/* =================================================================
   0xZemi // Ian Mattas — disassembler / memory-map portfolio
   Two typefaces: Martian Mono (display/labels), Spline Sans Mono (body)
   ================================================================= */

:root {
  /* surfaces */
  --bg:        #0a0c0f;
  --bg-2:      #0d1014;
  --panel:     #111519;
  --panel-2:   #151a20;
  --line:      rgba(232, 228, 218, 0.09);
  --line-2:    rgba(232, 228, 218, 0.16);

  /* ink */
  --text:      #e9e6dd;   /* bone */
  --muted:     #9aa3b0;   /* secondary */
  --dim:       #5b626d;   /* comments / decorative */

  /* accents */
  --red:       #ff4151;   /* segfault / breakpoint */
  --red-dim:   rgba(255, 65, 81, 0.14);
  --amber:     #f6b550;   /* primes / keywords */
  --green:     #46e0a0;   /* live status only */

  --maxw:      1200px;
  --gutter:    clamp(20px, 5vw, 72px);
  --rail:      96px;

  --mono:  "Spline Sans Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --disp:  "Martian Mono", ui-monospace, monospace;

  --ease:  cubic-bezier(.22, 1, .36, 1);
}

/* ---------------- reset / base ---------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 72px; }

body {
  font-family: var(--mono);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  overflow-wrap: break-word;
  cursor: crosshair;
}

a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
button {
  font: inherit; color: inherit; background: none; border: 0; cursor: inherit;
  -webkit-appearance: none; appearance: none;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
ul { list-style: none; }
img { display: block; max-width: 100%; }
::selection { background: var(--red); color: #0a0c0f; }

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

/* ---------------- atmospheric layers ---------------- */
/* faint dotted grid + radial vignette behind everything */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(120% 90% at 80% -10%, rgba(255,65,81,0.07), transparent 55%),
    radial-gradient(90% 70% at -10% 110%, rgba(70,224,160,0.04), transparent 55%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(120% 100% at 50% 0%, #000 35%, transparent 90%);
  mask-image: radial-gradient(120% 100% at 50% 0%, #000 35%, transparent 90%);
  opacity: .5;
  pointer-events: none;
}

#memdump {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  opacity: .5;
  pointer-events: none;
}

.grain {
  position: fixed;
  inset: -50%;
  z-index: 999;
  pointer-events: none;
  opacity: .04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 6s steps(6) infinite;
  will-change: transform;
}
@keyframes grain {
  0%,100% { transform: translate(0,0); }
  20% { transform: translate(-4%, 3%); }
  40% { transform: translate(3%, -4%); }
  60% { transform: translate(-2%, 2%); }
  80% { transform: translate(4%, 1%); }
}

/* ---------------- reticle cursor ---------------- */
.reticle {
  position: fixed;
  top: 0; left: 0;
  width: 26px; height: 26px;
  margin: -13px 0 0 -13px;
  z-index: 1000;
  pointer-events: none;
  mix-blend-mode: difference;
  transition: width .2s var(--ease), height .2s var(--ease), opacity .3s;
  opacity: 0;
}
.reticle span {
  position: absolute;
  inset: 0;
  border: 1.5px solid #fff;
  border-radius: 50%;
}
.reticle span::before, .reticle span::after {
  content: "";
  position: absolute;
  background: #fff;
}
.reticle span::before { top: 50%; left: -6px; right: -6px; height: 1px; transform: translateY(-50%); }
.reticle span::after  { left: 50%; top: -6px; bottom: -6px; width: 1px; transform: translateX(-50%); }
.reticle.is-active { width: 46px; height: 46px; margin: -23px 0 0 -23px; }
.reticle.is-hot span { border-color: var(--red); }

/* ---------------- utilities ---------------- */
.mono-dim { color: var(--dim); }
.hl       { color: var(--green); }
.hl-amber { color: var(--amber); }
.str      { color: var(--amber); }
.prompt   { color: var(--red); font-weight: 600; }
.key      { color: var(--dim); }

/* ---------------- nav / status bar ---------------- */
.bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 24px;
  height: 56px;
  padding: 0 var(--gutter);
  background: rgba(10, 12, 15, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 13px;
}
.bar__brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
}
.bar__bp {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 0 rgba(255,65,81,.55);
  animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(255,65,81,.5); }
  70%  { box-shadow: 0 0 0 7px rgba(255,65,81,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,65,81,0); }
}
.bar__name { font-family: var(--disp); font-weight: 700; letter-spacing: -.02em; }
.bar__sub  { color: var(--dim); }
.bar__nav  { display: flex; gap: 22px; margin-left: auto; }
.bar__nav a {
  color: var(--muted);
  transition: color .2s;
  position: relative;
}
.bar__nav a:hover { color: var(--text); }
.bar__nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -6px;
  width: 0; height: 1.5px;
  background: var(--red);
  transition: width .25s var(--ease);
}
.bar__nav a:hover::after { width: 100%; }

.bar__pc {
  display: flex;
  align-items: center;
  margin-left: auto;
  gap: 7px;
  padding: 4px 10px;
  border: 1px solid var(--line-2);
  border-radius: 3px;
  background: var(--panel);
  font-size: 12px;
  letter-spacing: .04em;
}
.bar__pc-label { color: var(--dim); }
.bar__pc-arrow { color: var(--red); }
.bar__pc-addr  { color: var(--amber); font-weight: 500; min-width: 56px; }

@media (max-width: 720px) {
  .bar__sub { display: none; }
  .bar__nav { gap: 14px; font-size: 12px; }
  .bar__nav a .key { display: none; }
  .bar__pc { display: none; }
}
@media (max-width: 460px) {
  .bar { gap: 12px; }
  .bar__nav a:nth-child(2) { display: none; }
}

/* ---------------- section scaffold + seg-label rail ---------------- */
.block, .hero {
  position: relative;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(72px, 11vw, 140px) var(--gutter);
}
.block { border-top: 1px solid var(--line); }

.seg-label {
  position: absolute;
  top: clamp(72px, 11vw, 140px);
  left: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: var(--rail);
  padding-left: var(--gutter);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  line-height: 1.5;
  color: var(--dim);
}
.seg-label__addr { color: var(--amber); font-weight: 500; }
.seg-label__seg  { color: var(--muted); }
.seg-label__perm { color: var(--dim); }
.seg-label::before {
  content: "";
  position: absolute;
  left: calc(var(--gutter) - 14px);
  top: 2px;
  width: 1px;
  height: 46px;
  background: linear-gradient(var(--red), transparent);
}
@media (max-width: 980px) {
  .seg-label {
    position: static;
    flex-direction: row;
    gap: 12px;
    width: auto;
    padding-left: 0;
    margin-bottom: 28px;
    align-items: center;
  }
  .seg-label::before { display: none; }
  .seg-label__addr::after { content: ""; }
}

/* block header */
.block__head {
  display: flex;
  align-items: baseline;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: clamp(36px, 5vw, 64px);
}
.block__idx {
  font-family: var(--disp);
  font-size: 13px;
  color: var(--red);
  font-weight: 600;
  letter-spacing: .1em;
}
.block__title {
  font-family: var(--disp);
  font-weight: 700;
  font-size: clamp(28px, 5.5vw, 54px);
  letter-spacing: -.03em;
  line-height: .95;
}
.block__note {
  color: var(--dim);
  font-size: 13px;
  margin-left: auto;
  align-self: flex-end;
}

/* ---------------- HERO / .text ---------------- */
.hero {
  min-height: 100vh;        /* fallback for browsers without svh */
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 120px;
}
.hero__inner { max-width: 920px; }

.hero__eyebrow {
  font-size: 13px;
  letter-spacing: .04em;
  color: var(--muted);
  margin-bottom: clamp(24px, 4vw, 40px);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.hero__eyebrow .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
  animation: blink 2.6s steps(1) infinite;
}
@keyframes blink { 0%,90%,100% { opacity: 1; } 94% { opacity: .25; } }

.hero__title {
  font-family: var(--disp);
  font-weight: 800;
  font-size: clamp(58px, 16vw, 184px);
  line-height: .82;
  letter-spacing: -.05em;
  margin: 0 0 28px;
}
.hero__line {
  display: block;
}
.hero__line:nth-child(2) {
  color: var(--text);   /* fallback: solid fill if text-stroke unsupported */
  position: relative;
}
@supports (-webkit-text-stroke: 1px black) {
  .hero__line:nth-child(2) {
    color: transparent;
    -webkit-text-stroke: 1.4px var(--text);
  }
}
.hero__line:nth-child(2)::after {
  content: "_";
  -webkit-text-stroke: 0;
  color: var(--red);
  animation: caret 1.05s steps(1) infinite;
}
@keyframes caret { 50% { opacity: 0; } }

.hero__handle {
  font-size: clamp(15px, 2.2vw, 19px);
  color: var(--muted);
  margin-bottom: 30px;
}
.hero__bio {
  font-size: clamp(18px, 2.8vw, 27px);
  line-height: 1.45;
  max-width: 22ch;
  margin-bottom: 36px;
  color: var(--text);
  font-weight: 500;
  border-left: 2px solid var(--red);
  padding-left: 18px;
}
.hero__bio-em { color: var(--amber); display: block; }

.hero__roles {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 44px;
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.hero__roles li {
  border: 1px solid var(--line-2);
  border-radius: 2px;
  padding: 7px 13px;
  color: var(--muted);
  background: rgba(255,255,255,.012);
}
.hero__roles li::before { content: "0x"; color: var(--dim); }

.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 22px;
  border: 1px solid var(--line-2);
  border-radius: 3px;
  font-size: 14px;
  color: var(--text);
  background: var(--panel);
  transition: transform .2s var(--ease), border-color .2s, background .2s, color .2s;
}
.btn:hover { transform: translateY(-3px); border-color: var(--text); }
.btn__glyph { color: var(--red); font-weight: 700; }
.btn--primary {
  background: var(--red);
  border-color: var(--red);
  color: #0a0c0f;
  font-weight: 600;
}
.btn--primary .btn__glyph { color: #0a0c0f; }
.btn--primary:hover { background: #ff5a68; border-color: #ff5a68; box-shadow: 0 12px 40px -12px rgba(255,65,81,.6); }

.hero__scroll {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: clamp(48px, 8vw, 96px);
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--dim);
}
.hero__scroll-bar {
  width: 80px; height: 1px;
  background: var(--line-2);
  position: relative; overflow: hidden;
}
.hero__scroll-bar::after {
  content: ""; position: absolute; inset: 0;
  width: 30%; background: var(--red);
  animation: scan 2.4s var(--ease) infinite;
}
@keyframes scan { 0% { left: -30%; } 100% { left: 100%; } }

/* ---------------- WHOAMI / .data ---------------- */
.whoami__grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}
.whoami__body .lede {
  font-size: clamp(20px, 3vw, 30px);
  line-height: 1.4;
  letter-spacing: -.01em;
  margin-bottom: 24px;
}
.whoami__body .lede em { color: var(--red); font-style: normal; }
.whoami__body p { color: var(--muted); font-size: 16px; margin-bottom: 18px; }
.whoami__sig { font-size: 14px; }

.dossier {
  border: 1px solid var(--line-2);
  background: var(--panel);
  border-radius: 4px;
  overflow: hidden;
  transition: transform .3s var(--ease), border-color .3s;
}
.dossier:hover { transform: translateY(-4px); border-color: var(--red); }
.dossier__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 14px;
  font-size: 11px;
  letter-spacing: .14em;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
}
.dossier__id { color: var(--red); }
.dossier__photo {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--bg-2);
}
.dossier__photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.1) brightness(.85);
  mix-blend-mode: luminosity;
}
.dossier__photo::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent, rgba(255,65,81,.18)), var(--red-dim);
  mix-blend-mode: color;
  z-index: 1;
}
.dossier__photo--fallback::after {
  content: "[ NO SIGNAL ]";
  position: absolute; inset: 0;
  display: grid; place-items: center;
  color: var(--dim); font-size: 13px; letter-spacing: .2em;
}
.dossier__scan {
  position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--red), transparent);
  z-index: 2;
  animation: scanY 4s linear infinite;
  opacity: .6;
}
@keyframes scanY { 0% { top: 0; } 100% { top: 100%; } }
.dossier__rows { padding: 6px 14px 14px; }
.dossier__rows > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 13px;
}
.dossier__rows > div:last-child { border-bottom: 0; }
.dossier__rows dt { color: var(--dim); text-transform: uppercase; letter-spacing: .08em; }
.dossier__rows dd { color: var(--text); text-align: right; }

@media (max-width: 820px) {
  .whoami__grid { grid-template-columns: 1fr; }
  .dossier { max-width: 360px; }
}

/* ---------------- ARSENAL / .rodata ---------------- */
.arsenal__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.cap {
  background: var(--bg);
  padding: 26px 24px 30px;
  transition: background .3s;
}
.cap:hover { background: var(--panel); }
.cap__title {
  font-family: var(--disp);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .02em;
  margin-bottom: 18px;
  display: flex; align-items: baseline; gap: 9px;
  text-transform: lowercase;
}
.cap__hex { color: var(--red); font-size: 12px; }
.cap__list li {
  font-size: 14px;
  color: var(--muted);
  padding: 6px 0;
  display: flex; align-items: baseline; gap: 9px;
}
.cap__list li::before { content: "›"; color: var(--dim); }
.cap__list--chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cap__list--chips li {
  padding: 5px 10px;
  border: 1px solid var(--line-2);
  border-radius: 2px;
  color: var(--text);
  font-size: 12.5px;
}
.cap__list--chips li::before { content: none; }
.cap__list--chips li:hover { border-color: var(--amber); color: var(--amber); }

@media (max-width: 900px) { .arsenal__grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .arsenal__grid { grid-template-columns: 1fr; } }

/* ---------------- DUMPS / projects ---------------- */
.dumps__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.dumps__grid > li { display: flex; }
.dumps__grid > li > .card { flex: 1; }
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line-2);
  background: var(--panel);
  border-radius: 4px;
  padding: 22px 22px 20px;
  overflow: hidden;
  transition: transform .3s var(--ease), border-color .3s, background .3s;
}
.card::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 2px; background: var(--red);
  transform: scaleY(0); transform-origin: top;
  transition: transform .35s var(--ease);
}
.card:hover { transform: translateY(-5px); border-color: var(--line-2); background: var(--panel-2); }
.card:hover::before { transform: scaleY(1); }

.card__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  font-size: 11.5px;
  letter-spacing: .06em;
  color: var(--dim);
}
.card__addr { color: var(--amber); }
.card__meta { display: flex; align-items: center; gap: 12px; }
.card__lang { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.card__lang::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--lang, var(--dim));
}
.card__stars { color: var(--amber); }
.card__stars::before { content: "★ "; }

.card__name {
  font-family: var(--disp);
  font-size: clamp(18px, 2.4vw, 23px);
  font-weight: 600;
  letter-spacing: -.02em;
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px;
}
.card__name .arrow {
  color: var(--red);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity .25s, transform .25s var(--ease);
}
.card:hover .card__name .arrow { opacity: 1; transform: translateX(0); }
.card__desc {
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.55;
  flex: 1;
}
.card__desc.is-undoc { color: var(--dim); font-style: italic; }
.card__hexline {
  margin-top: 18px;
  font-size: 11px;
  color: var(--dim);
  letter-spacing: .05em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-top: 1px dashed var(--line);
  padding-top: 12px;
}

@media (max-width: 760px) { .dumps__grid { grid-template-columns: 1fr; } }

/* loading shimmer for project grid */
.card--skel { pointer-events: none; }
.card--skel .skel {
  display: block; height: 12px; border-radius: 3px;
  background: linear-gradient(90deg, var(--panel-2) 25%, var(--line) 50%, var(--panel-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
  margin: 8px 0;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ---------------- STATS / .got register file ---------------- */
.stats { padding-top: clamp(48px, 7vw, 90px); padding-bottom: clamp(48px, 7vw, 90px); }
.stats__sync {
  font-size: 11px;
  color: var(--dim);
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 24px;
  display: flex; align-items: center; gap: 8px;
}
.stats__sync .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.stats__sync .dot.is-stale { background: var(--dim); }

.stats__row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line-2);
  border-radius: 4px;
  overflow: hidden;
}
.stat {
  background: var(--bg);
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  transition: background .3s;
}
.stat__num { overflow-wrap: anywhere; }
.stat:hover { background: var(--panel); }
.stat__num {
  font-family: var(--disp);
  font-size: clamp(30px, 5vw, 52px);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1;
  color: var(--text);
}
.stat__num--amber { color: var(--amber); }
.stat__num--red { color: var(--red); }
.stat__num--sm { font-size: clamp(20px, 3vw, 30px); }
.stat__lbl { font-size: 12px; color: var(--dim); letter-spacing: .06em; text-transform: uppercase; }

.stats__row--3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 820px) {
  .stats__row, .stats__row--3 { grid-template-columns: repeat(2, 1fr); }
}

