/* ==========================================================================
   Yarnova design system
   Palette sampled directly from the app icon and App Store screenshots:
   amber #FFBB2C (icon ground / primary buttons), rose #C56698 (yarn skein),
   plum #681F37 (deep text accent), and the pastel chips used on pattern cards.
   ========================================================================== */

:root {
    /* Brand */
    --amber: #FFBB2C;
    --amber-deep: #F0A008;
    --amber-soft: #FFE9B8;
    --amber-wash: #FFF6E4;

    --rose: #C56698;
    --rose-deep: #A34A79;
    --rose-soft: #E8A7C3;
    --rose-wash: #FCEFF5;

    --plum: #681F37;

    /* Pastel accents, taken from the in-app icon chips */
    --mint: #CFE6DC;
    --lavender: #DCD6F2;
    --blush: #F8D6E4;
    --sand: #E4DACE;

    /* Surfaces: warm paper, never clinical white */
    --bg: #FDF9F3;
    --bg-alt: #F8F1E7;
    --surface: #FFFFFF;
    --surface-warm: #FFFCF6;

    /* Ink */
    --ink: #2A1D22;
    --ink-soft: #6B5B62;
    /* #7A6870 clears WCAG AA (4.5:1) on every background token; the
       previous #948289 was 3.2-3.6:1 and failed on all three. */
    --ink-faint: #7A6870;

    --line: rgba(42, 29, 34, 0.10);
    --line-soft: rgba(42, 29, 34, 0.06);

    --shadow-sm: 0 2px 8px rgba(104, 31, 55, 0.05), 0 8px 24px rgba(104, 31, 55, 0.04);
    --shadow-md: 0 4px 16px rgba(104, 31, 55, 0.07), 0 18px 44px rgba(104, 31, 55, 0.07);
    --shadow-lg: 0 8px 28px rgba(104, 31, 55, 0.09), 0 32px 72px rgba(104, 31, 55, 0.10);
    --shadow-amber: 0 8px 24px rgba(240, 160, 8, 0.28);

    /* The app uses very round corners: match it */
    --r-sm: 14px;
    --r-md: 22px;
    --r-lg: 32px;
    --r-xl: 44px;
    --r-pill: 999px;

    --container: 1180px;
    --gutter: clamp(20px, 5vw, 48px);
    --header-h: 76px;

    --font: "Baloo 2", ui-rounded, "SF Pro Rounded", "Segoe UI", system-ui, sans-serif;
    --font-body: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;

    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --t: 260ms var(--ease);
}

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

* { margin: 0; padding: 0; }

html {
    font-size: 16px;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 16px);
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--ink);
    line-height: 1.65;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
    font-family: var(--font);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -0.015em;
    color: var(--ink);
    text-wrap: balance;
}

p { text-wrap: pretty; }

a { color: inherit; text-decoration: none; }

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

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

ul { list-style: none; }

::selection { background: var(--amber-soft); color: var(--plum); }

/* Focus: visible on every interactive element, never removed */
:focus-visible {
    outline: 3px solid var(--rose);
    outline-offset: 3px;
    border-radius: 6px;
}

.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 999;
    padding: 14px 22px;
    background: var(--plum);
    color: #fff;
    border-radius: 0 0 var(--r-sm) 0;
    font-weight: 700;
}
.skip-link:focus { left: 0; }

/* ==========================================================================
   Type scale
   ========================================================================== */

.display {
    font-size: clamp(2.6rem, 6.4vw, 4.6rem);
    line-height: 1.04;
    letter-spacing: -0.03em;
}

.h2 {
    font-size: clamp(1.9rem, 3.9vw, 2.9rem);
    letter-spacing: -0.022em;
}

.h3 { font-size: clamp(1.2rem, 2vw, 1.45rem); }

.lede {
    font-size: clamp(1.05rem, 1.6vw, 1.22rem);
    color: var(--ink-soft);
    line-height: 1.7;
    max-width: 56ch;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font);
    font-weight: 600;
    font-size: 0.82rem;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--rose-deep);
}

.eyebrow::before {
    content: "";
    width: 22px;
    height: 2px;
    border-radius: 2px;
    background: var(--rose-soft);
}

.eyebrow-center { justify-content: center; }

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 52px;
    padding: 14px 28px;
    border-radius: var(--r-pill);
    font-family: var(--font);
    font-weight: 700;
    font-size: 1.02rem;
    text-align: center;
    transition: transform var(--t), box-shadow var(--t), background var(--t), color var(--t);
    will-change: transform;
}

.btn-primary {
    background: var(--amber);
    color: var(--plum);
    box-shadow: var(--shadow-amber);
}

.btn-primary:hover {
    background: var(--amber-deep);
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(240, 160, 8, 0.36);
}

.btn-ghost {
    background: var(--surface);
    color: var(--ink);
    border: 1.5px solid var(--line);
    box-shadow: var(--shadow-sm);
}

.btn-ghost:hover {
    border-color: var(--rose-soft);
    color: var(--rose-deep);
    transform: translateY(-2px);
}

.btn-lg { min-height: 58px; padding: 16px 34px; font-size: 1.08rem; }

/* App Store badge: drawn, not an image, so it stays crisp and weightless */
.appstore {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 11px 24px 11px 20px;
    border-radius: var(--r-pill);
    background: var(--ink);
    color: #fff;
    transition: transform var(--t), box-shadow var(--t);
    box-shadow: 0 8px 22px rgba(42, 29, 34, 0.26);
    min-height: 56px;
}

