/* ==========================================================================
   Data Science with Dennis — Coaching Chat
   Aesthetic: editorial minimalism, warm paper + gold accent, typography-forward
   Brand-matched to clients.datasciencewithdennis.com
   ========================================================================== */

:root {
  /* Brand palette */
  --paper: #fdfdfd;
  --paper-shade: #f6f2e8;
  --ink: #222222;
  --ink-strong: #0c0c0c;
  --muted: #6b6b6b;
  --muted-soft: #9a9a96;
  --hairline: rgba(34, 34, 34, 0.10);
  --hairline-strong: rgba(34, 34, 34, 0.22);
  --gold: #dfd150;
  --gold-ink: #222222;
  --gold-soft: rgba(223, 209, 80, 0.20);
  --gold-line: rgba(223, 209, 80, 0.85);
  --danger: #b04a33;
  --danger-soft: rgba(176, 74, 51, 0.10);

  --shadow-card: 0 1px 2px rgba(34, 34, 34, 0.04), 0 12px 32px -16px rgba(34, 34, 34, 0.18);

  --display: "Libre Baskerville", "Iowan Old Style", Georgia, serif;
  --body: "Instrument Sans", -apple-system, system-ui, sans-serif;

  --column: 600px;
  --radius: 6px;
  --radius-lg: 10px;
  --pad-x: clamp(24px, 5vw, 48px);
}

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

body {
  background-color: var(--paper);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(223, 209, 80, 0.06), transparent 70%),
    radial-gradient(ellipse 60% 40% at 50% 100%, rgba(34, 34, 34, 0.02), transparent 70%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' seed='5'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.035 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, textarea { font-family: inherit; }

/* ---------- View switching ---------- */
/* Using :not(.is-active) so we beat `.screen { display: flex }` on specificity
   and don't need to care about rule order later in the file. */
.view:not(.is-active) { display: none !important; }

/* ---------- Top wordmark ---------- */
.wordmark {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--display);
  font-size: 17px;
  color: var(--ink);
  letter-spacing: 0.005em;
  padding: 32px 0 0;
}
.wordmark::before {
  content: "";
  display: block;
  width: 24px;
  height: 3px;
  background: var(--gold);
  border-radius: 2px;
}
.wordmark strong { font-weight: 700; }
.wordmark em { font-style: italic; color: var(--muted); margin-left: 2px; }

/* ---------- Shared column ---------- */
.column {
  max-width: var(--column);
  margin: 0 auto;
  padding: 0 var(--pad-x);
}

.screen {
  min-height: 100vh;
  padding-bottom: clamp(64px, 10vh, 120px);
  display: flex;
  flex-direction: column;
}

/* ---------- Display lockup ---------- */
.lockup {
  margin-top: clamp(32px, 6vh, 64px);
  margin-bottom: clamp(20px, 3.5vh, 36px);
}
.display {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(30px, 5.2vw, 46px);
  line-height: 1.18;
  letter-spacing: -0.005em;
  color: var(--ink-strong);
  margin: 0 0 20px;
}
.display em {
  font-style: italic;
  font-weight: 400;
  position: relative;
  display: inline-block;
  padding: 0 2px;
}
.display em::after {
  content: "";
  position: absolute;
  left: -2px;
  right: -2px;
  bottom: -0.12em;
  height: 0.32em;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 18' preserveAspectRatio='none'><path d='M2 10 Q 25 2, 50 8 T 100 7 T 150 9 T 198 6' fill='none' stroke='%23dfd150' stroke-width='6' stroke-linecap='round'/></svg>");
  background-size: 100% 100%;
  background-repeat: no-repeat;
  z-index: -1;
  opacity: 0.95;
}
.byline {
  margin: 0 0 14px;
  font-family: var(--body);
  font-size: 13px;
  font-weight: 400;
  font-style: italic;
  color: var(--muted);
  line-height: 1.55;
  letter-spacing: 0.01em;
}
.byline .sep {
  display: inline-block;
  padding: 0 4px;
  color: var(--gold);
  font-weight: 700;
  font-style: normal;
}
.subline {
  font-family: var(--body);
  font-size: 16px;
  color: var(--muted);
  line-height: 1.6;
  max-width: 44ch;
  margin: 0;
}

