/* ============================================================
   WAYB — landing page
   Editorial masthead structure, brutalist type scale.
   Palette and typefaces inherited from the pitch deck.
   ============================================================ */

/* ---------- tokens ---------- */
:root {
  --ink:        #101318;
  --ink-soft:   #1B212B;
  --ink-line:   #2A2F38;
  --paper:      #F5F4EF;
  --paper-card: #FDFDFB;
  --paper-line: #E0DFD7;
  --accent:     #C8F751;
  --muted-dark: #8E97A3;
  --muted-light:#4A5568;

  --display: 'Space Grotesk', Georgia, sans-serif;
  --text:    'IBM Plex Sans', Arial, sans-serif;

  /* fluid type scale — five steps, nothing in between */
  --t-wordmark: clamp(4.5rem, 21vw, 17rem);
  --t-xl:       clamp(2rem, 5.2vw, 4.25rem);
  --t-lg:       clamp(1.5rem, 3.2vw, 2.4rem);
  --t-md:       clamp(1.125rem, 1.6vw, 1.375rem);
  --t-sm:       1rem;
  --t-xs:       0.8125rem;

  /* spacing scale — 8px base */
  --s-1: 0.5rem;
  --s-2: 1rem;
  --s-3: 1.5rem;
  --s-4: 2rem;
  --s-5: 3rem;
  --s-6: 4.5rem;
  --s-7: 7rem;
  --s-8: 10rem;

  --gutter: clamp(1.25rem, 5vw, 4rem);
  --measure: 68ch;
  --wrap: 1180px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: var(--t-md);
  line-height: 1.6;
  -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;
  text-decoration: none;
  text-underline-offset: 0.25em;
}

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

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

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: var(--gutter);
  top: var(--s-2);
  z-index: 50;
  background: var(--accent);
  color: var(--ink);
  padding: var(--s-1) var(--s-2);
  font-size: var(--t-sm);
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- masthead ---------- */
.masthead {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-3) var(--gutter);
  mix-blend-mode: difference;
  pointer-events: none;
}
.masthead__mark {
  font-family: var(--display);
  font-weight: 700;
  font-size: var(--t-sm);
  letter-spacing: 0.22em;
  color: #FFFFFF;
  pointer-events: auto;
}
.masthead__nav {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  font-size: var(--t-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #FFFFFF;
  pointer-events: auto;
}
.masthead__nav a {
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: border-color 200ms var(--ease);
}
.masthead__nav a:hover { border-bottom-color: currentColor; }
.masthead__cta { font-weight: 600; }

@media (max-width: 720px) {
  .masthead__nav a:not(.masthead__cta) { display: none; }
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  /* svh, not vh: on mobile this is the height with the URL bar showing,
     so the hero fills the screen without ever overflowing it. */
  min-height: 100svh;
  background: var(--ink);
  color: var(--paper);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  /* Top padding only has to clear the fixed masthead. Anything larger
     pushes the wordmark below the fold on short laptop viewports. */
  padding: var(--s-6) var(--gutter) var(--s-5);
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 1px;
  background: var(--ink-line);
}
.hero__inner {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
}

.wordmark {
  font-family: var(--display);
  font-weight: 700;
  font-size: var(--t-wordmark);
  line-height: 0.84;
  letter-spacing: 0.02em;
  margin-bottom: var(--s-2);
}

.hero__question {
  font-family: var(--display);
  font-weight: 400;
  font-size: var(--t-xl);
  line-height: 1.05;
  color: var(--accent);
}

.hero__scroll {
  position: absolute;
  right: var(--gutter);
  bottom: var(--s-5);
  font-size: var(--t-xs);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted-dark);
  writing-mode: vertical-rl;
}
@media (max-width: 860px) { .hero__scroll { display: none; } }

/* ---------- sections ---------- */
.section { padding-block: var(--s-8); }
.section--tight { padding-top: 0; }
.section--light { background: var(--paper); color: var(--ink); }
.section--dark  { background: var(--ink);   color: var(--paper); }
.section--join  { padding-block: var(--s-8); }

