/* WildBlue AI Opportunity Audit — mobile-first at 375px, desktop is the enhancement.
   Aesthetic: a sharp consultant's field notes — warm paper, navy ink, one cobalt accent. */

:root {
  --paper: #f6f5f0;
  --card: #fffefb;
  --ink: #152b45;
  --ink-soft: #51647c;
  --line: #d9dcd2;
  --cobalt: #2353d4;
  --cobalt-soft: rgba(35, 83, 212, 0.07);
  --error: #b03434;
  --serif: "Newsreader", georgia, serif;
  --sans: "Schibsted Grotesk", system-ui, sans-serif;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(21, 43, 69, 0.05), 0 8px 24px -12px rgba(21, 43, 69, 0.18);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink);
  background-color: var(--paper);
  /* faint dot grid — the "graph paper" the notes are written on */
  background-image: radial-gradient(rgba(21, 43, 69, 0.07) 1px, transparent 1px);
  background-size: 24px 24px;
  min-height: 100dvh;
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  background: rgba(246, 245, 240, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}

.wordmark {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.wordmark span { color: var(--cobalt); }
.wordmark em { font-style: normal; font-weight: 400; color: var(--ink-soft); }

.step-count {
  margin-left: auto;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.back-btn {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  flex-shrink: 0;
}
.back-btn:active { transform: scale(0.94); }

.progress {
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: transparent;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--cobalt);
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- screens ---------- */

#app {
  max-width: 640px;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 4rem;
}

.screen > * {
  animation: rise 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.screen > *:nth-child(2) { animation-delay: 0.06s; }
.screen > *:nth-child(3) { animation-delay: 0.12s; }
.screen > *:nth-child(4) { animation-delay: 0.18s; }
.screen > *:nth-child(5) { animation-delay: 0.24s; }
.screen > *:nth-child(6) { animation-delay: 0.3s; }
.screen > *:nth-child(n + 7) { animation-delay: 0.36s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .screen > *, .margin-note, .chip, .btn { animation: none !important; transition: none !important; }
}

/* ---------- landing ---------- */

.eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cobalt);
  margin: 1.5rem 0 1rem;
}

.hero-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.1rem, 9vw, 3.1rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin-bottom: 1rem;
}
.hero-title em {
  font-style: italic;
  color: var(--cobalt);
}

.hero-sub {
  color: var(--ink-soft);
  font-size: 1.04rem;
  max-width: 34rem;
  margin-bottom: 1.75rem;
}

.hero-facts {
  list-style: none;
  display: flex;
  gap: 1.25rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 0.8rem 0;
  margin-bottom: 1.75rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
}
.hero-facts strong {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink);
  margin-right: 0.3rem;
}

.privacy-note {
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin-top: 0.9rem;
  max-width: 32rem;
}
.privacy-note a, .hero-footnote a { color: var(--cobalt); }

.hero-footnote {
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

/* ---------- buttons ---------- */

.btn {
  display: block;
  width: 100%;
  min-height: 3.4rem;
  padding: 0.9rem 1.5rem;
  font-family: var(--sans);
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.2s ease;
}
.btn:active { transform: scale(0.985); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
  background: var(--ink);
  color: var(--paper);
}

.btn-link {
  display: block;
  width: 100%;
  margin-top: 0.9rem;
  background: none;
  border: none;
  color: var(--ink-soft);
  font-size: 0.92rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  padding: 0.6rem;
}

a.btn { text-align: center; text-decoration: none; line-height: 1.6rem; }

/* ---------- question screens ---------- */

.margin-note {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.02rem;
  color: var(--ink);
  border-left: 3px solid var(--cobalt);
  padding: 0.15rem 0 0.15rem 0.85rem;
  margin-bottom: 1.6rem;
  min-height: 1.4rem;
  animation: rise 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.q-number {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cobalt);
  margin-bottom: 0.6rem;
}

.q-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.5rem, 6.5vw, 2rem);
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.q-hint {
  color: var(--ink-soft);
  font-size: 0.92rem;
  margin-bottom: 1.1rem;
}

.choices { display: grid; gap: 0.65rem; margin: 1.25rem 0 1.5rem; }

.chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  min-height: 3.3rem;
  padding: 0.85rem 1.1rem;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.12s ease;
}
.chip:active { transform: scale(0.985); }
.chip[aria-pressed="true"] {
  border-color: var(--cobalt);
  background: var(--cobalt-soft);
}
.chip[aria-pressed="true"]::after {
  content: "✓";
  color: var(--cobalt);
  font-weight: 700;
}

.suggestion-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}
.suggestion {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-soft);
  font-size: 0.85rem;
  padding: 0.45rem 0.8rem;
  border-radius: 99px;
  cursor: pointer;
}
.suggestion:active { transform: scale(0.96); }

textarea, input[type="text"], input[type="email"] {
  width: 100%;
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--ink);
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  box-shadow: var(--shadow);
}
textarea { min-height: 7rem; resize: vertical; margin-bottom: 0.4rem; }
textarea:focus, input:focus, .chip:focus-visible, .btn:focus-visible, .suggestion:focus-visible {
  outline: 2px solid var(--cobalt);
  outline-offset: 2px;
}

.char-count {
  font-size: 0.78rem;
  color: var(--ink-soft);
  text-align: right;
  margin-bottom: 1rem;
  font-variant-numeric: tabular-nums;
}

.field-error {
  color: var(--error);
  font-size: 0.88rem;
  margin: 0.4rem 0 0.8rem;
  min-height: 1.2rem;
}

/* ---------- loading interstitial ---------- */

.loading-wrap { text-align: center; padding-top: 4.5rem; }

.loading-quill {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.25rem;
  margin-bottom: 1.2rem;
}

.loading-dots { display: inline-flex; gap: 0.4rem; }
.loading-dots span {
  width: 0.5rem; height: 0.5rem;
  border-radius: 50%;
  background: var(--cobalt);
  animation: pulse 1.1s ease-in-out infinite;
}
.loading-dots span:nth-child(2) { animation-delay: 0.18s; }
.loading-dots span:nth-child(3) { animation-delay: 0.36s; }

@keyframes pulse {
  0%, 100% { opacity: 0.25; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-4px); }
}

/* ---------- email gate ---------- */

.teaser-list { display: grid; gap: 0.65rem; margin: 1.4rem 0 1.8rem; }

.teaser-card {
  display: flex;
  gap: 0.9rem;
  align-items: baseline;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
}
.teaser-card .index {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.3rem;
  color: var(--cobalt);
  flex-shrink: 0;
}
.teaser-card .headline { font-weight: 500; }
.teaser-card .locked {
  display: block;
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin-top: 0.2rem;
}

.consent-row {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  font-size: 0.88rem;
  color: var(--ink-soft);
  margin-bottom: 0.85rem;
}
.consent-row input[type="checkbox"] {
  width: 1.25rem; height: 1.25rem;
  margin-top: 0.1rem;
  accent-color: var(--cobalt);
  flex-shrink: 0;
}
.consent-row a { color: var(--cobalt); }

label.field-label {
  display: block;
  font-weight: 700;
  font-size: 0.95rem;
  margin: 1.2rem 0 0.5rem;
}

/* ---------- results ---------- */

.finding-card {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.2rem;
  margin-bottom: 0.9rem;
  box-shadow: var(--shadow);
}
.finding-card .index {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--cobalt);
  display: block;
  margin-bottom: 0.35rem;
}
.finding-card h3 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.3rem;
  line-height: 1.25;
  margin-bottom: 0.5rem;
}
.finding-card .why { color: var(--ink-soft); margin-bottom: 0.75rem; }
.finding-card .first-step {
  font-size: 0.95rem;
  border-top: 1px dashed var(--line);
  padding-top: 0.75rem;
}
.finding-card .first-step strong { color: var(--cobalt); }
.finding-card .caveat {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.92rem;
  color: var(--ink-soft);
  margin-top: 0.6rem;
}

.result-intro, .result-closing { margin-bottom: 1.3rem; }
.result-closing { color: var(--ink-soft); }

.email-confirm {
  font-size: 0.88rem;
  color: var(--ink-soft);
  text-align: center;
  margin-top: 0.9rem;
}

/* ---------- desktop enhancement ---------- */

@media (min-width: 720px) {
  #app { padding-top: 3.5rem; }
  .hero-title { font-size: 3.4rem; }
  .choices { gap: 0.75rem; }
  .btn { width: auto; min-width: 16rem; }
  .btn-link { width: auto; }
}
