:root {
  color-scheme: dark;
  --void: #050806;
  --panel: #0a0f0c;
  --panel-2: #0e1511;
  --ink: #e8f3eb;
  --muted: #718078;
  --green: #6dff8d;
  --green-soft: rgba(109, 255, 141, 0.12);
  --line: rgba(109, 255, 141, 0.18);
  --purple: #856dff;
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  background: var(--void);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 78% 17%, rgba(58, 184, 89, 0.11), transparent 31rem),
    radial-gradient(circle at 5% 85%, rgba(107, 83, 255, 0.08), transparent 27rem),
    var(--void);
  font-family: "IBM Plex Mono", "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  opacity: 0.22;
  background: repeating-linear-gradient(to bottom, transparent 0, transparent 3px, rgba(255,255,255,.018) 4px);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: .22;
  -webkit-mask-image: linear-gradient(to bottom, black, transparent 84%);
  mask-image: linear-gradient(to bottom, black, transparent 84%);
}

a { color: inherit; }
button, input { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }

.site-header,
main,
footer {
  width: min(1180px, calc(100% - 56px));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 86px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -.02em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--green);
  border-radius: 2px;
  color: var(--green);
  background: var(--green-soft);
  box-shadow: inset 0 0 17px rgba(109,255,141,.08), 0 0 16px rgba(109,255,141,.08);
  font-size: 12px;
}

.brand-dot { color: var(--green); }

.header-note {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #829087;
  font-size: 9px;
  font-style: normal;
  letter-spacing: .1em;
}

.header-note i,
.tag i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
  animation: pulse 2.2s infinite;
}

main { padding-block: clamp(68px, 9vw, 116px) 76px; }
.intro { position: relative; }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 25px;
  color: var(--green);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
}