.appstore:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(42, 29, 34, 0.32); }

.appstore svg { flex: none; }

.appstore-text { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.appstore-text small { font-size: 0.66rem; opacity: 0.82; letter-spacing: 0.04em; }
.appstore-text strong { font-family: var(--font); font-size: 1.12rem; font-weight: 600; letter-spacing: -0.01em; }

/* ==========================================================================
   Navigation
   ========================================================================== */

.nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(253, 249, 243, 0.82);
    backdrop-filter: saturate(180%) blur(18px);
    -webkit-backdrop-filter: saturate(180%) blur(18px);
    border-bottom: 1px solid transparent;
    transition: border-color var(--t), background var(--t);
}

.nav.scrolled {
    border-bottom-color: var(--line-soft);
    background: rgba(253, 249, 243, 0.94);
}

.nav-inner {
    height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand { display: inline-flex; align-items: center; gap: 11px; }

/* The icon file already carries its own rounded-square silhouette with
   transparent corners, so no border-radius here: it would clip the artwork. */
.brand img {
    width: 40px;
    height: 40px;
    filter: drop-shadow(0 3px 7px rgba(104, 31, 55, 0.16));
}

.brand-name {
    font-family: var(--font);
    font-weight: 700;
    font-size: 1.32rem;
    letter-spacing: -0.02em;
}

.nav-right { display: flex; align-items: center; gap: 26px; }

.nav-menu { display: flex; align-items: center; gap: 26px; }

.nav-link {
    font-weight: 600;
    font-size: 0.98rem;
    color: var(--ink-soft);
    padding: 6px 0;
    position: relative;
    transition: color var(--t);
}

.nav-link::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    border-radius: 2px;
    background: var(--amber);
    transition: width var(--t);
}

.nav-link:hover { color: var(--ink); }
.nav-link:hover::after { width: 100%; }
.nav-link[aria-current="page"] { color: var(--ink); }
.nav-link[aria-current="page"]::after { width: 100%; }

.nav-cta {
    padding: 10px 22px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    border-radius: var(--r-pill);
    background: var(--amber);
    color: var(--plum);
    font-family: var(--font);
    font-weight: 700;
    font-size: 0.96rem;
    transition: transform var(--t), background var(--t);
}

.nav-cta:hover { background: var(--amber-deep); transform: translateY(-1px); }

.nav-toggle {
    display: none;
    width: 46px;
    height: 46px;
    border-radius: 13px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    background: var(--surface);
    border: 1px solid var(--line);
}

.nav-toggle span {
    display: block;
    width: 19px;
    height: 2px;
    border-radius: 2px;
    background: var(--ink);
    transition: transform var(--t), opacity var(--t);
}

.nav-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 900px) {
    .nav-toggle { display: flex; }

    .nav-menu {
        position: fixed;
        inset: var(--header-h) 0 auto 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 8px var(--gutter) 24px;
        /* Fully opaque: a translucent panel lets the hero bleed through
           and makes the menu look broken rather than layered. */
        background: var(--bg);
        border-bottom: 1px solid var(--line);
        box-shadow: 0 18px 40px rgba(104, 31, 55, 0.14);
        transform: translateY(-12px);
        opacity: 0;
        visibility: hidden;
        transition: opacity var(--t), transform var(--t), visibility var(--t);
    }

    /* Dim the page behind the open menu so the two layers read apart */
    .nav-menu::after {
        content: "";
        position: fixed;
        inset: 100% 0 -100vh 0;
        background: rgba(42, 29, 34, 0.32);
        pointer-events: none;
    }

    .nav-menu.active { transform: translateY(0); opacity: 1; visibility: visible; }

    .nav-menu .nav-link {
        padding: 15px 4px;
        font-size: 1.08rem;
        width: 100%;
    }

    /* Rule on the list item, not the link, so it spans the full panel width */
    .nav-menu > li:not(:last-child) { border-bottom: 1px solid var(--line-soft); }

    .nav-menu .nav-link::after { display: none; }

    .nav-right { gap: 12px; }
    .nav-cta { padding: 10px 18px; font-size: 0.92rem; }
}

@media (max-width: 430px) {
    /* Too tight to sit beside the logo and the toggle, so it moves into the
       menu panel instead of disappearing entirely. */
    .nav-right > .nav-cta { display: none; }
}

/* CTA shown inside the open mobile menu */
.nav-menu .nav-cta-mobile { display: none; }

@media (max-width: 900px) {
    .nav-menu .nav-cta-mobile {
        display: flex;
        width: 100%;
        justify-content: center;
        margin-top: 16px;
        min-height: 52px;
        align-items: center;
        border-radius: var(--r-pill);
        background: var(--amber);
        color: var(--plum);
        font-family: var(--font);
        font-weight: 700;
        font-size: 1.02rem;
        box-shadow: var(--shadow-amber);
    }
}

body.menu-open { overflow: hidden; }

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
    position: relative;
    padding: clamp(28px, 4.4vw, 56px) 0 clamp(52px, 7vw, 88px);
    overflow: hidden;
}

/* Soft warm light behind the hero: cheap, GPU friendly, no images */
.hero::before,
.hero::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    pointer-events: none;
    z-index: 0;
}

.hero::before {
    width: 620px;
    height: 620px;
    top: -280px;
    right: -160px;
    background: radial-gradient(circle, rgba(255, 187, 44, 0.34), rgba(255, 187, 44, 0));
}

