:root {
  --ink: #0b1c19;
  --muted: #3f504c;
  --paper: #ebe7db;
  --surface: #ffffff;
  --line: #aeb9b4;
  --green: #086047;
  --green-dark: #043d2e;
  --highlight: #ffedab;
  --orange: #a84216;
  --yellow: #f4c95d;
  --red: #bd3b36;
  --shadow: 0 18px 60px rgba(16, 34, 31, .09);
  --radius: 22px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, summary:focus-visible, a:focus-visible {
  outline: 3px solid #ffb000;
  outline-offset: 3px;
}
code, pre { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
code { color: var(--ink); background: var(--highlight); border-radius: 4px; padding: .08em .24em; font-weight: 700; }
pre {
  margin: 1rem 0;
  padding: 1rem;
  overflow-x: auto;
  color: #ffffff;
  background: #1c2024;
  border-radius: 14px;
  font-size: .9rem;
}
pre code { color: #ffffff; background: transparent; padding: 0; font-weight: 400; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 1rem clamp(1rem, 4vw, 4rem);
  background: rgba(235, 231, 219, .97);
  border-bottom: 2px solid rgba(11, 28, 25, .28);
  backdrop-filter: blur(18px);
}
.brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  color: inherit;
  text-decoration: none;
}
.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: white;
  background: var(--green);
  border-radius: 13px;
  font: 800 1.3rem/1 Georgia, serif;
}
.brand strong, .brand small { display: block; }
.brand small { color: var(--muted); font-size: .74rem; }
.main-nav { display: flex; gap: .35rem; }
.nav-button, .text-button {
  border: 0;
  background: transparent;
  cursor: pointer;
}
.nav-button {
  padding: .65rem .9rem;
  border-radius: 999px;
  font-weight: 700;
}
.nav-button:hover, .nav-button.is-active {
  color: white;
  background: var(--green-dark);
}

main { min-height: calc(100vh - 160px); }
.view { display: none; padding: clamp(2rem, 5vw, 5rem) clamp(1rem, 5vw, 5rem); }
.view.is-active { display: block; animation: enter .25s ease-out; }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(260px, .7fr);
  gap: 2rem;
  align-items: stretch;
  padding: clamp(2rem, 5vw, 5rem);
  color: white;
  background: var(--green-dark);
  border-radius: 34px;
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}
.hero-copy { position: relative; z-index: 1; }
.eyebrow {
  margin: 0 0 .45rem;
  color: var(--orange);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.hero .eyebrow { color: var(--yellow); }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 1rem; font: 700 clamp(2.2rem, 5vw, 4.8rem)/1.02 Georgia, serif; letter-spacing: -.035em; }
