:root {
  /* Core industrial palette. */
  --bg: #07090b;
  --bg-elevated: #0d1116;
  --steel: #9aa4af;
  --steel-dark: #202832;
  --text: #f3f6f8;
  --muted: #a9b2bc;
  --orange: #ff7a1a;
  --orange-soft: rgba(255, 122, 26, 0.16);
  --blue: #3ab8ff;
  --blue-soft: rgba(58, 184, 255, 0.12);
  --line: rgba(255, 255, 255, 0.09);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  --radius: 8px;
  --max-width: 1160px;
}

/* Base layout and global page atmosphere. */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 76% 8%, rgba(58, 184, 255, 0.13), transparent 24rem),
    radial-gradient(circle at 18% 2%, rgba(255, 122, 26, 0.12), transparent 22rem),
    linear-gradient(180deg, #0b0d10 0%, var(--bg) 42%, #050607 100%);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.026) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent 72%);
}

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

p,
h1,
h2,
h3 {
  margin-top: 0;
}

/* Sticky navigation. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid transparent;
  transition: background-color 220ms ease, border-color 220ms ease, backdrop-filter 220ms ease;
}

.site-header.is-scrolled {
  background: rgba(7, 9, 11, 0.78);
  border-color: var(--line);
  backdrop-filter: blur(16px);
}

.nav {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin: 0 auto;
  max-width: var(--max-width);
  min-height: 76px;
  padding: 0 24px;
}

.brand {
  align-items: center;
  display: inline-flex;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  gap: 12px;
  letter-spacing: 0.08em;
}

.brand-mark {
  align-items: center;
  background: linear-gradient(135deg, var(--orange), #ff9a3d);
  border-radius: 6px;
  color: #101010;
  display: inline-flex;
  font-weight: 800;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.nav-links {
  align-items: center;
  display: flex;
  gap: 26px;
}

.nav-links a {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
  transition: color 180ms ease;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--text);
}

.nav-links .nav-cta {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  padding: 9px 14px;
}

.nav-links .nav-cta:hover {
  border-color: rgba(255, 122, 26, 0.58);
  box-shadow: 0 0 0 4px var(--orange-soft);
}

.nav-toggle {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: none;
  height: 42px;
  padding: 0;
  width: 42px;
}

.nav-toggle span {
  background: var(--text);
  display: block;
  height: 2px;
  margin: 6px auto;
  transition: transform 180ms ease;
  width: 18px;
}

/* Reusable page sections. */
.section {
  margin: 0 auto;
  max-width: var(--max-width);
  padding: 104px 24px;
}

/* Hero and abstract factory visual. */
.hero {
  min-height: calc(100vh - 76px);
  padding-top: 86px;
}

.hero-grid {
  display: grid;
  gap: 40px;
  grid-template-columns: minmax(0, 1fr) 320px 360px;
  align-items: start;
}

.eyebrow {
  color: var(--orange);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  margin-bottom: 16px;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  font-family: "Space Grotesk", sans-serif;
  line-height: 1.04;
}

h1 {
  font-size: clamp(2.1rem, 6vw, 4.5rem);
  font-weight: 700;
  margin-bottom: 20px;
}

h2 {
  font-size: clamp(2.15rem, 4vw, 4rem);
  margin-bottom: 18px;
}

h3 {
  font-size: 1.15rem;
  margin-bottom: 12px;
}

.hero-slogan {
  color: var(--blue);
  font-size: clamp(1.25rem, 2.1vw, 1.8rem);
  font-weight: 700;
  margin-bottom: 20px;
}

.hero-copy {
  color: var(--muted);
  font-size: 1.06rem;
  max-width: 640px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.button {
  align-items: center;
  border-radius: var(--radius);
  display: inline-flex;
  font-weight: 800;
  gap: 10px;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-2px);
}

.button-primary {
  background: var(--orange);
  color: #111;
  box-shadow: 0 16px 34px rgba(255, 122, 26, 0.24);
}

