/* ==========================================================================
   Gurukul — public landing page
   ========================================================================== */

@font-face {
    font-family: "Bricolage Grotesque";
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
    src: url("../fonts/bricolage/bricolage-latin-wght-normal.woff2") format("woff2");
}
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../fonts/inter/inter-latin-wght-normal.woff2") format("woff2");
}

:root {
    --ground: #fbfbfa;
    --surface: #ffffff;
    --ink: #121417;
    --ink-2: #2a2f37;
    --muted: #5b6472;
    --faint: #8b93a1;
    --line: #e6e7eb;
    --line-strong: #d3d6dd;
    --accent: #4338ca;
    --accent-soft: #eef0ff;
    --present: #047857; --present-bg: #d1fae5;
    --absent: #b91c1c;  --absent-bg: #fee2e2;
    --late: #b45309;    --late-bg: #fef3c7;
    --leave: #1d4ed8;   --leave-bg: #dbeafe;
    --display: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
    --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    --wrap: 1200px;
    --pad: clamp(20px, 4vw, 40px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
    margin: 0;
    color: var(--ink-2);
    background: var(--ground);
    font-family: var(--body);
    font-size: 17px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
figure { margin: 0; }
a { color: inherit; }
::selection { background: var(--accent-soft); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--pad)); margin: 0 auto; padding: 0 var(--pad); }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; padding: 8px 14px; border-radius: 8px; background: var(--ink); color: #fff; }
.skip:focus { left: 12px; }

