:root {
  --bg: #070a1a;
  --panel: rgba(16, 22, 52, .72);
  --line: rgba(140, 160, 255, .22);
  --text: #e8ecff;
  --muted: #9aa3d0;
  --teal: #3fe0c5;
  --coral: #ff6b5e;
  --gold: #ffc857;
  --blue: #6c8cff;
  --mono: 'Space Mono', ui-monospace, monospace;
  --sans: 'Space Grotesk', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 17px/1.6 var(--sans);
  background-image: radial-gradient(ellipse at 20% -10%, #1a2260 0, transparent 55%), radial-gradient(ellipse at 90% 30%, #2a124a 0, transparent 50%);
  background-attachment: fixed;
}
#stars { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; }
a { color: var(--teal); }
main, .hud { position: relative; z-index: 1; }
main { max-width: 1040px; margin: 0 auto; padding: 0 16px 80px; }

/* HUD */
.hud {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; align-items: center; gap: 24px; padding: 10px 20px;
  background: rgba(7, 10, 26, .82); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 13px;
}
.hud-brand { color: var(--text); text-decoration: none; font-weight: 700; letter-spacing: .05em; }
.hud-brand span { color: var(--teal); }
.hud-nav { display: flex; gap: 18px; margin-left: auto; }
.hud-nav a { color: var(--muted); text-decoration: none; }
.hud-nav a:hover, .hud-nav a:focus-visible { color: var(--teal); }
.hud-burger { display: none; width: 38px; height: 34px; padding: 0; background: none; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; flex-direction: column; justify-content: center; align-items: center; gap: 4px; }
.hud-burger span { display: block; width: 18px; height: 2px; background: var(--text); border-radius: 1px; transition: transform .2s, opacity .2s; }
.hud-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.hud-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hud-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Hero */
.hero { position: relative; min-height: 100vh; display: flex; align-items: center; gap: 48px; padding-top: 80px; }
.hero-text { flex: 1; }
.kicker { font-family: var(--mono); color: var(--teal); margin: 0 0 8px; }
h1 { font-size: clamp(2.6rem, 8vw, 5rem); line-height: 1.05; margin: 0; letter-spacing: -.02em; }
.role { font-family: var(--mono); color: var(--gold); margin: 10px 0 18px; }
.lead { max-width: 560px; color: var(--muted); }
.hero-avatar { text-align: center; }
.astro { width: clamp(150px, 24vw, 240px); image-rendering: pixelated; animation: float 6s ease-in-out infinite; filter: drop-shadow(0 0 28px rgba(63, 224, 197, .35)); }
.tag { font-family: var(--mono); font-size: 13px; margin-top: 14px; }
.tag span { color: var(--teal); }
@keyframes float { 50% { transform: translateY(-12px) rotate(2deg); } }

.cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.btn {
  display: inline-block; padding: 10px 18px; border: 1px solid var(--line); border-radius: 8px;
  color: var(--text); text-decoration: none; font-family: var(--mono); font-size: 14px; background: var(--panel);
  transition: transform .15s, border-color .15s;
}
.btn:hover, .btn:focus-visible { transform: translateY(-2px); border-color: var(--teal); }
.btn.primary { background: var(--teal); color: #04221d; border-color: var(--teal); font-weight: 700; }

/* Sections */
section:not(.hero) { padding: 72px 0 24px; }
h2 { font-size: 2rem; margin: 0 0 6px; }
h2 span { font-family: var(--mono); color: var(--teal); font-size: .9rem; margin-right: 10px; vertical-align: middle; }
.sub { color: var(--muted); margin: 0 0 32px; max-width: 680px; }
h3 { margin: 0 0 6px; font-size: 1.25rem; }
h3 em { font-style: normal; color: var(--teal); font-size: .95rem; font-family: var(--mono); display: block; margin-top: 2px; }
.meta { font-family: var(--mono); font-size: 12.5px; color: var(--gold); margin: 0 0 4px; }
.card, .quest { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 20px 22px; }
.card ul { margin: 10px 0 0; padding-left: 18px; color: var(--muted); font-size: 15.5px; }
.card li { margin: 4px 0; }

/* Route */
.route { list-style: none; margin: 0; padding: 0 0 0 44px; position: relative; }
.route::before { content: ''; position: absolute; left: 13px; top: 8px; bottom: 8px; border-left: 2px dashed var(--line); }
.stop { position: relative; margin-bottom: 22px; }
.planet {
  position: absolute; left: -44px; top: 14px; width: 28px; height: 28px; border-radius: 50%;
  box-shadow: inset -7px -7px 0 rgba(0, 0, 0, .3), 0 0 16px currentColor;
}
.p-teal { background: var(--teal); color: var(--teal); }
.p-red { background: var(--coral); color: var(--coral); }
.p-gold { background: var(--gold); color: var(--gold); }
.p-blue { background: var(--blue); color: var(--blue); }
.stop.now .planet { animation: pulse 2.4s infinite; }
.stop.now .card { border-color: rgba(63, 224, 197, .55); }
@keyframes pulse { 50% { box-shadow: inset -7px -7px 0 rgba(0, 0, 0, .3), 0 0 30px currentColor; } }

/* Grids */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 18px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.quest { display: flex; flex-direction: column; gap: 4px; transition: transform .2s, border-color .2s; }
.quest:hover { transform: translateY(-4px); border-color: var(--teal); }
.quest p { margin: 6px 0; color: var(--muted); font-size: 15.5px; }
.quest .meta { color: var(--gold); margin: 0; }
.gap { margin-top: 18px; }
.stack { font-family: var(--mono); font-size: 12px !important; color: var(--teal) !important; }
.links { margin-top: auto !important; }
.badge { align-self: flex-start; font-family: var(--mono); font-size: 11.5px; padding: 2px 10px; border-radius: 99px; border: 1px solid; }
.badge.done { color: var(--teal); }
.badge.wip { color: var(--gold); }
.badge.hw { color: var(--coral); }

/* Skill tree */
.tree { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.branch { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; }
.branch h3 { font-family: var(--mono); font-size: 14px; color: var(--teal); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 10px; }
.branch ul { list-style: none; margin: 0; padding: 0; }
.branch li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 5px 0; font-size: 15px; }
.branch li::after {
  content: ''; flex: none; width: 60px; height: 8px; border-radius: 2px;
  background: linear-gradient(90deg, var(--gold) calc(var(--p, 0) * 20%), rgba(255, 255, 255, .12) 0);
  -webkit-mask: repeating-linear-gradient(90deg, #000 0 10px, transparent 10px 12px);
  mask: repeating-linear-gradient(90deg, #000 0 10px, transparent 10px 12px);
}
.langs { margin-top: 24px; color: var(--muted); font-size: 15px; }

.foot { margin-top: 48px; font-family: var(--mono); font-size: 12.5px; color: var(--muted); }

/* Toast + warp */
#toast {
  position: fixed; bottom: 20px; right: 20px; z-index: 20; padding: 10px 16px; border-radius: 8px;
  background: var(--panel); border: 1px solid var(--gold); color: var(--gold);
  font-family: var(--mono); font-size: 13px; opacity: 0; transform: translateY(12px); transition: .3s; pointer-events: none;
}
#toast.show { opacity: 1; transform: none; }

@media (max-width: 760px) {
  .hud-burger { display: inline-flex; }
  .hud-achv { margin-left: auto; }
  .hud-nav { display: none; }
  .hud-nav.open { display: flex; flex-direction: column; gap: 0; position: fixed; top: 52px; left: 0; right: 0; padding: 4px 20px 10px; background: #0a0e24; border-bottom: 1px solid var(--line); }
  .hud-nav.open a { padding: 12px 0; font-size: 15px; border-bottom: 1px solid var(--line); }
  .hud-nav.open a:last-child { border-bottom: 0; }
  .hero { flex-direction: column-reverse; justify-content: center; gap: 20px; text-align: center; }
  .lead { margin: 0 auto; }
  .cta { justify-content: center; }
  .route { padding-left: 38px; }
  .planet { left: -38px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .astro, .stop.now .planet { animation: none; }
  * { transition: none !important; }
}

/* Forms */
.forms { margin-top: 32px; align-items: stretch; }
.form { gap: 12px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--muted); }
.form input:not([type=radio]):not([type=hidden]), .form textarea {
  font: inherit; color: var(--text); background: rgba(7, 10, 26, .6);
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px;
}
.form input:focus, .form textarea:focus { outline: 2px solid var(--teal); outline-offset: 1px; }
.form .btn { align-self: flex-start; cursor: pointer; }
.form .btn:disabled { opacity: .6; cursor: wait; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.hint { margin: 0 0 4px; }
.status { min-height: 1.4em; margin: 0; font-family: var(--mono); font-size: 13px; }
.status.ok { color: var(--teal) !important; }
.status.err { color: var(--coral) !important; }
.stars { border: 0; padding: 0; margin: 0; }
.stars legend { font-size: 14px; color: var(--muted); padding: 0; margin-bottom: 2px; }
.starrow { display: flex; flex-direction: row-reverse; justify-content: flex-end; }
.stars input { position: absolute; opacity: 0; }
.stars label { font-size: 30px; line-height: 1; color: rgba(255, 255, 255, .2); cursor: pointer; flex-direction: row; padding: 0 2px; }
.stars label:hover, .stars label:hover ~ label, .stars input:checked ~ label { color: var(--gold); }
.stars input:focus-visible + label { outline: 2px solid var(--teal); border-radius: 4px; }

/* Achievements */
.achv-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.achv-grid li { background: var(--panel); border: 1px dashed var(--line); border-radius: 12px; padding: 14px 18px; display: flex; flex-direction: column; gap: 2px; opacity: .55; }
.achv-grid b { font-family: var(--mono); font-size: 14px; }
.achv-grid span { font-size: 14px; color: var(--muted); }
.achv-grid li.on { opacity: 1; border: 1px solid var(--gold); }
.achv-grid li.on b::before { content: '\2605'; margin-right: 7px; color: var(--gold); }
.achv-count { font-family: var(--mono); font-size: 13px; color: var(--muted); margin-top: 14px; }

/* Astronaut states */
.astro .ov { display: none; }
.astro[data-state="sleep"] .ov-sleep, .astro[data-state="work"] .ov-work,
.astro[data-state="quest"] .ov-quest, .astro[data-state="off"] .ov-off, .astro[data-state="annoyed"] .ov-annoyed { display: inline; }
.astro[data-state="sleep"] .visor { fill: #1b5b52; }
.astro[data-state="sleep"] .eye { display: none; }
.astro[data-state="off"] .eye { display: none; }
.zzz { animation: zzz 2.4s ease-in-out infinite; }
@keyframes zzz { 0%, 100% { opacity: .15; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .zzz { animation: none; } }
.astro { overflow: visible; }

/* Interests */
.chips { list-style: none; margin: 4px 0 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { font-family: var(--mono); font-size: 12.5px; padding: 3px 12px; border: 1px solid var(--line); border-radius: 99px; color: var(--teal); background: rgba(63, 224, 197, .07); }
.private { font-size: 13.5px; color: var(--muted); }
.links { display: flex; flex-wrap: wrap; gap: 4px 14px; }

/* Achievements panel (opened from the header) */
.hud-achv { font: inherit; color: var(--gold); background: none; border: 1px solid var(--line); border-radius: 8px; padding: 3px 10px; cursor: pointer; }
.hud-achv:hover, .hud-achv[aria-expanded="true"] { border-color: var(--gold); }
.hud-achv.pulse { animation: achvpulse 1s ease-in-out 3; }
@keyframes achvpulse { 50% { box-shadow: 0 0 14px var(--gold); } }
.achv-panel { position: fixed; top: 54px; right: 12px; z-index: 12; width: min(400px, calc(100vw - 24px)); max-height: calc(100vh - 70px); overflow: auto; background: #0a0e24; border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; box-shadow: 0 12px 40px rgba(0, 0, 0, .5); }
.achv-panel[hidden] { display: none; }
.achv-panel h2 { font-size: 1.3rem; }
.achv-panel .sub { margin-bottom: 14px; font-size: 14px; }
.achv-panel .achv-grid { grid-template-columns: 1fr; }
@media (prefers-reduced-motion: reduce) { .hud-achv.pulse { animation: none; } }

/* Clickable astronaut */
.astro { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.achv-panel .achv-grid li { padding: 10px 14px; }
.astro { transition: scale .6s ease-in, translate 1.8s cubic-bezier(.22, .8, .3, 1); }
@media (prefers-reduced-motion: reduce) { .astro { transition: none; } }
.astro[data-state="annoyed"] .visor { fill: #ff8066; }
.anger { animation: anger .5s ease-in-out infinite alternate; }
@keyframes anger { to { transform: scale(1.25); transform-box: fill-box; transform-origin: center; } }
@media (prefers-reduced-motion: reduce) { .anger { animation: none; } }
.astro[data-state="annoyed"] .eye { display: none; }
.achv-panel h2 { margin-bottom: 14px; }

/* Locked achievements: descriptions in Aurebesh (Star Wars alphabet, OFL font by silvinor) */
@font-face { font-family: 'Aurebesh'; src: url('../fonts/Aurebesh.ttf') format('truetype'); font-display: swap; }
.achv-grid li:not(.on):not([data-secret]) span { font-family: 'Aurebesh', var(--sans); font-size: 13px; letter-spacing: .04em; }

/* Decode-on-load: hero text starts in Aurebesh and flips to English letter by letter */
.js:not(.ready) :is(.hud-brand, .hud-nav a, .hero-text .kicker, .hero-text h1, .hero-text .role, .hero-text .lead, .hero-text .btn, .hero .tag) { visibility: hidden; }
.dw { display: inline-block; white-space: nowrap; }
.dw .a { font-family: 'Aurebesh', var(--sans); opacity: .7; font-size: calc(1em * var(--s, 1)); }
.dw > span { line-height: 0; } /* Aurebesh font metrics must not make the lines taller than the final English text */
.cursor { animation: blink 1s steps(1) infinite; }
.cursor.typing { animation: none; }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .cursor { animation: none; } }

/* Equal-height forms: text areas soak up the spare room, buttons sit on the same line at the bottom */
.form label:has(textarea) { flex: 1; }
.form textarea { flex: 1; min-height: 110px; resize: vertical; }
.form .btn { margin-top: auto; }

/* Spaceship: docked bottom right of the first screen (top right on phones), later cruises through the background */
.ship { position: absolute; right: 14px; bottom: 14px; width: 38px; z-index: 2; pointer-events: none; filter: drop-shadow(0 0 10px rgba(63, 224, 197, .45)); animation: shipglow 3s ease-in-out infinite; }
.ship svg, .cruise svg { display: block; width: 100%; overflow: visible; }
.flame { display: none; }
.thrust .flame { display: inline; animation: flicker .12s steps(2) infinite; }
@keyframes flicker { 50% { opacity: .55; } }
@keyframes shipglow { 50% { filter: drop-shadow(0 0 16px rgba(63, 224, 197, .8)); } }
.cruise { position: absolute; left: 0; top: 0; width: 34px; z-index: 0; pointer-events: none; visibility: hidden; opacity: .85; filter: drop-shadow(0 0 8px rgba(63, 224, 197, .4)); }
@media (prefers-reduced-motion: reduce) { .ship { animation: none; } .thrust .flame { animation: none; } }
.status a { color: inherit; }
#contact { position: relative; }
/* the background ship lives in page space: scroll away and you leave it behind */
.sky { position: absolute; top: 0; left: 0; width: 100%; overflow: hidden; pointer-events: none; z-index: 0; }
/* the astronaut floats over the whole page, but only his body catches clicks */
.astro { position: relative; z-index: 5; pointer-events: none; }
.astro * { pointer-events: auto; }
body { position: relative; } /* absolute things (dock, background ship) are placed in page space */
.warp-toggle { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 13px; color: var(--gold); cursor: pointer; }
.warp-toggle[hidden] { display: none; }
.warp-toggle input { accent-color: var(--gold); }

/* On-screen Konami controller (inside the secret achievement tile) */
.achv-grid li[data-secret]:has(.pad:not([hidden])) { opacity: 1; border-style: solid; border-color: var(--teal); }
.achv-grid li[data-secret] { cursor: pointer; }
.achv-grid li.on[data-secret] { cursor: default; }
.pad { display: grid; grid-template-columns: 1fr 1fr; align-items: center; justify-items: center; gap: 10px; margin-top: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(7, 10, 26, .8); cursor: default; }
.pad[hidden] { display: none; }
.pad button { font: 700 14px var(--mono); color: var(--text); background: #1b2150; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.pad button:active { transform: scale(.92); background: #2a3270; }
.pad-dpad { display: grid; grid-template-columns: repeat(3, 42px); grid-template-rows: repeat(3, 42px); gap: 3px; }
.pad-dpad button { font-size: 16px; }
.pad-dpad button[data-k="ArrowUp"] { grid-area: 1 / 2; }
.pad-dpad button[data-k="ArrowLeft"] { grid-area: 2 / 1; }
.pad-dpad button[data-k="ArrowRight"] { grid-area: 2 / 3; }
.pad-dpad button[data-k="ArrowDown"] { grid-area: 3 / 2; }
.pad-ab { display: flex; gap: 12px; align-items: center; transform: rotate(-18deg); }
.pad-ab button { width: 48px; height: 48px; border-radius: 50%; font-size: 16px; }
.pad-ab button[data-k="b"] { background: #5a3d10; color: var(--gold); border-color: var(--gold); }
.pad-ab button[data-k="a"] { background: #0f423b; color: var(--teal); border-color: var(--teal); }
.pad-leds { grid-column: 1 / 3; display: flex; gap: 6px; justify-content: center; }
.pad-leds i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, .15); transition: background .15s, box-shadow .15s; }
.pad-leds i.on { background: var(--teal); box-shadow: 0 0 7px var(--teal); }
.pad.wrong .pad-leds i { background: var(--coral); box-shadow: 0 0 7px var(--coral); }
.pad.wrong { animation: padshake .3s; }
@keyframes padshake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
@media (prefers-reduced-motion: reduce) { .pad.wrong { animation: none; } }

/* Project screenshots: a thumbnail strip that opens full size in a dialog */
/* Only the first two thumbnails are shown; the rest are reached with the arrows in the viewer,
   so a project with a lot of screenshots does not stretch the card it sits in. */
.shots { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0 4px; }
.shots .shot.extra { display: none; }
.shots .shot[hidden] { display: none; }  /* beats the .shot display:block above */
.shot {
  position: relative; display: block; padding: 0; overflow: hidden; cursor: pointer;
  background: none; border: 1px solid var(--line); border-radius: 8px;
  transition: border-color .2s, transform .2s;
}
.shot img { display: block; width: 100%; height: 92px; object-fit: cover; }
.shot span {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 7px 6px 3px;
  font-family: var(--mono); font-size: 10.5px; color: var(--text); text-align: center;
  background: linear-gradient(transparent, rgba(7, 10, 26, .92));
}
.shot:hover, .shot:focus-visible { border-color: var(--teal); transform: translateY(-2px); }
.shot .more {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 13px; color: var(--text); background: rgba(7, 10, 26, .66);
}
.shot:hover .more, .shot:focus-visible .more { background: rgba(7, 10, 26, .45); }
@media (prefers-reduced-motion: reduce) { .shot:hover, .shot:focus-visible { transform: none; } }

.lightbox {
  width: min(94vw, 1100px); max-width: none; max-height: 92vh; padding: 0; overflow: visible;
  color: var(--text); background: #0a0f28; border: 1px solid var(--line); border-radius: 14px;
}
.lightbox::backdrop { background: rgba(4, 6, 18, .86); }
.lightbox img, .lightbox video { display: block; width: 100%; height: auto; max-height: calc(92vh - 52px);
  object-fit: contain; border-radius: 14px 14px 0 0; background: #060a1c; }
.lightbox [hidden] { display: none; }
.lightbox p { margin: 0; padding: 11px 16px; font-size: 13.5px; color: var(--muted); }
.lb-close, .lb-nav {
  position: absolute; z-index: 1; display: flex; align-items: center; justify-content: center;
  font: 400 20px/1 var(--sans); color: var(--text); cursor: pointer;
  background: rgba(7, 10, 26, .82); border: 1px solid var(--line); border-radius: 50%;
}
.lb-close { top: -14px; right: -14px; width: 36px; height: 36px; font-size: 15px; }
.lb-nav { top: 50%; width: 42px; height: 42px; margin-top: -21px; font-size: 26px; }
.lb-prev { left: -16px; }
.lb-next { right: -16px; }
.lb-close:hover, .lb-nav:hover, .lb-close:focus-visible, .lb-nav:focus-visible { color: var(--teal); border-color: var(--teal); }
@media (max-width: 600px) {
  .lightbox { width: 96vw; }
  .lb-prev { left: 4px; }
  .lb-next { right: 4px; }
  .lb-close { top: 4px; right: 4px; }
}


/* Skill tree without pips: the list reads as a list, not a scorecard */
.branch li { justify-content: flex-start; }
.branch li::after { content: none; }

/* Feedback: a quiet disclosure under the contact form, not a second headline act */
.forms { max-width: 560px; }
.feedback { margin-top: 26px; max-width: 560px; }
.feedback > summary { font-family: var(--mono); font-size: 13.5px; color: var(--muted); cursor: pointer; padding: 6px 0; }
.feedback > summary:hover, .feedback > summary:focus-visible { color: var(--teal); }
.feedback[open] > summary { margin-bottom: 10px; color: var(--teal); }

/* HUD: plain-mode switch */
.hud-mode { font: inherit; color: var(--muted); background: none; border: 1px solid var(--line); border-radius: 8px; padding: 3px 10px; cursor: pointer; white-space: nowrap; }
.hud-mode:hover, .hud-mode:focus-visible { color: var(--teal); border-color: var(--teal); }
.hud-mode[aria-pressed="true"] { color: var(--teal); border-color: var(--teal); }
@media (max-width: 760px) { .hud { gap: 10px; padding: 10px 14px; } .hud-mode { padding: 3px 8px; } }

/* --- Plain mode ------------------------------------------------------------
   Same content, none of the show: no starfield, no astronaut, no achievements,
   no animation. For the reader who came to find out what I have done. */
.plain #stars, .plain .ship, .plain .cruise, .plain .hero-avatar, .plain .hero-text .kicker,
.plain .hud-achv, .plain .achv-panel, .plain #toast, .plain .feedback { display: none !important; }
.plain body { background-image: none; background-color: #0a0e20; }
.plain * { animation: none !important; transition: none !important; }
.plain { scroll-behavior: auto; }
.plain :is(.hud-brand, .hud-nav a, .hero-text h1, .hero-text .role, .hero-text .lead, .hero-text .btn, .hero .tag) { visibility: visible !important; }
.plain .hero { display: block; min-height: 0; padding: 96px 0 4px; }
.plain .hero-text h1 { font-size: clamp(2.1rem, 6vw, 3.1rem); }
.plain .lead { max-width: 68ch; }
.plain section:not(.hero) { padding: 36px 0 0; }
.plain h2 { font-size: 1.5rem; }
.plain .sub { margin-bottom: 20px; }
.plain .card, .plain .quest, .plain .branch { background: rgba(255, 255, 255, .03); }
.plain .quest:hover, .plain .btn:hover, .plain .shot:hover { transform: none; }
.plain .planet { box-shadow: inset -7px -7px 0 rgba(0, 0, 0, .3); }
.plain .btn, .plain .stop.now .card { filter: none; }
.plain .stop { margin-bottom: 14px; }

/* The CV button is a real button, not a link: match the anchors it sits next to, and look unfinished */
.btn.cv-wip { line-height: 1.6; cursor: pointer; border-style: dashed; }
.btn.cv-wip:hover, .btn.cv-wip:focus-visible { border-color: var(--gold); color: var(--gold); }
/* Once every achievement is in, the dashed placeholder is replaced by a link that really downloads */
.btn.cv-open { border-color: var(--gold); color: var(--gold); }
.btn.cv-open:hover, .btn.cv-open:focus-visible { background: rgba(255, 200, 87, .14); }

/* Live telemetry under the astronaut: stays out of the way until a reading arrives */
.telemetry { font-family: var(--mono); font-size: 11.5px; color: var(--muted); margin: 8px 0 0; line-height: 1.55; }
.telemetry[hidden] { display: none; }
/* direct children only: the decoder builds .dw / .a spans inside these, and they must keep
   their own display and line-height or the lines collapse and overlap */
.telemetry > span { display: block; min-height: 1.55em; }
.telemetry > span:empty { display: none; }
/* a feed that will not answer: still a readout, just a dead one */
.telemetry > span.down { color: var(--coral); opacity: .72; }

/* The D&D chip rolls a d20 */
.chips .d20-chip { padding: 0; }
.chips .d20-chip button { font: inherit; color: inherit; background: none; border: 0; padding: 3px 12px; border-radius: 99px; cursor: pointer; }
.chips .d20-chip button:hover, .chips .d20-chip button:focus-visible { color: var(--gold); }
.chips .d20-chip.rolling { border-color: var(--gold); }
.chips .d20-chip.rolling button { color: var(--gold); }
.chips .d20-chip.nat20 { border-color: var(--gold); background: rgba(255, 200, 87, .12); }
.chips .d20-chip.nat20 button { color: var(--gold); text-shadow: 0 0 10px var(--gold); }
.chips .d20-chip.nat1 { border-color: var(--coral); background: rgba(255, 107, 94, .12); }
.chips .d20-chip.nat1 button { color: var(--coral); }

/* the toast's star or die sits off the text rather than against it */
#toast .toast-icon { font-style: normal; margin-right: 8px; }

/* Each meter sits directly under its own reading, with the gap below it, so it groups with
   the line it belongs to instead of the one underneath. */
.telemetry > .meter { display: flex; justify-content: center; min-height: 0; margin: 3px 0 8px; }
.telemetry > .meter:last-child { margin-bottom: 0; }
.meter i { background: rgba(255, 255, 255, .13); border-radius: 1px; transition: background .4s, box-shadow .4s; }
@media (prefers-reduced-motion: reduce) { .meter i { transition: none; } }

/* Kp: nine equal segments for Kp 1-9, each carrying its band colour from the start, so the
   storm thresholds stay visible on a quiet day. Teal calm, gold G1-G2, coral G3 and up. */
.kp { gap: 3px; }
.kp i { width: 9px; height: 5px; }
.kp i.on.calm { background: var(--teal); box-shadow: 0 0 5px rgba(63, 224, 197, .7); }
.kp i.on.warn { background: var(--gold); box-shadow: 0 0 5px rgba(255, 200, 87, .7); }
.kp i.on.storm { background: var(--coral); box-shadow: 0 0 5px rgba(255, 107, 94, .7); }

/* Range: rising bars, read like signal strength. Full means the station is overhead, empty
   means it is at the antipode. Deliberately a different shape from the Kp row. */
.range { gap: 3px; align-items: flex-end; }
.range i { width: 4px; }
.range i:nth-child(1) { height: 3px; }
.range i:nth-child(2) { height: 4px; }
.range i:nth-child(3) { height: 5px; }
.range i:nth-child(4) { height: 6px; }
.range i:nth-child(5) { height: 7px; }
.range i:nth-child(6) { height: 8px; }
.range i:nth-child(7) { height: 9px; }
.range i:nth-child(8) { height: 10px; }
.range i.on { background: var(--teal); box-shadow: 0 0 5px rgba(63, 224, 197, .7); }
.range.overhead i.on { background: var(--gold); box-shadow: 0 0 6px rgba(255, 200, 87, .85); }
