:root {
  color-scheme: light;
  --font-scale: 1;
  --page-bg: #eef4f1;
  --surface: rgba(255, 255, 251, 0.94);
  --surface-strong: #fffffb;
  --surface-muted: rgba(231, 240, 236, 0.92);
  --ink: #102033;
  --ink-soft: #40506a;
  --accent: #0b766f;
  --accent-strong: #06534f;
  --accent-soft: rgba(11, 118, 111, 0.13);
  --accent-warm: #d95f3f;
  --accent-yellow: #f4c84f;
  --success: #11643f;
  --success-soft: rgba(17, 100, 63, 0.14);
  --danger: #9a263f;
  --danger-soft: rgba(154, 38, 63, 0.14);
  --outline: #102033;
  --border: rgba(16, 32, 51, 0.18);
  --shadow: 0 20px 54px rgba(16, 32, 51, 0.11);
  --radius-xl: 18px;
  --radius-lg: 12px;
  --radius-md: 8px;
  --radius-sm: 6px;
  --content-max: 1180px;
  --focus-ring: 0 0 0 4px rgba(11, 122, 117, 0.22);
  --font-body: "Avenir Next", "Trebuchet MS", "Verdana", sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
}

html {
  font-size: calc(100% * var(--font-scale));
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(11, 118, 111, 0.13) 0 18%, transparent 18% 100%),
    linear-gradient(225deg, rgba(217, 95, 63, 0.12) 0 12%, transparent 12% 100%),
    linear-gradient(180deg, #f8fbf9 0%, var(--page-bg) 52%, #e2ece8 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(17, 32, 60, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 32, 60, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.8), transparent 92%);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

button,
input,
textarea,
select {
  font: inherit;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

.skip-link,
.sr-only {
  position: absolute;
}

.skip-link {
  left: 1rem;
  top: -4rem;
  z-index: 100;
  background: #ffffff;
  color: #000000;
  padding: 0.8rem 1rem;
  border-radius: 999px;
  border: 2px solid currentColor;
  text-decoration: none;
}

.skip-link:focus-visible {
  top: 1rem;
}

.sr-only {
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page-shell {
  width: min(100%, calc(var(--content-max) + 3rem));
  margin: 0 auto;
  padding: 1.2rem 1rem 2rem;
}

.site-header,
.hero-layout,
.training-section,
.lesson-topbar,
.slide-card,
.site-footer {
  position: relative;
  z-index: 1;
}

.site-header {
  display: grid;
  gap: 1.5rem;
  align-items: end;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.8fr);
  padding: 1.6rem 0 2rem;
}

.brand-cluster h1,
.hero-note h2,
.lesson-heading h2,
.section-heading h2 {
  font-family: var(--font-display);
  letter-spacing: -0.03em;
}

.brand-cluster h1 {
  margin: 0;
  font-size: clamp(2.4rem, 7vw, 5rem);
  line-height: 0.95;
  max-width: 10ch;
}

.eyebrow,
.hero-kicker,
.lesson-meta {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.lead {
  margin: 1rem 0 0;
  max-width: 58ch;
  font-size: 1.08rem;
  line-height: 1.7;
  color: var(--ink-soft);
}

.accessibility-panel {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  border-radius: var(--radius-lg);
  background: var(--surface);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(17, 32, 60, 0.08);
  box-shadow: var(--shadow);
  align-self: start;
}

.preference-controls {
  display: grid;
  gap: 1rem;
}

.control-group {
  display: grid;
  gap: 0.55rem;
}

.control-label {
  font-size: 0.95rem;
  font-weight: 700;
}

.segmented-control {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.control-chip,
.flag-button,
.preferences-toggle,
.contrast-toggle,
.ghost-button,
.primary-button,
.secondary-button,
.training-tile,
.dropzone-button {
  min-height: 56px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background-color 180ms ease,
    color 180ms ease,
    border-color 180ms ease;
}

.control-chip,
.flag-button,
.preferences-toggle,
.contrast-toggle,
.ghost-button,
.secondary-button {
  background: #ffffff;
  color: var(--ink);
  border: 1px solid var(--border);
}

.control-chip {
  padding: 0.65rem 1rem;
  font-weight: 700;
}

.language-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.flag-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-width: 84px;
  padding: 0.55rem 0.8rem;
  font-weight: 800;
}

.preferences-toggle {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 0.8rem 0.95rem;
  text-align: left;
  font-weight: 800;
}

.preferences-summary {
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 700;
}

.control-chip[aria-pressed="true"],
.flag-button[aria-pressed="true"],
.contrast-toggle[aria-pressed="true"] {
  background: var(--ink);
  color: #ffffff;
  border-color: var(--ink);
}

.contrast-toggle {
  padding: 0.8rem 1rem;
  justify-self: start;
  font-weight: 700;
}

.hero-layout {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 0.8fr);
  align-items: stretch;
}

.hero-poster,
.guide-panel,
.training-section,
.slide-card,
.noscript-note {
  border-radius: var(--radius-xl);
  background: var(--surface);
  border: 1px solid rgba(17, 32, 60, 0.08);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.hero-poster {
  overflow: hidden;
  padding: clamp(1.4rem, 3vw, 2.4rem);
  min-height: 420px;
  background:
    linear-gradient(135deg, rgba(255, 255, 251, 0.94), rgba(237, 247, 243, 0.82)),
    repeating-linear-gradient(90deg, rgba(16, 32, 51, 0.05) 0 1px, transparent 1px 36px);
}

.hero-poster::before,
.hero-poster::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.hero-poster::before {
  width: 180px;
  height: 520px;
  right: 18px;
  top: -84px;
  border-radius: 0;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(217, 95, 63, 0.28) 0 10px,
      transparent 10px 22px
    );
  transform: rotate(10deg);
  opacity: 0.48;
}

.hero-poster::after {
  width: 100%;
  height: 10px;
  left: 0;
  bottom: 0;
  border-radius: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-yellow), var(--accent-warm));
}

