/* Pangalin — shared styles. Brand: forest green #026034, crimson #D90C1D, Montserrat. */
@font-face {
  font-family: "Montserrat";
  src: url("/assets/fonts/montserrat-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  /* Colour ROLES — dark mode redefines these, never the rules below. */
  --ink: #092f22;           /* body text */
  --green: #026034;         /* accent: links, eyebrows, borders, focus */
  --green-soft: rgba(2, 96, 52, .06);
  --badge-line: rgba(2, 96, 52, .18);
  --red: #d90c1d;
  --paper: #f5f6f1;         /* page background */
  --card: #ffffff;
  --line: #dce4dc;
  --muted: #4d685c;
  --prose: #24473a;
  --btn-bg: #026034;        /* primary button */
  --btn-fg: #ffffff;
  --btn-hover: #092f22;
  --btn-line: #026034;      /* outline button border + text */
  --band: #092f22;          /* dark statement band — stays dark in both modes */
  --radius: 18px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #e8efe9;
    --green: #039b54;         /* forest green brightened to read on black (5.2:1) */
    --green-soft: rgba(3, 155, 84, .12);
    --badge-line: rgba(3, 155, 84, .40);
    --paper: #0c1511;
    --card: #13201a;
    --line: #26382e;
    --muted: #a9beb2;
    --prose: #cfdcd3;
    /* buttons keep the corporate forest green in dark mode (white text 7.7:1);
       outline buttons use the same hue brightened to #039b54 so a thin border reads on black */
    --btn-bg: #026034;
    --btn-fg: #ffffff;
    --btn-hover: #0a7a45;
    --btn-line: #039b54;
    --band: #0f3a2a;
  }
}
:root[data-theme="dark"] {
    --ink: #e8efe9;
    --green: #039b54;         /* forest green brightened to read on black (5.2:1) */
    --green-soft: rgba(3, 155, 84, .12);
    --badge-line: rgba(3, 155, 84, .40);
    --paper: #0c1511;
    --card: #13201a;
    --line: #26382e;
    --muted: #a9beb2;
    --prose: #cfdcd3;
    /* buttons keep the corporate forest green in dark mode (white text 7.7:1);
       outline buttons use the same hue brightened to #039b54 so a thin border reads on black */
    --btn-bg: #026034;
    --btn-fg: #ffffff;
    --btn-hover: #0a7a45;
    --btn-line: #039b54;
    --band: #0f3a2a;
  }
/* Logo swap: light artwork on dark backgrounds */
.logo-dark { display: none !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-light { display: none !important; }
  :root:not([data-theme="light"]) .logo-dark { display: block !important; }
}
:root[data-theme="dark"] .logo-light { display: none !important; }
:root[data-theme="dark"] .logo-dark { display: block !important; }

* { box-sizing: border-box; }
html { font-size: 93.75%; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
body {
  margin: 0; color: var(--ink); background: var(--paper);
  font-family: "Montserrat", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1rem; line-height: 1.6;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; border-radius: 6px; }
.wrap { width: min(1180px, calc(100% - 48px)); margin-inline: auto; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--band); color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 16px; }

/* Header */
.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 16px 28px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand .mark { width: 44px; }
.brand .word { width: 122px; }
.site-nav { display: flex; gap: 28px; font-size: .92rem; font-weight: 600; }
.site-nav a { white-space: nowrap; text-decoration: none; padding: 6px 0; border-bottom: 2px solid transparent; }
.site-nav a:hover { color: var(--green); }
.site-nav a[aria-current="page"] { color: var(--green); border-bottom-color: var(--green); }

/* Type */
.eyebrow { color: var(--green); font-size: .78rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; margin: 0; }
h1, h2, h3 { line-height: 1.05; letter-spacing: -.035em; margin: 0; }
h1 { font-size: clamp(1.6rem, 3vw, 2.6rem); font-weight: 800; }  /* same scale as the statement band */
h2 { font-size: clamp(1.5rem, 2.6vw, 2.2rem); font-weight: 800; }
h3 { font-size: 1.1rem; font-weight: 700; letter-spacing: -.02em; }
.lede { color: var(--muted); font-size: clamp(1rem, 1.3vw, 1.1rem); line-height: 1.55; max-width: 560px; margin: 0; }
.muted { color: var(--muted); }

