:root {
  --display: 'Unbounded', sans-serif;
  --body: 'DM Sans', sans-serif;
  --utility: 'IBM Plex Mono', monospace;
  --page-pad: clamp(20px, 4vw, 64px);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

html[data-site='l0'] {
  --bg: #07121f;
  --bg-deep: #030912;
  --surface: rgba(216, 235, 244, 0.055);
  --surface-strong: rgba(216, 235, 244, 0.1);
  --text: #e8f2f5;
  --muted: #91a9b6;
  --line: rgba(174, 204, 218, 0.22);
  --accent: #ff6948;
  --accent-soft: rgba(255, 105, 72, 0.15);
  --signal: #77c8e6;
  --signal-soft: rgba(119, 200, 230, 0.13);
  --focus: #ffb19d;
}

html[data-site='x0'] {
  --bg: #f3eadf;
  --bg-deep: #e6d6c7;
  --surface: rgba(62, 31, 46, 0.045);
  --surface-strong: rgba(62, 31, 46, 0.085);
  --text: #2b1621;
  --muted: #755b65;
  --line: rgba(75, 36, 54, 0.2);
  --accent: #a31f45;
  --accent-soft: rgba(163, 31, 69, 0.11);
  --signal: #d7794f;
  --signal-soft: rgba(215, 121, 79, 0.16);
  --focus: #6d1430;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html[data-site='x0'] {
  color-scheme: light;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at var(--mx, 72%) var(--my, 22%), var(--signal-soft), transparent 24rem),
    linear-gradient(145deg, var(--bg) 0%, var(--bg-deep) 100%);
  color: var(--text);
  font-family: var(--body);
  line-height: 1.5;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 72px 72px;
  content: '';
  opacity: 0.15;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(circle at 50% 44%, #000 0, transparent 76%);
  mask-image: radial-gradient(circle at 50% 44%, #000 0, transparent 76%);
}

html[data-site='x0'] body::before {
  background-image:
    linear-gradient(30deg, var(--line) 12%, transparent 12.5%, transparent 87%, var(--line) 87.5%),
    linear-gradient(150deg, var(--line) 12%, transparent 12.5%, transparent 87%, var(--line) 87.5%);
  background-position: 0 0, 36px 0;
  background-size: 72px 42px;
  opacity: 0.13;
}

a {
  color: inherit;
  text-decoration: none;
}

a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 5px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--text);
  color: var(--bg);
  font-weight: 700;
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.ambient {
  position: fixed;
  z-index: -1;
  border: 1px solid var(--line);
  border-radius: 50%;
  pointer-events: none;
}

.ambient-a {
  top: -28vw;
  right: -14vw;
  width: 58vw;
  height: 58vw;
}

.ambient-b {
  bottom: -32vw;
  left: -20vw;
  width: 52vw;
  height: 52vw;
}

.site-header,
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  padding-right: var(--page-pad);
  padding-left: var(--page-pad);
}

.site-header {
  min-height: 96px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  fill: currentColor;
}

.brand-name,
.domain-id,
.eyebrow,
.status-line,
.stage-caption,
.site-footer {
  font-family: var(--utility);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.brand-name {
  font-size: 13px;
  font-weight: 600;
}

.domain-id {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 600;
}

.domain-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px var(--accent-soft), 0 0 24px var(--accent);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(420px, 1.08fr);
  align-items: center;
  gap: clamp(40px, 6vw, 104px);
  min-height: calc(100vh - 176px);
  padding: clamp(56px, 8vh, 104px) var(--page-pad);
}

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 720px;
}

.eyebrow {
  margin: 0 0 24px;
  color: var(--accent);
  font-size: clamp(10px, 1vw, 12px);
  font-weight: 600;
}

h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(3.3rem, 7vw, 7.7rem);
  font-weight: 600;
  letter-spacing: -0.065em;
  line-height: 0.91;
}

.title-line {
  display: block;
  opacity: 0;
  transform: translateY(28px);
  animation: reveal 900ms var(--ease-out) 100ms forwards;
}

