/* Kapitulo Dos
   Active theme: A, warm editorial (cream paper, ink, one oxblood accent).
   Headings: Cormorant Garamond. Body and labels: Lora.
   The neutral, B and C themes are kept commented below for reference.
   The canvas hero reads these same custom properties.
*/

@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("../assets/fonts/cormorant-garamond-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../assets/fonts/inter-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Lora";
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url("../assets/fonts/lora-latin-italic.woff2") format("woff2");
}

@font-face {
  font-family: "Lora";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../assets/fonts/lora-latin-normal.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-text: "Lora", Georgia, serif;
  --font-weight-display: 300;
  --font-weight-text: 400;
  --color-paper: #F3EDE4;
  --color-paper-raised: #F7F3EC;
  --color-ink: #2B2522;
  --color-ink-soft: #53463C;
  --color-rule: rgba(43, 37, 34, 0.16);
  --color-accent: #8A3A35;
  --color-page: #F8F4EE;
  --color-page-line: rgba(43, 37, 34, 0.45);
  --color-page-rule: rgba(43, 37, 34, 0.14);
  --color-cover: #2B2522;
  --color-cover-edge: #53463C;
  --color-shadow: rgba(43, 37, 34, 0.16);
  --color-focus: #8A3A35;
  --color-done: #2B2522;
  --color-current: #8A3A35;
  --color-locked: #53463C;
  --grain-opacity: 0.05;
  --grain-blend: multiply;
}

/* Neutral theme (previous default).

:root {
  color-scheme: light;

  --font-display: "Cormorant Garamond", "Iowan Old Style", Palatino, "Palatino Linotype", serif;
  --font-text: "Inter", "Avenir Next", "Segoe UI", Helvetica, Arial, sans-serif;
  --font-weight-display: 300;
  --font-weight-text: 400;

  --color-paper: #eceae4;
  --color-paper-raised: #f7f6f2;
  --color-ink: #1b1a17;
  --color-ink-soft: #5a564f;
  --color-rule: rgba(27, 26, 23, 0.16);
  --color-accent: #6e6256;
  --color-page: #fbfaf6;
  --color-page-line: rgba(27, 26, 23, 0.45);
  --color-page-rule: rgba(27, 26, 23, 0.16);
  --color-cover: #1b1a17;
  --color-cover-edge: #3f3c37;
  --color-shadow: rgba(27, 26, 23, 0.16);
  --color-focus: #1b1a17;
  --color-done: #1b1a17;
  --color-current: #6e6256;
  --color-locked: #5a564f;

  --grain-opacity: 0.045;
  --grain-blend: multiply;
}
*/

/* Theme B, modern premium.
   Navy page, ivory type, one gold accent.
   Headings: Playfair Display. Body and labels: Inter.
   Load this before uncommenting, then comment out the active :root:
   https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;1,400&family=Inter:wght@400;500&display=swap

:root {
  color-scheme: dark;
  --font-display: "Playfair Display", Georgia, serif;
  --font-text: "Inter", "Segoe UI", sans-serif;
  --font-weight-display: 500;
  --font-weight-text: 400;
  --color-paper: #0F1E3A;
  --color-paper-raised: #1C2F4D;
  --color-ink: #F3EEE4;
  --color-ink-soft: #A8B0BC;
  --color-rule: rgba(243, 238, 228, 0.22);
  --color-accent: #B8925A;
  --color-page: #F3EEE4;
  --color-page-line: rgba(15, 30, 58, 0.55);
  --color-page-rule: rgba(15, 30, 58, 0.16);
  --color-cover: #0F1E3A;
  --color-cover-edge: #B8925A;
  --color-shadow: rgba(0, 0, 0, 0.45);
  --color-focus: #B8925A;
  --color-done: #F3EEE4;
  --color-current: #B8925A;
  --color-locked: #A8B0BC;
  --grain-opacity: 0.14;
  --grain-blend: overlay;
}
*/