.hero-note {
  max-width: 38rem;
  position: relative;
  z-index: 1;
}

.hero-note h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.8rem);
  line-height: 1.03;
}

.hero-copy {
  margin: 1rem 0 0;
  max-width: 38ch;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--ink-soft);
}

.hero-gridline {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
  margin-top: 2.2rem;
  position: relative;
  z-index: 1;
}

.poster-stat {
  min-height: 140px;
  display: grid;
  align-content: end;
  padding: 1rem;
  border-radius: var(--radius-md);
  background:
    linear-gradient(180deg, rgba(255, 255, 251, 0.96), rgba(235, 244, 240, 0.9));
  border: 1px solid rgba(17, 32, 60, 0.08);
}

.poster-number {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4rem);
  line-height: 0.95;
}

.poster-label {
  margin-top: 0.65rem;
  color: var(--ink-soft);
  font-weight: 700;
}

.guide-panel {
  padding: 1.35rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 251, 0.96), rgba(229, 239, 235, 0.88));
}

.guide-panel h2,
.section-heading h2,
.lesson-heading h2 {
  margin: 0;
  font-size: clamp(1.6rem, 3.2vw, 2.5rem);
}

.guide-list,
.summary-list,
.detail-list {
  margin: 1rem 0 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.9rem;
  line-height: 1.6;
}

.guide-list strong {
  color: var(--accent-strong);
}

.training-section {
  margin-top: 1.4rem;
  padding: clamp(1.25rem, 3vw, 2rem);
}

.progress-overview {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(220px, 1fr) minmax(220px, 0.9fr);
  gap: 1rem;
  align-items: center;
  margin-top: 1.4rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-md);
  background:
    linear-gradient(90deg, rgba(255, 255, 251, 0.98), rgba(236, 246, 241, 0.92));
  border: 1px solid rgba(16, 32, 51, 0.13);
  box-shadow: 0 16px 42px rgba(16, 32, 51, 0.08);
}

.progress-overview h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  line-height: 1.1;
}

.overall-meter,
.tile-progress {
  width: 100%;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(16, 32, 51, 0.1);
}

.overall-meter {
  height: 16px;
}

.overall-meter-bar,
.tile-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-yellow), var(--accent-warm));
  transition: width 260ms ease;
}

.progress-overview-text {
  margin: 0;
  color: var(--ink-soft);
  font-weight: 700;
  line-height: 1.45;
}

