/* Voidcraft Studios — "White Hole"
   Ported from the design package prototype (docs/design). */

:root {
  --bg: #07070B;
  --surface: #100E16;
  --line: #1C1926;
  --text: #EDEBF2;
  --body: #B9B5C6;
  --muted: #8C8798;
  --dim: #6E6A7C;
  --faint: #4A4658;
  --stroke-ghost: #3A3548;
  --accent: #A06BFF;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Space Grotesk', sans-serif;
  overflow-x: clip;
}

.mono { font-family: 'Space Mono', monospace; }
.accent { color: var(--accent); }
.dim { color: var(--dim); }

/* JS adds .v4-nocursor when the gravity cursor is active */
.v4-nocursor, .v4-nocursor a, .v4-nocursor button { cursor: none; }

/* ── Nav ──────────────────────────────────────────────────────────── */
.v4-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  background: linear-gradient(var(--bg) 30%, transparent);
}
.v4-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.v4-wordmark { font-size: 11px; letter-spacing: 0.4em; color: var(--text); }
.v4-nav-links { display: flex; align-items: center; gap: 28px; }
.v4-navlink {
  color: var(--body);
  text-decoration: none;
  font-size: 11px;
  letter-spacing: 0.22em;
  transition: color 0.15s ease;
}
.v4-navlink:hover { color: var(--text); }
.v4-cta {
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 9px 18px;
  border-radius: 2px;
}
.v4-cta:hover { color: var(--text); border-color: var(--text); }

/* ── Hero ─────────────────────────────────────────────────────────── */
.v4-hero { position: relative; height: 100vh; }
.cinematic .v4-hero { height: 260vh; }
.v4-hero-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  min-height: 640px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: clip;
}
.v4-stars {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  transition: opacity 0.6s ease;
}
.v4-hero-type {
  position: relative;
  width: fit-content;
  margin: 0 auto;
  text-align: center;
}
.v4-megatype {
  margin: 0;
  font-weight: 700;
  font-size: clamp(90px, 15.5vw, 230px);
  line-height: 0.88;
  letter-spacing: 0.015em;
  color: var(--text);
  user-select: none;
  position: relative;
  z-index: 1;
}
.v4-megatype-outline {
  position: absolute;
  inset: 0;
  pointer-events: none;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--accent);
  z-index: 3;
  clip-path: circle(189px at 50% 40%);
}
.v4-disc {
  position: absolute;
  left: 50%;
  top: 40%;
  transform: translate(-50%, -50%) scale(1);
  width: 380px;
  height: 380px;
  border-radius: 50%;
  background: var(--bg);
  z-index: 2;
  box-shadow: 0 0 0 1.5px var(--accent), 0 0 90px 0 color-mix(in srgb, var(--accent) 33%, transparent), inset 0 0 60px 10px #000;
  will-change: transform;
}
.v4-hero-inner {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  opacity: 0;
  pointer-events: none;
}
.v4-inner-kicker { font-size: 13px; letter-spacing: 0.5em; color: var(--accent); }
.v4-inner-line { font-size: clamp(40px, 5vw, 72px); font-weight: 700; letter-spacing: -0.01em; }
.v4-hero-meta {
  position: absolute;
  left: 0; right: 0; bottom: 46px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 28px;
  z-index: 5;
}
.v4-hero-meta-l { font-size: 12px; letter-spacing: 0.26em; color: var(--muted); line-height: 2; }
.v4-hero-meta-r { font-size: 12px; letter-spacing: 0.26em; color: var(--accent); text-align: right; line-height: 2; }

/* ── Section primitives ───────────────────────────────────────────── */
.v4-h2 {
  margin: 0;
  font-weight: 700;
  font-size: clamp(44px, 5.5vw, 76px);
  letter-spacing: -0.02em;
  line-height: 1;
  position: relative;
}
.v4-body {
  margin: 0;
  font-size: 18px;
  line-height: 1.75;
  color: var(--body);
  text-wrap: pretty;
}
.v4-edge {
  position: absolute;
  left: 28px;
  top: 132px;
  font-size: 11px;
  letter-spacing: 0.3em;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
  z-index: 3;
  color: var(--faint);
}
.v4-edge .edge-dot { color: var(--accent); }
.v4-edge.inverted { color: rgba(7, 7, 11, 0.55); }
.v4-edge.inverted .edge-dot { color: var(--bg); }
.v4-numeral {
  position: absolute;
  right: 12px;
  top: 48px;
  font-weight: 700;
  font-size: clamp(180px, 24vw, 340px);
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px var(--line);
  pointer-events: none;
  user-select: none;
}

