/* Gloune — darkroom safelight design system (docs/mvp-spec.md §4).
   The site commits to the light look everywhere — the cream ground is the
   brand, skin tones read best on it, and every visitor sees the same page.
   (The app keeps its own System/Light/Dark preference.) */
:root {
  color-scheme: only light;
  --ground: #F1ECE2;
  --surface: #FBF7EF;
  --surface-2: #E7E0D2;
  --ink: #221C13;
  --ink-2: #5B5244;
  --muted: #6F6757; /* AA at small mono sizes on the cream ground */
  --line: #DBD2C1;
  --line-soft: #E6DECE;
  --accent: #9C5F14;
  --accent-ink: #FBF7EF;
  --accent-soft: #F0DFC1;
  --good: #4E6B48;
  --alert: #9B3B2E;
}

* { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--ground);
  color: var(--ink);
  font-family: Archivo, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}
.mono {
  font-family: "IBM Plex Mono", Menlo, monospace;
  font-size: 12px;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
}
.wrap { max-width: 880px; margin: 0 auto; padding: 0 24px; }

/* nav */
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0;
}
.nav-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.nav-brand .name { font-family: Newsreader, Georgia, serif; font-style: italic; font-weight: 500; font-size: 22px; }
.nav-links { display: flex; align-items: center; gap: 22px; }
.nav-links a { color: var(--ink-2); text-decoration: none; font-size: 14px; white-space: nowrap; }
.nav-links a:hover { color: var(--accent); }
.lang-toggle {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  letter-spacing: .06em;
  color: var(--ink-2);
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
}
.lang-toggle:hover { color: var(--accent); border-color: var(--accent); }
/* small screens: brand + language + CTA carry the nav; anchor links retire */
@media (max-width: 680px) {
  nav { padding: 16px 0; gap: 10px; }
  .nav-links { gap: 10px; }
  .nav-plain { display: none; }
  .nav-cta { padding: 8px 14px; font-size: 13px; }
  .nav-brand .name { font-size: 20px; }
}

/* hero */
.hero {
  position: relative;
  text-align: center;
  padding: 84px 0 72px;
  overflow: hidden;
}
.hero .glow {
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  width: 560px;
  height: 560px;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--accent-soft), transparent 70%);
  opacity: .8;
  pointer-events: none;
}
.hero > * { position: relative; }
.hero .mark { width: 96px; height: 96px; margin: 0 auto 8px; animation: wax 2.2s ease-out both; }
@keyframes wax { from { clip-path: inset(0 0 0 55%); } to { clip-path: inset(0); } }
@media (prefers-reduced-motion: reduce) { .hero .mark { animation: none; } }
h1 {
  font-family: Newsreader, Georgia, serif;
  font-weight: 500;
  font-style: italic;
  font-size: clamp(44px, 8vw, 72px);
  line-height: 1.05;
}
.hero .tagline { margin-top: 14px; }
.hero .sub {
  max-width: 46ch;
  margin: 22px auto 0;
  color: var(--ink-2);
  font-size: 18px;
  text-wrap: balance;
}
.hero .cta { margin-top: 34px; display: inline-flex; align-items: center; gap: 14px; }
.waitlist {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.waitlist input[type="email"] {
  font: 400 16px Archivo, sans-serif; /* <16px makes iOS Safari zoom on focus */
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 13px 20px;
  min-width: 240px;
}
.waitlist input::placeholder { color: var(--muted); }
.waitlist input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.waitlist button {
  font: 600 14px Archivo, sans-serif;
  color: var(--accent-ink);
  background: var(--accent);
  border: 0;
  border-radius: 999px;
  padding: 13px 24px;
  cursor: pointer;
}
.waitlist button:hover { opacity: .9; }
.waitlist button:disabled { opacity: .6; cursor: default; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.cta-note { margin-top: 14px; }
.waitlist-done { margin-top: 34px; color: var(--accent); }

/* sections */
section { padding: 64px 0; border-top: 1px solid var(--line-soft); }
h2 {
  font-family: Newsreader, Georgia, serif;
  font-weight: 600;
  font-size: clamp(28px, 4.5vw, 38px);
  line-height: 1.15;
  margin: 6px 0 14px;
  text-wrap: balance;
}
.lede { color: var(--ink-2); max-width: 62ch; }

.principles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 28px; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
}
.card .num { font-family: "IBM Plex Mono", monospace; color: var(--accent); font-size: 12px; }
.card p { margin-top: 8px; font-size: 15px; }

.stages { display: flex; gap: 12px; align-items: center; margin: 30px 0 10px; flex-wrap: wrap; }
.stage {
  position: relative;
  flex: 1 1 120px;
  aspect-ratio: .8;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  display: grid;
  place-items: end center;
  padding: 10px;
  min-width: 110px;
  overflow: hidden;
}
.stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* tighter face crop so the strip reads differently from the hero slider */
  object-position: 50% 22%;
  transform: scale(1.28);
  transform-origin: 50% 26%;
}
.stage.proj { border-style: dashed; }
.stage .mono {
  position: relative;
  color: #EFE7D7;
  background: rgba(12, 10, 7, .55);
  padding: 3px 9px;
  border-radius: 6px;
}
.stages-note { margin-top: 4px; font-size: 11px; }

