/* =========================================================================
   Tooki — marketing site styles
   Warm editorial palette (cream + ember) with Fraunces italic display type,
   inspired by modern fintech/wellness landing pages.
   ========================================================================= */

:root {
  --cream: #faf8f3;   /* airy warm off-white — lighter than a "Claude beige" */
  --cream-2: #f2ede4; /* soft, light warm section tint (not tan) */
  --paper: #ffffff;
  --ink: #241e1a;
  --ink-soft: #6b5f54;
  --muted: #9c8e80;
  --ember: #f2600c;
  --ember-bright: #ff7a1a;
  --ember-soft: #ffe7d2;
  --teal: #158a7c;
  --line: rgba(36, 30, 26, 0.1);
  --line-strong: rgba(36, 30, 26, 0.16);

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --r-sm: 12px;
  --r-md: 20px;
  --r-lg: 30px;
  --r-pill: 999px;

  --shadow-sm: 0 2px 10px rgba(60, 40, 20, 0.06);
  --shadow-md: 0 18px 50px -20px rgba(80, 45, 15, 0.28);
  --shadow-glow: 0 30px 80px -30px rgba(242, 96, 12, 0.5);

  --maxw: 1140px;
  --gutter: clamp(20px, 5vw, 48px);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* --- Typography ---------------------------------------------------------- */

.display {
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.015em;
  margin: 0;
}
.display em {
  font-style: italic;
  font-weight: 400;
  color: var(--ember);
}

h1.display { font-size: clamp(2.9rem, 7.2vw, 5.4rem); }
h2.display { font-size: clamp(2.2rem, 5vw, 3.6rem); }
h3.display { font-size: clamp(1.5rem, 3vw, 2rem); }

.eyebrow {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ember);
  margin: 0 0 18px;
}
.eyebrow.teal { color: var(--teal); }

.lead {
  font-size: clamp(1.05rem, 1.6vw, 1.28rem);
  color: var(--ink-soft);
  max-width: 44ch;
  margin: 22px 0 0;
}
.muted { color: var(--muted); }

/* --- Layout -------------------------------------------------------------- */

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
section { padding: clamp(72px, 11vw, 140px) 0; }
.center { text-align: center; }
.center .lead { margin-left: auto; margin-right: auto; }

/* --- Nav ----------------------------------------------------------------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  background: rgba(251, 246, 238, 0.72);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background 0.3s ease;
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 1.1rem; letter-spacing: -0.01em; }
.brand img { width: 34px; height: 34px; border-radius: 9px; box-shadow: var(--shadow-sm); }
.nav-links { display: flex; align-items: center; gap: 34px; }
.nav-links a { font-size: 0.95rem; color: var(--ink-soft); font-weight: 500; transition: color 0.2s; }
.nav-links a:hover { color: var(--ink); }
.nav-cta { display: flex; gap: 12px; align-items: center; }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--ink); margin: 5px 0; border-radius: 2px; transition: 0.25s; }

/* --- Buttons ------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.98rem;
  padding: 13px 24px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.25s ease, background 0.2s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn-primary {
  background: linear-gradient(135deg, var(--ember-bright), var(--ember));
  color: #fff;
  box-shadow: var(--shadow-glow);
}
.btn-primary:hover { transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: rgba(36, 30, 26, 0.04); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { transform: translateY(-2px); }
.btn .ic { width: 18px; height: 18px; }

.store-badges { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.store {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 11px 20px; border-radius: 14px;
  background: var(--ink); color: #fff;
  transition: transform 0.18s ease, box-shadow 0.25s ease;
  box-shadow: var(--shadow-md);
}
.store:hover { transform: translateY(-2px); }
.store svg { width: 24px; height: 24px; flex: none; }
.store small { display: block; font-size: 0.62rem; letter-spacing: 0.06em; opacity: 0.8; text-transform: uppercase; }
.store b { display: block; font-size: 1.02rem; font-weight: 600; line-height: 1.1; }

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

.hero { position: relative; padding-top: clamp(40px, 6vw, 72px); }
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}
.hero .lead { max-width: 46ch; }
.hero-cta { display: flex; gap: 14px; margin-top: 34px; flex-wrap: wrap; }
.hero-note { margin-top: 20px; font-size: 0.9rem; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.hero-note svg { width: 16px; height: 16px; color: var(--teal); }

.hero-art { position: relative; display: grid; place-items: center; }
.hero-art .halo {
  position: absolute; inset: -6% ;
  background: radial-gradient(circle at 50% 45%, rgba(255, 122, 26, 0.32), rgba(255, 122, 26, 0) 62%);
  filter: blur(10px);
  z-index: 0;
}
.hero-card {
  position: relative; z-index: 1;
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-glow);
  border: 1px solid rgba(255,255,255,0.6);
  background: var(--paper);
  transform: rotate(-1.5deg);
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.hero-card:hover { transform: rotate(0deg) scale(1.01); }
.hero-card img { width: min(420px, 78vw); }
.hero-chip {
  position: absolute; z-index: 2;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 10px 16px;
  display: flex; align-items: center; gap: 9px;
  font-size: 0.86rem; font-weight: 600;
  box-shadow: var(--shadow-md);
}
.hero-chip .dot { width: 9px; height: 9px; border-radius: 50%; }
.hero-chip.one { top: 10%; left: -6%; }
.hero-chip.two { bottom: 12%; right: -4%; }
.hero-chip.two .dot { background: var(--teal); }
.hero-chip.one .dot { background: var(--ember); }

/* Live 3D layer — overlays the hero art; the static card fades out once it mounts. */
.hero-3d { position: absolute; inset: -8% -6% 0 -6%; z-index: 1; pointer-events: none; }
.hero-3d canvas { display: block; width: 100% !important; height: 100% !important; }
.hero-art.r3d-on .hero-card { opacity: 0; transition: opacity 0.6s ease; }
.hero-art.r3d-on .hero-chip { z-index: 3; }

