/* ============================================================
   Creative Architect — Creative Block Quiz
   Theme: cream background, navy ink, single orange accent — the
   inverse of the money-block quiz's navy background / cream ink,
   so the two quizzes read as a matched pair, not duplicates.
   Liquid-glass surfaces (frosted, translucent, blurred) reused
   from the homepage's .glass system, tinted navy since it now
   sits on a light background instead of a dark one.
   Shape system: cards / buttons / inputs = 18px radius.
                 progress bar / dots = full (pill) radius.
   Handwriting rule: any "Nic Handwriting" text is always sized
   2x the font-size of the SF Pro Display text it accompanies.
   ============================================================ */

@font-face {
  font-family: "SF Pro Display";
  src: url("fonts/SFPRODISPLAYREGULAR.OTF") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "SF Pro Display";
  src: url("fonts/SFPRODISPLAYMEDIUM.OTF") format("opentype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "SF Pro Display";
  src: url("fonts/SFPRODISPLAYBOLD.OTF") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "SF Pro Display";
  src: url("fonts/SFPRODISPLAYSEMIBOLDITALIC.OTF") format("opentype");
  font-weight: 600;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "SF Pro Display";
  src: url("fonts/SFPRODISPLAYBLACKITALIC.OTF") format("opentype");
  font-weight: 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Nic Handwriting";
  src: url("fonts/Nic_handwriting-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --cream: #ffeddf;
  --navy: #2d3047;
  --orange: #f15106;

  --bg: var(--cream);
  --text: var(--navy);
  --text-secondary: rgba(45, 48, 71, 0.72);
  --surface: rgba(45, 48, 71, 0.06);
  --surface-hover: rgba(45, 48, 71, 0.10);
  --border: rgba(45, 48, 71, 0.14);
  --border-strong: rgba(45, 48, 71, 0.26);
  --error: #c1391e;
  --shadow-orange: 0 10px 26px rgba(241, 81, 6, 0.24);

  /* Liquid glass: bright, mostly-white frosted fill (not a dark tint,
     the glass should look light and airy on this cream backdrop), a
     barely-there edge for definition, an inset rim light, and a soft
     warm outer glow tying it back to the orange accent. */
  --glass-bg: linear-gradient(155deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.2));
  --glass-border: rgba(45, 48, 71, 0.1);
  --glass-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.85), 0 10px 24px rgba(45, 48, 71, 0.08),
    0 0 22px rgba(241, 81, 6, 0.12);

  --radius: 18px;
  --radius-sm: 12px;
  --max-width: 480px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  overflow-x: hidden;
  background: radial-gradient(ellipse 120% 60% at 18% -10%, #fff6ec 0%, var(--cream) 55%);
  background-attachment: fixed;
  color: var(--text);
  font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Two independently-drifting colour blobs behind the content, same
   recipe as the homepage, so the glass surfaces have something
   colorful to actually blur/refract instead of just a flat gradient.
   Transform-only animation (compositor-only) so it stays smooth across
   question-to-question re-renders. Sits behind .shell (z-index 0 vs 1),
   below .grain (z-index 50). */
body::before,
body::after {
  content: "";
  position: fixed;
  z-index: 0;
  pointer-events: none;
  border-radius: 50%;
  width: 62vw;
  height: 62vw;
}
body::before {
  top: -12%;
  left: -12%;
  max-width: 480px;
  max-height: 480px;
  background: radial-gradient(closest-side, rgba(241, 81, 6, 0.16), transparent 70%);
  animation: drift-a 36s ease-in-out infinite alternate;
}
body::after {
  top: 10%;
  right: -16%;
  max-width: 420px;
  max-height: 420px;
  background: radial-gradient(closest-side, rgba(112, 141, 129, 0.18), transparent 70%);
  animation: drift-b 48s ease-in-out infinite alternate;
}
@keyframes drift-a {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(7vw, 9vh) scale(1.1); }
  100% { transform: translate(-5vw, 4vh) scale(0.94); }
}
@keyframes drift-b {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-9vw, -6vh) scale(1.12); }
  100% { transform: translate(4vw, 7vh) scale(0.92); }
}
@media (prefers-reduced-motion: reduce) {
  body::before,
  body::after {
    animation: none;
  }
}

/* Real paper-grain photo (not synthetic SVG noise), matching the
   money-block quiz's material direction. Never on scrolling containers
   (perf + the "slight vintage feel" from the brand brief). Lower
   opacity than the navy quiz's: the same texture reads much stronger
   against a light base. */
.grain {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: 0.14;
  mix-blend-mode: multiply;
  background-image: url("images/textures/paper-texture.jpg");
  background-size: 900px auto;
  background-repeat: repeat;
  will-change: opacity;
  transform: translateZ(0);
}

button {
  font-family: inherit;
}

/* Brand-matched keyboard focus ring: without this, every interactive
   element falls back to the browser's default outline (usually blue),
   which clashes with the cream/navy/orange palette. Kept as its own
   selector list (not folded into hover/active) so it only ever shows for
   keyboard navigation, never on mouse/touch clicks. */
.option:focus-visible,
.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.back-btn:focus-visible,
.field input:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}

