/* ============================================================
   jborlido.pt — design system
   Direction: systems-console editorial. Dark graphite, hairline
   grid, mono telemetry labels, single signal-mint accent.
   Fonts: Archivo (variable, wdth 62–125) + Fragment Mono.
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  --bg-0: #07090d;
  --bg-1: #0c0f15;
  --bg-2: #12161f;
  --line: rgba(226, 232, 244, 0.08);
  --line-strong: rgba(226, 232, 244, 0.18);
  --text-1: #e6eaf2;
  --text-2: #9aa4b5;
  --text-3: #5c6675;
  --accent: #3df2a3;
  --accent-dim: rgba(61, 242, 163, 0.12);
  --accent-line: rgba(61, 242, 163, 0.35);
  --badge-case: #3df2a3;
  --badge-saas: #6ac8ff;
  --badge-tool: #f5b84d;
  --badge-game: #ff8f7a;
  --font-body: "Archivo", system-ui, sans-serif;
  --font-mono: "Fragment Mono", ui-monospace, "SF Mono", monospace;
  --maxw: 1160px;
  --pad: clamp(1.25rem, 4vw, 2.5rem);
  --nav-h: 64px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 24px); }
body {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text-1);
  background: var(--bg-0);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
::selection { background: var(--accent); color: var(--bg-0); }

/* ---------- Atmosphere: grid + glow + noise ---------- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 80% 50% at 70% -10%, rgba(61, 242, 163, 0.07), transparent 60%),
    radial-gradient(ellipse 60% 40% at 10% 110%, rgba(106, 200, 255, 0.05), transparent 60%),
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 72px 72px, 72px 72px;
  mask-image: linear-gradient(#000 0%, rgba(0,0,0,0.55) 40%, rgba(0,0,0,0.85) 100%);
  -webkit-mask-image: linear-gradient(#000 0%, rgba(0,0,0,0.55) 40%, rgba(0,0,0,0.85) 100%);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.04 0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Type utilities ---------- */
.mono {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}
.kicker {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ---------- Nav ---------- */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(7, 9, 13, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--pad);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-1);
  letter-spacing: 0.05em;
}
.nav-logo .caret {
  display: inline-block;
  width: 0.55em;
  height: 1.05em;
  margin-left: 2px;
  vertical-align: text-bottom;
  background: var(--accent);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.nav-menu {
  display: flex;
  gap: 2rem;
  align-items: center;
}
.nav-link {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
  transition: color 0.2s;
  padding: 0.35rem 0;
}
.nav-link .idx { color: var(--text-3); margin-right: 0.3em; }
.nav-link:hover, .nav-link.active { color: var(--accent); }
.hamburger { display: none; cursor: pointer; padding: 8px; background: none; border: 0; }
.hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: var(--text-1);
  margin: 5px 0;
  transition: transform 0.25s, opacity 0.25s;
}
.hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Layout primitives ---------- */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(4rem, 9vw, 7rem) var(--pad);
}
.section + .section { border-top: 1px solid var(--line); }
.section-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}
.section-head .idx {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--accent);
  letter-spacing: 0.1em;
}
.section-head h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 700;
  font-stretch: 115%;
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.section-head .rule {
  flex: 1;
  height: 1px;
  background: var(--line-strong);
  align-self: center;
}

