/* =========================================================================
   LIFE IS A REPO — Runtime Viewport
   A live engine-viewport HUD wrapped around editorial-restrained content.
   ========================================================================= */

/* ============ TOKENS ============ */
:root {
  /* neutral cool-dark surfaces */
  --bg: oklch(0.165 0.006 255);
  --bg-2: oklch(0.198 0.007 255);
  --surface: oklch(0.225 0.008 255);
  --surface-2: oklch(0.255 0.009 255);

  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.13);
  --line-3: rgba(255, 255, 255, 0.2);

  --text: oklch(0.945 0.004 255);
  --muted: oklch(0.74 0.01 255);
  --faint: oklch(0.56 0.01 255);
  --dim: oklch(0.42 0.01 255);
  --ghost: oklch(0.33 0.008 255);

  /* signature accent — "selection amber" (swapped by Palette tweak) */
  --accent: #ff9133;
  --accent-rgb: 255, 145, 51;

  /* functional / semantic — stay constant */
  --live: #43e08a;
  --live-rgb: 67, 224, 138;
  --onair: #ff5a5f;
  --onair-rgb: 255, 90, 95;
  --wire: #4dd6e6;
  --wire-rgb: 77, 214, 230;
  --c-xr: #a98bff; /* skills: xr/spatial accent */

  /* type */
  --font-display: "Sansation", sans-serif;
  --font-body: "Hanken Grotesk", sans-serif;
  --font-mono: "JetBrains Mono", monospace;

  --maxw: 1180px;
  --gutter: 2.5rem;
  --rail: 56px; /* left HUD rail width on desktop */
}

/* ---- palettes (swap the single signature accent) ---- */
body[data-palette="cyan"] {
  --accent: #38d0e0;
  --accent-rgb: 56, 208, 224;
}
body[data-palette="red"] {
  --accent: #ff5a5f;
  --accent-rgb: 255, 90, 95;
}
body[data-palette="green"] {
  --accent: #43e08a;
  --accent-rgb: 67, 224, 138;
}
body[data-palette="mono"] {
  --accent: #c9ced8;
  --accent-rgb: 201, 206, 216;
}

/* ---- typography pairings ---- */
body[data-type="mono"] {
  --font-display: "JetBrains Mono", monospace;
}
body[data-type="grotesk"] {
  --font-display: "Sansation", sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  font-feature-settings: "ss01", "cv01";
}
/* faint engine-grid backdrop */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(
    ellipse 120% 80% at 50% 0%,
    #000 25%,
    transparent 78%
  );
  -webkit-mask-image: radial-gradient(
    ellipse 120% 80% at 50% 0%,
    #000 25%,
    transparent 78%
  );
}
a {
  color: inherit;
  text-decoration: none;
}
::selection {
  background: rgba(var(--accent-rgb), 0.3);
  color: #fff;
}
img {
  max-width: 100%;
  display: block;
}
/* opt-in: ![alt](src){:.inline-icon} — flows inline with text like an emoji */
img.inline-icon {
  display: inline-block;
  height: 1.2em;
  width: auto;
  max-width: none;
  vertical-align: -0.25em;
  margin: 0 0.1em;
}

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

/* =========================================================================
   VIEWPORT FRAME — corner registration marks (fixed, quiet)
   ========================================================================= */
.vp-frame {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
}
.vp-corner {
  position: absolute;
  width: 18px;
  height: 18px;
  opacity: 0.5;
}
.vp-corner::before,
.vp-corner::after {
  content: "";
  position: absolute;
  background: var(--accent);
}
.vp-corner::before {
  width: 100%;
  height: 1.5px;
}
.vp-corner::after {
  width: 1.5px;
  height: 100%;
}
.vp-corner.tl {
  top: 14px;
  left: 14px;
}
.vp-corner.tr {
  top: 14px;
  right: 14px;
}
.vp-corner.tr::before {
  right: 0;
}
.vp-corner.tr::after {
  right: 0;
}
.vp-corner.bl {
  bottom: 14px;
  left: 14px;
}
.vp-corner.bl::before {
  bottom: 0;
}
.vp-corner.bl::after {
  bottom: 0;
}
.vp-corner.br {
  bottom: 14px;
  right: 14px;
}
.vp-corner.br::before {
  bottom: 0;
  right: 0;
}
.vp-corner.br::after {
  bottom: 0;
  right: 0;
}

/* =========================================================================
   LEFT SECTION RAIL — doubles as scroll telemetry + nav
   ========================================================================= */
