:root {
  --bg: #0a0e13;
  --bg-2: #0f151c;
  --panel: #121a23;
  --border: #1f2b38;
  --text: #dbe4ee;
  --muted: #8b9bb0;
  --dim: #5d6d80;
  --accent: #5eead4;
  --accent-2: #7c9cff;
  --warn: #f59e0b;
  --danger: #f87171;
  --radius: 14px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, "Liberation Mono", monospace;
  --serif: Charter, "Iowan Old Style", Georgia, serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--sans); font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(124,156,255,.13), transparent 60%),
    radial-gradient(700px 400px at -10% 20%, rgba(94,234,212,.08), transparent 60%),
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px) 0 0 / 44px 44px;
  mask-image: linear-gradient(to bottom, #000 0%, #000 55%, transparent 100%);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
::selection { background: rgba(94,234,212,.25); }

.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  background: rgba(10,14,19,.72); border-bottom: 1px solid rgba(31,43,56,.6);
}
.nav .container { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { font-family: var(--mono); font-size: 14.5px; color: var(--text); }
.logo:hover { text-decoration: none; }
.logo .p { color: var(--accent); }
.logo .cursor { display: inline-block; width: 8px; height: 15px; background: var(--accent); vertical-align: -2px; margin-left: 3px; animation: blink 1.1s steps(1) infinite; }
.nav-links { display: flex; gap: 26px; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--muted); font-size: 14.5px; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text); text-decoration: none; }
.nav-links .btn-sm { color: var(--bg); background: var(--accent); padding: 6px 14px; border-radius: 8px; font-weight: 600; }
.nav-links .btn-sm:hover { color: var(--bg); filter: brightness(1.08); }
@media (max-width: 720px) { .nav-links li.hide-sm { display: none; } .nav-links { gap: 16px; } }

