:root {
  --bg: #f4f6fb;
  --card: rgba(255, 255, 255, 0.92);
  --text: #1d2838;
  --text-soft: #566579;
  --muted: #708095;
  --border: rgba(148, 163, 184, 0.18);
  --border-strong: rgba(116, 140, 173, 0.24);
  --primary: #4b74e6;
  --primary-dark: #355fcf;
  --primary-soft: rgba(75, 116, 230, 0.12);
  --success-bg: #f3fbf6;
  --success-border: rgba(22, 163, 74, 0.14);
  --error-bg: #fff7f7;
  --error-border: rgba(239, 68, 68, 0.14);
  --shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.06);
  --shadow-lift: 0 20px 48px rgba(15, 23, 42, 0.12);
  --radius-card: 26px;
  --radius-soft: 18px;
  --radius-pill: 999px;
  --card-action-size: 34px;
  --card-action-offset: 18px;
  --content-max: 940px;
  --content-wide: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "SF Pro Text", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(191, 219, 254, 0.38) 0%, rgba(191, 219, 254, 0) 34%),
    linear-gradient(180deg, #f9fbff 0%, var(--bg) 100%);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.home-page {
  background:
    radial-gradient(circle at top left, rgba(191, 219, 254, 0.52) 0%, rgba(191, 219, 254, 0) 32%),
    radial-gradient(circle at top right, rgba(219, 234, 254, 0.42) 0%, rgba(219, 234, 254, 0) 26%),
    linear-gradient(180deg, #f8fbff 0%, #f1f5fb 54%, var(--bg) 100%);
}

.app {
  flex: 1;
  width: min(100%, var(--content-max));
  margin: 0 auto;
  padding: 30px 20px 64px;
}

.home-app {
  width: min(100%, var(--content-wide));
  padding-top: 18px;
  padding-bottom: 44px;
}

.site-footer {
  width: min(calc(100% - 40px), var(--content-max));
  margin: 12px auto 32px;
  padding: 24px 0 0;
  border-top: 1px solid var(--border);
  text-align: center;
}

.site-footer-text {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.7;
}

.site-footer-text + .site-footer-text {
  margin-top: 8px;
}

.site-footer-link {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.site-footer-link:hover {
  text-decoration: underline;
}

.topbar {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 28px;
  padding: 28px 30px;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88) 0%, rgba(247, 250, 255, 0.96) 100%);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  margin: 0 0 14px;
  padding: 7px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.76);
  color: var(--primary);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

h1 {
  margin: 0;
  font-size: clamp(2.55rem, 5vw, 3.55rem);
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.subtitle {
  max-width: 48ch;
  margin: 14px 0 0;
  color: var(--text-soft);
  font-size: 1.04rem;
  line-height: 1.65;
}

.home-page .home-hero {
  position: relative;
  min-height: clamp(620px, 88vh, 860px);
  align-items: center;
  overflow: hidden;
  margin-bottom: 36px;
  padding: clamp(36px, 6vw, 64px);
  border: 1px solid rgba(191, 219, 254, 0.72);
  border-radius: 36px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94) 0%, rgba(246, 250, 255, 0.96) 56%, rgba(240, 246, 255, 0.98) 100%);
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.1);
  isolation: isolate;
}

.home-page .home-hero::before {
  content: "";
  position: absolute;
  top: -72px;
  right: -44px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.16) 0%, rgba(37, 99, 235, 0) 72%);
  pointer-events: none;
}

.home-page .home-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.54) 0%, rgba(255, 255, 255, 0) 62%);
  pointer-events: none;
}

.home-page .home-hero-copy {
  position: relative;
  z-index: 1;
  max-width: 660px;
}

.home-hero-support {
  display: grid;
  gap: 12px;
  max-width: 54ch;
  margin-top: 22px;
}

.home-hero-support .step-text {
  margin-bottom: 0;
  color: #4b5d72;
  font-size: 1.01rem;
  line-height: 1.72;
}

.home-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 26px;
}

.home-page .home-hero h1 {
  max-width: 10ch;
  font-size: clamp(3rem, 7vw, 4.5rem);
}

.home-page .home-hero .subtitle {
  max-width: 36ch;
  color: #46596f;
  font-size: 1.08rem;
  line-height: 1.62;
}

.home-page .home-cta {
  min-width: 172px;
  padding-inline: 22px;
  letter-spacing: -0.01em;
}

.ghost-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.ghost-link:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.question-card,
.step-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(248, 251, 255, 0.98) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
}

.question-card {
  overflow: visible;
  padding: 28px 30px;
  margin-bottom: 26px;
  z-index: 0;
}

