/* Certus Training guided tour viewer. Plain CSS, no build step, no network calls. */
@font-face { font-family: 'Barlow'; src: url('assets/Barlow-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Barlow'; src: url('assets/Barlow-Medium.ttf') format('truetype'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Barlow'; src: url('assets/Barlow-SemiBold.ttf') format('truetype'); font-weight: 600 800; font-display: swap; }

:root {
  --navy: #0e2a4d; --navy-2: #173a66; --green: #2a8339; --green-d: #1d6a2b; --green-t: #e7f4e8; --lime: #9bd66a;
  --ink: #17212b; --ink-2: #4a5662; --bg: #eceff2; --line: #d5dbe1; --amber: #f2b01e;
  --topbar-h: 64px; --controls-h: 68px;
  --font: 'Barlow', 'Segoe UI', system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 17px; line-height: 1.5; -webkit-font-smoothing: antialiased; display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; overflow-x: hidden; }
[hidden] { display: none !important; }
img { max-width: 100%; }
button { font: inherit; color: inherit; }
a { color: var(--green-d); }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 24px; min-height: var(--topbar-h); padding: 0 28px; background: var(--navy); color: #fff; border-bottom: 4px solid var(--green); }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; flex: none; }
.brand-mark { width: 34px; height: 34px; display: block; }
.brand-name { font-weight: 700; font-size: 21px; letter-spacing: -.01em; }
.brand-name span { color: var(--lime); font-weight: 600; }
.chapters { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; margin-left: auto; align-self: stretch; }
.chapters::-webkit-scrollbar { display: none; }
.chapters button { flex: none; border: 0; background: transparent; color: #d3deec; padding: 8px 14px; cursor: pointer; font-size: 16px; font-weight: 600; }
.chapters button:hover { color: #fff; background: rgba(255,255,255,.08); }
.chapters button[aria-current="true"] { color: #fff; box-shadow: inset 0 -4px 0 var(--lime); }

/* buttons */
.btn { border: 2px solid transparent; border-radius: 8px; cursor: pointer; padding: 10px 22px; font-weight: 600; font-size: 16px; line-height: 1.2; transition: background .15s, color .15s; }
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-d); }
.btn-ghost { background: #fff; color: var(--navy); border-color: var(--navy); }
.btn-ghost:hover { background: var(--navy); color: #fff; }
.btn:disabled { opacity: .4; cursor: default; background: #fff; color: var(--navy); }
.btn-lg { padding: 15px 30px; font-size: 19px; }
.btn:focus-visible, .chapters button:focus-visible, .chapter-card:focus-visible, .hotspot:focus-visible, .notes li:focus-visible, .brand:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }

main { flex: 1; display: flex; min-height: 0; }
.screen { flex: 1; min-width: 0; padding: 28px; }
.eyebrow { margin: 0 0 8px; color: var(--green-d); font-weight: 700; font-size: 14px; letter-spacing: .12em; text-transform: uppercase; }

/* intro */
.intro { display: flex; flex-direction: column; align-items: center; gap: 30px; padding-top: 5vh; padding-bottom: 44px; }
.intro-hero { width: 100%; max-width: 1080px; }
.intro h1 { font-size: clamp(34px, 5vw, 58px); line-height: 1.05; margin: 0 0 18px; letter-spacing: -.02em; color: var(--navy); text-wrap: balance; }
.intro h1 em { font-style: normal; color: var(--green); }
.lead { font-size: clamp(18px, 1.6vw, 21px); color: var(--ink-2); margin: 0 0 26px; max-width: 46em; }
.hint { color: var(--ink-2); font-size: 15px; margin: 14px 0 0; }
.chapter-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; width: 100%; max-width: 1080px; }
.chapter-card { text-align: left; border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 0; overflow: hidden; cursor: pointer; display: flex; flex-direction: column; border-radius: 12px; border-top: 4px solid var(--green); box-shadow: 0 1px 2px rgba(14,42,77,.06), 0 6px 18px rgba(14,42,77,.07); }
.chapter-card:hover { border-color: var(--green); }
.chapter-card .thumb { display: block; aspect-ratio: 16 / 10; background: var(--navy) center top / cover no-repeat; }
.chapter-card .body { display: block; padding: 14px 18px 18px; }
.chapter-card h3 { margin: 0 0 6px; font-size: 21px; line-height: 1.15; color: var(--navy); }
.chapter-card p { margin: 0; color: var(--ink-2); font-size: 16px; }
.chapter-card .count { display: inline-block; margin-top: 10px; font-size: 14px; font-weight: 700; color: var(--green-d); }

/* step */
.step { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: start; padding: 24px 28px 20px; }
.stage { display: flex; justify-content: center; min-width: 0; }
.frame { position: relative; max-width: 100%; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 0 0 0; overflow: visible; box-shadow: 0 2px 4px rgba(14,42,77,.08), 0 14px 34px rgba(14,42,77,.14); }
.frame-bar { display: flex; align-items: center; gap: 12px; height: 38px; padding: 0 12px; background: #dfe5eb; border-radius: 12px 12px 0 0; }
.dots { display: flex; gap: 6px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: #b3bcc6; display: block; }
.frame-label { flex: 1; max-width: 560px; background: #fff; border-radius: 6px; padding: 2px 12px 2px 28px; font-size: 14px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; position: relative; }
.frame-label::before { content: ""; position: absolute; left: 10px; top: 50%; width: 9px; height: 7px; margin-top: -2px; border: 2px solid var(--green); border-radius: 2px; }
.shot { position: relative; width: 100%; aspect-ratio: var(--ar, 1.6); }
.shot img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; border-radius: 0 0 11px 11px; }

/* hotspots */
.hotspots { position: absolute; inset: 0; }
.hotspot { position: absolute; transform: translate(-50%, -50%); width: 28px; height: 28px; border-radius: 50%; border: 2px solid #fff; padding: 0; background: var(--green-d); color: #fff; font-weight: 700; font-size: 14px; line-height: 24px; cursor: pointer; z-index: 3; box-shadow: 0 2px 8px rgba(14,42,77,.45); }
.hotspot::after { content: ""; position: absolute; inset: -2px; border-radius: 50%; border: 2px solid var(--green); animation: pulse 2s ease-out infinite; pointer-events: none; }
@keyframes pulse { 0% { transform: scale(1); opacity: .8; } 80%, 100% { transform: scale(2.1); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .hotspot::after { animation: none; opacity: 0; } .btn { transition: none; } }
.hotspot.active { background: var(--navy); border-color: var(--amber); }
.hotspot.active::after { animation: none; opacity: 0; }
.target { position: absolute; border: 3px solid var(--amber); border-radius: 4px; z-index: 2; background: rgba(242,176,30,.14); pointer-events: none; opacity: 0; transition: opacity .15s; }
.target.show { opacity: 1; }
.tip { position: absolute; z-index: 4; width: 270px; max-width: 70%; background: var(--navy); color: #fff; border-radius: 8px; padding: 10px 14px 11px; font-size: 15px; line-height: 1.4; box-shadow: 0 10px 28px rgba(14,42,77,.4); pointer-events: none; }
.tip b { color: var(--amber); margin-right: 8px; }

/* side panel */
.panel { background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--green); border-radius: 12px; padding: 20px 22px 12px; position: sticky; top: calc(var(--topbar-h) + 24px); box-shadow: 0 1px 2px rgba(14,42,77,.06), 0 6px 18px rgba(14,42,77,.07); }
.panel h2 { margin: 0 0 8px; font-size: 27px; line-height: 1.12; color: var(--navy); text-wrap: balance; }
.caption { margin: 0 0 14px; color: var(--ink); }
.notes { list-style: none; margin: 0; padding: 0; }
.notes li { display: grid; grid-template-columns: 30px 1fr; gap: 8px; align-items: baseline; padding: 9px 10px 9px 8px; margin: 0 -10px 0 -8px; cursor: pointer; font-size: 16px; border-left: 3px solid transparent; color: var(--ink-2); }
.notes li:hover, .notes li.active { background: var(--green-t); color: var(--ink); border-left-color: var(--green); }
.notes .num { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: var(--green-d); color: #fff; font-weight: 700; font-size: 13px; }

/* outro */
.outro { display: flex; justify-content: center; align-items: flex-start; padding-top: 7vh; }
.outro-card { width: 100%; max-width: 900px; }
.outro h1 { font-size: clamp(30px, 4.2vw, 48px); line-height: 1.08; margin: 0 0 16px; color: var(--navy); letter-spacing: -.02em; text-wrap: balance; }
.contact { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--green); border-radius: 10px; padding: 18px 24px; margin: 0 0 24px; max-width: 560px; }
.contact p { margin: 0; }

/* controls */
.controls { position: sticky; bottom: 0; z-index: 20; display: flex; align-items: center; gap: 16px; justify-content: space-between; min-height: var(--controls-h); padding: 10px 28px calc(10px + env(safe-area-inset-bottom, 0px)); background: rgba(255,255,255,.96); backdrop-filter: blur(8px); border-top: 1px solid var(--line); }
.progress { flex: 1; display: flex; align-items: center; gap: 16px; max-width: 680px; }
.progress-text { font-size: 15px; font-weight: 600; color: var(--ink-2); white-space: nowrap; min-width: 100px; }
.progress-track { flex: 1; height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; }
.progress-fill { display: block; height: 100%; width: 0; background: var(--green); transition: width .25s ease; }
.noscript { padding: 24px; text-align: center; }

@media (max-width: 1100px) { .step { grid-template-columns: 1fr; } .panel { position: static; } }
@media (max-width: 760px) {
  :root { --topbar-h: 52px; --controls-h: 60px; }
  .topbar { flex-wrap: wrap; gap: 0 12px; padding: 0 14px; }
  .brand { min-height: var(--topbar-h); gap: 8px; }
  .brand-mark { width: 28px; height: 28px; }
  .brand-name { font-size: 17px; }
  .chapters { margin-left: 0; width: 100%; align-self: auto; }
  .chapters button { padding: 8px 10px 10px; font-size: 14px; }
  .screen { padding: 16px; }
  .step { padding: 18px 12px 14px; gap: 16px; }
  .frame-bar { height: 30px; padding: 0 8px; }
  .frame-label { font-size: 12px; }
  .hotspot { width: 22px; height: 22px; font-size: 12px; line-height: 18px; }
  .tip { display: none; }
  .panel { padding: 14px 16px 6px; }
  .panel h2 { font-size: 22px; }
  .outro { padding-top: 24px; }
  .controls { padding: 8px 14px calc(8px + env(safe-area-inset-bottom, 0px)); gap: 10px; }
  .controls .btn { padding: 9px 14px; }
  .progress-text { min-width: 0; font-size: 13px; }
}
