/* KL Status Maker — website styles.
   Every color here is lifted from the app's own ui/theme/Color.kt so the site and the app read as
   one product; see docs/appwide-design.md for what each token means in the app. The two rules that
   are load-bearing rather than cosmetic:
   - The Brand* fills are theme-INVARIANT by design (a pill button is the same orange in light and
     dark), so they live outside the light/dark blocks below. Colored text on a bare background is
     the documented exception and uses the -text variants, whose three app counterparts
     (BrandPurpleOnDarkBackground, BrandBlueOnDarkBackground, BrandTealOnLightBackground) are
     copied exactly; the other seven have no counterpart and are the site's own.
   - The two teal washes are the app's ambientGlowBackground(): same hue, same alphas, same centres
     and same radii as a fraction of the canvas. Only the canvas differs - the app's is a phone
     screen, the site's is the viewport, which is what background-attachment: fixed buys. */

:root {
  /* Warm neutrals — light theme */
  --bg: #F3ECE2;
  --surface: #FBF7F1;
  --surface-variant: #E8DBC7;
  --on-bg: #1C1B18;
  --on-muted: #4D453C;
  --outline: #7E7466;
  /* SCREEN_GLOW_ALPHA_LIGHT = 0.15, and the trailing wash at SCREEN_GLOW_TRAILING_SCALE = 0.65 of
     it. Written out rather than calc()'d into rgba() so the two figures are greppable against
     ScreenBackground.kt. */
  --glow-lead: rgba(43, 158, 137, 0.15);
  --glow-trail: rgba(43, 158, 137, 0.0975);
  --glow-none: rgba(43, 158, 137, 0);
  --card-shadow: 0 1px 2px rgba(28, 27, 24, .06), 0 8px 24px rgba(28, 27, 24, .06);

  /* Brand action colors — identical in both themes, exactly as in the app */
  --orange: #D58128;
  --orange-ink: #0C0A08;
  --orange-lip: #5B3711;
  --teal: #2B9E89;
  --teal-lip: #12443B;
  --rose: #D9527A;
  --rose-lip: #5D2334;
  --blue: #3D5A99;
  --blue-lip: #1A2642;
  --purple: #973F82;
  --purple-lip: #401B37;

  /* Text-on-background variants (contrast-corrected, per Color.kt's own note). The teal one is
     BrandTealOnLightBackground verbatim; the other four have no app counterpart. */
  --orange-text: #8A4E0D;
  --teal-text: #1A6355;
  --rose-text: #A93055;
  --blue-text: #3D5A99;
  --purple-text: #7C3169;

  /* Shapes — Shape.kt */
  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-xl: 32px;

  --maxw: 1080px;
  --readw: 720px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #292521;
    --surface: #2E2A25;
    --surface-variant: #3E3932;
    --on-bg: #F0EAE2;
    --on-muted: #CFC6BA;
    --outline: #94897C;
    /* SCREEN_GLOW_ALPHA_DARK = 0.22, trailing at 0.65 of it. */
    --glow-lead: rgba(43, 158, 137, 0.22);
    --glow-trail: rgba(43, 158, 137, 0.143);
    --card-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    --orange-text: #E8A05B;
    --teal-text: #7DD8D0;
    --rose-text: #F08AA8;
    --blue-text: #93A9D6;
    --purple-text: #D79AC7;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background-color: var(--bg);
  /* ambientGlowBackground(), copied rather than rescaled - unlike the stripes it replaced, which
     had to be (a 36dp repeat is a frequency, and a frequency does not survive a change of canvas).
     Every number here is a FRACTION of the canvas in the app too, so the same values hold on a
     desktop page: centres at 8%/4% and 102%/94%, radii of 0.72 and 0.62 of the longest side.
     `max(100vw, 100vh)` is size.maxDimension; background-attachment: fixed is what makes the
     canvas the viewport rather than the (much taller) document, which is the app's own screen. */
  background-image:
    radial-gradient(circle calc(max(100vw, 100vh) * 0.72) at 8% 4%,
      var(--glow-lead) 0%, var(--glow-none) 100%),
    radial-gradient(circle calc(max(100vw, 100vh) * 0.62) at 102% 94%,
      var(--glow-trail) 0%, var(--glow-none) 100%);
  background-attachment: fixed;
  color: var(--on-bg);
  font-family: Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--orange); color: var(--orange-ink);
  padding: .75rem 1.25rem; border-radius: 0 0 var(--r-sm) 0; font-weight: 700;
}
.skip:focus { left: 0; }

