/* ==========================================================================
   Bytes Factorium — stylesheet
   Fonts are system-stack only (no external requests / self-contained site)
   ========================================================================== */

:root {
  /* ---- base site palette (dark) ---- */
  --bg: #0b0d10;
  --surface: #12151a;
  --surface-2: #171b21;
  --border: #262c34;
  --text: #e8e6e0;
  --text-dim: #9aa0a8;
  --accent: #47e6c9;      /* phosphor teal — the "bytes" identity */
  --accent-dim: #2b8f7d;

  --font-display: 'JetBrains Mono', 'Fira Code', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  --max-width: 1120px;
}

/* ---- game section palette (scoped locally, see .game-section) ---- */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

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

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: #06110f;
  padding: 0.75rem 1rem;
  z-index: 1000;
  font-family: var(--font-display);
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

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

/* ==========================================================================
   Header / Nav
   ========================================================================== */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(11, 13, 16, 0.82);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.brand-mark {
  color: var(--accent);
}

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

.nav-links {
  display: flex;
  gap: 2rem;
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.03em;
}

.nav-links a {
  color: var(--text-dim);
  position: relative;
  padding: 0.25rem 0;
  transition: color 0.2s ease;
}
.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--accent);
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.2s ease;
}
.nav-links a:hover::after,
.nav-links a:focus-visible::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 34px;
  height: 34px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 16px;
  height: 1.5px;
  background: var(--text);
  margin: 0 auto;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }
  .nav-links.open { max-height: 260px; }
  .nav-links a {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
  }
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  padding: 0.85rem 1.6rem;
  border-radius: 3px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: var(--accent);
  color: #06110f;
}
.btn-primary:hover { background: #63f0d6; }

.btn-ghost {
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

/* ==========================================================================
   Hero / Landing
   ========================================================================== */

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 1.5rem 4rem;
  overflow: hidden;
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(71, 230, 201, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(71, 230, 201, 0.06) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(ellipse at center, black 10%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 10%, transparent 72%);
}

.hero-content {
  position: relative;
  max-width: 760px;
}

.eyebrow {
  font-family: var(--font-display);
  font-size: 0.78rem;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 7vw, 4.2rem);
  letter-spacing: 0.01em;
  margin: 0 0 1.25rem;
  color: var(--text);
}

.hero-tagline {
  font-size: 1.05rem;
  color: var(--text-dim);
  max-width: 46ch;
  margin: 0 auto 2.25rem;
}

.scroll-cue {
  position: absolute;
  bottom: 2.25rem;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.scroll-cue span {
  position: absolute;
  top: 6px;
  left: 50%;
  width: 3px;
  height: 6px;
  background: var(--accent);
  border-radius: 2px;
  transform: translateX(-50%);
  animation: scrollcue 1.8s infinite ease-in-out;
}
@keyframes scrollcue {
  0% { opacity: 1; top: 6px; }
  70% { opacity: 0; top: 16px; }
  100% { opacity: 0; top: 16px; }
}

/* subtle glitch/flicker used on hero + game title */
[data-flicker] {
  animation: flicker 7s infinite;
}
@keyframes flicker {
  0%, 92%, 100% { opacity: 1; text-shadow: none; }
  93% { opacity: 0.7; text-shadow: 2px 0 var(--accent); }
  94% { opacity: 1; text-shadow: -1px 0 var(--accent); }
  95% { opacity: 0.85; text-shadow: none; }
  96% { opacity: 1; }
}

/* ==========================================================================
   Game section — paranormal case-file theme (own local palette)
   ========================================================================== */

.game-section {
  position: relative;
  --g-bg: #07080a;
  --g-surface: #0f1210;
  --g-border: #24312a;
  --g-text: #d7dcd6;
  --g-text-dim: #7c887f;
  --g-accent: #6bff8f;   /* EMF green */
  --g-accent-2: #9b7bff; /* violet undertone */

  background: var(--g-bg);
  color: var(--g-text);
  padding: 6rem 1.5rem 5rem;
  overflow: hidden;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.static-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

.scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.025) 0px,
    rgba(255, 255, 255, 0.025) 1px,
    transparent 1px,
    transparent 3px
  );
}

.game-inner {
  position: relative;
  max-width: var(--max-width);
  margin: 0 auto;
}

.case-header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  color: var(--g-text-dim);
  border-bottom: 1px dashed var(--g-border);
  padding-bottom: 1rem;
  margin-bottom: 2rem;
}