.section-heading {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
}

.training-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.training-tile {
  width: 100%;
  text-align: left;
  min-height: 250px;
  padding: 1.25rem;
  border-radius: var(--radius-md);
  background:
    linear-gradient(180deg, rgba(255, 255, 251, 0.98), rgba(239, 246, 243, 0.94));
  border: 1px solid rgba(16, 32, 51, 0.13);
  box-shadow: 0 14px 34px rgba(16, 32, 51, 0.08);
}

.training-tile.is-complete {
  background:
    linear-gradient(180deg, rgba(238, 251, 243, 0.98), rgba(247, 251, 241, 0.94));
  border-color: rgba(15, 107, 63, 0.24);
}

.tile-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  min-height: 36px;
  padding: 0.2rem 0.85rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 800;
}

.training-tile.is-complete .tile-index {
  background: var(--success-soft);
  color: var(--success);
}

.tile-title {
  margin: 1rem 0 0.5rem;
  font-size: 1.35rem;
  line-height: 1.15;
}

.tile-copy {
  margin: 0;
  line-height: 1.55;
  color: var(--ink-soft);
}

.tile-progress {
  height: 9px;
  margin-top: 1rem;
}

.tile-progress-copy,
.tile-inputs {
  margin: 0.6rem 0 0;
  color: var(--ink-soft);
  font-size: 0.94rem;
  line-height: 1.45;
}

.tile-progress-copy {
  font-weight: 800;
  color: var(--ink);
}

.tile-action {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 46px;
  margin-top: 1.05rem;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  background: var(--ink);
  color: #ffffff;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 12px 28px rgba(16, 32, 51, 0.16);
}

.tile-action-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 999px;
  background: var(--accent-yellow);
  color: var(--ink);
  transition: transform 180ms ease;
}

.training-tile:hover .tile-action-arrow {
  transform: translateX(2px);
}

.training-tile.is-complete .tile-action {
  background: var(--success);
}

.tile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1rem;
}

.tile-tag,
.slide-tag,
.hint-badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
  background: rgba(17, 32, 60, 0.06);
  color: var(--ink);
}

.tile-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  font-weight: 700;
  color: var(--success);
}

.view.is-hidden {
  display: none;
}

.lesson-topbar {
  display: grid;
  gap: 1rem;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  margin-top: 0.4rem;
}

.lesson-heading {
  justify-self: center;
  text-align: center;
}

.ghost-button,
.secondary-button,
.primary-button,
.dropzone-button {
  padding: 0.85rem 1.2rem;
  font-weight: 700;
}

.primary-button {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 16px 36px rgba(11, 122, 117, 0.22);
}

.primary-button[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.progress-cluster {
  margin: 1rem auto 1.2rem;
  width: min(760px, 100%);
}

.progress-track {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(17, 32, 60, 0.1);
  overflow: hidden;
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #12a09a);
  transition: width 260ms ease;
}

.progress-text {
  margin: 0.7rem 0 0;
  font-weight: 700;
  color: var(--ink-soft);
  text-align: center;
}

.slide-card {
  width: min(920px, 100%);
  margin: 0 auto;
  padding: clamp(1.2rem, 2.6vw, 2rem);
  outline: none;
}

.slide-layout {
  display: grid;
  gap: 1.35rem;
}

.slide-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.slide-layout h3 {
  margin: 0;
  font-size: clamp(1.9rem, 4vw, 3rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
}

.slide-copy {
  max-width: 58ch;
  font-size: 1.06rem;
  line-height: 1.7;
  color: var(--ink-soft);
}

.info-grid,
.exercise-panel,
.summary-grid {
  display: grid;
  gap: 1.2rem;
}

.info-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  align-items: start;
}

.callout,
.markup-block,
.result-panel,
.preview-panel,
.kbd-panel {
  padding: 1rem 1.05rem;
  border-radius: var(--radius-lg);
  background: var(--surface-muted);
  border: 1px solid rgba(17, 32, 60, 0.08);
}

.callout h4,
.preview-panel h4,
.kbd-panel h4 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.markup-block pre {
  margin: 0;
  overflow-x: auto;
  font-size: 0.98rem;
  line-height: 1.5;
}

.exercise-panel {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.7fr);
  align-items: start;
}

