/* ==========================================================
   ChatGPeTe — site styles
   ========================================================== */
:root {
  --bg: #050b18;
  --bg-2: #0a1530;
  --navy: #1e3a6e;
  --cyan: #4fd1ff;
  --cyan-soft: #7fdcff;
  --blue: #3b82f6;
  --violet: #8b7bff;
  --text: #dbe6ff;
  --muted: #8a9bc0;
  --dim: #56668a;
  --line: rgba(120, 170, 255, .14);
  --card: rgba(14, 26, 54, .55);
  --radius: 18px;
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0;
  background: radial-gradient(1200px 700px at 50% -10%, #0d2152 0%, transparent 60%), var(--bg);
  color: var(--text);
  font: 400 17px/1.65 var(--font-body);
  overflow-x: hidden;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img, svg { display: block; }
.mono { font-family: var(--font-mono); }
::selection { background: rgba(79, 209, 255, .35); color: #fff; }

/* ---------- Background layers ---------- */
#circuit {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: -2; pointer-events: none;
}
.noise {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain {
  0% { background-position: 0 0; } 20% { background-position: -37px 21px; } 40% { background-position: 23px -41px; }
  60% { background-position: -19px -13px; } 80% { background-position: 44px 31px; } 100% { background-position: 0 0; }
}
.cursor-glow {
  position: fixed; left: 0; top: 0; width: 520px; height: 520px; margin: -260px 0 0 -260px;
  border-radius: 50%; pointer-events: none; z-index: -1;
  background: radial-gradient(circle, rgba(79, 209, 255, .10), transparent 65%);
  transform: translate3d(var(--x, -999px), var(--y, -999px), 0);
  transition: opacity .4s;
}

/* ---------- Top bar ---------- */
.topbar {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%);
  width: min(1120px, calc(100% - 32px)); z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px 10px 12px; border-radius: 14px;
  background: rgba(7, 15, 34, .6); border: 1px solid var(--line);
  backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%);
  transition: transform .5s var(--ease-out), opacity .5s;
}
.topbar.is-hidden { transform: translate(-50%, -140%); opacity: 0; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 600 17px var(--font-display); letter-spacing: .01em; }
.brand b { color: var(--cyan); font-weight: 700; }
.topbar-links { display: flex; align-items: center; gap: 22px; font-size: 14px; }
.topbar-links a { text-decoration: none; color: var(--muted); transition: color .2s; }
.topbar-links a:hover { color: #fff; }
.status-dot { display: inline-flex; align-items: center; gap: 7px; font: 500 12px var(--font-mono); color: #5ee6a8; }
.status-dot i { width: 7px; height: 7px; border-radius: 50%; background: #5ee6a8; box-shadow: 0 0 0 0 rgba(94, 230, 168, .7); animation: ping 2s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 8px rgba(94, 230, 168, 0); } 100% { box-shadow: 0 0 0 0 rgba(94, 230, 168, 0); } }

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh; min-height: 100svh;
  width: min(1120px, calc(100% - 32px)); margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); align-items: center; gap: 56px;
  padding: 110px 0 80px; position: relative; overflow-x: clip;
}
.hero-logo-wrap { position: relative; aspect-ratio: 1; max-width: 460px; width: 100%; justify-self: center; }
.hero-halo {
  position: absolute; inset: -12%; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 20%, rgba(79, 209, 255, .35) 30%, transparent 40% 70%, rgba(139, 123, 255, .3) 80%, transparent 90%);
  filter: blur(40px); animation: spin 14s linear infinite; opacity: .8;
}
@keyframes spin { to { transform: rotate(360deg); } }
.hero-logo { position: relative; width: 100%; height: auto; overflow: visible; filter: drop-shadow(0 0 18px rgba(79, 209, 255, .35)); }
.hero-logo .ring, .hero-logo .trace { stroke: var(--cyan-soft); }
.hero-logo .node { stroke: var(--cyan-soft); fill: var(--bg); transform-box: fill-box; transform-origin: center; }
.hero-logo .word { fill: #fff; }
.hero-logo .flow { stroke: #fff; stroke-width: 3.4; fill: none; stroke-linecap: round; filter: drop-shadow(0 0 4px var(--cyan)); opacity: 0; }

/* intro animation states (only when JS is running) */
.js .hero-logo .ring { stroke-dasharray: 704; stroke-dashoffset: 704; animation: draw 1.6s var(--ease-out) .1s forwards; }
.js .hero-logo .trace { stroke-dasharray: var(--len, 120); stroke-dashoffset: var(--len, 120); animation: draw 1s var(--ease-out) forwards; animation-delay: var(--d, .6s); }
.js .hero-logo .node { opacity: 0; transform: scale(0); animation: pop .5s var(--ease-out) forwards; animation-delay: var(--d, 1.2s); }
.js .hero-logo .word { opacity: 0; animation: wordIn 1.2s var(--ease-out) 1.6s forwards; }
.hero-logo .node.lit { fill: var(--cyan); filter: drop-shadow(0 0 6px var(--cyan)); transition: fill .15s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pop { 60% { transform: scale(1.4); opacity: 1; } to { transform: scale(1); opacity: 1; } }
@keyframes wordIn { 0% { opacity: 0; filter: blur(8px); } 40% { opacity: .6; } 55% { opacity: .2; } 70% { opacity: 1; } 100% { opacity: 1; filter: blur(0); } }

.kicker { color: var(--cyan); font-size: 14px; margin: 0 0 14px; letter-spacing: .02em; }
.prompt { color: var(--violet); margin-right: .4em; }
.hero-title {
  font: 700 clamp(44px, 7.4vw, 92px)/1.02 var(--font-display); letter-spacing: -.035em; margin: 0 0 18px; color: #fff;
}
.swap {
  background: linear-gradient(100deg, var(--cyan) 0%, #a5b4ff 50%, var(--cyan) 100%);
  background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: sheen 5s linear infinite;
}
@keyframes sheen { to { background-position: -200% 0; } }
.caret {
  display: inline-block; width: .08em; height: .85em; margin-left: .06em; vertical-align: -.06em;
  background: var(--cyan); animation: caret 1s steps(1) infinite;
}
@keyframes caret { 50% { opacity: 0; } }
.hero-sub { font-size: clamp(18px, 2.2vw, 24px); color: var(--muted); margin: 0 0 34px; font-weight: 300; }

.hero-stats { display: flex; gap: 34px; margin-bottom: 38px; flex-wrap: wrap; }
.stat b { display: block; font: 600 40px/1 var(--font-display); color: #fff; letter-spacing: -.02em; }
.stat span { font: 400 12px var(--font-mono); color: var(--dim); text-transform: uppercase; letter-spacing: .08em; }

.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.btn {
  position: relative; display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px; border-radius: 12px; text-decoration: none;
  font: 600 15px var(--font-display); letter-spacing: .01em; transition: transform .25s var(--ease-out), box-shadow .25s, background .25s;
}
.btn svg { width: 18px; height: 18px; }
.btn--primary { background: linear-gradient(135deg, var(--cyan), var(--blue)); color: #031024; box-shadow: 0 10px 30px -10px rgba(79, 209, 255, .7); }
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 16px 40px -10px rgba(79, 209, 255, .9); }
.btn--ghost { border: 1px solid var(--line); color: var(--text); background: rgba(255, 255, 255, .03); }
.btn--ghost:hover { border-color: rgba(79, 209, 255, .5); background: rgba(79, 209, 255, .07); }

.scroll-hint { position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%); width: 26px; height: 42px; border: 1.5px solid var(--dim); border-radius: 14px; }
.scroll-hint span { position: absolute; left: 50%; top: 8px; width: 3px; height: 8px; margin-left: -1.5px; border-radius: 2px; background: var(--cyan); animation: scrolly 1.8s var(--ease-out) infinite; }
@keyframes scrolly { 0% { transform: translateY(0); opacity: 1; } 80% { transform: translateY(14px); opacity: 0; } 100% { opacity: 0; } }

/* ---------- Sections ---------- */
.section { width: min(1120px, calc(100% - 32px)); margin: 0 auto; padding: 110px 0; }
.section-label { color: var(--cyan); font-size: 13px; letter-spacing: .06em; margin: 0 0 18px; }
.section-title { font: 600 clamp(28px, 4vw, 46px)/1.12 var(--font-display); letter-spacing: -.025em; margin: 0 0 14px; color: #fff; max-width: 24ch; }
.section-intro { color: var(--muted); max-width: 62ch; margin: 0 0 40px; }

.about-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 56px; align-items: end; }
.big-statement { font: 600 clamp(32px, 5vw, 60px)/1.05 var(--font-display); letter-spacing: -.035em; margin: 0; color: #fff; }
.grad { background: linear-gradient(90deg, var(--cyan), var(--violet)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.about-text p { margin: 0 0 16px; color: #b9c7e6; font-size: 18px; }

/* ---------- Chat story ---------- */
.chat-window {
  max-width: 640px; border-radius: var(--radius); overflow: hidden;
  background: rgba(8, 17, 38, .75); border: 1px solid var(--line);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .8), inset 0 1px 0 rgba(255, 255, 255, .04);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.chat-head { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.dots { display: flex; gap: 6px; }
.dots i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.dots i:nth-child(2) { background: #febc2e; } .dots i:nth-child(3) { background: #28c840; }
.chat-online { margin-left: auto; color: #5ee6a8; font-size: 12px; }
.chat-body { padding: 22px 18px 26px; display: flex; flex-direction: column; gap: 12px; min-height: 380px; }
.msg {
  max-width: 82%; padding: 11px 15px; border-radius: 16px; font-size: 15.5px; line-height: 1.5; position: relative;
}
.msg--in { align-self: flex-start; background: rgba(255, 255, 255, .06); border-bottom-left-radius: 5px; }
.msg--in::before { content: attr(data-who); display: block; font: 500 11px var(--font-mono); color: var(--cyan); margin-bottom: 3px; opacity: .85; }
.msg--out { align-self: flex-end; background: linear-gradient(135deg, var(--blue), #2563eb); color: #fff; border-bottom-right-radius: 5px; }
.msg--system { align-self: center; background: none; color: var(--dim); font-size: 12.5px; padding: 6px 0 0; }
.msg b { color: #fff; }
.js .chat-body .msg { display: none; }
.js .chat-body .msg.is-shown { display: block; animation: msgIn .45s var(--ease-out); }
@keyframes msgIn { from { opacity: 0; transform: translateY(10px) scale(.97); } }
.typing { align-self: flex-start; display: flex; gap: 4px; padding: 14px 16px; background: rgba(255, 255, 255, .06); border-radius: 16px; border-bottom-left-radius: 5px; }
.typing.out { align-self: flex-end; background: rgba(59, 130, 246, .35); border-bottom-left-radius: 16px; border-bottom-right-radius: 5px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: bounce 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-5px); opacity: 1; } }

/* merge equation */
.merge { margin-top: 56px; }
.merge-row { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 18px; }
.chip { padding: 10px 16px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, .04); font-size: 18px; }
.chip b { color: var(--cyan); font-weight: 500; }
.op { color: var(--dim); font: 400 26px var(--font-mono); }
.merge-result { display: inline-flex; font: 700 clamp(40px, 7vw, 76px)/1 var(--font-display); letter-spacing: -.03em; color: #fff; }
.merge-result span { display: inline-block; }
.merge-result .ins { color: var(--cyan); text-shadow: 0 0 22px rgba(79, 209, 255, .7); }
.merge.play .merge-result span { animation: letterIn .6s var(--ease-out) backwards; animation-delay: calc(var(--k) * 55ms); }
.merge.play .merge-result .ins { animation: dropIn .9s cubic-bezier(.34, 1.56, .64, 1) backwards; animation-delay: calc(.7s + var(--k) * 90ms); }
@keyframes letterIn { from { opacity: 0; transform: translateY(18px); filter: blur(6px); } }
@keyframes dropIn { 0% { opacity: 0; transform: translateY(-70px) rotate(-25deg) scale(1.6); } 100% { opacity: 1; } }
.lang-toggle { display: inline-flex; margin-top: 26px; padding: 4px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03); }
.lang-toggle button { all: unset; cursor: pointer; padding: 7px 14px; border-radius: 9px; font-size: 14px; color: var(--muted); transition: background .2s, color .2s; }
.lang-toggle button.is-on { background: rgba(79, 209, 255, .14); color: #fff; }
.lang-toggle button:focus-visible { outline: 2px solid var(--cyan); }
.merge-note { color: var(--muted); margin: 18px 0 0; max-width: 60ch; }
.merge-note b { color: #fff; }

/* ---------- Projects ---------- */
.projects-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.projects-head .section-title { max-width: none; }
.projects-head .prompt { color: var(--cyan); }
.filters { display: flex; gap: 6px; padding: 5px; border-radius: 13px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03); margin-bottom: 14px; flex-wrap: wrap; }
.filters button { all: unset; cursor: pointer; padding: 7px 13px; border-radius: 9px; font: 500 13.5px var(--font-body); color: var(--muted); transition: all .2s; }
.filters button sup { font: 500 10px var(--font-mono); color: var(--cyan); margin-left: 2px; }
.filters button:hover { color: #fff; }
.filters button.is-on { background: rgba(79, 209, 255, .14); color: #fff; }
.filters button:focus-visible { outline: 2px solid var(--cyan); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; perspective: 1200px; }
.card {
  --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 50%;
  position: relative; display: flex; flex-direction: column; gap: 12px;
  padding: 24px; min-height: 236px; border-radius: var(--radius); text-decoration: none; color: var(--text);
  background: var(--card); border: 1px solid var(--line); overflow: hidden; isolation: isolate;
  transform: rotateX(var(--rx)) rotateY(var(--ry)); transform-style: preserve-3d;
  transition: transform .5s var(--ease-out), border-color .3s, box-shadow .4s, opacity .4s;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.card:hover { transition: transform .12s linear, border-color .3s, box-shadow .4s; border-color: color-mix(in srgb, var(--accent) 50%, transparent); box-shadow: 0 30px 60px -30px color-mix(in srgb, var(--accent) 60%, transparent); }
.card-spot {
  position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .3s;
  background: radial-gradient(420px circle at var(--mx) var(--my), color-mix(in srgb, var(--accent) 20%, transparent), transparent 45%);
}
.card:hover .card-spot { opacity: 1; }
.card-border {
  position: absolute; inset: 0; border-radius: inherit; padding: 1px; z-index: -1; pointer-events: none;
  background: radial-gradient(260px circle at var(--mx) var(--my), var(--accent), transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: 0; transition: opacity .3s;
}
.card:hover .card-border { opacity: 1; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-icon {
  width: 48px; height: 48px; border-radius: 13px; display: grid; place-items: center;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  transition: transform .4s var(--ease-out); transform: translateZ(30px);
}
.card:hover .card-icon { transform: translateZ(40px) rotate(-6deg) scale(1.06); }
.card-icon .ico { width: 24px; height: 24px; }
.card-badges { display: flex; gap: 6px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 999px; font: 500 11px var(--font-mono); text-transform: uppercase; letter-spacing: .06em; border: 1px solid var(--line); }
.badge--live { color: #5ee6a8; border-color: rgba(94, 230, 168, .3); }
.badge--live .pulse { width: 6px; height: 6px; border-radius: 50%; background: #5ee6a8; animation: ping 2s infinite; }
.badge--wip { color: #ffb547; border-color: rgba(255, 181, 71, .3); }
.badge--wip .blink { width: 6px; height: 6px; border-radius: 1px; background: #ffb547; animation: caret 1s steps(1) infinite; }
.badge--private { color: var(--muted); }
.badge-ico { width: 12px; height: 12px; }
.badge--new { color: #031024; background: linear-gradient(135deg, var(--cyan), var(--violet)); border: 0; font-weight: 600; }
.card-title { font: 600 21px/1.25 var(--font-display); letter-spacing: -.01em; margin: 6px 0 0; color: #fff; transform: translateZ(20px); }
.card-desc { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.55; flex: 1; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 14px; border-top: 1px dashed var(--line); }
.tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tag { font: 400 12px var(--font-mono); color: var(--dim); }
.card-go { display: inline-flex; align-items: center; gap: 6px; font: 600 13px var(--font-display); color: var(--accent); white-space: nowrap; }
.card-go svg { width: 16px; height: 16px; transition: transform .3s var(--ease-out); }
a.card-go { text-decoration: none; }
/* stretched link: the whole card is clickable via the Launch link */
.card-main-link::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.card-main-link:focus-visible { outline: none; }
.card:has(.card-main-link:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
.card[data-linked] { cursor: pointer; }
.desc-link {
  position: relative; z-index: 2; color: var(--accent); text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent); text-underline-offset: 3px;
  overflow-wrap: anywhere; cursor: pointer; transition: color .2s, text-decoration-color .2s;
}
.desc-link:hover { color: #fff; text-decoration-color: currentColor; }
.desc-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.card:hover .card-go svg { transform: translate(3px, -3px); }
.card-go--locked { color: var(--dim); font-family: var(--font-mono); font-weight: 400; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }

.card--featured { grid-column: span 2; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, transparent), var(--card) 55%); }
.card--featured .card-title { font-size: 26px; }
.card--private { background: repeating-linear-gradient(-45deg, rgba(255, 255, 255, .015) 0 10px, transparent 10px 20px), rgba(8, 15, 32, .55); border-style: dashed; cursor: not-allowed; }
.card--private .card-title { color: #9fb0d2; }
.card--private:hover .card-icon { animation: shake .4s; }
@keyframes shake { 25% { transform: translateZ(30px) translateX(-3px); } 75% { transform: translateZ(30px) translateX(3px); } }
.card.is-filtered { display: none; }

/* scroll reveal */
.js .reveal { opacity: 0; transform: translateY(34px); transition: opacity .9s var(--ease-out), transform .9s var(--ease-out); }
.js .reveal.in { opacity: 1; transform: none; }
.js .grid .card { opacity: 0; translate: 0 40px; transition: opacity .7s var(--ease-out), translate .8s var(--ease-out), transform .5s var(--ease-out), border-color .3s, box-shadow .4s; transition-delay: calc(var(--d, 0) * 70ms); }
.js .grid .card.in { opacity: 1; translate: 0 0; }

.empty { color: var(--dim); }

/* ---------- Blog teaser ---------- */
.blog-card {
  border-radius: var(--radius); padding: 40px; border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(139, 123, 255, .08), rgba(79, 209, 255, .04));
}
.blog-text { font: 500 clamp(20px, 2.6vw, 28px)/1.4 var(--font-display); color: #e7eeff; margin: 0 0 26px; max-width: 40ch; letter-spacing: -.01em; }
.loader { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--dim); }
.loader i { position: relative; flex: 0 1 260px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.loader i::after { content: ""; position: absolute; inset: 0; width: 4%; background: linear-gradient(90deg, var(--violet), var(--cyan)); border-radius: 4px; animation: stuck 6s ease-in-out infinite; }
.loader span::after { content: "…"; animation: caret 1s steps(1) infinite; }
@keyframes stuck { 0% { width: 2%; } 40% { width: 7%; } 60% { width: 6%; } 100% { width: 3%; } }

/* ---------- Blog: post cards ---------- */
.filters .tdot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 7px; vertical-align: 1px; box-shadow: 0 0 8px var(--accent); }
.filters button[data-topic].is-on { background: color-mix(in srgb, var(--accent, var(--cyan)) 16%, transparent); }
.posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.post-card {
  --accent: var(--cyan);
  position: relative; display: flex; flex-direction: column; overflow: hidden; border-radius: var(--radius);
  text-decoration: none; color: var(--text); background: var(--card); border: 1px solid var(--line);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: transform .45s var(--ease-out), border-color .3s, box-shadow .4s;
}
.post-card::before {
  content: ""; position: absolute; left: 0; top: 0; height: 2px; width: 100%; z-index: 2;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  transform: scaleX(0); transition: transform .6s var(--ease-out);
}
.post-card:hover { transform: translateY(-5px); border-color: color-mix(in srgb, var(--accent) 50%, transparent); box-shadow: 0 30px 60px -30px color-mix(in srgb, var(--accent) 55%, transparent); }
.post-card:hover::before { transform: scaleX(1); }
.post-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.post-thumb { display: block; aspect-ratio: 16 / 8; overflow: hidden; border-bottom: 1px solid var(--line); }
.post-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease-out), filter .5s; filter: saturate(.85) brightness(.9); }
.post-card:hover .post-thumb img { transform: scale(1.05); filter: none; }
.post-body { display: flex; flex-direction: column; gap: 10px; padding: 22px 24px 20px; flex: 1; }
.post-meta { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--dim); flex-wrap: wrap; }
.post-topic { max-width: 100%; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; color: var(--accent); text-transform: uppercase; letter-spacing: .06em; font-size: 11px; }
.post-topic i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.post-title { font: 600 22px/1.25 var(--font-display); letter-spacing: -.015em; color: #fff; }
.post-excerpt { color: var(--muted); font-size: 15px; line-height: 1.6; flex: 1; }
.post-foot { display: flex; justify-content: space-between; align-items: center; padding-top: 14px; border-top: 1px dashed var(--line); font-size: 12px; color: var(--dim); }
.post-read { color: var(--accent); font: 600 13px var(--font-display); }
.post-read b { display: inline-block; transition: transform .3s var(--ease-out); }
.post-card:hover .post-read b { transform: translateX(4px); }
.post-card.is-more, .post-card.is-filtered { display: none; }
.js .posts .post-card { opacity: 0; translate: 0 40px; transition: opacity .7s var(--ease-out), translate .8s var(--ease-out), transform .45s var(--ease-out), border-color .3s, box-shadow .4s; transition-delay: calc(var(--d, 0) * 70ms); }
.js .posts .post-card.in { opacity: 1; translate: 0 0; }
.more-wrap { display: flex; justify-content: center; margin-top: 28px; }
.topic-desc-in { animation: msgIn .4s var(--ease-out); }

/* ---------- Blog: reader modal ---------- */
.reader { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 24px 16px; }
.reader[hidden] { display: none; }
.reader-backdrop { position: absolute; inset: 0; background: rgba(3, 7, 16, .72); backdrop-filter: blur(10px) saturate(120%); -webkit-backdrop-filter: blur(10px) saturate(120%); opacity: 0; transition: opacity .4s; }
.reader-panel {
  --accent: var(--cyan);
  position: relative; width: min(820px, 100%); max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px);
  display: flex; flex-direction: column; overflow: hidden; border-radius: 22px;
  background: linear-gradient(180deg, rgba(13, 26, 56, .97), rgba(6, 13, 30, .98));
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  box-shadow: 0 50px 120px -30px rgba(0, 0, 0, .9), 0 0 0 1px rgba(255, 255, 255, .03) inset, 0 0 80px -30px color-mix(in srgb, var(--accent) 60%, transparent);
  opacity: 0; transform: translateY(40px) scale(.96); transition: opacity .45s var(--ease-out), transform .55s var(--ease-out);
}
.reader-panel::before { /* faint circuit grid inside the panel */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background: linear-gradient(rgba(79, 209, 255, .03) 1px, transparent 1px) 0 0 / 32px 32px, linear-gradient(90deg, rgba(79, 209, 255, .03) 1px, transparent 1px) 0 0 / 32px 32px;
  mask: linear-gradient(180deg, #000, transparent 40%); -webkit-mask: linear-gradient(180deg, #000, transparent 40%);
}
.reader.open .reader-backdrop { opacity: 1; }
.reader.open .reader-panel { opacity: 1; transform: none; }
.reader-progress { position: absolute; left: 0; right: 0; top: 0; height: 3px; z-index: 3; background: rgba(255, 255, 255, .04); }
.reader-progress i { display: block; height: 100%; width: 100%; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, var(--violet), var(--accent)); box-shadow: 0 0 12px var(--accent); }
.reader-bar { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 12px 26px; border-bottom: 1px solid var(--line); }
.reader-topic { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; display: inline-flex; align-items: center; gap: 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }
.reader-topic::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.reader-topic:empty::before { display: none; }
.reader-tools { display: flex; gap: 6px; }
.icon-btn { all: unset; cursor: pointer; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; color: var(--muted); border: 1px solid transparent; transition: all .2s; }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { color: #fff; background: rgba(255, 255, 255, .06); border-color: var(--line); }
.icon-btn:focus-visible { outline: 2px solid var(--accent); }
.reader-scroll { position: relative; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(120, 170, 255, .25) transparent; }
.reader-inner { padding: 34px clamp(22px, 6vw, 64px) 40px; }
.reader-meta { margin: 0 0 12px; font-size: 12.5px; color: var(--dim); }
.reader-meta .draft { color: #ffb547; border: 1px solid rgba(255, 181, 71, .4); border-radius: 99px; padding: 1px 8px; margin-left: 8px; text-transform: uppercase; font-size: 10.5px; letter-spacing: .06em; }
.reader-title { font: 700 clamp(28px, 4.6vw, 46px)/1.1 var(--font-display); letter-spacing: -.03em; color: #fff; margin: 0 0 30px; }
.reader-body { --accent: inherit; min-height: 120px; }
.reader.loading .reader-body { color: transparent; }
.reader.loading .reader-body::before {
  content: ""; display: block; height: 220px; border-radius: 12px;
  background: linear-gradient(90deg, rgba(255, 255, 255, .03) 0, rgba(79, 209, 255, .09) 40%, rgba(255, 255, 255, .03) 80%) 0 0 / 200% 100%;
  animation: shimmer 1.2s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }
.reader.ready .reader-body > * { animation: proseIn .6s var(--ease-out) backwards; }
.reader.ready .reader-body > *:nth-child(2) { animation-delay: .05s; } .reader.ready .reader-body > *:nth-child(3) { animation-delay: .1s; }
.reader.ready .reader-body > *:nth-child(4) { animation-delay: .15s; } .reader.ready .reader-body > *:nth-child(n+5) { animation-delay: .2s; }
@keyframes proseIn { from { opacity: 0; transform: translateY(14px); } }
.reader-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 46px; padding-top: 24px; border-top: 1px dashed var(--line); }
.reader-nav a { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); text-decoration: none; color: #fff; font: 600 15px/1.35 var(--font-display); transition: border-color .2s, background .2s; }
.reader-nav a span { font: 400 11px var(--font-mono); color: var(--dim); text-transform: uppercase; letter-spacing: .06em; }
.reader-nav a:hover { border-color: color-mix(in srgb, var(--accent) 50%, transparent); background: rgba(255, 255, 255, .02); }
.reader-nav a.next { text-align: right; grid-column: 2; }
.reader-error { color: var(--muted); font-family: var(--font-mono); font-size: 14px; }
html.reader-lock, html.reader-lock body { overflow: hidden; }

@media (max-width: 600px) {
  .reader { padding: 0; place-items: end center; }
  .reader-panel { max-height: 94vh; max-height: 94dvh; border-radius: 22px 22px 0 0; transform: translateY(100%); }
  .reader-nav { grid-template-columns: 1fr; }
  .reader-nav a.next { grid-column: auto; }
  .posts { grid-template-columns: 1fr; }
}

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); margin-top: 40px; }
.footer-inner { width: min(1120px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 40px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--dim); font-size: 14px; }
.footer-hint { font-size: 12px; opacity: .55; }

/* ---------- Easter egg ---------- */
#matrix { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 90; pointer-events: none; opacity: 0; transition: opacity .6s; }
#matrix.on { opacity: .96; }
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 100; transform: translate(-50%, calc(100% + 60px));
  padding: 14px 20px; border-radius: 14px; background: rgba(7, 15, 34, .92); border: 1px solid rgba(79, 209, 255, .4);
  font: 500 14px var(--font-mono); color: #fff; box-shadow: 0 20px 50px -10px rgba(79, 209, 255, .4);
  transition: transform .6s var(--ease-out), visibility 0s .6s; max-width: calc(100% - 32px); visibility: hidden;
}
.toast.show { transform: translate(-50%, 0); visibility: visible; transition: transform .6s var(--ease-out); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 28px; padding-top: 100px; text-align: center; }
  .hero-logo-wrap { max-width: 300px; }
  .hero-stats, .hero-cta { justify-content: center; }
  .about-grid { grid-template-columns: 1fr; gap: 24px; }
  .card--featured { grid-column: auto; }
  .topbar-links a { display: none; }
}
@media (max-width: 520px) {
  body { font-size: 16px; }
  .section { padding: 80px 0; }
  .grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 22px; }
  .stat b { font-size: 32px; }
  .blog-card { padding: 26px; }
  .msg { max-width: 92%; }
  .merge-row { gap: 10px 12px; }
  .chip { font-size: 15px; padding: 8px 12px; }
  .scroll-hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
  html { scroll-behavior: auto; }
  .noise, .hero-halo { display: none; }
}

/* long topic names: single line with an ellipsis */
.post-topic { display: inline-block; flex: 0 1 auto; }
.post-topic i { display: inline-block; margin-right: 7px; vertical-align: 1px; }
.post-meta > span:last-child { flex: none; }
.post-meta { flex-wrap: nowrap; }
.reader-topic { display: block; flex: 1 1 auto; }
.reader-topic::before { display: inline-block; margin-right: 8px; vertical-align: 1px; }

/* long topic names: single line with an ellipsis */
.post-topic { display: inline-block; flex: 0 1 auto; }
.post-topic i { display: inline-block; margin-right: 7px; vertical-align: 1px; }
.post-meta > span:last-child { flex: none; }
.post-meta { flex-wrap: nowrap; }
.reader-topic { display: block; flex: 1 1 auto; }
.reader-topic::before { display: inline-block; margin-right: 8px; vertical-align: 1px; }
