/* Digital System TT — member area
   Sober, institutional. Neutral ink palette with one restrained accent. */

:root {
  --ink:        #14181f;
  --ink-2:      #1d232c;
  --ink-3:      #2b333f;
  --line:       #e3e6ea;
  --line-dark:  #333c49;
  --paper:      #f6f7f9;
  --card:       #ffffff;
  --text:       #1a1f27;
  --text-2:     #5b6572;
  --text-inv:   #eef1f4;
  --text-inv-2: #9aa5b4;
  --accent:     #2f6fed;
  --accent-dk:  #235ac6;
  --ok:         #1f9254;
  --radius:     10px;
  --shadow:     0 1px 2px rgba(16,24,40,.05), 0 8px 24px rgba(16,24,40,.06);
  --topbar-h:   62px;
  --sidebar-w:  330px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.25; margin: 0; letter-spacing: -0.015em; }
p { margin: 0; }
a { color: var(--accent); }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: #fff; padding: 12px 18px; border-radius: 0 0 8px 0;
}
.skip:focus { left: 0; }

/* ---------- top bar ---------- */

.topbar {
  position: sticky; top: 0; z-index: 40;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 18px;
  padding: 0 20px;
  background: var(--ink);
  color: var(--text-inv);
  border-bottom: 1px solid #000;
}

.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }

.mark {
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center;
  border-radius: 7px;
  background: #fff; color: var(--ink);
  font-weight: 700; font-size: 13px; letter-spacing: .02em;
}