.exercise-card {
  display: grid;
  gap: 1rem;
  padding: clamp(1rem, 2vw, 1.3rem);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 250, 242, 0.92));
  border: 1px solid rgba(17, 32, 60, 0.08);
}

.exercise-card fieldset,
.validation-form fieldset,
.captcha-form fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.exercise-card legend,
.validation-form legend,
.captcha-form legend {
  padding: 0;
  margin: 0 0 0.75rem;
  font-size: 1.08rem;
  font-weight: 800;
}

.exercise-prompt {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.45;
}

.form-field,
.field-cluster {
  display: grid;
  gap: 0.5rem;
}

.form-field label,
.field-cluster label {
  font-weight: 700;
}

.input-shell,
.select-shell,
.textarea-shell {
  position: relative;
}

.input-shell input,
.textarea-shell textarea,
.select-shell select,
.validation-form input,
.range-input,
.dropzone-input {
  width: 100%;
  min-height: 64px;
  padding: 0.95rem 1rem;
  border-radius: var(--radius-md);
  border: 2px solid rgba(17, 32, 60, 0.16);
  background: #fffdf8;
  color: var(--ink);
}

.textarea-shell textarea {
  min-height: 148px;
  resize: vertical;
}

.select-shell::after {
  content: "▾";
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--ink-soft);
}

.select-shell select {
  appearance: none;
}

.input-shell input[type="range"],
.range-input {
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
}

.range-output {
  display: inline-flex;
  justify-content: center;
  min-width: 72px;
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 800;
}

.control-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
}

.color-shell {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
}

.color-shell input[type="color"] {
  width: 88px;
  min-height: 56px;
  padding: 0.35rem;
}

.complex-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.complex-form-grid .mini-fieldset,
.complex-form-grid .complex-consent {
  grid-column: 1 / -1;
}

.mini-fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.mini-fieldset legend {
  margin: 0 0 0.65rem;
  padding: 0;
  font-weight: 800;
}

.helper-text {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.55;
}

.result-panel {
  display: none;
  line-height: 1.6;
}

.result-panel.is-visible {
  display: block;
}

.result-panel.is-success {
  background: var(--success-soft);
  border-color: rgba(15, 107, 63, 0.2);
  color: var(--success);
}

.result-panel.is-error {
  background: var(--danger-soft);
  border-color: rgba(143, 38, 57, 0.24);
  color: var(--danger);
}

.choice-group,
.radio-grid {
  display: grid;
  gap: 0.75rem;
}

.choice-option,
.radio-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.85rem;
  align-items: center;
  padding: 0.95rem 1rem;
  border-radius: var(--radius-md);
  border: 2px solid rgba(17, 32, 60, 0.12);
  background: #fffdf8;
}

.choice-option input,
.radio-option input {
  width: 1.3rem;
  height: 1.3rem;
  margin: 0;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1rem;
  border-radius: var(--radius-md);
  border: 2px solid rgba(17, 32, 60, 0.12);
  background: #fffdf8;
}

.switch-control {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.switch-control input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.switch-visual {
  width: 72px;
  height: 40px;
  border-radius: 999px;
  background: rgba(17, 32, 60, 0.14);
  position: relative;
  transition: background-color 180ms ease;
}

.switch-visual::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(17, 32, 60, 0.18);
  transition: transform 180ms ease;
}

.switch-control input:checked + .switch-visual {
  background: var(--accent);
}

.switch-control input:checked + .switch-visual::after {
  transform: translateX(32px);
}

.dropzone {
  display: grid;
  gap: 0.9rem;
  padding: 1.1rem;
  border-radius: var(--radius-lg);
  border: 2px dashed rgba(17, 32, 60, 0.24);
  background: linear-gradient(180deg, rgba(255, 252, 247, 0.96), rgba(249, 243, 231, 0.9));
}

.dropzone.is-dragover {
  border-color: var(--accent);
  background: linear-gradient(180deg, rgba(238, 255, 252, 0.98), rgba(240, 250, 247, 0.92));
}

.dropzone-button {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid rgba(17, 32, 60, 0.16);
}

.dropzone input[type="file"] {
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
}

