:root {
  --bg: #14110e;
  --bg-alt: #1c1712;
  --card: #22190f;
  --border: #3a2c1a;
  --text: #f7f1e6;
  --text-muted: #c9b89e;
  --accent: #E39A2D;
  --accent-soft: #F5C566;
  --accent-2: #7052C2;
  --danger: #ff5c5c;
  --radius: 14px;
  --max-w: 1080px;
}

* { box-sizing: border-box; }

/* Kill the default mobile browser tap-highlight flash (the blue/grey
   rectangle that briefly overlays a tapped element) globally — most
   noticeable on the roster cards, right as the bio popup opens on top
   of the tapped card. */
* { -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  background:
    radial-gradient(900px 480px at 85% -10%, rgba(112, 82, 194, 0.22) 0%, transparent 60%),
    radial-gradient(1200px 600px at 15% -10%, rgba(227, 154, 45, 0.16) 0%, transparent 55%),
    var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* Coming-soon banner */
.site-banner {
  background: linear-gradient(135deg, var(--accent), var(--accent-soft));
  color: #241a08;
}

.site-banner p {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  line-height: 1.4;
}

.site-banner strong { font-weight: 800; }

/* Header */
header.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
  background: rgba(20, 17, 14, 0.8);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  max-width: var(--max-w);
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 20px;
  color: var(--text);
}

.brand img.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: block;
}

.brand .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px 2px rgba(227, 154, 45, 0.6);
}

.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-links a { color: var(--text-muted); font-weight: 600; font-size: 14px; }
.nav-links a:hover { color: var(--text); text-decoration: none; }

/* Mobile hamburger toggle (hidden on desktop) */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  cursor: pointer;
}
.nav-toggle svg {
  width: 22px;
  height: 22px;
  stroke: var(--text);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}
.nav-toggle .icon-close { display: none; }
.nav-toggle.open .icon-open { display: none; }
.nav-toggle.open .icon-close { display: block; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  min-height: 44px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-soft));
  color: #241a08;
}
.btn.btn-primary:hover { text-decoration: none; filter: brightness(1.05); }

.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-outline:hover { text-decoration: none; border-color: var(--accent); }

/* Hero */
.hero {
  /* Longhand on purpose — this must never touch padding-left/right, or it
     will collide with .container's side padding (both classes are on the
     same <section class="hero container">) and zero out the side gutter. */
  padding-top: 80px;
  display: block;
}

.hero-copy {
  text-align: center;
  max-width: 780px;
  margin: 0 auto;
}

.hero .eyebrow {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(112, 82, 194, 0.18);
  color: #cabdf5;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(32px, 4.6vw, 50px);
  margin: 0 0 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.hero p.lead {
  max-width: 620px;
  margin: 0 auto 36px;
  color: var(--text-muted);
  font-size: 18px;
}

.cta-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.store-badge img { height: 62px; display: block; }

/* Hero character lineup */
.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  margin-top: 24px;
  min-height: 420px;
}

.hero-visual .glow {
  position: absolute;
  bottom: 0;
  width: min(760px, 92%);
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(227, 154, 45, 0.30) 0%, transparent 70%);
  filter: blur(14px);
  z-index: 0;
}

/* All four cast members render at full brightness/saturation — no dimmed
   "background" characters. Slight negative margins overlap them into a single
   group shot, and the featured character is a touch taller and stacked on top. */
.hero-visual .char {
  position: relative;
  z-index: 1;
  height: clamp(245px, 30vw, 375px);
  width: auto;
  margin: 0 -22px;
  filter: drop-shadow(0 18px 26px rgba(0, 0, 0, 0.45));
}

.hero-visual .char.char-featured {
  height: clamp(300px, 35.5vw, 455px);
  z-index: 2;
  filter: drop-shadow(0 22px 32px rgba(0, 0, 0, 0.5));
}

/* Sections */
/* Longhand on purpose — see .hero comment above; avoids zeroing out
   .container's side padding on <section class="section container">. */
.section { padding-top: 64px; padding-bottom: 64px; }

.section h2 {
  font-size: 30px;
  margin: 0 0 8px;
  font-weight: 800;
  text-align: center;
}
.section .subhead {
  text-align: center;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 40px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
}

.card .icon {
  width: 52px;
  height: 52px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background:
    linear-gradient(155deg, rgba(227, 154, 45, 0.22), rgba(112, 82, 194, 0.16)),
    var(--bg-alt);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.card .icon svg {
  width: 26px;
  height: 26px;
  stroke: var(--accent-soft);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card h3 { margin: 0 0 8px; font-size: 18px; }
.card p { margin: 0; color: var(--text-muted); font-size: 14.5px; }

/* Character roster */
.roster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 18px;
}

.roster-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 12px 16px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
  /* Prevent the default mobile browser blue/grey tap-highlight rectangle
     from flashing over the card right as the bio popup opens on top of it. */
  -webkit-tap-highlight-color: transparent;
}