.kicker {
  font-family: var(--display);
  font-size: var(--t-xs);
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted-light);
  margin-bottom: var(--s-3);
}
.kicker--accent { color: var(--accent); }

.h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--t-xl);
  line-height: 1.08;
  letter-spacing: -0.015em;
  max-width: 20ch;
  margin-bottom: var(--s-5);
}
.h2--join { max-width: 17ch; }

.h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--t-lg);
  line-height: 1.15;
  margin-bottom: var(--s-1);
}

.body {
  max-width: var(--measure);
  color: var(--muted-light);
}
.section--dark .body { color: var(--muted-dark); }

.lede {
  max-width: 58ch;
  color: var(--muted-dark);
  margin-bottom: var(--s-5);
}
.section--light .lede { color: var(--muted-light); }

.rule {
  height: 1px;
  background: var(--ink-line);
  margin-block: var(--s-6);
}

/* ---------- split ---------- */
.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  gap: var(--s-5);
  border-top: 1px solid var(--paper-line);
  padding-top: var(--s-4);
}

.statement {
  font-family: var(--display);
  font-size: var(--t-lg);
  font-weight: 500;
  line-height: 1.25;
  max-width: 26ch;
  margin-top: var(--s-6);
  padding-left: var(--s-3);
  border-left: 3px solid var(--accent);
}
.statement--rule { max-width: 32ch; }

/* ---------- steps ---------- */
/* ---------- steps: a track, not five columns of ragged text ----------
   Explicit counts, not auto-fit: five steps must never wrap to an orphan
   row, or the sequence stops reading left to right. Subgrid puts every
   number, title and note on a shared baseline across all five, which is
   what stops a column layout looking like five unrelated blocks. */
.steps {
  display: grid;
  grid-template-columns: 1fr;
  grid-auto-rows: auto;
  counter-reset: step;
}
@media (min-width: 46rem) {
  .steps {
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: auto auto auto;
    gap: 0 var(--s-3);
  }
}

.step {
  display: grid;
  grid-template-rows: auto auto auto;
  gap: var(--s-2);
  padding: var(--s-4) 0 var(--s-4);
  border-top: 1px solid var(--ink-line);
  position: relative;
}
@media (min-width: 46rem) {
  .step {
    grid-row: span 3;
    grid-template-rows: subgrid;
    padding: var(--s-4) var(--s-3) 0 0;
  }
}

/* the node sitting on the track */
.step::before {
  content: "";
  position: absolute;
  top: -4.5px;
  left: 0;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
}

.step__num {
  font-family: var(--display);
  font-weight: 700;
  font-size: var(--t-xs);
  letter-spacing: 0.18em;
  color: var(--accent);
  align-self: start;
}
.step__label {
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--t-md);
  line-height: 1.2;
  align-self: start;
  text-wrap: balance;
}
.step__note {
  font-size: var(--t-sm);
  line-height: 1.5;
  color: var(--muted-dark);
  align-self: start;
  max-width: 24ch;
}

/* ---------- tags ---------- */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-1);
  margin-top: var(--s-3);
}
.tag {
  font-size: var(--t-sm);
  color: #C9D1DB;
  border: 1px solid var(--ink-line);
  background: #181D26;
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
}

/* ---------- evidence: dated proof of the trend ---------- */
.evidence {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  border-top: 1px solid var(--paper-line);
}
@media (min-width: 58rem) {
  .evidence {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto auto auto;
    gap: 0 var(--s-5);
  }
}
.ev {
  display: grid;
  grid-template-rows: auto auto auto;
  gap: var(--s-2);
  padding: var(--s-4) 0;
  border-bottom: 1px solid var(--paper-line);
}
@media (min-width: 58rem) {
  .ev {
    grid-row: span 3;
    grid-template-rows: subgrid;
    border-bottom: none;
    padding-bottom: var(--s-2);
  }
}

/* ---------- drift: the floating band of real posts ----------
   Two full-bleed rows that travel in opposite directions. Each track
   holds its set twice, so translating by exactly -50% loops seamlessly. */
