/* lesson-2026 — the deck system, rebuilt to match the families page.
 *
 * Ryan asked on Aug 26, 2026 for lesson slides that look and read like
 * /student-hub/families/ rather than the older condensed-uppercase decks.
 * This sheet is self-contained: it styles everything presentation.js needs,
 * so a deck loads this INSTEAD of advanced-first-week/styles.css, not on top
 * of it. Older decks keep their original look.
 *
 * Projected in a bright room, so it commits to the paper ground in every
 * viewer theme and paints every color explicitly.
 */

:root {
  --ink:        #151515;
  --paper:      #f7f4ec;
  --surface:    #ffffff;
  --rule:       #ded7c7;
  --muted:      #6f675c;
  --orange:     #f45a24;
  --orange-ink: #b8380d;
  --yellow:     #f2d40b;
  --blue:       #0a527b;
  --green:      #177e3d;

  --ground: var(--paper);
  --text:   var(--ink);
  --accent: var(--orange-ink);
  --line:   var(--rule);
  --panel:  var(--surface);
  --quiet:  var(--muted);

  --display: var(--hub-font-body);
  --label:   var(--hub-font-display);

  --header-h: clamp(48px, 6vh, 68px);
  --pad-x:    clamp(28px, 6vw, 110px);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--display);
  font-size: clamp(1rem, 1.25vw, 1.35rem);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  padding: 12px 16px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
}
.skip-link:focus { left: 0; }

/* ---------------------------------------------------------------- header --- */

.deck-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 40;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 var(--pad-x);
  background: var(--ink);
  color: var(--paper);
}

.deck-brand {
  display: grid;
  gap: 1px;
  color: inherit;
  text-decoration: none;
  line-height: 1.1;
}
.deck-brand span {
  font-size: clamp(.55rem, .7vw, .72rem);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #b6ad9c;
}
.deck-brand strong {
  font-family: var(--label);
  text-transform: uppercase;
  font-size: clamp(.95rem, 1.3vw, 1.3rem);
  font-weight: 700;
  letter-spacing: .04em;
}
.deck-brand:hover strong { color: var(--yellow); }

.deck-section {
  margin: 0;
  font-family: var(--label);
  text-transform: uppercase;
  font-weight: 700;
  font-size: clamp(.8rem, 1.05vw, 1.05rem);
  letter-spacing: .16em;
  color: var(--yellow);
}

.deck-count {
  margin: 0;
  font-variant-numeric: tabular-nums;
  font-size: clamp(.75rem, 1vw, 1rem);
  color: #b6ad9c;
}
.deck-count [data-current-slide] {
  color: var(--paper);
  font-weight: 700;
}

/* ----------------------------------------------------------------- slides --- */

.deck {
  position: relative;
  height: 100%;
  padding-top: var(--header-h);
  padding-bottom: clamp(52px, 7vh, 74px);
}

.slide {
  position: absolute;
  inset: var(--header-h) 0 clamp(52px, 7vh, 74px);
  display: none;
  overflow-y: auto;
  background: var(--ground);
  color: var(--text);
}
.slide.is-active { display: block; }

.slide__canvas {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(.6rem, 1.4vh, 1.1rem);
  width: min(72rem, 100%);
  margin: 0 auto;
  padding: clamp(1.75rem, 4vh, 3.25rem) var(--pad-x);
}

/* Tones. Paper is the default; the others are used sparingly, the way the
   families page spends its one bold color in one place. */
