/* Nakshatra site. Tokens from projects/astro/DESIGN.md.
   Light theme = "Panchang Patra" (HEAD DESIGN.md): paper #F4EBDA, ink #1C1712 (15.0:1),
   almanac red #C23417 for labels and links (4.67:1 on paper, 4.87:1 on rail), deep marigold
   #8A5A12 for readable gold (5.0:1); marigold #E89B0C is 1.9:1 on paper, so marks and rules only.
   Dark theme = the shipped "Jantar Mantar Night" palette (DESIGN.md at 70c212e3): night #0D1230,
   surface #171D42, ivory #F1E8D2 (15.0:1), gold #D9A441 links (8.15:1), slate #8B98C2 (6.43:1).
   The Play screenshots show the shipped night UI in both themes (1 px frame).
   Fonts: Khand 600 (display) and Palanquin 400/600 (text), static weights, Latin subsets. */

@font-face {
    font-family: "Khand";
    src: url("/astro/fonts/khand-600.woff2") format("woff2");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Palanquin";
    src: url("/astro/fonts/palanquin-400.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Palanquin";
    src: url("/astro/fonts/palanquin-600.woff2") format("woff2");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

:root {
    color-scheme: light dark;
    --bg: #F4EBDA;          /* paper */
    --card: #F7F0E1;        /* rail */
    --under: #E9DFCB;       /* under-band */
    --ink: #1C1712;
    --muted: #58524A;       /* ink at 72 % on paper, 6.5:1 */
    --rule: rgba(28, 23, 18, 0.6);
    --hairline: rgba(28, 23, 18, 0.22);
    --link: #C23417;        /* almanac red */
    --label: #C23417;
    --gold-text: #8A5A12;   /* deep marigold */
    --mark: #E89B0C;        /* marigold: marks only */
    --on-link: #F7F0E1;
    --shot-edge: rgba(28, 23, 18, 0.7);
    --display: "Khand", "Arial Narrow", system-ui, sans-serif;
    --body: "Palanquin", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0D1230;      /* night */
        --card: #171D42;    /* surface */
        --under: #1D254F;   /* surface2 */
        --ink: #F1E8D2;     /* ivory */
        --muted: #A9B4D8;   /* slate, lifted for body size: 8.9:1 */
        --rule: rgba(139, 152, 194, 0.6);
        --hairline: rgba(139, 152, 194, 0.28);
        --link: #D9A441;    /* gold */
        --label: #D9A441;
        --gold-text: #D9A441;
        --mark: #D9A441;
        --on-link: #0D1230;
        --shot-edge: rgba(139, 152, 194, 0.5);
    }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 400 1.0625rem/1.65 var(--body);
    overflow-wrap: anywhere;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--link); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 {
    font-family: var(--display);
    font-weight: 600;
    line-height: 1.12;
    margin: 0 0 0.5em;
}
h1 { font-size: clamp(2.3rem, 7vw, 3.9rem); letter-spacing: 0.005em; }
h2 { font-size: clamp(1.7rem, 4.4vw, 2.4rem); letter-spacing: 0.01em; }
h3 { font-size: 1.35rem; letter-spacing: 0.02em; }
p { margin: 0 0 1em; }
strong { font-weight: 600; }

.num { font-variant-numeric: tabular-nums; }

.wrap { max-width: 70rem; margin: 0 auto; padding: 0 1rem; }

.skip-link {
    position: absolute; left: 1rem; top: -4rem;
    background: var(--link); color: var(--on-link);
    padding: 0.75rem 1rem; border-radius: 6px; z-index: 10; font-weight: 600;
}
.skip-link:focus { top: 1rem; }

/* Header: the almanac's printed double rule beneath */
.topbar { border-bottom: 3px double var(--rule); }
.topbar .wrap {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: 0.25rem 1.5rem; padding-block: 0.5rem;
}
.brand {
    display: flex; align-items: center; gap: 0.6rem; min-height: 48px;
    color: var(--ink); text-decoration: none;
}
.brand img { border-radius: 10px; }
.wordmark { font-family: var(--display); font-weight: 600; font-size: 1.7rem; line-height: 1; letter-spacing: 0.03em; }
.site-nav ul { display: flex; flex-wrap: wrap; gap: 0 0.25rem; list-style: none; margin: 0; padding: 0; }
.site-nav a {
    display: inline-flex; align-items: center; min-height: 48px; padding: 0 0.75rem;
    color: var(--ink); font-weight: 600; text-decoration: none; border-radius: 6px;
}
.site-nav a:hover { background: var(--under); }
.site-nav a[aria-current="page"] { color: var(--label); text-decoration: underline; text-underline-offset: 0.3em; }
.site-nav a[aria-current="page"]:hover { background: transparent; }

/* Sections */
main { display: block; }
.section { padding: 2.75rem 0; }
.section + .section { border-top: 1px solid var(--hairline); }
.lede, .sub { font-size: 1.15rem; color: var(--muted); max-width: 40rem; }
.answer { font-size: 1.12rem; max-width: 43rem; }
.detail { max-width: 43rem; }
ul.detail, ol.detail { padding-left: 1.25rem; }
ul.detail li, ol.detail li { margin-bottom: 0.4rem; }

/* Red label above a heading, as the almanac's section labels */
.kicker {
    font-family: var(--display); font-weight: 600; font-size: 0.95rem;
    letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--label); margin: 0 0 0.35rem;
}
.kicker::before {
    content: ""; display: inline-block; width: 0.55rem; height: 0.55rem; margin-right: 0.5rem;
    border-radius: 50%; background: var(--mark); box-shadow: 0 0 0 1px var(--ink);
    vertical-align: 0.1em;
}

