/* Ringback Crew. Every value below comes from ../MASTER.md. */
:root {
  --night: #101214;
  --night-2: #1a1d21;
  --night-line: #2a2e34;
  --ground: #f3f4f2;
  --white: #ffffff;
  --ink: #121417;
  --ink-2: #4c535b;
  --mist: #b9bec5;
  --line: #d9dcd8;
  --hivis: #f5d90a;
  --hivis-hover: #ffe64a;
  --missed: #e5383b;
  --missed-ink: #b3141f;
  --sms: #2f3339;
  --sms-cus: #e9eaec;
  --ghost-line: #4a5058;
  --dim: #9aa1a9;

  --display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  --body: "Barlow", "Segoe UI", Roboto, system-ui, sans-serif;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px;
  --section: clamp(64px, 10vw, 128px);
  --radius: 2px;

  --ease: cubic-bezier(.2, .8, .2, 1);
  --t-fast: 140ms;
  --t-mid: 280ms;
  --t-slow: 320ms;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 17px/1.6 var(--body);
}
@media (min-width: 900px) { body { font-size: 18px; } }

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 800;
  text-transform: uppercase;
  line-height: .95;
  letter-spacing: .005em;
  margin: 0 0 var(--s4);
}
h2 { font-size: clamp(34px, 5vw, 56px); max-width: 18ch; }
h3 { font-size: 26px; font-weight: 700; line-height: 1; margin-bottom: var(--s2); }
p { margin: 0 0 var(--s4); }
a { color: inherit; text-decoration-thickness: 1.5px; text-underline-offset: 2px; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }
@media (max-width: 400px) { .wrap { padding: 0 16px; } }

.body-lead { font-size: clamp(18px, 2vw, 20px); color: var(--ink-2); max-width: 52ch; }
.fine { font-size: 14px; color: var(--ink-2); max-width: 52ch; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 var(--s5);
  font: 800 18px/1 var(--display); letter-spacing: .06em; text-transform: uppercase; text-decoration: none;
  color: var(--ink); background: var(--hivis);
  border: 2px solid var(--hivis); border-radius: var(--radius);
  cursor: pointer;
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.btn:hover { background: var(--hivis-hover); border-color: var(--hivis-hover); transform: translateY(-1px); }
.btn:active { transform: none; }
.btn-ghost { background: transparent; color: var(--white); border-color: var(--ghost-line); }
.btn-ghost:hover { background: transparent; border-color: var(--white); }
.btn-dark { background: var(--ink); color: var(--white); border-color: var(--ink); }
.btn-dark:hover { background: var(--night-2); border-color: var(--night-2); }

/* Header */
.site-header { background: var(--night); color: var(--white); border-bottom: 1px solid var(--night-line); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); min-height: 64px; }
.logo { display: inline-flex; align-items: center; gap: var(--s3); font: 800 22px/1 var(--display); text-transform: uppercase; letter-spacing: .04em; text-decoration: none; color: var(--white); }
.logo-mark { width: 32px; height: 32px; display: grid; place-items: center; background: var(--hivis); color: var(--ink); border-radius: var(--radius); }
.logo-mark svg { width: 24px; height: 24px; }
.nav { display: flex; align-items: center; gap: var(--s5); font-weight: 600; font-size: 15px; }
.nav a { color: var(--mist); text-decoration: none; transition: color var(--t-fast) var(--ease); }
.nav a:hover { color: var(--white); }
.nav .nav-cta { color: var(--ink); background: var(--hivis); padding: var(--s2) var(--s3); border-radius: var(--radius); font: 800 15px/1 var(--display); letter-spacing: .06em; text-transform: uppercase; }
.nav .nav-cta:hover { color: var(--ink); background: var(--hivis-hover); }
.site-header a:focus-visible { outline-color: var(--white); }
@media (max-width: 640px) { .nav a:not(.nav-cta) { display: none; } }

