/* PaidUp, by 3 Degrees North. Tokens mirror DESIGN.md (direction A, 3DN teal and charcoal). */
:root {
  --primary: #0EA5A0;
  --on-primary: #1E1E20;
  --primary-hover: #34BDB8;
  --primary-tint: #E8FAF9;
  --link: #0B7D79;
  --brand-mark: #EE542F;
  --surface: #FDFCFB;
  --surface-raised: #F6F2EF;
  --surface-sunken: #EFE9E5;
  --border: #E4DCD7;
  --border-input: #8F847E;
  --ink: #1E1E20;
  --muted: #5C5C60;
  --error: #B42318;
  --success: #2F6B3A;
  --white: #FFFFFF;
  --font-display: "Newsreader", Georgia, "Times New Roman", serif;
  --font-body: "Albert Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-lockup: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --radius-sm: 8px;
  --radius: 14px;
  --max: 1240px;
  --gutter: 32px;

  /* Legacy names still used below the hero until those sections are rebuilt. */
  --charcoal: var(--ink);
  --cream: var(--surface);
  --teal: var(--primary);
  --teal-dark: var(--link);
  --teal-light: var(--primary-tint);
  --primary-dark: var(--primary-hover);
  --primary-darker: var(--link);
  --primary-light: var(--primary-tint);
  --gray-700: var(--muted);
  --gray-600: var(--muted);
  --gray-300: var(--border-input);
  --gray-200: var(--border);
  --gray-100: var(--surface-raised);
  --font-head: var(--font-display);
  --radius-lg: var(--radius);
  --shadow: none;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font-body); font-size: 17px; line-height: 1.6; color: var(--ink); background: var(--surface); }
