/* Ichi — calm technology. Warm Paper canvas, weight-based SF type, one serif
   accent (Fraunces) for soul. Tokens mirror IchiKit/Theme/ThemeCatalog.swift. */

@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@1,6..72,400..600&display=swap');

:root {
  /* page */
  --paper:       #ECE3D0;
  --paper-lift:  #F3ECDD;
  --ink:         #2E2820;
  --ink-soft:    #5E5648;
  --muted:       #8A7E6A;
  --muted-faint: rgba(138,126,106,0.42);
  --line:        rgba(46,40,32,0.11);
  --hair:        rgba(46,40,32,0.07);
  --accent:      #B86B43;
  --accent-deep: #9A5733;

  /* the focus panel — retinted live by the theme switcher */
  --panel-bg:    #F8F2E6;
  --panel-glow:  rgba(184,107,67,0.10);
  --panel-ink:   #2E2820;
  --panel-muted: #8A7E6A;
  --panel-ring:  #B0A48C;
  --panel-acc:   #B86B43;
  --panel-shadow: rgba(46,40,32,0.16);

  --ui: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', system-ui, 'Segoe UI', sans-serif;
  --serif: 'Newsreader', ui-serif, 'Iowan Old Style', 'Palatino', Georgia, serif;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-soft: cubic-bezier(0.33, 0, 0.2, 1);
  --spring: cubic-bezier(0.34, 1.4, 0.64, 1); /* gentle overshoot for press release */
}

/* Cool Mist */
:root[data-theme="mist"] {
  --panel-bg: #FFFFFF; --panel-glow: rgba(91,138,166,0.12);
  --panel-ink: #1E2630; --panel-muted: #7A8694; --panel-ring: #A9B4C0; --panel-acc: #5B8AA6;
  --panel-shadow: rgba(30,38,48,0.14);
}
/* Nocturne */
:root[data-theme="nocturne"] {
  --panel-bg: #14151B; --panel-glow: rgba(126,136,214,0.20);
  --panel-ink: #ECEDF2; --panel-muted: #8A8F9C; --panel-ring: #4A4E5C; --panel-acc: #7E88D6;
  --panel-shadow: rgba(0,0,0,0.45);
}
/* Aurora */
:root[data-theme="aurora"] {
  --panel-bg: #F3E8F4; --panel-glow: rgba(155,123,212,0.16);
  --panel-ink: #2A2438; --panel-muted: #6E6580; --panel-ring: #C3B2D4; --panel-acc: #9B7BD4;
  --panel-shadow: rgba(42,36,56,0.16);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  /* warm light from above + faint terracotta pool below */
  background-image:
    radial-gradient(120% 70% at 50% -10%, rgba(255,251,242,0.7), transparent 55%),
    radial-gradient(80% 50% at 80% 110%, rgba(184,107,67,0.06), transparent 60%);
  background-attachment: fixed;
}
/* almost-invisible paper grain */
body::before {
  content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: 0.5; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 240 240' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
}
.wrap { max-width: 940px; margin: 0 auto; padding: 0 28px; position: relative; z-index: 1; }

/* ─── nav ───────────────────────────────────────────────── */
.nav { display: flex; align-items: center; justify-content: space-between; padding: 30px 0 0; }
.nav-mark { display: flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 17px; letter-spacing: -0.01em; }
.nav-mark img { width: 28px; height: 28px; border-radius: 8px; box-shadow: 0 1px 4px rgba(46,40,32,0.2); }
.nav-links { display: flex; gap: 28px; font-size: 14px; font-weight: 500; }
.nav-links a { color: var(--muted); text-decoration: none; transition: color 0.18s var(--ease); }
.nav-links a:hover { color: var(--accent); }

/* ─── hero ──────────────────────────────────────────────── */
.hero { padding: 64px 0 40px; text-align: center; }
.app-icon {
  display: block; width: 92px; height: 92px; margin: 0 auto 30px;
  border-radius: 21px;
  box-shadow: 0 14px 34px -10px rgba(46,40,32,0.38), 0 0 0 1px var(--hair);
}
.kicker {
  font-size: 13px; font-weight: 600; letter-spacing: 0.26em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 26px;
}
.headline {
  font-size: clamp(40px, 7vw, 74px); font-weight: 600; line-height: 1.02;
  letter-spacing: -0.035em; color: var(--ink); max-width: 16ch; margin: 0 auto;
}
.headline em {
  font-family: var(--serif); font-style: italic; font-weight: 600;
  font-optical-sizing: auto; letter-spacing: 0; color: var(--accent);
  font-size: 1.06em;
}
.subhead {
  font-size: clamp(17px, 2.2vw, 20px); color: var(--muted); font-weight: 450;
  max-width: 38ch; margin: 24px auto 0; line-height: 1.45;
}

