/* ==========================================================================
   IDFactors Academy: course index and lesson pages
   Builds on styles.css and products.css tokens and components.
   ========================================================================== */

/* Header ----------------------------------------------------------------- */
.academy-brand { display: flex; align-items: center; gap: 12px; }
.academy-brand a { display: inline-flex; align-items: center; text-decoration: none; color: var(--text); }
.academy-brand img { width: 148px; height: auto; }
.academy-brand__label {
  padding-left: 12px; border-left: 1px solid var(--line);
  font-family: var(--font-display); font-size: 1rem; font-weight: 600; letter-spacing: -0.01em;
}
.btn--back { color: var(--text); border-color: #C9CED7; background: var(--white); }
.btn--back:hover { border-color: var(--text); }
.nav__list a[aria-current="page"] { color: var(--red); }
@media (max-width: 1080px) {
  .site-header__actions .btn--back { display: none; }
}
@media (max-width: 380px) {
  .academy-brand img { width: 120px; }
  .academy-brand__label { font-size: .9rem; padding-left: 10px; }
}

/* Hero ------------------------------------------------------------------- */
.ac-hero { padding-bottom: clamp(56px, 7vw, 96px); position: relative; }
.ac-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(60% 80% at 85% 20%, rgba(110,164,255,.16), transparent 70%);
}
.ac-hero .container { position: relative; }
.ac-hero h1 { font-size: clamp(2.25rem, 4.8vw, 3.75rem); line-height: 1.05; letter-spacing: -0.028em; max-width: 14em; margin-bottom: 20px; }
.ac-hero .eyebrow { margin-bottom: 18px; }
.ac-hero__meta { display: flex; flex-wrap: wrap; gap: 10px 28px; margin-top: 28px; color: var(--on-dark-2); font-size: .95rem; }
.ac-hero__meta li { display: flex; align-items: center; gap: 8px; }
.ac-hero__meta li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #6EA4FF; box-shadow: 0 0 10px #6EA4FF; }

