/* ============================================================
   Suraj Yadav · Portfolio v4
   Dark engineering system · Space Grotesk + JetBrains Mono
   Accent: Ubuntu orange #E95420 (locked, single accent)
   Shape rule: radius 0 everywhere; circles only on images
   ============================================================ */

:root {
  --bg: #0B0C0E;
  --bg-2: #131417;
  --bg-3: #18191D;
  --line: rgba(232, 233, 235, 0.1);
  --line-strong: rgba(232, 233, 235, 0.22);
  --text: #F2F3F5;
  --text-2: #B2B7BF;
  --accent: #E95420;
  --accent-soft: rgba(233, 84, 32, 0.14);
  --accent-line: rgba(233, 84, 32, 0.4);
  --nav-bg: rgba(11, 12, 14, 0.82);
  --foot-bg: rgba(11, 12, 14, 0.4);
  --card-media-bg: #0E0F12;
  --hero-grid-line: rgba(232, 233, 235, 0.045);
  --hero-glow: rgba(233, 84, 32, 0.07);
  --card-shadow: 0 -28px 64px rgba(0, 0, 0, 0.75), 0 1px 0 rgba(232, 233, 235, 0.1);
  --pan-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
  --chip-bg: rgba(255, 255, 255, 0.04);
  --chip-text: #E2E4E8;
  --card-desc-color: #CBD0D6;
  --cursor-glow-bg: radial-gradient(circle, rgba(233, 84, 32, 0.12) 0%, rgba(233, 84, 32, 0.03) 45%, transparent 70%);
  --heat-l0: #17181D;
  --heat-l1: #52200F;
  --heat-l2: #8C2E0C;
  --heat-l3: #C64113;
  --heat-l4: #E95420;
  --font-d: "Space Grotesk", system-ui, -apple-system, sans-serif;
  --font-m: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --nav-h: 72px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] {
  --bg: #F6F7F9;
  --bg-2: #FFFFFF;
  --bg-3: #ECEEF2;
  --line: rgba(15, 17, 20, 0.08);
  --line-strong: rgba(15, 17, 20, 0.16);
  --text: #0E1013;
  --text-2: #525866;
  --accent: #E95420;
  --accent-soft: rgba(233, 84, 32, 0.08);
  --accent-line: rgba(233, 84, 32, 0.35);
  --nav-bg: rgba(246, 247, 249, 0.88);
  --foot-bg: rgba(236, 238, 242, 0.6);
  --card-media-bg: #E8EBEF;
  --hero-grid-line: rgba(15, 17, 20, 0.05);
  --hero-glow: rgba(233, 84, 32, 0.06);
  --card-shadow: 0 16px 40px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  --pan-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  --chip-bg: rgba(15, 17, 20, 0.04);
  --chip-text: #2C3038;
  --card-desc-color: #525866;
  --cursor-glow-bg: radial-gradient(circle, rgba(233, 84, 32, 0.14) 0%, rgba(233, 84, 32, 0.03) 50%, transparent 70%);
  --heat-l0: #EBEDF0;
  --heat-l1: #FFD4C2;
  --heat-l2: #FFA583;
  --heat-l3: #F66D39;
  --heat-l4: #E95420;
}

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

html { scroll-behavior: auto; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-d);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100dvh;
  transition: background-color 0.3s ease, color 0.3s ease;
}

img { display: block; max-width: 100%; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

::selection { background: var(--accent); color: #0B0C0E; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

section[id], footer[id] { scroll-margin-top: calc(var(--nav-h) + 24px); }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #26282E; border: 2px solid var(--bg); }

/* ---------- Utilities ---------- */

.shell { width: min(1200px, calc(100% - 48px)); margin-inline: auto; }
.shell-wide { width: min(1360px, calc(100% - 48px)); margin-inline: auto; }

.skip-link {
  position: fixed; top: -48px; left: 16px; z-index: 200;
  background: var(--accent); color: #0B0C0E;
  padding: 10px 18px; font-weight: 600; font-size: 14px;
  transition: top 0.25s var(--ease-out);
}
.skip-link:focus { top: 12px; }

/* ---------- Fixed layers ---------- */

.noise {
  position: fixed; inset: 0; z-index: 90; pointer-events: none; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.scroll-progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 80; }
.scroll-progress span {
  display: block; height: 100%; width: 100%;
  background: var(--accent);
  transform-origin: left center;
  transform: scaleX(0);
}

/* ---------- Persistent Ambient Pointer Highlighter ---------- */

.cursor-glow {
  position: fixed;
  top: 0; left: 0;
  width: 260px; height: 260px;
  margin-top: -130px; margin-left: -130px;
  border-radius: 50%;
  pointer-events: none;
  background: var(--cursor-glow-bg);
  z-index: 45;
  opacity: 0;
  will-change: transform, opacity;
  transition: opacity 0.4s ease;
  mix-blend-mode: screen;
}
.cursor-glow.active { opacity: 1; }
.cursor-glow.hidden,
body:has(.heatmap-card:hover) .cursor-glow {
  opacity: 0 !important;
}

.loader {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-content: center; justify-items: center; gap: 20px;
  background: var(--bg);
}
html:not(.js) .loader { display: none; }
.loader-mark {
  font-family: var(--font-m); font-size: 15px; font-weight: 500;
  letter-spacing: 0.5em; text-indent: 0.5em; color: var(--text-2);
}
.loader-bar { width: 132px; height: 1px; background: var(--line-strong); overflow: hidden; }
.loader-bar span { display: block; height: 100%; width: 100%; background: var(--accent); transform-origin: left center; transform: scaleX(0); animation: loaderfill 1.6s var(--ease-out) forwards; }
@keyframes loaderfill { to { transform: scaleX(1); } }

html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

/* ---------- Nav ---------- */

.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  width: 100%;
  max-width: 100vw;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between; gap: clamp(14px, 2vw, 24px);
  padding-inline: clamp(16px, 4vw, 56px);
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  backdrop-filter: blur(20px) saturate(140%);
  border-bottom: 1px solid var(--line-strong);
  box-sizing: border-box;
  transition: transform 0.3s ease, background 0.3s ease, border-color 0.3s ease;
}
.nav-logo {
  font-family: var(--font-m); font-size: 15px; font-weight: 500;
  letter-spacing: 0.02em; white-space: nowrap;
  flex-shrink: 0;
}
.nav-logo span { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: clamp(14px, 2.2vw, 28px); min-width: 0; }
.nav-links a {
  position: relative;
  font-family: var(--font-m); font-size: 12px; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--text-2);
  transition: color 0.25s ease;
  padding-block: 4px;
  white-space: nowrap;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a::after {
  content: ""; position: absolute; bottom: 0; left: 0; right: 0; height: 2px;
  background: var(--accent); transform: scaleX(0); transform-origin: left center;
  transition: transform 0.25s var(--ease-out);
}
.nav-links a.active::after { transform: scaleX(1); }

.nav-actions { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }

.cmd-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 9px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line-strong);
  color: var(--text-2);
  font-family: var(--font-d);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
[data-theme="light"] .cmd-trigger {
  background: rgba(15, 17, 20, 0.04);
}
.cmd-trigger:hover {
  color: var(--text);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}
.cmd-trigger-icon {
  flex-shrink: 0;
  color: currentColor;
  opacity: 0.85;
}
.cmd-trigger-text {
  font-size: 12px;
  letter-spacing: 0.02em;
}
.cmd-trigger-kbd {
  font-family: var(--font-m);
  font-size: 10px;
  padding: 1px 4px;
  border-radius: 3px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  color: var(--text-2);
  line-height: 1.3;
  letter-spacing: 0.04em;
}
.theme-toggle {
  display: grid; place-items: center;
  width: 24px; height: 24px;
  padding: 0; margin: 0;
  border: none;
  background: transparent;
  color: var(--text-2);
  opacity: 0.75;
  cursor: pointer;
  transition: opacity 0.2s ease, color 0.2s ease, transform 0.3s var(--ease-out);
}
.theme-toggle:hover {
  opacity: 1;
  color: var(--accent);
  transform: rotate(20deg) scale(1.08);
}
.sun-icon { display: block; }
.moon-icon { display: none; }
[data-theme="light"] .sun-icon { display: none; }
[data-theme="light"] .moon-icon { display: block; }

.nav-icon img { opacity: 0.75; transition: opacity 0.2s ease; }
.nav-icon:hover img { opacity: 1; }

/* ---------- Hero ---------- */