.slide--paper  { --ground: var(--paper);   --text: var(--ink);   --accent: var(--orange-ink); --line: var(--rule);   --panel: var(--surface); --quiet: var(--muted); }
.slide--ink    { --ground: var(--ink);     --text: #efe9dc;      --accent: var(--yellow);     --line: #3a352f;       --panel: #1f1d1a;       --quiet: #a49a8b; }
.slide--yellow { --ground: var(--yellow);  --text: #1b1705;      --accent: #6b5c00;           --line: #c7ae06;       --panel: #fbeb7a;       --quiet: #5c5104; }
.slide--orange { --ground: #fdf0e9;        --text: var(--ink);   --accent: var(--orange-ink); --line: #f0cbb8;       --panel: var(--surface); --quiet: #8a6a5b; }
.slide--blue   { --ground: #eaf2f7;        --text: #0d2b3c;      --accent: var(--blue);       --line: #c2d8e4;       --panel: var(--surface); --quiet: #4d6b7c; }
.slide--green  { --ground: #ecf5ee;        --text: #10301c;      --accent: var(--green);      --line: #c6ddcd;       --panel: var(--surface); --quiet: #4a6b55; }

@media (prefers-reduced-motion: no-preference) {
  .slide.is-entering .slide__canvas > * {
    animation: rise .34s cubic-bezier(.2, .7, .3, 1) both;
  }
  .slide.is-entering .slide__canvas > *:nth-child(2) { animation-delay: .04s; }
  .slide.is-entering .slide__canvas > *:nth-child(3) { animation-delay: .08s; }
  .slide.is-entering .slide__canvas > *:nth-child(4) { animation-delay: .12s; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* ------------------------------------------------------------- typography --- */

.slide__eyebrow {
  margin: 0;
  font-family: var(--label);
  text-transform: uppercase;
  font-weight: 700;
  font-size: clamp(1.2rem, 1.8vw, 1.75rem);
  letter-spacing: .18em;
  color: var(--accent);
}

.slide h1,
.slide h2 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.06;
  text-wrap: balance;
  max-width: 22ch;
}
.slide h1 { font-size: clamp(2.1rem, 4.6vw, 4.1rem); }
.slide h2 { font-size: clamp(1.7rem, 3.3vw, 3rem); max-width: 26ch; }

.lede {
  margin: .3rem 0 0;
  font-size: clamp(1.4rem, 2.2vw, 2.25rem);
  line-height: 1.35;
  max-width: 40ch;
}

.slide p { margin: 0; max-width: 60ch; }

.note {
  margin: 0;
  font-size: clamp(1.15rem, 1.5vw, 1.5rem);
  color: var(--quiet);
  max-width: 62ch;
}

.mark {
  position: absolute;
  right: var(--pad-x);
  bottom: clamp(1rem, 4vh, 3rem);
  margin: 0;
  font-family: var(--label);
  text-transform: uppercase;
  font-weight: 600;
  font-size: clamp(7rem, 20vw, 17rem);
  line-height: .8;
  color: var(--accent);
  opacity: .13;
  pointer-events: none;
}

/* ------------------------------------------------------------ components --- */

.ticks { margin: .35rem 0 0; padding: 0; list-style: none; display: grid; gap: .5rem; }
.ticks li {
  position: relative;
  padding-left: 1.7rem;
  max-width: 58ch;
  font-size: clamp(1.2rem, 1.7vw, 1.7rem);
  line-height: 1.4;
}
.ticks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .55em;
  width: .68rem;
  height: .68rem;
  border: 2px solid var(--accent);
  border-radius: 2px;
}

.steps { margin: .4rem 0 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: .55rem; }
.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 1fr);
  column-gap: 1rem;
  align-items: baseline;
  padding: .5rem 0;
  border-top: 1px solid var(--line);
  max-width: 62ch;
}
.steps li:first-child { border-top: 2px solid var(--text); }
.steps li::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--label);
  text-transform: uppercase;
  font-weight: 700;
  font-size: clamp(1.4rem, 2vw, 1.95rem);
  color: var(--accent);
}
/* A step can carry its own label - a letter for a role, or a real step number
   when the slide starts partway through a longer sequence. */
.steps li[data-key]::before { content: attr(data-key); }

/* strong and span are siblings, so both have to be pinned to the text column.
   Without this, span starts a third column and the sentence renders one word
   per line. */
.steps strong,
.steps span { grid-column: 2; }
.steps strong { font-weight: 600; font-size: clamp(1.3rem, 1.85vw, 1.85rem); line-height: 1.3; }
.steps span   { margin-top: .1rem; font-size: clamp(1.1rem, 1.45vw, 1.45rem); color: var(--quiet); line-height: 1.4; }

.cards {
  margin: .5rem 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: clamp(.75rem, 1.6vw, 1.4rem);
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: clamp(.9rem, 1.8vw, 1.5rem);
}
.card b {
  display: block;
  font-family: var(--label);
  text-transform: uppercase;
  font-size: clamp(1.35rem, 1.95vw, 1.95rem);
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--accent);
  margin-bottom: .1rem;
}
.card strong { display: block; font-weight: 600; font-size: clamp(1.3rem, 1.8vw, 1.8rem); line-height: 1.25; }
.card p { margin-top: .35rem; font-size: clamp(1.1rem, 1.45vw, 1.45rem); color: var(--quiet); line-height: 1.4; }

.callout {
  margin: .5rem 0 0;
  padding: clamp(.85rem, 1.7vw, 1.35rem) clamp(1rem, 2vw, 1.6rem);
  border-left: 5px solid var(--accent);
  background: var(--panel);
  font-size: clamp(1.3rem, 1.8vw, 1.85rem);
  font-weight: 600;
  line-height: 1.35;
  max-width: 56ch;
}

