/* ============================================================
   DESIGN SYSTEM
   Fonts: Bricolage Grotesque (display) + DM Sans (body)
   Palette: Apple-adjacent — #fbfbfd light / #1d1d1f dark
   ============================================================ */
@import url('https://cdn.jsdelivr.net/npm/@tabler/icons-webfont@3/dist/tabler-icons.min.css');

:root {
  /* — Colors — */
  --c-bg:           #fbfbfd;
  --c-bg-alt:       #f5f5f7;
  --c-bg-dark:      #1d1d1f;
  --c-bg-dark-2:    #2a2a2c;
  --c-text:         #1d1d1f;
  --c-text-sub:     #6e6e73;
  --c-white:        #f5f5f7;
  --c-white-sub:    #a1a1a6;
  --c-accent:       #7e22ce;
  --c-accent-hi:    #9333ea;
  --c-border:       rgba(0,0,0,0.08);
  --c-border-dark:  rgba(255,255,255,0.10);
  --c-error:        #dc2626;
  --c-on-accent:    #fff;    /* text/icons on accent-colored backgrounds */
  --c-amber:        #b45309; /* warning/shared tags */
  --c-404-title:    #1d1d1f; /* 404 page title (slightly dimmed in dark) */

  /* — Contact success animation (envelope + hearts) — */
  --env-body: #faf5ff;
  --env-flap: #e5d2fc;
  --env-line: #6b21a8;
  --heart-1: #d8b4fe;
  --heart-2: #ede9fe;
  --heart-3: #c084fc;
  --heart-4: #7e22ce;
  --heart-5: #a855f7;
  --heart-6: #9333ea;

  /* — Typography — */
  --f-display: 'Bricolage Grotesque', sans-serif;
  --f-body:    'DM Sans', sans-serif;

  /* — Spacing (8px grid) — */
  --s-1: 0.5rem;    /* 8 */
  --s-2: 1rem;      /* 16 */
  --s-3: 1.5rem;    /* 24 */
  --s-4: 2rem;      /* 32 */
  --s-6: 3rem;      /* 48 */
  --s-8: 4rem;      /* 64 */
  --s-12: 6rem;     /* 96 */
  --s-20: 10rem;    /* 160 */

  /* — Layout — */
  --max-w:  1160px;
  --nav-h:  52px;
  --radius: 20px;

  /* — Motion — */
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}


/* ============================================================
   RESET
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img  { max-width: 100%; height: auto; display: block; }
a    { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
ul, ol { list-style: none; }
input, textarea { font-family: inherit; font-size: inherit; }


/* ============================================================
   TYPOGRAPHY SCALE
   ============================================================ */
.t-hero {
  font-family: var(--f-display);
  font-size: clamp(3rem, 10vw, 7.5rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.t-section {
  font-family: var(--f-display);
  font-size: clamp(2rem, 5vw, 3.75rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.025em;
  color: inherit;
}

.t-card {
  font-family: var(--f-display);
  font-size: clamp(1.2rem, 2.5vw, 1.625rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

.t-eyebrow {
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--c-text-sub);
}

.t-body-lg {
  font-size: clamp(1rem, 2vw, 1.25rem);
  font-weight: 300;
  line-height: 1.6;
}

/* ============================================================
   LAYOUT UTILITIES
   ============================================================ */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--s-4);
}

.section      { padding: var(--s-20) 0; }
.cs-hero + .section,
.cs-hero--overlay + .section,
figure + .section { padding-top: var(--s-12); } /* ~96px after hero image */

/* ── Overlay Hero ──────────────────────────────────────────── */
.cs-hero--overlay {
  position: relative;
  width: 100%;
  height: clamp(360px, 52vw, 600px);
  /* background-image set via inline style to avoid CSS variable URL resolution issues */
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.cs-hero--overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--hero-tint, rgba(0,0,0,0.35));
  z-index: 1;
}
.cs-hero--no-tint::before { display: none; }
.cs-hero--overlay .hero-float {
  position: relative;
  z-index: 2;
  height: 100%;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 24px 48px rgba(0,0,0,0.4));
}
.cs-hero--overlay .hero-float--fill {
  height: 100%;
  object-fit: cover;
  object-position: center;
}
@media (max-width: 640px) {
  .cs-hero--overlay {
    height: 200px;
  }
  .cs-hero--overlay .hero-float {
    height: auto;
    width: 85%;
  }
  .cs-hero--overlay .hero-float--fill {
    height: 100%;
    width: 100%;
  }
}
.section--alt { background: var(--c-bg-alt); }
.section--dark {
  background: var(--c-bg-dark);
  color: var(--c-white);
}

.section-intro {
  text-align: center;
  max-width: 620px;
  margin: 0 auto var(--s-12);
}
.section-intro .t-eyebrow { display: block; margin-bottom: var(--s-3); color: var(--c-accent); }
.section-intro .t-section  { margin-bottom: var(--s-3); }
.section-intro p           { color: var(--c-text-sub); font-weight: 300; line-height: 1.65; }
.section-intro--dark p     { color: var(--c-white-sub); }
.section-intro--dark .t-section { color: var(--c-white); }

/* ── Case study text components (cs-eyebrow / cs-heading / cs-subheading) ──
   Canonical definitions. Do NOT redefine these in per-page inline <style>
   blocks — that caused eyebrow/heading spacing drift across case studies. */
.cs-eyebrow {
  display: block;
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--c-accent);
  margin-bottom: var(--s-2);
}
.cs-heading {
  font-family: var(--f-display);
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: var(--c-text);
  margin-bottom: var(--s-3);
  margin-top: var(--s-8);
}
.cs-heading:first-child { margin-top: 0; }
.cs-eyebrow + .cs-heading { margin-top: var(--s-2); }
.cs-subheading {
  font-family: var(--f-display);
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--c-text);
  margin-bottom: var(--s-2);
  margin-top: var(--s-6);
}

/* ── Case study content components (cs-meta / cs-body / cs-hero / cs-callout / cs-stat) ──
   Canonical definitions. Do NOT redefine these in per-page inline <style> blocks. */
.cs-meta { display: flex; gap: var(--s-2); flex-wrap: wrap; margin-bottom: var(--s-8); }
.cs-meta-item { flex: 1 1 140px; background: var(--c-bg-alt); border-radius: 12px; padding: var(--s-3); }
.cs-meta-item__label { font-size: .75rem; font-weight: 500; letter-spacing: .07em; text-transform: uppercase; color: var(--c-text-sub); display: block; margin-bottom: .4rem; }
.cs-meta-item__value { font-size: .9375rem; font-weight: 400; color: var(--c-text); }
.cs-meta-item__value a { color: var(--c-accent); transition: opacity .2s; }
.cs-meta-item__value a:hover { opacity: .7; }

.cs-body { max-width: 720px; margin-bottom: var(--s-12); }
.cs-body p { font-size: 1.0625rem; line-height: 1.75; color: var(--c-text-sub); font-weight: 300; margin-bottom: var(--s-4); }
.cs-body p:last-child { margin-bottom: 0; }

.cs-hero { width: 100%; max-height: 520px; object-fit: cover; display: block; background: var(--c-bg-alt); }