/* Buttons */
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 22px; border-radius: 999px; font-weight: 700; font-size: .95rem; text-decoration: none; border: 1.5px solid var(--btn-line); transition: background-color .2s, color .2s; }
/* long labels ("Buy Pangalin Space Manager · $25/year") wrap to two centred, balanced lines on phones */
.btn { text-align: center; text-wrap: balance; }
.btn-primary { background: var(--btn-bg); color: var(--btn-fg); border-color: var(--btn-bg); }
.btn-primary:hover { background: var(--btn-hover); border-color: var(--btn-hover); }
.btn-ghost { color: var(--btn-line); }
.btn-ghost:hover { background: var(--green-soft); }
.badge { display: inline-block; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--green); background: var(--green-soft); border: 1px solid var(--badge-line); padding: 4px 10px; border-radius: 999px; }

/* Sections */
section { padding: 72px 0; }
.rule { height: 1px; background: var(--line); }
.hero { padding: 72px 0 64px; display: grid; grid-template-columns: 1.15fr .85fr; align-items: center; gap: 50px; }
.hero h1 { margin: 14px 0 20px; }
.hero-mark { justify-self: start; width: min(100%, 280px); }
.section-head { display: grid; grid-template-columns: 260px 1fr; gap: 45px; align-items: start; margin-bottom: 48px; }
.section-head .label { font-size: 1rem; font-weight: 700; margin: 6px 0 0; }
.section-head p.big { margin: 0; max-width: 760px; font-size: clamp(1.25rem, 2.1vw, 1.8rem); letter-spacing: -.025em; line-height: 1.2; font-weight: 600; }

/* Featured product */
.feature { background: var(--card); border: 1px solid var(--line); border-radius: 28px; padding: clamp(24px, 3.5vw, 44px); display: grid; grid-template-columns: auto 1fr; gap: clamp(20px, 3vw, 40px); align-items: center; }
.feature { align-items: start; }
/* icon top lines up with the headline, not the small badge above it (badge 27px + h2 margin 10px) */
.feature .app-icon { width: clamp(72px, 8vw, 104px); margin-top: 37px; }
.feature h2 { margin: 10px 0 10px; font-size: clamp(1.25rem, 1.9vw, 1.6rem); }