.hero::after {
    width: 520px;
    height: 520px;
    bottom: -240px;
    left: -180px;
    background: radial-gradient(circle, rgba(197, 102, 152, 0.20), rgba(197, 102, 152, 0));
}

.hero-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr);
    gap: clamp(32px, 5vw, 72px);
    align-items: center;
}

.hero-copy { max-width: 620px; }

.hero h1 { margin-bottom: 22px; }

.hero h1 .rose { color: var(--rose-deep); }

/* Forces the line break at wide widths only; on small screens the text
   reflows naturally, so the span must still render its space. */
.hero h1 .br { display: inline; }

@media (min-width: 720px) {
    .hero h1 .br { display: block; height: 0; }
}

.hero h1 .accent {
    position: relative;
    display: inline-block;
}

/* Hand-drawn underline under the key phrase: a stitched, crafted detail.
   inline-block on .accent keeps the SVG bound to the phrase, not the line box. */
.hero h1 .accent svg {
    position: absolute;
    left: 0;
    width: 100%;
    bottom: 0.02em;
    height: 0.17em;
    overflow: visible;
}

.hero h1 .accent path {
    stroke: var(--amber);
    stroke-width: 7;
    stroke-linecap: round;
    fill: none;
    stroke-dasharray: 320;
    stroke-dashoffset: 320;
    animation: draw 1.1s var(--ease) 0.45s forwards;
}

@keyframes draw { to { stroke-dashoffset: 0; } }

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    margin-top: 32px;
}

.hero-note {
    margin-top: 20px;
    font-size: 0.94rem;
    color: var(--ink-faint);
    display: flex;
    align-items: flex-start;
    gap: 9px;
}

/* align-items:flex-start keeps the tick beside the first line when the text
   wraps, rather than centring it against the whole block */
.hero-note svg { flex: none; color: var(--rose); margin-top: 5px; }

/* Hero visual: phone + floating UI cards.
   The inner stage is sized to the phone so the floating cards can be
   positioned relative to the device rather than the whole column. */
.hero-visual {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 520px;
}

.hero-stage {
    position: relative;
    display: flex;
    justify-content: center;
    width: 100%;
    max-width: 520px;
}

/* The hero art is a full composition with its own props and shadows baked in,
   so it takes neither the .phone width clamp nor the device drop-shadow. */
.hero-stage .phone {
    width: 100%;
    filter: none;
    transform: none;
}


@keyframes floaty {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-14px) rotate(-2deg); }
}

/* ==========================================================================
   Phone frame: one shared component, used on every page
   ========================================================================== */

/* The device frame is baked into the source PNGs (real bezel, real corner
   radius, transparent background), so there is no CSS phone to fake here -
   just a drop shadow that follows the device's actual silhouette. */
.phone {
    position: relative;
    width: clamp(228px, 30vw, 300px);
    z-index: 2;
    /* drop-shadow follows the alpha channel; box-shadow would draw a
       rectangle around the transparent PNG instead of the phone shape. */
    filter: drop-shadow(0 18px 28px rgba(104, 31, 55, 0.16))
            drop-shadow(0 44px 70px rgba(104, 31, 55, 0.13));
}

.phone img {
    width: 100%;
    height: auto;
    display: block;
}

/* The stash composition has cards overhanging the device, so it needs more
   room than a plain screenshot to avoid looking cramped. */
.phone-wide { width: clamp(258px, 36vw, 366px); }

.phone-tilt { transform: rotate(-3.2deg); }


@media (max-width: 1040px) {
    /* Scoped to the homepage hero. Bare .lede / .eyebrow / .hero-actions here
       would leak onto the topic pages and centre their intros while the h1
       stayed flush left. */
    .hero-grid { grid-template-columns: 1fr; text-align: center; }
    .hero-copy { max-width: 700px; margin-inline: auto; }
    .hero-copy .lede { margin-inline: auto; }
    .hero-copy .hero-actions,
    .hero-copy .hero-note { justify-content: center; }
    .hero-copy .eyebrow { justify-content: center; }
    .hero-visual { min-height: 470px; margin-top: 12px; }
}

@media (max-width: 760px) {
    /* Below this the cards would sit off-screen; tuck them over the phone's
       edge instead, where they overlap the bezel rather than the UI. */
}

@media (max-width: 560px) {
    .hero-visual { min-height: 420px; }
}

/* ==========================================================================
   Sections
   ========================================================================== */

.section { padding: clamp(64px, 9vw, 118px) 0; position: relative; }

.section-warm { background: var(--bg-alt); }

.section-head { max-width: 680px; margin-bottom: clamp(38px, 5vw, 60px); }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head h2 { margin: 14px 0 16px; }

/* Curved section divider: softens the transition between bands */
.wave {
    display: block;
    width: 100%;
    height: clamp(38px, 5vw, 70px);
    color: var(--bg-alt);
}
.wave svg { width: 100%; height: 100%; display: block; }
.wave-flip { color: var(--bg); }

/* ==========================================================================
   Story: the "you know this feeling" moments
   ========================================================================== */

/* An editorial list rather than a card grid: a single stitched thread runs
   down the page and each moment hangs off it, alternating side on desktop. */
.story-list {
    --story-icon: 55px;
    position: relative;
    max-width: 940px;
    margin-inline: auto;
    display: grid;
    gap: clamp(30px, 5vw, 54px);
}

