/* ==========================================================================
   Creators’ Enclave — three screens
   Near black, one live surface, light type. Nothing else competes.
   ========================================================================== */

/* Design tokens */
:root {
  --bg: #07080B;
  --bg-lift: #0C0D12;
  --fg: #F2F3F5;
  --fg-soft: rgba(242, 243, 245, 0.62);
  --fg-faint: rgba(242, 243, 245, 0.34);
  --line: rgba(242, 243, 245, 0.14);
  --line-strong: rgba(242, 243, 245, 0.32);
  --danger: #F08C7A;
  --success: #9AD3A8;

  --font: "Geist", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;

  --gutter: 20px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 768px) {
  :root { --gutter: 40px; }
}

@media (min-width: 1280px) {
  :root { --gutter: 64px; }
}

/* Base */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, p, fieldset, figure {
  margin: 0;
}

fieldset {
  padding: 0;
  border: 0;
  min-width: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 1px solid var(--fg);
  outline-offset: 4px;
}

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

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 8px 12px;
  background: var(--fg);
  color: var(--bg);
  transform: translateY(-200%);
  transition: transform 500ms var(--ease);
}

.skip-link:focus {
  transform: translateY(0);
}

/* Each screen fills the viewport */
.screen {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  padding: var(--gutter);
}

/* --------------------------------------------------------------------------
   Screen one
   -------------------------------------------------------------------------- */

.hero {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

/* The live surface is fixed behind the whole page */
.silk {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  transition: opacity 2400ms var(--ease);
}

.silk.is-ready {
  opacity: 1;
}

/* Fallback light for browsers without WebGL */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(ellipse 70% 60% at 70% 30%, rgba(242, 243, 245, 0.08), transparent 70%);
  pointer-events: none;
}

.bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Mark: a ring that draws itself in, a core, and a satellite on a slow orbit
   -------------------------------------------------------------------------- */

.mark {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  overflow: visible;
}

.mark-ring {
  fill: none;
  stroke: var(--fg);
  stroke-width: 1.1;
  stroke-linecap: round;
  stroke-dasharray: 69.2;
  stroke-dashoffset: 69.2;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  transition: stroke-dashoffset 1600ms var(--ease) 200ms;
}

.mark-core {
  fill: var(--fg);
  transform: scale(0);
  transform-origin: 50% 50%;
  transition: transform 900ms var(--ease) 1100ms;
}

.mark-satellite {
  fill: var(--fg);
  opacity: 0;
  transform-origin: 50% 50%;
  transition: opacity 800ms var(--ease) 1500ms;
  animation: orbit 14s linear infinite;
}

.is-loaded .mark-ring {
  stroke-dashoffset: 0;
}

.is-loaded .mark-core {
  transform: scale(1);
}

.is-loaded .mark-satellite {
  opacity: 1;
}

/* The core breathes once the mark has settled */
.is-loaded .mark-core {
  animation: breathe 5s var(--ease) 2200ms infinite;
}

@keyframes orbit {
  to { transform: rotate(360deg); }
}

@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.18); }
}

/* Hovering the wordmark speeds the orbit for a moment */
.wordmark:hover .mark-satellite {
  animation-duration: 4s;
}

.bar-note,
.label,
.tags,
.colophon,
.roles {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-soft);
}

.bar-note {
  white-space: nowrap;
}

.bar-note span {
  color: var(--fg-faint);
}

/* The second half of the note only fits from tablet widths up */
.bar-note-more {
  display: none;
}

@media (min-width: 600px) {
  .bar-note-more {
    display: inline;
  }
}

.hero-body {
  max-width: 1120px;
  padding-bottom: 8vh;
}

/* The headline, light and large, rising line by line once fonts are ready */
.headline {
  font-weight: 300;
  font-size: clamp(38px, 7vw, 104px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.headline-line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.06em;
  margin-bottom: -0.06em;
}

.headline-line > span {
  display: block;
  transform: translateY(105%);
  transition: transform 1300ms var(--ease);
}

.headline-line:nth-child(2) > span {
  transition-delay: 100ms;
}

.is-loaded .headline-line > span {
  transform: translateY(0);
}

.headline-sm {
  font-size: clamp(34px, 5vw, 72px);
}

.sub {
  max-width: 56em;
  margin-top: 28px;
  font-size: 17px;
  line-height: 1.5;
  color: var(--fg-soft);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 1200ms var(--ease) 500ms, transform 1200ms var(--ease) 500ms;
}

.is-loaded .sub {
  opacity: 1;
  transform: translateY(0);
}

@media (min-width: 768px) {
  .sub {
    font-size: 19px;
  }
}

/* --------------------------------------------------------------------------
   Invite
   -------------------------------------------------------------------------- */

.invite {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  margin-top: 40px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 1200ms var(--ease) 700ms, transform 1200ms var(--ease) 700ms;
}

.is-loaded .invite {
  opacity: 1;
  transform: translateY(0);
}

/* Outlined pill that fills on hover and opens the visitor's mail app */
.invite-button {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 500ms var(--ease), color 500ms var(--ease), border-color 500ms var(--ease), transform 500ms var(--ease);
}

.invite-button::after {
  content: "→";
  display: inline-block;
  transition: transform 600ms var(--ease);
}

.invite-button:hover {
  background: var(--fg);
  border-color: var(--fg);
  color: var(--bg);
}

.invite-button:hover::after {
  transform: translateX(4px);
}

.invite-button:active {
  transform: scale(0.98);
}

/* Creator or brand, two words with a hairline underline on the chosen one */
.roles {
  display: flex;
  gap: 24px;
}

.role input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.role span {
  display: inline-block;
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
  color: var(--fg-faint);
  cursor: pointer;
  transition: color 500ms var(--ease), border-color 500ms var(--ease);
}

.role span:hover {
  color: var(--fg-soft);
}

.role input:checked + span {
  color: var(--fg);
  border-color: var(--fg);
}

.role input:focus-visible + span {
  outline: 1px solid var(--fg);
  outline-offset: 4px;
}

/* A single thin line that breathes at the bottom of the first screen */
.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: var(--gutter);
  width: 1px;
  height: 56px;
  overflow: hidden;
  transform: translateX(-50%);
  display: none;
}

