/* =====================================================================
   SAFELIGHT — anti-GAS darkroom
   Darkroom aesthetic: warm near-black, safelight red, editorial serif,
   monospace EXIF labels, hairline contact-sheet rules, film grain.
   ===================================================================== */

:root {
  /* warm darkroom palette — NOT zinc */
  --ink:        #0E0B0A;   /* warm near-black background */
  --ink-2:      #14100E;   /* card */
  --ink-3:      #1C1714;   /* raised card */
  --paper:      #EDE3D2;   /* warm paper text */
  --paper-dim:  #B7AC9A;   /* muted text */
  --paper-faint:#6F6657;   /* labels / hairlines text */
  --rule:       #332B23;   /* hairline rule */

  --red:        #E8442B;   /* safelight red — the single accent */
  --red-glow:   rgba(232, 68, 43, 0.35);
  --red-dim:    #8C2A1A;
  --green:      #7FB069;   /* used sparingly: "this is fine" verdicts */
  --amber:      #D9A441;

  --shadow: 0 1px 0 rgba(255,255,255,0.03), 0 20px 40px -20px rgba(0,0,0,0.7);

  --ff-serif: "Fraunces", Georgia, serif;
  --ff-mono:  "JetBrains Mono", ui-monospace, monospace;
  --ff-sans:  "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--ff-sans);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

body { position: relative; overflow-x: hidden; }

/* ----- film grain (earned texture) ----- */
.grain {
  position: fixed; inset: 0; z-index: 100; pointer-events: none;
  opacity: 0.06; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grainShift 1.2s steps(4) infinite;
}
@keyframes grainShift {
  0%   { transform: translate(0,0); }
  25%  { transform: translate(-3%, 2%); }
  50%  { transform: translate(2%, -3%); }
  75%  { transform: translate(-2%, -2%); }
  100% { transform: translate(0,0); }
}
.vignette {
  position: fixed; inset: 0; z-index: 99; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,0.55) 100%);
}

/* ----- viewfinder chrome ----- */
.chrome {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 14px) 20px 12px;
  background: linear-gradient(to bottom, var(--ink) 70%, transparent);
}
.chrome__brand { display: flex; align-items: center; gap: 9px; }
.chrome__title {
  font-family: var(--ff-mono); font-weight: 700; font-size: 12px;
  letter-spacing: 0.22em; color: var(--paper);
}
.safelamp {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--red); box-shadow: 0 0 8px 2px var(--red-glow);
  animation: lampPulse 3.5s ease-in-out infinite;
}
@keyframes lampPulse { 0%,100% { opacity: 0.55; } 50% { opacity: 1; } }
.chrome__frame {
  font-family: var(--ff-mono); font-size: 11px; letter-spacing: 0.15em;
  color: var(--paper-faint);
}

/* progress hairline */
.progress {
  position: sticky; top: 52px; z-index: 49;
  height: 1px; background: var(--rule);
}
.progress__bar {
  height: 100%; width: 0%; background: var(--red);
  transition: width 0.4s cubic-bezier(.2,.7,.2,1);
  box-shadow: 0 0 8px var(--red-glow);
}

/* ----- screens ----- */
.screen {
  padding: 28px 20px calc(env(safe-area-inset-bottom) + 120px);
  max-width: 480px; margin: 0 auto;
  min-height: calc(100vh - 100px);
}

