:root {
  --bg: #07080c;
  --bg-2: #0b0e14;
  --panel: rgba(255, 255, 255, 0.062);
  --panel-strong: rgba(255, 255, 255, 0.095);
  --border: rgba(255, 255, 255, 0.125);
  --text: #ffffff;
  --muted: #abb4c3;
  --soft: #788292;
  --accent: #d6b36a;
  --accent-2: #f4e0b0;
  --blue: #8ad7ff;
  --green: #91f5c7;
  --danger: #ff7a7a;
  --shadow: 0 26px 90px rgba(0, 0, 0, 0.52);
  --max: 1120px;
  --hud-h: 56px;
  --controls-h: 118px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: #050507;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html, body, #app {
  height: 100%;
  height: 100dvh;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  overflow: hidden;
}

body.allow-scroll {
  height: auto;
  min-height: 100dvh;
  overflow: auto;
}

body.allow-scroll #app {
  height: auto;
  min-height: 100dvh;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

.screen {
  display: none;
  position: relative;
}

.screen.active {
  display: block;
}

.screen-fixed {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 850;
  cursor: pointer;
  background: none;
  font-family: inherit;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.button-primary {
  color: #15110a;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: rgba(244, 224, 176, 0.52);
}

.button-secondary {
  color: var(--accent-2);
  background: rgba(214, 179, 106, 0.09);
  border-color: rgba(214, 179, 106, 0.3);
}

.button-ghost {
  color: #dfe7f3;
  background: rgba(255, 255, 255, 0.058);
  border-color: rgba(255, 255, 255, 0.13);
}

.button:hover { transform: translateY(-2px); }
.button:active { transform: translateY(0); }
.button:disabled { opacity: 0.45; transform: none; cursor: default; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 34px;
  padding: 8px 13px;
  margin-bottom: 18px;
  border: 1px solid rgba(214, 179, 106, 0.28);
  border-radius: 999px;
  color: var(--accent-2);
  background: rgba(214, 179, 106, 0.09);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Title */
.title-screen {
  background:
    radial-gradient(circle at top left, rgba(214, 179, 106, 0.18), transparent 30%),
    radial-gradient(circle at 78% 14%, rgba(138, 215, 255, 0.13), transparent 28%),
    linear-gradient(180deg, #07080c 0%, #090c12 48%, #050507 100%);
  color: var(--text);
}

.title-stars {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.title-inner {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 28px 20px calc(28px + env(safe-area-inset-bottom));
  max-width: min(640px, 100%);
  margin: 0 auto;
  overflow-x: hidden;
  overflow-y: auto;
}

.title-brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 22px;
}

.title-brand strong {
  font-family: Orbitron, Inter, sans-serif;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 13px;
  color: #7cf0ff;
  text-shadow: 0 0 16px rgba(124, 240, 255, 0.35);
}

.title-brand span {
  color: var(--soft);
  font-size: 13px;
}

.title-screen h1 {
  margin: 0 0 14px;
  font-family: Orbitron, Inter, sans-serif;
  font-size: clamp(30px, 8vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.04em;
  overflow-wrap: anywhere;
}

.title-copy {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: clamp(15px, 3.4vw, 19px);
  line-height: 1.55;
  max-width: 34em;
  overflow-wrap: anywhere;
}

.title-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 22px;
}

.title-actions .button {
  width: 100%;
  min-height: 52px;
  font-size: 16px;
}

.unlock-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.unlock-chip {
  display: none;
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.unlock-chip.ready { display: inline-flex; align-items: center; }

.mission-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--soft);
  font-size: 13px;
}

.mission-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.mission-list b { color: #fff; font-weight: 750; }

.title-foot {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--soft);
  font-size: 13px;
}

.title-foot a:hover { color: var(--accent-2); }

/* Game */
.game-screen {
  display: none;
  background: #050018;
  color: #fff;
  flex-direction: column;
}

.game-screen.active {
  display: flex;
}

.hud {
  flex: 0 0 auto;
  min-height: var(--hud-h);
  padding: 8px 12px calc(8px);
  padding-top: calc(8px + env(safe-area-inset-top));
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  background: linear-gradient(180deg, rgba(8, 12, 32, 0.96), rgba(12, 8, 28, 0.9));
  border-bottom: 1px solid rgba(124, 240, 255, 0.18);
  font-family: Orbitron, Inter, sans-serif;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
}

.hud-left, .hud-right {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.hud-right { justify-content: flex-end; }

.hud-score b, .hud-lives b, .hud-level b, .hud-bombs b {
  color: var(--accent-2);
  font-weight: 850;
}

.hud-rapid {
  display: none;
  color: #8ad7ff;
}

.hud-rapid.is-on {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.hud-rapid b {
  color: #c8f4ff;
  font-weight: 850;
}

.hud-center {
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #7cf0ff;
  text-shadow: 0 0 12px rgba(124, 240, 255, 0.45);
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  cursor: pointer;
  font-size: 16px;
}

.stage-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  background: #050018;
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.game-callout {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  z-index: 4;
  max-width: calc(100% - 24px);
  padding: 10px 16px;
  border-radius: 14px;
  border: 1px solid rgba(124, 240, 255, 0.4);
  background: rgba(8, 16, 36, 0.88);
  color: #e7fbff;
  font-family: Orbitron, Inter, sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.game-callout.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.game-callout.is-rapid {
  border-color: rgba(92, 225, 255, 0.7);
  color: #9af7ff;
  box-shadow: 0 0 22px rgba(92, 225, 255, 0.28);
}

.game-callout.is-bomb,
.game-callout.is-saucer {
  border-color: rgba(255, 154, 61, 0.7);
  color: #ffe0c2;
  box-shadow: 0 0 22px rgba(255, 154, 61, 0.28);
}

.game-callout.is-streak {
  border-color: rgba(214, 179, 106, 0.7);
  color: #f4e0b0;
}

.game-callout.is-warn {
  border-color: rgba(255, 61, 127, 0.7);
  color: #ffd0e6;
}

.game-overlay {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(5, 5, 7, 0.72);
  z-index: 3;
}

.game-overlay.show { display: flex; }

.overlay-card {
  width: min(420px, 100%);
  padding: 26px 22px;
  border-radius: 24px;
  border: 1px solid rgba(214, 179, 106, 0.28);
  background:
    radial-gradient(circle at 20% 0%, rgba(214, 179, 106, 0.16), transparent 40%),
    rgba(12, 14, 20, 0.96);
  box-shadow: var(--shadow);
  text-align: center;
}

.overlay-card h2 {
  margin: 0 0 10px;
  font-size: clamp(28px, 8vw, 42px);
  letter-spacing: -0.04em;
}

.overlay-card p {
  margin: 0 0 20px;
  color: var(--muted);
  line-height: 1.55;
}

.overlay-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.overlay-actions .button { width: 100%; min-height: 48px; }

.controls {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr 1.3fr 1fr;
  gap: 8px;
  padding: 10px 12px calc(12px + env(safe-area-inset-bottom));
  background: #08090d;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.ctrl {
  min-height: 72px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.08em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.ctrl:active, .ctrl.is-down {
  background: rgba(214, 179, 106, 0.22);
  border-color: rgba(244, 224, 176, 0.5);
}

.ctrl-bomb {
  background: linear-gradient(180deg, rgba(255, 138, 61, 0.7), rgba(180, 40, 80, 0.28));
  color: #fff6d6;
  font-size: 15px;
  box-shadow: 0 0 18px rgba(255, 120, 80, 0.25);
}

.ctrl-bomb.is-empty {
  opacity: 0.38;
}

.ctrl-bomb.has-charge {
  animation: bomb-pulse 1.1s ease-in-out infinite;
}

@keyframes bomb-pulse {
  0%, 100% { box-shadow: 0 0 12px rgba(255, 120, 80, 0.25); }
  50% { box-shadow: 0 0 22px rgba(255, 180, 80, 0.55); }
}

@media (min-width: 820px) {
  .controls { display: none; }
  .title-actions { flex-direction: row; }
  .title-actions .button { width: auto; min-width: 180px; }
}

/* Content screens */
.page-screen {
  background:
    radial-gradient(circle at top left, rgba(214, 179, 106, 0.18), transparent 30%),
    radial-gradient(circle at 78% 14%, rgba(138, 215, 255, 0.13), transparent 28%),
    linear-gradient(180deg, #07080c 0%, #090c12 48%, #050507 100%);
}

.page-screen::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.026) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.82), transparent 74%);
}

.nav {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(7, 8, 12, 0.84);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px 18px;
  padding-top: calc(14px + env(safe-area-inset-top));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand {
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
}

.brand strong {
  font-size: 14px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.brand span { color: var(--soft); font-size: 12px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-links a, .nav-links button {
  color: var(--muted);
  font-size: 13px;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}

.nav-links a:hover, .nav-links button:hover { color: var(--accent-2); }

.nav-links .locked { opacity: 0.35; pointer-events: none; }
.nav-links a.locked[data-requires="contact"] { display: none; }

main.content {
  position: relative;
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px 16px 64px;
}

.hero, .panel, .cta, .project-card, .proof-card, .service-card, .process-card, .contact-panel {
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, var(--panel-strong), rgba(255, 255, 255, 0.035)),
    rgba(255, 255, 255, 0.025);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.27);
}

.hero, .cta, .contact-panel {
  overflow: hidden;
  border-radius: 28px;
  border-color: rgba(214, 179, 106, 0.24);
  background:
    radial-gradient(circle at 16% 14%, rgba(214, 179, 106, 0.18), transparent 31%),
    radial-gradient(circle at 82% 18%, rgba(138, 215, 255, 0.14), transparent 28%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.095), rgba(255, 255, 255, 0.038));
  box-shadow: var(--shadow);
  padding: 28px 22px;
  margin-bottom: 18px;
}

h1, h2 {
  letter-spacing: -0.045em;
}

.content h1 {
  margin: 0 0 14px;
  font-size: clamp(36px, 10vw, 64px);
  line-height: 0.96;
}

.content h2 {
  margin: 0 0 14px;
  font-size: clamp(28px, 6vw, 44px);
  line-height: 1.05;
}

.content p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.content p strong { color: #fff; }

.hero-actions, .cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: 18px;
}

.panel {
  border-radius: 24px;
  padding: 22px;
}

.timeline, .project-proof {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline li, .project-proof li {
  padding: 12px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.timeline strong, .project-proof li {
  color: #dbe2ec;
  font-size: 14px;
}

.timeline span {
  display: block;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.5;
  margin-top: 4px;
}

.skill-cloud, .tech-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}

.tech-item {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.085);
  color: #d8dde6;
  font-size: 12.5px;
}

.proof-grid, .services-grid, .process, .project-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: 18px;
}

.proof-card, .service-card, .process-card {
  padding: 20px;
  border-radius: 22px;
}

.proof-card strong {
  display: block;
  margin-bottom: 8px;
  color: var(--accent-2);
  font-size: 12px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.proof-card p, .service-card p, .process-card p {
  margin: 0;
  color: #dfe6f1;
  font-size: 15px;
}

.project-card {
  overflow: hidden;
  border-radius: 24px;
  display: flex;
  flex-direction: column;
}

.project-media {
  aspect-ratio: 1672 / 941;
  background: #000;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.project-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.project-content { padding: 20px; display: flex; flex-direction: column; flex: 1; }

.project-kicker { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }

.mini-pill {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--accent-2);
  background: rgba(214, 179, 106, 0.08);
  border: 1px solid rgba(214, 179, 106, 0.18);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.project-content h3 {
  margin: 0 0 10px;
  font-size: clamp(26px, 6vw, 36px);
  letter-spacing: -0.04em;
}

.project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
}

.play-badge { display: block; height: 44px; width: auto; }

.footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 22px 16px calc(28px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: var(--soft);
  font-size: 13px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-links { display: flex; flex-wrap: wrap; gap: 14px; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--accent-2); }

.kbd-hint {
  display: none;
  margin-top: 8px;
  color: var(--soft);
  font-size: 12px;
}

@media (min-width: 820px) {
  .kbd-hint { display: block; }
  .content-grid { grid-template-columns: minmax(0, 1fr) minmax(280px, 0.8fr); }
  .proof-grid, .services-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .process { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  main.content { padding: 48px 22px 78px; }
  .hero, .cta, .contact-panel, .panel { padding: 32px; }
  .footer { flex-direction: row; justify-content: space-between; align-items: center; }
}

@media (max-width: 419px) {
  .hud-left, .hud-right { font-size: 10px; }
  .ctrl { min-height: 64px; }
}
