/* Bob V3 metallic DotisHQ (Drive Brand folder + chat attachments Nov 3 2026). Transparent WebP/PNG used in UI. */
:root {
  /* Sampled from V3-DotisHQ-Navy-Gold-Metallic (brighter royal blue + gold) */
  --blue: #0046A4;
  --blue-deep: #002C78;
  --blue-mid: #003F9F;
  --blue-bright: #22A0F9;
  --navy: #002C78;
  --navy-mid: #0046A4;
  --gold: #C29306;
  --gold-light: #DFBD5B;
  --gold-bright: #F0D78A;
  --gold-deep: #8A6A00;
  --gold-metal: linear-gradient(135deg, #F0D78A 0%, #DFBD5B 28%, #C29306 55%, #8A6A00 100%);
  --gold-metal-soft: linear-gradient(120deg, #DFBD5B 0%, #C29306 45%, #A8861F 100%);
  --blue-metal: linear-gradient(135deg, #22A0F9 0%, #0046A4 45%, #002C78 100%);
  --ink: #0A1A36;
  --muted: #5a6270;
  --paper: #F7F5EF;
  --card: #ffffff;
  --line: #e2e0da;
  --focus: #C29306;
  --radius: 14px;
  --shadow: 0 8px 28px rgba(0, 44, 120, 0.12);
  --font: Helvetica, Arial, system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(0, 70, 164, 0.10), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(194, 147, 6, 0.10), transparent 55%),
    var(--paper);
  line-height: 1.5;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; height: auto; display: block; }

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--navy);
  color: #fff;
  padding: 0.5rem 0.75rem;
  z-index: 10;
}
.skip:focus { left: 0.5rem; top: 0.5rem; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 5;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.brand img { width: 40px; height: 40px; }
.brand-name { font-size: 1.1rem; color: var(--blue-deep); letter-spacing: 0.04em; font-style: italic; font-weight: 800; }
.brand img { object-fit: contain; background: transparent; }

.preview-badge {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gold-deep);
  border: 1px solid rgba(201, 162, 39, 0.45);
  background: rgba(201, 162, 39, 0.10);
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
}

main {
  width: min(920px, 100%);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
  flex: 1;
}

.view[hidden] { display: none !important; }
.view { animation: fade 0.25s ease; }
@keyframes fade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.hero {
  text-align: center;
  margin: 1rem 0 2rem;
}
.hero-logo {
  margin: 0 auto 1.25rem;
  width: min(320px, 78vw);
  background: #fff;
  border-radius: 16px;
  padding: 0.85rem 1rem;
  box-shadow: var(--shadow);
}
h1 {
  margin: 0 0 0.6rem;
  font-size: clamp(1.6rem, 4vw, 2.15rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.lede {
  margin: 0 auto;
  max-width: 36rem;
  color: var(--muted);
  font-size: 1.05rem;
}
.lede.narrow { max-width: 32rem; }

.doors {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 700px) {
  .doors { grid-template-columns: 1fr 1fr; gap: 1.25rem; }
}

.door {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1.35rem 1.3rem 1.2rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  font: inherit;
  color: inherit;
}
.door:hover, .door:focus-visible {
  border-color: var(--navy);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(11, 31, 58, 0.14);
  outline: none;
}
.door:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.door-kicker {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gold-deep);
}
.door-title {
  font-size: 1.25rem;
  font-weight: 700;
}
.door-copy {
  color: var(--muted);
  font-size: 0.98rem;
  flex: 1;
}
.door-cta {
  margin-top: 0.4rem;
  font-weight: 600;
  color: var(--navy);
  font-size: 0.95rem;
}

.back {
  background: none;
  border: none;
  color: var(--navy);
  font: inherit;
  font-weight: 600;
  padding: 0;
  margin: 0 0 1rem;
  cursor: pointer;
}
.back:hover, .back:focus-visible { text-decoration: underline; }

.portal-tag {
  display: inline-block;
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

.intake {
  margin-top: 1.5rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
}
.intake textarea {
  width: 100%;
  resize: vertical;
  min-height: 9rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.9rem 1rem;
  font: inherit;
  font-size: 1.05rem;
  line-height: 1.45;
  color: var(--ink);
  background: #fff;
}
.intake textarea:focus {
  outline: 2px solid var(--navy);
  outline-offset: 1px;
  border-color: var(--navy);
}
.intake-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.85rem;
}

.btn-primary {
  appearance: none;
  border: none;
  font: inherit;
  font-weight: 650;
  font-size: 1rem;
  padding: 0.7rem 1.35rem;
  border-radius: 999px;
  cursor: pointer;
  min-width: 7rem;
}
.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.thanks-card {
  text-align: center;
  margin: 2rem auto 0;
  max-width: 28rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem 1.5rem;
}
.thanks-card img { margin: 0 auto 1rem; }

.site-footer {
  padding: 1rem 1.25rem 1.5rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--line);
}
.site-footer p { margin: 0; }

