/* Bar Ellington — Option A "Immersive Worlds"
   Theme tokens mirror core/themes.ts exactly (bg, bg2, card, card2, line,
   brass, brassDim, ink, dim, green, on, soft, accent, accentSoft, oxblood). */

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

/* ---------- Theme token sets ---------- */

[data-theme="gatsby"] {
  color-scheme: dark;
  --bg: #0A0A0B; --bg2: #121214; --card: #141416; --card2: #1C1B18;
  --line: #4A3D22; --brass: #D6B25E; --brass-dim: #8C7640;
  --oxblood: #6E2430; --ink: #F7F0DE; --dim: #A79A80; --green: #176052;
  --on: #171310; --soft: rgba(214,178,94,.14); --green-soft: rgba(23,96,82,.22);
  --accent: #176052; --accent-soft: rgba(23,96,82,.16);
  --font-display: "Poiret One", sans-serif;
  --font-body: "Manrope", sans-serif;
  --display-track: .09em;
}

[data-theme="interstellar"] {
  color-scheme: dark;
  --bg: #050812; --bg2: #0A0F1C; --card: #0D1320; --card2: #121A2B;
  --line: #1E2740; --brass: #55E6FF; --brass-dim: #4A7580;
  --oxblood: #FF6B4A; --ink: #EFF8FF; --dim: #8CA0B8; --green: #5FD9A0;
  --on: #04141A; --soft: rgba(85,230,255,.10); --green-soft: rgba(95,217,160,.14);
  --accent: #E8B15A; --accent-soft: rgba(232,177,90,.14);
  --font-display: "Michroma", sans-serif;
  --font-body: "IBM Plex Sans", sans-serif;
  --display-track: .14em;
}

[data-theme="canvas"] {
  color-scheme: light;
  --bg: #F3EBDD; --bg2: #EDE3D0; --card: #FAF5EA; --card2: #F1E8D6;
  --line: #DDD0B8; --brass: #233B36; --brass-dim: #5C7A72;
  --oxblood: #C24E32; --ink: #25201C; --dim: #7A6F5F; --green: #3C6355;
  --on: #F3EBDD; --soft: rgba(35,59,54,.08); --green-soft: rgba(60,99,85,.14);
  --accent: #C24E32; --accent-soft: rgba(194,78,50,.12);
  --font-display: "Playfair Display", serif;
  --font-body: "Source Sans 3", sans-serif;
  --display-track: 0em;
}

[data-theme="tiki"] {
  color-scheme: dark;
  --bg: #19231E; --bg2: #202B24; --card: #22302A; --card2: #2A3B32;
  --line: #3C5045; --brass: #F0A23A; --brass-dim: #A97A3D;
  --oxblood: #B4432E; --ink: #FFF3D1; --dim: #B8AC8E; --green: #2BA7A1;
  --on: #1D1509; --soft: rgba(240,162,58,.14); --green-soft: rgba(43,167,161,.18);
  --accent: #2BA7A1; --accent-soft: rgba(43,167,161,.14);
  --font-display: "Barrio", cursive;
  --font-body: "Atkinson Hyperlegible", sans-serif;
  --display-track: .02em;
}

/* ---------- Base ---------- */

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  transition: background-color .45s ease, color .45s ease;
}

h1, h2, h3 {
  font-family: var(--font-display);
  letter-spacing: var(--display-track);
  font-weight: 600;
  line-height: 1.15;
  color: var(--ink);
}

.narrow { max-width: 680px; margin: 0 auto; padding: 0 24px; text-align: center; }

.eyebrow {
  color: var(--brass-dim);
  font-size: 12px;
  letter-spacing: .14em;
  margin-bottom: 14px;
}

.lede { color: var(--dim); font-size: 17px; margin-top: 16px; }

section h2 { font-size: clamp(26px, 4vw, 40px); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- CTA ---------- */

.cta {
  display: inline-block;
  background: var(--brass);
  color: var(--on);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  border: none;
  border-radius: 999px;
  padding: 14px 34px;
  letter-spacing: .04em;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .3s ease, background-color .45s ease;
}
.cta:hover { transform: translateY(-1px); box-shadow: 0 6px 24px var(--soft); }
.cta.small { padding: 9px 20px; font-size: 13.5px; }

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 20px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  transition: background-color .45s ease, border-color .45s ease;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
}