/* ---------- Type ---------- */
h1, h2, h3 { margin: 0; color: var(--ink); font-family: var(--display); font-weight: 700; letter-spacing: -0.035em; }
h1 { font-size: clamp(46px, 7.2vw, 104px); line-height: 0.96; letter-spacing: -0.045em; }
h2 { font-size: clamp(34px, 4.6vw, 60px); line-height: 1.02; }
h3 { font-size: 24px; line-height: 1.2; letter-spacing: -0.02em; }
.lede { max-width: 36ch; margin: 0; color: var(--muted); font-size: clamp(18px, 1.6vw, 21px); line-height: 1.55; }
.eyebrow { margin: 0 0 18px; color: var(--accent); font-size: 15px; font-weight: 600; letter-spacing: -0.005em; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; gap: 10px;
    min-height: 48px; padding: 0 22px;
    border: 1px solid transparent; border-radius: 10px;
    font: 600 16px/1 var(--body); text-decoration: none; white-space: nowrap;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn-ink { color: #fff; background: var(--ink); }
.btn-ink:hover { background: #2a2f37; }
.btn-line { color: var(--ink); border-color: var(--line-strong); background: var(--surface); }
.btn-line:hover { border-color: var(--ink); }
.btn-light { color: var(--ink); background: #fff; }
.btn-light:hover { background: #e9eaee; }
.btn-ghost-light { color: #fff; border-color: rgba(255,255,255,.28); }
.btn-ghost-light:hover { border-color: #fff; }
.btn svg { width: 18px; height: 18px; flex: none; }

/* ---------- Header ---------- */
.site-head { position: sticky; top: 0; z-index: 50; background: rgba(251,251,250,.88); backdrop-filter: saturate(160%) blur(10px); border-bottom: 1px solid transparent; transition: border-color .2s ease; }
.site-head.is-scrolled { border-bottom-color: var(--line); }
.site-head .wrap { display: flex; align-items: center; gap: 32px; min-height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-family: var(--display); font-size: 23px; font-weight: 700; letter-spacing: -0.03em; }
.brand svg { width: 30px; height: 30px; flex: none; }
.site-nav { display: flex; gap: 28px; margin-left: auto; }
.site-nav a { color: var(--muted); font-size: 15px; font-weight: 500; text-decoration: none; }
.site-nav a:hover { color: var(--ink); }
.site-head .btn { min-height: 40px; padding: 0 16px; font-size: 15px; }
@media (max-width: 760px) { .site-nav { display: none; } .site-head .btn { margin-left: auto; } }

/* ---------- Hero ---------- */
.hero { padding: clamp(56px, 9vw, 120px) 0 0; }
.hero h1 { max-width: 13ch; }
.hero h1 .mark { color: var(--accent); }
.hero-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 28px 48px; margin-top: 36px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-shot { position: relative; margin-top: clamp(48px, 7vw, 88px); }
.hero-shot::before { /* the screenshot sits on a ruled band that runs into the next section */
    content: ""; position: absolute; left: 0; right: 0; top: 38%; bottom: 0; z-index: 0;
    background: var(--ink);
}
.hero-shot .wrap { position: relative; z-index: 1; }
.frame {
    overflow: hidden; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface);
    box-shadow: 0 1px 0 rgba(18,20,23,.04), 0 30px 60px -30px rgba(18,20,23,.35);
}
.frame-bar { display: flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-bottom: 1px solid var(--line); background: #f6f6f4; }
.frame-bar span { width: 10px; height: 10px; border-radius: 50%; background: #dcdde2; }
.frame-bar em { margin-left: 12px; color: var(--faint); font-size: 12.5px; font-style: normal; }
.hero-caption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 32px; padding: 18px 0 clamp(56px, 8vw, 96px); color: #aeb4bf; font-size: 14.5px; }
.hero-caption strong { color: #fff; font-weight: 600; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; }
.code { display: inline-grid; min-width: 24px; height: 22px; padding: 0 5px; place-items: center; border-radius: 6px; font-size: 12px; font-weight: 700; }
.code-p { color: var(--present); background: var(--present-bg); }
.code-a { color: var(--absent); background: var(--absent-bg); }
.code-l { color: var(--late); background: var(--late-bg); }
.code-lv { color: var(--leave); background: var(--leave-bg); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }

/* ---------- Modules index (ruled, like a register) ---------- */
.section { padding: clamp(72px, 10vw, 136px) 0; }
.section-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px 64px; align-items: end; margin-bottom: clamp(36px, 5vw, 64px); }
.section-head .lede { max-width: 44ch; }
@media (max-width: 860px) { .section-head { grid-template-columns: 1fr; } }

.ledger { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--ink); }
.ledger li { display: grid; grid-template-columns: 56px minmax(0, 15rem) minmax(0, 1fr); gap: 8px 32px; align-items: baseline; padding: 22px 0; border-bottom: 1px solid var(--line); }
.ledger .n { color: var(--faint); font-size: 14px; font-variant-numeric: tabular-nums; }
.ledger h3 { font-size: 22px; }
.ledger p { margin: 0; color: var(--muted); max-width: 58ch; }
@media (max-width: 700px) { .ledger li { grid-template-columns: 40px 1fr; } .ledger p { grid-column: 2; } }

/* ---------- A school year (sticky screenshot) ---------- */
.year { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.year-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 64px; }
.steps { margin: 0; padding: 0; list-style: none; }
.step { min-height: 72vh; padding: 12vh 0; border-top: 1px solid var(--line); }
.step:first-child { border-top: 0; padding-top: 4vh; }
.step .when { display: block; margin-bottom: 14px; color: var(--accent); font-size: 15px; font-weight: 600; }
.step h3 { font-size: clamp(28px, 3vw, 38px); line-height: 1.08; letter-spacing: -0.03em; }
.step p { margin: 16px 0 0; color: var(--muted); max-width: 42ch; }
.step ul { margin: 18px 0 0; padding: 0; list-style: none; color: var(--ink-2); font-size: 15.5px; }
.step li { position: relative; padding: 7px 0 7px 22px; border-bottom: 1px dashed var(--line); }
.step li::before { content: ""; position: absolute; left: 2px; top: 17px; width: 8px; height: 2px; background: var(--accent); }
.step-media { display: none; margin: 28px 0 0; }
.stage { position: sticky; top: 104px; height: calc(100vh - 140px); max-height: 760px; display: flex; align-items: center; }
.stage .frame { position: relative; width: 100%; }
.stage-imgs { position: relative; height: 320px; background: #f8fafc; transition: height .35s ease; }
.stage-imgs img { position: absolute; left: 0; top: 0; width: 100%; height: auto; opacity: 0; transition: opacity .45s ease; }
.stage-imgs img.is-on { opacity: 1; }
.stage-count { position: absolute; right: 14px; top: 8px; color: var(--faint); font-size: 12.5px; font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .stage-imgs, .stage-imgs img { transition: none; } }
@media (max-width: 960px) {
    .year-grid { grid-template-columns: 1fr; }
    .stage { display: none; }
    .step { min-height: 0; padding: 56px 0; }
    .step-media { display: block; }
}

/* ---------- Roles ---------- */
.roles-grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: 56px; align-items: start; }
.roles { width: 100%; border-collapse: collapse; }
.roles th, .roles td { padding: 18px 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.roles thead th { padding-top: 0; color: var(--faint); font-size: 13px; font-weight: 600; border-bottom: 1px solid var(--ink); }
.roles tbody th { width: 34%; padding-right: 20px; color: var(--ink); font-family: var(--display); font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.roles td { color: var(--muted); font-size: 16px; }
.roles-side { display: grid; gap: 28px; position: sticky; top: 104px; }
.roles-side figcaption { margin-top: 12px; color: var(--muted); font-size: 14.5px; }
.roles-side figcaption b { color: var(--ink); font-weight: 600; }
@media (max-width: 960px) { .roles-grid { grid-template-columns: 1fr; } .roles-side { position: static; } }

/* ---------- Security (dark) ---------- */
.dark { color: #c9ced6; background: var(--ink); }
.dark h2, .dark h3 { color: #fff; }
.dark .lede { color: #aeb4bf; }
.dark .eyebrow { color: #a5b4fc; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 64px; margin: 0; padding: 0; list-style: none; border-top: 1px solid rgba(255,255,255,.22); }
.facts li { display: grid; grid-template-columns: minmax(96px, auto) 1fr; gap: 24px; align-items: baseline; padding: 30px 0; border-bottom: 1px solid rgba(255,255,255,.12); }
.facts .big { color: #fff; font-family: var(--display); font-size: 52px; font-weight: 700; line-height: 1; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.facts h3 { font-size: 20px; }
.facts p { margin: 8px 0 0; color: #aeb4bf; font-size: 15.5px; }
@media (max-width: 860px) { .facts { grid-template-columns: 1fr; } }

/* ---------- Close & footer ---------- */
.close { padding: clamp(80px, 11vw, 150px) 0; }
.close h2 { max-width: 16ch; font-size: clamp(40px, 6vw, 84px); line-height: 0.98; letter-spacing: -0.045em; }
.close-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 32px; }
.close .hero-actions { margin-top: 0; }
.site-foot { padding: 28px 0 40px; border-top: 1px solid var(--line); color: var(--faint); font-size: 14px; }
.site-foot .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; }
.site-foot .brand { font-size: 18px; }
.site-foot .brand svg { width: 24px; height: 24px; }
.site-foot nav { display: flex; gap: 22px; margin-left: auto; }
.site-foot a { color: var(--muted); text-decoration: none; }
.site-foot a:hover { color: var(--ink); }
