/* ==========================================================================
   madjdakhedimi.com
   "Analyzer" theme: a lab signal analyzer. Plum casing, magenta phosphor.

   Contents
     1. Tokens
     2. Base
     3. Layout
     4. Navigation
     5. Buttons and labels
     6. Panels
     7. Hero and CRT
     8. Content modules
     9. Publications
    10. Skills
    11. Terminal and footer
    12. Blog index
    13. Article
    14. Game
    15. Utilities
    16. Responsive
    17. Motion and focus preferences
   ========================================================================== */

/* 1. Tokens ------------------------------------------------------------- */

:root {
  /* Surfaces */
  --case:        #180f17;
  --case-raised: #221620;
  --case-inset:  #2d1d2b;
  --screen:      #0d0710;

  /* Text */
  --text:        #f1e7ef;
  --text-muted:  #bda9b9;
  --text-faint:  #998296;

  /* Channels. ch1 is the primary accent. */
  --ch1:         #ff4d97;
  --ch1-strong:  #ff2d7e;
  --ch1-wash:    rgba(255, 77, 151, 0.13);
  --ch2:         #4fe0c8;
  --ch2-wash:    rgba(79, 224, 200, 0.13);
  --ch3:         #b78cff;
  --ch3-wash:    rgba(183, 140, 255, 0.13);

  /* Lines and depth */
  --line:        rgba(241, 231, 239, 0.13);
  --line-strong: rgba(241, 231, 239, 0.26);
  --bevel-light: rgba(255, 200, 230, 0.06);
  --bevel-dark:  rgba(0, 0, 0, 0.55);
  --graticule:   rgba(255, 120, 180, 0.10);

  /* Type */
  --font-display: 'Tektur', system-ui, sans-serif;
  --font-body:    'Space Grotesk', system-ui, sans-serif;
  --font-mono:    'Space Mono', ui-monospace, monospace;
  --font-screen:  'VT323', monospace;

  /* Metrics */
  --measure: 1140px;
  --gutter:  26px;
  --bar-height: 60px;
}

/* 2. Base --------------------------------------------------------------- */

*,
*::before,
*::after { box-sizing: border-box; }

body,
h1, h2, h3, h4,
p, ul, dl, dd, figure { margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  /* Offset anchor targets so the fixed bar does not cover headings. */
  scroll-padding-top: calc(var(--bar-height) + 20px);
}

body {
  font-family: var(--font-body);
  background: var(--case);
  color: var(--text);
  line-height: 1.62;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

ul { list-style: none; }
a  { color: inherit; }
img, svg { display: block; max-width: 100%; }

::selection { background: var(--ch1); color: #1f0613; }

/* Perforated casing texture. Decorative only. */
.texture {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.5;
  pointer-events: none;
  background-image: radial-gradient(rgba(241, 231, 239, 0.05) 1px, transparent 1.4px);
  background-size: 9px 9px;
}

.texture::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 100% 70% at 50% -10%, var(--ch1-wash), transparent 60%);
}

/* Screen reader only. */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Skip link for keyboard users. */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--gutter);
  z-index: 100;
  padding: 12px 18px;
  background: var(--ch1);
  color: #1f0613;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-decoration: none;
}

.skip-link:focus { top: 12px; }

/* 3. Layout ------------------------------------------------------------- */

.wrap {
  position: relative;
  z-index: 1;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section { padding: 30px 0; }

/* 4. Navigation --------------------------------------------------------- */

.bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 60;
  background: linear-gradient(#201427, #18101e);
  border-bottom: 1px solid var(--line);
  box-shadow: inset 0 1px 0 var(--bevel-light), 0 6px 18px rgba(0, 0, 0, 0.4);
}

.bar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--bar-height);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.04rem;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.brand svg { filter: drop-shadow(0 0 5px var(--ch1-wash)); }

.nav-list {
  display: flex;
  align-items: center;
  gap: 22px;
}

.nav-list a {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 0;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text-muted);
  transition: color 0.2s;
}

