/* ==========================================================================
   CAA - Car Audio Analyzer  |  site styles  (light theme)

   Restored to the site's original look after four redesign attempts (grey/
   amber "Test Bench", blue-violet gradient, cream/coral "Measured", and a
   dark audison.com-benchmarked pass) didn't land. This is the pre-renewal
   design: the app itself is dark, so every screenshot on this site is a
   dark image on a light page. Rather than fight that, screenshots sit
   inside a dark bezel (.shot-frame) that reads as a monitor -- the contrast
   becomes deliberate instead of accidental. Accent colours are the
   light-mode counterparts of the app's own palette (Source/Utils/Colours.h)
   so the two still feel related. The SPA rebuild (Astro + React islands,
   <ClientRouter /> page transitions) stays -- only the visual design reverts.
   ========================================================================== */

:root {
    --bg:        #FFFFFF;
    --bg-alt:    #F5F5F7;   /* alternating section band */
    --card:      #FFFFFF;
    --surface:   #F2F2F7;
    --bezel:     #1D1D1F;   /* frame around dark app screenshots */
    --border:    #D2D2D7;
    --border-soft:#E8E8ED;

    --text:      #1D1D1F;
    --text-2:    #3A3A3F;
    --text-3:    #6E6E73;

    --accent:    #007AFF;   /* systemBlue, light */
    --accent-ink:#0062CC;
    --purple:    #AF52DE;
    --teal:      #32ADE6;
    --yellow:    #FFCC00;
    --green:     #34C759;
    --orange:    #FF9500;
    --red:       #FF3B30;

    --maxw:      1120px;
    --radius:    14px;
    --radius-sm: 10px;
    --shadow:    0 1px 3px rgba(0,0,0,.06), 0 8px 24px rgba(0,0,0,.06);

    --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", "Pretendard",
                 "Apple SD Gothic Neo", "Malgun Gothic", Roboto, sans-serif;
    --font-display: var(--font-body);
    --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

html[data-lang="ko"] [lang="en"] { display: none; }
html[data-lang="en"] [lang="ko"] { display: none; }

/* Grid/flex items default to min-width:auto and refuse to shrink below their
   content, which lets a wide screenshot push the whole page sideways on a
   phone. */
.grid > *, .feature-row > *, .step > *, .footer-inner > * { min-width: 0; }
h1, h2, h3, p, li, td, th, summary, dt, dd { word-break: keep-all; overflow-wrap: anywhere; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* --- header / nav --------------------------------------------------------- */
header {
    position: sticky; top: 0; z-index: 40;
    background: rgba(255,255,255,.86);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-soft);
}
.nav { display: flex; align-items: center; gap: 28px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); font-size: 17px; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand img { width: 26px; height: 26px; border-radius: 6px; }
.nav-links { display: flex; gap: 24px; margin-left: auto; align-items: center; }
.nav-links a { color: var(--text-2); font-size: 14px; font-weight: 500; }
.nav-links a:hover, .nav-links a.active { color: var(--accent); text-decoration: none; }

.lang-toggle {
    display: flex; background: var(--surface); border: 1px solid var(--border);
    border-radius: 999px; overflow: hidden; margin-left: 4px;
}
.lang-toggle button {
    border: 0; background: transparent; color: var(--text-2); font-size: 12px;
    font-family: var(--font-body); font-weight: 600; padding: 7px 13px; cursor: pointer;
}
.lang-toggle button[aria-pressed="true"] { background: var(--accent); color: #fff; }

.menu-btn { display: none; background: none; border: 0; color: var(--text); font-size: 22px; cursor: pointer; padding: 4px 8px; }

.hero-overlay main { padding-top: 0; }

/* --- hero ------------------------------------------------------------------ */
.hero { padding: 84px 0 56px; text-align: center; }
.hero .eyebrow {
    display: inline-block; font-size: 12.5px; letter-spacing: .09em; text-transform: uppercase;
    color: var(--accent-ink); border: 1px solid rgba(0,122,255,.28);
    background: rgba(0,122,255,.07);
    border-radius: 999px; padding: 5px 14px; margin-bottom: 22px;
}
.hero h1 { font-family: var(--font-display); font-size: clamp(32px, 5.2vw, 54px); line-height: 1.2; margin: 0 0 18px; letter-spacing: -.022em; font-weight: 700; text-wrap: balance; }
.hero p.lead { font-size: clamp(16px, 2vw, 19px); color: var(--text-2); max-width: 660px; margin: 0 auto 32px; }
.hero p.lead strong { color: var(--text); }
.hero .meta { margin-top: 16px; font-size: 13.5px; color: var(--text-3); }
.hero .hero-note { margin-top: 10px; font-size: 12.5px; color: var(--text-3); }
.hero.small { padding: 56px 0 8px; text-align: left; }
.hero.small h1 { font-size: clamp(26px, 4vw, 38px); }
.hero.small .btn-row { justify-content: flex-start; }
.hero.small p.lead { margin-left: 0; }

/* Video hero (the homepage) -- the app measuring, behind the headline. The
   clip is silent, looping and carries nothing the page needs, so it is
   aria-hidden and the poster stands in wherever it cannot or should not
   play. Dark on an otherwise light page -- the one deliberate exception,
   because it is real footage of the app, not an invented dark theme. */
.hero.hero-video {
    position: relative; overflow: hidden; background: #0B0B0D; color: #fff;
    min-height: clamp(480px, 86vh, 800px); display: flex; align-items: center;
    padding: 112px 0 80px; text-align: center;
}
.hero-video > .wrap { width: 100%; }
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%;
           object-fit: cover; pointer-events: none; }
.hero-scrim { position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(180deg, rgba(8,8,10,.72) 0%, rgba(8,8,10,.40) 45%,
                                        rgba(8,8,10,.80) 100%); }
.hero-copy { position: relative; z-index: 1; }
.hero-video h1 { color: #fff; }
.hero-video p.lead { color: rgba(255,255,255,.80); }
.hero-video .meta { color: rgba(255,255,255,.52); }
.hero-video .eyebrow { color: #0A6CFF; border-color: rgba(10,108,255,.42);
                       background: rgba(255,255,255,.12); }
.hero-video .btn-ghost { background: rgba(255,255,255,.08); color: #fff;
                         border-color: rgba(255,255,255,.30); }
.hero-video .btn-ghost:hover { background: rgba(255,255,255,.16); }
.hero-video .hero-note { color: rgba(255,255,255,.42); }

@media (prefers-reduced-motion: reduce) {
    .hero-bg { display: none; }
    .hero.hero-video { background-image: url(/assets/video/caa-hero-poster.jpg);
                        background-size: cover; background-position: center; }
}

/* --- buttons ---------------------------------------------------------------- */
.btn {
    display: inline-block; padding: 13px 26px; border-radius: var(--radius-sm);
    font-weight: 600; font-size: 15.5px; border: 1px solid transparent; cursor: pointer;
    font-family: var(--font-body);
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-ink); }
.btn-ghost { background: #fff; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface); }
.btn-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero.small .btn-row { justify-content: flex-start; }

/* --- sections ---------------------------------------------------------------- */
section { padding: 64px 0; }
section.tight { padding: 44px 0; }
section.band { background: var(--bg-alt); }
h2 { font-family: var(--font-display); font-size: clamp(24px, 3.4vw, 34px); margin: 0 0 12px; letter-spacing: -.018em; font-weight: 700; text-wrap: balance; }
h3 { font-family: var(--font-display); font-size: 19px; margin: 0 0 8px; font-weight: 700; }
.section-lead { color: var(--text-2); max-width: 700px; margin: 0 0 36px; }
.center { text-align: center; }
.center .section-lead { margin-left: auto; margin-right: auto; }

.kicker {
    display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700;
    color: var(--accent); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 14px;
}

/* --- grid / cards ---------------------------------------------------------- */
.grid { display: grid; gap: 18px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-1 { grid-template-columns: 1fr; }

.card {
    background: var(--card); border: 1px solid var(--border-soft); border-radius: var(--radius);
    padding: 26px; box-shadow: var(--shadow);
}
.card h3 { margin-top: 0; }
.card p { color: var(--text-2); margin: 0; font-size: 14.5px; }
.card .chip {
    display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px;
    padding: 0 10px; border-radius: var(--radius-sm); color: #fff; font-weight: 700; font-family: var(--font-display);
    margin-bottom: 14px; font-size: 15px; background: var(--accent);
}

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border: 1px solid var(--border-soft); border-radius: var(--radius); overflow: hidden; background: var(--card); }
.stats div { padding: 24px 18px; text-align: center; border-right: 1px solid var(--border-soft); }
.stats div:last-child { border-right: 0; }
.stats .n { font-family: var(--font-display); font-size: 32px; font-weight: 700; letter-spacing: -.02em; display: block; color: var(--accent); }
.stats .l { font-size: 12.5px; color: var(--text-3); font-weight: 500; }

/* Screenshots: the app is dark, so it sits inside a dark bezel that reads
   as a monitor, deliberate contrast instead of accidental. */
.shot-frame { background: var(--bezel); padding: 0; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.shot-frame img { border-radius: var(--radius); width: 100%; display: block; }
.hero-shot { margin-top: 40px; }

.feature-row { display: grid; grid-template-columns: 1fr 1.2fr; gap: 48px; align-items: center; margin-bottom: 64px; }
.feature-row:last-child { margin-bottom: 0; }
.feature-row:nth-child(even) .feature-text { order: 2; }
.feature-row h2 { font-size: clamp(22px, 2.4vw, 28px); line-height: 1.3; }
.feature-row ul { color: var(--text-2); padding-left: 0; margin: 16px 0 0; font-size: 14.5px; list-style: none; }
.feature-row li { margin-bottom: 10px; padding-left: 20px; position: relative; }
.feature-row li::before { content: "→"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }

/* Rounded on the side that faces the text, square on the side that runs off
   the page edge -- a rounded corner floating at the viewport edge reads as
   a mistake, the image should look like it continues past the screen. */
.features.bleed .shot .shot-frame { padding: 0; background: none; overflow: hidden;
    border-radius: 18px 0 0 18px; box-shadow: -14px 0 34px rgba(0,0,0,.10); }
.features.bleed .feature-row:nth-child(even) .shot .shot-frame {
    border-radius: 0 18px 18px 0; box-shadow: 14px 0 34px rgba(0,0,0,.10); }
.features.bleed .shot .shot-frame img { border-radius: 0; }

.step { display: grid; grid-template-columns: 46px 1fr; gap: 20px; margin-bottom: 30px; }
.step .num {
    width: 40px; height: 40px; border-radius: var(--radius-sm); background: var(--accent); color: #fff;
    display: flex; align-items: center; justify-content: center; font-weight: 700; font-family: var(--font-display); font-size: 15px;
}
.step h3 { margin-bottom: 4px; }
.step p { color: var(--text-2); margin: 0; font-size: 14.5px; }
.step p + p { margin-top: 10px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); background: var(--card); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 11px 16px; border-bottom: 1px solid var(--border-soft); }
th { font-family: var(--font-body); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); font-weight: 700; }
tr:last-child td { border-bottom: 0; }

.defs { display: grid; gap: 14px; }
.defs .def { background: var(--card); border: 1px solid var(--border-soft); border-radius: var(--radius-sm); padding: 20px 22px; box-shadow: var(--shadow); }
.defs dt { font-weight: 700; font-size: 16px; margin-bottom: 2px; }
.defs .en-term { color: var(--text-3); font-weight: 500; font-size: 13px; }
.defs dd { margin: 8px 0 0; color: var(--text-2); font-size: 14.5px; }
.defs .why { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); font-size: 14px; color: var(--text-2); }
.defs .why b { color: var(--text); }

