/* ============================================
   Jolly Grid — Home (v4)
   Dark 3D stage → bright product tiles → pinned "build a sheet" → people → FAQ → finale.
   ============================================ */

.home-page {
    --ink: #0e1b2c;
    --ink-2: #16263b;
    --sky: #4ea8e6;
    --blue: #1f6fb2;
    --sun: #ffc940;
    --coral: #ff6b4a;
    --mint: #3dd6b5;
    --f-sky: #d6eafb;
    --f-sun: #ffe9a8;
    --f-mint: #cdf4ea;
    --f-coral: #ffdcd1;
    --display: 'Plus Jakarta Sans', var(--font-display);
    /* Stage (hero + finale) follows the site theme */
    --stage-bg: #f3f8fd;
    --stage-glow-1: rgba(78, 168, 230, 0.28);
    --stage-glow-2: rgba(255, 201, 64, 0.22);
    --stage-fg: #0e1b2c;
    --stage-muted: #3b4a58;
    --stage-grid: rgba(31, 111, 178, 0.07);
    --stage-scrim: rgba(243, 248, 253, 0.85);
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --r-tile: 28px;
    --paper-shadow: 0 1px 2px rgba(14, 27, 44, 0.1), 0 18px 40px -14px rgba(14, 27, 44, 0.35);
}

[data-theme="dark"] .home-page {
    --stage-bg: #0e1b2c;
    --stage-glow-1: #1b3552;
    --stage-glow-2: rgba(255, 107, 74, 0.18);
    --stage-fg: #ffffff;
    --stage-muted: rgba(255, 255, 255, 0.78);
    --stage-grid: rgba(255, 255, 255, 0.045);
    --stage-scrim: rgba(14, 27, 44, 0.75);
    --f-sky: #16304a;
    --f-sun: #3a3218;
    --f-mint: #123a33;
    --f-coral: #3d2019;
}

.home-page main .container {
    max-width: 1240px;
}