/* ---------- Type ---------- */

h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; font-weight: 700; letter-spacing: -0.02em; }
h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.1rem); }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); margin-top: 2.2em; }
h3 { font-size: 1.2rem; margin-top: 1.8em; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
a { color: var(--orange-text); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
ul, ol { padding-left: 1.35em; }
li { margin: .35em 0; }
strong { font-weight: 700; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; background: var(--surface-variant); padding: .1em .35em; border-radius: var(--r-xs); }
.plain { list-style: none; padding: 0; margin: 0; }
.lede { font-size: 1.15rem; color: var(--on-muted); }
.muted { color: var(--on-muted); }

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid color-mix(in srgb, var(--outline) 30%, transparent);
}
.header-inner { display: flex; align-items: center; gap: 1rem; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 700; color: var(--on-bg); text-decoration: none; font-size: 1.02rem; letter-spacing: -0.01em; white-space: nowrap; }
.brand img { border-radius: var(--r-xs); }
.site-nav { display: flex; gap: 1.1rem; margin-left: auto; }
.site-nav a { color: var(--on-muted); text-decoration: none; font-weight: 600; font-size: .96rem; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--on-bg); }
.header-cta { margin-left: .35rem; }
@media (max-width: 640px) {
  .site-header .header-cta { display: none; }
  .site-nav { gap: .85rem; }
}

/* ---------- Buttons: one pill CTA, everything else flat (appwide-design.md 5) ---------- */

.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  border-radius: 999px; padding: .85rem 1.6rem;
  font-weight: 700; font-size: 1rem; text-decoration: none;
  border: 0; cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}
.pill-sm { padding: .5rem 1rem; font-size: .9rem; }
.pill-orange { background: var(--orange); color: var(--orange-ink); box-shadow: 0 5px 0 var(--orange-lip); }
.pill-teal   { background: var(--teal);   color: #fff; box-shadow: 0 5px 0 var(--teal-lip); }
.pill-rose   { background: var(--rose);   color: #fff; box-shadow: 0 5px 0 var(--rose-lip); }
.pill-blue   { background: var(--blue);   color: #fff; box-shadow: 0 5px 0 var(--blue-lip); }
.pill:hover { transform: translateY(1px); box-shadow: 0 4px 0 var(--orange-lip); }
.pill-teal:hover { box-shadow: 0 4px 0 var(--teal-lip); }
.pill-rose:hover { box-shadow: 0 4px 0 var(--rose-lip); }
.pill-blue:hover { box-shadow: 0 4px 0 var(--blue-lip); }
.pill:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--orange-lip); }
@media (prefers-reduced-motion: reduce) { .pill { transition: none; } }

.btn-outline {
  display: inline-flex; align-items: center; gap: .5rem;
  border: 1px solid var(--outline); border-radius: 999px;
  padding: .8rem 1.4rem; font-weight: 600; text-decoration: none; color: var(--on-bg);
}
.btn-outline:hover { border-color: var(--on-bg); }

/* ---------- Hero ---------- */

.hero { padding-block: 3.5rem 1rem; }  /* padding-block, not padding: this element is also a .wrap */
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 3rem; align-items: center; }
.hero h1 { margin-bottom: .35em; }
.hero .lede { font-size: 1.22rem; max-width: 34ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.6rem; }
.hero-meta { margin-top: 1.4rem; font-size: .92rem; color: var(--on-muted); }
.hero-shots { display: flex; gap: 1rem; justify-content: center; }
.hero-shots .phone:nth-child(2) { transform: translateY(28px) rotate(2deg); }
.hero-shots .phone:nth-child(1) { transform: rotate(-2deg); }
@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; gap: 2rem; }
  .hero .lede { max-width: none; }
  .hero-shots .phone:nth-child(2) { display: none; }
}