.hero { position: relative; min-height: 100dvh; display: flex; align-items: stretch; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; will-change: transform; }
.hero-bg::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--hero-grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--hero-grid-line) 1px, transparent 1px);
  background-size: 72px 72px;
  -webkit-mask-image: radial-gradient(ellipse 95% 85% at 50% 38%, black 25%, transparent 78%);
  mask-image: radial-gradient(ellipse 95% 85% at 50% 38%, black 25%, transparent 78%);
}
.hero-bg::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse 55% 45% at 78% 8%, var(--hero-glow), transparent 70%);
}
.hero-inner {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; justify-content: center;
  padding-top: calc(var(--nav-h) + 60px);
  padding-bottom: 72px;
  max-width: 100%;
}
.hero-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  font-family: var(--font-m);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-2);
  margin-bottom: 32px;
  max-width: 100%;
}
.hero-avatar { width: 24px; height: 24px; object-fit: cover; border: 1px solid var(--line-strong); flex-shrink: 0; }
.hero-status span { max-width: 100%; line-height: 1.4; word-break: break-word; }
.hero-title {
  font-size: clamp(2.4rem, 6.5vw, 6.25rem);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.03em;
  word-break: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
}
.hero-title .line { display: block; overflow: hidden; max-width: 100%; }
.hero-title .line-inner { display: inline-block; will-change: transform; max-width: 100%; }
.hero-title .line:nth-child(2) { padding-left: clamp(0px, 4vw, 72px); }
.hero-sub {
  margin-top: 32px; max-width: 46ch;
  font-size: clamp(1rem, 1.35vw, 1.125rem);
  line-height: 1.7; color: var(--text-2);
  word-break: break-word;
}
.hero-ctas { margin-top: 44px; display: flex; flex-wrap: wrap; gap: 16px; max-width: 100%; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 54px; padding: 0 30px; white-space: nowrap; max-width: 100%;
  font-family: var(--font-m); font-size: 13px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.1em;
  border: 1px solid transparent;
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}
.btn-solid { background: var(--accent); color: #0B0C0E; }
.btn-solid:hover { background: #F26A38; }
.btn-ghost { border-color: var(--line-strong); color: var(--text); }
.btn-ghost:hover { border-color: var(--text-2); background: rgba(232, 233, 235, 0.04); }
.btn:active { transform: translateY(1px); }

/* ---------- Ticker ---------- */

.ticker { border-block: 1px solid var(--line); padding: 18px 0; overflow: hidden; }
.marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
}
.marquee-track { display: flex; gap: 56px; width: max-content; padding-right: 56px; }
.marquee-track.marquee-ready { animation: ticker-scroll 34s linear infinite; }
@keyframes ticker-scroll { to { transform: translateX(-50%); } }
.marquee-track li { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.marquee-track li span {
  font-family: var(--font-m); font-size: 13px; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--text-2); white-space: nowrap;
}
.marquee-track li img { opacity: 0.9; }

/* ---------- Section headers ---------- */

section { padding-block: clamp(96px, 13vh, 160px) 0; }
.manifesto, .stats, .activity, .journey, .morebuilds, .writing { padding-bottom: 0; }
.work { padding-bottom: clamp(64px, 9vh, 120px); position: relative; z-index: 1; }

.section-head { margin-bottom: 64px; display: grid; gap: 18px; }
.section-head h2 {
  font-size: clamp(2rem, 4.4vw, 3.3rem);
  font-weight: 600; letter-spacing: -0.02em; line-height: 1.08;
}
.eyebrow {
  font-family: var(--font-m); font-size: 12px; text-transform: uppercase;
  letter-spacing: 0.22em; color: var(--accent);
}

/* ---------- Editorial Modern Project Showcase Cards ---------- */

.editorial-projects-list {
  display: flex;
  flex-direction: column;
  gap: clamp(48px, 7vw, 96px);
  margin-top: 16px;
}

.project-showcase-card {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: clamp(32px, 4.5vw, 64px);
  align-items: center;
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  padding: clamp(24px, 3.5vw, 44px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s var(--ease-out);
  --mouse-x: 50%;
  --mouse-y: 50%;
}
.project-showcase-card::before, .pan-card::before, .cell::before {
  content: ""; position: absolute; inset: -1px; pointer-events: none;
  background: radial-gradient(550px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(233, 84, 32, 0.16), transparent 50%);
  opacity: 0; transition: opacity 0.4s ease; z-index: 2;
}
.project-showcase-card:hover {
  border-color: var(--accent-line, var(--accent));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
}
.project-showcase-card:hover::before, .pan-card:hover::before, .cell:hover::before {
  opacity: 1;
}

/* Alternating Layout (Left/Right rhythm on desktop) */
@media (min-width: 901px) {
  .project-showcase-card:nth-child(even) {
    grid-template-columns: 1fr 1.15fr;
  }
  .project-showcase-card:nth-child(even) .project-media-frame {
    order: 2;
  }
}

.project-media-frame {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}
.media-frame-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-3, rgba(255, 255, 255, 0.03));
  border-bottom: 1px solid var(--line);
  font-family: var(--font-m);
  font-size: 11px;
  color: var(--text-2);
}
.frame-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}
.frame-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line-strong);
}
.frame-dots .dot:nth-child(1) { background: #EF4444; opacity: 0.85; }
.frame-dots .dot:nth-child(2) { background: #F59E0B; opacity: 0.85; }
.frame-dots .dot:nth-child(3) { background: #10B981; opacity: 0.85; }
.frame-url {
  opacity: 0.75;
  letter-spacing: 0.04em;
  font-size: 10.5px;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.frame-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 9.5px;
  letter-spacing: 0.12em;
  color: var(--accent);
  text-transform: uppercase;
  font-weight: 600;
}

.pulse-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulse-glow 2s infinite ease-in-out;
}
@keyframes pulse-glow {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.4; }
}

.card-media {
  position: relative;
  overflow: hidden;
  background: var(--card-media-bg);
  aspect-ratio: 16 / 10;
  display: block;
}
.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.001);
  filter: grayscale(100%) contrast(1.12) brightness(0.85);
  transition: filter 0.45s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: filter, transform;
}
[data-theme="light"] .card-media img {
  filter: grayscale(100%) contrast(1.06) brightness(0.92);
}
.project-showcase-card:hover .card-media img {
  filter: grayscale(0%) contrast(1) brightness(1);
  transform: scale(1.03);
}

.project-content {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block: 4px;
}
.project-meta-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.project-idx {
  font-family: var(--font-m);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--accent);
  font-weight: 600;
}
.project-category {
  font-family: var(--font-m);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  color: var(--text-2);
  text-transform: uppercase;
}
.project-title {
  font-size: clamp(2rem, 3.4vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.05;
  color: var(--text);
  margin-bottom: 12px;
}
.project-tagline {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 12px;
}
.project-desc {
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text-2);
  margin-bottom: 22px;
  max-width: 52ch;
}
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 26px;
}
.chip-row li {
  font-family: var(--font-m);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--chip-text);
  border: 1px solid var(--line-strong);
  background: var(--chip-bg);
  padding: 6px 10px;
}
.project-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.project-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  font-family: var(--font-m);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.25s ease;
}
.project-actions .btn-primary {
  background: var(--accent);
  color: #0E1013;
  border: 1px solid var(--accent);
}
.project-actions .btn-primary:hover {
  background: #FFFFFF;
  border-color: #FFFFFF;
  color: #0E1013;
  transform: translateY(-2px);
}
.project-actions .btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line-strong);
}
.project-actions .btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-2px);
}

/* Flagship Technical Deep Dive Drawer */
.project-actions .btn-inspect {
  background: var(--bg-3);
  color: var(--text);
  border: 1px solid var(--line-strong);
}
.project-actions .btn-inspect:hover,
.project-actions .btn-inspect.is-active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-2px);
}
.project-actions .btn-inspect svg {
  color: currentColor;
  transition: transform 0.2s ease;
}
.project-actions .btn-inspect.is-active svg {
  transform: rotate(90deg);
}

.project-inspector {
  grid-column: 1 / -1;
  order: 10;
  width: 100%;
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  display: none;
}
.project-inspector.is-expanded {
  display: block;
  animation: inspector-fade 0.25s var(--ease-out);
}
@keyframes inspector-fade {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.inspector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.inspector-tabs {
  display: flex;
  gap: 6px;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  padding: 3px;
}
.inspector-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-2);
  font-family: var(--font-m);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 6px 12px;
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease;
}
.inspector-tab-btn:hover {
  color: var(--text);
}
.inspector-tab-btn.is-active {
  background: var(--bg-2);
  color: var(--accent);
  border: 1px solid var(--line);
}
[data-theme="light"] .inspector-tab-btn.is-active {
  background: #FFFFFF;
}

.inspector-panel {
  display: none;
}
.inspector-panel.is-active {
  display: block;
}

.inspector-arch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}
.arch-card {
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 16px;
}
.arch-card h4 {
  font-family: var(--font-m);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 6px;
}
.arch-card p {
  font-size: 13.5px;
  color: var(--card-desc-color);
  line-height: 1.55;
}

.inspector-code-box {
  background: var(--bg);
  border: 1px solid var(--line-strong);
  overflow: hidden;
}
.code-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: var(--bg-3);
  border-bottom: 1px solid var(--line);
  font-family: var(--font-m);
  font-size: 11px;
}
.code-box-lang {
  color: var(--text-2);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.code-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-2);
  padding: 3px 8px;
  font-family: var(--font-m);
  font-size: 10px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: all 0.15s ease;
}
.code-copy-btn:hover {
  color: var(--text);
  border-color: var(--accent-line);
}
.inspector-code-box pre {
  padding: 14px 16px;
  overflow-x: auto;
  margin: 0;
  font-family: var(--font-m);
  font-size: 12.5px;
  line-height: 1.6;
  color: #E2E4E8;
}
[data-theme="light"] .inspector-code-box pre {
  color: #1E293B;
  background: #F8FAFC;
}


/* ---------- Universal word scroll scrub illumination ---------- */

.manifesto .shell { display: block; }
.scrub-text {
  font-size: clamp(1.65rem, 3.4vw, 2.85rem);
  font-weight: 500; line-height: 1.32; letter-spacing: -0.02em;
  max-width: 900px;
  cursor: default;
}

.w-group {
  display: inline;
}

.w {
  display: inline-block;
  opacity: 0.18;
  will-change: opacity;
  transition: color 0.25s ease, text-shadow 0.25s ease;
}
.w:hover {
  color: #FFFFFF !important;
  text-shadow: 0 0 14px rgba(233, 84, 32, 0.45);
}

[data-theme="light"] .w:hover {
  color: #0E1013 !important;
  text-shadow: 0 0 10px rgba(233, 84, 32, 0.3);
}

.hero-title .line-inner,
.section-head h2,
.card-title,
.contact-title,
.contact-title .line-inner {
  transition: text-shadow 0.3s ease, color 0.3s ease;
  cursor: default;
}
.hero-title .line-inner:hover,
.section-head h2:hover,
.contact-title .line-inner:hover {
  text-shadow: 0 0 16px rgba(233, 84, 32, 0.25);
}

/* ---------- Stats bento ---------- */

.stats-grid {
  display: grid; grid-template-columns: repeat(12, 1fr);
  gap: 20px; grid-auto-flow: dense;
}
.cell {
  position: relative;
  display: flex; flex-direction: column; justify-content: space-between; gap: 20px;
  border: 1px solid var(--line);
  padding: clamp(24px, 2.6vw, 36px); min-height: 210px;
  transition: border-color 0.3s ease, transform 0.3s var(--ease-out);
}
.cell:hover { border-color: var(--line-strong); }
.cell-top-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.cell-top-row .cell-kicker { margin-bottom: 0; }
.live-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-m); font-size: 10px; text-transform: uppercase;
  letter-spacing: 0.14em; color: var(--accent);
  border: 1px solid var(--accent-line); background: var(--accent-soft);
  padding: 3px 8px; white-space: nowrap;
}
.cell-stats-sub {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px;
}
.sub-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-m); font-size: 11px; letter-spacing: 0.06em;
  color: var(--text-2); background: var(--chip-bg);
  border: 1px solid var(--line); padding: 4px 10px;
}
.sub-badge strong { color: var(--text); font-weight: 500; }
.sub-badge img { opacity: 0.85; }
.span12 { grid-column: span 12; }
.span6 { grid-column: span 6; }
.span4 { grid-column: span 4; }
.span3 { grid-column: span 3; }

