/* ============================================================
   IC — Section-specific styles
   ============================================================ */

/* ============================================================
   NAVBAR
   ============================================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: 88px;
  display: flex;
  align-items: center;
  transition: background var(--d-base) var(--ease-standard),
              backdrop-filter var(--d-base) var(--ease-standard),
              border-color var(--d-base) var(--ease-standard),
              box-shadow var(--d-base) var(--ease-standard);
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(13, 27, 42, 0.72);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  border-bottom-color: var(--border);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}
.nav__inner {
  display: flex;
  align-items: center;
  gap: var(--space-7);
  width: 100%;
}
.nav__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 68px;
  flex-shrink: 0;
}
.nav__logo-img {
  height: 40px;
  width: auto;
  display: block;
}
.nav__logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--grad-primary);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  letter-spacing: -0.02em;
  box-shadow: 0 0 24px rgba(46, 168, 255, 0.35);
}
.nav__logo-text {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.01em;
  color: var(--fg);
}
.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  margin-left: auto;
}
.nav__link {
  position: relative;
  font-size: 14px;
  font-weight: 500;
  color: var(--fg-muted);
  transition: color var(--d-fast) var(--ease-standard);
  padding-block: 4px;
}
.nav__link:hover { color: var(--fg); }
.nav__link.is-active { color: var(--fg); }
.nav__link.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}
.nav__cta { margin-left: var(--space-2); }

/* Theme toggle (sun-moon track) */
.theme-toggle {
  position: relative;
  width: 56px;
  height: 28px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-strong);
  background: var(--bg-subtle);
  display: inline-flex;
  align-items: center;
  padding: 2px;
  transition: background var(--d-base) var(--ease-standard), border-color var(--d-base) var(--ease-standard);
  margin-left: var(--space-3);
  cursor: pointer;
  flex-shrink: 0;
}
.theme-toggle__icons {
  position: absolute;
  inset: 2px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  pointer-events: none;
  color: var(--fg-subtle);
}
.theme-toggle__icons svg {
  width: 12px;
  height: 12px;
  margin: auto;
  display: block;
}
.theme-toggle__thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--grad-primary);
  transform: translateX(28px);
  transition: transform var(--d-base) var(--ease-spring);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.theme-toggle[data-theme="light"] .theme-toggle__thumb {
  transform: translateX(0);
}

.nav__burger {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  margin-left: auto;
  color: var(--fg);
  border: 1px solid var(--border);
}

.nav-mobile {
  position: fixed;
  inset: 72px 0 0 0;
  background: rgba(7, 17, 31, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 99;
  padding: var(--space-7) var(--pad-inline);
  display: none;
  flex-direction: column;
  gap: var(--space-5);
}
.nav-mobile.is-open { display: flex; }
.nav-mobile a {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  color: var(--fg);
  padding-block: 8px;
  border-bottom: 1px solid var(--border);
}

@media (max-width: 900px) {
  .nav__links { display: none; }
  .nav__burger { display: inline-flex; }
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  padding-top: 152px;
  padding-bottom: clamp(64px, 8vw, 128px);
  overflow: hidden;
  min-height: 760px;
  display: flex;
  align-items: center;
}
.hero__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.hero__glow {
  position: absolute;
  inset: -200px 0 auto 0;
  height: 900px;
  background: var(--grad-hero-glow);
  pointer-events: none;
}

.hero__inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(40px, 6vw, 80px);
  width: 100%;
}

@media (max-width: 960px) {
  .hero__inner { grid-template-columns: 1fr; gap: 48px; }
  .hero { min-height: 0; padding-top: 120px; }
}

.hero__copy { max-width: 640px; }

.hero__h1 {
  margin-top: var(--space-5);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--t-display-2xl);
  line-height: 1.02;
  letter-spacing: -0.035em;
  color: var(--fg);
}
.hero__h1 .line { display: block; overflow: visible; }
.hero__h1 .word { display: inline-block; }

.hero__sub {
  margin-top: var(--space-5);
  color: var(--fg-muted);
  font-size: var(--t-body-l);
  line-height: 1.65;
  max-width: 540px;
}

.hero__ctas {
  margin-top: var(--space-6);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.hero__chips {
  margin-top: var(--space-7);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}
.hero__chips .label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--fg-subtle);
  margin-right: 4px;
}

/* Hero visual — logo + orbits + particles + floating cards */
.hero__visual {
  position: relative;
  aspect-ratio: 1 / 1;
  max-width: 560px;
  margin-left: auto;
  width: 100%;
}
.hero__visual-inner {
  position: relative;
  width: 100%;
  height: 100%;
}
.hero__visual-glow {
  position: absolute;
  inset: -10%;
  background: radial-gradient(circle at 50% 50%,
    rgba(46, 168, 255, 0.25) 0%,
    rgba(124, 92, 255, 0.18) 30%,
    transparent 60%);
  filter: blur(40px);
  pointer-events: none;
}
.hero__orbits,
.hero__particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Three.js layer (lazy-loaded). When mounted, the script adds
   .has-canvas to the wrap, hiding the static SVG/logo fallback. */
.hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  transition: opacity 600ms cubic-bezier(0.16, 1, 0.3, 1);
}
.hero__visual-inner.has-canvas .hero__canvas {
  opacity: 1;
  pointer-events: auto;
}
.hero__visual-inner.has-canvas .hero__particles,
.hero__visual-inner.has-canvas .hero__logo-wrap {
  opacity: 0;
  transition: opacity 400ms ease;
  pointer-events: none;
}
.hero__orbits {
  animation: heroOrbitSpin 80s linear infinite;
  transform-origin: 50% 50%;
}
@keyframes heroOrbitSpin {
  to { transform: rotate(360deg); }
}
.hero__logo-wrap {
  position: absolute;
  inset: 18%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 50%, rgba(46, 168, 255, 0.18) 0%, transparent 65%);
}
.hero__logo {
  max-width: 70%;
  max-height: 70%;
  width: auto;
  height: auto;
  filter: drop-shadow(0 8px 30px rgba(46, 168, 255, 0.25));
}

