/* ==========================================================================
   Netzer Charitt — Portfolio
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --bg:            #FFFFFF;
  --surface:       #F7F8FA;
  --surface-2:     #EFF1F6;
  --border:        #E3E6ED;
  --border-soft:   rgba(11, 16, 32, .08);
  --text:          #0B1020;
  --text-2:        #55607A;
  --text-3:        #8B93A6;

  --primary:       #1A1B1F;
  --primary-soft:  rgba(26, 27, 31, .05);
  --critical:      #FF4D6D;
  --warning:       #FF9F43;
  --success:       #22C55E;
  --info:          #3B82F6;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --max:     1280px;
  --gutter:  clamp(20px, 5vw, 64px);
  --radius:  16px;
  --radius-lg: 24px;

  --section-y: clamp(72px, 10vw, 152px);

  --ease: cubic-bezier(.22, 1, .36, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;   /* clip, not hidden: hidden would break position:sticky */
}

img, svg, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
ul, ol { list-style: none; }

::selection { background: var(--primary); color: #fff; }

/* ---------- Layout helpers ---------- */
.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--section-y); }
.section--tight { padding-block: clamp(48px, 6vw, 88px); }

.grid { display: grid; gap: clamp(20px, 3vw, 40px); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.stack   { display: flex; flex-direction: column; }
.stack-8  { gap: 8px; }
.stack-12 { gap: 12px; }
.stack-16 { gap: 16px; }
.stack-24 { gap: 24px; }
.stack-32 { gap: 32px; }

.hr { height: 1px; background: var(--border); border: 0; }

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5 { line-height: 1.08; font-weight: 600; letter-spacing: -.02em; }

.display {
  font-size: clamp(3.2rem, 12vw, 10rem);
  font-weight: 700;
  line-height: .92;
  letter-spacing: -.045em;
  text-transform: uppercase;
}

.h1 { font-size: clamp(2.4rem, 6vw, 4.4rem); font-weight: 700; letter-spacing: -.035em; }
.h2 { font-size: clamp(1.9rem, 4.2vw, 3.2rem); font-weight: 600; letter-spacing: -.03em; }
.h3 { font-size: clamp(1.25rem, 2.2vw, 1.75rem); font-weight: 600; letter-spacing: -.02em; }
.h4 { font-size: clamp(1.05rem, 1.6vw, 1.25rem); font-weight: 600; }

.lead {
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  color: var(--text-2);
  line-height: 1.65;
  max-width: 62ch;
}

.body   { color: var(--text-2); }
.small  { font-size: .9rem; color: var(--text-2); }
.muted  { color: var(--text-3); }

.eyebrow {
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--primary);
}
.eyebrow--muted { color: var(--text-3); }

.mono-num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

/* ---------- Buttons / pills ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 999px;
  font-size: .95rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .3s var(--ease), background .3s var(--ease), border-color .3s var(--ease), color .3s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: #35373F; }
.btn--ghost { border-color: var(--border); color: var(--text); background: transparent; }
.btn--ghost:hover { border-color: var(--primary); color: var(--primary); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: .82rem;
  color: var(--text-2);
  background: rgba(11, 16, 32, .02);
}
.pill--accent { border-color: rgba(26, 27, 31, .28); color: var(--primary); background: var(--primary-soft); }

.dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, .16);
  flex: none;
}

/* ---------- Header ---------- */
.header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  padding-block: 18px;
  transition: background .4s var(--ease), backdrop-filter .4s var(--ease), border-color .4s var(--ease);
  border-bottom: 1px solid transparent;
}
.header.is-stuck {
  background: rgba(255, 255, 255, .8);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom-color: var(--border);
}
.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  letter-spacing: -.02em;
}
.brand__mark {
  width: 40px; height: 40px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 20%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  flex: none;
}
.brand__name { font-size: .95rem; }
.brand__role { display: block; font-size: .72rem; color: var(--text-3); font-weight: 400; letter-spacing: 0; }

.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  padding: 9px 16px;
  border-radius: 999px;
  font-size: .9rem;
  color: var(--text-2);
  transition: color .25s var(--ease), background .25s var(--ease);
}
.nav a:hover { color: var(--text); background: rgba(11, 16, 32, .05); }
.nav a.is-active { color: var(--text); background: rgba(11, 16, 32, .07); }

.header__cta { display: inline-flex; }

.burger {
  display: none;
  width: 44px; height: 44px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  position: relative;
}
.burger span {
  position: absolute;
  left: 12px;
  width: 20px; height: 1.6px;
  background: var(--text);
  transition: transform .35s var(--ease), opacity .25s var(--ease);
}
.burger span:nth-child(1) { top: 17px; }
.burger span:nth-child(2) { top: 25px; }
.burger.is-open span:nth-child(1) { transform: translateY(4px) rotate(45deg); }
.burger.is-open span:nth-child(2) { transform: translateY(-4px) rotate(-45deg); }