/* Product grid */
.products { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.product { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; display: flex; flex-direction: column; gap: 14px; min-height: 250px; text-decoration: none; transition: border-color .2s, transform .2s; }
a.product:hover { border-color: var(--green); transform: translateY(-2px); }
.product .top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.product .icon { width: 64px; }
.product p { margin: 0; color: var(--muted); font-size: .95rem; line-height: 1.5; }
.product .meta { margin-top: auto; font-size: .82rem; font-weight: 700; color: var(--green); }
.product.upcoming { background: transparent; border-style: dashed; }
.product.upcoming ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.product.upcoming li { font-size: .92rem; color: var(--muted); }
.product.upcoming li strong { color: var(--ink); font-weight: 700; }

/* Product page */
.p-hero { padding: 80px 0 64px; display: grid; grid-template-columns: 1fr auto; gap: 40px; align-items: center; }
.p-hero .app-icon { width: clamp(120px, 16vw, 200px); }
.p-hero h1 { margin: 16px 0 20px; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.facts div { padding: 22px 20px 22px 0; }
.facts dt { font-size: .75rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--green); }
.facts dd { margin: 4px 0 0; font-weight: 600; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.card h3 { margin-bottom: 10px; }
.card p { margin: 0; color: var(--muted); font-size: .96rem; }
.card .num { display: block; color: var(--green); font-size: .8rem; font-weight: 800; margin-bottom: 14px; }

/* Storage bar illustration */
.storage { background: var(--card); border: 1px solid var(--line); border-radius: 28px; padding: clamp(24px, 4vw, 44px); }
.storage .bar { display: flex; height: 28px; border-radius: 10px; overflow: hidden; gap: 3px; margin: 20px 0 18px; }
.storage .bar span { display: block; }
.storage .legend { display: flex; flex-wrap: wrap; gap: 10px 24px; margin: 0; padding: 0; list-style: none; font-size: .9rem; font-weight: 600; }
.storage .legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 8px; vertical-align: -1px; }
.s-system { background: #9fb3a8; } .s-apps { background: #026034; } .s-clutter { background: #d90c1d; } .s-move { background: #3f8f68; } .s-cloud { background: #c9d8cf; } .s-free { background: #eef2ee; }

/* Pricing */
.price { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.price .card h3 { font-size: 1.25rem; }
.price .card .tag { font-size: .8rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--green); margin: 0 0 10px; }
.price ul { margin: 14px 0 0; padding-left: 1.1em; color: var(--muted); }
.price li { margin-bottom: 6px; }

/* Statement band */
.statement { background: var(--band); color: #fff; padding: 0; }
.statement .wrap { padding: 72px 0; }
.statement p { margin: 0; max-width: 800px; font-size: clamp(1.6rem, 3vw, 2.6rem); line-height: 1.08; letter-spacing: -.035em; font-weight: 800; }
/* the pangolin sits on the last line, right after the final word */
.statement .band-mark { display: inline-block; width: 2.4em; height: auto; margin-left: .3em; vertical-align: -.08em; filter: brightness(0) invert(1); }

/* Prose pages (legal, support) */
.prose { max-width: 760px; padding: 72px 0 96px; }
.prose h1 { font-size: clamp(1.6rem, 2.8vw, 2.3rem); margin: 14px 0 12px; }
.prose h2 { font-size: 1.35rem; margin: 48px 0 12px; }
.prose h3 { font-size: 1.1rem; margin: 28px 0 8px; }
.prose p, .prose li { color: var(--prose); }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: 6px; }
.prose .updated { color: var(--muted); font-size: .9rem; margin: 0; }
.prose .callout { background: var(--green-soft); border-left: 3px solid var(--green); border-radius: 6px; padding: 16px 20px; margin: 20px 0; }
.prose ul.disclosures { list-style: none; padding-left: 0; }
.prose ul.disclosures li { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; margin-bottom: 10px; }
.prose ul.disclosures strong { color: var(--ink); }
.prose code { background: var(--green-soft); padding: 1px 6px; border-radius: 5px; font-size: .9em; }
.toc { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 24px; margin: 28px 0 0; }
.toc ul { margin: 6px 0 0; padding-left: 1.1em; }
/* Support: contact line + the two cards */
.support-contact { align-items: center; flex-wrap: wrap; }
.email-raw { color: var(--muted); font-size: .95rem; }
.email-raw strong { color: var(--ink); user-select: all; }
.copy-email { margin-left: 6px; font: inherit; font-size: .82rem; font-weight: 700; color: var(--btn-line); background: none; border: 1.5px solid var(--line); border-radius: 999px; padding: 3px 11px; cursor: pointer; }
.copy-email:hover { background: var(--green-soft); }
.support-cards { margin-top: 44px; }
.resend-form { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0 8px; }
.resend-form input { flex: 1 1 240px; min-width: 0; font: inherit; font-size: .98rem; padding: 11px 16px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); }
.resend-form input:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }
.resend-form button[disabled] { opacity: .6; cursor: progress; }
.resend-status { min-height: 1.5em; color: var(--muted); font-size: .95rem; margin: 0; }
.prose .support-cards h2 { font-size: 1.1rem; margin: 0 0 12px; }
.support-cards ul { margin: 0; }
.support-cards li:last-child { margin-bottom: 0; }
.guide-links { list-style: none; padding-left: 0 !important; }
.guide-links a { text-decoration: none; color: var(--green); font-weight: 600; }
.guide-links a:hover { text-decoration: underline; }
details { border-bottom: 1px solid var(--line); padding: 16px 0; }
details summary { cursor: pointer; font-weight: 700; list-style-position: outside; }
details p { margin: 10px 0 0; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 56px 0 36px; font-size: .9rem; color: var(--muted); }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px; }
.footer-grid h2 { font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink); margin: 0 0 12px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-grid a { text-decoration: none; }
.footer-grid .follow-h { margin-top: 22px; }
.footer-grid a:hover { color: var(--green); text-decoration: underline; }
.footer-brand img { width: 120px; margin-bottom: 12px; }
.footer-legal { margin-top: 44px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: .84rem; }

