.hero-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(21, 48, 77, 0.12);
}

.hero-link:hover {
  background: white;
}

:root {
  --bg-top: #f7fbff;
  --bg-bottom: #d9e8ff;
  --panel: rgba(255, 255, 255, 0.84);
  --panel-border: rgba(21, 48, 77, 0.12);
  --ink: #15304d;
  --muted: #5a738f;
  --accent: #0f766e;
  --accent-strong: #0d9488;
  --shadow: 0 24px 60px rgba(19, 48, 77, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Trebuchet MS", "Gill Sans", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255,255,255,0.9), transparent 28%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
}

.page {
  width: min(1380px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.5rem 0 2rem;
}

.hero {
  margin-bottom: 1rem;
}

.eyebrow {
  margin: 0 0 0.35rem;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 0.95;
}

.intro {
  max-width: 74ch;
  color: var(--muted);
  font-size: 1rem;
}

.layout {
  display: grid;
  grid-template-columns: minmax(320px, 390px) minmax(0, 1fr);
  gap: 1rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.controls {
  padding: 1.25rem;
}

.controls h2 {
  margin: 0 0 1rem;
  font-size: 1.2rem;
}

.mode-grid,
.toggle-grid,
.readout-grid {
  display: grid;
  gap: 0.75rem;
}

.mode-grid,
.toggle-grid {
  margin-bottom: 1rem;
}

.mode-grid {
  grid-template-columns: 1fr;
}

.toggle-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mode-chip,
.toggle-chip,
select,
input[type="number"] {
  width: 100%;
  padding: 0.78rem 0.8rem;
  border: 1px solid rgba(21,48,77,0.14);
  border-radius: 14px;
  font: inherit;
  color: var(--ink);
  background: rgba(255,255,255,0.92);
}

.mode-chip,
.toggle-chip {
  font-weight: 700;
  cursor: pointer;
}

.mode-chip.active,
.toggle-chip.active {
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  border-color: transparent;
}

.control-group {
  margin-bottom: 1rem;
}

.control-group label,
.section-label {
  display: block;
  margin-bottom: 0.45rem;
  font-weight: 700;
}

input[type="range"] {
  width: 100%;
  margin-bottom: 0.45rem;
  accent-color: var(--accent-strong);
}

.value-display {
  margin: 0.35rem 0 0;
  min-height: 1.35rem;
  color: var(--muted);
  font-size: 0.94rem;
}

.readout-card {
  padding: 0.9rem 1rem;
  border-radius: 18px;
  background: rgba(239,247,255,0.96);
}

.readout-label {
  display: block;
  margin-bottom: 0.28rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.readout-value {
  display: block;
  font-size: 1rem;
  font-weight: 700;
}

.mode-panel {
  display: none;
}

.mode-panel.active {
  display: block;
}

.visual-panel {
  padding: 0.85rem;
}

.canvas-wrap {
  overflow: hidden;
  border-radius: 18px;
  background:
    radial-gradient(circle at top, rgba(255,255,255,0.72), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,0.82), rgba(229,239,255,0.96));
}

.three-root {
  width: 100%;
  aspect-ratio: 16 / 10;
  min-height: 760px;
  touch-action: none;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.scene-note {
  padding: 0.75rem 1rem 1rem;
  color: var(--muted);
  font-size: 0.94rem;
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .three-root {
    min-height: 520px;
  }
}


.zoom-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