.rail {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--rail);
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-right: 1px solid var(--line);
  background: rgba(11, 12, 15, 0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.rail-prog {
  position: absolute;
  top: 0;
  left: 0;
  width: 2px;
  height: 0%;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(var(--accent-rgb), 0.6);
}
.rail-ticks {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.rail-tick {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--dim);
  letter-spacing: 0.05em;
  text-decoration: none;
  transition: color 0.2s;
  position: relative;
}
.rail-tick .num {
  width: 18px;
  text-align: right;
}
.rail-tick .bar {
  width: 14px;
  height: 1.5px;
  background: var(--ghost);
  transition: all 0.2s;
}
.rail-tick .nm {
  position: absolute;
  left: 32px;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-4px);
  transition:
    opacity 0.2s,
    transform 0.2s;
  text-transform: uppercase;
  background: var(--bg-2);
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  pointer-events: none;
}
.rail-tick:hover {
  color: var(--muted);
}
.rail-tick:hover .nm {
  opacity: 1;
  transform: translateX(0);
}
.rail-tick.active {
  color: var(--accent);
}
.rail-tick.active .bar {
  width: 24px;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(var(--accent-rgb), 0.5);
}
.rail-cap {
  position: absolute;
  bottom: 18px;
  font-family: var(--font-mono);
  font-size: 0.55rem;
  color: var(--ghost);
  letter-spacing: 0.1em;
  writing-mode: vertical-rl;
}
.rail-cap.top {
  top: 18px;
  bottom: auto;
}

/* =========================================================================
   BOTTOM-RIGHT LIVE READOUT
   ========================================================================= */
.readout {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 80;
  display: flex;
  gap: 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--faint);
  letter-spacing: 0.06em;
  background: rgba(11, 12, 15, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.4rem 0.7rem;
}
.readout b {
  color: var(--accent);
  font-weight: 600;
}
.readout .sep {
  color: var(--ghost);
}
.readout .lbl {
  color: var(--ghost);
}

/* =========================================================================
   NAVBAR
   ========================================================================= */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 58px;
  display: flex;
  align-items: center;
  background: rgba(11, 12, 15, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.navbar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.brand {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.brand-name {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: baseline;
}
.brand-name .dot {
  color: var(--accent);
}
.brand-name .cur {
  color: var(--accent);
  margin-left: 1px;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}
.brand-sub {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--dim);
  letter-spacing: 0.08em;
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 1.6rem;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 1.35rem;
  list-style: none;
}
.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--faint);
  letter-spacing: 0.02em;
  transition: color 0.2s;
  position: relative;
}
.nav-links a:hover,
.nav-links a.active {
  color: #fff;
}
.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -19px;
  height: 2px;
  background: var(--accent);
}
.nav-status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  color: var(--live);
  letter-spacing: 0.04em;
}
.nav-status .d {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 8px var(--live);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}
.btn-resume {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.42rem 1rem;
  border-radius: 5px;
  border: 1px solid rgba(var(--accent-rgb), 0.4);
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.07);
  letter-spacing: 0.02em;
  transition: all 0.2s;
  white-space: nowrap;
}
.btn-resume:hover {
  background: rgba(var(--accent-rgb), 0.16);
  border-color: var(--accent);
  box-shadow: 0 0 18px rgba(var(--accent-rgb), 0.2);
}
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.2rem;
}

/* =========================================================================
   SECTION CHROME
   ========================================================================= */
.page {
  padding-left: var(--rail);
}
section {
  position: relative;
}
.section-pad {
  padding: 7rem 0;
}
.s-head {
  margin-bottom: 3.25rem;
}
.s-head.row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.s-index {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1rem;
}
.s-index .n {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent);
  letter-spacing: 0.08em;
}
.s-index .ln {
  flex: 0 0 42px;
  height: 1px;
  background: var(--line-2);
}
.s-index .lbl {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--faint);
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.s-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.2vw, 3.1rem);
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.025em;
  line-height: 1.04;
}
.s-sub {
  font-size: 0.98rem;
  color: var(--muted);
  margin-top: 1rem;
  max-width: 600px;
  line-height: 1.6;
}
.s-sub strong {
  color: var(--text);
  font-weight: 600;
}
.view-all {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--accent);
  opacity: 0.8;
  transition: opacity 0.2s;
  white-space: nowrap;
}
.view-all:hover {
  opacity: 1;
}

/* =========================================================================
   HERO
   ========================================================================= */
