/* =========================================================
   CODE RESEARCH LAB
   Core stylesheet
   ========================================================= */

/* ---------- Tokens ---------- */
:root {
  --void: #04060d;
  --panel: rgba(255, 255, 255, 0.028);
  --panel-2: rgba(255, 255, 255, 0.055);
  --line: rgba(255, 255, 255, 0.10);
  --line-hot: rgba(0, 229, 255, 0.40);

  --ink: #eaf2ff;
  --ink-dim: #9aa8c2;
  --ink-faint: #64708a;

  --cyan: #00e5ff;
  --violet: #a855f7;
  --lime: #c8ff2e;
  --aztec: #d92142;        /* crimson, brightened for screen */

  --grad-hot: linear-gradient(120deg, var(--cyan), var(--violet) 55%, var(--aztec));
  --grad-cool: linear-gradient(120deg, var(--cyan), #6ee7ff 40%, var(--violet));

  --glow-cyan: 0 0 0 1px rgba(0, 229, 255, .25), 0 0 34px -6px rgba(0, 229, 255, .55);

  --font-display: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --nav-h: 74px;
  --radius: 16px;
  --shell: min(1240px, 92vw);
  --ease: cubic-bezier(.22, 1, .36, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--void);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.65;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
h1, h2, h3, h4 { margin: 0; line-height: 1.06; letter-spacing: -0.02em; font-weight: 700; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
::selection { background: var(--aztec); color: #fff; }

/* ---------- Ambient background ---------- */
.bg-layer { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.bg-grid {
  background-image:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 120% 80% at 50% 0%, #000 20%, transparent 78%);
  opacity: .5;
}
.bg-orb {
  position: absolute; border-radius: 50%; filter: blur(90px); opacity: .5;
  animation: drift 26s var(--ease) infinite alternate;
}
.orb-a { width: 46vw; height: 46vw; left: -12vw; top: -12vw; background: rgba(0, 229, 255, .17); }
.orb-b { width: 40vw; height: 40vw; right: -10vw; top: 18vh; background: rgba(168, 85, 247, .17); animation-delay: -8s; }
.orb-c { width: 36vw; height: 36vw; left: 30vw; top: 120vh; background: rgba(217, 33, 66, .15); animation-delay: -14s; }
@keyframes drift { to { transform: translate3d(6vw, 7vh, 0) scale(1.15); } }

.bg-noise {
  opacity: .35; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
}

.scan-lines {
  background: repeating-linear-gradient(to bottom, rgba(255,255,255,.028) 0 1px, transparent 1px 4px);
  opacity: .5;
}

/* Cursor-follow glow (desktop only) */
.cursor-glow {
  position: fixed; z-index: 1; width: 420px; height: 420px; border-radius: 50%;
  translate: -50% -50%; pointer-events: none; opacity: 0;
  background: radial-gradient(circle, rgba(0,229,255,.10), transparent 62%);
  transition: opacity .5s ease;
}

/* ---------- Layout ---------- */
.shell { width: var(--shell); margin-inline: auto; position: relative; z-index: 2; }
section { position: relative; z-index: 2; }
section[id], header[id] { scroll-margin-top: calc(var(--nav-h) + 8px); }
.section { padding: clamp(72px, 11vw, 140px) 0; }
.section--tight { padding-block: clamp(56px, 7vw, 90px); }

/* ---------- Scroll progress ---------- */
.progress-bar {
  position: fixed; inset: 0 auto auto 0; height: 2px; width: 100%; z-index: 90;
  transform-origin: 0 50%; transform: scaleX(0);
  background: var(--grad-hot); box-shadow: 0 0 14px rgba(0,229,255,.7);
}

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 80; height: var(--nav-h);
  display: flex; align-items: center;
  border-bottom: 1px solid transparent;
  transition: background .35s ease, border-color .35s ease, backdrop-filter .35s ease;
}
.nav.is-stuck {
  background: rgba(4, 6, 13, .82);
  backdrop-filter: blur(16px) saturate(1.4);
  border-bottom-color: var(--line);
}
.nav__inner { display: flex; align-items: center; gap: 24px; width: var(--shell); margin-inline: auto; }

.brand { display: flex; align-items: center; gap: 12px; margin-right: auto; }
.brand__mark { width: 38px; height: 38px; flex: none; filter: drop-shadow(0 0 10px rgba(0,229,255,.5)); }
.brand__text { display: flex; flex-direction: column; line-height: 1.05; }
.brand__name { font-weight: 700; font-size: 15px; letter-spacing: .16em; }
.brand__sub { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .22em; color: var(--ink-faint); text-transform: uppercase; }

.nav__links { display: flex; align-items: center; gap: 4px; }
.nav__links a {
  position: relative; padding: 9px 14px; border-radius: 9px;
  font-size: 13.5px; font-weight: 500; color: var(--ink-dim);
  transition: color .22s ease, background .22s ease;
}
.nav__links a::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 5px; height: 1px;
  background: var(--cyan); transform: scaleX(0); transform-origin: 0 50%;
  transition: transform .3s var(--ease);
}
.nav__links a:hover { color: var(--ink); background: var(--panel); }
.nav__links a:hover::after, .nav__links a.is-active::after { transform: scaleX(1); }
.nav__links a.is-active { color: var(--ink); }

.nav__toggle { display: none; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 11px; }
.nav__toggle span { display: block; width: 17px; height: 1.5px; background: var(--ink); margin: 4px auto; transition: .3s var(--ease); }
.nav.is-open .nav__toggle span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.nav.is-open .nav__toggle span:nth-child(2) { opacity: 0; }
.nav.is-open .nav__toggle span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

/* ---------- Buttons ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; gap: 9px;
  padding: 13px 24px; border-radius: 11px; font-size: 14px; font-weight: 600;
  letter-spacing: .01em; white-space: nowrap; overflow: hidden;
  transition: transform .2s var(--ease), box-shadow .3s ease, border-color .3s ease, color .3s ease;
}
.btn svg { width: 15px; height: 15px; }
.btn--primary { color: #04060d; background: var(--grad-cool); box-shadow: 0 8px 30px -10px rgba(0,229,255,.75); }
.btn--primary::before {
  content: ""; position: absolute; inset: 0; background: var(--grad-hot);
  opacity: 0; transition: opacity .35s ease;
}
.btn--primary:hover::before { opacity: 1; }
.btn--primary > * { position: relative; z-index: 1; }
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 14px 40px -12px rgba(217,33,66,.85); color: #fff; }

.btn--ghost { border: 1px solid var(--line); color: var(--ink); background: var(--panel); }
.btn--ghost:hover { border-color: var(--line-hot); color: var(--cyan); transform: translateY(-2px); box-shadow: var(--glow-cyan); }

.btn--sm { padding: 10px 17px; font-size: 13px; border-radius: 9px; }

/* ---------- Eyebrow / headings ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 9px; align-self: flex-start;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .26em; text-transform: uppercase;
  color: var(--cyan); padding: 7px 14px; border: 1px solid rgba(0,229,255,.24);
  border-radius: 100px; background: rgba(0,229,255,.05);
}
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .3; transform: scale(.7); } }

.h-sec { font-size: clamp(34px, 5.4vw, 62px); }
.h-sec em { font-style: normal; background: var(--grad-cool); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lede { color: var(--ink-dim); font-size: clamp(15px, 1.35vw, 17.5px); max-width: 62ch; }

.sec-head { display: flex; flex-direction: column; gap: 20px; margin-bottom: clamp(38px, 5vw, 64px); }
.sec-head--split { flex-direction: row; align-items: flex-end; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.sec-head--split > div { display: flex; flex-direction: column; gap: 18px; }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 100svh; display: flex; align-items: center; padding: calc(var(--nav-h) + 40px) 0 76px; overflow: hidden; }
/* canvas is a replaced element — left/right alone will not stretch it */
#constellation { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; opacity: .85; }
.hero__inner { display: grid; gap: clamp(18px, 2.2vh, 28px); justify-items: start; }

.hero__title {
  font-size: clamp(44px, 8.6vw, 116px);
  line-height: .86; letter-spacing: -0.045em; font-weight: 700; text-transform: uppercase;
}
.hero__title .line { display: block; overflow: hidden; }
.hero__title .line > span { display: block; }
.hero__title .accent { background: var(--grad-hot); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* glitch */
.glitch { position: relative; display: inline-block; }
.glitch::before, .glitch::after {
  content: attr(data-text); position: absolute; inset: 0; pointer-events: none;
  clip-path: inset(0 0 100% 0);
}
.glitch::before { color: var(--cyan); transform: translate(-2px, 0); mix-blend-mode: screen; animation: glitch-a 5.5s infinite steps(1); }
.glitch::after  { color: var(--aztec); transform: translate(2px, 0);  mix-blend-mode: screen; animation: glitch-b 5.5s infinite steps(1); }
@keyframes glitch-a {
  0%, 92%, 100% { clip-path: inset(0 0 100% 0); }
  93% { clip-path: inset(12% 0 62% 0); } 95% { clip-path: inset(58% 0 24% 0); } 97% { clip-path: inset(32% 0 51% 0); }
}
@keyframes glitch-b {
  0%, 92%, 100% { clip-path: inset(0 0 100% 0); }
  94% { clip-path: inset(70% 0 12% 0); } 96% { clip-path: inset(24% 0 63% 0); } 98% { clip-path: inset(46% 0 38% 0); }
}

.hero__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; font-family: var(--font-mono); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-faint); }
.hero__meta .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--aztec); }
.hero__lede { max-width: 60ch; font-size: clamp(15.5px, 1.5vw, 19px); color: var(--ink-dim); }
.hero__lede strong { color: var(--ink); font-weight: 600; }

