/* ==========================================================================
   Humming Kettle — Studio UI Theme
   Inspired by obsidian dark-fantasy RPG HUDs, gilded brass frames,
   arcane cyan accents, and crisp 16-bit pixel art.
   ========================================================================== */

:root {
  --bg-abyss: #070b14;
  --bg-slate: #0d1322;
  --bg-panel: #111829;
  --bg-panel-deep: #0b101d;
  --bg-panel-hover: #162038;

  --text-primary: #eef2f8;
  --text-secondary: #9eaccc;
  --text-muted: #667594;

  --gold: #f0c250;
  --gold-dim: #b6842c;
  --gold-border: rgba(240, 194, 80, 0.48);
  --cyan: #38d9f0;
  --cyan-border: rgba(56, 217, 240, 0.42);
  --emerald: #54d18e;
  --emerald-border: rgba(84, 209, 142, 0.42);
  --ember: #ff7d33;

  --border-frame: #27334f;
  --border-inner: rgba(255, 255, 255, 0.05);

  --font-display: "Cinzel", Georgia, "Times New Roman", serif;
  --font-pixel: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius-frame: 10px;
  --radius-card: 8px;
  --radius-btn: 6px;

  --shadow-panel:
    0 18px 44px rgba(2, 5, 12, 0.72),
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 -2px 0 rgba(0, 0, 0, 0.45);
  --transition-fast: 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100dvh;
  background-color: var(--bg-abyss);
  background-image:
    radial-gradient(ellipse 80% 55% at 74% 16%, rgba(30, 82, 108, 0.22), transparent 65%),
    radial-gradient(ellipse 65% 50% at 18% 85%, rgba(164, 96, 26, 0.14), transparent 68%);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}

::selection {
  background: rgba(240, 194, 80, 0.28);
  color: var(--text-primary);
}

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
}

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

/* ==========================================================================
   Atmospheric Backdrop
   ========================================================================== */

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

.arcane-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(circle at 50% 40%, transparent 45%, rgba(4, 7, 14, 0.62) 100%);
}

/* ==========================================================================
   Page Container
   ========================================================================== */

.page-shell {
  position: relative;
  z-index: 2;
  max-width: 1120px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: clamp(16px, 2.6vw, 28px) clamp(16px, 3.6vw, 36px);
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   Top HUD Header
   ========================================================================== */

.hud-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: clamp(16px, 2.4vw, 24px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  min-width: 0;
}

.brand-badge {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-btn);
  background: var(--bg-panel);
  border: 2px solid var(--gold-dim);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 240, 173, 0.14);
  flex-shrink: 0;
}

.brand-badge svg {
  width: 22px;
  height: 22px;
  image-rendering: pixelated;
}

.brand-name {
  font-family: var(--font-display);
  font-size: clamp(0.9rem, 3.2vw, 1.24rem);
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--gold);
  text-shadow: 0 2px 0 #05070e;
  white-space: nowrap;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.hud-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: var(--radius-btn);
  background: var(--bg-panel);
  border: 1.5px solid var(--border-frame);
  font-family: var(--font-pixel);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cyan);
  white-space: nowrap;
}

.hud-dot {
  width: 7px;
  height: 7px;
  background: var(--cyan);
  box-shadow: 0 0 8px rgba(56, 217, 240, 0.9);
  animation: pixelBlink 2s steps(2, end) infinite;
}

.hud-nav-btn {
  padding: 5px 12px;
  border-radius: var(--radius-btn);
  background: var(--bg-panel);
  border: 1.5px solid var(--gold-dim);
  font-family: var(--font-pixel);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--gold);
  white-space: nowrap;
  transition: background-color var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.hud-nav-btn:hover {
  background: #1a2338;
  border-color: var(--gold);
  transform: translateY(-1px);
}

/* ==========================================================================
   Main Content & Hero Title-Screen Frame
   ========================================================================== */

.page-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(18px, 2.6vw, 24px);
  padding-bottom: 24px;
}

.hero-frame {
  position: relative;
  padding: clamp(20px, 3.2vw, 34px);
  border-radius: var(--radius-frame);
  background: linear-gradient(160deg, rgba(20, 28, 48, 0.94) 0%, rgba(11, 16, 29, 0.97) 100%);
  border: 2px solid var(--gold-dim);
  box-shadow:
    var(--shadow-panel),
    0 0 0 1px rgba(6, 9, 17, 0.9);
}

