/* ============================================================
   DiaryZen — Landing design system
   Tokens pulled 1:1 from app/globals.css (oklch monochrome).
   Aesthetic: zen, editorial, "un libro ben impaginato".
   ============================================================ */

:root {
  /* App tokens (globals.css) */
  --background: oklch(0.985 0.004 60);
  --foreground: oklch(0.145 0.005 60);
  --card: oklch(0.975 0.003 60);
  --primary: oklch(0.205 0.006 60);
  --primary-foreground: oklch(0.985 0.004 60);
  --muted: oklch(0.965 0.004 60);
  --muted-foreground: oklch(0.45 0.008 60);
  --border: oklch(0.90 0.004 60);
  --ring: oklch(0.65 0.006 60);

  /* Warm paper for the marketing canvas — slightly warmer than app bg */
  --paper: oklch(0.972 0.007 75);
  --paper-deep: oklch(0.955 0.008 75);
  --ink: oklch(0.145 0.005 60);
  --ink-70: oklch(0.145 0.005 60 / 0.70);
  --ink-55: oklch(0.145 0.005 60 / 0.55);
  --ink-40: oklch(0.145 0.005 60 / 0.40);
  --ink-12: oklch(0.145 0.005 60 / 0.12);
  --ink-08: oklch(0.145 0.005 60 / 0.08);
  --flame: #d98a4a; /* warm accent, derived from streak flame — used VERY sparingly */

  --radius: 0.625rem;
  --font-sans: 'Inter', system-ui, sans-serif;
  --font-serif: 'Source Serif 4', Georgia, serif;

  --wrap: 1120px;
  --wrap-narrow: 760px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
  font-size: 17px;
}
::selection { background: var(--ink); color: var(--paper); }
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }

/* ---------- Typography helpers ---------- */
.serif { font-family: var(--font-serif); }
.sans  { font-family: var(--font-sans); }
.italic { font-style: italic; }
.eyebrow {
  font-family: var(--font-sans);
  font-size: 12px; font-weight: 500;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-40);
}
.lead {
  font-family: var(--font-serif);
  font-size: clamp(18px, 2.1vw, 22px);
  line-height: 1.6; color: var(--ink-70);
}
.muted { color: var(--ink-55); }

.display {
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.05;
  font-size: clamp(44px, 7vw, 92px);
}
.h-xl {
  font-family: var(--font-serif); font-weight: 600;
  letter-spacing: -0.018em; line-height: 1.08;
  font-size: clamp(34px, 5vw, 60px);
}
.h-lg {
  font-family: var(--font-serif); font-weight: 600;
  letter-spacing: -0.012em; line-height: 1.12;
  font-size: clamp(28px, 3.4vw, 40px);
}
.h-md {
  font-family: var(--font-serif); font-weight: 600;
  letter-spacing: -0.01em; line-height: 1.2;
  font-size: clamp(21px, 2.2vw, 26px);
}

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 32px; }
.wrap-narrow { max-width: var(--wrap-narrow); }
.section { padding: clamp(72px, 11vw, 150px) 0; }
.section-sm { padding: clamp(48px, 7vw, 92px) 0; }
.center { text-align: center; }
.stack-6 > * + * { margin-top: 6px; }
.stack-12 > * + * { margin-top: 12px; }
.stack-20 > * + * { margin-top: 20px; }
.stack-28 > * + * { margin-top: 28px; }
.hr { height: 1px; background: var(--ink-12); border: 0; margin: 0; }
.maxw-60ch { max-width: 60ch; }
.maxw-44ch { max-width: 44ch; }

