/* Self-hosted variable fonts (latin): no third-party request, faster first paint */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../fonts/inter-latin-wght.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 300 700; font-display: swap; src: url("../fonts/space-grotesk-latin-wght.woff2") format("woff2"); }

/* ==========================================================
   Vivek Kalwar – portfolio design system
   Dark-minimal by default, light theme via [data-theme="light"]
   ========================================================== */

:root {
  --bg: #08080d;
  --bg-2: #0e0e16;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-hover: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #f4f4f8;
  --muted: #9a9ab0;
  --accent: #a78bfa;
  --accent-2: #67e8f9;
  --accent-ink: #0b0618;
  --glow: rgba(167, 139, 250, 0.35);
  --grad: linear-gradient(120deg, #c4b5fd 0%, #a78bfa 40%, #67e8f9 100%);
  --nav-bg: rgba(14, 14, 22, 0.65);
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.7);

  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --radius: 18px;
  --radius-sm: 12px;
  --max: 1120px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f7f7fb;
  --bg-2: #ffffff;
  --surface: rgba(255, 255, 255, 0.75);
  --surface-hover: #ffffff;
  --border: rgba(20, 20, 40, 0.1);
  --border-strong: rgba(20, 20, 40, 0.22);
  --text: #12121a;
  --muted: #5c5c72;
  --accent: #6d4aff;
  --accent-2: #0891b2;
  --accent-ink: #ffffff;
  --glow: rgba(109, 74, 255, 0.25);
  --grad: linear-gradient(120deg, #6d4aff 0%, #8b5cf6 50%, #0891b2 100%);
  --nav-bg: rgba(255, 255, 255, 0.75);
  --shadow: 0 20px 50px -25px rgba(30, 20, 80, 0.35);
  color-scheme: light;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.12; margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--accent); color: var(--accent-ink); }

/* smooth cross-page transitions (Chrome/Edge/Safari 18+) */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out 0.25s var(--ease) both; }
::view-transition-new(root) { animation: vt-in 0.4s var(--ease) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-8px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(12px); } }

/* scrollbar */
html { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; border: 2px solid var(--bg); }

/* ---------- ambient background ---------- */
.ambient { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.ambient::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 56px 56px;
  opacity: 0.35;
  mask-image: radial-gradient(ellipse 70% 55% at 50% 0%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 55% at 50% 0%, #000 20%, transparent 75%);
}
.ambient i {
  position: absolute; border-radius: 50%; filter: blur(110px); opacity: 0.35;
  animation: float 18s ease-in-out infinite alternate;
}
.ambient i:nth-child(1) { width: 520px; height: 520px; background: #7c5cff; top: -180px; left: -120px; }
.ambient i:nth-child(2) { width: 460px; height: 460px; background: #22d3ee; top: 20%; right: -160px; opacity: 0.18; animation-delay: -6s; }
.ambient i:nth-child(3) { width: 420px; height: 420px; background: #c026d3; bottom: -160px; left: 30%; opacity: 0.16; animation-delay: -11s; }
:root[data-theme="light"] .ambient i { opacity: 0.14; }
@keyframes float { to { transform: translate3d(60px, 40px, 0) scale(1.1); } }
.cursor-glow {
  position: fixed; top: 0; left: 0; width: 480px; height: 480px; margin: -240px 0 0 -240px;
  background: radial-gradient(circle, var(--glow), transparent 65%);
  opacity: 0; transition: opacity 0.4s; z-index: -1; pointer-events: none; will-change: transform;
}
.cursor-glow.on { opacity: 0.55; }

/* scroll progress */
.progress { position: fixed; top: 0; left: 0; height: 3px; width: 100%; z-index: 100; transform-origin: 0 50%; transform: scaleX(0); background: var(--grad); }

/* ---------- layout ---------- */
.wrap { width: min(var(--max), 100% - 40px); margin-inline: auto; }
main { padding-top: 110px; }
section { padding-block: 72px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent);
}
.eyebrow::before { content: ""; width: 28px; height: 1px; background: currentColor; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 40px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(30px, 4.5vw, 46px); margin-top: 12px; }
.section-head p { color: var(--muted); max-width: 460px; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 90;
  width: min(1080px, 100% - 24px); view-transition-name: nav;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 10px 8px 20px; border-radius: 999px;
  background: var(--nav-bg); border: 1px solid var(--border);
  backdrop-filter: blur(18px) saturate(160%); -webkit-backdrop-filter: blur(18px) saturate(160%);
  box-shadow: var(--shadow);
  transition: padding 0.3s var(--ease), background 0.3s;
}
.nav.scrolled { padding-block: 6px; }
.brand { font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: -0.02em; display: flex; align-items: center; gap: 8px; }
.brand b { width: 10px; height: 10px; border-radius: 50%; background: var(--grad); box-shadow: 0 0 14px var(--accent); }
.nav-links { display: flex; align-items: center; gap: 2px; list-style: none; margin: 0; padding: 0; position: relative; }
.nav-links a {
  display: block; padding: 8px 14px; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--muted);
  transition: color 0.2s, background 0.2s;
}
.nav-links a:hover { color: var(--text); background: var(--surface-hover); }
.nav-links a[aria-current="page"] { color: var(--text); background: var(--surface-hover); box-shadow: inset 0 0 0 1px var(--border-strong); }
.nav-tools { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--border); color: var(--text); cursor: pointer;
  transition: transform 0.25s var(--ease), border-color 0.2s, background 0.2s;
}
.icon-btn:hover { transform: rotate(18deg) scale(1.06); border-color: var(--border-strong); }
.icon-btn svg { width: 18px; height: 18px; }
.menu-btn { display: none; }
.sun { display: none; }
:root[data-theme="light"] .sun { display: block; }
:root[data-theme="light"] .moon { display: none; }

@media (max-width: 960px) {
  .menu-btn { display: grid; }
  .nav-links {
    position: absolute; top: calc(100% + 10px); left: 0; right: 0; flex-direction: column; align-items: stretch;
    padding: 10px; border-radius: 22px; background: var(--bg-2); border: 1px solid var(--border);
    box-shadow: var(--shadow); opacity: 0; transform: translateY(-8px) scale(0.98); pointer-events: none;
    transition: opacity 0.25s, transform 0.3s var(--ease);
  }
  .nav.open .nav-links { opacity: 1; transform: none; pointer-events: auto; }
  .nav-links a { padding: 12px 16px; }
}

/* ---------- buttons ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; gap: 10px; padding: 13px 24px;
  border-radius: 999px; font-weight: 600; font-size: 15px; cursor: pointer; border: 1px solid transparent;
  transition: transform 0.3s var(--ease), box-shadow 0.3s, background 0.2s, border-color 0.2s;
}
.btn svg { width: 16px; height: 16px; transition: transform 0.3s var(--ease); }
.btn:hover svg { transform: translateX(4px); }
.btn-primary { background: var(--grad); color: var(--accent-ink); box-shadow: 0 10px 30px -10px var(--glow); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 40px -10px var(--glow); }
.btn-ghost { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn-ghost:hover { background: var(--surface-hover); transform: translateY(-2px); }

/* ---------- hero ---------- */
.hero { padding-block: 40px 40px; }
.hero-grid { display: grid; grid-template-columns: 1.25fr 0.75fr; gap: 48px; align-items: center; }
.status {
  display: inline-flex; align-items: center; gap: 10px; padding: 7px 14px 7px 12px; border-radius: 999px;
  font-size: 13px; color: var(--muted); background: var(--surface); border: 1px solid var(--border);
}
.status i { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6); animation: ping 2s infinite; }
@keyframes ping { to { box-shadow: 0 0 0 10px rgba(74, 222, 128, 0); } }
.hero h1 { font-size: clamp(42px, 7vw, 84px); margin: 22px 0 18px; font-weight: 700; letter-spacing: -0.04em; }
.role-line { font-family: var(--font-display); font-size: clamp(20px, 2.6vw, 28px); color: var(--muted); min-height: 1.5em; }
.role-line .typed { color: var(--text); }
.role-line .caret { display: inline-block; width: 2px; height: 1em; background: var(--accent); margin-left: 3px; vertical-align: -0.12em; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero p.lead { margin-top: 22px; max-width: 540px; color: var(--muted); font-size: 18px; }
.cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.socials { display: flex; gap: 10px; margin-top: 32px; }
.socials .icon-btn:hover { transform: translateY(-4px); }

.portrait { position: relative; justify-self: center; width: min(380px, 80%); aspect-ratio: 1; }
.portrait::before {
  content: ""; position: absolute; inset: 6%; border-radius: 50%;
  background: conic-gradient(from 0deg, #7c5cff, #22d3ee, #c026d3, #7c5cff); filter: blur(46px); opacity: 0.55;
  animation: spin 14s linear infinite;
}
.portrait::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; border: 1px dashed var(--border-strong);
  animation: spin 40s linear infinite reverse;
}
@keyframes spin { to { transform: rotate(360deg); } }
.portrait .disc {
  position: absolute; inset: 9%; border-radius: 50%; overflow: hidden;
  background: radial-gradient(circle at 30% 25%, var(--bg-2), var(--bg)); border: 1px solid var(--border-strong);
}
.portrait img { position: absolute; left: 50%; bottom: -2%; width: 104%; max-width: none; transform: translateX(-50%); }
.chip-float {
  position: absolute; padding: 8px 14px; font-size: 13px; font-weight: 500; border-radius: 999px; z-index: 2;
  background: var(--nav-bg); border: 1px solid var(--border-strong); backdrop-filter: blur(12px);
  animation: bob 6s ease-in-out infinite alternate;
}
.chip-float.a { top: 8%; right: -4%; }
.chip-float.b { bottom: 14%; left: -8%; animation-delay: -3s; }
@keyframes bob { to { transform: translateY(-12px); } }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-top: 64px; }
.stat { padding: 20px 22px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); }
.stat b { display: block; font-family: var(--font-display); font-size: 30px; letter-spacing: -0.03em; }
.stat span { font-size: 13px; color: var(--muted); }

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .portrait { order: -1; width: min(260px, 70%); }
  main { padding-top: 96px; }
}