/* stat board groups */
.board__group { margin-top: 36px; }
.board__label {
  font-family: var(--disp);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: lowercase;
  margin-bottom: 16px;
  display: flex; align-items: baseline; gap: 9px;
}
.board__hex { color: var(--red); font-size: 12px; }
.board__sub { color: var(--dim); font-weight: 400; }
.board__sublabel {
  font-size: 12px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--dim); margin: 30px 0 14px;
}

/* rank progress bar */
.rankbar {
  margin-top: 16px;
  padding: 18px 20px;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  background: var(--panel);
}
.rankbar__top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.rankbar__name { font-family: var(--disp); font-weight: 600; font-size: 16px; color: var(--red); }
.rankbar__next { font-size: 12px; color: var(--dim); letter-spacing: .06em; text-transform: uppercase; }
.rankbar__track {
  height: 8px; border-radius: 4px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  overflow: hidden;
}
.rankbar__fill {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--red), var(--amber));
  transition: width 1.1s var(--ease);
}
.rankbar__pct { display: block; margin-top: 8px; font-size: 12px; color: var(--muted); }

/* challenge categories */
.htb-cats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px 26px;
}
.cat__top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; font-size: 13px; }
.cat__name { color: var(--text); }
.cat__n { color: var(--dim); font-size: 12px; }
.cat__bar {
  height: 5px; border-radius: 3px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  overflow: hidden;
}
.cat__bar > span {
  display: block; height: 100%; width: 0;
  background: var(--amber);
  transition: width .9s var(--ease);
}
.cat--strong .cat__bar > span { background: var(--red); }

/* ---------------- CONTACT / .fini ---------------- */
.contact__grid {
  display: grid;
  gap: 1px;
  background: var(--line);
  border-top: 1px solid var(--line-2);
  border-bottom: 1px solid var(--line-2);
}
.link-row {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 22px var(--gutter);
  margin: 0 calc(-1 * var(--gutter));
  background: var(--bg);
  transition: background .25s, padding-left .25s var(--ease);
  font-size: clamp(15px, 2.4vw, 21px);
}
.link-row:hover { background: var(--panel); padding-left: calc(var(--gutter) + 12px); }
.link-row__k {
  font-size: 12px; color: var(--red);
  text-transform: uppercase; letter-spacing: .1em;
}
.link-row__v { font-family: var(--disp); font-weight: 500; letter-spacing: -.01em; min-width: 0; overflow-wrap: anywhere; }
.link-row__arr { color: var(--dim); font-size: 18px; transition: color .25s, transform .25s var(--ease); }
.link-row:hover .link-row__arr { color: var(--red); transform: translate(2px, -2px); }

@media (max-width: 560px) {
  .link-row { grid-template-columns: 1fr auto; gap: 4px 12px; }
  .link-row__k { grid-column: 1 / -1; }
}

/* ---------------- FOOTER ---------------- */
.foot {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 40px var(--gutter) 64px;
  border-top: 1px solid var(--line);
}
.foot__primes {
  display: flex; flex-wrap: wrap; gap: 14px;
  font-size: 13px; color: var(--dim);
  margin-bottom: 22px;
}
.foot__primes span { transition: color .2s; }
.foot__primes span:hover { color: var(--amber); }
.foot__line {
  display: flex; flex-wrap: wrap; gap: 8px 28px;
  font-size: 12.5px; color: var(--muted);
  letter-spacing: .03em;
}

/* ---------------- reveal-on-scroll ---------------- */
/* gated on .js so content stays visible if JavaScript is disabled or fails */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------------- notch / safe-area insets ---------------- */
@supports (padding: max(0px)) {
  .bar {
    padding-left: max(var(--gutter), env(safe-area-inset-left));
    padding-right: max(var(--gutter), env(safe-area-inset-right));
  }
  .hero, .block, .foot {
    padding-left: max(var(--gutter), env(safe-area-inset-left));
    padding-right: max(var(--gutter), env(safe-area-inset-right));
  }
}

/* ---------------- reduced motion ---------------- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal, .js .reveal { opacity: 1 !important; transform: none !important; }
  #memdump, .grain, .reticle, .dossier__scan, .hero__scroll-bar::after { display: none !important; }
  body { cursor: auto; }
}