.term-line {
  font-family: var(--font-mono); font-size: clamp(12px, 1.3vw, 14px); color: var(--lime);
  display: inline-flex; align-items: center; gap: 10px; padding: 11px 16px;
  border: 1px solid rgba(200,255,46,.22); border-radius: 10px; background: rgba(200,255,46,.045);
  max-width: 100%;
}
.term-line .prompt { color: var(--ink-faint); }
.caret { display: inline-block; width: 8px; height: 1.05em; background: var(--lime); animation: blink 1.05s steps(2) infinite; translate: 0 2px; }
@keyframes blink { 50% { opacity: 0; } }

.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; }

.hero__stats { display: flex; flex-wrap: wrap; gap: 14px 40px; padding-top: 8px; }
.hero__stats .stat { display: flex; flex-direction: column; gap: 2px; }
.hero__stats .stat b { font-size: clamp(22px, 2.6vw, 32px); letter-spacing: -.03em; }
.hero__stats .stat span { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-faint); }

.scroll-cue {
  position: absolute; left: 50%; bottom: 26px; translate: -50% 0; z-index: 3;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .28em; color: var(--ink-faint); text-transform: uppercase;
}
.scroll-cue i { width: 1px; height: 44px; background: linear-gradient(var(--cyan), transparent); animation: cue 2.2s var(--ease) infinite; }
@keyframes cue { 0% { transform: scaleY(0); transform-origin: 0 0; } 50% { transform: scaleY(1); transform-origin: 0 0; } 51% { transform-origin: 0 100%; } 100% { transform: scaleY(0); transform-origin: 0 100%; } }