/* ── Marquee ──────────────────────────────────────────────────────── */
.v4-marquee-wrap {
  overflow: clip;
  padding: 46px 0;
  margin: -10px 0;
  pointer-events: none;
}
.v4-marquee-track {
  display: inline-flex;
  white-space: nowrap;
  transform: rotate(-2.2deg);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
  width: 110%;
  margin-left: -5%;
}
.v4-marquee-text {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 30px;
  letter-spacing: 0.06em;
  color: transparent;
  -webkit-text-stroke: 1px var(--stroke-ghost);
  padding-right: 2em;
}

/* ── Work ─────────────────────────────────────────────────────────── */
.v4-work { position: relative; }
.cinematic .v4-work { height: 280vh; }
.v4-work-sticky { position: relative; }
.cinematic .v4-work-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: clip;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.v4-work-head { padding: 0 0 0 96px; margin-bottom: 36px; }
.v4-work-track {
  display: flex;
  gap: 32px;
  padding: 0 96px;
  will-change: transform;
  width: max-content;
}
.v4-slide { flex: 0 0 auto; width: 58vw; }
.v4-slot {
  width: 100%;
  height: 58vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--line);
}
.v4-slot-ph { font-size: 11px; letter-spacing: 0.3em; color: var(--faint); }
.v4-workmeta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  letter-spacing: 0.24em;
  color: var(--muted);
  margin-top: 12px;
}

/* static fallback (no cinematic) */
html:not(.cinematic) .v4-work { padding: 120px 28px 120px 96px; }
html:not(.cinematic) .v4-work-head { padding: 0; margin-bottom: 0; }
html:not(.cinematic) .v4-work-track {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 22px;
  margin-top: 56px;
  padding: 0;
  width: auto;
  transform: none !important;
}
html:not(.cinematic) .v4-slide { width: auto; }
html:not(.cinematic) .v4-slot { height: 300px; }

/* ── Services ─────────────────────────────────────────────────────── */
.v4-services {
  position: relative;
  background: var(--accent);
  color: var(--bg);
  padding: 120px 28px 140px 96px;
}
.v4-services .v4-h2 { color: var(--bg); }
.v4-irows {
  margin-top: 56px;
  border-top: 1.5px solid rgba(7, 7, 11, 0.4);
  display: flex;
  flex-direction: column;
}
.v4-irow {
  display: grid;
  grid-template-columns: 90px 1.4fr 1fr;
  align-items: baseline;
  gap: 24px;
  padding: 38px 18px;
  border-bottom: 1.5px solid rgba(7, 7, 11, 0.4);
  transition: background 0.18s ease, color 0.18s ease;
  cursor: default;
}
.v4-irow:hover { background: var(--bg); color: var(--accent); }
.v4-irow-num { font-size: 13px; letter-spacing: 0.2em; opacity: 0.6; }
.v4-irow-title { font-size: clamp(28px, 3.2vw, 46px); font-weight: 700; letter-spacing: -0.01em; }
.v4-irow-aud { font-size: 11px; letter-spacing: 0.22em; font-weight: 700; margin-bottom: 8px; }
.v4-irow-tags { font-size: 10.5px; letter-spacing: 0.18em; opacity: 0.65; }

/* ── About ────────────────────────────────────────────────────────── */
.v4-about { position: relative; padding: 140px 28px 140px 96px; }
.v4-manifesto {
  font-weight: 700;
  font-size: clamp(54px, 7.5vw, 110px);
  line-height: 1.04;
  letter-spacing: -0.02em;
}
.v4-outline {
  color: transparent;
  -webkit-text-stroke: 2px var(--accent);
}
.v4-about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  margin-top: 64px;
  max-width: 1000px;
}
.v4-about-list { font-size: 13px; line-height: 2.4; color: var(--muted); letter-spacing: 0.12em; }

/* ── Contact ──────────────────────────────────────────────────────── */
.v4-contact {
  position: relative;
  padding: 180px 28px;
  text-align: center;
  border-top: 1px solid var(--line);
  overflow: clip;
}
.v4-contact-kicker {
  font-size: 12px;
  letter-spacing: 0.32em;
  color: var(--accent);
  margin-bottom: 26px;
  position: relative;
}
.v4-shout {
  position: relative;
  display: inline-block;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: clamp(64px, 11vw, 170px);
  line-height: 1;
  letter-spacing: 0.01em;
  text-decoration: none;
  color: transparent;
  -webkit-text-stroke: 2px var(--accent);
  transition: color 0.2s ease;
}
.v4-shout:hover, .v4-shout:focus-visible { color: var(--accent); }
.v4-contact-sub {
  font-size: 13px;
  letter-spacing: 0.2em;
  color: var(--muted);
  margin-top: 30px;
  position: relative;
}

