/* The EXO — styles */

:root {
  --bg: #0a0a0a;
  --stone: #f5f5f5;
  --muted: #888;
  --font-display: "Helvetica Neue", "Inter Tight", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--stone);
  font-family: var(--font-display);
  height: 100%;
  width: 100%;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#root, .exo-app {
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  position: relative;
  background: var(--bg);
  color: var(--stone);
  transition: background 600ms ease, color 600ms ease;
}

/* ─── meta bar ─────────────────────────────────────────────────────────── */

.meta-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 28px 36px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 50;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  pointer-events: none;
}
.meta-bar > * { pointer-events: auto; }

.meta-left, .meta-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

.exo-mark {
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.28em;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.mark-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  animation: dot-pulse 2.6s ease-in-out infinite;
}
@keyframes dot-pulse {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.2); }
}

.meta-sep {
  width: 1px;
  height: 12px;
  background: currentColor;
  opacity: 0.25;
}

.meta-link {
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: inherit;
  cursor: pointer;
  text-transform: uppercase;
  transition: opacity 200ms ease;
}
.meta-link.muted { opacity: 0.55; }
.meta-link.muted:hover { opacity: 1; }

/* ─── stage / layers ─────────────────────────────────────────────────── */

.stage {
  position: absolute;
  inset: 0;
}

.layer {
  position: absolute;
  inset: 0;
  transition: opacity 700ms ease, transform 900ms cubic-bezier(.4,0,.2,1);
  will-change: opacity, transform;
}

/* ─── breathing & rotation ──────────────────────────────────────────── */

.constellation-rotate {
  animation: constellation-rotate 240s linear infinite;
}
@keyframes constellation-rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.stone-breathe {
  animation: stone-breathe 6s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}
@keyframes stone-breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

.core-breathe {
  animation: core-breathe 5s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}
@keyframes core-breathe {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.015); opacity: 0.96; }
}

/* unlock burst — a fast rotation that resolves into the perpetual one */
.unlocking-burst {
  animation: unlocking-burst 1.9s cubic-bezier(.55,.05,.25,1) both;
  transform-origin: 500px 500px;
}
@keyframes unlocking-burst {
  0%   { transform: rotate(0deg); }
  60%  { transform: rotate(440deg); }
  100% { transform: rotate(540deg); }
}

/* ─── gate / vault ──────────────────────────────────────────────────── */

.gate {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 70;
  transition: opacity 600ms ease;
  pointer-events: none;
}
.gate-inner {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* fits inside the enlarged core disc (r=230 / vb 1000) */
  width: 240px;
  text-align: center;
  gap: 4px;
}
.gate-kicker {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.34em;
  opacity: 0.55;
  white-space: nowrap;
}
.gate-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.3em;
  padding-left: 0.3em;
  margin: 4px 0 2px;
  line-height: 1;
  white-space: nowrap;
}
.gate-meta {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.3em;
  opacity: 0.55;
  margin-bottom: 18px;
  white-space: nowrap;
}
.gate-form {
  display: flex;
  align-items: stretch;
  width: 100%;
  border-bottom: 1px solid;
  border-color: color-mix(in oklab, currentColor 38%, transparent);
  padding-bottom: 4px;
  gap: 4px;
}
.gate-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  color: inherit;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  padding: 4px 0;
  outline: none;
  caret-color: currentColor;
  text-align: center;
}
.gate-input::placeholder {
  color: currentColor;
  opacity: 0.32;
  letter-spacing: 0.14em;
  text-transform: lowercase;
  text-align: center;
}
.gate-input.gate-shake {
  animation: gate-shake 480ms cubic-bezier(.36,.07,.19,.97);
}
@keyframes gate-shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-3px); }
  40%, 60% { transform: translateX(3px); }
}
.gate-submit {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 4px 6px;
  display: inline-flex;
  align-items: center;
  opacity: 0.7;
  transition: opacity 200ms ease, transform 200ms ease;
}
.gate-submit:hover { opacity: 1; transform: translateX(2px); }
.gate-arrow { font-size: 16px; line-height: 1; }