.ac-hero .ac-hero__grid { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(16px, 3vw, 52px); }
.ac-verification { min-width: 0; margin: 0; }
.ac-verification .scene { display: block; width: 100%; height: auto; }
.ac-verification .scene text { font-family: var(--font-text); }
.ac-verification figcaption {
  margin: 0 5%; padding: 10px 0 0; border-top: 1px solid #ffffff26;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  color: #c1cedb; font-size: .88rem;
}
.ac-verification .replay {
  display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0;
  padding: 6px 10px; min-height: 44px; color: #edf4ff; background: transparent;
  border: 0; border-radius: 6px; font: inherit; cursor: pointer;
}
.ac-verification .replay:hover { background: #ffffff12; }
.ac-verification .replay:focus-visible { outline: 2px solid #a2cdff; }
.ac-verification .replay[hidden] { display: none; }
.ac-verification__controls { display: flex; }
@media (max-width: 800px) {
  .ac-hero .ac-hero__grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .ac-verification { width: min(100%, 580px); justify-self: center; }
  .ac-verification figcaption { margin: 0; }
}

/* Section headings ------------------------------------------------------- */
.ac-head { max-width: 760px; margin-bottom: 40px; }
.page-academy main .ac-head h2 { font-size: clamp(1.75rem, 3.2vw, 2.5rem); line-height: 1.1; letter-spacing: -0.022em; margin-bottom: 16px; }
.ac-head p { color: var(--muted); font-size: 1.1rem; line-height: 1.6; }
.ac-head p + p { margin-top: 14px; }

/* About grid ------------------------------------------------------------- */
.ac-points { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.ac-point { padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.ac-point__num { display: block; font-family: var(--font-mono); font-size: .85rem; color: var(--red); margin-bottom: 12px; }
.ac-point h3 { font-size: 1.2rem; line-height: 1.25; margin-bottom: 8px; }
.ac-point p { color: var(--muted); }

.ac-format { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 56px; }
.ac-format li { padding-top: 18px; border-top: 2px solid var(--text); }
.ac-format h3 { font-size: 1.05rem; margin-bottom: 6px; }
.ac-format p { color: var(--muted); font-size: .95rem; }

@media (max-width: 860px) {
  .ac-points { grid-template-columns: 1fr; }
  .ac-format { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 20px; }
}
@media (max-width: 480px) { .ac-format { grid-template-columns: 1fr; } }

/* Course outline --------------------------------------------------------- */
.ac-modules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; counter-reset: none; }
.ac-module {
  display: flex; flex-direction: column; padding: 28px 28px 20px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--white);
  scroll-margin-top: 90px;
}
.ac-module__eyebrow { font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--red); margin-bottom: 8px; }
.ac-module h3 { font-size: 1.35rem; line-height: 1.2; letter-spacing: -0.012em; margin-bottom: 8px; }
.ac-module > p { color: var(--muted); margin-bottom: 18px; }
.ac-lessons { border-top: 1px solid var(--line); margin-top: auto; }
.ac-lessons li { border-bottom: 1px solid var(--line); }
.ac-lessons li:last-child { border-bottom: 0; }
.ac-lesson-row { display: grid; grid-template-columns: 2.6em 1fr auto; gap: 10px; align-items: baseline; padding: 11px 0; font-size: .97rem; }
.ac-lesson-row__num { font-family: var(--font-mono); font-size: .85rem; color: var(--muted); }
.ac-lesson-row__title { color: #4A505C; }
.ac-lesson-row__status { font-size: .75rem; color: #7A8190; white-space: nowrap; }
a.ac-lesson-row { text-decoration: none; color: inherit; border-radius: 8px; margin-inline: -10px; padding-inline: 10px; transition: background-color .2s var(--ease); }
a.ac-lesson-row .ac-lesson-row__title { color: var(--text); font-weight: 600; }
a.ac-lesson-row .ac-lesson-row__num { color: var(--red); }
a.ac-lesson-row .ac-lesson-row__status {
  padding: 3px 10px; border-radius: 999px; background: var(--red); color: var(--white); font-weight: 600;
}
a.ac-lesson-row:hover { background: var(--red-wash); }
a.ac-lesson-row:hover .ac-lesson-row__title { color: var(--red); }
.ac-module--practice { background: var(--bg-light); }
@media (max-width: 860px) { .ac-modules { grid-template-columns: 1fr; } }

/* Lesson layout ---------------------------------------------------------- */
.ac-lesson { display: grid; grid-template-columns: minmax(0, 720px) 260px; gap: clamp(40px, 6vw, 88px); justify-content: space-between; }
.ac-aside { align-self: start; font-size: .92rem; }
@media (min-width: 1001px) {
  .ac-aside {
    --aside-top: calc(var(--header-h) + 24px);
    position: sticky;
    top: var(--aside-top);
    max-height: calc(100vh - var(--aside-top) - 16px);
    max-height: calc(100dvh - var(--aside-top) - 16px);
    overflow-y: auto;
    padding: 4px;
  }
}
.page-academy main .ac-aside h2 { font-family: var(--font-text); font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.ac-aside ol { border-left: 1px solid var(--line); margin-bottom: 32px; }
.ac-aside li a, .ac-aside li span { display: block; padding: 7px 0 7px 16px; margin-left: -1px; border-left: 2px solid transparent; text-decoration: none; color: var(--muted); line-height: 1.35; }
.ac-aside li a:hover { color: var(--red); }
.ac-aside li a[aria-current="page"] { color: var(--text); font-weight: 600; border-left-color: var(--red); }
.ac-aside li span { color: #8A909C; }
@media (max-width: 1000px) {
  .ac-lesson { grid-template-columns: 1fr; }
  .ac-aside { order: 2; }
}

/* Video placeholder ------------------------------------------------------ */
.ac-video-wrap { background: var(--navy-deep); padding-bottom: clamp(48px, 6vw, 80px); }
.ac-video {
  position: relative; aspect-ratio: 16 / 9; max-width: 1040px; margin-inline: auto;
  display: grid; place-items: center; text-align: center; overflow: hidden;
  border-radius: var(--radius-lg); border: 1px solid rgba(255,255,255,.1);
  background: radial-gradient(60% 70% at 50% 45%, #1F3256, #0D1524 75%), #0D1524;
  color: var(--on-dark);
}
.ac-video__inner { display: grid; justify-items: center; gap: 14px; padding: 24px; }
.ac-video__play {
  width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid rgba(255,255,255,.3); background: rgba(255,255,255,.06);
}
.ac-video__play svg { width: 26px; height: 26px; margin-left: 4px; fill: var(--white); opacity: .85; }
.ac-video__title { font-family: var(--font-display); font-size: clamp(1.1rem, 2vw, 1.4rem); font-weight: 600; color: var(--white); }
.ac-video__note { font-size: .9rem; color: var(--on-dark-2); }
.ac-video__key { position: absolute; right: 7%; bottom: 12%; width: 22%; opacity: .5; }
.ac-video__player { position: absolute; inset: 0; width: 100%; height: 100%; display: block; background: #0D1524; object-fit: contain; }
@media (max-width: 560px) {
  .ac-video__play { width: 56px; height: 56px; }
  .ac-video__note, .ac-video__key { display: none; }
}

/* Prose ------------------------------------------------------------------ */
.ac-prose { font-size: 1.0625rem; line-height: 1.7; color: #2A2E36; }
.ac-prose > * + * { margin-top: 1.1em; }
.page-academy main .ac-prose h2 { font-size: clamp(1.5rem, 2.6vw, 1.9rem); line-height: 1.15; letter-spacing: -0.018em; color: var(--text); margin-top: 2.4em; scroll-margin-top: 90px; }
.page-academy main .ac-prose h2:first-child { margin-top: 0; }
.ac-prose h3 { font-size: 1.2rem; line-height: 1.25; color: var(--text); margin-top: 1.8em; }
.ac-prose ul.ac-list { padding-left: 1.2em; list-style: disc; }
.ac-prose ul.ac-list li + li { margin-top: .5em; }
.ac-prose ul.ac-list li::marker { color: var(--red); }
.ac-prose strong { color: var(--text); }
.ac-prose a { color: var(--red); text-underline-offset: 3px; }
.ac-prose code, .ac-mono { font-family: var(--font-mono); font-size: .92em; }
.ac-prose code { padding: 2px 6px; border-radius: 6px; background: var(--bg-light); border: 1px solid var(--line); }

.ac-hook {
  font-family: var(--font-display); font-size: clamp(1.25rem, 2.2vw, 1.55rem); line-height: 1.4; letter-spacing: -0.01em;
  color: var(--text); padding-left: 22px; border-left: 3px solid var(--red);
}

/* Figures ---------------------------------------------------------------- */
.ac-figure { margin-block: 2em; }
.ac-figure__panel {
  border-radius: var(--radius); overflow: hidden; padding: clamp(20px, 4vw, 36px);
  background: radial-gradient(70% 90% at 50% 40%, #1B2A47, #0D1524 80%); color: var(--on-dark);
}
.ac-figure__panel svg { width: 100%; height: auto; }
.ac-figure figcaption { margin-top: 12px; font-size: .9rem; color: var(--muted); line-height: 1.5; }

.ac-keyhex {
  font-family: var(--font-mono); font-size: clamp(.95rem, 2.4vw, 1.3rem); letter-spacing: .04em; color: #CFE0FF;
  text-shadow: 0 0 18px rgba(110,164,255,.55); text-align: center; word-spacing: .25em; overflow-wrap: anywhere;
}
.ac-keyhex__label { display: flex; justify-content: center; gap: 24px; margin-top: 16px; font-size: .85rem; color: var(--on-dark-2); }
.ac-keyhex__label span::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #6EA4FF; margin-right: 8px; vertical-align: 1px; }

/* Tables ----------------------------------------------------------------- */
.ac-table-wrap { overflow-x: auto; margin-block: 1.6em; border: 1px solid var(--line); border-radius: var(--radius); }
.ac-table { width: 100%; border-collapse: collapse; font-size: .95rem; line-height: 1.45; }
.ac-table th, .ac-table td { padding: 14px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.ac-table thead th { background: var(--navy); color: var(--white); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; }
.ac-table tbody tr:last-child td, .ac-table tbody tr:last-child th { border-bottom: 0; }
.ac-table tbody th { font-weight: 600; color: var(--text); }
.ac-table .ac-strong { color: var(--text); font-weight: 600; }

/* Interactive: key generator -------------------------------------------- */
.ac-keygen { margin-block: 2em; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.ac-keygen__top { padding: 22px 24px; background: var(--bg-light); border-bottom: 1px solid var(--line); }
.ac-keygen__top h3 { margin: 0 0 4px; font-size: 1.1rem; }
.ac-keygen__top p { margin: 0; color: var(--muted); font-size: .95rem; }
.ac-keygen__body { padding: 22px 24px 24px; }
.ac-keygen__sizes { display: flex; flex-wrap: wrap; gap: 8px; border: 0; padding: 0; margin: 0 0 18px; }
.ac-keygen__sizes legend { font-size: .85rem; font-weight: 600; margin-bottom: 8px; }
.ac-keygen__sizes label { position: relative; }
.ac-keygen__sizes input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.ac-keygen__sizes span {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 999px;
  border: 1px solid #C9CED7; font-size: .875rem; font-weight: 600; cursor: pointer;
}
.ac-keygen__sizes input:checked + span { background: var(--navy); border-color: var(--navy); color: var(--white); }
.ac-keygen__sizes input:focus-visible + span { outline: 3px solid #4D8DFF; outline-offset: 2px; }
.ac-keygen__out {
  padding: 20px; border-radius: 10px; background: var(--navy-deep); min-height: 84px; display: grid; place-items: center;
}
.ac-keygen__out .ac-keyhex { font-size: clamp(.95rem, 2.6vw, 1.25rem); }
.ac-keygen__stats { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 18px 0; }
.ac-keygen__stats dt { font-size: .8rem; color: var(--muted); }
.ac-keygen__stats dd { margin: 2px 0 0; font-weight: 600; color: var(--text); }
.ac-keygen__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.btn--navy { background: var(--navy); color: var(--white); }
.btn--navy:hover { background: var(--navy-soft); }
.ac-keygen__note { font-size: .85rem; color: var(--muted); }
@media (max-width: 480px) { .ac-keygen__stats { grid-template-columns: 1fr; } }

/* Key terms and recap ---------------------------------------------------- */
.ac-box { padding: 26px 28px; border-radius: var(--radius); background: var(--bg-light); border: 1px solid var(--line); margin-block: 2.2em; }
.page-academy main .ac-box > h2, .ac-box > h3 { font-family: var(--font-text); font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--red); margin: 0 0 14px; }
.ac-terms > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.3fr); gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.ac-terms > div:first-child { border-top: 0; padding-top: 0; }
.ac-terms dt { font-weight: 600; color: var(--text); }
.ac-terms dd { margin: 0; color: #4A505C; font-size: .97rem; line-height: 1.55; }
@media (max-width: 560px) { .ac-terms > div { grid-template-columns: 1fr; gap: 4px; } }

.ac-recap { counter-reset: recap; }
.ac-recap li { counter-increment: recap; position: relative; padding: 10px 0 10px 44px; line-height: 1.55; }
.ac-recap li::before {
  content: counter(recap); position: absolute; left: 0; top: 9px; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; background: var(--navy); color: var(--white); font-size: .85rem; font-weight: 600;
}

/* Go deeper -------------------------------------------------------------- */
.ac-deeper { margin-top: 3em; border: 1px solid var(--line); border-radius: var(--radius); }
.ac-deeper > summary {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; cursor: pointer; list-style: none;
  padding: 22px 24px; font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; color: var(--text);
}
.ac-deeper > summary::-webkit-details-marker { display: none; }
.ac-deeper > summary small { display: block; margin-top: 2px; font-family: var(--font-text); font-size: .9rem; font-weight: 400; color: var(--muted); }
.ac-deeper > summary::after {
  /* Plus drawn with two centered bars, so it sits exactly in the middle of the circle */
  content: ""; flex: none; width: 32px; height: 32px; border-radius: 50%; box-sizing: border-box;
  border: 1px solid #C9CED7; transition: transform .25s var(--ease);
  background:
    linear-gradient(currentColor, currentColor) center / 12px 1.5px no-repeat,
    linear-gradient(currentColor, currentColor) center / 1.5px 12px no-repeat;
}
.ac-deeper[open] > summary::after { transform: rotate(45deg); }
.ac-deeper > summary:hover { color: var(--red); }
.ac-deeper__body { padding: 0 24px 28px; }
.ac-deeper__body > h3:first-child { margin-top: .4em; }
.ac-cmd {
  font-family: var(--font-mono); font-size: .92rem; padding: 14px 18px; border-radius: 10px;
  background: var(--navy-deep); color: #E2E6ED; overflow-x: auto; white-space: pre;
}
.ac-cmd .ac-cmd__prompt { color: #6EA4FF; user-select: none; }
.ac-sources li + li { margin-top: .5em; }

/* Pager ------------------------------------------------------------------ */
.ac-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 56px; }
.ac-pager > * { display: block; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--text); }
.ac-pager small { display: block; font-size: .78rem; color: var(--muted); margin-bottom: 4px; }
.ac-pager strong { font-family: var(--font-display); font-weight: 600; }
.ac-pager__next { text-align: right; }
.ac-pager__soon { color: #8A909C; background: var(--bg-light); }
.ac-pager__soon strong { color: #6B7280; }
a.ac-pager__link:hover { border-color: var(--red); }
a.ac-pager__link:hover strong { color: var(--red); }
@media (max-width: 560px) { .ac-pager { grid-template-columns: 1fr; } .ac-pager__next { text-align: left; } }

.ac-reviewed { margin-top: 32px; font-size: .85rem; color: var(--muted); }

/* Footer ----------------------------------------------------------------- */
.ac-footer-note { margin-top: 18px; max-width: 26em; line-height: 1.6; }

/* Lesson 1.2: hash values and the live hash demo ------------------------- */
.ac-hashhex { font-size: clamp(.8rem, 1.9vw, 1.05rem); word-spacing: .15em; }
.ac-hashhex--second { margin-top: 28px; }
.ac-hashhex__label { margin-top: 10px; }
.ac-hashdemo__row { display: grid; gap: 8px; margin-bottom: 18px; }
.ac-hashdemo__row label { font-size: .85rem; font-weight: 600; }
.ac-hashdemo__row input {
  font: inherit; font-size: 1rem; padding: 10px 14px; border-radius: 10px;
  border: 1px solid #C9CED7; background: var(--white); color: var(--text); width: 100%; box-sizing: border-box;
}
.ac-hashdemo__row input:focus-visible { outline: 3px solid #4D8DFF; outline-offset: 1px; border-color: var(--navy); }
.ac-hashdemo__out {
  margin: 0; padding: 12px 14px; border-radius: 10px; background: var(--navy-deep); color: #CFE0FF;
  font-family: var(--font-mono); font-size: .88rem; line-height: 1.6; word-spacing: .2em; overflow-wrap: anywhere;
}
.ac-hashdemo__out mark { background: rgba(110,164,255,.28); color: var(--white); border-radius: 2px; }
.ac-hashdemo__hash { display: flex; justify-content: space-between; align-items: baseline; margin-top: 4px; font-size: .8rem; }
.ac-hashdemo__label { color: var(--muted); font-weight: 600; }
.ac-hashdemo__status { color: var(--muted); }
.ac-hashdemo__status.is-updated { color: #2B6FE0; font-weight: 600; }
.ac-hashdemo__out.is-flash { animation: ac-hash-flash .7s var(--ease); }
@keyframes ac-hash-flash { from { box-shadow: 0 0 0 3px rgba(110,164,255,.85); } to { box-shadow: 0 0 0 3px rgba(110,164,255,0); } }
@media (prefers-reduced-motion: reduce) { .ac-hashdemo__out.is-flash { animation: none; } }

/* Lesson 1.3: encryption demo -------------------------------------------- */
.ac-linkbtn { white-space: nowrap; flex: none; margin-left: 12px; border: 0; background: none; padding: 0; font: inherit; font-size: .8rem; font-weight: 600; color: #2B6FE0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.ac-linkbtn:hover { color: var(--navy); }
.ac-cipherdemo .ac-hashdemo__out { margin-bottom: 14px; }
.ac-cipherdemo__key { color: #9CC2FF; }
.ac-cipherdemo__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.ac-cipherdemo__result { min-height: 1.6em; margin: 16px 0 6px; font-weight: 600; }
.ac-cipherdemo__result.is-ok { color: #1E8E3E; }
.ac-cipherdemo__result.is-no { color: #D92D20; }
.ac-cipherdemo__actions .btn:disabled { opacity: .5; cursor: default; }

/* Lesson 1.4: key-agreement demo ----------------------------------------- */
.ac-kademo__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.ac-kademo__party, .ac-kademo__eve { padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); min-width: 0; }
.ac-kademo__party h4, .ac-kademo__eve h4 { margin: 0 0 8px; font-family: var(--font-display); font-size: 1.15rem; }
.ac-kademo__party .ac-hashdemo__out { margin-bottom: 12px; }
.ac-kademo__pub { color: #5EEAD4; }
.ac-kademo__private { margin: 4px 0 14px; font-size: .9rem; color: var(--muted); font-style: italic; }
.ac-kademo__eve { margin-top: 4px; background: var(--bg-light); }
.ac-kademo__eve > p:first-of-type { margin: 0 0 10px; font-size: .95rem; color: #4A505C; }
@media (max-width: 640px) { .ac-kademo__grid { grid-template-columns: 1fr; } }

/* Lessons 1.5–1.8 --------------------------------------------------------- */
.ac-prose ol.ac-steps { padding-left: 1.4em; list-style: decimal; }
.ac-prose ol.ac-steps li + li { margin-top: .6em; }
.ac-prose ol.ac-steps li::marker { color: var(--red); font-weight: 600; }
.ac-rsademo__steps { display: grid; gap: 10px; margin: 6px 0 4px; }
.ac-rsademo__steps > div { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; padding: 10px 14px; border-radius: 10px; background: var(--navy-deep); }
.ac-rsademo__steps dt { color: #C4CBD7; font-size: .92rem; }
.ac-rsademo__steps dd { margin: 0; font-family: var(--font-mono); font-size: 1.1rem; color: #CFE0FF; }
.ac-rsademo__factor { margin-top: 18px; }
.ac-hashdemo__row input[type="number"] { max-width: 220px; }
.ac-cipherdemo__actions .btn { white-space: normal; text-align: center; height: auto; min-height: 36px; padding-block: 8px; line-height: 1.3; }
.ac-prose code { overflow-wrap: anywhere; }
.ac-kademo .ac-keygen__actions { margin-top: 24px; }

/* Module 0 demos ------------------------------------------------------------ */
.ac-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ac-clonedemo .ac-hashdemo__out { margin-bottom: 14px; word-spacing: .2em; }
.ac-readerdemo__grid { margin-block: 0 4px; }
.ac-readerdemo__grid td { vertical-align: middle; }
.ac-readerdemo__grid .btn { min-width: 112px; }
.ac-readerdemo__grid .btn.is-ok { color: #1E8E3E; border-color: #1E8E3E; }
.ac-readerdemo__grid .btn.is-no { color: #D92D20; border-color: #D92D20; }
.ac-logdemo__table td:first-child { font-family: var(--font-mono); white-space: nowrap; }
.ac-logdemo__table tr.is-false td { background: #FDECEA; }
.ac-logdemo__table tr.is-false td:nth-child(3) { color: #D92D20; font-weight: 600; }
.ac-logdemo .ac-table-wrap { margin-block: 0 16px; }
.ac-lesson > .ac-prose { min-width: 0; }
.ac-readerdemo__sub { display: block; font-size: .78rem; font-weight: 400; color: var(--muted); }

/* Module 2 demos ------------------------------------------------------------ */
.ac-check { display: flex; gap: 10px; align-items: flex-start; margin: 8px 0; font-size: .95rem; cursor: pointer; }
.ac-check input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--navy); flex: none; }
.ac-chaindemo__checks { border: 0; padding: 0; margin: 0 0 8px; }
.ac-ownerdemo .btn.is-active { background: var(--navy); color: var(--white); border-color: var(--navy); }
.ac-ownerdemo__out { margin-top: 18px; }
.ac-ownerdemo__out p { margin: 0; color: #4A505C; font-size: .95rem; }
.ac-hashdemo__row input[type="range"] { width: 100%; accent-color: var(--navy); }
.ac-certdemo .ac-rsademo__steps dd { font-size: .95rem; font-family: var(--font-mono); }
.ac-demo-gap { margin-top: 22px; }
.ac-demo-group { margin-top: 10px; }
.ac-certdemo .ac-rsademo__steps { margin-bottom: 4px; }

/* Lesson 3.4: APDU log */
.ac-apdudemo__log { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 10px; }
.ac-apdudemo__log li { padding: 12px 14px; border-radius: 10px; background: var(--navy-deep); color: #E6ECF5; display: grid; gap: 4px; min-width: 0; }
.ac-prose .ac-apdudemo__log code { background: none; border: 0; padding: 0; font-family: var(--font-mono); font-size: .85rem; color: #9CC2FF; overflow-wrap: anywhere; }
.ac-apdudemo__dir { font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: #8C96A8; }
.ac-apdudemo__mean { margin-top: 4px; font-size: .9rem; color: #E6ECF5; }
.ac-ctdemo .btn.is-active, .ac-ifdemo .btn.is-active { background: var(--navy); color: var(--white); border-color: var(--navy); }
/* Module 3: rows of plain-text facts in demos */
.ac-factrows > div { display: grid; grid-template-columns: minmax(0, 11em) minmax(0, 1fr); align-items: start; }
.ac-factrows dt { font-size: .85rem; }
.ac-factrows dd { font-family: inherit; font-size: .95rem; line-height: 1.45; }
@media (max-width: 560px) { .ac-factrows > div { grid-template-columns: 1fr; gap: 4px; } }
/* Module 4 */
.ac-demo-label { margin: 0 0 6px; font-size: .8rem; font-weight: 600; color: var(--muted); }
.ac-pickdemo .btn.is-active, .ac-mechdemo .btn.is-active, .ac-doordemo .btn.is-active { background: var(--navy); color: var(--white); border-color: var(--navy); }
.ac-pickdemo [data-pick-panel] { margin-top: 18px; }
.ac-cred { box-shadow: inset 0 0 0 1px var(--cred); }
.ac-cred::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 8px; border-radius: 50%; background: var(--cred); vertical-align: 0; }
.ac-pickdemo .btn.ac-cred.is-active { box-shadow: inset 0 0 0 2px var(--cred); }
.ac-pickdemo [data-pick-panel][hidden], .ac-pickdemo [data-pick-empty][hidden] { display: none; }
.ac-demo-label.ac-demo-gap { margin-top: 22px; }
.ac-authzdemo .btn.is-active, .ac-wiredemo .btn.is-active { background: var(--navy); color: var(--white); border-color: var(--navy); }
.ac-wiredemo .ac-kademo__grid { gap: 12px; }
.ac-sizedemo .btn.is-active { background: var(--navy); color: var(--white); border-color: var(--navy); }
.ac-lwedemo .ac-hashdemo__out { font-size: .82rem; }
.ac-lwedemo [data-lwe-eq] { margin-top: 14px; }

/* Lesson 3.2: the timing attack demo log */
.ac-timingdemo__found { margin: 4px 0 14px; font-family: var(--font-mono); font-size: 1rem; font-weight: 600; letter-spacing: .04em; color: var(--navy); }
.ac-timingdemo__log { list-style: none; margin: 8px 0 12px; padding: 0; display: grid; gap: 6px; }
.ac-timingdemo__entry { display: grid; grid-template-columns: 4.5em minmax(0, 12em) 1fr; align-items: center; gap: 12px; font-size: .9rem; color: var(--text); }
.ac-timingdemo__entry code { font-family: var(--font-mono); font-size: .95rem; }
.ac-timingdemo__bar { height: 12px; width: calc(var(--units) * 25%); min-width: 10px; border-radius: 6px; background: var(--muted); opacity: .55; }
.ac-timingdemo__entry.is-up .ac-timingdemo__bar { background: #D97706; opacity: 1; }
.ac-timingdemo__entry.is-up .ac-timingdemo__units { color: #B45309; font-weight: 600; }
.ac-timingdemo__entry.is-ok .ac-timingdemo__bar { background: #1E8E3E; opacity: 1; }
.ac-timingdemo__entry.is-ok .ac-timingdemo__units { color: #1E8E3E; font-weight: 600; }
.ac-timingdemo__units { color: var(--muted); }
@media (max-width: 520px) { .ac-timingdemo__entry { grid-template-columns: 4em minmax(0, 1fr); } .ac-timingdemo__units { grid-column: 1 / -1; } }

/* "From the makers" band at the bottom of Academy pages */
.ac-maker { background: var(--navy-deep); color: var(--on-dark-2); border-top: 1px solid #ffffff14; padding-block: clamp(40px, 5vw, 56px); }
.ac-maker__label { margin: 0 0 6px; font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #8C95A6; }
.ac-maker__intro { margin: 0 0 24px; font-size: 1.05rem; line-height: 1.5; color: var(--on-dark-2); }
.ac-maker__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.ac-maker__item { display: flex; gap: 16px; align-items: center; height: 100%; padding: 16px; border: 1px solid #ffffff1f; border-radius: 14px; background: #16233D; color: inherit; text-decoration: none; transition: border-color .2s, background .2s; }
.ac-maker__item:hover { border-color: #6EA4FF80; background: #1B2A47; }
.ac-maker__item:focus-visible { outline: 2px solid #A5CEFF; outline-offset: 3px; }
.ac-maker__thumb { flex: none; display: grid; place-items: center; width: 88px; height: 88px; border-radius: 10px; background: #F2F4F7; overflow: hidden; }
.ac-maker__thumb img { width: auto; height: 76px; }
.ac-maker__thumb--cover img { width: 100%; height: 100%; object-fit: cover; }
.ac-maker__thumb--icon { background: #22365C; color: #A5CEFF; }
.ac-maker__text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ac-maker__text strong { color: var(--white); font-size: 1rem; font-weight: 600; }
.ac-maker__text strong span { color: #A5CEFF; }
.ac-maker__text > span { font-size: .875rem; line-height: 1.45; color: #B0B7C3; }
@media (max-width: 1100px) { .ac-maker__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .ac-maker__grid { grid-template-columns: 1fr; } }