/* ---------- Hero ---------- */
.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: calc(var(--nav-h) + clamp(4rem, 12vh, 8rem)) var(--pad) clamp(4rem, 10vh, 7rem);
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.hero .kicker { margin-bottom: 1.25rem; }
.hero h1 {
  font-size: clamp(2.8rem, 9vw, 6.5rem);
  font-weight: 800;
  font-stretch: 125%;
  line-height: 0.98;
  letter-spacing: -0.015em;
  text-transform: uppercase;
  margin-bottom: 1.75rem;
}
.hero h1 .accent-dot { color: var(--accent); }
.hero-lede {
  max-width: 34em;
  font-size: clamp(1.05rem, 1.8vw, 1.25rem);
  color: var(--text-2);
  margin-bottom: 2.5rem;
}
.hero-lede strong { color: var(--text-1); font-weight: 600; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 3.5rem; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.85rem 1.6rem;
  border: 1px solid var(--line-strong);
  color: var(--text-1);
  transition: border-color 0.2s, background 0.2s, color 0.2s, transform 0.2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg-0);
  font-weight: 700;
}
.btn-primary:hover { background: #5ff7b6; border-color: #5ff7b6; }
.btn-ghost:hover { border-color: var(--accent-line); color: var(--accent); }

/* Hero status strip */
.status-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  border: 1px solid var(--line);
  background: rgba(12, 15, 21, 0.6);
}
.status-cell {
  padding: 0.9rem 1.1rem;
  border-right: 1px solid var(--line);
  min-width: 0;
}
.status-cell:last-child { border-right: 0; }
.status-cell .label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 0.3rem;
}
.status-cell .value {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.status-cell .value a:hover { color: var(--accent); }
.pulse {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 0.5em;
  box-shadow: 0 0 0 0 rgba(61, 242, 163, 0.6);
  animation: pulse 2.2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(61, 242, 163, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(61, 242, 163, 0); }
  100% { box-shadow: 0 0 0 0 rgba(61, 242, 163, 0); }
}

/* ---------- What I do ---------- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.service {
  background: var(--bg-0);
  padding: clamp(1.5rem, 3vw, 2.25rem);
  transition: background 0.25s;
}
.service:hover { background: var(--bg-1); }
.service .num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  display: block;
  margin-bottom: 1.1rem;
}
.service h3 {
  font-size: 1.25rem;
  font-weight: 700;
  font-stretch: 110%;
  margin-bottom: 0.75rem;
}
.service p { color: var(--text-2); font-size: 0.9875rem; }

/* ---------- Work (unified case studies + tools) ---------- */
.work-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}
.work-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  background: var(--bg-1);
  padding: clamp(1.5rem, 3vw, 2rem);
  transition: border-color 0.25s, transform 0.25s, background 0.25s;
}
.work-card:hover {
  border-color: var(--accent-line);
  background: var(--bg-2);
  transform: translateY(-3px);
}
.work-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.1rem;
}
.badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.3rem 0.6rem;
  border: 1px solid currentColor;
}
.badge-case { color: var(--badge-case); }
.badge-saas { color: var(--badge-saas); }
.badge-tool { color: var(--badge-tool); }
.badge-game { color: var(--badge-game); }
.work-live {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.work-card h3 {
  font-size: clamp(1.2rem, 2.2vw, 1.5rem);
  font-weight: 700;
  font-stretch: 112%;
  line-height: 1.15;
  margin-bottom: 0.75rem;
}
.work-card > p { color: var(--text-2); font-size: 0.9875rem; flex: 1; }
.work-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 1.4rem;
}
.work-tags span {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.05em;
  color: var(--text-3);
  padding: 0.25rem 0.55rem;
  border: 1px solid var(--line);
}
.work-cta {
  margin-top: 1.4rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-1);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.work-card:hover .work-cta { color: var(--accent); }
.work-cta .arrow { transition: transform 0.2s; }
.work-card:hover .work-cta .arrow { transform: translateX(4px); }
.work-note {
  margin-top: 1.4rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: var(--text-3);
}
a.work-card-link { position: absolute; inset: 0; z-index: 1; }

/* ---------- Experience timeline ---------- */
.timeline { border-left: 1px solid var(--line-strong); }
.tl-item {
  position: relative;
  padding: 0 0 clamp(2rem, 4vw, 2.75rem) clamp(1.5rem, 3.5vw, 2.5rem);
}
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 0.55em;
  width: 9px; height: 9px;
  background: var(--bg-0);
  border: 1px solid var(--accent);
  transform: rotate(45deg);
}
.tl-date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--accent);
  display: block;
  margin-bottom: 0.4rem;
}
.tl-item h3 {
  font-size: 1.2rem;
  font-weight: 700;
  font-stretch: 110%;
  margin-bottom: 0.15rem;
}
.tl-org {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-2);
  margin-bottom: 0.65rem;
  display: block;
}
.tl-org a { border-bottom: 1px solid var(--line-strong); transition: color 0.2s, border-color 0.2s; }
.tl-org a:hover { color: var(--accent); border-color: var(--accent-line); }
.tl-item p { color: var(--text-2); font-size: 0.9875rem; max-width: 46em; }
.tl-compact { display: grid; gap: 0.5rem; margin-top: 0.25rem; }
.tl-compact li {
  color: var(--text-2);
  font-size: 0.9375rem;
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
}
.tl-compact .mono { flex-shrink: 0; }