/* ---------- Header / nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: oklch(0.972 0.007 75 / 0.82);
  backdrop-filter: saturate(140%) blur(18px);
  -webkit-backdrop-filter: saturate(140%) blur(18px);
  border-bottom: 1px solid var(--ink-08);
}
.nav-in {
  max-width: var(--wrap); margin: 0 auto; padding: 0 32px;
  height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); }
.brand-logo { height: 26px; width: auto; display: block; }
.footer .brand-logo { height: 28px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 999px;
  border: 1.6px solid var(--ink); display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.brand-mark svg { width: 17px; height: 17px; }
.brand-word { font-family: var(--font-serif); font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-link {
  font-size: 14px; color: var(--ink-55); text-decoration: none;
  padding: 8px 13px; border-radius: 8px; transition: color .15s, background .15s; white-space: nowrap;
}
.nav-link:hover { color: var(--ink); background: var(--ink-08); }
.nav-link.active { color: var(--ink); }
.nav-cta { margin-left: 8px; }
.nav-burger { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px; border-radius: 12px; border: 1px solid transparent;
  font-family: var(--font-sans); font-size: 15px; font-weight: 500; line-height: 1;
  text-decoration: none; cursor: pointer; transition: all .16s ease; white-space: nowrap;
}
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: oklch(0.145 0.005 60 / 0.88); transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--ink-12); }
.btn-outline:hover { background: var(--ink-08); border-color: var(--ink-40); }
.btn-ghost { background: transparent; color: var(--ink-70); }
.btn-ghost:hover { color: var(--ink); }
.btn-sm { height: 38px; padding: 0 15px; font-size: 14px; border-radius: 10px; }
.btn-lg { height: 52px; padding: 0 28px; font-size: 16px; border-radius: 14px; }

/* ---------- Sentiero motif (the recurring path) ---------- */
.path-eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
}
.path-eyebrow::before {
  content: ""; width: 26px; height: 1px; background: var(--ink-40);
}
.path-dot {
  width: 9px; height: 9px; border-radius: 999px; background: var(--ink);
  box-shadow: 0 0 0 4px var(--paper);
}

/* ---------- Cards & tags ---------- */
.surface {
  background: var(--background);
  border: 1px solid var(--ink-08);
  border-radius: 18px;
}
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 7px; background: var(--ink-08);
  font-size: 12px; color: var(--ink-70);
}
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--ink-12);
  font-size: 13px; color: var(--ink-70); background: var(--background);
}
.streak {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 11px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--background); font-size: 12px; font-weight: 500; color: var(--ink-70);
}

/* ---------- Feature grid (home overview) ---------- */
.feat-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 1px; background: var(--ink-08); border: 1px solid var(--ink-08); border-radius: 20px; overflow: hidden;
}
.feat {
  background: var(--paper); padding: 38px 36px; text-decoration: none; color: inherit;
  display: flex; flex-direction: column; gap: 14px; min-height: 220px;
  transition: background .2s;
}
.feat:hover { background: var(--background); }
.feat-ico {
  width: 40px; height: 40px; border-radius: 11px; border: 1px solid var(--ink-12);
  display: inline-flex; align-items: center; justify-content: center; color: var(--ink); background: var(--background);
}
.feat-ico svg { width: 20px; height: 20px; }
.feat h3 { font-family: var(--font-serif); font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }
.feat p { font-size: 15px; color: var(--ink-55); line-height: 1.55; }
.feat .more {
  margin-top: auto; font-size: 13px; color: var(--ink-70); display: inline-flex; align-items: center; gap: 6px;
  font-weight: 500;
}
.feat:hover .more svg { transform: translateX(3px); }
.feat .more svg { width: 14px; height: 14px; transition: transform .18s; }

/* ---------- Device frames ---------- */
.phone {
  width: 300px; aspect-ratio: 300 / 620; border-radius: 42px;
  border: 9px solid #1a1a18; background: #1a1a18;
  box-shadow: 0 40px 80px -40px oklch(0.145 0.005 60 / 0.55), 0 0 0 1px var(--ink-08);
  position: relative; overflow: hidden; flex-shrink: 0;
}
.phone-inner { position: absolute; inset: 0; border-radius: 33px; overflow: hidden; background: var(--background); }
.phone-notch { position: absolute; top: 9px; left: 50%; transform: translateX(-50%); width: 86px; height: 23px; border-radius: 999px; background: #000; z-index: 30; }
.phone-status { position: absolute; top: 0; left: 0; right: 0; height: 40px; display: flex; justify-content: space-between; align-items: center; padding: 14px 26px 0; font-size: 12px; font-weight: 600; z-index: 5; font-variant-numeric: tabular-nums; color: var(--ink); }
.phone-status .right { display: flex; gap: 5px; align-items: center; }

.browser {
  width: 100%; background: var(--background); border-radius: 14px; overflow: hidden;
  box-shadow: 0 40px 90px -50px oklch(0.145 0.005 60 / 0.5), 0 0 0 1px var(--ink-08);
  position: relative;
}
.browser-bar { height: 38px; background: var(--muted); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; padding: 0 14px; }
.browser-tl { width: 11px; height: 11px; border-radius: 999px; }
.browser-url { flex: 1; max-width: 320px; margin: 0 auto; height: 22px; background: var(--background); border-radius: 6px; padding: 0 10px; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 11px; color: var(--muted-foreground); border: 1px solid var(--border); }

/* ---------- Mock screen internals (mirrors Hi-Fi) ---------- */
.scr { background: var(--background); color: var(--ink); height: 100%; position: relative; }
.scr-serif { font-family: var(--font-serif); }
.rail { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--border); }
.rail-dot { position: absolute; width: 10px; height: 10px; border-radius: 999px; box-shadow: 0 0 0 4px var(--background); }
.rail-dot.now { background: var(--ink); }
.rail-dot.past { background: var(--ink-40); }
.month-h { font-family: var(--font-serif); font-weight: 600; font-size: 21px; color: var(--ink-70); letter-spacing: -0.01em; }
.mood { font-size: 14px; line-height: 1; }
.entry-title { font-family: var(--font-serif); font-weight: 600; letter-spacing: -0.005em; }
.entry-body { font-family: var(--font-serif); color: var(--ink-70); }