/* ---------- Marquee ---------- */
.marquee {
  border-block: 1px solid var(--line); background: rgba(255,255,255,.016);
  overflow: hidden; padding: 15px 0; position: relative; z-index: 2;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee__track { display: flex; width: max-content; animation: slide 42s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__track > span {
  display: inline-flex; align-items: center; gap: 22px; padding-right: 22px;
  font-family: var(--font-mono); font-size: 12.5px; letter-spacing: .22em; text-transform: uppercase; color: var(--ink-faint);
  white-space: nowrap;
}
.marquee__track b { color: var(--ink); font-weight: 500; }
.marquee__track i { color: var(--aztec); font-style: normal; }
@keyframes slide { to { transform: translateX(-50%); } }

/* ---------- Cards ---------- */
.card {
  position: relative; border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(255,255,255,.045), rgba(255,255,255,.012));
  overflow: hidden; transition: transform .4s var(--ease), border-color .4s ease, box-shadow .4s ease;
}
.card::before {
  content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity .45s ease; pointer-events: none;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(0,229,255,.13), transparent 62%);
}
.card:hover { transform: translateY(-5px); border-color: var(--line-hot); box-shadow: 0 24px 60px -30px rgba(0,229,255,.6); }
.card:hover::before { opacity: 1; }

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(34px, 5vw, 70px); align-items: center; }
.about__body { display: flex; flex-direction: column; gap: 22px; }
.pillars { display: grid; gap: 14px; margin-top: 6px; }
.pillar { display: flex; gap: 15px; padding: 17px 19px; border-radius: 13px; border: 1px solid var(--line); background: var(--panel); transition: .35s var(--ease); }
.pillar:hover { border-color: var(--line-hot); background: var(--panel-2); transform: translateX(5px); }
.pillar__ico { flex: none; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: rgba(0,229,255,.1); color: var(--cyan); }
.pillar__ico svg { width: 19px; height: 19px; }
.pillar h4 { font-size: 15.5px; margin-bottom: 4px; }
.pillar p { font-size: 13.8px; color: var(--ink-dim); line-height: 1.55; }