/* Theme C, Filipino-rooted.
   Sand page, earth type, abaca secondary, terracotta accent.
   Headings: Fraunces (SOFT 40, WONK 0, opsz 72). Body and labels: Nunito Sans.
   Load this before uncommenting, then comment out the active :root:
   https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500&family=Nunito+Sans:opsz,wght@6..12,400;6..12,500&display=swap

:root {
  color-scheme: light;
  --font-display: "Fraunces", Georgia, serif;
  --font-text: "Nunito Sans", "Segoe UI", sans-serif;
  --font-weight-display: 400;
  --font-weight-text: 400;
  --color-paper: #F5EBDF;
  --color-paper-raised: #F8F1E8;
  --color-ink: #4A3426;
  --color-ink-soft: #6E5A45;
  --color-rule: #E2D3C2;
  --color-accent: #B5573A;
  --color-page: #FBF6EF;
  --color-page-line: rgba(74, 52, 38, 0.48);
  --color-page-rule: rgba(74, 52, 38, 0.14);
  --color-cover: #4A3426;
  --color-cover-edge: #6E5A45;
  --color-shadow: rgba(74, 52, 38, 0.18);
  --color-focus: #B5573A;
  --color-done: #4A3426;
  --color-current: #B5573A;
  --color-locked: #6E5A45;
  --grain-opacity: 0.055;
  --grain-blend: multiply;
}
*/

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--color-paper);
  color: var(--color-ink);
  scrollbar-width: thin;
  scrollbar-color: var(--color-rule) transparent;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-text);
  font-weight: var(--font-weight-text);
  font-size: 1rem;
  line-height: 1.6;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: var(--grain-opacity);
  mix-blend-mode: var(--grain-blend);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

::selection {
  background: var(--color-ink);
  color: var(--color-paper);
}

:focus-visible {
  outline: 1px solid var(--color-focus);
  outline-offset: 3px;
}

img {
  max-width: 100%;
  height: auto;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: var(--font-weight-display);
  letter-spacing: 0.01em;
  line-height: 1.12;
  text-wrap: balance;
  margin: 0;
}

h1 {
  font-size: clamp(2.4rem, 5vw, 3.4rem);
}

p {
  margin: 0 0 1rem;
}

a {
  color: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  background: var(--color-ink);
  color: var(--color-paper);
  padding: 0.55rem 0.8rem;
  text-decoration: none;
}

.skip:focus {
  top: 1rem;
}

.eyebrow {
  margin: 0 0 0.8rem;
  font-family: var(--font-text);
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--color-ink-soft);
}

hr.rule {
  width: 3.25rem;
  height: 1px;
  margin: 1.05rem auto 1.25rem;
  border: 0;
  background: var(--color-ink);
  opacity: 0.4;
}

.mark {
  display: inline-block;
  width: 1.75rem;
  height: 1.75rem;
  background: var(--color-ink);
  -webkit-mask: var(--mark) center / contain no-repeat;
  mask: var(--mark) center / contain no-repeat;
}

.mark-week-1,
.mark-week-2,
.mark-week-3,
.mark-week-4,
.mark-week-5 {
  width: 2.25rem;
  height: 2.25rem;
}

.mark-week-1 { --mark: url("../assets/icon-week1-self-discovery.svg"); }
.mark-week-2 { --mark: url("../assets/icon-week2-tools.svg"); }
.mark-week-3 { --mark: url("../assets/icon-week3-communication-english.svg"); }
.mark-week-4 { --mark: url("../assets/icon-week4-competition.svg"); }
.mark-week-5 { --mark: url("../assets/icon-week5-ai-automation.svg"); }

.mark-seal {
  width: 3.5rem;
  height: 3.5rem;
  background: var(--color-ink);
  --mark: url("../assets/seal-certificate.svg");
}

.art {
  display: inline-block;
  color: var(--color-ink);
  line-height: 0;
}

.art svg {
  display: block;
  width: 100%;
  height: 100%;
}

.art svg * {
  vector-effect: non-scaling-stroke;
}

.art-book {
  width: 9.5rem;
  height: 6.2rem;
}

.art-book-sm {
  width: 2.7rem;
  height: 1.8rem;
}

.hero-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

main,
.colophon,
.bar {
  position: relative;
  z-index: 2;
}

.brand {
  position: fixed;
  z-index: 4;
  left: 0;
  right: 0;
  top: 60%;
  padding: 0 1.25rem;
  text-align: center;
  pointer-events: none;
  transform-origin: top center;
}

.brand a {
  pointer-events: auto;
  text-decoration: none;
}

.site-mark {
  position: fixed;
  z-index: 6;
  top: 0.8rem;
  left: 50%;
  transform: translateX(-50%);
  display: block;
  padding: 0.35rem 0.2rem;
  line-height: 0;
  text-decoration: none;
}