/* ---------- Game background strip ---------- */
.games-intro { color: var(--text-2); max-width: 46em; margin-bottom: 2rem; }
.games-intro strong { color: var(--text-1); }
.games-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.game-card {
  border: 1px solid var(--line);
  background: var(--bg-1);
  transition: border-color 0.25s, transform 0.25s;
  display: block;
}
.game-card:hover { border-color: var(--accent-line); transform: translateY(-3px); }
.game-card .thumb {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.game-card .thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: saturate(0.85);
  transition: filter 0.3s, transform 0.4s;
}
.game-card:hover .thumb img { filter: saturate(1.05); transform: scale(1.03); }
.game-card .body { padding: 1.1rem 1.25rem 1.3rem; }
.game-card h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.3rem; }
.game-card .desc { color: var(--text-2); font-size: 0.875rem; }

/* Single featured game: horizontal layout */
.game-card-wide {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(240px, 420px) 1fr;
  align-items: stretch;
}
.game-card-wide .thumb {
  aspect-ratio: auto;
  min-height: 200px;
  border-bottom: 0;
  border-right: 1px solid var(--line);
}
.game-card-wide .body {
  padding: clamp(1.25rem, 3vw, 2rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.game-card-wide h3 { font-size: clamp(1.2rem, 2.2vw, 1.5rem); font-stretch: 112%; }
.game-card-wide .desc { font-size: 0.9875rem; max-width: 40em; }
@media (max-width: 680px) {
  .game-card-wide { grid-template-columns: 1fr; }
  .game-card-wide .thumb { border-right: 0; border-bottom: 1px solid var(--line); aspect-ratio: 16 / 9; min-height: 0; }
}

/* ---------- About / contact ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: start;
}
.about-photo {
  border: 1px solid var(--line-strong);
  padding: 6px;
  background: var(--bg-1);
}
.about-photo img { filter: saturate(0.9); width: 100%; }
.about-copy p { color: var(--text-2); max-width: 46em; margin-bottom: 1.1rem; }
.about-copy p strong { color: var(--text-1); font-weight: 600; }
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin: 2rem 0 2.5rem;
}
.stat {
  background: var(--bg-0);
  padding: 1.25rem 1rem;
  text-align: left;
}
.stat .num {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  font-stretch: 120%;
  color: var(--accent);
  display: block;
  line-height: 1.1;
}
.stat .label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-top: 0.4rem;
  display: block;
}
.contact-row { display: flex; gap: 1rem; flex-wrap: wrap; }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  margin-top: clamp(3rem, 8vw, 5rem);
}
.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2rem var(--pad);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.footer .mono a:hover { color: var(--accent); }

/* ---------- Detail pages (case studies + projects) ---------- */
.page {
  max-width: 820px;
  margin: 0 auto;
  padding: calc(var(--nav-h) + clamp(3rem, 8vh, 5rem)) var(--pad) clamp(3rem, 8vh, 5rem);
}
.breadcrumb {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 2.5rem;
  display: inline-flex;
  gap: 0.6rem;
}
.breadcrumb a:hover { color: var(--accent); }
.page-head { margin-bottom: clamp(2rem, 5vw, 3rem); }
.page-head .badge { margin-bottom: 1.25rem; display: inline-block; }
.page-head h1 {
  font-size: clamp(2rem, 5.5vw, 3.4rem);
  font-weight: 800;
  font-stretch: 120%;
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin-bottom: 1.25rem;
}
.page-head .lede { color: var(--text-2); font-size: 1.125rem; max-width: 40em; }
.meta-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  border: 1px solid var(--line);
  background: rgba(12, 15, 21, 0.6);
  margin-top: 1.75rem;
}
.prose h2 {
  font-size: 1.4rem;
  font-weight: 700;
  font-stretch: 112%;
  margin: 2.75rem 0 1rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}
.prose h2 .idx {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.1em;
}
.prose p { color: var(--text-2); margin-bottom: 1.1rem; }
.prose p strong, .prose li strong { color: var(--text-1); font-weight: 600; }
.prose ul { margin: 0 0 1.25rem; display: grid; gap: 0.6rem; }
.prose li {
  color: var(--text-2);
  padding-left: 1.4rem;
  position: relative;
}
.prose li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.8em;
  top: 0.25em;
}
.prose .callout {
  border: 1px solid var(--line-strong);
  border-left: 2px solid var(--accent);
  background: var(--bg-1);
  padding: 1.25rem 1.5rem;
  margin: 1.75rem 0;
}
.prose .callout p { margin: 0; }
.page-cta {
  margin-top: 3rem;
  padding: 2rem;
  border: 1px solid var(--line-strong);
  background: var(--bg-1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.page-cta p { color: var(--text-2); margin: 0; }
.page-cta p strong { color: var(--text-1); }

/* ---------- Carousel (project pages) ---------- */
.project-hero { max-width: var(--maxw); margin: 0 auto; padding: calc(var(--nav-h) + 3rem) var(--pad) 0; }
.project-hero h1 {
  font-size: clamp(2rem, 5.5vw, 3.4rem);
  font-weight: 800;
  font-stretch: 120%;
  line-height: 1.05;
  margin: 2rem 0 0.5rem;
}
.project-meta {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  color: var(--text-3);
  text-transform: uppercase;
}
.media-carousel { position: relative; border: 1px solid var(--line); background: var(--bg-1); }
.carousel-container { position: relative; overflow: hidden; }
.carousel-track { display: flex; transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1); }
.carousel-item { min-width: 100%; display: flex; align-items: center; justify-content: center; }
.carousel-item img { width: 100%; aspect-ratio: 16 / 9; object-fit: contain; background: var(--bg-0); }
.video-container { position: relative; width: 100%; aspect-ratio: 16 / 9; }
.video-container iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  background: rgba(7, 9, 13, 0.7);
  border: 1px solid var(--line-strong);
  color: var(--text-1);
  font-size: 1rem;
  width: 42px; height: 42px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.carousel-nav:hover { border-color: var(--accent); color: var(--accent); }
.carousel-nav.prev { left: 12px; }
.carousel-nav.next { right: 12px; }
.carousel-indicators {
  position: absolute;
  bottom: 12px; left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 2;
}
.carousel-indicator {
  width: 22px; height: 3px;
  background: var(--line-strong);
  cursor: pointer;
  transition: background 0.2s;
}
.carousel-indicator.active { background: var(--accent); }
.project-body { max-width: 820px; margin: 0 auto; padding: 2rem var(--pad) 4rem; }
.project-body h2 {
  font-size: 1.4rem;
  font-weight: 700;
  font-stretch: 112%;
  margin: 2.5rem 0 1rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}
.project-body h2:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.project-body p { color: var(--text-2); margin-bottom: 1.1rem; }
.project-body ul { display: grid; gap: 0.6rem; margin-bottom: 1.25rem; }
.project-body li { color: var(--text-2); padding-left: 1.4rem; position: relative; }
.project-body li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.8em;
  top: 0.25em;
}
.page-footer-link {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 var(--pad) 4rem;
}
.page-footer-link a {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
}
.page-footer-link a:hover { color: var(--accent); }