/* ---------- Intake form ---------- */
.field-label {
  display: block;
  font-family: var(--body);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  margin: 0 0 14px;
}
.field-hint {
  display: inline-block;
  margin-left: 10px;
  font-weight: 400;
  font-style: italic;
  text-transform: none;
  letter-spacing: 0.02em;
  color: var(--muted-soft);
  font-size: 11px;
}
.email-field {
  margin: 0 0 44px;
}
.email-field input {
  width: 100%;
  border: 0;
  border-bottom: 1.5px solid var(--hairline-strong);
  background: transparent;
  font-family: var(--display);
  font-size: 20px;
  color: var(--ink);
  padding: 10px 0 14px;
  outline: none;
  transition: border-color 220ms ease, padding-left 220ms ease;
}
.email-field input::placeholder {
  color: var(--muted-soft);
  font-style: italic;
}
.email-field input:focus {
  border-bottom-color: var(--gold);
  padding-left: 2px;
}
.email-privacy {
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
}

.choice-group { margin: 0 0 44px; }
.choices { display: flex; flex-direction: column; gap: 8px; }
.choice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  background: #ffffff;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  text-align: left;
  box-shadow: 0 1px 0 rgba(34, 34, 34, 0.02);
  transition: border-color 180ms ease, transform 180ms ease,
              box-shadow 180ms ease, background 180ms ease;
}
.choice .years {
  font-family: var(--display);
  font-style: italic;
  font-size: 13px;
  color: var(--muted);
  font-weight: 400;
}
.choice:hover {
  background: var(--paper-shade);
  border-color: var(--gold-line);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px -6px rgba(223, 209, 80, 0.35);
}
.choice[aria-pressed="true"] {
  background: var(--paper-shade);
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
}
.choice[aria-pressed="true"]::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 12px;
  background: var(--gold);
  border-radius: 50%;
  flex-shrink: 0;
}

.intake-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  margin-top: 8px;
}
.enter-hint {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.04em;
  font-style: italic;
  margin: 0;
}
/* On phones the keyboard hint is useless — touch users can't press Enter
   usefully in most contexts — and taking up a line hurts layout. */
@media (max-width: 600px) {
  .intake-cta { gap: 12px; }
  .enter-hint { display: none; }
  #intake-submit { width: 100%; justify-content: center; }
}
.enter-hint kbd {
  font-family: var(--body);
  font-size: 11px;
  font-style: normal;
  padding: 2px 7px;
  border: 1px solid var(--hairline-strong);
  border-radius: 4px;
  margin: 0 2px;
  background: #ffffff;
  box-shadow: 0 1px 0 rgba(34, 34, 34, 0.06);
}
.form-error {
  margin-top: 16px;
  padding: 12px 16px;
  border: 1px solid rgba(176, 74, 51, 0.35);
  border-radius: var(--radius);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 14px;
  font-style: italic;
  display: none;
}
.form-error.is-visible { display: block; }

/* ---------- Chat screen ---------- */
.chat-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px 0 28px;
  margin-top: 32px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--hairline);
}
.monogram {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--gold-ink);
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.01em;
  flex-shrink: 0;
  box-shadow:
    0 4px 14px -4px rgba(223, 209, 80, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    inset 0 -1px 0 rgba(34, 34, 34, 0.1);
}
.chat-header .who {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink-strong);
}
.chat-header .what {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.04em;
  font-style: italic;
  margin-top: 2px;
}

.transcript { display: flex; flex-direction: column; }
.turn {
  padding: 22px 0;
  border-top: 1px solid var(--hairline);
}
.turn:first-child { border-top: 0; padding-top: 0; }
.turn .label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 12px;
}
.turn.dennis .label { color: var(--ink-strong); }
.turn.dennis .label::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 2px;
  background: var(--gold);
  border-radius: 1px;
}
.turn .body {
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  white-space: pre-wrap;
  word-wrap: break-word;
}
.turn .body p { margin: 0 0 14px; }
.turn .body p:last-child { margin-bottom: 0; }