.cs-callout { background: var(--c-bg-alt); border-left: 3px solid var(--c-accent); border-radius: 0 12px 12px 0; padding: var(--s-4) var(--s-6); margin: var(--s-6) 0; max-width: 720px; }
.cs-callout__label { font-size: .75rem; font-weight: 500; letter-spacing: .07em; text-transform: uppercase; color: var(--c-accent); display: block; margin-bottom: var(--s-2); }
.cs-callout p { font-size: 1.0625rem; line-height: 1.7; color: var(--c-text-sub); font-weight: 300; margin: 0; font-style: italic; }
.cs-callout strong { font-weight: 700; }

/* ── Quote pull (cs-quote) ──
   Canonical definition. Do NOT redefine in per-page inline <style> blocks. */
.cs-quote {
  max-width: 720px;
  margin: var(--s-6) 0;
  padding: var(--s-4);
  border-radius: 12px;
  background: var(--c-bg-alt);
}
.cs-quote::before {
  content: '“';
  font-family: var(--f-display);
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
  color: var(--c-accent);
  display: block;
  margin-bottom: var(--s-2);
}
.cs-quote p {
  font-size: 1.125rem;
  line-height: 1.65;
  color: var(--c-text-sub);
  font-weight: 300;
  font-style: italic;
  margin: 0 0 var(--s-2) 0;
}
.cs-quote cite {
  font-size: .8125rem;
  color: var(--c-accent);
  font-style: normal;
}

.cs-stats { display: flex; gap: var(--s-4); flex-wrap: wrap; margin: var(--s-6) 0; }
.cs-stat { flex: 1 1 160px; background: var(--c-bg-alt); border-radius: 12px; padding: var(--s-4); }
.cs-stat__value { font-family: var(--f-display); font-weight: 800; font-size: 2rem; color: var(--c-accent); line-height: 1; margin-bottom: .35rem; }
.cs-stat__label { font-size: .8125rem; color: var(--c-text-sub); line-height: 1.4; }

/* ── Image placeholder (img-ph) ──
   Canonical definition. Do NOT redefine in per-page inline <style> blocks. */
.img-ph {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--c-bg-alt);
  border: 1.5px dashed var(--c-border);
  border-radius: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: var(--s-4);
  text-align: center;
}
.img-ph__tag {
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--c-accent);
  background: color-mix(in srgb, var(--c-accent) 10%, transparent);
  padding: .25em .75em;
  border-radius: 980px;
}
.img-ph__title {
  font-family: var(--f-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--c-text-sub);
}
.img-ph__desc {
  font-size: .8125rem;
  color: var(--c-text-sub);
  opacity: .6;
  max-width: 360px;
  line-height: 1.5;
}

/* ── Section divider + product label (shared by multi-product case studies) ── */
.cs-section-divider {
  border: none;
  border-top: 1px solid var(--c-border);
  margin: var(--s-8) 0 var(--s-8);
}
.cs-section-divider + .cs-body { margin-top: 0; }
.cs-product-label {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: var(--c-accent);
  color: var(--c-on-accent);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .3rem .75rem;
  border-radius: 20px;
  margin-bottom: var(--s-3);
}

@media (max-width: 768px) {
  .container { padding: 0 var(--s-3); }
  .section   { padding: var(--s-12) 0; }
}


/* ============================================================
   NAVIGATION
   ============================================================ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  height: var(--nav-h);
  background: rgba(251,251,253,.88);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--c-border);
  transition: background .3s var(--ease), border-color .3s var(--ease);
}

.nav.is-dark {
  background: rgba(29,29,31,.88);
  border-bottom-color: var(--c-border-dark);
}

.nav.is-scrolled {
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}

.nav__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--s-4);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__logo {
  font-family: var(--f-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--c-text);
  transition: color .25s var(--ease);
}
.nav.is-dark .nav__logo { color: var(--c-white); }

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--s-4);
}

.nav__links a {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--c-text);
  position: relative;
  transition: opacity .2s;
}
.nav.is-dark .nav__links a { color: var(--c-white); }
.nav__links a:hover { opacity: .6; }

/* Underline active link */
.nav__links a.active::after {
  content: '';
  position: absolute;
  bottom: -3px; left: 0; right: 0;
  height: 1px;
  background: currentColor;
}

/* Pill CTA */
.nav__links .nav__cta {
  font-weight: 500;
  padding: .4em 1.1em;
  border-radius: 980px;
  background: var(--c-accent);
  color: var(--c-on-accent) !important;
  transition: background .2s var(--ease), transform .15s;
}
.nav__links .nav__cta:hover { background: var(--c-accent-hi); transform: scale(1.03); opacity: 1; }
.nav__links .nav__cta.active::after { display: none; }

/* Hamburger */
.nav__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 24px;
  height: var(--nav-h);
}
.nav__toggle span {
  display: block;
  height: 1.5px;
  background: var(--c-text);
  border-radius: 2px;
  transition: transform .3s var(--ease), opacity .3s var(--ease), background .25s;
}
.nav.is-dark .nav__toggle span { background: var(--c-white); }
.nav__toggle.is-open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav__toggle.is-open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav__toggle.is-open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Mobile overlay */
.nav-overlay {
  display: none;
  position: fixed;
  inset: var(--nav-h) 0 0 0;
  background: rgba(29,29,31,.97);
  backdrop-filter: blur(20px);
  z-index: 199;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-4);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s var(--ease);
}
.nav-overlay.is-open { opacity: 1; pointer-events: all; }
.nav-overlay a {
  font-family: var(--f-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--c-white);
  letter-spacing: -0.025em;
  transition: opacity .2s;
}
.nav-overlay a:hover { opacity: .55; }

@media (max-width: 768px) {
  .nav__links  { display: none; }
  .nav__toggle { display: flex; }
  .nav-overlay { display: flex; }
}


/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: var(--c-bg-dark);
  color: var(--c-white);
  padding: var(--s-8) 0 var(--s-6);
}
.footer__inner { display: flex; flex-direction: column; gap: var(--s-6); }
.footer__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--s-4);
  flex-wrap: wrap;
}
.footer__name {
  font-family: var(--f-display);
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.footer__tagline {
  font-size: 0.875rem;
  color: var(--c-white-sub);
  margin-top: .2rem;
}
.footer__nav { display: flex; gap: var(--s-4); flex-wrap: wrap; align-items: center; }
.footer__nav a {
  font-size: 0.875rem;
  color: var(--c-white-sub);
  transition: color .2s;
}
.footer__nav a:hover { color: var(--c-white); }
.footer__rule { height: 1px; background: var(--c-border-dark); }
.footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-2);
  flex-wrap: wrap;
  font-size: 0.8125rem;
  color: var(--c-white-sub);
}
.footer__social { display: flex; gap: var(--s-3); }
.footer__social a { color: var(--c-white-sub); font-size: 0.8125rem; transition: color .2s; }
.footer__social a:hover { color: var(--c-white); }