/* Compact Engineering Focus Strip */
.focus-strip-wrap {
  margin-bottom: 20px;
}
.focus-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  padding: 10px 18px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.25s ease;
}
.focus-strip::before {
  content: "";
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
}
.focus-strip:hover {
  border-color: var(--accent-line);
}
.focus-strip-main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.focus-strip-title {
  font-family: var(--font-m);
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
}
.focus-strip-sep {
  color: var(--line-strong);
  font-family: var(--font-m);
  font-size: 11px;
  flex-shrink: 0;
}
.focus-strip-desc {
  font-size: 12px;
  color: var(--card-desc-color);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.focus-strip-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.focus-strip-tag {
  font-family: var(--font-m);
  font-size: 10.5px;
  color: var(--text-2);
  background: var(--chip-bg);
  border: 1px solid var(--line);
  padding: 2px 8px;
  white-space: nowrap;
}
@media (max-width: 1024px) {
  .focus-strip-desc {
    display: none;
  }
  .focus-strip-sep {
    display: none;
  }
}
@media (max-width: 768px) {
  .focus-strip {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 14px;
  }
  .focus-strip-tags {
    flex-wrap: wrap;
  }
}


.cell-num { background: transparent; }
.cell-mid { background: var(--bg-2); }
.numeral {
  font-family: var(--font-m); font-weight: 500;
  font-size: clamp(2.6rem, 4.4vw, 4rem); letter-spacing: -0.02em;
  color: var(--accent); line-height: 1;
}
.cell-label { color: var(--text-2); font-size: 14.5px; line-height: 1.65; max-width: 44ch; }
.cell-kicker {
  font-family: var(--font-m); font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.2em; color: var(--text-2); margin-bottom: 14px;
}
.cell-big { font-size: clamp(1.45rem, 2.1vw, 1.9rem); font-weight: 600; letter-spacing: -0.01em; }
.cell-accent {
  background: linear-gradient(150deg, rgba(233, 84, 32, 0.2), rgba(233, 84, 32, 0.05));
  border-color: var(--accent-line);
}
.cell-img { position: relative; overflow: hidden; padding: 0; min-height: 240px; }
.cell-img img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(100%) contrast(1.12) brightness(0.8);
  transition: filter 0.45s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: filter, transform;
}
[data-theme="light"] .cell-img img {
  filter: grayscale(100%) contrast(1.06) brightness(0.92);
}
.cell-img:hover img {
  filter: grayscale(0%) contrast(1) brightness(1);
  transform: scale(1.04);
}

/* ---------- GitHub Activity & Achievements ---------- */

.activity { padding-bottom: 0; }

.heatmap-card {
  position: relative;
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  padding: clamp(20px, 3vw, 36px);
  margin-bottom: 44px;
  box-shadow: var(--pan-shadow);
  overflow: hidden;
  max-width: 100%;
  transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.heatmap-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 16px; padding-bottom: 18px; margin-bottom: 18px;
  border-bottom: 1px solid var(--line-strong);
}
.heatmap-title {
  font-family: var(--font-m); font-size: 13px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.14em; color: var(--text);
}
.heatmap-sub {
  font-family: var(--font-m); font-size: 12px; color: var(--text-2); margin-left: 8px;
}
.heatmap-meta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

.heatmap-alltime-pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-m); font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--accent);
  background: var(--accent-soft); border: 1px solid var(--accent-line);
  padding: 5px 12px;
}
.heatmap-alltime-pill strong { color: var(--text); font-weight: 700; }

.heatmap-profile-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-m); font-size: 12px; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--text);
  border-bottom: 1px solid var(--line-strong); padding-bottom: 3px;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.heatmap-profile-link:hover { color: var(--accent); border-color: var(--accent); }

/* Year switcher tabs */
.heatmap-years-bar {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 18px;
}
.year-tab {
  font-family: var(--font-m); font-size: 11.5px;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 6px 14px;
  background: var(--bg); border: 1px solid var(--line);
  color: var(--text-2); cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.year-tab:hover {
  border-color: var(--line-strong); color: var(--text);
}
.year-tab.active {
  background: var(--accent-soft); border-color: var(--accent);
  color: var(--accent); font-weight: 600;
}

.heatmap-scroll-wrap {
  position: relative;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-block: 8px 14px;
}
.heatmap-scroll-wrap::-webkit-scrollbar { height: 6px; }
.heatmap-scroll-wrap::-webkit-scrollbar-track { background: var(--bg); }
.heatmap-scroll-wrap::-webkit-scrollbar-thumb { background: var(--line-strong); }

.heatmap-inner {
  min-width: 820px;
  display: flex;
  justify-content: center;
  align-items: center;
}
.heatmap-svg {
  width: 100%;
  max-width: 860px;
  height: auto;
  display: block;
  overflow: visible;
}
.heat-square {
  cursor: pointer;
  shape-rendering: geometricPrecision;
  transition: stroke 0.15s ease, filter 0.15s ease;
}
.heat-square:hover {
  stroke: #FFFFFF;
  stroke-width: 1.5px;
  filter: drop-shadow(0 0 5px var(--accent));
}
[data-theme="light"] .heat-square:hover {
  stroke: #0E1013;
}

.heatmap-month-txt {
  font-family: var(--font-m);
  font-size: 10px;
  fill: var(--text-2);
  letter-spacing: 0.04em;
}
.heatmap-wday-txt {
  font-family: var(--font-m);
  font-size: 9px;
  fill: var(--text-2);
}

/* Floating interactive tooltip */
.heat-tooltip {
  position: absolute;
  pointer-events: none;
  z-index: 60;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -100%) translateY(-10px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
}
.heat-tooltip.show {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -100%) translateY(-8px);
}
.heat-tooltip-body {
  background: #0C0D11;
  color: #FFFFFF;
  border: 1px solid var(--accent);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.75);
  padding: 7px 12px;
  font-family: var(--font-m);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.heat-tooltip-body strong {
  color: var(--accent);
  font-weight: 700;
}
[data-theme="light"] .heat-tooltip-body {
  background: #FFFFFF;
  color: #0E1013;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}
.heat-tooltip-arrow {
  position: absolute;
  bottom: -4px; left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 8px; height: 8px;
  background: #0C0D11;
  border-right: 1px solid var(--accent);
  border-bottom: 1px solid var(--accent);
}
[data-theme="light"] .heat-tooltip-arrow {
  background: #FFFFFF;
}

.heatmap-footer {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 16px; margin-top: 18px; padding-top: 16px;
  border-top: 1px solid var(--line);
  font-family: var(--font-m); font-size: 11.5px; color: var(--text-2);
}
.heatmap-period-info { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.heatmap-period-info strong { color: var(--text); font-weight: 600; }
.heatmap-peak-badge {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-line);
  padding: 2px 8px;
}
.heatmap-legend { display: flex; align-items: center; gap: 5px; }
.legend-txt { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; margin-inline: 2px; }
.legend-box { width: 11px; height: 11px; border: 1px solid rgba(255, 255, 255, 0.08); }
.legend-box.level-0 { background: var(--heat-l0); }
.legend-box.level-1 { background: var(--heat-l1); }
.legend-box.level-2 { background: var(--heat-l2); }
.legend-box.level-3 { background: var(--heat-l3); }
.legend-box.level-4 { background: var(--heat-l4); }

/* ---------- Trophies Grid ---------- */

.trophies-wrap { margin-top: 40px; }
.trophies-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 22px;
}
.trophies-badge {
  font-family: var(--font-m); font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.12em; color: #F59E0B;
  background: rgba(245, 158, 11, 0.1); border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 4px 10px;
}

.trophies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  align-items: stretch;
}

.trophy-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  padding: 16px 8px 14px;
  height: 100%;
  min-height: 180px;
  box-sizing: border-box;
  text-align: center;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background-color 0.3s ease;
  --mouse-x: 50%;
  --mouse-y: 50%;
}
.trophy-card::before {
  content: ""; position: absolute; inset: -1px; pointer-events: none;
  background: radial-gradient(180px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(233, 84, 32, 0.15), transparent 45%);
  opacity: 0; transition: opacity 0.4s ease; z-index: 2;
}
.trophy-card:hover::before { opacity: 1; }
.trophy-card:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.trophy-tag {
  font-family: var(--font-m); font-size: 9.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em; color: #60A5FA;
  margin-bottom: 6px; width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.trophy-icon-wrap {
  display: flex; align-items: center; justify-content: center;
  height: 60px; width: 100%; margin-block: 4px;
}
.trophy-svg { display: block; max-width: 100%; height: auto; }
.trophy-title {
  font-size: 11px; font-weight: 600; color: var(--text);
  margin-top: 6px; line-height: 1.25;
  min-height: 28px;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
}
.trophy-pts {
  font-family: var(--font-m); font-size: 10px; color: var(--text-2); margin-top: 2px;
}
.trophy-bar {
  width: 78%; height: 2px; background: var(--line-strong);
  margin-top: 8px; overflow: hidden;
}
.trophy-bar span { display: block; height: 100%; }

/* ---------- Journey timeline ---------- */

.journey .tl-rail path { stroke: rgba(232, 233, 235, 0.1); stroke-width: 2; vector-effect: non-scaling-stroke; fill: none; }
.journey .tl { position: relative; padding-left: 52px; }
.tl-rail { position: absolute; left: 8px; top: 4px; bottom: 4px; width: 2px; height: auto; }
.tl-list { display: grid; gap: 76px; }
.tl-item { display: grid; grid-template-columns: 190px 1fr; gap: 32px; }
.tl-when p {
  font-family: var(--font-m); font-size: 12px; text-transform: uppercase;
  letter-spacing: 0.14em; color: var(--text-2); padding-top: 7px;
}
.tl-what h3 { font-size: clamp(1.35rem, 2.3vw, 1.8rem); font-weight: 600; letter-spacing: -0.01em; }
.tl-org { margin-top: 8px; font-size: 14px; font-weight: 500; color: var(--accent); }
.tl-body { margin-top: 16px; color: var(--text-2); font-size: 15.5px; line-height: 1.7; max-width: 62ch; }
.tl-progress { stroke: var(--accent) !important; }

/* ---------- More builds infinite horizontal marquee ---------- */
 
.morebuilds {
  position: relative;
  z-index: 2;
  background: var(--bg);
  overflow: hidden;
  padding-block: clamp(64px, 10vh, 120px) clamp(80px, 12vh, 140px);
}
.pan-pin {
  padding-top: 0;
  background: transparent;
}
.pan-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 24px; margin-bottom: 36px;
}
.pan-head-content h2 {
  font-size: clamp(2rem, 4.4vw, 3.3rem);
  font-weight: 600; letter-spacing: -0.02em;
}
.pan-head-content p { color: var(--text-2); max-width: 46ch; margin-top: 8px; }