.nav-list a::before {
  content: "";
  width: 5px;
  height: 5px;
  border: 1px solid var(--text-faint);
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.nav-list a:hover,
.nav-list a[aria-current="page"] { color: var(--text); }

.nav-list a:hover::before,
.nav-list a[aria-current="page"]::before {
  background: var(--ch1);
  border-color: var(--ch1);
  box-shadow: 0 0 6px var(--ch1);
}

.nav-toggle {
  display: none;
  padding: 8px 12px;
  background: var(--case-raised);
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}

/* 5. Buttons and labels ------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 20px;
  border: 1px solid var(--line-strong);
  background: var(--case-raised);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  box-shadow: inset 0 1px 0 var(--bevel-light), 0 3px 0 var(--bevel-dark);
  transition: transform 0.15s, box-shadow 0.15s, color 0.15s, border-color 0.15s;
}

.btn:hover {
  transform: translateY(1px);
  box-shadow: inset 0 1px 0 var(--bevel-light), 0 2px 0 var(--bevel-dark);
  color: var(--ch1);
  border-color: var(--ch1);
}

.btn--primary {
  background: linear-gradient(var(--ch1), var(--ch1-strong));
  border-color: var(--ch1-strong);
  color: #1f0613;
  font-weight: 700;
}

.btn--primary:hover { color: #1f0613; filter: brightness(1.06); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ch1);
}

.ref {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.chip {
  display: inline-block;
  width: fit-content;
  padding: 3px 8px;
  border: 1px solid;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.chip--1 { color: var(--ch1); border-color: var(--ch1-wash); background: var(--ch1-wash); }
.chip--2 { color: var(--ch2); border-color: var(--ch2-wash); background: var(--ch2-wash); }
.chip--3 { color: var(--ch3); border-color: var(--ch3-wash); background: var(--ch3-wash); }
.chip--plain { color: var(--text-muted); border-color: var(--line-strong); }

/* Status light. */
.led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ch1);
  box-shadow: 0 0 7px var(--ch1);
  animation: led-blink 2.4s steps(1) infinite;
}

@keyframes led-blink {
  0%, 72%   { opacity: 1; }
  73%, 100% { opacity: 0.25; }
}

/* 6. Panels ------------------------------------------------------------- */

.panel {
  position: relative;
  padding: 30px;
  background: linear-gradient(var(--case-raised), #1d1320);
  border: 1px solid var(--line);
  box-shadow:
    inset 0 1px 0 var(--bevel-light),
    inset 0 -1px 0 var(--bevel-dark),
    0 10px 30px rgba(0, 0, 0, 0.35);
}

/* Panel mounting screws. */
.panel::before,
.panel::after {
  content: "";
  position: absolute;
  top: 9px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #4c3848, #0d0710);
  box-shadow: 0 1px 1px var(--bevel-dark);
}

.panel::before { left: 9px; }
.panel::after  { right: 9px; }

.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  margin-bottom: 26px;
  border-bottom: 1px solid var(--line);
}

.panel__title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.32rem;
}

/* 7. Hero and CRT ------------------------------------------------------- */

.hero { padding: calc(var(--bar-height) + 44px) 0 56px; }

.hero .wrap {
  display: grid;
  grid-template-columns: 1fr 1.08fr;
  gap: 34px;
  align-items: center;
}

.hero__eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.05rem, 4.4vw, 3.05rem);
  line-height: 1.06;
  letter-spacing: -0.01em;
}

.hero h1 .ch1 { color: var(--ch1); text-shadow: 0 0 18px rgba(255, 77, 151, 0.35); }
.hero h1 .ch2 { color: var(--ch2); text-shadow: 0 0 18px rgba(79, 224, 200, 0.30); }
.hero h1 .ch3 { color: var(--ch3); text-shadow: 0 0 18px rgba(183, 140, 255, 0.30); }

.hero__lead {
  max-width: 42ch;
  margin-top: 22px;
  font-size: 1.1rem;
  color: var(--text-muted);
}

.hero__lead strong { color: var(--text); font-weight: 600; }

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 13px;
  margin-top: 30px;
}