/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .45em;
  font-family: var(--f-body);
  font-size: 1.0625rem;
  font-weight: 400;
  padding: .75em 1.5em;
  border-radius: 980px;
  transition: all .2s var(--ease);
  white-space: nowrap;
  cursor: pointer;
}
.btn--primary { background: var(--c-accent); color: var(--c-on-accent); }
.btn--primary:hover { background: var(--c-accent-hi); transform: scale(1.02); }
.btn--outline {
  background: transparent;
  color: var(--c-accent);
  box-shadow: inset 0 0 0 1.5px var(--c-accent);
}
.btn--outline:hover { background: var(--c-accent); color: var(--c-on-accent); }
.btn--outline-white {
  background: transparent;
  color: var(--c-white);
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.35);
}
.btn--outline-white:hover { background: rgba(255,255,255,.12); }
.btn--full { width: 100%; justify-content: center; }


/* ============================================================
   HERO  (index.html)
   ============================================================ */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(var(--nav-h) + var(--s-12)) var(--s-4) var(--s-20);
  background: var(--c-bg-dark);
  color: var(--c-white);
  position: relative;
  overflow: hidden;
}

/* Soft glow orb */
.hero::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -65%);
  width: 900px; height: 600px;
  background: radial-gradient(ellipse, rgba(0,102,204,.16) 0%, transparent 68%);
  pointer-events: none;
}

.hero__content { position: relative; max-width: 920px; }

.hero__eyebrow {
  display: block;
  color: var(--c-white);
  margin-bottom: var(--s-4);
  animation: riseIn .8s var(--ease-out) both;
}
.hero__title {
  font-family: var(--f-display);
  font-size: clamp(3rem, 10vw, 7.5rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.04em;
  margin-bottom: var(--s-4);
  animation: riseIn .8s .1s var(--ease-out) both;
}
.hero__sub {
  font-size: clamp(1.125rem, 2.5vw, 1.5rem);
  font-weight: 300;
  color: var(--c-white);
  max-width: 520px;
  margin: 0 auto var(--s-8);
  line-height: 1.5;
  animation: riseIn .8s .2s var(--ease-out) both;
}
.hero__ctas {
  display: flex;
  gap: var(--s-2);
  justify-content: center;
  flex-wrap: wrap;
  animation: riseIn .8s .3s var(--ease-out) both;
}
.hero__scroll-hint {
  position: absolute;
  bottom: var(--s-6);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-1);
  color: var(--c-white-sub);
  font-size: 0.75rem;
  letter-spacing: .06em;
  animation: fadeIn 2s 1.2s both;
}
.hero__scroll-hint::after {
  content: '';
  width: 1px;
  height: 44px;
  background: linear-gradient(to bottom, var(--c-white-sub), transparent);
  animation: breathe 2.2s ease-in-out infinite;
}


/* ============================================================
   PAGE HEADER  (non-home pages)
   ============================================================ */
.page-header {
  padding: calc(var(--nav-h) + var(--s-12)) 0 var(--s-8);
  background: linear-gradient(135deg, #0d0520 0%, #050f24 15%, #04141a 30%, #041410 45%, #050f24 60%, #0a0420 75%, #041a16 90%, #0d0520 100%);
  background-size: 400% 400%;
  animation: headerGradient 14s ease infinite;
  color: var(--c-white);
  text-align: center;
}

@keyframes headerGradient {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.page-header__eyebrow { display: block; color: rgba(255,255,255,0.5); margin-bottom: var(--s-3); }
.page-header__title {
  font-family: var(--f-display);
  font-size: clamp(2.5rem, 7vw, 5rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.05;
  margin-bottom: var(--s-3);
  color: var(--c-on-accent);
}
.page-header__sub {
  color: rgba(255,255,255,0.7);
  font-size: clamp(1rem, 2vw, 1.25rem);
  font-weight: 300;
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.5;
}


/* ============================================================
   WORK CARDS + GRIDS
   ============================================================ */

/* Featured 2-up grid (home) */
.grid--featured {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s-3);
}
.grid--featured .card--span-2 { grid-column: 1 / -1; }

/* Standard portfolio 2-col grid */
.grid--portfolio {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s-3);
}

@media (max-width: 768px) {
  .grid--featured,
  .grid--portfolio { grid-template-columns: 1fr; }
  .grid--featured .card--span-2 { grid-column: 1; }
}

/* Card base */
.card {
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--c-bg-alt);
  transition: transform .4s var(--ease-out);
  cursor: pointer;
}
.card:hover { transform: translateY(-4px) scale(1.005); }

/* Card image or placeholder */
.card__thumb {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
  transition: transform .5s var(--ease-out);
}
.card:hover .card__thumb { transform: scale(1.04); }

/* Overlay thumbnail (bg image + tint + floating image) */
.card__thumb--overlay {
  position: relative;
  /* background-image set via inline style to avoid CSS variable URL resolution issues */
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.card__thumb--overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--hero-tint, rgba(0,0,0,0.35));
  z-index: 1;
  transition: opacity .5s var(--ease-out);
}
.card:hover .card__thumb--overlay::before { opacity: .8; }
.card:hover .card__thumb--overlay { transform: none; }
.card-float {
  position: relative;
  z-index: 2;
  height: 100%;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  display: block;
  transition: transform .5s var(--ease-out);
}
.card:hover .card-float { transform: scale(1.04); }

.card__placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--f-display);
  font-size: clamp(3rem, 8vw, 7rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: rgba(255,255,255,.07);
  user-select: none;
  overflow: hidden;
  position: relative;
  transition: transform .5s var(--ease-out);
}
.card:hover .card__placeholder { transform: scale(1.04); }

/* Full-span card uses a wider aspect ratio */
.card--span-2 .card__placeholder,
.card--span-2 .card__thumb { aspect-ratio: 21/9; }

@media (max-width: 768px) {
  .card--span-2 .card__placeholder,
  .card--span-2 .card__thumb { aspect-ratio: 16/9; }
}

/* Card body */
.card__body {
  padding: var(--s-4);
  background: var(--c-bg-dark-2);
  color: var(--c-white);
}
.card__body--light {
  background: var(--c-bg-alt);
  color: var(--c-text);
}

.card__tags { display: flex; gap: var(--s-1); flex-wrap: wrap; margin-bottom: var(--s-2); }
.card__tag {
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: .25em .8em;
  border-radius: 980px;
  background: rgba(180,200,240,0.12);   /* blue-tinted, less white bleed */
  color: #b8c6e2;                        /* 6.3:1 on dark card bg — was failing */
}
.card__body--light .card__tag {
  background: transparent;              /* text directly on card bg = better contrast */
  color: #505060;                        /* 7.0:1 on #f5f5f7 — was #6e6e73 which failed */
  border: 1px solid rgba(0,0,0,0.14);
}
/* Muted tag + centered tag row (case study page headers) */
.card__tag--muted { background: var(--c-border); color: var(--c-text-sub); }
.tag-row { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center; margin-top: 1.5rem; }
/* Full-width block image */
.img-full { width: 100%; display: block; }

.card__title {
  font-family: var(--f-display);
  font-size: clamp(1.125rem, 2.5vw, 1.5rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin-bottom: var(--s-1);
}
.card__desc {
  font-size: .9375rem;
  font-weight: 300;
  line-height: 1.55;
  color: var(--c-white-sub);
}
.card__body--light .card__desc { color: var(--c-text-sub); }

.card__cta {
  display: inline-flex;
  align-items: center;
  gap: .4em;
  margin-top: var(--s-3);
  font-size: .9375rem;
  font-weight: 500;
  color: var(--c-accent);
  transition: gap .25s var(--ease);
}
.card:hover .card__cta { gap: .75em; }
.card__cta::after { content: '→'; }
/* Lighter purple for CTAs on dark card bodies */
.card__body:not(.card__body--light) .card__cta { color: #c084fc; }

/* Hidden state for filter */
.card.is-hidden { display: none; }


/* ============================================================
   ABOUT SPLIT (home + optionally resume)
   ============================================================ */
.about-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-12);
  align-items: center;
}
@media (max-width: 768px) {
  .about-split { grid-template-columns: 1fr; gap: var(--s-8); }
}

.about-split__photo-wrap {
  border-radius: 24px;
  overflow: hidden;
  aspect-ratio: 1/1;
  background: var(--c-bg-alt);
}
.about-split__photo-wrap img { width: 100%; height: 100%; object-fit: cover; }
.about-split__photo-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #2a2a2c 0%, #1a1a1c 100%);
  font-family: var(--f-display);
  font-size: 6rem; font-weight: 800;
  color: rgba(255,255,255,.05);
  letter-spacing: -0.04em;
}

.about-split__content .t-eyebrow { display: block; color: var(--c-accent); margin-bottom: var(--s-3); }
.about-split__content .t-section  { margin-bottom: var(--s-4); }
.about-split__content p {
  color: var(--c-text-sub);
  font-weight: 300;
  line-height: 1.7;
  font-size: 1.0625rem;
  margin-bottom: var(--s-3);
}
.about-split__content p:last-of-type { margin-bottom: var(--s-6); }


/* ============================================================
   JOURNEY  (home)
   ============================================================ */
.journey-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 800px;
  margin: var(--s-8) auto 0;
  padding-left: var(--s-6);
  border-left: 2px solid var(--c-border);
}
.journey-item {
  position: relative;
  padding: 0 0 var(--s-10) var(--s-6);
}
.journey-item:last-child { padding-bottom: 0; }
.journey-item__marker {
  position: absolute;
  left: calc(-1 * var(--s-6) - 5px);
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--c-accent);
  border: 2px solid var(--c-bg);
}
.journey-item__title {
  font-family: var(--f-display);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--c-text);
  margin-bottom: var(--s-2);
  letter-spacing: -0.01em;
}
.journey-item__copy {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--c-text-sub);
  font-weight: 300;
  margin: 0;
}
@media (max-width: 640px) {
  .journey-list { padding-left: var(--s-4); }
  .journey-item { padding-left: var(--s-4); }
  .journey-item__marker { left: calc(-1 * var(--s-4) - 5px); }
}


/* ============================================================
   JOURNEY CARDS  (home)
   ============================================================ */
.journey-section { background: #0a0d1a; color: var(--c-white); }
.journey-section .section-intro { text-align: center; }
.journey-section .t-eyebrow { color: var(--c-accent); }
.journey-section .t-section { color: var(--c-white); }

.journey-section { position: relative; overflow: hidden; }
.journey-path {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 420px;
  transform: translateY(-50%);
  pointer-events: none;
  z-index: 0;
}
.journey-path-mobile {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}
.journey-cards { position: relative; z-index: 1; }

.journey-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s-4);
  margin-top: var(--s-10);
}
@media (max-width: 900px) {
  .journey-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 500px) {
  .journey-cards { grid-template-columns: 1fr; }
  /* Swap to vertical winding SVG on mobile */
  .journey-path { display: none; }
  .journey-path-mobile { display: block; }
}

.journey-card {
  border-radius: 20px;
  padding: var(--s-4);
  position: relative;
  overflow: hidden;
  transition: transform .3s var(--ease-out);
}
.journey-card:hover { transform: translateY(-4px); }

.journey-card--coral  { background: #3b1f8c; }
.journey-card--teal   { background: #4c2baa; }
.journey-card--indigo { background: #5b35c4; }
.journey-card--amber  { background: #6d3fdf; }

.journey-card__year {
  display: inline-block;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.6);
  background: rgba(0,0,0,.2);
  border-radius: 20px;
  padding: .25rem .75rem;
  margin-bottom: var(--s-4);
}
.journey-card__icon {
  display: block;
  margin-bottom: var(--s-4);
  color: rgba(255,255,255,.9);
  width: 28px;
  height: 28px;
}
.journey-card__icon svg {
  width: 28px;
  height: 28px;
  stroke: rgba(255,255,255,.9);
  fill: none;
}
.journey-card__title {
  font-family: var(--f-display);
  font-size: 1.375rem;
  font-weight: 800;
  color: var(--c-on-accent);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: var(--s-4);
}
.journey-card__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}
.journey-card__list li {
  font-size: .9375rem;
  line-height: 1.6;
  color: rgba(255,255,255,.75);
  font-weight: 300;
  padding-left: 1.25rem;
  position: relative;
}
.journey-card__list li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: rgba(255,255,255,.4);
  font-size: .8rem;
  top: .1em;
}
.journey-card__list li strong {
  color: var(--c-on-accent);
  font-weight: 500;
}

/* ============================================================
   CAPABILITY TILES  (home — dark section)
   ============================================================ */
.caps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-3);
}
@media (max-width: 900px) { .caps-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 560px) { .caps-grid { grid-template-columns: 1fr; } }

.cap-tile {
  padding: var(--s-4);
  border-radius: var(--radius);
  background: var(--c-bg-dark-2);
  border: 1px solid var(--c-border-dark);
  transition: border-color .3s var(--ease), transform .35s var(--ease-out);
}
.cap-tile:hover { border-color: rgba(255,255,255,.22); transform: translateY(-5px); }
.cap-tile__icon { font-size: 1.75rem; display: block; margin-bottom: var(--s-3); }
.cap-tile__name {
  font-family: var(--f-display);
  font-size: 1.2rem; font-weight: 700;
  color: var(--c-white);
  margin-bottom: var(--s-2);
  letter-spacing: -0.01em;
}
.cap-tile__body { font-size: .9375rem; color: var(--c-white-sub); font-weight: 300; line-height: 1.6; }


/* ============================================================
   TESTIMONIALS
   ============================================================ */

/* Full-page grid */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s-3);
}
.testimonials-grid .tcard--featured { grid-column: 1 / -1; }
@media (max-width: 768px) {
  .testimonials-grid { grid-template-columns: 1fr; }
  .testimonials-grid .tcard--featured { grid-column: 1; }
}

.tcard {
  background: var(--c-bg-alt);
  border-radius: var(--radius);
  padding: var(--s-6);
  display: flex; flex-direction: column; gap: var(--s-4);
}
.tcard--featured {
  background: var(--c-bg-dark);
  color: var(--c-white);
}

.tcard__mark {
  font-family: var(--f-display);
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
  color: var(--c-accent);
  display: block;
  margin-bottom: calc(-1 * var(--s-4));
}
.tcard__quote {
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  font-weight: 400;
  line-height: 1.7;
  flex: 1;
  color: var(--c-text);
}
.tcard--featured .tcard__quote {
  font-size: clamp(1.125rem, 2vw, 1.375rem);
  color: var(--c-white);
}
.tcard__attr {
  display: flex; align-items: center; gap: var(--s-2);
  padding-top: var(--s-3);
  border-top: 1px solid var(--c-border);
}
.tcard--featured .tcard__attr { border-top-color: var(--c-border-dark); }

.tcard__avatar {
  width: 46px; height: 46px; border-radius: 50%;
  object-fit: cover; overflow: hidden; flex-shrink: 0;
  background: var(--c-bg-dark-2);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--f-display);
  font-size: .875rem; font-weight: 700;
  color: rgba(255,255,255,.5);
}
.tcard__name {
  font-family: var(--f-display);
  font-size: .9375rem; font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--c-text);
}
.tcard--featured .tcard__name { color: var(--c-white); }
.tcard__role { font-size: .8125rem; color: var(--c-text-sub); margin-top: .15rem; }
.tcard--featured .tcard__role { color: var(--c-white-sub); }

/* Mini testimonials (home) */
.mini-tlist { max-width: 760px; margin: 0 auto; }
.mini-t {
  display: flex; gap: var(--s-6); align-items: flex-start;
  padding: var(--s-6) 0;
  border-bottom: 1px solid var(--c-border);
}
.mini-t:last-child { border-bottom: none; }
.mini-t__avatar {
  width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, #e0e0e4, #d0d0d4);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--f-display);
  font-size: .875rem; font-weight: 700; color: rgba(0,0,0,.2);
  overflow: hidden;
}
.mini-t__avatar img { width: 52px; height: 52px; object-fit: cover; display: block; }
.mini-t__quote {
  font-size: 1.0625rem; font-weight: 300; line-height: 1.65;
  color: var(--c-text); margin-bottom: var(--s-2);
}
.mini-t__name { font-family: var(--f-display); font-size: .9375rem; font-weight: 700; }
.mini-t__role { font-size: .875rem; color: var(--c-text-sub); }
@media (max-width: 560px) { .mini-t { flex-direction: column; gap: var(--s-3); } }


/* ============================================================
   CTA BANNER
   ============================================================ */
.cta-banner {
  background: var(--c-bg-dark);
  color: var(--c-white);
  text-align: center;
  padding: var(--s-20) var(--s-4);
}
.cta-banner .t-section { max-width: 600px; margin: 0 auto var(--s-3); }
.cta-banner__sub {
  color: var(--c-white-sub);
  font-size: 1.125rem; font-weight: 300;
  max-width: 440px; margin: 0 auto var(--s-8);
  line-height: 1.6;
}
.cta-banner__actions {
  display: flex; gap: var(--s-2);
  justify-content: center; flex-wrap: wrap;
}


/* ============================================================
   PORTFOLIO: FILTER BAR
   ============================================================ */
.filter-bar { display: flex; gap: var(--s-1); flex-wrap: wrap; margin-bottom: var(--s-8); }
.filter-btn {
  font-family: var(--f-body);
  font-size: .875rem; font-weight: 500;
  padding: .5em 1.2em;
  border-radius: 980px;
  border: 1.5px solid var(--c-border);
  color: var(--c-text-sub);
  background: transparent;
  transition: all .2s var(--ease);
  cursor: pointer;
}
.filter-btn:hover { border-color: var(--c-text); color: var(--c-text); }
.filter-btn.is-active {
  background: var(--c-text);
  border-color: var(--c-text);
  color: var(--c-bg);
}


/* ============================================================
   RESUME PAGE
   ============================================================ */
.resume-intro {
  font-size: 1.125rem;
  font-weight: 300;
  line-height: 1.75;
  color: var(--c-text-sub);
  max-width: 680px;
  margin-bottom: var(--s-12);
}

.resume-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: var(--s-12);
  align-items: start;
}
@media (max-width: 900px) { .resume-layout { grid-template-columns: 1fr; } }

/* Section heading */
.resume-h {
  font-family: var(--f-display);
  font-size: 2rem; font-weight: 700;
  letter-spacing: -0.015em;
  margin-bottom: var(--s-6);
  padding-bottom: var(--s-3);
  border-bottom: 1.5px solid var(--c-border);
}

/* Role entry */
.role {
  margin-bottom: var(--s-8);
  padding-bottom: var(--s-8);
  border-bottom: 1px solid var(--c-border);
}
.role:last-child { border-bottom: none; padding-bottom: 0; margin-bottom: 0; }
.role__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--s-2);
  flex-wrap: wrap;
  margin-bottom: .2rem;
}
.role__company { font-family: var(--f-display); font-size: 1.2rem; font-weight: 700; letter-spacing: -0.01em; color: var(--c-text); }
.role__dates   { font-size: .875rem; color: var(--c-text-sub); white-space: nowrap; }
.role__title   { font-size: 1rem; font-weight: 500; color: var(--c-accent); margin-bottom: .2rem; }
.role__location { font-size: .875rem; color: var(--c-text-sub); margin-bottom: var(--s-3); }
.role__summary {
  font-size: .9375rem; font-weight: 300;
  line-height: 1.65; color: var(--c-text-sub);
  margin-bottom: var(--s-3);
}
.role__bullets  { display: flex; flex-direction: column; gap: var(--s-2); }
.role__bullets li {
  font-size: .9375rem; font-weight: 300;
  line-height: 1.55; color: var(--c-text-sub);
  padding-left: 1.25rem;
  position: relative;
}
.role__bullets li::before {
  content: '';
  position: absolute;
  left: 0; top: .55em;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--c-accent);
}

/* Aside cards */
.aside-card {
  background: var(--c-bg-alt);
  border-radius: 16px;
  padding: var(--s-4);
  margin-bottom: var(--s-3);
}
.aside-card:last-child { margin-bottom: 0; }
.aside-card__h {
  font-family: var(--f-display);
  font-size: 1rem; font-weight: 700;
  margin-bottom: var(--s-3);
  letter-spacing: -0.01em;
  color: var(--c-text);
}
.skill-tags { display: flex; flex-wrap: wrap; gap: var(--s-1); }
.skill-tag {
  font-size: .8rem; font-weight: 500;
  padding: .3em .85em;
  border-radius: 980px;
  background: var(--c-bg-alt);
  border: 1px solid rgba(0,0,0,0.12);
  color: var(--c-text);
}
.edu-entry { margin-bottom: var(--s-3); }
.edu-entry:last-child { margin-bottom: 0; }
.edu-entry__school { font-family: var(--f-display); font-size: .9375rem; font-weight: 700; }
.edu-entry__degree { font-size: .875rem; color: var(--c-text-sub); margin-top: .2rem; }
.edu-entry__years  { font-size: .8125rem; color: var(--c-text-sub); }

/* Resume section grouping */
.resume-section { margin-bottom: var(--s-12); }
.resume-section:last-child { margin-bottom: 0; }


/* ============================================================
   CONTACT PAGE
   ============================================================ */
.contact-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-12);
  align-items: start;
}
@media (max-width: 768px) { .contact-split { grid-template-columns: 1fr; } }

.contact-info .t-section  { margin-bottom: var(--s-4); }
.contact-info__body {
  font-size: 1.0625rem; font-weight: 300;
  line-height: 1.7; color: var(--c-text-sub);
  margin-bottom: var(--s-6);
}
.contact-details { display: flex; flex-direction: column; gap: var(--s-3); }
.contact-item__label {
  font-size: .75rem; font-weight: 500;
  letter-spacing: .07em; text-transform: uppercase;
  color: var(--c-text-sub);
  display: block; margin-bottom: .25rem;
}
.contact-item__value { font-size: 1rem; color: var(--c-text); }
.contact-item__value a { color: var(--c-accent); transition: opacity .2s; }
.contact-item__value a:hover { opacity: .7; }

/* Form */
.contact-form { display: flex; flex-direction: column; gap: var(--s-3); }
.form-field   { display: flex; flex-direction: column; gap: var(--s-1); margin-bottom: 24px; }
.form-field label { font-size: .875rem; font-weight: 500; }
.form-field input,
.form-field textarea {
  width: 100%;
  padding: .875rem 1rem;
  border: 1.5px solid var(--c-border);
  border-radius: 12px;
  font-size: 1rem;
  color: var(--c-text);
  background: var(--c-bg);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
  outline: none;
  resize: vertical;
}
.form-field input:focus,
.form-field textarea:focus {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px rgba(0,102,204,.12);
}
.form-field textarea { min-height: 160px; }
.form-submit { display: flex; justify-content: flex-start; }
.form-error { font-size: .8125rem; color: var(--c-error); margin-top: .25rem; }
.form-error--global { margin-bottom: var(--s-3); }
.form-field input[aria-invalid="true"],
.form-field textarea[aria-invalid="true"] { border-color: var(--c-error); }
.form-note { font-size: .8125rem; color: var(--c-text-sub); margin-top: var(--s-1); }

/* ── Contact: "Message sent" envelope animation ──────────────── */
.fs-success { text-align: center; padding: var(--s-6) 0; }
.env-scene { width: 100%; max-width: 360px; margin: 0 auto; }
.env-scene svg { width: 100%; height: auto; display: block; overflow: hidden; border-radius: 16px; }
.env-body { fill: var(--env-body); stroke: var(--env-line); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.env-flap { fill: var(--env-flap); stroke: var(--env-line); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.eh-1 { fill: var(--heart-1); }
.eh-2 { fill: var(--heart-2); }
.eh-3 { fill: var(--heart-3); }
.eh-4 { fill: var(--heart-4); }
.eh-5 { fill: var(--heart-5); }
.eh-6 { fill: var(--heart-6); }
.env-heart {
  transform-box: fill-box;
  transform-origin: center;
  animation-name: env-drift;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  will-change: transform, opacity;
}
@keyframes env-drift {
  0%   { opacity: 0; transform: translate(0,0) rotate(0deg) scale(.6); }
  15%  { opacity: 1; transform: translate(calc(var(--dx) * .12), calc(var(--dy) * .12)) rotate(calc(var(--rot) * .2)) scale(1); }
  70%  { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(.92); }
}
.fs-success__title { margin-bottom: .5rem; }
.fs-success__sub { color: var(--c-text-sub); }
@media (prefers-reduced-motion: reduce) {
  .env-heart { animation: none; opacity: 1; }
}


/* ============================================================
   SCROLL REVEAL
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .75s var(--ease-out), transform .75s var(--ease-out);
}
.reveal.is-visible { opacity: 1; transform: none; }
.reveal-d1 { transition-delay: .1s; }
.reveal-d2 { transition-delay: .2s; }
.reveal-d3 { transition-delay: .3s; }
.reveal-d4 { transition-delay: .4s; }


/* ============================================================
   KEYFRAMES
   ============================================================ */

@keyframes riseIn {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: none; }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes breathe {
  0%, 100% { opacity: .3; transform: scaleY(1); }
  50%       { opacity: .8; transform: scaleY(1.1) translateY(4px); }
}


/* ============================================================
   UTILITY
   ============================================================ */
.mt-8  { margin-top: var(--s-8); }
.mt-4  { margin-top: var(--s-4); }
.text-center { text-align: center; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}


/* ============================================================
   LIGHTBOX
   ============================================================ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0,0,0,.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 56px 0 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s var(--ease);
}
.lightbox.is-open {
  opacity: 1;
  pointer-events: all;
}
.lightbox__viewport {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.lightbox__img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  user-select: none;
  transform-origin: center center;
  will-change: transform;
  cursor: zoom-in;
}
.lightbox__caption {
  flex-shrink: 0;
  align-self: center;
  padding: var(--s-3) var(--s-8) var(--s-5);
  color: rgba(255,255,255,.5);
  font-size: .875rem;
  text-align: center;
  max-width: 600px;
}
.lightbox__counter {
  position: absolute;
  top: var(--s-4);
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,.4);
  font-size: .8125rem;
  letter-spacing: .04em;
  white-space: nowrap;
}
.lightbox__close {
  position: absolute;
  top: var(--s-3);
  right: var(--s-3);
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(155,155,155,.5);
  color: var(--c-on-accent);
  font-size: 1.125rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition: background .2s;
  font-family: var(--f-body);
}
.lightbox__close:hover { background: rgba(255,255,255,.2); }

.lightbox__prev,
.lightbox__next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px; height: 52px;
  border-radius: 50%;
  background: rgba(155,155,155,.5);
  color: var(--c-on-accent);
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition: background .2s, transform .2s;
  user-select: none;
  font-family: var(--f-body);
  z-index: 10;
}
.lightbox__prev { left: var(--s-4); }
.lightbox__next { right: var(--s-4); }
.lightbox__prev:hover { background: rgba(155,155,155,.75); transform: translateY(-50%) scale(1.08); }
.lightbox__next:hover { background: rgba(155,155,155,.75); transform: translateY(-50%) scale(1.08); }

@media (max-width: 640px) {
  .lightbox__prev { left: var(--s-2); }
  .lightbox__next { right: var(--s-2); }
}

/* Gallery — masonry (default) or grid (--grid modifier)
   Usage:
     Masonry 2-col:  <div class="cs-gallery">
     Masonry 3-col:  <div class="cs-gallery cs-gallery--trio">
     Grid 2-col:     <div class="cs-gallery cs-gallery--grid">
     Grid 3-col:     <div class="cs-gallery cs-gallery--grid cs-gallery--trio">
     Grid 4-col:     <div class="cs-gallery cs-gallery--grid cs-gallery--quad">
*/
.cs-gallery {
  columns: 2;
  column-gap: var(--s-3);
  margin-bottom: var(--s-12);
}
.cs-gallery--single { columns: 1; }
.cs-gallery--trio   { columns: 3; }
.cs-gallery--quad   { columns: 4; }
@media (max-width: 640px) {
  .cs-gallery               { columns: 1; }
  .cs-gallery--trio         { columns: 1; }
  .cs-gallery--quad         { columns: 2; }
}

/* --grid modifier: switch to CSS grid instead of masonry */
.cs-gallery--grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s-3);
}
.cs-gallery--grid.cs-gallery--single { grid-template-columns: 1fr; }
.cs-gallery--grid.cs-gallery--trio   { grid-template-columns: repeat(3, 1fr); }
.cs-gallery--grid.cs-gallery--quad { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 640px) {
  .cs-gallery--grid                       { grid-template-columns: 1fr; }
  .cs-gallery--grid.cs-gallery--trio      { grid-template-columns: 1fr; }
  .cs-gallery--grid.cs-gallery--quad     { grid-template-columns: repeat(2, 1fr); }
}

