/* ============ THEME TOKENS ============ */
:root {
  --bg: #F7F7F5;
  --bg-elev: #FFFFFF;
  --fg: #14161A;
  --fg-muted: #5B6472;
  --border: #E3E5E8;
  --accent: #2F66D9;
  --accent-rgb: 47, 102, 217;
  --accent-2: #6B7280;
  --accent-2-rgb: 107, 114, 128;
  --glass-bg: rgba(255, 255, 255, 0.65);
  --glass-border: rgba(17, 17, 20, 0.08);
  --nav-bg: rgba(247, 247, 245, 0.75);
  --shadow-soft: 0 10px 30px -10px rgba(20, 22, 26, 0.12);
  --grid-line: rgba(20, 22, 26, 0.05);
}

[data-theme="dark"] {
  --bg: #0A0612;
  --bg-elev: #140E22;
  --fg: #F5F3FA;
  --fg-muted: #A79FBD;
  --border: #2A2140;
  --accent: #FF2E7A;
  --accent-rgb: 255, 46, 122;
  --accent-2: #00E5FF;
  --accent-2-rgb: 0, 229, 255;
  --glass-bg: rgba(255, 255, 255, 0.045);
  --glass-border: rgba(255, 46, 122, 0.16);
  --nav-bg: rgba(10, 6, 18, 0.72);
  --shadow-soft: 0 10px 40px -12px rgba(0, 0, 0, 0.6);
  --grid-line: rgba(255, 46, 122, 0.05);
}

* { box-sizing: border-box; }

html { scroll-padding-top: 5rem; }

body {
  background: var(--bg);
  color: var(--fg);
  transition: background-color .35s ease, color .35s ease;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 64px 64px;
  background-position: center top;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

::selection { background: rgba(var(--accent-rgb), 0.3); }

/* ============ BACKGROUND CANVAS ============ */
/* Page-wide interactive paint-splatter background (Creative pages only) */
#splatterCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* Page-wide interactive background (index.html / Security persona only) */
#riskCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ============ TYPOGRAPHY HELPERS ============ */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--accent);
  display: inline-block;
}

.section-title {
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  font-size: clamp(1.9rem, 3.4vw, 2.75rem);
  line-height: 1.05;
}

.text-outline {
  -webkit-text-stroke: 1.5px var(--fg);
  color: transparent;
}

/* ============ CYBERPUNK ACCENTS (dark theme only) ============ */
[data-theme="dark"] .text-outline {
  -webkit-text-stroke: 1.5px var(--accent-2);
  text-shadow: 0 0 16px rgba(var(--accent-2-rgb), .35);
}
[data-theme="dark"] .text-accent {
  text-shadow: 0 0 12px rgba(var(--accent-rgb), .5);
}
[data-theme="dark"] .hero-badge span[style*="accent-2"] {
  text-shadow: 0 0 10px rgba(var(--accent-2-rgb), .5);
}
[data-theme="dark"] .eyebrow {
  font-weight: 700;
  color: var(--accent-2);
}
[data-theme="dark"] .eyebrow::before {
  background: var(--accent-2);
  box-shadow: 0 0 8px rgba(var(--accent-2-rgb), .6);
}
[data-theme="dark"] body {
  position: relative;
}
[data-theme="dark"] body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(255, 255, 255, 0.018) 0px,
    rgba(255, 255, 255, 0.018) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: overlay;
}
[data-theme="dark"] .hero::before,
[data-theme="dark"] .hero::after {
  content: "";
  position: absolute;
  width: 46vw;
  height: 46vw;
  max-width: 620px;
  max-height: 620px;
  border-radius: 999px;
  filter: blur(90px);
  z-index: 0;
  pointer-events: none;
}
[data-theme="dark"] .hero::before {
  top: -12%;
  left: -10%;
  background: radial-gradient(circle, rgba(var(--accent-rgb), .22), transparent 70%);
}
[data-theme="dark"] .hero::after {
  bottom: -18%;
  right: -8%;
  background: radial-gradient(circle, rgba(var(--accent-2-rgb), .16), transparent 70%);
}

/* ============ NAV ============ */
.nav-glass {
  background: var(--nav-bg);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border-bottom: 1px solid var(--border);
}

.brand-mark { color: var(--fg); text-decoration: none; display: inline-flex; align-items: center; }
.brand-mark-logo { display: block; transition: opacity .2s ease; }
.brand-mark:hover .brand-mark-logo { opacity: .85; }
[data-theme="dark"] .brand-mark-logo { filter: invert(1) brightness(1.05); }