/* ─── the live focus panel (the page IS the product) ────── */
.stage { margin: 52px auto 0; max-width: 560px; }
.panel {
  position: relative; overflow: hidden;
  background: var(--panel-bg);
  border-radius: 32px;
  padding: 36px 44px 28px;
  height: 290px; /* fixed so the card never resizes between active and All-clear */
  display: flex; flex-direction: column;
  box-shadow: 0 1px 0 rgba(255,255,255,0.35) inset, 0 30px 70px -28px var(--panel-shadow), 0 0 0 1px var(--hair);
  text-align: left;
  transition: background 0.6s var(--ease-soft), box-shadow 0.6s var(--ease-soft);
}
.panel-glow {
  position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(60% 45% at 50% 52%, var(--panel-glow), transparent 70%);
  transition: opacity 0.9s var(--ease-soft);
}
.panel.cleared .panel-glow { opacity: 1; }

/* the one task — completion circle ABOVE a large title, mirroring the app Home */
.task { display: flex; flex-direction: column; gap: 20px; margin: 30px 0 auto; position: relative; }
.task-row { display: flex; flex-direction: column; align-items: flex-start; gap: 22px; }
.check {
  flex: none; width: 38px; height: 38px; border-radius: 50%;
  border: 2.5px solid var(--panel-ring); background: transparent;
  cursor: pointer; position: relative;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease), transform 0.22s var(--spring);
}
.check:hover { border-color: var(--panel-acc); transform: scale(1.08); }
.check:active { transform: scale(0.9); }
.check svg { position: absolute; inset: 0; margin: auto; width: 22px; height: 22px; }
.check svg path { stroke: var(--panel-bg); stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; fill: none; stroke-dasharray: 26; stroke-dashoffset: 26; }
.check.done { background: var(--panel-acc); border-color: var(--panel-acc); }
.check.done svg path { animation: draw 0.34s var(--ease) 0.06s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* the Calm Bloom — a single expanding ring, never confetti (§7) */
.bloom {
  position: absolute; left: 19px; top: 19px; width: 38px; height: 38px;
  border-radius: 50%; border: 2px solid var(--panel-acc);
  transform: translate(-50%,-50%) scale(1); opacity: 0; pointer-events: none;
}
.bloom.go { animation: bloom 0.72s var(--ease-soft) forwards; }
@keyframes bloom {
  0% { opacity: 0.55; transform: translate(-50%,-50%) scale(0.9); }
  100% { opacity: 0; transform: translate(-50%,-50%) scale(7); }
}

.task-title {
  font-size: clamp(27px, 4.4vw, 33px); font-weight: 600; letter-spacing: -0.025em;
  line-height: 1.12; color: var(--panel-ink); transition: color 0.6s var(--ease-soft);
}
.task.leaving .task-title { text-decoration: line-through; text-decoration-color: var(--panel-muted); }
.task.entering { animation: rise-in 0.5s var(--ease) both; }
.task.leaving  { animation: float-up 0.42s var(--ease) both; }
@keyframes rise-in { from { opacity: 0; transform: translateY(34px); } to { opacity: 1; transform: translateY(0); } }
@keyframes float-up { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-26px); } }

/* all-clear rest state */
.cleared-state { text-align: center; margin: auto 0; }
.cleared-state .big { font-family: var(--ui); font-size: 38px; font-weight: 700; letter-spacing: -0.02em; color: var(--panel-ink); }
.cleared-state .small { font-size: 16px; color: var(--panel-muted); margin-top: 8px; }
.cleared-state .replay { margin-top: 26px; }
.cleared-state { animation: rise-in 0.6s var(--ease) both; }
.cleared-state.leaving { animation: float-up 0.42s var(--ease) both; }

