/* ============================================================
   DAVID MBOYA — davidmboya.com
   Hand-crafted design system. Zero frameworks.
   ============================================================ */

:root {
  --bg: #04070a;
  --bg-2: #070d11;
  --bg-3: #0a1216;
  --surface: rgba(148, 199, 172, 0.045);
  --surface-2: rgba(148, 199, 172, 0.08);
  --line: rgba(148, 199, 172, 0.14);
  --line-bright: rgba(148, 199, 172, 0.3);
  --primary: #4ade80;
  --primary-dim: rgba(74, 222, 128, 0.12);
  --accent: #22d3ee;
  --accent-dim: rgba(34, 211, 238, 0.1);
  --text: #e8f2ec;
  --muted: #8ba898;
  --faint: #57705f;
  --danger: #f87171;
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --radius: 14px;
  --radius-sm: 8px;
  --wrap: 1180px;
  --nav-h: 72px;
  --glow: 0 0 24px rgba(74, 222, 128, 0.25);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Ambient background: grid + aurora */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 60% 45% at 15% -5%, rgba(74, 222, 128, 0.09), transparent 60%),
    radial-gradient(ellipse 55% 45% at 90% 10%, rgba(34, 211, 238, 0.07), transparent 60%),
    radial-gradient(ellipse 50% 40% at 50% 110%, rgba(74, 222, 128, 0.05), transparent 60%),
    var(--bg);
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(148, 199, 172, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 199, 172, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
  pointer-events: none;
}

::selection { background: rgba(74, 222, 128, 0.3); color: #fff; }

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 4px; }

h1, h2, h3, h4 { line-height: 1.15; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 1rem; }
p { margin: 0 0 1.2rem; }

.wrap { width: min(var(--wrap), 92vw); margin-inline: auto; }
.mono { font-family: var(--font-mono); }
.grad {
  background: linear-gradient(120deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Skip link ---------- */
.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--primary); color: #04070a;
  padding: .6rem 1.2rem; z-index: 200; font-family: var(--font-mono);
}
.skip:focus { left: 8px; top: 8px; }

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center;
  transition: background .3s, border-color .3s, backdrop-filter .3s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(4, 7, 10, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}
.nav .wrap { display: flex; align-items: center; gap: 2rem; }
.brand {
  display: flex; align-items: center; gap: .6rem;
  font-family: var(--font-mono); font-weight: 700; font-size: 1.05rem;
  color: var(--text); letter-spacing: -0.02em;
}
.brand:hover { text-decoration: none; }
.brand svg { width: 30px; height: 30px; }
.brand .tld { color: var(--primary); }
.nav-links {
  display: flex; gap: .25rem; margin-left: auto; align-items: center;
  list-style: none; margin: 0 0 0 auto; padding: 0;
}
.nav-links a {
  color: var(--muted); font-size: .92rem; font-family: var(--font-mono);
  padding: .5rem .8rem; border-radius: var(--radius-sm);
  transition: color .2s, background .2s;
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav-links a.active { color: var(--primary); }
.nav-links a.active::before { content: './'; color: var(--faint); }
.nav-cta {
  margin-left: .5rem;
  border: 1px solid var(--line-bright);
  color: var(--primary) !important;
  background: var(--primary-dim);
}
.nav-cta:hover { box-shadow: var(--glow); }
.burger {
  display: none; margin-left: auto; background: none; border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: .5rem .7rem; color: var(--text);
  font-family: var(--font-mono); cursor: pointer; font-size: 1rem;
}
.progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 0;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  z-index: 101;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--font-mono); font-size: .95rem; font-weight: 500;
  padding: .85rem 1.6rem; border-radius: var(--radius-sm);
  border: 1px solid var(--line-bright); color: var(--text);
  background: var(--surface); cursor: pointer;
  transition: transform .2s, box-shadow .25s, background .2s, border-color .2s;
  position: relative;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); border-color: var(--primary); }