.hero {
  min-height: calc(100vh - 58px);
  display: flex;
  align-items: center;
  padding: 5rem 0;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse 60% 50% at 30% 30%,
    rgba(var(--accent-rgb), 0.07),
    transparent 70%
  );
}
.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 880px;
}
.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--live);
  letter-spacing: 0.04em;
  margin-bottom: 1.8rem;
  border: 1px solid var(--line);
  /* ----- for green border ----- */
  /* border: 1px solid rgba(var(--live-rgb), 0.5); */
  border-radius: 30px;
  padding: 0.35rem 0.85rem;
  background:
    linear-gradient(rgba(var(--live-rgb), 0.12), rgba(var(--live-rgb), 0.12)),
    rgba(8, 10, 12, 0.62);
}
.hero-tag-cur {
  color: var(--live);
  margin-left: 1px;
  animation: blink 1.1s steps(1) infinite;
}
.hero-tag .d {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 8px var(--live);
}
.hero-name {
  font-family: var(--font-display);
  font-size: clamp(3.2rem, 9vw, 7rem);
  font-weight: 700;
  line-height: 0.94;
  letter-spacing: -0.04em;
  color: #fff;
  margin-bottom: 1.4rem;
}
.hero-name .obj {
  color: var(--accent);
}
.hero-role {
  font-family: var(--font-mono);
  font-size: clamp(0.95rem, 1.7vw, 1.1rem);
  font-weight: 500;
  color: var(--text);
  margin-bottom: 1.6rem;
}
.hero-role .arw {
  color: var(--accent);
  margin-right: 0.5rem;
}
.hero-role .dim {
  color: var(--faint);
}
.hero-role .cur::after {
  content: "▋";
  color: var(--accent);
  margin-left: 2px;
  animation: blink 1.1s steps(1) infinite;
  font-size: 0.85em;
}
.hero-line {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.8vw, 2.05rem);
  font-weight: 500;
  color: var(--text);
  line-height: 1.32;
  letter-spacing: -0.015em;
  max-width: 760px;
  margin-bottom: 2.4rem;
  text-wrap: balance;
}
.hero-line b {
  color: #fff;
  font-weight: 700;
}
.hero-line .hl {
  color: var(--accent);
}
.hero-ctas {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
  align-items: center;
}
.hero-scroll {
  position: absolute;
  bottom: 2rem;
  left: calc(var(--rail) + var(--gutter));
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--dim);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  z-index: 2;
}
.hero-scroll .ln {
  width: 34px;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent);
  animation: scrollpulse 2.4s ease-in-out infinite;
}
@keyframes scrollpulse {
  0%,
  100% {
    opacity: 0.3;
  }
  50% {
    opacity: 1;
  }
}

/* hero stat strip */
.hero-stats {
  display: flex;
  gap: 2.4rem;
  margin-top: 3rem;
  flex-wrap: wrap;
}
.hstat {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.hstat .v {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}
.hstat .v .u {
  font-size: 0.9rem;
  color: var(--accent);
  vertical-align: baseline;
  line-height: 1;
  position: relative;
  top: -0.05em;
  margin-left: 0.1em;
}
.hstat .k {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--faint);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* hero variants */
body[data-hero="center"] .hero-inner {
  margin: 0 auto;
  text-align: center;
}
body[data-hero="center"] .hero-ctas,
body[data-hero="center"] .hero-stats {
  justify-content: center;
}
body[data-hero="center"] .hero-line {
  margin-left: auto;
  margin-right: auto;
}
body[data-hero="center"] .hero-scroll {
  left: 50%;
  transform: translateX(-50%);
}

body[data-hero="split"] .hero-inner {
  max-width: 100%;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 3.5rem;
  align-items: center;
}
body[data-hero="split"] .hero-visual {
  display: flex;
}

.hero-visual {
  display: none;
  position: relative;
  aspect-ratio: 4/3;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  overflow: hidden;
  align-items: flex-end;
  padding: 1rem;
  background:
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.022) 0 11px,
      transparent 11px 22px
    ),
    radial-gradient(
      circle at 65% 30%,
      rgba(var(--accent-rgb), 0.12),
      transparent 55%
    ),
    linear-gradient(160deg, var(--surface), var(--bg));
}
.hero-visual .lbl {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  color: var(--faint);
  background: rgba(0, 0, 0, 0.4);
  padding: 0.3rem 0.6rem;
  border-radius: 5px;
  border: 1px solid var(--line);
}
.hero-visual .gizmo {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--wire);
  letter-spacing: 0.04em;
}