/* The thread */
.story-list::before {
    content: "";
    position: absolute;
    top: 12px;
    bottom: 12px;
    /* centred under the icon: half the icon minus half the rail width */
    left: calc((var(--story-icon) / 2) - 1.5px);
    width: 3px;
    border-radius: 3px;
    background: repeating-linear-gradient(
        to bottom,
        var(--rose-soft) 0 9px,
        transparent 9px 17px
    );
}

.story-item {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: clamp(18px, 3vw, 26px);
    align-items: start;
    padding-left: 0;
}

.story-mark {
    width: var(--story-icon);
    height: var(--story-icon);
    border-radius: 18px;
    display: grid;
    place-items: center;
    flex: none;
    position: relative;
    z-index: 1;
    box-shadow: 0 0 0 7px var(--bg-alt);
}

.story-item h3 { margin-bottom: 8px; font-size: clamp(1.14rem, 1.9vw, 1.34rem); }
.story-item p { color: var(--ink-soft); font-size: 1.01rem; max-width: 60ch; }

.story-item .fix {
    display: inline-flex;
    align-items: flex-start;
    gap: 9px;
    margin-top: 14px;
    padding: 10px 16px 10px 13px;
    border-radius: var(--r-pill);
    background: var(--surface);
    border: 1px solid var(--amber-soft);
    box-shadow: var(--shadow-sm);
    font-weight: 700;
    font-size: 0.93rem;
    color: var(--plum);
    line-height: 1.45;
}

.story-item .fix svg { flex: none; margin-top: 3px; color: var(--rose-deep); }

@media (min-width: 860px) {
    .story-list::before { left: 50%; transform: translateX(-50%); }

    /* Each item spans half the list plus exactly half the icon, so the icon's
       own centre lands on the thread. Using half the icon width (not a guessed
       constant) is what keeps it centred at every viewport, matching mobile. */
    .story-item {
        width: calc(50% + (var(--story-icon) / 2));
        grid-template-columns: auto minmax(0, 1fr);
    }

    /* Odd items sit left of the thread with the icon on the inner edge.
       Headings align to the thread, but body copy stays left-aligned -
       ragged-right is much easier to read across multiple lines. */
    .story-item:nth-child(odd) {
        justify-self: start;
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .story-item:nth-child(odd) > div {
        order: -1;
        display: flex;
        flex-direction: column;
        align-items: flex-end;
    }

    .story-item:nth-child(odd) h3 { text-align: right; }

    .story-item:nth-child(even) { justify-self: end; }

    /* Stagger so the two columns interleave instead of lining up */
    .story-item:nth-child(even) { margin-top: -18px; }
}

/* ==========================================================================
   Feature bands: alternating, editorial, not a card grid
   ========================================================================== */

.band {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(34px, 6vw, 84px);
    align-items: center;
}

.band + .band { margin-top: clamp(64px, 9vw, 120px); }

.band-reverse .band-visual { order: -1; }

.band-copy h2 { margin: 14px 0 18px; }

.band-visual {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 480px;
}

/* Warm pad behind the device so screenshots never float in a void.
   Insets are tuned to the taller real-device images: the pad should read as
   a soft ground the phone sits on, not a frame tight around it. */
.band-visual::before {
    content: "";
    position: absolute;
    inset: 12% 6%;
    border-radius: var(--r-xl);
    background: linear-gradient(150deg, var(--amber-wash), var(--rose-wash));
    z-index: 0;
}

.band-visual.pad-mint::before { background: linear-gradient(150deg, #E4F1EA, var(--amber-wash)); }
.band-visual.pad-lav::before { background: linear-gradient(150deg, #EAE5F8, var(--rose-wash)); }

.feature-points { margin-top: 26px; display: grid; gap: 15px; }

.feature-points li {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 13px;
    align-items: start;
    font-size: 1rem;
    color: var(--ink-soft);
}

.feature-points strong { color: var(--ink); font-family: var(--font); font-weight: 600; }

.tick {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: var(--amber-soft);
    color: var(--plum);
    display: grid;
    place-items: center;
    flex: none;
    margin-top: 2px;
}

.band-link {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-top: 26px;
    font-family: var(--font);
    font-weight: 700;
    font-size: 1.02rem;
    color: var(--rose-deep);
    transition: gap var(--t);
}

.band-link:hover { gap: 15px; }

@media (max-width: 900px) {
    .band { grid-template-columns: 1fr; gap: 34px; }
    .band-reverse .band-visual { order: 0; }
    .band-visual { min-height: 430px; }

    /* Headings centre nicely; body copy does not. Left-aligning the prose
       keeps a consistent ragged-right edge and a readable measure. */
    .band-copy .eyebrow { justify-content: center; }
    .band-copy > h2 { text-align: center; }
    .band-copy > .lede { margin-inline: auto; }
    .feature-points { max-width: 460px; margin-inline: auto; }
    .band-link { display: flex; justify-content: center; }
}

@media (max-width: 640px) {
    .band-copy > h2 { text-align: left; }
    .band-copy .eyebrow { justify-content: flex-start; }
    .band-link { justify-content: flex-start; }
}

/* ==========================================================================
   Toolkit grid
   ========================================================================== */

/* Six tools: an explicit 3x2 (then 2x3, then 1x6) keeps rows even instead of
   letting auto-fit leave a 4+2 orphan row. align-items:stretch equalises height. */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(14px, 2vw, 20px);
    align-items: stretch;
}

@media (max-width: 900px) {
    .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
    .tool-grid { grid-template-columns: 1fr; }
}

.tool {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 16px;
    align-items: start;
    padding: 22px;
    background: var(--surface);
    border-radius: var(--r-md);
    border: 1px solid var(--line-soft);
    box-shadow: var(--shadow-sm);
    transition: transform var(--t), box-shadow var(--t), border-color var(--t);
}

.tool:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--amber-soft); }

.tool-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    flex: none;
}

.tool h3 { font-size: 1.04rem; margin-bottom: 2px; }
.tool p { font-size: 0.88rem; color: var(--ink-faint); line-height: 1.5; }

/* ==========================================================================
   FAQ
   ========================================================================== */

.faq { max-width: 820px; margin-inline: auto; display: grid; gap: 12px; }

.faq-item {
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--r-md);
    overflow: hidden;
    transition: border-color var(--t), box-shadow var(--t);
}

