/* ==========================================================================
   Clutch — clutch.conatus.space
   Palette lifted from the app's "Dune" theme (PORDL/Design/Theme.swift)
   ========================================================================== */

:root {
  color-scheme: light dark;

  /* Dune — light */
  --bg:          #EFEAE0;
  --surface:     #F7F3EC;
  --surface-alt: #E8E2D3;
  --ink:         #2B2A26;
  --ink-muted:   #6B655A;
  --ink-soft:    #9A9280;
  --accent:      #C2823A;
  --accent-soft: #E8B86D;
  --accent-ink:  #1F1B14;
  --sage:        #7A8A6E;
  --danger:      #A8453A;
  --hairline:    rgba(43, 42, 38, 0.10);
  --hairline-strong: rgba(43, 42, 38, 0.18);
  --shadow:      0 4px 14px rgba(60, 45, 20, 0.06);
  --shadow-lg:   0 18px 48px rgba(60, 45, 20, 0.11);
  --grain-ink:   rgba(43, 42, 38, 0.035);

  --maxw: 1080px;
  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 28px;

  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua",
                  Georgia, ui-serif, serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto,
               "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:          #1A1813;
    --surface:     #23201A;
    --surface-alt: #2C281F;
    --ink:         #F4EFE3;
    --ink-muted:   #A8A092;
    --ink-soft:    #6B6557;
    --accent:      #E8B86D;
    --accent-soft: #C2823A;
    --accent-ink:  #1A1813;
    --sage:        #A4B398;
    --danger:      #D97766;
    --hairline:    rgba(244, 239, 227, 0.10);
    --hairline-strong: rgba(244, 239, 227, 0.20);
    --shadow:      0 4px 14px rgba(0, 0, 0, 0.28);
    --shadow-lg:   0 18px 48px rgba(0, 0, 0, 0.42);
    --grain-ink:   rgba(244, 239, 227, 0.03);
  }
}

/* Explicit toggle wins over the media query in both directions. */
:root[data-theme="light"] {
  --bg: #EFEAE0; --surface: #F7F3EC; --surface-alt: #E8E2D3;
  --ink: #2B2A26; --ink-muted: #6B655A; --ink-soft: #9A9280;
  --accent: #C2823A; --accent-soft: #E8B86D; --accent-ink: #1F1B14;
  --sage: #7A8A6E; --danger: #A8453A;
  --hairline: rgba(43, 42, 38, 0.10);
  --hairline-strong: rgba(43, 42, 38, 0.18);
  --shadow: 0 4px 14px rgba(60, 45, 20, 0.06);
  --shadow-lg: 0 18px 48px rgba(60, 45, 20, 0.11);
  --grain-ink: rgba(43, 42, 38, 0.035);
}
:root[data-theme="dark"] {
  --bg: #1A1813; --surface: #23201A; --surface-alt: #2C281F;
  --ink: #F4EFE3; --ink-muted: #A8A092; --ink-soft: #6B6557;
  --accent: #E8B86D; --accent-soft: #C2823A; --accent-ink: #1A1813;
  --sage: #A4B398; --danger: #D97766;
  --hairline: rgba(244, 239, 227, 0.10);
  --hairline-strong: rgba(244, 239, 227, 0.20);
  --shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.42);
  --grain-ink: rgba(244, 239, 227, 0.03);
}

/* --------------------------------------------------------------- base --- */

*, *::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: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

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

