/* EMBER — Table of Eight
   Charcoal black · ember light · smoke grey · bone ceramic
   Marcellus (inscriptional capitals, the ritual voice)
   Newsreader (calm optical serif, the menu voice) */

:root {
  --char: #0e0b08;
  --char-2: #171310;
  --char-3: #201a15;
  --smoke: #a39a8e;
  --smoke-dim: #6e675e;
  --bone: #ece3d3;
  --ember: #ff7a2f;
  --ember-deep: #d2400f;
  --ember-soft: rgba(255, 122, 47, 0.55);
  --serif: "Newsreader", Georgia, serif;
  --caps: "Marcellus", "Times New Roman", serif;
  --measure: 34em;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

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

body {
  background: var(--char);
  color: var(--bone);
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-weight: 340;
  font-size: clamp(1.0rem, 0.95rem + 0.3vw, 1.15rem);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--ember-deep); color: var(--bone); }

a { color: inherit; }
img { max-width: 100%; height: auto; display: block; }

:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 3px;
  border-radius: 2px;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- ember canvas + hearth glow ---------- */

#emberField {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 30;
  mix-blend-mode: screen;
}

.hearth-glow {
  position: fixed;
  left: 50%;
  bottom: -32vh;
  width: 130vw;
  height: 70vh;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at 50% 100%,
    rgba(255, 110, 30, 0.32) 0%,
    rgba(210, 64, 15, 0.14) 38%,
    rgba(14, 11, 8, 0) 72%);
  pointer-events: none;
  z-index: 1;
  opacity: var(--glow, 0.5);
  transition: opacity 0.8s ease;
}

/* ---------- ritual voice ---------- */

.ritual {
  font-family: var(--caps);
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--smoke);
}

/* ---------- top bar ---------- */

.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 1.4rem clamp(1.25rem, 4vw, 3rem);
  background: linear-gradient(to bottom, rgba(14,11,8,0.92), rgba(14,11,8,0));
}

.brand {
  font-family: var(--caps);
  font-size: 1.05rem;
  letter-spacing: 0.42em;
  text-decoration: none;
  color: var(--bone);
}

.topbar nav { display: flex; gap: clamp(1rem, 3vw, 2.2rem); }

.topbar nav a {
  font-family: var(--caps);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--smoke);
  transition: color 0.3s ease;
}
.topbar nav a:hover { color: var(--bone); }

.nav-cta {
  color: var(--ember) !important;
  border-bottom: 1px solid rgba(255,122,47,0.4);
  padding-bottom: 2px;
}
.nav-cta:hover { border-bottom-color: var(--ember); }

/* ---------- hero ---------- */

.hero {
  position: relative;
  z-index: 2;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 7rem 1.5rem 4rem;
}

.wordmark {
  font-family: var(--caps);
  font-weight: 400;
  font-size: clamp(4rem, 15vw, 11.5rem);
  letter-spacing: 0.16em;
  margin-left: 0.16em; /* optically recenter tracked caps */
  line-height: 1;
  margin-top: 1.4rem;
  background: linear-gradient(180deg, var(--bone) 30%, #d9a06a 72%, var(--ember-deep) 115%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.hero-sub {
  font-size: clamp(1.3rem, 2.6vw, 1.9rem);
  font-style: italic;
  font-weight: 300;
  color: var(--smoke);
  margin-top: 0.9rem;
}
.hero-sub em { font-style: italic; }

.hero-thesis {
  max-width: 36em;
  margin-top: 2.2rem;
  color: var(--bone);
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  font-weight: 300;
  text-wrap: balance;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem 0.75rem;
  margin-top: 2.4rem;
  font-family: var(--caps);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--smoke);
}
.hero-meta .dot { color: var(--ember); }

.down-cue {
  margin-top: 4rem;
  display: inline-block;
}
.cue-line {
  display: block;
  width: 1px;
  height: 4.5rem;
  background: linear-gradient(to bottom, transparent, var(--ember));
  animation: cueDrop 2.6s ease-in-out infinite;
}
@keyframes cueDrop {
  0%, 100% { transform: scaleY(0.6); opacity: 0.4; transform-origin: top; }
  50% { transform: scaleY(1); opacity: 1; transform-origin: top; }
}

/* ---------- section scaffolding ---------- */

section { position: relative; z-index: 2; }

