/* ============================================================
   Latch — styles
   paper #FAFAF8 · ink #14120F · night #101820 · signal #FF4D00
   Display: Archivo (wide, heavy) · Mono: IBM Plex Mono
   ============================================================ */

:root {
  --paper: #FAFAF8;
  --ink: #14120F;
  --night: #101820;
  --night-2: #1A2430;
  --signal: #FF4D00;
  --signal-dark: #E04300;
  --steel: #6E6A62;
  --line: #E6E2D9;
  --line-strong: #D8D4CA;
  --line-dark: #2A3542;
  --paper-dark-text: #EDEDE8;
  --steel-dark: #8D99A6;
  --radius: 14px;
  --shell: 1160px;
  --font-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", "SF Mono", Consolas, monospace;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  font-family: var(--font-display);
  font-variation-settings: "wdth" 100;
  background: var(--paper);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.shell { max-width: var(--shell); margin: 0 auto; padding: 0 28px; }
.shell-narrow { max-width: 800px; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-variation-settings: "wdth" 112;
  letter-spacing: -0.02em;
  line-height: 1.05;
  font-weight: 800;
  text-wrap: balance;
}

h2 { font-size: clamp(2rem, 4.4vw, 3rem); }

section { padding: 104px 0; }

/* standardized section header block: eyebrow → h2 → sub */
.section-head { margin-bottom: 56px; }
.section-head h2 { margin-bottom: 0; }
.section-head .eyebrow { margin-bottom: 16px; }
.section-head .section-sub { margin-top: 18px; margin-bottom: 0; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--signal);
}

.section-sub {
  font-size: 1.12rem;
  color: var(--steel);
  max-width: 620px;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-variation-settings: "wdth" 106;
  font-weight: 700;
  font-size: 1rem;
  padding: 15px 28px;
  border-radius: 10px;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--signal); color: #fff; }
.btn-primary:hover { background: var(--signal-dark); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #000; }
.btn-sm { padding: 10px 18px; font-size: 0.92rem; }
.btn-block { display: block; width: 100%; text-align: center; }

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

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-row { display: flex; align-items: center; gap: 32px; height: 68px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.logo-mark { width: 28px; height: 28px; }
.logo-word {
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  font-variation-settings: "wdth" 115;
}
.site-nav { display: flex; gap: 28px; margin-left: auto; }
.site-nav a {
  color: var(--steel); text-decoration: none; font-weight: 600; font-size: 0.95rem;
}
.site-nav a:hover { color: var(--ink); }

/* ---------- hero ---------- */
.hero {
  padding: 84px 0 92px;
  overflow: hidden;
  position: relative;
  /* faint blueprint grid, fading toward the left */
  background-image:
    linear-gradient(to right, color-mix(in srgb, var(--ink) 5%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--ink) 5%, transparent) 1px, transparent 1px);
  background-size: 56px 56px;
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(100deg, var(--paper) 0%, var(--paper) 42%, transparent 100%);
  pointer-events: none;
}
.hero .shell { position: relative; }
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 384px;
  gap: 64px;
  align-items: center;
}
.hero h1 {
  font-size: clamp(2.6rem, 4.9vw, 3.8rem);
  margin-bottom: 24px;
}
.h1-line { display: block; }
.hero-copy .eyebrow { display: block; margin-bottom: 18px; }
.hero-sub { font-size: 1.2rem; color: var(--steel); max-width: 540px; margin-bottom: 36px; }
.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.hero-fine {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--steel);
  letter-spacing: 0.02em;
}