.drift {
  margin-block: var(--s-6) var(--s-7);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  overflow: hidden;
  /* fade the ends into the page instead of cutting them off */
  -webkit-mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
}
.drift[hidden] { display: none; }

.drift__row { overflow: hidden; }

.drift__track {
  display: flex;
  gap: var(--s-3);
  width: max-content;
  animation: drift-left calc(var(--count, 3) * 11s) linear infinite;
}
.drift__track[data-dir="right"] { animation-name: drift-right; }

/* pause while the reader is looking at one */
.drift:hover .drift__track { animation-play-state: paused; }

@keyframes drift-left  { from { transform: translateX(0); }     to { transform: translateX(-50%); } }
@keyframes drift-right { from { transform: translateX(-50%); }  to { transform: translateX(0); } }

/* Height is fixed on the tile, never derived from the image: these load
   lazily, and an unloaded img is zero-high, which would collapse the row. */
/* These are ~950px-wide screenshots. Shrinking a whole post into a small
   tile makes the text unreadable, so the tile shows the TOP of the post —
   avatar, handle, opening lines — at close to native scale, and crops the
   rest away. Fixed size also keeps the row from collapsing while images
   are still arriving. */
.drift__item {
  margin: 0;
  flex: 0 0 auto;
  width: clamp(300px, 40vw, 520px);
  height: clamp(200px, 22vw, 280px);
  overflow: hidden;
  border: 1px solid var(--ink-line);
  border-radius: 14px;
  background: var(--ink);
  box-shadow: 0 18px 40px -28px rgba(16, 19, 24, 0.55);
}
.drift__item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
}

@media (prefers-reduced-motion: reduce) {
  .drift {
    -webkit-mask-image: none;
    mask-image: none;
  }
  .drift__row { overflow-x: auto; }
  .drift__track { animation: none; }
  /* the duplicate pass is decoration only — drop it when nothing moves */
  .drift__item[aria-hidden="true"] { display: none; }
}
.ev__date {
  font-family: var(--display);
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-light);
  align-self: start;
}
.ev__head {
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--t-lg);
  line-height: 1.15;
  align-self: start;
  text-wrap: balance;
}
.ev .body { align-self: start; }

/* ---------- cta ---------- */
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-top: var(--s-5);
}
.cta {
  display: inline-block;
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--t-sm);
  letter-spacing: 0.04em;
  padding: 1rem 2rem;
  background: var(--accent);
  color: var(--ink);
  border: 1px solid var(--accent);
  transition: background 200ms var(--ease), color 200ms var(--ease), transform 200ms var(--ease);
}
.cta:hover { background: transparent; color: var(--accent); }
.cta:active { transform: translateY(1px); }

.cta-note {
  font-size: var(--t-sm);
  color: var(--muted-dark);
  margin-top: var(--s-2);
}
.cta-note--error { color: #F0A090; }

.cta--ghost {
  background: transparent;
  color: var(--paper);
  border-color: var(--ink-line);
}
.cta--ghost:hover { background: var(--paper); color: var(--ink); border-color: var(--paper); }

/* ---------- footer ---------- */
.footer {
  background: var(--ink);
  color: var(--paper);
  border-top: 1px solid var(--ink-line);
  padding-block: var(--s-5);
}
.footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-4);
  align-items: baseline;
  justify-content: space-between;
}
.footer__mark {
  font-family: var(--display);
  font-weight: 700;
  font-size: var(--t-lg);
  letter-spacing: 0.16em;
}
.footer__q {
  font-family: var(--display);
  color: var(--accent);
  font-size: var(--t-md);
}
.footer__note {
  font-size: var(--t-sm);
  color: var(--muted-dark);
  max-width: 34ch;
}

/* ---------- reveal ----------
   The hidden state is gated behind .js, which an inline script in <head>
   adds. If the script is blocked or errors, nothing is ever hidden and the
   page renders fully — a broken reveal must never mean a blank page. */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 620ms var(--ease), transform 620ms var(--ease);
  will-change: opacity, transform;
}
.js [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js [data-reveal],
  [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