/* Hero */
.hero { background: var(--night); color: var(--white); padding: clamp(48px, 8vw, 104px) 0 clamp(56px, 9vw, 112px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.kicker { font: 700 13px/1 var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--hivis); margin-bottom: var(--s4); }
.hero h1 { font-size: clamp(44px, 8vw, 92px); margin-bottom: var(--s5); }
.hero h1 em { font-style: normal; color: var(--hivis); }
.hero .lead { font-size: clamp(18px, 2vw, 21px); color: var(--mist); max-width: 36ch; margin-bottom: var(--s6); }
.cta-row { display: flex; flex-wrap: wrap; gap: var(--s3); }
.hero a:focus-visible, .hero button:focus-visible { outline-color: var(--white); }
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .cta-row .btn { flex: 1 1 220px; }
}

.thread-wrap { margin: 0; }
.thread { background: var(--night-2); border: 1px solid var(--night-line); border-radius: var(--radius); padding: var(--s4); min-height: 408px; }
.thread-head { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; color: var(--dim); padding-bottom: var(--s3); margin-bottom: var(--s4); border-bottom: 1px solid var(--night-line); }
.missed { display: flex; align-items: center; gap: var(--s2); color: var(--missed); font-weight: 700; font-size: 15px; margin-bottom: var(--s3); }
.bubble { max-width: 88%; margin: 0 0 var(--s2); padding: 10px 13px; border-radius: 16px; font-size: 15.5px; line-height: 1.4; }
.bubble.biz { background: var(--sms); color: var(--white); border-bottom-left-radius: 4px; }
.bubble.cus { background: var(--sms-cus); color: var(--ink); margin-left: auto; border-bottom-right-radius: 4px; }
.typing { display: inline-flex; gap: 4px; padding: 13px 14px; background: var(--sms); border-radius: 16px; border-bottom-left-radius: 4px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--dim); animation: typing 900ms var(--ease) infinite; }
.typing i:nth-child(2) { animation-delay: 150ms; }
.typing i:nth-child(3) { animation-delay: 300ms; }
@keyframes typing { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }
.ticket { display: grid; grid-template-columns: auto 1fr; gap: var(--s1) var(--s3); margin: var(--s3) 0 0; padding: var(--s3); border: 2px solid var(--hivis); border-radius: var(--radius); font-size: 15px; }
.ticket dt { font: 800 14px/1.5 var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--hivis); }
.ticket dd { margin: 0; }
.thread-foot { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s4); margin-top: var(--s3); font-size: 13px; color: var(--dim); }
.replay { flex: none; font: 600 14px var(--body); color: var(--white); background: transparent; border: 1px solid var(--ghost-line); border-radius: var(--radius); padding: 6px 12px; cursor: pointer; transition: border-color var(--t-fast) var(--ease); }
.replay:hover { border-color: var(--white); }

/* The conversation plays once; without JS every step is simply visible. */
.js .thread .step { opacity: 0; transform: translateY(8px); }
.js .thread .step.on { opacity: 1; transform: none; transition: opacity var(--t-mid) var(--ease), transform var(--t-mid) var(--ease); }
.js .thread .step.gone { display: none; }

/* Section reveal: content is visible by default, hidden only once JS is running. */
.js .reveal { opacity: 0; transform: translateY(12px); }
.js .reveal.in { opacity: 1; transform: none; transition: opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--ease); }

section { padding: var(--section) 0; }

/* Cost calculator */
.cost-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.calc { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(20px, 3vw, 32px); }
.field { display: block; margin-bottom: var(--s5); }
.field-top { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); font-weight: 600; margin-bottom: var(--s2); }
.field output { font: 800 24px/1 var(--display); font-variant-numeric: tabular-nums; flex: none; }
.hint { display: block; font-size: 13px; font-weight: 400; color: var(--ink-2); }
input[type="range"] { width: 100%; height: 32px; margin: 0; background: transparent; accent-color: var(--ink); cursor: pointer; }
.calc-out { display: grid; gap: var(--s1); padding: var(--s5) var(--s4); background: var(--night); color: var(--white); border-radius: var(--radius); }
.calc-out span { color: var(--mist); font-size: 15px; }
.calc-math { margin-top: var(--s2); padding-top: var(--s2); border-top: 1px solid var(--night-line); color: var(--dim); font-size: 13px; font-variant-numeric: tabular-nums; }
.calc-out b { font: 800 clamp(48px, 7vw, 72px)/1 var(--display); color: var(--hivis); font-variant-numeric: tabular-nums; }
@media (max-width: 860px) { .cost-grid { grid-template-columns: 1fr; } }

