/* ============================================================
   Nuri — website stylesheet
   Tokens copied verbatim from lib/design/tokens/nuri_colors.dart
   Typography: Fraunces italic (display) + Nunito (UI), per brand.
   Mobile-first. Light theme default, dark via prefers-color-scheme.
   ============================================================ */

:root {
  /* ── Brand palette (light) — exact app hexes ── */
  --navy:       #2C3E5D;
  --navy-deep:  #1E2C44;
  --navy-tint:  #DDE3EC;
  --rose:       #D4957A;
  --rose-deep:  #B37558;
  --rose-tint:  #F3E2D7;
  --ivory:      #FAF7F2;
  --cream:      #F2EDE4;
  --sage:       #7FAF8A;
  --sage-deep:  #5E8E6A;
  --sage-tint:  #E6EEE6;
  --paper:      #FFFFFF;

  /* ── Ink scale ── */
  --ink:  #2C3E5D;
  --ink2: #5A6A80;
  --ink3: #8A94A4;
  --hair:  rgba(44, 62, 93, 0.08);
  --hair2: rgba(44, 62, 93, 0.14);

  /* ── Semantic surfaces ── */
  --bg:      var(--ivory);
  --bg-alt:  var(--cream);
  --card:    var(--paper);
  --mark:    var(--navy);   /* logo crescent */
  --accent:  var(--rose);   /* logo dot */

  /* ── Radius scale (12/14/16/20/22/28) ── */
  --r-12: 12px; --r-14: 14px; --r-16: 16px;
  --r-20: 20px; --r-22: 22px; --r-28: 28px;

  /* ── 8px spacing grid ── */
  --s-1: 8px;  --s-2: 16px; --s-25: 20px; --s-3: 24px;
  --s-4: 32px; --s-5: 40px; --s-6: 48px;  --s-8: 64px; --s-10: 80px;

  --shadow-card: 0 2px 16px rgba(44, 62, 93, 0.06);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    /* ── Dark-mode equivalents — exact app hexes ── */
    --bg:      #1A1E26;  /* darkIvory  */
    --bg-alt:  #242932;  /* darkCream  */
    --card:    #2A2F39;  /* darkPaper  */

    --navy:      #6B7FA3;
    --navy-deep: #8595B8;
    --navy-tint: #2E3542;
    --rose:      #D4957A;
    --rose-deep: #E5A98E;
    --rose-tint: #3D2E28;
    --sage:      #8FBF9A;
    --sage-deep: #A5CFAE;
    --sage-tint: #2F3D35;

    --ink:  #F0ECE4;
    --ink2: #B4BAC4;
    --ink3: #7B8494;
    --hair:  rgba(240, 236, 228, 0.08);
    --hair2: rgba(240, 236, 228, 0.14);

    --mark:   #F0ECE4;   /* crescent reads as ink on dark */
    --accent: #D4957A;

    --shadow-card: 0 2px 16px rgba(0, 0, 0, 0.25);
  }
}

/* ── Reset & base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  font-family: 'Nunito', system-ui, -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }

a { color: var(--rose-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ink); }

.container { width: 100%; max-width: 1060px; margin: 0 auto; padding: 0 var(--s-25); }
.narrow    { max-width: 720px; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--card); color: var(--ink);
  padding: var(--s-1) var(--s-2); border-radius: var(--r-12); z-index: 100;
}
.skip-link:focus { left: var(--s-2); top: var(--s-2); }

/* ── Brand mark & wordmark ────────────────────────────────── */
.nuri-mark .mark-main   { fill: var(--mark); }
.nuri-mark .mark-accent { fill: var(--accent); }

.wordmark {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-weight: 500;
  letter-spacing: -0.5px;
  line-height: 1;
  color: var(--mark);
}
.wordmark-nav    { font-size: 26px; }
.wordmark-hero   { font-size: clamp(56px, 14vw, 88px); margin: 0; }
.wordmark-footer { font-size: 22px; }