.brand-logo {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  display: none;
}
.brand-logo-primary { display: block; }
[data-theme="canvas"] .brand-logo-primary { display: none; }
[data-theme="canvas"] .brand-logo-dark { display: block; }

.wordmark {
  font-family: var(--font-display);
  letter-spacing: var(--display-track);
  color: var(--brass);
  text-decoration: none;
  font-size: 17px;
  white-space: nowrap;
}

.switcher {
  display: flex;
  gap: 6px;
  margin-left: auto;
  overflow-x: auto;
  scrollbar-width: none;
}
.switcher::-webkit-scrollbar { display: none; }

.theme-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: transparent;
  color: var(--dim);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 12.5px;
  padding: 6px 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: color .3s ease, border-color .3s ease, background-color .3s ease;
}
.theme-btn:hover { color: var(--ink); border-color: var(--brass-dim); }
.theme-btn[aria-pressed="true"] {
  background: var(--soft);
  border-color: var(--brass);
  color: var(--ink);
}

.dots { display: inline-flex; gap: 3px; }
.dots i {
  width: 9px; height: 9px; border-radius: 50%;
  border: 1px solid rgba(128,128,128,.45);
}

.topbar .cta.small { flex-shrink: 0; }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: calc(100vh - 62px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  text-align: center;
}

.hero-scene, .hero-scene .motif { position: absolute; inset: 0; }
.hero-scene .motif {
  opacity: 0;
  transition: opacity .6s ease;
  pointer-events: none;
}

/* Gatsby: deco sunburst rays + gold glow + hairline frame */
.motif-rays {
  background:
    repeating-conic-gradient(from -90deg at 50% 118%,
      rgba(214,178,94,.07) 0deg 1.2deg, transparent 1.2deg 7deg);
}
.motif-frame { inset: 18px; border: 1px solid rgba(214,178,94,.28); }
.motif-frame::after {
  content: ""; position: absolute; inset: 5px;
  border: 1px solid rgba(214,178,94,.14);
}
[data-theme="gatsby"] .motif-rays,
[data-theme="gatsby"] .motif-frame { opacity: 1; }
[data-theme="gatsby"] .motif-glow {
  opacity: 1;
  background: radial-gradient(58% 44% at 50% 106%, rgba(214,178,94,.20), transparent 70%);
}

/* Interstellar: starfield + horizon grid + restrained amber giant */
.motif-stars {
  background-image:
    radial-gradient(1px 1px at 22px 34px, rgba(239,248,255,.85) 50%, transparent 51%),
    radial-gradient(1px 1px at 121px 92px, rgba(239,248,255,.55) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 190px 41px, rgba(85,230,255,.6) 50%, transparent 51%),
    radial-gradient(1px 1px at 74px 158px, rgba(239,248,255,.4) 50%, transparent 51%),
    radial-gradient(1px 1px at 233px 187px, rgba(239,248,255,.7) 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 160px 226px, rgba(232,177,90,.55) 50%, transparent 51%);
  background-size: 260px 260px;
}
.motif-grid {
  background:
    repeating-linear-gradient(90deg, rgba(85,230,255,.09) 0 1px, transparent 1px 72px),
    repeating-linear-gradient(0deg, rgba(85,230,255,.07) 0 1px, transparent 1px 56px);
  -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,.9), transparent 46%);
  mask-image: linear-gradient(to top, rgba(0,0,0,.9), transparent 46%);
}
[data-theme="interstellar"] .motif-stars,
[data-theme="interstellar"] .motif-grid { opacity: 1; }
[data-theme="interstellar"] .motif-glow {
  opacity: 1;
  background:
    radial-gradient(30% 24% at 79% 24%, rgba(232,177,90,.30), rgba(232,177,90,.07) 55%, transparent 75%);
}

