/* ============================================================
   RelapseLock — marketing site
   Palette and type ported from the app (Shared/Palette.swift,
   RelapseLock/DesignSystem/Theme.swift). Dark only, no light mode.

   Colour rules, same as the app:
     --sage  means "protected". Nothing else.
     --sand  means "needs attention". Nothing else.
     --clay  means danger. Nothing else.
     Nothing decorative is coloured.

   Accessibility note: --tx3 measures 3.0–3.7:1 against our surfaces,
   which is under 4.5:1. It is used for hairlines and dots only,
   never for text. Secondary copy uses --tx2 (7.07:1 on --ink).
   ============================================================ */

:root {
  --ink:   #0D1314;
  --surf:  #161F21;
  --surf2: #1D282A;
  --line:  #293638;
  --tx:    #E9EFED;
  --tx2:   #8FA3A1;
  --tx3:   #5F7371;
  --sage:  #85B8A0;
  --sage-bg: #16302A;
  --sand:  #DDA85F;
  --sand-bg: #33280F;
  --clay:  #CC7060;
  --on-sage: #08130F;

  --r: 10px;
  --r-lg: 16px;
  --pad: 20px;
  --maxw: 1080px;
  --prose: 34rem;

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--tx);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--sage); text-decoration: none; border-bottom: 1px solid rgba(133,184,160,.35); }
a:hover { border-bottom-color: var(--sage); }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--sage);
  outline-offset: 3px;
  border-radius: 3px;
}

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--sage); color: var(--on-sage);
  padding: 10px 16px; border: 0; z-index: 100; font-weight: 500;
}
.skip:focus { left: 8px; top: 8px; }

/* ---------- Layout ---------- */

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad); }
.prose { max-width: var(--prose); }

section { padding: 68px 0; border-top: 1px solid var(--line); }
section:first-of-type { border-top: 0; }

@media (min-width: 760px) { section { padding: 104px 0; } }

/* ---------- Type ---------- */

h1, h2, h3 { margin: 0 0 .5em; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }

h1 { font-size: clamp(2.1rem, 8vw, 3.9rem); letter-spacing: -0.035em; }
h2 { font-size: clamp(1.6rem, 5vw, 2.5rem); letter-spacing: -0.028em; }
h3 { font-size: 1.09rem; font-weight: 600; letter-spacing: -0.01em; }

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

.lede { font-size: clamp(1.02rem, 2.6vw, 1.22rem); color: var(--tx2); line-height: 1.55; }
.sub  { color: var(--tx2); }
.fine { font-size: .86rem; color: var(--tx2); line-height: 1.55; }

.eyebrow {
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--tx2);
  margin: 0 0 18px;
}
.eyebrow.is-protected { color: var(--sage); }

/* The serif is reserved for numerals and pull-quotes — same rule as the app. */
.num {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.6rem, 9vw, 3.6rem);
  line-height: 1;
  letter-spacing: -0.01em;
  display: block;
}

.quote {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1.4rem, 4.4vw, 2rem);
  line-height: 1.35;
  color: var(--tx);
  margin: 32px 0 0;
  padding-left: 20px;
  border-left: 2px solid var(--sage);
}
.quote p { margin: 0; }

/* ---------- Header ---------- */

.site-head {
  position: sticky; top: 0; z-index: 20;
  background: rgba(13,19,20,.88);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-head .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 58px;
}
.brand {
  display: inline-flex; align-items: center; gap: 9px;
  color: var(--tx); font-weight: 600; letter-spacing: -0.02em;
  font-size: 1rem; border: 0;
}
.brand svg { flex: none; }
.site-head nav ul { display: flex; gap: 18px; margin: 0; padding: 0; list-style: none; }
.site-head nav a { color: var(--tx2); font-size: .9rem; border: 0; }
.site-head nav a:hover { color: var(--tx); }
@media (max-width: 519px) { .site-head nav .opt { display: none; } }

/* ---------- Hero ---------- */

