/* ============================================================
   OWEN SHORT — AI DEMO TOOL
   Chrome = Costello design system (Inter, black-on-white,
   hairlines, subtle shadows).  Personal layer = runtime vars
   (--brand / --accent) swapped per visitor.
   ============================================================ */

:root {
  /* ---- PERSONAL BRAND LAYER (set live per visitor; fallback = navy + sky) */
  --brand:      #070E1C;   /* header band background          */
  --brand-fg:   #FFFFFF;   /* readable text/logo on --brand   */
  --accent:     #0EA5E9;   /* buttons, highlights, the CTA    */
  --accent-fg:  #FFFFFF;   /* text on --accent                */
  --accent-ink: #0C7BA8;   /* accent darkened, legible on white */

  /* Tints derived from the visitor accent (used for chips, washes) */
  --accent-wash: color-mix(in srgb, var(--accent) 9%, #fff);
  --accent-line: color-mix(in srgb, var(--accent) 26%, var(--border-hairline));

  /* App-level neutral aliases mapped onto DS tokens */
  --ink:   var(--text-primary);
  --muted: var(--text-muted);
  --line:  var(--border-hairline);
  --paper: #FFFFFF;
  --canvas:#FAFAF9;        /* warm off-white page bg          */
  --ok:    #16A34A;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--canvas);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button { font-family: inherit; }

.icon { width: 18px; height: 18px; flex: 0 0 auto; stroke: currentColor;
  fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ============================================================
   HEADER — the only element that uses --brand as a fill
   ============================================================ */
.site-header {
  background: var(--brand);
  color: var(--brand-fg);
  padding: 16px clamp(20px, 4vw, 40px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 60;
}
.brand-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.logo-chip { display: flex; align-items: center; justify-content: center; height: 38px; min-width: 38px; }
.logo-chip img { max-height: 36px; max-width: 168px; object-fit: contain; display: block; }
.logo-chip svg { max-height: 36px; max-width: 168px; display: block; }
.logo-chip.initial {
  width: 40px; height: 40px; border-radius: 9px;
  background: color-mix(in srgb, var(--brand-fg) 16%, transparent);
  color: var(--brand-fg); font-weight: 800; font-size: 19px;
}
.brand-name {
  font-size: 18px; font-weight: 700; letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand-right {
  font-size: 13px; opacity: .82; display: flex; align-items: center; gap: 7px;
  white-space: nowrap;
}
.brand-right .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: 0 0 auto; }
.brand-right strong { font-weight: 700; }

/* ============================================================
   STAGE + STATE TRANSITIONS
   ============================================================ */
main { display: block; }
.stage { animation: stage-in .45s var(--ease-standard); }
@keyframes stage-in { from { transform: translateY(10px); } to { transform: none; } }
[hidden] { display: none !important; }

.wrap { max-width: 560px; margin: 0 auto; padding: clamp(32px, 7vh, 80px) 22px 120px; }
.wrap-wide { max-width: min(1560px, 95vw); margin: 0 auto; padding: 28px clamp(20px, 4vw, 52px) 150px; }

/* ============================================================
   SHARED — kicker, buttons
   ============================================================ */
.eyebrow {
  font-size: var(--kicker-size); font-weight: var(--kicker-weight);
  letter-spacing: var(--kicker-tracking); text-transform: uppercase;
  color: var(--accent-ink); margin: 0 0 12px; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 8px;
}
.eyebrow .icon { width: 15px; height: 15px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-weight: 600; font-size: 16px; border: 1px solid transparent;
  border-radius: var(--radius-pill); padding: 13px 24px; cursor: pointer;
  transition: background var(--dur-base) var(--ease-standard),
              transform var(--dur-fast) var(--ease-standard),
              box-shadow var(--dur-base) var(--ease-standard),
              border-color var(--dur-base) var(--ease-standard);
}
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .55; cursor: default; }
.btn .icon { width: 18px; height: 18px; }
.btn-primary { background: var(--accent); color: var(--accent-fg); }
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 32%, transparent);
}
.btn-ghost { background: var(--paper); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { transform: translateY(-1px); box-shadow: var(--shadow-hover); }
.btn-lg { padding: 15px 28px; font-size: 16px; }

/* ============================================================
   SCREEN 1 — LANDING / INPUT
   ============================================================ */
.hero { text-align: center; margin-bottom: 28px; }
.greeting-wave { display: inline-block; transform-origin: 70% 70%; }
#hero-greeting {
  font-size: clamp(34px, 6vw, 50px); font-weight: 800; letter-spacing: -0.03em;
  line-height: 1.05; margin: 0 0 16px; text-wrap: balance;
}
.hero-sub {
  font-size: clamp(17px, 2vw, 19px); color: var(--muted); line-height: 1.6;
  max-width: 480px; margin: 0 auto; text-wrap: pretty;
}
.hero-sub b { color: var(--ink); font-weight: 600; }

.input-card {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-card);
  padding: 28px; max-width: 480px; margin: 0 auto;
}
.field { margin-bottom: 16px; }
.field:last-of-type { margin-bottom: 0; }
.field label {
  display: flex; align-items: baseline; gap: 8px; font-weight: 600;
  font-size: 14px; margin-bottom: 7px;
}
.field label .opt { font-weight: 400; color: var(--muted); font-size: 13px; }
.input-shell { position: relative; display: flex; align-items: center; }
.input-shell .input-icon {
  position: absolute; left: 14px; color: var(--muted); pointer-events: none;
  width: 18px; height: 18px;
}
.input-card input {
  width: 100%; padding: 13px 14px 13px 42px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); font: inherit; font-size: 15px;
  background: var(--bg-subtle); color: var(--ink);
  transition: border-color var(--dur-base) var(--ease-standard),
              box-shadow var(--dur-base) var(--ease-standard),
              background var(--dur-base) var(--ease-standard);
}
.input-card input::placeholder { color: var(--muted); }
.input-card input:focus {
  outline: none; background: var(--paper); border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}