.pan-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.pan-progress-wrap {
  display: flex; align-items: center; gap: 14px;
  font-family: var(--font-m); font-size: 12px; letter-spacing: 0.1em;
  color: var(--text-2);
}
.pan-progress-track {
  width: 120px; height: 2px; background: var(--line-strong);
  overflow: hidden; position: relative;
}
.pan-progress-bar {
  height: 100%; width: 100%; background: var(--accent);
  transform-origin: left center; transform: scaleX(0.09);
  transition: transform 0.15s ease-out;
}

.pan-nav-btns {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pan-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  color: var(--text);
  cursor: pointer;
  border-radius: 0;
  transition: all 0.2s ease;
}
.pan-nav-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #0E1013;
  transform: translateY(-2px);
}
.pan-nav-btn:active {
  transform: scale(0.95);
}

/* More Builds Category Filter */
.pan-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.pan-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  color: var(--text-2);
  font-family: var(--font-m);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 6px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.pan-filter-btn:hover {
  border-color: var(--accent-line);
  color: var(--text);
}
.pan-filter-btn.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.pan-filter-btn .filter-count {
  font-size: 10px;
  opacity: 0.8;
  background: var(--bg-3);
  padding: 1px 5px;
  line-height: 1.2;
}
.pan-filter-btn.active .filter-count {
  background: var(--accent);
  color: #0B0C0E;
  font-weight: 600;
}

.pan-track-wrap {
  overflow: hidden;
  width: 100%;
  position: relative;
  mask-image: linear-gradient(to right, transparent, black 3%, black 97%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 3%, black 97%, transparent);
  padding-block: 12px 24px;
}
.pan-marquee-inner {
  display: flex;
  gap: 24px;
  width: max-content;
  animation: pan-infinite-marquee 50s linear infinite;
  will-change: transform;
}
.pan-marquee-inner:hover,
.pan-marquee-inner.is-paused {
  animation-play-state: paused;
}

@keyframes pan-infinite-marquee {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(calc(-50% - 12px), 0, 0);
  }
}

.pan-track {
  display: flex;
  gap: 24px;
  width: max-content;
  list-style: none;
  margin: 0;
  padding: 0;
}
.pan-card {
  width: clamp(280px, 28vw, 360px);
  flex-shrink: 0;
  border: 1px solid var(--line-strong);
  background: var(--bg-2);
  position: relative;
  box-shadow: var(--pan-shadow);
  will-change: transform;
  --mouse-x: 50%;
  --mouse-y: 50%;
  transition: opacity 0.35s ease, filter 0.35s ease, background-color 0.3s ease, border-color 0.3s ease, transform 0.3s var(--ease-out);
}
.pan-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
}
.pan-card.is-dimmed {
  opacity: 0.16;
  filter: grayscale(100%);
  pointer-events: none;
}

.pan-card figure { overflow: hidden; aspect-ratio: 720 / 520; border-bottom: 1px solid var(--line-strong); background: var(--card-media-bg); }
.pan-card figure img {
  width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(100%) contrast(1.12) brightness(0.85);
  transform: scale(1.001);
  transition: filter 0.45s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.65s var(--ease-out);
  will-change: filter, transform;
}
[data-theme="light"] .pan-card figure img {
  filter: grayscale(100%) contrast(1.06) brightness(0.92);
}
.pan-card:hover figure img {
  filter: grayscale(0%) contrast(1) brightness(1);
  transform: scale(1.03);
}
.pan-meta { position: relative; z-index: 3; padding: 24px 24px 28px; }
.pan-meta h3 { font-size: 1.25rem; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.pan-meta p { color: var(--card-desc-color); font-size: 14px; line-height: 1.6; }
.pan-links { display: flex; gap: 20px; margin-top: 16px; }
.pan-links a {
  font-family: var(--font-m); font-size: 12px; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--text);
  border-bottom: 1px solid var(--line-strong); padding-bottom: 4px;
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.pan-links a:hover { color: var(--accent); border-color: var(--accent); transform: translateX(2px); }

/* ---------- Contact footer ---------- */

.contact {
  border-top: 1px solid var(--line-strong);
  padding: clamp(90px, 12vh, 150px) 0 0;
  position: relative;
  overflow: hidden;
}
.contact::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 50% 42% at 12% 100%, var(--hero-glow), transparent 70%);
}
.contact .shell { position: relative; padding-bottom: 0; }

.footer-top-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: clamp(36px, 6vw, 80px);
  align-items: start;
  position: relative;
  z-index: 2;
}

.footer-contact-block {
  display: flex;
  flex-direction: column;
}

.contact-title {
  font-size: clamp(2.2rem, 4.8vw, 4.2rem);
  font-weight: 600; line-height: 1.05; letter-spacing: -0.03em;
}
.contact-title .line { display: block; overflow: hidden; }
.contact-title .line-inner { display: inline-block; will-change: transform; }

.footer-desc {
  margin-top: 20px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-2);
  max-width: 520px;
}

.email-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px;
  margin-top: 36px;
}
.email-link {
  display: inline-block; margin-top: 0;
  font-family: var(--font-m); font-size: clamp(1.05rem, 2.4vw, 1.85rem); font-weight: 400;
  letter-spacing: -0.01em;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat; background-position: 0 100%; background-size: 0% 2px;
  transition: background-size 0.5s var(--ease-out), color 0.3s ease;
  overflow-wrap: anywhere;
}
.email-link:hover { color: var(--accent); background-size: 100% 2px; }

.copy-email-btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 16px;
  font-family: var(--font-m); font-size: 11.5px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.1em;
  border: 1px solid var(--line-strong); background: var(--bg-2);
  color: var(--text); cursor: pointer; white-space: nowrap;
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease, transform 0.25s var(--ease-out);
}
.copy-email-btn:hover {
  border-color: var(--accent); background: var(--accent-soft); color: var(--accent);
}
.copy-email-btn .icon-check { display: none; }
.copy-email-btn.copied {
  border-color: #22c55e; background: rgba(34, 197, 94, 0.12); color: #22c55e;
}
.copy-email-btn.copied .icon-copy { display: none; }
.copy-email-btn.copied .icon-check { display: inline-block; }

.social-row { display: flex; gap: 12px; margin-top: 36px; }
.social-row a {
  display: grid; place-items: center; width: 48px; height: 48px;
  border: 1px solid var(--line-strong);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}
.social-row a:hover { background: var(--accent); border-color: var(--accent); }
.social-row a:hover img { filter: brightness(0) invert(1); }
.social-row a:hover .social-txt { color: #FFFFFF; }
.social-txt {
  font-family: var(--font-m); font-size: 16px; font-weight: 500;
  color: var(--text); line-height: 1;
}

/* Footer Navigation Sitemap */
.footer-nav-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(20px, 3vw, 40px);
}
.footer-nav-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.footer-col-title {
  font-family: var(--font-m);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  font-weight: 600;
}
.footer-nav-col ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-nav-col a {
  font-family: var(--font-d);
  font-size: 13.5px;
  color: var(--text-2);
  transition: color 0.2s ease, transform 0.2s ease;
  display: inline-block;
}
.footer-nav-col a:hover {
  color: var(--text);
  transform: translateX(3px);
}

/* Big Name Monumental Display at Bottom */
.footer-big-name-wrap {
  width: 100%;
  max-width: 100vw;
  overflow: hidden;
  margin-top: clamp(40px, 6vw, 84px);
  margin-bottom: clamp(4px, 1vw, 16px);
  padding-inline: clamp(8px, 2.5vw, 36px);
  display: flex;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  position: relative;
  user-select: none;
}
.footer-name-svg {
  width: 100%;
  max-width: min(1800px, 98vw);
  height: auto;
  display: block;
  overflow: visible;
  pointer-events: none;
}
.footer-svg-text {
  font-family: var(--font-d);
  font-size: 180px;
  font-weight: 700;
  letter-spacing: -0.035em;
  fill: var(--text);
  transition: fill 0.3s ease;
}

/* ---------- Toast notification ---------- */

.toast {
  position: fixed; bottom: 32px; right: 32px; z-index: 150;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px;
  background: var(--bg-2);
  border: 1px solid var(--accent);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  font-family: var(--font-m); font-size: 12.5px; letter-spacing: 0.04em;
  color: var(--text);
  pointer-events: none;
  opacity: 0; transform: translateY(16px);
  transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out);
}
.toast.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.toast-icon {
  display: grid; place-items: center;
  width: 20px; height: 20px;
  background: var(--accent); color: #0B0C0E;
  font-weight: 700; font-size: 11px;
}

/* Footer Bottom Bar */
.foot-bottom {
  width: 100%;
  border-top: 1px solid var(--line-strong);
  padding: 24px 0 32px;
  background: var(--foot-bg);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}
.foot-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-inline: clamp(24px, 4.5vw, 64px);
  font-family: var(--font-m);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--text-2);
}
.foot-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.foot-logo {
  font-family: var(--font-m);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}
