/* Reclaim · web skin. Tokens mirror docs/06_DESIGN_SYSTEM.md and RCTheme.swift. */

:root {
  --bg: #131110;
  --surface: #1B1714;
  --surface2: #251F1A;
  --line: #2E2721;
  --ink: #F2EDE6;
  --ink2: #A79C90;
  --ink3: #92877B;
  --accent: #A3C9A8;
  --accentDeep: #3E5C4B;
  --ember: #E3A857;
  --relapse: #C97B63;
  --serif: "New York", ui-serif, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
  --shell: 880px;
  --measure: 680px;
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accentDeep); color: var(--ink); }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--ink); }

a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- Shell ---------- */

.shell { max-width: var(--shell); margin: 0 auto; padding: 0 24px; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 28px;
  padding-bottom: 28px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1;
}
.wordmark img { width: 30px; height: 30px; border-radius: 8px; display: block; }
.wordmark:hover { color: var(--ink); }

.site-nav { display: flex; gap: 4px; }
.site-nav a {
  color: var(--ink2);
  font-size: 15px;
  padding: 12px 12px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--ink); }

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: clamp(72px, 10vw, 120px);
  padding-top: 40px;
  padding-bottom: 56px;
  color: var(--ink3);
  font-size: 14px;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin-bottom: 20px;
}
.footer-links a { color: var(--ink2); padding: 6px 0; }
.footer-links a:hover { color: var(--ink); }
.footer-note { margin: 0; max-width: 60ch; }
.footer-note + .footer-note { margin-top: 10px; }

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 28px;
  border-radius: 16px;
  background: var(--ink);
  color: var(--bg);
  font-size: 17px;
  font-weight: 600;
  border: 0;
  cursor: pointer;
}
.button:hover { color: var(--bg); }
.button:active { opacity: 0.85; }

.button-quiet {
  background: none;
  color: var(--ink);
  border: 1px solid var(--line);
}
.button-quiet:hover { color: var(--ink); border-color: var(--ink3); }

/* ---------- Landing ---------- */

.hero {
  text-align: center;
  padding-top: clamp(56px, 9vw, 104px);
  padding-bottom: clamp(16px, 3vw, 32px);
}

.ring { width: 164px; height: 164px; margin: 0 auto 36px; position: relative; }
.ring svg { display: block; width: 100%; height: 100%; }
.ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.ring-days {
  font-family: var(--serif);
  font-size: 56px;
  line-height: 1;
  color: var(--ink);
}
.ring-label { font-size: 14px; color: var(--ink2); }

.ring-arc {
  stroke-dasharray: 439.82;
  stroke-dashoffset: 62.83; /* day 12, next milestone 14: 12/14 of the way there */
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  animation: ring-draw 1.4s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both;
}
@keyframes ring-draw {
  from { stroke-dashoffset: 439.82; }
  to { stroke-dashoffset: 62.83; }
}

.hero h1 {
  font-family: var(--serif);
  font-size: clamp(2.6rem, 7vw, 3.9rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
  margin: 0 auto 20px;
  max-width: 14ch;
}
.hero .lede {
  color: var(--ink2);
  font-size: 19px;
  line-height: 1.6;
  max-width: 56ch;
  margin: 0 auto 36px;
  text-wrap: pretty;
}
.hero-meta {
  margin-top: 18px;
  color: var(--ink3);
  font-size: 14px;
}

.section { padding-top: clamp(64px, 10vw, 112px); }
.section h2, .night h2, .final h2 {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 4.5vw, 2.4rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
  text-wrap: balance;
  margin: 0 0 16px;
}
.section > .shell > p, .section-intro {
  color: var(--ink2);
  max-width: 62ch;
  margin: 0;
  text-wrap: pretty;
}

/* How it works: a real sequence, so the numbers carry information */
.steps { list-style: none; margin: 44px 0 0; padding: 0; }
.steps li {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 20px;
  padding: 28px 0;
  border-top: 1px solid var(--line);
}
.steps li:last-child { border-bottom: 1px solid var(--line); }
.step-n {
  font-family: var(--serif);
  font-size: 34px;
  line-height: 1.1;
  color: var(--ember);
}
.steps h3 { margin: 4px 0 6px; font-size: 19px; font-weight: 600; }
.steps p { margin: 0; color: var(--ink2); max-width: 60ch; }

/* Night band: the panic tool gets its own visual world */
.night {
  margin-top: clamp(64px, 10vw, 112px);
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: clamp(56px, 8vw, 88px) 0;
}
.night-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  align-items: center;
}
@media (min-width: 720px) {
  .night-grid { grid-template-columns: 1.2fr 0.8fr; gap: 56px; }
}
.orb-wrap { display: flex; justify-content: center; }
.orb {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 148px;
  height: 148px;
  border-radius: 50%;
  background: var(--ember);
  animation: orb-breathe 14s cubic-bezier(0.37, 0, 0.63, 1) infinite;
}
.orb-phase {
  position: absolute;
  font-size: 19px;
  font-weight: 600;
  color: var(--bg);
  opacity: 0;
}
.orb-phase-in   { animation: phase-in 14s linear infinite; }
.orb-phase-hold { animation: phase-hold 14s linear infinite; }
.orb-phase-out  { animation: phase-out 14s linear infinite; }
.orb-static {
  display: none;
  font-size: 19px;
  font-weight: 600;
  color: var(--bg);
}
/* Phase labels stay in sync with orb-breathe: 0-28.6% in, 28.6-57.2% hold, 57.2-100% out */
@keyframes phase-in {
  0% { opacity: 1; }
  24% { opacity: 1; }
  28.57% { opacity: 0; }
  99% { opacity: 0; }
  100% { opacity: 1; }
}
@keyframes phase-hold {
  0%, 26% { opacity: 0; }
  28.57% { opacity: 1; }
  54% { opacity: 1; }
  57.14%, 100% { opacity: 0; }
}
@keyframes phase-out {
  0%, 55% { opacity: 0; }
  57.14% { opacity: 1; }
  95% { opacity: 1; }
  99%, 100% { opacity: 0; }
}
@keyframes orb-breathe {
  0%   { transform: scale(0.72); opacity: 0.75; }  /* 4s inhale begins */
  28.6%{ transform: scale(1); opacity: 1; }        /* inhale done */
  57.2%{ transform: scale(1); opacity: 1; }        /* 4s hold */
  100% { transform: scale(0.72); opacity: 0.75; }  /* 6s exhale */
}
.breath-key {
  display: flex;
  justify-content: center;
  gap: 28px;
  margin-top: 28px;
  color: var(--ink2);
  font-size: 14px;
}
.breath-key strong { color: var(--ink); font-weight: 600; }

