/* WrapDial design system
   Palette: Ink night blue, panel slate, signal green, watch amber, flag red.
   Type: Bricolage Grotesque display, IBM Plex Sans body, IBM Plex Mono for
   every phone number and data value (the telephony texture of the site). */

:root {
  --ink: #0e1220;
  --panel: #161d30;
  --panel-2: #1c2440;
  --line: #2a3450;
  --text: #e8ecf4;
  --muted: #93a0b8;
  --signal: #2fbf8f;
  --watch: #f0a52e;
  --risk: #f07a3c;
  --flag: #ff5c5c;
  --max: 1080px;
}

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

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

body {
  background: var(--ink);
  color: var(--text);
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.mono { font-family: "IBM Plex Mono", ui-monospace, monospace; }

h1, h2, h3 { font-family: "Bricolage Grotesque", "IBM Plex Sans", sans-serif; line-height: 1.12; letter-spacing: -0.015em; }
h1 { font-size: clamp(2rem, 5vw, 3.3rem); font-weight: 800; }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 700; margin-bottom: 0.6rem; }
h3 { font-size: 1.05rem; font-weight: 600; }

a { color: var(--signal); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; border-radius: 4px; }

/* Nav */
.nav {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.1rem clamp(1rem, 4vw, 2.5rem);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: rgba(14, 18, 32, 0.92); backdrop-filter: blur(8px); z-index: 10;
}
.wordmark {
  font-family: "IBM Plex Mono", monospace; font-weight: 600; font-size: 1.15rem;
  color: var(--text); letter-spacing: -0.02em;
}
.wordmark span { color: var(--signal); }
.wordmark:hover { text-decoration: none; }
.nav nav { display: flex; gap: 1.4rem; align-items: center; }
.nav nav a { color: var(--muted); font-size: 0.92rem; font-weight: 500; }
.nav nav a:hover { color: var(--text); text-decoration: none; }
.nav-cta { color: var(--signal) !important; }

/* Hero */
.hero {
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 3rem; align-items: center;
  max-width: var(--max); margin: 0 auto; padding: clamp(3rem, 8vh, 5.5rem) clamp(1rem, 4vw, 2.5rem) 3rem;
}
.eyebrow {
  font-family: "IBM Plex Mono", monospace; font-size: 0.75rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--signal); margin-bottom: 1rem;
}
.eyebrow.center { text-align: center; }
.sub { color: var(--muted); margin: 1.1rem 0 1.8rem; max-width: 34rem; }
.fine { color: var(--muted); font-size: 0.8rem; margin-top: 0.7rem; }