.caret {
  display: inline-block;
  width: 0.55ch;
  height: 1.05em;
  margin-left: 2px;
  vertical-align: -3px;
  background: var(--gold);
  animation: blink 960ms steps(1, end) infinite;
}
@keyframes blink { 50% { background: transparent; } }

/* ---------- Input bar ---------- */
.reply {
  margin-top: 36px;
  padding: 20px 20px 16px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  background: #ffffff;
  box-shadow: var(--shadow-card);
  transition: border-color 200ms ease, box-shadow 200ms ease, opacity 300ms ease;
}
.reply:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft), var(--shadow-card);
}
.reply.is-disabled {
  opacity: 0.5;
  pointer-events: none;
}
.reply .label {
  display: block;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 10px;
}
.reply textarea {
  width: 100%;
  border: 0;
  background: transparent;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  resize: none;
  outline: none;
  padding: 0;
  min-height: 3em;
}
.reply textarea::placeholder { color: var(--muted-soft); font-style: italic; }
.reply .hint {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--hairline);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.06em;
}
.reply .remaining {
  font-variant-numeric: tabular-nums;
  font-style: italic;
}
.send-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--ink-strong);
  color: var(--paper);
  border: 1px solid var(--ink-strong);
  border-radius: var(--radius);
  padding: 10px 18px;
  font-family: var(--body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 2px 6px -2px rgba(34, 34, 34, 0.25);
  transition: transform 120ms ease, background 180ms ease, box-shadow 180ms ease;
}
.send-btn:hover:not(:disabled) {
  background: var(--gold);
  color: var(--gold-ink);
  border-color: rgba(34, 34, 34, 0.12);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px -6px rgba(223, 209, 80, 0.55);
}
.send-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.send-btn .arrow { font-size: 14px; transition: transform 200ms ease; }
.send-btn:hover:not(:disabled) .arrow { transform: translateX(3px); }

@media (max-width: 600px) {
  .send-btn { padding: 12px 20px; font-size: 13px; }
}