/* ── Header / nav ─────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--hair);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 12px; padding-bottom: 12px;
}
.nav-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.nav-links { display: flex; gap: var(--s-3); }
.nav-links a {
  position: relative;
  font-weight: 700; font-size: 15px; text-decoration: none; color: var(--ink2);
  padding: 6px 2px; transition: color 180ms var(--ease);
}
.nav-links a:hover, .nav-links a[aria-current="page"], .nav-links a.is-active { color: var(--ink); }

/* Gliding active underline */
.nav-links a::after {
  content: ""; position: absolute; left: 2px; right: 2px; bottom: 1px;
  height: 2px; border-radius: 1px;
  background: var(--rose);
  opacity: 0; transform: scaleX(0); transform-origin: left center;
  transition: transform 450ms var(--ease), opacity 450ms var(--ease);
}
.nav-links a:hover::after,
.nav-links a[aria-current="page"]::after,
.nav-links a.is-active::after { opacity: 1; transform: scaleX(1); }
/* When the scrollspy lights up a section link, rest the static page underline. */
.nav-links:has(.is-active) a[aria-current="page"]:not(.is-active):not(:hover)::after {
  opacity: 0; transform: scaleX(0);
}

/* In-page section nav links hide on narrow screens */
.nav-sec { display: none; }

/* ── Hero ─────────────────────────────────────────────────── */
.hero { position: relative; overflow: hidden; padding: var(--s-8) 0 var(--s-8); }

.blob {
  position: absolute; border-radius: 50%; filter: blur(70px);
  opacity: 0.5; pointer-events: none;
}
.blob-rose {
  width: 420px; height: 420px; right: -140px; top: -120px;
  background: var(--rose-tint);
}
.blob-sage {
  width: 360px; height: 360px; left: -150px; bottom: -160px;
  background: var(--sage-tint);
}

.hero-inner { position: relative; text-align: center; }
.hero-lockup {
  display: flex; align-items: center; justify-content: center;
  gap: 18px; margin-bottom: var(--s-3);
}

.hero-tagline {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic; font-weight: 500;
  font-size: clamp(24px, 6vw, 38px);
  line-height: 1.3;
  color: var(--ink);
  margin: 0 0 var(--s-2);
}
.br-desktop { display: none; }

.hero-sub {
  max-width: 620px; margin: 0 auto var(--s-5);
  color: var(--ink2); font-size: 17px;
}

.coming-soon-label {
  font-size: 13px; font-weight: 800; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink3); margin: 0 0 var(--s-2);
}

/* ── Store badges (coming-soon state, deliberately not links) ── */
.store-badges {
  display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-2);
}
.store-badge {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 12px 22px;
  background: var(--card);
  border: 1px solid var(--hair2);
  border-radius: var(--r-16);
  box-shadow: var(--shadow-card);
  color: var(--ink);
  cursor: default;
  transition: transform 450ms var(--ease), box-shadow 450ms var(--ease);
}
.store-badge:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(44, 62, 93, 0.10); }
.store-badge:active { transform: translateY(0) scale(0.985); transition-duration: 200ms; }
.store-badge-text { display: flex; flex-direction: column; text-align: left; line-height: 1.25; }
.store-badge-text small  { font-size: 11px; font-weight: 600; color: var(--ink3); letter-spacing: 0.04em; }
.store-badge-text strong { font-size: 17px; font-weight: 800; }

/* ── Sections ─────────────────────────────────────────────── */
.section { padding: var(--s-8) 0; }
.section-alt { background: var(--bg-alt); }

.eyebrow {
  font-size: 13px; font-weight: 800; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--rose-deep); margin: 0 0 var(--s-1);
}
.section-title {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic; font-weight: 500;
  font-size: clamp(28px, 6vw, 40px);
  line-height: 1.25; color: var(--ink);
  margin: 0 0 var(--s-3);
}
.section-title em { color: var(--rose-deep); font-style: italic; }
.section-lead { color: var(--ink2); margin: 0 0 var(--s-2); }
.centered { text-align: center; }
.centered-block { text-align: center; }
.centered-block .section-lead { margin-left: auto; margin-right: auto; }