/* Recovery timeline */
.timeline { list-style: none; margin: 44px 0 0; padding: 0; }
.timeline li {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 20px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
}
.timeline li:last-child { border-bottom: 1px solid var(--line); }
.timeline .range {
  color: var(--ink3);
  font-size: 15px;
  padding-top: 3px;
  white-space: nowrap;
}
.timeline h3 { margin: 0 0 4px; font-size: 18px; font-weight: 600; }
.timeline p { margin: 0; color: var(--ink2); }
@media (max-width: 560px) {
  .timeline li { grid-template-columns: 1fr; gap: 4px; }
  .timeline .range { padding-top: 0; }
}

/* Privacy card */
.privacy-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px 32px;
  margin-top: 36px;
}
.privacy-card p { color: var(--ink2); margin: 0 0 14px; max-width: 62ch; }
.privacy-card p:last-child { margin-bottom: 0; }
.privacy-card strong { color: var(--ink); font-weight: 600; }

/* Pricing */
.plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 36px;
}
.plan {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px;
}
.plan.featured { background: var(--surface2); }
.plan-name { font-size: 15px; color: var(--ink2); margin: 0 0 10px; }
.plan-price {
  font-family: var(--serif);
  font-size: 44px;
  line-height: 1;
  margin: 0 0 6px;
}
.plan-price span { font-family: var(--sans); font-size: 16px; color: var(--ink2); }
.plan-note { color: var(--ink2); font-size: 15px; margin: 0; }
.plan-trial {
  display: inline-block;
  margin-top: 16px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--accentDeep);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}
.pricing-fineprint { color: var(--ink3); font-size: 14px; margin-top: 24px; max-width: 62ch; }

/* Final call */
.final { text-align: center; padding-top: clamp(72px, 11vw, 128px); }
.final h2 { max-width: 18ch; margin-left: auto; margin-right: auto; }
.final .button { margin-top: 28px; }

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

.prose { max-width: var(--measure); margin: 0 auto; padding: 40px 24px 0; }
.prose h1 {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 5vw, 2.8rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 8px;
  text-wrap: balance;
}
.prose h2 {
  font-family: var(--serif);
  font-size: 24px;
  line-height: 1.25;
  margin: 48px 0 12px;
  text-wrap: balance;
}
.prose p, .prose li { color: var(--ink2); text-wrap: pretty; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose ul { padding-left: 22px; }
.prose li + li { margin-top: 6px; }
.updated { color: var(--ink3); font-size: 14px; margin: 0 0 40px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px 26px;
  margin: 24px 0;
}
.card p:last-child { margin-bottom: 0; }

/* Support FAQ */
details.faq {
  border-top: 1px solid var(--line);
  padding: 4px 0;
}
details.faq:last-of-type { border-bottom: 1px solid var(--line); }
details.faq summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
  color: var(--ink);
  font-weight: 600;
  font-size: 17px;
  min-height: 44px;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after {
  content: "";
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--ink3);
  border-bottom: 2px solid var(--ink3);
  transform: rotate(45deg);
  margin-right: 6px;
  flex: none;
}
details.faq[open] summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
details.faq > div { padding: 0 0 20px; color: var(--ink2); max-width: 62ch; }
details.faq > div p { margin: 0 0 10px; }
details.faq > div p:last-child { margin-bottom: 0; }

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .ring-arc { animation: none; }
  .orb { animation: none; transform: scale(0.9); }
  .orb-phase { display: none; }
  .orb-static { display: block; }
}