.btn-primary {
  background: linear-gradient(120deg, var(--primary), #34d399);
  color: #04120a; border-color: transparent; font-weight: 700;
}
.btn-primary:hover { box-shadow: 0 8px 32px rgba(74, 222, 128, 0.35); color: #04120a; }
.btn-ghost:hover { box-shadow: var(--glow); }
.btn-sm { padding: .55rem 1.1rem; font-size: .85rem; }

/* ---------- Sections ---------- */
section { padding: clamp(4rem, 9vw, 7.5rem) 0; position: relative; }
.sec-tag {
  font-family: var(--font-mono); font-size: .85rem; color: var(--primary);
  display: inline-flex; align-items: center; gap: .5rem; margin-bottom: 1.1rem;
}
.sec-tag::before { content: '//'; color: var(--faint); }
.sec-title { font-size: clamp(1.8rem, 4vw, 2.7rem); margin-bottom: 1rem; }
.sec-lead { color: var(--muted); max-width: 620px; font-size: 1.08rem; }

/* ---------- Hero ---------- */
.hero {
  min-height: 100svh;
  display: flex; align-items: center;
  padding-top: var(--nav-h);
  position: relative; overflow: hidden;
}
#net { position: absolute; inset: 0; z-index: 0; opacity: .55; }
.hero .wrap {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1.15fr .85fr; gap: 3rem; align-items: center;
}
.hero-tag {
  font-family: var(--font-mono); color: var(--primary); font-size: .95rem;
  margin-bottom: 1.4rem; display: flex; align-items: center; gap: .6rem;
}
.hero-tag .dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--primary);
  box-shadow: 0 0 12px var(--primary); animation: pulse 2s infinite;
}
@keyframes pulse { 50% { opacity: .35; } }
.hero h1 {
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  font-weight: 700; letter-spacing: -0.03em; margin-bottom: 1.3rem;
}
.hero h1 .line { display: block; }
.hero-sub { color: var(--muted); font-size: 1.15rem; max-width: 540px; margin-bottom: 2.2rem; }
.hero-sub b, .hero-sub strong { color: var(--text); font-weight: 600; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }
.type-wrap { font-family: var(--font-mono); min-height: 1.6em; }
.caret { display: inline-block; width: .55em; height: 1.05em; background: var(--primary);
  vertical-align: -0.15em; margin-left: 2px; animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* Terminal card */
.term {
  background: rgba(6, 12, 10, 0.82);
  border: 1px solid var(--line); border-radius: var(--radius);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(148,199,172,.08);
  font-family: var(--font-mono); font-size: .88rem; overflow: hidden;
}
.term-bar {
  display: flex; align-items: center; gap: .5rem;
  padding: .75rem 1rem; border-bottom: 1px solid var(--line);
  background: rgba(148,199,172,.04);
}
.term-bar i { width: 11px; height: 11px; border-radius: 50%; display: block; }
.term-bar i:nth-child(1) { background: #f87171; }
.term-bar i:nth-child(2) { background: #fbbf24; }
.term-bar i:nth-child(3) { background: #4ade80; }
.term-bar span { margin-left: .5rem; color: var(--faint); font-size: .8rem; }
.term-body { padding: 1.2rem 1.3rem; min-height: 240px; }
.term-body .ln { display: block; margin-bottom: .4rem; white-space: pre-wrap; word-break: break-word; }
.term-body .p { color: var(--primary); }
.term-body .c { color: var(--accent); }
.term-body .k { color: #f0abfc; }
.term-body .s { color: #fcd34d; }
.term-body .m { color: var(--muted); }
.term-body .w { color: var(--text); }

/* Stats band */
.stats {
  border-block: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(148,199,172,.03), transparent);
  padding: 3rem 0;
}
.stats .wrap { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; }
.stat { text-align: left; }
.stat .num {
  font-size: clamp(2.2rem, 4.5vw, 3.4rem); font-weight: 700;
  font-family: var(--font-mono); color: var(--primary); line-height: 1;
}
.stat .num::after { content: '+'; color: var(--accent); }
.stat .lbl { color: var(--muted); font-size: .92rem; margin-top: .5rem; }

/* ---------- Cards / grids ---------- */
.grid { display: grid; gap: 1.4rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.7rem;
  position: relative; overflow: hidden;
  transition: transform .25s, border-color .25s, box-shadow .25s, background .25s;
}
.card::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 0%),
    rgba(74, 222, 128, 0.08), transparent 45%);
  opacity: 0; transition: opacity .3s; pointer-events: none;
}
.card:hover { transform: translateY(-4px); border-color: var(--line-bright);
  box-shadow: 0 18px 50px rgba(0,0,0,.4); }
.card:hover::before { opacity: 1; }
.card .idx {
  font-family: var(--font-mono); color: var(--faint); font-size: .8rem;
  position: absolute; top: 1.2rem; right: 1.4rem;
}
.card h3 { font-size: 1.22rem; margin-bottom: .6rem; }
.card p { color: var(--muted); font-size: .95rem; margin-bottom: 0; }
.card .ico {
  width: 46px; height: 46px; border-radius: var(--radius-sm);
  display: grid; place-items: center; margin-bottom: 1.1rem;
  background: var(--primary-dim); border: 1px solid rgba(74,222,128,.25);
  color: var(--primary); font-size: 1.3rem;
}
.card .ico.cy { background: var(--accent-dim); border-color: rgba(34,211,238,.3); color: var(--accent); }

/* ---------- Work / portfolio ---------- */
.work {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.8rem;
}
.proj {
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; background: var(--bg-2);
  transition: transform .25s, border-color .25s, box-shadow .25s;
  display: flex; flex-direction: column;
}
.proj:hover { transform: translateY(-5px); border-color: var(--primary);
  box-shadow: 0 24px 60px rgba(0,0,0,.5); }
.proj-shot {
  aspect-ratio: 16/10; overflow: hidden; position: relative;
  border-bottom: 1px solid var(--line); background: var(--bg-3);
}
.proj-shot img {
  width: 100%; height: 100%; object-fit: cover; object-position: top;
  transition: transform .5s ease, filter .5s;
  filter: saturate(.9);
}
.proj:hover .proj-shot img { transform: scale(1.04); filter: saturate(1.1); }
.proj-shot .scan {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(4,7,10,.75));
  opacity: .8; pointer-events: none;
}
.proj-body { padding: 1.4rem 1.5rem 1.5rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.proj-tags { display: flex; gap: .5rem; flex-wrap: wrap; }
.proj-body h3 { font-size: 1.25rem; margin: 0; }
.proj-body p { color: var(--muted); font-size: .93rem; margin: 0; flex: 1; }
.proj-link {
  font-family: var(--font-mono); font-size: .85rem; color: var(--primary);
  display: inline-flex; gap: .4rem; align-items: center; margin-top: .4rem;
}
.proj-link:hover { text-decoration: none; gap: .65rem; }
.proj-link::after { content: '→'; transition: inherit; }
.tag {
  font-family: var(--font-mono); font-size: .72rem; color: var(--accent);
  background: var(--accent-dim); border: 1px solid rgba(34,211,238,.22);
  padding: .18rem .6rem; border-radius: 99px; white-space: nowrap;
}
.tag.g { color: var(--primary); background: var(--primary-dim); border-color: rgba(74,222,128,.22); }
.tag.n { color: var(--muted); background: var(--surface-2); border-color: var(--line); }

/* ---------- Marquee ---------- */
.marquee {
  border-block: 1px solid var(--line); padding: 1.4rem 0; overflow: hidden;
  display: flex; gap: 3rem; white-space: nowrap;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track {
  display: flex; gap: 3rem; animation: scroll 30s linear infinite; flex-shrink: 0;
  align-items: center;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes scroll { to { transform: translateX(-100%); } }
.marquee span {
  font-family: var(--font-mono); color: var(--muted); font-size: 1rem;
  display: inline-flex; align-items: center; gap: 3rem;
}
.marquee b { color: var(--primary); font-weight: 500; }

/* ---------- Timeline ---------- */
.timeline { position: relative; padding-left: 2rem; max-width: 760px; }
.timeline::before {
  content: ''; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 1px;
  background: linear-gradient(180deg, var(--primary), var(--accent), transparent);
}
.tl-item { position: relative; padding-bottom: 2.4rem; }
.tl-item::before {
  content: ''; position: absolute; left: calc(-2rem + 1px); top: 8px;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--primary);
  box-shadow: 0 0 10px rgba(74,222,128,.5);
}
.tl-item .when { font-family: var(--font-mono); font-size: .82rem; color: var(--accent); }
.tl-item h3 { font-size: 1.25rem; margin: .3rem 0 .2rem; }
.tl-item .role { color: var(--primary); font-family: var(--font-mono); font-size: .9rem; }
.tl-item p { color: var(--muted); font-size: .95rem; margin-top: .5rem; }

/* ---------- Testimonials ---------- */
.quote-card { display: flex; flex-direction: column; }
.quote-card blockquote {
  margin: 0 0 1.2rem; color: var(--text); font-size: .98rem; flex: 1;
}
.quote-card blockquote::before { content: '"'; color: var(--primary); font-size: 1.6rem; line-height: 0; margin-right: .1em; }
.quote-card .who { display: flex; align-items: center; gap: .9rem; }
.quote-card .ava {
  width: 42px; height: 42px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-dim), var(--accent-dim));
  border: 1px solid var(--line-bright); display: grid; place-items: center;
  font-family: var(--font-mono); color: var(--primary); font-weight: 700;
}
.quote-card .who b { display: block; font-size: .95rem; }
.quote-card .who small { color: var(--faint); font-size: .8rem; font-family: var(--font-mono); }
.stars { color: #fbbf24; letter-spacing: .15em; font-size: .85rem; margin-bottom: .8rem; }

/* ---------- CTA band ---------- */
.cta-band {
  border: 1px solid var(--line-bright); border-radius: calc(var(--radius) * 1.4);
  padding: clamp(2.5rem, 6vw, 4.5rem); text-align: center; position: relative;
  overflow: hidden; background:
    radial-gradient(ellipse 60% 120% at 50% -20%, rgba(74,222,128,.12), transparent 60%),
    var(--bg-2);
}
.cta-band h2 { font-size: clamp(1.9rem, 4.5vw, 3rem); }
.cta-band p { color: var(--muted); max-width: 540px; margin-inline: auto; }

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid var(--line); padding: 4rem 0 2rem;
  background: linear-gradient(180deg, transparent, rgba(4,7,10,.6));
}
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2.5rem; }
.foot-grid h4 { font-family: var(--font-mono); font-size: .85rem; color: var(--faint);
  text-transform: uppercase; letter-spacing: .12em; margin-bottom: 1rem; }
