/* eVue Training. Kannegiesser brand: dark blue, cyan, URW DIN for Latin, Noto Sans HK for CJK.
   Every font is served from this container: plants are LAN-only. */
@font-face { font-family: "DIN"; src: url("fonts/DINRegular.ttf") format("truetype"); font-weight: 400; font-display: block; }
@font-face { font-family: "DIN"; src: url("fonts/DINMedium.ttf") format("truetype"); font-weight: 500; font-display: block; }
@font-face { font-family: "DIN"; src: url("fonts/din-bold.ttf") format("truetype"); font-weight: 700; font-display: block; }

:root {
  --blue: #275da1;
  --blue-light: #e9f0f8;
  --cyan: #55a8dd;
  --cyan-light: #eaf5fc;
  --cyan-dark: #2f7fb3;
  --orange: #f79421;
  --text: #333333;
  --muted: #5b6573;
  --line: #d9dee5;
  --page: #f5f6f8;
  --surface: #ffffff;
  --stage: #0b1119;
  --font: "DIN", "Noto Sans HK", sans-serif;
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--page); color: var(--text); font-family: var(--font); -webkit-text-size-adjust: 100%; }
a { color: inherit; }
button { font: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }

.bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; height: 56px;
  padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); background: var(--blue); color: #fff; }
.brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; }
.brand .mark { font-weight: 700; font-size: 1.25rem; letter-spacing: 0.06em; }
.brand .name { font-weight: 500; font-size: 1.05rem; opacity: 0.9; }
.plant { font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; padding: 3px 8px; border: 1px solid rgba(255,255,255,0.35); border-radius: 4px; white-space: nowrap; }
.spacer { flex: 1; }
.lang select { font: inherit; font-size: 0.9rem; color: #fff; background: transparent; border: 1px solid rgba(255,255,255,0.4); border-radius: 4px; padding: 5px 8px; }
.lang option { color: var(--text); }

main { max-width: 1200px; margin: 0 auto; padding: 32px max(16px, env(safe-area-inset-right)) 64px max(16px, env(safe-area-inset-left)); }
.eyebrow { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--cyan-dark); }
h1 { margin: 6px 0 0; font-size: clamp(1.8rem, 4vw, 2.5rem); line-height: 1.12; color: var(--blue); }
.rule { width: 56px; height: 4px; background: var(--cyan); margin: 16px 0 20px; }
.lead { font-size: 1.05rem; line-height: 1.55; color: var(--muted); max-width: 720px; margin: 10px 0 0; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-top: 8px; }
.card { display: flex; flex-direction: column; gap: 10px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; transition: border-color 150ms, transform 150ms; }
.card:hover { border-color: var(--cyan); }
.card .top { display: flex; align-items: center; gap: 14px; }
.card .play { flex: 0 0 auto; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--blue); color: #fff; transition: background 150ms; }
.card:hover .play { background: var(--cyan); }
.card h2 { margin: 0; font-size: 1.2rem; color: var(--blue); }
.card .meta { font-size: 0.85rem; font-weight: 500; color: var(--cyan-dark); }
.card p { margin: 0; font-size: 0.92rem; line-height: 1.5; color: var(--muted); }
.empty { padding: 28px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); background: var(--surface); }

.back { display: inline-flex; align-items: center; gap: 6px; font-size: 0.9rem; font-weight: 500; color: var(--blue); text-decoration: none; margin-bottom: 14px; }
/* The 404 page. */
.missing { padding-top: clamp(32px, 10vh, 96px); }
.button { display: inline-flex; align-items: center; margin-top: 24px; padding: 10px 18px; border-radius: 4px; background: var(--blue); color: #fff;
  font-weight: 500; text-decoration: none; transition: background 150ms; }
.button:hover { background: var(--cyan-dark); }

.notice { margin: 0 0 16px; padding: 10px 14px; border-radius: 8px; background: var(--cyan-light); color: var(--text); font-size: 0.92rem; }