.brandtext { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brandtext strong { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; }
.brandtext em {
  font-style: normal; font-size: 11px; letter-spacing: .09em;
  text-transform: uppercase; color: var(--text-inv-2);
}

.progress { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.progress-meter {
  width: 132px; height: 6px; border-radius: 99px;
  background: #39424f; overflow: hidden;
}
.progress-meter span {
  display: block; height: 100%; width: 0%;
  background: var(--ok); border-radius: 99px;
  transition: width .3s ease;
}
.progress-label { font-size: 12.5px; color: var(--text-inv-2); white-space: nowrap; }
.progress-label b { color: var(--text-inv); font-weight: 600; }

.navtoggle {
  display: none;
  align-items: center; gap: 9px;
  background: transparent; border: 1px solid var(--line-dark);
  color: var(--text-inv); border-radius: 8px;
  padding: 8px 12px; font: inherit; font-size: 13.5px; cursor: pointer;
}
.bars { display: grid; gap: 3px; }
.bars i { display: block; width: 15px; height: 1.5px; background: currentColor; }

/* ---------- layout ---------- */

.shell { display: flex; align-items: flex-start; }

.sidebar {
  width: var(--sidebar-w); flex: none;
  position: sticky; top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  background: var(--ink-2);
  border-right: 1px solid #000;
}
.sidebar-inner { padding: 20px 16px 28px; }
.sidebar-lead {
  font-size: 11.5px; letter-spacing: .07em; text-transform: uppercase;
  color: var(--text-inv-2); padding: 0 8px 14px;
}

.mod { margin-bottom: 6px; }
.mod-head {
  width: 100%; display: flex; align-items: center; gap: 10px; text-align: left;
  background: transparent; border: 0; cursor: pointer;
  color: var(--text-inv); font: inherit;
  padding: 10px 8px; border-radius: 8px;
}
.mod-head:hover { background: #263041; }
.mod-num {
  width: 24px; height: 24px; flex: none; display: grid; place-items: center;
  border-radius: 6px; background: #39424f; color: var(--text-inv);
  font-size: 11.5px; font-weight: 600;
}
.mod-title { flex: 1; font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.mod-count { font-size: 11.5px; color: var(--text-inv-2); }
.chev { width: 9px; height: 9px; flex: none; border-right: 1.6px solid var(--text-inv-2); border-bottom: 1.6px solid var(--text-inv-2); transform: rotate(45deg); margin: -3px 2px 0 0; transition: transform .18s ease; }
.mod.open .chev { transform: rotate(-135deg); margin-top: 2px; }

.mod-body { display: none; padding: 2px 0 8px; }
.mod.open .mod-body { display: block; }

.les {
  width: 100%; display: flex; align-items: flex-start; gap: 10px; text-align: left;
  background: transparent; border: 0; cursor: pointer; font: inherit;
  color: var(--text-inv-2); padding: 9px 10px 9px 12px; border-radius: 8px;
  border-left: 2px solid transparent;
}
.les:hover { background: #263041; color: var(--text-inv); }
.les.active { background: #2f3b4d; color: #fff; border-left-color: var(--accent); }
.les-tick {
  width: 17px; height: 17px; flex: none; margin-top: 3px;
  border-radius: 50%; border: 1.5px solid #4b5665;
  display: grid; place-items: center; font-size: 10px; color: transparent;
}
.les.done .les-tick { background: var(--ok); border-color: var(--ok); color: #fff; }
.les-txt { min-width: 0; }
.les-code { display: block; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; opacity: .75; }
.les-name { display: block; font-size: 13.5px; line-height: 1.4; }

.sidebar-foot { margin-top: 18px; padding: 14px 10px 0; border-top: 1px solid var(--line-dark); }
.linkbtn {
  background: none; border: 0; padding: 0; cursor: pointer; font: inherit;
  font-size: 12.5px; color: var(--text-inv-2); text-decoration: underline;
  text-underline-offset: 3px;
}
.linkbtn:hover { color: var(--text-inv); }

.scrim { display: none; }

/* ---------- main ---------- */

.main { flex: 1; min-width: 0; padding: 30px 34px 60px; max-width: 1180px; }

.stage {
  background: var(--ink);
  border-radius: var(--radius);
  padding: 20px;
  display: grid; place-items: center;
  border: 1px solid #0b0e13;
}

/* vertical 9:16 player, height-capped so it never overflows the fold */
.player {
  width: 100%;
  max-width: min(100%, calc((100vh - var(--topbar-h) - 140px) * 0.5625));
}
.player video {
  display: block; width: 100%; aspect-ratio: 9 / 16;
  background: #000; border-radius: 6px; outline: none;
}

.detail { margin-top: 28px; max-width: 760px; }

.eyebrow {
  font-size: 11.5px; letter-spacing: .09em; text-transform: uppercase;
  color: var(--text-2); font-weight: 600; margin-bottom: 8px;
}
.detail h1 { font-size: 27px; font-weight: 700; }
.lead { margin-top: 12px; color: var(--text-2); font-size: 16px; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

.btn {
  font: inherit; font-size: 14px; font-weight: 600;
  padding: 10px 17px; border-radius: 8px; cursor: pointer;
  border: 1px solid transparent; background: var(--accent); color: #fff;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.btn:hover { background: var(--accent-dk); }
.btn:disabled { opacity: .4; cursor: default; }
.btn.ghost { background: #fff; color: var(--text); border-color: var(--line); }
.btn.ghost:hover:not(:disabled) { background: #eef1f5; }
.btn.done.is-done { background: var(--ok); }
.btn.done.is-done:hover { background: #19773f; }

.workbook {
  margin-top: 26px;
  display: flex; align-items: center; gap: 15px;
  padding: 16px 18px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  text-decoration: none; color: inherit;
}
.workbook:hover { border-color: #c8ced7; }
.wb-icon {
  width: 42px; height: 42px; flex: none; display: grid; place-items: center;
  border-radius: 8px; background: #fdeceb; color: #b3261e;
  font-size: 10.5px; font-weight: 700; letter-spacing: .04em;
}
.wb-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.wb-text strong { font-size: 14.5px; font-weight: 600; }
.wb-text em { font-style: normal; font-size: 13px; color: var(--text-2); }
.wb-cta { font-size: 13.5px; font-weight: 600; color: var(--accent); white-space: nowrap; }

.resources { margin-top: 48px; padding-top: 30px; border-top: 1px solid var(--line); max-width: 760px; }
.resources h2 { font-size: 18px; font-weight: 700; }
.muted { color: var(--text-2); }
.small { font-size: 13px; }
.resources .muted { margin-top: 6px; font-size: 14.5px; }

.wb-list { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 8px; }
.wb-list a {
  display: flex; align-items: center; gap: 13px;
  padding: 12px 15px; background: var(--card);
  border: 1px solid var(--line); border-radius: 8px;
  text-decoration: none; color: inherit; font-size: 14px;
}
.wb-list a:hover { border-color: #c8ced7; background: #fcfcfd; }
.wb-list .n {
  width: 22px; height: 22px; flex: none; display: grid; place-items: center;
  border-radius: 5px; background: var(--paper); border: 1px solid var(--line);
  font-size: 11.5px; font-weight: 600; color: var(--text-2);
}
.wb-list .g { flex: 1; }
.wb-list .d { font-size: 13px; color: var(--accent); font-weight: 600; }

.foot { margin-top: 46px; padding-top: 24px; border-top: 1px solid var(--line); max-width: 760px; display: grid; gap: 9px; }
.foot p { font-size: 14px; }

/* ---------- responsive ---------- */

@media (max-width: 980px) {
  .navtoggle { display: inline-flex; }
  .progress-label { display: none; }
  .main { padding: 20px 18px 50px; }

  .sidebar {
    position: fixed; top: var(--topbar-h); left: 0; bottom: 0;
    height: auto; width: min(86vw, var(--sidebar-w));
    transform: translateX(-101%);
    transition: transform .22s ease;
    z-index: 45;
  }
  .sidebar.open { transform: none; }
  .scrim {
    display: block; position: fixed; inset: var(--topbar-h) 0 0 0;
    background: rgba(10,13,18,.5); z-index: 44;
  }
  .scrim[hidden] { display: none; }

  .stage { padding: 12px; border-radius: 8px; }
  /* on phones the video is the page — let it use the viewport height */
  .player { max-width: min(100%, calc((100vh - var(--topbar-h) - 110px) * 0.5625)); }

  .detail h1 { font-size: 22px; }
  .detail { margin-top: 22px; }
  .actions .btn { flex: 1 1 auto; }
}

@media (max-width: 560px) {
  .brandtext em { display: none; }
  .progress-meter { width: 84px; }
  .workbook { flex-wrap: wrap; }
  .wb-cta { width: 100%; }
}