.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: rgba(255, 255, 255, .97);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: var(--gutter);
  opacity: 0;
  visibility: hidden;
  transition: opacity .4s var(--ease), visibility .4s;
}
.mobile-nav.is-open { opacity: 1; visibility: visible; }
.mobile-nav a {
  font-size: clamp(1.8rem, 9vw, 2.6rem);
  font-weight: 600;
  letter-spacing: -.03em;
  padding-block: 10px;
  border-bottom: 1px solid var(--border-soft);
}
.mobile-nav .small { font-size: .95rem; margin-top: 24px; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding-top: 120px;
  padding-bottom: 72px;
  overflow: hidden;
}
.hero__glow {
  position: absolute;
  width: 900px; height: 900px;
  top: -320px; left: 50%;
  translate: -50% 0;
  background: radial-gradient(circle, rgba(26, 27, 31, .055) 0%, transparent 62%);
  pointer-events: none;
}
.hero__inner { position: relative; z-index: 1; width: 100%; }
.hero__name {
  font-size: .78rem;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: clamp(20px, 3vw, 32px);
}
.hero__title { position: relative; }
.hero__title .display + .display { margin-top: -.04em; }
.hero__title .display span { color: var(--primary); }
.hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: clamp(24px, 4vw, 56px);
  margin-top: clamp(28px, 4vw, 48px);
}
.hero__portraits { display: flex; gap: 12px; }
.hero__portraits img {
  width: clamp(74px, 11vw, 128px);
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--border);
  filter: grayscale(1) contrast(1.05);
  transition: filter .5s var(--ease), transform .5s var(--ease);
}
.hero__portraits img:hover { filter: none; transform: translateY(-4px); }
.hero__scroll {
  margin-top: clamp(40px, 6vw, 72px);
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-3);
  font-size: .8rem;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.hero__scroll::before {
  content: "";
  width: 46px; height: 1px;
  background: var(--border);
}

/* ---------- Page hero (inner pages) ---------- */
.page-hero {
  padding-top: clamp(140px, 16vw, 200px);
  padding-bottom: clamp(40px, 6vw, 72px);
  position: relative;
  overflow: hidden;
}
.page-hero__glow {
  position: absolute;
  width: 720px; height: 720px;
  top: -380px; left: 12%;
  background: radial-gradient(circle, rgba(26, 27, 31, .05) 0%, transparent 65%);
  pointer-events: none;
}
.page-hero .wrap { position: relative; z-index: 1; }

/* ---------- Section head ---------- */
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: clamp(36px, 5vw, 64px);
}
.section-head__text { max-width: 720px; }
.section-head .eyebrow { margin-bottom: 14px; display: block; }

/* ---------- Project cards ---------- */
/* Cards stack: each one pins, the next scrolls up over it */
.projects {
  display: block;
  --stack-top: 96px;
}
.projects > .project-card {
  position: sticky;
  top: var(--stack-top);
  margin-bottom: clamp(22px, 2.6vw, 34px);
}
.projects > .project-card:nth-child(1) { top: calc(var(--stack-top) + 0px);  z-index: 1; }
.projects > .project-card:nth-child(2) { top: calc(var(--stack-top) + 14px); z-index: 2; }
.projects > .project-card:nth-child(3) { top: calc(var(--stack-top) + 28px); z-index: 3; }
.projects > .project-card:nth-child(4) { top: calc(var(--stack-top) + 42px); z-index: 4; }
.projects > .project-card:nth-child(5) { top: calc(var(--stack-top) + 56px); z-index: 5; }
.projects > .project-card:nth-child(6) { top: calc(var(--stack-top) + 70px); z-index: 6; }
.projects > .project-card:last-child { margin-bottom: 0; }

.project-card {
  position: relative;
  display: block;
  padding: 0;
  min-height: clamp(400px, 44vw, 620px);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  isolation: isolate;
  transition: box-shadow .5s var(--ease);
}
.project-card { box-shadow: 0 24px 60px -40px rgba(11, 16, 32, .5); }
.project-card:hover { box-shadow: 0 34px 80px -34px rgba(11, 16, 32, .6); }
.project-card__media {
  position: absolute;
  inset: 0;
  z-index: -2;
  border: 0;
  border-radius: 0;
  overflow: hidden;
}
.project-card__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: 0;
  transition: transform .9s var(--ease);
}
.project-card:hover .project-card__media img { transform: scale(1.045); }

/* Scrim so the copy stays readable over any artwork */
.project-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(to top,
      rgba(8, 11, 20, .72) 0%,
      rgba(8, 11, 20, .52) 45%,
      rgba(8, 11, 20, .46) 100%);
  pointer-events: none;
}

