/* =========================================================================
   Leader Wiki, first version — archived in tests/ when the tab-bar app
   (Direction 01) became the live wiki.html.
   Same voice as Studio: warm near-black or warm paper, TeX Gyre Heros 400,
   pills for actions, 20px cards. It follows the device's light/dark setting
   because leaders open it on whatever phone is in their pocket, often in a
   bright classroom. One column on phones; content widens into grids, never
   into a sidebar, so the page reads the same everywhere.
   ========================================================================= */

@font-face {
  font-family: "TeX Gyre Heros";
  src: url("../../fonts/texgyreheros-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #130F0C;
  --fg: #FFFFFF;
  --panel: #1E1915;
  --well: color-mix(in srgb, var(--fg) 7%, var(--panel));
  --line: color-mix(in srgb, var(--fg) 13%, transparent);
  --muted: color-mix(in srgb, var(--fg) 62%, transparent);
  --bar: rgba(19, 15, 12, .82);
  --focus: #00D9FF;
  --font: "TeX Gyre Heros", Helvetica, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --r-card: 20px;
  --pad: max(16px, env(safe-area-inset-left));
  --wrap: 1120px;
  --bar-h: 60px;
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #F2EEE8;
    --fg: #130F0C;
    --panel: #FFFFFF;
    --bar: rgba(242, 238, 232, .85);
  }
}

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

html {
  scroll-behavior: smooth;
  /* anchors land below the sticky bar, not under it */
  scroll-padding-top: calc(var(--bar-h) + 16px);
  background: var(--bg);
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body.wiki {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 16px/1.45 var(--font);
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, p { margin: 0; font-weight: 400; }
b { font-weight: 400; }
a { color: inherit; }
button, input { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
[hidden] { display: none !important; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 50;
  padding: 10px 16px; border-radius: 999px;
  background: var(--fg); color: var(--bg); text-decoration: none;
}
.skip:focus { top: 12px; }

/* Icons are line drawings; a filled shape opts in with .f */
svg { stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; fill: none; }
svg .f { fill: currentColor; stroke: none; }

/* ── Top bar ───────────────────────────────────────────────────────────── */

.bar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding-top: env(safe-area-inset-top, 0px);
  background: var(--bar);
  -webkit-backdrop-filter: saturate(1.4) blur(16px);
  backdrop-filter: saturate(1.4) blur(16px);
  border-bottom: 1px solid var(--line);
}
.bar__in {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: var(--wrap);
  height: var(--bar-h);
  margin: 0 auto;
  padding: 0 var(--pad);
}
.bar__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: none;
  text-decoration: none;
}
.bar__logo { width: 32px; height: 32px; fill: currentColor; stroke: none; }
.bar__name { font-size: 20px; letter-spacing: -0.02em; }

/* Section jump links. On a phone they scroll sideways under the brand
   rather than wrapping — one row keeps the bar a fixed height. */
.jump {
  position: relative; /* offsetLeft of the chips measures from here */
  display: flex;
  gap: 4px;
  margin-left: auto;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12px, #000 calc(100% - 12px), transparent);
          mask-image: linear-gradient(90deg, transparent, #000 12px, #000 calc(100% - 12px), transparent);
  padding: 0 12px;
}
.jump::-webkit-scrollbar { display: none; }
.jump a {
  flex: none;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  transition: color .2s, background-color .2s;
}
.jump a:hover { color: var(--fg); }
.jump a[aria-current="true"] { color: var(--fg); background: var(--well); }

/* ── Layout ────────────────────────────────────────────────────────────── */

.main {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--pad) 48px;
}

.sec { padding-top: 56px; }
.sec__head { margin-bottom: 20px; max-width: 640px; }
.sec__head h2 { font-size: clamp(28px, 6vw, 40px); line-height: 1.05; letter-spacing: -0.03em; }
.sec__head p { margin-top: 10px; color: var(--muted); }

.eyebrow { font-size: 14px; color: var(--muted); }

.txtlink {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: var(--fg);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.txtlink svg { width: 14px; height: 14px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--well);
  font-size: 14px;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color .2s, transform .2s var(--ease);
}
.pill svg { width: 16px; height: 16px; }
.pill:hover { background: color-mix(in srgb, var(--fg) 14%, var(--panel)); }
.pill:active { transform: scale(.97); }
.pill--solid { background: var(--fg); color: var(--bg); padding: 0 20px; min-height: 48px; font-size: 16px; }
.pill--solid:hover { background: color-mix(in srgb, var(--fg) 86%, var(--bg)); }

/* ── Intro ─────────────────────────────────────────────────────────────── */

.intro { padding-top: 40px; }
.intro__title {
  margin-top: 10px;
  max-width: 14em;
  font-size: clamp(36px, 9vw, 72px);
  line-height: 1;
  letter-spacing: -0.04em;
}

.find {
  position: relative;
  display: flex;
  align-items: center;
  margin-top: 28px;
  max-width: 560px;
}
.find > svg {
  position: absolute; left: 16px;
  width: 20px; height: 20px;
  color: var(--muted);
  pointer-events: none;
}
.find input {
  width: 100%;
  height: 52px;
  padding: 0 48px 0 46px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  font-size: 16px; /* 16px stops iOS zooming the page on focus */
  outline: none;
  -webkit-appearance: none;
          appearance: none;
  transition: border-color .2s;
}
.find input::-webkit-search-cancel-button { display: none; }
.find input::placeholder { color: var(--muted); }
.find input:focus { border-color: color-mix(in srgb, var(--fg) 45%, transparent); }
.find__clear {
  position: absolute; right: 6px;
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border: 0; border-radius: 50%;
  background: none;
  color: var(--muted);
}
.find__clear svg { width: 18px; height: 18px; }
.find__none:empty { display: none; }
.find__none { margin-top: 14px; color: var(--muted); }

/* New-leader path: three numbered first moves */
.start {
  display: grid;
  gap: 8px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 760px) { .start { grid-template-columns: repeat(3, 1fr); } }
.start__link {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  height: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: none;
  text-align: left;
  text-decoration: none;
  transition: background-color .2s, border-color .2s;
}
.start__link:hover { background: var(--well); border-color: transparent; }
.start__no {
  display: grid; place-items: center;
  flex: none;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--fg); color: var(--bg);
  font-size: 14px;
}
.start__link b { display: block; }
.start__link small { display: block; font-size: 14px; color: var(--muted); }

