:root {
  color-scheme: light dark;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  --accent: #2563eb;
  --accent-muted: #93c5fd;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --surface: rgba(255, 255, 255, 0.9);
  --background: linear-gradient(160deg, #f9fafb 0%, #e2e8f0 40%, #f9fafb 100%);
  --line-color: #1f2937;
  --tick-color: #94a3b8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  background: var(--background);
  color: var(--text-primary);
}

.page {
  width: min(960px, 100%);
  padding: clamp(2rem, 5vw, 4rem) clamp(1rem, 4vw, 2rem) 3rem;
  display: grid;
  gap: 2rem;
}

.page__header {
  text-align: center;
  display: grid;
  gap: 0.75rem;
}

.page__header h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3rem);
}

.page__header p {
  margin: 0;
  font-size: 1rem;
  color: var(--text-secondary);
}

.controls {
  display: grid;
  gap: 1rem;
  background: var(--surface);
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: 0 18px 35px rgba(15, 23, 42, 0.12);
}

.controls__group {
  display: grid;
  gap: 0.35rem;
}

.controls label {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.controls input {
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 12px;
  padding: 0.65rem 0.8rem;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.9);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.controls input[type="number"]::-webkit-outer-spin-button,
.controls input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.controls input[type="number"] {
  -moz-appearance: textfield;
}

.controls input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.controls #highlight {
  font-family: "JetBrains Mono", "Fira Code", monospace;
}

.line-section {
  background: var(--surface);
  border-radius: 24px;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  box-shadow: 0 18px 35px rgba(15, 23, 42, 0.12);
}

.line-wrapper {
  position: relative;
  width: 100%;
  height: clamp(220px, 50vw, 320px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.number-line {
  position: relative;
  width: 100%;
  height: 4px;
  background: var(--line-color);
  border-radius: 999px;
}

.number-line__tick {
  position: absolute;
  bottom: 100%;
  width: 1px;
  background: var(--tick-color);
  transform: translateX(-50%);
}

.number-line__tick--major {
  height: 24px;
}

.number-line__tick--minor {
  height: 16px;
}

.number-line__label {
  position: absolute;
  top: calc(100% + 8px);
  transform: translateX(-50%);
  font-size: clamp(0.85rem, 2vw, 1rem);
  color: var(--text-primary);
}

.number-line__highlight {
  position: absolute;
  top: -36px;
  width: clamp(24px, 4vw, 32px);
  height: clamp(24px, 4vw, 32px);
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  transform: translate(-50%, -50%);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}

.number-line__highlight::before {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  width: 2px;
  height: 32px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, var(--accent) 0%, rgba(37, 99, 235, 0.2) 100%);
  border-radius: 999px;
}

.number-line__highlight span {
  font-size: clamp(0.75rem, 2vw, 0.95rem);
}

.notes {
  background: rgba(255, 255, 255, 0.7);
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
  display: grid;
  gap: 1rem;
}

.notes h2 {
  margin: 0;
  font-size: 1.25rem;
}

.notes ul {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.5rem;
}

.notes li {
  color: var(--text-secondary);
}

@media (min-width: 640px) {
  .controls {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    align-items: end;
  }

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

}
