/* Shared tokens for togwise.com + doda.land.
   Sources (read-only): the app's tailwind.config.js (Theme v2 "Warmth Meter"),
   src/theme/warmth.ts (the cold→warm ramp), and colours sampled from the real
   emulator screenshots (KEY-card tint). One look with the app and the bedtime chart
   (vision §12 2026-11-15 11:29): Figtree, white cards on cream, the navy top. Figtree is
   self-hosted from /assets (CSP font-src 'self'), preloaded on every page, font-display swap. */

@font-face {
  font-family: "Figtree";
  src: url("/assets/Figtree-wght.2f940894.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;

  /* Light — warm neutrals (tailwind.config.js) */
  --canvas: #f4eee3;
  --surface: #ffffff; /* white cards on the cream page (tailwind surface) */
  --ink: #2c2925;
  --muted: #6a625a;
  --hairline: #e7ddce;
  --accent: #57986c;
  --accent-ink: #2c5a40;
  --key-tint: #eceadd; /* sampled: KEY layer card, light */
  --honey: #e6b450;
  --warm-ink: #8a4b12;
  --caution: #c2410c; /* Hard Stops / car seat (tailwind caution) */
  --trust-strip: #e9efe3; /* the app's trust strip */
  --trust-edge: #cddbc8;
  --trust-ink: #35563e;

  /* Hero — the app's navy top (tailwind navy-top / navy-top-end; dark values below) */
  --hero-top: #17344b;
  --hero-bottom: #132b3e;
  --hero-glow: #24506f;
  --hero-fg: #f3ece0;
  --hero-muted: #a79e92;
  --night-top: #1a172f; /* sampled: sleep hero */
  --night-bottom: #0e0c19;
  --icon-ground: #1c1815; /* gen-icons.py HERO */

  /* Warmth ramp (warmth.ts WARMTH_STOPS) */
  --w-cold: #7fb2f2;
  --w-chilly: #58c1d6;
  --w-cool: #46c2a6;
  --w-mild: #cbb878;
  --w-warm: #ecab5c;
  --w-hot: #ec8863;
  --warmth: linear-gradient(90deg, var(--w-cold), var(--w-chilly), var(--w-cool), var(--w-mild), var(--w-warm), var(--w-hot));

  /* Type — Figtree (self-hosted) over system fallbacks, fluid scale (1.2 → 1.25) */
  --font-sans: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-round: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-serif: ui-serif, "New York", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --step--1: clamp(0.84rem, 0.82rem + 0.1vw, 0.9rem);
  --step-0: clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);
  --step-1: clamp(1.2rem, 1.13rem + 0.35vw, 1.33rem);
  --step-2: clamp(1.44rem, 1.3rem + 0.7vw, 1.77rem);
  --step-3: clamp(1.73rem, 1.48rem + 1.25vw, 2.4rem);
  --step-4: clamp(2.07rem, 1.65rem + 2.1vw, 3.3rem);

  /* Space + shape (card radius 18px, pill 999px — tailwind borderRadius) */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: 4.5rem;
  --s-9: 7rem;
  --r-card: 18px; /* tailwind borderRadius.card */
  --r-pill: 999px;
  --wrap: 72rem;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --shadow: 0 1px 2px rgb(44 41 37 / 0.06), 0 8px 24px -12px rgb(44 41 37 / 0.18);
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Dark — warm near-black (tailwind.config.js *D tokens) */
    --canvas: #15120e;
    --surface: #221d18;
    --ink: #f0e9dd;
    --muted: #a39a8e; /* a touch lighter than the app's #a0968a, for text contrast on --surface */
    --hairline: #322b23;
    --accent: #7fb89a;
    --accent-ink: #7fb89a;
    --key-tint: #2a332a; /* sampled: KEY layer card, dark */
    --warm-ink: #ecab5c;
    --caution: #e8743b;
    --trust-strip: #2a332a;
    --trust-edge: #2a332a;
    --trust-ink: #a9cdb5;
    --hero-top: #142e42;
    --hero-bottom: #0e141a;
    --hero-glow: #1d4260;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 10px 30px -14px rgb(0 0 0 / 0.6);
  }
}