/* ---------- Phone frame ---------- */

.phone {
  border-radius: var(--r-lg);
  border: 1px solid color-mix(in srgb, var(--outline) 45%, transparent);
  background: #292521;
  padding: 6px;
  box-shadow: var(--card-shadow);
  max-width: 270px;
  flex: 0 0 auto;
}
.phone img { display: block; width: 100%; height: auto; border-radius: 18px; }
.phone-wide { max-width: 320px; }

/* An exported FILE, not a screen — no device frame, so the reader is not shown a phone when the
   thing being demonstrated is the artifact the app wrote. Slightly wider than a .phone since there
   is no bezel eating into it. */
.output {
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  border: 1px solid color-mix(in srgb, var(--outline) 30%, transparent);
  max-width: 300px;
  flex: 0 0 auto;
}
.output img { display: block; width: 100%; height: auto; }

figure.shot { margin: 1.6rem 0; display: flex; flex-direction: column; align-items: center; gap: .7rem; }
figure.shot figcaption { font-size: .9rem; color: var(--on-muted); text-align: center; max-width: 44ch; }

/* ---------- Cards & grids ---------- */

.card {
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--outline) 28%, transparent);
  border-radius: var(--r-lg);
  padding: 1.5rem;
}
.grid { display: grid; gap: 1.1rem; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

a.card { text-decoration: none; color: inherit; display: block; transition: transform .12s ease, border-color .12s ease; }
a.card:hover { transform: translateY(-2px); border-color: var(--outline); }
a.card h3 { margin-top: 0; }
a.card p { margin-bottom: 0; color: var(--on-muted); font-size: .96rem; }
.card .kicker { font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin-bottom: .5rem; }
.kicker.orange { color: var(--orange-text); }
.kicker.rose { color: var(--rose-text); }
.kicker.blue { color: var(--blue-text); }
.kicker.teal { color: var(--teal-text); }
.kicker.purple { color: var(--purple-text); }

/* ---------- Feature rows ---------- */

.feature { display: grid; grid-template-columns: 1fr 300px; gap: 2.5rem; align-items: center; margin: 3.5rem 0; }
.feature:nth-child(even) { grid-template-columns: 300px 1fr; }
.feature:nth-child(even) .feature-text { order: 2; }
.feature ul { margin: 0; }
.feature h2 { margin-top: 0; }
.feature-media { display: flex; justify-content: center; }
@media (max-width: 860px) {
  .feature, .feature:nth-child(even) { grid-template-columns: 1fr; gap: 1.5rem; }
  .feature:nth-child(even) .feature-text { order: 0; }
}

/* ---------- Answer box (the bit AI assistants and featured snippets lift) ---------- */

.answer {
  border-left: 4px solid var(--teal);
  background: var(--surface);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: 1.1rem 1.3rem;
  margin: 1.5rem 0 2rem;
}
.answer p:last-child { margin-bottom: 0; }
.answer .answer-label { font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--teal-text); display: block; margin-bottom: .35rem; }

.note {
  border-left: 4px solid var(--orange);
  background: var(--surface);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: 1rem 1.2rem; margin: 1.5rem 0;
}
.note p:last-child { margin-bottom: 0; }

/* ---------- Steps ---------- */