.eyebrow span { color: #3a6a46; }

h1 {
  max-width: 950px;
  margin: 0;
  font-family: Inter, "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(56px, 9vw, 118px);
  font-weight: 750;
  letter-spacing: -.075em;
  line-height: .84;
  text-transform: uppercase;
}

h1 em {
  position: relative;
  color: transparent;
  -webkit-text-stroke: 1px rgba(232,243,235,.82);
  font-style: normal;
  font-weight: 720;
}

h1 em::after {
  content: "";
  position: absolute;
  inset: 58% 0 4% 0;
  z-index: -1;
  background: var(--green);
  opacity: .11;
}

h1 em span {
  display: inline-block;
  color: var(--green);
  -webkit-text-stroke: 0;
  animation: blink 1s steps(1) infinite;
}

.lead {
  max-width: 590px;
  margin: 36px 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.75;
}

.lead strong { color: #b5c2b9; font-weight: 600; }

.boot-line {
  display: flex;
  gap: 26px;
  margin-top: 50px;
  padding-block: 12px;
  border-top: 1px solid rgba(255,255,255,.05);
  border-bottom: 1px solid rgba(255,255,255,.05);
  color: #415048;
  font-size: 8px;
  letter-spacing: .1em;
}

.quest-hint {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 10px;
  margin: 18px 0 0 auto;
  padding: 8px 10px;
  border: 1px dashed rgba(109,255,141,.14);
  color: #46544b;
  cursor: help;
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease;
}

.quest-hint:hover {
  color: #7e9184;
  border-color: rgba(109,255,141,.38);
  background: rgba(109,255,141,.025);
}

.quest-ping {
  display: grid;
  width: 19px;
  height: 19px;
  place-items: center;
  border: 1px solid currentColor;
  color: var(--green);
  font-size: 9px;
  animation: pulse 2.2s infinite;
}

.quest-hint > span:last-child { display: grid; gap: 3px; }
.quest-hint strong { color: inherit; font-size: 8px; letter-spacing: .1em; }
.quest-hint small { color: #344139; font-size: 7px; letter-spacing: .04em; }

.projects { margin-top: clamp(76px, 11vw, 134px); }

.section-label {
  display: flex;
  justify-content: space-between;
  margin: 0 0 14px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
  color: #526159;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .12em;
}

.section-label span:first-child { color: var(--green); }

.project-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(280px, .88fr) minmax(380px, 1.12fr);
  min-height: 480px;
  overflow: hidden;
  border: 1px solid var(--line);
  color: var(--ink);
  background: rgba(8,13,10,.92);
  text-decoration: none;
  box-shadow: 0 34px 90px rgba(0,0,0,.35);
  transition: border-color 220ms ease, box-shadow 220ms ease;
}

.project-card::before,
.project-card::after {
  content: "";
  position: absolute;
  z-index: 4;
  width: 14px;
  height: 14px;
  pointer-events: none;
}

.project-card::before { top: 8px; left: 8px; border-top: 1px solid var(--green); border-left: 1px solid var(--green); }
.project-card::after { right: 8px; bottom: 8px; border-right: 1px solid var(--green); border-bottom: 1px solid var(--green); }

.story-art {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 410px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(135deg, transparent 45%, rgba(109,255,141,.08) 45.2%, transparent 45.5%),
    radial-gradient(circle at center, rgba(109,255,141,.12), transparent 52%),
    #071009;
}

.story-art::before {
  content: "";
  position: absolute;
  inset: -30%;
  z-index: -1;
  opacity: .28;
  background-image:
    linear-gradient(rgba(109,255,141,.32) 1px, transparent 1px),
    linear-gradient(90deg, rgba(109,255,141,.32) 1px, transparent 1px);
  background-size: 30px 30px;
  transform: perspective(450px) rotateX(58deg) rotateZ(-14deg) scale(1.3);
}

.story-symbol {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  display: grid;
  width: 148px;
  height: 148px;
  place-items: center;
  transform: translate(-50%, -50%);
  border: 1px solid var(--green);
  color: var(--green);
  background: #080d0a;
  box-shadow: 0 0 0 10px rgba(109,255,141,.025), 0 0 50px rgba(109,255,141,.14);
  font-family: Georgia, serif;
  font-size: 82px;
  font-style: italic;
  transition: transform 450ms cubic-bezier(.2,.8,.2,1), box-shadow 300ms ease;
}

.story-symbol::before,
.story-symbol::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
}

.story-symbol::before { top: -6px; left: -6px; border-top: 2px solid var(--green); border-left: 2px solid var(--green); }
.story-symbol::after { right: -6px; bottom: -6px; border-right: 2px solid var(--green); border-bottom: 2px solid var(--green); }

.story-orbit {
  position: absolute;
  top: 50%;
  left: 50%;
  border: 1px dashed rgba(109,255,141,.4);
  border-radius: 50%;
  transform: translate(-50%, -50%) rotate(-18deg);
}

.orbit-one { width: 300px; height: 150px; animation: orbit 18s linear infinite; }
.orbit-two { width: 380px; height: 215px; transform: translate(-50%, -50%) rotate(42deg); opacity: .45; animation: orbit2 24s linear infinite; }
.spark { position: absolute; color: var(--green); font-size: 18px; }
.spark-one { top: 20%; left: 17%; }
.spark-two { right: 14%; bottom: 18%; font-size: 10px; }

.art-caption {
  position: absolute;
  bottom: 24px;
  left: 25px;
  color: #60806a;
  font-size: 8px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: .12em;
}

.project-content {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(30px, 4.2vw, 56px);
  background:
    linear-gradient(90deg, rgba(109,255,141,.035) 1px, transparent 1px),
    var(--panel);
  background-size: 80px 100%;
}

.project-topline { display: flex; align-items: center; justify-content: space-between; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid rgba(109,255,141,.22);
  color: #7d9183;
  background: rgba(109,255,141,.035);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.tag i { width: 5px; height: 5px; }

.arrow {
  color: #46554c;
  font-size: 24px;
  transition: color 200ms ease, transform 250ms ease;
}

.project-number {
  margin: 0 0 15px;
  color: #536158;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .1em;
}

h2 {
  margin: 0 0 24px;
  color: #effff2;
  font-family: Inter, "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(64px, 8vw, 100px);
  font-weight: 760;
  letter-spacing: -.065em;
  line-height: .82;
  text-transform: uppercase;
}

h2 span { color: var(--green); }

.project-copy > h2 + p {
  max-width: 490px;
  margin: 0;
  color: #718078;
  font-size: 12px;
  line-height: 1.7;
}

.project-copy .project-aside {
  margin-top: 14px;
  color: #405047;
  font-size: 8px;
  letter-spacing: .04em;
}

.visit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 17px;
  border-top: 1px solid var(--line);
  color: #b4c1b8;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
}

.visit span { color: var(--green); font-size: 9px; transition: transform 250ms ease; }
.project-card:hover { border-color: rgba(109,255,141,.55); box-shadow: 0 34px 100px rgba(0,0,0,.5), 0 0 35px rgba(109,255,141,.05); }
.project-card:hover .story-symbol { transform: translate(-50%, -50%) scale(1.055); box-shadow: 0 0 0 14px rgba(109,255,141,.03), 0 0 70px rgba(109,255,141,.22); }
.project-card:hover .arrow { color: var(--green); transform: translate(4px,-4px); }
.project-card:hover .visit span { transform: translateX(4px); }

.fun-zone { margin-top: clamp(76px, 11vw, 134px); }

.telemetry {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.telemetry article {
  display: flex;
  min-height: 142px;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(109,255,141,.025), transparent 62%);
}

.metric-label {
  color: #4b5b51;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .12em;
}

.telemetry strong {
  color: var(--green);
  font-family: Inter, "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(18px, 2vw, 27px);
  letter-spacing: -.04em;
}

.telemetry small {
  color: #48564d;
  font-size: 8px;
  line-height: 1.45;
}

.fun-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 16px;
}