#research-btn { width: 100%; margin-top: 22px; }
.fine {
  text-align: center; color: var(--muted); font-size: 13px;
  margin: 16px 0 0; display: flex; align-items: center; justify-content: center; gap: 7px;
}
.fine .icon { width: 14px; height: 14px; color: var(--accent-ink); }

/* ============================================================
   SCREEN 2 — RESEARCH ANIMATION
   ============================================================ */
.research-card {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-card);
  padding: 36px 34px; max-width: 520px; margin: 0 auto; overflow: hidden;
}
.research-orb {
  width: 56px; height: 56px; margin: 0 auto 22px; border-radius: 50%;
  display: grid; place-items: center; position: relative;
  background: var(--accent-wash); color: var(--accent-ink);
}
.research-orb::before {
  content: ""; position: absolute; inset: -6px; border-radius: 50%;
  border: 2px solid var(--accent); opacity: .35;
  animation: orb-pulse 1.8s var(--ease-standard) infinite;
}
@keyframes orb-pulse { 0% { transform: scale(.85); opacity: .5; } 100% { transform: scale(1.25); opacity: 0; } }
.research-orb .icon { width: 26px; height: 26px; }
.research-title {
  font-size: 22px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 4px;
  text-align: center;
}
.research-title #research-target { color: var(--accent-ink); }
.research-meta { text-align: center; color: var(--muted); font-size: 14px; margin: 0 0 24px; }

.progress-track { height: 4px; border-radius: 999px; background: var(--bg-subtle); overflow: hidden; margin-bottom: 26px; }
.progress-fill { height: 100%; width: 0%; border-radius: 999px; background: var(--accent);
  transition: width .6s var(--ease-standard); }