/* ---------- Hero ---------- */
.hero { padding: 96px 0 72px; display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; }
.eyebrow { font-family: var(--mono); font-size: 13px; color: var(--accent); letter-spacing: .5px; display: inline-flex; align-items: center; gap: 8px; }
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(94,234,212,.6); animation: pulse 2s infinite; }
.hero h1 { font-size: clamp(38px, 5.4vw, 62px); line-height: 1.05; letter-spacing: -1.5px; margin: 18px 0 20px; font-weight: 750; }
.grad { background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: 18.5px; color: var(--muted); max-width: 560px; margin: 0 0 30px; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; border-radius: 10px; font-weight: 600; font-size: 15px; border: 1px solid var(--border); color: var(--text); background: var(--panel); transition: transform .15s, border-color .15s; }
.btn:hover { text-decoration: none; transform: translateY(-1px); border-color: #2d3d4f; }
.btn.primary { background: var(--accent); color: #062a25; border-color: transparent; }

.terminal { background: #0c1218; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 30px 80px rgba(0,0,0,.45), 0 0 0 1px rgba(94,234,212,.04); overflow: hidden; font-family: var(--mono); font-size: 13.2px; }
.term-bar { display: flex; gap: 7px; padding: 12px 14px; border-bottom: 1px solid var(--border); background: #0f161d; align-items: center; }
.term-bar i { width: 11px; height: 11px; border-radius: 50%; background: #2a3644; display: block; }
.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: 10px; color: var(--dim); font-size: 12px; }
.term-body { padding: 18px 18px 22px; line-height: 1.75; min-height: 300px; }
.term-body .ln { white-space: pre-wrap; opacity: 0; animation: appear .01s forwards; }
.term-body .c { color: var(--accent); } .term-body .k { color: var(--accent-2); } .term-body .m { color: var(--dim); } .term-body .w { color: var(--warn); } .term-body .ok { color: #4ade80; }
.term-body .ln:nth-child(1) { animation-delay: .2s; } .term-body .ln:nth-child(2) { animation-delay: .6s; }
.term-body .ln:nth-child(3) { animation-delay: 1.1s; } .term-body .ln:nth-child(4) { animation-delay: 1.4s; }
.term-body .ln:nth-child(5) { animation-delay: 1.7s; } .term-body .ln:nth-child(6) { animation-delay: 2.0s; }
.term-body .ln:nth-child(7) { animation-delay: 2.5s; } .term-body .ln:nth-child(8) { animation-delay: 2.9s; }
.term-body .ln:nth-child(9) { animation-delay: 3.2s; } .term-body .ln:nth-child(10) { animation-delay: 3.5s; }
.term-body .ln:nth-child(11) { animation-delay: 3.9s; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 0 0 96px; }
.stat { background: linear-gradient(180deg, var(--panel), var(--bg-2)); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; }
.stat b { display: block; font-size: 30px; letter-spacing: -.5px; }
.stat span { color: var(--muted); font-size: 14px; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 64px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Sections ---------- */
section.block { padding: 0 0 96px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.sec-head h2 { font-size: 30px; letter-spacing: -.6px; margin: 0; }
.sec-head .tag { font-family: var(--mono); color: var(--accent); font-size: 13px; }
.sec-head p { color: var(--muted); margin: 6px 0 0; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 900px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.card { background: linear-gradient(180deg, var(--panel), var(--bg-2)); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; position: relative; overflow: hidden; transition: border-color .2s, transform .2s; }
.card:hover { border-color: #2c3e52; transform: translateY(-2px); }
.card::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: radial-gradient(400px 120px at 0% 0%, rgba(94,234,212,.07), transparent 70%); }
.card .ic { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: rgba(94,234,212,.1); color: var(--accent); margin-bottom: 16px; }
.card .ic svg { width: 22px; height: 22px; }
.card h3 { margin: 0 0 8px; font-size: 18.5px; letter-spacing: -.2px; }
.card p { color: var(--muted); margin: 0; font-size: 15px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.chip { font-family: var(--mono); font-size: 11.5px; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; background: rgba(255,255,255,.02); }

.build { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: start; }
.build .num { font-family: var(--mono); font-size: 12px; color: var(--accent); border: 1px solid rgba(94,234,212,.3); border-radius: 8px; padding: 4px 8px; }
.build h3 { font-size: 17.5px; }

/* ---------- Timeline ---------- */
.timeline { position: relative; margin-left: 8px; padding-left: 30px; border-left: 1px dashed #2a3a4b; }
.tl-item { position: relative; padding-bottom: 34px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before { content: ""; position: absolute; left: -37px; top: 6px; width: 13px; height: 13px; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent); box-shadow: 0 0 0 4px rgba(94,234,212,.12); }
.tl-item .when { font-family: var(--mono); font-size: 12.5px; color: var(--dim); }
.tl-item h3 { margin: 4px 0 6px; font-size: 19px; }
.tl-item h3 span { color: var(--muted); font-weight: 500; }
.tl-item ul { margin: 8px 0 0; padding-left: 18px; color: var(--muted); }
.tl-item li { margin: 4px 0; }
.tl-item li::marker { color: var(--accent); }

/* ---------- Blog list ---------- */
.post-card { display: block; color: inherit; }
.post-card:hover { text-decoration: none; }
.post-card .meta { font-family: var(--mono); font-size: 12px; color: var(--dim); display: flex; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.post-card .meta .sev { color: var(--danger); }
.post-card h3 { font-size: 22px; letter-spacing: -.3px; margin: 0 0 8px; }
.post-card .more { display: inline-block; margin-top: 16px; color: var(--accent); font-weight: 600; font-size: 14.5px; }
.page-head { padding: 80px 0 40px; }
.page-head h1 { font-size: clamp(34px, 5vw, 52px); letter-spacing: -1.2px; margin: 12px 0 10px; }
.page-head p { color: var(--muted); font-size: 18px; max-width: 620px; margin: 0; }

/* ---------- Contact / footer ---------- */
.contact { text-align: center; padding: 56px 24px; border: 1px solid var(--border); border-radius: 20px; background: radial-gradient(600px 200px at 50% 0%, rgba(94,234,212,.09), transparent 70%), var(--bg-2); }
.contact h2 { font-size: 32px; margin: 10px 0 10px; letter-spacing: -.6px; }
.contact p { color: var(--muted); margin: 0 auto 26px; max-width: 520px; }
.contact .cta { justify-content: center; }
footer { border-top: 1px solid var(--border); margin-top: 96px; padding: 28px 0 40px; color: var(--dim); font-size: 13.5px; }
footer .container { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
footer a { color: var(--muted); }
.btn svg, .icon { width: 17px; height: 17px; fill: currentColor; }

/* ---------- Article ---------- */
.article { max-width: 740px; margin: 0 auto; padding: 64px 24px 0; }
.article .back { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.article .kicker { font-family: var(--mono); font-size: 12.5px; color: var(--accent); margin-top: 28px; letter-spacing: .4px; }
.article h1 { font-size: clamp(32px, 5vw, 46px); line-height: 1.12; letter-spacing: -1px; margin: 10px 0 14px; }
.article .sub { font-size: 19.5px; color: var(--muted); margin: 0 0 18px; }
.article .byline { font-family: var(--mono); font-size: 12.5px; color: var(--dim); padding-bottom: 24px; border-bottom: 1px solid var(--border); margin-bottom: 34px; }
.prose { font-family: var(--serif); font-size: 19px; line-height: 1.75; color: #cfd8e3; }
.prose h2 { font-family: var(--sans); font-size: 25px; letter-spacing: -.4px; color: var(--text); margin: 48px 0 12px; }
.prose p { margin: 0 0 18px; }
.prose b, .prose strong { color: #eef3f8; }
.prose ul, .prose ol { padding-left: 24px; margin: 0 0 18px; }
.prose li { margin: 8px 0; }
.prose li::marker { color: var(--accent); }
.prose .tldr { font-family: var(--sans); font-size: 16.5px; line-height: 1.65; background: var(--panel); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 12px; padding: 18px 22px; margin: 0 0 34px; }
.prose .tldr .label { font-family: var(--mono); font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--accent); display: block; margin-bottom: 6px; }
.prose .tldr ul { margin: 0; padding-left: 20px; }
.prose figure { margin: 30px 0 34px; }
.prose figure .fig { background: #f7f9fb; border-radius: 14px; padding: 18px; border: 1px solid var(--border); }
.prose figure svg { width: 100%; height: auto; display: block; font-family: var(--sans); }
.prose figcaption { font-family: var(--sans); font-size: 13.5px; color: var(--dim); text-align: center; margin-top: 10px; }
.prose .gaps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 10px 0 24px; font-family: var(--sans); }
.prose .gap { background: var(--panel); border: 1px solid var(--border); border-top: 3px solid var(--danger); border-radius: 10px; padding: 14px 16px; font-size: 15px; line-height: 1.55; color: var(--muted); }
.prose .gap b { display: block; font-size: 15.5px; margin-bottom: 4px; color: var(--text); }
.prose .note { font-family: var(--sans); font-size: 14px; color: var(--dim); border-top: 1px solid var(--border); margin-top: 44px; padding-top: 16px; }
@media (max-width: 680px) { .prose .gaps { grid-template-columns: 1fr; } .prose { font-size: 17.5px; } }

/* ---------- Motion ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }
@keyframes blink { 50% { opacity: 0; } }
@keyframes appear { to { opacity: 1; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(94,234,212,.55); } 70% { box-shadow: 0 0 0 10px rgba(94,234,212,0); } 100% { box-shadow: 0 0 0 0 rgba(94,234,212,0); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .term-body .ln, .reveal { opacity: 1; transform: none; }
}