.note { background: var(--surface); border-left: 3px solid var(--accent); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: 16px 20px; font-size: 14.5px; color: var(--text-2); }
.note.warn { border-left-color: var(--orange); }
.note.good { border-left-color: var(--green); }
.note strong { color: var(--text); }
.note + .note { margin-top: 12px; }

.cta {
    background: var(--bezel); color: #fff; border-radius: var(--radius); padding: 56px 40px; text-align: center;
}
.cta h2 { margin-bottom: 10px; color: #fff; }
.cta p { color: rgba(255,255,255,.72); margin: 0 auto 26px; max-width: 560px; }
.cta .btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.28); }
.cta .btn-ghost:hover { background: rgba(255,255,255,.08); }

/* --- slider ------------------------------------------------------------------ */
/* Slider. The track scrolls and snaps on its own, so without the script it is
   still a swipeable strip -- the buttons and dots are what it adds. */
.slider { position: relative; max-width: var(--maxw); margin: 40px auto 30px; padding: 0 24px; }
.slides { display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
          border-radius: var(--radius); background: var(--bezel);
          scrollbar-width: none; -ms-overflow-style: none; }
.slides::-webkit-scrollbar { display: none; }
.slides figure { margin: 0; flex: 0 0 100%; scroll-snap-align: start; position: relative; }
.slides img { display: block; width: 100%; aspect-ratio: 16 / 9;
              object-fit: cover; object-position: top left; }
