:root {
  --navy: #000f28;
  --navy-deep: #00081a;
  --black: #000000;
  --gold: #f1b113;
  --paper: #f4f2ec;
  --muted: #8891a3;
  --hairline: rgba(244, 242, 236, 0.14);
  --hairline-soft: rgba(244, 242, 236, 0.07);

  --font-display: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

html {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  background:
    radial-gradient(ellipse 120% 80% at 100% 0%, rgba(241, 177, 19, 0.07), transparent 55%),
    linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 100%);
  color: var(--paper);
  font-family: var(--font-display);
  position: relative;
}

/* ---------- scale-to-fit page wrapper (guarantees no scroll, any viewport) ---------- */

.page {
  width: 100vw;
  min-height: 100svh;
  min-height: 100vh;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  transform-origin: top center;
  display: flex;
  flex-direction: column;
}

/* ---------- texture layers ---------- */

.grid-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background-image:
    linear-gradient(var(--hairline-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--hairline-soft) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.9), rgba(0,0,0,0.35) 70%, transparent 100%);
}

.grain {
  position: fixed;
  inset: -10%;
  width: 120%;
  height: 120%;
  pointer-events: none;
  z-index: 2;
  opacity: 0.045;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  pointer-events: none;
  z-index: 60;
  transition: transform 0.55s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease, width 0.2s ease, height 0.2s ease, margin 0.2s ease;
  opacity: 0;
}

.cursor-ring.is-visible { opacity: 1; }
.cursor-ring.is-active {
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  background: var(--gold);
}

@media (pointer: coarse) {
  .cursor-ring { display: none; }
}

/* ---------- header ---------- */

.site-header {
  position: relative;
  z-index: 10;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: clamp(1.1rem, 3vh, 2rem) clamp(1.2rem, 4vw, 3.5rem) 0;
}

.logo {
  height: clamp(44px, 7vh, 76px);
  width: auto;
  display: block;
}

.status-readout {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-size: clamp(0.62rem, 1vh, 0.72rem);
  letter-spacing: 0.12em;
  color: var(--muted);
  white-space: nowrap;
}

.status-readout .sep { opacity: 0.4; }

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 0 rgba(241, 177, 19, 0.6);
  animation: pulse 2.4s ease-out infinite;
  flex-shrink: 0;
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(241, 177, 19, 0.55); }
  70%  { box-shadow: 0 0 0 8px rgba(241, 177, 19, 0); }
  100% { box-shadow: 0 0 0 0 rgba(241, 177, 19, 0); }
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  z-index: 10;
  flex: 1 1 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 620px) minmax(0, 1fr);
  align-items: center;
  gap: 1.5rem;
  padding: clamp(0.5rem, 1.5vh, 1.5rem) clamp(1.2rem, 4vw, 3.5rem);
  min-width: 0;
}

.hero-copy { max-width: 620px; min-width: 0; position: relative; z-index: 1; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 clamp(0.9rem, 2.4vh, 1.6rem);
  padding: clamp(0.32rem, 0.8vh, 0.42rem) clamp(0.65rem, 1.4vw, 0.85rem);
  border: 1px solid var(--gold);
  font-family: var(--font-mono);
  font-size: clamp(0.68rem, 1.15vh, 0.8rem);
  letter-spacing: 0.2em;
  color: var(--gold);
  text-transform: uppercase;
}

.headline {
  margin: 0;
  font-weight: 600;
  font-size: clamp(2.1rem, min(7vw, 8vh), 5.6rem);
  line-height: 0.98;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

.headline .accent {
  color: var(--gold);
  font-style: normal;
}

/* ---------- decorative wire ---------- */

.hero-visual {
  position: relative;
  height: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-visual svg { width: 100%; height: 100%; max-height: 100%; }

.wire { fill: none; stroke-linecap: round; }

.wire--main {
  stroke-dasharray: 1400;
  stroke-dashoffset: 1400;
  animation: draw 2.6s cubic-bezier(0.65, 0, 0.35, 1) 0.3s forwards;
  filter: drop-shadow(0 0 6px rgba(241, 177, 19, 0.35));
}

@keyframes draw {
  to { stroke-dashoffset: 0; }
}

.pulse-node {
  filter: drop-shadow(0 0 5px rgba(241, 177, 19, 0.9));
  opacity: 0;
  animation: node-in 0.4s ease 2.6s forwards;
}

@keyframes node-in { to { opacity: 1; } }

@media (max-width: 880px) {
  .headline { display: none; }

  .hero {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }

  .hero-copy {
    position: relative;
    z-index: 1;
    text-align: center;
  }

  .badge { margin: 0; background: var(--navy); }

  .hero-visual {
    position: absolute;
    inset: 0;
    z-index: 0;
    opacity: 0.9;
  }

  .wire--ghost-a, .wire--ghost-b { opacity: 0.12; }
  .wire--main { stroke-width: 2; }
}

/* ---------- marquee footer ---------- */

.marquee {
  position: relative;
  z-index: 10;
  flex: 0 0 auto;
  border-top: 1px solid var(--hairline);
  overflow: hidden;
  padding: clamp(0.5rem, 1.2vh, 0.85rem) 0;
}

.marquee-track {
  display: flex;
  width: max-content;
  gap: 1.4rem;
  font-family: var(--font-mono);
  font-size: clamp(0.64rem, 1vh, 0.76rem);
  letter-spacing: 0.16em;
  color: var(--muted);
  white-space: nowrap;
  animation: scroll 30s linear infinite;
}

.marquee-track span { flex-shrink: 0; }

@keyframes scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .marquee-track, .wire--main, .pulse-node, .pulse-dot, .cursor-ring {
    animation: none !important;
    transition: none !important;
  }
  .wire--main { stroke-dashoffset: 0; }
  .pulse-node { opacity: 1; }
}

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

@media (max-width: 560px) {
  .status-readout span:not(#clock):not(.pulse-dot) { display: none; }
}

@media (max-height: 460px) {
  .marquee { display: none; }
}
