/* Game Break — Arcade Break Room */

:root {
  --bg: #0a0e17;
  --bg-elevated: #111827;
  --cyan: #00f0ff;
  --magenta: #ff006e;
  --lime: #c8ff00;
  --text: #e8edf5;
  --text-muted: #7a8499;
  --border: rgba(0, 240, 255, 0.25);
  --font-display: "Syne", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100dvh;
  font-family: var(--font-mono);
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* Atmospheric layers */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 128px 128px;
}

.glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
}

.glow--cyan {
  width: 50vw;
  height: 50vw;
  max-width: 600px;
  max-height: 600px;
  top: -10%;
  left: -10%;
  background: rgba(0, 240, 255, 0.12);
}

.glow--magenta {
  width: 40vw;
  height: 40vw;
  max-width: 500px;
  max-height: 500px;
  bottom: -5%;
  right: -5%;
  background: rgba(255, 0, 110, 0.1);
}

/* Header */
.header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem clamp(1.25rem, 4vw, 3rem);
  animation: fadeDown 0.8s var(--ease-out) both;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo__mark {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.75rem;
  letter-spacing: -0.02em;
  color: var(--bg);
  background: linear-gradient(135deg, var(--cyan), var(--magenta));
  clip-path: polygon(0 0, 100% 0, 100% 70%, 85% 100%, 0 100%);
}

.logo__text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  border: 1px solid var(--border);
  background: rgba(17, 24, 39, 0.6);
  backdrop-filter: blur(8px);
}

.status-pill__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--lime);
  animation: pulse 2s ease-in-out infinite;
}

/* Hero layout */
.hero {
  position: relative;
  z-index: 5;
  flex: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: center;
  padding: 1rem clamp(1.25rem, 4vw, 3rem) 3rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

@media (min-width: 900px) {
  .hero {
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    padding-top: 2rem;
  }
}

.hero__copy {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.eyebrow {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--cyan);
  animation: fadeUp 0.7s var(--ease-out) 0.1s both;
}

.title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
}

.title__line {
  display: block;
}

.title__line--1 {
  animation: fadeUp 0.7s var(--ease-out) 0.2s both;
}

.title__line--2 {
  animation: fadeUp 0.7s var(--ease-out) 0.35s both;
  color: var(--text-muted);
}

.title__line--3 {
  animation: fadeUp 0.7s var(--ease-out) 0.5s both;
  background: linear-gradient(90deg, var(--cyan), var(--magenta));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  max-width: 42ch;
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--text-muted);
  animation: fadeUp 0.7s var(--ease-out) 0.65s both;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  animation: fadeUp 0.7s var(--ease-out) 0.8s both;
}

.badge {
  display: inline-flex;
  padding: 0.5rem 1rem;
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--bg);
  background: var(--cyan);
}