.scan-form { display: flex; gap: 0.6rem; max-width: 30rem; }
.scan-form input {
  flex: 1; background: var(--panel); border: 1px solid var(--line); color: var(--text);
  padding: 0.85rem 1rem; border-radius: 8px; font-size: 1.05rem; min-width: 0;
}
.scan-form input::placeholder { color: #5b6780; }
.scan-form.big { max-width: 36rem; margin-top: 1.6rem; }
.scan-form.big input { font-size: 1.25rem; padding: 1rem 1.2rem; }

.btn-primary {
  background: var(--signal); color: #08110d; border: 0; font-weight: 600;
  padding: 0.85rem 1.4rem; border-radius: 8px; font-size: 1rem; cursor: pointer;
  font-family: "IBM Plex Sans", sans-serif; white-space: nowrap;
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:disabled { opacity: 0.6; cursor: wait; }
.btn-ghost {
  background: transparent; color: var(--signal); border: 1px solid var(--signal);
  padding: 0.7rem 1.2rem; border-radius: 8px; font-size: 0.95rem; cursor: pointer; font-weight: 600;
}
.btn-ghost:hover { background: rgba(47, 191, 143, 0.1); }

.form-msg { min-height: 1.4rem; font-size: 0.88rem; color: var(--watch); margin-top: 0.5rem; }

/* Hero phone artifact: the signature element. */
.hero-art { display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.phone {
  width: 260px; height: 380px; background: linear-gradient(170deg, #0a0e1a, #131a2e);
  border: 1px solid var(--line); border-radius: 32px; position: relative; overflow: hidden;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.phone-notch {
  width: 90px; height: 18px; background: #05080f; border-radius: 0 0 12px 12px;
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
}
.callcard {
  position: absolute; inset: 60px 18px 24px; border-radius: 18px; padding: 1.2rem 1rem;
  display: flex; flex-direction: column; gap: 0.35rem;
}
.cc-bad { background: rgba(255, 92, 92, 0.08); border: 1px solid rgba(255, 92, 92, 0.35); animation: swapBad 9s infinite; }
.cc-good { background: rgba(47, 191, 143, 0.08); border: 1px solid rgba(47, 191, 143, 0.35); animation: swapGood 9s infinite; opacity: 0; }
@keyframes swapBad { 0%, 42% { opacity: 1; } 50%, 92% { opacity: 0; } 100% { opacity: 1; } }
@keyframes swapGood { 0%, 42% { opacity: 0; } 50%, 92% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .cc-bad { opacity: 0; } .cc-good { opacity: 1; }
}
.cc-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); }
.cc-name { font-size: 1.25rem; font-weight: 700; font-family: "Bricolage Grotesque", sans-serif; }
.cc-bad .cc-name { color: var(--flag); }
.cc-good .cc-name { color: var(--text); }
.cc-check {
  font-size: 0.6rem; background: var(--signal); color: #08110d; border-radius: 4px;
  padding: 2px 6px; vertical-align: middle; font-family: "IBM Plex Sans", sans-serif; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
}
.cc-num { color: var(--muted); font-size: 0.95rem; }
.cc-actions { margin-top: auto; display: flex; justify-content: space-around; font-size: 0.85rem; font-weight: 600; }
.cc-decline { color: var(--flag); }
.cc-accept { color: var(--signal); }
.dim { opacity: 0.35; }
.art-caption { color: var(--muted); font-size: 0.75rem; }

/* Sources strip */
.sources { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 1.6rem 1rem; }
.source-row {
  display: flex; flex-wrap: wrap; gap: 0.8rem 2.2rem; justify-content: center;
  list-style: none; color: var(--muted); font-size: 0.85rem; margin-top: 0.8rem;
}
.source-row em { color: var(--signal); font-style: normal; font-size: 0.7rem; margin-left: 4px; }

/* Sections */
main > section { max-width: var(--max); margin: 0 auto; padding: clamp(2.5rem, 7vh, 4.5rem) clamp(1rem, 4vw, 2.5rem); }
.sources { max-width: none; }
.case p, .scoring p, .upgrade p, .newsletter p { color: var(--muted); max-width: 44rem; }

.case-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin: 1.8rem 0 1.2rem; }
.case-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 1.1rem; }
.case-card h3 { margin: 0.6rem 0 0.2rem; }
.case-card p { font-size: 0.85rem; color: var(--muted); }
.case-close { font-weight: 500; color: var(--text) !important; }

.badge {
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 5px; font-family: "IBM Plex Sans", sans-serif;
}
.b-clean { background: rgba(47, 191, 143, 0.15); color: var(--signal); }
.b-flag { background: rgba(255, 92, 92, 0.15); color: var(--flag); }
.b-watch { background: rgba(240, 165, 46, 0.15); color: var(--watch); }
.b-mute { background: rgba(147, 160, 184, 0.12); color: var(--muted); }

.scoring { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
.ledger-demo { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 1.2rem; font-size: 0.85rem; }
.ld-row { display: flex; justify-content: space-between; gap: 1rem; padding: 0.55rem 0; border-bottom: 1px dashed var(--line); color: var(--muted); }
.ld-total { display: flex; justify-content: space-between; padding-top: 0.8rem; font-weight: 600; color: var(--text); }
.neg { color: var(--flag); }

.upgrade { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; margin-top: 1rem !important; margin-bottom: 1rem !important; }
.lead-form { margin-top: 1.4rem; max-width: 40rem; }
.lead-fields { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.8rem; }
.lead-fields input {
  flex: 1 1 12rem; background: var(--ink); border: 1px solid var(--line); color: var(--text);
  padding: 0.75rem 0.9rem; border-radius: 8px; font-size: 0.95rem; font-family: "IBM Plex Sans", sans-serif;
}
.upgrade .lead-fields input { background: var(--ink); }
.newsletter .lead-fields input { background: var(--panel); }

/* Scan page */
.scan-page { max-width: 46rem; margin: 0 auto; padding: clamp(2.5rem, 7vh, 4rem) clamp(1rem, 4vw, 2.5rem); }
.scan-faq { margin-top: 3.5rem; }
.scan-faq h2 { font-size: 1.1rem; margin-top: 1.6rem; }
.scan-faq p { color: var(--muted); font-size: 0.95rem; }

.progress { margin-top: 2rem; }
.progress-track { height: 6px; background: var(--panel); border-radius: 3px; overflow: hidden; margin: 0.8rem 0 1rem; }
.progress-bar { height: 100%; width: 4%; background: var(--signal); border-radius: 3px; transition: width 0.35s ease; }
.progress-sources { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem 1.6rem; color: var(--muted); font-size: 0.8rem; }
.progress-sources li::before { content: "· "; color: var(--line); }
.progress-sources li.done { color: var(--signal); }
.progress-sources li.done::before { content: "ok "; }
#progressText { color: var(--muted); font-size: 0.8rem; }

/* Report page */
.report { max-width: 52rem; margin: 0 auto; padding: clamp(2rem, 6vh, 3.5rem) clamp(1rem, 4vw, 2.5rem); }
.report-number { font-size: clamp(1.8rem, 5vw, 2.6rem); font-weight: 600; margin-bottom: 1.5rem; }
.report section { margin-bottom: 2.8rem; }
.score-block { display: grid; grid-template-columns: auto 1fr; gap: 2.2rem; align-items: center; }
.dial { text-align: center; }
.dial-num { font-family: "Bricolage Grotesque", sans-serif; font-size: 30px; font-weight: 800; fill: var(--text); }
.dial-sub { font-size: 10px; fill: var(--muted); font-family: "IBM Plex Mono", monospace; }
.band-label { font-family: "Bricolage Grotesque", sans-serif; font-weight: 700; font-size: 1.2rem; margin-top: 0.3rem; }
.partial { font-size: 0.72rem; color: var(--watch); margin-top: 0.3rem; }
.score-copy p { color: var(--muted); font-size: 0.95rem; margin-bottom: 1rem; }

.results { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.results th { text-align: left; font-family: "IBM Plex Mono", monospace; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); padding: 0.5rem 0.7rem; border-bottom: 1px solid var(--line); }
.results td { padding: 0.75rem 0.7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.results .src { font-weight: 600; white-space: nowrap; }
.results .detail { color: var(--muted); }

.ledger { list-style: none; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 0.6rem 1.2rem; }
.ledger li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.6rem 0; border-bottom: 1px dashed var(--line); font-size: 0.92rem; }
.ledger li:last-child { border-bottom: 0; }
.pts { font-family: "IBM Plex Mono", monospace; font-weight: 600; }
.ver { font-size: 0.7rem; color: var(--muted); font-weight: 400; }

.recs { padding-left: 1.3rem; color: var(--muted); }
.recs li { margin-bottom: 0.6rem; }

.report-foot { border-top: 1px solid var(--line); padding-top: 1.4rem; color: var(--muted); font-size: 0.78rem; }
.report-foot p { margin-bottom: 0.4rem; }

.site-foot { border-top: 1px solid var(--line); padding: 2rem clamp(1rem, 4vw, 2.5rem); color: var(--muted); font-size: 0.8rem; max-width: none; }
.site-foot .mono { color: var(--text); margin-bottom: 0.4rem; }

/* Responsive */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 2.2rem; }
  .hero-art { order: -1; }
  .phone { width: 220px; height: 330px; }
  .case-grid { grid-template-columns: repeat(2, 1fr); }
  .scoring { grid-template-columns: 1fr; gap: 1.6rem; }
  .score-block { grid-template-columns: 1fr; text-align: center; }
  .score-copy { text-align: left; }
  .scan-form { flex-direction: column; }
  .nav nav { gap: 0.9rem; }
  .nav nav a { font-size: 0.85rem; }
}
