/* SpecFit - "the midnight optician."
   Pure black-and-white, matching the app's rebrand: white type and hairlines
   on true black, charcoal cards, and one red reserved for calls to action.
   Annotated everywhere with the PD measurement line: end ticks, hairline
   rules, small mm labels. Montserrat carries the big display voice;
   Instrument Sans does the reading. */

:root {
  --ink: #000000;
  --panel: #0f0f0f;
  --card: #161616;
  --line: #262626;
  --text: #f5f5f5;
  --muted: #a3a3a3;
  --faint: #6f6f6f;
  --cta: #e8271b;
  --cta-hover: #ff3b30;
  --grad: linear-gradient(92deg, #ffffff, #c8c8c8);
  --display: "Montserrat", "Helvetica Neue", Arial, sans-serif;
  --sans: "Instrument Sans", -apple-system, "Helvetica Neue", sans-serif;
  --measure: 68rem;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

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

html { scroll-behavior: smooth; }

body {
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Grain + vignette atmosphere */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background:
    radial-gradient(90rem 50rem at 85% -10%, rgba(255, 255, 255, 0.05), transparent 60%),
    radial-gradient(70rem 40rem at 0% 110%, rgba(255, 255, 255, 0.03), transparent 60%);
}

main, header.site, footer.site { position: relative; z-index: 3; }

a { color: inherit; }

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 2.5rem);
}

/* ---- The measurement-line motif ---------------------------------- */

.measure-line {
  position: relative;
  height: 1px;
  background: var(--line);
}
.measure-line::before, .measure-line::after {
  content: "";
  position: absolute;
  top: -5px;
  width: 1px;
  height: 11px;
  background: inherit;
}
.measure-line::before { left: 0; }
.measure-line::after { right: 0; }
.measure-line.grad {
  background: var(--grad);
}
.measure-line.grad::before { background: #ffffff; }
.measure-line.grad::after { background: #c8c8c8; }

.measure-label {
  font-size: 0.6875rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 500;
}

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

header.site {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--ink) 78%, transparent);
  border-bottom: 1px solid var(--line);
}
header.site .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4.25rem;
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.35rem;
  letter-spacing: 0.01em;
}
.logo img { width: 30px; height: 30px; border-radius: 8px; }
nav.primary { display: flex; gap: 1.8rem; align-items: center; }
nav.primary a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.95rem;
  transition: color 0.2s;
}
nav.primary a:hover { color: var(--text); }
nav.primary a.cta {
  color: #ffffff;
  background: var(--cta);
  border: 1px solid var(--cta);
  padding: 0.45rem 1rem;
  border-radius: 999px;
  transition: border-color 0.2s, background 0.2s;
}
nav.primary a.cta:hover { background: var(--cta-hover); border-color: var(--cta-hover); color: #ffffff; }

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

.hero { padding: clamp(4rem, 9vw, 7.5rem) 0 clamp(3rem, 6vw, 5rem); }
.hero .wrap {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.75rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.6rem;
}
.kicker::before {
  content: "";
  width: 2.2rem;
  height: 1px;
  background: var(--grad);
}
h1 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(2.5rem, 5.4vw, 4.1rem);
  line-height: 1.06;
  letter-spacing: -0.015em;
}
h1 em {
  font-style: italic;
  background: linear-gradient(92deg, var(--cta), var(--cta-hover));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p.lede {
  margin: 1.5rem 0 2.2rem;
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  color: var(--muted);
  max-width: 34rem;
}
/* Buttons */
.btn-row { display: flex; gap: 0.9rem; flex-wrap: wrap; align-items: center; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.98rem;
  border-radius: 999px;
  padding: 0.85rem 1.5rem;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.2s;
}
.btn.primary {
  background: var(--cta);
  color: #ffffff;
  box-shadow: 0 8px 30px rgba(232, 39, 27, 0.28);
}
.btn.primary:hover { background: var(--cta-hover); transform: translateY(-1px); box-shadow: 0 12px 40px rgba(232, 39, 27, 0.4); }
.btn.ghost {
  border: 1px solid var(--line);
  color: var(--muted);
}
.btn.ghost:hover { border-color: var(--faint); color: var(--text); }
.btn small { font-weight: 500; opacity: 0.85; }

/* Waitlist */
.waitlist-form {
  display: flex;
  gap: 0.5rem;
  padding: 6px;
  max-width: 27rem;
  background: #0d0d0d;
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: border-color 0.2s;
}
.waitlist-form:focus-within, .waitlist-form:hover { border-color: var(--faint); }
.waitlist-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: none;
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  padding: 0.55rem 0.6rem 0.55rem 1.15rem;
}
.waitlist-input::placeholder { color: var(--faint); }
.waitlist-btn {
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  color: #ffffff;
  background: var(--cta);
  border-radius: 999px;
  padding: 0.7rem 1.4rem;
  transition: background 0.2s;
  box-shadow: 0 6px 24px rgba(232, 39, 27, 0.25);
}
.waitlist-btn:hover { background: var(--cta-hover); }
.waitlist-btn:disabled { opacity: 0.6; cursor: default; }
.waitlist-note { margin-top: 0.85rem; font-size: 0.82rem; color: var(--faint); }
.waitlist-success {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 500;
  max-width: 27rem;
}
.waitlist-success .tick {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  background: var(--cta);
  color: #ffffff;
  font-size: 0.85rem;
}
.waitlist-form[hidden], .waitlist-note[hidden], .waitlist-success[hidden] { display: none; }

