:root {
  --void: #e8e8ed;
  --ink: #1d1d1f;
  --quiet: #6e6e73;
  --hair: rgba(0, 0, 0, 0.08);
  --fill: rgba(255, 255, 255, 0.55);
  --glass: rgba(255, 255, 255, 0.52);
  --blue: #0071e3;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 10px 32px rgba(0, 0, 0, 0.06);
  --shadow-soft: 0 1px 1px rgba(0, 0, 0, 0.03), 0 6px 20px rgba(0, 0, 0, 0.05);
  --serif: "Cormorant Garamond", "Iowan Old Style", Palatino, Georgia, serif;
  --sans: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--void);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  color-scheme: light;
}

body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.atmosphere {
  pointer-events: none;
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -14%, #ffffff 0%, transparent 56%),
    radial-gradient(ellipse 48% 36% at 90% 12%, rgba(0, 113, 227, 0.18), transparent 64%),
    radial-gradient(ellipse 40% 32% at 8% 88%, rgba(90, 200, 245, 0.16), transparent 58%),
    #e8e8ed;
  z-index: 0;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.mast {
  position: sticky;
  top: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 16px 28px;
  background: rgba(232, 232, 237, 0.62);
  border-bottom: 1px solid var(--hair);
  backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
}

.wordmark {
  display: flex;
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  justify-self: start;
}

.wordmark em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 28px;
  letter-spacing: -0.03em;
  line-height: 1;
}

.wordmark span {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--quiet);
}

.course {
  margin: 0;
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--quiet);
}

.live {
  letter-spacing: 0.16em;
  font-size: 10px;
  font-weight: 600;
  color: #248a3d;
  background: rgba(52, 199, 89, 0.14);
  border: 1px solid rgba(52, 199, 89, 0.22);
  padding: 3px 8px;
  border-radius: 999px;
}

.chamber {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.05);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.04);
}

.chamber[hidden] {
  display: none;
}

.chamber button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--quiet);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
}

.chamber button.is-on {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-soft);
}

.mast-end {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 10px;
}

.mast-link {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--quiet);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 7px 4px;
  cursor: pointer;
}

.mast-link:hover,
.mast-link.is-on {
  color: var(--ink);
}

.gate-page .mast {
  grid-template-columns: 1fr;
}

.gate {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: min(420px, calc(100% - 32px));
  margin: 0 auto 64px;
}

.gate h1 {
  font-size: clamp(40px, 8vw, 64px);
}

.gate-card {
  display: grid;
  gap: 14px;
  margin-top: 28px;
  padding: 22px;
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 20px;
  box-shadow: var(--shadow);
  backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
}

.gate-card label {
  display: grid;
  gap: 6px;
}

.gate-card label span {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--quiet);
}

.gate-card input {
  appearance: none;
  width: 100%;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  padding: 12px 14px;
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.gate-card input:focus {
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
}

.gate-card button {
  appearance: none;
  border: 0;
  margin-top: 4px;
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 12px 16px;
  border-radius: 999px;
  cursor: pointer;
}

.gate-error {
  margin: 0;
  color: #c41e3a;
  font-size: 14px;
}

.view {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.view[hidden] {
  display: none;
}

.stage,
.desk {
  flex: 1;
  overflow: auto;
  padding: 56px 24px 32px;
}

.overture,
.desk,
.thread {
  width: min(720px, 100%);
  margin: 0 auto;
}

.kicker {
  margin: 0 0 14px;
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--quiet);
}

h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(40px, 7vw, 72px);
  line-height: 0.98;
  letter-spacing: -0.03em;
}

.lede {
  margin: 22px 0 0;
  max-width: 38em;
  color: var(--quiet);
  font-size: 17px;
  font-weight: 400;
}

.seeds {
  list-style: none;
  margin: 40px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.seeds button {
  appearance: none;
  width: 100%;
  text-align: left;
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 16px;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  padding: 16px 18px;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
}

.seeds button:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
}

.thread {
  list-style: none;
  padding: 0 0 24px;
  display: grid;
  gap: 28px;
}

.turn {
  display: grid;
  gap: 8px;
}

.turn .who {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--quiet);
}

.turn.student .who {
  justify-self: end;
}

.turn .bubble {
  margin: 0;
  font-size: 17px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.turn .bubble.has-math {
  white-space: normal;
}

.turn .bubble strong {
  font-weight: 600;
}

.turn .bubble em {
  font-style: italic;
}

.turn .bubble code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.86em;
  background: rgba(0, 0, 0, 0.05);
  padding: 0.08em 0.35em;
  border-radius: 5px;
}

.turn .bubble .katex {
  color: inherit;
  display: inline-block;
  white-space: nowrap;
  font-style: normal;
  font-weight: 400;
  font-size: 1.1em;
  line-height: 1.2;
  letter-spacing: normal;
  text-align: left;
  vertical-align: middle;
  max-width: 100%;
}

.turn .bubble .katex-display {
  display: block;
  margin: 0.75em 0;
  overflow-x: auto;
  overflow-y: hidden;
  text-align: center;
}