/* Paper grain — the app's surfaces aren't flat, and neither is this. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.55;
  background-image:
    radial-gradient(var(--grain-ink) 1px, transparent 1px),
    radial-gradient(var(--grain-ink) 1px, transparent 1px);
  background-size: 3px 3px, 7px 7px;
  background-position: 0 0, 2px 3px;
}

main, header, footer { position: relative; z-index: 1; }

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

a { color: inherit; text-decoration-color: var(--hairline-strong); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--accent); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.14;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; text-wrap: pretty; }

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

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

.eyebrow {
  font-family: var(--font-body);
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 14px;
}

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: var(--accent-ink);
  padding: 10px 18px; border-radius: 0 0 10px 0; z-index: 99; font-weight: 600;
}
.skip:focus { left: 0; }

/* ------------------------------------------------------------- header --- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.site-header[data-stuck="true"] { border-bottom-color: var(--hairline); }

.nav {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 66px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  margin-right: auto;
}
.brand img { width: 30px; height: 30px; border-radius: 8px; box-shadow: var(--shadow); }

.nav-links { display: flex; gap: 26px; align-items: center; }
.nav-links a {
  font-size: 14.5px;
  color: var(--ink-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}
.nav-links a:hover { color: var(--ink); }

@media (max-width: 720px) { .nav-links { display: none; } }

.theme-toggle {
  appearance: none;
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--ink-muted);
  width: 34px; height: 34px;
  border-radius: 999px;
  cursor: pointer;
  display: grid; place-items: center;
  font-size: 15px; line-height: 1;
  transition: color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--hairline-strong); transform: rotate(-12deg); }

/* ------------------------------------------------------------ buttons --- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 24px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.005em;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.16s cubic-bezier(0.2, 0.8, 0.3, 1),
              box-shadow 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}
.btn:active { transform: translateY(1px) scale(0.99); }

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: var(--shadow);
}
.btn-primary:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--hairline-strong);
}
.btn-ghost:hover { background: var(--surface); border-color: var(--accent); }

.btn-sm { padding: 9px 17px; font-size: 14px; }

/* --------------------------------------------------------------- hero --- */

.hero {
  position: relative;
  padding: clamp(56px, 9vw, 104px) 0 clamp(48px, 7vw, 84px);
  overflow: hidden;
}

/* Soft sun-glow behind the hero — the "Lumi" of the whole thing. */
.hero::after {
  content: "";
  position: absolute;
  top: -30%;
  right: -10%;
  width: min(760px, 90vw);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle,
    color-mix(in srgb, var(--accent) 22%, transparent) 0%,
    transparent 66%);
  pointer-events: none;
  z-index: -1;
  filter: blur(8px);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
}

.hero h1 {
  font-size: clamp(42px, 7.4vw, 74px);
  letter-spacing: -0.028em;
  margin-bottom: 20px;
}
.hero h1 em {
  font-style: normal;
  color: var(--accent);
}

.hero-sub {
  font-size: clamp(17px, 2.1vw, 20px);
  color: var(--ink-muted);
  max-width: 34ch;
  margin-bottom: 30px;
}

.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

.hero-note {
  margin-top: 18px;
  font-size: 13.5px;
  color: var(--ink-soft);
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--sage);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--sage) 20%, transparent);
  flex: none;
  margin-top: 8px;
}

/* ------------------------------------------------------------- device --- */

.device-stage {
  position: relative;
  display: grid;
  place-items: center;
  padding: 10px;
}

.phone {
  position: relative;
  width: min(286px, 74vw);
  aspect-ratio: 9 / 19.5;
  border-radius: 44px;
  background: var(--surface);
  border: 1px solid var(--hairline-strong);
  box-shadow: var(--shadow-lg);
  padding: 11px;
  animation: float 7s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50%      { transform: translateY(-12px) rotate(-1deg); }
}

.phone::before {
  content: "";
  position: absolute;
  top: 13px; left: 50%; transform: translateX(-50%);
  width: 86px; height: 22px;
  /* A notch is black in both themes — don't let --ink invert it. */
  background: #16140F;
  border-radius: 999px;
  z-index: 3;
}

.screen {
  position: relative;
  height: 100%;
  border-radius: 34px;
  background: var(--bg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 44px 15px 15px;
  gap: 9px;
}

.screen-head {
  display: flex; align-items: center; gap: 9px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--hairline);
}
.screen-head img {
  width: 26px; height: 26px;
  /* The mascot art is near-white; on light paper it needs a disc to sit on. */
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  border-radius: 50%;
  padding: 2px;
  object-fit: contain;
}
.screen-head strong { font-size: 13px; font-family: var(--font-display); }
.screen-head span { font-size: 10.5px; color: var(--sage); display: block; line-height: 1.2; }

.bubbles { display: flex; flex-direction: column; gap: 8px; margin-top: 2px; }