h2 { margin-bottom: .65rem; font: 700 1.45rem/1.15 Georgia, serif; }
.hero-text { max-width: 760px; color: #ffffff; font-size: 1.08rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.8rem; }
.primary-button, .secondary-button {
  padding: .8rem 1.05rem;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 800;
}
.primary-button { color: var(--green-dark); background: var(--yellow); }
.primary-button:hover { background: #ffd979; }
.secondary-button { color: var(--ink); background: var(--surface); border-color: var(--line); }
.hero .secondary-button { color: white; background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.72); }
.score-card {
  position: relative;
  z-index: 1;
  align-self: end;
  padding: 1.5rem;
  color: var(--ink);
  background: var(--surface);
  border: 3px solid var(--yellow);
  border-radius: var(--radius);
}
.score-card strong { display: block; font: 700 4rem/1 Georgia, serif; }
.score-card strong span { color: var(--muted); font-size: 1.5rem; }
.score-label { color: var(--orange); font-weight: 800; }
.score-card p { margin: .7rem 0 0; color: var(--muted); font-size: .85rem; }
.score-bar { height: 7px; margin-top: 1rem; background: var(--line); border-radius: 99px; overflow: hidden; }
.score-bar span { display: block; height: 100%; background: var(--yellow); border-radius: inherit; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin: 1.4rem 0; }
.stat-card, .panel, .week-card, .repair-card, .quiz-shell {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 30px rgba(16, 34, 31, .04);
}
.stat-card { padding: 1.25rem; }
.stat-card span, .stat-card small { display: block; color: var(--muted); }
.stat-card strong { display: block; margin: .35rem 0; font: 700 2rem/1 Georgia, serif; }
.dashboard-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 1.4rem; }
.panel { padding: 1.4rem; }
.panel-heading { display: flex; justify-content: space-between; align-items: start; }
.text-button { color: var(--green); font-weight: 800; }
.sprint-list { display: grid; gap: .65rem; }
.sprint-item {
  display: grid;
  grid-template-columns: 40px 1fr 30px;
  align-items: center;
  gap: .75rem;
  width: 100%;
  padding: .85rem;
  text-align: left;
  background: #f8f6ef;
  border: 1px solid transparent;
  border-radius: 14px;
  cursor: pointer;
}
.sprint-item:hover { border-color: var(--green-dark); box-shadow: inset 0 0 0 1px var(--green-dark); }
.sprint-item > span { color: var(--orange); font-weight: 900; }
.sprint-item strong, .sprint-item small { display: block; }
.sprint-item small { color: var(--muted); }
.sprint-item i { display: none; font-style: normal; color: white; text-align: center; background: var(--green); border-radius: 50%; }
.sprint-item.is-done { background: var(--highlight); border-color: var(--ink); }
.sprint-item.is-done i { display: block; }
.priority-list { list-style: none; padding: 0; margin: 1.2rem 0 0; display: grid; gap: .9rem; }
.priority-list li { display: flex; gap: .8rem; align-items: start; }
.priority-list strong, .priority-list small { display: block; }
.priority-list small { color: var(--muted); }
.priority { flex: 0 0 62px; padding: .2rem .4rem; text-align: center; border-radius: 99px; font-size: .68rem; font-weight: 900; text-transform: uppercase; }
.priority.high { color: #7c211d; background: #f8d9d5; }
.priority.medium { color: #7b4a11; background: #f8e9bd; }

.page-heading { max-width: 900px; margin-bottom: 2rem; }
.page-heading h1 { font-size: clamp(2.4rem, 4vw, 4rem); }
.page-heading > p:last-child { color: var(--muted); font-size: 1.05rem; }
.week-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem; }
.week-card { position: relative; padding: 1.6rem; overflow: hidden; }
.week-number { position: absolute; top: .6rem; right: 1rem; color: rgba(16,34,31,.08); font: 800 5rem/1 Georgia, serif; }
.week-card h2 { max-width: 70%; font-size: 1.8rem; }
.note-explanation { color: var(--muted); }
.note-box { margin: 1rem 0; padding: .9rem 1rem; color: var(--ink); background: var(--highlight); border: 1px solid var(--ink); border-radius: 12px; }
.note-box p:last-child, .note-box ol:last-child { margin-bottom: 0; }
.topic-list { padding-left: 1.2rem; }
.topic-list li { margin: .55rem 0; }
details { margin-top: 1.2rem; border-top: 1px solid var(--line); padding-top: 1rem; }
summary { cursor: pointer; color: var(--green-dark); font-weight: 800; }

.repair-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem; }
.repair-card { padding: 1.5rem; }
.repair-card.featured { grid-column: 1 / -1; }
.repair-tag { display: inline-block; margin-bottom: .8rem; padding: .25rem .55rem; color: var(--ink); background: var(--highlight); border: 1px solid var(--ink); border-radius: 99px; font-size: .7rem; font-weight: 900; text-transform: uppercase; }
.loop-table { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.loop-row { display: grid; grid-template-columns: .55fr 1.8fr .55fr; gap: 1rem; padding: .7rem 1rem; border-bottom: 1px solid var(--line); }
.loop-row:last-child { border: 0; }
.loop-head { color: var(--muted); background: #f4f2eb; font-size: .75rem; font-weight: 900; text-transform: uppercase; }
.loop-total { background: var(--highlight); }

.practice-heading { display: flex; justify-content: space-between; align-items: end; max-width: none; }
.practice-heading > div { max-width: 800px; }
.quiz-modes { display: flex; flex-wrap: wrap; gap: .55rem; margin: 0 0 1rem; }
.mode-button {
  padding: .62rem .9rem;
  color: var(--green-dark);
  background: var(--surface);
  border: 2px solid var(--green-dark);
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
}
.mode-button:hover, .mode-button.is-active { color: white; background: var(--green-dark); }
.quiz-shell { max-width: 1000px; min-height: 440px; padding: clamp(1.3rem, 4vw, 2.5rem); }
.quiz-topline { display: flex; justify-content: space-between; gap: 1rem; color: var(--muted); font-size: .85rem; font-weight: 800; }
.quiz-progress { height: 7px; margin: 1rem 0 2rem; background: #e7e5dd; border-radius: 99px; overflow: hidden; }
.quiz-progress span { display: block; height: 100%; background: var(--green); transition: width .2s ease; }
.quiz-question h2 { max-width: 800px; font-size: clamp(1.45rem, 3vw, 2.2rem); }
.quiz-instruction { color: var(--orange); font-weight: 800; }
.paper-date { color: var(--muted); font-weight: 700; }
.question-image { display: block; max-width: 100%; max-height: 680px; margin: 1rem 0; object-fit: contain; border: 1px solid var(--line); border-radius: 12px; }
.option-list { display: grid; gap: .7rem; margin: 1.2rem 0; }
.option {
  display: flex;
  align-items: start;
  gap: .8rem;
  padding: .9rem 1rem;
  background: #faf8f2;
  border: 1px solid var(--line);
  border-radius: 13px;
  cursor: pointer;
}
.option:hover { border-color: var(--green-dark); box-shadow: inset 0 0 0 1px var(--green-dark); }
.option input { margin-top: .3rem; accent-color: var(--green); }
.option-image { display: block; max-width: min(100%, 680px); max-height: 220px; margin-top: .55rem; object-fit: contain; }
.option.is-correct { background: var(--highlight); border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.option.is-wrong { background: #fae2de; border-color: var(--red); }
.paper-source { display: inline-block; color: var(--green-dark); font-weight: 800; }
.quiz-actions { display: flex; align-items: center; gap: 1rem; margin-top: 1.3rem; }
.quiz-error { color: var(--red); font-weight: 700; }
.feedback { margin-top: 1.2rem; padding: 1rem; border-left: 5px solid var(--ink); background: var(--highlight); border-radius: 0 12px 12px 0; }
.feedback.is-wrong { border-color: var(--red); background: #fae2de; }
.feedback strong { display: block; margin-bottom: .3rem; }
.result-card { display: grid; place-items: center; min-height: 360px; text-align: center; }
.result-score { font: 800 clamp(4rem, 10vw, 7rem)/1 Georgia, serif; color: var(--green); }
.result-card p { max-width: 600px; color: var(--muted); }

footer { display: flex; justify-content: space-between; gap: 1rem; padding: 2rem clamp(1rem, 5vw, 5rem); color: var(--muted); border-top: 1px solid var(--line); }
footer p { margin: 0; }

@media (max-width: 900px) {
  .site-header { align-items: flex-start; flex-direction: column; gap: .8rem; }
  .main-nav { width: 100%; overflow-x: auto; }
  .hero, .dashboard-grid, .week-grid, .repair-grid { grid-template-columns: 1fr; }
  .repair-card.featured { grid-column: auto; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .view { padding-top: 2rem; }
  .nav-button { padding: .55rem .7rem; white-space: nowrap; }
  .hero { padding: 1.5rem; border-radius: 24px; }
  .hero h1 { font-size: 2.5rem; }
  .stat-grid { grid-template-columns: 1fr; }
  .practice-heading, footer { align-items: flex-start; flex-direction: column; }
  .loop-row { grid-template-columns: .45fr 1.5fr .45fr; gap: .4rem; padding-inline: .65rem; font-size: .82rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