.foot-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.foot-grid ul a { color: var(--muted); font-size: .93rem; }
.foot-grid ul a:hover { color: var(--primary); text-decoration: none; }
.foot-note {
  border-top: 1px solid var(--line); margin-top: 3rem; padding-top: 1.6rem;
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  color: var(--faint); font-size: .85rem; font-family: var(--font-mono);
}
.socials { display: flex; gap: .6rem; margin-top: 1.2rem; }
.socials a {
  width: 40px; height: 40px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  display: grid; place-items: center; color: var(--muted); transition: .2s;
}
.socials a:hover { color: var(--primary); border-color: var(--primary); box-shadow: var(--glow); }
.socials svg { width: 17px; height: 17px; fill: currentColor; }

/* ---------- Forms ---------- */
.field { margin-bottom: 1.2rem; }
.field label {
  display: block; font-family: var(--font-mono); font-size: .8rem;
  color: var(--muted); margin-bottom: .45rem;
}
.field label b { color: var(--primary); }
.field input, .field textarea, .field select {
  width: 100%; background: rgba(4,7,10,.6); border: 1px solid var(--line);
  border-radius: var(--radius-sm); color: var(--text);
  font-family: var(--font-display); font-size: .98rem;
  padding: .85rem 1.05rem; transition: border-color .2s, box-shadow .2s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(74,222,128,.12);
}
.field textarea { min-height: 150px; resize: vertical; }
.form-note { font-family: var(--font-mono); font-size: .82rem; margin-top: 1rem; }
.form-note.ok { color: var(--primary); }
.form-note.err { color: var(--danger); }
.hp { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }

/* ---------- Page hero (inner pages) ---------- */
.page-hero {
  padding: calc(var(--nav-h) + clamp(3rem, 8vw, 6rem)) 0 clamp(2.5rem, 6vw, 4rem);
  position: relative; overflow: hidden;
}
.page-hero h1 { font-size: clamp(2.2rem, 5.5vw, 3.6rem); }
.crumbs { font-family: var(--font-mono); font-size: .82rem; color: var(--faint); margin-bottom: 1.4rem; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--primary); }

/* ---------- Misc ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
.hero-photo { position: relative; }
.hero-photo img {
  border-radius: 18px; border: 1px solid var(--line-bright);
  box-shadow: 0 30px 90px rgba(0,0,0,.55), 0 0 60px rgba(74,222,128,.12);
}
.hero-photo::after {
  content: ''; position: absolute; inset: -1px; border-radius: 19px;
  background: linear-gradient(135deg, rgba(74,222,128,.35), transparent 40%, rgba(34,211,238,.3));
  z-index: -1; filter: blur(18px); opacity: .6;
}
.chip-row { display: flex; flex-wrap: wrap; gap: .6rem; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 3.5rem; align-items: center; }
.list-check { list-style: none; padding: 0; margin: 0 0 1.4rem; display: grid; gap: .7rem; }
.list-check li { color: var(--muted); padding-left: 1.8rem; position: relative; }
.list-check li::before {
  content: '▸'; position: absolute; left: 0; color: var(--primary); font-family: var(--font-mono);
}
.faq details {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); margin-bottom: .8rem; overflow: hidden;
}
.faq summary {
  padding: 1.05rem 1.3rem; cursor: pointer; font-weight: 600; font-size: 1rem;
  list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-family: var(--font-mono); color: var(--primary); font-size: 1.2rem; }
.faq details[open] summary::after { content: '−'; }
.faq details p { padding: 0 1.3rem 1.2rem; color: var(--muted); margin: 0; font-size: .95rem; }
.contact-cards { display: grid; gap: 1rem; }
.contact-card {
  display: flex; gap: 1rem; align-items: center; padding: 1.1rem 1.3rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface);
  transition: border-color .2s;
}
.contact-card:hover { border-color: var(--primary); }
.contact-card .ico { width: 42px; height: 42px; border-radius: var(--radius-sm); background: var(--primary-dim);
  display: grid; place-items: center; color: var(--primary); flex-shrink: 0; font-size: 1.1rem; }
.contact-card b { display: block; font-size: .8rem; font-family: var(--font-mono); color: var(--faint);
  text-transform: uppercase; letter-spacing: .1em; }
.contact-card a, .contact-card span.v { color: var(--text); font-size: .98rem; }
.float-wa {
  position: fixed; right: 22px; bottom: 22px; z-index: 90;
  width: 54px; height: 54px; border-radius: 50%;
  background: linear-gradient(135deg, #25d366, #128c7e);
  display: grid; place-items: center; box-shadow: 0 10px 30px rgba(37,211,102,.35);
  transition: transform .2s;
}
.float-wa:hover { transform: scale(1.08); }
.float-wa svg { width: 26px; height: 26px; fill: #fff; }
.to-top {
  position: fixed; right: 27px; bottom: 88px; z-index: 89;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line-bright); background: rgba(7,13,17,.92);
  color: var(--primary); display: grid; place-items: center; cursor: pointer;
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity .25s, transform .25s, border-color .2s, box-shadow .2s;
  backdrop-filter: blur(8px);
}
.to-top.show { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { border-color: var(--primary); box-shadow: var(--glow); }
.to-top svg { width: 18px; height: 18px; }
.err-page { min-height: 70vh; display: grid; place-items: center; text-align: center;
  padding-top: var(--nav-h); }
.err-page .code { font-family: var(--font-mono); font-size: clamp(5rem, 16vw, 10rem);
  font-weight: 700; line-height: 1; }
.pricing-note { color: var(--faint); font-family: var(--font-mono); font-size: .8rem; margin-top: .5rem; }

/* ---------- Blog ---------- */
.post-list { display: grid; gap: 1.4rem; max-width: 860px; }
.post-card {
  display: flex; gap: 1.6rem; align-items: center;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); padding: 1.4rem 1.6rem;
  transition: transform .25s, border-color .25s, box-shadow .25s;
}
.post-card .pc-thumb {
  width: 180px; aspect-ratio: 16/9; object-fit: cover; flex-shrink: 0;
  border-radius: var(--radius-sm); border: 1px solid var(--line); display: block;
}
.post-card .pc-txt { min-width: 0; }
@media (max-width: 640px) {
  .post-card { flex-direction: column; align-items: stretch; }
  .post-card .pc-thumb { width: 100%; }
}
.post-card:hover { text-decoration: none; transform: translateY(-3px);
  border-color: var(--line-bright); box-shadow: 0 18px 50px rgba(0,0,0,.4); }