/* Canvas: soft washes of studio light */
[data-theme="canvas"] .motif-glow {
  opacity: 1;
  background:
    radial-gradient(42% 36% at 82% 14%, rgba(194,78,50,.10), transparent 70%),
    radial-gradient(48% 40% at 12% 92%, rgba(60,99,85,.12), transparent 70%),
    radial-gradient(30% 24% at 30% 20%, rgba(35,59,54,.06), transparent 70%);
}
[data-theme="canvas"] .motif-rays {
  opacity: 1;
  background: repeating-linear-gradient(0deg, rgba(37,32,28,.025) 0 1px, transparent 1px 9px);
}

/* Tiki: torch glow below, lagoon light above, tapa stripes */
[data-theme="tiki"] .motif-glow {
  opacity: 1;
  background:
    radial-gradient(64% 46% at 50% 108%, rgba(240,162,58,.30), transparent 72%),
    radial-gradient(46% 32% at 82% 0%, rgba(43,167,161,.14), transparent 70%);
}
[data-theme="tiki"] .motif-rays {
  opacity: 1;
  background:
    repeating-linear-gradient(135deg, rgba(240,162,58,.05) 0 2px, transparent 2px 26px),
    repeating-linear-gradient(45deg, rgba(43,167,161,.045) 0 2px, transparent 2px 26px);
}

.hero-inner {
  /* "Bar Ellington" line's size — the community headline is locked to
     exactly double this via calc(), so the 2:1 ratio holds at every
     viewport width, not just at the desktop/mobile checkpoints. */
  --be-size: clamp(26px, 5.6vw, 58px);
  position: relative;
  z-index: 1;
  padding: 96px 24px;
  max-width: 960px;
}

.hero-welcome {
  font-family: var(--font-body);
  letter-spacing: .16em;
  font-size: clamp(11px, 1.1vw, 13px);
  color: var(--brass-dim);
  margin-bottom: 16px;
}

.hero-mark {
  font-family: var(--font-display);
  letter-spacing: var(--display-track);
  font-size: var(--be-size);
  line-height: 1.15;
  color: var(--brass);
  margin-bottom: 10px;
}

.hero-subtitle {
  font-family: var(--font-display);
  letter-spacing: var(--display-track);
  font-size: clamp(13px, 1.6vw, 17px);
  color: var(--dim);
  margin-bottom: 28px;
}

.hero-headline {
  font-family: var(--font-display);
  letter-spacing: var(--display-track);
  font-size: calc(var(--be-size) * 2);
  line-height: 1.05;
  color: var(--ink);
  max-width: 100%;
  margin: 0 auto 26px;
  overflow-wrap: break-word;
  word-break: break-word;
}

/* Michroma's glyphs run much wider than the other three display faces —
   without a smaller base size the community line (2x this) overruns the
   viewport, so interstellar gets its own --be-size and a roomier container. */
[data-theme="interstellar"] .hero-inner {
  --be-size: clamp(17px, 3.6vw, 34px);
  max-width: 1160px;
}

.support {
  font-family: var(--font-display);
  letter-spacing: var(--display-track);
  font-size: clamp(15px, 2vw, 19px);
  color: var(--accent);
  margin-bottom: 30px;
}

.hero-cta-row {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.be-echo {
  font-family: var(--font-display);
  letter-spacing: .08em;
  font-size: 13px;
  color: var(--brass-dim);
  opacity: .85;
}

.hero-qr {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 36px;
  text-decoration: none;
}
.hero-qr img {
  width: 92px;
  height: 92px;
  border-radius: 10px;
  background: #fff;
  padding: 6px;
  display: block;
  transition: transform .15s ease;
}
.hero-qr:hover img { transform: translateY(-2px); }
.hero-qr-caption {
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: .02em;
  color: var(--brass-dim);
}

/* ---------- About ---------- */

.about { padding: 110px 0; background: var(--bg2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); transition: background-color .45s ease, border-color .45s ease; }

/* ---------- Our Story ---------- */

.story { padding: 110px 0; }

.story-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  max-width: 780px;
  margin: 50px auto 0;
  padding: 0 24px;
  text-align: center;
}
@media (max-width: 700px) { .story-grid { grid-template-columns: 1fr; gap: 40px; } }

.story-frame { margin: 0; }