/* ---------- cards with cursor spotlight ---------- */
.card {
  position: relative; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border);
  overflow: hidden; isolation: isolate;
  transition: transform 0.45s var(--ease), border-color 0.3s, background 0.3s, box-shadow 0.4s;
}
.card::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity 0.3s; border-radius: inherit;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), var(--glow), transparent 55%);
}
.card:hover { transform: translateY(-6px); border-color: var(--border-strong); background: var(--surface-hover); box-shadow: var(--shadow); }
.card:hover::before { opacity: 0.55; }

.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 22px; }
.project .thumb { aspect-ratio: 16 / 10; overflow: hidden; background: var(--bg-2); border-bottom: 1px solid var(--border); }
.project .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s var(--ease); }
.project:hover .thumb img { transform: scale(1.07); }
.project .body { padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.project h3 { font-size: 22px; }
.project p { color: var(--muted); font-size: 15px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { font-size: 12px; font-weight: 500; padding: 4px 11px; border-radius: 999px; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); }
.links { display: flex; gap: 18px; margin-top: 4px; }
.links a { font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; transition: color 0.2s, gap 0.25s; }
.links a:hover { color: var(--accent); gap: 10px; }
.links .soon { font-size: 13px; color: var(--muted); }

.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 32px; }
.filter {
  padding: 9px 18px; border-radius: 999px; font: 500 14px var(--font-body); cursor: pointer;
  color: var(--muted); background: var(--surface); border: 1px solid var(--border); transition: all 0.25s var(--ease);
}
.filter:hover { color: var(--text); border-color: var(--border-strong); }
.filter.active { color: var(--accent-ink); background: var(--grad); border-color: transparent; }
.project.hide { display: none; }

