/* K9X Certification: shared styles (landing page, courses, lessons). K9X background = .k9x-bg */
  :root {
    --bg: #050914; --bg2: #0a1224; --card: rgba(16, 26, 48, .72); --line: rgba(120, 160, 220, .16);
    --ink: #e8eef9; --mute: #9aabc6; --em: #34d399; --em-deep: #10b981; --gold: #f2c75c; --gold-deep: #d4a537;
    --glow: rgba(52, 211, 153, .35);
  }
  :root[data-theme="light"] {
    --bg: #f4f7fb; --bg2: #e9eff8; --card: rgba(255, 255, 255, .86); --line: rgba(40, 70, 120, .14);
    --ink: #0d1a2e; --mute: #4c5d78; --em: #059669; --em-deep: #047857; --gold: #b7862a; --gold-deep: #94681a;
    --glow: rgba(5, 150, 105, .18);
  }
  * { box-sizing: border-box; margin: 0; }
  html { scroll-behavior: smooth; }
  body { background-color: #030509;
         color: var(--ink); font: 16px/1.6 Inter, -apple-system, Segoe UI, sans-serif; overflow-x: hidden; }
  /* K9X background (reusable): near-black base, the K9X wordmark repeated faintly at an angle, a fine dot grid and
     diagonal hairlines. Pure CSS + inline SVG, no image files; light theme uses the same pattern in dark ink. */
  .k9x-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; background-color: #030509;
    background-image:
      radial-gradient(ellipse at 75% 0%, rgba(52, 211, 153, .10), transparent 55%),
      radial-gradient(ellipse at 10% 100%, rgba(242, 199, 92, .06), transparent 50%),
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='360' height='220'%3E%3Cg font-family='Arial Black,Helvetica,Arial,sans-serif' font-weight='900' font-size='46' fill='%23ffffff' fill-opacity='0.035' transform='rotate(-18 180 110)'%3E%3Ctext x='20' y='80'%3EK9X%3C/text%3E%3Ctext x='200' y='190'%3EK9X%3C/text%3E%3C/g%3E%3C/svg%3E"),
      radial-gradient(rgba(255, 255, 255, .07) 1px, transparent 1.2px),
      repeating-linear-gradient(135deg, rgba(255, 255, 255, .018) 0 1px, transparent 1px 28px);
    background-size: auto, auto, 360px 220px, 24px 24px, auto; }
  :root[data-theme="light"] .k9x-bg { background-color: #f4f7fb;
    background-image:
      radial-gradient(ellipse at 75% 0%, rgba(5, 150, 105, .08), transparent 55%),
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='360' height='220'%3E%3Cg font-family='Arial Black,Helvetica,Arial,sans-serif' font-weight='900' font-size='46' fill='%230d1a2e' fill-opacity='0.04' transform='rotate(-18 180 110)'%3E%3Ctext x='20' y='80'%3EK9X%3C/text%3E%3Ctext x='200' y='190'%3EK9X%3C/text%3E%3C/g%3E%3C/svg%3E"),
      radial-gradient(rgba(13, 26, 46, .08) 1px, transparent 1.2px);
    background-size: auto, 360px 220px, 24px 24px; }
  #stars { position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .7; }
  :root[data-theme="light"] #stars { opacity: .25; }
  main, header, footer { position: relative; z-index: 1; }
  h1, h2, h3, .brand { font-family: "Space Grotesk", Inter, sans-serif; }
  a { color: var(--em); }

  /* header */
  header { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 28px; padding: 14px 36px;
           background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
  .brand { font-weight: 700; font-size: 16px; letter-spacing: .2px; }
  .brand b { color: var(--em); }
  nav { display: flex; gap: 22px; flex: 1; }
  nav a { color: var(--mute); text-decoration: none; font-size: 14px; } nav a:hover { color: var(--ink); }
  .actions { display: flex; gap: 10px; align-items: center; }
  .btn { border-radius: 10px; padding: 9px 18px; font: 600 14px Inter, sans-serif; cursor: pointer; border: 1px solid var(--em);
         text-decoration: none; display: inline-block; white-space: nowrap; }
  .btn-primary { background: linear-gradient(135deg, var(--em), var(--em-deep)); color: #04140d; box-shadow: 0 0 24px var(--glow); }
  .btn-primary:hover { filter: brightness(1.08); }
  .btn-ghost { background: transparent; color: var(--em); } .btn-ghost:hover { background: rgba(52, 211, 153, .08); }
  .btn-lg { padding: 13px 26px; font-size: 15px; }
  .theme { background: transparent; border: 1px solid var(--line); border-radius: 10px; width: 40px; height: 38px; cursor: pointer; font-size: 16px; }

  /* hero */
  .hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; max-width: 1180px; margin: 0 auto;
          padding: 70px 32px 50px; min-height: min(78vh, 760px); }
  .eyebrow { font: 700 12px/1 ui-monospace, Menlo, monospace; letter-spacing: .22em; text-transform: uppercase; color: var(--gold); margin-bottom: 18px; }
  .hero h1 { font-size: 54px; line-height: 1.05; letter-spacing: -1.5px; margin-bottom: 20px; }
  .hero h1 span { background: linear-gradient(90deg, var(--em), var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
  .lede { font-size: 18px; color: var(--mute); max-width: 560px; margin-bottom: 30px; }
  .cta { display: flex; gap: 12px; flex-wrap: wrap; }
  .facts { display: flex; gap: 28px; margin-top: 34px; flex-wrap: wrap; }
  .facts div { font-size: 13px; color: var(--mute); } .facts b { display: block; font: 700 26px "Space Grotesk", sans-serif; color: var(--ink); }

  /* orbit emblem */
  .orbit { position: relative; width: 460px; height: 460px; margin: 0 auto; }
  .ring { position: absolute; border-radius: 50%; border: 1px solid var(--line); inset: 0; margin: auto; }
  .r1 { width: 230px; height: 230px; border-color: rgba(52, 211, 153, .45); box-shadow: 0 0 40px var(--glow) inset; }
  .r2 { width: 340px; height: 340px; border-style: dashed; }
  .r3 { width: 450px; height: 450px; border-style: dashed; opacity: .7; }
  .spin { position: absolute; inset: 0; margin: auto; border-radius: 50%; animation: spin linear infinite; }
  .s1 { width: 230px; height: 230px; animation-duration: 26s; } .s2 { width: 340px; height: 340px; animation-duration: 48s; animation-direction: reverse; }
  .s3 { width: 450px; height: 450px; animation-duration: 80s; }
  .planet { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); width: 18px; height: 18px; border-radius: 50%; }
  .p1 { background: var(--em); box-shadow: 0 0 18px var(--em), 0 0 40px var(--glow); }
  .p2 { background: #6b7a95; } .p3 { background: #6b7a95; }
  .tag { position: absolute; left: 50%; transform: translateX(-50%); font: 600 11px/1 ui-monospace, Menlo, monospace; letter-spacing: .12em;
         text-transform: uppercase; white-space: nowrap; padding: 5px 9px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); }
  .t1 { top: calc(50% - 132px); color: var(--em); border-color: rgba(52, 211, 153, .5); }
  .t2 { top: calc(50% - 187px); color: var(--mute); } .t3 { top: calc(50% - 242px); color: var(--mute); }
  .core { position: absolute; inset: 0; margin: auto; width: 150px; height: 150px; border-radius: 50%; display: grid; place-items: center; text-align: center;
          background: radial-gradient(circle at 35% 30%, #1d3b52, #0b1628 70%); border: 1px solid rgba(242, 199, 92, .5);
          box-shadow: 0 0 60px rgba(242, 199, 92, .22), 0 0 120px var(--glow); }
  :root[data-theme="light"] .core { background: radial-gradient(circle at 35% 30%, #ffffff, #e2ecf7 70%); }
  .core b { font: 700 30px "Space Grotesk", sans-serif; color: var(--gold); display: block; letter-spacing: 1px; }
  .core span { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--mute); }
  @keyframes spin { to { transform: rotate(360deg); } }

  /* sections */
  section { max-width: 1120px; margin: 0 auto; padding: 70px 32px; }
  .label { font: 700 12px/1 ui-monospace, Menlo, monospace; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); text-align: center; margin-bottom: 12px; }
  section h2 { text-align: center; font-size: 34px; letter-spacing: -.6px; margin-bottom: 14px; }
  .sub { text-align: center; color: var(--mute); max-width: 680px; margin: 0 auto 40px; }
  .card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 26px; backdrop-filter: blur(6px); }
  .levels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
  .level h3 { font-size: 21px; margin: 12px 0 8px; } .level p { color: var(--mute); font-size: 14.5px; }
  .level.open { border-color: rgba(52, 211, 153, .55); box-shadow: 0 0 40px var(--glow); }
  .pill { display: inline-block; font: 700 11px/1 ui-monospace, Menlo, monospace; letter-spacing: .12em; text-transform: uppercase; padding: 6px 10px; border-radius: 999px; }
  .pill.go { background: rgba(52, 211, 153, .15); color: var(--em); } .pill.soon { background: rgba(154, 171, 198, .12); color: var(--mute); }
  .level .n { float: right; font: 700 13px "Space Grotesk", sans-serif; color: var(--mute); }
  .steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; counter-reset: s; }
  .step { position: relative; } .step b { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
          background: linear-gradient(135deg, var(--em), var(--em-deep)); color: #04140d; font: 700 15px "Space Grotesk"; margin-bottom: 12px; box-shadow: 0 0 18px var(--glow); }
  .step h3 { font-size: 17px; margin-bottom: 6px; } .step p { color: var(--mute); font-size: 14px; }
  .study { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
  .study a.card { text-decoration: none; color: inherit; transition: border-color .2s, transform .2s; }
  .study a.card:hover { border-color: var(--em); transform: translateY(-2px); }
  .study h3 { font-size: 17px; margin-bottom: 6px; color: var(--ink); } .study p { color: var(--mute); font-size: 14px; }
  .study .go { color: var(--em); font-size: 13px; font-weight: 600; margin-top: 10px; display: block; }

  /* sample question */
  .quiz { max-width: 760px; margin: 0 auto; }
  .q { font: 600 19px/1.45 "Space Grotesk", sans-serif; margin-bottom: 18px; }
  .opt { display: block; width: 100%; text-align: left; padding: 14px 16px; margin-bottom: 10px; border-radius: 12px; cursor: pointer;
         background: transparent; color: var(--ink); border: 1px solid var(--line); font: 15px Inter, sans-serif; }
  .opt:hover:not([disabled]) { border-color: var(--em); }
  .opt.right { border-color: var(--em); background: rgba(52, 211, 153, .12); } .opt.wrong { border-color: #f87171; background: rgba(248, 113, 113, .1); }
  .feedback { display: none; margin-top: 14px; padding: 14px 16px; border-radius: 12px; background: rgba(242, 199, 92, .08); border: 1px solid rgba(242, 199, 92, .3); font-size: 14.5px; }
  .feedback b { color: var(--gold); }

  /* certificate preview */
  .cert-wrap { display: grid; grid-template-columns: 1fr 1.25fr; gap: 40px; align-items: center; }
  .cert { position: relative; aspect-ratio: 1.414; border-radius: 14px; padding: 34px 40px; color: #1b2433; text-align: center; overflow: hidden;
          background: linear-gradient(135deg, #fffdf6, #f6efdc); box-shadow: 0 30px 80px rgba(0, 0, 0, .45), 0 0 0 1px rgba(212, 165, 55, .5); }
  .cert::before { content: ""; position: absolute; inset: 12px; border: 2px solid #d4a537; border-radius: 8px; pointer-events: none; }
  .cert::after { content: ""; position: absolute; inset: 18px; border: 1px solid rgba(212, 165, 55, .45); border-radius: 6px; pointer-events: none; }
  .cert .sample { position: absolute; top: 22px; right: -38px; transform: rotate(35deg); background: #10b981; color: #fff; font: 700 10px Inter; letter-spacing: .2em; padding: 4px 44px; }
  .cert .k { font: 700 13px "Space Grotesk"; letter-spacing: .3em; color: #0f7a5a; margin-top: 4px; }
  .cert h4 { font: 700 24px "Space Grotesk"; margin: 8px 0 2px; letter-spacing: .5px; }
  .cert .lvl { font-size: 12px; letter-spacing: .25em; text-transform: uppercase; color: #8a6a1f; }
  .cert .cert-to { font-size: 12px; color: #5a6578; margin-top: 12px; }
  .cert .who { font: 400 40px/1.1 "Great Vibes", cursive; color: #1b2433; margin: 2px 0 6px; }
  .cert .meta { font-size: 11px; color: #5a6578; }
  .cert .foot { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 16px; padding: 0 6px; }
  .cert .sig { text-align: center; min-width: 170px; }
  .cert .sig .ink { font: 400 34px/1 "Great Vibes", cursive; color: #13315c; transform: rotate(-4deg); display: inline-block; }
  .cert .sig .line { border-top: 1px solid #8a94a6; margin-top: 2px; padding-top: 4px; font-size: 10.5px; color: #3c475a; }
  .cert .seal { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font: 700 12px "Space Grotesk"; color: #fff;
                background: radial-gradient(circle at 35% 30%, #f6d77c, #c99a2e); box-shadow: 0 0 0 4px rgba(201, 154, 46, .25); }
  .cert .id { font: 10px ui-monospace, Menlo, monospace; color: #6b7588; text-align: left; }

  /* register */
  .register { max-width: 620px; margin: 0 auto; }
  .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  label { display: block; font-size: 13px; color: var(--mute); margin: 12px 0 6px; }
  input { width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: rgba(5, 9, 20, .35); color: var(--ink); font: 15px Inter; }
  :root[data-theme="light"] input { background: #fff; }
  input:disabled { opacity: .55; cursor: not-allowed; }
  .soon-note { margin-top: 14px; font-size: 14px; color: var(--gold); text-align: center; }
  .scope { max-width: 760px; margin: 0 auto; color: var(--mute); padding-left: 20px; }
  .scope li { margin-bottom: 8px; } .scope b { color: var(--ink); }
  footer { text-align: center; padding: 34px 20px; color: var(--mute); font-size: 13px; border-top: 1px solid var(--line); }

  @media (max-width: 960px) {
    .hero { grid-template-columns: 1fr; text-align: center; padding-top: 40px; } .lede { margin-left: auto; margin-right: auto; }
    .cta, .facts { justify-content: center; } .orbit { transform: scale(.78); margin: -40px auto; }
    .levels, .study { grid-template-columns: 1fr 1fr; } .steps { grid-template-columns: 1fr 1fr; } .cert-wrap { grid-template-columns: 1fr; }
    nav { display: none; } .hero h1 { font-size: 40px; }
  }
  @media (max-width: 600px) {
    header { padding: 12px 16px; gap: 12px; } .actions .btn-ghost { display: none; }
    .levels, .study, .steps, .row { grid-template-columns: 1fr; } .orbit { transform: scale(.66); margin: -80px calc(50% - 230px); }
    .hero { overflow-x: clip; } /* the scaled orbit keeps its 460px layout box; centred, it would widen the page */
    section { padding: 54px 16px; } .cert { padding: 26px 22px; aspect-ratio: auto; }
    .cert .foot { flex-wrap: wrap; justify-content: center; gap: 14px 22px; } .cert .sig { min-width: 0; } /* phones: the footer wraps instead of being cut off */ .cert .who { font-size: 32px; } .cert h4 { font-size: 19px; }
  }
  @media (prefers-reduced-motion: reduce) { .spin { animation: none; } html { scroll-behavior: auto; } }

/* courses */
.page-hero { max-width: 1120px; margin: 0 auto; padding: 64px 32px 20px; text-align: center; }
.page-hero h1 { font-size: 46px; letter-spacing: -1px; margin-bottom: 14px; }
.page-hero h1 span { background: linear-gradient(90deg, var(--em), var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.track { max-width: 1120px; margin: 0 auto; padding: 36px 32px; }
.track-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.track-head h2 { font-size: 26px; text-align: left; margin: 0; }
.track-head p { color: var(--mute); font-size: 14.5px; }
.modules { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.module h3 { font-size: 19px; margin: 10px 0 8px; }
.module ul { padding-left: 18px; color: var(--mute); font-size: 14px; margin-bottom: 14px; }
.module li { margin-bottom: 4px; }
.module .links { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; font-weight: 600; }
.module .links a { text-decoration: none; }
.module .links .muted { color: var(--mute); font-weight: 500; }
.module .num { font: 700 12px/1 ui-monospace, Menlo, monospace; letter-spacing: .14em; color: var(--gold); }
.lab { border-left: 3px solid var(--gold); }
.status { float: right; }

/* certificate: seal, QR, name that fits */
.cert .who { white-space: nowrap; overflow: hidden; max-width: 100%; padding: 0 12px; }
.cert .seal-img { width: 74px; height: 74px; border-radius: 50%; box-shadow: 0 0 0 4px rgba(201, 154, 46, .22); }
.cert .id-wrap { display: flex; align-items: center; gap: 8px; text-align: left; }
.cert .qr { width: 48px; height: 48px; }

/* registration */
.reg-msg { margin-top: 14px; min-height: 1.4em; text-align: center; font-size: 14.5px; color: var(--mute); }
.reg-msg.ok { color: var(--em); font-weight: 600; } .reg-msg.bad { color: #f87171; }
.privacy { margin-top: 14px; font-size: 12.5px; color: var(--mute); text-align: center; line-height: 1.5; }

/* account pages */
#auth-area { display: inline-flex; gap: 10px; }
.auth-main { min-height: 72vh; display: grid; place-items: center; padding: 50px 16px; }
.auth-card { width: 100%; max-width: 480px; } .auth-card.wide { max-width: 860px; }
.auth-card h2 { text-align: left; font-size: 30px; margin: 4px 0 10px; } .auth-card .label { text-align: left; }
.auth-sub { color: var(--mute); margin-bottom: 8px; }
.auth-btn { width: 100%; margin-top: 20px; }
.check { display: flex; gap: 8px; align-items: center; color: var(--mute); font-size: 14px; margin-top: 14px; }
.check input { width: auto; }
.auth-links { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 18px; font-size: 14px; color: var(--mute); }
.linkish { background: none; border: none; color: var(--em); font: 600 14px Inter, sans-serif; cursor: pointer; padding: 0; margin-top: 10px; }
.learn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 18px; }
.learn-tile h3 { font-size: 18px; margin-bottom: 6px; } .learn-tile p { color: var(--mute); font-size: 14px; margin-bottom: 12px; }
.reg-msg a { color: var(--em); }
@media (max-width: 640px) { .learn-grid { grid-template-columns: 1fr; } }

/* sections that depend on sign-in: [data-when="out"] for visitors, [data-when="in"] for signed-in learners */
[data-when="in"] { display: none !important; }
body.signed-in [data-when="out"] { display: none !important; }
body.signed-in [data-when="in"] { display: revert !important; }
body.signed-in a.btn[data-when="in"] { display: inline-block !important; }

/* course player: sidebar of modules and lessons, one page at a time */
.player { position: relative; z-index: 1; display: grid; grid-template-columns: 310px minmax(0, 1fr); min-height: calc(100vh - 67px); }
/* the sidebar's scrollbar follows the theme (browsers drew a light bar on the dark page) */
.toc { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.toc::-webkit-scrollbar { width: 8px; } .toc::-webkit-scrollbar-track { background: transparent; }
.toc::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
.toc { position: sticky; top: 67px; align-self: start; height: calc(100vh - 67px); overflow-y: auto; border-right: 1px solid var(--line);
       background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(8px); padding: 22px 16px 40px; }
.toc-head { padding: 0 6px 16px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.toc-course { font: 700 17px "Space Grotesk", sans-serif; margin-bottom: 12px; }
.bar { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--em), var(--gold)); transition: width .4s; }
.toc-count { font-size: 12.5px; color: var(--mute); margin-top: 8px; }
.toc-mod { border-radius: 10px; margin-bottom: 4px; }
.toc-mod summary { cursor: pointer; list-style: none; padding: 9px 8px; border-radius: 10px; font-weight: 600; font-size: 14.5px; line-height: 1.35; }
.toc-mod summary::-webkit-details-marker { display: none; }
.toc-mod summary:hover { background: rgba(52, 211, 153, .06); }
.toc-num { display: block; font: 700 11px/1 ui-monospace, Menlo, monospace; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin-bottom: 5px; }
.toc-mod.soon summary { color: var(--mute); font-weight: 500; }
.toc-mod.soon .toc-num { color: var(--mute); }
.toc-mod .pill { font-size: 9.5px; padding: 4px 7px; margin-left: 4px; vertical-align: 1px; }
.toc-soon { font-size: 13px; color: var(--mute); padding: 0 8px 10px; }
.toc-item { display: flex; gap: 10px; align-items: flex-start; padding: 7px 8px 7px 10px; border-radius: 8px; font-size: 14px; color: var(--mute);
            text-decoration: none; line-height: 1.4; border-left: 2px solid transparent; }
.toc-item:hover { color: var(--ink); background: rgba(52, 211, 153, .06); }
.toc-item.current { color: var(--ink); background: rgba(52, 211, 153, .12); border-left-color: var(--em); font-weight: 600; }
.toc-item .tick { flex: 0 0 18px; height: 18px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center;
                  font-size: 11px; margin-top: 1px; color: var(--mute); }
.toc-item.done .tick { background: var(--em); border-color: var(--em); color: #04140d; font-weight: 700; }
.toc-item small { color: var(--mute); font-weight: 400; margin-left: 4px; }

.lesson-main { max-width: 820px; width: 100%; margin: 0 auto; padding: 44px 40px 70px; }
.crumb { font: 700 12px/1 ui-monospace, Menlo, monospace; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); margin-bottom: 14px; }
.lesson-title { font-size: 38px; line-height: 1.12; letter-spacing: -.8px; margin-bottom: 10px; }
.lesson-meta { color: var(--mute); font-size: 13.5px; margin-bottom: 28px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.lesson { font-size: 16.5px; line-height: 1.72; }
.lesson > * + * { margin-top: 1em; }
.lesson h2 { font-size: 24px; margin-top: 1.8em; letter-spacing: -.3px; }
.lesson h3 { font-size: 19px; margin-top: 1.5em; }
.lesson ul, .lesson ol { padding-left: 1.4em; } .lesson li + li { margin-top: .35em; }
.lesson strong { color: var(--ink); }
.lesson blockquote { border-left: 3px solid var(--gold); padding: 6px 0 6px 16px; color: var(--ink); font-style: italic; background: rgba(242, 199, 92, .05); border-radius: 0 8px 8px 0; }
.lesson code { font: 14px ui-monospace, Menlo, monospace; background: rgba(120, 160, 220, .12); padding: 1px 6px; border-radius: 5px; }
.lesson pre { background: #070d1a; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; overflow-x: auto; }
.lesson pre code { background: none; padding: 0; font-size: 13.5px; line-height: 1.6; color: #d6e2f5; }
:root[data-theme="light"] .lesson pre { background: #0f1b2e; }
.lesson table { width: 100%; border-collapse: collapse; font-size: 14.5px; display: block; overflow-x: auto; }
.lesson th, .lesson td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.lesson th { color: var(--gold); font-weight: 600; font-size: 13px; }
.lesson-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--line); }
.lesson-nav .btn { white-space: normal; text-align: center; }
.done-wrap { display: inline-flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-left: auto; }
.done-wrap .linkish { margin-top: 0; color: var(--mute); font-weight: 500; }

/* module quiz */
.qq { border: 1px solid var(--line); border-radius: 14px; padding: 18px 18px 14px; margin-bottom: 18px; background: var(--card); }
.qq legend { font: 600 17px/1.45 "Space Grotesk", sans-serif; padding: 0; display: flex; gap: 10px; float: left; width: 100%; margin-bottom: 6px; }
.qq legend + * { clear: both; }
.qn { flex: 0 0 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13px;
      background: linear-gradient(135deg, var(--em), var(--em-deep)); color: #04140d; margin-top: 1px; }
.qopt { display: flex; gap: 10px; align-items: flex-start; padding: 11px 12px; margin: 8px 0 0; border: 1px solid var(--line); border-radius: 10px;
        cursor: pointer; color: var(--ink); font-size: 15px; }
.qopt:hover { border-color: var(--em); }
.qopt input { width: auto; margin-top: 4px; accent-color: var(--em); }
.qopt.right { border-color: var(--em); background: rgba(52, 211, 153, .12); }
.qopt.wrong { border-color: #f87171; background: rgba(248, 113, 113, .1); }
.qfeedback:not(:empty) { margin-top: 12px; padding: 12px 14px; border-radius: 10px; background: rgba(242, 199, 92, .07); border: 1px solid rgba(242, 199, 92, .28); font-size: 14.5px; }
.qfeedback .ok { color: var(--em); } .qfeedback .bad { color: #f87171; }
.qsource { margin-top: 6px; font: 12px ui-monospace, Menlo, monospace; color: var(--mute); }
.quiz-result { min-height: 1.4em; font-weight: 600; font-size: 16px; text-align: center; padding: 6px; }
.quiz-result.ok { color: var(--em); } .quiz-result.bad { color: #f87171; }

.toc-toggle { display: none; }
@media (max-width: 900px) {
  .player { grid-template-columns: minmax(0, 1fr); z-index: auto; }      /* drawer can rise above the page */
  .player-body header { z-index: 30; }                                   /* stays above the drawer: its button closes it */
  .toc { position: fixed; top: 0; padding-top: 86px; left: 0; bottom: 0; height: auto; width: min(340px, 88vw); z-index: 20; transform: translateX(-102%);
         transition: transform .25s; box-shadow: 0 0 40px rgba(0, 0, 0, .5); background: var(--bg); }
  body.toc-open .toc { transform: none; }
  .toc-toggle { display: inline-block; }
  .player-body .actions .toc-toggle { display: inline-block !important; }
  .lesson-main { padding: 30px 16px 60px; }
  .lesson-title { font-size: 30px; }
}
.learn-tile .bar { margin: 4px 0 8px; }
.learn-count { font-size: 13px !important; }

/* lesson diagrams: inline SVG in the Markdown, coloured by the theme */
.lesson .diagram { margin: 1.8em 0; text-align: center; }
.lesson .diagram svg { width: 100%; height: auto; max-width: 700px; }
.lesson .diagram figcaption { font-size: 13.5px; color: var(--mute); margin-top: 8px; }
.diagram .box { fill: var(--bg2); stroke: var(--em); stroke-width: 1.5; }
.diagram .box.abs { stroke: var(--gold); stroke-dasharray: 5 3; }
.diagram .sep { stroke: var(--line); stroke-width: 1.2; }
.diagram .hl { fill: rgba(52, 211, 153, .16); }
.diagram text { fill: var(--ink); font: 15px Inter, sans-serif; }
.diagram text.b { font-weight: 700; } .diagram text.it { font-style: italic; } .diagram text.u { text-decoration: underline; }
.diagram text.mono { font: 13.5px ui-monospace, Menlo, monospace; }
.diagram text.mono.b { font-weight: 700; }
.diagram text.sm { font-size: 12px; fill: var(--mute); }
.diagram .ln { stroke: var(--mute); stroke-width: 1.6; fill: none; }
.diagram .ln.dash { stroke-dasharray: 5 4; }
.diagram .head { fill: var(--bg2); stroke: var(--mute); stroke-width: 1.6; }
.diagram .arrowhead { fill: var(--mute); }
.diagram .box.key { stroke: var(--gold); }
.diagram .solid { fill: var(--mute); stroke: var(--mute); stroke-width: 1.6; }
.diagram .box.hlbox { fill: rgba(52, 211, 153, .18); stroke-width: 2.2; }
.lesson hr { border: 0; border-top: 1px solid var(--line); margin: 2.2em 0; }
.lesson h3 { color: var(--ink); }

/* final exam */
.exam-banner { padding: 14px 16px; border-radius: 12px; border: 1px solid rgba(242, 199, 92, .35); background: rgba(242, 199, 92, .08);
               font-weight: 600; margin: 4px 0 18px; }
.exam-banner.ok { border-color: rgba(52, 211, 153, .45); background: rgba(52, 211, 153, .1); color: var(--em); }
.exam-banner.bad { border-color: rgba(248, 113, 113, .45); background: rgba(248, 113, 113, .08); color: #f87171; }
.cert-ready, .comments-box { margin: 18px 0; }
.cert-ready h3, .comments-box h3 { font-size: 19px; margin-bottom: 6px; }
.cert-ready p, .comments-box p { color: var(--mute); font-size: 15px; }
.cert-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
textarea { width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: rgba(5, 9, 20, .35);
           color: var(--ink); font: 15px/1.5 Inter, sans-serif; margin-top: 10px; resize: vertical; }
:root[data-theme="light"] textarea { background: #fff; }

/* certificate page: the landing page's certificate at full size */
.cert-main { position: relative; z-index: 1; max-width: 920px; margin: 0 auto; padding: 40px 16px 60px; }
.cert-full { padding: 52px 64px; display: flex; flex-direction: column; justify-content: center; }
.cert-full .k { font-size: 17px; }
.cert-full h4 { font-size: 34px; margin-top: 12px; }
.cert-full .lvl { font-size: 15px; }
.cert-full .cert-to { font-size: 15px; margin-top: 20px; }
.cert-full .who { font-size: 46px; margin: 6px 0 10px; }
.cert-full .meta { font-size: 13.5px; }
.cert-full .foot { margin-top: 30px; }
.cert-full .seal-img { width: 96px; height: 96px; }
.cert-full .qr { width: 64px; height: 64px; }
.cert-full .id { font-size: 11px; }
.cert-main .cert-actions { justify-content: center; margin-top: 24px; }
.cert-note { text-align: center; color: var(--mute); font-size: 13px; margin-top: 14px; }
@media (max-width: 700px) {
  .cert-full { padding: 30px 26px; } .cert-full h4 { font-size: 22px; } .cert-full .who { font-size: 30px; }
  .cert-full .seal-img { width: 60px; height: 60px; } .cert-full .qr { width: 44px; height: 44px; }
}
@media print {
  @page { size: A4 landscape; margin: 8mm; }
  body.cert-page header, body.cert-page .k9x-bg, body.cert-page #stars, body.cert-page .cert-actions,
  body.cert-page .cert-note, body.cert-page #verify-banner { display: none !important; }
  body.cert-page { background: #fff; }
  .cert-main { padding: 0; max-width: none; }
  .cert-full { box-shadow: none; }
}
.toc-exam { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 12px; color: var(--gold); font-weight: 600; }
.toc-exam .tick { border-color: var(--gold); color: var(--gold); }
.cert-ready h3, .comments-box h3 { margin-top: 0; }
.exam-review .review-item { padding: 16px 18px 12px; }
.review-head { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 4px; font-size: 15.5px; }
.qopt .your { float: right; font-size: 12.5px; font-weight: 600; margin-left: 10px; }
.qopt.right .your { color: var(--em); } .qopt.wrong .your { color: #f87171; }
.review-item .qopt { cursor: default; }

/* landing: learning path, exam blueprint, further reading */
.steps.path { grid-template-columns: repeat(3, 1fr); }
.blueprint { margin-top: 22px; }
.blueprint h3 { font-size: 19px; margin-bottom: 10px; }
.blueprint table, table.resources { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.blueprint th, .blueprint td, table.resources th, table.resources td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.blueprint th, table.resources th { color: var(--gold); font-size: 13px; }
.blueprint td:last-child { white-space: nowrap; }
table.resources { max-width: 820px; margin: 0 auto; }
table.resources td:first-child { white-space: nowrap; font-weight: 600; }
@media (max-width: 600px) { .steps.path { grid-template-columns: 1fr; } .blueprint td:last-child { white-space: normal; } }
@media (max-width: 960px) and (min-width: 601px) { .steps.path { grid-template-columns: 1fr 1fr; } }
@media (max-width: 960px) { .hero { grid-template-columns: minmax(0, 1fr); } .hero > div { min-width: 0; } }
@media (max-width: 600px) { .cta .btn { white-space: normal; } .hero h1 { font-size: 34px; } }

/* phones: a computer is needed for the courses, labs and exam */
.device-note { display: none; position: relative; z-index: 9; padding: 9px 16px; font-size: 13px; line-height: 1.45; text-align: center;
               color: var(--ink); background: rgba(242, 199, 92, .12); border-bottom: 1px solid rgba(242, 199, 92, .35); }
@media (max-width: 900px) { .device-note { display: block; } }