.steps { list-style: none; padding: 0; margin: 0; }
.step {
  display: flex; align-items: center; gap: 14px; padding: 13px 14px; border-radius: var(--radius-md);
  font-size: 15px; color: var(--muted); transition: background .3s var(--ease-standard),
  color .3s var(--ease-standard); position: relative;
}
.step + .step { margin-top: 2px; }
.step.active { color: var(--ink); background: var(--accent-wash); font-weight: 600; }
.step.done { color: var(--ink); }
.step-icon {
  width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line);
  flex: 0 0 26px; display: grid; place-items: center; color: var(--muted);
  background: var(--paper); transition: all .3s var(--ease-standard);
}
.step-icon .icon { width: 14px; height: 14px; }
.step.active .step-icon { border-color: var(--accent); color: var(--accent); }
.step.active .step-icon .spinner {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-top-color: var(--accent); animation: spin .7s linear infinite;
}
.step.done .step-icon { border-color: var(--ok); background: var(--ok); color: #fff; }
.step .step-label { flex: 1; }
.step .step-sub { font-size: 12.5px; color: var(--muted); font-weight: 400; opacity: 0;
  max-height: 0; transition: opacity .3s, max-height .3s; }
.step.active .step-sub { opacity: 1; max-height: 24px; }
@keyframes spin { to { transform: rotate(360deg); } }

.research-flavour {
  text-align: center; color: var(--accent-ink); font-size: 14px; font-weight: 600;
  margin: 22px 0 0; min-height: 20px; transition: opacity .3s;
}

/* research error / manual fallback re-uses .research-card */
.research-card textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); font: inherit; font-size: 15px; resize: vertical;
  background: var(--bg-subtle);
}
.research-card textarea:focus { outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }

/* ============================================================
   SCREEN 3 — RESULTS  (two-column)
   ============================================================ */
.results-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(400px, 1fr);
  gap: 36px;
  align-items: start;
}
.results-left { position: sticky; top: 86px; }
.results-right { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

/* ---- generic tile ---- */
.tile {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-card); padding: 24px;
}
.tile-head { margin-bottom: 14px; }
.tile .eyebrow { margin-bottom: 8px; }
.tile-title { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; margin: 0; }
.tile-sub { color: var(--muted); font-size: 14px; margin: 6px 0 0; text-wrap: pretty; }

/* ---- profile tile ---- */
#profile-summary { font-size: 16px; color: var(--ink); margin: 0 0 16px; text-wrap: pretty; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  background: var(--accent-wash); border: 1px solid var(--accent-line);
  color: var(--ink); border-radius: var(--radius-pill); padding: 6px 13px; font-size: 13px;
}
.chip b { color: var(--accent-ink); font-weight: 700; margin-right: 3px; }

/* ---- doc cards ---- */
.doc-cards { display: flex; flex-direction: column; gap: 10px; }
.doc-card {
  text-align: left; background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius-md); padding: 15px 16px; cursor: pointer;
  display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto;
  gap: 4px 12px; align-items: center;
  transition: border-color var(--dur-base) var(--ease-standard),
              box-shadow var(--dur-base) var(--ease-standard),
              transform var(--dur-fast) var(--ease-standard),
              background var(--dur-base) var(--ease-standard);
}
.doc-card:hover { border-color: var(--accent-line); transform: translateY(-1px); box-shadow: var(--shadow-hover); }
.doc-card .dc-title { font-weight: 600; font-size: 15px; grid-column: 1; }
.doc-card .dc-why { font-size: 13px; color: var(--muted); grid-column: 1; grid-row: 2; line-height: 1.5; }
.doc-card .dc-go {
  grid-column: 2; grid-row: 1 / span 2; align-self: center;
  font-size: 13px; font-weight: 600; color: var(--accent-ink);
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
}
.doc-card .dc-go .icon { width: 15px; height: 15px; }
.doc-card.active {
  border-color: var(--accent); background: var(--accent-wash);
  box-shadow: 0 0 0 1px var(--accent);
}
.doc-card.active .dc-go { color: var(--accent-ink); }
.doc-card.active .dc-go .label-gen::after { content: " · selected"; color: var(--muted); font-weight: 400; }