.foot-logo .accent-dot {
  color: var(--accent);
}
.foot-role {
  font-size: 11px;
  color: var(--text-2);
  opacity: 0.75;
  border-left: 1px solid var(--line-strong);
  padding-left: 12px;
}
.foot-copy {
  display: flex;
  align-items: center;
  gap: 8px;
}
.to-top {
  font-family: var(--font-m);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-2);
  border-bottom: 1px solid transparent;
  padding-bottom: 3px;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.to-top:hover {
  color: var(--text);
  border-color: var(--accent);
}

/* ---------- Adaptive Icons & Elements for Light Mode ---------- */

[data-theme="light"] .marquee-track img,
[data-theme="light"] .nav-icon img,
[data-theme="light"] .card-links img,
[data-theme="light"] .sub-badge img,
[data-theme="light"] .social-row img {
  filter: brightness(0);
  opacity: 0.85;
}

[data-theme="light"] .social-row a:hover img {
  filter: brightness(0) invert(1);
  opacity: 1;
}

[data-theme="light"] .toast {
  background: #FFFFFF;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .copy-email-btn {
  background: #FFFFFF;
}

[data-theme="light"] .noise {
  opacity: 0.03;
  filter: invert(1);
}

/* ============================================================
   BLOG & EDITORIAL ARTICLES
   ============================================================ */

.blog-hero {
  padding-top: calc(var(--nav-h) + clamp(48px, 8vh, 80px));
  padding-bottom: clamp(40px, 6vh, 64px);
  border-bottom: 1px solid var(--line-strong);
}
.blog-back-wrap { margin-bottom: 24px; }
.back-link {
  font-family: var(--font-m); font-size: 12px; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--text-2);
  border-bottom: 1px solid transparent; padding-bottom: 2px;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.back-link:hover { color: var(--accent); border-color: var(--accent); }
.blog-hero-title {
  font-size: clamp(2.4rem, 5.2vw, 4.2rem);
  font-weight: 600; line-height: 1.05; letter-spacing: -0.025em;
  margin-block: 16px 20px;
}
.blog-hero-sub {
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  color: var(--card-desc-color); max-width: 780px; line-height: 1.6;
}

/* Filter pills */
.blog-filter-bar {
  display: flex; flex-wrap: wrap; gap: 10px; margin-top: 36px;
}
.filter-pill {
  font-family: var(--font-m); font-size: 11.5px; text-transform: uppercase;
  letter-spacing: 0.08em; padding: 8px 16px;
  background: var(--bg-2); border: 1px solid var(--line);
  color: var(--text-2); cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.filter-pill:hover { border-color: var(--line-strong); color: var(--text); }
.filter-pill.active {
  background: var(--accent-soft); border-color: var(--accent);
  color: var(--accent); font-weight: 600;
}

/* Featured post */
.blog-posts-section { padding-block: clamp(60px, 8vh, 100px); }
.featured-post-card {
  position: relative;
  background: var(--bg-2); border: 1px solid var(--line-strong);
  padding: clamp(28px, 4vw, 48px);
  margin-bottom: 48px;
  box-shadow: var(--pan-shadow);
  transition: border-color 0.3s ease;
}
.featured-post-card:hover { border-color: var(--accent); }
.featured-post-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-m); font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.14em; color: var(--accent);
  background: var(--accent-soft); border: 1px solid var(--accent-line);
  padding: 4px 12px; margin-bottom: 24px;
}
.featured-post-grid {
  display: grid; grid-template-columns: 1.2fr 0.8fr; gap: clamp(28px, 4vw, 48px);
  align-items: center;
}
.post-meta-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  font-family: var(--font-m); font-size: 11px; color: var(--text-2);
  margin-bottom: 16px;
}
.post-tag {
  color: var(--accent); text-transform: uppercase; letter-spacing: 0.12em;
  font-weight: 600;
}
.featured-post-title {
  font-size: clamp(1.8rem, 3.2vw, 2.6rem);
  font-weight: 600; line-height: 1.15; letter-spacing: -0.02em;
  margin-bottom: 18px;
}
.featured-post-title a { color: var(--text); transition: color 0.2s ease; }
.featured-post-title a:hover { color: var(--accent); }
.featured-post-desc {
  font-size: 15.5px; line-height: 1.68; color: var(--card-desc-color);
  margin-bottom: 24px;
}
.featured-post-takeaways { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.takeaway-pill {
  font-family: var(--font-m); font-size: 11px; letter-spacing: 0.04em;
  background: var(--chip-bg); border: 1px solid var(--line);
  color: var(--text-2); padding: 4px 10px;
}

/* Code box preview */
.code-preview-box {
  background: #0E0F13; border: 1px solid var(--line-strong);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
}
.code-preview-head {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot.red { background: #EF4444; }
.dot.yellow { background: #F59E0B; }
.dot.green { background: #10B981; }
.code-title {
  font-family: var(--font-m); font-size: 11px; color: var(--text-2);
  margin-left: 6px; letter-spacing: 0.04em;
}
.code-block {
  padding: 18px 20px; margin: 0; font-family: var(--font-m);
  font-size: 12.5px; line-height: 1.7; color: #E2E8F0;
  overflow-x: auto;
}

/* Articles grid */
.articles-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}
.article-card {
  display: flex; flex-direction: column; justify-content: space-between;
  background: var(--bg-2); border: 1px solid var(--line-strong);
  padding: 28px 24px 24px; min-height: 240px;
  transition: border-color 0.25s ease, transform 0.25s var(--ease-out);
}
.article-card:hover {
  border-color: var(--accent); transform: translateY(-3px);
}
.article-title {
  font-size: 1.25rem; font-weight: 600; line-height: 1.3;
  margin-block: 14px 12px;
}
.article-title a { color: var(--text); transition: color 0.2s ease; }
.article-title a:hover { color: var(--accent); }
.article-desc { font-size: 14px; line-height: 1.6; color: var(--card-desc-color); margin-bottom: 20px; }
.article-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 16px; border-top: 1px solid var(--line);
  font-family: var(--font-m); font-size: 11.5px; color: var(--text-2);
}
.article-link {
  color: var(--accent); text-transform: uppercase; letter-spacing: 0.08em;
  font-weight: 600;
}

/* ============================================================
   ARTICLE DETAIL PAGE
   ============================================================ */

.article-header {
  padding-top: calc(var(--nav-h) + clamp(48px, 8vh, 80px));
  padding-bottom: 40px;
  border-bottom: 1px solid var(--line-strong);
}
.article-breadcrumb { margin-bottom: 24px; }
.article-shell { max-width: 1100px; }
.article-main-title {
  font-size: clamp(2.4rem, 4.8vw, 3.8rem);
  font-weight: 600; line-height: 1.08; letter-spacing: -0.025em;
  margin-block: 16px 20px; max-width: 960px;
}
.article-lead {
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  line-height: 1.6; color: var(--card-desc-color); max-width: 820px;
  margin-bottom: 32px;
}
.author-bar { display: flex; align-items: center; gap: 14px; }
.author-avatar { border-radius: 50%; border: 1px solid var(--accent); }
.author-info { display: flex; flex-direction: column; gap: 2px; }
.author-name { font-weight: 600; font-size: 14.5px; color: var(--text); }
.author-role { font-family: var(--font-m); font-size: 11.5px; color: var(--text-2); }

/* Article layout with sticky TOC */
.article-layout {
  display: grid; grid-template-columns: 260px 1fr; gap: clamp(36px, 5vw, 64px);
  padding-block: clamp(48px, 7vh, 80px);
}
.article-toc { position: relative; }
.toc-inner {
  position: sticky; top: calc(var(--nav-h) + 32px);
  padding: 20px; background: var(--bg-2); border: 1px solid var(--line-strong);
}
.toc-title {
  font-family: var(--font-m); font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.14em; color: var(--accent); margin-bottom: 14px;
}
.toc-title-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.toc-title-row .toc-title { margin-bottom: 0; }
.toc-progress-pill {
  font-family: var(--font-m); font-size: 9.5px; letter-spacing: 0.1em;
  color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-line);
  padding: 2px 6px; font-weight: 600;
}
.toc-nav { display: flex; flex-direction: column; gap: 10px; }
.toc-nav a {
  font-family: var(--font-m); font-size: 11.5px; color: var(--text-2);
  line-height: 1.4; transition: color 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
.toc-nav a:hover { color: var(--accent); transform: translateX(3px); }
.toc-nav a.active {
  color: var(--accent); font-weight: 600; transform: translateX(4px);
  border-left: 2px solid var(--accent); padding-left: 6px;
}

/* Article action bar */
.article-actions-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-top: 24px; padding-top: 18px;
  border-top: 1px solid var(--line); flex-wrap: wrap;
}
.article-metrics-badge {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-m); font-size: 11px; color: var(--text-2);
}
.article-metrics-badge .metric-item { display: inline-flex; align-items: center; gap: 6px; }
.article-metrics-badge .metric-divider { opacity: 0.4; }
.article-share-group { display: flex; align-items: center; gap: 8px; }
.article-share-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg-2); border: 1px solid var(--line-strong);
  color: var(--text-2); font-family: var(--font-m); font-size: 11px;
  font-weight: 500; letter-spacing: 0.04em; padding: 5px 12px;
  cursor: pointer; transition: all 0.2s ease;
}
.article-share-btn:hover {
  border-color: var(--accent-line); color: var(--text); background: var(--accent-soft);
}
.article-share-btn svg { color: currentColor; }

/* Article code blocks */
.article-code-block {
  background: var(--bg-2); border: 1px solid var(--line-strong);
  margin-block: 24px 28px; overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}
