/* ==========================================================================
   Mohammed Hebah — Cyber Playground
   Noir & Gold design system. No external requests (system font stacks).
   ========================================================================== */

:root {
  --bg: #0b0b0b;
  --fg: #f4f2ee;
  --gold: #ccac5a;

  --surface: #1c1c1c;
  --surface-2: #232323;
  --border: rgba(244, 242, 238, 0.14);
  --muted: rgba(244, 242, 238, 0.62);
  --dim: rgba(244, 242, 238, 0.42);
  --danger: #e05a4a;

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

  --shell: 42rem;
  --radius: 0.35rem;
}

body.mh-body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--fg);
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  line-height: 1.6;
}

::selection {
  background: rgba(204, 172, 90, 0.35);
  color: #111;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

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

/* --------------------------------- layout -------------------------------- */

.mh-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.mh-main,
.mh-header,
.mh-footer {
  position: relative;
  z-index: 1;
}

.mh-shell {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
}

.mh-center {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.mh-center-text {
  text-align: center;
}

.mh-left {
  text-align: left;
}

.mh-section {
  padding: 2.5rem 1.25rem;
}

.mh-hero {
  padding-top: 4.5rem;
  padding-bottom: 1rem;
}

/* --------------------------------- header -------------------------------- */

.mh-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  justify-content: center;
  padding: 0.5rem 1rem 0;
}

.mh-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  max-width: var(--shell);
  padding: 0.35rem 0.6rem;
  border: 1px solid transparent;
  border-radius: 999px;
  transition:
    background-color 0.3s ease,
    border-color 0.3s ease;
}

.mh-nav.is-scrolled {
  border-color: var(--border);
  background: rgba(11, 11, 11, 0.85);
  backdrop-filter: blur(10px);
}

.mh-emblem {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  flex: none;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--gold);
  cursor: pointer;
  transition: border-color 0.25s ease;
}

.mh-emblem:hover {
  border-color: rgba(204, 172, 90, 0.6);
}

.mh-emblem .mh-logo,
.mh-emblem img {
  width: 1rem;
  height: 1rem;
  transition: transform 0.3s ease;
}

.mh-emblem:hover .mh-logo {
  transform: rotate(6deg);
}

.mh-nav-list {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mh-nav-list a {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.2s ease;
}

.mh-nav-list a:hover {
  color: var(--gold);
}

/* ------------------------------- typography ------------------------------ */

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

.mh-muted {
  color: var(--muted);
}

.mh-dim {
  color: var(--dim);
}

.mh-gold-text {
  color: var(--gold);
}

.mh-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.mh-eyebrow {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.36em;
  text-transform: uppercase;
  color: var(--gold);
}

.mh-h1 {
  margin: 1rem 0 0;
  font-family: var(--font-mono);
  font-size: clamp(2rem, 8vw, 4rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.mh-h1-sub {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.55em;
  font-weight: 400;
  letter-spacing: 0.18em;
  color: rgba(204, 172, 90, 0.9);
}

.mh-h2 {
  margin: 0.4rem 0 0;
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.01em;
}

.mh-lead {
  margin: 0.9rem 0 0;
  font-size: 1.05rem;
  color: rgba(244, 242, 238, 0.9);
}

.mh-tagline {
  margin-top: 0.5rem;
}

.mh-gold {
  background: linear-gradient(100deg, var(--gold), #efd79a, var(--gold));
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: mh-gold-sweep 9s linear infinite;
}

.mh-hairline {
  display: block;
  width: 5rem;
  height: 1px;
  margin: 1rem auto;
  background: linear-gradient(90deg, transparent, rgba(204, 172, 90, 0.55), transparent);
}

.mh-hairline-wide {
  width: 8rem;
}

.mh-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0.3rem 0.8rem;
  border: 1px solid rgba(204, 172, 90, 0.3);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
}

.mh-dot {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 999px;
  background: var(--gold);
  animation: mh-pulse 2.4s ease-in-out infinite;
}

.mh-caret {
  display: inline-block;
  margin-left: 0.25rem;
  color: var(--gold);
  animation: mh-caret 1.1s step-end infinite;
}

/* --------------------------------- buttons ------------------------------- */

.mh-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.25rem;
}

.mh-btn {
  display: inline-block;
  padding: 0.65rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    color 0.2s ease,
    border-color 0.2s ease,
    background-color 0.2s ease;
}

.mh-btn:hover {
  color: var(--gold);
  border-color: rgba(204, 172, 90, 0.4);
}

.mh-btn-primary {
  border-color: rgba(204, 172, 90, 0.5);
  background: rgba(204, 172, 90, 0.12);
  color: var(--gold);
}

.mh-btn-primary:hover {
  background: rgba(204, 172, 90, 0.22);
}

/* --------------------------------- panels -------------------------------- */

.mh-panel {
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  background: rgba(28, 28, 28, 0.55);
  backdrop-filter: blur(14px) saturate(120%);
  box-shadow: 0 30px 70px -40px rgba(0, 0, 0, 0.95);
}

.mh-terminal {
  margin-top: 1.5rem;
  padding: 1.25rem;
  text-align: left;
}

.mh-terminal-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.52rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--dim);
}

.mh-terminal-path {
  margin-left: 0.5rem;
}

.mh-tl {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
}
.mh-tl-red {
  background: rgba(224, 90, 74, 0.7);
}
.mh-tl-gold {
  background: rgba(204, 172, 90, 0.7);
}
.mh-tl-amber {
  background: rgba(239, 215, 154, 0.6);
}

.mh-meta {
  display: grid;
  gap: 1px;
  margin: 1.25rem 0 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--border);
}