@media (min-width: 768px) {
  .scroll-cue {
    display: block;
  }
}

.scroll-cue span {
  position: absolute;
  inset: 0;
  background: var(--fg);
  transform-origin: top;
  animation: cue 2600ms var(--ease) infinite;
}

@keyframes cue {
  0% { transform: scaleY(0); transform-origin: top; }
  45% { transform: scaleY(1); transform-origin: top; }
  55% { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* --------------------------------------------------------------------------
   Screen two
   -------------------------------------------------------------------------- */

.books {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9vh;
  text-align: center;
}

.statement {
  max-width: 14em;
  font-weight: 300;
  font-size: clamp(30px, 4.6vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.sides {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 48px;
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .sides {
    grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1fr);
    gap: 0;
  }

  .divider {
    height: 100%;
    background: linear-gradient(to bottom, transparent, var(--line-strong) 30%, var(--line-strong) 70%, transparent);
  }

  .side {
    padding: 0 8%;
  }
}

.side {
  text-align: center;
  transition: opacity 800ms var(--ease);
}

/* Hovering one side quietens the other */
.sides:hover .side {
  opacity: 0.4;
}

.sides .side:hover {
  opacity: 1;
}

.label {
  margin-bottom: 28px;
}

/* The two figures are the only big objects on the screen */
.figure {
  font-weight: 300;
  font-size: clamp(64px, 9vw, 132px);
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.caption {
  max-width: 34em;
  margin: 24px auto 0;
  color: var(--fg-soft);
  font-size: 15px;
}

.tags {
  max-width: 32em;
  margin: 20px auto 0;
  color: var(--fg-faint);
  text-wrap: balance;
}

.tags span {
  margin: 0 6px;
}

/* --------------------------------------------------------------------------
   Screen three
   -------------------------------------------------------------------------- */

.closing {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  min-height: 86svh;
  text-align: center;
}

.closing-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  width: 100%;
  padding: 12vh 0 10vh;
}

.closing .headline-line > span {
  transform: none;
}

.closing .invite {
  align-items: center;
  margin-top: 36px;
  opacity: 1;
  transform: none;
}

.colophon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  text-transform: none;
  letter-spacing: 0;
  color: var(--fg-faint);
}

.colophon-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 28px;
}

.colophon-links a {
  transition: color 400ms var(--ease);
}

.colophon-links a:hover {
  color: var(--fg);
}

/* --------------------------------------------------------------------------
   Scroll reveal for screens two and three
   -------------------------------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1200ms var(--ease), transform 1200ms var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .headline-line > span,
  .sub,
  .invite,
  .reveal {
    opacity: 1;
    transform: none;
  }

  .mark-ring {
    stroke-dashoffset: 0;
  }

  .mark-core {
    transform: scale(1);
  }

  .mark-satellite {
    opacity: 1;
  }
}

/* --------------------------------------------------------------------------
   Legal and 404 pages
   -------------------------------------------------------------------------- */

.page {
  max-width: 680px;
  margin: 0 auto;
  padding: 12vh var(--gutter) 16vh;
}

.page .bar {
  max-width: none;
  margin-bottom: 12vh;
}

.page h1 {
  margin-bottom: 8px;
}

.page h2 {
  margin: 40px 0 8px;
  font-weight: 400;
  font-size: 18px;
}

.page p,
.page li {
  color: var(--fg-soft);
  margin-bottom: 14px;
}

.page ul {
  margin: 0 0 14px;
  padding-left: 20px;
}

.page a {
  border-bottom: 1px solid var(--line-strong);
}

/* The wordmark and the bar link carry no underline */
.page .bar a {
  border-bottom: 0;
}

.page-updated {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-faint);
  margin-bottom: 40px;
}

.page-404 {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.page-404 .sub {
  opacity: 1;
  transform: none;
}

.page-404 .text-link {
  display: inline-block;
  margin-top: 32px;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--fg);
}
