/* ─────────────────────────────────────────────────────────────
   Clew — under construction
   One sheet of paper. One ball of thread. Nothing else.
   ───────────────────────────────────────────────────────────── */

:root {
  /* paper */
  --paper:      #fcfcfa;
  --paper-ink:  #14151a;
  --ink-soft:   #5c5f6a;
  --ink-faint:  #9a9da6;
  --rule:       #e6e5e0;

  /* type */
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans:  "Inter", -apple-system, "Segoe UI", "Noto Sans SC", sans-serif;
  --mono:  "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;

  /* rhythm */
  --edge: clamp(20px, 6vw, 88px);
  --ease: cubic-bezier(.22, .61, .24, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:     #0d0e11;
    --paper-ink: #edeae3;
    --ink-soft:  #9d9fa8;
    --ink-faint: #5f626b;
    --rule:      #23252b;
  }
  html { color-scheme: dark; }
}

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

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--paper-ink);
  font-family: var(--sans);
  line-height: 1.6;
  overflow-x: hidden;
}

a { color: inherit; }

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 10px 16px;
  background: var(--paper-ink);
  color: var(--paper);
  z-index: 10;
}
.skip:focus { left: var(--edge); top: 12px; }

/* ── header ──────────────────────────────────────────────────── */

.top {
  position: relative;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: clamp(20px, 3.2vw, 34px) var(--edge) 0;
}

.brand {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .14em;
  color: var(--ink-soft);
}
.brand .dot { color: var(--ink-faint); }

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.pulse {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ink-soft);
  animation: breathe 3.6s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { opacity: .35; }
  50%      { opacity: 1; }
}

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

main {
  flex: 1;
  display: flex;
  align-items: center;
  padding: clamp(16px, 3vh, 40px) var(--edge) clamp(16px, 3vh, 32px);
}

.stage {
  position: relative;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
}

.copy { position: relative; z-index: 2; }

/* the ball sits right of the type — behind it, never in the way */
.thread {
  position: absolute;
  z-index: 1;
  top: 50%;
  right: -3%;
  width: min(56%, 600px);
  height: auto;
  aspect-ratio: 1000 / 640;
  transform: translateY(-54%);
  color: var(--paper-ink);
  pointer-events: none;
  overflow: visible;
}

.thread .front { stroke-opacity: .88; stroke-width: 1.2; }
.thread .back  { stroke-opacity: .24; stroke-width: 1; }
.thread .tail  { stroke-opacity: .88; stroke-width: 1.2; }

/* a breath of rotation once wound: turned in the hand, not spun */
@media (prefers-reduced-motion: no-preference) {
  body.ready .wound {
    transform-origin: 500px 320px;
    animation: turn 120s ease-in-out 3s infinite alternate;
  }
}
@keyframes turn {
  from { transform: rotate(-1.6deg); }
  to   { transform: rotate(1.6deg); }
}

/* ── type ────────────────────────────────────────────────────── */

.eyebrow {
  margin: 0 0 clamp(14px, 2.4vw, 22px);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.headline {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(64px, 12.5vw, 184px);
  line-height: .88;
  letter-spacing: -.028em;
  text-wrap: balance;
}
.headline em {
  font-style: italic;
  letter-spacing: -.012em;
  color: var(--ink-soft);
}

.lede {
  margin: clamp(24px, 3.6vw, 36px) 0 0;
  max-width: 34ch;
  font-size: clamp(15px, 1.5vw, 17px);
  line-height: 1.65;
  color: var(--ink-soft);
  text-wrap: pretty;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(22px, 5vw, 64px);
  margin: clamp(30px, 5vw, 54px) 0 0;
  padding-top: clamp(16px, 2.2vw, 22px);
  border-top: 1px solid var(--rule);
  max-width: 620px;
}
.meta div { display: flex; flex-direction: column; gap: 6px; margin: 0; }

.meta dt {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.meta dd {
  margin: 0;
  font-size: 14px;
  letter-spacing: .01em;
}

.meta a {
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 100% 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  padding-bottom: 1px;
  transition: color 180ms var(--ease);
}
.meta a:hover { color: var(--ink-soft); }

/* entrance — a small stagger, once */
.eyebrow, .headline, .lede, .meta {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 800ms var(--ease),
    transform 800ms var(--ease);
}
body.ready .eyebrow  { opacity: 1; transform: none; transition-delay: 120ms; }
body.ready .headline { opacity: 1; transform: none; transition-delay: 220ms; }
body.ready .lede     { opacity: 1; transform: none; transition-delay: 380ms; }
body.ready .meta     { opacity: 1; transform: none; transition-delay: 520ms; }

/* ── foot ────────────────────────────────────────────────────── */

.foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 0 var(--edge) clamp(20px, 3vw, 32px);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--ink-faint);
}
.foot a { text-decoration: none; transition: color 180ms var(--ease); }
.foot a:hover { color: var(--paper-ink); }

:focus-visible {
  outline: 2px solid var(--paper-ink);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ── narrow ──────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .stage { display: flex; flex-direction: column; }
  .thread {
    position: relative;
    top: auto;
    right: auto;
    order: 1;
    width: min(74vw, 360px);
    margin: 0 0 clamp(10px, 2vw, 18px) auto;
    transform: none;
  }
  .copy { order: 2; }
  .headline { font-size: clamp(54px, 15vw, 92px); line-height: .92; }
  .lede { max-width: 30ch; }
  .foot { flex-direction: column; gap: 6px; }
}

@media (max-width: 420px) {
  .thread { width: 78vw; margin-right: 0; }
  .headline { font-size: clamp(48px, 16.5vw, 76px); }
}

@media (max-height: 560px) and (orientation: landscape) {
  .headline { font-size: clamp(40px, 9.5vh, 68px); }
  .lede { margin-top: 14px; font-size: 14px; }
  .meta { margin-top: 18px; }
  .thread { width: min(44%, 320px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    transition-delay: 0ms !important;
  }
  .eyebrow, .headline, .lede, .meta { opacity: 1; transform: none; }
}