.roster-card:hover,
.roster-card:focus-visible {
  transform: translateY(-4px);
  border-color: var(--accent);
}

.roster-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.roster-card img {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border);
  margin-bottom: 10px;
  background: var(--bg-alt);
}

.roster-card:hover img { border-color: var(--accent); }

.roster-card .name { font-weight: 700; font-size: 14.5px; }
.roster-card .role { color: var(--text-muted); font-size: 12.5px; margin-top: 2px; }

/* Footer */
footer.site-footer {
  border-top: 1px solid var(--border);
  /* Longhand — see .hero comment; footer also carries the .container class. */
  padding-top: 40px;
  padding-bottom: 40px;
  margin-top: 40px;
}

.footer-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: space-between;
  align-items: center;
}

.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a { color: var(--text-muted); font-size: 14px; }
.footer-note { color: #8a7a5f; font-size: 13px; margin-top: 16px; }

/* Legal pages */
/* Longhand — see .hero comment; <main class="legal container"> would
   otherwise lose its side padding to this rule's shorthand. */
.legal {
  padding-top: 56px;
  padding-bottom: 100px;
}

.legal h1 {
  font-size: 36px;
  margin-bottom: 4px;
}

.legal .updated {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 36px;
}

.legal h2 {
  font-size: 22px;
  margin-top: 42px;
  margin-bottom: 12px;
  color: var(--accent);
}

.legal h3 {
  font-size: 17px;
  margin-top: 24px;
  margin-bottom: 8px;
}

.legal p, .legal li { color: #e2d8c6; font-size: 15.5px; }
.legal ul { padding-left: 20px; }
.legal table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14.5px;
}
.legal th, .legal td {
  text-align: left;
  padding: 10px 12px;
  border: 1px solid var(--border);
}
.legal th { background: var(--bg-alt); color: var(--text); }
.legal td { color: var(--text-muted); }

.callout {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent-2);
  border-radius: 10px;
  padding: 16px 20px;
  margin: 20px 0;
  font-size: 14.5px;
  color: var(--text-muted);
}

.callout.danger { border-left-color: var(--danger); }

/* Deletion form */
.form-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 640px;
  margin: 32px auto 0;
}

.form-card label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin: 18px 0 6px;
}

.form-card input,
.form-card select,
.form-card textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text);
  font-size: 14.5px;
  font-family: inherit;
}

.form-card textarea { resize: vertical; min-height: 100px; }

.form-card .hint { color: var(--text-muted); font-size: 13px; margin-top: 4px; }

.form-card button.btn { margin-top: 24px; width: 100%; justify-content: center; }

.steps { counter-reset: step; list-style: none; padding: 0; }
.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 44px;
  margin-bottom: 18px;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0; top: 0;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: #241a08;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

@media (max-width: 860px) {
  .hero { padding-top: 56px; }
  .hero-visual { min-height: 285px; margin-top: 12px; }
  .hero-visual .char { margin: 0 -16px; }
}

/* Collapse the header nav into a hamburger dropdown once links start
   crowding the row (tablets and phones alike). */
@media (max-width: 780px) {
  .nav { position: relative; }
  .nav-toggle { display: flex; }

  .nav-links {
    display: none;
    position: absolute;
    top: calc(100% + 1px);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 14px 14px;
    padding: 8px 20px 18px;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.35);
    z-index: 30;
  }
  .nav-links.open { display: flex; }
  .nav-links a:not(.btn) {
    padding: 13px 2px;
    border-bottom: 1px solid var(--border);
    font-size: 15.5px;
  }
  .nav-links a.btn {
    margin-top: 14px;
    justify-content: center;
  }
}

/* --------------------------------------------------------------------
   Phone layout (<=640px). Rather than just shrinking the desktop grid,
   this gives several sections a distinct mobile-appropriate layout:
   generous edge padding, a compact two-character hero duo sized to fit
   comfortably within the screen (not hidden, not overflowing), and a
   swipeable horizontal carousel for the companion roster instead of a
   squeezed multi-column grid.
   -------------------------------------------------------------------- */