.hero__floating-card {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(13, 27, 42, 0.72);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  white-space: nowrap;
  z-index: 3;
}
.hero__fc-icon {
  display: inline-flex;
  color: var(--accent);
}
.hero__fc-icon.ai { color: var(--accent-ai); }
.hero__floating-card.fc-1 { top: 6%; left: -4%; }
.hero__floating-card.fc-2 { top: 46%; right: -8%; }
.hero__floating-card.fc-3 { bottom: 8%; left: 6%; }

@media (max-width: 700px) {
  .hero__floating-card.fc-1 { left: 4%; }
  .hero__floating-card.fc-2 { right: 4%; }
}

/* ============================================================
   ABOUT
   ============================================================ */
.about-grid {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: clamp(40px, 6vw, 80px);
  align-items: start;
}
@media (max-width: 880px) {
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
}
.about-cap-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.cap-card {
  padding: 24px;
  background: #fff;
  border: 1px solid #DCE3EC;
  border-radius: var(--radius-2xl);
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 16px;
  align-items: flex-start;
  box-shadow: 0 1px 2px rgba(11, 18, 32, 0.04), 0 6px 16px rgba(11, 18, 32, 0.04);
  transition: border-color var(--d-base) var(--ease-standard), transform var(--d-base) var(--ease-standard);
}
.cap-card:hover { transform: translateY(-2px); border-color: #C2CCD9; }
.cap-card__dot {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: rgba(37, 99, 255, 0.08);
  display: grid;
  place-items: center;
  color: var(--accent-strong);
  grid-row: 1 / span 2;
}
.cap-card.ai .cap-card__dot {
  background: rgba(109, 73, 245, 0.08);
  color: var(--accent-ai);
}
.cap-card__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  color: #0B1220;
  margin: 4px 0 0;
}
.cap-card__body {
  font-size: 14px;
  color: #475569;
  line-height: 1.55;
  margin: 0;
}

.meta-row {
  margin-top: var(--space-7);
  padding-top: var(--space-5);
  border-top: 1px solid #DCE3EC;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-5);
}
@media (max-width: 900px) { .meta-row { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .meta-row { grid-template-columns: repeat(2, 1fr); } }
.meta-row dt {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #7C8CA1;
  margin-bottom: 4px;
  font-weight: 500;
}
.meta-row dd {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: #0B1220;
  line-height: 1.5;
}

/* ============================================================
   SELECTED WORK
   ============================================================ */
.work-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--space-5);
}
.work-card {
  grid-column: span 6;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  padding: 24px;
  background: #fff;
  border: 1px solid #DCE3EC;
  border-radius: var(--radius-2xl);
  box-shadow: 0 1px 2px rgba(11, 18, 32, 0.04), 0 8px 24px rgba(11, 18, 32, 0.06);
  transition: transform var(--d-base) var(--ease-standard),
              border-color var(--d-base) var(--ease-standard),
              box-shadow var(--d-base) var(--ease-standard);
}
.work-card:hover {
  transform: translateY(-3px);
  border-color: #C2CCD9;
  box-shadow: 0 4px 8px rgba(11, 18, 32, 0.05), 0 18px 48px rgba(11, 18, 32, 0.10);
}
.work-card--featured,
.work-card--wide { grid-column: span 12; }
.work-card--wide {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 32px;
  align-items: center;
}
.work-card--wide .work-card__body { padding-top: 0; order: -1; }

@media (max-width: 880px) {
  .work-card, .work-card--featured, .work-card--wide { grid-column: span 12; }
  .work-card--wide { grid-template-columns: 1fr; }
  .work-card--wide .work-card__body { order: 0; }
}

/* Unified ProjectCover — gradient + diagonal stripes + glow + label pill */
.work-cover {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(46,168,255,0.10), rgba(13,27,42,0.4));
}
.work-cover--ai {
  background: linear-gradient(135deg, rgba(124,92,255,0.12), rgba(13,27,42,0.4));
}
.work-cover__stripes {
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(45deg, rgba(255,255,255,0.04) 0 1px, transparent 1px 14px);
  pointer-events: none;
}
.work-cover__glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 70% 60%, rgba(46,168,255,0.25), transparent 60%);
  pointer-events: none;
}
.work-cover--ai .work-cover__glow {
  background: radial-gradient(circle at 30% 40%, rgba(124,92,255,0.30), transparent 60%);
}
.work-cover__label {
  position: absolute;
  left: 16px;
  bottom: 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: var(--radius-full);
  background: rgba(7, 17, 31, 0.6);
  border: 1px solid var(--border);
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
}
.work-cover__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.work-cover__dot.ai { background: var(--accent-ai); }

.work-card__body {
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.work-card__meta {
  display: flex;
  gap: 12px;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #7C8CA1;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  flex-wrap: wrap;
}
.work-card__meta .dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; }
.work-card__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 24px;
  letter-spacing: -0.015em;
  color: #0B1220;
  display: flex;
  align-items: center;
  gap: 10px;
}
.work-card--wide .work-card__title { font-size: 32px; }
.work-card__title .arrow {
  opacity: 0;
  transform: translate(-6px, 0);
  transition: opacity var(--d-base) var(--ease-standard), transform var(--d-base) var(--ease-standard);
  color: var(--accent-strong);
}
.work-card:hover .work-card__title .arrow { opacity: 1; transform: translate(0, 0); }
.work-card__desc {
  color: #475569;
  font-size: 15px;
  line-height: 1.6;
  max-width: 60ch;
  margin: 0;
}
.work-card__more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  margin-top: 4px;
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 600;
  border-bottom: 1px dotted rgba(37, 99, 255, 0.4);
  padding-bottom: 2px;
  transition: border-bottom-style var(--d-fast) var(--ease-standard);
}
.work-card__more:hover { border-bottom-style: solid; }