.nav-link {
  color: var(--fg-muted);
  text-decoration: none;
  transition: color .2s ease;
  position: relative;
}
.nav-link:hover { color: var(--fg); }

.theme-toggle {
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--glass-bg);
  color: var(--fg);
  cursor: pointer;
  transition: border-color .2s ease, transform .2s ease;
}
.theme-toggle:hover { border-color: var(--accent); transform: translateY(-1px); }

.cta-pill {
  align-items: center;
  gap: .45rem;
  font-size: .85rem;
  font-weight: 600;
  padding: .55rem 1.1rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
  transition: transform .2s ease, box-shadow .2s ease;
}
.cta-pill svg { flex-shrink: 0; }
.cta-pill:hover { transform: translateY(-1px); box-shadow: 0 8px 24px -8px rgba(var(--accent-rgb), .6); }

.cta-solid {
  display: inline-flex; align-items: center; gap: .6rem;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: .92rem;
  padding: .85rem 1.5rem;
  border-radius: 10px;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: transform .2s ease, box-shadow .2s ease;
}
.cta-solid:hover { transform: translateY(-2px); box-shadow: 0 12px 30px -10px rgba(var(--accent-rgb), .55); }

.cta-outline {
  display: inline-flex; align-items: center; gap: .6rem;
  border: 1px solid var(--border);
  color: var(--fg);
  font-weight: 600;
  font-size: .92rem;
  padding: .85rem 1.5rem;
  border-radius: 10px;
  text-decoration: none;
  transition: border-color .2s ease, transform .2s ease;
}
.cta-outline:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

/* ============ HERO ============ */
.hero { position: relative; z-index: 1; }

.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin-top: 60px;
  object-fit: cover;
  object-position: 62% center;
  z-index: 0;
  opacity: 1;
  will-change: opacity;
}
.hero-video-overlay {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(5, 3, 10, .58) 0%, rgba(5, 3, 10, .72) 55%, var(--bg) 100%);
}
[data-theme="light"] .hero-video,
[data-theme="light"] .hero-video-overlay { display: none; }

.hero-portrait-frame {
  aspect-ratio: 4/5;
  width: 100%;
  max-width: 420px;
  margin-inline: auto;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-soft);
  position: relative;
}
.hero-portrait-frame::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(0,0,0,.55) 100%);
}

.hero-badge {
  position: absolute;
  padding: .85rem 1.1rem;
  border-radius: 12px;
  max-width: 220px;
}
.hero-badge--top { top: -1.25rem; left: -1rem; }
.hero-badge--bottom { bottom: -1.25rem; right: -1rem; }
@media (max-width: 640px) {
  .hero-badge { max-width: 170px; padding: .65rem .85rem; }
  .hero-badge--top { left: -.5rem; top: -1rem; }
  .hero-badge--bottom { right: -.5rem; bottom: -1rem; }
}

.stat-row > div + div { border-left: 1px solid var(--border); padding-left: 1.5rem; }

/* ============ HERO WEB DIAGRAM (creative.html hero) ============ */
.hero-web-wrap {
  position: relative;
  width: 100%;
  max-width: 460px;
  margin-inline: auto;
}
.hero-web-wrap::before {
  content: "";
  position: absolute;
  inset: -8%;
  background: radial-gradient(circle at 50% 45%, rgba(5, 3, 10, .5), transparent 68%);
  z-index: -1;
  border-radius: 999px;
}
.hero-web { width: 100%; height: auto; overflow: visible; }

.hero-web__thread { stroke: rgba(var(--accent-rgb), .3); stroke-width: 1; stroke-dasharray: 3 4; }
.hero-web__thread--cyan { stroke: rgba(var(--accent-2-rgb), .3); }

.hero-web__bgstar {
  animation: hero-web-twinkle 3.6s ease-in-out infinite;
}
@keyframes hero-web-twinkle {
  0%, 100% { opacity: .12; }
  50% { opacity: .6; }
}