/* ---------- Interactive demos (case studies) ---------- */
.demo-panel {
  border: 1px solid var(--line-strong);
  background: var(--bg-1);
  margin: 2rem 0;
}
.demo-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}
.demo-titlebar .title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
}
.demo-titlebar .tag {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--badge-tool);
  border: 1px solid currentColor;
  padding: 0.2rem 0.5rem;
}
.demo-controls {
  display: flex;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  border-top: 1px solid var(--line);
  background: var(--bg-2);
}
.demo-btn {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.45rem 0.9rem;
  background: none;
  border: 1px solid var(--line-strong);
  color: var(--text-1);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.demo-btn:hover { border-color: var(--accent-line); color: var(--accent); }
.demo-btn.primary { background: var(--accent); border-color: var(--accent); color: var(--bg-0); font-weight: 700; }
.demo-btn.primary:hover { background: #5ff7b6; color: var(--bg-0); }

/* Terminal replay */
.term {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.7;
  padding: 1.1rem 1.25rem;
  height: 340px;
  overflow-y: auto;
  background: var(--bg-0);
}
.term-line { display: block; opacity: 0; animation: term-in 0.25s forwards; word-wrap: break-word; }
@keyframes term-in { to { opacity: 1; } }
.term-line .t { color: var(--text-3); margin-right: 0.6em; }
.term-line.agent .who { color: var(--accent); }
.term-line.dev .who { color: var(--badge-saas); }
.term-line.tool { color: var(--badge-tool); }
.term-line.result { color: var(--accent); }
.term-line .who { margin-right: 0.5em; }
.term-line .msg { color: var(--text-2); }
.term-cursor {
  display: inline-block;
  width: 0.55em; height: 1.05em;
  background: var(--accent);
  vertical-align: text-bottom;
  animation: blink 1.1s steps(1) infinite;
}

/* Task transformer */
.flow-tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 1rem; border-bottom: 1px solid var(--line); }
.flow-tab {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.5rem 0.95rem;
  background: none;
  border: 1px solid var(--line-strong);
  color: var(--text-2);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.flow-tab:hover { border-color: var(--accent-line); color: var(--accent); }
.flow-tab.active { background: var(--accent); border-color: var(--accent); color: var(--bg-0); font-weight: 700; }
.flow-compare {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: stretch;
  padding: 1.25rem;
}
.flow-col { border: 1px solid var(--line); background: var(--bg-0); padding: 1.1rem 1.2rem; }
.flow-col .head {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.8rem;
}
.flow-col.before .head { color: var(--text-3); }
.flow-col.after .head { color: var(--accent); }
.flow-col ol { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.45rem; }
.flow-col li { color: var(--text-2); font-size: 0.9rem; padding-left: 0.2rem; }
.flow-col li::before { content: none; }
.flow-col li.human strong { color: var(--text-1); }
.flow-col .time {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}
.flow-col.before .time { color: var(--text-3); }
.flow-col.after .time { color: var(--accent); }
.flow-arrow {
  align-self: center;
  color: var(--accent);
  font-size: 1.4rem;
}
@media (max-width: 680px) {
  .flow-compare { grid-template-columns: 1fr; }
  .flow-arrow { transform: rotate(90deg); justify-self: center; }
}

/* ---------- Reveal animations ----------
   Hidden state is gated on html.js (set by an inline script) so content
   stays visible for no-JS users and crawlers. */
.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.2, 0.6, 0.2, 1), transform 0.7s cubic-bezier(0.2, 0.6, 0.2, 1);
}
.js .reveal.animate-in { opacity: 1; transform: none; }
.reveal-1 { transition-delay: 0.08s; }
.reveal-2 { transition-delay: 0.16s; }
.reveal-3 { transition-delay: 0.24s; }
.reveal-4 { transition-delay: 0.32s; }

