/* Trustworthy Academy with Rich Silver
   The page starts in a storm and ends at first light. Sections before the dawn are set in
   bone on slate; sections after it (.tone-light) are set in ink on the morning sky. */

@font-face { font-family: "Besley"; src: url("fonts/besley.woff2") format("woff2"); font-weight: 400 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Besley"; src: url("fonts/besley-italic.woff2") format("woff2"); font-weight: 400 900; font-style: italic; font-display: swap; }
@font-face { font-family: "Libre Franklin"; src: url("fonts/franklin.woff2") format("woff2"); font-weight: 300 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Libre Franklin"; src: url("fonts/franklin-italic.woff2") format("woff2"); font-weight: 300 800; font-style: italic; font-display: swap; }

:root {
  --storm: #0b1218;
  --slate: #16222b;
  --shard: #c5dae6;
  --ember: #f5a83c;
  --ember-hot: #ffc266;
  --bone: #f3eee4;
  --first-light: #f4e6cf;
  --ink: #17120c;
  --flag: #a3271c;

  --display: "Besley", "Clarendon", "Rockwell", Georgia, serif;
  --text: "Libre Franklin", "Franklin Gothic Medium", "Helvetica Neue", Arial, sans-serif;

  --gutter: clamp(1.25rem, 6vw, 6.5rem);
  --fg: var(--bone);
  --rule: rgba(243, 238, 228, 0.2);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0;
  background: var(--storm);
  color: var(--fg);
  font-family: var(--text);
  font-size: 1.125rem;
  line-height: 1.62;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; }
b { font-weight: 700; }

.skip { position: fixed; left: 1rem; top: -4rem; z-index: 40; padding: 0.6rem 1rem; background: var(--ember); color: var(--ink); border-radius: 10px; font-weight: 700; }
.skip:focus { top: 1rem; }
:focus-visible { outline: 3px solid var(--ember-hot); outline-offset: 3px; border-radius: 6px; }
body[data-tone="light"] :focus-visible, .tone-light :focus-visible { outline-color: var(--ink); }

/* ---------- the scene and the layers over it */
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; }
.scrim {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(90deg, rgba(7, 12, 17, 0.80) 0%, rgba(7, 12, 17, 0.52) 30%, rgba(7, 12, 17, 0) 60%);
  transition: opacity 0.9s ease;
}
.scrim::after {
  content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity 0.9s ease;
  background: linear-gradient(90deg, rgba(246, 232, 210, 0.78) 0%, rgba(246, 232, 210, 0.50) 32%, rgba(246, 232, 210, 0) 62%);
}
body[data-tone="light"] .scrim { background: none; }
body[data-tone="light"] .scrim::after { opacity: 1; }
body[data-open="true"] .scrim { opacity: 0; }

#labels { position: fixed; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
.tag {
  position: absolute; left: 0; top: 0; opacity: 0; white-space: nowrap; will-change: transform, opacity;
  font: italic 500 0.92rem/1 var(--text); color: var(--shard); letter-spacing: 0.01em;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.7);
}
.tag.is-stopped { color: var(--ember-hot); text-decoration: line-through; animation: tag-out 0.9s ease-out forwards; }
.tag.is-through { color: #fff; animation: tag-out 0.9s ease-out forwards; }
.tag.is-gone { animation: tag-out 0.45s ease-out forwards; }
@keyframes tag-out { to { opacity: 0; } }

main, .foot { position: relative; z-index: 3; }

/* ---------- top bar */
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 10;
  display: flex; align-items: center; gap: 1.5rem;
  padding: 0.85rem var(--gutter);
  transition: color 0.6s ease;
}
/* Once the page has moved, the bar gets a solid backing, so nothing scrolling under it
   can run through the name or the button. At the very top it is clear and the scene shows. */