.hero-web__path {
  fill: none;
  stroke: url(#heroWebGradient);
  stroke-width: 1.5;
  stroke-dasharray: 6 7;
  animation: hero-web-dash 2.2s linear infinite;
  opacity: .75;
}
@keyframes hero-web-dash { to { stroke-dashoffset: -26; } }

.hero-web__satellite {
  animation: hero-web-pulse 2.8s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}
@keyframes hero-web-pulse {
  0%, 100% { opacity: .45; transform: scale(.85); }
  50% { opacity: 1; transform: scale(1.15); }
}

.hero-web__node-hit {
  cursor: pointer;
  display: inline-block;
  transform-box: fill-box;
  transform-origin: center;
  transition: transform .35s ease;
}
.hero-web__node-hit:hover, .hero-web__node-hit:focus-visible {
  transform: scale(1.07);
  outline: none;
}
.hero-web__ring { transition: filter .3s ease; }
.hero-web__ring--creative { filter: drop-shadow(0 0 16px rgba(var(--accent-rgb), .55)); animation: hero-web-breathe 3.4s ease-in-out infinite; }
.hero-web__ring--security { filter: drop-shadow(0 0 16px rgba(var(--accent-2-rgb), .55)); animation: hero-web-breathe 3.4s ease-in-out infinite; animation-delay: 1.2s; }
@keyframes hero-web-breathe {
  0%, 100% { stroke-opacity: .7; }
  50% { stroke-opacity: 1; }
}
.hero-web__node-hit:hover .hero-web__ring--creative { filter: drop-shadow(0 0 32px rgba(var(--accent-rgb), .85)); }
.hero-web__node-hit:hover .hero-web__ring--security { filter: drop-shadow(0 0 32px rgba(var(--accent-2-rgb), .85)); }

.hero-web__child-badge {
  opacity: 0;
  transform: scale(.4);
  transform-box: fill-box;
  transform-origin: center;
  transition: opacity .25s ease, transform .25s ease;
  pointer-events: none;
}
.hero-web__child-badge rect {
  fill: var(--bg-elev);
  stroke: var(--accent);
  stroke-width: 1;
}
.hero-web__child-badge--security rect { stroke: var(--accent-2); }
.hero-web__child-badge text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  letter-spacing: .03em;
  fill: var(--fg);
}
.hero-web__node-hit--creative:hover ~ .hero-web__child-badge-group--creative .hero-web__child-badge,
.hero-web__node-hit--creative:focus-visible ~ .hero-web__child-badge-group--creative .hero-web__child-badge {
  opacity: 1;
  transform: scale(1);
}
.hero-web__node-hit--security:hover ~ .hero-web__child-badge-group--security .hero-web__child-badge,
.hero-web__node-hit--security:focus-visible ~ .hero-web__child-badge-group--security .hero-web__child-badge {
  opacity: 1;
  transform: scale(1);
}
.hero-web__child-badge-group--creative g:nth-child(2) .hero-web__child-badge { transition-delay: .05s; }
.hero-web__child-badge-group--creative g:nth-child(3) .hero-web__child-badge { transition-delay: .1s; }
.hero-web__child-badge-group--security g:nth-child(2) .hero-web__child-badge { transition-delay: .05s; }

.hero-web__title {
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .02em;
  font-size: 22px;
  fill: var(--fg);
}
@media (max-width: 640px) {
  .hero-web-wrap { max-width: 340px; }
}

.scroll-cue {
  position: absolute;
  bottom: 2rem; left: 50%;
  transform: translateX(-50%);
  width: 24px; height: 40px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  display: none;
}
@media (min-width: 1024px) { .scroll-cue { display: block; } }
.scroll-cue span {
  position: absolute;
  top: 6px; left: 50%;
  width: 4px; height: 8px;
  background: var(--accent);
  border-radius: 999px;
  transform: translateX(-50%);
  animation: scrollcue 1.8s ease infinite;
}
@keyframes scrollcue {
  0% { opacity: 1; top: 6px; }
  70% { opacity: 0; top: 20px; }
  100% { opacity: 0; top: 20px; }
}

/* ============ GLASS / CARDS ============ */
.glass-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
}

.section-pad { padding-block: clamp(4rem, 8vw, 7rem); position: relative; z-index: 1; }
.section-alt { background: color-mix(in srgb, var(--bg) 92%, var(--fg) 8%); }

.fact-chip {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: .75rem .9rem;
  color: var(--fg);
}

/* ============ PORTFOLIO TEASER (homepage) ============ */
.portfolio-teaser-card {
  display: block;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  text-decoration: none;
  color: var(--fg);
  transition: transform .3s ease, border-color .3s ease;
}
.portfolio-teaser-card:hover { transform: translateY(-4px); border-color: var(--accent); }
.portfolio-teaser-card img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  object-position: top;
}
.portfolio-teaser-card__body { padding: 1.25rem 1.4rem 1.5rem; }

/* ============ PORTFOLIO SUBPAGES ============ */
.subpage-tabs {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
}
.subpage-tab {
  font-size: .85rem;
  font-weight: 600;
  padding: .55rem 1.3rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--fg-muted);
  text-decoration: none;
  transition: all .2s ease;
}
.subpage-tab:hover { color: var(--fg); border-color: var(--accent); }
.subpage-tab.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }

.portfolio-hero {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  aspect-ratio: 16/8;
  box-shadow: var(--shadow-soft);
}
.portfolio-hero img {
  width: 100%; height: 100%; object-fit: cover;
}
.portfolio-hero__caption {
  position: absolute;
  left: 1.5rem; bottom: 1.5rem;
  padding: .9rem 1.2rem;
  max-width: min(80%, 360px);
}
@media (max-width: 640px) {
  .portfolio-hero { aspect-ratio: 4/5; }
  .portfolio-hero__caption { left: 1rem; bottom: 1rem; right: 1rem; max-width: none; }
}

.credit-card {
  display: flex; align-items: flex-start; gap: .9rem;
  padding: 1.3rem 1.4rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  transition: transform .25s ease, border-color .25s ease;
}
.credit-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.credit-card__icon {
  width: 40px; height: 40px;
  flex-shrink: 0;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(var(--accent-rgb), .12);
  color: var(--accent);
}
.credit-card__icon svg { width: 20px; height: 20px; }
.credit-card__tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: .66rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

/* ============ CROSS-LINK BANNER ============ */
.cross-link-banner {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  padding: 2rem clamp(1.5rem, 4vw, 2.75rem);
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  text-decoration: none;
  color: var(--fg);
  transition: transform .3s ease, border-color .3s ease;
}
.cross-link-banner:hover { transform: translateY(-3px); border-color: var(--accent); }
.cross-link-banner__icon {
  width: 56px; height: 56px;
  flex-shrink: 0;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(var(--accent-rgb), .12);
  color: var(--accent);
}
.cross-link-banner__icon svg { width: 28px; height: 28px; }
.cross-link-banner__text { flex: 1; }
.cross-link-banner__arrow {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px;
  border-radius: 999px;
  border: 1px solid var(--border);
  flex-shrink: 0;
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}
.cross-link-banner:hover .cross-link-banner__arrow { background: var(--accent); border-color: var(--accent); color: #fff; transform: translateX(4px); }
@media (max-width: 640px) {
  .cross-link-banner { flex-wrap: wrap; }
  .cross-link-banner__arrow { display: none; }
}


/* ============ TAGS ============ */
.tag-chip {
  font-size: .8rem;
  padding: .5rem .9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--fg-muted);
  font-family: 'JetBrains Mono', monospace;
  transition: border-color .2s ease, color .2s ease;
}
.tag-chip:hover { border-color: var(--accent); color: var(--accent); }

/* ============ CERT TILES ============ */
.cert-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: .72rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--fg-muted);
  border: 1px solid var(--border);
  padding: .4rem .8rem;
  border-radius: 999px;
  white-space: nowrap;
}
.cert-tile-grid {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
}
.cert-tile {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-size: .8rem;
  line-height: 1.2;
  padding: .5rem .8rem;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--fg);
  transition: border-color .2s ease, transform .2s ease, background .2s ease;
}
.cert-tile::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 999px;
  background: var(--accent);
  flex-shrink: 0;
}
.cert-tile:hover { border-color: var(--accent); background: rgba(var(--accent-rgb), .06); transform: translateY(-1px); }

.cert-tile--focus {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), .08);
  font-weight: 600;
}
.cert-tile--focus::before { width: 8px; height: 8px; }

/* ============ SPECIALIZATIONS ============ */
.spec-featured {
  display: flex;
  gap: 2rem;
  padding: clamp(1.75rem, 4vw, 2.75rem);
  border-radius: 24px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  background: linear-gradient(155deg, color-mix(in srgb, var(--accent) 9%, var(--bg-elev)) 0%, var(--bg-elev) 55%);
  box-shadow: 0 20px 60px -25px rgba(var(--accent-rgb), .35);
}
.spec-featured__icon {
  width: 72px; height: 72px;
  flex-shrink: 0;
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 12px 28px -10px rgba(var(--accent-rgb), .55);
}
.spec-featured__icon svg { width: 34px; height: 34px; }
.spec-featured__tag {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #fff;
  background: var(--accent);
  padding: .35rem .75rem;
  border-radius: 999px;
}
.spec-featured__grid {
  margin-top: 1.75rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: .75rem;
}
.spec-pill {
  display: flex; align-items: center; gap: .6rem;
  font-size: .85rem;
  font-weight: 500;
  padding: .7rem .9rem;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
}
.spec-pill svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--accent); }
@media (max-width: 640px) {
  .spec-featured { flex-direction: column; }
}

