/* =====================================================================
   gantry — held breath
   nothing here is decoration. every value serves the moment.
   ===================================================================== */

:root {
  --bg:        #030712;
  --ink:       #f3f4f6;
  --ink-soft:  #99a1af;
  --ink-low:   #4a5565;
  --ink-bare:  #1e2939;

  --acid:      #2b7fff;
  --warm:      #51a2ff;

  --serif:     'Instrument Serif', Georgia, serif;
  --sans:      'Space Grotesk', system-ui, sans-serif;
  --mono:      'JetBrains Mono', ui-monospace, monospace;
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  overflow: hidden;
  height: 100%;
}

body {
  font-family: var(--sans);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  cursor: default;
}

::selection { background: var(--acid); color: var(--bg); }

/* ----------------------------------------------------------------
   the field — canvas behind everything
---------------------------------------------------------------- */

#field {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100svh;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  animation: field-fade 4s ease 200ms forwards;
}

@keyframes field-fade {
  to { opacity: 1; }
}

/* ----------------------------------------------------------------
   the stage — full-viewport composition
---------------------------------------------------------------- */

.stage {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100vh;
  height: 100svh;
  display: grid;
  grid-template-rows: 1fr auto 1fr;
  padding: clamp(32px, 5vw, 64px);
  pointer-events: none;
}

.stage > * { pointer-events: auto; }

/* ----------------------------------------------------------------
   the breath — small mark, always present, alive
---------------------------------------------------------------- */

.breath {
  align-self: start;
  justify-self: start;
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-low);
  opacity: 0;
  animation: breath-arrive 2.4s ease 200ms forwards;
}

@keyframes breath-arrive {
  to { opacity: 1; }
}

.breath-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--acid);
  box-shadow: 0 0 10px rgba(43, 127, 255, 0.45);
  animation: breath-pulse 4.2s ease-in-out infinite;
  position: relative;
}

.breath-dot::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--acid);
  opacity: 0.4;
  animation: breath-ring 4.2s ease-out infinite;
}

@keyframes breath-pulse {
  0%, 100% { transform: scale(1);    opacity: 1;    }
  50%      { transform: scale(0.92); opacity: 0.78; }
}

@keyframes breath-ring {
  0%   { transform: scale(1);   opacity: 0.4; }
  70%  { transform: scale(3);   opacity: 0;   }
  100% { transform: scale(3);   opacity: 0;   }
}

/* ----------------------------------------------------------------
   the held line — words resolve like a held thought
---------------------------------------------------------------- */

.held {
  align-self: center;
  max-width: 880px;
  width: 100%;
}

.held-line {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(48px, 9vw, 124px);
  line-height: 1.04;
  letter-spacing: -0.015em;
  margin: 0;
  color: var(--ink);

  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06),
    0 2px 8px rgba(255, 255, 255, 0.035),
    0 22px 80px rgba(0, 0, 0, 0.82),
    0 0 42px rgba(243, 244, 246, 0.09);
}

.word {
  display: inline-block;
  opacity: 0;
  filter: blur(8px);
  transform: translateY(8px);
  animation: word-arrive 1.6s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
  animation-delay: var(--delay, 0ms);
  margin-right: 0.18em;
}

.word.italic {
  font-style: italic;
  color: var(--warm);
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04),
    0 18px 64px rgba(0, 0, 0, 0.72),
    0 0 30px rgba(81, 162, 255, 0.16);
}

@keyframes word-arrive {
  0%   { opacity: 0;    filter: blur(8px); transform: translateY(8px); }
  60%  { opacity: 0.95; filter: blur(0);   transform: translateY(0);   }
  100% { opacity: 1;    filter: blur(0);   transform: translateY(0);   }
}

/* ----------------------------------------------------------------
   the bottom — stacks the whisper above the trace
---------------------------------------------------------------- */

.bottom {
  align-self: end;
  justify-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ----------------------------------------------------------------
   the whisper — the sentence given to this visitor
---------------------------------------------------------------- */

.whisper {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: 0.005em;
  color: var(--ink-soft);
  max-width: 640px;
  opacity: 0;
  transform: translateY(6px);
  filter: blur(4px);
  transition: opacity 2200ms cubic-bezier(0.2, 0.7, 0.2, 1),
              transform 2200ms cubic-bezier(0.2, 0.7, 0.2, 1),
              filter 2200ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.whisper.is-ready {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

.whisper-text::before {
  content: '“';
  color: var(--ink-low);
  margin-right: 0.12em;
  font-style: normal;
}

.whisper-text::after {
  content: '”';
  color: var(--ink-low);
  margin-left: 0.04em;
  font-style: normal;
}

/* ----------------------------------------------------------------
   the trace — proof of others, almost invisible
---------------------------------------------------------------- */

.trace {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  opacity: 0;
  animation: trace-arrive 2.6s ease 6800ms forwards;
}

@keyframes trace-arrive {
  to { opacity: 1; }
}

.trace-mark {
  color: var(--acid);
  opacity: 0.8;
  font-size: 16px;
  line-height: 1;
}

.trace-text {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  font-variant-numeric: tabular-nums;
}

#visits {
  color: var(--ink);
  font-weight: 400;
  font-style: normal;
  font-family: var(--serif);
}

.trace-suffix {
  color: var(--ink-low);
  letter-spacing: 0.01em;
}

/* ----------------------------------------------------------------
   reduced motion — for visitors who'd rather not be moved
---------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .word { opacity: 1; filter: none; transform: none; }
  #field { opacity: 1; }
}