.code-block-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 16px; background: var(--bg-3); border-bottom: 1px solid var(--line);
  font-family: var(--font-m); font-size: 11px;
}
.code-file-meta { display: flex; align-items: center; gap: 8px; }
.code-file-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.code-file-title { color: var(--text); letter-spacing: 0.04em; font-weight: 500; }
.code-block-actions { display: flex; align-items: center; gap: 8px; }
.code-badge {
  font-size: 10px; letter-spacing: 0.08em; color: var(--text-2);
  text-transform: uppercase; background: var(--bg); border: 1px solid var(--line);
  padding: 2px 7px;
}
.code-copy-trigger {
  background: transparent; border: 1px solid var(--line-strong);
  color: var(--text-2); font-family: var(--font-m); font-size: 10.5px;
  padding: 3px 8px; cursor: pointer; text-transform: uppercase;
  letter-spacing: 0.06em; transition: all 0.15s ease;
}
.code-copy-trigger:hover { color: var(--text); border-color: var(--accent-line); }
.code-content {
  padding: 16px 18px; overflow-x: auto; margin: 0;
  font-family: var(--font-m); font-size: 12.5px; line-height: 1.65;
  color: #E2E4E8; background: var(--bg);
}
[data-theme="light"] .code-content { color: #1E293B; background: #F8FAFC; }

/* Blog filter pills */
.blog-filter-bar {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 28px; flex-wrap: wrap;
}
.blog-filter-pill {
  background: var(--bg-2); border: 1px solid var(--line-strong);
  color: var(--text-2); font-family: var(--font-m); font-size: 11px;
  font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 6px 14px; cursor: pointer; transition: all 0.2s ease;
}
.blog-filter-pill:hover { border-color: var(--accent-line); color: var(--text); }
.blog-filter-pill.active {
  background: var(--accent-soft); border-color: var(--accent); color: var(--accent);
}


/* Article content typography */
.article-content { max-width: 720px; }
.article-content section { padding-block: 0 48px; }
.article-content h2 {
  font-size: clamp(1.6rem, 2.8vw, 2.1rem);
  font-weight: 600; letter-spacing: -0.015em; line-height: 1.2;
  margin-block: 24px 16px; color: var(--text);
  border-bottom: 1px solid var(--line); padding-bottom: 12px;
}
.article-content h3 {
  font-size: 1.25rem; font-weight: 600; margin-block: 20px 10px;
  color: var(--text);
}
.article-content p {
  font-size: 16px; line-height: 1.78; color: var(--card-desc-color);
  margin-bottom: 20px;
}
.article-content ul, .article-content ol {
  margin-bottom: 24px; padding-left: 20px;
  color: var(--card-desc-color); font-size: 15.5px; line-height: 1.75;
}
.article-content li { margin-bottom: 8px; }
.article-content strong { color: var(--text); font-weight: 600; }
.article-content em { color: var(--text); font-style: italic; }

.version-badge {
  display: inline-block; font-family: var(--font-m); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--text-2); background: var(--bg-3); border: 1px solid var(--line-strong);
  padding: 4px 12px; margin-bottom: 16px;
}
.version-badge.highlight {
  color: var(--accent); background: var(--accent-soft); border-color: var(--accent-line);
}