.fade-in { animation: fadeIn 0.4s ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ----- shared section header (contact sheet label) ----- */
.label {
  font-family: var(--ff-mono); font-size: 10px; font-weight: 500;
  letter-spacing: 0.2em; color: var(--paper-faint);
  text-transform: uppercase;
  display: flex; align-items: center; gap: 8px;
}
.label::before {
  content: ""; width: 14px; height: 1px; background: var(--red);
}

/* =====================================================================
   HOME
   ===================================================================== */
.home__hero { margin-bottom: 36px; }
.home__eyebrow { margin-bottom: 18px; }
.home__headline {
  font-family: var(--ff-serif); font-weight: 600;
  font-size: clamp(34px, 11vw, 46px); line-height: 1.02;
  letter-spacing: -0.02em; color: var(--paper);
  margin-bottom: 14px;
}
.home__headline em {
  font-style: italic; color: var(--red); font-weight: 600;
}
.home__sub {
  font-size: 15px; color: var(--paper-dim); line-height: 1.55;
  max-width: 34ch;
}

.home__actions { margin: 28px 0 40px; display: flex; flex-direction: column; gap: 10px; }

.btn {
  font-family: var(--ff-sans); font-weight: 600; font-size: 15px;
  border: none; cursor: pointer; width: 100%;
  padding: 16px 20px; border-radius: 2px;
  display: flex; align-items: center; justify-content: space-between;
  transition: transform 0.12s ease, background 0.2s ease, border-color 0.2s;
}
.btn:active { transform: scale(0.985); }
.btn--primary {
  background: var(--red); color: #fff;
  box-shadow: 0 6px 20px -6px var(--red-glow);
}
.btn--primary:hover { background: #f24a30; }
.btn--ghost {
  background: transparent; color: var(--paper);
  border: 1px solid var(--rule);
}
.btn--ghost:hover { border-color: var(--paper-faint); }
.btn__arrow { font-family: var(--ff-mono); font-size: 13px; opacity: 0.8; }

/* feature list */
.home__features { margin-top: 36px; border-top: 1px solid var(--rule); }
.feature {
  padding: 18px 0; border-bottom: 1px solid var(--rule);
  display: grid; grid-template-columns: 28px 1fr; gap: 14px; align-items: start;
}
.feature__num {
  font-family: var(--ff-mono); font-size: 11px; color: var(--red);
  padding-top: 3px;
}
.feature__title {
  font-family: var(--ff-serif); font-size: 18px; font-weight: 600; color: var(--paper);
  margin-bottom: 3px;
}
.feature__desc { font-size: 13.5px; color: var(--paper-dim); line-height: 1.5; }

/* stat line */
.home__stat {
  margin-top: 36px; padding: 18px; border: 1px dashed var(--rule);
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
}
.home__stat-num {
  font-family: var(--ff-serif); font-size: 30px; font-weight: 700; color: var(--red);
  font-feature-settings: "tnum";
}
.home__stat-label { font-family: var(--ff-mono); font-size: 11px; color: var(--paper-faint); letter-spacing: 0.12em; }

/* =====================================================================
   GEAR PICKER
   ===================================================================== */
.picker__head { margin-bottom: 22px; }
.picker__title {
  font-family: var(--ff-serif); font-size: 28px; font-weight: 600;
  color: var(--paper); margin: 10px 0 6px; letter-spacing: -0.01em;
}
.picker__sub { font-size: 14px; color: var(--paper-dim); }

.search {
  margin: 18px 0 6px; display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--rule); padding-bottom: 10px;
}
.search__icon { color: var(--paper-faint); font-family: var(--ff-mono); font-size: 13px; }
.search__input {
  flex: 1; background: none; border: none; color: var(--paper);
  font-family: var(--ff-sans); font-size: 15px; outline: none;
}
.search__input::placeholder { color: var(--paper-faint); }

.gear-list { margin-top: 16px; }
.gear-item {
  display: grid; grid-template-columns: 40px 1fr auto; gap: 14px;
  align-items: center; padding: 16px 0;
  border-bottom: 1px solid var(--rule);
  cursor: pointer; width: 100%; background: none; border-left: none; border-right: none; border-top: none;
  text-align: left; color: inherit;
  transition: padding-left 0.18s ease;
}
.gear-item:active { padding-left: 6px; }
.gear-item__idx {
  font-family: var(--ff-mono); font-size: 11px; color: var(--paper-faint);
}
.gear-item__body { min-width: 0; }
.gear-item__name {
  font-family: var(--ff-serif); font-size: 17px; font-weight: 600; color: var(--paper);
  margin-bottom: 2px;
}
.gear-item__meta {
  font-family: var(--ff-mono); font-size: 11px; color: var(--paper-faint);
  letter-spacing: 0.04em;
}
.gear-item__price {
  font-family: var(--ff-mono); font-size: 13px; color: var(--red); font-weight: 500;
}
.gear-item__cat {
  margin-top: 22px; margin-bottom: 8px;
}

/* =====================================================================
   QUESTION FLOW
   ===================================================================== */
.q { counter-reset: qstep; }
.q__count { margin-bottom: 22px; }
.q__num {
  font-family: var(--ff-mono); font-size: 11px; color: var(--red);
  letter-spacing: 0.15em;
}
.q__title {
  font-family: var(--ff-serif); font-size: 27px; font-weight: 600;
  line-height: 1.12; color: var(--paper); letter-spacing: -0.01em;
  margin: 8px 0 26px;
}
.q__title em { font-style: italic; color: var(--red); }

.options { display: flex; flex-direction: column; gap: 0; border-top: 1px solid var(--rule); }
.option {
  display: grid; grid-template-columns: 30px 1fr auto; gap: 12px;
  align-items: center; padding: 18px 4px;
  border-bottom: 1px solid var(--rule);
  cursor: pointer; width: 100%; background: none; border-left:none; border-right:none;
  color: inherit; text-align: left;
  font-family: var(--ff-sans); font-size: 15.5px; color: var(--paper);
  transition: background 0.15s, padding-left 0.15s;
}
.option:hover { background: rgba(232,68,43,0.04); }
.option:active { padding-left: 8px; }
.option__num {
  font-family: var(--ff-mono); font-size: 11px; color: var(--paper-faint);
}
.option__text { line-height: 1.4; }
.option__hint {
  font-family: var(--ff-mono); font-size: 10px; color: var(--red);
  letter-spacing: 0.1em;
}

.q__nav {
  margin-top: 28px; display: flex; align-items: center; gap: 16px;
}
.backlink {
  font-family: var(--ff-mono); font-size: 12px; color: var(--paper-faint);
  background: none; border: none; cursor: pointer; letter-spacing: 0.08em;
}
.backlink:hover { color: var(--paper); }

/* =====================================================================
   VERDICT
   ===================================================================== */
.verdict { padding-top: 6px; }

/* hero: gear card with X */
.verdict__hero {
  position: relative; margin-bottom: 28px;
  border: 1px solid var(--rule); padding: 26px 20px;
  background:
    linear-gradient(180deg, var(--ink-3), var(--ink-2));
  overflow: hidden;
}
/* corner crop marks */
.verdict__hero::before, .verdict__hero::after {
  content: ""; position: absolute; width: 14px; height: 14px;
  border: 1px solid var(--red);
}
.verdict__hero::before { top: 8px; left: 8px; border-right: none; border-bottom: none; }
.verdict__hero::after  { bottom: 8px; right: 8px; border-left: none; border-top: none; }

.verdict__gearlabel {
  font-family: var(--ff-mono); font-size: 10px; color: var(--paper-faint);
  letter-spacing: 0.2em; margin-bottom: 10px;
}
.verdict__gearname {
  font-family: var(--ff-serif); font-size: 30px; font-weight: 700;
  line-height: 1.05; color: var(--paper); letter-spacing: -0.01em;
  position: relative; z-index: 2;
}
/* the dramatic X */
.verdict__x {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  width: 70%; height: 2px; z-index: 3; pointer-events: none;
}
.verdict__x::before, .verdict__x::after {
  content: ""; position: absolute; top: 50%; left: 0; width: 100%; height: 3px;
  background: var(--red); border-radius: 2px;
  box-shadow: 0 0 14px var(--red-glow);
}
.verdict__x::before { transform: rotate(-12deg); }
.verdict__x::after  { transform: rotate(12deg); }
.verdict__x.draw::before, .verdict__x.draw::after {
  animation: drawX 0.6s cubic-bezier(.2,.8,.2,1) both;
}
.verdict__x.draw::after { animation-delay: 0.18s; }
@keyframes drawX {
  from { width: 0; opacity: 0; }
  to   { width: 100%; opacity: 1; }
}

.verdict__price {
  font-family: var(--ff-mono); font-size: 13px; color: var(--red);
  margin-top: 14px; letter-spacing: 0.04em;
}

.verdict__stamp {
  margin-top: 8px;
  font-family: var(--ff-mono); font-size: 10px; letter-spacing: 0.2em;
  color: var(--paper-faint);
}

/* the verdict headline */
.verdict__headline {
  font-family: var(--ff-serif); font-size: clamp(26px, 8vw, 34px);
  font-weight: 600; line-height: 1.1; color: var(--paper);
  letter-spacing: -0.015em; margin-bottom: 14px;
}
.verdict__headline em { font-style: italic; color: var(--red); }
.verdict__headline .ok { color: var(--green); font-style: italic; }

/* reason block */
.verdict__reason {
  font-size: 15.5px; line-height: 1.6; color: var(--paper-dim);
  margin-bottom: 28px;
}
.verdict__reason strong { color: var(--paper); font-weight: 600; }

/* verdict sections */
.vsection { margin-bottom: 26px; }
.vsection__label { margin-bottom: 10px; }
.vsection__body {
  font-family: var(--ff-serif); font-size: 18px; line-height: 1.45;
  color: var(--paper); font-weight: 400;
}
.vsection__body em { color: var(--red); font-style: italic; }

/* what the money is worth — reframed */
.reframe {
  border-left: 2px solid var(--red); padding: 4px 0 4px 16px;
  margin-bottom: 28px;
}
.reframe__lines { display: flex; flex-direction: column; gap: 6px; }
.reframe__line {
  font-family: var(--ff-serif); font-size: 16.5px; color: var(--paper);
  display: flex; gap: 12px;
}
.reframe__line b { font-family: var(--ff-mono); font-weight: 500; color: var(--red); min-width: 70px; font-size: 14px; padding-top: 2px; }

/* verdict actions */
.verdict__actions {
  margin-top: 32px; display: flex; flex-direction: column; gap: 10px;
}
.verdict__meta {
  margin-top: 20px; text-align: center;
  font-family: var(--ff-mono); font-size: 10px; color: var(--paper-faint);
  letter-spacing: 0.15em;
}

/* saved ticker */
.savedbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
  background: var(--ink-2); border-top: 1px solid var(--rule);
  padding: 12px 20px calc(env(safe-area-inset-bottom) + 12px);
  display: flex; align-items: center; justify-content: space-between;
  max-width: 480px; margin: 0 auto;
}
.savedbar[hidden] { display: none; }
.savedbar__label {
  font-family: var(--ff-mono); font-size: 10px; color: var(--paper-faint);
  letter-spacing: 0.15em;
}
.savedbar__amount {
  font-family: var(--ff-mono); font-size: 18px; font-weight: 700; color: var(--red);
}

/* =====================================================================
   ABOUT / misc
   ===================================================================== */
.about__title {
  font-family: var(--ff-serif); font-size: 30px; font-weight: 600;
  margin: 12px 0 18px; letter-spacing: -0.01em;
}
.about__p { font-size: 15px; line-height: 1.6; color: var(--paper-dim); margin-bottom: 14px; }
.about__p strong { color: var(--paper); }
.about__sig {
  margin-top: 28px; font-family: var(--ff-mono); font-size: 11px;
  color: var(--paper-faint); letter-spacing: 0.1em;
}

/* utility */
.muted { color: var(--paper-dim); }
.center { text-align: center; }
.mt-s { margin-top: 10px; } .mt-m { margin-top: 20px; } .mt-l { margin-top: 32px; }
.mb-s { margin-bottom: 10px; } .mb-m { margin-bottom: 20px; }