/* ── Cards & grids ────────────────────────────────────────── */
.feature-grid {
  display: grid; grid-template-columns: 1fr;
  gap: var(--s-2); margin-top: var(--s-5);
}
.principle-grid {
  display: grid; grid-template-columns: 1fr;
  gap: var(--s-2); margin-top: var(--s-5);
}

.card {
  background: var(--card);
  border: 1px solid var(--hair);
  border-radius: var(--r-22);
  padding: var(--s-3);
  box-shadow: var(--shadow-card);
  transition: transform 450ms var(--ease), box-shadow 450ms var(--ease);
}
.card:hover { transform: translateY(-4px); box-shadow: 0 10px 28px rgba(44, 62, 93, 0.10); }
.card h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic; font-weight: 500;
  font-size: 21px; line-height: 1.3;
  margin: 0 0 var(--s-1); color: var(--ink);
}
.card p { margin: 0; color: var(--ink2); font-size: 15.5px; }

.card-icon {
  width: 48px; height: 48px; border-radius: var(--r-14);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: var(--s-2);
}
.icon-rose { background: var(--rose-tint); color: var(--rose-deep); }
.icon-navy { background: var(--navy-tint); color: var(--navy-deep); }
.icon-sage { background: var(--sage-tint); color: var(--sage-deep); }

.card-principle { border-radius: var(--r-28); padding: var(--s-4); }
.card-principle p { font-size: 16px; }

/* ── Screenshot placeholder ───────────────────────────────── */
.screenshot-note {
  margin: var(--s-5) auto 0; max-width: 460px;
  text-align: center; color: var(--ink3); font-size: 14px;
}
.screenshot-placeholder {
  display: flex; align-items: center; justify-content: center;
  height: 160px; margin-bottom: var(--s-2);
  background: var(--card);
  border: 1.5px dashed var(--hair2);
  border-radius: var(--r-28);
}

/* ── Buttons / CTA ────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 14px 32px;
  border-radius: var(--r-16);
  font-family: 'Nunito', system-ui, sans-serif;
  font-size: 16px; font-weight: 800;
  text-decoration: none;
  transition: transform 180ms var(--ease), box-shadow 180ms var(--ease), background 180ms var(--ease);
}
.btn-primary { background: var(--rose); color: #FFFFFF; box-shadow: 0 4px 18px rgba(212, 149, 122, 0.35); }
.btn-primary:hover { background: var(--rose-deep); color: #FFFFFF; transform: translateY(-1px); }
@media (prefers-color-scheme: dark) {
  .btn-primary { color: #1A1E26; }
  .btn-primary:hover { color: #1A1E26; }
}
.cta-fineprint { font-size: 13px; color: var(--ink3); margin-top: var(--s-2); }

/* ── Privacy policy page ──────────────────────────────────── */
.policy h2 {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic; font-weight: 500;
  font-size: 24px; line-height: 1.3; color: var(--ink);
  margin: var(--s-5) 0 var(--s-1);
}
.policy p, .policy li { color: var(--ink2); font-size: 16px; }
.policy ul { padding-left: 22px; margin: var(--s-1) 0 var(--s-2); }
.policy li { margin-bottom: 6px; }
.policy strong { color: var(--ink); }
.policy-updated { font-size: 14px; color: var(--ink3); margin-top: calc(-1 * var(--s-1)); }

.policy-summary { margin: var(--s-4) 0; border-radius: var(--r-28); background: var(--sage-tint); border-color: transparent; }
.policy-summary h2 { margin-top: 0; }
.policy-summary li::marker { color: var(--sage-deep); }