.project-card__body {
  position: relative;
  z-index: 1;
  min-height: inherit;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 16px;
  padding: clamp(26px, 3.4vw, 60px);
  color: #fff;
}
.project-card__body h2,
.project-card__body h3 { color: #fff; }
.project-card__body .body { color: rgba(255, 255, 255, .82); max-width: 62ch; }

.project-card__tags { display: flex; flex-wrap: wrap; gap: 8px; }
.project-card .pill {
  color: rgba(255, 255, 255, .88);
  border-color: rgba(255, 255, 255, .28);
  background: rgba(255, 255, 255, .10);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.project-card .pill--accent {
  color: #fff;
  border-color: rgba(255, 255, 255, .55);
  background: rgba(255, 255, 255, .18);
}

.project-card__link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: .95rem;
  color: #fff;
  margin-top: 4px;
}
.project-card__link .arrow { transition: transform .35s var(--ease); }
.project-card:hover .project-card__link .arrow { transform: translateX(5px); }

.project-card__index {
  position: absolute;
  z-index: 1;
  top: clamp(20px, 2.4vw, 34px);
  right: clamp(20px, 2.4vw, 34px);
  font-size: .78rem;
  color: rgba(255, 255, 255, .7);
  letter-spacing: .12em;
}

/* ---------- Cards / generic ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(22px, 2.6vw, 32px);
  transition: border-color .35s var(--ease), transform .35s var(--ease), background .35s var(--ease);
}
.card:hover { border-color: rgba(26, 27, 31, .28); background: var(--surface-2); }
.card__num {
  font-size: .8rem;
  color: var(--primary);
  letter-spacing: .12em;
  font-weight: 600;
  margin-bottom: 14px;
  display: block;
}
.card ul { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.card ul li {
  position: relative;
  padding-left: 20px;
  color: var(--text-2);
  font-size: .93rem;
  line-height: 1.55;
}
.card ul li::before {
  content: "";
  position: absolute;
  left: 0; top: .62em;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--primary);
  opacity: .7;
}

/* ---------- Stat / meta rows ---------- */
.meta-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.meta-row > div { background: var(--surface); padding: clamp(18px, 2vw, 26px); }
.meta-row dt {
  font-size: .72rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 8px;
}
.meta-row dd { font-size: .96rem; font-weight: 500; line-height: 1.45; }

/* ---------- Tech stack ---------- */
.tech-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(14px, 2vw, 22px); }
.tech-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(20px, 2.2vw, 26px);
  display: flex; flex-direction: column; gap: 12px;
  transition: border-color .35s var(--ease), transform .35s var(--ease);
}
.tech-card:hover { border-color: rgba(26, 27, 31, .28); transform: translateY(-3px); }
/* One fixed box for every logo, whatever its native aspect ratio */
.tech-card__icon {
  width: 52px;
  height: 52px;
  flex: none;
  border-radius: 13px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--border);
  padding: 9px;
}
.tech-card h4 { font-size: 1rem; }
.tech-card p { font-size: .86rem; color: var(--text-2); line-height: 1.5; }

/* ---------- Contact ---------- */
.contact {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}
.contact-detail {
  display: flex; flex-direction: column; gap: 4px;
  padding-block: 18px;
  border-bottom: 1px solid var(--border);
}
.contact-detail span { font-size: .74rem; letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); }
.contact-detail a, .contact-detail p { font-size: 1.05rem; font-weight: 500; }
.contact-detail a { transition: color .25s var(--ease); }
.contact-detail a:hover { color: var(--primary); }

.form { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.field input, .field select, .field textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: .95rem;
  transition: border-color .25s var(--ease), background .25s var(--ease);
  width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface-2);
}
.field textarea { min-height: 130px; resize: vertical; }
.field select { appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239CA3AF' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}
.form__note { font-size: .82rem; color: var(--text-3); }

/* ==========================================================================
   Case study
   ========================================================================== */
.cs-hero {
  padding-top: clamp(130px, 15vw, 180px);
  padding-bottom: clamp(40px, 5vw, 64px);
  position: relative;
  overflow: hidden;
}
.cs-hero__glow {
  position: absolute;
  width: 820px; height: 820px;
  top: -420px; right: -120px;
  background: radial-gradient(circle, rgba(26, 27, 31, .055) 0%, transparent 65%);
  pointer-events: none;
}
.cs-hero .wrap { position: relative; z-index: 1; }
.cs-back {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .88rem; color: var(--text-2);
  margin-bottom: clamp(24px, 3vw, 40px);
  transition: color .25s var(--ease);
}
.cs-back:hover { color: var(--primary); }

.cs-cover {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
}
.cs-cover img { width: 100%; }

.figure { display: flex; flex-direction: column; gap: 12px; }
.figure img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}
.figure figcaption { font-size: .84rem; color: var(--text-3); }

/* ==========================================================================
   Document-style case study (heading, then its image underneath)
   ========================================================================== */
.doc-block { padding-block: clamp(40px, 5vw, 76px); }

/* Features section: the stand-mixer illustration sits behind the content */
.doc-block--mixer {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}
.doc-block--mixer::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 50%;
  right: clamp(-90px, -4vw, 0px);
  translate: 0 -50%;
  width: clamp(320px, 38vw, 620px);
  aspect-ratio: 734 / 832;
  background: url("../../projects/chefeat-assets/chefeat-illus-stand-mixer.png") no-repeat center / contain;
  pointer-events: none;
}
.doc-block--mixer > .wrap { position: relative; }

@media (max-width: 900px) {
  .doc-block--mixer::before {
    width: min(78vw, 420px);
    right: -14%;
    opacity: .55;
  }
}