/* phone demo */
.hero-demo { display: flex; flex-direction: column; gap: 14px; }
.phone {
  width: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 24px 60px -24px rgba(20, 18, 15, 0.30);
  overflow: hidden;
}
.phone-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #FDFDFC;
  gap: 8px;
}
.phone-id { display: flex; align-items: center; gap: 10px; min-width: 0; }
.phone-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--night); color: #fff;
  display: grid; place-items: center;
  font-weight: 700; font-size: 0.95rem; flex-shrink: 0;
}
.phone-id strong { display: block; font-size: 0.95rem; line-height: 1.2; }
.phone-status {
  font-family: var(--font-mono); font-size: 0.72rem; color: var(--signal); font-weight: 500;
}
.timer-chip {
  font-family: var(--font-mono); font-size: 0.72rem; color: var(--steel);
  background: var(--paper); border: 1px solid var(--line);
  padding: 5px 9px; border-radius: 99px; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.timer-chip b { color: var(--ink); font-weight: 600; }

/* fixed height + internal scroll: the card never changes size (no layout shift) */
.thread {
  padding: 18px 16px;
  display: flex; flex-direction: column; gap: 10px;
  height: 368px;
  overflow-y: auto;
  scrollbar-width: none;
  scroll-behavior: smooth;
}
.thread::-webkit-scrollbar { display: none; }
.msg {
  max-width: 84%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 0.94rem;
  line-height: 1.4;
  flex-shrink: 0;
}
.msg.out {
  align-self: flex-start;
  background: var(--paper);
  border: 1px solid var(--line);
  border-bottom-left-radius: 5px;
}
.msg.in {
  align-self: flex-end;
  background: var(--night);
  color: var(--paper-dark-text);
  border-bottom-right-radius: 5px;
}
.msg.typing { color: var(--steel); font-family: var(--font-mono); font-size: 0.8rem; }
.msg-appear { animation: msgIn 0.28s ease both; }
@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.phone-foot {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 16px;
  border-top: 1px solid var(--line);
  background: #FDFDFC;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.phone-foot.show { opacity: 1; }
.foot-label {
  font-family: var(--font-mono); font-size: 0.7rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: #fff; background: var(--signal);
  padding: 4px 8px; border-radius: 6px;
  flex-shrink: 0;
}
.foot-value { font-weight: 700; font-size: 0.92rem; }

.demo-caption {
  font-size: 0.85rem; color: var(--steel); text-align: center;
}

/* ---------- strip ---------- */
.strip { padding: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fff; }
.strip-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 16px 28px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--steel);
}
.strip-left { justify-self: start; }
.strip-trades { justify-self: center; color: var(--ink); font-weight: 600; }
.strip-right { justify-self: end; text-align: right; }

/* ---------- math (dark) ---------- */
.math { background: var(--night); color: var(--paper-dark-text); }
.math .section-head { margin-bottom: 64px; }
.math-head { color: #fff; }
.math-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px;
  margin-bottom: 44px;
}
.stat { border-top: 2px solid var(--line-dark); padding-top: 22px; }
.stat-num {
  display: block;
  font-family: var(--font-mono);
  font-size: clamp(2.6rem, 5vw, 3.6rem);
  font-weight: 600;
  color: var(--signal);
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 12px;
  font-variant-numeric: tabular-nums;
}
.stat-label { color: var(--steel-dark); font-size: 1rem; max-width: 270px; display: block; }
.math-kicker { font-size: 1.25rem; color: #fff; margin-bottom: 72px; }
.math-kicker em { color: var(--signal); font-style: normal; }

/* calculator */
.calc {
  display: grid; grid-template-columns: 1.1fr 0.9fr;
  background: var(--night-2);
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  overflow: hidden;
}
.calc-inputs { padding: 40px; }
.calc-inputs h3 { color: #fff; font-size: 1.4rem; margin-bottom: 28px; }
.calc-inputs label {
  display: block; margin-bottom: 24px;
  font-size: 0.95rem; font-weight: 600; color: var(--paper-dark-text);
}
.range-row { display: flex; align-items: center; gap: 16px; margin-top: 10px; }
.range-row output {
  font-family: var(--font-mono); font-size: 0.95rem; font-weight: 600;
  color: #fff; min-width: 76px; text-align: right;
  font-variant-numeric: tabular-nums;
}
input[type="range"] {
  flex: 1; appearance: none; -webkit-appearance: none;
  height: 4px; border-radius: 2px; background: var(--line-dark);
  accent-color: var(--signal);
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--signal); border: 3px solid var(--night-2);
  box-shadow: 0 0 0 1px var(--signal);
}
input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--signal); border: 3px solid var(--night-2);
  box-shadow: 0 0 0 1px var(--signal);
}
.calc-note { font-size: 0.82rem; color: var(--steel-dark); font-weight: 400; max-width: 400px; margin-top: 6px; }