/* doda.land — the studio. Same warm neutrals as Togwise (one family), its own voice:
   a serif display face, sage + ink instead of the warmth ramp, ripples instead of bars. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 5rem; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 400 var(--step-0) / 1.65 var(--font-sans); -webkit-font-smoothing: antialiased; transition: background-color 0.4s var(--ease), color 0.4s var(--ease); }
img, svg { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { font-family: var(--font-serif); font-weight: 500; line-height: 1.12; letter-spacing: -0.01em; margin: 0 0 var(--s-3); text-wrap: balance; }
h1 { font-size: clamp(2.4rem, 1.7rem + 3.6vw, 4.6rem); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
p { margin: 0 0 var(--s-4); text-wrap: pretty; }
a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 0.18em; transition: text-decoration-thickness 0.2s, text-underline-offset 0.2s, color 0.2s; }
a:hover { text-decoration-thickness: 2px; text-underline-offset: 0.26em; }
:focus-visible { outline: 3px solid var(--accent-ink); outline-offset: 3px; border-radius: 4px; }
.product :focus-visible { outline-color: var(--accent); } /* the product card is dark in both themes */
.wrap { width: min(100% - 2.5rem, 64rem); margin-inline: auto; }
.skip { position: absolute; left: var(--s-4); top: -4rem; z-index: 10; padding: var(--s-2) var(--s-4); background: var(--ink); color: var(--canvas); border-radius: var(--r-pill); }
.skip:focus { top: var(--s-4); }

.draft-banner { display: flex; align-items: center; justify-content: center; gap: var(--s-2); padding: var(--s-2) var(--s-4); font-size: var(--step--1); font-weight: 600; background: var(--key-tint); border-bottom: 1px solid var(--hairline); }
.draft-dot { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--honey); }

.site-header { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--canvas) 86%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid color-mix(in srgb, var(--hairline) 70%, transparent); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); min-height: 3.75rem; }
.brand { display: inline-flex; align-items: baseline; gap: 0.35rem; color: var(--ink); text-decoration: none; }
.brand-word { font-family: var(--font-serif); font-size: 1.6rem; font-weight: 600; letter-spacing: -0.02em; }
.brand-word::after { content: "."; color: var(--accent); }
.brand-sub { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.nav { display: flex; gap: var(--s-1); list-style: none; margin: 0; padding: 0; }
.nav a { display: block; padding: var(--s-2) var(--s-3); border-radius: var(--r-pill); color: var(--muted); font-size: var(--step--1); font-weight: 600; text-decoration: none; transition: background-color 0.2s, color 0.2s; }
.nav a:hover { color: var(--ink); background: var(--surface); }
@media (max-width: 26rem) { .nav li:first-child { display: none; } }

.hero { position: relative; isolation: isolate; overflow: hidden; padding-block: var(--s-9) var(--s-8); }
.ripples { position: absolute; z-index: -1; width: min(95vw, 44rem); right: -14rem; top: -6rem; fill: none; stroke: var(--accent); stroke-width: 1.2; opacity: 0.35; }
.ripples circle { transform-origin: 300px 300px; }
.eyebrow { margin: 0 0 var(--s-3); font-size: var(--step--1); font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-ink); }
.hero h1 { max-width: 15ch; }
.lead { font-size: var(--step-1); line-height: 1.55; color: var(--muted); max-width: 36rem; }
.lead-ink { font-size: var(--step-1); color: var(--muted); max-width: 32rem; }
.hero-links { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-5); margin-top: var(--s-6); }
.button { display: inline-block; padding: var(--s-3) var(--s-5); border-radius: var(--r-pill); background: var(--ink); color: var(--canvas); font-weight: 650; text-decoration: none; transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease); }
.button:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.text-link { font-weight: 650; }

.section { padding-block: var(--s-8); }
.section-alt { background: var(--surface); border-block: 1px solid var(--hairline); }
.section-head { margin-bottom: var(--s-6); }