.home-page main {
    overflow-x: clip;
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.home-page main h2 {
    font-family: var(--display);
    font-size: clamp(2.2rem, 4.4vw, 3.6rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.05;
    margin: 0;
}

.head {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
    align-items: end;
    gap: 1.25rem 3rem;
    margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.head p {
    margin: 0;
    font-size: 1.15rem;
    line-height: 1.6;
    color: var(--text-secondary);
    max-width: 38ch;
}

/* ---------- 1. Stage ---------- */
.stage {
    position: relative;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    align-items: center;
    overflow: hidden;
    color: var(--stage-fg);
    background:
        radial-gradient(80% 70% at 70% 35%, var(--stage-glow-1) 0%, transparent 70%),
        radial-gradient(50% 50% at 15% 90%, var(--stage-glow-2), transparent 70%),
        var(--stage-bg);
    isolation: isolate;
}

.stage::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(var(--stage-grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--stage-grid) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(90% 80% at 60% 40%, #000 30%, transparent 85%);
}

.stage__inner::before {
    content: '';
    position: absolute;
    inset: -35% 40% -35% -100vw;
    z-index: -1;
    background: radial-gradient(closest-side, var(--stage-scrim), transparent);
    pointer-events: none;
}

.stage__canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0;
    transition: opacity 1.2s ease;
}

.stage.has-3d .stage__canvas {
    opacity: 1;
}

.stage__fallback {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

/* The flat sheets only show without JS or when the 3D scene can't run (home.js adds .no-3d). */
.js .stage:not(.no-3d) .stage__fallback,
.stage.has-3d .stage__fallback {
    display: none;
}

.fb {
    position: absolute;
    width: clamp(160px, 17vw, 260px);
    height: auto;
    border-radius: 4px;
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.6);
}

.fb--a { right: 30%; top: 18%; transform: rotate(-12deg); }
.fb--b { right: 14%; top: 10%; transform: rotate(6deg); }
.fb--c { right: 4%; top: 34%; transform: rotate(16deg); }

.stage__inner {
    position: relative;
    z-index: 1;
    width: 100%;
    padding-top: calc(var(--header-height) + 2rem);
    padding-bottom: clamp(4rem, 9vh, 6rem);
    pointer-events: none;
}

.stage__inner a {
    pointer-events: auto;
}

.stage__title {
    font-family: var(--display);
    font-size: clamp(2.6rem, 5.4vw, 5rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.04em;
    color: var(--stage-fg);
    /* 8em keeps the break at "Make free / worksheets and / coloring pages" in every font renderer */
    max-width: 8em;
    text-wrap: balance;
    margin: 0 0 clamp(2rem, 5vh, 3.5rem);
}

.stage__foot {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.75rem;
    max-width: 580px;
}

.stage__jump {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 0.5rem;
    padding-top: 1.4rem;
    width: 100%;
    border-top: 1px solid color-mix(in srgb, var(--stage-fg) 12%, transparent);
    font-size: 0.9rem;
}

.stage__jump span {
    margin-right: 4px;
    color: var(--stage-muted);
}

.stage__jump a {
    padding: 6px 11px;
    border-radius: 999px;
    color: var(--stage-fg);
    background: color-mix(in srgb, var(--stage-fg) 5%, transparent);
    border: 1px solid color-mix(in srgb, var(--stage-fg) 10%, transparent);
    font-weight: 500;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.stage__jump a:hover {
    text-decoration: none;
    color: var(--stage-fg);
    background: color-mix(in srgb, var(--stage-fg) 10%, transparent);
    border-color: color-mix(in srgb, var(--stage-fg) 22%, transparent);
}

/* Grid lines pick up colour around the cursor. home.js sizes this layer to the open area beside the copy,
   so the colour never runs under the headline, the buttons or the header. Same 56px grid as .stage::after. */
.stage__glow {
    display: none;
}

@supports (mask-composite: intersect) {
    .stage__glow {
        display: block;
        position: absolute;
        left: 0;
        top: 0;
        width: 0;
        height: 0;
        z-index: -1;
        pointer-events: none;
        opacity: 0;
        transition: opacity 0.6s ease;
        background: conic-gradient(from var(--gh, 0deg) at var(--mx, 50%) var(--my, 50%),
            #4ea8e6, #3dd6b5, #ffc940, #ff6b4a, #4ea8e6);
        /* soft edges ∩ spotlight ∩ (horizontal ∪ vertical lines) */
        mask-image:
            linear-gradient(90deg, transparent, #000 96px, #000 calc(100% - 96px), transparent),
            linear-gradient(transparent, #000 72px, #000 calc(100% - 72px), transparent),
            radial-gradient(circle 280px at var(--mx, 50%) var(--my, 50%), #000, transparent 72%),
            linear-gradient(#000 1.5px, transparent 1.5px),
            linear-gradient(90deg, #000 1.5px, transparent 1.5px);
        mask-size: 100% 100%, 100% 100%, 100% 100%, 56px 56px, 56px 56px;
        mask-position: 0 0, 0 0, 0 0, var(--ox, 0) var(--oy, 0), var(--ox, 0) var(--oy, 0);
        mask-repeat: no-repeat, no-repeat, no-repeat, repeat, repeat;
        mask-composite: intersect, intersect, intersect, add, add;
    }
}

.stage__glow.is-on {
    opacity: 0.75;
}

[data-theme="dark"] .stage__glow.is-on {
    opacity: 0.6;
}

.stage__hint {
    position: absolute;
    right: clamp(1rem, 3vw, 2.5rem);
    bottom: clamp(1rem, 3vh, 2rem);
    z-index: 2;
    margin: 0;
    padding: 8px 14px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--stage-fg) 6%, transparent);
    color: var(--stage-muted);
    font-size: 0.85rem;
    pointer-events: none;
    opacity: 0;
    translate: 0 8px;
    transition: opacity 0.5s ease, translate 0.5s var(--ease);
}

.stage__hint.is-on {
    opacity: 1;
    translate: 0 0;
}

.stage:not(.has-3d) .stage__hint {
    display: none;
}

.stage__lede {
    margin: 0;
    max-width: 44ch;
    font-size: clamp(1.05rem, 1.3vw, 1.2rem);
    line-height: 1.6;
    color: var(--stage-muted);
}

.stage__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}


/* Header floats over the dark stage */
.home-page .modern-header {
    transition: background-color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

.home-page:not(.is-scrolled) .modern-header {
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
}

[data-theme="dark"] .home-page:not(.is-scrolled) .modern-header .logo-text,
[data-theme="dark"] .home-page:not(.is-scrolled) .modern-header .nav-link,
[data-theme="dark"] .home-page:not(.is-scrolled) .modern-header .theme-icon,
[data-theme="dark"] .home-page:not(.is-scrolled) .modern-header .btn-login {
    color: #fff !important;
}

[data-theme="dark"] .home-page:not(.is-scrolled) .modern-header .btn-login {
    border-color: rgba(255, 255, 255, 0.35);
}

[data-theme="dark"] .home-page:not(.is-scrolled) .modern-header .toggle-bar {
    background: #fff;
}

/* ---------- 2. Bento ---------- */
.bento-wrap {
    overflow: clip;
    padding: clamp(5rem, 10vw, 8.5rem) 0 clamp(4rem, 8vw, 6rem);
}

.bento {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-auto-rows: minmax(0, auto);
    gap: 18px;
}

.tile {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 340px;
    padding: clamp(1.5rem, 2.4vw, 2.1rem);
    border-radius: var(--r-tile);
    overflow: hidden;
    color: var(--text-primary);
    isolation: isolate;
}

a.tile:hover {
    text-decoration: none;
    color: var(--text-primary);
}

.tile h3 {
    font-family: var(--display);
    font-size: clamp(1.5rem, 2.2vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.05;
    margin-bottom: 0.6rem;
}

.tile__text p {
    margin: 0;
    max-width: 34ch;
    color: var(--text-secondary);
    line-height: 1.55;
}

.tile--sheets { grid-column: span 7; grid-row: span 2; background: var(--f-sky); min-height: 640px; }
.tile--mandala { grid-column: span 5; background: var(--f-coral); }
.tile--timer { grid-column: span 5; background: var(--ink); color: #fff; }
.tile--board { grid-column: span 4; background: var(--f-mint); }
.tile--print { grid-column: span 4; background: var(--f-sun); }
.tile--files { grid-column: span 4; background: var(--bg-card); border: 1px solid var(--border-light); }

a.tile--timer:hover { color: #fff; }
.tile--timer h3 { color: #fff; }
.tile--timer .tile__text p { color: rgba(255, 255, 255, 0.7); }

/* Fanned sheets */
.tile__art--fan {
    position: relative;
    flex: 1;
    margin-top: 1.5rem;
}

.fan {
    position: absolute;
    bottom: -8%;
    left: 50%;
    width: 46%;
    height: auto;
    border-radius: 4px;
    box-shadow: var(--paper-shadow);
    transition: transform 0.7s var(--ease);
}

.fan--1 { transform: translateX(-108%) rotate(-10deg); }
.fan--2 { transform: translateX(-50%) translateY(-6%); z-index: 1; }
.fan--3 { transform: translateX(8%) rotate(10deg); }

.tile--sheets:hover .fan--1 { transform: translateX(-118%) translateY(-4%) rotate(-14deg); }
.tile--sheets:hover .fan--2 { transform: translateX(-50%) translateY(-12%); }
.tile--sheets:hover .fan--3 { transform: translateX(18%) translateY(-4%) rotate(14deg); }

/* Mandala */
.tile__mandala {
    position: absolute;
    right: -14%;
    bottom: -22%;
    z-index: -1;
    width: 72%;
    height: auto;
    border-radius: 50%;
    background: #fff;
    box-shadow: var(--paper-shadow);
    transition: transform 1.6s var(--ease);
}

.tile--mandala:hover .tile__mandala {
    transform: rotate(45deg) scale(1.04);
}

.tile--mandala .tile__text p {
    max-width: 20ch;
}

/* Timer */
.qt {
    position: absolute;
    right: 8%;
    bottom: 10%;
    width: 46%;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
}

.qt svg {
    position: absolute;
    inset: 0;
    transform: rotate(-90deg);
}

.qt__track,
.qt__ring {
    fill: none;
    stroke-width: 7;
}

.qt__track {
    stroke: rgba(255, 255, 255, 0.1);
}

.qt__ring {
    stroke: var(--mint);
    stroke-linecap: round;
    stroke-dasharray: 327;
    stroke-dashoffset: 0;
}

.qt__time {
    font-family: var(--display);
    font-size: clamp(2rem, 3.6vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}

.tile--timer .tile__text p {
    max-width: 22ch;
}

/* Whiteboard */
.wb {
    position: relative;
    flex: 1;
    margin-top: 1.25rem;
    border-radius: 16px;
    background: #fff radial-gradient(#d9e2ea 1px, transparent 1px) 0 0 / 16px 16px;
    box-shadow: var(--paper-shadow);
}

.wb__note {
    position: absolute;
    padding: 10px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1.4;
    color: #16232f;
    box-shadow: 0 6px 14px -6px rgba(14, 27, 44, 0.35);
    transition: transform 0.6s var(--ease);
}

.wb__note--y { left: 10%; top: 14%; background: #fff1b8; transform: rotate(-4deg); }
.wb__note--m { right: 10%; top: 26%; background: #cff3e6; transform: rotate(3deg); }

.tile--board:hover .wb__note--y { transform: rotate(-8deg) translateY(-4px); }
.tile--board:hover .wb__note--m { transform: rotate(6deg) translateY(-4px); }

.wb__ink {
    position: absolute;
    left: 10%;
    bottom: 12%;
    width: 62%;
}

.wb__ink path {
    fill: none;
    stroke: var(--blue);
    stroke-width: 3.5;
    stroke-linecap: round;
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
    transition: stroke-dashoffset 1.4s var(--ease);
}

.tile--board.is-in .wb__ink path,
.tile--board:hover .wb__ink path {
    stroke-dashoffset: 0;
}

/* Printables stack */
.tile__art--stack {
    position: relative;
    flex: 1;
    margin-top: 1rem;
}

.stack {
    position: absolute;
    bottom: -30%;
    width: 52%;
    height: auto;
    border-radius: 4px;
    box-shadow: var(--paper-shadow);
    transition: transform 0.7s var(--ease);
}

.stack--1 { left: 6%; transform: rotate(-6deg); }
.stack--2 { right: 6%; transform: rotate(5deg); }

.tile--print:hover .stack--1 { transform: rotate(-9deg) translateY(-8%); }
.tile--print:hover .stack--2 { transform: rotate(8deg) translateY(-10%); }

/* Files list */
.tile--files ul {
    list-style: none;
    margin: 0.75rem 0 auto;
    padding: 0;
}

.tile--files li {
    border-bottom: 1px solid var(--border-light);
}

.tile--files li a {
    display: flex;
    justify-content: space-between;
    padding: 0.6rem 0;
    color: var(--text-primary);
    font-weight: 500;
}

.tile--files li a::after {
    content: '↗';
    color: var(--text-muted);
    transition: transform 0.25s var(--ease);
}

.tile--files li a:hover {
    text-decoration: none;
    color: var(--blue);
}

.tile--files li a:hover::after {
    transform: translate(2px, -2px);
    color: var(--blue);
}

.tile__all {
    margin-top: 1.25rem;
    font-weight: 600;
}

/* ---------- 3. Build ----------
   Default (no JS, reduced motion, phones): the finished sheet, every step readable.
   On desktop home.js pins the section and sets .build[data-step] while scrubbing. */
.build {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
}

.build__pin {
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    align-items: center;
    padding: calc(var(--header-height) + 1.5rem) 0 2.5rem;
}

.build__inner {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    grid-template-areas:
        "title title"
        "steps desk";
    align-items: center;
    gap: clamp(1.75rem, 3.5vw, 2.5rem) clamp(2.5rem, 6vw, 5.5rem);
}

.build__title {
    grid-area: title;
    margin: 0 !important;
    font-size: clamp(2.2rem, 1.4rem + 3vw, 3.6rem);
}

/* Steps */
.steps {
    grid-area: steps;
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: none;
}

.steps__item {
    position: relative;
    display: flex;
    gap: 1.1rem;
    padding: 1.25rem 0 1.25rem 1.25rem;
    border-top: 1px solid var(--border-light);
    transition: color 0.3s ease;
}

.steps__item:last-child {
    border-bottom: 1px solid var(--border-light);
}

.steps__item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 1.25rem;
    bottom: 1.25rem;
    width: 3px;
    border-radius: 3px;
    background: var(--brand-primary);
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.35s ease;
}

.steps__item > span {
    flex: none;
    display: grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: var(--brand-primary-strong);
    color: #fff;
    font-weight: 700;
    transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

.steps__item h3 {
    font-family: var(--display);
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0.2rem 0 0.25rem;
    color: var(--text-primary);
}

.steps__item p {
    margin: 0;
    max-width: 38ch;
    color: var(--text-secondary);
}

/* While scrubbing: the current step is marked, the others are quieter but still readable */
.build[data-step] .steps__item > span {
    background: transparent;
    color: var(--text-secondary);
    box-shadow: inset 0 0 0 2px var(--border-strong);
}

.build[data-step] .steps__item h3 {
    color: var(--text-secondary);
}

.build[data-step] .steps__item.is-active::before {
    transform: scaleY(1);
}

.build[data-step] .steps__item.is-active > span {
    background: var(--brand-primary-strong);
    color: #fff;
    box-shadow: none;
}

.build[data-step] .steps__item.is-active h3 {
    color: var(--text-primary);
}

/* Desk: a graph-paper panel so the sheet sits on something */
.build__desk {
    grid-area: desk;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 22px;
    padding: clamp(1.5rem, 3vw, 2.25rem) clamp(1.5rem, 3vw, 2.5rem) clamp(2rem, 3.5vw, 2.75rem);
    border: 1px solid var(--border-light);
    border-radius: 24px;
    background:
        linear-gradient(var(--jg-rule) 1px, transparent 1px) 0 0 / 24px 24px,
        linear-gradient(90deg, var(--jg-rule) 1px, transparent 1px) 0 0 / 24px 24px,
        var(--bg-primary);
}

.bopts {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    padding: 6px;
    border-radius: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    box-shadow: 0 12px 30px -18px rgba(14, 27, 44, 0.4);
}

.bopt {
    display: grid;
    place-items: center;
    min-width: 44px;
    height: 40px;
    padding: 0 12px;
    border-radius: 10px;
    font-weight: 700;
    color: var(--text-secondary);
    transition: background-color 0.25s ease, color 0.25s ease;
}

.bopt--gap {
    margin-left: 10px;
}

.bopt--print {
    display: inline-flex;
    gap: 8px;
    margin-left: 10px;
}

.bopt[data-on] {
    background: var(--text-primary);
    color: var(--bg-primary);
}

.bopt--print[data-on] {
    background: var(--brand-primary-strong);
    color: #fff;
}

.build[data-step="0"] .bopt[data-on],
.build[data-step="1"] .bopt[data-on="2"] {
    background: transparent;
    color: var(--text-secondary);
}

/* Sheet: drawn like the real math worksheet output, with its answer key printed behind it */
.bstack {
    --ink: #16232f;
    --ink-soft: #5b6b7a;
    --rule: #8d9aa6;
    position: relative;
    width: min(86%, 380px);
    margin-top: 6%;
    /* recentre: the key sheet sticks out on the right */
    transform: translateX(-7%);
}

/* Pinned on desktop: size the sheet from the viewport height so the whole block fits on screen */
@media (min-width: 1101px) {
    .bstack {
        width: min(86%, 380px, max(250px, calc((100svh - 420px) * 0.77)));
    }
}

.bsheet {
    position: relative;
    aspect-ratio: 8.5 / 11;
    display: flex;
    flex-direction: column;
    padding: 8% 8% 5%;
    background: #fff;
    color: var(--ink);
    border-radius: 3px;
    box-shadow: var(--paper-shadow);
    /* Text scales with the sheet (cqi), so it reads the same at every size */
    container-type: inline-size;
}

.bsheet--key {
    position: absolute;
    inset: 0;
    transform: translate(15%, -6%) rotate(-2.5deg);
    box-shadow: 0 1px 2px rgba(14, 27, 44, 0.08), 0 10px 26px -14px rgba(14, 27, 44, 0.3);
}

.bsheet__head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 3cqi;
    padding-bottom: 3cqi;
    border-bottom: 0.6cqi solid var(--ink);
}

.bsheet__logo {
    width: 8cqi;
    height: 8cqi;
    border-radius: 1.8cqi;
}

.bsheet__title {
    font-family: var(--display);
    font-weight: 800;
    font-size: 1.1rem;
    font-size: 5cqi;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.bsheet__fields {
    display: grid;
    grid-template-columns: repeat(2, auto);
    gap: 1.6cqi 3cqi;
    font-size: 2.6cqi;
    color: var(--ink-soft);
}

.bsheet__fields > span {
    display: flex;
    align-items: flex-end;
    gap: 1cqi;
}

.bsheet__fields > span:first-child {
    grid-column: span 2;
}

.bsheet__fields i {
    flex: 1;
    min-width: 7cqi;
    border-bottom: 1px solid var(--rule);
}

.bsheet--key .bsheet__head {
    border-color: transparent;
}

.bsheet--key .bsheet__head > :not(.bsheet__key) {
    visibility: hidden;
}

/* On the key the answers carry the ink; the problems step back */
.bsheet--key .bsheet__grid li > span {
    color: var(--rule);
    border-color: #c5ced6;
}

/* Sits in the strip of the key that shows above the front sheet */
.bsheet__key {
    position: absolute;
    top: 2.6cqi;
    right: 7cqi;
    padding: 0.8cqi 2cqi;
    border: 0.4cqi solid currentColor;
    border-radius: 1.4cqi;
    font-size: 2.8cqi;
    font-weight: 700;
    color: #c0392b;
    white-space: nowrap;
}

.bsheet__grid {
    list-style: none;
    margin: 0;
    padding: 4cqi 0 0;
    flex: 1;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-content: space-evenly;
    column-gap: 5cqi;
    font-family: ui-monospace, 'SF Mono', Menlo, 'Roboto Mono', Consolas, monospace;
    font-size: 1.1rem;
    font-size: 5cqi;
    line-height: 1.25;
    font-variant-numeric: tabular-nums;
}

.bsheet__grid li {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    padding-bottom: 1.4em;
}

.bsheet__grid li > span:nth-child(2) {
    align-self: stretch;
    text-align: right;
    padding-bottom: 0.15em;
    border-bottom: 0.5cqi solid var(--ink);
}

.bsheet__grid b {
    position: absolute;
    right: 0;
    bottom: 0.1em;
    font-weight: 700;
    color: #c0392b;
}

.bsheet__foot {
    align-self: center;
    font-size: 2.4cqi;
    color: var(--rule);
}

/* ---------- 4. People ---------- */
.people {
    padding: clamp(5rem, 10vw, 8rem) 0 clamp(2rem, 4vw, 3rem);
}

.people__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.person {
    display: flex;
    flex-direction: column;
    min-height: 360px;
    padding: clamp(1.75rem, 2.6vw, 2.4rem);
    border-radius: var(--r-tile);
    color: var(--text-primary);
    transition: transform 0.6s var(--ease);
}

.person:hover {
    text-decoration: none;
    color: var(--text-primary);
}

.person--sky { background: var(--f-sky); }
.person--sun { background: var(--f-sun); }
.person--mint { background: var(--f-mint); }

.person h3 {
    font-family: var(--display);
    font-size: clamp(2.4rem, 4vw, 3.4rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
    margin-bottom: auto;
}

.person p {
    margin: 2rem 0 1.25rem;
    font-size: 1.05rem;
    line-height: 1.55;
    color: var(--text-secondary);
}

.person > span {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.person > span::after {
    content: '→';
    transition: transform 0.3s var(--ease);
}

.person:hover > span::after {
    transform: translateX(4px);
}

/* ---------- Local print shop ---------- */
.shop-local {
    padding: clamp(4rem, 8vw, 6rem) 0;
}

.shop-local__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: clamp(2.5rem, 6vw, 5rem);
    padding: clamp(2rem, 4vw, 3.5rem);
    border-radius: var(--r-tile);
    background: var(--f-coral);
}

.shop-local__copy p {
    margin: 1.25rem 0 2rem;
    max-width: 46ch;
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-secondary);
}


.shop-local__art {
    position: relative;
    height: 320px;
}

.sticker {
    position: absolute;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #fff;
    border: 6px solid #fff;
    box-shadow: 0 14px 30px -12px rgba(14, 27, 44, 0.45);
    font-family: var(--display);
    font-weight: 800;
    color: #0e1b2c;
    transition: transform 0.5s var(--ease);
}

.sticker img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.sticker--a { width: 150px; height: 150px; left: 4%; top: 6%; transform: rotate(-10deg); }
.sticker--b { width: 140px; height: 140px; left: 34%; top: 48%; background: var(--sun); border-color: #fff; font-size: 1.1rem; transform: rotate(8deg); }
.sticker--c { width: 96px; height: 96px; left: 12%; bottom: 0; background: var(--mint); font-size: 2.6rem; color: #fff; transform: rotate(-4deg); }

.bizcard {
    position: absolute;
    right: 2%;
    top: 14%;
    width: 250px;
    aspect-ratio: 3.5 / 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 18px 20px;
    border-radius: 10px;
    background: #0e1b2c;
    color: #fff;
    box-shadow: 0 22px 40px -16px rgba(14, 27, 44, 0.6);
    transform: rotate(6deg);
    transition: transform 0.5s var(--ease);
}

.bizcard strong {
    font-family: var(--display);
    font-size: 1.2rem;
}

.bizcard span {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

.bizcard img {
    position: absolute;
    top: 16px;
    right: 16px;
    border-radius: 8px;
}

.shop-local__inner:hover .sticker--a { transform: rotate(-16deg) translateY(-6px); }
.shop-local__inner:hover .sticker--b { transform: rotate(14deg) translateY(-6px); }
.shop-local__inner:hover .bizcard { transform: rotate(2deg) translateY(-8px); }

/* ---------- 5. FAQ ---------- */
.faq {
    padding: clamp(4rem, 8vw, 6.5rem) 0;
}

.faq__inner {
    display: grid;
    grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr);
    gap: 2rem 4rem;
}

.faq__list details {
    border-bottom: 1px solid var(--border-light);
}

.faq__list details:first-child {
    border-top: 1px solid var(--border-light);
}

.faq__list summary {
    position: relative;
    list-style: none;
    padding: 1.5rem 3rem 1.5rem 0;
    font-family: var(--display);
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: -0.015em;
    color: var(--text-primary);
    cursor: pointer;
}

.faq__list summary::-webkit-details-marker {
    display: none;
}

.faq__list summary::before,
.faq__list summary::after {
    content: '';
    position: absolute;
    right: 0.4rem;
    top: 50%;
    width: 16px;
    height: 2px;
    background: var(--text-primary);
    transition: transform 0.35s var(--ease);
}

.faq__list summary::after {
    transform: rotate(90deg);
}

.faq__list details[open] summary::after {
    transform: rotate(0deg);
}

.faq__list details p {
    margin: -0.4rem 0 1.5rem;
    max-width: 62ch;
    line-height: 1.65;
    color: var(--text-secondary);
}

/* ---------- 6. Finale ---------- */
.finale {
    position: relative;
    overflow: hidden;
    padding: clamp(6rem, 14vw, 11rem) 0;
    background:
        radial-gradient(60% 80% at 80% 20%, var(--stage-glow-1), transparent 70%),
        radial-gradient(50% 70% at 10% 100%, var(--stage-glow-2), transparent 70%),
        var(--stage-bg);
    color: var(--stage-fg);
}

.home-page main .finale__title {
    font-size: clamp(3rem, 8vw, 7.4rem);
    font-weight: 800;
    line-height: 0.95;
    letter-spacing: -0.03em;
    color: var(--stage-fg);
    max-width: 11ch;
    margin-bottom: clamp(2rem, 4vw, 3rem);
}

.finale__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* ---------- Motion base ---------- */
.js .stage__title,
.js .stage__foot {
    opacity: 0;
    animation: failsafe 0s 3s forwards;
}

.line-mask {
    padding-bottom: 0.06em;
    margin-bottom: -0.06em;
}

@keyframes failsafe {
    to { opacity: 1; }
}


/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .stage__foot { max-width: 480px; }

    .tile--sheets { grid-column: span 12; grid-row: auto; min-height: 520px; }
    .tile--mandala,
    .tile--timer { grid-column: span 6; }
    .tile--board,
    .tile--print,
    .tile--files { grid-column: span 6; }
    .tile--files { grid-column: span 12; }

    .build__inner {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "title"
            "steps"
            "desk";
    }

    .build__pin {
        min-height: 0;
        padding: clamp(4rem, 8vw, 6rem) 0;
    }

    .faq__inner,
    .shop-local__inner {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 768px) {
    .head {
        grid-template-columns: minmax(0, 1fr);
    }

    .tile--mandala,
    .tile--timer,
    .tile--board,
    .tile--print {
        grid-column: span 12;
    }

    .tile--sheets { min-height: 440px; }

    .people__grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .person {
        min-height: 0;
    }
}

/* Stacked hero (phones, portrait tablets): the scene takes the top, the copy sits under it.
   Keep in sync with STACKED in home.js. */
@media (max-width: 899px), (max-aspect-ratio: 4/5) {
    .stage {
        align-items: flex-end;
    }

    .stage__inner {
        padding-top: max(46svh, 300px);
        padding-bottom: 2.5rem;
    }

    .stage__inner::before {
        inset: 30% -20% -10% -20%;
        background: linear-gradient(to bottom, transparent, var(--stage-scrim) 35%);
    }

    .stage__title {
        font-size: clamp(2.3rem, 7.5vw, 4.25rem);
        margin-bottom: 1.5rem;
    }

    .stage__foot {
        max-width: 580px;
    }

    .stage__hint {
        left: 50%;
        right: auto;
        top: calc(var(--header-height) + 8px);
        bottom: auto;
        translate: -50% 8px;
        white-space: nowrap;
    }

    .stage__hint.is-on {
        translate: -50% 0;
    }

    .fb { width: clamp(120px, 26vw, 230px); }
    .fb--a { right: auto; left: 16%; top: calc(var(--header-height) + 7svh); }
    .fb--b { right: 16%; top: calc(var(--header-height) + 4svh); }
    .fb--c { display: none; }
}

@media (max-width: 576px) {
    .stage__actions,
    .finale__actions {
        width: 100%;
    }

    .stage__actions .pill,
    .finale__actions .pill {
        flex: 1 1 100%;
    }

    .stage__title {
        font-size: clamp(2.3rem, 10.5vw, 3rem);
        margin-bottom: 1.25rem;
    }

    /* Keep the tool bar on one line: tighter keys, icon-only Print */
    .bopts { flex-wrap: nowrap; gap: 4px; }
    .bopt { min-width: 36px; height: 36px; padding: 0 9px; }
    .bopt--gap,
    .bopt--print { margin-left: 6px; }
    .bopt--print > span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
    }

    .shop-local__art {
        height: 260px;
    }

    .bizcard {
        width: 190px;
    }

    .sticker--a { width: 110px; height: 110px; }
    .sticker--b { width: 108px; height: 108px; font-size: 0.9rem; }
}

@media (prefers-reduced-motion: reduce) {
    .home-page *,
    .home-page *::before,
    .home-page *::after {
        animation: none !important;
        transition: none !important;
    }

    .js .stage__title,
    .js .stage__foot {
        opacity: 1;
    }

    .wb__ink path {
        stroke-dashoffset: 0;
    }
}