.gate-outside {
  pointer-events: auto;
  position: absolute;
  bottom: 8vh;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.gate-err {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  height: 14px;
  opacity: 0;
  transition: opacity 200ms ease;
}
.gate-err.visible { opacity: 0.8; }
.gate-foot {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.28em;
  opacity: 0.45;
}
.gate-foot a {
  color: inherit;
  border-bottom: 1px solid currentColor;
  text-decoration: none;
  padding-bottom: 1px;
}
.gate-foot a:hover { opacity: 0.7; }

/* ─── archive ───────────────────────────────────────────────────────── */

.archive {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: var(--bg);
  overflow: auto;
  transition: opacity 500ms ease;
  padding: 110px 36px 60px;
}
.archive-inner { max-width: 980px; margin: 0 auto; }
.archive-head {
  border-bottom: 1px solid currentColor;
  border-bottom-color: color-mix(in oklab, currentColor 18%, transparent);
  padding-bottom: 28px;
  margin-bottom: 8px;
}
.archive-kicker {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.32em;
  opacity: 0.5;
  margin-bottom: 18px;
}
.archive-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 72px;
  letter-spacing: -0.03em;
  line-height: 0.95;
  margin: 0 0 16px;
  text-wrap: balance;
}
.archive-sub {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  opacity: 0.6;
}
.archive-list { list-style: none; margin: 0; padding: 0; }
.archive-row {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 28px;
  align-items: center;
  padding: 28px 4px;
  border-bottom: 1px solid;
  border-bottom-color: color-mix(in oklab, currentColor 18%, transparent);
  cursor: pointer;
  transition: padding 240ms ease, background 240ms ease, color 240ms ease;
}
.archive-row:hover { padding-left: 16px; }
.arc-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 32px;
  letter-spacing: -0.02em;
  opacity: 0.85;
}
.arc-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 6px;
}
.arc-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.01em;
}
.arc-pill {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.28em;
  border: 1px solid currentColor;
  padding: 4px 8px;
  opacity: 0.75;
}
.arc-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  opacity: 0.45;
}
.arc-action {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  opacity: 0.4;
  white-space: nowrap;
  transition: opacity 240ms ease;
}
.archive-row:hover .arc-action { opacity: 0.9; }

/* ─── cover letter ──────────────────────────────────────────────────── */

.cover-letter {
  position: absolute;
  top: 100px;
  left: 36px;
  max-width: 260px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 1.4s ease 0.6s, transform 1.4s ease 0.6s;
  pointer-events: none;
}
.cover-letter.visible {
  opacity: 1;
  transform: translateY(0);
}
.cover-kicker {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.32em;
  opacity: 0.5;
  margin-bottom: 14px;
}
.cover-letter-body {
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1.45;
  letter-spacing: -0.005em;
  text-wrap: pretty;
  margin: 0 0 14px;
  font-weight: 400;
  opacity: 0.85;
}
.cover-letter-sign {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  opacity: 0.55;
}

/* ─── bottom prompt ─────────────────────────────────────────────────── */

.bottom-prompt {
  position: fixed;
  bottom: 28px;
  left: 36px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  opacity: 0.75;
  z-index: 40;
  transition: opacity 400ms ease;
}
.bp-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  animation: dot-pulse 2.6s ease-in-out infinite;
}

/* ─── story overlay ─────────────────────────────────────────────────── */

.story-portal {
  position: fixed;
  inset: 0;
  z-index: 60;
  transition: opacity 600ms ease, transform 700ms cubic-bezier(.4,0,.2,1);
}

.story-overlay {
  position: absolute;
  inset: 0;
  overflow: auto;
  padding: 88px 36px 60px;
}

.story-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 64px;
  max-width: 1480px;
  margin: 0 auto;
}

.story-aside {
  position: sticky;
  top: 0;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 40px;
  padding-top: 4px;
}

.story-crumb {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.28em;
  margin-bottom: 32px;
}

.story-kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  opacity: 0.6;
  margin: 0 0 14px;
  font-weight: 400;
}

.story-title {
  font-family: var(--font-display);
  font-size: 56px;
  line-height: 0.96;
  letter-spacing: -0.03em;
  font-weight: 700;
  margin: 0 0 22px;
  text-wrap: balance;
}

.story-byline {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  opacity: 0.7;
}

.story-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  line-height: 1.9;
  opacity: 0.55;
  border-top: 1px solid currentColor;
  padding-top: 16px;
}