.doc-h {
  font-size: clamp(1.5rem, 2.6vw, 2.1rem);
  font-weight: 600;
  letter-spacing: -.01em;
  margin-bottom: clamp(20px, 2.6vw, 32px);
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.doc-h--end {
  border-bottom: 0;
  text-align: center;
  color: var(--text-3);
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: clamp(1rem, 1.6vw, 1.2rem);
}

.doc-copy {
  max-width: 68ch;
  margin-bottom: clamp(24px, 3vw, 40px);
  display: flex;
  flex-direction: column;
  gap: 16px;
  color: var(--text-2);
  font-size: clamp(1rem, 1.25vw, 1.1rem);
  line-height: 1.7;
}
.doc-copy strong { color: var(--text); font-weight: 600; }
.doc-list { list-style: decimal; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.doc-list li { color: var(--text-2); }

/* Images sit centred at their own scale, never upscaled past native size */
.doc-fig {
  margin-block: clamp(20px, 2.6vw, 34px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.doc-fig img {
  width: 100%;
  height: auto;
  border: 0;
  background: none;
  border-radius: var(--radius);
}
.doc-fig figcaption { font-size: .84rem; color: var(--text-3); }

.doc-fig--lg img { max-width: min(100%, 880px); }
.doc-fig--md img { max-width: min(100%, 660px); }
.doc-fig--sm img { max-width: min(100%, 430px); }
.doc-fig--xs img { max-width: min(100%, 480px); }

/* Rounded corners on every image inside a case study */
.cs-doc img { border-radius: var(--radius); }
.cs-doc .doc-fig--xs img { border-radius: 12px; }

/* ---------- Lightbox: click any figure to view it large ---------- */
.zoomable { cursor: zoom-in; transition: opacity .25s var(--ease); }
.zoomable:hover { opacity: .88; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 56px);
  background: rgba(6, 9, 18, .93);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: zoom-out;
  opacity: 0;
  transition: opacity .3s var(--ease);
}
.lightbox.is-open { display: flex; opacity: 1; }

.lightbox__img {
  max-width: 96vw;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 40px 120px -30px #000;
  cursor: default;
  transform: scale(.97);
  transition: transform .3s var(--ease);
}
.lightbox.is-open .lightbox__img { transform: none; }

.lightbox__btn {
  position: absolute;
  display: grid;
  place-items: center;
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .22);
  background: rgba(255, 255, 255, .1);
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  transition: background .25s var(--ease), transform .25s var(--ease);
}
.lightbox__btn:hover { background: rgba(255, 255, 255, .22); transform: scale(1.06); }
.lightbox__btn--close { top: clamp(14px, 3vw, 28px); right: clamp(14px, 3vw, 28px); font-size: 1.4rem; }
.lightbox__btn--prev  { left: clamp(10px, 2vw, 28px);  top: 50%; translate: 0 -50%; }
.lightbox__btn--next  { right: clamp(10px, 2vw, 28px); top: 50%; translate: 0 -50%; }

.lightbox__count {
  position: absolute;
  bottom: clamp(14px, 3vw, 28px);
  left: 50%;
  translate: -50% 0;
  color: rgba(255, 255, 255, .7);
  font-size: .82rem;
  letter-spacing: .1em;
  font-variant-numeric: tabular-nums;
}
.lightbox__hint {
  position: absolute;
  top: clamp(14px, 3vw, 28px);
  left: 50%;
  translate: -50% 0;
  color: rgba(255, 255, 255, .45);
  font-size: .76rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}
@media (max-width: 640px) {
  .lightbox__hint { display: none; }
  .lightbox__btn { width: 42px; height: 42px; }
  .lightbox__img { max-width: 100vw; max-height: 82vh; }
}

/* ---------- In-page section nav ---------- */
/* Case pages that carry no site header: hero clears the fixed section bar */
.cs-hero--bare { padding-top: clamp(112px, 12vw, 158px); }

/* Full-bleed banner above the title */
/* Cover image, sits under the title and scope row, aligned to the page grid */
.cs-banner {
  margin: clamp(36px, 5vw, 64px) auto 0;
  width: 100%;
  max-width: var(--max);
  padding-inline: var(--gutter);
}
.cs-banner img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
}

@media (max-width: 640px) {
  .cs-banner img { border-radius: var(--radius); }
}

/* Fixed bar across the top, links pinned to the right edge */
.cs-nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 90;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.cs-nav__inner {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
  padding-block: 13px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.cs-nav__inner::-webkit-scrollbar { display: none; }
.cs-nav a {
  flex: none;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: .88rem;
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
  transition: color .25s var(--ease), background .25s var(--ease);
}
.cs-nav a:hover { color: var(--text); background: rgba(11, 16, 32, .05); }
.cs-nav a.is-current { color: var(--text); font-weight: 600; background: rgba(11, 16, 32, .07); }

.cs-doc [id] { scroll-margin-top: 84px; }

@media (max-width: 860px) {
  /* the back button owns the left side, so the strip starts after it */
  .cs-nav__inner { justify-content: flex-start; padding-left: 190px; }
  .cs-nav a { font-size: .8rem; padding: 7px 13px; }
}
@media (max-width: 640px) {
  .cs-nav__inner { padding-left: 155px; }
}

/* Figure sizing helpers: stop small or very tall assets being blown up */
.figure--center { align-items: center; text-align: center; }
.figure--center img { margin-inline: auto; }
.figure--sm  img { max-width: min(100%, 460px); }
.figure--md  img { max-width: min(100%, 720px); }
.figure--lg  img { max-width: min(100%, 980px); }
.figure--tall img { max-height: 78vh; width: auto; margin-inline: auto; }
.figure--strip img {
  max-width: min(100%, 560px);
  padding: 22px 26px;
  background: var(--surface);
}

/* Equal-height media rows regardless of source ratio */
.row-media { display: grid; gap: clamp(16px, 2vw, 24px); align-items: stretch; }
.row-media--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.row-media--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.row-media figure { height: 100%; }
.row-media .shot {
  height: 100%;
  min-height: 260px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  display: grid;
  place-items: center;
  padding: clamp(16px, 2vw, 28px);
  overflow: hidden;
}
.row-media .shot img {
  max-height: 420px;
  width: auto;
  max-width: 100%;
  border: 0;
  border-radius: 8px;
}
@media (max-width: 900px) {
  .row-media--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .row-media--2, .row-media--3 { grid-template-columns: 1fr; }
  .figure--tall img { max-height: none; width: 100%; }
}

.split {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  gap: clamp(28px, 4vw, 72px);
  align-items: start;
}
.split--even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.split__sticky { position: sticky; top: 110px; }

.quote {
  font-size: clamp(1.5rem, 3.4vw, 2.6rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -.03em;
  max-width: 20ch;
}
.quote--wide { max-width: 26ch; }
.quote span { color: var(--primary); }

.numbered { counter-reset: n; display: grid; gap: clamp(16px, 2vw, 24px); }
.numbered .card { position: relative; }

.steps { display: grid; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.step { background: var(--surface); padding: clamp(20px, 2.4vw, 28px); display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: start; }
.step__idx {
  font-size: .78rem; font-weight: 600; letter-spacing: .12em;
  color: var(--primary); padding-top: 3px; min-width: 34px;
}

/* Swatches */
.swatches { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.swatch { display: flex; flex-direction: column; gap: 10px; }
.swatch__chip { height: 68px; border-radius: 12px; border: 1px solid var(--border); }
.swatch__name { font-size: .85rem; font-weight: 500; }
.swatch__hex { font-size: .78rem; color: var(--text-3); letter-spacing: .04em; }

/* Timeline */
.timeline { display: grid; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.tl-row {
  background: var(--surface);
  display: grid;
  grid-template-columns: 200px 76px 1fr 180px;
  gap: 18px;
  padding: 20px clamp(18px, 2.2vw, 26px);
  align-items: center;
}
.tl-row__stage { font-size: .78rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.tl-row__time { font-size: .9rem; color: var(--text-2); font-variant-numeric: tabular-nums; }
.tl-row__detail { font-size: .93rem; color: var(--text-2); }
.tl-row__src { font-size: .82rem; color: var(--text-3); text-align: right; }
.tl-badge {
  display: inline-block; margin-top: 6px;
  font-size: .68rem; letter-spacing: .1em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--text-2);
}

/* KPI strip */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.kpi { background: var(--surface); padding: clamp(18px, 2vw, 26px); }
.kpi__label { font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); margin-bottom: 8px; }
.kpi__value { font-size: clamp(1.05rem, 1.8vw, 1.4rem); font-weight: 600; letter-spacing: -.02em; }
.kpi--critical .kpi__value { color: var(--critical); }
.kpi--warning  .kpi__value { color: var(--warning); }

/* Comparison table */
.table-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.cmp { width: 100%; border-collapse: collapse; min-width: 720px; background: var(--surface); }
.cmp th, .cmp td { padding: 16px 18px; text-align: left; border-bottom: 1px solid var(--border); font-size: .9rem; }
.cmp thead th { font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); font-weight: 600; }
.cmp tbody tr:last-child td { border-bottom: 0; }
.cmp td:first-child { color: var(--text); font-weight: 500; }
.cmp td { color: var(--text-2); }
.cmp .col-own { background: var(--primary-soft); color: var(--primary); font-weight: 500; }
.cmp thead .col-own { color: var(--primary); }

/* Before / After */
.ba { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(18px, 2.4vw, 28px); }
.ba__panel { border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(22px, 2.6vw, 32px); background: var(--surface); }
.ba__panel--after { border-color: rgba(26, 27, 31, .4); background: linear-gradient(180deg, rgba(26, 27, 31, .08), transparent 60%), var(--surface); }
.ba__panel h3 { margin-bottom: 4px; }
.ba__panel .tag { font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.ba__panel--after .tag { color: var(--primary); }
.ba__panel ul { margin-top: 20px; display: flex; flex-direction: column; gap: 12px; }
.ba__panel li { position: relative; padding-left: 22px; color: var(--text-2); font-size: .93rem; }
.ba__panel li::before {
  content: "—"; position: absolute; left: 0; top: 0; color: var(--text-3);
}
.ba__panel--after li::before { content: "+"; color: var(--primary); }

/* Carousel */
.carousel { position: relative; }
.carousel__track {
  display: flex;
  gap: clamp(16px, 2vw, 24px);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding-bottom: 12px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.carousel__track::-webkit-scrollbar { display: none; }
.carousel__slide {
  flex: 0 0 min(720px, 84%);
  scroll-snap-align: start;
}
.carousel__slide--wide { flex-basis: min(960px, 92%); }
.carousel__nav { display: flex; gap: 10px; margin-top: 20px; }
.carousel__btn {
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  display: grid; place-items: center;
  cursor: pointer;
  transition: border-color .3s var(--ease), background .3s var(--ease), color .3s var(--ease);
  color: var(--text-2);
}
.carousel__btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }

/* Feature list (case study) */
.features { display: grid; gap: clamp(18px, 2.2vw, 28px); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.feature { border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(22px, 2.6vw, 30px); background: var(--surface); }
.feature h4 { margin-bottom: 8px; }
.feature p { color: var(--text-2); font-size: .93rem; }

/* Gallery */
.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(16px, 2vw, 24px); }
.gallery img { border-radius: var(--radius); border: 1px solid var(--border); width: 100%; }
.gallery--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* Next project */
.next-project {
  border-top: 1px solid var(--border);
  padding-block: clamp(56px, 8vw, 96px);
  display: block;
  transition: background .4s var(--ease);
}
.next-project:hover { background: var(--surface); }
.next-project__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }

/* ==========================================================================
   Featured opening block (home)
   ========================================================================== */
.featured {
  padding-top: clamp(128px, 15vw, 190px);
  padding-bottom: var(--section-y);
}
.featured__head {
  max-width: 900px;
  margin-bottom: clamp(40px, 6vw, 80px);
}
.featured__head .display {
  font-size: clamp(3.4rem, 14vw, 11rem);
  margin-top: clamp(14px, 2vw, 22px);
}

/* ==========================================================================
   Contact list (footer)
   ========================================================================== */
/* ==========================================================================
   404
   ========================================================================== */
.nf {
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding-block: clamp(112px, 13vw, 170px) clamp(56px, 8vw, 100px);
}
.nf__inner { text-align: center; display: flex; flex-direction: column; align-items: center; }

.nf__art {
  width: min(100%, 620px);
  margin-bottom: clamp(24px, 3.5vw, 40px);
}
.nf__art svg { width: 100%; height: auto; overflow: visible; }

/* colour blobs drift gently */
.nf-blob { opacity: .85; transform-box: fill-box; transform-origin: center; }
.nf-blob--a { animation: nf-float 7s ease-in-out infinite; }
.nf-blob--b { animation: nf-float 8s .6s ease-in-out infinite reverse; }
.nf-blob--c { animation: nf-float 9s 1.2s ease-in-out infinite; opacity: .7; }
@keyframes nf-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(6px, -12px) scale(1.04); }
}

.nf-confetti > * {
  transform-box: fill-box;
  transform-origin: center;
  animation: nf-pop .6s var(--ease) both, nf-bob 5s ease-in-out infinite;
}
.nf-confetti > *:nth-child(2) { animation-delay: .08s, .4s; }
.nf-confetti > *:nth-child(3) { animation-delay: .16s, .8s; }
.nf-confetti > *:nth-child(4) { animation-delay: .24s, 1.2s; }
.nf-confetti > *:nth-child(5) { animation-delay: .32s, 1.6s; }
.nf-confetti > *:nth-child(6) { animation-delay: .40s, 2s; }
@keyframes nf-pop { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: scale(1); } }
@keyframes nf-bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }

/* the zero rolls in, then keeps a slow idle wobble */
.nf-zero {
  transform-box: fill-box;
  transform-origin: center;
  animation: nf-roll 1.1s var(--ease) both, nf-idle 4.5s 1.2s ease-in-out infinite;
}
@keyframes nf-roll {
  from { transform: translateX(-210px) rotate(-330deg); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
@keyframes nf-idle {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-9px) rotate(-4deg); }
}

.nf-digit { opacity: 0; animation: nf-drop .7s var(--ease) both; }
.nf-digit--l { animation-delay: .05s; }
.nf-digit--r { animation-delay: .18s; }
@keyframes nf-drop {
  from { opacity: 0; transform: translateY(-26px); }
  to   { opacity: 1; transform: none; }
}

.nf-eye {
  transform-box: fill-box;
  transform-origin: center;
  animation: nf-blink 5s 1.6s ease-in-out infinite;
}
.nf-eye--r { animation-delay: 1.68s; }
@keyframes nf-blink {
  0%, 92%, 100% { transform: scaleY(1); }
  95%           { transform: scaleY(.1); }
}

/* paper plane circles the scene, still looking for that page */
.nf-plane {
  transform-box: view-box;
  offset-path: path("M40 330 C 160 250, 220 380, 340 320 S 560 250, 604 320");
  offset-rotate: auto;
  animation: nf-fly 9s 1s linear infinite;
}
@keyframes nf-fly {
  from { offset-distance: 0%;   opacity: 0; }
  8%   { opacity: 1; }
  92%  { opacity: 1; }
  to   { offset-distance: 100%; opacity: 0; }
}

