:root {
  --black: #050606;
  --panel: rgba(11, 12, 12, 0.78);
  --panel-strong: rgba(7, 8, 8, 0.92);
  --white: #e9e7e2;
  --muted: #9a9994;
  --orange: #f0441d;
  --red: #c62318;
  --line: rgba(240, 68, 29, 0.33);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--white);
  background: var(--black);
  font-family: "JetBrains Mono", monospace;
}

body::selection { background: var(--orange); color: #000; }

a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.site-shell { position: relative; z-index: 4; min-height: 100vh; }
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 0 4vw;
  border-bottom: 1px solid rgba(255,255,255,.1);
  background: linear-gradient(180deg, rgba(0,0,0,.92), rgba(0,0,0,.52));
  backdrop-filter: blur(10px);
  font-size: clamp(.66rem, 1vw, .82rem);
  letter-spacing: .14em;
}
.network-id { display: flex; align-items: center; gap: .75rem; color: var(--orange); }
.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 0 rgba(240,68,29,.7);
  animation: pulse 1.8s infinite;
}
.sound-toggle {
  border: 0;
  color: var(--muted);
  background: none;
  font: inherit;
  letter-spacing: .1em;
  cursor: pointer;
}
.sound-toggle:hover { color: var(--orange); }

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(320px, 780px) minmax(180px, 1fr);
  align-items: center;
  min-height: 100svh;
  padding: 90px 4vw 60px;
  isolation: isolate;
  overflow: hidden;
}
.hero__backdrop {
  position: absolute;
  inset: 0;
  z-index: -4;
  background:
    linear-gradient(180deg, rgba(0,0,0,.15), rgba(0,0,0,.78)),
    url("assets/ashfall-background-clean.jpg") center center / cover no-repeat;
  transform: scale(1.03);
  animation: breathe 12s ease-in-out infinite alternate;
}
.hero__vignette {
  position: absolute;
  inset: 0;
  z-index: -3;
  background: radial-gradient(circle at 50% 45%, transparent 0 30%, rgba(0,0,0,.34) 65%, rgba(0,0,0,.88) 100%);
}
.hero__content {
  grid-column: 2;
  text-align: center;
  padding: 1rem;
  max-width: 760px;
  margin-inline: auto;
}
.hero__logo {
  width: clamp(120px, 12vw, 180px);
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
  filter: drop-shadow(0 12px 26px rgba(0,0,0,.8));
  opacity: .98;
}
.kicker, .eyebrow {
  color: var(--orange);
  font-size: clamp(.64rem, .9vw, .78rem);
  letter-spacing: .23em;
}
.hero h1 {
  margin: .35rem 0 .5rem;
  font-family: "Barlow Condensed", sans-serif;
  font-size: clamp(3rem, 6.2vw, 6.2rem);
  line-height: .87;
  letter-spacing: .035em;
  text-transform: uppercase;
  text-shadow: 0 2px 0 #000, 0 0 28px rgba(240,68,29,.15);
}
.hero__copy {
  max-width: 620px;
  margin: 0 auto 1.4rem;
  color: #bebbb4;
  font-family: "Barlow Condensed", sans-serif;
  font-size: clamp(1.05rem, 1.8vw, 1.4rem);
  letter-spacing: .06em;
}
.transmission {
  display: inline-flex;
  flex-direction: column;
  gap: .35rem;
  min-width: min(92vw, 410px);
  padding: .85rem 1.1rem;
  border: 1px solid var(--line);
  background: rgba(0,0,0,.55);
  box-shadow: inset 0 0 28px rgba(240,68,29,.06);
}
.transmission span { color: var(--muted); font-size: .66rem; letter-spacing: .22em; }
.transmission strong { color: var(--orange); font-size: clamp(1rem, 2vw, 1.35rem); letter-spacing: .12em; }
.actions { display: flex; justify-content: center; flex-wrap: wrap; gap: .75rem; margin-top: 1.25rem; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 185px;
  padding: .9rem 1.1rem;
  border: 1px solid rgba(255,255,255,.16);
  text-decoration: none;
  font-size: .72rem;
  letter-spacing: .14em;
  transition: .25s ease;
}
.btn--primary { color: #090909; border-color: var(--orange); background: var(--orange); }
.btn--primary:hover { background: #ff5b32; box-shadow: 0 0 26px rgba(240,68,29,.32); transform: translateY(-2px); }
.btn--ghost { background: rgba(0,0,0,.52); }
.btn--ghost:hover { border-color: var(--orange); color: var(--orange); transform: translateY(-2px); }

.status { align-self: center; padding: 1.1rem; border-left: 1px solid var(--line); background: linear-gradient(90deg, rgba(0,0,0,.58), transparent); }
.status--right { border-left: 0; border-right: 1px solid var(--line); background: linear-gradient(-90deg, rgba(0,0,0,.58), transparent); text-align: right; }
.status dl, .status ul { margin: 1rem 0 0; padding: 0; list-style: none; }
.status dl div { margin-bottom: .75rem; }
.status dt { color: var(--muted); font-size: .65rem; letter-spacing: .13em; }
.status dd { margin: .15rem 0 0; font-size: .88rem; letter-spacing: .12em; }
.status li { margin: .65rem 0; color: #c7c4bd; font-size: .72rem; letter-spacing: .14em; }
.status li::before { content: "• "; color: var(--orange); }
.online { color: #ff6a3d !important; }
.danger { color: var(--orange) !important; }

.lower-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: rgba(255,255,255,.08);
  border-top: 1px solid rgba(255,255,255,.08);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.terminal-card {
  position: relative;
  min-height: 290px;
  padding: clamp(1.5rem, 4vw, 4rem);
  background: linear-gradient(145deg, rgba(14,15,15,.98), rgba(6,7,7,.98));
}
.terminal-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(255,255,255,.012) 3px 4px);
}
.terminal-card h2 {
  margin: .6rem 0 .75rem;
  font-family: "Barlow Condensed", sans-serif;
  font-size: clamp(1.65rem, 3vw, 2.5rem);
  letter-spacing: .07em;
}
.terminal-card p { max-width: 56ch; color: #aaa7a0; font-size: .82rem; line-height: 1.8; }
.terminal-card--center { text-align: center; }
.stamp {
  display: inline-block;
  margin-top: 1rem;
  padding: .45rem .8rem;
  border: 2px solid var(--orange);
  color: var(--orange);
  font-weight: 600;
  letter-spacing: .16em;
  transform: rotate(-2deg);
}
.terminal-line { display: grid; grid-template-columns: auto 1fr auto; gap: .8rem; align-items: center; margin-top: 1.3rem; color: var(--muted); font-size: .7rem; }
.terminal-line i { height: 2px; overflow: hidden; background: rgba(255,255,255,.1); }
.terminal-line i::after { content: ""; display: block; width: 12%; height: 100%; background: var(--orange); box-shadow: 0 0 10px var(--orange); }
.text-link { display: inline-block; margin-top: 1rem; color: var(--orange); font-size: .75rem; letter-spacing: .11em; text-decoration: none; }
.text-link:hover { text-decoration: underline; }

footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: center;
  padding: 1.2rem 4vw;
  color: #76736d;
  background: #050606;
  font-size: clamp(.52rem, .8vw, .68rem);
  letter-spacing: .11em;
}
footer strong { color: var(--orange); text-align: center; }
footer span:last-child { text-align: right; }

.noise, .scanlines { position: fixed; inset: 0; pointer-events: none; z-index: 20; }
.noise { opacity: .08; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E"); animation: jitter .2s steps(2) infinite; }
.scanlines { opacity: .15; background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(255,255,255,.05) 3px 4px); }
.ash { position: fixed; inset: 0; pointer-events: none; z-index: 5; overflow: hidden; }
.ash span { position: absolute; top: -20px; width: 2px; height: 2px; border-radius: 50%; background: #d9c2ad; opacity: .3; animation: fall linear infinite; }

.boot {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: #030404;
  transition: opacity .55s ease, visibility .55s ease;
}
.boot.is-hidden { opacity: 0; visibility: hidden; }
.boot__panel { width: min(680px, 92vw); color: #b9b7b0; font-size: clamp(.7rem, 1.7vw, .95rem); line-height: 1.85; }
.boot__panel > p:first-child { color: var(--orange); letter-spacing: .12em; }
.boot-line { opacity: 0; animation: reveal .2s forwards; }
.boot-line:nth-of-type(2) { animation-delay: .35s; }
.boot-line:nth-of-type(3) { animation-delay: .75s; }
.boot-line:nth-of-type(4) { animation-delay: 1.15s; }
.boot-line:nth-of-type(5) { animation-delay: 1.55s; }
.boot__bar { height: 4px; margin: 1.4rem 0; background: #171919; overflow: hidden; }
.boot__bar span { display: block; width: 0; height: 100%; background: var(--orange); animation: load 1.8s .25s ease forwards; }
.boot__enter { opacity: 0; color: var(--orange); letter-spacing: .22em; animation: reveal .2s 2.05s forwards, flicker 1.2s 2.1s infinite; }

@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(240,68,29,0); } 100% { box-shadow: 0 0 0 0 rgba(240,68,29,0); } }
@keyframes breathe { from { transform: scale(1.03); } to { transform: scale(1.08); } }
@keyframes jitter { 0% { transform: translate(0); } 25% { transform: translate(1%,-1%); } 50% { transform: translate(-1%,1%); } 75% { transform: translate(.5%,.5%); } }
@keyframes fall { to { transform: translate3d(70px, 110vh, 0) rotate(360deg); } }
@keyframes reveal { to { opacity: 1; } }
@keyframes load { to { width: 100%; } }
@keyframes flicker { 0%,18%,22%,25%,53%,57%,100% { opacity: 1; } 20%,24%,55% { opacity: .25; } }

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; }
  .hero__content { grid-column: 1; }
  .status { position: absolute; bottom: 70px; width: 230px; opacity: .75; }
  .status--left { left: 3vw; }
  .status--right { right: 3vw; }
  .lower-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .topbar { padding: 0 1rem; }
  .network-id { max-width: 65%; }
  .hero { min-height: 100svh; padding: 84px 1rem 46px; }
  .hero__logo { width: 125px; }
  .hero h1 { font-size: clamp(3.1rem, 18vw, 5rem); }
  .status { display: none; }
  .transmission { min-width: 0; width: 100%; }
  .actions { flex-direction: column; }
  .btn { width: 100%; }
  footer { grid-template-columns: 1fr; text-align: center; }
  footer span:last-child { text-align: center; }
}

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