:root {
  color-scheme: dark;
  --background: #070a12;
  --surface: #101521;
  --surface-strong: #171e2d;
  --text: #f4f0e6;
  --muted: #b8bfd0;
  --gold: #d8b768;
  --gold-light: #f0d896;
  --real: #70b7ff;
  --imaginary: #bd8cff;
  --danger: #e58b8b;
  --border: #30394c;
  --focus: #ffffff;
  --shadow: 0 18px 60px rgb(0 0 0 / 35%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--background);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 50% 5%, rgb(216 183 104 / 10%), transparent 30rem),
    var(--background);
  line-height: 1.65;
}

a {
  color: var(--gold-light);
}

a:hover {
  text-decoration-thickness: 0.16em;
}

button,
input {
  font: inherit;
}

button {
  min-height: 2.75rem;
  color: var(--text);
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  padding: 0.55rem 0.85rem;
  cursor: pointer;
}

button:hover {
  border-color: var(--gold);
}

button.primary {
  color: #111;
  background: var(--gold);
  border-color: var(--gold);
  font-weight: 750;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}

.skip-link {
  position: absolute;
  top: -5rem;
  left: 1rem;
  z-index: 20;
  padding: 0.75rem 1rem;
  color: #111;
  background: var(--gold-light);
  border-radius: 0.5rem;
}

.skip-link:focus {
  top: 1rem;
}


#experience:focus {
  outline: 2px solid var(--gold);
  outline-offset: 0.4rem;
}

.site-header,
main,
footer {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
}

.site-header {
  padding: clamp(3.5rem, 10vw, 7.5rem) 0 2.5rem;
  text-align: center;
}

.eyebrow {
  margin: 0;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

h1 {
  margin: 0.35rem 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3rem, 12vw, 7.5rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.05em;
}

h2,
h3 {
  line-height: 1.2;
}

.lede {
  margin: 1.25rem 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2.5vw, 1.35rem);
}

.intro {
  max-width: 52rem;
  margin: 0 auto 2rem;
  text-align: center;
}

.experience-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(18rem, 0.8fr);
  gap: 1.25rem;
  align-items: stretch;
}

.visual-panel,
.control-panel,
.boundary {
  background: rgb(16 21 33 / 92%);
  border: 1px solid var(--border);
  border-radius: 1.1rem;
  box-shadow: var(--shadow);
}

.visual-panel {
  display: grid;
  min-height: 32rem;
  padding: 1rem;
  place-items: center;
}

#unit-circle {
  width: min(100%, 42rem);
  height: auto;
  overflow: visible;
}

.axis {
  stroke: #6f788c;
  stroke-width: 1;
}

.circle {
  fill: none;
  stroke: var(--gold);
  stroke-width: 2.25;
}

.radius {
  stroke: var(--gold-light);
  stroke-linecap: round;
  stroke-width: 3;
}

.projection {
  stroke-dasharray: 5 5;
  stroke-width: 2;
}

.projection.real {
  stroke: var(--real);
}

.projection.imaginary {
  stroke: var(--imaginary);
}

.addition {
  stroke: var(--gold-light);
  stroke-linecap: round;
  stroke-width: 4;
  transition: opacity 220ms ease;
}

#addition-arrow path {
  fill: var(--gold-light);
}

.addition-label {
  fill: var(--gold-light);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
  font-weight: 700;
  transition: opacity 220ms ease;
}

.point {
  fill: var(--gold-light);
  stroke: #111;
  stroke-width: 2;
}

.origin {
  fill: var(--text);
  stroke: var(--gold);
  stroke-width: 2;
  transition: opacity 220ms ease;
}

.axis-label {
  fill: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
}

.hidden {
  opacity: 0;
  visibility: hidden;
}

.control-panel {
  padding: clamp(1.1rem, 3vw, 1.8rem);
}

.control-group label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 750;
}

#angle-slider {
  width: 100%;
  accent-color: var(--gold);
}

.help {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.preset-group,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1.15rem;
}

.readout {
  display: grid;
  gap: 0.45rem;
  margin: 1.35rem 0;
}

.readout div {
  display: grid;
  grid-template-columns: minmax(8rem, 1fr) minmax(7rem, auto);
  gap: 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

.readout dt {
  color: var(--muted);
}

.readout dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.explanation {
  padding: 1rem;
  background: #0b0f18;
  border-left: 4px solid var(--gold);
  border-radius: 0.65rem;
}

.explanation h3 {
  margin-top: 0;
}

.equation {
  margin-bottom: 0;
  color: var(--gold-light);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
}

.boundary {
  margin-top: 1.25rem;
  padding: 1.25rem 1.5rem;
}

.boundary h2 {
  margin-top: 0;
}

footer {
  padding: 2.5rem 0 4rem;
  color: var(--muted);
  text-align: center;
}

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

  .visual-panel {
    min-height: auto;
  }
}

@media (max-width: 480px) {
  .site-header,
  main,
  footer {
    width: min(100% - 1rem, 1120px);
  }

  .visual-panel,
  .control-panel,
  .boundary {
    border-radius: 0.8rem;
  }

  .readout div {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .readout dd {
    text-align: left;
  }

  .button-row button {
    flex: 1 1 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }
}