/* Portfolio preview mockups */
.portfolio-preview-card {
  background: var(--bg-2); border: 1px solid var(--line-strong);
  margin-block: 20px 28px; box-shadow: var(--pan-shadow);
  transition: border-color 0.25s ease, transform 0.25s var(--ease-out);
}
.portfolio-preview-card:hover {
  border-color: var(--accent); transform: translateY(-2px);
}
.mockup-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02); font-family: var(--font-m);
}
.mockup-dots { display: flex; align-items: center; gap: 6px; }
.mockup-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.mockup-dot.red { background: #EF4444; }
.mockup-dot.yellow { background: #F59E0B; }
.mockup-dot.green { background: #10B981; }
.mockup-url-bar {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg); border: 1px solid var(--line);
  padding: 4px 12px; font-size: 11px; color: var(--text-2);
  flex-grow: 1; max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.url-lock { font-size: 11px; opacity: 0.8; }
.mockup-btn {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-line);
  padding: 4px 10px; transition: background 0.2s ease, color 0.2s ease;
}
.mockup-btn:hover { background: var(--accent); color: #0B0C0E; }
.mockup-body { padding: 22px 24px; }
.mockup-kicker {
  font-family: var(--font-m); font-size: 10px; text-transform: uppercase;
  letter-spacing: 0.16em; color: var(--accent); margin-bottom: 6px;
}
.mockup-title { font-size: 1.2rem; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.mockup-desc { font-size: 14px; line-height: 1.6; color: var(--card-desc-color); margin-bottom: 16px; }
.mockup-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.mockup-tag {
  font-family: var(--font-m); font-size: 11px; color: var(--text-2);
  background: var(--chip-bg); border: 1px solid var(--line);
  padding: 3px 8px;
}

/* Terminal mockup variant */
.terminal-head { background: #0E1015; }
.terminal-body-mockup {
  background: #090A0D; font-family: var(--font-m);
  padding: 20px 24px;
}
.terminal-prompt-line { font-size: 13px; color: var(--text-2); margin-bottom: 4px; }
.t-user { color: #10B981; font-weight: 600; }
.t-path { color: #3B82F6; font-weight: 600; }
.t-cmd { color: #F59E0B; font-weight: 600; }
.terminal-output { font-size: 13px; color: #E2E8F0; margin-bottom: 12px; padding-left: 8px; }

/* Scrapbook mockup variant */
.scrapbook-card { border-color: rgba(217, 119, 6, 0.35); }
.scrapbook-head { background: rgba(217, 119, 6, 0.06); }
.scrapbook-body { background: rgba(254, 243, 199, 0.03); }

.article-callout {
  padding: 20px 24px; background: var(--bg-2); border-left: 3px solid var(--accent);
  margin-block: 24px;
}
.callout-kicker {
  font-family: var(--font-m); font-size: 10.5px; text-transform: uppercase;
  letter-spacing: 0.14em; color: var(--accent); margin-bottom: 6px;
}
.article-callout p { margin-bottom: 0; font-size: 15px; }

/* Evolution table */
.table-wrap { overflow-x: auto; margin-block: 24px 36px; }
.evolution-table {
  width: 100%; border-collapse: collapse; text-align: left;
  font-family: var(--font-m); font-size: 12.5px;
}
.evolution-table th, .evolution-table td {
  padding: 12px 16px; border: 1px solid var(--line-strong);
}
.evolution-table th {
  background: var(--bg-2); color: var(--accent); text-transform: uppercase;
  letter-spacing: 0.08em; font-size: 11px;
}
.evolution-table td { background: var(--bg); color: var(--text-2); }
.evolution-table tr:hover td { background: var(--bg-2); color: var(--text); }

/* Takeaways list */
.takeaways-list { display: grid; gap: 20px; margin-block: 24px 40px; }
.takeaway-item {
  display: grid; grid-template-columns: 48px 1fr; gap: 18px;
  background: var(--bg-2); border: 1px solid var(--line-strong);
  padding: 20px 22px;
}
.takeaway-num {
  font-family: var(--font-m); font-size: 18px; font-weight: 700;
  color: var(--accent);
}
.takeaway-text h4 { font-size: 1.1rem; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.takeaway-text p { margin-bottom: 0; font-size: 14.5px; line-height: 1.6; }

/* Author bio box */
.article-author-box {
  display: flex; gap: 20px; align-items: flex-start;
  padding: 28px; background: var(--bg-2); border: 1px solid var(--line-strong);
  margin-top: 48px;
}
.author-box-avatar { border-radius: 50%; border: 2px solid var(--accent); flex-shrink: 0; }
.author-box-content h3 { font-size: 1.15rem; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.author-box-content p { font-size: 14px; line-height: 1.6; color: var(--card-desc-color); margin-bottom: 12px; }
.author-box-links { display: flex; gap: 14px; font-family: var(--font-m); font-size: 12px; }
.author-box-links a { color: var(--accent); text-decoration: underline; }

/* Pager */
.article-pager {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
  margin-top: 40px; padding-top: 32px; border-top: 1px solid var(--line);
}
.pager-btn {
  display: flex; flex-direction: column; gap: 4px;
  padding: 18px 20px; background: var(--bg-2); border: 1px solid var(--line-strong);
  transition: border-color 0.2s ease;
}
.pager-btn:hover { border-color: var(--accent); }
.pager-label {
  font-family: var(--font-m); font-size: 10.5px; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--accent);
}
.pager-title { font-weight: 600; font-size: 13.5px; color: var(--text); }
.pager-btn.next { text-align: right; }

/* ---------- Responsive Media Queries & Mobile System ---------- */

/* Overflow guard for small screens */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

@media (max-width: 1024px) {
  .stack-card { grid-template-columns: 1fr; min-height: 0; padding: clamp(24px, 4vw, 40px); }
  .card-media { min-height: 260px; aspect-ratio: 16 / 10; }
  .tl-item { grid-template-columns: 140px 1fr; }
  .article-layout { grid-template-columns: 220px 1fr; gap: 36px; }
}

@media (max-width: 1180px) {
  .nav {
    padding-inline: clamp(16px, 2.5vw, 32px);
    gap: 16px;
  }
  .nav-links {
    gap: clamp(10px, 1.5vw, 20px);
  }
  .nav-links a {
    font-size: 11px;
    letter-spacing: 0.08em;
  }
  .cmd-trigger-kbd {
    display: none;
  }
}

@media (max-width: 990px) {
  .nav {
    padding-inline: 16px;
    gap: 12px;
  }
  .nav-links {
    gap: clamp(8px, 1.2vw, 14px);
  }
  .nav-links a {
    font-size: 10.5px;
    letter-spacing: 0.06em;
  }
  .cmd-trigger-text {
    display: none;
  }
  .cmd-trigger {
    width: 30px;
    height: 30px;
    padding: 0;
    justify-content: center;
  }
  .nav-actions {
    gap: 10px;
  }
}

@media (max-width: 900px) {
  .span6, .span4, .span3 { grid-column: span 6; }
  .cell-img { grid-column: span 12; }
  .cell { min-height: 160px; }
  .project-showcase-card {
    grid-template-columns: 1fr !important;
    gap: 24px;
    padding: clamp(20px, 4vw, 32px);
    margin-bottom: 36px;
  }
  .project-showcase-card:nth-child(even) .project-media-frame {
    order: 0 !important;
  }
  .featured-post-grid { grid-template-columns: 1fr; gap: 28px; }
  .article-layout { grid-template-columns: 1fr; }
  .article-toc { display: none; }
  .article-pager { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  :root { --nav-h: 84px; }
  
  /* Strict container constraints */
  html, body, main, section, footer, .hero, .morebuilds {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: clip !important;
    box-sizing: border-box !important;
  }

  section[id], footer[id] { scroll-margin-top: 96px; }
  section { padding-block: clamp(56px, 9vh, 88px) 0; }
  .section-head { margin-bottom: 36px; gap: 12px; }
  .section-head h2 {
    font-size: clamp(1.65rem, 6.8vw, 2.6rem);
    word-break: break-word;
  }
  .shell, .shell-wide {
    width: 100% !important;
    max-width: calc(100vw - 32px) !important;
    margin-inline: auto !important;
    box-sizing: border-box !important;
    padding-inline: 0 !important;
  }

  /* Robust 2-Row Grid Mobile Navigation Bar */
  .nav {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    grid-template-rows: auto auto !important;
    padding-inline: 16px !important;
    padding-block: 10px 8px !important;
    gap: 6px 12px !important;
    height: auto !important;
    min-height: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    background: rgba(11, 12, 14, 0.96) !important;
  }
  [data-theme="light"] .nav {
    background: rgba(246, 247, 249, 0.96) !important;
  }
  .nav-logo {
    grid-column: 1 !important;
    grid-row: 1 !important;
    align-self: center !important;
    min-width: 0 !important;
  }
  .nav-actions {
    grid-column: 2 !important;
    grid-row: 1 !important;
    align-self: center !important;
    justify-self: end !important;
    gap: 14px !important;
    min-width: 0 !important;
    flex-shrink: 0 !important;
  }
  .cmd-trigger {
    width: 28px !important;
    height: 28px !important;
    padding: 0 !important;
    justify-content: center !important;
  }
  .cmd-trigger-text,
  .cmd-trigger-kbd {
    display: none !important;
  }
  .nav-links {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    display: flex !important;
    align-items: center !important;
    gap: 14px !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    padding-top: 6px !important;
    padding-bottom: 2px !important;
    border-top: 1px solid var(--line) !important;
  }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links a {
    font-size: 11px !important;
    white-space: nowrap !important;
    padding: 2px 0 !important;
    flex-shrink: 0 !important;
  }

  /* Hero Section */
  .hero-inner { padding-top: calc(var(--nav-h) + 48px); padding-bottom: 44px; }
  .hero-name { font-size: clamp(2.2rem, 10vw, 4.4rem); word-break: break-word; }
  .hero-tagline { font-size: clamp(1.3rem, 5.5vw, 2.2rem); margin-block: 14px 18px; word-break: break-word; }
  .hero-desc { font-size: 14px; line-height: 1.6; }
  .hero-status { flex-direction: column; align-items: flex-start; gap: 8px; }
  .hero-status span { max-width: 100%; font-size: 11.5px; }
  .hero-ctas { flex-direction: column; width: 100%; gap: 10px; }
  .btn { width: 100%; height: 46px; font-size: 12px; }

  /* Bento Stats Grid */
  .proof-grid { gap: 12px; width: 100%; max-width: 100%; }
  .span6, .span4, .span3, .cell-img { grid-column: span 12 !important; }
  .cell { padding: 18px 16px; min-height: 120px; }
  .cell-num { font-size: clamp(1.8rem, 7.5vw, 2.6rem); }
  .cell-desc { font-size: 13px; line-height: 1.5; }

  /* Heatmap Card */
  .heatmap-card { padding: 16px 12px; margin-bottom: 28px; width: 100%; }
  .heatmap-head {
    flex-direction: column; align-items: flex-start;
    gap: 12px; padding-bottom: 12px; margin-bottom: 12px;
  }
  .heatmap-meta { width: 100%; justify-content: space-between; gap: 8px; }
  .heatmap-alltime-pill { font-size: 9.5px; padding: 3px 8px; }
  .heatmap-years-bar {
    width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap; padding-bottom: 6px; gap: 6px;
  }
  .year-tab { font-size: 10px; padding: 4px 8px; white-space: nowrap; flex-shrink: 0; }
  .heatmap-scroll-wrap {
    width: 100%; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
  }
  .heatmap-foot {
    flex-direction: column; align-items: flex-start;
    gap: 10px; margin-top: 12px; padding-top: 12px;
  }
  .heatmap-legend { width: 100%; justify-content: flex-start; }

  /* Achievement Trophies */
  .trophy-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
  .trophy-card { padding: 10px 6px; min-height: 135px; }
  .trophy-icon svg { width: 40px; height: 40px; }
  .trophy-name { font-size: 9px; min-height: 22px; }
  .trophy-rank { font-size: 8.5px; padding: 2px 5px; }

  /* Timeline */
  .tl { padding-left: 20px; }
  .tl-rail { left: 2px; }
  .tl-item { grid-template-columns: 1fr; gap: 8px; }
  .tl-when p { padding-top: 0; }
  .tl-meta-chips { gap: 6px; }
  .chip { font-size: 9.5px; padding: 2px 7px; }

  /* Selected Work Editorial Cards */
  .editorial-projects-list {
    gap: 28px;
  }
  .project-showcase-card {
    padding: 16px 14px;
    gap: 16px;
    margin-bottom: 20px;
    border-radius: 0;
    width: 100%;
  }
  .project-title { font-size: clamp(1.4rem, 6vw, 1.9rem); margin-bottom: 8px; }
  .project-tagline { font-size: 13.5px; margin-bottom: 8px; }
  .project-desc { font-size: 13px; line-height: 1.55; margin-bottom: 16px; }
  .chip-row { gap: 6px; margin-bottom: 18px; }
  .chip-row li { font-size: 9.5px; padding: 4px 8px; letter-spacing: 0.08em; }

  .project-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }
  .project-actions .btn {
    font-size: 11px;
    height: 38px;
    padding: 0 10px;
    justify-content: center;
    width: 100%;
  }
  .project-actions .btn-inspect {
    grid-column: 1 / -1;
  }

  /* Deep Dive Inspector on Mobile */
  .inspector-header { margin-bottom: 12px; }
  .inspector-tabs {
    width: 100%;
    display: flex;
    gap: 4px;
  }
  .inspector-tab-btn {
    flex: 1;
    text-align: center;
    font-size: 10px;
    padding: 6px 4px;
    white-space: nowrap;
  }
  .inspector-arch-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .arch-card {
    padding: 12px 10px;
  }
  .arch-card h4 {
    font-size: 10.5px;
  }
  .arch-card p {
    font-size: 12.5px;
    line-height: 1.5;
  }
  .inspector-code-box pre {
    padding: 12px 10px;
    font-size: 11px;
    line-height: 1.55;
  }
  .code-box-header {
    padding: 7px 10px;
  }
  .code-box-lang {
    font-size: 9.5px;
  }
  .code-copy-btn {
    font-size: 9px;
    padding: 2px 6px;
  }

  /* More Builds Section & Filter Bar */
  .pan-head { margin-bottom: 16px; }
  .pan-filter-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 6px;
    margin-inline: -16px;
    padding-inline: 16px;
    gap: 6px;
  }
  .pan-filter-bar::-webkit-scrollbar { display: none; }
  .pan-filter-btn {
    flex-shrink: 0;
    white-space: nowrap;
    font-size: 10px;
    padding: 5px 10px;
  }
  .pan-track-wrap {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    padding-bottom: 12px;
    box-sizing: border-box;
  }
  .pan-track {
    display: flex !important;
    gap: 14px !important;
    width: max-content !important;
    box-sizing: border-box;
  }
  .pan-card {
    width: clamp(250px, 76vw, 300px) !important;
    flex-shrink: 0 !important;
    box-sizing: border-box;
  }
  .pan-meta { padding: 12px 10px; }
  .pan-meta h3 { font-size: 1.05rem; }
  .pan-meta p { font-size: 12px; line-height: 1.5; }

  /* Blog Archive Topic Filter Bar */
  .blog-filter-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 6px;
    margin-inline: -16px;
    padding-inline: 16px;
    gap: 6px;
  }
  .blog-filter-bar::-webkit-scrollbar { display: none; }
  .blog-filter-pill {
    flex-shrink: 0;
    white-space: nowrap;
    font-size: 10px;
    padding: 5px 10px;
  }

  /* Featured Writing / Blog Section */
  .featured-post-card { padding: 18px 14px; margin-bottom: 28px; width: 100%; }
  .featured-post-title { font-size: clamp(1.25rem, 5vw, 1.75rem); line-height: 1.2; }
  .featured-post-desc { font-size: 13px; line-height: 1.55; }
  .featured-post-takeaways { gap: 5px; margin-bottom: 16px; }
  .takeaway-pill { font-size: 9.5px; padding: 2px 7px; }
  .featured-post-action {
    display: flex; flex-direction: column; align-items: stretch; gap: 8px;
  }
  .featured-post-action .btn { margin-left: 0 !important; width: 100%; }
  .code-preview-box { max-width: 100%; }
  .code-block { font-size: 10.5px; padding: 12px 14px; line-height: 1.45; }

  /* Blog Hub & Article Pages */
  .blog-hero { padding-top: calc(var(--nav-h) + 48px); padding-bottom: 28px; }
  .blog-hero-title { font-size: clamp(1.7rem, 7vw, 2.7rem); line-height: 1.1; }
  .blog-hero-sub { font-size: 13.5px; }
  .article-header { padding-top: calc(var(--nav-h) + 48px); padding-bottom: 20px; }
  .article-main-title { font-size: clamp(1.6rem, 6.5vw, 2.4rem); line-height: 1.12; }
  .article-lead { font-size: 14px; line-height: 1.55; }
  .article-layout { padding-block: 24px; }
  .article-content section { padding-block: 0 32px; }
  .article-content h2 { font-size: 1.35rem; }
  .article-content p, .article-content ul, .article-content ol { font-size: 14px; line-height: 1.65; }

  /* Portfolio Preview Mockup Cards */
  .portfolio-preview-card { margin-block: 14px 18px; width: 100%; }
  .mockup-header {
    flex-direction: column; align-items: stretch; gap: 8px; padding: 10px 12px;
  }
  .mockup-url-bar { max-width: 100%; font-size: 9.5px; order: 2; }
  .mockup-btn { align-self: flex-start; order: 3; font-size: 9.5px; }
  .mockup-body { padding: 14px 12px; }
  .terminal-body-mockup { padding: 12px 10px; font-size: 10.5px; }

  /* Tables & Takeaways */
  .table-wrap { margin-block: 14px 20px; -webkit-overflow-scrolling: touch; width: 100%; }
  .evolution-table th, .evolution-table td { padding: 7px 9px; font-size: 10.5px; white-space: nowrap; }
  .takeaway-item { grid-template-columns: 1fr; gap: 6px; padding: 12px 14px; }
  .article-author-box { flex-direction: column; align-items: flex-start; gap: 10px; padding: 16px 14px; }
  .article-pager { grid-template-columns: 1fr; gap: 10px; }

  /* Contact & Footer */
  .contact {
    padding-top: clamp(40px, 7vh, 60px);
    scroll-margin-top: calc(var(--nav-h) + 24px);
  }
  .contact-title {
    font-size: clamp(1.75rem, 6.8vw, 2.6rem);
    line-height: 1.08;
  }
  .footer-desc {
    font-size: 13.5px;
    line-height: 1.55;
    margin-top: 12px;
  }
  .footer-top-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .email-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 18px;
    padding: 8px 12px;
    background: var(--bg-2);
    border: 1px solid var(--line-strong);
    width: 100%;
    box-sizing: border-box;
  }
  .email-link {
    font-size: clamp(12px, 3.6vw, 14px);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .copy-email-btn {
    height: 32px;
    padding: 0 12px;
    font-size: 10.5px;
    flex-shrink: 0;
  }
  .social-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
  }
  .social-row a {
    width: 38px;
    height: 38px;
  }
  .social-row a img {
    width: 18px;
    height: 18px;
  }
  .social-txt {
    font-size: 14px;
  }
  .footer-nav-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px 10px;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
  }
  .footer-nav-col {
    gap: 8px;
  }
  .footer-col-title {
    font-size: 10.5px;
    letter-spacing: 0.1em;
  }
  .footer-nav-col ul {
    gap: 6px;
  }
  .footer-nav-col a {
    font-size: 11.5px;
    line-height: 1.35;
  }
  .footer-big-name-wrap {
    margin-top: 24px;
    margin-bottom: 8px;
    padding-inline: 4px;
  }
  .foot-bottom {
    padding: 16px 0 24px;
  }
  .foot-row {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    font-size: 11px;
  }
  .foot-brand {
    flex-direction: row;
    gap: 8px;
  }
  .foot-role {
    border-left: 1px solid var(--line-strong);
    padding-left: 8px;
  }
  .toast { left: 12px; right: 12px; bottom: 16px; justify-content: center; text-align: center; }
}

@media (max-width: 480px) {
  .shell, .shell-wide { max-width: calc(100vw - 24px) !important; }
  .hero-inner { padding-top: calc(var(--nav-h) + 24px); }
  .hero-name { font-size: clamp(1.9rem, 11vw, 3rem); }
  .hero-tagline { font-size: clamp(1.15rem, 6vw, 1.7rem); }
  .trophy-grid { grid-template-columns: repeat(2, 1fr); }
  .marquee-track { gap: 24px; padding-right: 24px; }
  .marquee-track li span { font-size: 11px; }
  .cell-num { font-size: 2rem; }
  .card-media { min-height: 150px; }
  .footer-nav-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px 6px;
  }
  .footer-col-title { font-size: 9.5px; }
  .footer-nav-col a { font-size: 10.5px; }
  .footer-big-name-wrap { padding-inline: 2px; }

  /* Article and code blocks on mobile */
  .article-actions-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .article-share-group {
    width: 100%;
    display: flex;
    gap: 8px;
  }
  .article-share-btn {
    flex: 1;
    justify-content: center;
    font-size: 10px;
    padding: 7px 8px;
  }
  .code-block-bar {
    padding: 7px 10px;
    gap: 8px;
  }
  .code-file-title {
    font-size: 10px;
    max-width: 140px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .code-content {
    padding: 12px 10px;
    font-size: 11px;
    line-height: 1.55;
  }

  /* Sprint Focus Strip */
  .focus-strip {
    padding: 10px 12px;
    gap: 6px;
  }
  .focus-strip-title {
    font-size: 11.5px;
  }
  .focus-strip-tag {
    font-size: 9px;
    padding: 1px 5px;
  }
}

@media (max-width: 360px) {
  .nav { padding-inline: 10px !important; gap: 4px 8px !important; }
  .nav-logo { font-size: 13.5px !important; }
  .nav-actions { gap: 8px !important; }
  .hero-name { font-size: clamp(1.6rem, 9.5vw, 2.2rem); }
  .hero-tagline { font-size: 1.1rem; }
  .footer-nav-grid { grid-template-columns: 1fr; gap: 14px; }
  .email-row { flex-direction: column; align-items: stretch; gap: 8px; }
  .copy-email-btn { width: 100%; }
  .email-link { text-align: center; font-size: 12px; }
  .pan-card { width: 85vw !important; }
}

/* Command palette dialog */

body.cmd-open {
  overflow: hidden !important;
}

.cmd-backdrop {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(11, 12, 14, 0.78);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(36px, 10vh, 96px) 16px 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
[data-theme="light"] .cmd-backdrop {
  background: rgba(246, 247, 249, 0.82);
}
.cmd-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.cmd-modal {
  width: min(600px, 100%);
  max-height: min(540px, calc(100dvh - 80px));
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7), 0 0 0 1px var(--line);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(-8px) scale(0.985);
  transition: transform 0.2s var(--ease-out);
}
[data-theme="light"] .cmd-modal {
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.12), 0 0 0 1px var(--line);
}
.cmd-backdrop.is-open .cmd-modal {
  transform: translateY(0) scale(1);
}

.cmd-search-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}
.cmd-search-icon {
  color: var(--text-2);
  flex-shrink: 0;
}
.cmd-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-d);
  font-size: 15px;
  color: var(--text);
  padding: 0;
  line-height: 1.4;
}
.cmd-input::placeholder {
  color: var(--text-2);
  opacity: 0.7;
  font-size: 14px;
}
.cmd-close {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
}
.cmd-close kbd {
  font-family: var(--font-m);
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg-3);
  border: 1px solid var(--line-strong);
  color: var(--text-2);
  display: inline-block;
  line-height: 1;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.cmd-close:hover kbd {
  color: var(--text);
  border-color: var(--accent-line);
}

.cmd-list-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 10px 8px;
  overscroll-behavior: contain;
}
.cmd-list-wrap::-webkit-scrollbar {
  width: 6px;
}
.cmd-list-wrap::-webkit-scrollbar-track {
  background: transparent;
}
.cmd-list-wrap::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 3px;
}