/* ============================================================
   DOCUMENT PREVIEW FRAME (the hero, left column)
   ============================================================ */
.doc-stage {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-card); overflow: hidden;
  display: flex; flex-direction: column;
}
.doc-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 16px; border-bottom: 1px solid var(--line); background: var(--bg-subtle);
}
.doc-file { display: flex; align-items: center; gap: 10px; min-width: 0; }
.doc-file .doc-dot { display: flex; gap: 6px; }
.doc-file .doc-dot span { width: 11px; height: 11px; border-radius: 50%; background: #D4D4D4; }
.doc-filename { font-size: 13px; color: var(--muted); font-weight: 500; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.doc-filename b { color: var(--ink); font-weight: 600; }
#doc-download {
  font-size: 13.5px; font-weight: 600; padding: 8px 16px; flex: 0 0 auto;
}
.doc-canvas {
  position: relative; background: #EEEEEC; padding: 30px;
  min-height: 660px; display: flex; align-items: flex-start; justify-content: center;
  max-height: calc(100vh - 168px); overflow-y: auto;
}
#doc-frame {
  width: 100%; max-width: 800px; height: 1040px; border: 0; border-radius: 7px;
  background: #fff; box-shadow: 0 6px 30px rgba(0,0,0,.14); display: block;
}
/* skeleton */
.doc-skeleton { width: 100%; max-width: 600px; padding: 44px 40px;
  background: #fff; border-radius: 6px; box-shadow: 0 4px 24px rgba(0,0,0,.10); }
.sk-row { height: 13px; border-radius: 5px; margin: 0 0 14px;
  background: linear-gradient(90deg,#eee 25%,#e0e0e0 37%,#eee 63%);
  background-size: 400% 100%; animation: shimmer 1.4s ease infinite; }
.sk-row.title { height: 24px; width: 55%; margin-bottom: 26px; }
.sk-row.w90 { width: 90%; } .sk-row.w80 { width: 80%; } .sk-row.w70 { width: 70%; }
.sk-row.w60 { width: 60%; } .sk-row.gap { margin-top: 30px; }
.sk-note { display: flex; align-items: center; justify-content: center; gap: 9px;
  color: var(--muted); font-size: 14px; margin-top: 30px; font-weight: 500; }
.sk-note .spinner { width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--accent) 28%, transparent);
  border-top-color: var(--accent); animation: spin .7s linear infinite; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.doc-error { padding: 50px 30px; text-align: center; color: #B91C1C; font-size: 15px; }
.doc-error .btn { margin-top: 16px; }

/* document caption under frame */
.doc-caption {
  display: flex; align-items: center; gap: 9px; padding: 13px 18px;
  border-top: 1px solid var(--line); background: var(--paper);
  color: var(--muted); font-size: 13px;
}
.doc-caption .icon { width: 16px; height: 16px; color: var(--accent-ink); }
.doc-caption b { color: var(--ink); font-weight: 600; }

/* ============================================================
   CTA tile + slide-up bar
   ============================================================ */
.cta-tile {
  background: var(--brand); color: var(--brand-fg); border: 0;
  text-align: left; overflow: hidden; position: relative;
}
.cta-tile .eyebrow { color: color-mix(in srgb, var(--brand-fg) 72%, var(--accent)); }
.cta-tile .tile-title { color: var(--brand-fg); font-size: 21px; }
.cta-lead { color: color-mix(in srgb, var(--brand-fg) 78%, transparent); font-size: 14.5px;
  margin: 10px 0 18px; text-wrap: pretty; }
#cta-btn { width: 100%; font-size: 16px; }
.cta-reassure { display: flex; align-items: center; justify-content: center; gap: 7px;
  margin: 12px 0 0; font-size: 12.5px; color: color-mix(in srgb, var(--brand-fg) 62%, transparent); }
.cta-reassure .icon { width: 14px; height: 14px; }

.cta-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 80;
  background: var(--brand); color: var(--brand-fg);
  padding: 13px clamp(18px, 4vw, 32px);
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  box-shadow: 0 -6px 28px rgba(0,0,0,.18);
  transform: translateY(110%); transition: transform .42s var(--ease-standard);
}
.cta-bar.show { transform: translateY(0); }
#cta-bar-text { display: flex; align-items: center; gap: 11px; font-size: 15px; font-weight: 500; }
#cta-bar-text .icon { width: 19px; height: 19px; color: var(--brand-fg); }
#cta-bar-text b { font-weight: 700; }
.cta-bar-actions { display: flex; align-items: center; gap: 8px; }
#cta-bar-btn { padding: 11px 20px; font-size: 15px; }

/* The two booking buttons sit ON the --brand surface (the tile + the bar), where
   --accent can be too close to --brand to read as a button. Fill them with the brand's
   readable foreground instead — white on a dark brand, dark on a light brand — so they
   always stand out, then invert again on hover for a clear press affordance. */
.cta-tile #cta-btn,
.cta-bar #cta-bar-btn {
  background: var(--brand-fg);
  color: var(--brand);
}
.cta-tile #cta-btn:hover:not(:disabled),
.cta-bar #cta-bar-btn:hover:not(:disabled) {
  background: var(--brand-fg);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
}
.cta-bar-close { background: transparent; border: 0; color: var(--brand-fg); cursor: pointer;
  opacity: .7; display: grid; place-items: center; padding: 8px; border-radius: 8px; }