/* Responsive */
@media (max-width: 900px) {
  .products, .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .facts { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .wrap { width: calc(100% - 32px); }
  section { padding: 48px 0; }
  .site-header .wrap { padding: 14px 0; }
  .site-nav { width: 100%; gap: 18px; font-size: .84rem; }
  .hero { padding: 44px 0 40px; grid-template-columns: 1fr; gap: 28px; }
  .hero-mark { justify-self: start; width: 220px; }
  .section-head { grid-template-columns: 1fr; gap: 14px; margin-bottom: 32px; }
  .feature { grid-template-columns: 1fr; }
  .feature .app-icon { margin-top: 0; }
  .p-hero { grid-template-columns: 1fr; padding: 48px 0 40px; }
  .p-hero .app-icon { order: -1; width: 120px; }
  .price, .grid-2 { grid-template-columns: 1fr; }
  .statement .wrap { padding: 52px 0; }
}
@media (max-width: 520px) {
  .products, .grid-3 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .product { min-height: 0; } /* stacked: height from content, no gap above the link */
}
.section-head:last-child { margin-bottom: 0; }
section.wrap + section.wrap { padding-top: 0; }
.products.products-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 520px) { .products.products-2 { grid-template-columns: 1fr; } }
summary:focus-visible, [tabindex="0"]:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; border-radius: 6px; }

/* About page flat pangolin: static */
.hero-mark img { width: 100%; }

/* Homepage pangolin: the detailed mark, shown straight away, with "Meet Kala" under it. */
.hero-live { position: relative; justify-self: start; align-self: end; width: min(100%, 320px); aspect-ratio: 480 / 198; } /* feet sit on the buttons' baseline */
.hero-live .flat { position: absolute; width: 102%; max-width: none; left: -2.3%; top: -6.4%; }
/* the morph: 3D dissolves as the flat logo sharpens into the same outline */
@media (max-width: 760px) { .hero-live { justify-self: start; width: 230px; } }

/* Even line breaks for display text: no single word left alone on the last line */
h1, h2, h3, .statement p, .section-head p.big { text-wrap: balance; }

/* A saved choice also sets the browser's own form controls and scrollbars */
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