/* Phone */
.hero .phone-wrapper {
  position: relative;
  perspective: 1800px;
}
.hero .phone-wrapper::before {
  content: "";
  position: absolute;
  inset: auto 0 -8% 0;
  height: 60%;
  background: radial-gradient(ellipse at 50% 60%, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.05) 40%, transparent 70%);
  filter: blur(40px);
  z-index: 0;
  pointer-events: none;
}
.hero .phone {
  z-index: 1;
  transform: rotateY(-10deg) rotateX(2deg);
  animation: float-tilt 6s ease-in-out infinite;
}
@keyframes float-tilt {
  0%, 100% { transform: rotateY(-10deg) rotateX(2deg) translateY(0); }
  50% { transform: rotateY(-10deg) rotateX(2deg) translateY(-12px); }
}
@media (prefers-reduced-motion: reduce) {
  .hero .phone { animation: none; }
}

.phone {
  position: relative;
  width: min(310px, 78vw);
  margin: 0 auto;
  border-radius: 44px;
  border: 1px solid #333333;
  background: #050505;
  padding: 10px;
  box-shadow:
    0 40px 90px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.03) inset;
}
.phone img { width: 100%; height: auto; display: block; border-radius: 30px; }

/* ---- Sections ------------------------------------------------------ */

section { padding: clamp(3.2rem, 7vw, 5.5rem) 0; }
.section-head { max-width: 42rem; margin-bottom: clamp(2rem, 4vw, 3rem); }
h2 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
}
.section-head p { color: var(--muted); margin-top: 0.9rem; }

.divider .wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.divider .measure-line { flex: 1; }

/* Steps */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.1rem;
  counter-reset: step;
}
.step {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1.7rem 1.5rem 1.6rem;
  position: relative;
}
.step::before {
  counter-increment: step;
  content: "0" counter(step);
  font-family: var(--display);
  font-style: italic;
  font-size: 2.2rem;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: block;
  margin-bottom: 0.8rem;
}
.step h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.45rem; }
.step p { color: var(--muted); font-size: 0.95rem; }

/* Feature grid */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.1rem;
}
.feature {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1.6rem 1.5rem;
  transition: border-color 0.25s ease, transform 0.25s ease;
}
.feature:hover { border-color: #3d3d3d; transform: translateY(-2px); }
.feature .glyph {
  font-size: 1.3rem;
  display: inline-block;
  margin-bottom: 0.9rem;
}
.feature h3 { font-size: 1.05rem; font-weight: 600; margin-bottom: 0.4rem; }
.feature p { color: var(--muted); font-size: 0.93rem; }

/* Styles gallery */
.style-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
.style-card {
  background: #0d0d0d;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  transition: border-color 0.25s ease, transform 0.25s ease;
}
.style-card:hover { border-color: #3d3d3d; transform: translateY(-2px); }
.style-card img {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}
.style-card figcaption {
  padding: 0.7rem 1rem 0.85rem;
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 500;
}

/* In-app screens strip */
.screens-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.2rem, 3vw, 2.4rem);
  align-items: start;
}
.screens-grid .screen { margin: 0; }
.screens-grid .phone {
  width: min(250px, 70vw);
  border-radius: 34px;
  padding: 8px;
}
.screens-grid .phone img { border-radius: 26px; }
.screens-grid figcaption {
  margin-top: 1.1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  max-width: 17rem;
  margin-left: auto;
  margin-right: auto;
}