/* ---------- CTA block ---------- */
.cta {
  margin-top: 56px;
  padding: 40px 36px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  background: #ffffff;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  display: none;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 540ms ease, transform 540ms ease;
}
.cta.is-visible {
  display: block;
  opacity: 1;
  transform: none;
}
.cta::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--gold) 0%, #eae06b 50%, var(--gold) 100%);
}
.cta::after {
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle at top right, var(--gold-soft), transparent 60%);
  pointer-events: none;
}
.cta .kicker {
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-strong);
  font-weight: 700;
  margin-bottom: 14px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.cta .kicker::before {
  content: "";
  width: 24px;
  height: 2px;
  background: var(--gold);
}
.cta h3 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 28px;
  line-height: 1.25;
  margin: 0 0 16px;
  color: var(--ink-strong);
}
.cta h3 em {
  font-style: italic;
  position: relative;
}
.cta h3 em::after {
  content: "";
  position: absolute;
  left: -2px; right: -2px;
  bottom: -0.1em;
  height: 0.3em;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 18' preserveAspectRatio='none'><path d='M2 10 Q 30 4, 60 9 T 120 8 T 198 7' fill='none' stroke='%23dfd150' stroke-width='6' stroke-linecap='round'/></svg>");
  background-size: 100% 100%;
  background-repeat: no-repeat;
  z-index: -1;
  opacity: 0.9;
}
.cta p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
  margin: 0 0 24px;
  max-width: 48ch;
  position: relative;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--gold);
  color: var(--gold-ink);
  padding: 16px 28px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid rgba(34, 34, 34, 0.12);
  border-radius: var(--radius);
  cursor: pointer;
  box-shadow:
    0 4px 14px -4px rgba(223, 209, 80, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transition: transform 120ms ease, box-shadow 200ms ease, background 200ms ease;
}
.btn:hover {
  background: #e7d958;
  transform: translateY(-2px);
  box-shadow:
    0 8px 22px -6px rgba(223, 209, 80, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.btn .arrow { font-size: 16px; transition: transform 200ms ease; }
.btn:hover .arrow { transform: translateX(4px); }

/* ---------- Intro animation ---------- */
.reveal > * {
  opacity: 0;
  transform: translateY(12px);
  animation: rise 680ms cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}
.reveal > *:nth-child(1) { animation-delay: 60ms; }
.reveal > *:nth-child(2) { animation-delay: 160ms; }
.reveal > *:nth-child(3) { animation-delay: 280ms; }
.reveal > *:nth-child(4) { animation-delay: 420ms; }
.reveal > *:nth-child(5) { animation-delay: 560ms; }
.reveal > *:nth-child(6) { animation-delay: 680ms; }
@keyframes rise { to { opacity: 1; transform: none; } }

@media (max-width: 600px) {
  .display { font-size: 34px; }
  .email-field input { font-size: 18px; }
  .cta { padding: 28px 22px; }
  .cta h3 { font-size: 24px; }
  .chat-header { gap: 12px; }
  .monogram { width: 42px; height: 42px; font-size: 14px; }
}

/* ---------- Modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  animation: modal-fade-in 260ms ease-out;
}
.modal[hidden] { display: none; }
@keyframes modal-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 20, 20, 0.38);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
}
.modal-card {
  position: relative;
  max-width: 520px;
  width: 100%;
  padding: 44px 40px 40px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  background: #ffffff;
  box-shadow: 0 30px 80px -20px rgba(34, 34, 34, 0.35), 0 2px 6px rgba(34, 34, 34, 0.08);
  overflow: hidden;
  animation: modal-rise 380ms cubic-bezier(0.22, 0.61, 0.36, 1);
}
@keyframes modal-rise {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}
.modal-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--gold) 0%, #eae06b 50%, var(--gold) 100%);
}
.modal-card::after {
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle at top right, var(--gold-soft), transparent 60%);
  pointer-events: none;
}
.modal-card .kicker {
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-strong);
  font-weight: 700;
  margin-bottom: 14px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  position: relative;
}
.modal-card .kicker::before {
  content: "";
  width: 24px;
  height: 2px;
  background: var(--gold);
}
.modal-card h3 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 30px;
  line-height: 1.2;
  margin: 0 0 16px;
  color: var(--ink-strong);
  position: relative;
}
.modal-card h3 em {
  font-style: italic;
  position: relative;
}
.modal-card h3 em::after {
  content: "";
  position: absolute;
  left: -2px; right: -2px;
  bottom: -0.1em;
  height: 0.3em;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 18' preserveAspectRatio='none'><path d='M2 10 Q 30 4, 60 9 T 120 8 T 198 7' fill='none' stroke='%23dfd150' stroke-width='6' stroke-linecap='round'/></svg>");
  background-size: 100% 100%;
  background-repeat: no-repeat;
  z-index: -1;
  opacity: 0.9;
}
.modal-card p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
  margin: 0 0 24px;
  max-width: 46ch;
  position: relative;
}
.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  z-index: 2;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}
.modal-close:hover {
  color: var(--ink-strong);
  background: var(--paper-shade);
  border-color: var(--hairline);
}
.modal-close:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.trust-footer {
  margin-top: 32px;
  padding-top: 22px;
  border-top: 1px dashed var(--hairline);
  position: relative;
}
.trust-caption {
  margin: 0 0 14px;
  font-size: 12px;
  font-style: italic;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.trust-graphic {
  display: block;
  max-width: 100%;
  height: auto;
}

@media (max-width: 600px) {
  .modal { padding: 16px; }
  .modal-card { padding: 40px 24px 28px; }
  .modal-card h3 { font-size: 24px; }
}

/* Lock body scroll while the modal is open */
body.modal-open { overflow: hidden; }