.turn-in {
  margin: .6rem 0 0;
  display: grid;
  /* Cap the label column so a long label wraps instead of squeezing the
     link or note beside it into a one-word-wide column. */
  grid-template-columns: fit-content(42%) minmax(0, 1fr);
  gap: clamp(1rem, 2.4vw, 2rem);
  align-items: center;
  padding: clamp(.8rem, 1.8vh, 1.4rem) 0;
  border-top: 2px solid var(--text);
  border-bottom: 2px solid var(--text);
  max-width: 62ch;
}
.turn-in span {
  font-family: var(--label);
  text-transform: uppercase;
  font-weight: 700;
  font-size: clamp(1.35rem, 1.95vw, 1.95rem);
  line-height: 1.15;
  letter-spacing: .1em;
  color: var(--accent);
}
.turn-in p { font-size: clamp(1.2rem, 1.7vw, 1.7rem); font-weight: 600; }

.slide a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.slide a:hover { color: var(--accent); }

.filename {
  font-family: var(--hub-font-body);
  font-size: .92em;
}

/* --------------------------------------------------------------- controls --- */

.deck-controls {
  position: fixed;
  inset: auto 0 0;
  z-index: 40;
  display: flex;
  align-items: stretch;
  border-top: 1px solid var(--rule);
  background: var(--paper);
}
.deck-controls button {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: clamp(.7rem, 1.6vh, 1.05rem) clamp(.9rem, 2vw, 1.6rem);
  border: 0;
  border-left: 1px solid var(--rule);
  background: transparent;
  color: var(--ink);
  font-family: var(--label);
  text-transform: uppercase;
  font-weight: 700;
  font-size: clamp(.8rem, 1.05vw, 1.05rem);
  letter-spacing: .12em;
  cursor: pointer;
}
.deck-controls button:hover { background: var(--ink); color: var(--paper); }
.deck-controls [data-next] { background: var(--yellow); }
.deck-controls [data-next]:hover { background: var(--ink); color: var(--yellow); }
.deck-controls [data-previous] { border-left: 0; }
.control-hint {
  flex: 1;
  margin: 0;
  align-self: center;
  padding: 0 clamp(.9rem, 2vw, 1.6rem);
  font-size: clamp(.72rem, .95vw, .95rem);
  color: var(--muted);
}

.index-rail {
  position: fixed;
  left: 0;
  top: 50%;
  z-index: 45;
  transform: translateY(-50%);
  padding: clamp(.9rem, 2vh, 1.5rem) .35rem;
  border: 0;
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
}
.index-rail span {
  display: block;
  font-family: var(--label);
  text-transform: uppercase;
  font-weight: 700;
  font-size: .8rem;
  letter-spacing: .18em;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}
.index-rail:hover { background: var(--orange); }

.deck-controls button:focus-visible,
.index-rail:focus-visible,
.slide a:focus-visible,
.deck-brand:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 2px;
}

/* ------------------------------------------------------------ slide index --- */

.slide-index {
  width: min(64rem, 92vw);
  max-height: 84vh;
  padding: 0;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
}
.slide-index::backdrop { background: rgba(21, 21, 21, .68); }
.slide-index__header {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.1rem clamp(1rem, 3vw, 2rem);
  background: var(--ink);
  color: var(--paper);
}
.slide-index__header p {
  margin: 0 0 .1rem;
  font-family: var(--label);
  text-transform: uppercase;
  font-weight: 700;
  font-size: .85rem;
  letter-spacing: .16em;
  color: var(--yellow);
}
.slide-index__header h2 { margin: 0; font-size: 1.5rem; font-weight: 700; }
.slide-index__header button {
  border: 1px solid currentColor;
  padding: .5rem .9rem;
  background: transparent;
  color: inherit;
  font-family: var(--label);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: .1em;
  cursor: pointer;
}
.slide-index__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 1px;
  padding: 1px;
  background: var(--rule);
}
.index-item {
  display: grid;
  gap: .15rem;
  padding: .9rem 1rem;
  border: 0;
  background: var(--paper);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.index-item:hover { background: var(--yellow); }
.index-item span {
  font-family: var(--label);
  text-transform: uppercase;
  font-weight: 700;
  font-size: .95rem;
  color: var(--orange-ink);
}
.index-item small { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.index-item strong { font-size: 1.02rem; font-weight: 600; line-height: 1.25; }

/* -------------------------------------------------------------------- toast --- */

.toast {
  position: fixed;
  left: 50%;
  bottom: clamp(4.5rem, 11vh, 6.5rem);
  z-index: 60;
  transform: translate(-50%, 8px);
  margin: 0;
  padding: .65rem 1.1rem;
  background: var(--ink);
  color: var(--paper);
  font-size: .95rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 720px) {
  .deck-section { display: none; }
  .index-rail { display: none; }
  .slide__canvas { justify-content: flex-start; }
}