/* ── Footer ───────────────────────────────────────────────────────── */
.v4-footer {
  border-top: 1px solid var(--line);
  padding: 26px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.v4-footer-brand { display: flex; align-items: center; gap: 10px; }
.v4-footer-name { font-size: 10px; letter-spacing: 0.34em; color: var(--dim); }
.v4-footer-legal { font-size: 11px; color: var(--faint); letter-spacing: 0.1em; }

/* ── Fixed layers ─────────────────────────────────────────────────── */
.v4-grain {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.05;
  pointer-events: none;
  z-index: 90;
}
.v4-hud {
  position: fixed;
  left: 28px;
  bottom: 24px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 10px;
  letter-spacing: 0.28em;
  color: var(--dim);
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.v4-hud-bar {
  width: 90px;
  height: 2px;
  background: var(--line);
  display: inline-block;
  position: relative;
}
.v4-hud-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0%;
  background: var(--accent);
}
.v4-hud .accent { font-variant-numeric: tabular-nums; }
.v4-feed {
  position: fixed;
  right: 28px;
  bottom: 24px;
  z-index: 60;
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--dim);
  pointer-events: none;
  transition: opacity 0.2s ease;
  text-align: right;
}

/* wormhole transition overlay */
.v4-wormhole {
  position: fixed;
  inset: 0;
  z-index: 95;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: clip;
}
.v4-wormhole.active { pointer-events: auto; }
.v4-wormhole-disc {
  width: 380px;
  height: 380px;
  border-radius: 50%;
  background: #000;
  flex: 0 0 auto;
  box-shadow: 0 0 0 1.5px var(--accent), 0 0 90px 0 color-mix(in srgb, var(--accent) 33%, transparent);
  transform: scale(0);
  transition: transform 0.6s cubic-bezier(0.2, 0.6, 0.4, 1);
  will-change: transform;
}
.v4-wormhole.closing .v4-wormhole-disc {
  transform: scale(10);
  transition: transform 0.55s cubic-bezier(0.5, 0, 0.8, 0.4);
}

/* gravity cursor */
.v4-cursor { display: none; }
.v4-nocursor ~ .v4-cursor, .v4-cursor.on { display: block; }
.v4-cursor-ring {
  position: fixed;
  left: -18px;
  top: -18px;
  width: 36px;
  height: 36px;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 100;
}
.v4-cursor-dot {
  position: fixed;
  left: -2.5px;
  top: -2.5px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  pointer-events: none;
  z-index: 100;
}

/* boot overlay (built by JS) */
.v4-boot {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease;
}
.v4-boot.fade { opacity: 0; }
.v4-boot-lines {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.3em;
  line-height: 2.6;
  color: var(--muted);
  min-width: 340px;
}

/* ── Motion ───────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  .v4-marquee-track > span { animation: v4-scroll 38s linear infinite; }
  .v4-marquee-flip > span { animation-direction: reverse; }
  .v4-caret { animation: v4-blink 1.1s steps(2, start) infinite; }
}
@keyframes v4-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}
@keyframes v4-blink {
  to { visibility: hidden; }
}

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 880px) {
  .v4-edge, .v4-numeral { display: none; }
  .v4-work-head { padding-left: 28px; }
  .v4-work-track { padding: 0 28px; }
  .v4-slide { width: 78vw; }
  .v4-services { padding: 100px 24px 110px; }
  .v4-about { padding: 110px 24px; }
  html:not(.cinematic) .v4-work { padding: 100px 24px; }
  html:not(.cinematic) .v4-work-track { grid-template-columns: 1fr; }
  .v4-about-grid { grid-template-columns: 1fr; gap: 32px; }
  .v4-irow { grid-template-columns: 48px 1fr; }
  .v4-irow > div:last-child { grid-column: 2; }
}
@media (max-width: 640px) {
  .v4-nav { padding: 16px 18px; }
  .v4-nav-links { gap: 16px; }
  .v4-navlink:not(.v4-cta) { display: none; }
  .v4-hero-sticky { min-height: 520px; }
  .v4-hero-meta {
    bottom: 48px;
    padding: 0 18px;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .v4-hero-meta-l, .v4-hero-meta-r { font-size: 10px; }
  .v4-hero-meta-r { text-align: left; }
  .v4-disc { width: 280px; height: 280px; }
  .v4-megatype-outline { clip-path: circle(139px at 50% 40%); }
  .v4-hud { left: 18px; bottom: 18px; }
  .v4-feed { display: none; }
  .v4-footer { flex-direction: column; align-items: flex-start; }
}