.spec-card {
  padding: 1.75rem;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  transition: transform .25s ease, border-color .25s ease;
}
.spec-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.spec-card__icon {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
  background: rgba(var(--accent-rgb), .12);
  color: var(--accent);
}
.spec-card__icon svg { width: 22px; height: 22px; }
.spec-list { margin-top: .25rem; font-size: .9rem; color: var(--fg-muted); }
.spec-list li { position: relative; padding-left: 1.1rem; padding-block: .3rem; }
.spec-list li::before {
  content: "";
  position: absolute; left: 0; top: .85rem;
  width: 6px; height: 6px;
  border-radius: 999px;
  background: var(--accent);
}

/* ============ PORTFOLIO ============ */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.1rem;
}

.portfolio-item {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  aspect-ratio: 4/3;
  display: block;
  text-decoration: none;
  color: var(--fg);
}
.portfolio-item img {
  width: 100%; height: 100%; object-fit: cover;
  object-position: top;
  transition: transform .5s ease;
  cursor: zoom-in;
}
.portfolio-item:hover img { transform: scale(1.06); }
.portfolio-item figcaption {
  position: absolute; inset-inline: 0; bottom: 0;
  padding: 1.1rem;
  display: flex; flex-direction: column; gap: .1rem;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.75));
  color: #fff;
}
.portfolio-item figcaption .text-xs { color: rgba(255,255,255,.75); }
.portfolio-item.is-hidden { display: none; }

.filter-chip {
  font-size: .82rem;
  font-weight: 600;
  padding: .5rem 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--fg-muted);
  cursor: pointer;
  transition: all .2s ease;
}
.filter-chip:hover { color: var(--fg); border-color: var(--accent); }
.filter-chip.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }

.portfolio-item--icon {
  background: var(--bg-elev);
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  padding: 1.5rem;
}
.portfolio-item--icon .portfolio-item__icon {
  width: 44px; height: 44px;
  margin: 0 auto .9rem;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
  background: rgba(var(--accent-rgb), .12);
  color: var(--accent);
}
.portfolio-item--icon .portfolio-item__icon svg { width: 22px; height: 22px; }
.portfolio-item--icon:hover { border-color: var(--accent); }

/* ============ PORTFOLIO LIGHTBOX ============ */
body.lightbox-open { overflow: hidden; }
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.5rem, 6vw, 4rem);
  background: rgba(5, 3, 10, .94);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
}
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox__img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .55);
  -webkit-user-select: none; user-select: none;
  -webkit-user-drag: none;
  transform: scale(.96);
  transition: transform .25s ease;
}
.lightbox.is-open .lightbox__img { transform: scale(1); }
.lightbox__close {
  position: absolute;
  top: clamp(1rem, 3vw, 1.75rem);
  right: clamp(1rem, 3vw, 1.75rem);
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .22);
  background: rgba(255, 255, 255, .08);
  color: #fff;
  cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}
.lightbox__close:hover { background: rgba(255, 255, 255, .18); transform: scale(1.06); }
.lightbox__caption {
  position: absolute;
  bottom: clamp(1rem, 3vw, 1.75rem);
  left: 50%;
  transform: translateX(-50%);
  max-width: 90%;
  text-align: center;
  color: rgba(255, 255, 255, .85);
  font-family: 'JetBrains Mono', monospace;
  font-size: .78rem;
  letter-spacing: .04em;
}

/* ============ POST CARDS ============ */
.post-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  border-radius: 16px;
  padding: 1.75rem;
  transition: transform .25s ease, border-color .25s ease;
}
.post-card:hover { transform: translateY(-4px); border-color: var(--accent); }
.post-card__media {
  position: absolute;
  inset: 0;
  background-image: var(--post-bg);
  background-size: cover;
  background-position: center;
  opacity: .25;
  z-index: 0;
}
.post-card__body { position: relative; z-index: 1; }
.post-card--featured { padding: 2.25rem; }
.post-card__tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  padding: .3rem .6rem;
  border-radius: 999px;
}

.post-card--soon { border-style: dashed; }
.post-card__tag--soon {
  color: var(--fg-muted);
  border-color: var(--border);
}

/* ============ BRIEF ARTICLE (blog post pages) ============ */
.brief-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem 1rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: .78rem;
  color: var(--fg-muted);
}
.brief-meta-row .dot { opacity: .5; }
.brief-back-link {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: var(--fg-muted);
  text-decoration: none;
  font-size: .85rem;
  transition: color .2s ease;
}
.brief-back-link:hover { color: var(--accent); }

.brief-article { max-width: 760px; }
.brief-article h2 {
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  font-size: clamp(1.35rem, 2.6vw, 1.85rem);
  line-height: 1.15;
  color: var(--fg);
  margin: 3rem 0 1.1rem;
}
.brief-article > h2:first-child { margin-top: 0; }
.brief-article h3 {
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  font-size: 1.2rem;
  letter-spacing: -.005em;
  color: var(--fg);
  margin: 2.25rem 0 .75rem;
}
.brief-article h4 {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--fg);
  margin: 1.75rem 0 .5rem;
}
.brief-article p { color: var(--fg-muted); line-height: 1.75; margin: 0 0 1.25rem; font-size: 1rem; }
.brief-article p.lede { color: var(--fg); font-size: 1.1rem; line-height: 1.7; }
.brief-article strong { color: var(--fg); font-weight: 600; }
.brief-article ul, .brief-article ol {
  color: var(--fg-muted);
  line-height: 1.75;
  margin: 0 0 1.25rem;
  padding-left: 1.25rem;
}
.brief-article li { margin-bottom: .45rem; }
.brief-article li::marker { color: var(--accent); font-weight: 600; }
.brief-article a:not(.cta-solid):not(.cta-outline) { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.brief-article hr { border: none; border-top: 1px solid var(--border); margin: 3rem 0; }
.brief-article blockquote {
  border-left: 3px solid var(--accent);
  padding: .2rem 0 .2rem 1.25rem;
  margin: 1.5rem 0;
  color: var(--fg);
  font-style: italic;
  font-size: 1.02rem;
}

.brief-callout {
  background: color-mix(in srgb, var(--accent) 6%, var(--bg-elev));
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border));
  border-radius: 14px;
  padding: 1.4rem 1.6rem;
  margin: 2rem 0;
}
.brief-callout p { font-size: .92rem; margin-bottom: .75rem; }
.brief-callout p:last-child, .brief-callout ul:last-child { margin-bottom: 0; }
.brief-callout ul { margin-bottom: 0; }
.brief-callout--muted {
  background: var(--bg-elev);
  border-color: var(--border);
}
.brief-callout--muted p { font-size: .82rem; color: var(--fg-muted); }

.brief-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: .85rem;
  margin: 1.75rem 0 2rem;
}
.brief-stat {
  border: 1px solid var(--border);
  background: var(--bg-elev);
  border-radius: 12px;
  padding: 1.1rem 1.2rem;
}
.brief-stat__label {
  font-family: 'JetBrains Mono', monospace;
  font-size: .66rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--fg-muted);
  display: block;
}
.brief-stat__value {
  font-family: 'Oswald', sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--fg);
  margin-top: .35rem;
}
.brief-stat__delta { font-size: .76rem; margin-top: .3rem; color: var(--fg-muted); }
.brief-stat__delta--good { color: #1a8a4a; }
[data-theme="dark"] .brief-stat__delta--good { color: #3ddc84; }
.brief-stat__delta--bad { color: #b3261e; }
[data-theme="dark"] .brief-stat__delta--bad { color: #ff6b6b; }

.brief-table-wrap {
  overflow-x: auto;
  margin: 1.5rem 0 2rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  -webkit-overflow-scrolling: touch;
}
.brief-table { width: 100%; border-collapse: collapse; font-size: .86rem; min-width: 620px; }
.brief-table th, .brief-table td { padding: .7rem .9rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.brief-table thead th {
  font-family: 'JetBrains Mono', monospace;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--fg-muted);
  background: var(--bg);
  white-space: nowrap;
}
.brief-table tbody tr:last-child td { border-bottom: none; }
.brief-table tbody tr:hover { background: rgba(var(--accent-rgb), .05); }
.brief-table td strong { color: var(--fg); }

.brief-cloud-group { margin-bottom: 1.4rem; }
.brief-cloud-group__label {
  font-family: 'JetBrains Mono', monospace;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--fg-muted);
  display: block;
  margin-bottom: .6rem;
}
.brief-cloud-tags { display: flex; flex-wrap: wrap; gap: .5rem; }
.brief-cloud-tags--lg .tag-chip { font-size: .95rem; padding: .6rem 1.1rem; font-weight: 600; color: var(--fg); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }

.brief-share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  padding-top: 2.5rem;
  margin-top: 2.5rem;
  border-top: 1px solid var(--border);
}

/* ============ BRIEF HERO ROW (title + filter, top of page) ============ */
.brief-hero-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: start;
}
.brief-hero-row > * { min-width: 0; }
@media (min-width: 1024px) {
  .brief-hero-row { grid-template-columns: 1fr 280px; gap: 2.5rem; }
}

/* Mobile/tablet: a compact toggle button; desktop hides it and the panel
   below is always shown instead, aligned with the H1. */
.brief-filter-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  width: 100%;
  font-size: .85rem;
  font-weight: 600;
  padding: .85rem 1.1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--fg);
  cursor: pointer;
  transition: border-color .2s ease, color .2s ease;
}
.brief-filter-toggle:hover { border-color: var(--accent); color: var(--accent); }
.brief-filter-toggle__label { display: inline-flex; align-items: center; gap: .55rem; }
.brief-filter-toggle__chev { transition: transform .2s ease; flex-shrink: 0; }
.brief-filter-toggle[aria-expanded="true"] .brief-filter-toggle__chev { transform: rotate(180deg); }

