:root {
  --navy: #071b2a;
  --navy-2: #0d344d;
  --blue: #17618c;
  --gold: #e7b94f;
  --paper: #f5f1e8;
  --ink: #17222a;
  --white: #fff;
  --muted: #68747c;
}

* { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: Arial, Helvetica, sans-serif; }
button, input { font: inherit; }
button { color: inherit; border: 0; cursor: pointer; }
.skip-link { position: fixed; z-index: 1000; top: .5rem; left: .5rem; padding: .7rem 1rem; color: #fff; background: #000; transform: translateY(-150%); }
.skip-link:focus { transform: none; }
.learning-shell { min-height: 100vh; }
.learning-header { position: sticky; z-index: 60; top: 0; min-height: 64px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; padding: .55rem clamp(.8rem, 3vw, 2.4rem); color: var(--white); background: rgba(7,27,42,.96); border-bottom: 1px solid rgba(255,255,255,.22); backdrop-filter: blur(16px); }
.back-link { color: inherit; text-decoration: none; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.learning-title { text-align: center; }
.learning-title small, .module-kicker, .path-heading small, .progress-heading small { display: block; color: var(--gold); font-size: .63rem; font-weight: 850; letter-spacing: .15em; text-transform: uppercase; }
.learning-title strong { display: block; font-family: Georgia, serif; font-size: 1.05rem; font-weight: 500; }
#progress-toggle { justify-self: end; min-height: 42px; padding: .55rem .8rem; color: #fff; background: transparent; border: 1px solid rgba(255,255,255,.36); border-radius: 3px; font-size: .72rem; font-weight: 750; }
#progress-toggle span { color: var(--gold); }
.learning-intro { max-width: 1040px; margin: 0 auto; padding: clamp(2rem, 6vw, 5rem) clamp(1rem, 4vw, 2rem) 2rem; }
.learning-intro h1 { max-width: 800px; margin: .35rem 0 .8rem; font-family: Georgia, serif; font-size: clamp(2.4rem, 7vw, 5.8rem); font-weight: 500; line-height: .94; }
#module-description { max-width: 720px; color: #3e4b54; font-family: Georgia, serif; font-size: clamp(1.05rem, 2vw, 1.35rem); line-height: 1.55; }
.inquiry { max-width: 780px; margin-top: 1.4rem; padding: .8rem 1rem; border-left: 4px solid var(--gold); background: rgba(255,255,255,.58); }
.inquiry span { color: var(--blue); font-size: .62rem; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
.inquiry p { margin: .25rem 0 0; line-height: 1.5; }
.viewer-stage { position: relative; width: min(1120px, calc(100% - 2rem)); height: min(68vh, 720px); min-height: 440px; margin: 0 auto; overflow: hidden; background: var(--navy); box-shadow: 0 28px 70px rgba(8,24,34,.24); }
#module-frame { width: 100%; height: 100%; border: 0; background: var(--navy); }
.image-controls { position: absolute; z-index: 10; right: 1rem; bottom: 1rem; display: flex; align-items: center; gap: .25rem; padding: .35rem; color: #fff; background: rgba(4,22,34,.9); border: 1px solid rgba(255,255,255,.45); border-radius: 4px; backdrop-filter: blur(12px); }
.image-controls[hidden] { display: none; }
.image-controls button { width: 42px; height: 42px; color: #fff; background: transparent; border-radius: 2px; }
.image-controls button:hover, .image-controls button:focus-visible { color: var(--gold); background: rgba(255,255,255,.1); }
.image-controls i { width: 1px; height: 24px; margin: 0 .2rem; background: rgba(255,255,255,.3); }
.module-navigation { width: min(1120px, calc(100% - 2rem)); margin: 0 auto 4rem; display: grid; grid-template-columns: 1fr minmax(220px, .78fr) 1fr; border: 1px solid #c7c4bb; border-top: 0; background: #fff; }
.module-navigation button { min-height: 82px; display: grid; align-items: center; gap: .65rem; padding: .8rem 1.1rem; background: #fff; }
#previous-module { grid-template-columns: auto 1fr; text-align: left; }
#previous-module small { align-self: end; }
#previous-module strong { grid-column: 2; align-self: start; }
#next-module { grid-template-columns: 1fr auto; text-align: right; }
#next-module small { align-self: end; }
#next-module strong { grid-column: 1; align-self: start; }
.module-navigation small { color: var(--muted); font-size: .63rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.module-navigation strong { font-family: Georgia, serif; font-weight: 500; }
#complete-module { display: flex; justify-content: center; flex-direction: column; color: #fff; background: var(--navy-2); text-align: center; }
#complete-module .check { width: 28px; height: 28px; display: grid; place-items: center; color: var(--navy); background: var(--gold); border-radius: 50%; }
#complete-module[aria-pressed="true"] { color: var(--navy); background: var(--gold); }
#complete-module[aria-pressed="true"] .check { color: #fff; background: var(--navy); }
#complete-module small { color: inherit; opacity: .76; }
.module-navigation button:disabled { opacity: .35; cursor: default; }
.path-rail { padding: clamp(2rem, 5vw, 4.5rem) max(1rem, calc((100vw - 1120px) / 2)); color: #fff; background: var(--navy); }
.path-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.path-heading h2 { margin: .25rem 0 0; font-family: Georgia, serif; font-size: clamp(1.7rem, 4vw, 3rem); font-weight: 500; }
.path-heading p { max-width: 24rem; color: #b9c7cf; }
#path-list { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .7rem; margin: 0; padding: 0; }
#path-list button { width: 100%; min-height: 116px; position: relative; display: flex; flex-direction: column; justify-content: end; padding: .8rem; overflow: hidden; color: #fff; background: #14354a center/cover; border: 1px solid rgba(255,255,255,.22); text-align: left; isolation: isolate; }
#path-list button::before { content: ""; position: absolute; z-index: -1; inset: 0; background: linear-gradient(180deg, rgba(4,20,31,.05), rgba(4,20,31,.92)); }
#path-list button:hover, #path-list button:focus-visible, #path-list button[aria-current="true"] { border-color: var(--gold); }
#path-list button[data-complete="true"]::after { content: "✓"; position: absolute; top: .55rem; right: .55rem; width: 25px; height: 25px; display: grid; place-items: center; color: var(--navy); background: var(--gold); border-radius: 50%; font-weight: 900; }
#path-list small { color: var(--gold); font-size: .58rem; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
#path-list strong { margin-top: .25rem; font-family: Georgia, serif; font-weight: 500; }
.progress-panel { position: fixed; z-index: 200; inset: 0 0 0 auto; width: min(520px, 100%); overflow: auto; padding: 1.2rem; color: var(--ink); background: var(--paper); box-shadow: -24px 0 60px rgba(0,0,0,.3); }
.progress-panel[hidden], .panel-backdrop[hidden] { display: none; }
.panel-backdrop { position: fixed; z-index: 190; inset: 0; background: rgba(2,14,23,.68); }
.progress-heading { display: flex; align-items: start; justify-content: space-between; gap: 1rem; }
.progress-heading h2 { margin: .2rem 0 1.4rem; font-family: Georgia, serif; font-size: 2rem; font-weight: 500; }
#progress-close { width: 44px; height: 44px; background: transparent; font-size: 2rem; }
.learner-name { display: grid; gap: .45rem; font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
.learner-name input { min-height: 46px; padding: .7rem; border: 1px solid #aaa; background: #fff; text-transform: none; letter-spacing: 0; }
#record-list { list-style: none; margin: 1.2rem 0; padding: 0; border-top: 1px solid #c8c4ba; }
#record-list li { display: grid; grid-template-columns: 58px 1fr auto; gap: .75rem; align-items: center; padding: .65rem 0; border-bottom: 1px solid #d8d4ca; }
#record-list img, #record-list .video-thumb { width: 58px; height: 42px; object-fit: cover; background: var(--navy-2); }
#record-list .video-thumb { display: grid; place-items: center; color: var(--gold); font-size: 1.2rem; }
#record-list strong { font-family: Georgia, serif; font-size: .92rem; font-weight: 500; }
#record-list span:last-child { color: #7b817f; font-weight: 900; }
#record-list li[data-complete="true"] span:last-child { color: #0d6c52; }
.certificate-note { padding: 1rem; color: #fff; background: var(--navy-2); border-left: 5px solid var(--gold); }
.certificate-note strong { color: var(--gold); font-family: Georgia, serif; font-size: 1.4rem; }
.certificate-note p { margin-bottom: 0; line-height: 1.5; }
.print-record, .reset-progress { width: 100%; min-height: 48px; margin-top: 1rem; padding: .7rem 1rem; }
.print-record { color: #fff; background: var(--blue); font-weight: 800; }
.reset-progress { color: #7a2525; background: transparent; border: 1px solid #bcaeaa; }
.print-help { color: var(--muted); font-size: .78rem; line-height: 1.5; }
.print-sheet { display: none; }

@media (max-width: 840px) {
  .learning-header { grid-template-columns: 1fr auto; }
  .learning-title { display: none; }
  .viewer-stage { min-height: 54vh; }
  #path-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .module-navigation { grid-template-columns: 1fr 1fr; }
  #complete-module { grid-column: 1 / -1; grid-row: 1; }
  .image-controls { left: .5rem; right: .5rem; bottom: .5rem; justify-content: center; }
}

@media (max-width: 520px) {
  .learning-intro { padding-top: 2rem; }
  .viewer-stage { width: 100%; height: 58vh; min-height: 390px; }
  .module-navigation { width: 100%; }
  .module-navigation button { min-height: 74px; padding: .65rem; }
  .image-controls button:nth-child(2), .image-controls button:nth-child(3) { display: none; }
  #path-list { grid-template-columns: 1fr; }
  .path-heading { display: block; }
}

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

@media print {
  @page { size: letter; margin: .55in; }
  body { background: #fff; }
  .learning-shell, .progress-panel, .panel-backdrop, .skip-link { display: none !important; }
  .print-sheet { display: block; color: #17222a; font-family: Georgia, serif; }
  .print-sheet > p:first-child { color: #17618c; font-family: Arial, sans-serif; font-size: 9pt; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
  .print-sheet h1 { margin: .2in 0 .08in; padding-bottom: .12in; border-bottom: 4px solid #e7b94f; font-size: 28pt; font-weight: 500; }
  .print-sheet h2 { margin: .12in 0; font-size: 18pt; font-weight: 500; }
  .print-sheet ol { display: grid; grid-template-columns: 1fr 1fr; gap: .07in .2in; margin: .25in 0; padding: 0; list-style: none; }
  .print-sheet li { min-height: .36in; display: grid; grid-template-columns: .42in 1fr auto; gap: .08in; align-items: center; padding: .04in 0; border-bottom: 1px solid #ccc; break-inside: avoid; }
  .print-sheet img, .print-sheet .video-thumb { width: .42in; height: .3in; object-fit: cover; background: #0d344d; }
  .print-sheet .video-thumb { display: grid; place-items: center; color: #e7b94f; font-family: Arial, sans-serif; }
  .print-sheet li span:last-child { font-family: Arial, sans-serif; font-weight: 900; }
  .print-sheet footer { margin-top: .25in; padding-top: .12in; border-top: 1px solid #888; font-family: Arial, sans-serif; font-size: 8pt; line-height: 1.4; }
}
