:root {
  --black-1000: #000;
  --black-950: #050505;
  --black-900: #0a0a0a;
  --black-800: #171717;
  --white-100: #fff;
  --white-200: #e8e8e8;
  --white-400: #a6a6a6;
  --white-600: #686868;
  --signal: #ff4d00;
  --surface: var(--black-950);
  --text: var(--white-100);
  --muted: var(--white-400);
  --border: rgba(255, 255, 255, 0.18);
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --space-8: 40px;
  --space-9: 48px;
  --space-10: 64px;
  --space-11: 80px;
  --text-xs: 0.7rem;
  --text-sm: 0.82rem;
  --text-base: 1rem;
  --text-lg: 1.15rem;
  --text-display: clamp(3.2rem, 9.5vw, 9.8rem);
  --radius-sm: 2px;
  --radius-md: 6px;
  --radius-lg: 12px;
  --radius-full: 999px;
  --shadow-sm: 0 6px 20px rgba(0, 0, 0, 0.24);
  --shadow-md: 0 16px 50px rgba(0, 0, 0, 0.36);
  --shadow-glow: 0 0 48px rgba(255, 255, 255, 0.12);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-move: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --duration-fast: 120ms;
  --duration-base: 250ms;
  --duration-slow: 400ms;
  --duration-reveal: 900ms;
}

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

html { background: var(--black-1000); scroll-behavior: smooth; }

body {
  min-width: 320px;
  height: 100svh;
  margin: 0;
  overflow: hidden;
  color: var(--text);
  background: var(--surface);
  font-family: "DM Mono", monospace;
  font-size: var(--text-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitchTiles'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
}

a { color: inherit; }

.skip-link {
  position: fixed;
  left: var(--space-4);
  top: var(--space-4);
  z-index: 100;
  padding: var(--space-3) var(--space-4);
  color: var(--black-1000);
  background: var(--white-100);
  transform: translateY(-150%);
  transition: transform var(--duration-base) var(--ease);
}

.skip-link:focus { transform: none; }

.site-header {
  position: fixed;
  z-index: 10;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-7) clamp(var(--space-5), 4vw, var(--space-10));
  mix-blend-mode: difference;
}

.brand {
  display: inline-flex;
  align-items: center;
  color: var(--white-100);
  font-family: "Syne", sans-serif;
  font-size: var(--text-sm);
  font-weight: 800;
  letter-spacing: 0.16em;
  text-decoration: none;
}

.brand img {
  width: 72px;
  height: 72px;
  object-fit: cover;
}

.header-status {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  margin: 0;
  color: var(--white-200);
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ascii-loader {
  display: inline-block;
  width: 6ch;
  font-variant-numeric: tabular-nums;
}

.ascii-loader::before {
  content: "[....]";
  animation: vfat-loader 1.5s steps(1, end) infinite;
}

.hero {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  display: grid;
  align-items: center;
  overflow: hidden;
  padding: clamp(112px, 14vh, 160px) clamp(var(--space-5), 4vw, var(--space-10)) clamp(160px, 24vh, 260px);
  background: var(--black-1000);
}

#flame-canvas {
  position: absolute;
  inset: 0;
  z-index: -3;
  width: 100%;
  height: 100%;
}

.vignette {
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 20%, rgba(0, 0, 0, 0.22) 68%, rgba(0, 0, 0, 0.72) 100%),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.12) 45%, transparent 70%);
}

.hero-content {
  width: 100%;
  max-width: 1500px;
  display: grid;
  place-items: center;
  margin: 0 auto;
}

.glitch {
  position: relative;
  margin: 0;
  color: var(--white-100);
  font-family: "DM Mono", monospace;
  font-size: clamp(1.15rem, 3.1vw, 3.1rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.13em;
  text-align: center;
  text-transform: uppercase;
  text-shadow: 0 0 18px rgba(255, 255, 255, 0.18);
  animation: glitch-base 4.5s steps(1, end) infinite;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
  text-align: left;
}

.glitch::before {
  color: #62f6ff;
  opacity: 0;
  transform: translateX(-3px);
  animation: glitch-top 3.7s steps(1, end) infinite;
}

.glitch::after {
  color: #ff3f81;
  opacity: 0;
  transform: translateX(3px);
  animation: glitch-bottom 3.7s 80ms steps(1, end) infinite;
}

.loading-dots {
  display: inline-block;
  width: 3ch;
  text-align: left;
}

.loading-dots::after {
  content: ".";
  animation: loading-dots 2.4s steps(1, end) infinite;
}

@media (hover: hover) {
  footer a:hover { color: var(--white-100); }
}

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

footer {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--space-6);
  padding: var(--space-5) clamp(var(--space-5), 4vw, var(--space-10));
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--white-600);
  background: var(--black-1000);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

footer p { margin: 0; }
footer p:last-child { text-align: right; }
footer a { transition: color var(--duration-base); }

footer .social-link {
  color: inherit;
}

.social-link a {
  color: var(--white-100);
  font-weight: 500;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes vfat-loader {
  0%, 100% { content: "[....]"; }
  20% { content: "[=...]"; }
  40% { content: "[.=..]"; }
  60% { content: "[..=.]"; }
  80% { content: "[...=]"; }
}

@keyframes glitch-base {
  0%, 87%, 91%, 100% { transform: translate(0); filter: none; }
  88% { transform: translate(-2px, 1px); filter: brightness(1.5); }
  89% { transform: translate(3px, -1px); }
  90% { transform: translate(-1px, 0); }
}

@keyframes glitch-top {
  0%, 84%, 87%, 100% { opacity: 0; clip-path: inset(0 0 100% 0); }
  85% { opacity: 0.72; clip-path: inset(8% 0 58% 0); }
  86% { opacity: 0.48; clip-path: inset(64% 0 10% 0); }
}

@keyframes glitch-bottom {
  0%, 84%, 87%, 100% { opacity: 0; clip-path: inset(100% 0 0 0); }
  85% { opacity: 0.65; clip-path: inset(54% 0 12% 0); }
  86% { opacity: 0.45; clip-path: inset(18% 0 62% 0); }
}

@keyframes loading-dots {
  0%, 24% { content: "."; }
  25%, 49% { content: ".."; }
  50%, 74% { content: "..."; }
  75%, 100% { content: ""; }
}

@media (max-width: 768px) {
  .site-header { padding: var(--space-6) var(--space-5); }
  .hero { align-items: center; padding: 112px var(--space-5) 180px; }
  footer { grid-template-columns: 1fr; justify-items: center; font-size: 0.875rem; text-align: center; }
  footer p:last-child { text-align: center; }
}

@media (max-width: 480px) {
  .header-status { gap: var(--space-1); }
  .status-label { display: none; }
  .brand img { width: 60px; height: 60px; }
  .hero { padding: 92px var(--space-4) 148px; }
  .glitch { max-width: 16ch; line-height: 1.25; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .ascii-loader::before { content: "[=...]"; }
  .loading-dots::after { content: "..."; }
}