h1, h2, h3, h4 { margin: 0 0 0.5em; }
h1, h2 { font-family: var(--font-display); font-weight: 400; }
h1 { font-size: clamp(44px, 6.2vw, 84px); line-height: 1.02; letter-spacing: -0.015em; }
h2 { font-size: clamp(34px, 3.8vw, 52px); line-height: 1.08; letter-spacing: -0.01em; }
h3 { font: 600 20px/1.3 var(--font-body); }
p { margin: 0 0 1em; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible, textarea:focus-visible, input:focus-visible, label.drop:focus-within {
  outline: 3px solid var(--link); outline-offset: 2px;
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Buttons: one teal pill per view region, charcoal label */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 14px 28px; border: 0; border-radius: 999px;
  background: var(--primary); color: var(--on-primary); font: 600 17px/1 var(--font-body);
  text-decoration: none; cursor: pointer; transition: background-color 120ms cubic-bezier(0.2, 0, 0, 1);
}
.btn:hover { background: var(--primary-hover); text-decoration: none; }
.btn:disabled { background: var(--surface-sunken); color: var(--muted); cursor: not-allowed; }
.btn-small { min-height: 44px; padding: 10px 20px; font-size: 16px; }
.btn-quiet { background: transparent; color: var(--ink); border: 1px solid var(--border-input); }
.btn-quiet:hover { background: var(--surface-raised); }

/* Nav: wordmark plus the 3DN lockup, text link to start (the filled button lives in the hero) */
.nav { max-width: var(--max); margin: 0 auto; padding: 16px var(--gutter); min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; font: 500 26px/1 var(--font-display); color: var(--ink); text-decoration: none; margin: 0; }
.wordmark:hover { text-decoration: none; }
.by { font: 500 13px/1 var(--font-lockup); color: var(--muted); align-self: flex-end; margin: 0 0 3px -2px; }
.by b { font-weight: 500; color: var(--brand-mark); }
.tick { width: 28px; height: 28px; border-radius: var(--radius-sm); background: var(--brand-mark) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M9 16.5l4.5 4.5L23 11.5' fill='none' stroke='%23fff' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/100% no-repeat; flex: none; }
.nav-link { font-weight: 600; }

/* Hero: headline left (5 cols), the interview's opening exchange right (7 cols) */
.hero { max-width: var(--max); margin: 0 auto; padding: 32px var(--gutter) 48px; display: grid; grid-template-columns: 5fr 7fr; gap: 64px; align-items: center; min-height: clamp(560px, calc(100vh - 72px), 860px); }
.hero-home { grid-template-columns: 1fr; min-height: 0; padding-bottom: 40px; }
.hero-home .hero-text { max-width: 820px; }
.lead { font-size: 21px; line-height: 1.5; color: var(--muted); max-width: 30ch; margin-top: 24px; }
.hero-home .lead { max-width: 52ch; }
.lead-sm { font-size: 19px; color: var(--muted); }

/* Ask card: the signature. Question, an example exchange, then the visitor's own answer. */
.ask { background: var(--surface-raised); border: 1px solid var(--border); border-radius: var(--radius); padding: 36px; display: flex; flex-direction: column; gap: 18px; }
.ask-q { font: 400 34px/1.15 var(--font-display); margin: 0; }
.ask-example { margin: 0; display: grid; gap: 12px; }
.ask-example figcaption { font-size: 15px; font-weight: 600; color: var(--muted); }
.bubble { margin: 0; padding: 14px 18px; border-radius: var(--radius); max-width: 88%; }
.bubble-them { justify-self: end; background: var(--primary-tint); }
.ask-example .bubble { border-style: dashed; border-width: 1px; border-color: var(--border-input); }
.bubble-us { justify-self: start; background: var(--white); border: 1px solid var(--border); }
.ask-label { font-weight: 600; margin: 6px 0 -8px; }
.ask textarea, .composer textarea, .lead-form input {
  width: 100%; border: 1px solid var(--border-input); border-radius: var(--radius-sm); padding: 14px 16px;
  font: 17px/1.5 var(--font-body); color: var(--ink); background: var(--white); resize: vertical;
}
.ask textarea::placeholder, .composer textarea::placeholder { color: var(--muted); }
.ask-go { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.ask-terms { margin: 0; font-size: 15px; color: var(--muted); }

@media (max-width: 600px) {
  :root { --gutter: 20px; }
  .nav { min-height: 60px; }
  .nav .by { display: none; }
  .wordmark { font-size: 24px; }
  .nav-link { font-size: 16px; white-space: nowrap; }
  .hero { padding-top: 24px; gap: 32px; padding-bottom: 88px; }
  .lead { font-size: 19px; margin-top: 16px; }
  .ask { padding: 22px 18px; gap: 14px; }
  .ask-q { font-size: 28px; }
  .bubble { max-width: 94%; padding: 12px 14px; font-size: 16px; }
  /* Answer box and button first on phones, so the action is above the fold; the example follows. */
  .ask-label { display: none; }
  .ask-example { order: 5; }
  .lead { display: none; }
}

/* Sections below the hero. Gaps vary (120 / 144 / 176) and neighbours never share a composition. */
.small { font-size: 15px; color: var(--muted); }

/* Proof: a real capture beside the copy. The flip mirrors it once, text first. */
.proof { max-width: var(--max); margin: 0 auto; padding: 72px var(--gutter) 0; display: grid; grid-template-columns: 7fr 5fr; gap: 72px; align-items: start; }
.proof-flip { grid-template-columns: 5fr 7fr; padding-top: 144px; }
.proof-text { padding-top: 24px; }
.proof-text > p { max-width: 44ch; }
.shot { margin: 0; }
.shot img { display: block; width: 100%; height: auto; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); }
.shot-pad img { padding: 24px; }
.shot figcaption { margin-top: 12px; font-size: 15px; color: var(--muted); }
.points { margin: 32px 0 0; display: grid; gap: 20px; }
.points div { border-left: 2px solid var(--primary); padding-left: 18px; }
.points dt { font: 600 18px/1.35 var(--font-body); margin-bottom: 4px; }
.points dd { margin: 0; color: var(--muted); }

/* What happens next: one quiet paragraph on a sunken band */
.next { margin-top: 144px; background: var(--surface-sunken); padding: 120px var(--gutter); }
.next-inner { max-width: 760px; margin: 0 auto; }
.next p { font-size: 21px; line-height: 1.55; margin: 0; }

/* Price: a heading and a plain statement on one row, no big figure */
.price { max-width: var(--max); margin: 0 auto; padding: 176px var(--gutter) 0; display: grid; grid-template-columns: 5fr 7fr; gap: 72px; align-items: baseline; }
.price p:first-child { font-size: 21px; line-height: 1.55; max-width: 52ch; }

/* FAQ: one column of disclosures */
.faq { max-width: 760px; margin: 0 auto; padding: 144px var(--gutter) 0; box-sizing: content-box; }
.faq h2 { margin-bottom: 24px; }
.qa { border-top: 1px solid var(--border); }
.qa:last-of-type { border-bottom: 1px solid var(--border); }
.qa summary { cursor: pointer; list-style: none; padding: 20px 40px 20px 0; position: relative; font: 600 18px/1.4 var(--font-body); }
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: "+"; position: absolute; right: 4px; top: 16px; font: 400 26px/1 var(--font-body); color: var(--link); }
.qa[open] summary::after { content: "\2212"; }
.qa p { margin: 0 0 20px; color: var(--muted); max-width: 64ch; }

/* Close: the hero's action again, centred, without the example */
.close { max-width: 720px; margin: 0 auto; padding: 176px var(--gutter) 144px; box-sizing: content-box; }
.close h2 { text-align: center; margin-bottom: 32px; }

/* Home: one row per stream */
.streams { max-width: var(--max); margin: 0 auto; padding: 24px var(--gutter) 144px; }
.stream-row { display: grid; grid-template-columns: 5fr 6fr auto; gap: 32px; align-items: baseline; padding: 32px 0; border-top: 1px solid var(--border); color: inherit; text-decoration: none; }
.stream-row:last-child { border-bottom: 1px solid var(--border); }
.stream-row h2 { font-size: 32px; line-height: 1.18; margin: 0; }
.stream-row p { margin: 0; color: var(--muted); }
.stream-row span { font-weight: 600; color: var(--link); white-space: nowrap; }
.stream-row:hover h2 { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }

.footer { border-top: 1px solid var(--border); background: var(--surface-raised); }
.footer-inner { max-width: var(--max); margin: 0 auto; padding: 48px var(--gutter); display: grid; gap: 12px; color: var(--muted); font-size: 15px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.footer-links a { color: var(--muted); }
.legal { font-size: 14px; color: var(--muted); margin: 0; }

.prose { max-width: 720px; margin: 0 auto; padding: 48px var(--gutter) 120px; }
.prose h1 { font-size: 52px; }
.prose h2 { font-size: 32px; margin-top: 1.4em; }

/* Interview app */
.nav-app { border-bottom: 1px solid var(--gray-200); max-width: none; background: var(--white); }
.progress { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; font-size: 14px; color: var(--gray-600); }
.progress li { padding: 6px 12px; border-radius: 999px; }
.progress li.on { background: var(--primary-light); color: var(--primary-darker); font-weight: 600; }
.progress li.done { color: var(--teal-dark); }
.app { max-width: 760px; margin: 0 auto; padding: 32px 24px 160px; }
.chat { display: flex; flex-direction: column; gap: 16px; }
.msg { max-width: 88%; padding: 14px 18px; border-radius: var(--radius-lg); white-space: pre-wrap; }
.msg-assistant { align-self: flex-start; background: var(--white); border: 1px solid var(--gray-200); }
.msg-assistant.first { font: 700 21px/1.35 var(--font-head); }
.msg-user { align-self: flex-end; background: var(--charcoal); color: var(--white); }
.msg-error { align-self: center; background: var(--primary-light); color: var(--primary-darker); font-size: 15px; }
.typing::after { content: "…"; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .typing::after { animation: none; } .btn { transition: none; } }

.composer { position: sticky; bottom: 0; margin-top: 24px; padding: 16px 0 24px; background: linear-gradient(to bottom, rgba(253, 252, 251, 0), var(--cream) 24%); display: flex; gap: 12px; align-items: flex-end; }
.composer textarea { min-height: 52px; }
.composer[hidden] { display: none; }

.panel { margin-top: 40px; background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: 32px; box-shadow: var(--shadow); }
.panel[hidden] { display: none; }
.panel h2 { font-size: 30px; }
.spec-body h2 { font-size: 19px; color: var(--teal-dark); margin: 20px 0 6px; }
.spec-body ul { margin: 0; padding-left: 20px; }
.row-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }

.drop { display: flex; align-items: center; justify-content: center; min-height: 140px; border: 2px dashed var(--gray-300); border-radius: var(--radius-lg); background: var(--cream); color: var(--gray-700); font-weight: 500; cursor: pointer; text-align: center; padding: 24px; }
.drop.over { border-color: var(--teal); background: var(--teal-light); }
.drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.upload-status { margin: 12px 0 0; color: var(--gray-700); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 20px 0; }
.stat { background: var(--cream); border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 14px; }
.stat b { display: block; font: 800 28px/1.1 var(--font-head); }
.stat span { font-size: 14px; color: var(--gray-600); }
.table-wrap { overflow-x: auto; border: 1px solid var(--gray-200); border-radius: var(--radius); margin: 12px 0 20px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--gray-200); white-space: nowrap; }
th { background: var(--gray-100); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
.exceptions li { margin: 4px 0; }
.ok { color: var(--teal-dark); font-weight: 600; }

.lead-form { display: grid; gap: 16px; max-width: 460px; }
.lead-form label { display: grid; gap: 6px; font-weight: 500; font-size: 15px; }
.lead-form .btn { justify-self: start; }
.form-error { color: var(--primary-darker); margin: 0; min-height: 1.5em; }

@media (max-width: 900px) {
  .hero, .proof, .proof-flip, .price { grid-template-columns: 1fr; gap: 36px; min-height: 0; }
  .hero { padding-top: 32px; }
  .proof { padding-top: 96px; }
  .proof .proof-text { order: -1; }
  .proof-text { padding-top: 0; }
  .next { margin-top: 96px; padding: 88px var(--gutter); }
  .price { padding-top: 120px; gap: 8px; }
  .faq { padding-top: 104px; }
  .close { padding-top: 120px; padding-bottom: 104px; }
  .stream-row { grid-template-columns: 1fr; gap: 8px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .progress li:not(.on) { display: none; }
  .msg { max-width: 100%; }
}