/* PD section */
.pd-split .wrap {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
ul.checks { list-style: none; margin-top: 1.4rem; display: grid; gap: 0.75rem; }
ul.checks li {
  padding-left: 1.7rem;
  position: relative;
  color: var(--muted);
}
ul.checks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 0.95rem;
  height: 1px;
  background: var(--grad);
}
ul.checks li strong { color: var(--text); font-weight: 600; }

/* Privacy band */
.privacy-band {
  background: var(--panel);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.privacy-band .wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
.privacy-band .big {
  font-family: var(--display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 500;
  line-height: 1.2;
}
.privacy-band p { color: var(--muted); margin-top: 1rem; font-size: 0.97rem; }

/* Pricing */
.pricing-card {
  max-width: 30rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 2rem 2rem 1.8rem;
  position: relative;
  overflow: hidden;
}
.pricing-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(92deg, var(--cta), var(--cta-hover));
}
.pricing-card .price {
  font-family: var(--display);
  font-size: 2rem;
  font-weight: 600;
}
.pricing-card .price .tier { white-space: nowrap; }
.pricing-card .price .unit { font-size: 1rem; color: var(--muted); font-family: var(--sans); font-weight: 500; }
.pricing-card p.fine { color: var(--faint); font-size: 0.82rem; margin-top: 1.1rem; }

/* FAQ */
.faq { max-width: 46rem; }
details {
  border-bottom: 1px solid var(--line);
  padding: 1.1rem 0;
}
details summary {
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  font-size: 1.02rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
details summary::-webkit-details-marker { display: none; }
details summary::after {
  content: "+";
  font-family: var(--display);
  font-size: 1.3rem;
  color: var(--faint);
  transition: transform 0.25s;
}
details[open] summary::after { transform: rotate(45deg); color: var(--cta-hover); }
details p { color: var(--muted); padding-top: 0.7rem; font-size: 0.96rem; max-width: 40rem; }

/* Footer */
footer.site {
  border-top: 1px solid var(--line);
  padding: 2.6rem 0 3rem;
  margin-top: 2rem;
}
footer.site .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem 2.4rem;
  align-items: center;
  justify-content: space-between;
  color: var(--faint);
  font-size: 0.9rem;
}
footer.site nav { display: flex; gap: 1.6rem; flex-wrap: wrap; }
footer.site a { color: var(--muted); text-decoration: none; }
footer.site a:hover { color: var(--text); }

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

.legal {
  max-width: 46rem;
  padding: clamp(3rem, 7vw, 5rem) 0 4rem;
}
.legal h1 { font-size: clamp(2rem, 4vw, 2.8rem); }
.legal .updated {
  color: var(--faint);
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 1rem 0 0.4rem;
}
.legal h2 {
  font-size: 1.35rem;
  margin: 2.6rem 0 0.8rem;
}
.legal p, .legal li { color: var(--muted); }
.legal strong { color: var(--text); font-weight: 600; }
.legal ul { margin: 0.7rem 0 0.7rem 1.2rem; display: grid; gap: 0.5rem; }
.legal a { color: var(--text); text-decoration-color: var(--cta-hover); }
.legal .measure-line { margin: 2rem 0; }

/* ---- Reveal on scroll ----------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: 0.08s; }
.reveal.d2 { transition-delay: 0.16s; }
.reveal.d3 { transition-delay: 0.24s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---- Responsive ------------------------------------------------------ */

@media (max-width: 880px) {
  .hero .wrap, .pd-split .wrap, .privacy-band .wrap { grid-template-columns: 1fr; }
  .pd-split .wrap > :first-child { order: 2; }
  .steps, .features { grid-template-columns: 1fr; }
  .style-grid { grid-template-columns: repeat(2, 1fr); }
  .screens-grid { grid-template-columns: 1fr; gap: 2.4rem; }
  .phone { margin-top: 1rem; }
  nav.primary a:not(.cta) { display: none; }
}