.question-card.menu-open {
  z-index: 30;
}

.home-page .home-level-card {
  scroll-margin-top: 24px;
  padding-top: 30px;
  border-color: rgba(191, 219, 254, 0.74);
  background: linear-gradient(180deg, rgba(245, 249, 255, 0.98) 0%, rgba(255, 255, 255, 0.98) 100%);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.07);
}

.home-step-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid rgba(75, 116, 230, 0.16);
  border-radius: var(--radius-pill);
  background: rgba(75, 116, 230, 0.08);
  color: var(--primary);
}

.home-step-label::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 5px rgba(75, 116, 230, 0.08);
}

.home-level-intro {
  max-width: 42ch;
  margin-bottom: 20px;
  color: #4f6075;
}

.home-page .home-level-card h2 {
  margin-bottom: 10px;
}

.question-label {
  margin: 0 0 10px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

.question-math {
  font-size: 1.1rem;
}

.question-math .katex-display {
  margin: 0.75em 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
}

.question-prompt {
  margin: 0.75em 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.05rem, 3.8vw, 2.45rem);
  line-height: 1.35;
  letter-spacing: 0.01em;
}

.question-note {
  margin-top: 16px;
  color: var(--text-soft);
}

.attempt-note {
  margin: 16px 0 18px;
  padding: 15px 18px;
  background: linear-gradient(180deg, rgba(246, 249, 255, 0.98) 0%, rgba(251, 253, 255, 0.98) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-soft);
}

.hint-intro {
  margin-bottom: 20px;
}

.hint-list {
  display: grid;
  gap: 14px;
  margin-bottom: 20px;
}

.hint-item {
  padding: 18px 20px;
  background: linear-gradient(180deg, rgba(246, 249, 255, 0.98) 0%, rgba(251, 253, 255, 0.98) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-soft);
}

.hint-item .step-number {
  margin-bottom: 0;
}

.hint-toggle-btn {
  margin-top: 12px;
}

.hint-body {
  margin-top: 14px;
}

.hint-body .step-text {
  margin-bottom: 0;
}

.gate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 20px;
}

.question-entry-actions {
  position: relative;
  align-items: stretch;
  margin-top: 4px;
  margin-bottom: 0;
  z-index: 2;
}

.question-entry-actions > .nav-btn,
.question-entry-actions > .question-menu {
  flex: 1 1 180px;
}

.question-entry-actions > .nav-btn,
.question-menu-button {
  width: 100%;
}

.question-menu {
  position: relative;
}

.question-menu-panel {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  min-width: 220px;
  padding: 10px;
  display: grid;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-soft);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(246, 250, 255, 0.98) 100%);
  box-shadow: var(--shadow-soft);
  z-index: 20;
}

.question-menu-option {
  width: 100%;
  min-width: 0;
  justify-content: flex-start;
}

.answer-card .hint-body {
  margin-top: 8px;
}

.step-card {
  padding: 30px;
}

.hidden {
  display: none !important;
}

.step-number {
  display: inline-flex;
  align-items: center;
  margin: 0 0 14px;
  padding: 7px 12px;
  border: 1px solid rgba(75, 116, 230, 0.14);
  border-radius: var(--radius-pill);
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

h2 {
  margin: 0 0 12px;
  font-size: clamp(1.55rem, 3vw, 2.05rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.step-text {
  margin: 0 0 18px;
  color: var(--text-soft);
  line-height: 1.68;
}

.button-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 18px 0 16px;
}

.button-grid.two-col {
  grid-template-columns: 1fr;
}

.option-btn,
.nav-btn {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  border-radius: 16px;
  padding: 14px 18px;
  font-size: 1rem;
  line-height: 1.35;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.05);
}

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

.option-btn:hover,
.nav-btn:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: 0 14px 24px rgba(15, 23, 42, 0.08);
}

.nav-btn.is-disabled,
.nav-btn[aria-disabled="true"],
.nav-btn:disabled {
  opacity: 0.56;
  cursor: not-allowed;
  pointer-events: none;
  transform: none;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.03);
}