/* terminal window */
.term {
  border-radius: 14px; border: 1px solid var(--line); overflow: hidden;
  background: linear-gradient(180deg, #080d1a, #05070f);
  box-shadow: 0 40px 90px -40px rgba(0,229,255,.35), 0 0 0 1px rgba(255,255,255,.02);
}
.term__bar { display: flex; align-items: center; gap: 8px; padding: 11px 15px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.03); }
.term__bar i { width: 10px; height: 10px; border-radius: 50%; }
.term__bar i:nth-child(1) { background: #ff5f57; } .term__bar i:nth-child(2) { background: #febc2e; } .term__bar i:nth-child(3) { background: #28c840; }
.term__bar span { margin-left: 8px; font-family: var(--font-mono); font-size: 11px; color: var(--ink-faint); }
.term__body { padding: 20px 22px; font-family: var(--font-mono); font-size: clamp(11px, 1.05vw, 13px); line-height: 1.85; overflow-x: auto; }
.term__body pre { margin: 0; }
.c-key { color: var(--violet); } .c-fn { color: var(--cyan); } .c-str { color: var(--lime); }
.c-com { color: var(--ink-faint); } .c-num { color: #ff8fa3; } .c-var { color: var(--ink); }

/* ---------- Specialties ---------- */
.spec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 18px; }
.spec { padding: 26px 24px 24px; display: flex; flex-direction: column; gap: 13px; min-height: 100%; }
.spec__top { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.spec__ico { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.04); color: var(--cyan); transition: .4s var(--ease); }
.spec__ico svg { width: 22px; height: 22px; }
.spec:hover .spec__ico { color: #04060d; background: var(--grad-cool); border-color: transparent; transform: rotate(-6deg) scale(1.06); }
.spec__idx { font-family: var(--font-mono); font-size: 11px; letter-spacing: .16em; color: var(--ink-faint); }
.spec h3 { font-size: 18px; letter-spacing: -.015em; }
.spec p { font-size: 13.8px; color: var(--ink-dim); line-height: 1.6; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 6px; }
.tag {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  padding: 4.5px 9px; border-radius: 6px; border: 1px solid var(--line); color: var(--ink-faint); background: rgba(255,255,255,.02);
  transition: .3s ease;
}
.spec:hover .tag { border-color: rgba(0,229,255,.3); color: var(--cyan); }

/* ---------- Team ---------- */
/* 300px min lands three per row at full width, so nine members grid evenly */
.team-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 22px; }
.member { display: flex; flex-direction: column; }
.member__photo { position: relative; aspect-ratio: 4 / 3.5; overflow: hidden; background: #070c18; }
.member__photo img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.06); transition: filter .55s ease, transform .8s var(--ease); }
.member:hover .member__photo img { filter: grayscale(0) contrast(1); transform: scale(1.05); }
/* generated monogram placeholders are already themed — don't desaturate them */
.member__photo--mono img { filter: none; }
.member:hover .member__photo--mono img { filter: none; transform: scale(1.04); }
.member__photo::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(4,6,13,.28) 82%, rgba(4,6,13,.72));
}
.member__scan {
  position: absolute; inset: 0; z-index: 1; opacity: 0; transition: opacity .4s ease;
  background: repeating-linear-gradient(to bottom, rgba(0,229,255,.14) 0 1px, transparent 1px 5px);
}
.member:hover .member__scan { opacity: 1; }
.member__badge {
  position: absolute; z-index: 2; top: 13px; left: 13px;
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .18em; text-transform: uppercase;
  padding: 5px 10px; border-radius: 100px; color: var(--ink);
  background: rgba(4,6,13,.7); border: 1px solid var(--line); backdrop-filter: blur(8px);
}
.member__body { padding: 20px 22px 24px; display: flex; flex-direction: column; gap: 11px; flex: 1; }
.member__name { font-size: 20px; }
.member__role { font-family: var(--font-mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--cyan); }
.member__bio { font-size: 13.6px; color: var(--ink-dim); line-height: 1.6; }

