:root {
  --ink: #000;
  --paper: #fff;
  --dim: rgba(255, 255, 255, 0.72);
  --faint: rgba(255, 255, 255, 0.34);
  --gutter: clamp(16px, 4vw, 56px);
  --rail-size: clamp(9px, 1.05vw, 12px);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: "DM Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---------- background static ---------- */

/* Still fallback: visible when JS is off or the canvas never starts.
   The canvas fades in over the top of it once static.js is running. */
.grain {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-color: #000;
  background-image: url("assets/grain.png");
  background-size: 614px 614px;
  image-rendering: pixelated;
  opacity: 0.85;
  -webkit-mask-image: radial-gradient(118% 88% at 28% 52%, #000 12%, rgba(0,0,0,0.35) 58%, transparent 92%);
  mask-image: radial-gradient(118% 88% at 28% 52%, #000 12%, rgba(0,0,0,0.35) 58%, transparent 92%);
}

#static {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
  opacity: 0;
  transition: opacity 500ms ease;
}

.static-live #static { opacity: 1; }

/* knocks the noise back on the right so the type stays crisp */
.veil {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0,0,0,0.92) 0%, rgba(0,0,0,0.45) 9%, rgba(0,0,0,0) 20%),
    linear-gradient(0deg, rgba(0,0,0,0.92) 0%, rgba(0,0,0,0.45) 9%, rgba(0,0,0,0) 20%),
    linear-gradient(100deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.15) 34%, rgba(0,0,0,0.72) 62%, rgba(0,0,0,0.88) 100%);
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: radial-gradient(118% 88% at 28% 52%, rgba(0,0,0,0) 26%, rgba(0,0,0,0.5) 66%, rgba(0,0,0,0.95) 100%);
}

/* ---------- frame ---------- */

.frame {
  position: relative;
  z-index: 4;
  height: 100%;
  padding: var(--gutter);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: clamp(16px, 3vh, 32px);
}

.frame::before {
  content: "";
  position: absolute;
  inset: calc(var(--gutter) * 0.52);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: clamp(10px, 1.4vw, 20px);
  pointer-events: none;
}

.rail {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  font-size: var(--rail-size);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--dim);
  padding: 0 clamp(6px, 1.5vw, 22px);
}

.rail__start { grid-column: 1; }
.rail__mid { grid-column: 2; text-align: center; color: var(--faint); }
.rail__end { grid-column: 3; text-align: right; }

/* ---------- call to action ---------- */
/* .button styles below are intentionally kept while the button is
   commented out in index.html. */

.stage {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 clamp(6px, 2.5vw, 40px);
}

.cta {
  max-width: min(46vw, 560px);
  text-align: right;
  animation: rise 1.1s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.eyebrow {
  margin: 0 0 clamp(14px, 2.4vh, 26px);
  font-size: var(--rail-size);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--faint);
}

.eyebrow::after {
  content: "";
  display: block;
  margin: 10px 0 0 auto;
  width: 46px;
  height: 1px;
  background: rgba(255, 255, 255, 0.3);
}

.headline {
  margin: 0;
  font-family: "Instrument Serif", "Times New Roman", serif;
  font-weight: 400;
  font-size: clamp(2.6rem, 7.2vw, 5.6rem);
  line-height: 0.98;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.headline em {
  font-style: italic;
  letter-spacing: 0.005em;
}

.sub {
  margin: clamp(16px, 2.6vh, 28px) 0 0;
  font-size: clamp(11px, 1.15vw, 13px);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
}

.button {
  margin-top: clamp(22px, 3.4vh, 40px);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 999px;
  color: var(--paper);
  text-decoration: none;
  font-size: var(--rail-size);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(2px);
  transition: background 220ms ease, color 220ms ease, border-color 220ms ease;
}

.button:hover,
.button:focus-visible {
  background: var(--paper);
  border-color: var(--paper);
  color: var(--ink);
}

.button svg { transition: transform 220ms ease; }
.button:hover svg { transform: translateX(3px); }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

/* ---------- small screens ---------- */

@media (max-width: 720px) {
  .veil {
    background: linear-gradient(185deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.3) 40%, rgba(0,0,0,0.86) 100%);
  }
  .stage { align-items: flex-end; padding-bottom: clamp(8px, 4vh, 40px); }
  .cta { max-width: 100%; }
  .rail {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    letter-spacing: 0.14em;
    font-size: 9px;
    padding: 0 2px;
    white-space: nowrap;
  }
  .rail__mid { display: none; }
  .rail__end { margin-left: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .cta { animation: none; }
  #static { transition: none; }
  .button, .button svg { transition: none; }
}