.title-accent {
  margin-top: 0.08em;
  color: var(--accent);
  animation-delay: 210ms;
}

html[data-site='x0'] .title-accent {
  font-size: 0.86em;
  letter-spacing: -0.055em;
}

.hero-text {
  max-width: 620px;
  margin: clamp(28px, 4vw, 44px) 0 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.5vw, 1.32rem);
  line-height: 1.58;
  opacity: 0;
  transform: translateY(18px);
  animation: reveal 760ms var(--ease-out) 360ms forwards;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
  opacity: 0;
  transform: translateY(18px);
  animation: reveal 760ms var(--ease-out) 470ms forwards;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 52px;
  border: 1px solid var(--line);
  padding: 13px 18px;
  font-size: 0.93rem;
  font-weight: 700;
  transition: color 180ms ease, background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.button svg {
  width: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.button-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fffaf6;
}

.button-secondary {
  background: var(--surface);
}

.button:hover {
  transform: translateY(-3px);
}

.button-primary:hover {
  background: transparent;
  color: var(--accent);
}

.button-secondary:hover {
  border-color: var(--signal);
  background: var(--signal-soft);
}

.status-line {
  display: grid;
  grid-template-columns: auto minmax(28px, 100px) auto;
  align-items: center;
  gap: 14px;
  max-width: 590px;
  margin-top: clamp(48px, 9vh, 96px);
  color: var(--muted);
  font-size: 9px;
  opacity: 0;
  animation: fade-in 600ms ease 700ms forwards;
}

.status-label {
  color: var(--text);
}

.status-rule {
  height: 1px;
  background: var(--line);
}

.signal-stage {
  min-width: 0;
  perspective: 1000px;
}

.signal-frame {
  position: relative;
  display: grid;
  place-items: center;
  width: min(100%, 680px);
  aspect-ratio: 1;
  margin: 0 auto;
  border: 1px solid var(--line);
  background: linear-gradient(145deg, var(--surface-strong), transparent 56%);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.16);
  overflow: hidden;
  opacity: 0;
  transform: rotateY(-7deg) translateX(20px);
  animation: stage-in 1200ms var(--ease-out) 260ms forwards;
}

html[data-site='x0'] .signal-frame {
  border-radius: 50%;
  background: radial-gradient(circle at 48% 44%, rgba(255, 255, 255, 0.72), var(--surface) 56%, transparent 72%);
  box-shadow: 0 44px 100px rgba(92, 48, 61, 0.15);
  transform: scale(0.92) rotate(4deg);
  animation-name: origin-in;
}

.frame-corner {
  position: absolute;
  width: 20px;
  height: 20px;
  border-color: var(--accent);
  border-style: solid;
  opacity: 0.8;
}

html[data-site='x0'] .frame-corner {
  display: none;
}

.corner-a { top: 16px; left: 16px; border-width: 1px 0 0 1px; }
.corner-b { top: 16px; right: 16px; border-width: 1px 1px 0 0; }
.corner-c { right: 16px; bottom: 16px; border-width: 0 1px 1px 0; }
.corner-d { bottom: 16px; left: 16px; border-width: 0 0 1px 1px; }

.l0-visual,
.x0-visual {
  position: relative;
  width: 82%;
  aspect-ratio: 1;
}

.x0-visual {
  display: none;
}

html[data-site='x0'] .l0-visual {
  display: none;
}

html[data-site='x0'] .x0-visual {
  display: block;
}

.zero-orbit,
.zero-core {
  position: absolute;
  inset: 50% auto auto 50%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.zero-orbit {
  border: 1px solid var(--line);
}

.zero-orbit::after {
  position: absolute;
  top: -4px;
  left: calc(50% - 4px);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 18px var(--signal);
  content: '';
}

.orbit-one {
  width: 38%;
  height: 38%;
  animation: spin 8s linear infinite;
}

.orbit-two {
  width: 64%;
  height: 64%;
  border-style: dashed;
  animation: spin-reverse 14s linear infinite;
}

.orbit-three {
  width: 90%;
  height: 90%;
  animation: spin 20s linear infinite;
}

.zero-core {
  display: grid;
  place-items: center;
  width: 24%;
  height: 24%;
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 80px var(--accent-soft);
}

.zero-core span {
  font-family: var(--display);
  font-size: clamp(1.7rem, 4vw, 3.8rem);
  font-weight: 600;
  letter-spacing: -0.08em;
}

.system-tag {
  position: absolute;
  padding: 6px 9px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--muted);
  font-family: var(--utility);
  font-size: clamp(7px, 0.75vw, 10px);
  letter-spacing: 0.1em;
}