.post-card .meta {
  font-family: var(--font-mono); font-size: .78rem; color: var(--faint);
  display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: .7rem;
}
.post-card .meta b { color: var(--primary); font-weight: 500; }
.post-card h2 { font-size: 1.45rem; margin-bottom: .5rem; color: var(--text); }
.post-card p { color: var(--muted); font-size: .95rem; margin: 0; }
.post-card .more { font-family: var(--font-mono); font-size: .82rem; color: var(--primary); margin-top: .9rem; display: inline-block; }
.post-meta { font-family: var(--font-mono); font-size: .82rem; color: var(--faint);
  display: flex; gap: 1.2rem; flex-wrap: wrap; margin-top: 1.2rem; }
.post-cover {
  display: block; width: 100%; max-width: 860px; margin-top: 2rem;
  border-radius: var(--radius); border: 1px solid var(--line);
  box-shadow: 0 24px 60px rgba(0,0,0,.4);
}

.prose { max-width: 760px; }
.prose h2 { font-size: 1.55rem; margin: 2.4rem 0 .8rem; }
.prose h3 { font-size: 1.2rem; margin: 1.8rem 0 .6rem; color: var(--text); }
.prose p { color: #b9c9bf; margin-bottom: 1.2rem; }
.prose ul, .prose ol { color: #b9c9bf; margin: 0 0 1.2rem 1.2rem; display: grid; gap: .45rem; }
.prose li::marker { color: var(--primary); }
.prose strong, .prose b { color: var(--text); font-weight: 600; }
.prose a { color: var(--primary); }
.prose code {
  font-family: var(--font-mono); font-size: .85em; color: var(--accent);
  background: rgba(34,211,238,.08); padding: .12em .45em; border-radius: 5px;
}
.prose pre {
  background: rgba(6,12,10,.9); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 1.2rem 1.3rem; overflow-x: auto; margin: 0 0 1.4rem;
}
.prose pre code { background: none; padding: 0; color: var(--text); font-size: .85rem; line-height: 1.6; }
.prose blockquote {
  border-left: 3px solid var(--primary); margin: 1.6rem 0; padding: .2rem 0 .2rem 1.2rem;
  color: var(--muted); font-style: italic;
}
.prose .callout {
  border: 1px solid rgba(74,222,128,.3); background: var(--primary-dim);
  border-radius: var(--radius-sm); padding: 1.1rem 1.3rem; margin: 1.6rem 0;
}
.prose .callout p:last-child { margin: 0; }

/* Post layout: article + related sidebar */
.post-layout { display: grid; grid-template-columns: 1fr 300px; gap: 3rem; align-items: start; }
.post-side {
  position: sticky; top: calc(var(--nav-h) + 24px);
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); padding: 1.4rem 1.5rem;
}
.post-side h4 {
  font-family: var(--font-mono); font-size: .78rem; color: var(--faint);
  text-transform: uppercase; letter-spacing: .12em; margin-bottom: .4rem;
}
.side-link {
  display: flex; gap: .85rem; align-items: center;
  padding: .95rem 0; border-top: 1px solid var(--line);
}
.side-link:first-of-type { border-top: 0; padding-top: .5rem; }
.side-link img {
  width: 84px; aspect-ratio: 16/9; object-fit: cover; flex-shrink: 0;
  border-radius: 7px; border: 1px solid var(--line); display: block;
  transition: border-color .2s, transform .25s;
}
.side-link .sl-txt { min-width: 0; }
.side-link b {
  display: block; color: var(--text); font-size: .9rem; font-weight: 600;
  line-height: 1.35; transition: color .2s;
}
.side-link:hover { text-decoration: none; }
.side-link:hover img { border-color: var(--primary); transform: scale(1.04); }
.side-link:hover b { color: var(--primary); }
.side-link .sl-txt > span { display: block; margin-top: .3rem;
  font-family: var(--font-mono); font-size: .72rem; color: var(--faint); }
.side-cta { margin-top: 1rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }
.side-cta p { font-size: .85rem; color: var(--muted); margin-bottom: .8rem; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 2.5rem; }
  .hero { min-height: auto; padding-block: calc(var(--nav-h) + 3rem) 4rem; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .split { grid-template-columns: 1fr; gap: 2rem; }
  .post-layout { grid-template-columns: 1fr; }
  .post-side { position: static; }
}
@media (max-width: 720px) {
  .nav-links { display: none; }
  .burger { display: block; }
  .nav.open .nav-links {
    display: flex; flex-direction: row; flex-wrap: wrap; gap: .6rem;
    position: absolute; top: var(--nav-h); left: 0; right: 0;
    background: rgba(4,7,10,.97); border-bottom: 1px solid var(--line);
    padding: 1rem 4vw 1.5rem; backdrop-filter: blur(14px);
  }
  .nav.open .nav-links li { margin: 0; }
  .nav.open .nav-links a {
    display: inline-block; padding: .55rem 1.15rem; font-size: .85rem;
    border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  }
  .nav.open .nav-links a:hover { border-color: var(--primary); }
  .nav.open .nav-links a.active { border-color: rgba(74,222,128,.45); background: var(--primary-dim); }
  .nav.open .nav-links li:last-child { margin-left: auto; }
  .nav-cta { margin: 0; text-align: center; border-radius: 999px; }
  .grid-2, .grid-3, .work { grid-template-columns: 1fr; }
  .stats .wrap { grid-template-columns: repeat(2, 1fr); }
  footer { padding: 2.8rem 0 1.4rem; }
  .foot-grid { grid-template-columns: 1fr 1fr; gap: 1.8rem 1.2rem; }
  .foot-grid > div:first-child { grid-column: 1 / -1; }
  .foot-grid h4 { margin-bottom: .7rem; }
  .foot-grid ul { gap: .45rem; }
  .foot-note { margin-top: 2.2rem; padding-top: 1.2rem; flex-direction: column; gap: .5rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