/* ── Before / After Compare Gallery ────────────────────────────────────── */
.cs-gallery--compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-3);
  margin-bottom: var(--s-12);
}
.cs-gallery--compare figure {
  margin: 0;
  border-radius: 12px;
  overflow: hidden;
  background: var(--c-bg-alt);
  cursor: zoom-in;
}
.cs-gallery--compare .compare-img-wrap {
  position: relative;
  overflow: hidden;
}
.cs-gallery--compare figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
  transition: transform .4s var(--ease-out);
}
.cs-compare-label {
  position: absolute;
  top: .75rem;
  left: .75rem;
  background: rgba(0,0,0,.65);
  color: var(--c-on-accent);
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .25rem .6rem;
  border-radius: 4px;
  z-index: 2;
  pointer-events: none;
}
/* Badge label works in ANY gallery figure (natural-height --grid or equal-height
   --compare), independent of the crop. The figure just needs positioning. */
.cs-gallery figure:has(.cs-compare-label) { position: relative; }
@media (max-width: 640px) {
  .cs-gallery--compare { grid-template-columns: 1fr; }
}

.cs-gallery figcaption,
.cs-gallery--compare figcaption {
  display: flex;
  align-items: center;
  gap: .35rem;
  padding: .75rem 1rem;
  font-size: .8125rem;
  color: var(--c-text-sub);
  border-top: 1px solid var(--c-border);
}
.cs-caption-icon {
  font-size: 11px;
  opacity: .45;
  flex-shrink: 0;
}
.cs-gallery figure {
  break-inside: avoid;
  margin: 0 0 var(--s-3);
  background: var(--c-bg-alt);
  border-radius: 12px;
  overflow: hidden;
}
.cs-gallery--grid figure { margin: 0; }

/* Gallery images fill their column */
.cs-gallery figure img { width: 100%; height: auto; display: block; transition: transform .4s var(--ease-out); }

/* Interactivity cues. Lightbox images get zoom cursor + hover zoom; prototype
   figures get a pointer cursor; the caption icon is injected in main.js.
   Non-lightbox images (data-no-lightbox) get NO hover, cursor, or icon. */
.cs-gallery figure { cursor: zoom-in; }
.cs-gallery figure[data-prototype] { cursor: pointer; }
.cs-gallery figure:hover img,
.cs-gallery--compare figure:hover img { transform: scale(1.02); }
.cs-gallery figure:has(img[data-no-lightbox]) { cursor: default; }
.cs-gallery figure:has(img[data-no-lightbox]):hover img { transform: none; }

/* ── Case Study Nav ─────────────────────────────────────────────────────── */
.cs-nav { display:flex; justify-content:space-between; align-items:center; gap:var(--s-4); padding:var(--s-8) 0; border-top:1px solid var(--c-border); flex-wrap:wrap; }
.cs-nav a { display:flex; flex-direction:column; gap:.3rem; text-decoration:none; }
.cs-nav a:last-child { text-align:right; align-items:flex-end; }
.cs-nav a:hover .cs-nav__title { color: var(--c-accent); }
.cs-nav__dir { font-size:.75rem; font-weight:500; letter-spacing:.07em; text-transform:uppercase; color:var(--c-text-sub); }
.cs-nav__title { font-family:var(--f-display); font-size:1.125rem; font-weight:700; color:var(--c-accent); letter-spacing:-0.01em; transition:opacity .2s; }

/* ============================================================
   ERROR PAGE (404)
   ============================================================ */
.error-page {
  min-height: calc(100vh - 200px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--s-8) var(--s-4);
}
.error-page__inner { max-width: 520px; }
.error-page__code {
  font-family: var(--f-display);
  font-size: clamp(6rem, 20vw, 10rem);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1;
  color: var(--c-accent);
  opacity: 0.15;
  margin-bottom: var(--s-4);
  display: block;
}
.error-page__title {
  font-family: var(--f-display);
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--c-404-title);
  margin-bottom: var(--s-3);
}
.error-page__desc {
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--c-text-sub);
  font-weight: 300;
  margin-bottom: var(--s-6);
}
.error-page__actions {
  display: flex;
  gap: var(--s-3);
  justify-content: center;
  flex-wrap: wrap;
}

/* ============================================================
   DARK MODE  —  follows system preference automatically
   ============================================================ */
@media (prefers-color-scheme: dark) {

  :root {
    color-scheme: dark;

    --c-bg:          #060810;
    --c-bg-alt:      #0d1020;
    --c-bg-dark:     #030407;
    --c-bg-dark-2:   #111826;
    --c-text:        #f0f2fa;
    --c-text-sub:    #aab4d4;
    --c-white:       #f0f2fa;
    --c-white-sub:   #aab4d4;
    --c-accent:      #7e22ce;
    --c-accent-hi:   #9333ea;
    --c-border:      rgba(80, 110, 200, 0.14);
    --c-border-dark: rgba(100, 130, 220, 0.12);
    --c-error:       #f87171;
    --c-404-title:   #dde3f5;

    /* Contact success animation — dark adaptations */
    --env-body: #140f22;
    --env-flap: #1d1630;
    --env-line: #b07ee0;
    --heart-4: #9333ea;
    --heart-6: #a855f7;
  }

/* Platform list — cs-meta-item Platform field */
.cs-platforms {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
}
.cs-platform {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  font-size: .9375rem;
  font-weight: 400;
  color: var(--c-text);
  white-space: nowrap;
}
.cs-platform i { font-size: .9rem; opacity: .65; }
.cs-sep { opacity: .5; }
.cs-platform:not(:last-child)::after {
  content: ',\00a0';
  opacity: .5;
}

  /* Smooth palette transitions */
  body, .nav, .card, .card__body, .card__body--light,
  .tcard, .aside-card, .cap-tile, .cs-meta-item,
  .filter-btn, .form-field input, .form-field textarea {
    transition: background-color .3s ease, color .3s ease, border-color .3s ease;
  }

  /* ── Skills tiles ───────────────────────────── */
  .cap-tile { background: var(--c-bg-alt); }
  .section--dark { background: var(--c-bg-alt); }

  /* ── Nav ─────────────────────────────────────── */
  .nav {
    background: rgba(4, 5, 10, 0.92);
    border-bottom-color: var(--c-border-dark);
  }
  .nav__logo        { color: var(--c-text); }
  .nav__links a     { color: var(--c-text); }
  .nav__toggle span { background: var(--c-text); }

  /* ── Cards ───────────────────────────────────── */
  .card                                          { background: var(--c-bg-alt); }
  .card__body--light                             { background: var(--c-bg-alt); color: var(--c-text); }
  .card__body--light .card__title                { color: var(--c-text); }
  .card__body:not(.card__body--light) .card__title { color: var(--c-text); }
  .card__body--light .card__desc                 { color: var(--c-text-sub); }
  .card__body--light .card__tag                  { background: var(--c-border); color: var(--c-text-sub); border-color: var(--c-border-dark); }
  .card__tag                                     { color: var(--c-text-sub); background: var(--c-border); }

  /* ── Borders on list items / resume / nav ─────── */
  .mini-t           { border-bottom-color: var(--c-border-dark); }
  .resume-h         { border-bottom-color: var(--c-border-dark); }
  .role             { border-bottom-color: var(--c-border-dark); }

  /* ── Portfolio filter ────────────────────────── */
  .filter-btn           { border-color: var(--c-border-dark); color: var(--c-text-sub); }
  .filter-btn:hover     { border-color: var(--c-text); color: var(--c-text); }
  .filter-btn.is-active { background: var(--c-text); border-color: var(--c-text); color: var(--c-bg); }

  /* ── Resume / skills ─────────────────────────── */
  .aside-card { background: var(--c-bg-alt); }
  .skill-tag  { background: var(--c-bg-dark-2); border-color: rgba(140,160,255,0.2); color: var(--c-text); }

  /* ── Contact form ────────────────────────────── */
  .form-field label     { color: var(--c-text); }
  .form-field input,
  .form-field textarea  { background: var(--c-bg-alt); border-color: var(--c-border-dark); color: var(--c-text); }
  .form-field input::placeholder,
  .form-field textarea::placeholder { color: var(--c-text-sub); }

  /* ── Case study gallery ──────────────────────── */
  .cs-gallery figure { background: var(--c-bg-alt); }

}


