:root {
  color-scheme: dark;
  --ink: #061015;
  --ink-deep: #02070b;
  --ivory: #e9e4d6;
  --ivory-dim: #a8aa9f;
  --copper: #c78e55;
  --copper-bright: #e1b67b;
  --verdigris: #4ca99a;
  --focus: #8bd8ca;
}

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  min-height: 100%;
  overflow: hidden;
  background: var(--ink-deep);
  color: var(--ivory);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

button,
select { font: inherit; }

button,
a,
select { -webkit-tap-highlight-color: transparent; }

#app {
  position: relative;
  width: 100vw;
  height: 100svh;
  min-height: 600px;
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(circle at 70% 38%, rgba(33, 89, 91, .16), transparent 38%),
    linear-gradient(160deg, #0b2024, #02070b 62%);
}

#world {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}

#world.is-dragging { cursor: grabbing; }
#world:focus-visible { outline: 1px solid rgba(139, 216, 202, .48); outline-offset: -3px; }

.grade,
.grain {
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
}

.grade {
  background:
    radial-gradient(ellipse at 67% 42%, transparent 12%, rgba(2, 8, 11, .05) 44%, rgba(1, 5, 8, .7) 100%),
    linear-gradient(90deg, rgba(2, 7, 10, .93) 0%, rgba(3, 9, 12, .66) 23%, transparent 48%),
    linear-gradient(0deg, rgba(1, 5, 8, .76), transparent 26%);
  box-shadow: inset 0 0 16vw rgba(0, 0, 0, .72);
}

.grain {
  opacity: .06;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
}

.topbar {
  position: absolute;
  z-index: 3;
  inset: 0 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: clamp(22px, 3vw, 42px) clamp(24px, 3.5vw, 56px);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: rgba(233, 228, 214, .52);
  text-decoration: none;
  transition: color .25s ease;
}

.back b { color: rgba(199, 142, 85, .72); font-weight: 500; }
.back:hover { color: var(--ivory); }

.back-mark {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border: 1px solid rgba(76, 169, 154, .38);
  color: var(--verdigris);
  font: 500 12px/1 Cinzel, serif;
  transform: rotate(45deg);
}

.back-mark::first-letter { transform: rotate(-45deg); }

.world-state {
  display: flex;
  align-items: center;
  gap: 11px;
  color: rgba(233, 228, 214, .38);
}

.world-state i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--verdigris);
  box-shadow: 0 0 11px rgba(76, 169, 154, .9);
}

.view-switch {
  position: absolute;
  z-index: 4;
  top: clamp(22px, 3vw, 42px);
  left: 50%;
  display: flex;
  align-items: center;
  gap: 3px;
  transform: translateX(-50%);
  padding: 3px;
  border: 1px solid rgba(199, 142, 85, .16);
  background: rgba(4, 13, 16, .46);
  backdrop-filter: blur(12px);
}

.view-label {
  padding: 0 8px;
  color: rgba(233, 228, 214, .28);
  font-size: 7px;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.view-switch button {
  display: flex;
  min-height: 27px;
  align-items: center;
  gap: 7px;
  border: 0;
  background: transparent;
  padding: 0 10px;
  color: rgba(233, 228, 214, .38);
  font-size: 7px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color .25s ease, background .25s ease;
}

.view-switch button i {
  width: 4px;
  height: 4px;
  border: 1px solid currentColor;
  transform: rotate(45deg);
}

.view-switch button:hover,
.view-switch button:focus-visible {
  color: var(--ivory);
}

.view-switch button:focus-visible {
  outline: 1px solid var(--focus);
  outline-offset: 1px;
}

.view-switch button[aria-pressed="true"] {
  background: rgba(46, 91, 81, .32);
  color: var(--copper-bright);
}

.view-switch button[aria-pressed="true"] i {
  border-color: var(--verdigris);
  background: rgba(76, 169, 154, .32);
  box-shadow: 0 0 8px rgba(76, 169, 154, .5);
}

.hero-copy {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: clamp(38px, 6.4vw, 110px);
  width: min(490px, 39vw);
  transform: translateY(-46%);
  text-shadow: 0 3px 24px rgba(0, 0, 0, .86);
}

.sigil {
  position: absolute;
  top: -12px;
  left: -64px;
  width: 42px;
  color: rgba(76, 169, 154, .54);
}

.sigil svg { overflow: visible; fill: none; stroke: currentColor; stroke-width: 1.15; }
.sigil circle { fill: rgba(76, 169, 154, .18); }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 0 0 18px;
  font-size: 9px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: rgba(233, 228, 214, .52);
}