.bar::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity 0.3s ease;
  background: #080e13;
  border-bottom: 1px solid rgba(243, 238, 228, 0.13);
}
body[data-scrolled="true"] .bar::before { opacity: 1; }
body[data-tone="light"] .bar { color: var(--ink); }
body[data-tone="light"] .bar::before { background: #f5e9d6; border-bottom-color: rgba(23, 18, 12, 0.15); }
.mark { font: 700 1.08rem/1.1 var(--display); text-decoration: none; letter-spacing: -0.005em; margin-right: auto; }
.mark span { font: 400 0.9rem/1 var(--text); opacity: 0.75; margin-left: 0.35em; }
.bar nav { display: flex; gap: 1.6rem; }
.bar nav a { font-weight: 500; font-size: 0.95rem; text-decoration: none; opacity: 0.85; }
.bar nav a:hover { opacity: 1; text-decoration: underline; text-underline-offset: 0.25em; }

/* ---------- buttons */
.btn {
  display: inline-block; padding: 0.95em 1.5em; border-radius: 14px;
  background: var(--ember); color: var(--ink);
  font: 700 1.05rem/1.1 var(--text); text-decoration: none;
  box-shadow: 0 0 0 1px rgba(255, 220, 160, 0.35) inset, 0 10px 40px -12px rgba(245, 168, 60, 0.75);
  transition: background 0.2s ease, transform 0.2s ease;
}
.btn:hover { background: var(--ember-hot); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-small { padding: 0.7em 1.1em; font-size: 0.95rem; border-radius: 11px; box-shadow: none; white-space: nowrap; }
.btn-ink { background: var(--ink); color: var(--first-light); box-shadow: 0 12px 34px -14px rgba(23, 18, 12, 0.7); }
.btn-ink:hover { background: #33271a; }
body[data-tone="light"] .bar .btn { background: var(--ink); color: var(--first-light); }

/* ---------- beats */
.beat {
  position: relative; min-height: 100svh;
  display: grid; align-content: center;
  padding: clamp(6rem, 15vh, 10rem) var(--gutter);
}
.col { position: relative; max-width: 33rem; }
.col-wide { max-width: 37rem; }
.col > * + * { margin-top: 1.15rem; }
.tone-light { --fg: var(--ink); --rule: rgba(23, 18, 12, 0.22); color: var(--ink); }

h1, h2, h3 { font-family: var(--display); text-wrap: balance; }
h1 { font-weight: 800; font-size: clamp(2.5rem, 1.1rem + 5.3vw, 5.4rem); line-height: 1.0; letter-spacing: -0.02em; }
h2 { font-weight: 700; font-size: clamp(1.95rem, 1.1rem + 2.9vw, 3.3rem); line-height: 1.06; letter-spacing: -0.012em; }
h3 { font-weight: 700; font-size: clamp(1.5rem, 1rem + 1.6vw, 2.2rem); line-height: 1.12; }
p { text-wrap: pretty; }

.hero .col { max-width: 46rem; }
h1 span { display: block; }
.lede { font-size: clamp(1.12rem, 0.95rem + 0.6vw, 1.3rem); line-height: 1.55; max-width: 34rem; }
.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.9rem 1.2rem; margin-top: 1.9rem !important; }
.cta-note { font-size: 0.95rem; opacity: 0.85; max-width: 16rem; line-height: 1.35; }

.scene-note {
  position: absolute; right: var(--gutter); bottom: 2.4rem; max-width: 17.5rem; margin: 0;
  text-align: right; font-size: 0.92rem; line-height: 1.4; opacity: 0.9;
}
.coarse-pointer { display: none; }
@media (hover: none), (pointer: coarse) { .fine-pointer { display: none; } .coarse-pointer { display: inline; } }
.tally-row { display: block; margin-top: 0.5rem; font-variant-numeric: tabular-nums; }
.tally-row b { font: 700 1.25rem/1 var(--display); color: var(--ember-hot); }
.tally-row i { display: inline-block; width: 1px; height: 0.9em; margin: 0 0.6em; background: var(--rule); vertical-align: -0.05em; }
[data-tally] { font-variant-numeric: tabular-nums; }

/* ---------- Rich */
.record { margin-top: 1.9rem !important; border-bottom: 1px solid var(--rule); }
.record li { padding: 0.72rem 0; border-top: 1px solid var(--rule); font-size: 1.02rem; line-height: 1.45; }
.record b { font-weight: 700; }
.aside { font-size: 0.98rem; }
.aside a { text-underline-offset: 0.25em; }
.portrait { margin-top: 1.6rem !important; max-width: 15rem; }
.portrait img { display: block; width: 100%; height: auto; border-radius: 12px; }

/* ---------- pick your work */
.trades { display: flex; flex-wrap: wrap; gap: 0.55rem; margin-top: 1.6rem !important; }
.trades button {
  appearance: none; cursor: pointer; color: inherit; background: rgba(11, 18, 24, 0.35);
  border: 1px solid rgba(243, 238, 228, 0.38); border-radius: 12px;
  padding: 0.55em 0.95em; font: 500 0.98rem/1.2 var(--text);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.trades button:hover { border-color: var(--ember); }
.trades button[aria-checked="true"] { background: var(--ember); border-color: var(--ember); color: var(--ink); font-weight: 700; }
.trade-line { font: 500 clamp(1.2rem, 1rem + 0.8vw, 1.5rem)/1.38 var(--display); min-height: 6.4em; margin-top: 1.5rem !important; }

/* ---------- eight sessions */
.sessions { align-content: start; padding-top: 22svh; }
.weeks { margin-top: 12svh; }
.weeks li {
  min-height: 66svh; max-width: 30rem;
  display: grid; align-content: center; gap: 0.7rem;
  opacity: 0.3; transition: opacity 0.45s ease;
}
.weeks li.is-active { opacity: 1; }
.week { font: 700 0.95rem/1 var(--text); color: var(--ember-hot); }

/* ---------- the dawn */
.dawn { min-height: 190svh; align-content: end; justify-items: center; padding-bottom: 20svh; }
.dawn-line { font: italic 600 clamp(1.5rem, 1rem + 2.2vw, 2.6rem)/1.2 var(--display); color: var(--ink); text-align: center; max-width: 18ch; }

/* ---------- price and guarantee */
.price-head { display: grid; gap: 0.4rem; }
.price { font-weight: 900; font-size: clamp(6.5rem, 2rem + 20vw, 15rem); line-height: 0.8; letter-spacing: -0.045em; margin-left: -0.04em; }
.price-for { font: 600 clamp(1.3rem, 1rem + 1.2vw, 1.9rem)/1.15 var(--display); letter-spacing: 0; }
.price-note { font-size: 1.12rem; max-width: 33rem; }
.price-note s { text-decoration-thickness: 2px; }
.countdown { display: block; margin-top: 0.4rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.facts { margin-top: 1.7rem !important; border-bottom: 1px solid var(--rule); }
.facts div { display: grid; grid-template-columns: 8.5rem 1fr; gap: 1rem; padding: 0.7rem 0; border-top: 1px solid var(--rule); }
.facts dt { font-weight: 700; font-size: 0.98rem; }
.facts dd { font-size: 1.02rem; line-height: 1.45; }
.todo, [data-todo] { color: var(--flag); font-weight: 600; background: rgba(163, 39, 28, 0.09); outline: 2px dashed rgba(163, 39, 28, 0.6); outline-offset: 2px; border-radius: 4px; padding: 0.05em 0.4em; font-size: 0.95rem; }

.guarantee { margin-top: 4.2rem !important; padding-top: 1.6rem; border-top: 4px solid var(--ink); }
.guarantee > * + * { margin-top: 1rem; }
.guarantee h3 { font-weight: 800; font-size: clamp(1.8rem, 1.1rem + 2.6vw, 3rem); line-height: 1.03; letter-spacing: -0.015em; }
.outs { display: grid; grid-template-columns: 1fr 1fr; gap: 1.6rem; margin-top: 1.7rem !important; }
.outs li { display: grid; gap: 0.35rem; align-content: start; padding-top: 0.8rem; border-top: 1px solid var(--rule); }
.outs b { font: 700 1.2rem/1.2 var(--display); }
.outs span { font-size: 1.02rem; line-height: 1.5; }

/* ---------- questions and footer */
.questions { min-height: 0; padding-top: 4rem; padding-bottom: 6rem; }
details { border-top: 1px solid var(--rule); }
details:last-of-type { border-bottom: 1px solid var(--rule); }
.col > details + details { margin-top: 0; }
summary { cursor: pointer; list-style: none; padding: 1rem 2rem 1rem 0; position: relative; font: 600 1.2rem/1.3 var(--display); }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: 0.2rem; top: 0.82rem; font: 400 1.5rem/1 var(--text); }
details[open] summary::after { content: "\2212"; }
details p { padding: 0 2rem 1.2rem 0; }

.foot { padding: 3rem var(--gutter) 4rem; display: grid; gap: 0.7rem; font-size: 0.98rem; }
.foot-mark { font: 700 1.3rem/1.1 var(--display); }
.foot-mark span { font: 400 1rem/1 var(--text); opacity: 0.75; }

/* ---------- without the 3D scene */
html.no-gl body { background: linear-gradient(#0b1218 0%, #16222b 55%, #2a3a44 78%, #f4e6cf 78%) no-repeat; }
html.no-gl #scene { display: none; }
html.no-gl .tone-light, html.no-gl .dawn { background: var(--first-light); }
html.no-gl .scene-note { display: none; }

/* ---------- narrow screens: the lantern sits high, the words sit below it */
@media (max-width: 820px) {
  body { font-size: 1.06rem; }
  .bar nav { display: none; }
  .mark span { display: none; }
  .scrim { background: linear-gradient(0deg, rgba(7, 12, 17, 0.78) 0%, rgba(7, 12, 17, 0.45) 38%, rgba(7, 12, 17, 0) 62%); }
  .scrim::after { background: linear-gradient(0deg, rgba(246, 232, 210, 0.82) 0%, rgba(246, 232, 210, 0.5) 40%, rgba(246, 232, 210, 0) 64%); }
  .beat { align-content: end; padding: 5.5rem var(--gutter) 3rem; }
  .hero { padding-bottom: 2rem; }
  .cta { margin-top: 1.4rem !important; }
  .cta .btn { width: 100%; text-align: center; }
  .cta-note { max-width: none; }
  .col::before {
    content: ""; position: absolute; z-index: -1; inset: -3.5rem calc(-1 * var(--gutter)) -2.5rem;
    background: rgba(7, 12, 17, 0.62);
    -webkit-mask-image: linear-gradient(transparent, #000 3.5rem, #000 calc(100% - 2.5rem), transparent);
    mask-image: linear-gradient(transparent, #000 3.5rem, #000 calc(100% - 2.5rem), transparent);
  }
  .hero .col::before { display: none; }
  .tone-light .col::before { background: rgba(246, 232, 210, 0.72); }
  .scene-note { position: static; order: -1; max-width: none; text-align: left; font-size: 0.88rem; margin-bottom: 1.1rem; }
  .tally-row { margin-top: 0.3rem; }
  .tally-row b { font-size: 1.1rem; }
  .lede .more { display: none; }
  h1 { font-size: clamp(2.2rem, 1rem + 5.6vw, 3.2rem); }
  .sessions { align-content: end; padding-top: 5.5rem; }
  .weeks { margin-top: 4rem; }
  .weeks li { min-height: 72svh; align-content: end; padding-bottom: 12svh; }
  .outs { grid-template-columns: 1fr; }
  .facts div { grid-template-columns: 6.5rem 1fr; }
  .dawn { min-height: 170svh; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