/* Corner brass pixel rivets */
.corner-rivet {
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--gold);
  border: 1px solid #3c2608;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.55);
  pointer-events: none;
}

.corner-rivet--tl { top: 8px; left: 8px; }
.corner-rivet--tr { top: 8px; right: 8px; }
.corner-rivet--bl { bottom: 8px; left: 8px; }
.corner-rivet--br { bottom: 8px; right: 8px; }

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: clamp(22px, 3.4vw, 38px);
}

@media (min-width: 880px) {
  .hero-grid {
    grid-template-columns: 1.05fr 0.95fr;
  }
}

.hero-kicker-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.pixel-tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 4px;
  background: rgba(240, 194, 80, 0.12);
  border: 1px solid var(--gold-border);
  font-family: var(--font-pixel);
  font-size: 0.69rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--gold);
}

.pixel-tag--cyan {
  background: rgba(56, 217, 240, 0.1);
  border-color: var(--cyan-border);
  color: var(--cyan);
}

.hero-title {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: clamp(2.15rem, 4.4vw, 3.55rem);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: 0.015em;
  text-transform: uppercase;
  color: var(--text-primary);
  text-shadow: 0 3px 0 #050810;
}

.title-gold {
  color: var(--gold);
  text-shadow: 0 3px 0 #050810, 0 0 28px rgba(240, 194, 80, 0.25);
}

.hero-lead {
  margin: 0 0 20px;
  max-width: 540px;
  font-size: clamp(0.97rem, 1.25vw, 1.06rem);
  line-height: 1.66;
  color: var(--text-secondary);
}

.hero-lead strong {
  color: var(--text-primary);
  font-weight: 600;
}

.spec-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.spec-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--radius-btn);
  background: var(--bg-panel-deep);
  border: 1px solid var(--border-frame);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-secondary);
}

.chip-key {
  font-family: var(--font-pixel);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--gold);
}

/* ==========================================================================
   Live Pixel-Art Sanctuary Diorama
   ========================================================================== */

.diorama-column {
  display: flex;
  flex-direction: column;
}

.diorama-bezel {
  border-radius: var(--radius-card);
  background: #080c15;
  border: 2px solid #2e3b5c;
  box-shadow:
    0 16px 36px rgba(0, 0, 0, 0.65),
    inset 0 0 0 1px rgba(240, 194, 80, 0.14);
  overflow: hidden;
}

.diorama-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 12px;
  background: #101728;
  border-bottom: 1.5px solid #25304c;
  font-family: var(--font-pixel);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.07em;
}

.diorama-title {
  color: var(--text-secondary);
}

.diorama-live {
  color: var(--emerald);
}

.scene-button {
  appearance: none;
  display: block;
  width: 100%;
  padding: 0;
  margin: 0;
  border: 0;
  background: #070b14;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

.scene-button::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 28px rgba(4, 8, 16, 0.55);
}

.pixel-scene {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 256 / 168;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.diorama-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  background: #101728;
  border-top: 1.5px solid #25304c;
}

.scene-status {
  font-family: var(--font-pixel);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sfx-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 4px;
  background: #172138;
  border: 1.5px solid #324268;
  font-family: var(--font-pixel);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
  transition: border-color var(--transition-fast), color var(--transition-fast), background-color var(--transition-fast);
}

.sfx-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.sfx-btn[aria-pressed="true"] {
  border-color: var(--emerald);
  background: rgba(84, 209, 142, 0.14);
  color: var(--emerald);
}

.sfx-led {
  width: 6px;
  height: 6px;
  background: #4e5d80;
}

.sfx-btn[aria-pressed="true"] .sfx-led {
  background: var(--emerald);
  box-shadow: 0 0 8px var(--emerald);
}

/* ==========================================================================
   Direct Open Contact Dispatch Panel
   ========================================================================== */

.dispatch-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: clamp(18px, 2.6vw, 24px) clamp(20px, 3vw, 28px);
  border-radius: var(--radius-frame);
  background: linear-gradient(155deg, rgba(19, 27, 46, 0.94), rgba(11, 16, 29, 0.97));
  border: 2px solid var(--border-frame);
  box-shadow: var(--shadow-panel);
}

@media (min-width: 820px) {
  .dispatch-panel {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
  }
}