/* ---------- Quote / pull ---------- */
.pull {
  font-family: var(--font-serif); font-style: italic; font-weight: 500;
  font-size: clamp(26px, 4.2vw, 46px); line-height: 1.28; letter-spacing: -0.015em;
  color: var(--ink); text-wrap: balance;
}

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--ink-08); padding: 72px 0 48px; background: var(--paper-deep); }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 48px; }
.footer h4 { font-family: var(--font-sans); font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-40); margin-bottom: 16px; }
.footer-links { display: flex; flex-direction: column; gap: 11px; }
.footer-links a { font-size: 15px; color: var(--ink-70); text-decoration: none; transition: color .15s; }
.footer-links a:hover { color: var(--ink); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--ink-08); font-size: 13px; color: var(--ink-40); flex-wrap: wrap; }

/* ---------- Page hero (sub-pages) ---------- */
.page-hero { padding: clamp(56px, 9vw, 110px) 0 clamp(40px, 6vw, 72px); }
.back-link { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-55); text-decoration: none; margin-bottom: 26px; }
.back-link:hover { color: var(--ink); }
.back-link svg { width: 14px; height: 14px; }

/* ---------- Detail rows ---------- */
.detail {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 6vw, 88px);
  align-items: center;
}
.detail.rev .detail-media { order: -1; }
.detail-list { display: flex; flex-direction: column; gap: 22px; margin-top: 28px; }
.detail-list li { display: flex; gap: 14px; }
.detail-list .di {
  width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--ink-12); background: var(--background);
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--ink);
}
.detail-list .di svg { width: 17px; height: 17px; }
.detail-list h4 { font-family: var(--font-serif); font-size: 18px; }
.detail-list p { font-size: 14.5px; color: var(--ink-55); margin-top: 2px; line-height: 1.5; }

/* ---------- CTA band ---------- */
.cta-band { background: var(--ink); color: var(--paper); border-radius: 28px; padding: clamp(48px, 7vw, 84px); text-align: center; }
.cta-band .display, .cta-band .h-xl { color: var(--paper); }
.cta-band .lead { color: oklch(0.985 0.004 60 / 0.72); }
.cta-band .btn-primary { background: var(--paper); color: var(--ink); }
.cta-band .btn-primary:hover { background: oklch(0.985 0.004 60 / 0.9); }
.cta-band .btn-ghost { color: oklch(0.985 0.004 60 / 0.8); }
.cta-band .btn-ghost:hover { color: var(--paper); }

/* ---------- Reveal on scroll ----------
   Default visible (so no-JS / capture / slow-JS never blanks).
   Only hidden when html.js is present AND not yet revealed. */
.reveal { transition: opacity .7s ease, transform .7s ease; }
.js .reveal:not(.in) { opacity: 0; transform: translateY(18px); }
@media (prefers-reduced-motion: reduce) {
  .js .reveal:not(.in) { opacity: 1; transform: none; }
  .reveal { transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  body { font-size: 16px; }
  .nav-links { display: none; }
  .nav-links.open {
    display: flex; flex-direction: column; align-items: stretch; gap: 2px;
    position: absolute; top: 66px; left: 0; right: 0; background: var(--paper);
    border-bottom: 1px solid var(--ink-08); padding: 12px 20px 20px;
  }
  .nav-links.open .nav-link { padding: 12px 10px; font-size: 16px; }
  .nav-links.open .nav-cta { margin: 8px 0 0; }
  .nav-burger {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border: 1px solid var(--ink-12); border-radius: 10px;
    background: transparent; cursor: pointer; color: var(--ink);
  }
  .feat-grid { grid-template-columns: 1fr; }
  .detail { grid-template-columns: 1fr; gap: 40px; }
  .detail.rev .detail-media { order: 0; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer-brand-col { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .wrap { padding: 0 22px; }
  .footer-grid { grid-template-columns: 1fr; }
}