.faq-item[open] { border-color: var(--amber-soft); box-shadow: var(--shadow-sm); }

.faq-q {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    width: 100%;
    padding: 20px 24px;
    font-family: var(--font);
    font-weight: 600;
    font-size: 1.04rem;
    text-align: left;
    cursor: pointer;
    list-style: none;
    min-height: 60px;
}

.faq-q::-webkit-details-marker { display: none; }

.faq-q .chev {
    flex: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--amber-wash);
    display: grid;
    place-items: center;
    color: var(--rose-deep);
    transition: transform var(--t), background var(--t);
}

.faq-item[open] .chev { transform: rotate(180deg); background: var(--amber-soft); }

.faq-a { padding: 0 24px 22px; color: var(--ink-soft); font-size: 0.99rem; }
.faq-a a { color: var(--rose-deep); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* ==========================================================================
   Explore / internal-link cards
   ========================================================================== */

.explore-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 258px), 1fr));
    gap: clamp(14px, 2vw, 20px);
}

.explore {
    display: block;
    padding: 26px;
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
    transition: transform var(--t), box-shadow var(--t), border-color var(--t);
}

.explore:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--amber-soft); }

.explore-icon { width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; margin-bottom: 16px; }
.explore h3 { font-size: 1.1rem; margin-bottom: 7px; }
.explore p { font-size: 0.92rem; color: var(--ink-soft); line-height: 1.6; }

.explore .go {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 15px;
    font-family: var(--font);
    font-weight: 700;
    font-size: 0.93rem;
    color: var(--rose-deep);
    transition: gap var(--t);
}

.explore:hover .go { gap: 13px; }

/* ==========================================================================
   Closing CTA
   ========================================================================== */

.cta {
    position: relative;
    padding: clamp(46px, 7vw, 84px) clamp(26px, 5vw, 76px);
    border-radius: var(--r-xl);
    background: linear-gradient(140deg, #FFD478 0%, var(--amber) 46%, #F5A93C 100%);
    text-align: center;
    box-shadow: var(--shadow-lg);
    /* NOT overflow:hidden. The yarn art deliberately overhangs the corner, and
       clipping it there was cutting the daisy in half. The stitch texture is
       clipped by its own ::before instead, which owns the border-radius. */
}

/* Subtle stitch texture so the panel isn't a flat gradient slab */
.cta::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    overflow: hidden;
    background-image: radial-gradient(circle at 1px 1px, rgba(104, 31, 55, 0.11) 1px, transparent 0);
    background-size: 22px 22px;
    opacity: 0.55;
    pointer-events: none;
}

.cta > * { position: relative; z-index: 1; }

.cta h2 { color: var(--plum); margin-bottom: 16px; }
.cta p { color: #6E3348; max-width: 50ch; margin-inline: auto; font-size: 1.07rem; }

.cta-actions { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-top: 32px; }

.cta .appstore { background: var(--plum); box-shadow: 0 10px 26px rgba(104, 31, 55, 0.3); }
.cta .appstore:hover { background: #4E1428; }

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
    background: var(--plum);
    color: rgba(255, 255, 255, 0.76);
    padding: clamp(52px, 7vw, 78px) 0 34px;
}

.footer h3 {
    font-size: 0.82rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--amber);
    margin-bottom: 16px;
}

.footer-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr));
    gap: clamp(28px, 4vw, 52px);
}

.footer-brand .brand-name { color: #fff; }
.footer-brand p { margin-top: 15px; font-size: 0.94rem; max-width: 38ch; line-height: 1.7; }

.footer-col a {
    display: block;
    padding: 6px 0;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.76);
    transition: color var(--t), transform var(--t);
    width: fit-content;
}

.footer-col a:hover { color: var(--amber); transform: translateX(3px); }

.footer-bottom {
    margin-top: clamp(34px, 5vw, 52px);
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
    align-items: center;
    font-size: 0.87rem;
    color: rgba(255, 255, 255, 0.6);
}

@media (max-width: 860px) {
    .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 460px) {
    .footer-grid { grid-template-columns: 1fr; gap: 26px; }
    .footer-bottom { justify-content: flex-start; }
}

/* ==========================================================================
   Article / topic pages
   ========================================================================== */

.page-hero {
    padding: clamp(38px, 6vw, 76px) 0 clamp(30px, 4vw, 50px);
    position: relative;
    overflow: hidden;
}

.page-hero::before {
    content: "";
    position: absolute;
    width: 560px;
    height: 560px;
    top: -320px;
    right: -140px;
    border-radius: 50%;
    filter: blur(90px);
    background: radial-gradient(circle, rgba(255, 187, 44, 0.3), transparent 70%);
    pointer-events: none;
}