@media (max-width: 640px) {
  /* Keep generous breathing room off the screen edges — this should
     feel like it has MORE space than desktop, not less. */
  .container { padding: 0 26px; }

  /* Hero: simplify spacing between the eyebrow/headline/lead/CTA so it
     doesn't feel packed, and give the character art its own row. */
  .hero { padding-top: 36px; }
  .hero .eyebrow { margin-bottom: 18px; }
  .hero h1 { font-size: clamp(28px, 7.5vw, 38px); margin-bottom: 16px; }
  .hero p.lead { font-size: 16px; line-height: 1.65; margin-bottom: 30px; padding: 0 4px; }
  .cta-row { gap: 14px; }
  .store-badge img { height: 52px; }

  /* Two-character hero duo (e.g. Beau + Honey), sized with vw so
     the pair always fits inside the padded container instead of
     bleeding past the screen edges. */
  .hero-visual {
    min-height: 225px;
    margin-top: 20px;
    gap: 0;
  }
  .hero-visual .char.hide-sm { display: none; }
  .hero-visual .char {
    height: clamp(168px, 40vw, 235px);
    margin: 0 -8px;
  }
  .hero-visual .char.char-featured {
    height: clamp(200px, 47vw, 280px);
  }

  /* Feature cards: full-width single column with generous padding
     instead of a cramped two-up grid. */
  .grid { grid-template-columns: 1fr; gap: 16px; }
  .card { padding: 24px 22px; }

  .section { padding-top: 52px; padding-bottom: 52px; }
  .section .subhead { margin-bottom: 28px; padding: 0 4px; }

  /* Companion roster: horizontal swipeable carousel, bleeding to the
     screen edges so it reads as a distinct "scroll me" strip rather
     than a squeezed grid. */
  .roster-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 14px;
    margin: 0 -26px;
    padding: 4px 26px 14px;
    -webkit-overflow-scrolling: touch;
  }
  .roster-grid::-webkit-scrollbar { height: 5px; }
  .roster-grid::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
  .roster-card {
    flex: 0 0 140px;
    scroll-snap-align: start;
    padding: 20px 12px 18px;
  }

  .form-card { padding: 26px 22px; }

  .footer-grid { flex-direction: column; align-items: flex-start; gap: 18px; }
}

@media (max-width: 400px) {
  /* Very narrow phones — trim the character duo a touch further rather
     than dropping one, so both stay visible and proportioned. */
  .hero-visual { min-height: 195px; }
  .hero-visual .char { height: clamp(145px, 38vw, 185px); margin: 0 -6px; }
  .hero-visual .char.char-featured { height: clamp(173px, 45vw, 220px); }
}



/* Scrollable wrapper for wide data tables (Privacy Policy provider table)
   so they don't force horizontal page scroll on phones. */
.legal .table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 16px 0;
  border-radius: 10px;
}
.legal .table-scroll table { margin: 0; min-width: 620px; }

@media (max-width: 640px) {
  .legal { padding-top: 40px; padding-bottom: 72px; }
  .legal h1 { font-size: 28px; }
  .legal h2 { font-size: 19px; margin-top: 34px; }
  .legal h3 { font-size: 16px; }
  .legal p, .legal li { font-size: 15px; line-height: 1.7; }
  .legal ul { padding-left: 18px; }
  .callout { padding: 16px 18px; }
  .form-card { max-width: 100%; }
  .steps li { padding-left: 40px; margin-bottom: 22px; }
}


/* Companion detail modal */
body.modal-open { overflow: hidden; }

.companion-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(10, 8, 6, 0.78);
  backdrop-filter: blur(4px);
  padding: 24px;
  overflow-y: auto;
  align-items: flex-start;
  justify-content: center;
}

.companion-modal-overlay.open { display: flex; }

.companion-modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  max-width: 720px;
  width: 100%;
  margin: 32px 0;
  display: grid;
  grid-template-columns: 260px 1fr;
  overflow: hidden;
  position: relative;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}

.companion-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(20, 17, 14, 0.6);
  color: var(--text);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.companion-modal-close:hover { background: rgba(20, 17, 14, 0.85); }

.companion-modal-media {
  background: linear-gradient(180deg, rgba(227, 154, 45, 0.12), transparent 60%), var(--bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 260px;
}

.companion-modal-img {
  width: 100%;
  height: 100%;
  max-height: 480px;
  object-fit: contain;
  object-position: center;
  display: block;
  /* Hidden until the new character's image has actually finished loading
     (see companions.js) so the previously-viewed character's art doesn't
     linger on screen while the next one downloads. */
  opacity: 0;
  transition: opacity 0.2s ease;
}

.companion-modal-img.is-loaded {
  opacity: 1;
}

.companion-modal-img.is-avatar-fallback {
  object-fit: contain;
  padding: 32px;
  max-height: 320px;
}

.companion-modal-body {
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.companion-modal-name {
  font-size: 26px;
  font-weight: 800;
  margin: 0;
}

.companion-modal-role {
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.02em;
  margin-bottom: 16px;
}

.companion-modal-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 14px 0 6px;
}

.companion-modal-backstory {
  color: #e2d8c6;
  font-size: 15px;
  line-height: 1.6;
  margin: 0;
}

.companion-modal-intro {
  background: var(--bg-alt);
  border-left: 3px solid var(--accent-2);
  border-radius: 8px;
  padding: 14px 16px;
  margin: 0;
  font-size: 14.5px;
  font-style: italic;
  color: var(--text-muted);
  line-height: 1.6;
}

@media (max-width: 640px) {
  .companion-modal-overlay { padding: 16px; }
  .companion-modal {
    grid-template-columns: 1fr;
  }
  .companion-modal-media { min-height: 200px; }
  .companion-modal-img { max-height: 320px; }
  .companion-modal-body { padding: 24px 20px 28px; }
}