/* ---------- Projects ---------- */
.proj-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 20px; }
.proj { padding: 26px 25px; display: flex; flex-direction: column; gap: 14px; }
.proj__head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.status {
  display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-mono);
  font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-faint);
}
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ink-faint); }
.status--live { color: var(--lime); } .status--live::before { background: var(--lime); box-shadow: 0 0 9px var(--lime); animation: pulse 1.8s infinite; }
.status--build { color: var(--cyan); } .status--build::before { background: var(--cyan); box-shadow: 0 0 9px var(--cyan); }
.status--rnd { color: var(--violet); } .status--rnd::before { background: var(--violet); box-shadow: 0 0 9px var(--violet); }
.proj h3 { font-size: 20px; }
.proj p { font-size: 13.8px; color: var(--ink-dim); line-height: 1.62; }
.proj__meta { font-family: var(--font-mono); font-size: 11px; color: var(--ink-faint); letter-spacing: .06em; }

/* ---------- Join / CTA ---------- */
.join { position: relative; overflow: hidden; border-radius: 22px; border: 1px solid var(--line); padding: clamp(36px, 6vw, 76px); background: linear-gradient(155deg, rgba(0,229,255,.09), rgba(168,85,247,.07) 48%, rgba(217,33,66,.09)); }
.join::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 44px 44px; mask-image: radial-gradient(ellipse at 80% 20%, #000, transparent 70%);
}
.join__inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; }
.join h2 { font-size: clamp(30px, 4.4vw, 50px); margin-bottom: 16px; }
.join h2 em { font-style: normal; background: var(--grad-cool); -webkit-background-clip: text; background-clip: text; color: transparent; }
.join p { color: var(--ink-dim); max-width: 52ch; }
.join__actions { display: flex; flex-wrap: wrap; gap: 13px; margin-top: 26px; }
.join__list { display: grid; gap: 11px; }
.join__list li { display: flex; gap: 11px; align-items: flex-start; font-size: 14px; color: var(--ink-dim); }
.join__list svg { flex: none; width: 17px; height: 17px; color: var(--lime); margin-top: 2px; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 54px 0 34px; position: relative; z-index: 2; background: rgba(3, 5, 11, .6); }
.footer__grid { display: grid; grid-template-columns: 1.4fr repeat(2, .8fr); gap: 40px; margin-bottom: 40px; }
.footer__about p { font-size: 13.8px; color: var(--ink-dim); margin-top: 16px; max-width: 42ch; }
.footer h5 { font-family: var(--font-mono); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink); margin: 0 0 16px; font-weight: 500; }
.footer__links { display: grid; gap: 10px; }
.footer__links a { font-size: 13.8px; color: var(--ink-dim); transition: .25s ease; }
.footer__links a:hover { color: var(--cyan); padding-left: 5px; }
.footer__bottom { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; align-items: center; padding-top: 24px; border-top: 1px solid var(--line); font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; color: var(--ink-faint); }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .about, .join__inner { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .footer__about { grid-column: 1 / -1; }
}
@media (max-width: 820px) {
  .nav__toggle { display: block; }
  .nav__cta { display: none; }
  .nav__links {
    position: fixed; inset: var(--nav-h) 0 auto 0; flex-direction: column; align-items: stretch; gap: 2px;
    padding: 16px; background: rgba(4,6,13,.97); backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--line);
    transform: translateY(-8px); opacity: 0; pointer-events: none; transition: .3s var(--ease);
  }
  .nav.is-open .nav__links { transform: none; opacity: 1; pointer-events: auto; }
  .nav__links a { padding: 13px 12px; font-size: 15px; }
  .nav__links a::after { display: none; }
  .cursor-glow { display: none; }
  .hero { min-height: auto; padding-top: calc(var(--nav-h) + 40px); }
  .scroll-cue { display: none; }
}
@media (max-width: 560px) {
  .footer__grid { grid-template-columns: 1fr; }
  .hero__stats { gap: 14px 26px; }
}

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