/* ── Footer ───────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--hair);
  background: var(--bg-alt);
  padding: var(--s-6) 0;
  margin-top: var(--s-2);
}
.footer-inner { text-align: center; }
.footer-brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: var(--s-2); }

.footer-disclaimer {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  color: var(--ink2); font-size: 16px;
  max-width: 480px; margin: 0 auto var(--s-3);
}
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-3); margin-bottom: var(--s-2); }
.footer-links a { font-size: 14px; font-weight: 700; color: var(--ink2); text-decoration: none; }
.footer-links a:hover { color: var(--ink); text-decoration: underline; }
.footer-meta { font-size: 13px; color: var(--ink3); margin: 0; }

/* ── ≥ 640px ──────────────────────────────────────────────── */
@media (min-width: 640px) {
  .feature-grid { grid-template-columns: 1fr 1fr; }
  .br-desktop { display: inline; }
  .hero { padding-top: var(--s-10); padding-bottom: var(--s-10); }
  .nav-sec { display: inline-block; }
}

/* ── ≥ 900px ──────────────────────────────────────────────── */
@media (min-width: 900px) {
  .feature-grid { grid-template-columns: 1fr 1fr 1fr; gap: var(--s-25); }
  .principle-grid { grid-template-columns: 1fr 1fr; gap: var(--s-25); }
  .section { padding: var(--s-10) 0; }
}

/* ============================================================
   Calm motion — "alive but calm"
   Everything below is decorative. The global
   prefers-reduced-motion rule at the top of this file disables
   ALL animations & transitions, and js/calm.js reveals content
   immediately for reduced-motion users, so the site stays fully
   usable and complete with motion off (and with JS off).
   ============================================================ */

/* Anchored sections land below the sticky header */
section[id] { scroll-margin-top: 76px; }

/* ── 1. Scroll reveals ─────────────────────────────────────── */
/* Hidden state only exists when JS is running (html.js). */
.js .reveal:not(.is-visible) { opacity: 0; transform: translateY(20px); }
.js .reveal.is-visible {
  animation: reveal-rise 650ms var(--ease) backwards;
  animation-delay: var(--reveal-delay, 0ms);
}
@keyframes reveal-rise {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: none; }
}

/* Gentle stagger inside grids */
.feature-grid   > .reveal:nth-child(2) { --reveal-delay: 80ms; }
.feature-grid   > .reveal:nth-child(3) { --reveal-delay: 160ms; }
.feature-grid   > .reveal:nth-child(4) { --reveal-delay: 240ms; }
.feature-grid   > .reveal:nth-child(5) { --reveal-delay: 320ms; }
.feature-grid   > .reveal:nth-child(6) { --reveal-delay: 400ms; }
.principle-grid > .reveal:nth-child(2) { --reveal-delay: 120ms; }

/* Soft hero entrance on load */
.js .hero-lockup       { animation: reveal-rise 700ms var(--ease) backwards; }
.js .hero-tagline      { animation: reveal-rise 700ms var(--ease) 90ms backwards; }
.js .hero-sub          { animation: reveal-rise 700ms var(--ease) 180ms backwards; }
.js .coming-soon-label { animation: reveal-rise 700ms var(--ease) 270ms backwards; }
.js .store-badges      { animation: reveal-rise 700ms var(--ease) 340ms backwards; }
.js .rhythm-dial       { animation: reveal-rise 700ms var(--ease) 420ms backwards; }

/* ── 2. Breathing logo + twinkling grace stars ─────────────── */
.hero-lockup .nuri-mark {
  animation: nuri-breathe 5.2s ease-in-out infinite;
  transform-origin: 50% 50%;
  will-change: transform;
}
@keyframes nuri-breathe {
  0%, 100% { transform: scale(1);    opacity: 1; }
  50%      { transform: scale(1.03); opacity: 0.92; }
}

