/*
 * styles.css — Wheel Refraction Simulator
 * Breezeway Labs — https://breezewaylabs.com
 * Copyright (c) 2015–2026 Keith Warren  —  MIT License
 */

:root {
  --bg:          #f3efe3;
  --panel:       rgba(255, 251, 240, 0.88);
  --ink:         #1d1c1a;
  --muted:       #615c4d;
  --accent:      #2a6a7c;
  --accent-soft: rgba(42, 106, 124, 0.16);
  --line:        rgba(29, 28, 26, 0.12);
  --shadow:      0 24px 80px rgba(42, 64, 34, 0.18);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Avenir Next", "Century Gothic", "Trebuchet MS", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top, rgba(255,255,255,0.8), transparent 30%),
    linear-gradient(180deg, #efe7d2 0%, #f6f1e7 48%, #e5dcc8 100%);
}

.app-shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 32px 0 40px;
}

/* ── Hero ─────────────────────────────────────────────── */
.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 24px;
  align-items: start;
}

.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  color: var(--muted);
}

h1 {
  margin: 0;
  font-size: clamp(1.9rem, 4vw, 3.6rem);
  line-height: 0.96;
}

.lede {
  max-width: 44rem;
  font-size: 1.02rem;
  line-height: 1.65;
  color: var(--muted);
}

/* ── Panels ───────────────────────────────────────────── */
.controls,
.sim-panel {
  background: var(--panel);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.controls { padding: 20px 22px 22px; }

/* ── Sliders ──────────────────────────────────────────── */
.slider-group {
  display: grid;
  gap: 7px;
  margin-top: 18px;
}

.slider-group:first-child { margin-top: 0; }

.slider-group > span {
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--muted);
}

.slider-value {
  font-weight: 700;
  color: var(--accent);
}

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

/* ── Playback buttons ─────────────────────────────────── */
.playback-row {
  display: flex;
  gap: 7px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.btn-ctrl {
  flex: 1;
  min-width: 72px;
  padding: 9px 10px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(200, 193, 178, 0.7);
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: background 130ms, border-color 130ms, color 130ms, opacity 130ms;
}

.btn-ctrl:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(150, 140, 120, 0.8);
}

.btn-ctrl:disabled {
  opacity: 0.38;
  cursor: default;
}

.btn-ctrl.active {
  background: var(--accent-soft);
  border-color: rgba(42, 106, 124, 0.5);
  color: var(--accent);
}

.btn-swap {
  background: rgba(42, 106, 124, 0.1);
  border-color: rgba(42, 106, 124, 0.35);
  color: var(--accent);
}

.btn-swap:hover:not(:disabled) {
  background: rgba(42, 106, 124, 0.2);
}

/* ── Readout tiles ────────────────────────────────────── */
.readout-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.readout {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.5);
  min-height: 4.5rem;
}

.readout span {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.3;
}

.readout strong {
  display: block;
  margin-top: 4px;
  font-size: 1.05rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Canvas panel ─────────────────────────────────────── */
.sim-panel {
  margin-top: 24px;
  padding: 22px;
}

canvas {
  display: block;
  width: min(100%, 900px);
  margin: 0 auto;
  touch-action: none;
  border-radius: 10px;
}

.hint {
  margin: 14px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
}

/* ── Breadcrumb ───────────────────────────────────────── */
.breadcrumb {
  padding: 0.7rem 1.5rem;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  border-bottom: 1px solid rgba(29, 28, 26, 0.1);
  background: rgba(255, 251, 240, 0.7);
  backdrop-filter: blur(12px);
}

.breadcrumb a       { color: var(--accent); text-decoration: none; font-weight: 500; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep    { color: rgba(29, 28, 26, 0.3); }
.breadcrumb .current{ color: var(--muted); }

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .app-shell {
    width: min(100vw - 20px, 1180px);
    padding-top: 18px;
    padding-bottom: 22px;
  }
  .controls, .sim-panel { border-radius: 22px; }
}

@media (max-width: 480px) {
  .playback-row { gap: 5px; }
  .btn-ctrl     { font-size: 0.76rem; padding: 8px 6px; }
}