.shell {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ---------- Top bar / progress ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: max(1rem, env(safe-area-inset-top)) 1.25rem 0.75rem;
  background: rgba(255, 237, 223, 0.72);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
}

.topbar[hidden] {
  display: none;
}

.back-btn {
  flex: 0 0 auto;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s var(--ease), background 0.15s var(--ease);
}

.back-btn svg {
  display: block;
}

.back-btn:active {
  transform: scale(0.92);
}

.progress-track {
  flex: 1 1 auto;
  height: 6px;
  border-radius: 999px;
  background: rgba(45, 48, 71, 0.14);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: var(--orange);
  transition: width 0.4s var(--ease);
}

@media (prefers-reduced-motion: reduce) {
  .progress-fill {
    transition: none;
  }
}

.progress-label {
  flex: 0 0 auto;
  font-family: "SF Pro Display", sans-serif;
  font-weight: 500;
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* ---------- Stage ---------- */

.stage {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1.5rem 1.25rem calc(2.5rem + env(safe-area-inset-bottom));
}

.screen {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  animation: rise 0.45s var(--ease);
}

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

@media (prefers-reduced-motion: reduce) {
  .screen {
    animation: none;
  }
}

/* ---------- Landing hero (matches moneyblocks' materic direction) ---------- */
/* Breaks out of .stage's own padding to go edge-to-edge, then the
   scrim/duotone bring it back to solid cream for the content below. */

.hero-image-wrap {
  position: relative;
  width: calc(100% + 2.5rem);
  margin: -1.5rem -1.25rem 1.25rem;
  height: 30vh;
  min-height: 190px;
  max-height: 280px;
  overflow: hidden;
  background: var(--cream);
}

.hero-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  /* Duotone: desaturate the source image, then let the gradient overlay
     (mix-blend-mode: color) restamp it with brand hues — cream-dominant
     here (inverse of the money quiz's navy-dominant version), so the
     image reads pale and misty rather than dark and heavy. */
  filter: grayscale(1) contrast(1.1) brightness(1.12);
}

.hero-duotone {
  position: absolute;
  inset: 0;
  background: linear-gradient(155deg, var(--cream) 0%, var(--navy) 100%);
  mix-blend-mode: color;
}

.hero-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      to bottom,
      rgba(255, 237, 223, 0) 0%,
      rgba(255, 237, 223, 0) 40%,
      rgba(255, 237, 223, 0.55) 70%,
      var(--cream) 100%
    ),
    linear-gradient(to right, var(--cream) 0%, transparent 14%, transparent 86%, var(--cream) 100%);
}

.bracket-label {
  font-family: "SF Pro Display", sans-serif;
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin: 0 0 0.85rem;
}

.bracket-label b {
  color: var(--orange);
  font-weight: 700;
}

h1.landing-title {
  font-size: 2.05rem;
  line-height: 1.12;
}

.highlight {
  display: inline-block;
  font-style: italic;
  font-weight: 900;
  color: var(--orange);
  background: rgba(241, 81, 6, 0.14);
  border: 1px solid rgba(241, 81, 6, 0.4);
  border-radius: 6px;
  padding: 0.05em 0.3em;
  margin: 0 0.05em;
  transform: rotate(-1.2deg);
  line-height: 1.2;
}

@media (min-width: 640px) {
  .hero-image-wrap {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    margin-top: -3rem;
    margin-bottom: 1.25rem;
    height: 34vh;
  }

  h1.landing-title {
    font-size: 2.6rem;
  }
}

/* ---------- Logo ---------- */

.logo-mark {
  display: block;
  width: 200px;
  height: auto;
  margin: 0 0 1.75rem;
}

.eyebrow {
  font-family: "SF Pro Display", sans-serif;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--orange);
  margin: 0 0 0.5rem;
}

/* ---------- Type ---------- */

h1 {
  font-family: "SF Pro Display", sans-serif;
  font-weight: 700;
  font-size: 1.7rem;
  line-height: 1.22;
  letter-spacing: -0.01em;
  color: var(--navy);
  margin: 0 0 0.75rem;
}

h1 em, h2 em {
  font-style: italic;
  font-weight: 900;
  color: var(--orange);
  line-height: 1.15;
  padding-bottom: 0.05em;
  display: inline-block;
}

h2.question {
  font-family: "SF Pro Display", sans-serif;
  font-weight: 700;
  font-size: 1.45rem;
  line-height: 1.28;
  letter-spacing: -0.01em;
  color: var(--navy);
  margin: 0 0 1.5rem;
}

p.lede {
  font-size: 1.02rem;
  line-height: 1.55;
  color: var(--text-secondary);
  margin: 0 0 1.75rem;
  max-width: 40ch;
}

/* One complete thought per line, for the result/exit screens: several
   short paragraphs read better than one dense block that wraps wherever
   the browser feels like. */
p.thought {
  font-size: 1.02rem;
  line-height: 1.4;
  color: var(--text-secondary);
  margin: 0 0 0.3rem;
}

/* Air only at the 3 key beats: into "how it shows up", into "what's
   possible", and into the closing "Thanks" line. Everything else stays
   tight so the page doesn't read as one long wall of text. */