.preview-panel {
  display: grid;
  gap: 0.75rem;
}

.preview-image {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid rgba(17, 32, 60, 0.12);
}

.preview-meta {
  margin: 0;
  line-height: 1.6;
  color: var(--ink-soft);
}

.summary-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
}

.microcopy {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.6;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  padding: 1.6rem 0 0.5rem;
}

.preview-demo {
  display: grid;
  gap: 0.75rem;
}

.preview-demo input:disabled,
.preview-demo textarea:disabled,
.preview-demo select:disabled,
.preview-demo button:disabled {
  opacity: 1;
  color: var(--ink);
}

.preview-demo button:disabled {
  cursor: default;
}

.coffee-link,
.repo-link {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 48px;
  padding: 0.8rem 1.1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(17, 32, 60, 0.12);
  text-decoration: none;
  font-weight: 700;
}

.repo-link {
  background: var(--ink);
  color: #ffffff;
}

.coffee-icon,
.repo-icon {
  display: inline-flex;
  width: 1.25rem;
  height: 1.25rem;
}

.noscript-note {
  margin-bottom: 1rem;
  padding: 1rem 1.2rem;
  line-height: 1.6;
}

button:hover,
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
.training-tile:focus-visible,
.dropzone:focus-within,
.choice-option:focus-within,
.radio-option:focus-within,
.switch-row:focus-within {
  outline: none;
  box-shadow: var(--focus-ring);
}

button[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

button:hover,
.training-tile:hover,
.coffee-link:hover,
.repo-link:hover {
  transform: translateY(-1px);
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  border-color: var(--accent);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

body[data-contrast="high"] {
  --page-bg: #ffffff;
  --surface: #ffffff;
  --surface-strong: #ffffff;
  --surface-muted: #f6f6f6;
  --ink: #000000;
  --ink-soft: #111111;
  --accent: #0039c7;
  --accent-strong: #002894;
  --accent-soft: rgba(0, 57, 199, 0.12);
  --success: #065a00;
  --success-soft: rgba(6, 90, 0, 0.12);
  --danger: #870000;
  --danger-soft: rgba(135, 0, 0, 0.12);
  --border: rgba(0, 0, 0, 0.24);
  --shadow: none;
  --focus-ring: 0 0 0 4px rgba(255, 191, 0, 0.55);
  background:
    linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
}

body[data-contrast="high"]::before {
  opacity: 0.3;
}

@media (max-width: 1080px) {
  .site-header,
  .hero-layout,
  .training-grid,
  .progress-overview,
  .info-grid,
  .exercise-panel,
  .summary-grid,
  .lesson-topbar {
    grid-template-columns: 1fr;
  }

  .lesson-heading {
    justify-self: start;
    text-align: left;
  }

  .progress-cluster,
  .slide-card {
    width: 100%;
  }
}

@media (max-width: 760px) {
  .page-shell {
    padding: 0.8rem 0.8rem 1.3rem;
  }

  .site-header {
    padding-top: 0.8rem;
  }

  .accessibility-panel.is-ready .preferences-toggle {
    display: flex;
    flex-wrap: wrap;
  }

  .accessibility-panel.is-collapsed {
    gap: 0;
    padding: 0.55rem;
  }

  .accessibility-panel.is-collapsed .preference-controls {
    display: none;
  }

  .accessibility-panel.is-collapsed .preferences-toggle {
    background: var(--ink);
    border-color: var(--ink);
    color: #ffffff;
    box-shadow: 0 12px 28px rgba(16, 32, 51, 0.16);
  }

  .accessibility-panel.is-collapsed .preferences-summary {
    color: rgba(255, 255, 255, 0.82);
  }

  .brand-cluster h1 {
    max-width: 8ch;
  }

  .hero-gridline {
    grid-template-columns: 1fr;
  }

  .training-grid {
    gap: 0.85rem;
  }

  .training-tile {
    min-height: 180px;
  }

  .complex-form-grid {
    grid-template-columns: 1fr;
  }

  .action-row {
    align-items: stretch;
  }

  .action-row > * {
    width: 100%;
    justify-content: center;
  }

  .coffee-link,
  .repo-link {
    width: 100%;
    justify-content: center;
  }
}