.turn .bubble .katex-display > .katex {
  display: inline-block;
  max-width: none;
}

.turn.student .bubble {
  justify-self: end;
  max-width: 34em;
  color: var(--ink);
  text-align: left;
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 18px 18px 6px 18px;
  padding: 12px 16px;
  box-shadow: var(--shadow-soft);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
}

.turn.student .bubble.has-math {
  text-align: left;
  justify-self: stretch;
  max-width: 100%;
}

.turn.tutor .bubble {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.35;
  letter-spacing: -0.015em;
}

.bubble.is-typing::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 0.9em;
  margin-left: 4px;
  background: var(--ink);
  animation: caret 1s step-end infinite;
  vertical-align: -2px;
}

@keyframes caret {
  50% {
    opacity: 0;
  }
}

.cite {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 0;
  margin: 4px 0 0;
  list-style: none;
}

.cite li {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--quiet);
}

.dock {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 10px;
  align-items: flex-end;
  width: min(720px, calc(100% - 32px));
  margin: 0 auto 28px;
  padding: 10px 10px 10px 18px;
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
}

.dock textarea {
  flex: 1;
  resize: none;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  line-height: 1.45;
  max-height: 160px;
  outline: none;
  padding: 8px 0;
}

.dock textarea::placeholder {
  color: #86868b;
}

.dock button[type="submit"] {
  appearance: none;
  border: 0;
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 10px 16px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.dock button[type="submit"]:disabled {
  opacity: 0.4;
  cursor: default;
  box-shadow: none;
}

.dock .ghost {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--quiet);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 10px 8px 10px 4px;
  cursor: pointer;
  flex: 0 0 auto;
}

.dock .ghost:hover {
  color: var(--ink);
}

.desk h1 {
  font-size: clamp(36px, 6vw, 58px);
}

.about h2 {
  margin: 40px 0 12px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(26px, 4vw, 34px);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.about p,
.about li {
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
}

.about p {
  margin: 0 0 14px;
}

.about .lede {
  color: var(--quiet);
}

.about ul,
.about ol {
  margin: 0 0 18px;
  padding-left: 1.2em;
  display: grid;
  gap: 8px;
}

.about li::marker {
  color: var(--quiet);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 40px 0 48px;
  border: 0;
}

.metrics figure {
  margin: 0;
  padding: 22px 20px;
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
}

.metrics strong {
  display: block;
  font-family: var(--serif);
  font-size: 40px;
  font-weight: 400;
  letter-spacing: -0.03em;
}

.metrics figcaption {
  margin-top: 4px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--quiet);
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.split article {
  padding: 22px 22px 18px;
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 20px;
  box-shadow: var(--shadow-soft);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
}

.split h2,
.later {
  margin: 0 0 16px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--quiet);
}

.later {
  margin-top: 36px;
}

.friction,
.materials {
  list-style: none;
  margin: 0;
  padding: 0;
}

.friction li,
.materials li {
  padding: 12px 0;
  border-top: 1px solid var(--hair);
  font-size: 16px;
}

.hint {
  margin: 0 0 14px;
  color: var(--quiet);
  font-size: 13px;
}

.drop {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  margin: 0 0 12px;
  border-radius: 14px;
  border: 1px dashed rgba(0, 0, 0, 0.18);
  background: rgba(255, 255, 255, 0.45);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.drop:hover {
  border-color: rgba(0, 0, 0, 0.28);
  background: rgba(255, 255, 255, 0.7);
}

.drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.materials li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  align-items: start;
}

.materials li span {
  grid-column: 1;
}

.materials li small {
  grid-column: 1;
}

.ghost-mini {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--quiet);
  font: inherit;
  font-size: 12px;
  padding: 4px 0;
  cursor: pointer;
  grid-column: 2;
  grid-row: 1 / span 2;
}

.ghost-mini:hover {
  color: var(--ink);
}

.toggle {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  cursor: pointer;
}

.toggle input {
  position: absolute;
  opacity: 0;
}

.track {
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: #e8e8ed;
  position: relative;
  flex: 0 0 auto;
  margin-top: 2px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
}

.track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}

.toggle input:checked + .track {
  background: var(--blue);
}

.toggle input:checked + .track::after {
  left: 21px;
}

.toggle-copy {
  display: grid;
  gap: 4px;
}

.toggle-copy b {
  font-weight: 600;
  font-size: 15px;
}

.toggle-copy small {
  color: var(--quiet);
  font-size: 13px;
}

@media (max-width: 720px) {
  .mast {
    grid-template-columns: 1fr auto;
    padding: 12px 16px;
  }

  .course {
    display: none;
  }

  .split,
  .metrics {
    grid-template-columns: 1fr;
  }

  .stage,
  .desk {
    padding-top: 32px;
  }

  .turn.tutor .bubble {
    font-size: 20px;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .mast,
  .seeds button,
  .dock,
  .metrics figure,
  .split article,
  .turn.student .bubble,
  .gate-card {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: #fff;
  }
}