.hero-lockup .grace-star {
  animation: nuri-twinkle 3.8s ease-in-out infinite;
  animation-delay: var(--tw-delay, 0s);
}
.grace-star-1 { --tw-hi: 0.5;  --tw-lo: 0.15; --tw-delay: 0s; }
.grace-star-2 { --tw-hi: 0.35; --tw-lo: 0.10; --tw-delay: 1.3s; }
.grace-star-3 { --tw-hi: 0.55; --tw-lo: 0.20; --tw-delay: 2.6s; }
@keyframes nuri-twinkle {
  0%, 100% { opacity: var(--tw-hi); }
  50%      { opacity: var(--tw-lo); }
}

/* Faint glow pulse on the held rose dot (hero only) */
.hero-lockup .mark-dot { animation: nuri-dot-glow 5.2s ease-in-out infinite; }
@keyframes nuri-dot-glow {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(212, 149, 122, 0)); }
  50%      { filter: drop-shadow(0 0 5px rgba(212, 149, 122, 0.55)); }
}

/* ── 3. Drifting ambient blobs ─────────────────────────────── */
.blob { will-change: transform; }
.blob-rose { animation: blob-drift-a 26s ease-in-out infinite alternate; }
.blob-sage { animation: blob-drift-b 32s ease-in-out -8s infinite alternate; }
@keyframes blob-drift-a {
  0%   { transform: translate(0, 0) scale(1); }
  55%  { transform: translate(-22px, 16px) scale(1.05); }
  100% { transform: translate(-30px, 26px) scale(1.02); }
}
@keyframes blob-drift-b {
  0%   { transform: translate(0, 0) scale(1.03); }
  45%  { transform: translate(18px, -14px) scale(0.98); }
  100% { transform: translate(26px, -20px) scale(1.06); }
}

/* ── 4a. Dawn→dusk hero gradient (very slow day cycle) ─────── */
/* A tall gradient layer slides via transform only (compositor-
   friendly). The segment 80%→100% repeats 0%→20%, so the loop
   is seamless. Brand tints keep it calm in light AND dark mode;
   low opacity keeps hero text fully readable throughout. */
.hero::before {
  content: ""; position: absolute;
  left: 0; right: 0; top: 0; height: 500%;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    var(--rose-tint) 0%,    /* sunrise   */
    var(--bg-alt)   20%,    /* bright day */
    var(--rose-tint) 40%,   /* golden dusk */
    var(--navy-tint) 60%,   /* evening    */
    var(--rose-tint) 80%,   /* sunrise again (loop seam) */
    var(--bg-alt)   100%
  );
  opacity: 0.5;
  animation: hero-daycycle 96s linear infinite;
}
@media (prefers-color-scheme: dark) {
  .hero::before { opacity: 0.35; }
}
@keyframes hero-daycycle {
  from { transform: translateY(0); }
  to   { transform: translateY(-80%); }
}

/* ── 4b. 24-hour rhythm dial motif ─────────────────────────── */
.rhythm-dial { display: flex; justify-content: center; margin-top: var(--s-5); }
.dial-track {
  fill: none; stroke: var(--hair2); stroke-width: 2.5;
}
.dial-arc {
  fill: none; stroke: var(--sage); stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 62 100; /* static fallback when motion is off */
  animation: dial-sweep 18s var(--ease) infinite;
}
.dial-core {
  fill: var(--navy);
  transform-box: fill-box; transform-origin: center;
  animation: dial-core-breathe 5.2s ease-in-out infinite;
}
@keyframes dial-sweep {
  0%   { stroke-dasharray: 0 100;  opacity: 0.9; }
  55%  { stroke-dasharray: 62 100; opacity: 0.9; }
  80%  { stroke-dasharray: 62 100; opacity: 0.9; }
  100% { stroke-dasharray: 62 100; opacity: 0; }
}
@keyframes dial-core-breathe {
  0%, 100% { transform: scale(1);    opacity: 0.85; }
  50%      { transform: scale(1.22); opacity: 1; }
}