.work-foot {
  margin-top: var(--space-7);
  display: flex;
  justify-content: center;
}

/* ============================================================
   EXPERTISE
   ============================================================ */
.expertise-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}
@media (max-width: 980px) { .expertise-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .expertise-grid { grid-template-columns: 1fr; } }

.expertise-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 240px;
  position: relative;
}
.expertise-card__icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--accent-subtle);
  border: 1px solid rgba(46, 168, 255, 0.18);
  display: grid;
  place-items: center;
  color: var(--accent);
}
.expertise-card.ai .expertise-card__icon {
  background: var(--accent-ai-subtle);
  border-color: rgba(124, 92, 255, 0.22);
  color: var(--accent-ai);
}
.expertise-card.ai:hover { box-shadow: var(--el-glow-ai); }
.expertise-card__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--fg);
}
.expertise-card__body {
  color: var(--fg-muted);
  font-size: 15px;
  line-height: 1.6;
  margin: 0;
}
.expertise-card__num {
  position: absolute;
  top: 24px;
  right: 24px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-subtle);
  letter-spacing: 0.08em;
}

/* ============================================================
   EXPERIENCE TIMELINE
   ============================================================ */
.timeline {
  display: flex;
  flex-direction: column;
}
.tl-row {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  gap: var(--space-5);
  align-items: start;
  padding: var(--space-5) 0;
  border-bottom: 1px solid #DCE3EC;
  cursor: pointer;
  transition: background var(--d-fast) var(--ease-standard);
}
.tl-row:hover { background: rgba(11, 18, 32, 0.02); }
.tl-row:hover .tl-row__chev { color: var(--accent-strong); transform: translateX(2px); }
.tl-row[open] .tl-row__chev { transform: rotate(90deg); }

.tl-row__years {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: #7C8CA1;
  padding-top: 4px;
  text-transform: uppercase;
}
.tl-row__main { display: flex; flex-direction: column; gap: 8px; }
.tl-row__role {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
  color: #0B1220;
  letter-spacing: -0.01em;
}
.tl-row__company {
  font-size: 14px;
  color: #475569;
}
.tl-row__desc {
  margin-top: 12px;
  font-size: 15px;
  line-height: 1.65;
  color: #475569;
  max-width: 68ch;
  display: none;
}
.tl-row.is-open .tl-row__desc { display: block; }
.tl-row__chev {
  margin-top: 6px;
  color: #94A3B8;
  transition: transform var(--d-base) var(--ease-standard), color var(--d-fast) var(--ease-standard);
}
.tl-row.is-open .tl-row__chev { transform: rotate(90deg); color: var(--accent-strong); }

@media (max-width: 640px) {
  .tl-row { grid-template-columns: 1fr auto; }
  .tl-row__years { grid-column: 1 / -1; padding-top: 0; margin-bottom: -4px; }
}

/* ============================================================
   TECH STACK
   ============================================================ */
.stack-group { margin-bottom: var(--space-6); }
.stack-group:last-child { margin-bottom: 0; }
.stack-group__head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.stack-group__label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #7C8CA1;
}
.stack-group__line { flex: 1; height: 1px; background: #DCE3EC; }
.stack-pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.stack-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  background: #fff;
  border: 1px solid #DCE3EC;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  color: #0B1220;
  transition: border-color var(--d-fast) var(--ease-standard),
              box-shadow var(--d-fast) var(--ease-standard),
              transform var(--d-fast) var(--ease-standard);
}
.stack-pill:hover {
  border-color: rgba(37, 99, 255, 0.4);
  box-shadow: 0 4px 16px rgba(37, 99, 255, 0.08);
  transform: translateY(-1px);
}
.stack-pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-strong);
}
.stack-pill.ai .dot { background: var(--accent-ai); }

/* ============================================================
   AI ENGINEERING
   ============================================================ */
.ai-section {
  position: relative;
  overflow: hidden;
}
.ai-section__glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(40% 60% at 80% 40%, rgba(124, 92, 255, 0.20), transparent 70%),
    radial-gradient(40% 60% at 10% 70%, rgba(46, 168, 255, 0.12), transparent 70%);
  pointer-events: none;
}
.ai-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 6vw, 80px);
  align-items: center;
  position: relative;
}
@media (max-width: 960px) {
  .ai-grid { grid-template-columns: 1fr; }
}
.ai-list {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 16px 28px;
  margin: var(--space-6) 0;
  padding: 0;
  list-style: none;
}
@media (max-width: 540px) {
  .ai-list { grid-template-columns: 1fr; gap: 4px 0; }
  .ai-list dt { margin-top: 12px; }
}
.ai-list dt {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  color: var(--fg);
  letter-spacing: -0.005em;
  display: flex;
  align-items: center;
  gap: 10px;
}
.ai-list dt::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-ai);
  box-shadow: 0 0 10px rgba(124, 92, 255, 0.8);
  flex-shrink: 0;
}
.ai-list dd {
  margin: 0;
  font-size: 14px;
  color: var(--fg-muted);
  line-height: 1.55;
}

.ai-visual {
  position: relative;
  aspect-ratio: 1 / 1;
  width: 100%;
  max-width: 560px;
  margin-left: auto;
}
.ai-visual__glow {
  position: absolute;
  inset: -10%;
  background: radial-gradient(circle, rgba(124, 92, 255, 0.30), transparent 65%);
  filter: blur(40px);
  pointer-events: none;
}
.ai-visual__svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.ai-visual__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  transition: opacity 600ms cubic-bezier(0.16, 1, 0.3, 1);
}
.ai-visual.has-canvas .ai-visual__canvas {
  opacity: 1;
  pointer-events: auto;
}
.ai-visual.has-canvas .ai-visual__svg {
  opacity: 0;
  transition: opacity 400ms ease;
}
.ai-visual__label {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-subtle);
  letter-spacing: 0.04em;
}
.ai-visual__label--in { left: 5%; top: 92%; }
.ai-visual__label--out { right: 2%; top: 92%; }

/* ============================================================
   PROCESS
   ============================================================ */
.process {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  position: relative;
}
.process::before {
  content: "";
  position: absolute;
  top: 56px;
  left: 12%;
  right: 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, #DCE3EC 12%, #DCE3EC 88%, transparent 100%);
  z-index: 0;
}
@media (max-width: 880px) {
  .process { grid-template-columns: 1fr; }
  .process::before { display: none; }
}
.process-step {
  position: relative;
  z-index: 1;
}
.process-step__num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 64px;
  letter-spacing: -0.04em;
  line-height: 1;
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.process-step__title {
  margin-top: 12px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  color: #0B1220;
  letter-spacing: -0.01em;
}
.process-step__body {
  margin-top: 8px;
  font-size: 14px;
  color: #475569;
  line-height: 1.6;
}

/* ============================================================
   CONTACT CTA
   ============================================================ */
.cta-section {
  position: relative;
  overflow: hidden;
  text-align: center;
}
.cta-section__glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(50% 60% at 50% 60%, rgba(46, 168, 255, 0.18), transparent 70%),
    radial-gradient(40% 50% at 80% 40%, rgba(124, 92, 255, 0.14), transparent 70%);
  pointer-events: none;
}
.cta-inner {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
}
.cta-section__h {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(40px, 5.6vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--fg);
  margin: var(--space-5) 0 var(--space-5);
}
.cta-section__sub {
  color: var(--fg-muted);
  font-size: var(--t-body-l);
  line-height: 1.6;
  max-width: 600px;
  margin: 0 auto;
}
.cta-section__ctas {
  margin-top: var(--space-6);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: center;
}
.cta-contacts {
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-4);
  text-align: left;
}
@media (max-width: 760px) {
  .cta-contacts { grid-template-columns: repeat(2, 1fr); }
}
.cta-contact dt {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-subtle);
  margin-bottom: 6px;
}
.cta-contact dd {
  margin: 0;
  font-size: 14px;
  color: var(--fg);
  font-weight: 500;
}
.cta-contact a { color: inherit; transition: color var(--d-fast) var(--ease-standard); }
.cta-contact a:hover { color: var(--accent); }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: var(--bg-deep);
  border-top: 1px solid var(--border);
  padding-block: var(--space-7) var(--space-5);
}
.footer__top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--space-7);
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--border);
}
@media (max-width: 760px) {
  .footer__top { grid-template-columns: 1fr; gap: var(--space-5); }
}
.footer__brand-tag {
  margin-top: var(--space-3);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-subtle);
}
.footer__brand-bio {
  margin-top: var(--space-4);
  max-width: 340px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--fg-muted);
}
.footer__col-head {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-subtle);
  margin-bottom: var(--space-3);
}
.footer__col-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer__col-list a {
  color: var(--fg-muted);
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: color var(--d-fast) var(--ease-standard);
}
.footer__col-list a svg { color: var(--fg-subtle); transition: color var(--d-fast) var(--ease-standard); }
.footer__col-list a:hover { color: var(--accent); }
.footer__col-list a:hover svg { color: var(--accent); }
.footer__bot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--space-5);
  font-size: 12px;
  color: var(--fg-subtle);
  gap: var(--space-4);
}
@media (max-width: 540px) {
  .footer__bot { flex-direction: column; align-items: flex-start; gap: 8px; }
}
.footer__bot .mono { font-family: var(--font-mono); letter-spacing: 0.04em; }

/* ============================================================
   INNER PAGES — /about, /contact, /cv, /404
   ============================================================ */
.page-header {
  position: relative;
  padding: 160px 0 80px;
  overflow: hidden;
}
.page-header__glow {
  position: absolute;
  inset: 0;
  background: var(--grad-hero-glow);
  opacity: 0.6;
  pointer-events: none;
}
.page-header__inner {
  position: relative;
}
.page-header .badge { margin-bottom: 20px; margin-top: 0; }
.page-header h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--t-display-l);
  line-height: 1.08;
  letter-spacing: -0.025em;
  max-width: 880px;
  text-wrap: balance;
  margin: 0;
}
.page-header__sub {
  font-size: var(--t-body-l);
  line-height: 1.65;
  color: var(--fg-muted);
  max-width: 680px;
  margin-top: 20px;
  text-wrap: pretty;
}
.page-header__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--fg-muted);
  font-size: 14px;
  margin-bottom: 24px;
}
.page-header__back:hover { color: var(--accent); }

.page-section { padding: 0 0 160px; }

/* About — sidebar/portrait + meta */
.about-grid-page {
  display: grid;
  grid-template-columns: 4fr 8fr;
  gap: 64px;
  align-items: start;
}
@media (max-width: 960px) {
  .about-grid-page { grid-template-columns: 1fr; gap: 40px; }
}
.about-portrait {
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-2xl);
  border: 1px solid var(--border);
  background:
    linear-gradient(135deg, rgba(46, 168, 255, 0.08), rgba(124, 92, 255, 0.10));
  position: relative;
  overflow: hidden;
  margin-bottom: 24px;
}
.about-portrait::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 16px);
}
.about-portrait__label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--fg-subtle);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-align: center;
}
.about-portrait__label svg { margin-inline: auto; margin-bottom: 12px; opacity: 0.5; }

.about-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 16px;
  margin-bottom: 32px;
}
.about-meta dt {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-subtle);
  margin: 0;
}
.about-meta dd {
  margin: 0;
  font-size: 14px;
  color: var(--fg);
}
.about-meta .available { color: var(--accent); }

.about-body h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--t-h1);
  letter-spacing: -0.02em;
  margin: 0 0 24px;
}
.about-body h2:not(:first-child) { margin-top: 56px; }
.about-body p {
  font-size: var(--t-body-l);
  line-height: 1.65;
  color: var(--fg-muted);
  max-width: 720px;
}
.about-body p + p { margin-top: 20px; }

.principles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 720px) { .principles { grid-template-columns: 1fr; } }
.principle {
  padding: 16px 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  gap: 12px;
  font-size: 15px;
  line-height: 1.55;
}
.principle__check {
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 2px;
}

.tools-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px 24px;
  border-top: 1px solid var(--border);
}
.tools-grid dt,
.tools-grid dd {
  padding: 18px 0 16px;
  border-bottom: 1px solid var(--border);
  margin: 0;
}
.tools-grid dt {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-subtle);
}
.tools-grid dd { color: var(--fg-muted); font-size: 17px; line-height: 1.6; }
.tools-grid dt:last-of-type,
.tools-grid dd:last-of-type { border-bottom: 0; }

/* Contact page — channel cards */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 720px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-card {
  padding: 28px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: transform var(--d-base) var(--ease-standard), border-color var(--d-base) var(--ease-standard);
}
.contact-card:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.contact-card__head { display: flex; align-items: center; gap: 12px; }
.contact-card__icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  background: var(--accent-subtle);
  color: var(--accent);
  display: grid; place-items: center;
}
.contact-card__icon.ai {
  background: var(--accent-ai-subtle);
  color: var(--accent-ai);
}
.contact-card__label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-subtle);
  margin: 0;
}
.contact-card__sub {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-subtle);
  margin: 2px 0 0;
}
.contact-card__value {
  font-family: var(--font-mono);
  font-size: 18px;
  word-break: break-all;
  color: var(--fg);
  margin: 0;
}
.contact-card__action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  border-bottom: 1px dotted rgba(46, 168, 255, 0.5);
  padding-bottom: 2px;
}
.contact-card__action:hover { border-bottom-style: solid; }

.contact-calbar {
  margin-top: 48px;
  padding: 28px 32px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 24px;
  align-items: center;
}
@media (max-width: 720px) {
  .contact-calbar { grid-template-columns: 1fr; }
  .contact-calbar > * { justify-self: start; }
}
.contact-calbar__icon {
  width: 52px; height: 52px;
  border-radius: var(--radius-md);
  background: var(--accent-subtle);
  color: var(--accent);
  display: grid; place-items: center;
}

/* CV page */
.cv-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 56px;
}
.cv-sheet {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: 56px;
  max-width: 960px;
  margin-inline: auto;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
}
@media (max-width: 720px) {
  .cv-sheet { padding: 32px; }
}
.cv-sheet__head {
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border-strong);
}
.cv-sheet__head-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}
.cv-sheet__head-top img { height: 36px; width: auto; }
.cv-sheet__name { font-family: var(--font-display); font-size: var(--t-display-m); font-weight: 600; letter-spacing: -0.02em; margin: 0 0 8px; }
.cv-sheet__role {
  font-family: var(--font-display);
  font-size: var(--t-h3);
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 20px;
}
.cv-sheet__contacts {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.cv-sheet__contacts span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  color: var(--fg-muted);
}
.cv-section { padding-top: 48px; }
.cv-section h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--t-h1);
  letter-spacing: -0.02em;
  margin: 0 0 16px;
}
.cv-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 24px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}
.cv-row > .label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-subtle);
  padding-top: 4px;
}
.cv-row > .value { font-size: 15px; line-height: 1.7; color: var(--fg-muted); }
.cv-row > .value strong { color: var(--fg); }
.cv-row.mono > .value { font-family: var(--font-mono); }
@media (max-width: 640px) { .cv-row { grid-template-columns: 1fr; gap: 4px; } }

.cv-role {
  padding: 32px 0;
  border-bottom: 1px solid var(--border);
}
.cv-role__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.cv-role__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 28px;
  margin: 0;
}
.cv-role__employer { font-size: 17px; color: var(--fg); margin: 4px 0 0; }
.cv-role__when, .cv-role__where {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--fg-subtle);
  margin: 0;
}
.cv-role__where { margin-top: 2px; }
.cv-role__summary { font-size: 17px; color: var(--fg-muted); margin: 0 0 16px; max-width: 720px; }
.cv-role__bullets {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 0 20px;
  list-style: none;
  padding: 0;
}
.cv-role__bullets li {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 8px;
}
.cv-role__bullets li::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 1px;
  background: var(--accent);
  margin-top: 8px;
}
.cv-role__bullets li span {
  font-size: 17px;
  line-height: 1.6;
  color: var(--fg-muted);
  max-width: 720px;
}

/* 404 page */
.notfound {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}
.notfound__big {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(120px, 18vw, 220px);
  line-height: 0.95;
  letter-spacing: -0.04em;
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  margin: 0 0 32px;
}
.notfound__title {
  font-family: var(--font-display);
  font-size: var(--t-display-l);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.025em;
  margin: 0 0 20px;
  max-width: 720px;
  text-wrap: balance;
}
.notfound__sub {
  font-size: var(--t-body-l);
  color: var(--fg-muted);
  max-width: 560px;
  margin: 0 0 56px;
  text-wrap: pretty;
}
.notfound__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  max-width: 640px;
}
@media (max-width: 640px) { .notfound__grid { grid-template-columns: 1fr; } }
.notfound__card {
  padding: 20px;
  background: rgba(13, 27, 42, 0.72);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--fg);
  transition: transform var(--d-base) var(--ease-standard), border-color var(--d-base) var(--ease-standard);
}
.notfound__card:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.notfound__card-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  background: var(--accent-subtle);
  color: var(--accent);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.notfound__card-body { flex: 1; }
.notfound__card-title { font-family: var(--font-body); font-weight: 600; font-size: 18px; margin: 0 0 2px; }
.notfound__card-desc { font-size: 15px; color: var(--fg-subtle); margin: 0; }
.notfound__meta {
  margin-top: 56px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--fg-subtle);
}

[data-theme="light"] .about-portrait::before,
[data-theme="light"] .notfound__card {
  background: var(--bg-elevated);
}
[data-theme="light"] .notfound__card {
  background: var(--bg-elevated);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
[data-theme="light"] .cv-sheet {
  box-shadow: 0 30px 80px rgba(11, 18, 32, 0.12);
}

/* ============================================================
   LIGHT THEME OVERRIDES
   Cards / pills / borders inside light sections all use hardcoded
   light-palette colors above so they look right on dark mode's
   light strip. In light mode, the page itself is light, so we
   flip the cards to subtle elevated tones.
   ============================================================ */
[data-theme="light"] .cap-card,
[data-theme="light"] .light-card,
[data-theme="light"] .work-card,
[data-theme="light"] .stack-pill,
[data-theme="light"] .ai-list ~ * .work-card {
  background: var(--bg-elevated);
  border-color: var(--border);
}
[data-theme="light"] .cap-card:hover,
[data-theme="light"] .light-card:hover,
[data-theme="light"] .work-card:hover {
  border-color: var(--border-strong);
}
[data-theme="light"] .cap-card__title,
[data-theme="light"] .work-card__title,
[data-theme="light"] .process-step__title {
  color: var(--fg);
}
[data-theme="light"] .cap-card__body,
[data-theme="light"] .process-step__body,
[data-theme="light"] .work-card__desc,
[data-theme="light"] .tl-row__company,
[data-theme="light"] .tl-row__desc {
  color: var(--fg-muted);
}
[data-theme="light"] .work-card__meta,
[data-theme="light"] .tl-row__years {
  color: var(--fg-subtle);
}
[data-theme="light"] .tl-row {
  border-bottom-color: var(--border);
}
[data-theme="light"] .tl-row:hover {
  background: var(--accent-subtle);
}
[data-theme="light"] .tl-row__role {
  color: var(--fg);
}
[data-theme="light"] .stack-group__label {
  color: var(--fg-subtle);
}
[data-theme="light"] .stack-group__line,
[data-theme="light"] .meta-row {
  border-color: var(--border);
}
[data-theme="light"] .meta-row {
  border-top-color: var(--border);
}
[data-theme="light"] .meta-row dt {
  color: var(--fg-subtle);
}
[data-theme="light"] .meta-row dd {
  color: var(--fg);
}
[data-theme="light"] .process::before {
  background: linear-gradient(90deg, transparent 0%, var(--border) 12%, var(--border) 88%, transparent 100%);
}
[data-theme="light"] .stack-pill {
  color: var(--fg);
}
[data-theme="light"] .chip {
  background: var(--bg-subtle);
  border-color: var(--border);
  color: var(--fg-muted);
}
[data-theme="light"] .work-cover {
  background: linear-gradient(135deg, rgba(37, 99, 255, 0.08), rgba(11, 18, 32, 0.04));
  border-color: var(--border);
}
[data-theme="light"] .work-cover--ai {
  background: linear-gradient(135deg, rgba(109, 73, 245, 0.10), rgba(11, 18, 32, 0.04));
}
[data-theme="light"] .work-cover__label {
  background: rgba(255, 255, 255, 0.85);
  border-color: var(--border);
  color: var(--fg-muted);
}
[data-theme="light"] .work-cover__stripes {
  background-image: repeating-linear-gradient(45deg, rgba(11, 18, 32, 0.03) 0 1px, transparent 1px 14px);
}
[data-theme="light"] .work-cover__glow {
  background: radial-gradient(circle at 70% 60%, rgba(37, 99, 255, 0.15), transparent 60%);
}
[data-theme="light"] .work-cover--ai .work-cover__glow {
  background: radial-gradient(circle at 30% 40%, rgba(109, 73, 245, 0.18), transparent 60%);
}

/* Dark sections remain dark in light theme — they're the cinematic
   blocks (hero glow, AI, contact CTA, footer). In light mode they
   should still feel like rich surfaces, just slightly tonally
   adjusted to fit the surrounding paper-white. */
[data-theme="light"] .section--dark,
[data-theme="light"] .hero,
[data-theme="light"] .ai-section,
[data-theme="light"] .cta-section,
[data-theme="light"] .footer {
  background: #0B1220;
  color: #F8FAFC;
}
[data-theme="light"] .footer { background: #050B14; }
[data-theme="light"] .section--dark .badge:not(.badge--ai) {
  background: rgba(46, 168, 255, 0.12);
  color: #2EA8FF;
  border-color: rgba(46, 168, 255, 0.24);
}
[data-theme="light"] .section--dark .glass-card,
[data-theme="light"] .ai-section .glass-card {
  background: rgba(13, 27, 42, 0.72);
  border-color: rgba(255, 255, 255, 0.08);
}
[data-theme="light"] .section--dark .expertise-card__title,
[data-theme="light"] .section--dark .ai-list dt,
[data-theme="light"] .cta-section__h {
  color: #F8FAFC;
}
[data-theme="light"] .section--dark .expertise-card__body,
[data-theme="light"] .section--dark .ai-list dd,
[data-theme="light"] .cta-section__sub,
[data-theme="light"] .footer__col-list a,
[data-theme="light"] .footer__brand-bio {
  color: #B6C2D1;
}
[data-theme="light"] .section--dark .expertise-card__num,
[data-theme="light"] .cta-contact dt,
[data-theme="light"] .footer__col-head,
[data-theme="light"] .footer__brand-tag,
[data-theme="light"] .footer__bot {
  color: #7C8CA1;
}
[data-theme="light"] .cta-contact dd { color: #F8FAFC; }
[data-theme="light"] .nav { color: var(--fg); }
[data-theme="light"] .nav__link { color: var(--fg-muted); }
[data-theme="light"] .nav__link.is-active { color: var(--fg); }
[data-theme="light"] .nav.is-scrolled {
  background: rgba(255, 255, 255, 0.78);
  border-bottom-color: var(--border);
  box-shadow: 0 4px 24px rgba(11, 18, 32, 0.08);
}
[data-theme="light"] .theme-toggle {
  background: var(--bg-elevated);
  border-color: var(--border);
}
[data-theme="light"] .theme-toggle__icons { color: var(--fg-subtle); }


/* ============================================================
   WORK INDEX (/work) — filter bar, pagination, long-tail cards
   ============================================================ */
.work-filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 20px 24px;
  margin-bottom: 32px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  flex-wrap: wrap;
}
.work-filter-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.work-filter-chip {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--fg-muted);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--d-fast) var(--ease-standard),
              color var(--d-fast) var(--ease-standard),
              border-color var(--d-fast) var(--ease-standard);
}
.work-filter-chip:hover { color: var(--fg); background: var(--bg-subtle); }
.work-filter-chip.is-active {
  background: var(--accent-subtle);
  color: var(--accent);
  border-color: rgba(46, 168, 255, 0.3);
}
.work-filter-sort {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--fg-muted);
}
.work-filter-sort .caption { color: var(--fg-subtle); }
.work-filter-sort .value { color: var(--fg); }