.page-hero .container { position: relative; z-index: 1; }
.page-hero h1 { font-size: clamp(2.1rem, 4.8vw, 3.5rem); margin-bottom: 18px; }

.crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    color: var(--ink-faint);
    margin-bottom: 22px;
}

.crumbs a { color: var(--rose-deep); font-weight: 600; }
.crumbs a:hover { text-decoration: underline; }
.crumbs svg { flex: none; opacity: 0.5; }

.prose { max-width: 74ch; }
.prose h2 { font-size: clamp(1.5rem, 2.9vw, 2.05rem); margin: clamp(42px, 5vw, 62px) 0 16px; }
.prose h3 { font-size: clamp(1.14rem, 2vw, 1.33rem); margin: 32px 0 11px; }
.prose p { color: var(--ink-soft); margin-bottom: 17px; font-size: 1.03rem; }
.prose ul, .prose ol { margin: 0 0 18px 22px; color: var(--ink-soft); }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { margin-bottom: 9px; padding-left: 4px; font-size: 1.02rem; }
.prose strong { color: var(--ink); font-weight: 700; }
.prose a { color: var(--rose-deep); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.prose a:hover { color: var(--plum); }

.prose > p:first-of-type { font-size: 1.14rem; color: var(--ink); line-height: 1.7; }

/* Callout: pulls the app back into editorial content */
/* Aside notes inside long-form pages.
   Deliberately NOT the tinted-box-with-left-border pattern: that treatment is
   so common in generated content that it reads as boilerplate. These are
   practical tips rather than warnings, so they are set as a marginal note,
   hung off a stitched thread that echoes the homepage story section. */
.note {
    position: relative;
    margin: 40px 0;
    padding: 4px 0 4px 30px;
    background: none;
    border: 0;
}

/* The thread: a running stitch down the left edge */
.note::before {
    content: "";
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 3px;
    border-radius: 3px;
    background: repeating-linear-gradient(
        to bottom,
        var(--rose-soft) 0 7px,
        transparent 7px 13px);
}

.note h3 {
    margin: 0 0 9px;
    font-size: 0.82rem;
    font-family: var(--font);
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--rose-deep);
}

/* Slightly larger and darker than body copy so the note reads as a lift
   out of the flow rather than a boxed-off interruption */
.note p {
    margin: 0;
    color: var(--ink);
    font-size: 1.06rem;
    line-height: 1.72;
}

.note a { color: var(--rose-deep); }

@media (min-width: 700px) {
    .note { padding-left: 34px; }
}

/* Reference table used on the hook-size page */
.table-wrap {
    overflow-x: auto;
    margin: 26px 0 30px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: var(--surface);
    -webkit-overflow-scrolling: touch;
}

table { width: 100%; border-collapse: collapse; min-width: 520px; }

thead th {
    background: var(--amber-wash);
    font-family: var(--font);
    font-size: 0.88rem;
    text-align: left;
    padding: 13px 16px;
    color: var(--plum);
    white-space: nowrap;
    border-bottom: 1px solid var(--line);
}

tbody td {
    padding: 12px 16px;
    font-size: 0.95rem;
    color: var(--ink-soft);
    border-bottom: 1px solid var(--line-soft);
}

tbody tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) { background: var(--surface-warm); }
tbody td:first-child { font-weight: 700; color: var(--ink); font-family: var(--font); }

/* Two-column layout for topic pages: prose + sticky aside.
   min-width:0 on the grid items is required: without it a wide child
   (the stitch tables) forces the track wider than the viewport. */
.topic-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 316px;
    gap: clamp(34px, 5vw, 64px);
    align-items: start;
}

.topic-layout > * { min-width: 0; }

.aside { position: sticky; top: calc(var(--header-h) + 22px); display: grid; gap: 18px; }

.aside-card {
    padding: 24px;
    border-radius: var(--r-lg);
    background: var(--surface);
    border: 1px solid var(--line-soft);
    box-shadow: var(--shadow-sm);
}

.aside-card h3 { font-size: 1.04rem; margin-bottom: 12px; }
.aside-card p { font-size: 0.92rem; color: var(--ink-soft); margin-bottom: 16px; }
.aside-card .btn { width: 100%; }

.aside-links a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 0;
    font-size: 0.94rem;
    font-weight: 600;
    color: var(--ink-soft);
    border-bottom: 1px solid var(--line-soft);
    transition: color var(--t);
}

.aside-links a:last-child { border-bottom: 0; }
.aside-links a:hover { color: var(--rose-deep); }
.aside-links svg { flex: none; opacity: 0.45; }

@media (max-width: 980px) {
    .topic-layout { grid-template-columns: 1fr; }
    .aside { position: static; max-width: 560px; }
}

/* Related-page links at the foot of topic pages */
.related {
    margin-top: clamp(46px, 6vw, 70px);
    padding-top: 34px;
    border-top: 1px solid var(--line);
}

.related h2 { font-size: 1.4rem; margin-bottom: 20px; }

/* ==========================================================================
   Reveal on scroll
   ========================================================================== */

/* The hidden state is applied by JS (via .js on <html>), never by default.
   Without this guard a JS-disabled browser: or a crawler that does not run
   scripts: would see the whole page at opacity:0. */
.js [data-reveal] {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 640ms var(--ease), transform 640ms var(--ease);
}

.js [data-reveal].visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }

    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }

    .js [data-reveal] { opacity: 1; transform: none; }
    .hero h1 .accent path { stroke-dashoffset: 0; }

}