.button-primary:hover {
  box-shadow: 0 18px 42px rgba(255, 122, 26, 0.34);
}

.button-secondary {
  border: 1px solid var(--line);
  color: var(--text);
}

.button-secondary:hover {
  border-color: rgba(58, 184, 255, 0.56);
  box-shadow: 0 0 0 4px var(--blue-soft);
}

.discord-widget {
  border-radius: var(--radius);
  overflow: hidden;
  align-self: flex-start;
}

.discord-widget iframe {
  border-radius: var(--radius);
  display: block;
}

.forge-panel {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-height: 430px;
  overflow: hidden;
  padding: 26px;
  position: relative;
}

.forge-panel::before {
  content: "";
  inset: 0;
  position: absolute;
  background: linear-gradient(120deg, transparent, rgba(255, 122, 26, 0.09), transparent);
  transform: translateX(-100%);
  animation: scan 6s ease-in-out infinite;
}

.factory-visual {
  height: 320px;
  position: relative;
}

.rail,
.pulse-line {
  background: linear-gradient(90deg, var(--steel-dark), var(--orange), var(--steel-dark));
  border-radius: 999px;
  height: 5px;
  left: 10%;
  position: absolute;
  right: 10%;
}

.rail-top {
  top: 28%;
}

.rail-mid {
  top: 51%;
}

.rail-bottom {
  top: 74%;
}

.pulse-line {
  background: linear-gradient(90deg, transparent, var(--blue), transparent);
  box-shadow: 0 0 24px rgba(58, 184, 255, 0.52);
  top: 51%;
  transform-origin: left;
  animation: pulseRail 2.6s ease-in-out infinite;
}

.node {
  background: linear-gradient(145deg, #171e26, #0a0d11);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 1px rgba(255, 122, 26, 0.08), 0 12px 30px rgba(0, 0, 0, 0.35);
  height: 74px;
  position: absolute;
  width: 88px;
}

.node::after {
  background: var(--orange);
  border-radius: 999px;
  box-shadow: 0 0 18px rgba(255, 122, 26, 0.72);
  content: "";
  height: 9px;
  position: absolute;
  right: 14px;
  top: 14px;
  width: 9px;
}

.node-a {
  left: 8%;
  top: 15%;
}

.node-b {
  right: 14%;
  top: 38%;
}

.node-c {
  left: 20%;
  top: 61%;
}

.node-d {
  right: 28%;
  top: 16%;
}

.panel-status {
  align-items: center;
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  font-size: 0.9rem;
  justify-content: space-between;
  padding-top: 22px;
}

.panel-status strong {
  color: var(--blue);
  letter-spacing: 0.08em;
}

/* About and project content blocks. */
.section-heading {
  max-width: 760px;
}

.section-heading p:not(.eyebrow),
.lead,
.about-text p,
.card p,
.timeline-item p,
.site-footer p {
  color: var(--muted);
}

.about-layout {
  display: grid;
  gap: 44px;
  grid-template-columns: 0.9fr 1.1fr;
  margin-top: 34px;
}

.lead {
  font-size: clamp(1.35rem, 2.5vw, 2rem);
  line-height: 1.35;
}

.about-text {
  border-left: 1px solid rgba(255, 122, 26, 0.34);
  padding-left: 28px;
}

.project-section {
  border-top: 1px solid var(--line);
}

.feature-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 44px;
}

.card {
  background: rgba(13, 17, 22, 0.82);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.card:hover {
  border-color: rgba(255, 122, 26, 0.42);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.28);
  transform: translateY(-4px);
}

.card-icon {
  color: var(--orange);
  display: inline-block;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 26px;
}

.screenshots {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(2, 1fr);
  margin-top: 24px;
}

.screenshot {
  aspect-ratio: 16 / 9;
  background:
    linear-gradient(135deg, rgba(58, 184, 255, 0.08), transparent),
    #0d1116;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 0;
  overflow: hidden;
  padding: 22px;
  position: relative;
}