.option-btn:focus-visible,
.nav-btn:focus-visible,
.ghost-link:focus-visible,
.site-footer-link:focus-visible {
  outline: none;
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.feedback {
  min-height: 56px;
  margin-top: 8px;
  padding: 15px 18px;
  border-radius: var(--radius-soft);
  border: 1px solid transparent;
  line-height: 1.65;
  color: var(--text-soft);
}

.feedback.success {
  background: linear-gradient(180deg, var(--success-bg) 0%, #eef8f2 100%);
  border-color: var(--success-border);
  color: #245a43;
}

.feedback.error {
  background: linear-gradient(180deg, var(--error-bg) 0%, #fff2f2 100%);
  border-color: var(--error-border);
  color: #8d3c3c;
}

.feedback .math-block,
.feedback .answer-highlight,
.feedback .callout-card {
  margin: 12px 0 0;
}

.feedback .step-text:last-child,
.feedback .katex-display:last-child {
  margin-bottom: 0;
}

.next-step-btn {
  margin-top: 12px;
}

.walkthrough-step-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 18px;
}

.graph-card {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(280px, 1.2fr);
  gap: 20px;
  margin-top: 20px;
  align-items: start;
}

.graph-copy h3 {
  margin: 0 0 12px;
  font-size: 1.3rem;
}

.graph-control,
.graph-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  color: var(--text);
  font-weight: 600;
}

.graph-control span:first-child {
  min-width: 54px;
}

.graph-frame {
  background: linear-gradient(180deg, rgba(247, 250, 255, 0.98) 0%, rgba(255, 255, 255, 0.98) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-soft);
  padding: 14px;
  overflow: hidden;
}

.question-graph-frame {
  margin: 12px 0 18px;
  background: #ffffff;
}

.interactive-plot-frame {
  border-color: rgba(75, 116, 230, 0.16);
  box-shadow: inset 0 0 0 1px rgba(75, 116, 230, 0.04);
}

.graph-svg {
  width: 100%;
  height: auto;
  display: block;
}

.interactive-plot-svg {
  cursor: crosshair;
  touch-action: none;
}

.graph-bg {
  fill: #ffffff;
}

.graph-grid-line {
  stroke: #dbe3ee;
  stroke-width: 1;
}

.graph-axis {
  stroke: #66758f;
  stroke-width: 1.6;
}

.graph-curve {
  fill: none;
  stroke: #ef4444;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.graph-normal {
  stroke: #1d4ed8;
  stroke-width: 2.25;
}

.question-normal {
  stroke: #111827;
  stroke-width: 1.35;
}

.graph-point {
  fill: var(--primary);
  stroke: white;
  stroke-width: 2;
}

.graph-point-secondary {
  fill: #0f766e;
  stroke: white;
  stroke-width: 2;
}

.graph-point-draggable {
  fill: #ef4444;
  stroke: white;
  stroke-width: 2.5;
  filter: drop-shadow(0 6px 12px rgba(239, 68, 68, 0.22));
}

.graph-label {
  fill: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.graph-draggable-label {
  fill: #b91c1c;
}

.graph-equation-label {
  fill: var(--text);
  font-size: 15px;
  font-weight: 800;
}

.graph-curve-secondary {
  fill: none;
  stroke: #0f766e;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.graph-legend-chip {
  fill: rgba(255, 255, 255, 0.92);
  stroke: var(--border);
  stroke-width: 1;
}

.graph-legend-line-primary {
  stroke: #ef4444;
  stroke-width: 3;
  stroke-linecap: round;
}

.graph-legend-line-secondary {
  stroke: #0f766e;
  stroke-width: 3;
  stroke-linecap: round;
}

.question-curve {
  fill: none;
  stroke: #111827;
  stroke-width: 2;
}

.question-dot {
  fill: #111827;
}

.question-origin {
  fill: #ffffff;
  stroke: #111827;
  stroke-width: 1.4;
}

.plot-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.plot-status {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.98rem;
  line-height: 1.45;
}

.question-label-mark,
.question-axis-label {
  fill: #111827;
}

.math-block {
  background: linear-gradient(180deg, rgba(246, 249, 255, 0.98) 0%, rgba(251, 253, 255, 0.98) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-soft);
  padding: 18px 20px;
  margin: 16px 0 20px;
  overflow-x: auto;
}

.answer-highlight {
  margin: 18px 0 20px;
  padding: 20px 22px;
  background: linear-gradient(180deg, rgba(244, 248, 255, 0.98) 0%, rgba(236, 243, 255, 0.98) 100%);
  border: 1px solid rgba(75, 116, 230, 0.18);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-soft);
}

.answer-highlight .question-label {
  margin-bottom: 10px;
  color: var(--primary);
}

.answer-highlight .katex-display:last-child {
  margin-bottom: 0;
}

.callout-card {
  margin: 16px 0 20px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-soft);
}

.callout-card.tip {
  background: linear-gradient(180deg, rgba(246, 249, 255, 0.98) 0%, rgba(251, 253, 255, 0.98) 100%);
  border-color: rgba(75, 116, 230, 0.18);
}

