:root {
  color: #1f2937;
  font-family: Inter, system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: #f7f8fc;
}

.app { width: min(920px, 92vw); padding: 48px 0; }
.intro { text-align: center; max-width: 600px; margin: 0 auto 28px; }
.eyebrow { margin: 0; color: #d63b3b; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; }
h1 { margin: 8px 0; font-size: clamp(2rem, 5vw, 3rem); }
.intro p:last-child { margin: 0; color: #5d6878; }

.visualizer {
  background: white;
  border: 1px solid #e4e7ee;
  border-radius: 18px;
  box-shadow: 0 12px 32px #1f29370d;
  padding: 22px;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 230px;
  align-items: center;
  gap: 24px;
}

/* Keep controls in a fixed position as optional value cards appear. */
.visualizer > div:last-child { align-self: stretch; }

svg { width: 100%; touch-action: none; user-select: none; }
.axis { stroke: #b8c0cc; stroke-width: 2; }
.unit-circle { fill: #f4f8ff; stroke: #5d7ea8; stroke-width: 3; }
.radius { stroke: #344b68; stroke-width: 3; }
.cosine-line { stroke: #2f9a76; stroke-width: 4; }
.sine-line { stroke: #426fa6; stroke-width: 4; }
.is-hidden { display: none !important; }
.angle-arc { fill: none; stroke: #e8a42b; stroke-width: 3; }
.point { fill: #e54545; stroke: white; stroke-width: 4; cursor: grab; }
.point:active { cursor: grabbing; }
.axis-label { fill: #6e7785; font-size: 20px; font-style: italic; }
.coordinate-label { fill: #344b68; font-size: 16px; font-weight: 700; }

.controls { display: grid; gap: 14px; margin-bottom: 18px; }
fieldset { margin: 0; padding: 0; border: 0; display: grid; gap: 7px; }
legend { margin-bottom: 5px; color: #657082; font-size: .9rem; font-weight: 700; }
label { cursor: pointer; font-size: .95rem; }
input { accent-color: #426fa6; }
.readout { display: grid; gap: 10px; }
.readout div { background: #f5f7fa; padding: 13px 15px; border-radius: 10px; display: flex; justify-content: space-between; gap: 10px; }
.readout span { color: #657082; }
.readout strong { color: #1f2937; }

@media (max-width: 650px) {
  .app { padding: 28px 0; }
  .visualizer { grid-template-columns: 1fr; }
  .readout { grid-template-columns: 1fr; }
}