/* ---- Light/dark switch (assets/theme.js). Moon = "go dark", sun = "go light". ---- */
.theme-toggle { display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--ink); cursor: pointer; flex: none; transition: border-color .2s, color .2s; }
.theme-toggle:hover { border-color: var(--green); color: var(--green); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .i-sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .i-sun { display: block; }
}
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
.site-header .wrap { position: relative; }
@media (max-width: 760px) { .site-header .theme-toggle { position: absolute; top: 14px; right: 0; } }
/* keep the menu on the right with the switch beside it (not centred between logo and switch) */
.site-nav { margin-left: auto; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Header Products menu (built by build.py from PRODUCTS; behaviour in nav.js) */
.site-nav { align-items: center; }
.nav-menu { position: relative; }
.nav-menu-btn { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.nav-menu-btn .chev { width: 12px; height: 12px; transition: transform .15s; }
.nav-menu-btn[data-current] { color: var(--green); border-bottom-color: var(--green); }
.nav-menu-panel { position: absolute; top: calc(100% + 10px); left: 50%; transform: translateX(-50%); z-index: 20;
  width: 300px; padding: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 18px 40px -18px rgba(9, 47, 34, .35); display: none; }
.nav-menu-panel::before { content: ""; position: absolute; left: 0; right: 0; top: -12px; height: 12px; } /* hover bridge */
.nav-menu.open .nav-menu-panel { display: block; }
html:not(.js) .nav-menu:hover .nav-menu-panel, html:not(.js) .nav-menu:focus-within .nav-menu-panel { display: block; }
.nav-menu.open .nav-menu-btn .chev { transform: rotate(180deg); }
.site-nav .nav-menu-panel a { display: flex; align-items: center; gap: 12px; padding: 10px; border: 0; border-radius: 10px; white-space: normal; }
.site-nav .nav-menu-panel a:hover, .site-nav .nav-menu-panel a:focus-visible { background: var(--green-soft); color: inherit; }
.site-nav .nav-menu-panel a[aria-current="page"] b { color: var(--green); }
.nav-menu-panel img { width: 36px; height: 36px; flex: none; }
.nav-menu-panel span { display: grid; gap: 2px; }
.nav-menu-panel b { font-weight: 700; font-size: .92rem; }
.nav-menu-panel small { color: var(--muted); font-weight: 500; font-size: .8rem; }
.site-nav .nav-menu-panel a.all { margin-top: 4px; border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; color: var(--green); font-size: .85rem; }
@media (max-width: 760px) {
  .nav-menu-panel { left: 0; transform: none; width: min(300px, calc(100vw - 32px)); }
}

/* Homepage "Get both" (one checkout for both products) */
.bundle { margin-top: 18px; display: flex; align-items: center; justify-content: space-between; gap: 18px 28px; flex-wrap: wrap;
  padding: 22px 26px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.bundle h3 { margin: 0 0 6px; font-size: 1.05rem; }
.bundle p { margin: 0; color: var(--muted); font-size: .95rem; line-height: 1.5; max-width: 62ch; }
.bundle [data-bundle-price] { color: var(--ink); font-weight: 700; white-space: nowrap; }
@media (max-width: 760px) { .bundle .btn { width: 100%; } }
.resend-form .resend-status { flex-basis: 100%; }
.prose p.small { font-size: .88rem; color: var(--muted); margin-top: 4px; }

/* Buy pages (/buy/<app>/): site header above Polar's embedded checkout */
.buy { max-width: 640px; padding: 40px 0 80px; }
.buy-back { margin: 0 0 20px; font-size: .95rem; }
.buy-back a { color: var(--green); text-decoration: none; font-weight: 600; }
.buy-back a:hover { text-decoration: underline; }
.buy-head { display: flex; gap: 16px; align-items: center; margin-bottom: 24px; }
.buy-icon { width: 56px; height: 56px; border-radius: 14px; flex: none; }
.buy-head h1 { font-size: clamp(1.4rem, 2.4vw, 1.8rem); margin: 0 0 4px; }
.buy-head p { margin: 0; color: var(--muted); }
.buy-checkout { min-height: 420px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; }
.buy-loading { margin: 0; padding: 40px 16px; text-align: center; color: var(--muted); }
.buy-fallback { margin: 16px 0 0; font-weight: 600; }
.buy-note { margin: 20px 0 0; font-size: .85rem; color: var(--muted); }

/* Footer news sign-up */
.news-form { margin-top: 18px; max-width: 340px; }
.news-form label { display: block; color: var(--ink); font-weight: 600; margin-bottom: 8px; }
.news-row { display: flex; gap: 8px; }
.news-row input { flex: 1; min-width: 0; font: inherit; padding: 9px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink); }
.news-row input:focus { outline: 2px solid var(--green); outline-offset: 1px; }
.news-row .btn { padding: 9px 16px; font-size: .9rem; }
.news-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.news-msg { margin: 8px 0 0; color: var(--ink); min-height: 0; }
.news-msg:empty { display: none; }
.news-fine { margin: 6px 0 0; font-size: .8rem; }

/* 404: the badge as the zero, and Kala */
.e404 { text-align: center; }
.e404 .lede { margin-left: auto; margin-right: auto; }
.e404 .actions { justify-content: center; }
.prose .e404-code { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 0 0 8px; font-weight: 800; font-size: clamp(5rem, 14vw, 9rem); line-height: 1; color: var(--green); }
.e404-code img { width: .95em; height: .95em; }
.e404-note { margin: 6px 0 0; font-size: .9rem; color: var(--muted); }

/* About: Kala */
.kala { display: flex; align-items: center; gap: 18px; margin-top: 22px; }
.kala img { width: 96px; height: 96px; flex: none; }
.kala .lede { margin: 0; }

/* Homepage: name the mascot */
.hero-live .kala-tag { position: absolute; left: 0; right: 0; top: calc(100% + 14px); text-align: center; font-size: .85rem; font-weight: 600; color: var(--muted); text-decoration: none; }
.hero-live .kala-tag:hover { color: var(--green); text-decoration: underline; }

/* Kala Roll: the pixel game on the 404 page */
.kala-roll { margin: 26px auto 0; max-width: 720px; }
.kala-roll canvas { display: block; width: 100%; height: auto; aspect-ratio: 200 / 60; image-rendering: pixelated; image-rendering: crisp-edges; border: 1px solid var(--line); border-radius: 12px; background: var(--card); cursor: pointer; touch-action: manipulation; -webkit-user-select: none; user-select: none; }
.kala-roll-help { margin: 8px 0 0; font-size: .85rem; color: var(--muted); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Kala's arcade (/games/ and the 404 page) */
.arcade { padding: 56px 0 80px; }
.arcade .lede { max-width: 720px; }
.arcade-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 26px 0 16px; }
.arcade-tabs button { font: inherit; font-weight: 700; font-size: .9rem; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--btn-line); background: transparent; color: var(--green); cursor: pointer; }
.arcade-tabs button.on { background: var(--btn-bg); color: var(--btn-fg); }
.arcade-main { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 22px; align-items: start; }
.arcade-canvas { display: block; width: 100%; height: auto; image-rendering: pixelated; image-rendering: crisp-edges; border: 1px solid var(--line); border-radius: 12px; background: var(--card); cursor: pointer; touch-action: none; -webkit-user-select: none; user-select: none; }
.arcade-help { margin: 8px 0 0; font-size: .88rem; color: var(--muted); }
.arcade-board { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.arcade-board h2 { margin: 0 0 8px; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; }
.arcade-board .scores { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-variant-numeric: tabular-nums; }
.arcade-board .scores li { display: grid; grid-template-columns: 22px 1fr auto; gap: 6px; font-size: .9rem; }
.arcade-board .scores li.muted { display: block; color: var(--muted); }
.arcade-board .scores li.me { color: var(--green); font-weight: 700; }
.arcade-board .rank { color: var(--muted); }
.arcade-board .save { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.arcade-board .save p { margin: 0 0 8px; font-size: .9rem; }
.arcade-board .save-row { display: flex; gap: 6px; }
.arcade-board .save-row input { flex: 1; min-width: 0; font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--ink); text-transform: uppercase; }
.arcade-board .save-row .btn { padding: 8px 14px; font-size: .88rem; }
.arcade-board .fine, .arcade-board .save-msg { margin: 6px 0 0; font-size: .8rem; color: var(--muted); }
.arcade-note { margin-top: 18px; font-size: .85rem; color: var(--muted); }
@media (max-width: 760px) { .arcade-main { grid-template-columns: 1fr; } }
.arcade-404 { margin: 26px auto 0; max-width: 980px; text-align: left; }
.arcade-canvas:focus { outline: none; }
.arcade-canvas:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.prose ol.steps { padding-left: 1.4em; display: grid; gap: 8px; }
.prose ol.steps li::marker { color: var(--green); font-weight: 800; }

/* Welcome pages: first step for new buyers */
.start-here { margin-top: 14px; padding: 14px 18px; border-radius: var(--radius); background: var(--green-soft); border: 1px solid var(--badge-line); }

/* Conversion strategy: help guides, checklists, "Best value", reply time, touch targets */
.start-here p { margin: 0 0 6px; }
.start-here ol { margin: 0; padding-left: 1.3em; }
.start-here li { margin-bottom: 4px; }
.card-link { display: block; text-decoration: none; color: inherit; transition: border-color .2s, transform .2s; }
.card-link:hover { border-color: var(--green); transform: translateY(-2px); }
.card-link h2, .card-link h3 { color: var(--ink); }
.help-list { display: grid; gap: 14px; margin-top: 28px; }
.help-list .card h2 { font-size: 1.15rem; margin: 0 0 6px; }
.prose .checklist { padding-left: 1.4em; }
.prose .checklist li { margin-bottom: 12px; }
.prose kbd { font: inherit; font-size: .85em; padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; background: var(--card); }
.help-cta { margin-top: 48px; padding: 28px; border-radius: var(--radius); background: var(--card); border: 2px solid var(--green); }
.help-cta h2 { margin-top: 0; }
.help-cta .actions { margin-top: 18px; }
.assure { margin: 12px 0 0; font-size: .84rem; color: var(--muted); }
.best { display: inline-block; margin-left: 8px; padding: 2px 9px; border-radius: 999px; font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; vertical-align: middle; color: var(--btn-fg); background: var(--btn-bg); }
.site-footer .reply-time { color: var(--muted); font-size: .85em; }
@media (pointer: coarse) {
  .theme-toggle { width: 44px; height: 44px; }
  .brand { min-height: 44px; }
}
.prose code { overflow-wrap: anywhere; }
.table-wrap { overflow-x: auto; margin: 16px 0 8px; }
.compare-table { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 560px; }
.compare-table th, .compare-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--prose); }
.compare-table thead th { color: var(--ink); font-weight: 800; }
.compare-table tbody th { color: var(--ink); font-weight: 700; }
.compare-table td:last-child { color: var(--ink); font-weight: 600; background: var(--green-soft); }

