:root {
  color-scheme: dark;
  --ink: #f2f1ec;
  --muted: rgba(242, 241, 236, 0.58);
  --hairline: rgba(255, 255, 255, 0.17);
  --panel: rgba(16, 21, 22, 0.68);
  --cyan: #a2e6dc;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  background: #727c7b;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
}

body {
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.experience {
  position: relative;
  width: 100%;
  height: 100svh;
  min-height: 700px;
  overflow: hidden;
  isolation: isolate;
  background: #7f8987;
}

#glory-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  transform: scale(1.01);
}

.grain {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.15;
  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='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
}

.topbar {
  position: absolute;
  z-index: 4;
  top: 0;
  left: 0;
  width: 100%;
  height: 78px;
  padding: 0 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--hairline);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.22em;
}

.brand-mark {
  width: 20px;
  height: 20px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  position: relative;
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.08);
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  inset: 3px;
}

.brand-mark::after {
  inset: 7px;
  background: var(--ink);
  border: 0;
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 24px;
  color: rgba(255, 255, 255, 0.48);
  font-family: "DM Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.16em;
}

.icon-button,
.close-button {
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease;
}

.icon-button {
  width: 29px;
  height: 29px;
  padding: 0;
  display: grid;
  place-items: center;
  font-family: Georgia, serif;
  font-size: 13px;
}

.icon-button:hover,
.close-button:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.55);
}

.intro {
  position: absolute;
  z-index: 3;
  left: clamp(42px, 7vw, 118px);
  top: 50%;
  width: min(520px, 36vw);
  transform: translateY(-48%);
}

.eyebrow,
.panel-kicker {
  margin: 0;
  font-family: "DM Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.62);
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  display: inline-block;
  vertical-align: middle;
  margin-right: 12px;
  background: rgba(255, 255, 255, 0.55);
}

.intro h1 {
  margin: 22px 0 24px;
  font-size: clamp(52px, 5.3vw, 92px);
  line-height: 0.97;
  letter-spacing: -0.062em;
  font-weight: 300;
  text-shadow: 0 3px 40px rgba(10, 18, 18, 0.18);
}

.lede {
  width: min(390px, 100%);
  margin: 0;
  font-size: 13px;
  font-weight: 300;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.67);
}

.explore-button {
  margin-top: 35px;
  padding: 0;
  display: flex;
  width: 205px;
  align-items: center;
  justify-content: space-between;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.45);
  background: transparent;
  cursor: pointer;
  font-family: "DM Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.14em;
  line-height: 37px;
  transition: width 200ms ease, border-color 200ms ease;
}

.explore-button:hover {
  width: 225px;
  border-color: white;
}

.arrow {
  font-size: 16px;
}

.control-panel {
  position: absolute;
  z-index: 4;
  right: 42px;
  top: 50%;
  width: 322px;
  transform: translateY(-48%);
  padding: 25px 26px 23px;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(18px) saturate(0.7);
  box-shadow: 0 25px 65px rgba(17, 24, 24, 0.24);
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.panel-header h2 {
  margin: 6px 0 0;
  font-size: 18px;
  font-weight: 400;
  letter-spacing: -0.03em;
}

.live-indicator {
  font-family: "DM Mono", monospace;
  font-size: 8px;
  letter-spacing: 0.13em;
  color: rgba(255, 255, 255, 0.45);
}

.live-indicator span {
    width: 5px;
    height: 5px;
    margin-right: 5px;
    display: inline-block;
    border-radius: 50%;
    background: var(--cyan);
    box-shadow: 0 0 8px var(--cyan);
    animation: pulse 2s infinite;
}

@keyframes pulse {
  50% { opacity: 0.35; }
}

.preset-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 22px 0 23px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.preset {
  min-height: 31px;
  padding: 0;
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  cursor: pointer;
  font-family: "DM Mono", monospace;
  font-size: 7px;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.42);
  transition: background 150ms ease, color 150ms ease;
}

.preset:last-child { border-right: 0; }
.preset.active { background: rgba(255, 255, 255, 0.12); color: white; }

.controls {
  display: grid;
  gap: 21px;
}

.control {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
}

.control-name,
.control-value,
.range-labels,
.readout span {
  font-family: "DM Mono", monospace;
  font-size: 7px;
  letter-spacing: 0.12em;
}

.control-name { color: rgba(255, 255, 255, 0.53); }
.control-value { color: rgba(255, 255, 255, 0.92); }

input[type="range"] {
  grid-column: 1 / -1;
  width: 100%;
  height: 14px;
  margin: 7px 0 1px;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 1px;
  background: linear-gradient(90deg, rgba(255,255,255,.8) var(--progress), rgba(255,255,255,.18) var(--progress));
}