/* Topic-page hero with a device alongside, so the product stays visible on
   deep pages rather than only on the homepage. */
.page-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.62fr);
    gap: clamp(28px, 5vw, 60px);
    align-items: center;
}

.page-hero-visual {
    display: flex;
    justify-content: center;
    position: relative;
}

.page-hero-visual::before {
    content: "";
    position: absolute;
    inset: 6% 0 -4%;
    border-radius: var(--r-xl);
    background: linear-gradient(150deg, var(--amber-wash), var(--rose-wash));
    z-index: 0;
}

.page-hero-split { padding-bottom: clamp(36px, 5vw, 62px); }

@media (max-width: 880px) {
    .page-hero-grid { grid-template-columns: 1fr; }
    /* On mobile the device would push the article below the fold: hide it
       and let the copy lead, since the homepage already shows the product. */
    .page-hero-visual { display: none; }
}

/* Screen-reader-only text (table captions, extra context for links) */
.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* ==========================================================================
   Tap targets: every interactive element clears 44px on touch devices
   ========================================================================== */

.band-link,
.explore .go,
.aside-links a,
.crumbs a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}

/* Footer links must stay block-level (one per line): using inline-flex here
   collapses the column into a run-on line. flex + fit-content keeps both the
   stacking and the 44px touch height. */
.footer-col a {
    display: flex;
    align-items: center;
    min-height: 44px;
    width: fit-content;
}

/* Inline links inside prose can't be 44px tall without breaking the text
   flow, so give them a larger hit area via padding that doesn't shift layout. */
.prose p a,
.faq-a a {
    padding-block: 6px;
    margin-block: -6px;
}

@media (max-width: 900px) {
    .footer-col a { min-height: 46px; }
}

@media (max-width: 640px) {
    /* Centred section intros work at tablet width but leave ragged, hard-to-scan
       paragraphs on a phone. Headings stay centred; supporting copy goes left. */
    .section-head.center { text-align: left; }
    .section-head.center h2 { text-align: left; }
    .section-head.center .eyebrow { justify-content: flex-start; }
    .section-head.center .lede { margin-inline: 0; }

    .cta { text-align: left; }
    .cta p { margin-inline: 0; }
    .cta-actions { justify-content: flex-start; }
}


@media (max-width: 780px) {
    /* Below this the art would sit under the text; drop it rather than crowd */
}

@media (max-width: 640px) {
    /* At phone width the centred hero fights the left-aligned body copy below
       it and makes the lede harder to scan. Align everything left. */
    .hero-grid { text-align: left; }
    .hero-copy .eyebrow { justify-content: flex-start; }
    .hero-actions { justify-content: flex-start; }
    .hero-note { justify-content: flex-start; text-align: left; }
    .hero .lede { margin-inline: 0; }

    /* Full-width CTAs are easier to hit and look deliberate on a phone */
    .hero-actions { flex-direction: column; align-items: stretch; gap: 12px; }
    .hero-actions .appstore,
    .hero-actions .btn { width: 100%; justify-content: center; }
}

/* Scroll affordance: a soft fade on the right edge tells the reader the
   table continues, instead of leaving a hard cut that looks like a bug. */
.table-wrap {
    position: relative;
    background:
        linear-gradient(to right, var(--surface) 30%, rgba(255,255,255,0)) left center,
        linear-gradient(to left, var(--surface) 30%, rgba(255,255,255,0)) right center,
        radial-gradient(farthest-side at 0 50%, rgba(104,31,55,.14), transparent) left center,
        radial-gradient(farthest-side at 100% 50%, rgba(104,31,55,.14), transparent) right center;
    background-repeat: no-repeat;
    background-size: 40px 100%, 40px 100%, 14px 100%, 14px 100%;
    background-attachment: local, local, scroll, scroll;
}

@media (max-width: 620px) {
    .table-wrap::after {
        content: "Scroll for more →";
        display: block;
        padding: 9px 16px 11px;
        font-size: .78rem;
        color: var(--ink-faint);
        border-top: 1px solid var(--line-soft);
        background: var(--surface-warm);
        position: sticky;
        left: 0;
        width: 100%;
    }
}

/* Seven tools into a 3-column grid leaves one orphan on the last row.
   Letting the final card span the remaining columns reads as deliberate
   rather than as a layout accident. */
@media (min-width: 901px) {
    .tool-grid > .tool:last-child:nth-child(3n + 1) { grid-column: span 3; }
    .tool-grid > .tool:last-child:nth-child(3n + 2) { grid-column: span 2; }
}

@media (min-width: 561px) and (max-width: 900px) {
    .tool-grid > .tool:last-child:nth-child(odd) { grid-column: span 2; }
}

/* ==========================================================================
   Measurement Swapper: the last tool cell, spanning the full grid width.
   It reads as the same white card as the other six, with a faint tick motif
   along its edges hinting at a rule rather than imitating one. The section
   should stay quiet so the product screenshots remain the loudest thing on
   the page.
   ========================================================================== */

.tool-ruler {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    align-items: center;
}

