/* blong.io portal — an arcade lineup in a dark room.
   Palette: deep indigo void, violet housing light, plasma-teal signal.
   No webfonts, no external requests. */

:root {
  --void: #06041c;
  --deep: #0f0930;
  --violet: #8a2fff;
  --violet-dim: #4a1f9e;
  --plasma: #35f0d8;
  --haze: #b3a9dd;
  --white: #f4f1ff;
  --edge: rgba(160, 130, 255, 0.18);
  --screen: #05030f;

  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --shell: min(1160px, 100% - 2.5rem);
  --radius: 18px;

  color-scheme: dark;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--void);
  color: var(--white);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p { margin: 0; }

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--plasma);
  outline-offset: 3px;
  border-radius: 4px;
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 20;
  padding: 0.9rem 1.25rem;
  background: var(--plasma);
  color: #04121a;
  font-weight: 700;
  text-decoration: none;
}

.skip:focus { left: 0; }

/* --- atmosphere ---------------------------------------------------------- */

#sky {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
}

.veil {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(90% 60% at 50% -8%, rgba(138, 47, 255, 0.34) 0%, rgba(138, 47, 255, 0) 62%),
    radial-gradient(60% 40% at 82% 12%, rgba(53, 240, 216, 0.1) 0%, rgba(53, 240, 216, 0) 70%),
    linear-gradient(180deg, rgba(6, 4, 28, 0) 45%, rgba(6, 4, 28, 0.86) 88%, var(--void) 100%);
}

.hero, .lineup, .footer { position: relative; z-index: 2; }

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

.hero {
  width: var(--shell);
  margin: 0 auto;
  min-height: 92svh;
  padding: clamp(3rem, 12vh, 7rem) 0 clamp(2.5rem, 8vh, 5rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: clamp(1.1rem, 3vh, 1.9rem);
}

.hero-eyebrow {
  color: var(--haze);
  opacity: 0.85;
  margin: 0;
  animation: fade-up 0.7s 0.05s both;
}

.wordmark {
  margin: 0;
  font-size: clamp(3.4rem, 19vw, 10.5rem);
  font-weight: 900;
  letter-spacing: -0.045em;
  line-height: 0.92;
  white-space: nowrap;
  text-shadow: 0 0 60px rgba(138, 47, 255, 0.45);
}

.wm-l,
.wm-ring,
.wm-dot {
  display: inline-block;
  animation: letter-in 0.62s cubic-bezier(0.16, 0.84, 0.3, 1) both;
  animation-delay: calc(var(--i) * 55ms + 120ms);
}

.wm-ring {
  width: 0.63em;
  height: 0.72em;
  margin: 0 0.055em 0 0.02em;
  border: 0.155em solid var(--white);
  border-radius: 50%;
  position: relative;
  box-shadow:
    0 0 0 0.02em rgba(53, 240, 216, 0.5),
    0 0 34px rgba(138, 47, 255, 0.75),
    inset 0 0 18px rgba(138, 47, 255, 0.55);
}

.wm-ring::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 0.12em;
  height: 0.12em;
  border-radius: 50%;
  background: var(--plasma);
  box-shadow: 0 0 14px var(--plasma);
  animation: core-pulse 3.4s ease-in-out infinite;
}

.wm-dot {
  width: 0.13em;
  height: 0.13em;
  margin: 0 0.03em 0 0.06em;
  background: var(--plasma);
  vertical-align: baseline;
  box-shadow: 0 0 16px rgba(53, 240, 216, 0.8);
}

.wm-suffix {
  font-size: 0.36em;
  letter-spacing: 0.02em;
  color: var(--plasma);
  vertical-align: baseline;
  text-shadow: 0 0 26px rgba(53, 240, 216, 0.55);
}

.hero-tagline {
  font-size: clamp(1.05rem, 3.4vw, 1.55rem);
  font-weight: 500;
  color: var(--haze);
  max-width: 24ch;
  letter-spacing: -0.005em;
  animation: fade-up 0.7s 0.55s both;
}

.hero-tagline span { white-space: nowrap; }

.accentuate {
  color: var(--white);
  font-weight: 700;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  animation: fade-up 0.7s 0.68s both;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 52px;
  padding: 0 1.6rem;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

.btn-primary {
  background: var(--plasma);
  color: #04121a;
  box-shadow: 0 10px 40px -12px rgba(53, 240, 216, 0.9);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 46px -12px rgba(53, 240, 216, 1);
}

.btn-glyph {
  width: 0;
  height: 0;
  border-left: 11px solid currentColor;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
}

.btn-ghost {
  border: 1px solid var(--edge);
  color: var(--white);
  background: rgba(20, 11, 51, 0.5);
  backdrop-filter: blur(6px);
}

.btn-ghost:hover {
  border-color: rgba(138, 47, 255, 0.75);
  background: rgba(35, 18, 84, 0.66);
  transform: translateY(-2px);
}

.hero-status {
  margin: 0;
  color: var(--haze);
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  animation: fade-up 0.6s both;
}

.hero-status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--plasma);
  box-shadow: 0 0 12px var(--plasma);
  animation: breathe 2.6s ease-in-out infinite;
}

.hero-status[data-state="degraded"]::before {
  background: #e8b06a;
  box-shadow: 0 0 12px #e8b06a;
}