/* ---------- timeline ---------- */
.timeline { position: relative; display: grid; gap: 22px; padding-left: 34px; }
.timeline::before {
  content: ""; position: absolute; left: 9px; top: 8px; bottom: 8px; width: 2px;
  background: linear-gradient(var(--accent), var(--accent-2), transparent);
  transform-origin: top; border-radius: 2px;
}
.t-item { position: relative; padding: 24px 26px; overflow: visible; }
.t-item::after {
  content: ""; position: absolute; left: -33px; top: 30px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent); box-shadow: 0 0 0 5px var(--bg), 0 0 18px var(--glow);
}
.t-top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.logo { width: 48px; height: 48px; border-radius: 12px; background: #fff; padding: 6px; object-fit: contain; flex: none; border: 1px solid var(--border); }
.t-top h3 { font-size: 20px; }
.t-top .org { color: var(--accent); font-weight: 600; font-size: 15px; }
.t-time { margin-left: auto; font-size: 13px; color: var(--muted); padding: 5px 12px; border: 1px solid var(--border); border-radius: 999px; white-space: nowrap; }
.t-item ul { margin: 16px 0 0; padding-left: 18px; color: var(--muted); font-size: 15px; display: grid; gap: 6px; }
.t-item ul li::marker { color: var(--accent); }
.t-mode { font-size: 12px; color: var(--muted); }

/* ---------- skills ---------- */
.skill-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.skill { padding: 26px 16px; display: grid; justify-items: center; gap: 14px; text-align: center; }
.skill img { width: 64px; height: 64px; padding: 11px; border-radius: 16px; background: #fff; object-fit: contain; transition: transform 0.4s var(--ease); }
.skill:hover img { transform: scale(1.15) rotate(-4deg); }
.skill span { font-weight: 600; font-size: 15px; }

.marquee { overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.marquee-track { display: flex; gap: 14px; width: max-content; animation: scroll 38s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.pill { display: flex; align-items: center; gap: 12px; padding: 12px 22px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-weight: 500; white-space: nowrap; }
.pill img { width: 30px; height: 30px; padding: 3px; border-radius: 8px; background: #fff; object-fit: contain; }
@keyframes scroll { to { transform: translateX(-50%); } }

/* ---------- education ---------- */
.edu-result { display: inline-block; margin-top: 12px; font-weight: 600; font-size: 14px; color: var(--accent-2); }

/* ---------- CTA + footer ---------- */
.cta-card { padding: clamp(36px, 6vw, 72px); text-align: center; background: var(--surface); }
.cta-card h2 { font-size: clamp(30px, 5vw, 54px); max-width: 720px; margin: 14px auto 18px; }
.cta-card p { color: var(--muted); max-width: 520px; margin: 0 auto 30px; }
.cta-card .cta { justify-content: center; margin-top: 0; }
.footer { border-top: 1px solid var(--border); padding-block: 36px; margin-top: 40px; }
.footer .wrap { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; color: var(--muted); font-size: 14px; }
.footer .socials { margin: 0; }
.to-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 80; opacity: 0; transform: translateY(12px); pointer-events: none;
  transition: opacity 0.3s, transform 0.3s var(--ease);
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }

/* ---------- page header (inner pages) ---------- */
.page-head { padding-block: 40px 20px; }
.page-head h1 { font-size: clamp(40px, 6.5vw, 76px); margin: 14px 0 16px; letter-spacing: -0.04em; }
.page-head p { color: var(--muted); max-width: 560px; font-size: 18px; }

/* ---------- reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); transition-delay: var(--d, 0ms); }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

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

/* ---------- dropdown (support) ---------- */
.dd { position: relative; }
.dd > button { font: 500 14px var(--font-body); color: var(--muted); background: none; border: 0; padding: 8px 14px; border-radius: 999px; cursor: pointer; display: flex; align-items: center; gap: 6px; transition: color 0.2s, background 0.2s; }
.dd > button:hover, .dd.open > button { color: var(--text); background: var(--surface-hover); }
.dd-menu { position: absolute; right: 0; top: calc(100% + 12px); min-width: 230px; padding: 8px; border-radius: 16px; background: var(--bg-2); border: 1px solid var(--border-strong); box-shadow: var(--shadow); opacity: 0; transform: translateY(-6px); pointer-events: none; transition: opacity 0.2s, transform 0.3s var(--ease); list-style: none; margin: 0; }
.dd.open .dd-menu { opacity: 1; transform: none; pointer-events: auto; }
.dd-menu a { display: block; padding: 10px 14px; border-radius: 10px; font-size: 14px; color: var(--text); }
.dd-menu a:hover { background: var(--surface-hover); color: var(--accent); }
@media (max-width: 960px) {
  .dd { display: flex; flex-direction: column; }
  .dd > button { padding: 12px 16px; justify-content: space-between; }
  .dd-menu { position: static; opacity: 1; transform: none; pointer-events: auto; display: none; box-shadow: none; margin: 4px 0 0 10px; }
  .dd.open .dd-menu { display: block; }
}

/* ---------- explore cards (home) ---------- */
.explore { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.explore a.card { padding: 28px; display: flex; flex-direction: column; gap: 10px; min-height: 190px; }
.explore .num { font-family: var(--font-display); font-size: 13px; color: var(--accent); letter-spacing: 0.12em; }
.explore h3 { font-size: 26px; }
.explore p { color: var(--muted); font-size: 15px; }
.explore .go { margin-top: auto; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--border-strong); transition: transform 0.4s var(--ease), background 0.3s, color 0.3s; }
.explore .go svg { width: 16px; height: 16px; }
.explore a.card:hover .go { background: var(--grad); color: var(--accent-ink); transform: rotate(-45deg); border-color: transparent; }

/* ---------- contact ---------- */
.contact-grid { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 28px; align-items: start; }
.contact-info { display: grid; gap: 14px; }
.info-card { padding: 22px 24px; display: flex; align-items: center; gap: 16px; }
.info-card .icon-btn { flex: none; }
.info-card small { display: block; color: var(--muted); font-size: 13px; }
.info-card b { font-weight: 600; }
.form { padding: clamp(22px, 4vw, 38px); display: grid; gap: 18px; }
.form:hover { transform: none; }
.field { display: grid; gap: 8px; }
.field label { font-size: 13px; font-weight: 500; color: var(--muted); }
.field input, .field textarea {
  width: 100%; font: 400 16px var(--font-body); color: var(--text); background: var(--bg-2);
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field input::placeholder, .field textarea::placeholder { color: var(--muted); opacity: 0.6; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-msg { font-size: 15px; min-height: 1.4em; }
.form-msg.ok { color: #4ade80; } .form-msg.err { color: #f87171; }
.btn[disabled] { opacity: 0.6; cursor: wait; }
.hp { position: absolute; left: -9999px; }
@media (max-width: 860px) { .contact-grid, .form-row { grid-template-columns: 1fr; } }

/* slim banner used at the bottom of inner pages */
.banner { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: 28px 32px; }
.banner h2 { font-size: 24px; }
.banner p { color: var(--muted); font-size: 15px; margin-top: 4px; }
.footer .quote { width: 100%; text-align: center; font-family: var(--font-display); font-size: 18px; color: var(--text); padding-bottom: 12px; }

/* ---------- original animated social icons ---------- */
.soc { overflow: hidden; }
.soc svg { width: 22px; height: 22px; }
.soc.github svg { width: 28px; height: 28px; }
.soc:hover { transform: translateY(-4px) !important; }
.soc .gh .gh-body, .soc .gh .gh-arm { fill: none; stroke: currentColor; stroke-width: 16; stroke-linecap: round; stroke-linejoin: round; }
.soc.github:hover .gh-arm { transform-origin: bottom right; animation: moveArm 1s infinite alternate; }
@keyframes moveArm { 0% { transform: rotate(10deg); } 100% { transform: rotate(-10deg); } }
.soc.linkedin:hover .li rect { animation: rect-up 0.3s linear infinite; }
.soc.linkedin:hover .li circle { animation: bounce 0.4s linear infinite; }
@keyframes rect-up { 0% { y: 13px; height: 8px; } 50% { y: 10px; height: 11px; } }
@keyframes bounce { 0%, 50% { cy: 4px; } 75% { cy: 8px; } }

/* ---------- illustrations ---------- */
.page-head .wrap { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; align-items: center; }
.illo { width: 100%; max-height: 380px; object-fit: contain; filter: drop-shadow(0 30px 40px rgba(0, 0, 0, 0.35)); }
.illo-wrap { position: relative; }
.illo-wrap::before { content: ""; position: absolute; inset: 10%; background: radial-gradient(circle, var(--glow), transparent 65%); filter: blur(30px); opacity: 0.6; z-index: -1; }
@media (max-width: 860px) { .page-head .wrap { grid-template-columns: 1fr; } .illo { max-height: 260px; } }
.bike-li { display: none; }
@media (max-width: 960px) { .bike-li { display: block; text-align: center; order: 99; } .bike-li img { margin: 0 auto; width: 160px; height: auto; } }
.smiley { width: 100%; max-width: 380px; margin: 0 auto; }

/* ---------- loader: FULL (fresh visit) ---------- */
html.loading { overflow: hidden; }
html.ld-mini .loader { display: none; }
.loader { position: fixed; inset: 0; z-index: 9999; color: var(--text); }
.ld-p { position: absolute; left: 0; right: 0; height: 50.6%; background: var(--bg); transition: transform 1.05s cubic-bezier(0.76, 0, 0.24, 1); }
.ld-p.top { top: 0; } .ld-p.bot { bottom: 0; }
.loader.done .ld-p.top { transform: translateY(-101%); }
.loader.done .ld-p.bot { transform: translateY(101%); }
.ld-ui { position: absolute; inset: 0; display: grid; place-items: center; transition: opacity 0.45s, transform 0.9s var(--ease); }
.loader.done .ld-ui { opacity: 0; transform: scale(1.05); }
.ld-ui::before {
  content: ""; position: absolute; inset: 0; opacity: 0.4;
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px); background-size: 56px 56px;
  mask-image: radial-gradient(circle at 50% 50%, #000, transparent 62%); -webkit-mask-image: radial-gradient(circle at 50% 50%, #000, transparent 62%);
}
.ld-glow { position: absolute; width: min(620px, 90vw); aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, var(--glow), transparent 65%); filter: blur(30px); animation: ld-breathe 3.2s ease-in-out infinite; }
@keyframes ld-breathe { 50% { transform: scale(1.15); opacity: 0.7; } }

.ld-corner { position: absolute; font: 500 12px var(--font-body); letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 10px; opacity: 0; animation: ld-fade 0.8s 0.3s forwards; }
.ld-corner.tl { top: 30px; left: clamp(20px, 4vw, 48px); }
.ld-corner.tr { top: 30px; right: clamp(20px, 4vw, 48px); }
.ld-corner.bl { bottom: clamp(34px, 6vh, 62px); left: clamp(20px, 4vw, 48px); }
.ld-corner i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 0 0 var(--accent-2); animation: ping-ld 1.6s infinite; }
@keyframes ping-ld { 70% { box-shadow: 0 0 0 9px transparent; } }
@keyframes ld-fade { to { opacity: 1; } }

.ld-center { position: relative; display: grid; justify-items: center; gap: 26px; }
.ld-mono { width: min(210px, 50vw); overflow: visible; filter: drop-shadow(0 0 20px var(--glow)); }
.ld-mono path { fill: none; stroke: url(#ldg); stroke-width: 8; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: ld-draw 1.1s cubic-bezier(0.65, 0, 0.35, 1) forwards; }
.ld-mono .p1 { animation-delay: 0.2s; } .ld-mono .p2 { animation-delay: 0.75s; } .ld-mono .p3 { animation-delay: 1s; }
@keyframes ld-draw { to { stroke-dashoffset: 0; } }
.ld-role { position: relative; padding-top: 20px; font: 500 12px var(--font-body); letter-spacing: 0.34em; text-transform: uppercase; color: var(--muted); text-align: center; opacity: 0; animation: ld-fade 0.9s 1.3s forwards; }
.ld-role::before { content: ""; position: absolute; top: 0; left: 50%; width: 0; height: 1px; background: var(--grad); transform: translateX(-50%); animation: ld-rule 0.9s 1.3s var(--ease) forwards; }
@keyframes ld-rule { to { width: 64px; } }

.ld-count { position: absolute; right: clamp(20px, 4vw, 48px); bottom: clamp(30px, 5vh, 56px); display: flex; align-items: baseline; font: 700 clamp(56px, 10vw, 132px)/0.9 var(--font-display); letter-spacing: -0.05em; font-variant-numeric: tabular-nums; }
.ld-count b { font-weight: 700; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ld-count span { font-size: 0.28em; margin-left: 0.12em; letter-spacing: 0; color: var(--muted); font-weight: 500; }
.ld-line { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--border); }
.ld-line i { display: block; height: 100%; background: var(--grad); transform-origin: 0 50%; transform: scaleX(0); box-shadow: 0 0 14px var(--glow); }
@media (max-width: 560px) { .ld-corner.bl { display: none; } .ld-corner { letter-spacing: 0.14em; font-size: 11px; } }
@media (prefers-reduced-motion: reduce) { .ld-mono path { stroke-dashoffset: 0; } .ld-corner, .ld-role { opacity: 1; } }

/* ---------- loader: MINI (moving between pages) ---------- */
.mini-ld { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 10000; pointer-events: none; opacity: 0; transition: opacity 0.3s; }
.mini-ld.on { opacity: 1; }
.mini-ld i { display: block; height: 100%; background: var(--grad); transform-origin: 0 50%; transform: scaleX(0); box-shadow: 0 0 14px var(--glow), 0 0 4px var(--accent-2); transition: transform 0.55s var(--ease); border-radius: 0 3px 3px 0; }
.mini-pill { position: fixed; left: 50%; bottom: 26px; z-index: 10000; display: flex; align-items: center; gap: 10px; padding: 9px 16px; border-radius: 999px; font: 500 13px var(--font-body); color: var(--text); background: var(--nav-bg); border: 1px solid var(--border-strong); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: var(--shadow); transform: translate(-50%, 14px); opacity: 0; pointer-events: none; transition: opacity 0.3s, transform 0.4s var(--ease); }
.mini-pill.show { opacity: 1; transform: translate(-50%, 0); }
.mini-pill u { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--border-strong); border-top-color: var(--accent); animation: spin 0.7s linear infinite; }

/* ---------- tech-stack orbit ---------- */
.orbit { --ai: var(--accent); --cloud: var(--accent-2); --web: #f472b6; container-type: inline-size; position: relative; width: min(940px, 100%, calc(100vh - 120px)); min-width: min(100%, 360px); aspect-ratio: 1; margin: 10px auto 0; }
.o-core {
  position: absolute; left: 50%; top: 50%; width: 20cqw; height: 20cqw; transform: translate(-50%, -50%); border-radius: 50%;
  display: grid; place-content: center; text-align: center; padding: 8px; z-index: 2;
  background: radial-gradient(circle at 30% 25%, var(--surface-hover), var(--bg-2)); border: 1px solid var(--border-strong);
  box-shadow: 0 0 0 1px var(--border), 0 0 60px -10px var(--glow), inset 0 0 30px -12px var(--glow);
  animation: core-pulse 4s ease-in-out infinite;
}
@keyframes core-pulse { 50% { box-shadow: 0 0 0 1px var(--border), 0 0 90px -6px var(--glow), inset 0 0 40px -8px var(--glow); } }
.o-core b { font: 700 clamp(13px, 3.4cqw, 26px)/1.15 var(--font-display); letter-spacing: -0.02em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.o-core small { font-size: clamp(9px, 1.6cqw, 13px); color: var(--muted); margin-top: 4px; }
.orbit.hold .o-core b { color: var(--text); background: none; -webkit-text-fill-color: currentColor; }

.ring { position: absolute; left: 50%; top: 50%; width: 0; height: 0; --sz: clamp(34px, 8.4cqw, 70px); animation: spin var(--t) linear infinite var(--d1, normal); transition: opacity 0.4s; }
.ring::before { pointer-events: none; content: ""; position: absolute; width: calc(var(--r) * 2); height: calc(var(--r) * 2); left: calc(var(--r) * -1); top: calc(var(--r) * -1); border-radius: 50%; border: 1px dashed color-mix(in srgb, var(--c) 40%, transparent); }
.r1 { --r: 17.5cqw; --t: 34s; --c: var(--ai); --d2: reverse; }
.r2 { --r: 30cqw; --t: 52s; --c: var(--cloud); --d1: reverse; --d2: normal; }
.r3 { --r: 42.5cqw; --t: 74s; --c: var(--web); --d2: reverse; }
.o-item {
  position: absolute; left: 0; top: 0; width: var(--sz); height: var(--sz); margin: calc(var(--sz) / -2); padding: 0; border: 0; background: none; cursor: pointer;
  transform: rotate(var(--a)) translateX(var(--r)) rotate(calc(var(--a) * -1));
}
.o-in { display: block; width: 100%; height: 100%; animation: spin var(--t) linear infinite var(--d2); }
.o-chip {
  display: grid; place-items: center; width: 100%; height: 100%; border-radius: 28%; background: #fff; padding: 20%;
  border: 2px solid color-mix(in srgb, var(--c) 55%, transparent); box-shadow: 0 8px 24px -8px color-mix(in srgb, var(--c) 70%, transparent);
  animation: chip-in 0.9s var(--ease) backwards; animation-delay: calc(0.3s + var(--a) / 360deg * 0.6s);
  transition: transform 0.35s var(--ease), box-shadow 0.3s;
}
.o-chip img { width: 100%; height: 100%; object-fit: contain; }
@keyframes chip-in { from { opacity: 0; transform: scale(0.2); } }
.o-item:hover .o-chip, .o-item:focus-visible .o-chip { transform: scale(1.35); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 35%, transparent), 0 14px 34px -6px var(--c); }
.o-item:hover, .o-item:focus-visible { z-index: 5; }
.orbit:hover .ring, .orbit:hover .o-in, .orbit:focus-within .ring, .orbit:focus-within .o-in { animation-play-state: paused; }
.orbit[data-focus="ai"] .ring:not(.focus), .orbit[data-focus="cloud"] .ring:not(.focus), .orbit[data-focus="web"] .ring:not(.focus) { opacity: 0.18; }
.ring.focus::before { border-style: solid; }

.orbit-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 30px; }
.lg { display: inline-flex; align-items: center; gap: 10px; padding: 9px 18px; border-radius: 999px; font: 500 14px var(--font-body); color: var(--text); background: var(--surface); border: 1px solid var(--border); cursor: pointer; transition: border-color 0.2s, transform 0.3s var(--ease); }
.lg:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.lg i { width: 10px; height: 10px; border-radius: 50%; background: var(--dot); box-shadow: 0 0 12px var(--dot); }
.lg-ai { --dot: var(--accent); } .lg-cloud { --dot: var(--accent-2); } .lg-web { --dot: #f472b6; }
.orbit-hint { text-align: center; color: var(--muted); font-size: 14px; margin-top: 14px; }
@media (hover: none) { .orbit-hint { display: none; } }

/* repeat visits: same loader, faster */
.loader.quick .ld-mark, .loader.quick .ld-name span, .loader.quick .ld-role, .loader.quick .ld-bar, .loader.quick .ld-pct { animation-duration: 0.45s; animation-delay: 0s; }
.loader.quick .ld-name span:nth-child(2) { animation-delay: 0.06s; }
.loader.quick.done { transition-duration: 0.7s; }

/* every logo gets its own name tooltip (stays upright because it lives inside the counter-rotating layer) */
.o-in { position: relative; }
.o-in::after {
  content: attr(data-name); position: absolute; left: 50%; bottom: calc(100% + 16px); transform: translate(-50%, 6px);
  padding: 6px 12px; border-radius: 10px; font: 600 13px var(--font-body); white-space: nowrap; color: var(--text);
  background: var(--bg-2); border: 1px solid var(--border-strong); box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.3s var(--ease); z-index: 20;
}
.o-item:hover .o-in::after, .o-item:focus-visible .o-in::after { opacity: 1; transform: translate(-50%, 0); }
.ring:has(.o-item:hover), .ring:has(.o-item:focus-visible) { z-index: 6; }
.o-item:focus-visible { outline: none; }
.o-item:focus-visible .o-chip { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (max-width: 520px) { .o-in::after { font-size: 11px; padding: 4px 8px; } }

/* ---------- grouped roles (promotion) ---------- */
.roles { list-style: none; margin: 22px 0 0; padding: 0 0 0 22px; position: relative; display: grid; gap: 22px; }
.roles::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; background: linear-gradient(var(--accent-2), var(--border-strong)); }
.roles > li { position: relative; }
.roles > li::before { content: ""; position: absolute; left: -22px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); border: 2px solid var(--border-strong); }
.roles > li.current::before { border-color: var(--accent-2); background: var(--accent-2); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-2) 25%, transparent), 0 0 14px var(--accent-2); animation: ping-dot 2.4s infinite; }
@keyframes ping-dot { 50% { box-shadow: 0 0 0 7px transparent, 0 0 14px var(--accent-2); } }
.r-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.r-head h4 { font-size: 18px; }
.badge { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; color: #052e16; background: #4ade80; }
.r-time { margin-left: auto; font-size: 13px; color: var(--muted); white-space: nowrap; }
.roles ul { margin: 10px 0 0; padding-left: 18px; color: var(--muted); font-size: 15px; display: grid; gap: 6px; }
.roles ul li::marker { color: var(--accent); }
@media (max-width: 520px) { .r-time { margin-left: 0; } }

/* ---------- home hero: animated developer illustration ---------- */
.hero-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
.hero-art-wrap { justify-self: center; width: 100%; max-width: 600px; }
.hero-art { display: block; width: 100%; height: auto; overflow: visible; --px: 0; --py: 0; }
.ha-par { transform: translate(calc(var(--px) * var(--k) * 1px), calc(var(--py) * var(--k) * 1px)); transition: transform 0.4s var(--ease); }
.ha-card { fill: var(--bg-2); fill-opacity: 0.92; stroke: var(--border-strong); stroke-width: 1.2; filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.28)); }
.ha-fl { animation: ha-float 6s ease-in-out infinite; }
.ha-fl.f2 { animation-duration: 7.2s; animation-delay: -2s; }
.ha-fl.f3 { animation-duration: 5.6s; animation-delay: -4s; }
@keyframes ha-float { 50% { transform: translateY(-10px); } }

.ha-ring { transform-box: view-box; transform-origin: 260px 250px; animation: spin 40s linear infinite; }
.ha-orbit { fill: none; stroke: var(--border-strong); stroke-width: 1.5; stroke-dasharray: 3 7; }
.ha-dot { filter: drop-shadow(0 0 6px currentColor); }
.ha-dot.d1 { fill: var(--accent); color: var(--accent); }
.ha-dot.d2 { fill: var(--accent-2); color: var(--accent-2); }
.ha-dot.d3 { fill: #f472b6; color: #f472b6; }

.ha-bob { transform-box: view-box; transform-origin: 260px 392px; animation: ha-bob 4.2s ease-in-out infinite; }
@keyframes ha-bob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-4px) rotate(1.6deg); } }
.ha-eye { fill: #1b1b26; transform-box: fill-box; transform-origin: center; animation: ha-blink 5s infinite; }
@keyframes ha-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(0.1); } }
.ha-brow, .ha-smile { fill: none; stroke: #1b1b26; stroke-width: 3; stroke-linecap: round; }
.ha-smile { stroke: #8a4b33; }
.ha-band { fill: none; stroke: #23233a; stroke-width: 10; stroke-linecap: round; }
.ha-led { fill: var(--accent-2); animation: ha-led 1.6s ease-in-out infinite; }
.ha-led.l2 { animation-delay: 0.8s; }
@keyframes ha-led { 50% { opacity: 0.25; } }
.ha-str { fill: none; stroke: #c4b5fd; stroke-width: 3; stroke-linecap: round; }
.ha-badge { font: 700 14px var(--font-display); fill: #fff; text-anchor: middle; }
.ha-badge.dark { fill: #04222a; }

.ha-mono { font: 500 10.5px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.ha-acc { fill: var(--accent); } .ha-mut { fill: var(--muted); } .ha-ok { fill: #4ade80; } .ha-t { fill: var(--text); }
.ln { animation: ha-line 8s ease-in-out infinite; }
.ln.l2 { animation-delay: 0.9s; } .ln.l3 { animation-delay: 1.8s; }
@keyframes ha-line { 0% { opacity: 0; } 8%, 86% { opacity: 1; } 96%, 100% { opacity: 0; } }
.ha-cursor { fill: var(--accent); animation: blink 1s steps(1) infinite; }

.ha-track { stroke: var(--border-strong); stroke-width: 3; stroke-linecap: round; }
.ha-flow { stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 6 8; animation: ha-dash 1s linear infinite; }
@keyframes ha-dash { to { stroke-dashoffset: -14; } }
.ha-node { fill: var(--bg-2); stroke: var(--accent); stroke-width: 3; animation: ha-node 4.5s ease-in-out infinite; }
.ha-node.n2 { animation-delay: 1.5s; } .ha-node.n3 { animation-delay: 3s; }
@keyframes ha-node { 0%, 100% { fill: var(--bg-2); stroke: var(--accent); } 20%, 65% { fill: #4ade80; stroke: #4ade80; } }
.ha-packet { fill: var(--accent-2); filter: drop-shadow(0 0 5px var(--accent-2)); animation: ha-packet 4.5s ease-in-out infinite; }
@keyframes ha-packet { from { transform: translateX(0); } to { transform: translateX(126px); } }

.ha-bar { fill: var(--accent); transform-box: fill-box; transform-origin: 50% 100%; animation: ha-bar 3.2s ease-in-out infinite; transform: scaleY(var(--s, 1)); }
.ha-bar.b1 { --s: 0.5; } .ha-bar.b2 { --s: 0.8; animation-delay: -0.5s; } .ha-bar.b3 { --s: 0.62; animation-delay: -1s; }
.ha-bar.b4 { --s: 1; fill: var(--accent-2); animation-delay: -1.5s; } .ha-bar.b5 { --s: 0.76; animation-delay: -2s; }
@keyframes ha-bar { 50% { transform: scaleY(calc(var(--s) * 0.55)); } }
.ha-cloud { fill: var(--accent-2); }
.ha-up { fill: none; stroke: #fff; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; animation: ha-up 2s ease-in-out infinite; }
@keyframes ha-up { 0%, 100% { transform: translateY(2px); opacity: 0.6; } 50% { transform: translateY(-4px); opacity: 1; } }

/* heading: words rise in once the loader lifts */
.hero h1 .h-w { display: inline-block; overflow: hidden; vertical-align: top; padding: 0 0.04em 0.14em; margin: 0 -0.04em -0.14em; }
.hero h1 .h-w > span { display: inline-block; transform: translateY(115%); }
html:not(.loading) .hero h1 .h-w > span { animation: h-rise 1s var(--ease) forwards; animation-delay: calc(var(--i) * 90ms + 150ms); }
@keyframes h-rise { to { transform: none; } }
.hero h1 .grad-text { background-size: 220% 100%; animation: grad-shift 7s ease-in-out infinite alternate; }
html:not(.loading) .hero h1 .h-w > .grad-text { animation: h-rise 1s var(--ease) forwards, grad-shift 7s ease-in-out infinite alternate; animation-delay: calc(var(--i) * 90ms + 150ms), 0s; }
@keyframes grad-shift { to { background-position: 100% 0; } }

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art-wrap { order: -1; max-width: 440px; }
}

/* ---------- contact page v2 ---------- */
.contact-grid { grid-template-columns: 0.8fr 1.2fr; gap: 26px; }
.avail { padding: 24px; display: grid; gap: 14px; }
.avail:hover, .form-wrap:hover { transform: none; }
.avail h2 { font-size: 20px; }
.info-card { transition: transform 0.45s var(--ease), border-color 0.3s, background 0.3s, box-shadow 0.4s; }
.info-go { margin-left: auto; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--border-strong); color: var(--muted); transition: transform 0.4s var(--ease), background 0.3s, color 0.3s; }
.info-go svg { width: 14px; height: 14px; }
.info-card:hover .info-go { background: var(--grad); color: var(--accent-ink); border-color: transparent; transform: rotate(-45deg); }

.form-wrap { position: relative; padding: clamp(22px, 4vw, 38px); overflow: hidden; min-height: 460px; }
.cform { display: grid; gap: 28px; transition: opacity 0.4s, transform 0.6s var(--ease), visibility 0.4s; }
.form-wrap.is-sent .cform { opacity: 0; transform: translateY(-18px) scale(0.98); visibility: hidden; pointer-events: none; }

.topics { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.topics-label { width: 100%; font-size: 13px; color: var(--muted); font-weight: 500; margin-bottom: 2px; }
.topic { font: 500 13px var(--font-body); color: var(--muted); background: transparent; border: 1px solid var(--border-strong); border-radius: 999px; padding: 7px 14px; cursor: pointer; transition: color 0.2s, background 0.25s, border-color 0.2s, transform 0.3s var(--ease); }
.topic:hover { color: var(--text); transform: translateY(-2px); }
.topic.active { color: var(--accent-ink); background: var(--grad); border-color: transparent; }

.fl-field { position: relative; }
.fl-field input, .fl-field textarea {
  width: 100%; display: block; font: 400 16px var(--font-body); color: var(--text); caret-color: var(--accent);
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 26px 16px 10px; resize: none;
  transition: border-color 0.25s, box-shadow 0.3s, background 0.3s;
}
.fl-field textarea { min-height: 150px; padding-bottom: 30px; line-height: 1.6; overflow-y: auto; }
.fl-field label {
  position: absolute; left: 17px; top: 17px; color: var(--muted); font-size: 16px; pointer-events: none; transform-origin: left top;
  transition: transform 0.3s var(--ease), color 0.25s;
}
.fl-field input:focus + label, .fl-field input:not(:placeholder-shown) + label,
.fl-field textarea:focus + label, .fl-field textarea:not(:placeholder-shown) + label { transform: translateY(-11px) scale(0.76); }
.fl-field input:focus + label, .fl-field textarea:focus + label { color: var(--accent); }
.fl-field input:focus, .fl-field textarea:focus { outline: none; border-color: var(--accent); background: var(--surface-hover); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent); }
.fl-field input:-webkit-autofill { -webkit-text-fill-color: var(--text); box-shadow: 0 0 0 40px var(--bg-2) inset; }
.fl-bar { position: absolute; left: 12px; right: 12px; bottom: 0; height: 2px; border-radius: 2px; background: var(--grad); transform: scaleX(0); transition: transform 0.45s var(--ease); pointer-events: none; }
.fl-field:focus-within .fl-bar { transform: scaleX(1); }
.fl-err { position: absolute; left: 3px; top: calc(100% + 5px); font-size: 13px; line-height: 1.3; color: #f87171; opacity: 0; transform: translateY(-4px); transition: opacity 0.3s, transform 0.4s var(--ease); pointer-events: none; }
.fl-field.bad .fl-err { opacity: 1; transform: none; }
.fl-field.bad input, .fl-field.bad textarea { border-color: #f87171; }
.fl-field.bad:focus-within input, .fl-field.bad:focus-within textarea { box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.18); }
.fl-field.shake { animation: shake 0.4s; }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.count { position: absolute; right: 14px; bottom: 12px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; pointer-events: none; }
.count b { font-weight: 600; color: var(--text); }
.fl-field.ta.bad { margin-bottom: 6px; }

.form-foot { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.send { position: relative; overflow: hidden; min-width: 190px; justify-content: center; }
.send::after { content: ""; position: absolute; top: 0; bottom: 0; width: 60px; left: -80px; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.45), transparent); transform: skewX(-20deg); }
.send:hover::after { animation: shine 0.9s var(--ease); }
@keyframes shine { to { left: calc(100% + 40px); } }
.send .s-spin { position: absolute; width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid color-mix(in srgb, var(--accent-ink) 30%, transparent); border-top-color: var(--accent-ink); opacity: 0; animation: spin 0.7s linear infinite; }
.send .s-label { display: inline-flex; align-items: center; gap: 10px; transition: opacity 0.2s, transform 0.3s var(--ease); }
.send.loading .s-label { opacity: 0; transform: translateY(8px); }
.send.loading .s-spin { opacity: 1; }
.send.loading::after { display: none; }
.form-msg { font-size: 14px; min-height: 1.4em; }
.form-msg.err { color: #f87171; }
.form-msg a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* success state */
.sent { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; text-align: center; gap: 14px; padding: 30px; opacity: 0; visibility: hidden; transform: translateY(22px) scale(0.98); transition: opacity 0.5s 0.15s, transform 0.7s 0.15s var(--ease), visibility 0.5s 0.15s; }
.form-wrap.is-sent .sent { opacity: 1; visibility: visible; transform: none; }
.sent h3 { font-size: clamp(26px, 4vw, 36px); }
.sent p { color: var(--muted); max-width: 360px; }
.sent p b { color: var(--text); }
.sent-check { width: 92px; height: 92px; filter: drop-shadow(0 0 18px color-mix(in srgb, #4ade80 55%, transparent)); }
.sent-check circle, .sent-check path { fill: none; stroke: #4ade80; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.form-wrap.is-sent .sent-check circle { animation: ld-draw 0.8s 0.25s var(--ease) forwards; }
.form-wrap.is-sent .sent-check path { animation: ld-draw 0.5s 0.8s var(--ease) forwards; }

@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } .form-wrap { min-height: 0; } .sent { position: relative; display: none; padding: 20px 0; } .form-wrap.is-sent .sent { display: grid; } .form-wrap.is-sent .cform { display: none; } }
@media (prefers-reduced-motion: reduce) { .sent-check circle, .sent-check path { stroke-dashoffset: 0; } }

/* ---------- support page ---------- */
.support-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; align-items: start; }
.pay-card, .msg-card { padding: clamp(22px, 4vw, 36px); }
.pay-card:hover, .msg-card:hover { transform: none; }
.pay-card h2, .msg-card h2 { font-size: 28px; }
.sub { color: var(--muted); font-size: 15px; margin: 8px 0 24px; }

.seg { position: relative; display: inline-grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--border); margin-bottom: 26px; }
.seg .thumb { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 999px; background: var(--grad); transition: transform 0.5s var(--ease); box-shadow: 0 8px 20px -8px var(--glow); }
.seg button { position: relative; z-index: 1; border: 0; background: none; font: 600 14px var(--font-body); padding: 9px 22px; border-radius: 999px; cursor: pointer; color: var(--muted); transition: color 0.3s; }
.seg button[aria-selected="true"] { color: var(--accent-ink); }

.panel { display: none; }
.panel.on { display: block; animation: panel-in 0.55s var(--ease); }
@keyframes panel-in { from { opacity: 0; transform: translateY(14px); } }

.qr-frame { position: relative; width: min(290px, 100%); margin: 0 auto; padding: 18px; background: #fff; border-radius: 24px; box-shadow: 0 24px 60px -24px var(--glow), 0 0 0 1px var(--border); }
.qr-frame img { width: 100%; height: auto; display: block; border-radius: 10px; }
.qr-scan { position: absolute; left: 18px; right: 18px; top: 8%; height: 3px; border-radius: 3px; background: var(--grad); box-shadow: 0 0 18px 4px var(--glow); animation: qr-scan 3.2s ease-in-out infinite; pointer-events: none; }
@keyframes qr-scan { 0%, 100% { top: 7%; } 50% { top: 91%; } }
.qr-frame i { position: absolute; width: 22px; height: 22px; border: 3px solid var(--accent); pointer-events: none; }
.qr-frame .c1 { top: 6px; left: 6px; border-right: 0; border-bottom: 0; border-radius: 10px 0 0 0; }
.qr-frame .c2 { top: 6px; right: 6px; border-left: 0; border-bottom: 0; border-radius: 0 10px 0 0; }
.qr-frame .c3 { bottom: 6px; left: 6px; border-right: 0; border-top: 0; border-radius: 0 0 0 10px; }
.qr-frame .c4 { bottom: 6px; right: 6px; border-left: 0; border-top: 0; border-radius: 0 0 10px 0; }
.qr-hint { text-align: center; color: var(--muted); font-size: 14px; margin-top: 18px; }
.dl { display: block; width: max-content; margin: 10px auto 0; font-size: 14px; font-weight: 600; color: var(--accent); text-underline-offset: 4px; }
.dl:hover { text-decoration: underline; }

.steps { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 12px; }
.steps li { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--bg-2); border: 1px solid var(--border); font-size: 15px; }
.steps b { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--grad); color: var(--accent-ink); font: 700 13px var(--font-display); }
.app-btn { width: 100%; justify-content: center; }
.hint { margin-top: 16px; font-size: 14px; color: var(--muted); text-align: center; }
.hint b { color: var(--text); }

.pay-meta { text-align: center; margin-top: 28px; padding-top: 24px; border-top: 1px dashed var(--border-strong); }
.pay-meta small { display: block; color: var(--muted); font-size: 13px; }
.pay-meta b { font: 600 20px var(--font-display); }
.upi-chip { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 16px; padding: 8px 8px 8px 20px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--border-strong); font: 500 15px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow: hidden; }
.upi-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copy-btn { flex: none; border: 0; cursor: pointer; font: 600 14px var(--font-body); padding: 10px 20px; border-radius: 999px; color: var(--accent-ink); background: var(--grad); transition: transform 0.3s var(--ease), background 0.3s; }
.copy-btn:hover { transform: scale(1.05); }
.copy-btn.done { background: #4ade80; color: #052e16; }

@keyframes shimmer { to { background-position: -200% 0; } }

.alt-pay { margin-top: 26px; padding: 24px 30px; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.alt-pay:hover { transform: none; }
.alt-pay h3 { font-size: 22px; }
.alt-pay p { color: var(--muted); font-size: 15px; margin-top: 4px; }

.toast { position: fixed; left: 50%; bottom: 28px; z-index: 10001; padding: 11px 20px; border-radius: 999px; font: 500 14px var(--font-body); color: var(--text); background: var(--bg-2); border: 1px solid var(--border-strong); box-shadow: var(--shadow); opacity: 0; transform: translate(-50%, 16px); pointer-events: none; transition: opacity 0.3s, transform 0.45s var(--ease); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.modal { position: fixed; inset: 0; z-index: 10002; display: grid; place-items: center; padding: 20px; background: rgba(5, 5, 12, 0.6); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); opacity: 0; visibility: hidden; transition: opacity 0.35s, visibility 0.35s; }
.modal.open { opacity: 1; visibility: visible; }
.modal-box { width: min(420px, 100%); padding: 38px 30px; text-align: center; display: grid; justify-items: center; gap: 12px; transform: translateY(20px) scale(0.96); transition: transform 0.6s var(--ease); background: var(--bg-2); }
.modal-box:hover { transform: translateY(20px) scale(0.96); }
.modal.open .modal-box, .modal.open .modal-box:hover { transform: none; }
.modal-box p { color: var(--muted); }
.modal.open .sent-check circle { animation: ld-draw 0.8s 0.3s var(--ease) forwards; }
.modal.open .sent-check path { animation: ld-draw 0.5s 0.85s var(--ease) forwards; }

@media (max-width: 860px) { .support-grid { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .qr-scan { display: none; } }

.dd.active > button { color: var(--text); background: var(--surface-hover); box-shadow: inset 0 0 0 1px var(--border-strong); }
.dd-menu a[aria-current="page"] { color: var(--accent); }

/* ---------- 404 ---------- */
.nf { min-height: calc(100vh - 220px); display: grid; align-items: center; text-align: center; }
.nf .wrap { display: grid; justify-items: center; gap: 4px; }
.nf-art { display: flex; align-items: center; justify-content: center; gap: clamp(8px, 2vw, 22px); margin-bottom: 18px; font: 700 clamp(110px, 22vw, 230px)/1 var(--font-display); letter-spacing: -0.06em; }
.nf-art span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 12px 40px var(--glow)); animation: ha-float 5s ease-in-out infinite; }
.nf-art span:last-child { animation-delay: -2.5s; }
.nf-orb { width: clamp(80px, 16vw, 170px); aspect-ratio: 1; border-radius: 50%; position: relative; background: radial-gradient(circle at 32% 28%, #fff, var(--accent) 40%, #2a1d8f); box-shadow: 0 0 70px 6px var(--glow); animation: ha-float 4s ease-in-out infinite; }
.nf-orb::after { content: ""; position: absolute; inset: -14%; border-radius: 50%; border: 1px dashed var(--border-strong); animation: spin 18s linear infinite; }
.nf h1 { font-size: clamp(32px, 5vw, 56px); margin: 10px 0 14px; letter-spacing: -0.03em; }
.nf p { color: var(--muted); max-width: 480px; font-size: 18px; }
.nf .cta { justify-content: center; }

/* ---------- SEO / accessibility helpers ---------- */
.nav-wrap { display: contents; }
.skip { position: fixed; left: 16px; top: -60px; z-index: 10005; padding: 10px 18px; border-radius: 999px; background: var(--grad); color: var(--accent-ink); font-weight: 600; transition: top 0.25s var(--ease); }
.skip:focus { top: 14px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
html.ld-none .loader { display: none; }
html.ld-none .reveal { opacity: 1; transform: none; transition: none; }
html.ld-none .hero h1 .h-w > span { transform: none; animation: none; }

/* support message form */
.form-msg.ok { color: #4ade80; }

/* ---------- support form v2 ---------- */
.msg-card { position: relative; overflow: hidden; }
.mform { display: grid; gap: 22px; transition: opacity 0.4s, transform 0.6s var(--ease); }
.msg-card.is-sent .mform { display: none; }
.mf-group { display: grid; gap: 10px; }
.mf-label { font-size: 13px; font-weight: 500; color: var(--muted); }
.mf-label em { font-style: normal; opacity: 0.7; }
.mf-note { margin: -10px 0 0; font-size: 13px; color: var(--muted); }

.kinds { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.kind { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--bg-2); color: var(--text); font: 500 14px var(--font-body); text-align: left; cursor: pointer; transition: border-color 0.25s, background 0.25s, transform 0.3s var(--ease), box-shadow 0.3s; }
.kind b { font-size: 20px; line-height: 1; transition: transform 0.4s var(--ease); }
.kind:hover { transform: translateY(-2px); }
.kind:hover b { transform: scale(1.2) rotate(-6deg); }
.kind.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--bg-2)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }

.collapse { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows 0.55s var(--ease), opacity 0.4s; }
.collapse.open { grid-template-rows: 1fr; opacity: 1; }
.collapse-in { overflow: hidden; display: grid; gap: 18px; margin: -4px; padding: 4px; }
.amts { display: flex; flex-wrap: wrap; gap: 8px; }
.amt { font: 600 14px var(--font-body); padding: 8px 16px; border-radius: 999px; cursor: pointer; color: var(--text); background: var(--bg-2); border: 1px solid var(--border-strong); transition: background 0.25s, color 0.25s, transform 0.3s var(--ease), border-color 0.25s; }
.amt:hover { transform: translateY(-2px); }
.amt.on { background: var(--grad); color: var(--accent-ink); border-color: transparent; }

.rate { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rt { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--bg-2); cursor: pointer; font-size: 22px; transition: transform 0.4s var(--ease), background 0.25s, border-color 0.25s, opacity 0.3s, filter 0.3s; }
.rt span { display: block; transition: transform 0.4s var(--ease); }
.rt:hover { transform: translateY(-3px); }
.rt:hover span { transform: scale(1.2); }
.rt.on { background: color-mix(in srgb, var(--accent) 20%, var(--bg-2)); border-color: var(--accent); transform: scale(1.12); box-shadow: 0 8px 22px -8px var(--glow); }
.rt.on span { animation: rt-pop 0.5s var(--ease); }
.rt.dim { opacity: 0.45; filter: grayscale(0.7); }
@keyframes rt-pop { 40% { transform: scale(1.5) rotate(-12deg); } }
.rate-txt { font-size: 14px; font-weight: 600; color: var(--accent); margin-left: 6px; min-width: 90px; }

.m-sent { display: none; place-content: center; justify-items: center; text-align: center; gap: 14px; padding: 40px 10px; min-height: 380px; }
.msg-card.is-sent .m-sent { display: grid; animation: panel-in 0.6s var(--ease); }
.m-sent h3 { font-size: clamp(24px, 3.6vw, 32px); }
.m-sent p { color: var(--muted); max-width: 340px; }
.msg-card.is-sent .sent-check circle { animation: ld-draw 0.8s 0.2s var(--ease) forwards; }
.msg-card.is-sent .sent-check path { animation: ld-draw 0.5s 0.75s var(--ease) forwards; }
@media (max-width: 520px) { .kinds { grid-template-columns: 1fr; } .rt { width: 42px; height: 42px; } }
@media (prefers-reduced-motion: reduce) { .msg-card.is-sent .sent-check circle, .msg-card.is-sent .sent-check path { stroke-dashoffset: 0; } }
.mform .send { min-width: 170px; }

/* contact form: adaptive details + reply preference */
.cform .collapse-in { gap: 22px; }
.cform .rp { font-weight: 500; }

/* hidden collapsible fields must not leave a gap behind */
.cform > .collapse, .mform > .collapse { transition: grid-template-rows 0.55s var(--ease), opacity 0.4s, margin 0.55s var(--ease); }
.cform > .collapse:not(.open) { margin-bottom: -28px; }
.mform > .collapse:not(.open) { margin-bottom: -22px; }
.cform, .mform { display: flex; flex-direction: column; }

.footer .copy { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.heart { display: inline-block; color: #f472b6; animation: heartbeat 2.4s ease-in-out infinite; }
@keyframes heartbeat { 0%, 60%, 100% { transform: scale(1); } 70% { transform: scale(1.3); } 80% { transform: scale(1); } 90% { transform: scale(1.2); } }

/* ---------- contact: one question at a time ---------- */
.wz { gap: 26px; }
.wz-top { display: flex; align-items: center; gap: 14px; }
.wz-bar { flex: 1; height: 4px; border-radius: 4px; background: var(--border); overflow: hidden; }
.wz-bar i { display: block; height: 100%; width: 20%; border-radius: inherit; background: var(--grad); transition: width 0.7s var(--ease); }
.wz-count { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.wz-back { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 50%; cursor: pointer; color: var(--text); background: var(--bg-2); border: 1px solid var(--border-strong); transition: transform 0.35s var(--ease), border-color 0.2s; animation: wz-pop 0.45s var(--ease); }
.wz-back[hidden] { display: none; }
.wz-back:hover { transform: translateX(-3px); border-color: var(--accent); }
.wz-back svg { width: 16px; height: 16px; }
@keyframes wz-pop { from { opacity: 0; transform: scale(0.5); } }

.wz-stage { position: relative; transition: height 0.6s var(--ease); }
.step {
  position: absolute; left: 0; right: 0; top: 0; padding: 0; display: flex; flex-direction: column; gap: 22px;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.3s, transform 0.6s var(--ease), visibility 0s 0.6s;
}
.step.before { transform: translateX(-46px); }
.step.after { transform: translateX(46px); }
.step.active { opacity: 1; visibility: visible; pointer-events: auto; transform: none; transition: opacity 0.45s 0.12s, transform 0.65s 0.08s var(--ease), visibility 0s; }
.step.active > * { animation: wz-in 0.6s var(--ease) both; }
.step.active > :nth-child(2) { animation-delay: 0.07s; }
.step.active > :nth-child(3) { animation-delay: 0.14s; }
.step.active > :nth-child(4) { animation-delay: 0.21s; }
@keyframes wz-in { from { opacity: 0; transform: translateY(16px); } }
.wz-q { font-size: clamp(22px, 3.2vw, 30px); letter-spacing: -0.02em; }
.wz-s { margin: -14px 0 0; color: var(--muted); font-size: 15px; }
.step > .collapse:not(.open) { margin-bottom: -22px; }
.step > .collapse { transition: grid-template-rows 0.55s var(--ease), opacity 0.4s, margin 0.55s var(--ease); }

.wz-nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.wz-nav .btn[hidden] { display: none; }
.wz-nav .btn { min-width: 170px; justify-content: center; }
@media (prefers-reduced-motion: reduce) { .step, .step.active { transition-duration: 0.01ms; } .step.active > * { animation: none; } }

.about-p { max-width: 760px; color: var(--muted); font-size: clamp(17px, 2vw, 20px); line-height: 1.75; }
.about-p a { color: var(--text); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 4px; transition: color 0.2s; }
.about-p a:hover { color: var(--accent); }

/* ================================================================
   Case-study article (okf-rag-case-study.html)
   Same tokens as the rest of the site; blue/navy accent scoped to this page.
   ================================================================ */
html.post-page[data-theme="light"] {
  --bg: #fbfcfe; --bg-2: #ffffff; --surface: #ffffff; --surface-hover: #ffffff;
  --text: #0f172a; --muted: #475569; --border: rgba(15, 23, 42, 0.1); --border-strong: rgba(15, 23, 42, 0.2);
  --accent: #1d4ed8; --accent-2: #0369a1; --accent-ink: #ffffff; --glow: rgba(29, 78, 216, 0.22);
  --grad: linear-gradient(120deg, #1e3a8a 0%, #1d4ed8 55%, #0284c7 100%);
  --nav-bg: rgba(255, 255, 255, 0.82); --shadow: 0 24px 50px -28px rgba(15, 23, 42, 0.35);
}
html.post-page[data-theme="dark"] {
  --bg: #070d1c; --bg-2: #0d1630; --accent: #60a5fa; --accent-2: #38bdf8; --accent-ink: #06142e; --glow: rgba(96, 165, 250, 0.3);
  --grad: linear-gradient(120deg, #93c5fd 0%, #60a5fa 55%, #38bdf8 100%);
}
.post-page .ambient i { opacity: 0.1; }
.post-page .ambient::before { opacity: 0.18; }
.post-page .cursor-glow { display: none; }

/* ---------- header ---------- */
.post-hero { padding-block: 24px 20px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; color: var(--muted); margin-bottom: 26px; }
.crumbs a { transition: color 0.2s; } .crumbs a:hover { color: var(--accent); }
.crumbs span[aria-hidden] { opacity: 0.5; }
.post-hero .eyebrow { margin-bottom: 18px; }
.post-hero h1 { font-size: clamp(34px, 5.6vw, 62px); letter-spacing: -0.035em; line-height: 1.06; max-width: 920px; }
.post-hero .sub { font-size: clamp(18px, 2.1vw, 23px); color: var(--muted); max-width: 760px; margin-top: 22px; line-height: 1.55; }
.post-meta { display: flex; flex-wrap: wrap; gap: 10px 26px; margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--border); font-size: 14px; color: var(--muted); }
.post-meta b { display: block; font-size: 12px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text); opacity: 0.7; margin-bottom: 2px; }
.post-cover { margin: 36px 0 0; border-radius: 22px; overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow); background: #0a1230; }
.post-cover img { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; }
.post-cover figcaption { padding: 12px 18px; font-size: 13px; color: #94a3b8; background: #070d1c; }

/* ---------- layout ---------- */
.post-layout { display: grid; grid-template-columns: 220px minmax(0, 720px); gap: 72px; justify-content: center; padding-block: 56px 20px; }
.toc { position: sticky; top: 110px; align-self: start; max-height: calc(100vh - 140px); overflow: auto; font-size: 14px; }
.toc .toc-title { font: 600 12px var(--font-body); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; border-left: 1px solid var(--border-strong); counter-reset: t; }
.toc a { display: block; padding: 7px 0 7px 16px; margin-left: -1px; border-left: 2px solid transparent; color: var(--muted); transition: color 0.2s, border-color 0.2s; line-height: 1.35; }
.toc a:hover { color: var(--text); }
.toc a.on { color: var(--accent); border-left-color: var(--accent); font-weight: 600; }
.toc-m { display: none; margin-bottom: 36px; border: 1px solid var(--border-strong); border-radius: 14px; background: var(--surface); }
.toc-m summary { cursor: pointer; padding: 14px 18px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.toc-m summary::after { content: "+"; font-size: 20px; color: var(--accent); transition: transform 0.3s var(--ease); }
.toc-m[open] summary::after { transform: rotate(45deg); }
.toc-m ol { margin: 0; padding: 0 18px 16px 38px; display: grid; gap: 8px; color: var(--muted); }
.toc-m a:hover { color: var(--accent); }

/* ---------- prose ---------- */
.prose { font-size: 18.5px; line-height: 1.82; color: var(--text); counter-reset: sec; }
.prose > * + * { margin-top: 1.25em; }
.prose p { margin: 0; }
.prose p + p { margin-top: 1.25em; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.prose em { font-style: italic; } .prose strong, .prose b { font-weight: 600; }
.lede { font-size: clamp(20px, 2.4vw, 23px); line-height: 1.65; color: var(--text); }
.prose h2 { counter-increment: sec; font-size: clamp(27px, 3.4vw, 36px); letter-spacing: -0.025em; margin-top: 2.5em; padding-top: 1.1em; border-top: 1px solid var(--border-strong); scroll-margin-top: 110px; line-height: 1.2; }
.prose h2::before { content: counter(sec, decimal-leading-zero); display: block; font: 600 13px var(--font-body); letter-spacing: 0.16em; color: var(--accent); margin-bottom: 10px; }
.prose h3 { font-size: clamp(20px, 2.4vw, 24px); margin-top: 2em; letter-spacing: -0.015em; scroll-margin-top: 110px; }
.prose h3 + p { margin-top: 0.6em; }
.prose h4.ex-title { font: 600 13px var(--font-body); letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); margin-top: 2.2em; }
.prose ul, .prose ol.plain { padding-left: 1.3em; display: grid; gap: 0.6em; }
.prose li::marker { color: var(--accent); }
.prose ol.plain { counter-reset: li; list-style: none; padding-left: 0; }
.prose ol.plain > li { counter-increment: li; position: relative; padding-left: 2.6em; }
.prose ol.plain > li::before { content: counter(li); position: absolute; left: 0; top: 0.18em; width: 1.7em; height: 1.7em; border-radius: 50%; display: grid; place-items: center; font: 600 13px var(--font-body); color: var(--accent); border: 1px solid var(--accent); }

.note { padding: 20px 24px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); background: color-mix(in srgb, var(--accent) 7%, transparent); font-size: 16px; line-height: 1.7; }
.note strong { display: block; margin-bottom: 4px; color: var(--accent); }
.note p { margin: 0; color: var(--muted); }
.pull { margin: 2.2em 0 !important; padding: 6px 0 6px 28px; border-left: 4px solid var(--accent); font: 600 clamp(22px, 2.9vw, 29px)/1.4 var(--font-display); letter-spacing: -0.02em; color: var(--text); }
.fine { font-size: 14px !important; color: var(--muted); text-align: center; margin-top: 28px !important; }

/* ---------- figures ---------- */
.fig { margin: 2.2em 0 !important; }
.fig figcaption { margin-top: 14px; font-size: 14px; line-height: 1.6; color: var(--muted); }
.fig figcaption strong { color: var(--text); }

.docs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.doc { padding: 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border-strong); font-size: 15px; line-height: 1.55; box-shadow: var(--shadow); }
.doc p { margin: 8px 0 0 !important; color: var(--muted); } .doc b { color: var(--accent); }
.doc-tag { font: 600 11px var(--font-body); letter-spacing: 0.1em; text-transform: uppercase; color: var(--text); opacity: 0.75; }
.ask { margin-top: 14px; padding: 14px 18px; border-radius: 12px; background: var(--grad); color: var(--accent-ink); font-weight: 500; font-size: 16px; }
.ask span { font: 700 11px var(--font-body); letter-spacing: 0.14em; text-transform: uppercase; margin-right: 10px; opacity: 0.85; }

.layers { display: grid; gap: 8px; }
.layer { display: grid; gap: 2px; padding: 16px 22px; border-radius: 14px; border: 1px solid var(--border-strong); background: var(--surface); }
.layer b { font: 700 16px var(--font-display); } .layer span { font-size: 14.5px; color: var(--muted); line-height: 1.5; }
.layer.l3 { background: var(--grad); border-color: transparent; color: var(--accent-ink); } .layer.l3 span { color: color-mix(in srgb, var(--accent-ink) 85%, transparent); }
.layer.l4 { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }

.arch { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; counter-reset: none; }
.arch li { display: grid; grid-template-columns: 46px 1fr auto; gap: 16px; align-items: center; padding: 16px 18px; border: 1px solid var(--border-strong); background: var(--surface); position: relative; margin: 0 !important; }
.arch li:first-child { border-radius: 14px 14px 0 0; } .arch li:last-child { border-radius: 0 0 14px 14px; }
.arch li + li { margin-top: -1px !important; }
.arch li:not(:last-child)::after { content: ""; position: absolute; left: 33px; bottom: -7px; width: 12px; height: 12px; z-index: 2; background: var(--bg); border-right: 1px solid var(--border-strong); border-bottom: 1px solid var(--border-strong); transform: rotate(45deg); }
.arch li.okf { background: color-mix(in srgb, var(--accent) 9%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 38%, var(--border-strong)); }
.arch li.okf::after { background: color-mix(in srgb, var(--accent) 9%, var(--bg)); }
.arch .n { font: 700 14px var(--font-display); color: var(--accent); letter-spacing: 0.05em; }
.arch b { font: 600 17px var(--font-display); } .arch p { margin: 2px 0 0 !important; font-size: 14.5px; line-height: 1.5; color: var(--muted); }
.tech { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; max-width: 210px; }
.tech i { font: 500 12px var(--font-body); font-style: normal; padding: 3px 10px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--border-strong); color: var(--muted); white-space: nowrap; }

.flow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 6px; }
.flow .fstep { padding: 9px 15px; border-radius: 999px; font-size: 14.5px; font-weight: 500; background: var(--surface); border: 1px solid var(--border-strong); }
.flow .fstep.hl { background: var(--grad); color: var(--accent-ink); border-color: transparent; }
.flow i { width: 14px; height: 14px; flex: none; position: relative; }
.flow i::before { content: ""; position: absolute; inset: 3px 0 auto 0; border-top: 2px solid var(--accent); }
.flow i::after { content: ""; position: absolute; right: 0; top: 0; width: 7px; height: 7px; border-top: 2px solid var(--accent); border-right: 2px solid var(--accent); transform: translateY(0.5px) rotate(45deg); }

.kg { width: 100%; height: auto; display: block; padding: 10px; border-radius: 16px; border: 1px solid var(--border-strong); background: var(--surface); }
.kg-edges path { fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; }
.kg-edges .kg-hot { stroke: var(--accent); stroke-width: 2.4; stroke-dasharray: 6 5; }
.kg-arrow { fill: var(--muted); }
.kg-labels text { font: 600 10.5px var(--font-body); letter-spacing: 0.08em; fill: var(--muted); paint-order: stroke; stroke: var(--surface); stroke-width: 5px; }
.kg-labels .kg-hot-l { fill: var(--accent); }
.kg-nodes rect { fill: var(--bg-2); stroke: var(--border-strong); stroke-width: 1.5; }
.kg-nodes rect.hot { stroke: var(--accent); stroke-width: 2.2; fill: color-mix(in srgb, var(--accent) 10%, var(--bg-2)); }
.kg-nodes .k { font: 700 9.5px var(--font-body); letter-spacing: 0.12em; fill: var(--accent); text-anchor: middle; }
.kg-nodes .v { font: 600 14px var(--font-display); fill: var(--text); text-anchor: middle; }
.kg-prov path { stroke: var(--muted); stroke-width: 1.4; stroke-dasharray: 3 3; }
.kg-prov rect { fill: color-mix(in srgb, var(--accent) 10%, var(--surface)); stroke: color-mix(in srgb, var(--accent) 45%, transparent); }
.kg-prov text { font: 500 10.5px var(--font-body); fill: var(--text); text-anchor: middle; }

pre.code { margin: 0; padding: 22px 24px; border-radius: 14px; background: #0b1226; color: #dbe4ff; font: 400 14px/1.75 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-x: auto; border: 1px solid rgba(255, 255, 255, 0.08); }
pre.code .c { color: #7e8bb0; } pre.code .k { color: #93c5fd; } pre.code .r { color: #fcd34d; }

.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.compare .col { padding: 20px; border-radius: 14px; border: 1px solid var(--border-strong); background: var(--surface); }
.compare h5 { font: 600 16px var(--font-display); margin-bottom: 8px; }
.compare p { margin: 0 !important; font-size: 15px; line-height: 1.6; color: var(--muted); }
.compare .bad { border-color: rgba(239, 68, 68, 0.4); background: rgba(239, 68, 68, 0.05); } .compare .bad h5 { color: #dc2626; }
.compare .good { border-color: rgba(22, 163, 74, 0.45); background: rgba(22, 163, 74, 0.06); } .compare .good h5 { color: #15803d; }
html.post-page[data-theme="dark"] .compare .bad h5 { color: #f87171; } html.post-page[data-theme="dark"] .compare .good h5 { color: #4ade80; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border-strong); border-radius: 14px; background: var(--surface); }
.prose table { width: 100%; border-collapse: collapse; font-size: 15.5px; line-height: 1.6; }
.prose th { text-align: left; padding: 13px 18px; font: 600 12px var(--font-body); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); background: var(--bg-2); border-bottom: 1px solid var(--border-strong); }
.prose td { padding: 14px 18px; vertical-align: top; border-bottom: 1px solid var(--border); color: var(--muted); }
.prose td:first-child { width: 28%; color: var(--text); }
.prose tr:last-child td { border-bottom: 0; }
.prose table.two td:first-child { width: 50%; color: var(--muted); }

.verdicts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.verdict { padding: 20px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border-strong); border-top-width: 4px; }
.verdict h5 { font: 600 17px var(--font-display); margin: 12px 0 6px; } .verdict p { margin: 0 !important; font-size: 14.5px; line-height: 1.55; color: var(--muted); }
.badge { display: inline-block; font: 700 11px var(--font-body); letter-spacing: 0.14em; padding: 4px 12px; border-radius: 999px; }
.verdict.pass { border-top-color: #16a34a; } .verdict.pass .badge { background: rgba(22, 163, 74, 0.14); color: #15803d; }
.verdict.partial { border-top-color: #d97706; } .verdict.partial .badge { background: rgba(217, 119, 6, 0.16); color: #b45309; }
html.post-page[data-theme="dark"] .verdict.pass .badge { color: #4ade80; } html.post-page[data-theme="dark"] .verdict.partial .badge { color: #fbbf24; }

.stack-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin-top: 1.5em !important; }
.stack-g { padding: 16px 18px; border-radius: 14px; border: 1px solid var(--border-strong); background: var(--surface); }
.stack-g h5 { font: 700 11px var(--font-body); letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
.stack-g ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: 15.5px; }
.stack-g li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; } .stack-g li::marker { content: none; }
.stack-g .v { font: 600 10px var(--font-body); letter-spacing: 0.08em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; background: rgba(22, 163, 74, 0.14); color: #15803d; }
.stack-note { font-size: 14.5px !important; color: var(--muted); }

.post-end { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 2.6em !important; padding-top: 2em; border-top: 1px solid var(--border-strong); }

/* ---------- responsive ---------- */
@media (max-width: 1040px) {
  .post-layout { grid-template-columns: minmax(0, 720px); gap: 0; }
  .toc { display: none; } .toc-m { display: block; }
}
@media (max-width: 640px) {
  .prose { font-size: 17.5px; }
  .docs, .compare, .verdicts { grid-template-columns: 1fr; }
  .arch li { grid-template-columns: 34px 1fr; } .arch .tech { grid-column: 2; justify-content: flex-start; max-width: none; }
  .arch li:not(:last-child)::after { left: 22px; }
  .post-meta { gap: 14px 22px; }
  .flow .fstep { font-size: 13.5px; padding: 8px 12px; }
}
@media print { .toc, .toc-m, .nav, .progress, .ambient, .to-top, .footer, .post-end { display: none !important; } .post-layout { display: block; } }

.links a svg { width: 14px; height: 14px; }

.prose h2 + p, .prose h2 + .lede { margin-top: 1em; }
.stack-note { margin-top: 1.4em !important; }

.kg-box { overflow-x: auto; border-radius: 16px; }
.swipe { display: none; font-size: 13px !important; color: var(--muted); margin-top: 8px !important; }
@media (max-width: 640px) { .kg { min-width: 640px; } .swipe { display: block; } }
.toc-m a { text-decoration: none; color: var(--text); }

/* buttons inside the article keep their own colours (the article link style must not touch them) */
.prose a.btn { text-decoration: none; }
.prose a.btn-primary { color: var(--accent-ink); }
.prose a.btn-ghost { color: var(--text); }

/* article: figure card headings are real headings now (h3) but keep the small card look */
.prose .compare h3.mini, .prose .verdict h3.mini, .prose .stack-g h3.mini { margin-top: 0; letter-spacing: normal; }
.prose .compare h3.mini { font: 600 16px var(--font-display); margin-bottom: 8px; }
.prose .verdict h3.mini { font: 600 17px var(--font-display); margin: 12px 0 6px; }
.prose .stack-g h3.mini { font: 700 11px var(--font-body); letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
.toc .toc-title { font: 600 12px var(--font-body); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }

/* contrast: slightly deeper status colours so every label passes WCAG AA (4.5:1) */
.compare .bad h3.mini { color: #b91c1c; }
.verdict.pass .badge, .stack-g .v { color: #166534; }
.verdict.partial .badge { color: #92400e; }

/* ---------- real research screenshots + video player ---------- */
.nsn-screenshots { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.nsn-shot { margin: 0; overflow: hidden; border: 1px solid var(--border-strong); border-radius: 14px; background: var(--surface); }
.nsn-shot img { width: 100%; height: auto; display: block; }
.nsn-shot figcaption { padding: 12px 14px; font-size: 13.5px; line-height: 1.55; color: var(--muted); }
.nsn-shot figcaption strong { color: var(--text); }
@media (max-width: 640px) { .nsn-screenshots { grid-template-columns: 1fr; } }
.project-video-player { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border: 1px solid var(--border-strong); border-radius: 18px; background: #08080d; box-shadow: var(--shadow); }
.project-video-trigger { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; padding: 0; cursor: pointer; background: #08080d; color: #fff; }
.project-video-trigger > img { width: 100%; height: 100%; object-fit: cover; opacity: 0.58; transition: transform 0.5s var(--ease), opacity 0.25s; }
.project-video-trigger:hover > img { transform: scale(1.02); opacity: 0.72; }
.project-play-icon { position: absolute; left: 50%; top: 50%; width: 76px; height: 76px; transform: translate(-50%, -58%); display: grid; place-items: center; border-radius: 50%; background: var(--grad); color: var(--accent-ink); box-shadow: 0 16px 40px rgba(29,78,216,0.35); }
.project-play-icon svg { width: 30px; height: 30px; fill: currentColor; margin-left: 3px; }
.project-play-label { position: absolute; left: 50%; top: calc(50% + 52px); transform: translateX(-50%); padding: 7px 13px; border: 1px solid rgba(255,255,255,0.18); border-radius: 999px; background: rgba(7,13,28,0.72); font: 600 13px var(--font-body); white-space: nowrap; }
.project-video-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #08080d; }
.project-video-frame[hidden] { display: none; }