.nf__eyebrow { margin-bottom: 14px; }
.nf__title { max-width: 17ch; margin-inline: auto; }
.nf__lead  { margin-top: 20px; max-width: 52ch; margin-inline: auto; }

.nf__hint {
  margin-top: 14px;
  font-size: 1rem;
  color: var(--text-3);
}

.nf__actions {
  margin-top: clamp(26px, 3.5vw, 36px);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

/* report to WhatsApp */
.nf__report { margin-top: clamp(26px, 3.5vw, 38px); }
.btn--report {
  background: #25D366;
  color: #06301A;
  font-weight: 600;
  border-color: transparent;
}
.btn--report:hover { background: #1FBE5B; }
.btn--report.is-sent {
  background: var(--surface-2);
  color: var(--text-2);
  cursor: default;
  transform: none;
}
.nf-wa { display: inline-flex; width: 19px; height: 19px; }
.nf-wa svg { width: 100%; height: 100%; }

.nf__report-note {
  margin-top: 12px;
  font-size: .88rem;
  color: var(--text-3);
  min-height: 1.2em;
}

.nf__links {
  margin-top: clamp(34px, 4.5vw, 52px);
  padding-top: 24px;
  border-top: 1px solid var(--border);
  width: min(100%, 720px);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 26px;
  justify-content: center;
  font-size: .9rem;
}
.nf__links a { color: var(--text-2); transition: color .25s var(--ease); }
.nf__links a:hover { color: var(--text); }

@media (prefers-reduced-motion: reduce) {
  .nf-zero, .nf-digit, .nf-eye, .nf-blob, .nf-confetti > *, .nf-plane {
    animation: none;
    opacity: 1;
  }
  .nf-plane { display: none; }
}

/* ---------- About me block with portrait ---------- */
.about-me {
  display: grid;
  grid-template-columns: minmax(0, .62fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
}
.about-me__photo { margin: 0; }
.about-me__photo img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center 25%;
  border-radius: var(--radius-lg);
}

@media (max-width: 860px) {
  .about-me { grid-template-columns: 1fr; }
  .about-me__photo img { aspect-ratio: 16 / 11; }
}

.footer { border-top: 1px solid var(--border); padding-block: clamp(56px, 8vw, 104px); }
.footer__top {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: clamp(32px, 5vw, 80px);
  align-items: start;
}
.contact-list { display: flex; flex-direction: column; }
.contact-list li { border-top: 1px solid var(--border); }
.contact-list li:last-child { border-bottom: 1px solid var(--border); }
.contact-list a {
  display: grid;
  grid-template-columns: 130px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: clamp(16px, 2vw, 22px) 4px;
  transition: padding-inline-start .35s var(--ease), color .25s var(--ease);
}
.contact-list a:hover { padding-inline-start: 16px; }
.contact-list__label {
  font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--text-3);
}
.contact-list__value { font-size: clamp(1rem, 1.6vw, 1.25rem); font-weight: 500; }
.contact-list__go { color: var(--text-3); transition: transform .35s var(--ease), color .25s var(--ease); }
.contact-list a:hover .contact-list__go { transform: translateX(4px); color: var(--text); }

.footer__bottom {
  margin-top: clamp(40px, 5vw, 64px);
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
  font-size: .82rem;
  color: var(--text-3);
}

/* ---------- Anchor offset under fixed header ---------- */
[id] { scroll-margin-top: 96px; }

/* ==========================================================================
   Motion
   ========================================================================== */
/* Hidden-before-reveal only applies once JS confirms it can animate,
   so the site is fully readable with JS disabled. */
.motion .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity .85s var(--ease),
    transform .85s var(--ease),
    filter .85s var(--ease);
  filter: blur(6px);
  will-change: opacity, transform, filter;
}
.motion .reveal.is-in { opacity: 1; transform: none; filter: none; }