.slides figcaption { position: absolute; inset: auto 0 0 0; padding: 44px 24px 20px;
    background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,.82));
    color: #fff; font-size: 15.5px; font-weight: 600; }

.s-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
    width: 44px; height: 44px; border-radius: 50%; cursor: pointer;
    border: 1px solid rgba(255,255,255,.28); background: rgba(0,0,0,.42);
    color: #fff; font-size: 24px; line-height: 1; display: none; }
.s-nav:hover { background: rgba(0,0,0,.66); }
.s-prev { left: 34px; }
.s-next { right: 34px; }

.s-dots { display: flex; justify-content: center; gap: 8px; margin-top: 16px; }
.s-dots button { width: 8px; height: 8px; padding: 0; border-radius: 50%; cursor: pointer;
                 border: 0; background: var(--border); }
.s-dots button[aria-current="true"] { background: var(--accent); width: 22px; border-radius: 999px; }

@media (min-width: 620px) { .s-nav { display: block; } }
@media (max-width: 620px) { .slides figcaption { font-size: 13.5px; } }

/* --- tiles ------------------------------------------------------------------ */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.tile { display: block; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); overflow: hidden; background: var(--card); box-shadow: var(--shadow); }
.tile:hover { border-color: var(--accent); text-decoration: none; }
.tile img { aspect-ratio: 16/10; object-fit: cover; }
.tile-body { padding: 16px 18px; }
.tile-body h3 { margin: 0 0 4px; font-size: 15px; }
.tile-body p { font-size: 13px; color: var(--text-2); }