.section-head {
  max-width: 44em;
  margin: 0 auto;
  text-align: center;
  padding: 0 1.5rem;
}

h2 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2rem, 4.6vw, 3.3rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin-top: 1.1rem;
  text-wrap: balance;
}

.section-lede {
  margin: 1.6rem auto 0;
  max-width: var(--measure);
  color: var(--smoke);
}

/* ---------- the evening / courses ---------- */

.evening { padding: clamp(6rem, 12vh, 10rem) 0 clamp(4rem, 8vh, 7rem); }

.courses {
  --pad: clamp(4.5rem, 10vw, 7rem);
  --rail: clamp(1.6rem, 4.5vw, 3.1rem);
  position: relative;
  max-width: 46rem;
  margin: clamp(4rem, 8vh, 6rem) auto 0;
  padding: 0 1.5rem 0 var(--pad);
}

.fuse {
  position: absolute;
  left: var(--rail);
  top: 0.5rem;
  bottom: 0.5rem;
  width: 1px;
  background: rgba(163, 154, 142, 0.18);
}
.fuse-fill {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: calc(var(--fuse, 0) * 100%);
  background: linear-gradient(to bottom, rgba(210,64,15,0.25), var(--ember));
}
.fuse-tip {
  position: absolute;
  left: 50%;
  top: calc(var(--fuse, 0) * 100%);
  width: 7px; height: 7px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--ember);
  box-shadow: 0 0 12px 3px var(--ember-soft);
}

.course {
  position: relative;
  padding: clamp(2.2rem, 5vh, 3.4rem) 0;
}
/* no dividers between courses — the fuse and its numeral stations
   are the only line system this section needs */

/* Numerals sit ON the fuse like stations; a charcoal chip parts the rail. */
.course-no {
  position: absolute;
  left: calc(var(--rail) - var(--pad));
  top: clamp(2.6rem, 5.4vh, 3.8rem);
  transform: translateX(-50%);
  font-family: var(--caps);
  font-size: 1.05rem;
  letter-spacing: 0.1em;
  color: var(--smoke);
  background: var(--char);
  padding: 0.45rem 0.15rem;
  text-align: center;
  transition: color 0.6s ease, text-shadow 0.6s ease;
}
.course-no.ignited {
  color: var(--ember);
  text-shadow: 0 0 14px rgba(255, 122, 47, 0.45);
}

.course h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  letter-spacing: 0.01em;
}

.fire-note {
  font-family: var(--caps);
  font-size: 0.7rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ember);
  margin: 0.55rem 0 0.9rem;
}

.course-body p:last-child {
  color: var(--smoke);
  max-width: var(--measure);
}

.course-photo {
  margin-top: 2rem;
}
.course-photo img {
  border-radius: 3px;
  filter: saturate(1.04);
}
.course-photo figcaption {
  margin-top: 0.8rem;
  font-size: 0.66rem;
}

/* ---------- the room ---------- */

.room {
  padding: clamp(4rem, 9vh, 8rem) 0;
}

.room-photo {
  position: relative;
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 3rem);
}
.room-photo img {
  width: 100%;
  border-radius: 3px;
}
.room-photo::after {
  content: "";
  position: absolute;
  inset: 0 clamp(1.25rem, 4vw, 3rem);
  border-radius: 3px;
  background: linear-gradient(to top, rgba(14,11,8,0.55), transparent 45%);
  pointer-events: none;
}

.room-copy {
  max-width: 44em;
  margin: clamp(-4rem, -8vh, -6rem) auto 0;
  position: relative;
  z-index: 2;
  background: linear-gradient(to bottom, rgba(14,11,8,0) , var(--char) 18%);
  padding: clamp(3rem, 7vh, 5rem) 1.5rem 0;
  text-align: center;
}
.room-copy p:not(.ritual) {
  margin-top: 1.4rem;
  color: var(--smoke);
  max-width: var(--measure);
  margin-left: auto;
  margin-right: auto;
}

/* ---------- the hands ---------- */

.hands {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 4fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
  max-width: 72rem;
  margin: 0 auto;
  padding: clamp(4rem, 9vh, 8rem) clamp(1.25rem, 4vw, 3rem);
}

.hands-copy > p:nth-of-type(2) { margin-top: 1.4rem; color: var(--smoke); max-width: var(--measure); }