@media (max-width: 480px) {
  .hero-logo { width: min(220px, 78vw); }
  .intake { padding: 0.75rem; }
  .btn-primary { width: 100%; }
  .intake-actions { justify-content: stretch; }
}


/* Metallic gold accents (subtle sheen; keep text readable) */
.brand-name {
  background: var(--gold-metal);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
h1 {
  background: var(--gold-metal);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .brand-name, h1 { color: var(--gold-deep); background: none; -webkit-text-fill-color: currentColor; }
}
.door {
  border-top: 3px solid transparent;
  border-image: var(--gold-metal-soft) 1;
  border-image-slice: 1;
  border-width: 3px 1px 1px 1px;
  border-style: solid;
  border-color: var(--line);
  border-top-color: var(--gold);
}
.door:hover, .door:focus-visible {
  border-color: var(--navy);
  border-top-color: var(--gold-light);
}
.door-title {
  background: var(--gold-metal-soft);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .door-title { color: var(--navy); background: none; -webkit-text-fill-color: currentColor; }
}
.btn-primary {
  background: var(--gold-metal);
  color: var(--navy);
  text-shadow: 0 1px 0 rgba(255,255,255,0.25);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.35), 0 2px 8px rgba(11, 31, 58, 0.18);
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-primary:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 3px;
}
.preview-badge {
  color: var(--navy) !important;
  border-color: rgba(201, 162, 39, 0.55) !important;
  background: var(--gold-metal-soft) !important;
}
.site-header {
  border-bottom: 2px solid transparent;
  border-image: linear-gradient(90deg, #0B1F3A 0%, #C9A227 50%, #0B1F3A 100%) 1;
}
.thanks-card {
  border-top: 4px solid var(--gold);
}

.form-error {
  margin: 0 0 0.75rem;
  color: #8a1f1f;
  background: #fdeeee;
  border: 1px solid #f0c2c2;
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
  font-size: 0.95rem;
}
#thanks-ref {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--blue-deep);
  letter-spacing: 0.02em;
}

.answer-card {
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin: 1rem auto;
  max-width: 36rem;
  box-shadow: var(--shadow);
}
.answer-label {
  margin: 0 0 0.45rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--blue-deep);
}
.answer-label span {
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--muted);
}
.answer-body {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.55;
  color: var(--ink);
}
.muted-note { font-size: 0.92rem; color: var(--muted); }

/* --- Chat thread --- */
.view-chat {
  display: flex;
  flex-direction: column;
  min-height: min(70vh, 720px);
  gap: 0.75rem;
}
.view-chat[hidden] { display: none !important; }
.chat-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}
.chat-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 0.15rem; }
.chat-ref {
  margin: 0;
  font-size: 0.78rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--muted);
}
.chat-ref span { color: var(--blue-deep); }
.chat-thread {
  flex: 1;
  overflow-y: auto;
  background: rgba(255,255,255,0.65);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  min-height: 280px;
  max-height: min(52vh, 520px);
  box-shadow: var(--shadow);
}
.bubble-row {
  display: flex;
  flex-direction: column;
  margin-bottom: 0.85rem;
  max-width: 92%;
}
.bubble-user { align-self: flex-end; align-items: flex-end; margin-left: auto; }
.bubble-assistant { align-self: flex-start; align-items: flex-start; }
.bubble {
  padding: 0.7rem 0.95rem;
  border-radius: 14px;
  white-space: pre-wrap;
  line-height: 1.5;
  font-size: 0.98rem;
}
.bubble-user .bubble {
  background: var(--blue-metal);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.bubble-assistant .bubble {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-bottom-left-radius: 4px;
  color: var(--ink);
}
.bubble-meta {
  margin: 0.25rem 0.35rem 0;
  font-size: 0.72rem;
  color: var(--muted);
}
.bubble a {
  color: var(--blue-metal, #1a4b7a);
  text-decoration: underline;
  word-break: break-word;
}
.bubble-sources {
  margin: 0.35rem 0.35rem 0;
  padding: 0.45rem 0.6rem;
  background: rgba(255,255,255,0.7);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.78rem;
}
.bubble-sources-title {
  margin: 0 0 0.25rem;
  font-weight: 600;
  color: var(--ink);
}
.bubble-sources ul {
  margin: 0;
  padding-left: 1.1rem;
}
.bubble-sources a {
  color: var(--blue-metal, #1a4b7a);
  word-break: break-word;
}
.chat-composer {
  position: sticky;
  bottom: 0;
  background: rgba(247, 245, 239, 0.92);
  backdrop-filter: blur(6px);
  padding: 0.5rem 0 0;
  border-top: 1px solid transparent;
}
.chat-composer textarea {
  width: 100%;
  resize: vertical;
  min-height: 3.2rem;
  max-height: 10rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  font: inherit;
  background: #fff;
}
.chat-composer textarea:focus {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}
.chat-footnote { margin: 0; font-size: 0.82rem; }