.callout-card.mistake {
  background: linear-gradient(180deg, #fff9f0 0%, #fffdf9 100%);
  border-color: rgba(245, 158, 11, 0.18);
}

.callout-card.review {
  background: linear-gradient(180deg, #fffcef 0%, #fffef8 100%);
  border-color: rgba(234, 179, 8, 0.18);
}

.callout-title {
  margin: 0 0 6px;
  font-size: 0.95rem;
  font-weight: 700;
}

.callout-card .step-text {
  margin-bottom: 0;
}

.math-input-group {
  margin: 18px 0 16px;
}

.math-answer-input {
  width: 100%;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.96);
  color: var(--text);
  border-radius: 16px;
  padding: 15px 18px;
  font-size: 1rem;
  line-height: 1.35;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.05);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.math-answer-input:focus {
  outline: none;
  border-color: rgba(75, 116, 230, 0.34);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.math-preview {
  min-height: 74px;
  margin-top: 12px;
  padding: 18px 20px;
  background: linear-gradient(180deg, rgba(246, 249, 255, 0.98) 0%, rgba(251, 253, 255, 0.98) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-soft);
  overflow-x: auto;
  color: var(--text);
}

.math-preview.is-placeholder,
.math-preview.is-error {
  display: flex;
  align-items: center;
  color: var(--muted);
}

.math-preview .katex-display {
  margin: 0;
}

.check-btn {
  margin-top: 12px;
}

.nav-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 26px;
}

.index-nav {
  flex-wrap: wrap;
  justify-content: flex-start;
}

.year-picker-card {
  overflow: hidden;
}

.year-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.home-page .year-picker-grid {
  gap: 18px;
}

.year-option {
  width: 100%;
  min-height: 110px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 8px;
  text-align: left;
}

.home-page .year-option {
  position: relative;
  min-height: 132px;
  padding: 22px 22px 24px;
  padding-right: calc(var(--card-action-size) + var(--card-action-offset) + 24px);
  border-color: var(--border);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(246, 250, 255, 0.98) 100%);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.home-page .year-option::after,
.home-page .index-link-card::after {
  content: "\2192";
  position: absolute;
  right: var(--card-action-offset);
  bottom: var(--card-action-offset);
  display: grid;
  place-items: center;
  width: var(--card-action-size);
  height: var(--card-action-size);
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 1rem;
  line-height: 1;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.home-page .year-option:hover,
.home-page .index-link-card:hover {
  transform: translateY(-3px);
  border-color: rgba(75, 116, 230, 0.28);
  box-shadow: var(--shadow-lift);
}

.home-page .year-option:hover::after,
.home-page .index-link-card:hover::after {
  transform: translateX(2px);
  background: rgba(75, 116, 230, 0.18);
}

.year-option.secondary {
  color: var(--text);
}

.year-option.secondary.is-active {
  background: linear-gradient(180deg, rgba(75, 116, 230, 0.1) 0%, rgba(255, 255, 255, 0.98) 100%);
  color: var(--text);
  border-color: rgba(75, 116, 230, 0.34);
}

.home-page .year-option.secondary.is-active {
  background: linear-gradient(180deg, rgba(75, 116, 230, 0.12) 0%, rgba(255, 255, 255, 0.98) 100%);
  border-color: rgba(75, 116, 230, 0.34);
  box-shadow: 0 14px 28px rgba(75, 116, 230, 0.14);
}

.home-page .year-option.secondary.is-active::after {
  background: rgba(75, 116, 230, 0.18);
  color: var(--primary);
}

.year-option.secondary.is-active:hover {
  background: linear-gradient(180deg, rgba(75, 116, 230, 0.14) 0%, rgba(255, 255, 255, 0.98) 100%);
  border-color: rgba(75, 116, 230, 0.36);
}

.home-page .year-option.secondary.is-active:hover {
  background: linear-gradient(180deg, rgba(75, 116, 230, 0.16) 0%, rgba(255, 255, 255, 0.98) 100%);
  border-color: rgba(75, 116, 230, 0.38);
}

.year-option-title,
.year-option-copy {
  display: block;
}

.year-option-title {
  font-size: 1.15rem;
  line-height: 1.2;
}

.year-option-copy {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
  font-weight: 500;
}

.year-option.secondary.is-active .year-option-copy {
  color: var(--text-soft);
}

.paper-panel {
  scroll-margin-top: 24px;
}

.home-page .paper-panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.97) 0%, rgba(244, 249, 255, 0.98) 100%);
}

.standard-section {
  padding: 22px 24px 24px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(247, 250, 255, 0.98) 0%, rgba(255, 255, 255, 0.98) 100%);
  scroll-margin-top: 24px;
}

