:root { font-family: var(--font-body); }

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 0.5rem 1rem;
  z-index: 100;
}
.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
}

:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 2px;
}

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(1rem, 4vw, 2.5rem);
}

.page h1 {
  font-family: var(--font-display);
  font-weight: 700;
  margin-top: 0;
}

.page h2 {
  font-family: var(--font-display);
  font-weight: 600;
}

form { display: flex; flex-direction: column; gap: 0.5rem; max-width: 320px; margin-bottom: 2rem; }
label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.9rem; }
input, select {
  font-family: inherit;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--static-gray);
  border-radius: 0.3rem;
  background: white;
  color: var(--ink);
}
button {
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 600;
  border: 1px solid var(--brass);
  border-radius: 0.3rem;
  background: var(--brass);
  color: var(--paper);
}
button:hover { filter: brightness(0.92); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

.controls { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem; }
#chart { border: 1px solid var(--static-gray); border-radius: 0.5rem; max-width: 100%; height: auto; background: white; }
#chart text { font-size: 13px; }

.hint { font-size: 0.85rem; color: var(--ink-soft); }

/* --- Nav (Task 4) --- */
.nav-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--paper-dim);
  overflow-x: auto;
  white-space: nowrap;
}
.nav-dial {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--brass), #6b4d27);
  flex-shrink: 0;
}
.nav-brand {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  margin-right: 0.5rem;
}
.nav-link {
  color: var(--static-gray);
  text-decoration: none;
  font-size: 0.9rem;
  padding-bottom: 3px;
}
.nav-link.active {
  color: var(--ink);
  border-bottom: 2px dotted var(--brass);
}
.nav-signout { margin-left: auto; }
.nav-signout-form { display: inline; margin-left: auto; }
.nav-signout-btn { background: none; border: none; padding: 0; cursor: pointer; }

/* --- Landing hero + cards (Task 5) --- */
.hero { text-align: center; padding: clamp(1.5rem, 6vw, 3rem) 1rem; }
.hero-dial {
  width: 100px;
  height: 100px;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  position: relative;
  background: radial-gradient(circle at 35% 30%, #cfa565, var(--brass) 55%, #6b4d27 100%);
  box-shadow: inset 0 -4px 8px rgba(0,0,0,0.3), 0 2px 6px rgba(0,0,0,0.2);
}
.hero-dial::after {
  content: "";
  position: absolute;
  top: 14%;
  left: 47%;
  width: 6%;
  height: 36%;
  background: var(--ink);
  border-radius: 2px;
}
.hero h1 { font-size: clamp(1.75rem, 5vw, 2.5rem); margin-bottom: 0.5rem; }
.hero p { max-width: 480px; margin: 0 auto; color: var(--ink-soft); }

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 2rem;
}
@media (max-width: 700px) {
  .card-grid { grid-template-columns: 1fr; }
}
.mode-card {
  display: block;
  border: 1px solid var(--paper-dim);
  border-radius: 0.5rem;
  padding: 1.25rem;
  text-decoration: none;
  color: var(--ink);
  background: white;
}
.mode-card:hover { border-color: var(--brass); }
.mode-card h3 { font-family: var(--font-display); margin: 0 0 0.4rem; }
.mode-card p { margin: 0; font-size: 0.9rem; color: var(--ink-soft); }

/* --- Score gauges (Task 8) --- */
.score-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 1rem; margin: 0; }
.score-gauge { text-align: center; width: 90px; }
.score-gauge svg { width: 100%; height: auto; }
.score-gauge .caption { font-family: var(--font-mono); font-size: 0.8rem; margin-top: 0.2rem; }
.score-gauge.band-green .caption { color: var(--signal-green); }
.score-gauge.band-yellow .caption { color: var(--brass); }
.score-gauge.band-red .caption { color: var(--tube-red); }

.stress-list { display: flex; flex-direction: column; gap: 0.5rem; }
.stress-row { display: flex; align-items: center; gap: 0.75rem; font-family: var(--font-mono); font-size: 0.85rem; }
.stress-bar { position: relative; flex: 1; height: 1rem; background: var(--paper-dim); border-radius: 0.2rem; overflow: hidden; }
.stress-fill { position: absolute; top: 0; height: 100%; }
.stress-fill.positive { background: var(--signal-green); }
.stress-fill.negative { background: var(--tube-red); }
.stress-label { white-space: nowrap; color: var(--ink-soft); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