.case-status .status-blink {
  color: var(--g-accent);
  animation: blink 2.4s infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.game-title {
  font-family: 'Courier New', Courier, monospace;
  font-weight: 700;
  font-size: clamp(2rem, 6vw, 3.4rem);
  letter-spacing: 0.03em;
  margin: 0 0 0.4rem;
  color: var(--g-text);
}

.game-subtitle {
  font-family: 'Courier New', Courier, monospace;
  color: var(--g-text-dim);
  font-size: 0.9rem;
  margin: 0 0 2rem;
}

.game-logline {
  font-family: 'Courier New', Courier, monospace;
  font-size: 1.05rem;
  line-height: 1.75;
  max-width: 66ch;
  color: var(--g-text);
  margin-bottom: 3rem;
}

.evidence-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 3rem;
}

.evidence-card {
  background: var(--g-surface);
  border: 1px solid var(--g-border);
  border-left: 2px solid var(--g-accent);
  padding: 1.5rem;
  border-radius: 2px;
  position: relative;
}

.evidence-index {
  font-family: var(--font-display);
  font-size: 0.72rem;
  color: var(--g-accent-2);
  letter-spacing: 0.08em;
}

.evidence-card h3 {
  font-family: 'Courier New', Courier, monospace;
  margin: 0.6rem 0 0.5rem;
  font-size: 1.1rem;
  color: var(--g-text);
}

.evidence-card p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--g-text-dim);
  line-height: 1.6;
}

.dossier {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
  align-items: start;
  border-top: 1px dashed var(--g-border);
  padding-top: 2.5rem;
  margin-bottom: 3rem;
}

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

.redacted-heading {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--g-accent);
  margin: 0 0 0.9rem;
}

.dossier-text p {
  font-family: 'Courier New', Courier, monospace;
  color: var(--g-text-dim);
  font-size: 0.95rem;
  line-height: 1.75;
  max-width: 56ch;
}

/* EMF meter widget — signature decorative element */
.emf-widget {
  background: var(--g-surface);
  border: 1px solid var(--g-border);
  padding: 1.25rem;
  border-radius: 2px;
}

.emf-label {
  font-family: var(--font-display);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  color: var(--g-text-dim);
  margin-bottom: 0.85rem;
}

.emf-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 40px;
  margin-bottom: 0.75rem;
}

.emf-bars span {
  flex: 1;
  background: var(--g-border);
  border-radius: 1px;
  transition: height 0.15s ease, background 0.15s ease;
}

.emf-value {
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--g-accent);
  letter-spacing: 0.03em;
}

.btn-outline-game {
  font-family: 'Courier New', Courier, monospace;
  border: 1px solid var(--g-accent);
  color: var(--g-accent);
  padding: 0.85rem 1.6rem;
  border-radius: 2px;
  display: inline-block;
  transition: background 0.2s ease, color 0.2s ease;
}
.btn-outline-game:hover {
  background: var(--g-accent);
  color: #06110f;
}

/* ==========================================================================
   About
   ========================================================================== */

.about-section {
  padding: 6rem 1.5rem;
  background: var(--bg);
}

.about-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  letter-spacing: 0.02em;
  margin: 0 0 2.5rem;
  color: var(--text);
}
.section-title::before {
  content: "// ";
  color: var(--accent-dim);
}

.about-grid {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 3rem;
  align-items: start;
}

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

.about-avatar {
  width: 140px;
  height: 140px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-mark {
  font-family: var(--font-display);
  font-size: 2.2rem;
  color: var(--accent);
  letter-spacing: 0.05em;
}

.about-text p {
  color: var(--text-dim);
  max-width: 62ch;
  margin: 0 0 1.15rem;
}
.about-text p:last-child { margin-bottom: 0; }

/* ==========================================================================
   Contact
   ========================================================================== */

.contact-section {
  padding: 6rem 1.5rem 7rem;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.contact-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.contact-copy {
  color: var(--text-dim);
  max-width: 52ch;
  margin: 0 0 2rem;
}

.contact-email {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 4vw, 2rem);
  color: var(--accent);
  border-bottom: 1px solid var(--accent-dim);
  padding-bottom: 0.3rem;
  display: inline-block;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.contact-email:hover {
  color: #63f0d6;
  border-color: var(--accent);
}

.contact-note {
  margin-top: 1.5rem;
  font-size: 0.85rem;
  color: var(--text-dim);
}

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

.site-footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 3rem 1.5rem 2.5rem;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  text-align: center;
}

.footer-brand {
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}
.footer-brand .brand-mark { color: var(--accent); }

.social-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.social-item a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-dim);
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}
.social-item a:hover,
.social-item a:focus-visible {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin: 0;
}