.brief-filter-panel {
  border: 1px solid var(--border);
  background: var(--bg-elev);
  border-radius: 12px;
  padding: 1.25rem 1.4rem;
  margin-top: .6rem;
}
.brief-filter-panel[hidden] { display: none; }

@media (min-width: 1024px) {
  .brief-filter-toggle { display: none; }
  .brief-filter-panel { margin-top: 0; }
  .brief-filter-panel[hidden] { display: block; }
}

/* ============ BRIEF LAYOUT (article + sidebar) ============ */
.brief-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: start;
}
.brief-layout > * { min-width: 0; }
@media (min-width: 1024px) {
  .brief-layout { grid-template-columns: 1fr 300px; }
}

.brief-sidebar { min-width: 0; }
.brief-sidebar-inner {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
@media (min-width: 1024px) {
  .brief-sidebar-inner { position: sticky; top: 5.5rem; max-height: calc(100vh - 7rem); overflow-y: auto; }
}

.brief-sidebar-card {
  border: 1px solid var(--border);
  background: var(--bg-elev);
  border-radius: 14px;
  padding: 1.35rem 1.5rem;
}
.brief-sidebar-card__title {
  font-family: 'JetBrains Mono', monospace;
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--fg-muted);
  display: block;
  margin-bottom: 1rem;
}

/* On-this-page TOC */
.brief-toc { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .15rem; }
.brief-toc a {
  display: block;
  font-size: .82rem;
  line-height: 1.35;
  color: var(--fg-muted);
  text-decoration: none;
  padding: .4rem 0 .4rem .8rem;
  border-left: 2px solid var(--border);
  transition: color .2s ease, border-color .2s ease;
}
.brief-toc a:hover { color: var(--fg); border-color: var(--fg-muted); }
.brief-toc a.is-active { color: var(--accent); border-color: var(--accent); font-weight: 600; }

/* Filter groups */
.brief-filter-group { margin-bottom: 1.35rem; }
.brief-filter-group:last-child { margin-bottom: 0; }
.brief-filter-group__label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--fg);
  margin-bottom: .6rem;
  display: block;
}
.brief-filter-list { display: flex; flex-direction: column; gap: .1rem; }
.brief-filter-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  font-size: .84rem;
  color: var(--fg-muted);
  text-decoration: none;
  padding: .4rem .1rem;
  border-radius: 6px;
  transition: color .2s ease, background .2s ease;
}
.brief-filter-link:hover { color: var(--accent); background: rgba(var(--accent-rgb), .06); }
.brief-filter-link__label { flex: 1 1 auto; min-width: 0; overflow-wrap: break-word; }
.brief-filter-link__count {
  font-family: 'JetBrains Mono', monospace;
  font-size: .68rem;
  color: var(--fg-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .05rem .5rem;
  flex-shrink: 0;
}

/* Up-next (unpublished) list */
.brief-upnext { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .9rem; }
.brief-upnext li { font-size: .84rem; line-height: 1.4; color: var(--fg-muted); padding-left: .8rem; border-left: 2px dashed var(--border); }
.brief-upnext li strong { display: block; color: var(--fg); font-weight: 600; font-size: .86rem; margin-bottom: .15rem; }

/* Filter banner on the Briefs index/section */
.brief-filter-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-elev));
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border));
  border-radius: 12px;
  padding: .85rem 1.2rem;
  margin-bottom: 1.5rem;
  font-size: .88rem;
  color: var(--fg);
}
.brief-filter-banner[hidden] { display: none; }
.brief-filter-clear {
  font-family: 'JetBrains Mono', monospace;
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}
.brief-filter-clear:hover { text-decoration: underline; }