/* The instrument. */
.scope {
  position: relative;
  padding: 16px;
  border: 1px solid #0d0710;
  border-radius: 14px;
  background: linear-gradient(#2a1a28, #140b16);
  box-shadow: inset 0 1px 0 var(--bevel-light), 0 12px 34px rgba(0, 0, 0, 0.5);
}

.scope__screws { position: absolute; inset: 0; pointer-events: none; }

.scope__screws i {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #6a4a62, #0d0710);
  box-shadow: 0 1px 2px var(--bevel-dark);
}

.scope__screws i:nth-child(1) { top: 7px; left: 7px; }
.scope__screws i:nth-child(2) { top: 7px; right: 7px; }
.scope__screws i:nth-child(3) { bottom: 7px; left: 7px; }
.scope__screws i:nth-child(4) { bottom: 7px; right: 7px; }

.screen {
  position: relative;
  aspect-ratio: 5 / 3;
  overflow: hidden;
  border-radius: 9px;
  background:
    radial-gradient(ellipse 120% 120% at 50% 50%, #160a1c 0%, #0c0510 70%, transparent 100%),
    var(--screen);
  box-shadow: inset 0 0 0 2px #000, inset 0 0 40px rgba(0, 0, 0, 0.7);
}

.screen > svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.graticule line { stroke: var(--graticule); stroke-width: 1; }
.graticule .axis { stroke: rgba(255, 120, 180, 0.2); }

.trace--1 {
  fill: none;
  stroke: var(--ch1);
  stroke-width: 1.6;
  filter: drop-shadow(0 0 4px rgba(255, 77, 151, 0.85));
}

.trace--2 {
  fill: none;
  stroke: var(--ch2);
  stroke-width: 1.5;
  filter: drop-shadow(0 0 4px rgba(79, 224, 200, 0.8));
}

/* Draw-on sweep. --len is set per path from the measured path length. */
.sweep {
  stroke-dasharray: var(--len);
  stroke-dashoffset: var(--len);
  animation: sweep 2.6s linear forwards;
}

.sweep--delayed { animation-delay: 0.5s; }

@keyframes sweep {
  to { stroke-dashoffset: 0; }
}

.screen__scanlines,
.screen__flicker {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: 9px;
}

.screen__scanlines {
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.32) 0,
    rgba(0, 0, 0, 0.32) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: multiply;
}

.screen__flicker {
  background: rgba(255, 120, 180, 0.025);
  animation: flicker 5s steps(2) infinite;
}

@keyframes flicker {
  0%, 97% { opacity: 0; }
  98%     { opacity: 1; }
  100%    { opacity: 0; }
}

.screen__label {
  position: absolute;
  font-family: var(--font-screen);
  font-size: clamp(0.8rem, 1.5vw, 1.05rem);
  line-height: 1.15;
  letter-spacing: 0.04em;
  color: var(--ch1);
  text-shadow: 0 0 6px rgba(255, 77, 151, 0.6);
}

.screen__label--tl { top: 10px; left: 14px; }
.screen__label--tr {
  top: 10px; right: 14px;
  text-align: right;
  color: var(--ch2);
  text-shadow: 0 0 6px rgba(79, 224, 200, 0.6);
}
.screen__label--bl {
  bottom: 8px; left: 14px;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-shadow: none;
  opacity: 0.8;
}
.screen__label--br {
  bottom: 8px; right: 14px;
  color: var(--ch3);
  text-shadow: 0 0 6px rgba(183, 140, 255, 0.5);
}

.caret {
  display: inline-block;
  width: 0.55ch;
  background: var(--ch1);
  color: transparent;
  animation: led-blink 1s steps(1) infinite;
}

/* Knobs below the screen. */
.controls {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 15px 8px 4px;
}

.control {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}

.control span {
  font-family: var(--font-mono);
  font-size: 0.56rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.knob {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 30%, #3a2a38, #0d0710);
  box-shadow: inset 0 1px 0 var(--bevel-light), 0 3px 5px var(--bevel-dark);
}

.knob::after {
  content: "";
  position: absolute;
  top: 5px;
  left: 50%;
  width: 2px;
  height: 11px;
  background: var(--ch1);
  box-shadow: 0 0 5px var(--ch1);
  transform: translateX(-50%);
  transform-origin: bottom;
}

.knob--b::after { transform: translateX(-50%) rotate(42deg); }
.knob--c::after { transform: translateX(-50%) rotate(-58deg); }

.controls__spacer { flex: 1; }

.controls__power {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ch2);
}

.controls__power .led { background: var(--ch2); box-shadow: 0 0 7px var(--ch2); }

/* 8. Content modules ---------------------------------------------------- */

.about {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 42px;
}

.about__prose p {
  max-width: 60ch;
  margin-bottom: 1.15rem;
  font-size: 1.1rem;
  color: var(--text-muted);
}

.about__prose p strong { color: var(--text); font-weight: 600; }

.specs { font-family: var(--font-mono); font-size: 0.82rem; }

.specs__row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px dashed var(--line);
}

.specs__row:last-child { border-bottom: none; }

.specs__key {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.specs__value { text-align: right; color: var(--text); }

/* Channel cards. */
.channels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 20px;
}

.channel {
  padding: 18px;
  background: var(--case-inset);
  border: 1px solid var(--line);
}

.channel__id {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
}

.channel:nth-child(1) .channel__id { color: var(--ch1); }
.channel:nth-child(2) .channel__id { color: var(--ch2); }
.channel:nth-child(3) .channel__id { color: var(--ch3); }

.channel h3 {
  margin: 6px 0 8px;
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.channel p {
  margin-bottom: 12px;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.channel__meter {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 26px;
}

.channel__meter i { flex: 1; opacity: 0.85; }
.channel:nth-child(1) .channel__meter i { background: var(--ch1); box-shadow: 0 0 5px var(--ch1-wash); }
.channel:nth-child(2) .channel__meter i { background: var(--ch2); box-shadow: 0 0 5px var(--ch2-wash); }
.channel:nth-child(3) .channel__meter i { background: var(--ch3); box-shadow: 0 0 5px var(--ch3-wash); }

/* 9. Publications ------------------------------------------------------- */

.pub {
  display: grid;
  grid-template-columns: 108px 1fr 168px;
  gap: 24px;
  align-items: start;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.pub:first-of-type { border-top: 1px solid var(--line); }

.pub__rail {
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-family: var(--font-mono);
}

.pub__year {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--text);
}

.pub__body h3 {
  margin-bottom: 7px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.12rem;
  line-height: 1.38;
}

.pub__venue {
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-faint);
}

.pub__note {
  max-width: 58ch;
  font-size: 1rem;
  color: var(--text-muted);
}

.pub__side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  text-align: right;
}

/* Segmented display for headline numbers. */
.readout {
  padding: 8px 12px;
  background: var(--screen);
  border: 1px solid #000;
  box-shadow: inset 0 0 0 1px var(--line);
  font-family: var(--font-screen);
  font-size: 1.9rem;
  line-height: 1;
  color: var(--ch1);
  text-shadow: 0 0 10px rgba(255, 77, 151, 0.45);
}

.readout small {
  display: block;
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  text-shadow: none;
}

.pub__links {
  display: flex;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.pub__links a {
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.pub__links a:hover { color: var(--ch1); border-bottom-color: var(--ch1); }

/* 10. Skills ------------------------------------------------------------ */

.skills {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 6px;
  border: 1px solid var(--line);
}

.skill {
  padding: 22px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.skill:nth-child(3n) { border-right: none; }
.skill:nth-last-child(-n + 3) { border-bottom: none; }

.skill h3 {
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ch1);
}

.skill li {
  padding: 6px 0;
  font-size: 0.94rem;
  color: var(--text-muted);
  border-bottom: 1px dashed var(--line);
}

.skill li:last-child { border-bottom: none; }
.skill li b { color: var(--text); font-weight: 600; }

/* 11. Terminal and footer ----------------------------------------------- */

.terminal {
  padding: 22px 24px;
  background: var(--screen);
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.95rem;
}

.terminal__line {
  padding: 5px 0;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.terminal__prompt { color: var(--ch2); }

.terminal a {
  color: var(--ch1);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.terminal a:hover { border-bottom-color: var(--ch1); }

.footer {
  margin-top: 30px;
  background: linear-gradient(#18101e, #201427);
  border-top: 1px solid var(--line);
  box-shadow: inset 0 1px 0 var(--bevel-light);
}

.footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 54px;
  padding-top: 12px;
  padding-bottom: 12px;
}

.footer p {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}

.footer .ok { color: var(--ch2); }

/* 12. Blog index -------------------------------------------------------- */

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

.entry {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 24px;
  align-items: baseline;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  transition: background 0.2s;
}

.entry:hover { background: var(--case-inset); }

.entry__rail {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-faint);
}

.entry h3 {
  margin-bottom: 7px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.28rem;
  line-height: 1.34;
  transition: color 0.2s;
}

.entry:hover h3 { color: var(--ch1); }

.entry p {
  max-width: 62ch;
  font-size: 0.98rem;
  color: var(--text-muted);
}

.entry__go {
  align-self: center;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-faint);
  white-space: nowrap;
}

.entry:hover .entry__go { color: var(--ch1); }

/* 13. Article ----------------------------------------------------------- */

.article { padding: calc(var(--bar-height) + 44px) 0 30px; }
.article .wrap { max-width: 720px; }

.article__head {
  padding-bottom: 26px;
  margin-bottom: 38px;
  border-bottom: 1px solid var(--line);
}

.article__head .eyebrow { display: inline-block; margin-bottom: 16px; }

.article__title {
  margin-bottom: 16px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
}

.article__byline {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-faint);
}

.prose p {
  margin-bottom: 1.4rem;
  font-size: 1.12rem;
  line-height: 1.85;
  color: var(--text-muted);
}

.prose p strong { color: var(--text); font-weight: 600; }

.prose h2 {
  margin: 2.5rem 0 1rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.42rem;
  color: var(--text);
}

.prose h2::before {
  content: "// ";
  font-family: var(--font-mono);
  font-weight: 400;
  color: var(--ch1);
}

.prose ul { margin: 0 0 1.4rem 0; }

.prose ul li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 0.6rem;
  font-size: 1.08rem;
  line-height: 1.7;
  color: var(--text-muted);
}