/* Hero */
.hero { padding: 2rem 0 2.75rem; }
.hero-grid { display: grid; gap: 2rem; align-items: center; }
@media (min-width: 56rem) { .hero-grid { grid-template-columns: 1fr 21rem; gap: 3rem; } }
.hero-grid > * { min-width: 0; }
.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; margin-top: 1.5rem; }
.cta-note { margin: 0; color: var(--muted); font-weight: 600; max-width: 22rem; }
.play-badge { display: inline-block; min-height: 48px; border-radius: 8px; }
.play-badge img { width: 188px; height: 56px; }

/* Screenshots: night UI, framed so it reads on paper and on night */
.phone { border: 1px solid var(--shot-edge); border-radius: 14px; background: #0D1230; }
.hero-shot { display: block; max-width: 21rem; margin: 0 auto; }

/* Entity paragraph: a plate between double rules */
.entity {
    border-top: 3px double var(--rule); border-bottom: 3px double var(--rule);
    padding: 1.25rem 0; max-width: 50rem; margin-top: 2.5rem;
}
.entity p { margin: 0; }

/* Cards */
.cards { display: grid; gap: 1rem; list-style: none; margin: 1.5rem 0 0; padding: 0; }
@media (min-width: 40rem) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 62rem) { .cards { grid-template-columns: repeat(3, 1fr); } }
.card {
    background: var(--card); color: var(--ink);
    border: 1px solid var(--hairline); border-radius: 10px; padding: 1.1rem 1.25rem;
}
.card h3 { margin-bottom: 0.3em; color: var(--label); }
.card p:last-child { margin: 0; }

/* Day plate: one worked panchang example, set like an almanac page */
.plate {
    background: var(--card); color: var(--ink);
    border: 1px solid var(--hairline); border-radius: 10px;
    padding: 1.25rem; max-width: 43rem; margin: 1.5rem 0;
}
.plate-title { font-family: var(--display); font-weight: 600; font-size: 1.3rem; margin: 0 0 0.25rem; }
.plate-note { color: var(--muted); font-size: 0.95rem; margin: 0 0 0.75rem; }
.plate dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(10.5rem, 100%), 1fr)); gap: 0.75rem 1.25rem; margin: 0; }
.plate dl > div { border-top: 1px solid var(--hairline); padding-top: 0.5rem; min-width: 0; }
.plate dt { color: var(--label); font-weight: 600; font-size: 0.95rem; }
.plate dd { margin: 0; font-family: var(--display); font-weight: 600; font-size: 1.3rem; line-height: 1.25; }

.split { display: grid; gap: 1.5rem; align-items: start; }
@media (min-width: 48rem) { .split { grid-template-columns: 1fr 15rem; gap: 2.5rem; } }
.split > * { min-width: 0; }
.split img { max-width: min(15rem, 100%); }

/* Gallery */
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; list-style: none; margin: 1.25rem 0 0; padding: 0; }
@media (min-width: 48rem) { .gallery { grid-template-columns: repeat(3, 1fr); max-width: 52rem; } }
.gallery > li { min-width: 0; }
.shot { margin: 0; }
.shot figcaption { font-size: 0.95rem; color: var(--muted); margin-top: 0.5rem; }

/* Question links */
.qlinks { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; max-width: 43rem; }
.qlinks a {
    display: flex; align-items: center; min-height: 48px; padding: 0.5rem 1rem;
    background: var(--under); color: var(--ink); border-radius: 6px;
    font-weight: 600; text-decoration: none;
}
.qlinks a:hover { text-decoration: underline; }
.toc { margin-top: 1.25rem; }

/* Breadcrumb */
.crumbs ol { display: flex; flex-wrap: wrap; list-style: none; margin: 0 0 1rem; padding: 0; color: var(--muted); font-size: 0.95rem; }
.crumbs li + li::before { content: "›"; padding: 0 0.5rem; }
.crumbs a { display: inline-block; padding: 0.75rem 0; }

/* Tables: stack into cards at 600 px and below */
table { border-collapse: collapse; width: 100%; max-width: 50rem; margin: 1rem 0 1.5rem; }
caption { display: block; text-align: left; font-weight: 600; margin-bottom: 0.5rem; }
th, td { text-align: left; vertical-align: top; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--hairline); }
th[scope="row"] { font-weight: 600; }
thead th { border-bottom: 3px double var(--rule); color: var(--label); }
@media (max-width: 37.5rem) {
    thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    tr { display: block; background: var(--card); color: var(--ink); border-radius: 10px; padding: 0.5rem 0.75rem; margin-bottom: 0.75rem; }
    th, td { display: block; border: 0; padding: 0.25rem 0; }
    td::before { content: attr(data-label) ": "; font-weight: 600; }
}

.faq section { padding: 1.5rem 0; border-top: 1px solid var(--hairline); }
.faq h2 { font-size: clamp(1.45rem, 3.6vw, 1.9rem); }

/* Closing band */
.band {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem;
    background: var(--card); color: var(--ink);
    border-top: 3px double var(--rule); border-bottom: 3px double var(--rule);
    padding: 1.5rem 1.25rem;
}
.band h2 { margin: 0; }

/* Footer */
.footer { border-top: 3px double var(--rule); padding: 2rem 0; margin-top: 1rem; font-size: 0.95rem; }
.footer-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.footer-top p { margin: 0; }
.footer-links { display: flex; flex-wrap: wrap; list-style: none; margin: 1rem 0; padding: 0; gap: 0 1rem; }
.footer-links a { display: inline-flex; align-items: center; min-height: 48px; }
.fine { color: var(--muted); }
.fine p { margin: 0 0 0.5rem; }