.site-mark .logo {
  display: block;
  height: 2.05rem;
  width: auto;
  max-width: 46vw;
  margin: 0;
}

.brand h1 {
  font-size: clamp(2.8rem, 6.2vw, 5.5rem);
  line-height: 0.95;
  font-weight: var(--font-weight-display);
}

.tagline {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  padding-left: 0.32em;
  color: var(--color-ink);
}

.menu-toggle {
  display: none;
}

.menu {
  position: fixed;
  z-index: 5;
  left: 1.75rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.15rem;
  margin: 0;
  padding: 0;
}

.menu a {
  position: relative;
  display: inline-block;
  color: var(--color-ink-soft);
  text-decoration: none;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  line-height: 1.4;
}

.menu a:hover,
.menu a[aria-current="true"] {
  color: var(--color-ink);
}

.menu a::after {
  content: "";
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  width: 0;
  height: 1px;
  background: currentColor;
}

.menu a:hover::after,
.menu a:focus-visible::after,
.menu a[aria-current="true"]::after {
  width: 1.5rem;
}

.hint {
  position: fixed;
  z-index: 4;
  left: 0;
  right: 0;
  bottom: 1.3rem;
  margin: 0;
  text-align: center;
  pointer-events: none;
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--color-ink-soft);
}

.hero-space {
  height: 100vh;
  height: 100svh;
}

.panel {
  padding: 5.5rem 1.25rem;
  scroll-margin-top: 4.5rem;
}

.panel-inner {
  width: min(40rem, 100%);
  margin: 0 auto;
  text-align: center;
}

#weeks .panel-inner {
  width: min(44rem, 100%);
}

.panel h2 {
  font-size: clamp(2rem, 4.4vw, 3.3rem);
  margin-bottom: 0.35rem;
}

.copy {
  max-width: 38rem;
  margin: 0 auto 1rem;
  line-height: 1.75;
}

.subhead {
  margin: 2.2rem 0 0.75rem;
  font-size: clamp(1.6rem, 3vw, 2.15rem);
}

.steps {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  text-align: left;
}

.steps li {
  display: grid;
  grid-template-columns: 3.2rem 1fr;
  gap: 0.4rem 1rem;
  padding: 1.15rem 0;
  border-top: 1px solid var(--color-rule);
}

.step-num,
.week-index,
.toc .n,
.chapter .num {
  font-variant-numeric: tabular-nums;
}

.step-num {
  font-family: var(--font-display);
  font-weight: var(--font-weight-display);
  font-size: 1.8rem;
  line-height: 1;
}

.steps h3 {
  font-family: var(--font-text);
  font-weight: 400;
  font-size: 1rem;
  letter-spacing: 0;
  margin: 0 0 0.25rem;
}

.steps p {
  margin: 0;
  line-height: 1.6;
}

.week-head {
  display: grid;
  grid-template-columns: 2.8rem 1fr;
  gap: 0.75rem 1rem;
  align-items: start;
  margin: 3.2rem 0 0.8rem;
  text-align: left;
}

.week-index {
  font-family: var(--font-text);
  font-weight: 400;
  font-size: 0.95rem;
  line-height: 1;
  letter-spacing: 0.14em;
  color: var(--color-ink-soft);
  padding-top: 0.35rem;
  white-space: nowrap;
}

.week-head .mark {
  margin-bottom: 0.45rem;
}

.week-head h3 {
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  margin: 0.1rem 0 0.35rem;
}

.week-head p {
  margin: 0;
  color: var(--color-ink);
  line-height: 1.55;
}

.toc {
  list-style: none;
  margin: 0;
  padding: 0;
  text-align: left;
}

.toc li {
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: 0.75rem;
  padding: 0.68rem 0;
  border-top: 1px solid var(--color-rule);
  line-height: 1.45;
}

.toc .n {
  color: var(--color-ink-soft);
}

.panel .mark-seal {
  display: block;
  margin: 0 auto 1rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.6rem;
}

.more {
  margin: 1.25rem 0 0;
}

.more a,
.back a,
.fine a {
  text-underline-offset: 0.22em;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.75rem 1.35rem;
  border: 1px solid var(--color-ink);
  border-radius: 0;
  background: var(--color-ink);
  color: var(--color-paper);
  font-family: var(--font-text);
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
}

.btn:hover,
.btn:focus-visible {
  background: transparent;
  color: var(--color-ink);
}

