/* serene.day home: one quiet column. Tokens follow DESIGN.md (theme.tsx):
   cream canvas, sage used sparingly, Inter Light headlines, Georgia italic
   only for the words meant to comfort. */

@font-face { font-family: "Inter"; font-weight: 300; font-display: swap; src: url("/fonts/Inter_300Light.ttf") format("truetype"); }
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("/fonts/Inter_400Regular.ttf") format("truetype"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url("/fonts/Inter_500Medium.ttf") format("truetype"); }

:root {
  --ground: #f9f8f6;
  --step: #f0eee9;        /* one tone darker than the ground */
  --card: #ffffff;
  --ink: #3c3c3b;
  --soft: #5f5e5b;        /* secondary text that still reads (DESIGN.md: web muted) */
  --accent: #a8bba4;      /* sage */
  --accent-ink: #1f261e;  /* text on sage */
  --accent-soft: #e6ece4;
  --ui-line: rgba(0, 0, 0, 0.07);
  --drop-line: rgba(0, 0, 0, 0.14);

  --display: clamp(42px, 5.4vw, 76px);
  --h2: clamp(28px, 2.8vw, 38px);
  --lead: 20px;
  --body: 18px;
  --small: 15px;

  --m: 24px;                           /* side margins */
  --gap: clamp(96px, 12vw, 160px);     /* between sections */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #262a26;
    --step: #30352f;
    --card: #30352f;
    --ink: #e7e5e0;
    --soft: #c2bfb9;
    --accent-ink: #172016;
    --accent-soft: #344033;
    --ui-line: rgba(255, 255, 255, 0.08);
    --drop-line: rgba(255, 255, 255, 0.16);
  }
}
:root[data-theme="dark"] {
  --ground: #262a26;
  --step: #30352f;
  --card: #30352f;
  --ink: #e7e5e0;
  --soft: #c2bfb9;
  --accent-ink: #172016;
  --accent-soft: #344033;
  --ui-line: rgba(255, 255, 255, 0.08);
  --drop-line: rgba(255, 255, 255, 0.16);
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 var(--body)/1.6 "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; font-weight: 300; text-wrap: balance; }
p, ul, dl, dd, figure, blockquote { margin: 0; }
a { color: inherit; text-underline-offset: 4px; text-decoration-thickness: 1px; }
button { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
svg { flex: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--accent); color: var(--accent-ink); }
.skip { position: absolute; left: var(--m); top: -60px; background: var(--ink); color: var(--ground); padding: 10px 16px; z-index: 10; }
.skip:focus { top: 12px; }

/* The one column */
.wrap { width: 100%; max-width: calc(760px + 2 * var(--m)); margin-inline: auto; padding-inline: var(--m); }
main > section + section { margin-top: var(--gap); }
h2 { font-size: var(--h2); line-height: 1.2; letter-spacing: -0.015em; }
.lead { margin-top: 16px; font-size: var(--lead); line-height: 1.55; }
.caption { margin-top: 14px; font-size: var(--small); color: var(--soft); }
html:not(.js) .js-only { display: none; }

/* Buttons: one shape, square-cornered and flat */
.stores { display: flex; flex-wrap: wrap; gap: 12px; }
.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 50px; padding: 0 24px;
  background: var(--ink); color: var(--ground);
  font-weight: 500; text-decoration: none;
  transition: transform 160ms var(--ease-out), opacity 160ms var(--ease-out);
}
.button:hover { opacity: 0.88; }
.button:active { transform: scale(0.97); }
.button.alt { background: var(--step); color: var(--ink); }
.button.soon, .button.soon:hover { cursor: default; opacity: 0.7; }
.button.soon:active { transform: none; }

/* Navigation */
.nav { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-top: 28px; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 500; font-size: 14px; letter-spacing: 0.22em; text-transform: uppercase; }
.wordmark svg, .foot-mark svg { fill: var(--accent); stroke: var(--accent); }
.nav nav { display: flex; gap: 24px; font-size: var(--small); }
.nav nav a { text-decoration: none; color: var(--soft); transition: color 160ms var(--ease-out); }
.nav nav a:hover { color: var(--ink); }

/* Hero */
.hero { padding-top: clamp(80px, 14vh, 140px); }
.hero h1 { font-size: var(--display); line-height: 1.05; letter-spacing: -0.035em; }
.hero .lede { margin-top: 28px; font-size: var(--lead); line-height: 1.55; max-width: 34em; }
.hero .stores { margin-top: 32px; }
.note { margin-top: 12px; font-size: var(--small); color: var(--soft); }
.hero > * { animation: rise 800ms var(--ease-out) both; }
.hero > :nth-child(2) { animation-delay: 80ms; }
.hero > :nth-child(3) { animation-delay: 160ms; }
.hero > :nth-child(4) { animation-delay: 220ms; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }

/* The feeling picker, as in the app */
.try { margin-top: 72px !important; }
.heart { background: var(--step); border-radius: 28px; padding: 28px; font-size: var(--small); }
.heart-q { font-weight: 300; font-size: 22px; line-height: 1.3; letter-spacing: -0.2px; }
.feelings { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.feelings button {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 40px; padding: 0 14px;
  border: 1px solid var(--ui-line); border-radius: 12px; background: var(--ground);
  font-size: var(--small); font-weight: 500; cursor: pointer;
  transition: transform 120ms var(--ease-out), background-color 160ms var(--ease-out), border-color 160ms var(--ease-out);
}
.feelings button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.feelings button:hover { border-color: var(--accent); }
.feelings button:active { transform: scale(0.97); }
.feelings button[aria-checked="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.message { margin-top: 22px; }
.message-type { font-size: var(--small); color: var(--soft); }
.message blockquote { margin-top: 6px; font: italic 20px/1.5 var(--serif); }
.message.swap blockquote, .message.swap .message-type { animation: fade 220ms var(--ease-out); }
.message a { display: inline-block; margin-top: 12px; font-size: var(--small); font-weight: 500; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }

/* Four quiet things */
.inside dl { margin-top: 32px; display: grid; gap: 24px; }
.inside dl > div { display: grid; grid-template-columns: 120px 1fr; gap: 24px; }
.inside dt { font-weight: 500; }
.inside dd { color: var(--ink); }

/* Free and Premium */
.plans { display: grid; gap: 10px; margin-top: 32px; }
.plans ul { list-style: none; padding: 0 20px 20px; margin: 0; display: grid; gap: 10px; }
.plans li { padding-left: 18px; position: relative; }
.plans li::before { content: ""; position: absolute; left: 0; top: 0.65em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.price { margin-top: 36px; color: var(--soft); }

/* Private journal, encrypted in front of you */
.type-line { display: block; margin-top: 36px; }
.type-hint { display: block; font-size: var(--small); color: var(--soft); margin-bottom: 6px; }
.type-line textarea {
  display: block; width: 100%; resize: none; overflow: hidden;
  border: 0; border-bottom: 2px solid var(--accent); border-radius: 0;
  background: none; color: var(--ink); padding: 0 0 10px;
  font: 300 clamp(26px, 3vw, 34px)/1.25 "Inter", sans-serif; letter-spacing: -0.02em;
  caret-color: var(--accent);
  field-sizing: content;
  transition: border-color 160ms var(--ease-out);
}
.type-line textarea:hover, .type-line textarea:focus { outline: none; border-bottom-color: var(--ink); }
.sealed { margin-top: 18px; display: grid; gap: 4px; font-size: var(--small); }
.sealed span { color: var(--soft); }
.sealed code { font: 14px/1.5 ui-monospace, "SF Mono", Menlo, monospace; word-break: break-all; }

/* Questions */
.faq h2 { margin-bottom: 14px; }
/* Tap-to-open boxes: Free / Premium and the questions */
.faq { display: grid; gap: 10px; }
.drop { background: var(--step); border: 1px solid var(--drop-line); border-radius: 16px; transition: border-color 160ms var(--ease-out); }
.drop:hover, .drop[open] { border-color: var(--accent); }
.drop summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px;
  padding: 16px 20px; font-size: var(--lead); color: var(--ink);
}
.drop summary::-webkit-details-marker { display: none; }
.drop summary > span:last-of-type { flex: 1; min-width: 0; }
.drop summary::after {
  content: ""; flex: none; margin-left: auto; width: 9px; height: 9px;
  border-right: 2px solid var(--soft); border-bottom: 2px solid var(--soft);
  transform: translateY(-3px) rotate(45deg); transition: transform 200ms var(--ease-out);
}
.drop[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.drop summary:focus-visible { outline-offset: -2px; border-radius: 16px; }
.drop-note { margin-left: 8px; font-size: var(--small); color: var(--soft); }
.drop > p { padding: 0 20px 18px; max-width: 38em; }
.drop[open] > p, .drop[open] > ul { animation: fade 200ms var(--ease-out); }

/* Close */
.close .stores { margin-top: 28px; }

/* Footer */
.foot { margin-top: var(--gap); padding-top: 48px; padding-bottom: 48px; font-size: var(--small); }
.foot-help { color: var(--ink); }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 20px; color: var(--soft); }
.foot-links a { text-decoration: none; }
.foot-links a:hover { text-decoration: underline; color: var(--ink); }
.foot-mark { display: flex; align-items: center; gap: 10px; margin-top: 32px; color: var(--soft); }

/* Entrances: only with script, so nothing stays hidden without it */
.js .reveal { opacity: 0; transform: translateY(20px); transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out); }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: 1ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* Phone */
@media (max-width: 600px) {
  :root { --m: 20px; --lead: 18px; }
  .nav nav { gap: 16px; }
  .nav nav a[href="#private"] { display: none; }
  .hero { padding-top: 64px; }
  .heart { padding: 22px 18px; border-radius: 24px; }
  .heart-q { font-size: 20px; }
  .inside dl > div { grid-template-columns: 1fr; gap: 4px; }
  .drop-note { display: block; margin: 2px 0 0; }
  .stores .button { flex: 1 1 auto; }
}

/* Light/dark switch at the top (theme.js). The icon shows where it will take you. */
.theme-toggle { display: inline-grid; place-items: center; width: 40px; height: 40px; margin: -8px -8px -8px 0; border: 0; border-radius: 50%; background: none; color: var(--soft); cursor: pointer; transition: color 160ms, background-color 160ms; }
.theme-toggle:hover { color: var(--ink, var(--text)); background: var(--step, var(--card)); }
.theme-toggle[hidden] { display: none; }
.theme-toggle svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: none; }
}
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }
