/* Masters Hub — public site. No framework, no dependencies. */

@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('plus-jakarta-sans-variable.woff2') format('woff2-variations');
  font-weight: 200 800; font-style: normal; font-display: swap;
}

:root {
  /* Ink, not black: a slight blue bias so the teal sits in the same family. */
  --ink-900: #070d14;
  --ink-800: #0b1420;
  --ink-700: #111e2c;
  --ink-600: #1a2c3d;
  --line:    #22384c;

  --paper:   #f2f7f8;
  --muted:   #9db2c3;
  --subtle:  #6d8598;

  --teal-400: #2dd4bf;
  --teal-500: #14b8a6;
  --teal-600: #0d9488;
  --teal-soft: rgba(45, 212, 191, 0.12);

  /* Chaos is warm; order is cool. The whole page runs on that one contrast. */
  --amber:   #f5a524;
  --coral:   #fb7185;
  --violet:  #a78bfa;

  --r-sm: 8px; --r-md: 14px; --r-lg: 20px; --r-xl: 28px;
  --shadow: 0 24px 60px rgb(0 0 0 / 0.45), 0 2px 8px rgb(0 0 0 / 0.3);

  --step--1: clamp(0.82rem, 0.79rem + 0.15vw, 0.9rem);
  --step-0:  clamp(1rem, 0.96rem + 0.2vw, 1.09rem);
  --step-1:  clamp(1.2rem, 1.1rem + 0.5vw, 1.45rem);
  --step-2:  clamp(1.5rem, 1.3rem + 1vw, 2.1rem);
  --step-3:  clamp(2rem, 1.6rem + 2vw, 3.2rem);
  --step-4:  clamp(2.6rem, 1.8rem + 4vw, 5.2rem);

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

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: var(--step-0);
  line-height: 1.6;
  color: var(--paper);
  background: var(--ink-900);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3 { line-height: 1.08; letter-spacing: -0.03em; margin: 0; text-wrap: balance; font-weight: 700; }
p { margin: 0; }
a { color: inherit; }
img, svg { max-width: 100%; }

.wrap { width: min(1180px, 100% - 2.5rem); margin-inline: auto; }
.eyebrow {
  font-size: var(--step--1); font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--teal-400);
}
.lede { color: var(--muted); font-size: var(--step-1); max-width: 46ch; }
.quip { color: var(--subtle); font-size: var(--step--1); font-style: italic; }

/* ── buttons ─────────────────────────────────────────────────────────── */
.btn {
  --bg: var(--teal-500); --fg: #05231f;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.85rem 1.5rem; border-radius: 999px; border: 1px solid transparent;
  background: var(--bg); color: var(--fg);
  font: inherit; font-weight: 700; font-size: var(--step-0);
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), background 0.18s;
  box-shadow: 0 8px 24px rgb(20 184 166 / 0.28);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgb(20 184 166 / 0.36); }
.btn:active { transform: translateY(0); }
.btn--ghost {
  --bg: transparent; --fg: var(--paper);
  border-color: var(--line); box-shadow: none;
}
.btn--ghost:hover { background: var(--ink-700); border-color: var(--teal-600); box-shadow: none; }
.btn--sm { padding: 0.55rem 1.05rem; font-size: var(--step--1); }

:where(a, button, [tabindex]):focus-visible {
  outline: 3px solid var(--teal-400); outline-offset: 3px; border-radius: 6px;
}

/* ── skip link ───────────────────────────────────────────────────────── */
.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  transition: top 0.2s var(--ease);
}
.skip:focus { top: 1rem; }