/* ============================================================
   AURORA BACKGROUND  (dark mode only)
   Adapted from Sylvain Garnot's rainbow CodePen.
   On dark backgrounds, the "white" edges are dropped and the
   pure colour beams become an aurora borealis effect.
   ============================================================ */

.bg-aurora {
  display: none;
  position: absolute;   /* scoped inside .hero — not page-wide */
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

/* .hero already has position:relative + overflow:hidden, so aurora is clipped to it */

/* The beam elements — populated by JS */
.rainbow {
  height: 100%;
  width: 0;
  top: 0;
  position: absolute;
  transform: rotate(10deg);
  transform-origin: top right;
  will-change: right;
}

/* Corner vignettes — darken edges so aurora reads as light from within */
.aurora-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 0% 100%,  rgba(3,4,7,.8) 0%, transparent 70%),
    radial-gradient(ellipse 60% 50% at 100% 100%, rgba(3,4,7,.8) 0%, transparent 70%),
    radial-gradient(ellipse 100% 30% at 50% 100%, rgba(3,4,7,.9) 0%, transparent 60%);
  pointer-events: none;
}

@keyframes slide {
  from { right: -25%; }
  to   { right: 125%; }
}

/* Aurora always visible — hero is always dark-backgrounded */
.bg-aurora { display: block; }

/* Hero content must sit above the aurora layer */
.hero__content, .hero__scroll-hint { position: relative; z-index: 1; }


/* ── Case Study Nav ─────────────────────────────────────────────────────── */
.cs-nav { display:flex; justify-content:space-between; align-items:center; gap:var(--s-4); padding:var(--s-8) 0; border-top:1px solid var(--c-border); flex-wrap:wrap; }
.cs-nav a { display:flex; flex-direction:column; gap:.3rem; text-decoration:none; }
.cs-nav a:last-child { text-align:right; align-items:flex-end; }
.cs-nav a:hover .cs-nav__title { color: var(--c-accent); }
.cs-nav__dir { font-size:.75rem; font-weight:500; letter-spacing:.07em; text-transform:uppercase; color:var(--c-text-sub); }
.cs-nav__title { font-family:var(--f-display); font-size:1.125rem; font-weight:700; color:var(--c-accent); letter-spacing:-0.01em; transition:opacity .2s; }

/* ============================================================
   DARK MODE — COMPREHENSIVE COVERAGE
   All values use CSS variables — change a variable, everything
   updates automatically. No hardcoded hex values here.
   ============================================================ */
@media (prefers-color-scheme: dark) {

  /* ── Foundation ───────────────────────────────────────────── */
  body          { background: var(--c-bg); color: var(--c-text); }
  .section      { background: var(--c-bg); }
  .section--alt  { background: var(--c-bg-alt); }
  .section--dark  { background: var(--c-bg-alt); }

  /* ── Section intros ───────────────────────────────────────── */
  .section-intro .t-section { color: var(--c-text); }
  .section-intro p          { color: var(--c-text-sub); }

  /* ── About ────────────────────────────────────────────────── */
  .about-split__content .t-section { color: var(--c-text); }
  .about-split__content p          { color: var(--c-text-sub); }

  /* ── Testimonials ─────────────────────────────────────────── */
  .mini-t__quote { color: var(--c-text); }
  .mini-t__name  { color: var(--c-text); }

  /* ── Resume ───────────────────────────────────────────────── */
  .role__company     { color: var(--c-text); }
  .role__location    { color: var(--c-text-sub); }
  .role__summary     { color: var(--c-text-sub); }
  .role__bullets li  { color: var(--c-text-sub); }
  .edu-entry__school { color: var(--c-text); }
  .edu-entry__degree { color: var(--c-text-sub); }
  .edu-entry__years  { color: var(--c-text-sub); }
  .aside-card__h     { color: var(--c-text); }
  .resume-intro      { color: var(--c-text-sub); }

  /* ── Contact ──────────────────────────────────────────────── */
  .contact-info .t-section  { color: var(--c-text); }
  .contact-info__body        { color: var(--c-text-sub); }
  .contact-item__label       { color: var(--c-text-sub); }
  .contact-item__value       { color: var(--c-text); }

  /* ── Footer ───────────────────────────────────────────────── */
  .footer { background: var(--c-bg-dark); }

  /* ── CTA banner ───────────────────────────────────────────── */
  /* cta-banner always has dark bg — white text set in base rule, no dark mode override needed */

  /* ── Case study components ────────────────────────────────── */
  .cs-meta-item          { background: var(--c-bg-alt); }
  .cs-meta-item__label   { color: var(--c-text-sub); }
  .cs-meta-item__value   { color: var(--c-text); }
  .cs-body p             { color: var(--c-text-sub); }
  .cs-callout            { background: var(--c-bg-alt); border-left-color: var(--c-accent); }
  .cs-callout p          { color: var(--c-text); }
  .cs-callout strong     { font-weight: 700; }
  .cs-stat               { background: var(--c-bg-alt); }
  .cs-stat__label        { color: var(--c-text-sub); }
  .cs-gallery figcaption,
  .cs-gallery--compare figcaption { color: var(--c-text-sub); border-top-color: var(--c-border-dark); }
  .cs-nav                { border-top-color: var(--c-border-dark); }

  /* ── Tool icons — invert for dark mode ───────────────────── */
  .tool-item__logo img   { filter: invert(1); }
  .cs-nav__dir           { color: var(--c-text-sub); }
  .cs-nav__title         { color: var(--c-accent); }

}

/* ── Toolbox section ──────────────────────────────────────── */
.toolbox-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--s-6) var(--s-4);
  margin-top: var(--s-10);
}
@media (max-width: 900px) { .toolbox-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 600px) { .toolbox-grid { grid-template-columns: repeat(3, 1fr); } }

.tool-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-3);
  cursor: default;
}
.tool-item__logo {
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: var(--c-bg-alt);
  border: 1px solid var(--c-border);
}
.tool-item__logo img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  display: block;
}
.tool-item__name {
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .03em;
  color: var(--c-text-sub);
  text-align: center;
}