.panel-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 28px; min-height: 34px; }
.hint { font-size: 13px; color: var(--panel-muted); font-weight: 500; opacity: 0.9; transition: opacity 0.3s var(--ease); }
.replay {
  font-size: 13px; font-weight: 600; color: var(--panel-acc); cursor: pointer;
  letter-spacing: 0.01em; border: 0; padding: 8px 15px; border-radius: 999px;
  background: color-mix(in srgb, var(--panel-acc) 10%, transparent);
  opacity: 0; pointer-events: none;
  transition: opacity 0.4s var(--ease), background 0.22s var(--ease), transform 0.22s var(--spring);
  display: inline-flex; align-items: center; gap: 7px;
}
.replay-ico { display: inline-flex; align-items: center; transition: transform 0.5s var(--spring); }
.replay-ico svg { width: 15px; height: 15px; display: block; }
.replay:hover { background: color-mix(in srgb, var(--panel-acc) 20%, transparent); transform: translateY(-1px); }
.replay:hover .replay-ico { transform: rotate(-180deg); }
.replay:active { transform: translateY(0) scale(0.95); }
.panel.cleared .replay { opacity: 1; pointer-events: auto; }
.panel.cleared .hint { opacity: 0; }
.panel.cleared .panel-foot { display: none; } /* empty in the cleared state — let the rest content center fully */