/* Layout v2 (benchmark): solid priced Buy, terms line, trust strip, home pricing with the bundle featured */
.btn-buy { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn-buy:hover { opacity: .88; }
.hero .terms { margin: 14px 0 0; font-size: .9rem; font-weight: 600; color: var(--muted); }
.hero .trust-strip { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 18px 0 0; padding: 0; font-size: .88rem; font-weight: 600; color: var(--ink); }
.hero .trust-strip li::before { content: "✓"; color: var(--green); font-weight: 800; margin-right: 7px; }
.price-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; align-items: stretch; max-width: 860px; margin: 0 auto; }
.price-card { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 28px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); }
.price-card h3 { margin: 0; font-size: 1.2rem; }
.price-card img { width: 48px; height: 48px; }
.price-card .amount { margin: 0; color: var(--muted); }
.price-card .amount b { font-size: 2rem; letter-spacing: -.04em; color: var(--ink); }
.price-card p { margin: 0; color: var(--muted); font-size: .95rem; }
.price-card .btn { margin-top: auto; }
.price-card .more { font-size: .88rem; font-weight: 600; color: var(--green); text-decoration: none; text-align: center; }
.price-card.featured { border: 2px solid var(--green); box-shadow: 0 18px 40px rgba(2, 96, 52, .14); padding-top: 34px; }
@media (min-width: 900px) { .price-card.featured { transform: translateY(-10px); } }
.price-card .ribbon { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); padding: 4px 14px; border-radius: 999px; background: var(--btn-bg); color: var(--btn-fg); font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.price-card .value-line { color: var(--green); font-weight: 600; }
.price-terms { margin: 22px 0 0; font-size: .86rem; color: var(--muted); text-align: center; }
@media (max-width: 899px) { .price-grid { grid-template-columns: 1fr; max-width: 520px; margin: 0 auto; } .price-card.featured { order: -1; } }