.btn-ghost {
  background: transparent;
  color: var(--color-ink);
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
  background: var(--color-ink);
  color: var(--color-paper);
}

.btn-block {
  width: 100%;
}

.btn-quiet {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.35rem 0;
  border: 0;
  background: transparent;
  color: var(--color-ink);
  font: inherit;
  font-size: 0.92rem;
  text-decoration: underline;
  text-underline-offset: 0.22em;
}

.colophon {
  width: min(68rem, calc(100% - 2.4rem));
  margin: 0 auto;
  padding: 1rem 0 3rem;
  color: var(--color-ink-soft);
  font-size: 0.82rem;
  line-height: 1.6;
}

.page-home .colophon {
  text-align: center;
  padding-bottom: 4.5rem;
}

.bar {
  border-bottom: 1px solid var(--color-rule);
}

.bar-inner,
.wrap {
  width: min(68rem, calc(100% - 2.4rem));
  margin-inline: auto;
}

.bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 0;
}

.wordmark {
  font-family: var(--font-display);
  font-weight: var(--font-weight-display);
  font-size: 1.85rem;
  line-height: 1;
  letter-spacing: 0.01em;
  text-decoration: none;
}

.who-name {
  margin: 0.4rem 0 0;
}

.who-meta {
  margin: 0.15rem 0 0;
  color: var(--color-ink-soft);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.bar-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.gate-main {
  min-height: calc(100vh - 5rem);
  min-height: calc(100svh - 5rem);
  display: grid;
  place-items: center;
  padding: 3rem 1.25rem 2rem;
}

.narrow {
  width: min(24rem, 100%);
}

.narrow .art-book {
  display: block;
  margin: 0 auto 1.2rem;
}

.narrow .eyebrow,
.narrow h1,
.narrow .lede,
.narrow .back,
.narrow .fine {
  text-align: center;
}

.lede {
  max-width: 36rem;
  line-height: 1.7;
}

.form {
  margin-top: 1.6rem;
  text-align: left;
}

.field {
  margin: 0 0 1.25rem;
}

.field label {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-ink-soft);
}

.field input {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.7rem 0;
  border: 0;
  border-bottom: 1px solid var(--color-rule);
  border-radius: 0;
  background: transparent;
  color: var(--color-ink);
  font-size: 1rem;
}

.field input:focus-visible {
  outline: 1px solid var(--color-focus);
  outline-offset: 4px;
  border-bottom-color: var(--color-ink);
}

.field input:user-invalid {
  border-bottom-color: var(--color-accent);
}

.or {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.75rem;
  align-items: center;
  margin: 1.35rem 0 0.35rem;
  color: var(--color-ink-soft);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.or::before,
.or::after {
  content: "";
  height: 1px;
  background: var(--color-rule);
}

.fine {
  color: var(--color-ink-soft);
  font-size: 0.82rem;
  line-height: 1.6;
  margin-top: 1.3rem;
}

.back {
  margin-top: 0.4rem;
}

.desk-main {
  padding: 2.6rem 0 3rem;
}

.desk-main .lede {
  max-width: 38rem;
}

.meter {
  width: min(28rem, 100%);
  height: 1px;
  margin: 0.35rem 0 0.85rem;
  background: var(--color-rule);
}

.meter-fill {
  display: block;
  height: 1px;
  background: var(--color-ink);
}

.catch {
  color: var(--color-ink-soft);
  font-size: 0.92rem;
}

.gates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 2rem 0 2.6rem;
  border-top: 1px solid var(--color-rule);
}

.gate {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  column-gap: 0.9rem;
  row-gap: 0.15rem;
  align-items: center;
  width: 100%;
  min-height: 44px;
  padding: 1.15rem 1rem 1.15rem 0;
  border: 0;
  border-bottom: 1px solid var(--color-rule);
  background: transparent;
  color: inherit;
  text-align: left;
}

.gate .mark,
.gate .art {
  grid-column: 1;
  grid-row: 1 / span 2;
}

.gate-kicker {
  grid-column: 2;
  grid-row: 1;
}

.gate-title {
  grid-column: 2;
  grid-row: 2;
}

.gate .status {
  grid-column: 3;
  grid-row: 1 / span 2;
  align-self: center;
}

.gates .gate + .gate {
  padding-left: 1.15rem;
  border-left: 1px solid var(--color-rule);
}

.gate-kicker {
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-ink-soft);
}