.work-pagination {
  margin-top: 64px;
  display: flex;
  justify-content: center;
  gap: 6px;
}
.work-page-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--fg-muted);
  border: 1px solid var(--border);
  font-weight: 500;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: border-color var(--d-fast) var(--ease-standard),
              color var(--d-fast) var(--ease-standard);
}
.work-page-btn:hover { color: var(--fg); border-color: var(--border-strong); }
.work-page-btn.is-active {
  background: var(--accent-subtle);
  color: var(--accent);
  border-color: rgba(46, 168, 255, 0.3);
}

.work-empty {
  margin: 64px auto 0;
  max-width: 480px;
  text-align: center;
  color: var(--fg-muted);
  font-size: 15px;
}
.work-empty .btn--link { margin-left: 4px; }

/* Long-tail card — small glass card used for the lower-priority projects */
.work-tail {
  background: rgba(13, 27, 42, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform var(--d-base) var(--ease-standard),
              border-color var(--d-base) var(--ease-standard);
}
.work-tail:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
}
.work-tail__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-subtle);
}
.work-tail__live {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--fg-subtle);
  text-transform: none;
  letter-spacing: 0;
  font-size: 12px;
}
.work-tail__title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0;
}
.work-tail__desc {
  font-size: 14px;
  line-height: 1.55;
  color: var(--fg-muted);
  margin: 0;
}

[data-theme="light"] .work-filter-bar { background: var(--bg-elevated); }
[data-theme="light"] .work-filter-chip:hover { background: rgba(11, 18, 32, 0.04); }
[data-theme="light"] .work-tail {
  background: var(--bg-elevated);
  border-color: var(--border);
  color: var(--fg);
}
[data-theme="light"] .work-tail__title { color: var(--fg); }
[data-theme="light"] .work-tail__desc { color: var(--fg-muted); }

/* ============================================================
   CASE STUDY (/work/<slug>) — header, cover, 2-col body
   ============================================================ */

.cs-header {
  position: relative;
  padding: 120px 0 64px;
  overflow: hidden;
}
.cs-header__glow {
  position: absolute;
  inset: 0;
  background: var(--grad-hero-glow);
  pointer-events: none;
}
.cs-header__inner { position: relative; }

.cs-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--fg-muted);
  font-size: 14px;
  margin-bottom: 24px;
  transition: color var(--d-fast) var(--ease-standard);
}
.cs-back:hover { color: var(--accent); }

.cs-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-subtle);
}
.cs-meta__sep { color: var(--fg-subtle); }

.cs-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--t-display-l);
  line-height: 1.08;
  letter-spacing: -0.025em;
  text-wrap: balance;
  max-width: 920px;
  margin: 0 0 24px;
}
.cs-summary {
  font-size: var(--t-body-l);
  line-height: 1.65;
  color: var(--fg-muted);
  text-wrap: pretty;
  max-width: 720px;
  margin: 0;
}

/* ── Cover: 16:9 window frame ─────────────────────────────── */
.cs-cover {
  margin-top: 56px;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-3xl);
  overflow: hidden;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  position: relative;
}
.cs-cover__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.cs-cover__chrome {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  background: rgba(7, 17, 31, 0.6);
  border-bottom: 1px solid var(--border);
  z-index: 2;
}
.cs-cover__dots { display: flex; gap: 6px; }
.cs-cover__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  opacity: 0.7;
}
.cs-cover__dot--r { background: #FF5F57; }
.cs-cover__dot--y { background: #FEBC2E; }
.cs-cover__dot--g { background: #28C840; }
.cs-cover__url {
  margin-left: 16px;
  padding: 4px 12px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-subtle);
}
.cs-cover__chip-r {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: var(--radius-full);
  font-size: 11px;
  color: var(--success);
  font-family: var(--font-mono);
}
.cs-cover__chip-r .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}
.cs-cover__body {
  position: absolute;
  top: 44px;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 32px 40px;
}
.cs-cover__floating {
  position: absolute;
  right: 20px;
  bottom: 20px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(7, 17, 31, 0.7);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--accent);
  z-index: 3;
}
.cs-cover__floating .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