/* ============ CONTACT ============ */
.contact-panel { padding: clamp(2rem, 5vw, 3.5rem); }
.contact-row { display: flex; align-items: center; gap: .85rem; }
.contact-row a { color: var(--fg); text-decoration: none; border-bottom: 1px solid transparent; transition: border-color .2s ease, color .2s ease; }
.contact-row a:hover { color: var(--accent); border-color: var(--accent); }

.form-label { display: block; font-size: .8rem; font-weight: 600; margin-bottom: .4rem; color: var(--fg-muted); }
.form-input {
  width: 100%;
  padding: .75rem .9rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg);
  font-family: 'Inter', sans-serif;
  font-size: .92rem;
  transition: border-color .2s ease;
}
.form-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .18); }

.social-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .55rem 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: .82rem;
  font-weight: 600;
  color: var(--fg);
  text-decoration: none;
  transition: border-color .2s ease, color .2s ease;
}
.social-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ============ FOOTER ============ */
.footer { border-top: 1px solid var(--border); position: relative; z-index: 1; background: var(--bg); }
.footer-heading { font-family: 'JetBrains Mono', monospace; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--fg-muted); margin-bottom: 1rem; }
.footer-links { display: flex; flex-direction: column; gap: .6rem; font-size: .9rem; }
.footer-links a { color: var(--fg-muted); text-decoration: none; transition: color .2s ease; }
.footer-links a:hover { color: var(--accent); }
.footer-bottom {
  margin-top: 3.5rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 1rem;
  font-size: .8rem;
  color: var(--fg-muted);
}
.footer-credit-name {
  color: #000;
  font-weight: 600;
}
[data-theme="dark"] .footer-credit-name {
  color: var(--accent-2);
  text-shadow: 0 0 8px rgba(var(--accent-2-rgb), .5);
}

/* ============ REVEAL ANIMATION FALLBACK ============ */
[data-reveal] { opacity: 1; }
.js-anim [data-reveal] { opacity: 0; transform: translateY(24px); }

/* focus visibility */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ============ CYBERPUNK NEON INTERACTIONS (dark theme only) ============ */
[data-theme="dark"] .cta-solid:hover {
  box-shadow: 0 0 24px rgba(var(--accent-rgb), .65), 0 12px 30px -10px rgba(var(--accent-rgb), .5);
}
[data-theme="dark"] .cta-outline:hover {
  box-shadow: 0 0 18px rgba(var(--accent-rgb), .3);
}
[data-theme="dark"] .cta-pill {
  background: #fff;
  color: #000;
  box-shadow: 0 0 14px rgba(var(--accent-2-rgb), .55), 0 0 28px rgba(var(--accent-2-rgb), .25);
}
[data-theme="dark"] .cta-pill:hover {
  box-shadow: 0 0 22px rgba(var(--accent-2-rgb), .85), 0 0 42px rgba(var(--accent-2-rgb), .4);
}
[data-theme="dark"] .theme-toggle:hover {
  box-shadow: 0 0 16px rgba(var(--accent-rgb), .45);
}
[data-theme="dark"] .portfolio-item:hover,
[data-theme="dark"] .portfolio-teaser-card:hover {
  box-shadow: 0 0 0 1px var(--accent-2), 0 0 28px rgba(var(--accent-2-rgb), .45);
}
[data-theme="dark"] .credit-card:hover,
[data-theme="dark"] .post-card:hover {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 1px rgba(var(--accent-2-rgb), .4), 0 0 22px rgba(var(--accent-2-rgb), .3);
}
[data-theme="dark"] .cross-link-banner:hover {
  box-shadow: 0 0 30px rgba(var(--accent-rgb), .2);
}
[data-theme="dark"] .filter-chip.is-active,
[data-theme="dark"] .subpage-tab.is-active {
  box-shadow: 0 0 18px rgba(var(--accent-rgb), .55);
}
[data-theme="dark"] .glass-card {
  box-shadow: var(--shadow-soft), 0 0 30px rgba(var(--accent-2-rgb), .06);
}
[data-theme="dark"] .credit-card__icon,
[data-theme="dark"] .cross-link-banner__icon {
  box-shadow: 0 0 16px rgba(var(--accent-rgb), .25);
}
[data-theme="dark"] .portfolio-hero {
  box-shadow: var(--shadow-soft), 0 0 40px rgba(var(--accent-rgb), .12);
}


/* ============ BLOG VISIBILITY SWITCH ============ */
/* <body data-blog="off"> hides every [data-blog-item] (nav links, section, cards, CTAs). The CMS flips it. */
body[data-blog="off"] [data-blog-item] { display: none !important; }