.tag-interface { top: 6%; left: 41%; }
.tag-services { top: 36%; right: 0; }
.tag-events { bottom: 13%; left: 15%; }
.tag-infra { top: 42%; left: 0; }

.origin-lines {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.origin-ring,
.cross-line,
.origin-x {
  fill: none;
  stroke: var(--line);
  vector-effect: non-scaling-stroke;
}

.origin-ring {
  stroke-dasharray: 2 8;
  stroke-linecap: round;
  animation: spin-svg 34s linear infinite;
  transform-box: fill-box;
  transform-origin: center;
}

.ring-b {
  stroke: var(--signal);
  stroke-dasharray: 1 10;
  opacity: 0.72;
  animation-direction: reverse;
  animation-duration: 24s;
}

.ring-c {
  stroke: var(--accent);
  stroke-dasharray: 3 7;
  animation-duration: 16s;
}

.cross-line {
  stroke: var(--line);
  stroke-dasharray: 4 10;
}

.origin-x {
  stroke: var(--accent);
  stroke-width: 2;
}

.origin-label {
  position: absolute;
  inset: 50% auto auto 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translate(-50%, -50%);
}

.origin-label span {
  font-family: var(--display);
  font-size: clamp(2.1rem, 5vw, 5rem);
  font-weight: 600;
  letter-spacing: -0.08em;
}

.origin-label small,
.coordinate {
  color: var(--muted);
  font-family: var(--utility);
  font-size: clamp(7px, 0.7vw, 10px);
  letter-spacing: 0.14em;
}

.coordinate {
  position: absolute;
}

.coordinate-a { top: 4%; left: 50%; transform: translateX(-50%); }
.coordinate-b { right: 3%; bottom: 29%; transform: rotate(90deg); }
.coordinate-c { bottom: 7%; left: 12%; }

.stage-caption {
  position: absolute;
  right: 24px;
  bottom: 20px;
  left: 24px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(7px, 0.7vw, 10px);
  text-align: center;
}

.site-footer {
  min-height: 80px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 8px;
}

.site-footer p {
  margin: 0;
}

@keyframes reveal {
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes stage-in {
  to { opacity: 1; transform: rotateY(0) translateX(0); }
}

@keyframes origin-in {
  to { opacity: 1; transform: scale(1) rotate(0); }
}

@keyframes spin {
  from { transform: translate(-50%, -50%) rotate(0); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes spin-reverse {
  from { transform: translate(-50%, -50%) rotate(360deg); }
  to { transform: translate(-50%, -50%) rotate(0); }
}

@keyframes spin-svg {
  to { transform: rotate(360deg); }
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 64px;
  }

  .hero-copy {
    max-width: 820px;
  }

  .signal-frame {
    max-width: 640px;
  }
}

@media (max-width: 640px) {
  body::before {
    background-size: 48px 48px;
  }

  .site-header {
    min-height: 76px;
  }

  .brand-name {
    display: none;
  }

  .hero {
    min-height: auto;
    padding-top: 54px;
    padding-bottom: 64px;
  }

  h1 {
    font-size: clamp(3rem, 15vw, 5.2rem);
  }

  .hero-text {
    font-size: 1rem;
  }

  .actions {
    align-items: stretch;
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .status-line {
    grid-template-columns: auto 32px 1fr;
    margin-top: 48px;
  }

  .signal-stage {
    margin-right: -6px;
    margin-left: -6px;
  }

  .signal-frame {
    width: 100%;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    min-height: 110px;
    padding-top: 24px;
    padding-bottom: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