/* --- Trust strip --------------------------------------------------------- */

.strip { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--cream-2); }
.strip .wrap { display: flex; flex-wrap: wrap; gap: clamp(20px, 5vw, 60px); justify-content: space-between; padding-top: 34px; padding-bottom: 34px; }
.stat { display: flex; flex-direction: column; }
.stat b { font-family: var(--serif); font-size: clamp(1.8rem, 3.6vw, 2.6rem); font-weight: 500; line-height: 1; }
.stat span { font-size: 0.86rem; color: var(--ink-soft); margin-top: 8px; }

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

.feature { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(30px, 6vw, 90px); align-items: center; }
.feature + .feature { margin-top: clamp(70px, 10vw, 130px); }
.feature.flip .feature-media { order: -1; }
.feature-media {
  border-radius: var(--r-lg);
  padding: clamp(22px, 4vw, 46px);
  display: grid; place-items: center;
  position: relative;
  overflow: hidden;
  min-height: 320px;
}
.feature-media img { width: min(300px, 70%); filter: drop-shadow(0 24px 40px rgba(80,45,15,0.25)); }
.media-cream { background: linear-gradient(160deg, #fff, var(--cream-2)); border: 1px solid var(--line); }
.media-ember { background: linear-gradient(160deg, #ff8a3d, var(--ember)); }
.media-ink { background: linear-gradient(160deg, #2c2521, #1a1512); }
/* Full-bleed product shots (already carry their own rounded frame). */
.feature-media.media-photo { padding: 0; background: none; border: 0; min-height: 0; overflow: visible; }
.feature-media.media-photo img { width: 100%; height: auto; border-radius: var(--r-lg); box-shadow: var(--shadow-md); filter: none; }
.feature h2 { margin-bottom: 6px; }
.feature p { color: var(--ink-soft); margin: 18px 0 0; max-width: 42ch; }

.ticks { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 14px; }
.ticks li { display: flex; gap: 12px; align-items: flex-start; font-weight: 500; }
.ticks svg { width: 22px; height: 22px; color: var(--ember); flex: none; margin-top: 1px; }

/* --- Personality pills --------------------------------------------------- */

.pills { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.pill { padding: 9px 18px; border-radius: var(--r-pill); border: 1px solid var(--line-strong); font-weight: 600; font-size: 0.92rem; background: var(--paper); }
.pill.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* --- Privacy band -------------------------------------------------------- */

.band {
  background: radial-gradient(120% 140% at 50% 0%, #2c2521 0%, #171310 70%);
  color: #f3e9da;
  text-align: center;
}
.band .eyebrow { color: var(--ember-bright); }
.band .display { color: #fff; }
.band .lead { color: rgba(243, 233, 218, 0.72); }
.band-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; margin-top: 56px; text-align: left; }
.band-card { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.09); border-radius: var(--r-md); padding: 28px; }
.band-card .ic { width: 26px; height: 26px; color: var(--ember-bright); margin-bottom: 16px; }
.band-card h4 { font-family: var(--serif); font-weight: 500; font-size: 1.25rem; margin: 0 0 8px; }
.band-card p { margin: 0; font-size: 0.95rem; color: rgba(243, 233, 218, 0.66); }

/* --- Pricing teaser ------------------------------------------------------ */

.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 54px; }
.plan { border: 1px solid var(--line-strong); border-radius: var(--r-lg); padding: 34px; background: var(--paper); }
.plan.pro { background: linear-gradient(165deg, #fff, var(--ember-soft)); border-color: var(--ember); position: relative; box-shadow: var(--shadow-md); }
.plan h3 { font-family: var(--serif); font-weight: 500; font-size: 1.5rem; margin: 0; }
.plan .price { font-family: var(--serif); font-size: 2.4rem; margin: 10px 0 2px; }
.plan .price small { font-family: var(--sans); font-size: 0.95rem; color: var(--muted); font-weight: 500; }
.plan ul { list-style: none; padding: 0; margin: 24px 0 28px; display: grid; gap: 13px; }
.plan li { display: flex; gap: 11px; align-items: flex-start; color: var(--ink-soft); font-weight: 500; }
.plan li svg { width: 20px; height: 20px; color: var(--ember); flex: none; margin-top: 2px; }
.plan .tag { position: absolute; top: 22px; right: 22px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ember); background: #fff; padding: 6px 12px; border-radius: var(--r-pill); border: 1px solid var(--ember); }
.plan .btn { width: 100%; justify-content: center; }

/* --- CTA band ------------------------------------------------------------ */

.cta {
  background: linear-gradient(135deg, var(--ember-bright), var(--ember));
  color: #fff; text-align: center; border-radius: 0;
}
.cta .display { color: #fff; }
/* On the ember band the default ember accent would blend in — keep the
   emphasis word white with a soft underline so it reads as an accent. */
.cta .display em { color: #fff; text-decoration: underline; text-decoration-color: rgba(255, 255, 255, 0.55); text-decoration-thickness: 2px; text-underline-offset: 6px; }
.cta .lead { color: rgba(255,255,255,0.9); }
.cta .store { background: #fff; color: var(--ink); }
.cta .store small { color: var(--ink-soft); }
.cta .store-badges { justify-content: center; }

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

footer { background: var(--cream-2); border-top: 1px solid var(--line); }
.foot { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; padding-top: 70px; padding-bottom: 40px; }
.foot .brand { margin-bottom: 16px; }
.foot p { color: var(--ink-soft); font-size: 0.94rem; max-width: 34ch; }
.foot h5 { font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin: 0 0 16px; }
.foot ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.foot a { color: var(--ink-soft); font-size: 0.95rem; transition: color 0.2s; }
.foot a:hover { color: var(--ember); }
.foot-bottom { border-top: 1px solid var(--line); padding: 24px 0; display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; color: var(--muted); font-size: 0.86rem; }

/* --- Reveal animation ---------------------------------------------------- */

.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.8s cubic-bezier(0.2,0.8,0.2,1), transform 0.8s cubic-bezier(0.2,0.8,0.2,1); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: 0.08s; }
.reveal.d2 { transition-delay: 0.16s; }
.reveal.d3 { transition-delay: 0.24s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* --- Legal / prose pages ------------------------------------------------- */

.prose-hero { padding: clamp(60px, 9vw, 110px) 0 clamp(30px, 5vw, 54px); border-bottom: 1px solid var(--line); }
.prose-hero .display { font-size: clamp(2.4rem, 5.5vw, 3.8rem); }
.prose-wrap { max-width: 760px; margin: 0 auto; padding: clamp(40px, 7vw, 72px) var(--gutter) 90px; }
.prose { color: var(--ink-soft); }
.prose h2 { font-family: var(--serif); font-weight: 500; color: var(--ink); font-size: 1.5rem; margin: 44px 0 12px; line-height: 1.2; }
.prose h3 { font-weight: 700; color: var(--ink); font-size: 1.08rem; margin: 26px 0 8px; }
.prose p, .prose li { font-size: 1.02rem; }
.prose a { color: var(--ember); text-decoration: underline; text-underline-offset: 2px; }
.prose ul { padding-left: 22px; display: grid; gap: 8px; margin: 14px 0; }
.prose strong { color: var(--ink); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 0.94rem; }
.prose th, .prose td { text-align: left; padding: 12px 14px; border: 1px solid var(--line); vertical-align: top; }
.prose th { background: var(--cream-2); color: var(--ink); font-weight: 600; }
.prose blockquote { margin: 18px 0; padding: 14px 20px; background: var(--cream-2); border-left: 3px solid var(--ember); border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.updated { display: inline-block; margin-top: 16px; font-size: 0.9rem; color: var(--muted); }

/* --- Support form -------------------------------------------------------- */
.support-form { display: grid; gap: 20px; max-width: 560px; }
.field { display: grid; gap: 8px; }
.field label { font-weight: 600; font-size: 0.95rem; color: var(--ink); }
.field input, .field textarea {
  font-family: var(--sans); font-size: 1rem; color: var(--ink);
  background: var(--paper); border: 1.5px solid var(--line-strong);
  border-radius: var(--r-md); padding: 13px 16px; width: 100%;
  transition: border-color 0.2s ease;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--ember); }
.field textarea { resize: vertical; min-height: 130px; line-height: 1.5; }
.support-form .btn { justify-self: start; }
.form-msg { margin: 2px 0 0; font-size: 0.95rem; min-height: 1.2em; }
.form-msg.ok { color: var(--teal); font-weight: 600; }
.form-msg.err { color: #c0392b; }
.toc-back { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 8px; color: var(--ember); font-weight: 600; font-size: 0.92rem; }

/* --- Responsive ---------------------------------------------------------- */

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero .lead { margin-left: auto; margin-right: auto; }
  .hero-cta, .store-badges, .hero-note { justify-content: center; }
  .hero-art { margin-top: 20px; }
  .feature, .feature.flip { grid-template-columns: 1fr; }
  .feature.flip .feature-media { order: 0; }
  .feature-media { min-height: 240px; }
  .band-grid { grid-template-columns: 1fr; }
  .plans { grid-template-columns: 1fr; }
  .foot { grid-template-columns: 1fr 1fr; }
  .nav-links, .nav-cta .btn-ghost { display: none; }
  .nav-toggle { display: block; }
  .nav.open .nav-links {
    display: flex; flex-direction: column; gap: 20px;
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--cream); padding: 24px var(--gutter) 32px;
    border-bottom: 1px solid var(--line);
  }
}
@media (max-width: 560px) {
  .foot { grid-template-columns: 1fr; }
  .hero-chip.one { left: 2%; }
  .hero-chip.two { right: 2%; }
}

/* --- Live 3D experience (added when the WebGL backdrop boots) ------------- */
/* The canvas is position:fixed at z-index:0; page content stacks above it.   */
body.r3d-dark { background: transparent; }
body.r3d-dark > :not(.nav) { position: relative; z-index: 1; }

/* Hero flips to its ember-lit dark look while the canvas is live. The static
   cream fallback styling stays untouched for no-WebGL / reduced-JS visitors. */
.r3d-dark .hero h1.display { color: #f7f0e7; }
.r3d-dark .hero .display em { color: var(--ember-bright); }
.r3d-dark .hero .lead { color: rgba(240, 231, 220, 0.82); }
.r3d-dark .hero .eyebrow { color: var(--ember-bright); }
.r3d-dark .hero .hero-note { color: rgba(240, 231, 220, 0.62); }
.r3d-dark .hero .hero-card { opacity: 0; }
.r3d-dark .hero .halo { opacity: 0.5; }
.r3d-dark .hero .hero-chip { box-shadow: 0 10px 32px rgba(0, 0, 0, 0.35); }

/* --- Tooki portrait — floats top-right of the hero art --------------------- */
.tooki-portrait {
  position: absolute;
  top: -9%;
  right: -26%;
  z-index: 3;
  width: clamp(220px, 26vw, 400px);
  height: clamp(220px, 26vw, 400px);
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid rgba(255, 170, 100, 0.55);
  box-shadow: 0 18px 54px rgba(242, 96, 12, 0.45), 0 4px 14px rgba(0, 0, 0, 0.35);
  animation: tooki-float 5.2s ease-in-out infinite;
}
.tooki-portrait img { width: 100%; height: 100%; object-fit: cover; display: block; }
@keyframes tooki-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@media (prefers-reduced-motion: reduce) { .tooki-portrait { animation: none; } }
@media (max-width: 860px) { .tooki-portrait { right: 2%; top: -4%; width: clamp(170px, 42vw, 240px); height: clamp(170px, 42vw, 240px); } }

/* Text blocks that land on the gradient's dark band flip to light ink. */
[data-inkflip] .display, [data-inkflip] .lead { transition: color 0.5s ease; }
[data-inkflip].on-dark-bg .display { color: #f7f0e7; }
[data-inkflip].on-dark-bg .display em { color: var(--ember-bright); }
[data-inkflip].on-dark-bg .lead { color: rgba(240, 231, 220, 0.82); }
[data-inkflip].on-dark-bg .eyebrow { color: var(--ember-bright); }