.bubble {
  font-size: 12.2px;
  line-height: 1.42;
  padding: 9px 12px;
  border-radius: 15px;
  max-width: 88%;
  opacity: 0;
  animation: rise 0.5s cubic-bezier(0.2, 0.8, 0.3, 1) forwards;
}
.bubble.lumi {
  background: var(--surface-alt);
  border-bottom-left-radius: 5px;
  align-self: flex-start;
}
.bubble.me {
  background: var(--accent);
  color: var(--accent-ink);
  border-bottom-right-radius: 5px;
  align-self: flex-end;
}
.bubble:nth-child(1) { animation-delay: 0.45s; }
.bubble:nth-child(2) { animation-delay: 1.15s; }
.bubble:nth-child(3) { animation-delay: 1.85s; }
.bubble:nth-child(4) { animation-delay: 2.55s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(9px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}

.screen-gate {
  margin-top: auto;
  border: 1px dashed var(--hairline-strong);
  border-radius: 13px;
  padding: 10px 11px;
  background: color-mix(in srgb, var(--sage) 10%, transparent);
  opacity: 0;
  animation: rise 0.5s cubic-bezier(0.2, 0.8, 0.3, 1) 3.2s forwards;
}
.screen-gate b { font-size: 11.5px; display: block; }
.screen-gate span { font-size: 10.5px; color: var(--ink-muted); }

/* ------------------------------------------------------------ section --- */

.section { padding: clamp(56px, 8vw, 96px) 0; }
.section + .section { padding-top: 0; }

.section-head { max-width: 46ch; margin-bottom: clamp(32px, 4.5vw, 52px); }
.section-head h2 {
  font-size: clamp(29px, 4.2vw, 42px);
  margin-bottom: 14px;
}
.section-head p { color: var(--ink-muted); font-size: 17px; }

.rule { height: 1px; background: var(--hairline); border: 0; margin: 0; }

/* --------------------------------------------------------------- loop --- */

.loop {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  overflow: hidden;
}
@media (max-width: 860px) { .loop { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .loop { grid-template-columns: 1fr; } }

.loop-step {
  background: var(--surface);
  padding: 26px 22px 28px;
}
.loop-step .n {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.1em;
  display: block;
  margin-bottom: 12px;
}
.loop-step h3 { font-size: 18px; margin-bottom: 8px; }
.loop-step p { font-size: 14.5px; color: var(--ink-muted); line-height: 1.55; }

/* ------------------------------------------------------------ feature --- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(272px, 1fr));
  gap: 18px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 26px 24px 28px;
  box-shadow: var(--shadow);
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.3, 1),
              box-shadow 0.2s ease, border-color 0.2s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--hairline-strong);
}

.card .icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent);
  margin-bottom: 16px;
}
.card .icon svg { width: 20px; height: 20px; }

.card h3 { font-size: 19px; margin-bottom: 9px; }
.card p { font-size: 15px; color: var(--ink-muted); line-height: 1.58; }

.card.wide { grid-column: span 2; }
@media (max-width: 660px) { .card.wide { grid-column: span 1; } }

.tag {
  display: inline-block;
  margin-top: 14px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--sage) 18%, transparent);
  color: color-mix(in srgb, var(--sage) 80%, var(--ink));
}
.tag.pro { background: color-mix(in srgb, var(--accent) 20%, transparent); color: var(--accent); }
.tag.soon { background: var(--surface-alt); color: var(--ink-soft); }

/* ------------------------------------------------------------- honest --- */

.honest {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 30px 30px 32px;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 26px;
  align-items: center;
}
@media (max-width: 620px) {
  .honest { grid-template-columns: 1fr; gap: 18px; text-align: left; padding: 26px 22px; }
  .honest img { width: 76px; }
}
.honest img { width: 96px; justify-self: center; }
.honest h2 { font-size: clamp(24px, 3.4vw, 30px); margin-bottom: 12px; }
.honest p { color: var(--ink-muted); font-size: 15.5px; }
.honest p + p { margin-top: 10px; }

/* -------------------------------------------------------------- price --- */

.plans {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}
@media (max-width: 700px) { .plans { grid-template-columns: 1fr; } }

.plan {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: 30px 28px 32px;
  display: flex;
  flex-direction: column;
}
.plan.featured {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: var(--shadow-lg);
  position: relative;
}
.plan.featured::after {
  content: "Pro";
  position: absolute;
  top: 22px; right: 24px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent);
}

.plan h3 { font-size: 21px; margin-bottom: 6px; }
.plan .price {
  font-family: var(--font-display);
  font-size: 40px;
  letter-spacing: -0.03em;
  margin: 14px 0 4px;
}
.plan .price small { font-size: 15px; color: var(--ink-soft); font-family: var(--font-body); letter-spacing: 0; }
.plan .lede { color: var(--ink-muted); font-size: 15px; }

.plan ul { list-style: none; margin: 22px 0 26px; padding: 0; display: grid; gap: 11px; }
.plan li {
  font-size: 15px;
  color: var(--ink-muted);
  padding-left: 26px;
  position: relative;
  line-height: 1.5;
}
.plan li::before {
  content: "";
  position: absolute;
  left: 2px; top: 8px;
  width: 12px; height: 7px;
  border-left: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
  border-radius: 1px;
}
.plan .btn { margin-top: auto; width: 100%; }

/* ---------------------------------------------------------------- faq --- */

.faq { display: grid; gap: 0; border-top: 1px solid var(--hairline); }

details {
  border-bottom: 1px solid var(--hairline);
}
details summary {
  cursor: pointer;
  list-style: none;
  padding: 20px 40px 20px 0;
  font-family: var(--font-display);
  font-size: 18.5px;
  font-weight: 600;
  position: relative;
  transition: color 0.15s ease;
}
details summary::-webkit-details-marker { display: none; }
details summary:hover { color: var(--accent); }
details summary::after {
  content: "";
  position: absolute;
  right: 6px; top: 50%;
  width: 9px; height: 9px;
  border-right: 2px solid var(--ink-soft);
  border-bottom: 2px solid var(--ink-soft);
  transform: translateY(-70%) rotate(45deg);
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.3, 1);
}
details[open] summary::after { transform: translateY(-25%) rotate(-135deg); }
details .answer {
  padding: 0 0 22px;
  color: var(--ink-muted);
  font-size: 15.5px;
  max-width: 66ch;
}
details .answer p + p { margin-top: 10px; }