/* How it works: one rail, four stops */
.how { background: var(--white); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.flow { list-style: none; margin: var(--s7) 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s5); position: relative; }
.flow::before { content: ""; position: absolute; left: 0; right: 0; top: 7px; height: 2px; background: var(--line); }
.flow li { position: relative; padding-top: var(--s6); }
.flow li::before { content: ""; position: absolute; top: 0; left: 0; width: 16px; height: 16px; background: var(--white); border: 2px solid var(--ink); border-radius: 50%; }
.flow li:last-child::before { background: var(--hivis); }
.flow .flow-alert::before { background: var(--missed-ink); border-color: var(--missed-ink); }
.flow p { color: var(--ink-2); font-size: 16px; }
@media (max-width: 860px) {
  .flow { grid-template-columns: 1fr; gap: var(--s6); }
  .flow::before { left: 7px; right: auto; top: 8px; bottom: 8px; width: 2px; height: auto; }
  .flow li { padding: 0 0 0 var(--s7); }
}

/* Old estimates */
.drawer-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(32px, 6vw, 96px); align-items: center; }
.template { margin: 0; background: var(--night); padding: var(--s5); border-radius: var(--radius); }
.template figcaption { color: var(--mist); font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; margin-bottom: var(--s3); }
.template .bubble { max-width: 100%; margin: 0; }
.slot { color: var(--hivis); font-weight: 600; }
@media (max-width: 860px) { .drawer-grid { grid-template-columns: 1fr; } }

/* What it will never do */
.rules { background: var(--night); color: var(--white); }
.rule-list { list-style: none; margin: var(--s6) 0 0; padding: 0; columns: 2 340px; column-gap: var(--s8); }
.rule-list li { break-inside: avoid; padding: var(--s4) 0; border-top: 1px solid var(--night-line); color: var(--mist); font-size: 17px; }
.rule-list b { display: block; color: var(--white); font: 800 24px/1.1 var(--display); text-transform: uppercase; letter-spacing: .01em; margin-bottom: var(--s1); }

/* Who */
.who .body-lead { max-width: 60ch; }

/* Book */
.book { background: var(--hivis); }
.book-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, .7fr); gap: clamp(24px, 5vw, 72px); align-items: end; }
.book h2 { max-width: 16ch; }
.book p { max-width: 48ch; }
.book .fine { color: var(--ink); margin-top: var(--s3); }
.book-actions .btn { width: 100%; }
@media (max-width: 860px) { .book-grid { grid-template-columns: 1fr; } }

/* SMS disclosures */
.sms { border-top: 1px solid var(--line); }
.sms h2 { font-size: clamp(28px, 4vw, 40px); }
.plain { padding-left: 1.1em; margin: 0 0 var(--s4); color: var(--ink-2); }
.plain li { margin-bottom: var(--s2); }

/* Footer */
.site-footer { background: var(--night); color: var(--mist); font-size: 15px; padding: var(--s6) 0; }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s4); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: var(--s5); }
.site-footer a { color: var(--mist); }
.site-footer a:hover { color: var(--white); }
.site-footer a:focus-visible { outline-color: var(--white); }

/* Legal pages */
.legal { padding: clamp(48px, 8vw, 96px) 0 var(--section); }
.legal h1 { font-size: clamp(44px, 7vw, 72px); }
.legal h2 { font-size: 28px; max-width: none; margin-top: var(--s7); }
.legal p, .legal li { color: var(--ink-2); max-width: 68ch; }
.legal strong { color: var(--ink); }
.legal ul { padding-left: 1.1em; }
.legal li { margin-bottom: var(--s2); }
.updated { font-size: 14px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.callout { background: var(--white); border-left: 6px solid var(--hivis); padding: var(--s4) var(--s5); color: var(--ink) !important; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal, .js .thread .step { opacity: 1; transform: none; transition: none; }
  .typing i { animation: none; opacity: .7; }
  .btn:hover { transform: none; }
}