/* ── nav ─────────────────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 50;
  padding: 1rem 0;
  transition: background 0.3s var(--ease), backdrop-filter 0.3s, border-color 0.3s, padding 0.3s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav[data-scrolled] {
  background: rgb(7 13 20 / 0.82); backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--line); padding: 0.6rem 0;
}
.nav__inner { display: flex; align-items: center; gap: 1.5rem; }
.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; font-weight: 800; letter-spacing: -0.02em; }
.brand__mark {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  background: linear-gradient(140deg, var(--teal-400), var(--teal-600));
  display: grid; place-items: center; color: #05231f;
  box-shadow: 0 4px 14px rgb(20 184 166 / 0.35);
}
.nav__links { display: flex; gap: 1.6rem; margin-left: auto; }
.nav__links a {
  text-decoration: none; color: var(--muted); font-size: var(--step--1); font-weight: 600;
  position: relative; padding: 0.2rem 0;
}
.nav__links a::after {
  content: ''; position: absolute; left: 0; right: 100%; bottom: -2px; height: 2px;
  background: var(--teal-400); transition: right 0.25s var(--ease);
}
.nav__links a:hover { color: var(--paper); }
.nav__links a:hover::after { right: 0; }
.nav__cta { display: flex; gap: 0.6rem; align-items: center; }
@media (max-width: 860px) {
  .nav__links { display: none; }
  .nav__cta { margin-left: auto; }
}
@media (max-width: 420px) { .nav__cta .btn--ghost { display: none; } }

/* ── hero ────────────────────────────────────────────────────────────── */
.hero { position: relative; padding: clamp(3rem, 8vw, 7rem) 0 clamp(3rem, 7vw, 6rem); }
.hero::before {
  /* Inset to 0 horizontally: bleeding -20% past each edge widened the
     document by 256px at 1280 and gave the whole page a horizontal
     scrollbar, for a glow nobody can see the edge of anyway. */
  content: ''; position: absolute; inset: -30% 0 auto 0; height: 90vh; z-index: -1;
  background:
    radial-gradient(60% 50% at 15% 20%, rgb(20 184 166 / 0.18), transparent 70%),
    radial-gradient(55% 45% at 85% 10%, rgb(167 139 250 / 0.13), transparent 70%);
  filter: blur(10px);
}
.hero__grid { display: grid; gap: clamp(2.5rem, 5vw, 4rem); grid-template-columns: 1fr; align-items: center; }
@media (min-width: 1000px) { .hero__grid { grid-template-columns: 1.05fr 1fr; } }
.hero h1 { font-size: var(--step-4); font-weight: 800; margin: 1rem 0 1.2rem; }
.hero h1 em { font-style: normal; color: var(--teal-400); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 0.8rem; margin: 2rem 0 1rem; }
.hero__note {
  display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
  font-size: var(--step--1); color: var(--muted);
}
.pill {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.3rem 0.75rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--ink-800);
  font-size: var(--step--1); font-weight: 600; color: var(--muted);
}
.pill__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--teal-400); flex: none; }

/* ── the app mock, shared by hero and feature switcher ───────────────── */
.mock {
  border-radius: var(--r-xl); border: 1px solid var(--line);
  background: linear-gradient(170deg, var(--ink-700), var(--ink-800) 60%);
  box-shadow: var(--shadow); overflow: hidden;
}
.mock__bar {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.7rem 1rem; border-bottom: 1px solid var(--line); background: rgb(7 13 20 / 0.5);
}
.mock__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ink-600); flex: none; }
.mock__title { margin-left: 0.5rem; font-size: var(--step--1); color: var(--subtle); font-weight: 600; }
.mock__body { padding: 1.1rem; display: grid; gap: 0.8rem; }

.card {
  border-radius: var(--r-md); border: 1px solid var(--line);
  background: var(--ink-800); padding: 0.9rem 1rem;
}
.card--accent { border-left: 3px solid var(--teal-400); }
.card__label { font-size: var(--step--1); color: var(--subtle); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.card__title { font-weight: 700; margin-top: 0.2rem; }
.card__meta { font-size: var(--step--1); color: var(--muted); margin-top: 0.1rem; }
.row { display: flex; align-items: center; gap: 0.7rem; }
.row + .row { margin-top: 0.6rem; }
.dot { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.tnum { font-variant-numeric: tabular-nums; }

.bar { height: 6px; border-radius: 999px; background: var(--ink-600); overflow: hidden; margin-top: 0.5rem; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--teal-600), var(--teal-400)); width: 0; }

/* ── generic section ─────────────────────────────────────────────────── */
.section { padding: clamp(3.5rem, 9vw, 7rem) 0; position: relative; }
.section__head { max-width: 60ch; margin-bottom: clamp(2rem, 4vw, 3.2rem); }
.section__head h2 { font-size: var(--step-3); margin: 0.7rem 0 0.9rem; }
.rule { height: 1px; background: linear-gradient(90deg, var(--line), transparent); border: 0; margin: 0; }

/* ── chaos → order ───────────────────────────────────────────────────── */
.chaos { display: grid; gap: 2rem; grid-template-columns: 1fr; align-items: center; }
@media (min-width: 960px) { .chaos { grid-template-columns: 1fr auto 1fr; gap: 2.5rem; } }
.scatter { position: relative; min-height: 340px; }
/*
 * Below the breakpoint the pile stops being absolutely positioned and simply
 * wraps. Scattering by pixel maths cannot be made safe at 375: the widest
 * scrap is 188px, and any placement plus its width has to fit a 335px column,
 * which leaves almost nothing to scatter with. Wrapping keeps the visual idea
 * — tilted scraps, no order — and cannot overflow.
 */