.dispatch-copy {
  max-width: 480px;
}

.dispatch-kicker {
  margin: 0 0 5px;
  font-family: var(--font-pixel);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  color: var(--cyan);
}

.dispatch-title {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--gold);
}

.dispatch-text {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-secondary);
}

.dispatch-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.email-slot {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-radius: var(--radius-btn);
  background: var(--bg-panel-deep);
  border: 2px solid var(--gold-dim);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: clamp(0.82rem, 1.3vw, 0.94rem);
  font-weight: 500;
  color: var(--text-primary);
  transition: border-color var(--transition-fast), background-color var(--transition-fast), transform var(--transition-fast);
}

.email-slot:hover {
  border-color: var(--gold);
  background: #141d32;
  transform: translateY(-1px);
}

.email-slot .slot-icon {
  color: var(--gold);
}

.slot-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  image-rendering: pixelated;
}

.copy-slot-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 11px 16px;
  border-radius: var(--radius-btn);
  background: linear-gradient(180deg, #273758 0%, #1a243d 100%);
  border: 2px solid #445b8f;
  font-family: var(--font-pixel);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-primary);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color var(--transition-fast), background var(--transition-fast), transform var(--transition-fast), color var(--transition-fast);
}

.copy-slot-btn:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  transform: translateY(-1px);
}

.copy-slot-btn.is-copied {
  border-color: var(--emerald);
  background: rgba(84, 209, 142, 0.16);
  color: var(--emerald);
}

/* ==========================================================================
   Codex / Future Games Grid (Rarity-Bordered RPG Cards)
   ========================================================================== */

.codex-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

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

.codex-card {
  padding: 18px 20px;
  border-radius: var(--radius-card);
  background: var(--bg-panel);
  border: 2px solid var(--border-frame);
  box-shadow: var(--shadow-panel);
  transition: transform var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast);
}

.codex-card:hover {
  transform: translateY(-2px);
  background: var(--bg-panel-hover);
}

.codex-card--gold {
  border-color: rgba(240, 194, 80, 0.42);
}

.codex-card--gold:hover {
  border-color: var(--gold);
}

.codex-card--cyan {
  border-color: rgba(56, 217, 240, 0.36);
}

.codex-card--cyan:hover {
  border-color: var(--cyan);
}

.codex-card--emerald {
  border-color: rgba(84, 209, 142, 0.36);
}

.codex-card--emerald:hover {
  border-color: var(--emerald);
}

.codex-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.codex-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--bg-panel-deep);
  border: 1.5px solid #2b3858;
}

.codex-icon svg {
  width: 22px;
  height: 22px;
  image-rendering: pixelated;
}

.rarity-pill {
  font-family: var(--font-pixel);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  padding: 3px 9px;
  border-radius: 4px;
  white-space: nowrap;
}

.rarity-pill--gold {
  background: rgba(240, 194, 80, 0.12);
  border: 1px solid var(--gold-border);
  color: var(--gold);
}

.rarity-pill--cyan {
  background: rgba(56, 217, 240, 0.12);
  border: 1px solid var(--cyan-border);
  color: var(--cyan);
}

.rarity-pill--emerald {
  background: rgba(84, 209, 142, 0.12);
  border: 1px solid var(--emerald-border);
  color: var(--emerald);
}

.codex-title {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-primary);
}

.codex-text {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--border-frame);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 20px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.footer-copy {
  margin: 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.footer-links a {
  text-decoration: none;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--gold);
}

/* ==========================================================================
   Animations & Mobile Tweaks
   ========================================================================== */

@keyframes pixelBlink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.38;
  }
}

@media (max-width: 560px) {
  .brand {
    gap: 8px;
  }

  .brand-badge {
    width: 30px;
    height: 30px;
  }

  .brand-badge svg {
    width: 19px;
    height: 19px;
  }

  .brand-name {
    font-size: 0.88rem;
  }

  .hud-nav-btn {
    display: none;
  }

  .hud-status-pill {
    padding: 4px 8px;
    font-size: 0.64rem;
  }

  .dispatch-actions {
    width: 100%;
  }

  .email-slot,
  .copy-slot-btn {
    width: 100%;
    justify-content: center;
  }

  .footer-sep {
    display: none;
  }

  .footer-links {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hud-dot {
    animation: none;
  }
}