.product { display: grid; gap: var(--s-6); overflow: hidden; padding: var(--s-6); border-radius: 24px; background: linear-gradient(180deg, var(--hero-top), var(--hero-bottom)); color: var(--hero-fg); box-shadow: var(--shadow); transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease); }
.product:hover { transform: translateY(-3px); }
.product-icon { margin-bottom: var(--s-4); width: 4.5rem; height: 4.5rem; border-radius: 1.4rem; box-shadow: 0 0 0 1px rgb(255 255 255 / 0.08), 0 10px 30px -10px rgb(0 0 0 / 0.6); }
.product h3 { font-family: var(--font-round); font-weight: 750; letter-spacing: -0.02em; }
.product p { color: var(--hero-muted); max-width: 34rem; }
.product-meta { margin-bottom: var(--s-3); }
.pill { display: inline-block; padding: var(--s-1) var(--s-3); border-radius: var(--r-pill); border: 1px solid rgb(243 236 224 / 0.25); font-size: var(--step--1); color: var(--hero-fg); }
.product-link { color: #7fb89a; font-weight: 700; text-decoration: none; }
.product-link span { display: inline-block; transition: transform 0.25s var(--ease); }
.product-link:hover span { transform: translateX(4px); }
.product-link:hover { text-decoration: underline; }

/* Two Togwise screens, light behind dark */
.product-phones { position: relative; display: flex; justify-content: center; align-items: flex-start; padding-block: var(--s-2) var(--s-4); }
.phone { position: relative; width: min(46%, 12.5rem); aspect-ratio: 1 / 2; padding: 0.4rem; border-radius: 1.9rem; background: linear-gradient(145deg, #3a3631, #121010 60%); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.08), 0 24px 48px -18px rgb(0 0 0 / 0.7); transition: transform 0.4s var(--ease); }
.phone img { width: 100%; height: 100%; object-fit: cover; object-position: top; border-radius: 1.5rem; }
.phone-back { transform: rotate(-4deg); margin-right: -2.5rem; margin-top: var(--s-5); }
.phone-front { transform: rotate(3deg); z-index: 1; }
.product:hover .phone-back { transform: rotate(-6deg) translateX(-6px); }
.product:hover .phone-front { transform: rotate(4deg) translateY(-4px); }

.principles { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-4); }
.principle { padding: var(--s-5); border-radius: var(--r-card); background: var(--canvas); border: 1px solid var(--hairline); }
.principle p { margin: 0; color: var(--muted); }
.p-num { display: block; margin-bottom: var(--s-3); font-family: var(--font-serif); font-size: var(--step-1); color: var(--accent-ink); }

.company-grid { display: grid; gap: var(--s-6); }
.facts { margin: 0; display: grid; border-top: 1px solid var(--hairline); }
.facts div { display: grid; gap: var(--s-1); padding: var(--s-4) 0; border-bottom: 1px solid var(--hairline); }
.facts dt { font-size: var(--step--1); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 0; font-size: var(--step-1); }

.site-footer { padding-block: var(--s-6); border-top: 1px solid var(--hairline); background: var(--surface); }
.fine { font-size: var(--step--1); color: var(--muted); margin: var(--s-2) 0 0; }
.notfound { min-height: 60vh; }

@media (min-width: 48rem) {
  .product { grid-template-columns: 1fr minmax(0, 0.9fr); align-items: center; padding: var(--s-7); }
  .principles { grid-template-columns: repeat(3, 1fr); }
  .company-grid { grid-template-columns: 1fr 1.2fr; }
  .facts div { grid-template-columns: 11rem 1fr; align-items: baseline; }
}

@media (prefers-reduced-motion: no-preference) {
  /* The ripples move three times, then rest. */
  .ripples circle { animation: ripple 12s ease-in-out 3; }
  .ripples circle:nth-child(2) { animation-delay: -3s; }
  .ripples circle:nth-child(3) { animation-delay: -6s; }
  .ripples circle:nth-child(4) { animation-delay: -9s; }
  /* Hero entrance: transform only (visible from the first paint). */
  .hero .wrap > * { animation: hero-rise 0.9s var(--ease) both; }
  .hero .wrap > :nth-child(2) { animation-delay: 0.08s; }
  .hero .wrap > :nth-child(3) { animation-delay: 0.16s; }
  .hero .wrap > :nth-child(4) { animation-delay: 0.24s; }
  @supports (animation-timeline: view()) {
    /* opacity + `translate`, never `transform`, so hover lifts keep working */
    .reveal { animation: reveal linear both; animation-timeline: view(); animation-range: entry 0% entry 80%; }
  }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@keyframes hero-rise { from { transform: translateY(18px); } to { transform: none; } }
@keyframes reveal { from { opacity: 0; translate: 0 18px; } to { opacity: 1; translate: none; } }
@keyframes ripple { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.04); opacity: 0.55; } }