.steps { list-style: none; padding: 0; margin: 2rem 0; counter-reset: step; }
.steps > li {
  counter-increment: step;
  position: relative;
  padding-left: 3.1rem;
  margin: 0 0 2.2rem;
}
.steps > li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 2.2rem; height: 2.2rem;
  border-radius: 999px;
  background: var(--orange); color: var(--orange-ink);
  display: grid; place-items: center;
  font-weight: 700; font-size: 1rem;
}
.steps.rose > li::before { background: var(--rose); color: #fff; }
.steps.blue > li::before { background: var(--blue); color: #fff; }
.steps.teal > li::before { background: var(--teal); color: #fff; }
.steps.purple > li::before { background: var(--purple); color: #fff; }
.steps h3 { margin: .15rem 0 .4rem; font-size: 1.12rem; }
.steps figure.shot { align-items: flex-start; margin: 1rem 0 0; }

/* ---------- FAQ ---------- */

.faq { margin: 1.5rem 0; }
.faq details {
  border-bottom: 1px solid color-mix(in srgb, var(--outline) 28%, transparent);
  padding: .35rem 0;
}
.faq summary {
  cursor: pointer; padding: .9rem 2rem .9rem 0; font-weight: 600; font-size: 1.04rem;
  list-style: none; position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: .25rem; top: .75rem;
  font-size: 1.5rem; font-weight: 400; color: var(--on-muted); line-height: 1;
}
.faq details[open] summary::after { content: "\2212"; }
.faq details > div { padding: 0 0 1rem; color: var(--on-muted); }
.faq details > div p:last-child { margin-bottom: 0; }

/* ---------- Sections & misc ---------- */

.section { padding-block: 1rem 2rem; }  /* see .hero — never a padding shorthand on a .wrap */
.section-head { max-width: var(--readw); margin-bottom: 1.6rem; }
.prose { max-width: var(--readw); }
.prose h2:first-child { margin-top: 0; }

.breadcrumbs { font-size: .88rem; color: var(--on-muted); padding-block: 1.4rem .2rem; }
.breadcrumbs a { color: var(--on-muted); }
.breadcrumbs span { padding: 0 .4rem; }

.chips { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; padding: 0; margin: 1rem 0 0; }
.chips a {
  display: inline-block; border: 1px solid var(--outline); border-radius: 999px;
  padding: .35rem .9rem; font-size: .88rem; text-decoration: none; color: var(--on-muted);
}
.chips a:hover { color: var(--on-bg); border-color: var(--on-bg); }

.cta-band {
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--outline) 28%, transparent);
  border-radius: var(--r-xl);
  padding: 2.5rem; margin: 3.5rem 0 1rem; text-align: center;
}
.cta-band h2 { margin-top: 0; }
.cta-band p { max-width: 52ch; margin-inline: auto; color: var(--on-muted); }

/* ---------- Tables (legal pages) ---------- */

table { border-collapse: collapse; width: 100%; margin: 1.2rem 0; font-size: .95rem; }
th, td { border: 1px solid color-mix(in srgb, var(--outline) 35%, transparent); padding: .55rem .7rem; text-align: left; vertical-align: top; }
th { background: var(--surface-variant); }

/* ---------- Footer ---------- */

.site-footer {
  margin-top: 4rem; padding: 3rem 0 2rem;
  border-top: 1px solid color-mix(in srgb, var(--outline) 30%, transparent);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  font-size: .95rem;
}
.footer-cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; }
@media (max-width: 720px) { .footer-cols { grid-template-columns: 1fr; gap: 1.5rem; } }
.footer-h { font-size: 1rem; margin-bottom: .6rem; }
.site-footer p { color: var(--on-muted); }
.site-footer a { color: var(--on-muted); text-decoration: none; }
.site-footer a:hover { color: var(--on-bg); text-decoration: underline; }
.site-footer .pill { margin-top: .6rem; }
.fineprint { margin-top: 2.5rem; font-size: .82rem; opacity: .75; }

/* Belt and braces against horizontal overflow on narrow viewports. A single over-wide child
   (an unbroken URL, a wide table on a legal page) would otherwise give the whole document a
   horizontal scrollbar, which is invisible in a desktop render and obvious on a phone. */
html, body { max-width: 100%; overflow-x: hidden; }
img { max-width: 100%; }
table { display: block; overflow-x: auto; }
