:root {
  --bg: #08090c;
  --bg-elevated: #0e1117;
  --border: rgba(255, 255, 255, 0.09);
  --border-hover: rgba(157, 180, 192, 0.38);
  --text: #e6e9ef;
  --text-muted: #8a93a2;
  --text-dim: #555e6d;
  --accent: #9db4c0;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --radius: 12px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html,
body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

/* ===========================
   ENTRY GATE
   =========================== */
.entry-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #060709;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: opacity 0.75s var(--ease), visibility 0.75s var(--ease);
}

.entry-gate.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.entry-inner {
  text-align: center;
  padding: 2rem;
}

.entry-prompt {
  font-family: var(--mono);
  font-size: clamp(0.95rem, 2vw, 1.12rem);
  letter-spacing: 0.14em;
  color: var(--text);
  animation: pulsePrompt 2.6s ease-in-out infinite;
}

.entry-sub {
  display: inline-block;
  margin-top: 0.85rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--text-dim);
}

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

/* ===========================
   VIDEO BACKDROP + OVERLAY
   =========================== */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.bg-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.75);
}

.bg-scrim {
  position: absolute;
  inset: 0;
  background: rgba(5, 7, 10, 0.74);
}

/* ===========================
   GAME CANVAS
   =========================== */
#game-canvas {
  position: fixed;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* ===========================
   MINIMAL HUD
   =========================== */
.hud-top {
  position: fixed;
  top: 1.25rem;
  left: 1.5rem;
  right: 1.5rem;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  pointer-events: none;
}

.hud-left,
.hud-actions {
  pointer-events: auto;
}

.hud-left {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.85rem;
}

.hud-info {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}

.hud-brand {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}

.hud-avatar {
  width: 79px;
  height: 79px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid var(--border-hover);
  background: var(--bg-elevated);
  flex-shrink: 0;
}

.hud-title {
  font-family: var(--mono);
  font-size: 1rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

.hud-bio {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--text-dim);
}

.cursor {
  color: var(--accent);
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.hud-stats {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--accent);
}

.hud-sep {
  color: var(--text-dim);
}

.hud-hint {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-dim);
}

.hud-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.hud-btn {
  font-family: var(--mono);
  font-size: 0.73rem;
  color: var(--text-muted);
  background: rgba(12, 14, 19, 0.75);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.42rem 0.85rem;
  backdrop-filter: blur(10px);
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.hud-btn:hover {
  color: var(--text);
  border-color: var(--border-hover);
  background: rgba(157, 180, 192, 0.1);
}

/* Direct 1-Click Socials Dock */
.quick-socials {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.7rem;
  background: rgba(12, 14, 19, 0.78);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.quick-link {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.quick-link:hover {
  color: var(--text);
  background: rgba(157, 180, 192, 0.12);
}

/* Interact Pill */
.interact-pill {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  z-index: 25;
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--text);
  background: rgba(12, 14, 19, 0.88);
  border: 1px solid var(--border-hover);
  border-radius: 999px;
  padding: 0.48rem 1rem;
  backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  transition: opacity 0.2s ease, transform 0.2s var(--ease);
}

.interact-pill.visible {
  opacity: 1;
  pointer-events: auto;
  cursor: pointer;
  transform: translateX(-50%) translateY(0);
}

/* ===========================
   RAIN AUDIO PLAYER
   =========================== */
.rain-player {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.85rem;
  background: rgba(12, 14, 19, 0.78);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: border-color 0.25s ease;
}

.rain-player:hover {
  border-color: var(--border-hover);
}

.audio-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--mono);
  font-size: 0.73rem;
  color: var(--text-muted);
}

.audio-btn:hover {
  color: var(--text);
}

.eq-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
}

.eq-bars span {
  width: 2px;
  height: 4px;
  background: var(--accent);
  border-radius: 2px;
}

.rain-player.playing .eq-bars span:nth-child(1) { animation: eq 0.9s ease-in-out infinite alternate; }
.rain-player.playing .eq-bars span:nth-child(2) { animation: eq 0.65s ease-in-out 0.2s infinite alternate; }
.rain-player.playing .eq-bars span:nth-child(3) { animation: eq 1.1s ease-in-out 0.4s infinite alternate; }

@keyframes eq {
  from { height: 3px; }
  to { height: 12px; }
}

.volume-wrap {
  display: flex;
  align-items: center;
  padding-left: 0.35rem;
  border-left: 1px solid var(--border);
}

#volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 58px;
  height: 2px;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  outline: none;
  cursor: pointer;
}

#volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}

#volume-slider::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}

/* ===========================
   MODALS
   =========================== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(4, 5, 8, 0.8);
  backdrop-filter: blur(10px);
  display: grid;
  place-items: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal.open {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  position: relative;
  width: min(540px, 100%);
  max-height: 86vh;
  overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  user-select: text;
}

.modal-wide {
  width: min(860px, 100%);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1.15rem;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-muted);
}

.modal-close:hover {
  color: var(--text);
}

.modal-tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

.modal-heading {
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  margin-bottom: 0.85rem;
}

.modal-bio {
  font-size: 0.94rem;
  font-weight: 300;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* Cat Modal */
.cat-modal-card {
  width: min(440px, 100%);
  padding: 1.25rem;
}

.cat-modal-img-wrap {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #080a0e;
}

.cat-modal-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cat-modal-footer {
  margin-top: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
}

.cat-modal-info h2 {
  font-family: var(--mono);
  font-size: 1.15rem;
  font-weight: 400;
}

.cat-modal-info p {
  margin-top: 0.25rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.cat-modal-nav {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}

/* Socials */
.socials {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.9rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.social-link svg {
  width: 15px;
  height: 15px;
}

.social-link:hover {
  color: var(--text);
  border-color: var(--border-hover);
  background: rgba(157, 180, 192, 0.08);
}

/* PC Modal Grid */
.pc-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(240px, 0.9fr);
  gap: 1.75rem;
  margin-top: 0.5rem;
}

.projects-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
}

.project-row {
  display: grid;
  grid-template-columns: 2rem 1fr auto;
  gap: 0.9rem;
  align-items: start;
  padding: 1rem 0.4rem;
  border-bottom: 1px solid var(--border);
  transition: background-color 0.2s ease;
}

.project-row:hover {
  background: rgba(255, 255, 255, 0.02);
}

.project-num {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  padding-top: 0.2rem;
}

.project-top {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.project-top h3 {
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 400;
}

.project-row:hover .project-top h3 {
  color: var(--accent);
}

.status {
  font-family: var(--mono);
  font-size: 0.62rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-dim);
}

.status.active {
  color: #9ec5ab;
  border-color: rgba(158, 197, 171, 0.3);
}

.project-body p {
  margin-top: 0.3rem;
  font-size: 0.84rem;
  color: var(--text-muted);
  font-weight: 300;
}

.project-arrow {
  font-family: var(--mono);
  color: var(--text-dim);
}

.workspace-panel {
  padding: 1.15rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  align-self: start;
}

.workspace-header {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.workspace-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.workspace-header h3 {
  font-family: var(--mono);
  font-size: 0.86rem;
  font-weight: 400;
}

.workspace-tag {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.64rem;
  color: var(--text-dim);
  border: 1px solid var(--border);
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
}

.spec-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.spec-item {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
}

.spec-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.spec-item dt {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-dim);
}

.spec-item dd {
  font-family: var(--mono);
  font-size: 0.73rem;
  color: var(--text-muted);
  text-align: right;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 800;
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--text);
  background: rgba(16, 19, 25, 0.92);
  border: 1px solid var(--border-hover);
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s var(--ease);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 720px) {
  .pc-grid {
    grid-template-columns: 1fr;
  }

  .hud-top {
    top: 0.85rem;
    left: 0.85rem;
    right: 0.85rem;
    flex-direction: column;
    gap: 0.55rem;
  }

  .hud-hint,
  .hud-bio {
    display: none;
  }

  .hud-avatar {
    width: 55px;
    height: 55px;
    border-radius: 999px;
  }

  .hud-btn {
    font-size: 0.68rem;
    padding: 0.35rem 0.7rem;
  }

  .rain-player {
    bottom: 0.85rem;
    left: 0.85rem;
    padding: 0.42rem 0.75rem;
  }

  .volume-wrap {
    display: none;
  }

  .quick-socials {
    bottom: 0.85rem;
    right: 0.85rem;
    gap: 0.15rem;
    padding: 0.35rem 0.5rem;
  }

  .quick-link {
    font-size: 0.68rem;
    padding: 0.2rem 0.42rem;
  }

  .interact-pill {
    bottom: 4.1rem;
    font-size: 0.72rem;
    padding: 0.45rem 0.9rem;
  }

  .modal-card {
    padding: 1.25rem;
  }
}