.loop-steps { margin-top: 24px; display: grid; gap: 0; }
.loop-step {
  display: flex;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line-soft);
  align-items: baseline;
}
.loop-step .mono { flex: none; width: 84px; color: var(--accent); }
.loop-step p { color: var(--ink-2); font-size: 15px; }
.loop-step b { color: var(--ink); font-weight: 600; }

.privacy-list { margin-top: 22px; display: grid; gap: 10px; max-width: 62ch; }
.privacy-list li { list-style: none; padding-left: 26px; position: relative; color: var(--ink-2); }
.privacy-list li::before { content: "—"; position: absolute; left: 0; color: var(--accent); }

footer {
  border-top: 1px solid var(--line-soft);
  padding: 36px 0 48px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  align-items: baseline;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13.5px;
}
footer a { color: var(--ink-2); text-decoration: none; }
footer a:hover { color: var(--accent); }

/* document pages */
.doc { padding: 40px 0 80px; max-width: 720px; }
.doc h1 { font-style: normal; font-size: clamp(32px, 5vw, 44px); margin-bottom: 6px; }
.doc h2 { font-size: 22px; margin-top: 36px; }
.doc p, .doc li { color: var(--ink-2); font-size: 15.5px; margin-top: 10px; }
.doc ul { padding-left: 22px; }
.doc .updated { margin-top: 4px; }
.doc .notice {
  margin-top: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 14px;
  color: var(--ink-2);
}

/* before/after slider (hero) */
.ba {
  --pos: 42%;
  position: relative;
  width: min(400px, calc(100% - 8px));
  aspect-ratio: 4 / 5;
  margin: 34px auto 0;
  border-radius: 16px;
  border: 1px solid var(--line);
  overflow: hidden;
  cursor: ew-resize;
  touch-action: pan-y;
  user-select: none;
}
.ba-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.ba-before { clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.ba-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos);
  width: 2px;
  margin-left: -1px;
  background: #EFE7D7;
  opacity: .95;
}
.ba-grip {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #EFE7D7;
  color: #16130E;
  border-radius: 999px;
  padding: 6px 10px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
}
.ba-chip {
  position: absolute;
  top: 12px;
  padding: 4px 10px;
  border-radius: 7px;
  background: rgba(12, 10, 7, .55);
  color: #EFE7D7 !important;
  font-size: 11px;
}
.ba-chip-l { left: 12px; }
.ba-chip-r { right: 12px; }
.ba-note { margin-top: 12px; font-size: 11px; }

/* gentle waitlist popup */
.popup {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
  width: min(360px, calc(100% - 40px));
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px 22px 22px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .22);
  animation: popup-in .45s cubic-bezier(.2, .9, .3, 1) both;
}
@keyframes popup-in { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .popup { animation: none; } }
.popup[hidden] { display: none; }
.popup-close {
  position: absolute;
  top: 8px;
  right: 12px;
  background: none;
  border: 0;
  color: var(--ink-2);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
}
.popup-kicker { font-size: 11px; }
.popup-title {
  font-family: Newsreader, Georgia, serif;
  font-size: 21px;
  font-weight: 500;
  margin: 8px 0 14px;
}
.popup .cta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 0; }
.popup input[type="email"] { flex: 1; min-width: 0; }
.popup .waitlist input[type="email"] { width: auto; }

/* hero: two columns on desktop, stacked on mobile */
.hero-grid { display: grid; gap: 44px; align-items: center; }
@media (min-width: 920px) {
  .hero { text-align: left; padding: 96px 0 84px; }
  .hero-grid { grid-template-columns: 1.08fr .92fr; gap: 64px; }
  .hero .glow { left: 26%; }
  .hero .mark { margin: 0 0 10px; }
  .hero .sub { margin-left: 0; }
  .hero-copy .waitlist { justify-content: flex-start; }
  .hero-visual .ba { margin: 0 0 0 auto; }
  .hero-visual .ba-note { text-align: center; }
}

/* nav CTA */
.nav-cta {
  color: var(--accent-ink) !important;
  background: var(--accent);
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 600;
}
.nav-cta:hover { color: var(--accent-ink) !important; opacity: .9; }

/* wider hero on desktop; bigger slider */
@media (min-width: 920px) {
  .hero-grid { max-width: 1120px; }
  .hero-visual .ba { width: min(460px, 100%); }
}
.hero .mark { width: 64px; height: 64px; }
.ba:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* app phones */
.phones {
  margin-top: 32px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 22px;
}
.phone { margin: 0; text-align: center; }
.phone img {
  width: 100%;
  height: auto;
  border-radius: 26px;
  border: 1px solid var(--line);
  box-shadow: 0 14px 36px rgba(34, 28, 19, .1);
  display: block;
}
.phone figcaption { margin-top: 12px; }

/* faq */
.faq-list { margin-top: 20px; max-width: 640px; }
.faq-list details { border-bottom: 1px solid var(--line-soft); padding: 4px 0; }
.faq-list summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 16px;
  padding: 14px 0;
  list-style: none;
  position: relative;
  padding-right: 30px;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: "+";
  position: absolute;
  right: 4px;
  color: var(--accent);
  font-weight: 400;
  font-size: 20px;
}
.faq-list details[open] summary::after { content: "–"; }
.faq-list details p { color: var(--ink-2); font-size: 15px; padding: 0 0 16px; max-width: 58ch; }

/* closing cta */
.join { text-align: center; }
.join .waitlist { justify-content: center; margin-top: 26px; }
.join-note { margin-top: 14px; }