/* Full-bleed tick overlay, kept very light so it reads as texture */
.ruler-scale {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.rl-minor path { stroke: rgba(42, 29, 34, 0.10); stroke-width: 1; }
.rl-mid   path { stroke: rgba(42, 29, 34, 0.16); stroke-width: 1.3; }
.rl-major path { stroke: rgba(42, 29, 34, 0.24); stroke-width: 1.6; }

/* Numerals would make it literal; the ticks alone carry the idea */
.rl-num { display: none; }

.tool-ruler-copy h3 { font-size: 1.04rem; margin-bottom: 2px; }
.tool-ruler-copy p { font-size: 0.88rem; color: var(--ink-faint); line-height: 1.5; }

/* cm / in swap, styled like the other tool chips */
.ruler-swap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: none;
    padding: 7px 11px;
    border-radius: var(--r-pill);
    background: var(--amber-wash);
    border: 1px solid var(--amber-soft);
    color: var(--rose-deep);
}

.ruler-unit {
    font-family: var(--font);
    font-weight: 700;
    font-size: 0.82rem;
    color: var(--ink-faint);
    line-height: 1;
}

.ruler-unit.is-on {
    color: var(--plum);
    background: var(--amber-soft);
    padding: 4px 9px;
    border-radius: var(--r-pill);
}

@media (min-width: 901px) {
    .tool-ruler {
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 18px;
    }
}

@media (max-width: 900px) {
    .ruler-swap { display: none; }
}

/* Yarn art anchors the closing CTA panel so it isn't a bare gradient slab.
   (The hero deliberately has no decoration; the device stands alone there.) */
.cta-yarn {
    position: absolute;
    right: clamp(-18px, -1.4vw, -6px);
    bottom: clamp(-34px, -3vw, -20px);
    width: clamp(160px, 22vw, 280px);
    z-index: 2;
    /* Shadow reads against the page, not the panel, now that it overhangs */
    filter: drop-shadow(0 18px 30px rgba(104, 31, 55, 0.26));
    pointer-events: none;
}

@media (max-width: 780px) {
    /* Below this the art would sit under the text; drop it rather than crowd */
    .cta-yarn { display: none; }
}

/* Homepage feature bands use the 3D compositions, which bring their own props
   and shadows. They take neither the device drop-shadow nor the pastel pad
   that plain screenshots need to avoid floating in a void.

   Sizing: the phone occupies a different fraction of each composition (75-88%,
   because the props extend further on some). Setting one width for all four
   would render the phones at visibly different sizes, so each gets a width
   solved to put the *device* at ~300px. That is what the eye compares. */
.phone-3d {
    filter: none;
    transform: none;
    width: min(100%, var(--art-w, 360px));
}

.phone-3d[data-art="pattern-detail"] { --art-w: 400px; }        /* phone 75% of frame */
.phone-3d[data-art="project-steps"] { --art-w: 342px; }         /* phone 87% of frame */
.phone-3d[data-art="row-counter"] { --art-w: 381px; }           /* phone 78% of frame */
.phone-3d[data-art="yarn-stash"] { --art-w: 346px; }            /* phone 86% of frame */

.band-visual:has(.phone-3d) { min-height: 0; }
.band-visual:has(.phone-3d)::before { display: none; }

@media (max-width: 900px) {
    /* Same ratios, scaled down together */
    .phone-3d[data-art="pattern-detail"] { --art-w: 347px; }
    .phone-3d[data-art="project-steps"] { --art-w: 297px; }
    .phone-3d[data-art="row-counter"] { --art-w: 330px; }
    .phone-3d[data-art="yarn-stash"] { --art-w: 300px; }
}

/* ==========================================================================
   Legal pages: privacy and terms
   Long documents people scan rather than read, so they get a sticky section
   index alongside the prose.
   ========================================================================== */

.legal-meta {
    margin-top: 16px;
    font-size: 0.92rem;
    color: var(--ink-faint);
}

.legal-layout {
    display: grid;
    grid-template-columns: 244px minmax(0, 1fr);
    gap: clamp(32px, 5vw, 68px);
    align-items: start;
}

.legal-layout > * { min-width: 0; }

.legal-toc {
    position: sticky;
    top: calc(var(--header-h) + 22px);
    padding: 22px 24px;
    border-radius: var(--r-lg);
    background: var(--surface);
    border: 1px solid var(--line-soft);
    box-shadow: var(--shadow-sm);
}

.legal-toc h2 {
    margin: 0 0 14px;
    font-family: var(--font);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--rose-deep);
}

.legal-toc ol {
    list-style: none;
    counter-reset: toc;
    margin: 0;
    padding: 0;
}

.legal-toc li { counter-increment: toc; }

.legal-toc a {
    display: grid;
    grid-template-columns: 1.6rem 1fr;
    gap: 4px;
    padding: 7px 0;
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--ink-soft);
    transition: color var(--t);
}

.legal-toc a::before {
    content: counter(toc) ".";
    color: var(--ink-faint);
    font-variant-numeric: tabular-nums;
}

.legal-toc a:hover { color: var(--rose-deep); }

/* Anchored headings need to clear the sticky header when jumped to */
.legal-prose h2 { scroll-margin-top: calc(var(--header-h) + 20px); }

.legal-prose h2:first-child { margin-top: 0; }

/* Slightly tighter than editorial prose: these are reference documents */
.legal-prose p,
.legal-prose li { font-size: 1rem; }
.legal-prose h3 { font-size: 1.1rem; }

@media (max-width: 940px) {
    .legal-layout { grid-template-columns: 1fr; }

    /* Static above the prose on narrow screens; sticky would eat the viewport */
    .legal-toc {
        position: static;
        max-width: 560px;
    }

    .legal-toc ol {
        columns: 2;
        column-gap: 26px;
    }
}

@media (max-width: 520px) {
    .legal-toc ol { columns: 1; }
}