.screenshot figcaption {
  bottom: 18px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  left: 22px;
  position: absolute;
}

.screenshot-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, 1fr);
  height: 72%;
}

.screenshot-grid span {
  background: linear-gradient(180deg, rgba(255, 122, 26, 0.28), rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
}

.screenshot-lines {
  display: grid;
  gap: 18px;
  padding-top: 28px;
}

.screenshot-lines span {
  background: linear-gradient(90deg, var(--orange), rgba(58, 184, 255, 0.56), transparent);
  border-radius: 999px;
  height: 10px;
}

.screenshot-lines span:nth-child(2),
.screenshot-lines span:nth-child(4) {
  margin-left: 18%;
}

/* Devlog timeline. */
.devlog-section {
  border-top: 1px solid var(--line);
}

.timeline {
  border-left: 1px solid var(--line);
  list-style: none;
  margin: 44px 0 0;
  padding: 0;
}

.timeline-item {
  display: grid;
  gap: 28px;
  grid-template-columns: 120px 1fr;
  padding: 0 0 34px 28px;
  position: relative;
}

.timeline-item::before {
  background: var(--orange);
  border: 5px solid var(--bg);
  border-radius: 999px;
  content: "";
  height: 13px;
  left: -12px;
  position: absolute;
  top: 3px;
  width: 13px;
}

.timeline-date {
  color: var(--blue);
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
}

/* Footer. */
.site-footer {
  align-items: center;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr auto auto;
  margin: 0 auto;
  max-width: var(--max-width);
  padding: 34px 24px 48px;
}

.site-footer strong {
  font-family: "Space Grotesk", sans-serif;
}

.site-footer p {
  margin-bottom: 0;
}

.footer-links {
  display: flex;
  gap: 18px;
}

.footer-links a {
  color: var(--muted);
  font-weight: 700;
  transition: color 180ms ease;
}

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

.copyright {
  font-size: 0.88rem;
}

/* Scroll reveal animation, disabled for reduced-motion users below. */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 600ms ease, transform 600ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes scan {
  0%,
  46% {
    transform: translateX(-110%);
  }

  100% {
    transform: translateX(110%);
  }
}

@keyframes pulseRail {
  0%,
  100% {
    opacity: 0.28;
    transform: scaleX(0.2);
  }

  50% {
    opacity: 1;
    transform: scaleX(1);
  }
}

@media (max-width: 860px) {
  .nav-toggle {
    display: block;
  }

  .nav-links {
    background: rgba(7, 9, 11, 0.96);
    border-bottom: 1px solid var(--line);
    display: grid;
    gap: 18px;
    left: 0;
    opacity: 0;
    padding: 22px 24px 28px;
    pointer-events: none;
    position: absolute;
    right: 0;
    top: 76px;
    transform: translateY(-10px);
    transition: opacity 180ms ease, transform 180ms ease;
  }

  .nav-links.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .hero-grid,
  .about-layout,
  .feature-grid,
  .screenshots,
  .site-footer {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 62px;
  }

  .forge-panel {
    min-height: 340px;
  }

  .factory-visual {
    height: 240px;
  }

  .node {
    height: 58px;
    width: 70px;
  }

  .about-text {
    border-left: 0;
    border-top: 1px solid rgba(255, 122, 26, 0.34);
    padding-left: 0;
    padding-top: 24px;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .site-footer {
    align-items: start;
  }
}

@media (max-width: 560px) {
  .section {
    padding: 78px 18px;
  }

  .nav {
    padding: 0 18px;
  }

  .brand {
    letter-spacing: 0.04em;
  }

  h1 {
    font-size: 3.1rem;
  }

  .hero-actions,
  .button {
    width: 100%;
  }

  .forge-panel,
  .card,
  .screenshot {
    padding: 20px;
  }

  .screenshots {
    gap: 16px;
  }
}

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