.hero {
  padding: 64px 0 60px;
  position: relative;
  overflow: hidden;
  border-top: 0;
}
.hero::before {
  content: "";
  position: absolute; inset: -40% 0 auto -20%;
  width: 140%; height: 130%;
  background: radial-gradient(ellipse 60% 50% at 30% 20%, rgba(133,184,160,.10), transparent 70%);
  pointer-events: none;
}
.hero > .wrap { position: relative; }
.hero h1 { margin-bottom: .35em; text-wrap: balance; }
.hero h1 .accent { color: var(--sage); }
.hero .lede { max-width: 30rem; }


.hero-grid { display: grid; gap: 40px; align-items: center; }
@media (min-width: 900px) {
  .hero { padding: 88px 0 96px; }
  /* The text column gets the room: the headline should land on two lines, not four. */
  .hero-grid { grid-template-columns: minmax(0, 1.35fr) minmax(0, .65fr); gap: 48px; }
  .hero h1 { font-size: 3.25rem; }
}
@media (min-width: 1120px) {
  .hero h1 { font-size: 3.6rem; }
}

.hero-shot { justify-self: center; max-width: 300px; width: 100%; }

.status-line {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .8rem; color: var(--tx2);
  margin-top: 26px;
}
.dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--sage); flex: none;
}

/* ---------- Cards & grids ---------- */

.card {
  background: var(--surf);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 22px;
}
.card h3 { margin-bottom: .4em; }
.card p { color: var(--tx2); font-size: .95rem; margin-bottom: 0; }

.grid { display: grid; gap: 14px; margin-top: 34px; }
@media (min-width: 620px) { .grid.two   { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 860px) { .grid.three { grid-template-columns: repeat(3, 1fr); } }

/* Numbered mechanism steps — the delayed-disable explainer. */
.steps { list-style: none; margin: 36px 0 0; padding: 0; counter-reset: step; max-width: 46rem; }
.steps li {
  counter-increment: step;
  position: relative;
  padding: 0 0 26px 52px;
  border-left: 1px solid var(--line);
  margin-left: 15px;
}
.steps li:last-child { border-left-color: transparent; padding-bottom: 0; }
.steps li::before {
  content: counter(step);
  position: absolute; left: -16px; top: -2px;
  width: 31px; height: 31px;
  display: grid; place-items: center;
  background: var(--surf2);
  border: 1px solid var(--line);
  border-radius: 50%;
  font-family: var(--serif); font-weight: 300; font-size: 1rem;
  color: var(--sage);
}
.steps h3 { margin-bottom: .25em; }
.steps p { color: var(--tx2); margin-bottom: 0; font-size: .96rem; }

/* Screenshot figures */
.shots {
  display: grid;
  gap: 26px;
  margin-top: 44px;
  justify-content: center;
  grid-template-columns: minmax(0, 280px);
}
@media (min-width: 640px) { .shots.two   { grid-template-columns: repeat(2, minmax(0, 260px)); } }
@media (min-width: 900px) { .shots.three { grid-template-columns: repeat(3, minmax(0, 250px)); } }
@media (min-width: 900px) { .shots.four  { grid-template-columns: repeat(4, minmax(0, 220px)); } }
@media (min-width: 640px) and (max-width: 899px) {
  .shots.three, .shots.four { grid-template-columns: repeat(2, minmax(0, 260px)); }
}

figure { margin: 0; }
figure img {
  width: 100%;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--surf);
}
figcaption {
  margin-top: 12px;
  font-size: .86rem;
  color: var(--tx2);
  line-height: 1.5;
}

h2.sub-h2 { font-size: clamp(1.35rem, 4vw, 1.85rem); }
.section-break { margin-top: 64px; }

/* ---------- Callouts ---------- */

.note {
  border-radius: var(--r);
  padding: 18px 20px;
  margin-top: 32px;
  max-width: 46rem;
  font-size: .95rem;
  line-height: 1.55;
}
.note.protected { background: var(--sage-bg); border: 1px solid rgba(133,184,160,.28); color: var(--tx); }
.note.attention { background: var(--sand-bg); border: 1px solid rgba(221,168,95,.28); color: var(--tx); }
.note.plain     { background: var(--surf);   border: 1px solid var(--line);          color: var(--tx2); }
.note strong { color: var(--tx); font-weight: 600; }
.note p { margin-bottom: .7em; }