.calc-result {
  background: var(--signal);
  color: #fff;
  padding: 40px;
  display: flex; flex-direction: column; justify-content: center; gap: 12px;
}
.calc-result-label {
  font-family: var(--font-mono); font-size: 0.78rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.85);
}
.calc-result-num {
  font-family: var(--font-mono);
  font-size: clamp(2.8rem, 4.6vw, 3.9rem);
  font-weight: 600; letter-spacing: -0.04em; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.calc-result-sub { font-size: 0.98rem; color: rgba(255, 255, 255, 0.92); margin-bottom: 16px; max-width: 340px; }
.calc-result .btn-dark { align-self: flex-start; }

/* ---------- system bento ---------- */
.bento {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.cell {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 28px;
  display: flex; flex-direction: column; gap: 12px;
  transition: border-color 0.15s ease;
}
.cell:hover { border-color: var(--line-strong); }
.cell-wide { grid-column: span 2; flex-direction: row; align-items: center; gap: 32px; }
.cell-body { flex: 1; display: flex; flex-direction: column; gap: 12px; }
.cell-feature { grid-row: span 2; border-color: var(--signal); border-width: 2px; }
.cell-feature:hover { border-color: var(--signal-dark); }
.cell-proof { grid-column: span 2; }
.cell h3 { font-size: 1.28rem; }
.cell p { color: var(--steel); font-size: 0.98rem; max-width: 56ch; }
.cell-tag {
  font-family: var(--font-mono); font-size: 0.7rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--steel);
  align-self: flex-start;
}
.cell-tag-signal { color: var(--signal); }

.cell-visual { margin-top: auto; }
.cell-wide .cell-visual { margin-top: 0; }

/* mini site mockup */
.site-visual { flex-shrink: 0; width: 250px; }
.mini-site { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--paper); }
.mini-bar { display: flex; gap: 5px; padding: 8px 10px; border-bottom: 1px solid var(--line); background: #fff; }
.mini-bar span { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.mini-hero { padding: 16px 14px 18px; }
.mini-headline { height: 12px; width: 80%; background: var(--ink); border-radius: 3px; margin-bottom: 8px; }
.mini-line { height: 7px; width: 60%; background: var(--line); border-radius: 3px; margin-bottom: 14px; }
.mini-cta {
  display: inline-block;
  font-family: var(--font-mono); font-size: 0.62rem; font-weight: 600; letter-spacing: 0.08em;
  background: var(--signal); color: #fff;
  padding: 6px 10px; border-radius: 6px;
}

/* mini thread */
.mini-thread { display: flex; flex-direction: column; gap: 8px; padding-top: 8px; }
.mini-msg {
  font-size: 0.85rem; padding: 8px 12px; border-radius: 12px; max-width: 88%;
}
.mini-msg.out { align-self: flex-start; background: var(--paper); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.mini-msg.in { align-self: flex-end; background: var(--night); color: var(--paper-dark-text); border-bottom-right-radius: 4px; }

/* ---------- guarantees ---------- */
.guarantees { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.guarantee-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px;
}
.guarantee {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px 28px;
  background: var(--paper);
}
.guarantee h3 { font-size: 1.35rem; margin-bottom: 10px; }
.guarantee p { color: var(--steel); max-width: 52ch; }

/* ---------- pricing ---------- */
.price-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 18px;
  align-items: stretch;
}
.price-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px 32px;
  background: #fff;
  display: flex; flex-direction: column;
}
.price-card-main { border: 2px solid var(--ink); box-shadow: 0 20px 50px -30px rgba(20, 18, 15, 0.35); }
.price-card h3 { font-size: 1.5rem; margin-bottom: 12px; }
.price-line { display: flex; align-items: baseline; gap: 6px; }
.price-num {
  font-family: var(--font-mono);
  font-size: 3rem; font-weight: 600; letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.price-per { color: var(--steel); font-weight: 600; }
.price-setup {
  font-family: var(--font-mono); font-size: 0.8rem; color: var(--steel);
  margin: 6px 0 22px;
}
.price-card ul { list-style: none; flex: 1; margin-bottom: 26px; }
.price-card li {
  padding: 9px 0 9px 28px;
  position: relative;
  border-bottom: 1px solid var(--line);
  font-size: 0.97rem;
}
.price-card li:last-child { border-bottom: none; }
.price-card li::before {
  content: "";
  position: absolute; left: 2px; top: 15px;
  width: 14px; height: 8px;
  border-left: 2.5px solid var(--signal);
  border-bottom: 2.5px solid var(--signal);
  transform: rotate(-45deg);
}
.price-fine { font-size: 0.85rem; color: var(--steel); margin-top: 14px; text-align: center; }

/* ---------- faq ---------- */
.faq .section-head { margin-bottom: 40px; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer;
  padding: 22px 44px 22px 0;
  font-weight: 700;
  font-size: 1.08rem;
  list-style: none;
  position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute; right: 4px; top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 1.4rem; font-weight: 400;
  color: var(--signal);
  transition: transform 0.2s ease;
}
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details p { padding: 0 0 24px; color: var(--steel); max-width: 640px; }

/* ---------- final CTA ---------- */
.cta-final { background: var(--night); color: var(--paper-dark-text); }
.cta-final .section-head { margin-bottom: 44px; }
.cta-final h2 { color: #fff; }
.cta-final .section-sub { color: var(--steel-dark); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.demo-form label {
  display: block;
  font-size: 0.88rem; font-weight: 600;
  color: var(--paper-dark-text);
}
.demo-form .optional { color: var(--steel-dark); font-weight: 400; }
.demo-form input {
  display: block; width: 100%;
  margin-top: 7px;
  padding: 14px 16px;
  font-family: var(--font-display);
  font-size: 1rem;
  color: #fff;
  background: var(--night-2);
  border: 1px solid var(--line-dark);
  border-radius: 10px;
}
.demo-form input::placeholder { color: #5B6874; }
.demo-form input:focus { outline: 2px solid var(--signal); outline-offset: 0; border-color: var(--signal); }
.demo-form .btn { margin-top: 8px; }
.form-fine {
  font-family: var(--font-mono); font-size: 0.78rem; color: var(--steel-dark);
  text-align: center; margin-top: 14px;
}
.form-success {
  margin-top: 20px; padding: 18px 22px;
  background: var(--night-2); border: 1px solid var(--signal);
  border-radius: 10px; color: #fff; font-weight: 600;
}

/* ---------- about ---------- */
.about { padding: 80px 0; background: var(--paper); }
.about-grid {
  display: grid; grid-template-columns: 260px 1fr; gap: 48px;
  align-items: start;
}
.about-head { font-size: 1.5rem; }
.about-body p {
  color: var(--steel); font-size: 0.98rem; max-width: 68ch;
}
.about-body p + p { margin-top: 16px; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 48px 0 56px; background: #fff; }
.footer-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 32px;
  align-items: start;
}
.footer-brand p { color: var(--steel); font-size: 0.92rem; margin-top: 6px; }
.footer-nav { display: flex; flex-direction: column; gap: 8px; }
.footer-nav a { color: var(--steel); text-decoration: none; font-size: 0.92rem; font-weight: 600; }
.footer-nav a:hover { color: var(--ink); }
.footer-meta {
  display: flex; flex-direction: column; gap: 6px;
  justify-self: end; text-align: right;
  font-size: 0.9rem; color: var(--steel);
}
.footer-meta a { color: var(--ink); text-decoration: none; }
.footer-meta a:hover { color: var(--signal); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .hero-grid { grid-template-columns: 1fr 360px; gap: 44px; }
  .hero h1 { font-size: clamp(2.5rem, 4.5vw, 3.3rem); }
}

@media (max-width: 920px) {
  section { padding: 76px 0; }
  .hero { padding: 64px 0 72px; }
  .hero-grid { grid-template-columns: 1fr; gap: 52px; }
  .hero-demo { max-width: 420px; }
  .math-stats { grid-template-columns: 1fr; gap: 24px; }
  .calc { grid-template-columns: 1fr; }
  .bento { grid-template-columns: 1fr 1fr; }
  .cell-wide { grid-column: span 2; flex-direction: column; align-items: stretch; }
  .cell-feature { grid-row: auto; }
  .cell-proof { grid-column: span 2; }
  .site-visual { width: 100%; max-width: 320px; }
  .strip-row { grid-template-columns: 1fr; gap: 6px; padding: 16px 28px; }
  .strip-left, .strip-trades, .strip-right { justify-self: start; text-align: left; }
  .about-grid { grid-template-columns: 1fr; gap: 20px; }
  .footer-row { grid-template-columns: 1fr 1fr; }
  .footer-nav { grid-row: 2; }
  .footer-meta { justify-self: start; text-align: left; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .site-nav { display: none; }
  .hero h1 { font-size: clamp(2.3rem, 9.5vw, 2.9rem); }
  .h1-line { display: inline; }
  .bento { grid-template-columns: 1fr; }
  .cell-wide, .cell-proof { grid-column: span 1; }
  .guarantee-grid { grid-template-columns: 1fr; }
  .price-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .footer-row { grid-template-columns: 1fr; }
  .calc-inputs, .calc-result { padding: 28px 24px; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .thread { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