/* ─── theme switcher (the Pro lever, made tangible) ─────── */
.themes { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 26px auto 0; }
.themes .label { font-size: 12px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-right: 4px; }
.swatch {
  width: 32px; height: 32px; border-radius: 9px; cursor: pointer; padding: 0;
  border: 1.5px solid var(--line); position: relative; background: var(--sw-bg);
  box-shadow: 0 2px 8px rgba(46,40,32,0.12); transition: transform 0.22s var(--spring), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
/* a small accent dot tucked in the bottom-right — mirrors the app's theme swatch */
.swatch::after {
  content: ''; position: absolute; right: 5px; bottom: 5px;
  width: 9px; height: 9px; border-radius: 50%; background: var(--sw-acc);
}
.swatch:hover { transform: translateY(-2px) scale(1.08); box-shadow: 0 5px 14px rgba(46,40,32,0.18); }
.swatch:active { transform: translateY(0) scale(0.92); }
.swatch[aria-pressed="true"] { border-color: var(--ink); border-width: 2px; }
:root[data-theme="nocturne"] .swatch[aria-pressed="true"] { border-color: var(--accent); }
.swatch .pro { position: absolute; top: -7px; right: -7px; font-size: 8px; font-weight: 800; letter-spacing: 0.06em; color: #fff; background: var(--accent); padding: 1px 4px; border-radius: 6px; box-shadow: 0 1px 3px rgba(46,40,32,0.25); }
.sw-warm { --sw-bg: #F8F2E6; --sw-acc: #B86B43; }
.sw-mist { --sw-bg: #FFFFFF; --sw-acc: #5B8AA6; }
.sw-noc  { --sw-bg: #1A1C22; --sw-acc: #7E88D6; }
.sw-aur  { --sw-bg: #F7F2FB; --sw-acc: #9B7BD4; }

/* ─── cta ───────────────────────────────────────────────── */
.cta { text-align: center; margin: 60px 0 0; }
.btn {
  display: inline-flex; align-items: center; gap: 12px; padding: 15px 26px;
  background: var(--ink); color: var(--paper-lift); border-radius: 16px; text-decoration: none;
  font-weight: 600; box-shadow: 0 12px 30px -10px rgba(46,40,32,0.5);
  transition: transform 0.22s var(--spring), background 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.btn:hover { transform: translateY(-2px); background: #1f1b15; box-shadow: 0 16px 36px -10px rgba(46,40,32,0.55); }
.btn:active { transform: translateY(0) scale(0.97); }
.btn .glyph { display: inline-flex; }
.btn .copy { display: flex; flex-direction: column; align-items: flex-start; line-height: 1; gap: 2px; }
.btn .lead { font-size: 10px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.7; }
.btn .label { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.cta-meta { margin-top: 18px; font-size: 13px; color: var(--muted); font-weight: 500; letter-spacing: 0.02em; }
.cta-meta span + span::before { content: '·'; margin: 0 9px; color: var(--muted-faint); }

/* ─── editorial statement ───────────────────────────────── */
.statement { padding: 120px 0; text-align: center; border-top: 1px solid var(--hair); margin-top: 90px; }
.statement p { font-size: clamp(26px, 4vw, 40px); font-weight: 500; line-height: 1.28; letter-spacing: -0.025em; color: var(--ink); max-width: 22ch; margin: 0 auto; text-wrap: balance; }
.statement em { font-family: var(--serif); font-style: italic; font-weight: 600; font-optical-sizing: auto; font-size: 1.02em; color: var(--accent); white-space: nowrap; }
.statement .by { margin-top: 30px; font-size: 14px; color: var(--muted); font-weight: 500; letter-spacing: 0.04em; }

/* ─── principles ────────────────────────────────────────── */
.principles { padding: 30px 0 100px; }
.principles-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border-radius: 20px; overflow: hidden; box-shadow: 0 0 0 1px var(--line); }
.cell { background: var(--paper); padding: 34px 32px; }
.cell h3 { font-size: 18px; font-weight: 650; letter-spacing: -0.02em; color: var(--ink); margin-bottom: 9px; }
.cell h3 .mk { color: var(--accent); font-weight: 700; margin-right: 8px; }
.cell p { font-size: 15px; line-height: 1.55; color: var(--ink-soft); max-width: 36ch; }

/* ─── pro ───────────────────────────────────────────────── */
.pro { padding: 0 0 110px; }
.pro-card {
  background: var(--paper-lift); border-radius: 28px; padding: 56px 48px;
  box-shadow: inset 0 0 0 1px var(--hair); text-align: center;
}
.pro-card .eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; color: var(--accent); margin-bottom: 16px; }
.pro-card h2 { font-size: clamp(28px, 4vw, 40px); font-weight: 600; letter-spacing: -0.03em; color: var(--ink); margin-bottom: 16px; }
.pro-card h2 em { font-family: var(--serif); font-style: italic; font-weight: 600; font-optical-sizing: auto; font-size: 1.04em; color: var(--accent); white-space: nowrap; }
.pro-card p { font-size: 16px; line-height: 1.6; color: var(--muted); max-width: 50ch; margin: 0 auto; }
.pro-card p b { color: var(--ink); font-weight: 600; }
.pro-price { margin-top: 24px; font-size: 14px; color: var(--ink-soft); font-weight: 500; }
.pro-price a { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--line); padding-bottom: 1px; }
.pro-price a:hover { border-color: var(--accent); }

/* ─── footer ────────────────────────────────────────────── */
.foot {
  border-top: 1px solid var(--line); padding: 34px 0 70px;
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px;
  font-size: 13px; color: var(--muted); font-weight: 500;
}
.foot a { color: var(--muted); text-decoration: none; transition: color 0.18s var(--ease); }
.foot a:hover { color: var(--accent); }
.foot-links { display: flex; gap: 26px; }

/* ─── load-in motion ────────────────────────────────────── */
@keyframes up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
.app-icon { animation: up 0.6s var(--ease) both; }
.kicker   { animation: up 0.6s var(--ease) 0.12s both; }
.headline { animation: up 0.7s var(--ease) 0.1s both; }
.subhead  { animation: up 0.7s var(--ease) 0.2s both; }
.stage    { animation: up 0.8s var(--ease) 0.32s both; }
.themes   { animation: up 0.8s var(--ease) 0.46s both; }
.cta      { animation: up 0.8s var(--ease) 0.56s both; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; }
  .bloom { display: none; }
}

/* ─── legal pages (privacy / terms / support) ───────────── */
.legal { padding: 56px 0 40px; max-width: 680px; }
.legal h1 { font-size: clamp(32px, 5vw, 42px); font-weight: 600; letter-spacing: -0.03em; line-height: 1.08; color: var(--ink); margin-bottom: 10px; }
.legal .meta { font-size: 14px; color: var(--muted); margin-bottom: 44px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.legal h2 { font-size: 19px; font-weight: 650; letter-spacing: -0.02em; color: var(--ink); margin: 38px 0 12px; }
.legal h2:first-of-type { margin-top: 0; }
.legal p, .legal li { font-size: 15.5px; line-height: 1.68; color: var(--ink-soft); max-width: 64ch; margin-bottom: 12px; }
.legal ul { padding-left: 22px; margin-bottom: 12px; }
.legal li { margin-bottom: 7px; }
.legal strong { color: var(--accent-deep); font-weight: 600; }
.legal a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(184,107,67,0.4); }
.legal a:hover { text-decoration-color: var(--accent); }
.legal code { font-size: 0.92em; background: rgba(46,40,32,0.06); padding: 1px 6px; border-radius: 4px; color: var(--accent-deep); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.legal hr { border: 0; border-top: 1px solid var(--line); margin: 52px 0 40px; }

@media (max-width: 680px) {
  .wrap { padding: 0 20px; }
  .hero { padding: 44px 0 30px; }
  .app-icon { width: 78px; height: 78px; margin-bottom: 24px; border-radius: 18px; }
  .panel { padding: 28px 26px 24px; height: 258px; border-radius: 26px; }
  .task { margin-top: 26px; }
  .statement { padding: 80px 0; margin-top: 60px; }
  .principles-grid { grid-template-columns: 1fr; }
  .pro-card { padding: 40px 26px; }
  .nav-links { gap: 18px; }
}