.story-placeholder {
  aspect-ratio: 4 / 3;
  border: 1.5px dashed var(--line);
  border-radius: 16px;
  background: var(--card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background-color .45s ease, border-color .45s ease;
}
.story-placeholder-icon { font-size: 30px; opacity: .55; }
.story-placeholder-label {
  font-family: var(--font-body);
  font-size: 12.5px;
  letter-spacing: .04em;
  color: var(--dim);
}

.story-frame figcaption {
  margin-top: 16px;
  font-size: 14px;
  color: var(--dim);
  line-height: 1.6;
}

/* ---------- Worlds ---------- */

.worlds { padding-top: 110px; }
.worlds-head { margin-bottom: 70px; }

.world {
  position: relative;
  min-height: 68vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  text-align: center;
  padding: 90px 24px;
}
.world-motif { position: absolute; inset: 0; pointer-events: none; }
.world-inner { position: relative; z-index: 1; max-width: 640px; }

.world-kicker {
  font-size: 12px;
  letter-spacing: .18em;
  margin-bottom: 14px;
}
.world-title { font-size: clamp(30px, 5vw, 52px); margin-bottom: 20px; font-weight: 600; }
.world-story { font-size: clamp(15.5px, 2vw, 18px); line-height: 1.75; }

.world-swatches { display: inline-flex; gap: 8px; margin-top: 30px; }
.world-swatches i {
  width: 14px; height: 14px; border-radius: 50%;
  border: 1px solid rgba(128,128,128,.5);
}

/* Each world panel is a fixed preview of its own theme, whatever is active. */

.world-gatsby { background: #0A0A0B; }
.world-gatsby .world-motif {
  background:
    repeating-conic-gradient(from -90deg at 50% 125%, rgba(214,178,94,.08) 0deg 1.2deg, transparent 1.2deg 8deg),
    radial-gradient(56% 42% at 50% 108%, rgba(214,178,94,.22), transparent 70%);
  border-top: 1px solid #4A3D22;
}
.world-gatsby .world-kicker { color: #8C7640; }
.world-gatsby .world-title {
  font-family: "Poiret One", sans-serif; letter-spacing: .09em; color: #D6B25E;
}
.world-gatsby .world-story { font-family: "Manrope", sans-serif; color: #F7F0DE; }

.world-interstellar { background: #050812; }
.world-interstellar .world-motif {
  background:
    radial-gradient(1px 1px at 40px 60px, rgba(239,248,255,.8) 50%, transparent 51%),
    radial-gradient(1px 1px at 150px 130px, rgba(239,248,255,.5) 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 220px 50px, rgba(85,230,255,.6) 50%, transparent 51%),
    radial-gradient(1px 1px at 90px 210px, rgba(239,248,255,.45) 50%, transparent 51%),
    radial-gradient(28% 22% at 80% 20%, rgba(232,177,90,.28), rgba(232,177,90,.06) 55%, transparent 75%),
    repeating-linear-gradient(90deg, rgba(85,230,255,.07) 0 1px, transparent 1px 76px);
  background-size: 270px 270px, 270px 270px, 270px 270px, 270px 270px, auto, auto;
  border-top: 1px solid #1E2740;
}
.world-interstellar .world-kicker { color: #4A7580; }
.world-interstellar .world-title { font-family: "Michroma", sans-serif; letter-spacing: .14em; color: #55E6FF; }
.world-interstellar .world-story { font-family: "IBM Plex Sans", sans-serif; color: #EFF8FF; }

.world-canvas { background: #F3EBDD; }
.world-canvas .world-motif {
  background:
    radial-gradient(40% 34% at 84% 10%, rgba(194,78,50,.10), transparent 70%),
    radial-gradient(44% 38% at 10% 94%, rgba(60,99,85,.12), transparent 70%);
  border-top: 1px solid #DDD0B8;
}
.world-canvas .world-kicker { color: #5C7A72; }
.world-canvas .world-title { font-family: "Playfair Display", serif; color: #233B36; }
.world-canvas .world-story { font-family: "Source Sans 3", sans-serif; color: #25201C; }

.world-tiki { background: #19231E; }
.world-tiki .world-motif {
  background:
    repeating-linear-gradient(135deg, rgba(240,162,58,.055) 0 2px, transparent 2px 24px),
    radial-gradient(62% 44% at 50% 110%, rgba(240,162,58,.30), transparent 72%),
    radial-gradient(40% 28% at 85% 0%, rgba(43,167,161,.14), transparent 70%);
  border-top: 1px solid #3C5045;
}
.world-tiki .world-kicker { color: #A97A3D; }
.world-tiki .world-title { font-family: "Barrio", cursive; color: #F0A23A; }
.world-tiki .world-story { font-family: "Atkinson Hyperlegible", sans-serif; color: #FFF3D1; }

/* ---------- How it works ---------- */

.how { padding: 110px 0; background: var(--bg2); border-top: 1px solid var(--line); transition: background-color .45s ease, border-color .45s ease; }

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  max-width: 980px;
  margin: 56px auto 0;
  padding: 0 24px;
}
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }

.step {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 34px 26px;
  text-align: center;
  transition: background-color .45s ease, border-color .45s ease;
}
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--soft);
  border: 1px solid var(--brass);
  color: var(--brass);
  font-family: var(--font-display);
  font-size: 19px;
  margin-bottom: 18px;
}
.step h3 { font-size: 19px; margin-bottom: 10px; }
.step p { color: var(--dim); font-size: 14.5px; }

/* ---------- Scan Here ---------- */

.scan {
  padding: 110px 0;
  background: var(--bg2);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transition: background-color .45s ease, border-color .45s ease;
}

.scan-card {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-top: 40px;
  padding: 28px 34px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  text-decoration: none;
  cursor: pointer;
  transition: border-color .3s ease, transform .15s ease, background-color .45s ease;
}
.scan-card:hover { border-color: var(--brass); transform: translateY(-2px); }

.scan-qr {
  display: block;
  width: 200px;
  height: 200px;
  border-radius: 12px;
  background: #fff;
  padding: 10px;
}

.scan-tap {
  font-family: var(--font-body);
  font-size: 13px;
  letter-spacing: .02em;
  color: var(--brass-dim);
}

/* ---------- Join ---------- */

.join { padding: 110px 0 120px; border-top: 1px solid var(--line); transition: border-color .45s ease; }

.join-form {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 34px;
  flex-wrap: wrap;
}
.join-form input {
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  border-radius: 999px;
  padding: 13px 22px;
  width: min(340px, 100%);
  outline: none;
  transition: border-color .3s ease, background-color .45s ease;
}
.join-form input::placeholder { color: var(--dim); }
.join-form input:focus { border-color: var(--brass); }
.join-form .cta:disabled { opacity: .6; cursor: default; transform: none; box-shadow: none; }

.hp-field {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.join-thanks {
  margin-top: 30px;
  color: var(--green);
  font-weight: 600;
  font-size: 16px;
}

.join-error {
  margin-top: 30px;
  color: var(--oxblood);
  font-weight: 600;
  font-size: 16px;
}

/* ---------- Footer ---------- */

.footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  padding: 34px 24px 26px;
  border-top: 1px solid var(--line);
  background: var(--bg2);
  transition: background-color .45s ease, border-color .45s ease;
}

.footer-qr {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.footer-qr img {
  width: 76px;
  height: 76px;
  border-radius: 9px;
  background: #fff;
  padding: 5px;
  display: block;
}
.footer-qr-caption {
  font-family: var(--font-body);
  font-size: 11.5px;
  letter-spacing: .02em;
  color: var(--brass-dim);
}

.foot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  width: 100%;
  max-width: 640px;
}
.foot-mark { color: var(--dim); font-size: 14px; }
.footer a { color: var(--brass); text-decoration: none; font-size: 14px; font-weight: 600; }
.footer a:hover { text-decoration: underline; }

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

@media (max-width: 700px) {
  .topbar { flex-wrap: wrap; }
  .topbar .cta.small { order: 2; margin-left: auto; }
  .brand { order: 1; }
  .switcher { order: 3; width: 100%; margin-left: 0; }
  .hero { min-height: 86vh; }
  .motif-frame { inset: 10px; }
  .world { min-height: 60vh; padding: 70px 20px; }
}