.gate-title {
  font-family: var(--font-display);
  font-weight: var(--font-weight-display);
  font-size: clamp(1.25rem, 2vw, 1.6rem);
  line-height: 1.1;
}

.gate .status,
.chapter .status {
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-ink-soft);
}

.gate:hover .gate-kicker,
.gate:focus-visible .gate-kicker {
  color: var(--color-ink);
}

.desk {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(16rem, 0.8fr);
  gap: 3.5rem;
  align-items: start;
}

.reader {
  position: sticky;
  top: 1.25rem;
  border-top: 1px solid var(--color-rule);
  padding-top: 1.15rem;
}

.reader h2 {
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  margin: 0.15rem 0 0.8rem;
}

.reader .rule {
  margin-left: 0;
}

.reader-meta {
  margin: 0 0 0.85rem;
  color: var(--color-ink-soft);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.reader p {
  line-height: 1.7;
}

.week-block {
  margin-top: 2.2rem;
}

.week-block h2 {
  font-size: clamp(1.7rem, 3vw, 2.15rem);
  margin: 0.15rem 0 0.25rem;
}

.week-note {
  margin: 0;
  color: var(--color-ink-soft);
  font-size: 0.92rem;
}

.chapter-list {
  margin-top: 0.8rem;
}

.chapter {
  display: grid;
  grid-template-columns: 2.4rem minmax(0, 1fr) auto;
  gap: 0.35rem 0.75rem;
  align-items: baseline;
  width: 100%;
  min-height: 48px;
  padding: 0.85rem 0.15rem;
  border: 0;
  border-top: 1px solid var(--color-rule);
  background: transparent;
  color: var(--color-ink);
  text-align: left;
}

.chapter:last-child {
  border-bottom: 1px solid var(--color-rule);
}

.chapter .num {
  color: var(--color-ink-soft);
}

.chapter .name {
  line-height: 1.4;
}

.chapter.is-locked {
  color: var(--color-locked);
}

.chapter.is-current .status {
  color: var(--color-current);
}

.chapter.is-selected {
  box-shadow: inset 2px 0 0 var(--color-accent);
  padding-left: 0.7rem;
}

.chapter.is-selected .num {
  color: var(--color-accent);
}

.chapter:hover .name,
.chapter:focus-visible .name {
  color: var(--color-ink);
}

@media (min-width: 901px) {
  .panel {
    min-height: 100vh;
    min-height: 100svh;
    display: grid;
    align-items: center;
    padding: 7rem 3rem 7rem 8rem;
  }

  #weeks.panel {
    min-height: 0;
    display: block;
    padding-top: 8rem;
  }

  .menu a::after {
    transition: width 0.35s ease;
  }
}

@media (max-width: 1100px) {
  .panel-inner,
  #weeks .panel-inner {
    width: min(34rem, 100%);
  }
}

@media (max-width: 900px) {
  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    z-index: 9;
    top: 0.85rem;
    right: 0.9rem;
    min-width: 44px;
    min-height: 44px;
    padding: 0.4rem 0.15rem;
    border: 0;
    background: transparent;
    color: var(--color-ink);
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
  }

  .menu {
    display: none;
    inset: 0;
    top: 0;
    left: 0;
    transform: none;
    justify-content: center;
    gap: 0.35rem;
    padding: 5rem 2rem;
    background: var(--color-paper);
  }

  .menu.is-open {
    display: flex;
    z-index: 8;
  }

  .menu a {
    font-size: 13px;
    letter-spacing: 0.24em;
    padding: 0.55rem 0;
  }

  .menu a::after {
    display: none;
  }

  .brand {
    top: 54%;
  }

  .site-mark {
    top: 0.72rem;
  }

  .site-mark .logo {
    height: 1.55rem;
  }

  .tagline {
    letter-spacing: 0.18em;
    padding-left: 0.18em;
  }
}

@media (max-width: 859px) {
  .desk {
    display: flex;
    flex-direction: column;
    gap: 2rem;
  }

  .reader {
    position: static;
    order: -1;
  }

  .gates {
    grid-template-columns: 1fr;
  }

  .gates .gate + .gate {
    padding-left: 0;
    border-left: 0;
  }
}

@media (max-width: 640px) {
  .bar-inner {
    align-items: flex-start;
  }

  .chapter {
    grid-template-columns: 2.2rem minmax(0, 1fr);
  }

  .chapter .status {
    grid-column: 2;
  }

  .week-head {
    grid-template-columns: 3rem 1fr;
  }
}