.badge--ghost {
  color: var(--text-muted);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Webcam frame */
.hero__visual {
  animation: fadeUp 0.9s var(--ease-out) 0.4s both;
  transform-style: preserve-3d;
  perspective: 800px;
}

.frame {
  position: relative;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 1rem;
  box-shadow:
    0 0 0 1px rgba(0, 240, 255, 0.05),
    0 24px 80px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.frame__corner {
  position: absolute;
  width: 20px;
  height: 20px;
  border-color: var(--cyan);
  border-style: solid;
}

.frame__corner--tl { top: -1px; left: -1px; border-width: 2px 0 0 2px; }
.frame__corner--tr { top: -1px; right: -1px; border-width: 2px 2px 0 0; }
.frame__corner--bl { bottom: -1px; left: -1px; border-width: 0 0 2px 2px; }
.frame__corner--br { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; }

.frame__hud {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
}

.frame__hud-item--live {
  color: var(--magenta);
  animation: blink 1.5s step-end infinite;
}

.frame__viewport {
  position: relative;
  aspect-ratio: 4 / 5;
  background:
    radial-gradient(ellipse at 50% 80%, rgba(0, 240, 255, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 30% 20%, rgba(255, 0, 110, 0.06) 0%, transparent 50%),
    linear-gradient(180deg, #0d1220 0%, #080c14 100%);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.frame__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 240, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}

.scanline {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.15) 2px,
    rgba(0, 0, 0, 0.15) 4px
  );
  pointer-events: none;
  z-index: 2;
}

.scanline::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  opacity: 0.4;
  animation: scanMove 3s linear infinite;
}

.frame__overlay-text {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  right: 1rem;
  display: flex;
  justify-content: space-between;
  font-size: 0.55rem;
  letter-spacing: 0.2em;
  color: rgba(0, 240, 255, 0.5);
  z-index: 3;
}

.frame__footer {
  display: flex;
  justify-content: space-between;
  margin-top: 0.75rem;
  font-size: 0.6rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

.frame__footer em {
  font-style: normal;
  color: var(--cyan);
}

/* Hand skeleton SVG */
.hand-skeleton {
  width: 55%;
  max-width: 220px;
  height: auto;
  z-index: 1;
  filter: drop-shadow(0 0 12px rgba(0, 240, 255, 0.3));
  animation: handFloat 4s ease-in-out infinite;
}

.bone {
  stroke: var(--cyan);
  stroke-width: 2;
  stroke-linecap: round;
  fill: none;
  stroke-dasharray: 200;
  stroke-dashoffset: 200;
  animation: drawBone 2s var(--ease-out) forwards;
}

.bone--palm { animation-delay: 0.2s; stroke: rgba(0, 240, 255, 0.5); }
.bone--thumb { animation-delay: 0.5s; stroke: var(--magenta); }
.bone--index { animation-delay: 0.7s; }
.bone--middle { animation-delay: 0.9s; }
.bone--ring { animation-delay: 1.1s; }
.bone--pinky { animation-delay: 1.3s; stroke: var(--magenta); }

.joint {
  fill: var(--cyan);
  opacity: 0;
  animation: jointPop 0.4s var(--ease-out) forwards;
}

.joint--wrist {
  fill: var(--lime);
  animation-delay: 0.1s;
}

.joint--tip {
  fill: var(--magenta);
}

.bone--thumb + .joint,
.bone--thumb ~ .joint:nth-of-type(2) { animation-delay: 0.6s; }
.bone--index ~ .joint { animation-delay: 0.8s; }

.hand-skeleton .joint:nth-child(8) { animation-delay: 0.55s; }
.hand-skeleton .joint:nth-child(9) { animation-delay: 0.65s; }
.hand-skeleton .joint:nth-child(10) { animation-delay: 0.75s; }
.hand-skeleton .joint:nth-child(13) { animation-delay: 0.85s; }
.hand-skeleton .joint:nth-child(14) { animation-delay: 0.95s; }
.hand-skeleton .joint:nth-child(15) { animation-delay: 1.05s; }
.hand-skeleton .joint:nth-child(18) { animation-delay: 1.0s; }
.hand-skeleton .joint:nth-child(19) { animation-delay: 1.1s; }
.hand-skeleton .joint:nth-child(20) { animation-delay: 1.2s; }
.hand-skeleton .joint:nth-child(23) { animation-delay: 1.15s; }
.hand-skeleton .joint:nth-child(24) { animation-delay: 1.25s; }
.hand-skeleton .joint:nth-child(25) { animation-delay: 1.35s; }
.hand-skeleton .joint:nth-child(28) { animation-delay: 1.3s; }
.hand-skeleton .joint:nth-child(29) { animation-delay: 1.4s; }
.hand-skeleton .joint:nth-child(30) { animation-delay: 1.5s; }

/* Footer */
.footer {
  position: relative;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 1.5rem clamp(1.25rem, 4vw, 3rem);
  font-size: 0.65rem;
  color: var(--text-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  animation: fadeUp 0.7s var(--ease-out) 1s both;
}

.footer__mono {
  letter-spacing: 0.1em;
  color: rgba(0, 240, 255, 0.4);
}

/* Animations */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeDown {
  from {
    opacity: 0;
    transform: translateY(-16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

@keyframes scanMove {
  0% { top: -3px; }
  100% { top: 100%; }
}

@keyframes handFloat {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-8px) rotate(2deg); }
}

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

@keyframes jointPop {
  from {
    opacity: 0;
    transform: scale(0);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

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

  .hand-skeleton {
    animation: none;
  }

  .bone {
    stroke-dashoffset: 0;
  }

  .joint {
    opacity: 1;
  }
}