/* =========================================================
   BLOG
   ========================================================= */

/* ---------- Index ---------- */
.blog-hero { padding: calc(var(--nav-h) + clamp(56px, 8vw, 104px)) 0 clamp(34px, 5vw, 56px); }
.blog-hero__inner { display: flex; flex-direction: column; gap: 20px; }

.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 20px; }

.post-card { display: flex; flex-direction: column; padding: 26px 25px 24px; gap: 13px; }
.post-card__top { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.post-card h3 { font-size: 20px; line-height: 1.22; letter-spacing: -.018em; }
.post-card h3 a::after { content: ""; position: absolute; inset: 0; }
.post-card p { font-size: 13.8px; color: var(--ink-dim); line-height: 1.62; }
.post-card__foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-faint);
}
.post-card .arrow { color: var(--cyan); transition: transform .3s var(--ease); }
.post-card:hover .arrow { transform: translateX(4px); }

.topic {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase;
  padding: 5px 10px; border-radius: 6px; color: var(--cyan);
  border: 1px solid rgba(0,229,255,.24); background: rgba(0,229,255,.05);
}

/* featured post */
.post-feature { padding: clamp(28px, 4vw, 44px); display: grid; gap: 20px; margin-bottom: 20px; }
.post-feature h2 { font-size: clamp(26px, 3.6vw, 42px); line-height: 1.08; max-width: 20ch; }
.post-feature h2 a::after { content: ""; position: absolute; inset: 0; }
.post-feature p { color: var(--ink-dim); max-width: 66ch; font-size: clamp(14.5px, 1.25vw, 16.5px); }
.post-feature__top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