.eyebrow span { color: var(--copper-bright); }

.eyebrow span::after {
  content: "";
  display: inline-block;
  width: 24px;
  height: 1px;
  margin-left: 13px;
  vertical-align: middle;
  background: linear-gradient(90deg, rgba(199, 142, 85, .75), transparent);
}

.wordmark-wrap { position: relative; width: max-content; isolation: isolate; }

.wordmark-wrap::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: -24px -82px -25px -34px;
  background: radial-gradient(ellipse at 34% 52%, rgba(2, 7, 10, .88), rgba(2, 7, 10, .38) 56%, transparent 78%);
  filter: blur(9px);
  pointer-events: none;
}

h1,
.wordmark-echo {
  font: 500 clamp(50px, 6.1vw, 96px)/.9 Cinzel, Georgia, serif;
  letter-spacing: .075em;
}

h1 {
  position: relative;
  z-index: 2;
  margin: 0;
  color: transparent;
  background: linear-gradient(180deg, #fffdf1 10%, #d8d1bd 48%, #93866e 78%, #e0caa2 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-stroke: .45px rgba(255, 250, 231, .34);
  filter: drop-shadow(0 3px 1px #010405) drop-shadow(0 0 12px #02070b) drop-shadow(0 0 22px rgba(199, 142, 85, .12));
}

h1::after {
  content: "";
  position: absolute;
  inset: 42% 0 auto;
  height: 1px;
  opacity: .34;
  background: linear-gradient(90deg, transparent, #fff6dc 20%, transparent 70%);
}

.wordmark-echo {
  position: absolute;
  z-index: 1;
  inset: 3px auto auto 3px;
  color: transparent;
  -webkit-text-stroke: 1px rgba(76, 169, 154, .24);
  pointer-events: none;
}

.tagline {
  margin: 22px 0 18px;
  max-width: 420px;
  font: 400 clamp(13px, 1.1vw, 16px)/1.7 Cinzel, Georgia, serif;
  letter-spacing: .07em;
  color: rgba(233, 228, 214, .7);
}

.ornament {
  display: flex;
  width: 176px;
  align-items: center;
  gap: 9px;
  margin: 0 0 23px;
  color: rgba(199, 142, 85, .6);
  font-size: 6px;
}

.ornament i { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, currentColor); }
.ornament i:last-child { background: linear-gradient(90deg, currentColor, transparent); }
.ornament b { font-weight: 400; }

nav { display: grid; width: min(315px, 100%); gap: 2px; }

.menu-item {
  position: relative;
  display: grid;
  grid-template-columns: 28px 1fr 20px;
  align-items: center;
  min-height: 42px;
  border: 0;
  border-left: 1px solid rgba(199, 142, 85, .18);
  background: linear-gradient(90deg, rgba(13, 27, 29, .28), transparent 82%);
  padding: 0 13px;
  color: rgba(233, 228, 214, .48);
  text-align: left;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color .25s ease, color .25s ease, background .25s ease, transform .25s ease;
}

.menu-item::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -3px;
  width: 5px;
  height: 5px;
  border: 1px solid transparent;
  transform: translateY(-50%) rotate(45deg);
  transition: border-color .25s ease, background .25s ease, box-shadow .25s ease;
}

.menu-item .index {
  color: rgba(199, 142, 85, .42);
  font: 500 8px/1 Cinzel, serif;
  letter-spacing: .08em;
}

.menu-item .label { font-size: 9px; font-weight: 600; letter-spacing: .19em; }
.menu-item .chevron { opacity: 0; color: var(--verdigris); font-size: 18px; transform: translateX(-6px); transition: .25s ease; }

.menu-item:hover,
.menu-item:focus-visible,
.menu-item.primary {
  border-left-color: var(--copper);
  color: var(--ivory);
  background: linear-gradient(90deg, rgba(42, 67, 61, .38), transparent 88%);
  transform: translateX(4px);
}

.menu-item:hover::before,
.menu-item:focus-visible::before,
.menu-item.primary::before {
  border-color: var(--copper-bright);
  background: rgba(199, 142, 85, .18);
  box-shadow: 0 0 10px rgba(199, 142, 85, .4);
}

.menu-item:hover .chevron,
.menu-item:focus-visible .chevron { opacity: .9; transform: none; }

.menu-status {
  min-height: 15px;
  margin: 11px 0 0 42px;
  color: rgba(139, 216, 202, .68);
  font-size: 8px;
  line-height: 1.5;
  letter-spacing: .12em;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity .25s ease;
}

.menu-status.is-visible { opacity: 1; }

.scene-controls {
  position: absolute;
  z-index: 3;
  right: clamp(24px, 3.5vw, 56px);
  bottom: clamp(22px, 3vw, 42px);
  display: grid;
  grid-template-columns: auto auto auto;
  align-items: center;
  gap: 10px;
  color: rgba(233, 228, 214, .38);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.performance { display: flex; align-items: baseline; gap: 4px; min-width: 48px; }
.performance span { color: rgba(139, 216, 202, .68); font-variant-numeric: tabular-nums; }
.performance small { font-size: 6px; }
.quality-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.select-wrap { position: relative; }
.select-wrap::after { content: "⌄"; position: absolute; top: 7px; right: 10px; pointer-events: none; color: var(--copper); }

select {
  min-width: 112px;
  appearance: none;
  border: 1px solid rgba(199, 142, 85, .26);
  border-radius: 0;
  outline: 0;
  background: rgba(5, 15, 18, .62);
  padding: 9px 27px 9px 11px;
  color: rgba(233, 228, 214, .75);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: .15em;
  text-transform: uppercase;
  cursor: pointer;
  backdrop-filter: blur(12px);
}

select:hover { border-color: rgba(199, 142, 85, .66); }
select:focus-visible { border-color: var(--focus); box-shadow: 0 0 0 2px rgba(76, 169, 154, .22); }
.quality-state { min-width: 59px; color: rgba(199, 142, 85, .54); }

.parallax-hint {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: clamp(27px, 3.4vw, 48px);
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  transform: translateX(-50%);
  color: rgba(233, 228, 214, .25);
  font-size: 7px;
  font-weight: 600;
  letter-spacing: .23em;
  text-transform: uppercase;
}

.parallax-hint i { width: 32px; height: 1px; background: linear-gradient(90deg, rgba(76, 169, 154, .55), transparent); }

.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;
}

#fallback {
  position: absolute;
  z-index: 10;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  text-align: center;
  background: radial-gradient(circle at 50% 38%, #173b3c, #061014 46%, #020609 78%);
}

#fallback[hidden] { display: none; }
.fallback-art { position: absolute; inset: 0; opacity: .8; }
.fallback-art::before { content: ""; position: absolute; left: 50%; top: 24%; width: min(70vw, 760px); height: min(28vw, 260px); border-radius: 50%; background: #0c262a; transform: translateX(-50%); box-shadow: 0 40px 80px #000; }
.fallback-art i { position: absolute; left: 50%; top: 27%; width: 2px; height: 25%; background: linear-gradient(#d39b5e, #4ca99a, transparent); box-shadow: 0 0 30px #4ca99a; }
.fallback-art b { position: absolute; left: calc(50% - 86px); top: 30%; width: 172px; height: 150px; border: 2px solid rgba(199, 142, 85, .35); border-radius: 50% 50% 10% 10%; }
.fallback-art span { position: absolute; left: 50%; top: 47%; width: 46vw; height: 20vw; border-radius: 50%; background: linear-gradient(#0b1919, #020608); transform: translateX(-50%) rotate(4deg); clip-path: polygon(4% 0, 96% 0, 78% 45%, 60% 63%, 51% 100%, 43% 65%, 18% 47%); }
.fallback-copy { position: relative; z-index: 1; margin-top: 22vh; }
.fallback-copy > p:first-child { color: var(--copper-bright); font-size: 9px; letter-spacing: .28em; text-transform: uppercase; }
.fallback-copy h2 { margin: 12px 0 20px; font: 500 clamp(42px, 8vw, 92px)/1 Cinzel, serif; letter-spacing: .1em; }
.fallback-copy .ornament { margin-inline: auto; }
.fallback-message { max-width: 390px; color: rgba(233, 228, 214, .56); font: 400 13px/1.8 Cinzel, serif; }
.fallback-copy a { display: inline-block; margin-top: 18px; border-bottom: 1px solid rgba(199, 142, 85, .45); padding: 8px 3px; color: var(--ivory); font-size: 8px; letter-spacing: .2em; text-decoration: none; text-transform: uppercase; }

@media (max-width: 900px) {
  .hero-copy { left: 40px; width: 44vw; }
  .sigil { display: none; }
  .world-state span { display: none; }
  .quality-state { display: none; }
}

@media (max-width: 700px) {
  #app { min-height: 560px; }
  .topbar { padding: 20px; }
  .back { font-size: 8px; }
  .world-state { display: none; }
  .view-switch {
    top: 59px;
    left: 20px;
    transform: none;
  }
  .view-label { display: none; }
  .view-switch button { min-height: 25px; padding-inline: 8px; font-size: 6px; }
  .hero-copy {
    top: auto;
    right: 22px;
    bottom: max(25px, env(safe-area-inset-bottom));
    left: 22px;
    width: auto;
    transform: none;
  }
  .eyebrow { margin-bottom: 11px; font-size: 7px; letter-spacing: .2em; }
  .eyebrow span::after { width: 13px; margin-left: 8px; }
  h1,
  .wordmark-echo { font-size: clamp(41px, 14.2vw, 66px); letter-spacing: .055em; }
  .tagline { margin: 13px 0 10px; font-size: 11px; }
  .ornament { width: 136px; margin-bottom: 10px; }
  nav { width: min(290px, 86vw); }
  .menu-item { min-height: 36px; grid-template-columns: 24px 1fr 16px; }
  .menu-item .label { font-size: 8px; }
  .menu-status { display: none; }
  .scene-controls { top: 18px; right: 18px; bottom: auto; display: flex; gap: 7px; }
  .performance,
  .quality-state { display: none; }
  select { min-width: 88px; padding-block: 8px; font-size: 7px; }
  .parallax-hint { display: none; }
  .grade {
    background:
      linear-gradient(0deg, rgba(1, 5, 8, .97) 0%, rgba(2, 7, 10, .78) 29%, transparent 58%),
      radial-gradient(ellipse at 52% 30%, transparent 16%, rgba(1, 5, 8, .25) 64%, rgba(1, 5, 8, .75) 100%);
    box-shadow: inset 0 0 20vw rgba(0, 0, 0, .65);
  }
}

@media (max-height: 680px) and (max-width: 700px) {
  .hero-copy { bottom: 13px; }
  .tagline { display: none; }
  .ornament { margin-top: 8px; }
  .menu-item { min-height: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
  .parallax-hint,
  .world-state { display: none; }
}

@media (forced-colors: active) {
  .grade,
  .grain { display: none; }
  h1 { color: CanvasText; background: none; filter: none; }
  .wordmark-echo { display: none; }
  .menu-item { border: 1px solid ButtonText; }
}