/* ----------------------------------------------------------------- cta --- */

.final {
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: clamp(44px, 6vw, 68px) 28px;
  position: relative;
  overflow: hidden;
}
.final::before {
  content: "";
  position: absolute;
  bottom: -55%; left: 50%; transform: translateX(-50%);
  width: 640px; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle,
    color-mix(in srgb, var(--accent) 20%, transparent) 0%, transparent 65%);
  pointer-events: none;
}
.final > * { position: relative; }
.final img { width: 86px; margin: 0 auto 20px; }
.final h2 { font-size: clamp(28px, 4.4vw, 42px); margin-bottom: 14px; }
.final p { color: var(--ink-muted); max-width: 44ch; margin: 0 auto 28px; }
.final .hero-cta { justify-content: center; }

/* -------------------------------------------------------------- footer --- */

.site-footer {
  margin-top: clamp(56px, 8vw, 96px);
  border-top: 1px solid var(--hairline);
  padding: 40px 0 52px;
  font-size: 14px;
  color: var(--ink-soft);
}
.footer-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 34px;
  align-items: center;
}
.footer-grid nav { display: flex; flex-wrap: wrap; gap: 20px; margin-left: auto; }
.footer-grid a { text-decoration: none; color: var(--ink-muted); }
.footer-grid a:hover { color: var(--accent); }
.footer-brand { display: flex; align-items: center; gap: 10px; color: var(--ink-muted); }
.footer-brand img { width: 24px; height: 24px; border-radius: 7px; }
.legal { margin-top: 22px; font-size: 13px; line-height: 1.6; max-width: 70ch; }

/* --------------------------------------------------------------- prose --- */

.prose { max-width: 70ch; padding: clamp(40px, 6vw, 72px) 0 0; }
.prose h1 { font-size: clamp(32px, 5vw, 46px); margin-bottom: 10px; }
.prose .updated { color: var(--ink-soft); font-size: 14px; margin-bottom: 34px; }
.prose h2 { font-size: 22px; margin: 38px 0 12px; }
.prose h3 { font-size: 17.5px; margin: 24px 0 8px; }
.prose p, .prose li { color: var(--ink-muted); font-size: 16px; }
.prose p + p { margin-top: 14px; }
.prose ul { padding-left: 22px; margin: 12px 0; display: grid; gap: 8px; }
.prose strong { color: var(--ink); font-weight: 620; }
.prose .callout {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--sage);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  margin: 22px 0;
}
.prose .callout p { color: var(--ink); font-size: 15.5px; }

/* --------------------------------------------------------- reveal-in --- */

[data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.8, 0.3, 1);
}
[data-reveal].in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; }
}