/* ---------- Article ---------- */
.post-head { padding: calc(var(--nav-h) + clamp(48px, 7vw, 88px)) 0 clamp(28px, 4vw, 44px); }
.post-head__inner { display: flex; flex-direction: column; gap: 20px; max-width: 74ch; }
.post-head h1 { font-size: clamp(30px, 4.6vw, 54px); line-height: 1.05; letter-spacing: -.032em; }
.post-head .lede { font-size: clamp(15.5px, 1.5vw, 19px); }
.post-head__meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
  padding-top: 6px; font-family: var(--font-mono); font-size: 11.5px;
  letter-spacing: .13em; text-transform: uppercase; color: var(--ink-faint);
}
.post-head__meta .sep { width: 4px; height: 4px; border-radius: 50%; background: var(--aztec); }
.post-head__meta b { color: var(--ink-dim); font-weight: 400; }

.post-body { padding-bottom: clamp(56px, 8vw, 104px); }

.prose { max-width: 74ch; font-size: 16.5px; line-height: 1.78; color: var(--ink-dim); }
.prose > * + * { margin-top: 1.15em; }
.prose h2 {
  font-size: clamp(21px, 2.3vw, 27px); color: var(--ink); letter-spacing: -.02em;
  margin-top: 2.1em; padding-top: .5em;
}
.prose h3 { font-size: 17.5px; color: var(--ink); margin-top: 1.8em; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose a { color: var(--cyan); border-bottom: 1px solid rgba(0,229,255,.32); }
.prose a:hover { border-bottom-color: var(--cyan); }
.prose ul, .prose ol { display: grid; gap: .55em; padding-left: 1.1em; }
.prose ul li { list-style: none; position: relative; padding-left: 1.1em; }
.prose ul li::before {
  content: ""; position: absolute; left: 0; top: .72em;
  width: 5px; height: 5px; border-radius: 50%; background: var(--cyan);
}
.prose ol { list-style: decimal; }
.prose ol li::marker { color: var(--cyan); font-family: var(--font-mono); font-size: .85em; }
.prose code {
  font-family: var(--font-mono); font-size: .85em; color: var(--lime);
  padding: 2px 6px; border-radius: 5px; background: rgba(200,255,46,.07);
  border: 1px solid rgba(200,255,46,.16);
}
.prose pre {
  margin: 1.6em 0; padding: 20px 22px; overflow-x: auto;
  border-radius: 13px; border: 1px solid var(--line);
  background: linear-gradient(180deg, #080d1a, #05070f);
  font-family: var(--font-mono); font-size: 13px; line-height: 1.75; color: var(--ink);
}
.prose pre code { padding: 0; border: 0; background: none; color: inherit; font-size: inherit; }

.prose blockquote {
  margin: 1.9em 0; padding: 4px 0 4px 24px; border-left: 2px solid var(--cyan);
  font-size: clamp(17px, 1.7vw, 21px); line-height: 1.5; color: var(--ink);
  letter-spacing: -.012em;
}

.prose figure { margin: 1.9em 0; }
.prose figcaption {
  margin-top: 10px; font-family: var(--font-mono); font-size: 11.5px;
  letter-spacing: .06em; color: var(--ink-faint);
}
.prose hr { margin: 2.4em 0; border: 0; border-top: 1px solid var(--line); }

/* callout */
.note {
  margin: 1.9em 0; padding: 18px 20px; border-radius: 13px;
  border: 1px solid var(--line); background: var(--panel);
  font-size: 14.6px; line-height: 1.66;
}
.note b {
  display: block; margin-bottom: 5px; color: var(--ink);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
}

/* footer of an article */
.post-foot {
  max-width: 74ch; margin-top: clamp(40px, 6vw, 64px); padding-top: 26px;
  border-top: 1px solid var(--line); display: flex; flex-wrap: wrap;
  align-items: center; justify-content: space-between; gap: 18px;
}
.post-foot__by { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .13em; text-transform: uppercase; color: var(--ink-faint); }

.post-more { border-top: 1px solid var(--line); padding: clamp(48px, 7vw, 84px) 0; }

/* An article is a reading column, not a full-width layout — centre it.
   "Keep reading" keeps the wide shell so its cards still grid three across. */
.post-head .shell, .post-body .shell { width: min(820px, 92vw); }