.cta-bar-close:hover { opacity: 1; background: color-mix(in srgb, var(--brand-fg) 12%, transparent); }

/* ============================================================
   SCROLL CUE — bottom gradient fade + "scroll to explore"
   ============================================================ */
.scroll-cue {
  position: fixed; left: 0; right: 0; bottom: 0; height: 120px; z-index: 70;
  pointer-events: none; display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: 22px;
  background: linear-gradient(to top, var(--canvas) 14%, color-mix(in srgb, var(--canvas) 55%, transparent) 55%, transparent 100%);
  opacity: 0; visibility: hidden;
  transition: opacity .35s var(--ease-standard), visibility .35s var(--ease-standard), bottom .35s var(--ease-standard);
}
.scroll-cue.show { opacity: 1; visibility: visible; }
.scroll-cue.lifted { bottom: 64px; height: 96px; }
.cue-pill {
  pointer-events: auto; display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent); border: 1px solid transparent;
  box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 36%, transparent);
  border-radius: var(--radius-pill); padding: 10px 20px; font: inherit; font-size: 13.5px;
  font-weight: 600; color: var(--accent-fg); cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-standard), box-shadow var(--dur-base) var(--ease-standard);
}
.cue-pill:hover { transform: translateY(-1px); box-shadow: 0 8px 26px color-mix(in srgb, var(--accent) 46%, transparent); }
.cue-pill .icon { width: 16px; height: 16px; color: var(--accent-fg); animation: cue-bob 1.6s var(--ease-standard) infinite; }
@keyframes cue-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(3px); } }

/* ============================================================
   RESPONSIVE — stack: document first, then tiles
   ============================================================ */
@media (max-width: 940px) {
  .results-grid { grid-template-columns: 1fr; gap: 18px; }
  .results-left { position: static; }
  .doc-canvas { min-height: 480px; max-height: none; }
  #doc-frame { height: 760px; }
}
@media (max-width: 600px) {
  .wrap { padding-top: 36px; }
  .brand-right { display: none; }
  .cta-bar { flex-direction: column; gap: 10px; text-align: center; padding: 14px 18px; }
  .cta-bar-actions { width: 100%; }
  #cta-bar-btn { width: 100%; }
  #doc-frame { height: 600px; }
  .doc-canvas { padding: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