.home-page .standard-section {
  padding: 24px 24px 26px;
  border-color: rgba(200, 213, 230, 0.86);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(250, 252, 255, 0.98) 0%, rgba(243, 248, 255, 0.98) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.standard-section + .standard-section {
  margin-top: 20px;
}

.paper-picker-grid {
  margin-bottom: 8px;
}

.paper-year-panel {
  margin-top: 20px;
}

.home-page .paper-year-panel {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid rgba(200, 213, 230, 0.72);
}

.standard-title {
  margin: 0 0 12px;
  font-size: 1.4rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.index-group + .index-group {
  margin-top: 24px;
}

.home-page .index-group + .index-group {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid rgba(200, 213, 230, 0.64);
}

.index-group-label {
  margin-bottom: 14px;
}

.nav-btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 152px;
  font-weight: 600;
}

.index-link-card {
  position: relative;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 8px;
  width: calc(50% - 6px);
  min-height: 128px;
  padding: 20px 22px 54px;
  padding-right: calc(var(--card-action-size) + var(--card-action-offset) + 24px);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(246, 250, 255, 0.98) 100%);
  border-color: var(--border);
  text-align: left;
}

.home-page .index-link-card {
  width: calc(50% - 8px);
  border-radius: 20px;
}

.home-page .index-link-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0) 48%);
  pointer-events: none;
}

.home-page .index-link-card::after {
  background: var(--primary-soft);
  color: var(--primary);
}

.home-page .index-link-title,
.home-page .index-link-copy {
  position: relative;
  z-index: 1;
}

.home-page .index-link-title {
  letter-spacing: -0.015em;
}

.home-page .index-link-copy {
  color: var(--text-soft);
}

.index-link-title {
  display: block;
  font-size: 1.15rem;
  line-height: 1.2;
}

.index-link-copy {
  display: block;
  font-size: 0.92rem;
  line-height: 1.45;
  font-weight: 500;
  color: var(--text-soft);
}

.nav-btn:not(.secondary):not(.index-link-card) {
  background: linear-gradient(180deg, #5b86f5 0%, var(--primary) 100%);
  color: white;
  border-color: transparent;
  box-shadow: 0 12px 24px rgba(75, 116, 230, 0.22);
}

.nav-btn:not(.secondary):not(.index-link-card):hover {
  background: linear-gradient(180deg, #4e7ef2 0%, var(--primary-dark) 100%);
  border-color: transparent;
  box-shadow: 0 16px 30px rgba(75, 116, 230, 0.26);
}

.nav-btn.secondary {
  background: rgba(255, 255, 255, 0.9);
}

.home-page .home-footer {
  width: min(calc(100% - 40px), var(--content-wide));
  margin: 8px auto 36px;
  padding: 28px 0 0;
}

.home-page .home-footer .site-footer-text {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  color: #627086;
  line-height: 1.7;
}

@media (max-width: 700px) {
  .topbar {
    flex-direction: column;
    padding: 24px 22px;
  }

  .button-grid {
    grid-template-columns: 1fr;
  }

  .nav-row {
    flex-direction: column;
  }

  .question-entry-actions {
    flex-direction: column;
  }

  .question-menu-panel {
    position: static;
    min-width: 0;
    margin-top: 10px;
  }

  .index-link-card {
    width: 100%;
    min-height: 0;
  }

  .graph-card {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: clamp(2.15rem, 10vw, 2.7rem);
  }

  h2 {
    font-size: 1.45rem;
  }

  .home-app {
    padding: 26px 16px 36px;
  }

  .home-page .home-hero {
    min-height: auto;
    padding: 32px 24px;
    border-radius: 28px;
    margin-bottom: 24px;
  }

  .home-page .home-hero h1 {
    max-width: none;
    font-size: clamp(2.55rem, 11vw, 3.3rem);
  }

  .home-page .home-hero .subtitle {
    font-size: 1rem;
  }

  .question-card,
  .step-card {
    padding: 22px 20px;
  }

  .question-card {
    margin-bottom: 22px;
  }

  .home-page .year-picker-grid {
    gap: 12px;
  }

  .home-page .year-option,
  .home-page .index-link-card {
    width: 100%;
    min-height: 0;
    padding: 18px 18px 54px;
  }

  .home-page .home-level-card {
    padding-top: 24px;
  }

  .home-page .standard-section {
    padding: 20px 18px 22px;
  }

  .home-page .paper-year-panel {
    padding-top: 18px;
  }

  .home-page .home-footer {
    width: calc(100% - 32px);
    margin-bottom: 28px;
    padding-top: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
}