.cmd-group {
  margin-bottom: 8px;
}
.cmd-group:last-child {
  margin-bottom: 0;
}
.cmd-group-title {
  font-family: var(--font-m);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-2);
  padding: 6px 10px 4px;
  opacity: 0.75;
}

.cmd-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text);
  border: 1px solid transparent;
  text-decoration: none;
  transition: background 0.12s ease, border-color 0.12s ease;
  user-select: none;
  margin-block: 1px;
}
.cmd-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}
.cmd-item-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--bg-3);
  color: var(--text-2);
  flex-shrink: 0;
  border: 1px solid var(--line);
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.cmd-item-info {
  min-width: 0;
  flex: 1;
}
.cmd-item-title {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
}
.cmd-item-desc {
  font-size: 11.5px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}
.cmd-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.cmd-item-tag {
  font-family: var(--font-m);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--chip-bg);
  color: var(--text-2);
  border: 1px solid var(--line);
  letter-spacing: 0.04em;
}
.cmd-item-hint {
  display: none;
  font-family: var(--font-m);
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-line);
}

.cmd-item.is-active {
  background: var(--bg-3);
  border-color: var(--line-strong);
}
.cmd-item.is-active .cmd-item-icon {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent-line);
}
.cmd-item.is-active .cmd-item-hint {
  display: inline-flex;
  align-items: center;
}
.cmd-item.is-active .cmd-item-tag {
  display: none;
}

.cmd-empty {
  padding: 36px 16px;
  text-align: center;
  color: var(--text-2);
}
.cmd-empty-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 4px;
}
.cmd-empty-desc {
  font-size: 12px;
  color: var(--text-2);
}

.cmd-foot {
  padding: 9px 16px;
  border-top: 1px solid var(--line);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-m);
  font-size: 11px;
  color: var(--text-2);
}
.cmd-foot-hints {
  display: flex;
  align-items: center;
  gap: 12px;
}
.cmd-hint-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.cmd-key {
  font-family: var(--font-m);
  font-size: 9.5px;
  padding: 1px 4px;
  border-radius: 3px;
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  color: var(--text);
  line-height: 1.2;
}
.cmd-foot-tag {
  font-size: 10px;
  letter-spacing: 0.08em;
  opacity: 0.6;
}

@media (max-width: 768px) {
  .cmd-backdrop {
    padding: 16px 12px;
    align-items: flex-start;
  }
  .cmd-modal {
    width: 100%;
    max-height: calc(100dvh - 32px);
    border-radius: 10px;
  }
  .cmd-search-wrap {
    padding: 12px 14px;
  }
  .cmd-input {
    font-size: 14px;
  }
  .cmd-item-desc {
    max-width: 170px;
  }
  .cmd-foot-hints .cmd-hint-item:first-child {
    display: none;
  }
}

@media (max-width: 480px) {
  .cmd-backdrop {
    padding: 8px 6px;
  }
  .cmd-modal {
    max-height: calc(100dvh - 16px);
    border-radius: 8px;
  }
  .cmd-search-wrap {
    padding: 10px 12px;
    gap: 8px;
  }
  .cmd-item {
    padding: 7px 8px;
    gap: 8px;
  }
  .cmd-item-icon {
    width: 24px;
    height: 24px;
  }
  .cmd-item-title {
    font-size: 13px;
  }
  .cmd-item-desc {
    max-width: 120px;
    font-size: 10.5px;
  }
  .cmd-item-tag {
    font-size: 9px;
    padding: 1px 5px;
  }
  .cmd-foot-hints {
    display: none;
  }
  .cmd-foot {
    padding: 6px 10px;
    font-size: 10px;
  }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .marquee-track.marquee-ready { animation: none; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  .loader-bar span { animation: none; transform: scaleX(1); }
}