/* Cover variants */
.cs-cover--clinical-ai .cs-cover__bg {
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.12), rgba(46, 168, 255, 0.08)),
              repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.02) 0 1px, transparent 1px 22px);
}
.cs-cover--pharma .cs-cover__bg {
  background: linear-gradient(135deg, rgba(46, 168, 255, 0.10), rgba(124, 92, 255, 0.04));
}
.cs-cover--talentech .cs-cover__bg {
  background: linear-gradient(160deg, rgba(46, 168, 255, 0.10), rgba(7, 17, 31, 0.6));
}
.cs-cover--true-express .cs-cover__bg {
  background: linear-gradient(135deg, rgba(46, 168, 255, 0.10), rgba(7, 17, 31, 0.6));
}
.cs-cover--ata3allam {
  background: linear-gradient(135deg, #0F1E30, #050B14);
}
.cs-cover--ata3allam .cs-cover__bg {
  background: radial-gradient(circle at 30% 50%, rgba(46, 168, 255, 0.12), transparent 60%),
              radial-gradient(circle at 75% 50%, rgba(124, 92, 255, 0.12), transparent 60%);
}

/* Terminal-style content for cs-cover bodies */
.cs-term {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.8;
  color: var(--fg-muted);
}
.cs-term__dollar { color: var(--accent-ai); }
.cs-term__str { color: var(--accent); }
.cs-term__cmt { color: var(--fg-subtle); }
.cs-term__ok { color: var(--success); }
.cs-term__hl { color: var(--accent-ai); }
.cs-term__indent { padding-left: 16px; }
.cs-term__indent-2 { padding-left: 24px; }
.cs-term__indent-3 { padding-left: 40px; }

/* ── 2-column article + sticky sidebar ──────────────────────── */
.cs-body {
  padding: 80px 0 160px;
}
.cs-grid {
  display: grid;
  grid-template-columns: 8fr 4fr;
  gap: 80px;
}
@media (max-width: 960px) {
  .cs-grid { grid-template-columns: 1fr; gap: 48px; }
}
.cs-article { max-width: 720px; }

.cs-aside { position: relative; }
.cs-aside__sticky { position: sticky; top: 32px; }
@media (max-width: 960px) {
  .cs-aside__sticky { position: static; }
}

.cs-section {
  margin-bottom: 56px;
}
.cs-section__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--t-display-m);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 20px;
  display: flex;
  align-items: baseline;
  gap: 16px;
}
.cs-section__num {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--fg-subtle);
  flex-shrink: 0;
}
.cs-section h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--t-h2);
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin: 32px 0 12px;
}
.cs-section p {
  font-size: var(--t-body-l);
  line-height: 1.65;
  color: var(--fg-muted);
  text-wrap: pretty;
  max-width: 720px;
  margin: 0 0 20px;
}
.cs-section p strong { color: var(--fg); }
.cs-section .inline-code {
  background: var(--bg-subtle);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.92em;
  color: var(--fg);
}

.cs-bullets {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cs-bullets li {
  display: grid;
  grid-template-columns: 8px 1fr;
  gap: 16px;
}
.cs-bullets li::before {
  content: "";
  margin-top: 14px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.cs-bullets li > span {
  font-size: var(--t-body);
  line-height: 1.6;
  color: var(--fg-muted);
  text-wrap: pretty;
  max-width: 700px;
}

.cs-callout {
  padding: 24px;
  background: var(--accent-subtle);
  border: 1px solid rgba(46, 168, 255, 0.25);
  border-radius: var(--radius-lg);
  margin-bottom: 32px;
  display: flex;
  gap: 16px;
}
.cs-callout--ai {
  background: var(--accent-ai-subtle);
  border-color: rgba(124, 92, 255, 0.25);
}
.cs-callout__icon {
  color: var(--accent);
  flex-shrink: 0;
}
.cs-callout--ai .cs-callout__icon { color: var(--accent-ai); }
.cs-callout__title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 6px;
  color: var(--accent);
}
.cs-callout--ai .cs-callout__title { color: var(--accent-ai); }
.cs-callout__body {
  font-size: var(--t-body-s);
  line-height: 1.55;
  color: var(--fg-muted);
  margin: 0;
  text-wrap: pretty;
}

.cs-reflection {
  border-left: 3px solid var(--accent);
  padding-left: 24px;
  margin: 0;
  font-style: italic;
}
.cs-reflection p {
  font-size: var(--t-body-l);
  line-height: 1.55;
  color: var(--fg-muted);
  max-width: 660px;
  margin: 0;
}

/* Retrieval / inline grid items used inside clinical-ai */
.cs-row-items {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 32px 0;
}
.cs-row-item {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.cs-row-item__tag {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--accent);
  font-weight: 600;
  align-self: center;
}
.cs-row-item__title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 4px;
}
.cs-row-item__desc {
  font-size: var(--t-body-s);
  line-height: 1.5;
  color: var(--fg-muted);
  margin: 0;
}

/* ── Sidebar blocks ─────────────────────────────────────────── */
.cs-sb {
  margin-bottom: 28px;
}
.cs-sb__title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-subtle);
  margin: 0 0 14px;
}
.cs-sb__rows {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 16px;
}
.cs-sb__rows dt {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--fg-subtle);
  margin: 0;
}
.cs-sb__rows dd {
  margin: 0;
  font-size: 14px;
  color: var(--fg);
}
.cs-sb__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.cs-sb__metric {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 56px;
  letter-spacing: -0.025em;
  line-height: 1;
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

/* ── Prev/next ─────────────────────────────────────────────── */
.cs-nextprev {
  margin-top: 96px;
  padding: 32px 0;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.cs-nextprev__back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--fg-muted);
  transition: color var(--d-fast) var(--ease-standard);
}
.cs-nextprev__back:hover { color: var(--fg); }
.cs-nextprev__next {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  color: var(--fg);
}
.cs-nextprev__next .caption {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-subtle);
}
.cs-nextprev__next .title {
  font-family: var(--font-display);
  font-size: var(--t-h3);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  letter-spacing: -0.01em;
}
.cs-nextprev__next:hover .title { color: var(--accent); }

[data-theme="light"] .cs-cover {
  background: var(--bg-elevated);
  box-shadow: 0 30px 80px rgba(11, 18, 32, 0.12);
}
[data-theme="light"] .cs-cover__chrome { background: rgba(255, 255, 255, 0.85); }
[data-theme="light"] .cs-cover__url { background: rgba(11, 18, 32, 0.04); }
[data-theme="light"] .cs-cover__floating {
  background: rgba(255, 255, 255, 0.9);
  border-color: var(--border);
}
[data-theme="light"] .cs-row-item,
[data-theme="light"] .cs-callout {
  background: var(--bg-elevated);
}
[data-theme="light"] .cs-section .inline-code {
  background: rgba(11, 18, 32, 0.04);
}
