/* Slopworks — grungy industrial theme
   Post-apocalyptic factory survival game teaser site */

/* === FONT IMPORTS === */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Oswald:wght@400;700&family=Space+Mono:ital,wght@0,400;0,700;1,400&display=swap');

/* === DESIGN TOKENS === */
:root {
  --bg: #0A0E14;
  --bg-surface: #12171F;
  --bg-card: #1A1F2B;
  --border: #2A2A2A;
  --border-rust: #8B3A1A;
  --text: #C5CDD8;
  --text-dim: #6B7A8D;
  --accent: #E8A031;
  --accent-dim: #8B6320;
  --teal: #5CCFE6;
  --teal-dim: #2A6B77;
  --red: #CC3333;
  --font-display: 'Oswald', sans-serif;
  --font-body: 'IBM Plex Sans', sans-serif;
  --font-mono: 'Space Mono', monospace;
}

/* === RESET + BASE === */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

/* === TEXTURE BACKGROUND (CSS-only noise/grain) === */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.04;
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(200, 200, 200, 0.03) 2px,
      rgba(200, 200, 200, 0.03) 3px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 3px,
      rgba(200, 200, 200, 0.02) 3px,
      rgba(200, 200, 200, 0.02) 4px
    ),
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 5px,
      rgba(150, 150, 150, 0.015) 5px,
      rgba(150, 150, 150, 0.015) 6px
    ),
    repeating-linear-gradient(
      -30deg,
      transparent,
      transparent 7px,
      rgba(180, 180, 180, 0.02) 7px,
      rgba(180, 180, 180, 0.02) 8px
    );
}

.bg-surface {
  background: var(--bg-surface);
}

/* === TYPOGRAPHY === */
h1 {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  color: var(--accent);
  line-height: 1.1;
}

h2 {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: clamp(1.5rem, 3.5vw, 2.2rem);
  color: var(--text);
  margin-bottom: 1rem;
  line-height: 1.2;
}

h3 {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  color: var(--text);
  line-height: 1.3;
}

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

.text-accent {
  color: var(--accent);
}

.text-teal {
  color: var(--teal);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  text-decoration: underline;
}

/* === LAYOUT === */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2rem);
}

.section {
  padding: clamp(2rem, 4vw, 3.5rem) 0;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.section.visible {
  opacity: 1;
  transform: translateY(0);
}

/* === NAVIGATION (sticky industrial signage) === */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(10, 14, 20, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--border);
  padding: 0 clamp(1rem, 4vw, 2rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

/* Caution stripe beneath nav */
.site-nav::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  right: 0;
  height: 3px;
  background: repeating-linear-gradient(
    45deg,
    var(--accent),
    var(--accent) 8px,
    transparent 8px,
    transparent 16px
  );
}

.nav-brand {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
}

.nav-brand:hover {
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 0;
  list-style: none;
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  padding: 0 1rem;
  line-height: 56px;
  text-decoration: none;
  border-left: 1px solid var(--border);
  transition: color 0.2s;
  display: block;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
  text-decoration: none;
}

.nav-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-dim);
  margin: 4px 0;
  transition: transform 0.3s, opacity 0.3s;
}

/* === HERO SECTION === */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.hero-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(
    to bottom,
    rgba(10, 14, 20, 0.3) 0%,
    rgba(10, 14, 20, 0.7) 60%,
    rgba(10, 14, 20, 0.95) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 3;
  text-align: center;
  max-width: 800px;
  padding: 0 1.5rem;
}

.hero-subtitle {
  font-family: var(--font-mono);
  font-size: clamp(0.85rem, 2vw, 1.1rem);
  color: var(--teal);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-top: 0.5rem;
}

.hero-hook {
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  color: var(--text-dim);
  margin-top: 1.5rem;
  font-style: italic;
}

/* === CAUTION DIVIDER === */
.caution-divider {
  height: 4px;
  background: repeating-linear-gradient(
    45deg,
    var(--accent),
    var(--accent) 10px,
    transparent 10px,
    transparent 20px
  );
  margin: 0;
}

/* === CARD GRID === */
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(1rem, 3vw, 1.5rem);
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.3s, transform 0.3s;
  display: block;
}

.card:hover {
  border-color: var(--accent-dim);
  transform: translateY(-2px);
  text-decoration: none;
}

.card-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

.card-body {
  padding: clamp(1rem, 2vw, 1.5rem);
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.card-desc {
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.5;
}

.card-grid .card:nth-child(5) {
    grid-column: span 2;
}

/* === ART FRAMES (concept art images) === */
.art-frame {
  position: relative;
  overflow: hidden;
  border-radius: 2px;
  border: 1px solid var(--border-rust);
}

.art-frame img {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.art-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

.art-placeholder {
  background: var(--bg-surface);
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* === CONTENT SPLIT LAYOUT === */
.content-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 4vw, 3rem);
  align-items: center;
}

.content-split.reverse .split-image {
  order: 2;
}

.content-split.reverse .split-text {
  order: 1;
}

/* === SLOP ELEMENTS === */
.slop-says {
  border-left: 3px solid var(--accent);
  background: rgba(232, 160, 49, 0.05);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  line-height: 1.6;
}

.slop-says::before {
  content: 'S.L.O.P.://';
  display: block;
  font-size: 0.7rem;
  color: var(--accent-dim);
  margin-bottom: 0.5rem;
}

.slop-interjection {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  max-width: 400px;
  background: var(--bg-surface);
  border: 1px solid var(--accent-dim);
  padding: 1rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  z-index: 900;
  transform: translateX(120%);
  transition: transform 0.4s ease;
  border-radius: 2px;
}

.slop-interjection.visible {
  transform: translateX(0);
}

.scan-lines::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.1) 2px,
    rgba(0, 0, 0, 0.1) 4px
  );
  pointer-events: none;
  z-index: 1;
}