/* --- footer ------------------------------------------------------------------ */
.site-footer { border-top: 1px solid var(--border-soft); padding: 52px 0 24px; color: var(--text-3); font-size: 13.5px; margin-top: 40px; background: var(--bg-alt); }
.footer-cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; padding-bottom: 32px; border-bottom: 1px solid var(--border-soft); }
.footer-brand .fb-name { font-family: var(--font-display); font-weight: 700; font-size: 17px; color: var(--text); margin-bottom: 8px; letter-spacing: -.01em; }
.footer-brand p { margin: 0 0 16px; }
.site-footer nav h4 { font-family: var(--font-body); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin: 0 0 12px; font-weight: 700; }
.site-footer nav a { display: block; color: var(--text-2); margin-bottom: 9px; }
.site-footer nav a:hover { color: var(--accent); text-decoration: none; }
.footer-base { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; padding-top: 20px; }
.footer-lang.lang-toggle { background: none; border: 0; overflow: visible; gap: 6px; }
.footer-lang.lang-toggle button { background: none; border: 1px solid var(--border); color: var(--text-3); border-radius: 999px; }
.footer-lang.lang-toggle button:hover { color: var(--text); border-color: var(--text-3); }
.footer-lang.lang-toggle button[aria-pressed="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }

.mono { font-family: var(--font-mono); }
.big  { font-size: 1.12em; }
.sub  { color: var(--text-3); font-size: 14px; }

.warn-box { background: rgba(255,149,0,.08); border: 1px solid rgba(255,149,0,.3); border-radius: var(--radius-sm); padding: 16px 20px; font-size: 14.5px; color: var(--text-2); }
.flash { border-radius: var(--radius-sm); padding: 12px 15px; margin: 0 0 18px; font-size: 15px; }
.flash.ok  { background: rgba(52,199,89,.1); border: 1px solid rgba(52,199,89,.35); color: var(--text); }
.flash.bad { background: rgba(255,59,48,.08); border: 1px solid rgba(255,59,48,.3); color: var(--text); }

.badge { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge.ok  { background: rgba(52,199,89,.12); color: #1F8A44; }
.badge.bad { background: rgba(255,59,48,.1); color: #C7291F; }
.badge.pending   { background: var(--surface); color: var(--text-3); }
.badge.paid      { background: rgba(0,122,255,.12); color: var(--accent-ink); }
.badge.issued    { background: rgba(52,199,89,.12); color: #1F8A44; }
.badge.cancelled { background: rgba(255,59,48,.1); color: #C7291F; }

table.kv { width: 100%; border-collapse: collapse; margin: 6px 0 12px; }
table.kv th { width: 34%; text-align: left; font-weight: 500; color: var(--text-3);
              padding: 8px 10px 8px 0; vertical-align: top; border-bottom: 1px solid var(--border-soft); font-size: 13.5px; }
table.kv td { padding: 8px 0; border-bottom: 1px solid var(--border-soft); font-size: 14.5px; }
table.kv tr:last-child th, table.kv tr:last-child td { border-bottom: 0; }

.orderform label { display: block; margin: 0 0 14px; font-size: 14px; color: var(--text-2); }
.orderform input, .orderform textarea {
    width: 100%; margin-top: 6px; padding: 11px 14px; font: inherit; font-family: var(--font-body);
    border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; color: var(--text); }
.orderform input:focus, .orderform textarea:focus { outline: none; border-color: var(--accent); }
.orderform .f2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 620px) { .orderform .f2 { grid-template-columns: 1fr; } }
.orderform .total { display: block; margin-top: 6px; padding: 11px 0; font-size: 22px; font-weight: 700; font-family: var(--font-display); color: var(--accent); }
.orderform .check { display: flex; align-items: center; gap: 9px; margin: 4px 0 18px; }
.orderform .check input { width: auto; margin: 0; }
.orderform .hp { position: absolute; left: -9999px; }

.serial { display: inline-block; background: var(--surface); border: 1px solid var(--border);
          border-radius: var(--radius-sm); padding: 10px 16px; letter-spacing: 0.06em; margin: 4px 0; font-family: var(--font-mono); color: var(--text); }
.steps { color: var(--text-2); padding-left: 20px; }
.steps li { margin: 6px 0; }

.price { font-family: var(--font-display); font-size: 36px; font-weight: 700; margin: 6px 0 14px; letter-spacing: -0.01em; color: var(--text); }
.price .unit { font-size: 15px; font-weight: 400; color: var(--text-3); margin-left: 6px; }

.ticks { list-style: none; padding: 0; margin: 0 0 14px; }
.ticks li { position: relative; padding-left: 24px; margin: 8px 0; color: var(--text-2); }
.ticks li::before { content: "✓"; position: absolute; left: 0; color: var(--green); font-weight: 700; }

.wrap.narrow { max-width: 720px; }

/* --- video playlist (videos.astro) --------------------------------------- */
.player { display: grid; grid-template-columns: 1fr 330px; gap: 20px; align-items: start; }
.player-main video { width: 100%; display: block; border-radius: var(--radius); background: #000; }
.player-main h3 { margin: 14px 0 0; }

.playlist { list-style: none; margin: 0; padding: 6px; max-height: 62vh; overflow-y: auto;
            border: 1px solid var(--border-soft); border-radius: var(--radius-sm); background: var(--card); }
.playlist li { margin: 0; }
.pl-item { display: flex; align-items: center; gap: 11px; width: 100%; padding: 7px;
           border: 0; border-radius: var(--radius-sm); background: none; text-align: left;
           font: inherit; color: inherit; cursor: pointer; }
.pl-item:hover { background: var(--surface); }
.pl-item.is-active { background: rgba(0,122,255,.1);
                     box-shadow: inset 3px 0 0 var(--accent); }
.pl-item img { width: 84px; flex: none; border-radius: 6px; display: block; }
.pl-text { min-width: 0; }
.pl-text b { display: block; font-size: 14px; line-height: 1.3; font-family: var(--font-body); font-weight: 700; color: var(--text); }
.pl-text span { font-size: 12.5px; color: var(--text-2); }
.pl-time { margin-left: auto; padding-left: 6px; font-size: 12px; color: var(--text-3);
           font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

@media (max-width: 860px) {
    .player { grid-template-columns: 1fr; }
    .playlist { max-height: 46vh; }
}

/* --- responsive ------------------------------------------------------------ */
@media (max-width: 900px) {
    .feature-row { grid-template-columns: 1fr; gap: 28px; }
    .feature-row:nth-child(even) .feature-text { order: 0; }
    .features.bleed .shot .shot-frame,
    .features.bleed .feature-row:nth-child(even) .shot .shot-frame {
        border-radius: 18px; box-shadow: 0 10px 30px rgba(0,0,0,.12); }
    .footer-cols { grid-template-columns: 1fr 1fr; }
    .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .tiles { grid-template-columns: repeat(2, 1fr); }
    .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    /* .nav-links goes position:fixed below (an off-canvas panel, not a flex
       item anymore), so it no longer pushes .menu-btn to the right edge the
       way it does on desktop -- margin-left:auto has to do that job here. */
    .menu-btn { display: block; margin-left: auto; }
    .nav-links {
        position: fixed; inset: 64px 0 0 0; background: var(--bg); flex-direction: column;
        align-items: flex-start; padding: 20px 24px; gap: 16px; transform: translateX(100%);
        transition: transform .2s; overflow-y: auto; border-top: 1px solid var(--border-soft);
    }
    .nav-links.open { transform: translateX(0); }
    .stats { grid-template-columns: repeat(2, 1fr); }
    .stats div:nth-child(2) { border-right: 0; }
    .footer-cols, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .tiles { grid-template-columns: 1fr; }
    .footer-base { flex-direction: column; align-items: flex-start; }
}