/* =========================================================================
   BUTTONS
   ========================================================================= */
.btn {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.01em;
  padding: 0.78rem 1.4rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.22s ease;
  cursor: pointer;
  border: 1px solid transparent;
}
.btn-primary {
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--accent);
  border-color: rgba(var(--accent-rgb), 0.4);
  border-left: 3px solid var(--accent);
}
.btn-primary::before {
  content: "$";
  opacity: 0.55;
}
.btn-primary:hover {
  background: rgba(var(--accent-rgb), 0.18);
  color: #fff;
  box-shadow: 0 0 22px rgba(var(--accent-rgb), 0.2);
}
.btn-ghost {
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  border-color: var(--line-2);
}
.btn-ghost:hover {
  color: #fff;
  border-color: var(--line-3);
  background: rgba(255, 255, 255, 0.05);
}

/* =========================================================================
   SKILLS — subsystem modules
   ========================================================================= */
.sys-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1rem;
}
.sys {
  grid-column: span 2;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.012);
  position: relative;
  overflow: hidden;
  transition:
    border-color 0.25s,
    transform 0.25s,
    background 0.25s;
}
.sys:hover {
  border-color: var(--line-3);
  transform: translateY(-3px);
  background: rgba(255, 255, 255, 0.025);
}
.sys::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent);
  opacity: 0.7;
}
.sys.core {
  grid-column: span 3;
  background: linear-gradient(
    160deg,
    rgba(var(--accent-rgb), 0.06),
    rgba(255, 255, 255, 0.012)
  );
  border-color: rgba(var(--accent-rgb), 0.25);
}
.sys.wide {
  grid-column: span 3;
}
.sys-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.7rem;
}
.sys-id {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.sys-id .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 9px var(--accent);
}
.sys-id .nm {
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}
.sys-stat {
  font-family: var(--font-mono);
  font-size: 0.56rem;
  color: var(--faint);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.15rem 0.45rem;
}
.sys.core .sys-stat {
  color: var(--accent);
  border-color: rgba(var(--accent-rgb), 0.3);
}
.sys-desc {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 1.1rem;
}
.sys-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.chip {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  padding: 0.26rem 0.6rem;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line-2);
  color: var(--muted);
  letter-spacing: 0.01em;
}
.sys.core .chip {
  background: rgba(var(--accent-rgb), 0.08);
  border-color: rgba(var(--accent-rgb), 0.22);
  color: var(--accent);
}
/* per-subsystem accent */
.sys--xr::before {
  background: var(--c-xr);
}
.sys--xr .sys-id .dot {
  background: var(--c-xr);
  box-shadow: 0 0 9px var(--c-xr);
}
.sys--vp::before {
  background: var(--wire);
}
.sys--vp .sys-id .dot {
  background: var(--wire);
  box-shadow: 0 0 9px var(--wire);
}
.sys--cast::before {
  background: var(--onair);
}
.sys--cast .sys-id .dot {
  background: var(--onair);
  box-shadow: 0 0 9px var(--onair);
}
.sys--ai::before {
  background: var(--live);
}
.sys--ai .sys-id .dot {
  background: var(--live);
  box-shadow: 0 0 9px var(--live);
}
.sys--tools::before {
  background: var(--faint);
}
.sys--tools .sys-id .dot {
  background: var(--faint);
  box-shadow: 0 0 9px var(--faint);
}

/* =========================================================================
   EXPERIENCE — commit graph
   ========================================================================= */
.repo {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.012);
}
.repo-bar {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.75rem 1.2rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--faint);
  letter-spacing: 0.04em;
}
.repo-bar .br {
  color: var(--accent);
}
.repo-bar .br::before {
  content: "⎇ ";
}
.repo-bar .sp {
  margin-left: auto;
  color: var(--dim);
}
.commits {
  padding: 1.6rem 1.4rem 1.8rem;
  position: relative;
}
.commit {
  position: relative;
  padding: 0 0 2rem 2.6rem;
}
.commit:last-child {
  padding-bottom: 0;
}
.commit::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 16px;
  bottom: -6px;
  width: 2px;
  background: var(--line-2);
}
.commit:last-child::before {
  display: none;
}
.commit-node {
  position: absolute;
  left: 0;
  top: 5px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  z-index: 1;
  transition: transform 0.3s;
}
.commit.head .commit-node {
  background: var(--accent);
  box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.6);
}
.commit-meta {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.35rem;
  flex-wrap: wrap;
}
.commit-hash {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--accent);
}
.commit-date {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--faint);
}
.commit-head-tag {
  font-family: var(--font-mono);
  font-size: 0.56rem;
  color: var(--accent);
  border: 1px solid rgba(var(--accent-rgb), 0.4);
  background: rgba(var(--accent-rgb), 0.08);
  border-radius: 4px;
  padding: 0.1rem 0.45rem;
  letter-spacing: 0.08em;
}
.commit-now {
  font-family: var(--font-mono);
  font-size: 0.56rem;
  color: var(--live);
  border: 1px solid rgba(var(--live-rgb), 0.35);
  background: rgba(var(--live-rgb), 0.08);
  border-radius: 4px;
  padding: 0.1rem 0.45rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.commit-role {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}
.commit-co {
  font-size: 0.85rem;
  color: var(--accent);
  margin: 0.1rem 0 0.5rem;
}
.commit-desc {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.6;
  max-width: 640px;
}

/* =========================================================================
   PROJECT CARDS (client) + personal
   ========================================================================= */
.proj-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.filters {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}
.filter {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.38rem 0.9rem;
  border-radius: 6px;
  border: 1px solid var(--line-2);
  color: var(--faint);
  background: transparent;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.02em;
}
.filter.active {
  border-color: rgba(var(--accent-rgb), 0.45);
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.08);
}
.filter:hover:not(.active) {
  color: var(--muted);
  border-color: var(--line-3);
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.022);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  transition:
    transform 0.25s,
    box-shadow 0.25s,
    border-color 0.25s;
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(var(--accent-rgb), 0.3);
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(var(--accent-rgb), 0.12);
}
.card.hide {
  display: none;
}
.card-media {
  position: relative;
  height: 172px;
  flex-shrink: 0;
  display: flex;
  align-items: flex-end;
  padding: 0.8rem;
  overflow: hidden;
  background:
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.02) 0 10px,
      transparent 10px 20px
    ),
    radial-gradient(
      circle at 70% 25%,
      rgba(var(--accent-rgb), 0.1),
      transparent 55%
    ),
    linear-gradient(160deg, var(--surface), var(--bg));
}
.card-media .lbl {
  position: relative;
  z-index: 1;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--faint);
  background: rgba(0, 0, 0, 0.6);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  border: 1px solid var(--line);
  letter-spacing: 0.03em;
}
.badge {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 0.56rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 0.22rem 0.55rem;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  backdrop-filter: blur(10px) saturate(1.3);
  -webkit-backdrop-filter: blur(10px) saturate(1.3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
.badge .d {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.badge-live {
  background:
    linear-gradient(rgba(var(--live-rgb), 0.2), rgba(var(--live-rgb), 0.2)),
    rgba(8, 10, 12, 0.62);
  color: var(--live);
  border: 1px solid rgba(var(--live-rgb), 0.5);
}
.badge-live .d {
  background: var(--live);
  box-shadow: 0 0 6px var(--live);
}
.badge-rnd {
  background:
    linear-gradient(rgba(var(--wire-rgb), 0.2), rgba(var(--wire-rgb), 0.2)),
    rgba(8, 10, 12, 0.62);
  color: var(--wire);
  border: 1px solid rgba(var(--wire-rgb), 0.5);
}
.badge-rnd .d {
  background: var(--wire);
}
.card-body {
  padding: 1.2rem 1.25rem 1.3rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.card-role {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.card-title {
  font-family: var(--font-display);
  font-size: 1.06rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.25;
  margin-bottom: 0.55rem;
}
.card-desc {
  font-size: 0.83rem;
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 1.1rem;
  flex-grow: 1;
}
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: auto;
}
.tag {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line-2);
  color: var(--faint);
  letter-spacing: 0.02em;
}
.card-arrow {
  position: absolute;
  bottom: 1.3rem;
  right: 1.25rem;
  color: var(--accent);
  font-family: var(--font-mono);
  opacity: 0;
  transform: translateX(-5px);
  transition: all 0.25s;
}
.card:hover .card-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* list variant — desktop/tablet only; phones (<=720px) always render as cards */
@media (min-width: 721px) {
  .proj-grid[data-layout="list"] {
    grid-template-columns: 1fr;
    gap: 1px;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    background: var(--line);
  }
  .proj-grid[data-layout="list"] .card {
    flex-direction: row;
    border: none;
    border-radius: 0;
    background: var(--bg);
    transform: none;
    box-shadow: none;
  }
  .proj-grid[data-layout="list"] .card:hover {
    transform: none;
    box-shadow: none;
    background: rgba(255, 255, 255, 0.025);
    border-color: transparent;
  }
  .proj-grid[data-layout="list"] .card-media {
    width: 230px;
    height: auto;
    flex-shrink: 0;
    border-right: 1px solid var(--line);
  }
  .proj-grid[data-layout="list"] .card-arrow {
    display: none;
  }
  .proj-grid[data-layout="list"] .badge {
    top: 0.7rem;
    right: 0.7rem;
  }
}

.more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 2.2rem;
}
.more {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.07);
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  padding: 0.6rem 1.3rem;
  border-radius: 7px;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: all 0.2s;
}
.more:hover {
  background: rgba(var(--accent-rgb), 0.15);
  border-color: var(--accent);
  box-shadow: 0 0 16px rgba(var(--accent-rgb), 0.15);
}

/* personal & R&D — heavier craft cards */
.personal-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}
.pcard {
  position: relative;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.022);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  transition:
    transform 0.25s,
    box-shadow 0.25s,
    border-color 0.25s;
}
.pcard::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
  opacity: 0.75;
  z-index: 2;
  transition: opacity 0.25s;
}
.pcard:hover {
  transform: translateY(-4px);
  border-color: rgba(var(--accent-rgb), 0.32);
  box-shadow:
    0 18px 44px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(var(--accent-rgb), 0.14);
}
.pcard:hover::before {
  opacity: 1;
}
.pcard-media {
  position: relative;
  height: 200px;
  display: flex;
  align-items: flex-end;
  padding: 0.8rem;
  background:
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.022) 0 10px,
      transparent 10px 20px
    ),
    radial-gradient(
      circle at 70% 25%,
      rgba(var(--accent-rgb), 0.1),
      transparent 55%
    ),
    linear-gradient(160deg, var(--surface), var(--bg));
}
.pcard-media .lbl {
  position: relative;
  z-index: 1;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--faint);
  background: rgba(0, 0, 0, 0.4);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  border: 1px solid var(--line);
}
.pcard-body {
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.pcard-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}
.pcard-title {
  font-family: var(--font-display);
  font-size: 1.18rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.25;
}
.pcard-owned {
  font-family: var(--font-mono);
  font-size: 0.56rem;
  color: var(--live);
  border: 1px solid rgba(var(--live-rgb), 0.3);
  background: rgba(var(--live-rgb), 0.07);
  border-radius: 4px;
  padding: 0.12rem 0.45rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.pcard-desc {
  font-size: 0.87rem;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 1.1rem;
}
.pcard-sys {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.2rem;
}
.psys {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  padding: 0.24rem 0.55rem;
  border-radius: 5px;
  background: rgba(var(--accent-rgb), 0.07);
  border: 1px solid rgba(var(--accent-rgb), 0.2);
  color: var(--accent);
}
.pcard-links {
  display: flex;
  gap: 1.2rem;
  margin-top: auto;
}
.pcard-link {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent);
  opacity: 0.85;
  transition: opacity 0.2s;
}
.pcard-link:hover {
  opacity: 1;
}

/* =========================================================================
   DEVLOG
   ========================================================================= */
.posts {
  display: flex;
  flex-direction: column;
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--line);
}
.post {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  align-items: center;
  gap: 1.25rem;
  background: var(--bg);
  padding: 1.1rem 1.4rem;
  transition: background 0.2s;
}
.post:hover {
  background: rgba(255, 255, 255, 0.025);
}
.post-date {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--faint);
}
.post-main {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.post-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  transition: color 0.2s;
}
.post:hover .post-title {
  color: #fff;
}
.post-tags {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.post-tag {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--dim);
}
.post-tag::before {
  content: "#";
  color: var(--accent);
  opacity: 0.6;
}
.post-rt {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--dim);
  white-space: nowrap;
}
.post-arrow {
  font-family: var(--font-mono);
  color: var(--accent);
  opacity: 0;
  transform: translateX(-4px);
  transition: all 0.2s;
}
.post:hover .post-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* =========================================================================
   ABOUT
   ========================================================================= */
.about-grid {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 3.5rem;
  align-items: start;
}
.about-body p {
  color: var(--muted);
  font-size: 1.04rem;
  margin-bottom: 1.15rem;
  line-height: 1.7;
}
.about-body p:last-child {
  margin-bottom: 0;
}
.about-body strong {
  color: #fff;
  font-weight: 600;
}
.about-body .ac {
  color: var(--accent);
  font-weight: 500;
}
.facts {
  display: flex;
  flex-direction: column;
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--line);
}
.fact {
  background: var(--bg);
  padding: 1.05rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.fact-k {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--faint);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.fact-v {
  font-size: 0.96rem;
  color: #fff;
  font-weight: 500;
}
.fact-v span {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--faint);
  font-weight: 400;
}

/* ---- About portrait ---- */
.about-portrait {
  display: flex;
  flex-direction: column;
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--line);
}
.portrait-frame {
  position: relative;
  margin: 0;
  background: var(--bg);
  aspect-ratio: 1/1;
  overflow: hidden;
}
.portrait-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(0.15) contrast(1.02);
}
.pf-corner {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--accent);
  opacity: 0.85;
  pointer-events: none;
}
.pf-corner.tl {
  top: 10px;
  left: 10px;
  border-right: 0;
  border-bottom: 0;
}
.pf-corner.tr {
  top: 10px;
  right: 10px;
  border-left: 0;
  border-bottom: 0;
}
.pf-corner.bl {
  bottom: 10px;
  left: 10px;
  border-right: 0;
  border-top: 0;
}
.pf-corner.br {
  bottom: 10px;
  right: 10px;
  border-left: 0;
  border-top: 0;
}
.portrait-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--line);
}
.pm-row {
  background: var(--bg);
  padding: 1.05rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.pm-k {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--faint);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.pm-v {
  font-size: 0.96rem;
  color: #fff;
  font-weight: 500;
}
.pm-v span {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--faint);
  font-weight: 400;
}

/* =========================================================================
   CONTACT
   ========================================================================= */
.contact {
  border: 1px solid rgba(var(--accent-rgb), 0.2);
  border-radius: 16px;
  padding: 3.5rem 2.5rem;
  position: relative;
  overflow: hidden;
  text-align: center;
  background:
    radial-gradient(
      ellipse at 50% 0%,
      rgba(var(--accent-rgb), 0.08),
      transparent 60%
    ),
    linear-gradient(
      180deg,
      rgba(var(--accent-rgb), 0.04),
      rgba(255, 255, 255, 0.01)
    );
}
.contact-eye {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--live);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.contact-eye .d {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 8px var(--live);
  animation: pulse 2s ease-in-out infinite;
}
.contact h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.025em;
  line-height: 1.12;
  margin-bottom: 1rem;
}
.contact h2 .hl {
  color: var(--accent);
}
.contact p {
  color: var(--muted);
  max-width: 500px;
  margin: 0 auto 2.2rem;
  font-size: 1.02rem;
}
.contact-actions {
  display: flex;
  gap: 0.7rem;
  justify-content: center;
  flex-wrap: wrap;
}
.sbtn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 1.15rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line-2);
  color: var(--text);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.8rem;
  transition: all 0.2s;
}
.sbtn .ic {
  color: var(--accent);
}
.sbtn:hover {
  border-color: rgba(var(--accent-rgb), 0.5);
  background: rgba(var(--accent-rgb), 0.06);
  color: #fff;
  transform: translateY(-2px);
}
.sbtn.primary {
  color: var(--accent);
  border-color: rgba(var(--accent-rgb), 0.35);
  background: rgba(var(--accent-rgb), 0.08);
}

/* =========================================================================
   FOOTER
   ========================================================================= */
.footer {
  border-top: 1px solid var(--line);
  padding: 3rem 0 2.5rem;
  margin-top: 5rem;
}
.footer .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.footer-name {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}
.footer-name .dot {
  color: var(--accent);
}
.footer-tag {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--dim);
  letter-spacing: 0.04em;
}
.footer-links {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.footer-link {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--faint);
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  transition: all 0.2s;
}
.footer-link:hover {
  color: #fff;
  border-color: var(--line-3);
  background: rgba(255, 255, 255, 0.03);
}
.footer-copy {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--ghost);
  letter-spacing: 0.04em;
  width: 100%;
  text-align: center;
  margin-top: 2rem;
}

/* =========================================================================
   SCROLL REVEAL
   ========================================================================= */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 0.7s ease,
    transform 0.7s ease;
}
.reveal.in {
  opacity: 1;
  transform: none;
}
body[data-motion="off"] .reveal {
  opacity: 1;
  transform: none;
  transition: none;
}
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* commit graph draw-in */
.commit-node {
  transform: scale(0);
}
.repo.in .commit-node {
  transform: scale(1);
}
.repo.in .commit:nth-child(1) .commit-node {
  transition-delay: 0.1s;
}
.repo.in .commit:nth-child(2) .commit-node {
  transition-delay: 0.3s;
}
.repo.in .commit:nth-child(3) .commit-node {
  transition-delay: 0.5s;
}
body[data-motion="off"] .commit-node {
  transform: scale(1);
  transition: none;
}
@media (prefers-reduced-motion: reduce) {
  .commit-node {
    transform: scale(1);
    transition: none;
  }
}

/* =========================================================================
   RESPONSIVE
   ========================================================================= */
@media (max-width: 1080px) {
  .sys-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .sys,
  .sys.core,
  .sys.wide {
    grid-column: span 2;
  }
}
@media (max-width: 960px) {
  :root {
    --rail: 0px;
  }
  .rail {
    display: none;
  }
  .proj-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .about-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  body[data-hero="split"] .hero-inner {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}
@media (max-width: 720px) {
  :root {
    --gutter: 1.35rem;
  }
  /* viewport corner marks are hidden on phones — the bottom pair jittered against
     the browser chrome show/hide, and JS sync couldn't track it smoothly */
  .vp-frame {
    display: none;
  }
  /* keep the hero vertically centered but cut the empty slack on phones */
  .hero {
    min-height: calc(100svh - 58px);
    padding: 3.25rem 0;
  }
  .hero-scroll {
    bottom: 1.25rem;
  }
  .section-pad {
    padding: 5rem 0;
  }
  .nav-links {
    position: absolute;
    top: 45px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--bg-2);
    border-bottom: 1px solid var(--line);
    padding: 0.5rem 1.35rem;
    display: none;
  }
  .nav-links.open {
    display: flex;
  }
  .nav-links li {
    width: 100%;
  }
  .nav-links a {
    display: block;
    padding: 0.75rem 0;
    width: 100%;
  }
  .nav-links a.active::after {
    display: none;
  }
  .brand-sub {
    display: none;
  }
  .nav-status {
    display: none;
  }
  .nav-toggle {
    display: inline-flex;
  }
  .sys-grid {
    grid-template-columns: 1fr;
  }
  .sys,
  .sys.core,
  .sys.wide {
    grid-column: span 1;
  }
  /* phones always show cards (list variant is gated to >=721px), single column */
  .proj-grid {
    grid-template-columns: 1fr;
  }
  .personal-grid {
    grid-template-columns: 1fr;
  }
  .post {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  .post-rt,
  .post-arrow {
    display: none;
  }
  .readout {
    display: none;
  }
  .footer .wrap {
    flex-direction: column;
    text-align: center;
  }
}

/* --- Lightbox (shared across project shots, devlog images, carousels) --- */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(8, 8, 10, 0.92);
  backdrop-filter: blur(4px);
  padding: clamp(1rem, 5vw, 4rem);
  /* zoomed images grow past .lightbox-content's box — clip at the viewport
     edge, not the box hugging the image, or zoom looks like it's happening
     inside a small window the size of the original image */
  overflow: hidden;
}
.lightbox-overlay.active {
  display: flex;
}
.lightbox-content {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  touch-action: none;
}
.lightbox-content img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  cursor: zoom-in;
  touch-action: none;
  user-select: none;
}
.lightbox-content img.zoomed {
  cursor: grab;
  border-radius: 4px;
}
.lightbox-content img.dragging {
  cursor: grabbing;
}
@media (min-width: 1024px) {
  .lightbox-content {
    max-width: 1500px; /* 1100px + 25% */
  }
  .lightbox-content img {
    max-height: 100vh; /* 80vh + 25%; still bounded by .lightbox-content's max-height: 100% and the overlay's padding */
  }
}
.lightbox-caption {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--muted);
  text-align: center;
  max-width: 680px;
}
.lightbox-close {
  position: absolute;
  z-index: 2;
  top: 1.1rem;
  right: 1.3rem;
  background: none;
  border: none;
  color: var(--faint);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s;
}
.lightbox-close:hover {
  color: var(--accent);
}
.lightbox-btn {
  position: absolute;
  z-index: 2;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--line);
  color: #fff;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  transition:
    border-color 0.2s,
    background 0.2s;
}
.lightbox-btn:hover {
  border-color: var(--accent);
  background: rgba(0, 0, 0, 0.65);
}
.lightbox-btn.prev {
  left: 1.3rem;
}
.lightbox-btn.next {
  right: 1.3rem;
}
/* touch devices swipe/pinch instead of tapping arrows */
@media (hover: none) and (pointer: coarse) {
  .lightbox-btn {
    display: none !important;
  }
}