@media (max-width: 520px) {
  .actions {
    flex-direction: column;
    align-items: stretch;
  }

  .actions .btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }

  .page-home .brand {
    transition: top 1.05s cubic-bezier(0.22, 0.61, 0.21, 1), transform 1.05s cubic-bezier(0.22, 0.61, 0.21, 1);
  }

  .hint {
    transition: opacity 0.6s ease;
  }

  .btn {
    transition: background 0.2s ease, color 0.2s ease;
  }

  html.has-js body.page-home:not(.hero-ready) .brand .eyebrow,
  html.has-js body.page-home:not(.hero-ready) .brand h1,
  html.has-js body.page-home:not(.hero-ready) .brand .rule,
  html.has-js body.page-home:not(.hero-ready) .brand .tagline {
    opacity: 0;
  }

  html.has-js body.page-home.hero-ready .brand .eyebrow {
    animation: appear 1s ease both;
  }

  html.has-js body.page-home.hero-ready .brand h1 {
    animation: appear 1.15s ease 0.12s both;
  }

  html.has-js body.page-home.hero-ready .brand .rule {
    animation: appear 1s ease 0.28s both;
  }

  html.has-js body.page-home.hero-ready .brand .tagline {
    animation: appear 1.1s ease 0.4s both;
  }

  html.has-js .panel-inner {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.8s ease, transform 0.8s ease;
  }

  html.has-js .panel.is-in .panel-inner {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .menu a::after,
  .hint,
  .btn,
  .panel-inner {
    transition: none;
    animation: none;
  }

  .page-home .brand,
  .hero-canvas,
  .site-mark {
    transition: opacity 180ms ease, transform 180ms ease;
    animation: none;
  }
}

.hint.is-gone {
  opacity: 0;
}

.desk-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2.5rem;
  align-items: center;
}

.sheet-pair {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.4rem;
  min-height: 20rem;
  padding: 1rem 0.4rem 1.4rem;
}

.float-slot {
  position: relative;
  width: 11.5rem;
  height: 16rem;
  flex: 0 0 auto;
}

.sheet-shadow {
  position: absolute;
  z-index: 0;
  left: 12%;
  right: 12%;
  bottom: 0.15rem;
  height: 1.15rem;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(43, 37, 34, 0.34), transparent 70%);
  pointer-events: none;
  will-change: transform, opacity;
}

.sheet-shadow-lift {
  opacity: 0;
  transform: scaleX(1.38) scaleY(1.2);
  transition: opacity 0.28s ease;
}

.float-sheet {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  color: var(--color-ink);
  text-decoration: none;
  will-change: transform;
}

.sheet-face {
  display: block;
  width: 100%;
  height: 100%;
  background:
    linear-gradient(var(--color-page-rule), var(--color-page-rule)) 1.1rem 1.4rem / 1px 70% no-repeat,
    var(--color-page);
  border: 1px solid var(--color-rule);
  transition: transform 0.28s ease;
  transform-origin: center bottom;
}

.sheet-a .float-sheet { animation: float-a 5.5s ease-in-out infinite; }
.sheet-a .sheet-shadow:not(.sheet-shadow-lift) { animation: shadow-a 5.5s ease-in-out infinite; }
.sheet-b .float-sheet { animation: float-b 6.8s ease-in-out -2.7s infinite; }
.sheet-b .sheet-shadow:not(.sheet-shadow-lift) { animation: shadow-b 6.8s ease-in-out -2.7s infinite; }

.sheet-label {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 1.2rem;
  font-family: var(--font-display);
  font-size: 1.85rem;
  line-height: 0.95;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.float-slot:hover .sheet-label,
.float-slot:focus-within .sheet-label,
.float-slot:active .sheet-label {
  opacity: 1;
}

.float-slot:hover .sheet-face,
.float-slot:focus-within .sheet-face,
.float-slot:active .sheet-face {
  transform: translateY(-12px) scale(1.04);
}

.float-slot:hover .sheet-shadow-lift,
.float-slot:focus-within .sheet-shadow-lift,
.float-slot:active .sheet-shadow-lift {
  opacity: 0.9;
}

.float-sheet:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
}

.book-sheet {
  width: min(38rem, 100%);
  margin: 0 auto;
  padding: 1.6rem 1.4rem 1.8rem;
  background: var(--color-page);
  border: 1px solid var(--color-rule);
  box-shadow: 0 16px 32px var(--color-shadow);
  animation: page-turn 0.45s ease;
}