.ritual-list {
  list-style: none;
  margin-top: 2.4rem;
  border-top: 1px solid rgba(163,154,142,0.15);
}
.ritual-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(163,154,142,0.15);
  font-size: 1rem;
}
.ritual-list li span {
  font-family: var(--caps);
  font-size: 0.68rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--smoke-dim);
}

.hands-photo img { border-radius: 3px; }
.hands-photo figcaption {
  margin-top: 0.8rem;
  font-size: 0.66rem;
  text-align: right;
}

/* ---------- the list ---------- */

.list {
  padding: clamp(6rem, 14vh, 11rem) 1.5rem clamp(7rem, 16vh, 12rem);
  text-align: center;
}

.list-inner { max-width: 42em; margin: 0 auto; }

.list-lede {
  margin: 1.6rem auto 0;
  max-width: var(--measure);
  color: var(--smoke);
}

.list-form {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 2.6rem;
  flex-wrap: wrap;
}

.list-form input {
  font-family: var(--serif);
  font-size: 1rem;
  color: var(--bone);
  background: rgba(236, 227, 211, 0.05);
  border: 1px solid rgba(163, 154, 142, 0.3);
  border-radius: 3px;
  padding: 0.9rem 1.1rem;
  min-width: min(20rem, 100%);
  transition: border-color 0.3s ease;
}
.list-form input::placeholder { color: var(--smoke-dim); }
.list-form input:focus { border-color: var(--ember); outline: none; }
.list-form input:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; }

.list-form button {
  font-family: var(--caps);
  font-size: 0.74rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--char);
  background: linear-gradient(160deg, #ffa15c, var(--ember) 45%, var(--ember-deep));
  border: none;
  border-radius: 3px;
  padding: 0.95rem 1.6rem;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  box-shadow: 0 0 0 rgba(255,122,47,0);
}
.list-form button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 28px rgba(255, 110, 30, 0.35);
}

.form-note {
  margin-top: 1.1rem;
  font-size: 0.85rem;
  color: var(--smoke-dim);
  font-style: italic;
}
.form-note.confirmed { color: var(--ember); font-style: normal; }

/* ---------- footer ---------- */

.site-foot {
  position: relative;
  z-index: 2;
  border-top: 1px solid rgba(163,154,142,0.14);
  padding: clamp(3rem, 6vh, 4.5rem) clamp(1.25rem, 4vw, 3rem) 2.5rem;
  color: var(--smoke);
  font-size: 0.92rem;
}

.foot-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 2rem;
  max-width: 72rem;
  margin: 0 auto;
}

.brand-foot {
  font-family: var(--caps);
  letter-spacing: 0.42em;
  color: var(--bone);
  margin-bottom: 0.4rem;
}

.site-foot a {
  color: var(--smoke);
  text-decoration-color: rgba(163,154,142,0.4);
  text-underline-offset: 3px;
  transition: color 0.3s ease;
}
.site-foot a:hover { color: var(--bone); }

.foot-fine {
  max-width: 72rem;
  margin: 2.8rem auto 0;
  font-style: italic;
  font-size: 0.84rem;
  color: var(--smoke-dim);
}

/* ---------- reveal on scroll ---------- */

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.lit {
  opacity: 1;
  transform: none;
}

/* stagger inside hero */
.hero .reveal:nth-child(1) { transition-delay: 0.1s; }
.hero .reveal:nth-child(2) { transition-delay: 0.25s; }
.hero .reveal:nth-child(3) { transition-delay: 0.45s; }
.hero .reveal:nth-child(4) { transition-delay: 0.6s; }
.hero .reveal:nth-child(5) { transition-delay: 0.75s; }
.hero .reveal:nth-child(6) { transition-delay: 0.95s; }

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .cue-line { animation: none; opacity: 0.8; }
  .hearth-glow { transition: none; }
  .list-form button { transition: none; }
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .hands {
    grid-template-columns: 1fr;
  }
  .hands-photo { max-width: 30rem; }
  .foot-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 560px) {
  .topbar { padding: 1.1rem 1.25rem; }
  .topbar nav a:not(.nav-cta) { display: none; }
  .courses { --pad: 3.4rem; --rail: 1.15rem; }
  .course-no { font-size: 0.82rem; }
  .list-form { flex-direction: column; align-items: stretch; }
  .list-form input { min-width: 0; }
  .foot-grid { grid-template-columns: 1fr; gap: 1.4rem; }
}