/* The player: a dark stage, a caption band under it, then the transport. */
.player { outline: none; }
.stage { position: relative; width: 100%; aspect-ratio: 16 / 9; background: var(--stage); border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; }
.stage .center { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.frame { position: relative; width: 100%; transition: transform 900ms cubic-bezier(0.22, 1, 0.36, 1); }
.frame img { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }
.hl { position: absolute; border: 3px solid var(--orange); border-radius: 4px; pointer-events: none;
  box-shadow: 0 0 0 4px rgba(247,148,33,0.25), 0 0 0 9999px rgba(0,0,0,0.28); animation: cue-in 250ms ease-out; }
@keyframes cue-in { from { opacity: 0; transform: scale(1.06); } to { opacity: 1; transform: scale(1); } }
.start { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  border: 0; background: rgba(0,0,0,0.62); color: #fff; cursor: pointer; padding: 16px; text-align: center; }
.start .disc { width: 88px; height: 88px; border-radius: 50%; display: grid; place-items: center; background: var(--blue); }
.start b { font-size: 1.3rem; }
.caption { min-height: 3.6rem; display: flex; align-items: center; justify-content: center; padding: 10px 20px; text-align: center;
  background: rgba(0,0,0,0.88); color: #fff; border-radius: 0 0 var(--radius) var(--radius); font-size: clamp(0.98rem, 2vw, 1.2rem); line-height: 1.45; }
.transport { display: flex; align-items: center; gap: 8px; margin-top: 12px; color: var(--blue); }
.icon { width: 44px; height: 44px; flex: 0 0 auto; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; }
.icon:hover { background: var(--blue-light); }
.icon:disabled { opacity: 0.35; cursor: default; background: transparent; }
.icon.main { background: var(--cyan-light); }
.icon svg { width: 26px; height: 26px; fill: currentColor; pointer-events: none; } /* the button takes the click, whatever icon it shows */
.timeline { flex: 1; display: flex; gap: 3px; min-width: 0; margin: 0 6px; }
.seg { position: relative; height: 8px; border: 0; padding: 0; border-radius: 2px; background: var(--line); overflow: hidden; cursor: pointer; }
.seg:hover { height: 12px; }
.seg i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--cyan); }
.seg.done i { width: 100%; background: var(--blue); }
.clock { min-width: 90px; text-align: right; font-size: 0.9rem; font-variant-numeric: tabular-nums; }

.below { max-width: 720px; margin-top: 28px; }
.chapters { border-top: 1px solid var(--line); margin-top: 8px; }
.chapters button { width: 100%; display: flex; align-items: baseline; gap: 16px; padding: 10px 8px; border: 0; border-bottom: 1px solid var(--line);
  background: transparent; color: var(--text); text-align: left; text-decoration: none; cursor: pointer; font-size: 0.98rem; }
.chapters button:hover { background: var(--cyan-light); }
.chapters button.current { background: var(--cyan-light); color: var(--blue); font-weight: 500; }
.chapters .t { min-width: 42px; font-size: 0.85rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* A wide screen: the chapters are a narrow list beside the player, as tall as the player, scrolling on their own. */
@media (min-width: 1000px) {
  .lesson { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 24px; align-items: stretch; }
  .lesson .below { position: relative; max-width: none; margin-top: 0; }
  .lesson .below section { position: absolute; inset: 0; display: flex; flex-direction: column; }
  .lesson .chapters { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
  .lesson .chapters button { gap: 10px; padding: 9px 8px; font-size: 0.92rem; line-height: 1.3; }
  .lesson .chapters .t { min-width: 36px; font-size: 0.8rem; }
}

/* Full screen (and its stand-in where the browser has none, e.g. iPhone): the stage takes the screen. */
.player:fullscreen, .player.immersive { background: #000; display: flex; flex-direction: column; justify-content: center; padding: 8px max(8px, env(safe-area-inset-right)) 8px max(8px, env(safe-area-inset-left)); }
.player.immersive { position: fixed; inset: 0; z-index: 20; }
.player:fullscreen .stage, .player.immersive .stage { border-radius: 0; width: auto; max-width: 100%; height: calc(100dvh - 150px); margin: 0 auto; }
.player:fullscreen .caption, .player.immersive .caption { border-radius: 0; font-size: clamp(1rem, 2.6vw, 1.6rem); }
.player:fullscreen .transport, .player.immersive .transport { color: #fff; }
.player:fullscreen .icon:hover, .player.immersive .icon:hover { background: rgba(255,255,255,0.12); }
.player:fullscreen .icon.main, .player.immersive .icon.main { background: rgba(255,255,255,0.16); }

@media (max-width: 760px) {
  main { padding-top: 16px; }
  .below { margin-top: 20px; }
  .plant { display: none; }
  .stage { border-radius: 0; margin: 0 calc(-1 * max(16px, env(safe-area-inset-left))); width: calc(100% + 2 * max(16px, env(safe-area-inset-left))); }
  .caption { border-radius: 0; margin: 0 calc(-1 * max(16px, env(safe-area-inset-left))); }
  .clock { min-width: 0; font-size: 0.8rem; }
  .icon { width: 40px; height: 40px; }
}
/* A phone held sideways: the stage gets the screen. */
@media (max-height: 520px) and (orientation: landscape) {
  .player.immersive .stage, .player:fullscreen .stage { height: calc(100dvh - 104px); }
  .player.immersive .caption, .player:fullscreen .caption { min-height: 2.6rem; padding: 4px 12px; font-size: 1rem; }
  .player.immersive .transport, .player:fullscreen .transport { margin-top: 4px; }
}
@media (prefers-reduced-motion: reduce) { .frame { transition: none; } .hl { animation: none; } }
.plant:empty { display: none; }
.card .play svg, .start .disc svg { width: 26px; height: 26px; fill: currentColor; }
.start .disc svg { width: 52px; height: 52px; }