.page-turn {
  width: min(38rem, 100%);
  margin: 1rem auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.page-turn a {
  color: var(--color-ink);
}

.has-folio-tab .desk-main {
  padding-right: 3.4rem;
}

.folio-tab {
  position: fixed;
  z-index: 6;
  right: 0;
  top: 36%;
  transform-origin: right center;
  padding: 1rem 0.55rem;
  min-width: 44px;
  background: var(--color-page);
  color: var(--color-ink);
  border: 1px solid var(--color-rule);
  border-right: 0;
  box-shadow: -4px 6px 0 var(--color-shadow);
  text-decoration: none;
  writing-mode: vertical-rl;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.68rem;
  animation: folio-flap 2.4s ease-in-out infinite;
  will-change: transform;
}

body.folio-open .folio-tab {
  animation: none;
  transform: none;
}

.folio-tab:focus-visible,
.folio-close:focus-visible,
.page-turn a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

.folio-panel {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(43, 37, 34, 0.28);
  display: flex;
  justify-content: flex-end;
}

.folio-dialog {
  width: min(34rem, 100%);
  height: 100%;
  overflow: auto;
  padding: 1.3rem 1.3rem 2.5rem;
  background: var(--color-page);
  box-shadow: -12px 0 30px var(--color-shadow);
  animation: sheet-slide 0.35s ease;
}

.folio-close {
  float: right;
  color: var(--color-ink);
  text-decoration: none;
  font-size: 1.6rem;
  line-height: 1;
  padding: 0.2rem 0.35rem;
}

.folio-open {
  overflow: hidden;
}

.save-status {
  min-height: 1.2rem;
  color: var(--color-ink-soft);
  font-size: 0.82rem;
}

@keyframes float-a {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-12px) rotate(2deg); }
}

@keyframes float-b {
  0%, 100% { transform: translateY(-12px) rotate(1.6deg); }
  50% { transform: translateY(0) rotate(-2.2deg); }
}

@keyframes shadow-a {
  0%, 100% { transform: scaleX(0.78) scaleY(0.72); opacity: 0.78; }
  50% { transform: scaleX(1.22) scaleY(1); opacity: 0.38; }
}

@keyframes shadow-b {
  0%, 100% { transform: scaleX(1.22) scaleY(1); opacity: 0.38; }
  50% { transform: scaleX(0.78) scaleY(0.72); opacity: 0.78; }
}

@keyframes float-a-soft {
  0%, 100% { transform: translateY(0) rotate(-1.2deg); }
  50% { transform: translateY(-7px) rotate(1.2deg); }
}

@keyframes float-b-soft {
  0%, 100% { transform: translateY(-7px) rotate(1deg); }
  50% { transform: translateY(0) rotate(-1.3deg); }
}

@keyframes shadow-a-soft {
  0%, 100% { transform: scaleX(0.86) scaleY(0.8); opacity: 0.7; }
  50% { transform: scaleX(1.12) scaleY(1); opacity: 0.46; }
}

@keyframes shadow-b-soft {
  0%, 100% { transform: scaleX(1.12) scaleY(1); opacity: 0.46; }
  50% { transform: scaleX(0.86) scaleY(0.8); opacity: 0.7; }
}

@keyframes page-turn {
  from { transform: translateX(16px) rotate(0.4deg); opacity: 0.45; }
  to { transform: none; opacity: 1; }
}

@keyframes sheet-slide {
  from { transform: translateX(24px); }
  to { transform: none; }
}

@media (max-width: 800px) {
  .desk-hero {
    grid-template-columns: 1fr;
  }

  .sheet-pair {
    min-height: 15rem;
    gap: 0.8rem;
  }

  .float-slot {
    width: 8.5rem;
    height: 12rem;
  }

  .sheet-label {
    font-size: 1.45rem;
  }
}