.story-nav {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.story-nav button {
  background: none;
  border: 1px solid currentColor;
  color: inherit;
  padding: 8px 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 200ms ease, background 200ms ease, color 200ms ease;
}
.story-nav button:hover:not(:disabled) {
  opacity: 1;
  background: currentColor;
}
.story-nav button:hover:not(:disabled) {
  /* invert when hovered */
  color: var(--bg);
}
.story-nav button:disabled {
  opacity: 0.25;
  cursor: default;
}

.story-main {
  display: flex;
  flex-direction: column;
  gap: 48px;
  max-width: 920px;
}

.story-hero {
  width: 100%;
  aspect-ratio: 16/10;
  border: 1px solid currentColor;
  border-opacity: 0.3;
  position: relative;
  overflow: hidden;
  background: color-mix(in oklab, currentColor 4%, transparent);
}
.story-hero img,
.story-hero video,
.story-hero iframe,
.still img,
.still video,
.still iframe,
.media-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border: 0;
}
.hero-stripes {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    45deg,
    transparent 0,
    transparent 14px,
    currentColor 14px,
    currentColor 15px
  );
  opacity: 0.07;
}
.hero-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  opacity: 0.55;
  text-align: center;
}
.hero-sub {
  font-size: 10px;
  opacity: 0.6;
  letter-spacing: 0.18em;
}

.story-body p {
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1.5;
  letter-spacing: -0.005em;
  margin: 0 0 22px;
  max-width: 64ch;
  text-wrap: pretty;
}

.story-stills {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.still {
  aspect-ratio: 4/5;
  border: 1px solid currentColor;
  position: relative;
  overflow: hidden;
  background: color-mix(in oklab, currentColor 4%, transparent);
}
.still-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  opacity: 0.55;
}

/* serif system overrides — make the story title set in display serif */
.exo-app[data-system="editorial-dark"] .story-title,
:root[style*="GT Sectra"] .story-title {
  letter-spacing: -0.015em;
}

@media (max-width: 900px) {
  .story-grid { grid-template-columns: 1fr; gap: 32px; }
  .story-aside { position: static; }
  .story-title { font-size: 38px; }
}

/* ─── mobile (≤ 720px) ───────────────────────────────────────────────── */

@media (max-width: 720px) {
  /* Meta bar — collapse to a single tight row */
  .meta-bar {
    padding: 16px 18px;
    gap: 8px;
  }
  .meta-left { gap: 10px; flex-wrap: wrap; }
  .meta-right { gap: 10px; }
  .meta-edition,
  .meta-date {
    font-size: 9px;
    letter-spacing: 0.14em;
  }
  .exo-mark { font-size: 11px; letter-spacing: 0.22em; }
  .meta-sep { display: none; }
  .meta-link { font-size: 9px; letter-spacing: 0.14em; }

  /* Bottom prompt */
  .bottom-prompt {
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 9px;
    letter-spacing: 0.18em;
    text-align: center;
    padding: 0 16px;
  }
  .bottom-prompt[style*="opacity: 0"] { transform: translateX(-50%); }

  /* Cover letter — overlay full width at top, smaller type, not absolute */
  .cover-letter {
    top: auto;
    bottom: 80px;
    left: 18px;
    right: 18px;
    max-width: none;
    text-align: center;
  }
  .cover-letter-body { font-size: 14px; }

  /* Gate input fits narrow phones */
  .gate-inner { width: 220px; }
  .gate-title { font-size: 18px; letter-spacing: 0.24em; padding-left: 0.24em; }
  .gate-input { font-size: 12px; }

  /* Story overlay — single column, smaller display type, tighter padding */
  .story-overlay { padding: 72px 18px 40px; }
  .story-grid { gap: 24px; }
  .story-title { font-size: 32px; line-height: 1; }
  .story-kicker { font-size: 10px; }
  .story-body p { font-size: 17px; line-height: 1.5; }
  .story-aside-top { gap: 12px; }
  .story-meta { font-size: 10px; line-height: 1.7; }
  .story-stills { grid-template-columns: 1fr; }
  .story-nav button { padding: 8px 10px; font-size: 10px; letter-spacing: 0.14em; }

  /* Archive — looser type, single-column rows */
  .archive { padding: 96px 20px 60px; }
  .archive-title { font-size: 44px; }
  .archive-sub { font-size: 12px; }
  .archive-row {
    grid-template-columns: 48px 1fr;
    gap: 14px;
    padding: 20px 4px;
  }
  .arc-num { font-size: 22px; }
  .arc-title { font-size: 17px; }
  .arc-meta { font-size: 9px; letter-spacing: 0.14em; }
  .arc-action {
    grid-column: 1 / -1;
    text-align: right;
    margin-top: 4px;
  }
}

/* very narrow phones */
@media (max-width: 380px) {
  .meta-right .meta-link:not(:last-child) { display: none; }
}