/* Home v3: lead with the problem and the product (visual review, 4 Oct) */
.hero-home { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); padding-top: 56px; }
.hero-home h1 { font-size: clamp(2.3rem, 4.4vw, 3.6rem); }
.hero-shot { margin: 0; }
.hero-shot img { display: block; width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--line); box-shadow: 0 24px 60px rgba(9, 47, 34, .16); }
.hero-shot figcaption { margin-top: 10px; font-size: .85rem; color: var(--muted); }
.hero-shot figcaption a { color: var(--green); font-weight: 600; text-decoration: none; }
.hero .trust-strip li { display: inline-flex; align-items: center; gap: 7px; }
.hero .trust-strip li::before { content: none; }
.hero .trust-strip svg { width: 18px; height: 18px; color: var(--green); flex: none; }
.product-shot { display: block; width: 100%; height: 150px; object-fit: cover; object-position: left top; border-radius: 10px; border: 1px solid var(--line); }
.kala-link { font-size: .9rem; font-weight: 600; color: var(--green); text-decoration: none; white-space: nowrap; }
@media (max-width: 900px) { .hero-home { grid-template-columns: 1fr; } .hero-shot { order: 2; } }

/* Whole-site audit: header CTA and a closing call-to-action band */
.site-nav .nav-cta { margin-left: 4px; color: var(--btn-fg); }
.site-nav .nav-cta:hover { color: var(--btn-fg); }
.cta-band { margin-top: 24px; margin-bottom: 24px; }
.cta-band-box { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding: 28px 32px; border-radius: var(--radius); background: var(--card); border: 2px solid var(--green); }
.cta-band-box h2 { margin: 0 0 6px; font-size: 1.3rem; }
.cta-band-box p { margin: 0; color: var(--muted); max-width: 60ch; }
.site-nav a.nav-cta { padding: 9px 18px; border: 1.5px solid var(--btn-bg); border-radius: 999px; }
@media (max-width: 760px) { .site-nav .nav-cta { display: none; } }
/* Header Download menu: pick the app */
.nav-download .nav-menu-panel { left: auto; right: 0; transform: none; }
.site-nav .nav-download .nav-menu-btn { color: var(--btn-fg); border-bottom: 1.5px solid var(--btn-bg); }
.nav-download .nav-menu-btn .chev { color: var(--btn-fg); }
@media (max-width: 760px) { .site-nav .nav-download { display: none; } }