p.thought.thought-group-start {
  margin-top: 0.55rem;
}

/* ---------- Form (landing) ---------- */

.field {
  margin-bottom: 1.1rem;
  text-align: left;
}

.field label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 500;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
  color: var(--text);
}

.field label svg {
  flex: 0 0 auto;
  color: var(--orange);
}

.field input {
  width: 100%;
  padding: 0.95rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  outline: none;
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.field input::placeholder {
  color: var(--text-secondary);
  opacity: 0.75;
}

.field input:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(241, 81, 6, 0.22);
}

.field input[aria-invalid="true"] {
  border-color: var(--error);
}

.field .hint {
  margin-top: 0.4rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.field .error {
  display: none;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.4rem;
  font-size: 0.82rem;
  color: var(--error);
}

.field .error svg {
  flex: 0 0 auto;
}

.field.has-error .error {
  display: flex;
}

.field-checkbox label {
  align-items: flex-start;
  gap: 0.6rem;
  font-weight: 400;
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.4;
  cursor: pointer;
}

.field-checkbox input[type="checkbox"] {
  flex: 0 0 auto;
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.1rem;
  accent-color: var(--orange);
  cursor: pointer;
}

/* ---------- Buttons ---------- */

.btn-primary {
  display: block;
  width: 100%;
  border: none;
  border-radius: var(--radius);
  background: var(--orange);
  color: var(--navy);
  font-family: "SF Pro Display", sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
  padding: 1.05rem 1.5rem;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--shadow-orange);
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease);
  margin-top: 0.5rem;
}

.btn-primary:hover {
  box-shadow: 0 14px 32px rgba(241, 81, 6, 0.42);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-primary.btn-cta {
  display: table;
  width: auto;
  padding: 0.85rem 1.75rem;
  font-size: 1.05rem;
  margin: 1rem auto 0;
  text-decoration: none;
}

/* Secondary CTA: quieter than the primary booking button, glass instead
   of solid, for people not ready for a call yet. Never the first or
   only action on the final screen. */
.btn-secondary {
  display: block;
  width: 100%;
  text-align: center;
  border-radius: var(--radius);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  color: var(--text);
  font-family: "SF Pro Display", sans-serif;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.9rem 1.5rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s var(--ease), background 0.15s var(--ease);
}

.btn-secondary:active {
  transform: scale(0.98);
}

.cta-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.5rem 0 1rem;
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.cta-divider::before,
.cta-divider::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: var(--border);
}

.btn-caption {
  display: block;
  text-align: center;
  font-family: "SF Pro Display", sans-serif;
  font-weight: 600;
  font-style: italic;
  color: var(--orange);
  font-size: 0.92rem;
  letter-spacing: 0.01em;
  line-height: 1.3;
  margin-top: 0.75rem;
}

/* ---------- Quiz options ---------- */

.options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.option {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  text-align: left;
  padding: 1.1rem 1.2rem;
  min-height: 64px;
  border-radius: var(--radius);
  border: 2px solid var(--glass-border);
  background: var(--glass-bg);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  color: var(--text);
  font-family: "SF Pro Display", sans-serif;
  font-weight: 500;
  font-size: 1.02rem;
  line-height: 1.35;
  cursor: pointer;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease),
    transform 0.12s var(--ease), color 0.15s var(--ease);
}

.option:hover {
  background: linear-gradient(155deg, rgba(45, 48, 71, 0.13), rgba(45, 48, 71, 0.05));
  border-color: var(--border-strong);
}

.option:active {
  transform: scale(0.98);
}

.option .dot {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}

.option .dot svg {
  width: 13px;
  height: 13px;
  color: var(--navy);
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.15s var(--ease), transform 0.15s var(--ease);
}

.option.selected {
  background: rgba(241, 81, 6, 0.14);
  border-color: var(--orange);
  color: var(--text);
  font-weight: 700;
}

.option.selected .dot {
  border-color: var(--orange);
  background: var(--orange);
}

.option.selected .dot svg {
  opacity: 1;
  transform: scale(1);
}

/* ---------- Exit / final screens ---------- */

.icon-circle {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  background: var(--orange);
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-orange);
}

.icon-circle svg {
  width: 1.5rem;
  height: 1.5rem;
}

/* Handwriting signoff paired with p.lede (1.02rem) -> 2x = 2.04rem */
.signoff {
  font-family: "Nic Handwriting", cursive;
  color: var(--orange);
  font-size: 2.04rem;
  line-height: 1.15;
  margin-top: 1.75rem;
}

/* ---------- Responsive ---------- */

@media (min-width: 640px) {
  /* Past mobile width, the radial gradient's soft corner starts reading
     as washed-out gray instead of the intended cream once the viewport
     is much wider than the gradient's own ellipse. A flat solid fill
     avoids the stretch entirely. */
  body {
    background: var(--cream);
  }

  .stage {
    padding: 3rem 1.5rem;
  }

  .logo-mark {
    width: 230px;
  }

  h1 {
    font-size: 2rem;
  }

  h2.question {
    font-size: 1.65rem;
  }
}