@media (max-width: 700px) {
  .scatter {
    display: flex; flex-wrap: wrap; gap: 0.5rem;
    min-height: 0; margin-bottom: 0.5rem;
  }
  .scrap {
    position: static !important; left: auto !important; top: auto !important;
    white-space: normal; max-width: 100%;
  }
}
.scrap {
  position: absolute; padding: 0.65rem 0.9rem; border-radius: 10px;
  background: var(--ink-700); border: 1px solid var(--line);
  font-size: var(--step--1); font-weight: 600; color: var(--muted);
  box-shadow: 0 10px 24px rgb(0 0 0 / 0.35); white-space: nowrap;
  max-width: 100%;
}
.scrap[data-tone="amber"] { border-color: rgb(245 165 36 / 0.5); color: #ffd79a; }
.scrap[data-tone="coral"] { border-color: rgb(251 113 133 / 0.5); color: #ffc2cb; }
.scrap[data-tone="violet"] { border-color: rgb(167 139 250 / 0.5); color: #d8ccff; }
.arrow { display: grid; place-items: center; color: var(--teal-400); }
.arrow svg { width: 46px; height: 46px; }
@media (max-width: 959px) { .arrow { transform: rotate(90deg); margin: -0.5rem 0; } }

/* ── feature switcher ────────────────────────────────────────────────── */
.switch { display: grid; gap: 1.6rem; grid-template-columns: 1fr; }
/* minmax(0, …) so the scrolling tab strip may actually shrink; a bare 1fr
   has a min-content floor and the row pushed the page sideways at 375. */
@media (min-width: 900px) { .switch { grid-template-columns: 260px minmax(0, 1fr); gap: 2.5rem; } }
.switch > * { min-width: 0; }
.switch__list { display: flex; flex-direction: column; gap: 0.4rem; }
@media (max-width: 899px) {
  .switch__list {
    flex-direction: row; overflow-x: auto; padding-bottom: 0.5rem;
    scrollbar-width: thin; min-width: 0; max-width: 100%;
  }
}
.switch__btn {
  display: flex; align-items: center; gap: 0.7rem; text-align: left;
  padding: 0.8rem 1rem; border-radius: var(--r-md);
  border: 1px solid transparent; background: transparent; color: var(--muted);
  font: inherit; font-weight: 700; cursor: pointer; white-space: nowrap;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s var(--ease);
}
.switch__btn:hover { color: var(--paper); background: var(--ink-800); }
.switch__btn[aria-selected="true"] {
  background: var(--teal-soft); color: var(--teal-400); border-color: rgb(45 212 191 / 0.35);
}
.switch__btn small { display: block; font-weight: 500; font-size: var(--step--1); color: var(--subtle); }
@media (max-width: 899px) { .switch__btn small { display: none; } }
.switch__panel { min-height: 320px; }

/* ── cohort demo ─────────────────────────────────────────────────────── */
.cohort { display: grid; gap: 2rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 940px) { .cohort { grid-template-columns: 0.9fr 1.1fr; gap: 3rem; } }
.codebox {
  border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--ink-800);
  padding: 1.4rem; box-shadow: var(--shadow);
}
.codebox__field {
  display: flex; align-items: center; gap: 0.7rem;
  border: 1px dashed var(--line); border-radius: var(--r-md);
  padding: 0.9rem 1rem; background: var(--ink-900);
  font-size: var(--step-2); font-weight: 800; letter-spacing: 0.18em;
  transition: border-color 0.3s, background 0.3s;
}
.codebox__field[data-state="ok"] { border-style: solid; border-color: var(--teal-500); background: var(--teal-soft); }
.caret { display: inline-block; width: 2px; height: 1em; background: var(--teal-400); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.codebox__status { margin-top: 0.8rem; font-size: var(--step--1); color: var(--muted); min-height: 1.5em; }
.split { display: grid; gap: 0.8rem; grid-template-columns: 1fr 1fr; margin-top: 1.2rem; }
@media (max-width: 520px) { .split { grid-template-columns: 1fr; } }
.split h4 { margin: 0 0 0.4rem; font-size: var(--step--1); letter-spacing: 0.08em; text-transform: uppercase; }
.split ul { margin: 0; padding-left: 1.1rem; color: var(--muted); font-size: var(--step--1); line-height: 1.9; }
.split__shared h4 { color: var(--teal-400); }
.split__private h4 { color: var(--violet); }

/* ── closing ─────────────────────────────────────────────────────────── */
.closing { text-align: center; padding: clamp(4rem, 10vw, 8rem) 0; }
.closing h2 { font-size: var(--step-3); margin-bottom: 1rem; }
.closing .hero__cta { justify-content: center; }
.leader {
  margin-top: 3.5rem; padding-top: 2rem; border-top: 1px solid var(--line);
  color: var(--subtle); font-size: var(--step--1);
}
.leader button {
  background: none; border: 0; color: var(--teal-400); font: inherit; font-weight: 700;
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 0;
}
.leader__note {
  max-width: 46ch; margin: 0.9rem auto 0; padding: 0.9rem 1.1rem;
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--ink-800);
  color: var(--muted);
}
.leader__note[hidden] { display: none; }

.foot { padding: 2rem 0 3rem; color: var(--subtle); font-size: var(--step--1); border-top: 1px solid var(--line); }
.foot__inner { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; }

/* ── motion ──────────────────────────────────────────────────────────── */
/*
 * Content is visible by default. Hiding it in CSS and revealing it with
 * JavaScript means any failure — a script error, an observer that never
 * fires, a tab that is not painting, a crawler — leaves a blank page. So the
 * hiding is opt-in: site.js sets .js-anim on <html> only once it is certain
 * it can also do the revealing, and a watchdog clears it regardless.
 */
.js-anim [data-anim]:not(.is-in) { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .js-anim [data-anim] { opacity: 1 !important; transform: none !important; }
  .caret { animation: none; }
}