/* ── Gather guides ─────────────────────────────────────────────────────── */

/* Phone: a list of rows led by the week number. Wider: a 3×2 grid of
   tiles. Plain numbers, not deck art — the guide is a doc, and a card
   back on it read as "this is the deck". */
.weeks { display: grid; gap: 8px; }
.week {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 44px 12px 12px;
  border-radius: var(--r-card);
  background: var(--panel);
  text-decoration: none;
  transition: transform .3s var(--ease), background-color .2s;
}
.week:hover { background: var(--well); }
.week:active { transform: scale(.985); }
.week__num {
  display: grid;
  place-content: center;
  justify-items: center;
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: 14px;
  background: var(--well);
  font-size: 26px;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.week__num small { margin-bottom: 3px; font-size: 11px; letter-spacing: 0; color: var(--muted); }
.week__txt { display: grid; gap: 2px; min-width: 0; }
.week__name { font-size: 20px; letter-spacing: -0.02em; }
.week__line {
  font-size: 14px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.week__go { position: absolute; right: 16px; top: 50%; width: 18px; height: 18px; margin-top: -9px; color: var(--muted); }

@media (min-width: 760px) {
  .weeks { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .week {
    flex-direction: column;
    align-items: stretch;
    gap: 24px;
    padding: 20px 20px 22px;
  }
  .week__num {
    display: block;
    width: auto;
    height: auto;
    background: none;
    /* the phone badge's centring would still apply to a block box */
    justify-items: normal;
    place-content: normal;
    font-size: 56px;
    letter-spacing: -0.04em;
  }
  .week__num small { display: block; margin-bottom: 8px; font-size: 13px; }
  .week__name { font-size: 24px; }
  .week__go { top: 22px; right: 20px; margin: 0; }
}

.runs {
  margin-top: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
}
.runs__h { font-size: 20px; letter-spacing: -0.02em; }
.runs__list {
  display: grid;
  gap: 14px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: run;
}
.runs__list li {
  display: grid;
  grid-template-columns: 28px 1fr;
  column-gap: 10px;
  counter-increment: run;
}
.runs__list li::before {
  content: counter(run);
  grid-row: span 2;
  display: grid; place-items: center;
  width: 28px; height: 28px;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 13px;
}
.runs__list span { font-size: 14px; color: var(--muted); }
@media (min-width: 900px) {
  .runs { padding: 24px; }
  .runs__list { grid-template-columns: repeat(5, 1fr); gap: 20px; }
  .runs__list li { grid-template-columns: 1fr; row-gap: 4px; align-content: start; }
  .runs__list li::before { grid-row: auto; margin-bottom: 6px; }
}

/* ── Printables ────────────────────────────────────────────────────────── */

.prints { display: grid; gap: 12px; }
@media (min-width: 640px) { .prints { grid-template-columns: repeat(2, 1fr); gap: 16px; } }
@media (min-width: 1040px) { .prints { grid-template-columns: repeat(3, 1fr); } }

.print {
  display: flex;
  flex-direction: column;
  border-radius: var(--r-card);
  background: var(--panel);
  overflow: hidden;
}
/* Every piece sits on the same warm well at the same height, so a 24×36
   poster and a 4×6 card read as a set instead of a ragged row. */
.print__art {
  display: grid;
  place-items: center;
  --art-h: 240px;
  height: var(--art-h);
  padding: 24px;
  background: color-mix(in srgb, var(--fg) 5%, var(--bg));
}
.print__art img {
  /* a percentage would not resolve inside the grid cell */
  max-height: calc(var(--art-h) - 48px);
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .45), 0 0 0 1px rgba(0, 0, 0, .06);
}
.print__txt { display: grid; gap: 4px; padding: 16px 16px 18px; }

/* Phone: art beside the words, so six printables are a short list
   rather than six screens of pictures. */
@media (max-width: 639px) {
  .print { flex-direction: row; }
  .print__art { --art-h: 156px; flex: none; width: 112px; height: auto; min-height: var(--art-h); padding: 14px; }
  .print__art img { max-height: calc(var(--art-h) - 28px); }
  .print__txt { align-content: start; padding: 14px 14px 16px; }
  .print__txt h3 { font-size: 18px; }
}
.print__txt h3 { font-size: 20px; letter-spacing: -0.02em; }
.print__txt p { font-size: 14px; color: var(--muted); }
.dl { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

/* ── Videos ────────────────────────────────────────────────────────────── */

/* Phone: a sideways shelf you can thumb through. Wider: an even grid —
   eight videos fill two rows of four exactly. */
.vids {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 78%;
  gap: 12px;
  margin: 0 calc(-1 * var(--pad));
  padding: 0 var(--pad) 4px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 var(--pad);
  scrollbar-width: none;
}
.vids::-webkit-scrollbar { display: none; }
@media (min-width: 640px) {
  .vids {
    grid-auto-flow: row;
    grid-template-columns: repeat(2, 1fr);
    margin: 0;
    padding: 0;
    overflow: visible;
    gap: 20px 16px;
  }
}
@media (min-width: 1040px) { .vids { grid-template-columns: repeat(4, 1fr); } }

.vid {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  scroll-snap-align: start;
}
.vid__art {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-bottom: 8px;
  border-radius: 14px;
  overflow: hidden;
  background: var(--well);
}
.vid__art img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.vid:hover .vid__art img { transform: scale(1.04); }
.vid__play {
  position: absolute;
  left: 12px; bottom: 12px;
  display: grid; place-items: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  color: #130F0C;
  box-shadow: 0 6px 18px -6px rgba(0, 0, 0, .5);
}
.vid__play svg { width: 18px; height: 18px; margin-left: 2px; }
.vid__title { font-size: 16px; line-height: 1.25; }
.vid__meta { font-size: 13px; color: var(--muted); }

.player {
  width: min(1100px, 100vw - 32px);
  max-width: none;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}
.player::backdrop { background: rgba(10, 8, 6, .86); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.player[open] { animation: rise .35s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.player__frame { aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: #000; }
.player__frame iframe { display: block; width: 100%; height: 100%; border: 0; }
.player__x {
  position: absolute;
  top: -56px; right: 0;
  display: grid; place-items: center;
  width: 44px; height: 44px;
  border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .14);
  color: #FFFFFF;
}
.player__x svg { width: 20px; height: 20px; }

/* ── Brand toolkit ─────────────────────────────────────────────────────── */

.tools { display: grid; gap: 8px; }
@media (min-width: 760px) {
  .tools { grid-template-columns: 1.4fr 1fr 1fr; gap: 16px; }
  .tool--hero { grid-row: span 2; }
}
.tool {
  position: relative;
  display: grid;
  align-content: start;
  gap: 2px;
  min-height: 76px;
  padding: 16px 48px 16px 18px;
  border-radius: var(--r-card);
  background: var(--panel);
  text-decoration: none;
  transition: background-color .2s, transform .3s var(--ease);
}
.tool:hover { background: var(--well); }
.tool:active { transform: scale(.985); }
.tool__k { font-size: 13px; color: var(--muted); }
.tool__name { font-size: 20px; letter-spacing: -0.02em; }
.tool__go { position: absolute; right: 18px; top: 18px; width: 18px; height: 18px; color: var(--muted); }

.tool--hero {
  padding: 22px 22px 20px;
  background: var(--fg);
  color: var(--bg);
}
.tool--hero:hover { background: color-mix(in srgb, var(--fg) 90%, var(--bg)); }
.tool--hero .tool__k { color: color-mix(in srgb, var(--bg) 60%, transparent); }
.tool--hero .tool__name { font-size: clamp(28px, 5vw, 40px); letter-spacing: -0.03em; }
.tool__line { margin-top: 6px; max-width: 26em; color: color-mix(in srgb, var(--bg) 70%, transparent); }
.tool__cta {
  justify-self: start;
  margin-top: 18px;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--fg);
  font-size: 14px;
}
@media (min-width: 760px) { .tool--hero { align-content: space-between; } .tool__cta { margin-top: 32px; } }

/* ── FAQ ───────────────────────────────────────────────────────────────── */

.faq { border-top: 1px solid var(--line); max-width: 820px; }
.qa { border-bottom: 1px solid var(--line); }
.qa summary {
  position: relative;
  display: block;
  padding: 18px 40px 18px 0;
  font-size: 18px;
  line-height: 1.3;
  cursor: pointer;
  list-style: none;
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary::before,
.qa summary::after {
  content: "";
  position: absolute;
  right: 6px; top: 50%;
  width: 14px; height: 1.6px;
  border-radius: 1px;
  background: currentColor;
  transition: transform .35s var(--ease);
}
.qa summary::after { transform: rotate(90deg); }
.qa[open] summary::after { transform: rotate(0); }
.qa__a { padding: 0 40px 20px 0; color: var(--muted); }
.qa__a .txtlink { color: var(--fg); }

/* ── Help + footer ─────────────────────────────────────────────────────── */

.help {
  display: grid;
  justify-items: start;
  gap: 6px;
  margin-top: 56px;
  padding: 28px 22px;
  border-radius: var(--r-card);
  background: var(--panel);
}
.help__h { font-size: clamp(24px, 5vw, 32px); letter-spacing: -0.03em; line-height: 1.1; }
.help p:not(.help__h) { color: var(--muted); }
.help .pill { margin-top: 14px; }

.foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 24px var(--pad) calc(32px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--fg); }

/* Search hides whole cards; a section with nothing left hides its head too. */
.is-out { display: none !important; }