/* Hero load-in (no observer needed) */
.hero .kicker, .hero h1, .hero-lede, .hero-actions, .hero .status-strip {
  opacity: 0;
  transform: translateY(18px);
  animation: rise 0.8s cubic-bezier(0.2, 0.6, 0.2, 1) forwards;
}
.hero h1 { animation-delay: 0.1s; }
.hero-lede { animation-delay: 0.22s; }
.hero-actions { animation-delay: 0.34s; }
.hero .status-strip { animation-delay: 0.46s; }
@keyframes rise { to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal, .hero .kicker, .hero h1, .hero-lede, .hero-actions, .hero .status-strip { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .work-grid { grid-template-columns: 1fr; }
  .games-grid { grid-template-columns: 1fr 1fr; }
  .about-grid { grid-template-columns: 160px 1fr; }
}
@media (max-width: 680px) {
  .services-grid { grid-template-columns: 1fr; }
  .games-grid { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; }
  .about-photo { max-width: 200px; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .status-strip { grid-template-columns: 1fr 1fr; }
  .status-cell .value { white-space: normal; }
  .status-cell { border-bottom: 1px solid var(--line); }
  .status-cell:nth-child(even) { border-right: 0; }
  .status-cell:nth-last-child(-n+2) { border-bottom: 0; }
  .nav-menu {
    position: fixed;
    top: var(--nav-h);
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    width: min(70vw, 280px);
    height: calc(100vh - var(--nav-h));
    background: rgba(7, 9, 13, 0.97);
    border-left: 1px solid var(--line);
    padding: 1.5rem;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.2, 0.6, 0.2, 1);
  }
  .nav-menu.active { transform: translateX(0); }
  .nav-menu li { width: 100%; }
  .nav-link { display: block; padding: 0.9rem 0; border-bottom: 1px solid var(--line); }
  .hamburger { display: block; }
}