/* ---------- Scroll-linked motion ----------
   Native scroll-driven animations where supported (Chrome/Edge);
   JS drives the same effects elsewhere via .sd-* classes. */
@keyframes sd-reveal {
  from { opacity: 0; transform: translateY(38px); filter: blur(8px); }
  to   { opacity: 1; transform: none;             filter: none; }
}
@keyframes sd-float {
  from { transform: translateY(-4%) scale(1.1); }
  to   { transform: translateY(4%)  scale(1.1); }
}
@keyframes sd-exit {
  from { opacity: 1; transform: none; }
  to   { opacity: 0; transform: translateY(-16%) scale(.95); }
}
@keyframes sd-line { from { transform: scaleX(0); } to { transform: scaleX(1); } }

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .motion .reveal {
      opacity: 1; transform: none; filter: none; transition: none;
      animation: sd-reveal linear both;
      animation-timeline: view();
      animation-range: entry 4% cover 34%;
    }
    /* media drifts with the scroll instead of sitting still */
    .motion .project-card__media img,
    .motion .cs-cover img {
      animation: sd-float linear both;
      animation-timeline: view();
      animation-range: cover 0% cover 100%;
    }
    .motion .project-card__media { overflow: hidden; }

    /* opening block dissolves as it leaves */
    .motion .featured__head,
    .motion .cs-hero .wrap,
    .motion .page-hero .wrap {
      animation: sd-exit linear both;
      animation-timeline: view();
      animation-range: exit 10% exit 95%;
    }

    /* section rules draw themselves */
    .motion .section-head { position: relative; }
    .motion .section-head::after {
      content: "";
      position: absolute;
      left: 0; bottom: -18px;
      width: 100%; height: 1px;
      background: var(--border);
      transform-origin: left center;
      animation: sd-line linear both;
      animation-timeline: view();
      animation-range: entry 20% cover 40%;
    }
  }
}