input[type="range"]::-webkit-slider-thumb {
  width: 8px;
  height: 8px;
  margin-top: -3.5px;
  appearance: none;
  border: 0;
  border-radius: 50%;
  background: white;
  box-shadow: 0 0 0 3px rgba(255,255,255,.14);
}

input[type="range"]::-moz-range-track { height: 1px; background: rgba(255,255,255,.18); }
input[type="range"]::-moz-range-progress { height: 1px; background: rgba(255,255,255,.8); }
input[type="range"]::-moz-range-thumb { width: 8px; height: 8px; border: 0; border-radius: 50%; background: white; }

.range-labels {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  color: rgba(255, 255, 255, 0.25);
  font-size: 6px;
}

.control-hint {
  grid-column: 1 / -1;
  max-height: 0;
  margin-top: 0;
  overflow: hidden;
  font-size: 8px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0);
  transition: max-height 180ms ease, margin-top 180ms ease, color 180ms ease;
}

.control:focus-within .control-hint,
.control:hover .control-hint {
  max-height: 28px;
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.42);
}

.readout {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.readout div:last-child {
  padding-left: 19px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.readout span {
  display: block;
  color: rgba(255, 255, 255, 0.32);
  font-size: 6px;
}

.readout strong {
  display: block;
  margin-top: 6px;
  font-family: "DM Mono", monospace;
  font-size: 12px;
  font-weight: 400;
}

.coordinates {
  position: absolute;
  z-index: 3;
  left: 42px;
  bottom: 32px;
  display: flex;
  gap: 15px;
  font-family: "DM Mono", monospace;
  font-size: 7px;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.35);
}

.scroll-mark {
  position: absolute;
  z-index: 3;
  right: 42px;
  bottom: 30px;
  display: flex;
  align-items: center;
  gap: 15px;
  font-family: "DM Mono", monospace;
  font-size: 7px;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.38);
}

.scroll-line {
  width: 44px;
  height: 1px;
  background: rgba(255, 255, 255, 0.4);
  position: relative;
  overflow: hidden;
}

.scroll-line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: white;
  transform: translateX(-100%);
  animation: scan 2.5s ease-in-out infinite;
}

@keyframes scan { 65%, 100% { transform: translateX(100%); } }

.science-card {
  position: absolute;
  z-index: 8;
  right: 42px;
  top: 92px;
  width: 470px;
  padding: 34px;
  background: rgba(13, 18, 19, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.17);
  backdrop-filter: blur(24px);
  transform: translateX(calc(100% + 60px));
  opacity: 0;
  transition: transform 350ms cubic-bezier(.2,.75,.25,1), opacity 250ms ease;
}

.science-card.open { transform: translateX(0); opacity: 1; }

.science-card h2 {
  margin: 18px 0 16px;
  font-size: 34px;
  font-weight: 300;
  letter-spacing: -0.05em;
}

.science-card p {
  font-size: 12px;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.62);
}

.close-button {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 27px;
  height: 27px;
  padding: 0;
  line-height: 23px;
}

.formula {
  margin: 25px 0;
  padding: 17px 0;
  border-top: 1px solid rgba(255,255,255,.14);
  border-bottom: 1px solid rgba(255,255,255,.14);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: "DM Mono", monospace;
}

.formula span { font-size: 7px; letter-spacing: .15em; color: rgba(255,255,255,.38); }
.formula strong { font-weight: 300; font-size: 18px; }
.citation-note { font-size: 9px !important; color: rgba(255,255,255,.4) !important; }

.unsupported {
  position: absolute;
  z-index: 20;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  padding: 18px 22px;
  background: #1c2424;
  border: 1px solid rgba(255,255,255,.2);
  font-size: 13px;
}

@media (max-width: 980px) {
  .experience { min-height: 820px; overflow-y: auto; }
  body { overflow: auto; }
  .intro { top: 205px; width: calc(100% - 64px); transform: none; left: 32px; }
  .intro h1 { font-size: clamp(50px, 12vw, 72px); }
  .control-panel { top: auto; bottom: 32px; right: 32px; transform: none; width: min(400px, calc(100% - 64px)); }
  .topbar { padding: 0 32px; }
  .coordinates { left: 32px; }
  .scroll-mark { display: none; }
}

@media (max-width: 620px) {
  .experience { min-height: 920px; }
  .topbar { height: 64px; padding: 0 20px; }
  .topbar-meta > span { display: none; }
  .intro { left: 20px; right: 20px; top: 124px; width: auto; }
  .intro h1 { margin-top: 18px; font-size: 50px; }
  .lede { font-size: 12px; width: 90%; }
  .explore-button { margin-top: 22px; }
  .control-panel { left: 20px; right: 20px; bottom: 40px; width: auto; padding: 22px; }
  .controls { gap: 17px; }
  .coordinates { display: none; }
  .science-card { top: 76px; left: 20px; right: 20px; width: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
