:root {
  --bg: #060a10;
  --bg-2: #0a111b;
  --panel: rgba(10, 18, 29, 0.88);
  --line: rgba(138, 255, 184, 0.16);
  --line-bright: rgba(138, 255, 184, 0.45);
  --text: #e8f4ee;
  --muted: #8ea49a;
  --green: #8affb8;
  --green-2: #45e989;
  --cyan: #77d6ff;
  --orange: #ffb000;
  --switch-blue: #003b76;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.42);
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 0%, rgba(69, 233, 137, 0.08), transparent 34rem),
    radial-gradient(circle at 100% 40%, rgba(119, 214, 255, 0.06), transparent 38rem),
    linear-gradient(180deg, #05080d 0%, var(--bg) 60%, #04070b 100%);
  font-family: var(--sans);
  overflow-x: hidden;
}

::selection { background: var(--green); color: #06100a; }

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

.noise,
.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
}

.noise {
  opacity: 0.18;
  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='.92' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.17'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.scanlines {
  opacity: 0.14;
  background: repeating-linear-gradient(to bottom, transparent 0 3px, rgba(154, 255, 191, 0.08) 4px);
}

.site-header {
  width: min(1180px, calc(100% - 36px));
  height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 2;
}

.brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  text-decoration: none;
  font: 700 12px/1 var(--mono);
  letter-spacing: 0.13em;
  color: #ccebdd;
}

.brand-prompt { color: var(--green); font-size: 18px; }
.header-status {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  color: var(--muted);
  font: 600 11px/1 var(--mono);
  letter-spacing: 0.14em;
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green-2);
  box-shadow: 0 0 0 4px rgba(69,233,137,.09), 0 0 18px rgba(69,233,137,.75);
  animation: pulse 2.2s ease-in-out infinite;
}

.shell {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.tabs {
  display: flex;
  gap: 4px;
  padding: 28px 0 0;
  border-bottom: 1px solid var(--line);
}

.tab {
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #667d73;
  padding: 13px 16px 14px;
  cursor: pointer;
  font: 700 12px/1 var(--mono);
  letter-spacing: 0.11em;
  transition: .2s ease;
}
.tab span { margin-right: 8px; color: #40564d; }
.tab:hover { color: var(--text); background: rgba(138,255,184,.03); }
.tab.is-active { color: var(--green); border-bottom-color: var(--green); }
.tab.is-active span { color: var(--green); }

.panel { padding: 68px 0 32px; animation: reveal .38s ease both; }
.panel[hidden] { display: none; }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.22fr) minmax(320px, .78fr);
  align-items: center;
  gap: clamp(44px, 7vw, 90px);
  min-height: 430px;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--green);
  font: 700 11px/1.4 var(--mono);
  letter-spacing: .16em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }
h1 {
  margin-bottom: 22px;
  font: 800 clamp(44px, 6.1vw, 84px)/.92 var(--sans);
  letter-spacing: -.055em;
  text-transform: uppercase;
  max-width: 900px;
}
h1 span {
  color: transparent;
  -webkit-text-stroke: 1px rgba(138, 255, 184, .86);
  text-shadow: 0 0 35px rgba(69, 233, 137, .06);
}

.lead {
  max-width: 760px;
  color: #a8bdb4;
  font-size: clamp(16px, 1.5vw, 19px);
  line-height: 1.7;
}

.cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 30px; }
.btn {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 18px;
  text-decoration: none;
  cursor: pointer;
  border-radius: 3px;
  border: 1px solid var(--line-bright);
  font: 800 12px/1 var(--mono);
  letter-spacing: .09em;
  transition: transform .16s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  color: #031008;
  background: var(--green);
  border-color: var(--green);
  box-shadow: 0 0 30px rgba(69,233,137,.12);
}
.btn-primary:hover { background: #a2ffc7; box-shadow: 0 0 34px rgba(69,233,137,.2); }
.btn-ghost { color: #b6c9c0; background: rgba(8,15,23,.72); }
.btn-ghost:hover { border-color: var(--green); color: var(--green); }
.btn-icon { font-size: 17px; }

.terminal {
  overflow: hidden;
  border: 1px solid rgba(138,255,184,.22);
  background: linear-gradient(180deg, rgba(9,16,25,.94), rgba(5,10,16,.9));
  box-shadow: var(--shadow), inset 0 0 40px rgba(69,233,137,.025);
  transform: rotate(.45deg);
}
.terminal::after {
  content: "";
  display: block;
  height: 2px;
  width: 100%;
  background: linear-gradient(90deg, transparent, var(--green), transparent);
  opacity: .35;
}
.terminal-bar {
  height: 42px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 13px;
  color: #64796f;
  font: 500 10px/1 var(--mono);
}
.terminal-dots { display: flex; gap: 6px; }
.terminal-dots i { width: 7px; height: 7px; border-radius: 50%; background: #36463f; }
.terminal-dots i:nth-child(2) { background: #536158; }
.terminal-dots i:nth-child(3) { background: var(--green-2); box-shadow: 0 0 12px rgba(69,233,137,.35); }
.terminal-body {
  padding: 26px;
  min-height: 250px;
  font: 500 12px/1.9 var(--mono);
  color: #c8ddd3;
}
.terminal-body p { margin: 0; }
.terminal-body b { color: #e8fff4; font-weight: 600; }
.prompt { color: var(--green); margin-right: 8px; }
.muted { color: #7e958a; }
.warning { color: #d8bd77; }
.cursor { display: inline-block; color: var(--green); animation: blink 1s steps(1) infinite; }

.mission-card {
  margin-top: 68px;
  border: 1px solid var(--line);
  background: rgba(7, 13, 20, .68);
  display: grid;
  grid-template-columns: 150px minmax(0,1fr) 280px;
  gap: 28px;
  align-items: start;
  padding: 30px;
  position: relative;
}
.mission-card::before {
  content: "";
  position: absolute;
  left: -1px; top: -1px;
  width: 80px; height: 1px;
  background: var(--green);
  box-shadow: 0 0 15px rgba(69,233,137,.4);
}
.section-index {
  color: #64796f;
  font: 700 11px/1.4 var(--mono);
  letter-spacing: .12em;
}
.mission-card h2,
.hints h2 {
  margin-bottom: 10px;
  font-size: clamp(26px, 3vw, 38px);
  letter-spacing: -.035em;
}
.mission-card p { color: #98afa4; line-height: 1.7; margin-bottom: 0; }
.objective-box {
  border-left: 1px solid var(--line-bright);
  padding-left: 22px;
  display: grid;
  gap: 8px;
}
.objective-box span { color: var(--green); font: 700 10px/1 var(--mono); letter-spacing: .14em; }
.objective-box strong { font-size: 16px; line-height: 1.4; }
.objective-box small { color: #70857b; line-height: 1.5; }

.rules-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 14px 0 84px;
}
.mini-card {
  min-height: 190px;
  padding: 25px;
  border: 1px solid rgba(138,255,184,.12);
  background: rgba(10,18,29,.46);
  transition: border-color .18s ease, transform .18s ease, background .18s ease;
}
.mini-card:hover { border-color: rgba(138,255,184,.32); transform: translateY(-3px); background: rgba(10,18,29,.7); }
.mini-icon { display: block; color: var(--green); font: 400 28px/1 var(--mono); margin-bottom: 28px; }
.mini-card h3 { margin-bottom: 9px; font-size: 16px; }
.mini-card p { color: #7f978c; line-height: 1.6; font-size: 14px; margin-bottom: 0; }

.hints { scroll-margin-top: 28px; }
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 26px;
}
.section-heading p:last-child { max-width: 360px; color: #789087; font-size: 13px; line-height: 1.6; }

.hint-list { border-top: 1px solid var(--line); }
details { border-bottom: 1px solid var(--line); }
summary {
  list-style: none;
  cursor: pointer;
  padding: 21px 50px 21px 0;
  position: relative;
  font: 700 14px/1.5 var(--mono);
  color: #c5d8cf;
}
summary::-webkit-details-marker { display: none; }
summary span { color: var(--green); display: inline-block; width: 96px; font-size: 11px; letter-spacing: .12em; }
summary::after {
  content: "+";
  position: absolute;
  right: 8px;
  top: 17px;
  color: var(--green);
  font-size: 24px;
  font-weight: 300;
  transition: transform .16s ease;
}
details[open] summary::after { transform: rotate(45deg); }
details p {
  margin: -4px 0 23px 96px;
  color: #8ea49a;
  max-width: 760px;
  line-height: 1.7;
  font-size: 14px;
}

.challenge-footer {
  margin-top: 78px;
  padding: 20px 0 8px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  color: #52655c;
  font: 600 9px/1.5 var(--mono);
  letter-spacing: .1em;
}
.hashline { color: #425149; }

.built-wrap {
  min-height: 590px;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, .72fr);
  align-items: center;
  gap: clamp(44px, 8vw, 100px);
}
.built-copy h1 { max-width: 820px; }
.built-copy .lead strong { color: var(--text); }
.maker-note {
  margin-top: 38px;
  max-width: 650px;
  border-left: 1px solid var(--line-bright);
  padding-left: 22px;
}
.maker-label {
  display: block;
  color: var(--green);
  font: 700 10px/1 var(--mono);
  letter-spacing: .16em;
  margin-bottom: 13px;
}
.switch-card {
  width: 220px;
  min-height: 108px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 4px;
  overflow: hidden;
  text-decoration: none;
  position: relative;
  transition: transform .2s ease, box-shadow .2s ease;
  box-shadow: 0 18px 45px rgba(0,0,0,.28);
}
.switch-card:hover { transform: translateY(-3px); box-shadow: 0 24px 55px rgba(0,0,0,.38); }
.switch-card img { width: 100%; height: 100%; object-fit: contain; display: block; }
.switch-fallback {
  display: none;
  color: var(--switch-blue);
  font: 800 38px/1 var(--sans);
  letter-spacing: -.05em;
}
.switch-fallback span { color: var(--orange); }
.switch-card.logo-failed img { display: none; }
.switch-card.logo-failed .switch-fallback { display: inline; }
.maker-note p { color: #738a80; margin: 16px 0 0; font-size: 13px; line-height: 1.6; max-width: 530px; }

.ascii-card {
  border: 1px solid rgba(138,255,184,.2);
  background: rgba(7,13,20,.66);
  padding: 32px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.ascii-card::before {
  content: "";
  position: absolute;
  inset: -40% -40% auto auto;
  width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(69,233,137,.12), transparent 68%);
}
.ascii-card pre {
  margin: 0;
  color: #9cfcc1;
  font: 500 clamp(10px, 1.2vw, 14px)/1.55 var(--mono);
  white-space: pre;
}
.ascii-status {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px dashed rgba(138,255,184,.18);
  color: #60736b;
  font: 600 10px/1.4 var(--mono);
  letter-spacing: .08em;
}
.built-bottom {
  border-top: 1px solid var(--line);
  padding-top: 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  color: #52675d;
  font: 600 10px/1 var(--mono);
  letter-spacing: .1em;
}

@keyframes blink { 50% { opacity: 0; } }
@keyframes pulse { 50% { opacity: .45; transform: scale(.9); } }
@keyframes reveal { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

@media (max-width: 900px) {
  .hero-grid, .built-wrap { grid-template-columns: 1fr; }
  .terminal { max-width: 620px; transform: none; }
  .mission-card { grid-template-columns: 1fr; }
  .section-index { margin-bottom: -12px; }
  .objective-box { border-left: 0; border-top: 1px solid var(--line-bright); padding: 18px 0 0; }
  .rules-grid { grid-template-columns: 1fr; }
  .mini-card { min-height: auto; }
  .built-wrap { min-height: auto; }
  .ascii-card { max-width: 560px; }
}

@media (max-width: 650px) {
  .site-header, .shell { width: min(100% - 24px, 1180px); }
  .header-status { font-size: 0; }
  .header-status .status-dot { margin-right: 2px; }
  .tabs { overflow-x: auto; }
  .tab { white-space: nowrap; padding-inline: 12px; }
  .panel { padding-top: 44px; }
  h1 { font-size: clamp(40px, 13.3vw, 64px); }
  .hero-grid { gap: 44px; }
  .terminal-body { padding: 20px; font-size: 11px; overflow-x: auto; }
  .mission-card { margin-top: 54px; padding: 22px; }
  .rules-grid { margin-bottom: 64px; }
  .section-heading { display: block; }
  .section-heading p:last-child { margin-top: 12px; }
  summary span { display: block; width: auto; margin-bottom: 5px; }
  details p { margin-left: 0; }
  .challenge-footer { align-items: flex-start; flex-direction: column; }
  .hashline { display: none; }
  .ascii-card { padding: 22px 15px; overflow-x: auto; }
  .built-bottom { align-items: flex-start; flex-direction: column; }
}