/* --- lineup -------------------------------------------------------------- */

.lineup {
  width: var(--shell);
  margin: 0 auto;
  padding: clamp(1rem, 4vh, 2.5rem) 0 clamp(3rem, 10vh, 6rem);
}

.lineup-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 1rem;
  padding-bottom: 1.1rem;
  margin-bottom: 1.6rem;
  border-bottom: 1px solid var(--edge);
}

.section-title {
  font-size: clamp(1.5rem, 4.5vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.section-note {
  color: var(--haze);
  font-size: 0.95rem;
}

.grid {
  display: grid;
  gap: 1.1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr));
}

.grid-loading {
  color: var(--haze);
  opacity: 0.6;
  grid-column: 1 / -1;
  padding: 2rem 0;
}

/* --- cabinets ------------------------------------------------------------ */

.cab {
  --accent: var(--violet);
  position: relative;
  border-radius: var(--radius);
  border: 1px solid var(--edge);
  background: linear-gradient(180deg, rgba(28, 16, 68, 0.92) 0%, rgba(12, 7, 36, 0.94) 100%);
  overflow: hidden;
  isolation: isolate;
  animation: deal-in 0.6s cubic-bezier(0.16, 0.84, 0.3, 1) both;
  animation-delay: calc(var(--n) * 90ms);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.cab::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.75;
  z-index: 3;
}

.cab-hit {
  display: block;
  text-decoration: none;
  color: inherit;
}

.cab:not(.is-locked):hover,
.cab:not(.is-locked):focus-within,
.cab.is-awake {
  transform: translateY(-5px);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: 0 22px 50px -26px var(--accent), 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent);
}

.screen {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--screen);
  overflow: hidden;
}

.screen canvas {
  display: block;
  width: 100%;
  height: 100%;
  filter: saturate(0.94) brightness(0.88);
  transition: filter 0.3s ease;
}

.cab:hover .screen canvas,
.cab:focus-within .screen canvas,
.cab.is-awake .screen canvas {
  filter: saturate(1.08) brightness(1.06);
}

.screen::after {
  /* glass: corner glare + scanlines, drawn in CSS so the canvas stays clean */
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.13) 0%, rgba(255, 255, 255, 0) 38%),
    repeating-linear-gradient(180deg, rgba(0, 0, 0, 0.26) 0 1px, rgba(0, 0, 0, 0) 1px 3px);
  mix-blend-mode: overlay;
}

.plate {
  padding: 0.95rem 1.05rem 1.05rem;
  display: grid;
  gap: 0.3rem;
}

.plate-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.cab-name {
  font-size: 1.18rem;
  font-weight: 800;
  letter-spacing: -0.015em;
}

.cab-tagline {
  color: var(--haze);
  font-size: 0.92rem;
}

.badge {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 0.3rem 0.55rem 0.28rem;
  border-radius: 999px;
  white-space: nowrap;
  border: 1px solid transparent;
}

.badge-new {
  background: var(--accent);
  color: #16091f;
  font-weight: 700;
  animation: badge-pulse 2s ease-in-out infinite;
}

.badge-live {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.badge-live::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.badge-soon {
  border-color: var(--edge);
  color: var(--haze);
}

.cab-go {
  margin-top: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 24px;
}

.cab-go::after {
  content: "→";
  transition: transform 0.2s ease;
}

.cab:hover .cab-go::after,
.cab:focus-within .cab-go::after,
.cab.is-awake .cab-go::after {
  transform: translateX(4px);
}

.cab.is-locked { opacity: 0.72; }
.cab.is-locked .cab-go { color: var(--haze); }
.cab.is-locked .cab-go::after { content: ""; }
.cab.is-locked .screen canvas { filter: saturate(0.5) brightness(0.7); }

.cab.is-cold .cab-go { color: #e8b06a; }

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

.footer {
  width: var(--shell);
  margin: 0 auto;
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--edge);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
}

.footer-line {
  color: var(--haze);
  font-size: 0.95rem;
}

.footer-line strong { color: var(--white); }

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.85rem;
  color: var(--haze);
  font-size: 0.9rem;
  text-decoration: none;
  border-radius: 8px;
}

.footer-links a:hover {
  color: var(--white);
  background: rgba(138, 47, 255, 0.14);
}

.footer-mark {
  color: var(--violet);
  opacity: 0.65;
  flex-basis: 100%;
}

/* --- motion -------------------------------------------------------------- */

@keyframes letter-in {
  from { opacity: 0; transform: translateY(0.28em) scale(0.94); filter: blur(6px); }
  to { opacity: 1; transform: none; filter: none; }
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

@keyframes deal-in {
  from { opacity: 0; transform: translateY(20px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

@keyframes badge-pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); }
  50% { box-shadow: 0 0 0 7px rgba(232, 176, 106, 0); }
}

@keyframes core-pulse {
  0%, 100% { opacity: 0.55; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.15); }
}

@keyframes breathe {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

@media (max-width: 560px) {
  :root { --shell: min(1160px, 100% - 1.75rem); }
  .hero { min-height: 80svh; text-align: center; }
  .footer { justify-content: flex-start; }
  .footer-links { margin-left: -0.85rem; }
}

@media (hover: none) {
  /* Touch: the wake state is driven by JS on tap/scroll, hover never sticks. */
  .cab:hover { transform: none; }
}

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