@media (min-width: 640px) {
  .mh-meta {
    grid-template-columns: repeat(3, 1fr);
  }
}

.mh-meta-cell {
  padding: 0.7rem 0.8rem;
  background: rgba(11, 11, 11, 0.9);
}

.mh-meta dt {
  margin: 0;
  font-size: 0.5rem;
}
.mh-meta dd {
  margin: 0.25rem 0 0;
  font-size: 0.72rem;
  text-transform: none;
  letter-spacing: 0.04em;
}

.mh-article {
  padding: 1.5rem;
  margin-top: 4rem;
}

.mh-prose {
  color: rgba(244, 242, 238, 0.88);
}

/* ---------------------------------- game --------------------------------- */

.mh-game {
  margin-top: 1.5rem;
  padding: 0.9rem;
}

.mh-hud {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  justify-content: space-between;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
}

.mh-hud b {
  color: var(--gold);
}

.mh-rank {
  color: var(--gold);
}

.mh-arena {
  position: relative;
  margin-top: 0.75rem;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(5, 5, 5, 0.85);
  touch-action: none;
}

.mh-arena canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 1;
}

.mh-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 1rem;
  text-align: center;
  background: rgba(5, 5, 5, 0.78);
  backdrop-filter: blur(3px);
  transition: opacity 0.25s ease;
}

.mh-overlay[hidden] {
  display: none;
}

.mh-overlay-title {
  margin: 0;
  font-size: 0.85rem;
  color: var(--gold);
}

.mh-banner {
  position: absolute;
  top: 0.6rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.25rem 0.7rem;
  border: 1px solid rgba(204, 172, 90, 0.4);
  border-radius: 999px;
  background: rgba(11, 11, 11, 0.85);
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.mh-banner.is-on {
  opacity: 1;
  animation: mh-pop 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.mh-pad {
  display: none;
  grid-template-columns: repeat(3, 3rem);
  grid-template-rows: repeat(2, 3rem);
  gap: 0.35rem;
  justify-content: center;
  margin-top: 0.85rem;
}

@media (hover: none) and (pointer: coarse) {
  .mh-pad {
    display: grid;
  }
}

.mh-pad-btn {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(28, 28, 28, 0.7);
  color: var(--gold);
  font-size: 0.85rem;
  cursor: pointer;
  user-select: none;
}

.mh-pad-btn:active {
  background: rgba(204, 172, 90, 0.2);
}

.mh-pad-up {
  grid-column: 2;
  grid-row: 1;
}
.mh-pad-left {
  grid-column: 1;
  grid-row: 2;
}
.mh-pad-down {
  grid-column: 2;
  grid-row: 2;
}
.mh-pad-right {
  grid-column: 3;
  grid-row: 2;
}

.mh-controls,
.mh-game-hint {
  margin-top: 0.7rem;
}

/* -------------------------------- contact -------------------------------- */

.mh-contact-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  max-width: 24rem;
  margin-top: 1.25rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  background: rgba(28, 28, 28, 0.3);
  text-align: left;
  transition:
    border-color 0.25s ease,
    background-color 0.25s ease;
}

.mh-contact-card:hover {
  border-color: rgba(204, 172, 90, 0.6);
  background: rgba(28, 28, 28, 0.6);
}

.mh-contact-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  flex: none;
  border: 1px solid rgba(204, 172, 90, 0.3);
  border-radius: var(--radius);
  color: var(--gold);
}

.mh-contact-icon svg {
  width: 1.1rem;
  height: 1.1rem;
}

.mh-contact-body {
  min-width: 0;
  flex: 1;
}

.mh-contact-body > span {
  display: block;
}

.mh-contact-handle {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--fg);
}

.mh-contact-arrow {
  color: var(--muted);
  transition:
    transform 0.3s ease,
    color 0.3s ease;
}

.mh-contact-card:hover .mh-contact-arrow {
  transform: translate(2px, -2px);
  color: var(--gold);
}

.mh-encrypted {
  margin-top: 1rem;
}

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

.mh-footer {
  padding: 1.25rem;
  border-top: 1px solid var(--border);
}

.mh-footer p {
  margin: 0;
}

/* ------------------------------- easter egg ------------------------------ */

.mh-egg {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  z-index: 60;
  padding: 0.75rem 1.25rem;
  border: 1px solid rgba(204, 172, 90, 0.3);
  border-radius: 0.75rem;
  background: rgba(28, 28, 28, 0.9);
  backdrop-filter: blur(12px);
  box-shadow: 0 0 40px -10px rgba(204, 172, 90, 0.55);
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 0.75rem);
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
  pointer-events: none;
}

.mh-egg.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
}

.mh-egg p {
  margin: 0;
}

.mh-egg-text {
  margin-top: 0.25rem !important;
  font-size: 0.8rem;
  color: var(--gold);
  text-transform: none;
  letter-spacing: 0.05em;
}

/* --------------------------------- reveal -------------------------------- */

.mh-reveal {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.mh-reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ------------------------------- animations ------------------------------ */

@keyframes mh-gold-sweep {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 220% 50%;
  }
}

@keyframes mh-pulse {
  0%,
  100% {
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(204, 172, 90, 0.55);
  }
  50% {
    opacity: 0.5;
    box-shadow: 0 0 0 6px transparent;
  }
}

@keyframes mh-caret {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}

@keyframes mh-pop {
  0% {
    transform: translateX(-50%) scale(0.85);
  }
  60% {
    transform: translateX(-50%) scale(1.05);
  }
  100% {
    transform: translateX(-50%) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .mh-reveal {
    opacity: 1;
    transform: none;
  }
}