.glitching {
  animation: glitch 0.3s steps(2);
}

/* === THREE.JS SCENE CONTAINERS === */
.scene-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--bg-surface);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 2px;
  margin: 2rem 0;
}

.scene-container canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.scene-label {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--accent-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  z-index: 5;
  background: rgba(10, 14, 20, 0.7);
  padding: 0.25rem 0.5rem;
  border-radius: 2px;
}

.scene-status {
  position: absolute;
  bottom: 0.75rem;
  right: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--teal-dim);
  z-index: 5;
}

/* === FAUNA GRID === */
.fauna-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(1rem, 2vw, 1.5rem);
}

.fauna-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  overflow: hidden;
  border-radius: 2px;
}

.fauna-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

.fauna-info {
  padding: 1rem;
}

.fauna-name {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text);
  font-size: 0.95rem;
}

.fauna-biome {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--teal);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0.25rem;
}

.fauna-desc {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: 0.5rem;
}

/* === CO-OP SECTION === */
.coop-section {
  position: relative;
  overflow: hidden;
}

.coop-section img {
  width: 100%;
  display: block;
  aspect-ratio: 21 / 9;
  object-fit: cover;
}

.coop-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(
    to right,
    rgba(10, 14, 20, 0.8),
    rgba(10, 14, 20, 0.4),
    rgba(10, 14, 20, 0.8)
  );
}

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

.coop-text h2 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  color: var(--text);
}

.coop-text p {
  font-family: var(--font-mono);
  color: var(--teal);
  font-size: clamp(0.8rem, 2vw, 1rem);
}

/* === FOOTER === */
.site-footer {
  position: relative;
  border-top: 4px solid var(--border);
  padding: 3rem 0 2rem;
  text-align: center;
}

/* Caution stripe above footer border */
.site-footer::before {
  content: '';
  position: absolute;
  top: -7px;
  left: 0;
  right: 0;
  height: 3px;
  background: repeating-linear-gradient(
    45deg,
    var(--accent),
    var(--accent) 8px,
    transparent 8px,
    transparent 16px
  );
}

.corp-text {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.build-status {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--accent-dim);
  margin-top: 1rem;
}

/* === CRT TERMINAL (SLOP page) === */
.terminal {
  background: #0a0800;
  border: 2px solid var(--accent-dim);
  border-radius: 4px;
  padding: 0;
  overflow: hidden;
  max-width: 700px;
  margin: 2rem auto;
  position: relative;
}

/* Terminal scan lines */
.terminal::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.1) 2px,
    rgba(0, 0, 0, 0.1) 4px
  );
  pointer-events: none;
  z-index: 1;
}

.terminal-header {
  background: rgba(232, 160, 49, 0.1);
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--accent-dim);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.terminal-output {
  padding: 1rem 1.5rem;
  max-height: 500px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--accent);
}

.terminal-output .line {
  margin-bottom: 0.25rem;
}

.terminal-output .prompt-text {
  color: var(--teal);
}

.terminal-output .response-text {
  color: var(--accent);
}

.terminal-output .system-text {
  color: var(--accent-dim);
  font-size: 0.7rem;
}

.terminal-prompts {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--accent-dim);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.terminal-prompt-btn {
  background: none;
  border: 1px solid var(--accent-dim);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.2s;
}

.terminal-prompt-btn:hover {
  background: rgba(232, 160, 49, 0.15);
  border-color: var(--accent);
}

.terminal-prompt-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.typing-cursor {
  display: inline-block;
  width: 8px;
  height: 1em;
  background: var(--accent);
  animation: blink 0.8s step-end infinite;
  vertical-align: text-bottom;
}

/* === UTILITY CLASSES === */
.full-width-art {
  margin: 3rem calc(-1 * clamp(1rem, 4vw, 2rem));
  width: calc(100% + 2 * clamp(1rem, 4vw, 2rem));
}

.mt-sm { margin-top: 1rem; }
.mt-md { margin-top: 2rem; }
.mt-lg { margin-top: 3rem; }

.mb-sm { margin-bottom: 1rem; }
.mb-md { margin-bottom: 2rem; }
.mb-lg { margin-bottom: 3rem; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* === ANIMATIONS === */
@keyframes glitch {
  0% {
    transform: translate(0, 0);
    filter: none;
  }
  50% {
    transform: translate(-2px, 1px);
    filter: hue-rotate(90deg);
  }
  100% {
    transform: translate(0, 0);
    filter: none;
  }
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* === RESPONSIVE: MOBILE === */
@media (max-width: 768px) {
  .nav-hamburger {
    display: block;
  }

  .nav-links {
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--bg-surface);
    flex-direction: column;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    z-index: 999;
    border-bottom: 1px solid var(--border);
  }

  .nav-links.open {
    max-height: 400px;
  }

  .nav-links a {
    border-left: none;
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem;
    line-height: normal;
    width: 100%;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

    .card-grid .card:nth-child(5) {
        grid-column: span 1;
    }

  .content-split {
    grid-template-columns: 1fr;
  }

  .content-split.reverse .split-image,
  .content-split.reverse .split-text {
    order: unset;
  }

  .slop-interjection {
    right: 1rem;
    left: 1rem;
    max-width: none;
    bottom: 1rem;
  }
}

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

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

  .section {
    opacity: 1;
    transform: none;
  }

  .slop-interjection {
    transition: none;
  }

  .glitching {
    animation: none;
  }

  .typing-cursor {
    animation: none;
    opacity: 1;
  }
}