@media (max-width: 700px) {
  .folio-dialog {
    width: 100%;
  }

  .has-folio-tab .desk-main {
    padding-right: 3.1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sheet-a .float-sheet { animation: float-a-soft 9.2s ease-in-out infinite; }
  .sheet-a .sheet-shadow:not(.sheet-shadow-lift) { animation: shadow-a-soft 9.2s ease-in-out infinite; }
  .sheet-b .float-sheet { animation: float-b-soft 11.3s ease-in-out -3.4s infinite; }
  .sheet-b .sheet-shadow:not(.sheet-shadow-lift) { animation: shadow-b-soft 11.3s ease-in-out -3.4s infinite; }
  .book-sheet { animation: page-fade 0.9s ease; }
  .folio-dialog { animation-duration: 0.7s; }
  .sheet-label,
  .sheet-face,
  .sheet-shadow-lift { transition-duration: 0.6s; }
  body:not(.folio-open) .folio-tab { animation: folio-flap-soft 4.8s ease-in-out infinite; }
}

@keyframes folio-flap {
  0%, 100% { transform: rotate(0deg) skewX(0deg); }
  9% { transform: rotate(2deg) skewX(1deg); }
  16% { transform: rotate(-12deg) skewX(-8deg); }
  23% { transform: rotate(-3deg) skewX(-1deg); }
  31% { transform: rotate(-18deg) skewX(-12deg); }
  40% { transform: rotate(-6deg) skewX(-3deg); }
  48% { transform: rotate(-14deg) skewX(-9deg); }
  63% { transform: rotate(-2deg) skewX(-1deg); }
  76% { transform: rotate(-9deg) skewX(-5deg); }
  88% { transform: rotate(-1deg) skewX(0deg); }
}

@keyframes folio-flap-soft {
  0%, 100% { transform: rotate(0deg) skewX(0deg); }
  22% { transform: rotate(-4deg) skewX(-2deg); }
  38% { transform: rotate(-7deg) skewX(-4deg); }
  58% { transform: rotate(-2deg) skewX(-1deg); }
  78% { transform: rotate(-5deg) skewX(-3deg); }
}

@keyframes page-fade {
  from { opacity: 0.55; }
  to { opacity: 1; }
}

body.menu-open {
  overflow: hidden;
}

@keyframes appear {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Logo: "2os" wordmark, inline SVG so it uses the self-hosted display font and theme colours. */
.logo { display: block; height: 1.6em; width: auto; overflow: visible; }
.brand h1 .logo { margin: 0 auto; }
.wordmark .logo { height: 1.5em; }
.logo text { font-family: var(--font-display); }

button.bar-link {
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.alert {
  color: var(--color-accent);
  margin: 0 0 1rem;
}

a.chapter {
  text-decoration: none;
}

.stack-form {
  margin: 1.4rem 0 0;
}

.certificate-sheet {
  width: min(40rem, 100%);
  margin: 2.5rem auto 1rem;
  text-align: center;
  border-top: 1px solid var(--color-rule);
  border-bottom: 1px solid var(--color-rule);
  padding: 2.5rem 1.25rem;
}

.admin-list {
  list-style: none;
  margin: 0 0 1.2rem;
  padding: 0;
}

.admin-list li {
  padding: 0.85rem 0 0.2rem;
  border-top: 1px solid var(--color-rule);
}

.admin-block {
  margin: 2rem 0;
  padding-top: 1rem;
  border-top: 1px solid var(--color-rule);
}

.admin-block h2 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  margin: 0 0 0.8rem;
}

.reset {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: end;
  margin: 0.35rem 0 1rem;
}

.reset input {
  flex: 1 1 12rem;
  min-height: 44px;
  border: 0;
  border-bottom: 1px solid var(--color-rule);
  background: transparent;
  color: var(--color-ink);
  font: inherit;
  font-size: 1rem;
}

@media print {
  .bar,
  .colophon,
  .skip,
  .no-print {
    display: none !important;
  }

  body {
    background: white;
  }

  .certificate-sheet {
    border: 0;
    margin: 0 auto;
  }
}

.block {
  margin: 1.25rem 0 1.5rem;
}

.video-frame {
  position: relative;
  width: min(40rem, 100%);
  aspect-ratio: 16 / 9;
  margin: 0.8rem 0 0;
  background: var(--color-paper-raised);
}

.video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.resource-list,
.check-list,
.quiz {
  list-style: none;
  margin: 0;
  padding: 0;
}

.resource-list li,
.check-list label,
.quiz label {
  display: block;
  padding: 0.7rem 0;
  border-top: 1px solid var(--color-rule);
}

.check-list label,
.quiz label {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  cursor: pointer;
}

.quiz-question {
  margin: 0 0 1rem;
  padding: 0;
  border: 0;
}

.quiz-question legend {
  font-family: var(--font-text);
  padding: 0 0 0.35rem;
}