/* Terms line: each item stays whole; separators sit between items, so lines only break between them */
.terms span { white-space: nowrap; }
.terms span { display: block; }

/* "How did you find us?" (welcome and download pages) */
.heard { margin: 28px 0 0; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; }
.heard-q { margin: 0 0 10px; font-weight: 700; }
.heard-q span { font-weight: 400; color: var(--muted); font-size: .9em; margin-left: 6px; }
.heard-row { display: flex; flex-wrap: wrap; gap: 8px; }
.heard-row button { font: inherit; font-size: .92rem; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: inherit; cursor: pointer; }
.heard-row button:hover { border-color: var(--green); color: var(--green); }
.heard-done { margin: 0; color: var(--muted); }

/* Download page: checksum tucked behind a small link */
.verify-dl { border: 0; padding: 4px 0 0; font-size: .9rem; color: var(--muted); }
.verify-dl summary { font-weight: 400; color: var(--green); }
.verify-dl pre { overflow-x: auto; white-space: pre-wrap; word-break: break-all; }

/* "More on …" links at the end of each help article (build.py related_help) */
.related { margin-top: 8px; margin-bottom: 56px; padding-top: 24px; border-top: 1px solid var(--line); }
.related h2 { font-size: 1.15rem; margin: 0 0 10px; }
.related ul { margin: 0 0 12px; padding-left: 1.2em; }
.related li { margin: 6px 0; }
.byline { color: var(--muted); font-size: .88rem; margin: 6px 0 16px; }
/* Comparison pages that put our app first: highlight the first data column instead of the last */
.compare-table.ours-first td:last-child { color: var(--prose); font-weight: 400; background: none; }
.compare-table.ours-first td:nth-child(2), .compare-table.ours-first thead th:nth-child(2) { color: var(--ink); font-weight: 600; background: var(--green-soft); }
.compare-table .yes { color: var(--green); font-weight: 800; }
.compare-table .no { color: var(--muted); }

/* Help search */
.help-search { margin: 18px 0 8px; }
.help-search input { width: 100%; box-sizing: border-box; padding: 12px 14px; font: inherit; font-size: 1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--card, #fff); color: inherit; }
.help-search input:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }
.help-search-count { color: var(--muted); font-size: .9rem; margin: 12px 0 8px; }
.help-search-results { display: grid; gap: 12px; }
.help-search-tag { font-size: .7rem; font-weight: 700; color: var(--green); border: 1px solid var(--green); border-radius: 999px; padding: 1px 7px; vertical-align: middle; margin-left: 6px; }

/* Copy button on code boxes */
.prose pre.has-copy { position: relative; padding-right: 76px; }
.copy-btn { position: absolute; top: 8px; right: 8px; font: inherit; font-size: .8rem; font-weight: 600; color: var(--green); background: var(--card, #fff); border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; cursor: pointer; }
.copy-btn:hover { border-color: var(--green); }
.copy-btn:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }
.prose code.copyable { cursor: pointer; }
.prose code.copyable:hover { outline: 1px solid var(--green); }
.prose code.copyable.copied::after { content: " ✓ copied"; color: var(--green); font-weight: 600; }
/* Links to the same page in other languages (build.py, translated pages) */
.lang-switch { font-size: .85rem; color: var(--muted); margin: 8px auto 32px; }
.lang-switch a { margin: 0 2px; }

/* "Was this helpful?" at the end of help articles and guides */
.helpful { margin-top: 36px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; }
.helpful-q { margin: 0 0 10px; font-weight: 700; }
.helpful-row { display: flex; flex-wrap: wrap; gap: 8px; }
.helpful-row button { font: inherit; font-size: .92rem; padding: 7px 16px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: inherit; cursor: pointer; }
.helpful-row button:hover, .helpful-row button:focus-visible { border-color: var(--green); }
.helpful-done { margin: 0; }
.helpful [hidden] { display: none !important; }