.fun-button {
  display: flex;
  min-height: 47px;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  border: 1px solid rgba(109,255,141,.15);
  color: #66766c;
  background: rgba(8,13,10,.74);
  cursor: pointer;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .07em;
  text-align: center;
  text-decoration: none;
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.fun-button:hover,
.fun-button:focus-visible {
  border-color: rgba(109,255,141,.5);
  color: var(--green);
  background: rgba(109,255,141,.05);
  outline: none;
  transform: translateY(-2px);
}

.fun-button.primary {
  border-color: rgba(109,255,141,.38);
  color: var(--green);
  background: rgba(109,255,141,.06);
}

.fun-button.danger { border-color: rgba(255,100,100,.17); color: #895c5c; }
.fun-button.danger:hover { border-color: rgba(255,100,100,.55); color: #ff8585; background: rgba(255,100,100,.05); }

.action-message {
  min-height: 16px;
  margin: 12px 0 0;
  color: #46564c;
  font-size: 8px;
  letter-spacing: .04em;
  text-align: right;
}

.changelog {
  margin-top: 28px;
  border: 1px solid rgba(109,255,141,.1);
  background: rgba(5,8,6,.45);
}

.changelog summary {
  display: flex;
  justify-content: space-between;
  padding: 14px 16px;
  color: #58675e;
  cursor: pointer;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .1em;
  list-style: none;
}

.changelog summary::-webkit-details-marker { display: none; }
.changelog summary span { color: #344139; }
.changelog[open] summary { border-bottom: 1px solid rgba(109,255,141,.1); color: #7e9184; }

.changelog ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 17px 20px 19px 38px;
  color: #5d6c63;
  font-size: 9px;
  line-height: 1.55;
}

.changelog code { margin-right: 8px; color: var(--green); background: transparent; }

.modal-open { overflow: hidden; }

.terminal-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(1,4,2,.82);
  backdrop-filter: blur(8px);
}

.terminal-window {
  width: min(760px, 100%);
  overflow: hidden;
  border: 1px solid rgba(109,255,141,.45);
  background: #050806;
  box-shadow: 0 0 0 1px rgba(109,255,141,.06), 0 30px 120px rgba(0,0,0,.75), 0 0 50px rgba(109,255,141,.08);
}

.terminal-bar {
  display: flex;
  min-height: 43px;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px 0 15px;
  border-bottom: 1px solid rgba(109,255,141,.2);
  color: #6f8175;
  background: #0b110d;
  font-size: 9px;
  letter-spacing: .08em;
}

.terminal-bar span { display: flex; align-items: center; gap: 8px; }
.terminal-bar i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 9px var(--green); }

.terminal-bar button {
  width: 30px;
  height: 30px;
  border: 0;
  color: #5a685f;
  background: transparent;
  cursor: pointer;
  font-size: 20px;
}

.terminal-bar button:hover { color: var(--green); }

.terminal-output {
  height: min(430px, 55vh);
  overflow-y: auto;
  padding: 18px;
  color: #a5b4aa;
  font-size: 11px;
  line-height: 1.6;
  scrollbar-color: #294532 #080c09;
}

.terminal-output p {
  min-height: 1.6em;
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.terminal-output .muted { color: #4d5a51; }
.terminal-output .command { color: #d5e2d8; }
.terminal-output .accent { color: var(--green); }
.terminal-output .error { color: #ff7d7d; }

.terminal-form {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 18px;
  border-top: 1px solid rgba(109,255,141,.18);
  color: var(--green);
  background: #080c09;
  font-size: 10px;
}

.terminal-form label { flex: none; }
.terminal-form input {
  width: 100%;
  border: 0;
  outline: 0;
  color: #dbe9de;
  background: transparent;
  caret-color: var(--green);
}

.terminal-form input:disabled { opacity: .3; }

.portal-toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 150;
  max-width: min(380px, calc(100% - 40px));
  padding: 13px 16px;
  border: 1px solid var(--green);
  color: var(--green);
  background: #071009;
  box-shadow: 0 15px 50px rgba(0,0,0,.5);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .07em;
}

body.rgb-mode {
  animation: rgb-overdrive 2.4s linear infinite;
}

body.rgb-mode::before { opacity: .42; }
body.rgb-mode .project-card,
body.rgb-mode .telemetry,
body.rgb-mode .terminal-window { box-shadow: 0 0 45px rgba(109,255,141,.25); }

.error-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.error-shell {
  width: min(780px, 100%);
  margin: 0;
  padding: 0;
}

.error-brand { margin-bottom: 50px; }

.error-code {
  margin: 0 0 12px;
  color: var(--green);
  font-size: 10px;
  letter-spacing: .14em;
}

.error-shell h1 {
  margin-bottom: 28px;
  font-size: clamp(70px, 17vw, 150px);
}

.error-copy {
  max-width: 600px;
  margin: 0;
  color: #66756b;
  font-size: 12px;
  line-height: 1.75;
}

.error-log {
  margin: 36px 0;
  padding: 18px;
  border: 1px solid rgba(109,255,141,.15);
  color: #4e5d53;
  background: #070b08;
  font: 10px/1.7 "IBM Plex Mono", monospace;
  white-space: pre-wrap;
}

.error-actions { display: flex; flex-wrap: wrap; gap: 9px; }

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 23px 34px;
  border-top: 1px solid var(--line);
  color: #455148;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .1em;
}

.footer-status { display: flex; align-items: center; gap: 8px; }
.footer-status i { width: 5px; height: 5px; border-radius: 50%; background: var(--green); box-shadow: 0 0 9px var(--green); }
.rpi-note { color: #66736a; text-align: center; text-transform: none; }
.heart { color: var(--green); font-weight: 700; text-shadow: 0 0 8px rgba(109,255,141,.45); }

@keyframes pulse { 50% { opacity: .35; } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes orbit { to { transform: translate(-50%,-50%) rotate(342deg); } }
@keyframes orbit2 { to { transform: translate(-50%,-50%) rotate(-318deg); } }
@keyframes rgb-overdrive { to { filter: hue-rotate(360deg); } }

@media (max-width: 760px) {
  .site-header, main, footer { width: min(100% - 30px, 1180px); }
  .site-header { min-height: 72px; }
  main { padding-top: 58px; }
  h1 { font-size: clamp(50px, 15vw, 82px); line-height: .87; }
  .lead { margin: 28px 0 0; }
  .boot-line { gap: 12px; justify-content: space-between; overflow: hidden; white-space: nowrap; }
  .project-card { grid-template-columns: 1fr; }
  .story-art { min-height: 315px; border-right: 0; border-bottom: 1px solid var(--line); }
  .project-content { min-height: 390px; }
  .story-symbol { width: 124px; height: 124px; font-size: 68px; }
  .orbit-one { width: 245px; }
  .orbit-two { width: 315px; }
  .telemetry { grid-template-columns: repeat(2, 1fr); }
  .fun-actions { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 430px) {
  .header-note { font-size: 0; }
  .header-note i { display: block; }
  .project-content { min-height: 370px; padding: 26px; }
  .story-art { min-height: 275px; }
  .project-copy > p:last-child { font-size: 11px; }
  .boot-line span:nth-child(2) { display: none; }
  .quest-hint { margin-left: 0; }
  .telemetry { grid-template-columns: 1fr; }
  .telemetry article { min-height: 122px; }
  .fun-actions { grid-template-columns: 1fr; }
  .action-message { text-align: left; }
  .terminal-modal { padding: 8px; }
  .terminal-output { height: 62vh; padding: 14px; font-size: 10px; }
  .terminal-form { padding: 12px; }
  footer { flex-wrap: wrap; gap: 14px; }
  .rpi-note { order: 3; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .header-note i, .tag i, h1 em span, .quest-ping, .orbit-one, .orbit-two { animation: none; }
  .story-symbol, .arrow, .visit span, .project-card { transition: none; }
  body.rgb-mode { animation: none; }
}