/* "What this can't do" — deliberately plain, not alarm-coloured. */
.limits { list-style: none; margin: 34px 0 0; padding: 0; max-width: 46rem; }
.limits li {
  padding: 18px 0;
  border-top: 1px solid var(--line);
}
.limits li:last-child { border-bottom: 1px solid var(--line); }
.limits h3 { margin-bottom: .3em; }
.limits p { color: var(--tx2); margin: 0; font-size: .96rem; }

/* Goal modes */
.modes { list-style: none; margin: 34px 0 0; padding: 0; display: grid; gap: 12px; }
@media (min-width: 860px) { .modes { grid-template-columns: repeat(3, 1fr); } }
.modes li {
  background: var(--surf);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 20px;
}
.modes li:first-child { border-color: rgba(133,184,160,.4); background: var(--sage-bg); }
.modes h3 { margin-bottom: .35em; }
.modes p { color: var(--tx2); font-size: .94rem; margin: 0; }

/* Pricing */
.plans { list-style: none; margin: 30px 0 0; padding: 0; display: grid; gap: 10px; max-width: 30rem; }
.plans li {
  display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
  background: var(--surf); border: 1px solid var(--line);
  border-radius: var(--r); padding: 15px 18px;
}
.plans li.best { border-color: rgba(133,184,160,.4); background: var(--sage-bg); }
.plans .plan-name { font-weight: 600; }
.plans .plan-per { display: block; font-size: .82rem; color: var(--tx2); font-weight: 400; }
.plans .plan-price { font-family: var(--serif); font-weight: 300; font-size: 1.4rem; white-space: nowrap; }
.plans-note { margin-top: 14px; max-width: 30rem; }

/* ---------- Contact ---------- */

.contact-mail {
  display: inline-block;
  font-size: clamp(1.05rem, 3.4vw, 1.4rem);
  font-weight: 500;
  word-break: break-word;
}

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

.legal { padding: 44px 0 80px; }
.legal .prose { max-width: 38rem; }
.legal h1 { font-size: clamp(1.9rem, 6vw, 2.7rem); margin-bottom: .3em; }
.legal h2 {
  font-size: 1.22rem; letter-spacing: -0.015em;
  margin-top: 2.4em; padding-top: 1.4em;
  border-top: 1px solid var(--line);
}
.legal h3 { margin-top: 1.8em; font-size: 1rem; }
.legal p, .legal li { color: var(--tx2); }
.legal strong { color: var(--tx); font-weight: 600; }
.legal ul { padding-left: 1.15em; margin: 0 0 1.1em; }
.legal li { margin-bottom: .5em; }
.legal .updated { font-size: .86rem; color: var(--tx2); margin-bottom: 2.4em; }
.legal .toc { margin: 0 0 8px; }

table.terms-tbl { width: 100%; border-collapse: collapse; margin: 0 0 1.2em; font-size: .93rem; }
table.terms-tbl th, table.terms-tbl td {
  text-align: left; padding: 11px 12px;
  border-bottom: 1px solid var(--line); color: var(--tx2);
}
table.terms-tbl th { color: var(--tx); font-weight: 600; }
.tbl-cap { text-align: left; padding-bottom: 10px; }
.tbl-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---------- Footer ---------- */

.site-foot {
  border-top: 1px solid var(--line);
  padding: 40px 0 56px;
  color: var(--tx2);
  font-size: .88rem;
}
.site-foot .foot-grid { display: grid; gap: 24px; }
@media (min-width: 700px) { .site-foot .foot-grid { grid-template-columns: 1.4fr 1fr; align-items: start; } }
.site-foot ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; }
.site-foot a { color: var(--tx2); border-bottom-color: rgba(143,163,161,.3); }
.site-foot a:hover { color: var(--tx); border-bottom-color: var(--tx2); }
.site-foot .brand { margin-bottom: 10px; }
.rating {
  display: inline-block; margin-top: 4px;
  border: 1px solid var(--line); border-radius: 5px;
  padding: 1px 7px; font-size: .78rem; color: var(--tx2);
}