.prose ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 7px;
  height: 1px;
  background: var(--ch1);
}

.prose a { color: var(--ch1); text-decoration: underline; text-underline-offset: 3px; }

.callout {
  margin: 1.6rem 0;
  padding: 16px 20px;
  background: var(--ch1-wash);
  border-left: 2px solid var(--ch1);
  font-size: 1.04rem;
  color: var(--text);
}

.code {
  margin: 1.6rem 0;
  padding: 18px 20px;
  background: var(--screen);
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.8;
  color: var(--text-muted);
  white-space: pre-wrap;
  overflow-x: auto;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 2.3rem 0 1rem;
}

.tags span {
  padding: 4px 10px;
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-faint);
  text-decoration: none;
  transition: gap 0.2s, color 0.2s;
}

.back:hover { gap: 14px; color: var(--ch1); }

/* 14. Game -------------------------------------------------------------- */

.game__intro {
  max-width: 58ch;
  margin-bottom: 18px;
  color: var(--text-muted);
}

.game {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 20px;
  align-items: start;
}

.game__screen {
  position: relative;
  aspect-ratio: 2 / 1;
  overflow: hidden;
  border-radius: 9px;
  background:
    radial-gradient(ellipse 120% 120% at 50% 50%, #160a1c 0%, #0c0510 70%, transparent 100%),
    var(--screen);
  box-shadow: inset 0 0 0 2px #000, inset 0 0 40px rgba(0, 0, 0, 0.7);
}

.game__screen canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.game__hud {
  position: absolute;
  top: 10px;
  left: 14px;
  right: 14px;
  display: flex;
  justify-content: space-between;
  font-family: var(--font-screen);
  font-size: 1.05rem;
  color: var(--ch1);
  text-shadow: 0 0 6px rgba(255, 77, 151, 0.6);
  pointer-events: none;
}

.game__hud .match { color: var(--ch2); text-shadow: 0 0 6px rgba(79, 224, 200, 0.6); }

.game__panel {
  padding: 18px;
  background: var(--case-inset);
  border: 1px solid var(--line);
}

.dial { margin-bottom: 18px; }

.dial label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 7px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.dial output { color: var(--ch2); }

/* Range input, styled for both engines. */
.dial input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 3px;
  background: var(--line-strong);
  outline: none;
  cursor: pointer;
}

.dial input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 15px;
  height: 15px;
  border: none;
  border-radius: 50%;
  background: var(--ch1);
  box-shadow: 0 0 7px var(--ch1);
  cursor: pointer;
}

.dial input[type="range"]::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border: none;
  border-radius: 50%;
  background: var(--ch1);
  box-shadow: 0 0 7px var(--ch1);
  cursor: pointer;
}

.game__actions { display: flex; flex-direction: column; gap: 10px; }
.game__actions .btn { justify-content: center; }

.game__status {
  margin-top: 14px;
  min-height: 3.4em;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.game__status b { color: var(--ch2); }

/* 15. Utilities --------------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* 16. Responsive -------------------------------------------------------- */

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

  .nav-list {
    display: none;
    position: fixed;
    top: var(--bar-height);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: #18101e;
    border-bottom: 1px solid var(--line);
  }

  .nav-list.is-open { display: flex; }
  .nav-list li { width: 100%; border-bottom: 1px solid var(--line); }
  .nav-list a { padding: 15px var(--gutter); }

  .hero .wrap { grid-template-columns: 1fr; gap: 26px; }
  .scope { order: -1; }

  .about { grid-template-columns: 1fr; gap: 26px; }
  .channels { grid-template-columns: 1fr; }

  .skills { grid-template-columns: 1fr; }
  .skill { border-right: none; }
  .skill:nth-last-child(-n + 3) { border-bottom: 1px solid var(--line); }
  .skill:last-child { border-bottom: none; }

  .pub { grid-template-columns: 1fr; gap: 14px; }
  .pub__side { align-items: flex-start; text-align: left; }

  .entry { grid-template-columns: 1fr; gap: 12px; }
  .entry__go { display: none; }

  .game { grid-template-columns: 1fr; }
  .panel { padding: 22px; }
}

/* 17. Motion and focus preferences -------------------------------------- */

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

  .sweep { stroke-dashoffset: 0; }
  .reveal { opacity: 1; transform: none; }
  .screen__flicker { display: none; }
}

:focus-visible {
  outline: 2px solid var(--ch1);
  outline-offset: 3px;
}