/* Scroll progress bar */
.progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0;
  background: var(--primary);
  z-index: 200;
  transition: width .12s linear;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .motion .reveal { opacity: 1; transform: none; filter: none; transition: none; animation: none; }
  .motion .reveal .project-card__media img,
  .motion .project-card__media img,
  .motion .cs-cover img { transform: none; animation: none; }
  .motion .featured__head,
  .motion .cs-hero .wrap,
  .motion .page-hero .wrap { opacity: 1; transform: none; animation: none; }
  .progress { display: none; }
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ==========================================================================
   Responsive — Tablet
   ========================================================================== */
@media (max-width: 1080px) {
  .kpi-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .swatches { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tech-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .meta-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tl-row { grid-template-columns: 1fr; gap: 8px; }
  .tl-row__src { text-align: left; }
}

@media (max-width: 900px) {
  .nav, .header__cta { display: none; }
  .burger { display: block; }

  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .project-card { min-height: clamp(340px, 78vw, 460px); }
  .projects { --stack-top: 78px; }


  .split, .split--even { grid-template-columns: 1fr; }
  .split__sticky { position: static; }

  .contact { grid-template-columns: 1fr; }
  .features { grid-template-columns: 1fr; }
  .gallery, .gallery--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .carousel__slide { flex-basis: 88%; }
  .footer__top { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Responsive — Mobile
   ========================================================================== */
@media (max-width: 640px) {
  body { font-size: 15px; }

  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .tech-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .meta-row { grid-template-columns: 1fr; }
  .kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .swatches { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ba { grid-template-columns: 1fr; }
  .gallery, .gallery--3 { grid-template-columns: 1fr; }

  .hero { min-height: auto; padding-top: 130px; padding-bottom: 64px; }
  .hero__meta { flex-direction: column; align-items: flex-start; }
  .step { grid-template-columns: 1fr; gap: 10px; }
  .carousel__slide { flex-basis: 92%; }
  .section-head { flex-direction: column; align-items: flex-start; }
  .contact-list a { grid-template-columns: 1fr auto; row-gap: 4px; }
  .contact-list__label { grid-column: 1 / -1; }
  .footer__bottom { flex-direction: column; align-items: flex-start; gap: 12px; }
}

/* ---- CV / resume button row ---- */
.cv-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}
.cv-links .btn { align-self: flex-start; }
@media (max-width: 520px) {
  .cv-links { flex-direction: column; align-items: stretch; }
  .cv-links .btn { justify-content: center; }
}

/* ---- CV language chooser ---- */
.cv-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(11, 16, 32, .5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.cv-modal.is-open { display: flex; animation: cvFade .22s ease both; }
@keyframes cvFade { from { opacity: 0 } to { opacity: 1 } }

.cv-modal__panel {
  position: relative;
  width: min(420px, 100%);
  padding: clamp(26px, 4vw, 34px);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 70px rgba(11, 16, 32, .22);
  animation: cvRise .3s cubic-bezier(.22, 1, .36, 1) both;
}
@keyframes cvRise { from { transform: translateY(14px) scale(.98) } to { transform: none } }

.cv-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-2);
  font-size: 13px;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.cv-modal__close:hover { background: var(--primary); color: #fff; }

.cv-modal__title { margin-top: 10px; }
.cv-modal__opts { display: grid; gap: 10px; margin-top: 22px; }

.cv-opt {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 2px 12px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: border-color .2s, background .2s, transform .2s;
}
.cv-opt:hover, .cv-opt:focus-visible {
  border-color: var(--primary);
  background: var(--surface);
  transform: translateY(-1px);
}
.cv-opt__lang { font-weight: 600; font-size: 1rem; }
.cv-opt__meta { grid-column: 1; font-size: .8rem; color: var(--text-3); }
.cv-opt__go { grid-row: 1 / span 2; font-size: 1.1rem; color: var(--text-2); }

/* ---- Mobile nav: the links live inside .wrap, so stack them there ---- */
.mobile-nav .wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  max-height: 100svh;
  overflow-y: auto;
}
.mobile-nav a {
  display: block;
  width: 100%;
  font-size: clamp(1.6rem, 8vw, 2.4rem);
  line-height: 1.15;
}
.mobile-nav a:last-of-type { border-bottom: 0; }
