/* Martin Tenovski — portfolio. Visual language modelled on fiordaliso.io:
   black canvas, #171717 surfaces, DM Sans, blue gradient accents. */

:root {
  --bg: #000;
  --surface: #171717;
  --line: rgb(var(--ink) / 0.08);
  --line-2: rgb(var(--ink) / 0.14);
  --text: #fff;
  --muted: #808080;
  --soft: #c9c9c9;
  --accent-a: #1c7ff0;
  --accent-b: #19bff7;
  --btn-a: #0048a0;
  --btn-b: #157e96;
  --dot: #157e96;
  --ink: 255 255 255; /* overlays: rgb(var(--ink) / .08) */
  --hover: #262626;
  --faint: #5d5d5d;
  --media: #0b0b0b; /* base the case-media glows mix into */
  --ok: #3ddc84;
  color-scheme: dark;
  --wrap: 1240px;
  --gutter: 60px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
p, h1, h2, h3, h4, ul, ol, figure, blockquote { margin: 0; }
:focus-visible { outline: 2px solid var(--accent-b); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(var(--wrap), 100% - 2 * var(--gutter)); margin-inline: auto; }

/* ---------- Header / footer ---------- */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 40px var(--gutter); position: relative; z-index: 5;
}
.brand { font-size: 20px; line-height: 28px; letter-spacing: 0.02em; }
.nav { display: flex; align-items: center; gap: 32px; }
.nav a { font-size: 16px; letter-spacing: 0.04em; transition: opacity 0.2s; }
.nav a:hover { opacity: 0.6; }
.nav .li-icon { margin-left: 18px; }
.li-icon svg { width: 26px; height: 26px; display: block; }

.site-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  width: min(1040px, 100% - 2 * var(--gutter)); margin: 0 auto; padding: 60px 0 80px;
}
.site-footer small { color: var(--muted); font-size: 16px; letter-spacing: 0.04em; }

/* ---------- Shared type ---------- */
.eyebrow {
  display: inline-block; font-size: 16px; font-weight: 500;
  background: linear-gradient(90deg, var(--accent-a), var(--accent-b));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.label {
  display: inline-block; font-size: 20px; line-height: 30px;
  background: linear-gradient(90deg, var(--accent-a), var(--accent-b));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.section-head { text-align: center; display: grid; justify-items: center; gap: 12px; }
.section-head h2 { font-size: 32px; font-weight: 400; line-height: 1.3; }
.section-head p { color: var(--muted); font-size: 20px; letter-spacing: 0.02em; max-width: 1180px; margin-top: 16px; }
.muted { color: var(--muted); }

.rule {
  height: 1px; border: 0; margin: 0 auto; width: min(900px, 80%);
  background: linear-gradient(90deg, transparent, rgb(var(--ink) / 0.12), transparent);
}

/* ---------- Buttons & chips ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  height: 54px; padding: 0 32px; border-radius: 64px;
  font-size: 16px; letter-spacing: 0.04em; white-space: nowrap;
  transition: transform 0.3s var(--ease), filter 0.3s, background-color 0.3s;
}
.btn svg { width: 16px; height: 16px; transition: transform 0.3s var(--ease); }
.btn:hover svg { transform: translate(2px, -2px); }
.btn-primary { color: #fff; background: linear-gradient(160deg, var(--btn-a) 0%, var(--btn-b) 100%); }
.btn-primary:hover { filter: brightness(1.15); }
.btn-ghost { border: 1px solid rgb(var(--ink) / 0.85); min-width: 190px; }
.btn-ghost:hover { background: rgb(var(--ink) / 0.08); }

.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 10px; }
.chips > div { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 10px; width: 100%; }
.chip {
  display: inline-flex; align-items: center; height: 46px; padding: 0 18px; border-radius: 99px;
  border: 1px solid var(--line-2); font-size: 16px; letter-spacing: 0.04em; white-space: nowrap;
}
.chips .sep { color: var(--dot); font-family: Inter, sans-serif; font-size: 18px; }
.chips-sm .chip { height: 38px; padding: 0 16px; background: var(--surface); border: 0; }

/* ---------- Home: hero ---------- */
.hero { padding: 64px 0 160px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 60px; align-items: center; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px 30px; margin-bottom: 64px; }
.tabs button { font-size: 16px; letter-spacing: 0.04em; color: var(--muted); transition: color 0.25s; }
.tabs button:hover, .tabs button[aria-pressed="true"] { color: var(--text); }
.hero h1 {
  font-size: 56px; line-height: 1.3; font-weight: 500; letter-spacing: -1px;
  max-width: 820px; min-height: calc(56px * 1.3 * 4);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}
.hero h1.swap { opacity: 0; transform: translateY(10px); }
.hero .actions { display: flex; flex-wrap: wrap; gap: 30px; margin-top: 56px; }
.portrait {
  width: 364px; aspect-ratio: 1; border-radius: 50%; overflow: hidden; justify-self: end;
  background: radial-gradient(60% 60% at 50% 40%, #2a2a2a 0%, #121212 70%, #0a0a0a 100%);
}
.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 12%; transform: translateY(8%) scale(1.02); }

/* ---------- Home: selected cases ---------- */
.work { padding: 64px 0 120px; }
.work .section-head { margin: 48px 0 64px; }
.case-card {
  display: grid; grid-template-columns: 47% 53%; min-height: 710px;
  background: var(--surface); border-radius: 40px; overflow: hidden;
}
.case-card + .case-card { margin-top: 64px; }
.case-card.flip { grid-template-columns: 51% 49%; }
.case-card.flip .case-copy { order: 2; }
.case-copy { padding: 90px 72px; display: flex; flex-direction: column; }
.case-copy h3 { font-size: 48px; font-weight: 400; line-height: 1.3; margin: 12px 0 48px; letter-spacing: -0.5px; }
.case-copy hr { border: 0; height: 1px; background: var(--line-2); margin: 40px 0 48px; }
.stats { display: flex; flex-wrap: wrap; gap: 24px 40px; }
.stat b { display: block; font-size: 40px; line-height: 1.2; font-weight: 700; white-space: nowrap; }
.stat span { display: block; color: var(--muted); font-size: 18px; letter-spacing: 0.02em; margin-top: 4px; }
.case-copy .btn { align-self: flex-start; margin-top: 48px; }

.case-media { position: relative; overflow: hidden; min-height: 420px; }
.media-rac { background: radial-gradient(90% 70% at 70% 30%, #1d4f2a 0%, #0b1d12 45%, #050807 100%); }
.media-rac .desk {
  position: absolute; left: 12%; top: 16%; width: 108%; border-radius: 14px;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.08);
  transform: perspective(1600px) rotateY(-14deg) rotateX(4deg); transform-origin: left center;
  transition: transform 0.8s var(--ease);
}
.media-rac .phone { left: 6%; bottom: -8%; width: 30%; }
.case-card:hover .media-rac .desk { transform: perspective(1600px) rotateY(-8deg) rotateX(2deg); }
.media-pocket { background: radial-gradient(80% 70% at 40% 40%, #12294a 0%, #0d1a30 45%, #070b14 100%); }
.media-pocket .phone { width: 34%; top: 50%; }
.media-pocket .phone:nth-child(1) { left: 12%; transform: translateY(-46%) rotate(-8deg); }
.media-pocket .phone:nth-child(2) { left: 36%; transform: translateY(-54%); z-index: 2; }
.media-pocket .phone:nth-child(3) { left: 60%; transform: translateY(-46%) rotate(8deg); }
.media-roam { background: radial-gradient(80% 70% at 40% 40%, #2d3a10 0%, #171f08 45%, #080a04 100%); }

.phone {
  position: absolute; border-radius: 34px; padding: 8px; background: #0b0b0b;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.55), inset 0 0 0 1.5px rgba(255, 255, 255, 0.16);
}
.phone img { border-radius: 27px; width: 100%; }

/* ---------- Home: results / leadership ---------- */
.results { padding: 110px 0 130px; }
.results .section-head { margin-top: 64px; }
.big-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 88px; }
.big-stats > div { text-align: center; padding: 8px 0 12px; }
.big-stats > div + div { border-left: 1px solid rgb(var(--ink) / 0.1); }
.big-stats b { display: block; font-size: 64px; font-weight: 700; line-height: 1.2; }
.big-stats span { display: block; color: var(--muted); font-size: 20px; letter-spacing: 0.02em; margin-top: 18px; }

.space-card {
  position: relative; overflow: hidden; border-radius: 48px;
  background:
    radial-gradient(40% 60% at 72% 20%, rgba(255, 255, 255, 0.07) 0%, transparent 70%),
    linear-gradient(180deg, #131313 0%, #141414 100%);
  border: 1px solid rgb(var(--ink) / 0.04);
}
.leadership { padding: 56px 40px 88px; width: min(1250px, 100% - 2 * var(--gutter)); margin: 0 auto; }
.lead-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 24px 20px; margin-top: 56px; }
.lead-item {
  display: flex; gap: 14px; padding: 30px 28px; border-radius: 24px;
  background: rgb(var(--ink) / 0.015); border: 1px solid rgb(var(--ink) / 0.07);
  font-size: 20px; line-height: 1.45; color: var(--muted); letter-spacing: 0.02em;
}
.lead-item strong { color: var(--text); font-weight: 700; letter-spacing: 0.01em; }
.lead-item svg { flex: none; width: 20px; height: 20px; margin-top: 5px; }

/* Stars + shooting stars */
.stars { position: absolute; inset: 0; pointer-events: none; }
.stars i { position: absolute; width: 2px; height: 2px; border-radius: 50%; background: #fff; opacity: 0.5; animation: twinkle 4s ease-in-out infinite; }
@keyframes twinkle { 50% { opacity: 0.12; } }
.shoot {
  position: absolute; height: 1px; width: 120px; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8));
  transform: rotate(20deg); opacity: 0; animation: shoot 7s linear infinite;
}
@keyframes shoot {
  0% { opacity: 0; translate: -60px -22px; }
  6% { opacity: 1; }
  14% { opacity: 0; translate: 90px 32px; }
  100% { opacity: 0; translate: 90px 32px; }
}

/* ---------- Home: references ---------- */
.refs { padding: 130px 0 120px; text-align: center; }
.refs .section-head { margin-top: 64px; }
.marquee {
  margin: 88px auto 72px; overflow: hidden; width: min(1240px, 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee-track { display: flex; gap: 32px; width: max-content; animation: marquee 60s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(calc(-50% - 16px)); } }
.ref-card {
  width: 390px; flex: none; text-align: left; padding: 30px 30px 36px; border-radius: 24px;
  background: linear-gradient(180deg, #121212 0%, #000 100%); border: 1px solid rgb(var(--ink) / 0.06);
}
.ref-who { display: flex; align-items: center; gap: 14px; padding-bottom: 24px; border-bottom: 1px solid var(--line-2); }
.avatar {
  width: 52px; height: 52px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-weight: 600; font-size: 20px; color: #fff; background: linear-gradient(160deg, var(--btn-a), var(--btn-b));
}
.ref-who b { display: block; font-weight: 400; font-size: 20px; }
.ref-who div span { display: block; color: var(--muted); font-size: 16px; letter-spacing: 0.04em; }
.ref-card blockquote { color: var(--soft); font-size: 18px; line-height: 1.55; margin-top: 24px; }

/* ---------- Contact ---------- */
.contact { position: relative; overflow: hidden; text-align: center; padding: 170px var(--gutter) 290px; }
.contact::before {
  content: ""; position: absolute; left: 50%; bottom: 150px; width: 1300px; height: 700px; translate: -50% 0;
  background: radial-gradient(50% 55% at 50% 100%, rgba(150, 110, 220, 0.55) 0%, rgba(70, 60, 150, 0.35) 40%, transparent 75%);
  filter: blur(10px);
}
.horizon {
  position: absolute; left: 50%; top: calc(100% - 230px); width: 2800px; height: 1600px; translate: -50% 0;
  border-radius: 50%; background: var(--bg);
  box-shadow: 0 -2px 0 rgba(255, 255, 255, 0.85), 0 -10px 40px rgba(210, 190, 255, 0.55), 0 -30px 120px rgba(150, 110, 230, 0.4);
}
.contact .inner { position: relative; z-index: 2; display: grid; justify-items: center; gap: 14px; }
.contact h2 { font-size: 40px; font-weight: 400; letter-spacing: -0.5px; line-height: 1.3; word-break: break-word; }
.contact h2 a:hover { opacity: 0.8; }
.contact p { color: var(--muted); font-size: 20px; letter-spacing: 0.02em; margin: 10px 0 36px; }

/* ---------- Back to top ---------- */
.to-top {
  position: fixed; right: 26px; bottom: 80px; z-index: 20; width: 40px; height: 40px;
  display: grid; place-items: center; color: var(--muted); opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.to-top.show { opacity: 1; pointer-events: auto; }
.to-top svg { width: 22px; height: 28px; }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* =====================================================
   Case study page
   ===================================================== */
.cs-hero { padding: 40px var(--gutter) 0; }
.cs-hero h1 { font-size: 80px; line-height: 1; font-weight: 500; letter-spacing: -2px; margin: 18px 0 28px; max-width: 1150px; }
.cs-hero .lede { color: var(--muted); font-size: 20px; line-height: 28px; letter-spacing: 0.02em; max-width: 1020px; margin: 40px 0 44px; }

/* Phone coverflow */
.coverflow { position: relative; overflow-x: clip; height: 640px; margin: 80px auto 60px; max-width: 1320px; }
.coverflow::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 360px; height: 460px; translate: -50% -50%;
  background: radial-gradient(closest-side, rgba(21, 126, 150, 0.55), transparent); filter: blur(30px);
}
.cf-item {
  position: absolute; left: 50%; top: 50%; width: 270px; border-radius: 38px; padding: 7px; background: #0b0b0b;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6), inset 0 0 0 2px rgba(255, 255, 255, 0.28);
  transition: transform 0.7s var(--ease), opacity 0.7s var(--ease), filter 0.7s var(--ease);
}
.cf-item img { border-radius: 31px; }
.cf-btn {
  position: absolute; top: 50%; z-index: 20; width: 40px; height: 40px; border-radius: 50%; translate: 0 -50%;
  display: grid; place-items: center; background: var(--surface); border: 1px solid rgb(var(--ink) / 0.12);
}
.cf-btn:hover { background: var(--hover); }
.cf-btn svg { width: 16px; height: 16px; }
.cf-prev { left: calc(50% - 200px); }
.cf-next { left: calc(50% + 160px); }

.meta-row {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px;
  padding: 0 var(--gutter) 120px; font-family: Inter, sans-serif;
}
.meta-row h4 { font-weight: 400; font-size: 16px; line-height: 24px; text-transform: uppercase; margin-bottom: 18px; }
.meta-row li { list-style: none; color: var(--muted); font-size: 18px; line-height: 27px; margin-top: 8px; }
.meta-row ul { padding: 0; }
.confidential { padding: 0 var(--gutter); margin: -80px 0 100px; color: var(--faint); font-size: 14px; }

/* Body: sticky chapter nav + content */
.cs-body { display: grid; grid-template-columns: 324px minmax(0, 1fr); padding: 0 var(--gutter) 60px; }
.toc { position: sticky; top: 40px; align-self: start; display: grid; gap: 10px; padding-top: 10px; }
.toc a { font-size: 16px; letter-spacing: 0.04em; transition: color 0.25s; }
.toc a.active {
  background: linear-gradient(90deg, var(--accent-a), var(--accent-b));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.toc a:hover { opacity: 0.7; }
.cs-content { max-width: 1000px; }
.chapter { padding-bottom: 120px; scroll-margin-top: 30px; }
.chapter > h2 {
  font-size: 32px; font-weight: 400; margin-bottom: 36px;
  background: linear-gradient(90deg, var(--accent-a), var(--accent-b));
  -webkit-background-clip: text; background-clip: text; color: transparent; display: inline-block;
}
.chapter > .intro { font-size: 24px; line-height: 1.4; max-width: 800px; margin-bottom: 56px; }
.block { max-width: 800px; margin-bottom: 56px; }
.block h3 { font-size: 18px; font-weight: 500; line-height: 1.6; margin-bottom: 16px; }
.prose { color: var(--muted); letter-spacing: 0.04em; }
.prose p + p { margin-top: 20px; }
.prose ul { padding-left: 20px; margin-top: 14px; }
.prose li { margin-top: 4px; }
.prose li::marker { color: var(--faint); }
.prose strong { color: var(--soft); font-weight: 700; }
.caption { color: var(--muted); font-size: 14px; margin-top: 12px; max-width: 800px; }

.step { display: grid; grid-template-columns: 100px minmax(0, 1fr); margin: 24px 0 56px; }
.step > .num { font-size: 18px; font-weight: 500; line-height: 1.6; }
.step > div > h3 { font-size: 18px; font-weight: 500; line-height: 1.6; margin-bottom: 20px; }
.step .prose { max-width: 800px; }
.step-media { margin-top: 36px; }

.panel { background: var(--surface); border-radius: 24px; padding: 24px; margin-bottom: 56px; }
.panel img { border-radius: 12px; width: 100%; cursor: zoom-in; }
.panel.flush { padding: 0; overflow: hidden; }
.panel.flush img { border-radius: 0; }
.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 56px; }
.gallery .wide { grid-column: 1 / -1; }
.gallery figure { background: var(--surface); border-radius: 20px; padding: 16px; display: flex; flex-direction: column; }
.gallery figure img { border-radius: 10px; cursor: zoom-in; margin: auto 0; }
.gallery figcaption { color: var(--muted); font-size: 14px; margin-top: 12px; }
.gallery.tall figure img { max-height: 520px; width: auto; margin: 0 auto; }

.callout { padding: 44px 40px; margin: 8px 0 64px; max-width: 800px; border-radius: 40px; }
.callout h3 { position: relative; font-size: 20px; font-weight: 400; margin-bottom: 18px; }
.callout p { position: relative; font-size: 17px; font-weight: 500; line-height: 1.5; }

.stat-row { display: flex; justify-content: flex-end; gap: 72px; max-width: 800px; margin: 28px 0 64px; text-align: center; }
.stat-row b { display: block; font-size: 40px; font-weight: 700; line-height: 1.2; }
.stat-row span { display: block; color: var(--muted); font-size: 16px; margin-top: 6px; }

/* Audit table */
.audit { max-width: 800px; margin: 8px 0 40px; border-top: 1px solid var(--line); }
.audit-row { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 24px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.audit-row h4 { font-weight: 500; font-size: 16px; }
.audit-row p { color: var(--muted); font-size: 14px; letter-spacing: 0.02em; margin-top: 4px; }
.audit-row .delta { text-align: right; font-size: 28px; font-weight: 700; white-space: nowrap; }
.audit-row .delta s { color: var(--faint); text-decoration: none; font-weight: 400; }
.audit-row .delta em { font-style: normal; font-size: 14px; color: var(--muted); display: block; font-weight: 400; }

/* Horizontal slider (decisions) */
.slider { position: relative; margin-bottom: 56px; }
.slides { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 4px; }
.slides::-webkit-scrollbar { display: none; }
.slides > * { scroll-snap-align: start; flex: 0 0 min(620px, 88%); }
.slider-btns { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.slider-btns button {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface); border: 1px solid rgb(var(--ink) / 0.1);
}
.slider-btns button:hover { background: var(--hover); }
.slider-btns svg { width: 16px; height: 16px; }
.decision { background: var(--surface); border-radius: 24px; padding: 32px; }
.decision small { color: var(--muted); font-size: 14px; letter-spacing: 0.04em; }
.decision h4 { font-size: 22px; font-weight: 500; line-height: 1.35; margin: 8px 0 14px; }
.decision > p { color: var(--muted); letter-spacing: 0.02em; }
.options { list-style: none; padding: 0; margin: 22px 0; display: grid; gap: 8px; }
.options li { display: flex; gap: 12px; padding: 12px 16px; border-radius: 14px; border: 1px solid var(--line); color: var(--faint); }
.options li span { flex: none; width: 18px; text-align: center; }
.options li.chosen { color: var(--text); border-color: rgba(25, 191, 247, 0.45); background: rgba(21, 126, 150, 0.12); }
.options li.chosen span { color: var(--accent-b); }
.options li em { display: block; font-style: normal; font-size: 14px; color: var(--muted); margin-top: 2px; }
.decision .why { border-top: 1px solid var(--line); padding-top: 18px; color: var(--soft); font-size: 15px; line-height: 1.55; }
.decision .why b { color: var(--text); font-weight: 500; }

/* Before / after compare */
.ba-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.ba-tabs button { height: 38px; padding: 0 16px; border-radius: 99px; background: var(--surface); font-size: 14px; letter-spacing: 0.04em; color: var(--muted); transition: color 0.2s, background 0.2s; }
.ba-tabs button[aria-pressed="true"] { color: #fff; background: linear-gradient(160deg, var(--btn-a), var(--btn-b)); }
.compare { position: relative; overflow: hidden; border-radius: 12px; user-select: none; touch-action: pan-y; background: var(--surface); }
.compare img { width: 100%; }
.compare .after { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--pos, 50%)); }
.compare .after img { height: 100%; object-fit: cover; object-position: top; }
.compare .handle { position: absolute; top: 0; bottom: 0; left: var(--pos, 50%); width: 2px; translate: -1px 0; background: #fff; pointer-events: none; }
.compare .handle::after {
  content: "‹ ›"; position: absolute; top: 50%; left: 50%; translate: -50% -50%; width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center; background: #fff; color: #000; font-size: 18px; letter-spacing: 2px;
}
.compare input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }
.compare .tag { position: absolute; bottom: 14px; padding: 5px 12px; border-radius: 99px; background: rgba(0, 0, 0, 0.7); color: #fff; font-size: 13px; letter-spacing: 0.04em; pointer-events: none; }
.compare .tag.l { left: 14px; }
.compare .tag.r { right: 14px; }
.ba-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; margin: 20px 4px 6px; }
.ba-meta h4 { font-size: 18px; font-weight: 500; }
.ba-meta span { color: var(--muted); font-size: 14px; letter-spacing: 0.04em; }
.ba-changes { color: var(--muted); letter-spacing: 0.02em; padding-left: 20px; margin: 10px 4px 4px; }
.ba-changes li { margin-top: 4px; }

/* Full-bleed screen strip */
.strip { overflow: hidden; margin: 20px 0 140px; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.strip-track { display: flex; gap: 24px; width: max-content; animation: marquee 80s linear infinite; }
.strip img { height: 330px; width: auto; border-radius: 16px; border: 1px solid rgb(var(--ink) / 0.08); }

/* Outcomes / timeline / learnings */
.outcomes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 56px; }
.outcome { background: var(--surface); border-radius: 20px; padding: 26px 22px; }
.outcome b { display: block; font-size: 36px; font-weight: 700; line-height: 1.15; white-space: nowrap; }
.outcome h4 { font-weight: 500; font-size: 16px; margin: 10px 0 8px; }
.outcome p { color: var(--muted); font-size: 14px; line-height: 1.5; letter-spacing: 0.02em; }
.timeline { list-style: none; padding: 0; max-width: 800px; border-left: 1px solid var(--line-2); margin: 8px 0 56px 6px; }
.timeline li { position: relative; padding: 0 0 22px 28px; color: var(--muted); letter-spacing: 0.02em; }
.timeline li::before { content: ""; position: absolute; left: -5px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: linear-gradient(160deg, var(--accent-a), var(--accent-b)); }
.timeline time { display: block; color: var(--text); font-size: 14px; letter-spacing: 0.06em; margin-bottom: 2px; }
.learnings { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.learning { padding: 28px; border-radius: 24px; border: 1px solid rgb(var(--ink) / 0.07); background: rgb(var(--ink) / 0.015); }
.learning h4 { display: flex; gap: 12px; font-size: 18px; font-weight: 500; margin-bottom: 10px; }
.learning h4 svg { flex: none; width: 18px; height: 18px; margin-top: 4px; }
.learning p { color: var(--muted); letter-spacing: 0.02em; }

.next-case { text-align: center; padding: 40px 0 20px; }

/* Lightbox */
.lightbox { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 94vh; }
.lightbox::backdrop { background: rgba(0, 0, 0, 0.9); }
.lightbox img { max-width: 96vw; max-height: 94vh; border-radius: 10px; cursor: zoom-out; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  :root { --gutter: 32px; }
  .case-card, .case-card.flip { grid-template-columns: 1fr; }
  .case-card.flip .case-copy { order: 0; }
  .case-media { min-height: 460px; }
  .case-copy { padding: 56px 48px; }
  .cs-body { grid-template-columns: minmax(0, 1fr); }
  .toc { display: none; }
  .outcomes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .portrait { justify-self: start; width: 240px; order: -1; }
  .hero h1 { font-size: 40px; min-height: calc(40px * 1.3 * 5); }
  .lead-grid, .learnings { grid-template-columns: 1fr; }
  .meta-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cs-hero h1 { font-size: 52px; letter-spacing: -1px; }
  .stat-row { justify-content: flex-start; gap: 40px; }
}
@media (max-width: 640px) {
  :root { --gutter: 16px; }
  .site-header { padding: 24px var(--gutter); }
  .nav { gap: 18px; }
  .nav .li-icon { margin-left: 4px; }
  .hero-grid > * { min-width: 0; }
  .nav a { font-size: 14px; letter-spacing: 0.02em; }
  .brand { font-size: 17px; }
  .hero { padding: 24px 0 96px; }
  .tabs { gap: 8px 18px; margin-bottom: 36px; }
  .tabs button { font-size: 14px; }
  .hero h1 { font-size: 32px; min-height: calc(32px * 1.3 * 6); }
  .hero .actions { gap: 14px; margin-top: 36px; }
  .hero .actions .btn { flex: 1; min-width: 0; }
  .case-card { border-radius: 28px; }
  .case-copy { padding: 40px 24px; }
  .case-copy h3 { font-size: 32px; margin-bottom: 32px; }
  .chip { height: 40px; padding: 0 14px; font-size: 14px; }
  .stats { gap: 20px 24px; }
  .stat b { font-size: 30px; }
  .stat span { font-size: 15px; }
  .case-media { min-height: 340px; }
  .big-stats { grid-template-columns: 1fr; gap: 40px; }
  .big-stats > div + div { border-left: 0; border-top: 1px solid rgb(var(--ink) / 0.1); padding-top: 40px; }
  .big-stats b { font-size: 52px; }
  .section-head p { font-size: 17px; }
  .leadership { padding: 44px 16px 48px; border-radius: 32px; }
  .lead-item { font-size: 17px; padding: 22px 18px; }
  .ref-card { width: 300px; }
  .contact { padding: 110px var(--gutter) 240px; }
  .contact h2 { font-size: 24px; }
  .contact p { font-size: 17px; }
  .site-footer { flex-direction: column; align-items: flex-start; }
  .cs-hero h1 { font-size: 38px; line-height: 1.08; }
  .cs-hero .lede { font-size: 17px; line-height: 1.5; }
  .coverflow { height: 480px; margin: 40px 0; }
  .cf-item { width: 200px; border-radius: 30px; }
  .cf-item img { border-radius: 24px; }
  .cf-prev { left: 8px; }
  .cf-next { left: auto; right: 8px; }
  .meta-row { gap: 28px 16px; padding-bottom: 96px; }
  .meta-row li { font-size: 15px; line-height: 22px; }
  .chapter > .intro { font-size: 20px; }
  .step { grid-template-columns: minmax(0, 1fr); }
  .step > .num { margin-bottom: 4px; }
  .panel { padding: 12px; border-radius: 18px; }
  .gallery { grid-template-columns: 1fr; }
  .callout { padding: 32px 24px; border-radius: 28px; }
  .stat-row { flex-wrap: wrap; gap: 28px 36px; }
  .stat-row b { font-size: 32px; }
  .audit-row { grid-template-columns: 1fr; gap: 8px; }
  .audit-row .delta { text-align: left; }
  .outcomes { grid-template-columns: 1fr; }
  .strip img { height: 200px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .marquee-track, .strip-track, .stars i, .shoot { animation: none; }
}

/* Centre the case-study layout on wide screens (same 1320 column as the coverflow). */
.cs-hero, .meta-row, .confidential, .cs-body { max-width: calc(1320px + 2 * var(--gutter)); margin-inline: auto; }
.cs-body { grid-template-columns: 280px minmax(0, 1fr); column-gap: 40px; }
.cs-content { width: 100%; max-width: 1000px; }
@media (max-width: 1100px) { .cs-body { grid-template-columns: minmax(0, 1fr); column-gap: 0; } }
.block > .panel { margin-bottom: 0; }

/* =====================================================
   Generated project pages
   ===================================================== */
.hero-shot {
  max-width: 1320px; margin: 80px auto 100px; padding: 48px; border-radius: 40px;
  background: radial-gradient(80% 90% at 50% 0%, color-mix(in srgb, var(--accent) 35%, var(--media)) 0%, var(--media) 70%);
}
.hero-shot img { border-radius: 16px; width: 100%; box-shadow: 0 40px 90px rgba(0, 0, 0, 0.55); cursor: zoom-in; }
.hero-icons {
  max-width: 1320px; margin: 80px auto 100px; padding: 90px 40px; border-radius: 40px;
  background: radial-gradient(70% 90% at 50% 0%, color-mix(in srgb, var(--accent) 30%, var(--media)) 0%, var(--media) 70%);
}
.hero-icons ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 28px; }
.hero-icons li { width: 128px; border-radius: 30px; overflow: hidden; box-shadow: 0 24px 50px rgba(0, 0, 0, 0.5); transition: transform 0.5s var(--ease); }
.hero-icons li:nth-child(odd) { transform: rotate(-6deg) translateY(10px); }
.hero-icons li:nth-child(even) { transform: rotate(5deg); }
.hero-icons li:hover { transform: translateY(-8px); }

.phone-panel { display: grid; place-items: center; padding: 48px 24px; }
.phone-frame { width: min(300px, 100%); border-radius: 38px; padding: 7px; background: #0b0b0b; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.22), 0 30px 60px rgba(0, 0, 0, 0.5); }
.phone-frame img, .panel .phone-frame img { border-radius: 31px; }
.phones-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 28px 20px; background: var(--surface); border-radius: 24px; padding: 32px; margin-bottom: 56px; }
.phones-row figure { display: grid; justify-items: center; align-content: start; gap: 14px; }
.phones-row .phone-frame img { cursor: zoom-in; }
.phones-row figcaption { color: var(--muted); font-size: 14px; text-align: center; max-width: 240px; }

.callout-list { position: relative; list-style: none; padding: 0; margin-top: 20px; display: flex; flex-wrap: wrap; gap: 8px; }
.callout-list li { font-size: 14px; letter-spacing: 0.04em; padding: 6px 14px; border-radius: 99px; background: rgb(var(--ink) / 0.06); color: var(--soft); }
.deliv { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.deliv h4 { color: var(--text); font-weight: 500; font-size: 15px; letter-spacing: 0.04em; }
.deliv ul { margin-top: 8px; }
.stat-4 { justify-content: space-between; gap: 32px; }
.stat-row .txt b { font-size: 22px; line-height: 1.2; padding-top: 12px; }
.principle { color: var(--soft); border-left: 2px solid var(--accent-a); padding-left: 16px; }

.quote-card { max-width: 800px; margin: 16px 0 72px; padding: 40px; border-radius: 32px; background: linear-gradient(180deg, #121212, #050505); border: 1px solid rgb(var(--ink) / 0.06); }
.quote-card blockquote { font-size: 22px; line-height: 1.5; }
.quote-card figcaption { display: flex; align-items: center; gap: 14px; margin-top: 28px; color: var(--muted); font-size: 15px; }
.quote-card figcaption b { display: block; color: var(--text); font-weight: 500; font-size: 17px; }

.next-link {
  display: grid; justify-items: start; gap: 10px; max-width: 800px; margin-top: 16px; padding: 44px 40px; border-radius: 32px;
  background: var(--surface); transition: background 0.3s;
}
.next-link:hover { background: var(--hover); }
.next-link b { font-size: 32px; font-weight: 500; letter-spacing: -0.5px; }
.next-link .muted { max-width: 600px; letter-spacing: 0.02em; }
.next-link .btn { margin-top: 18px; }

/* Home: more cases */
.more-head { margin: 120px 0 56px; }
.more-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
.mini-case { display: flex; flex-direction: column; background: var(--surface); border-radius: 32px; overflow: hidden; transition: transform 0.5s var(--ease); }
.mini-case:hover { transform: translateY(-6px); }
.mc-media { position: relative; height: 340px; overflow: hidden; background: radial-gradient(90% 90% at 50% 10%, color-mix(in srgb, var(--accent) 40%, var(--media)) 0%, var(--media) 75%); }
.mc-media.shot img { position: absolute; left: 8%; top: 12%; width: 92%; border-radius: 12px; box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5); transition: transform 0.6s var(--ease); }
.mini-case:hover .mc-media.shot img { transform: translate(-10px, -6px); }
.mc-media.phones .phone { width: 30%; top: 14%; }
.mc-media.phones .phone:first-child { left: 18%; transform: rotate(-7deg); }
.mc-media.phones .phone:last-child { left: 50%; transform: rotate(6deg) translateY(10px); }
.mc-media.logo { display: grid; place-items: center; }
.mc-media.logo img { width: 40%; border-radius: 28px; }
.mc-copy { padding: 36px 40px 40px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.mc-copy h3 { font-size: 28px; font-weight: 400; line-height: 1.3; letter-spacing: -0.3px; }
.mc-copy p { color: var(--muted); letter-spacing: 0.02em; }
.mc-meta { margin-top: auto; padding-top: 18px; display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 14px; letter-spacing: 0.04em; }
.mc-meta svg { width: 18px; height: 18px; color: var(--text); }

/* =====================================================
   About page
   ===================================================== */
.about-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 72px; align-items: center; padding: 64px var(--gutter) 140px; max-width: calc(1320px + 2 * var(--gutter)); margin: 0 auto; }
.about-hero h1 { font-size: 48px; line-height: 1.3; font-weight: 500; letter-spacing: -1px; margin: 18px 0 44px; }
.about-hero .actions { display: flex; flex-wrap: wrap; gap: 20px; }
.about-photo { border-radius: 20px; overflow: hidden; aspect-ratio: 16 / 10; }
.about-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 38% 40%; }
.rotator { display: inline-grid; }
/* Gradient per word: on the parent, background-clip:text would paint the faded-out words too. */
.label.rotator { background: none; }
.rotator > span {
  background: linear-gradient(90deg, var(--accent-a), var(--accent-b));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.rotator > span { grid-area: 1 / 1; opacity: 0; transform: translateY(8px); transition: opacity 0.5s var(--ease), transform 0.5s var(--ease); }
.rotator > span.on { opacity: 1; transform: none; }
.rich { font-size: 24px; line-height: 1.45; color: var(--muted); max-width: 820px; }
.rich strong { color: var(--text); font-weight: 400; }
.rich + .rich { margin-top: 24px; }
.jobs { list-style: none; padding: 0; margin: 56px 0 0; max-width: 820px; border-top: 1px solid var(--line); }
.jobs li { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 24px; padding: 26px 0; border-bottom: 1px solid var(--line); }
.jobs time { color: var(--muted); font-size: 15px; letter-spacing: 0.04em; padding-top: 3px; }
.jobs h3 { font-size: 18px; font-weight: 500; }
.jobs h3 span { color: var(--muted); font-weight: 400; }
.jobs p { color: var(--muted); letter-spacing: 0.02em; margin-top: 6px; }
.jobs a { color: var(--accent-b); font-size: 14px; letter-spacing: 0.04em; display: inline-block; margin-top: 8px; margin-right: 14px; }
.jobs a:hover { text-decoration: underline; }
.kit { display: grid; gap: 28px; max-width: 820px; }
.kit h4 { font-weight: 500; font-size: 16px; margin-bottom: 12px; }
.photo-strip { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin: 48px 0; border-radius: 20px; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
.photo-strip::-webkit-scrollbar { display: none; }
.photo-strip img { height: 300px; width: auto; flex: none; border-radius: 16px; scroll-snap-align: start; cursor: zoom-in; }
.mechka { max-width: 820px; font-size: 22px; line-height: 1.5; padding-left: 22px; border-left: 2px solid var(--accent-a); margin: 8px 0 40px; }

@media (max-width: 1100px) {
  .more-grid { grid-template-columns: 1fr; }
  .about-hero { grid-template-columns: 1fr; gap: 40px; }
}
@media (max-width: 640px) {
  .hero-shot, .hero-icons { margin: 40px var(--gutter) 64px; padding: 16px; border-radius: 24px; }
  .hero-icons { padding: 40px 16px; }
  .hero-icons ul { gap: 16px; }
  .hero-icons li { width: 72px; border-radius: 18px; }
  .deliv { grid-template-columns: 1fr; }
  .stat-4 { justify-content: flex-start; }
  .quote-card, .next-link { padding: 28px 22px; border-radius: 24px; }
  .quote-card blockquote { font-size: 18px; }
  .next-link b { font-size: 26px; }
  .phones-row { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 16px; gap: 20px 10px; }
  .mc-media { height: 240px; }
  .mc-copy { padding: 28px 24px 30px; }
  .mc-copy h3 { font-size: 22px; }
  .about-hero { padding: 24px var(--gutter) 88px; }
  .about-hero h1 { font-size: 32px; margin-bottom: 32px; }
  .rich { font-size: 19px; }
  .jobs li { grid-template-columns: 1fr; gap: 6px; }
  .photo-strip img { height: 200px; }
  .mechka { font-size: 18px; }
}

.phone-panel { max-width: 800px; padding: 40px 24px; }
.phone-panel .phone-frame { width: min(250px, 100%); }

/* An odd last card spans the row, media beside copy. */
@media (min-width: 1101px) {
  .more-grid > :last-child:nth-child(odd) { grid-column: 1 / -1; flex-direction: row; }
  .more-grid > :last-child:nth-child(odd) .mc-media { flex: 0 0 55%; height: auto; min-height: 380px; }
  .more-grid > :last-child:nth-child(odd) .mc-copy { justify-content: center; padding: 48px; }
}

/* =====================================================
   Sticky header + mobile menu
   ===================================================== */
html { scroll-padding-top: 96px; }
.site-header {
  position: sticky; top: 0; z-index: 50;
  transition: padding 0.35s var(--ease), margin 0.35s var(--ease), background-color 0.35s, border-color 0.35s;
  border-bottom: 1px solid transparent;
}
/* margin-bottom gives back the padding the compact header loses, so its layout
   footprint never changes — otherwise content shifts, scrollY drops back under
   the threshold and the header flip-flops near the top. */
.site-header.scrolled {
  padding-top: 18px; padding-bottom: 18px; margin-bottom: 44px;
  background: color-mix(in srgb, var(--bg) 72%, transparent); border-bottom-color: rgb(var(--ink) / 0.06);
  -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%);
}
@media (max-width: 640px) { .site-header.scrolled { margin-bottom: 12px; } }
.toc { top: 110px; }
.chapter { scroll-margin-top: 100px; }
.menu-btn { display: none; }

.hero-kicker { display: none; }

@media (max-width: 860px) {
  .menu-btn {
    display: grid; place-content: center; gap: 6px; width: 44px; height: 44px; margin-right: -10px; border-radius: 50%;
  }
  .menu-btn span { display: block; width: 22px; height: 1.5px; background: var(--text); border-radius: 2px; transition: transform 0.35s var(--ease); }
  .site-header.open .menu-btn span:first-child { transform: translateY(3.75px) rotate(45deg); }
  .site-header.open .menu-btn span:last-child { transform: translateY(-3.75px) rotate(-45deg); }

  .site-header .nav {
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0; padding: 8px var(--gutter) 24px;
    background: color-mix(in srgb, var(--bg) 94%, transparent); border-bottom: 1px solid rgb(var(--ink) / 0.08);
    -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0.3s;
  }
  .site-header.open { background: color-mix(in srgb, var(--bg) 94%, transparent); }
  .site-header.open .nav { opacity: 1; visibility: visible; transform: none; }
  .site-header .nav a { font-size: 22px; letter-spacing: 0; padding: 14px 0; border-bottom: 1px solid rgb(var(--ink) / 0.07); }
  .site-header .nav .li-icon { margin: 18px 0 0; padding: 0; border: 0; display: inline-flex; align-items: center; gap: 12px; font-size: 16px; }
  .site-header .nav .li-icon::after { content: "LinkedIn"; }
  .site-header .nav .li-icon svg { width: 24px; height: 24px; }
}

/* =====================================================
   Mobile hero
   ===================================================== */
@media (max-width: 860px) {
  .hero { padding: 16px 0 88px; }
  .hero-grid { gap: 20px; }
  /* Photo moves into the status line: avatar with an accent ring and an "available" dot. */
  .portrait { display: none; }
  .hero-kicker { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
  .hero-kicker .face {
    position: relative; flex: none; width: 60px; height: 60px; border-radius: 50%; padding: 2px; border: 2px solid transparent;
    background:
      url(assets/martin.webp) 50% 8% / 150% auto no-repeat content-box,
      radial-gradient(60% 60% at 50% 40%, #2a2a2a, #121212) content-box,
      linear-gradient(var(--bg), var(--bg)) padding-box,
      linear-gradient(135deg, var(--accent-a), var(--accent-b)) border-box;
  }
  .hero-kicker .face::after {
    content: ""; position: absolute; right: -3px; bottom: -3px; width: 16px; height: 16px; border-radius: 50%;
    background: var(--ok); border: 3px solid var(--bg);
  }
  .hero-kicker p { display: grid; gap: 3px; font-size: 16px; letter-spacing: 0.01em; }
  .hero-kicker b { font-weight: 500; }
  .hero-kicker p span { color: var(--ok); font-size: 14px; }
  .tabs {
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 8px; margin: 0 calc(-1 * var(--gutter)) 28px; padding: 0 var(--gutter);
    -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent);
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button {
    flex: none; height: 38px; padding: 0 16px; border-radius: 99px; font-size: 14px; letter-spacing: 0.02em;
    border: 1px solid rgb(var(--ink) / 0.14); transition: color 0.25s, background 0.25s, border-color 0.25s;
  }
  .tabs button[aria-pressed="true"] { color: #fff; border-color: transparent; background: linear-gradient(160deg, var(--btn-a), var(--btn-b)); }
  .hero h1 { font-size: 34px; line-height: 1.22; letter-spacing: -0.8px; min-height: 0; }
  .hero .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 24px; }
  .hero .actions .btn { min-width: 0; padding: 0 16px; }
}
@media (max-width: 380px) {
  .hero h1 { font-size: 30px; }
}

/* =====================================================
   Mobile case cards
   ===================================================== */
@media (max-width: 1100px) {
  .case-media { order: -1; min-height: 380px; }
  .case-card.flip .case-copy { order: 1; }
}
@media (max-width: 640px) {
  .work .section-head { margin: 40px 0 32px; }
  .case-card + .case-card { margin-top: 24px; }
  .case-card { border-radius: 24px; min-height: 0; }
  .case-media { min-height: 260px; }
  .media-rac .desk { left: 8%; top: 12%; width: 118%; border-radius: 10px; }
  .media-rac .phone { left: 6%; bottom: -18%; width: 34%; border-radius: 22px; padding: 5px; }
  .media-rac .phone img { border-radius: 18px; }
  .media-pocket .phone { width: 38%; border-radius: 24px; padding: 5px; }
  .media-pocket .phone img { border-radius: 19px; }
  .media-pocket .phone:nth-child(1) { left: 4%; }
  .media-pocket .phone:nth-child(2) { left: 31%; }
  .media-pocket .phone:nth-child(3) { left: 58%; }
  .case-copy { padding: 28px 22px 26px; }
  .case-copy .label { font-size: 16px; line-height: 24px; }
  .case-copy h3 { font-size: 28px; line-height: 1.2; margin: 8px 0 20px; }
  .case-copy .chips, .case-copy .chips > div { gap: 8px; }
  .case-copy .chips .sep { display: none; }
  .case-copy .chip { height: 32px; padding: 0 12px; font-size: 13px; letter-spacing: 0.02em; }
  .case-copy hr { margin: 24px 0; }
  .stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .stat b { font-size: 26px; }
  .stat span { font-size: 13px; line-height: 1.3; }
  .case-copy .btn { align-self: stretch; margin-top: 28px; }

  .more-head { margin: 72px 0 28px; }
  .more-grid { gap: 20px; }
  .mini-case { border-radius: 24px; }
  .mc-media { height: 220px; }
  .mc-media.phones .phone { width: 34%; top: 12%; border-radius: 24px; padding: 5px; }
  .mc-media.phones .phone img { border-radius: 19px; }
  .mc-media.phones .phone:first-child { left: 14%; }
  .mc-media.phones .phone:last-child { left: 52%; }
  .mc-media.logo img { width: 34%; }
  .mc-copy { padding: 22px 22px 22px; gap: 8px; }
  .mc-copy .label { font-size: 15px; line-height: 22px; }
  .mc-copy h3 { font-size: 22px; line-height: 1.25; }
  .mc-copy p { font-size: 15px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .mc-meta { padding-top: 12px; }
}

/* =====================================================
   Language switch, client logos, reference documents
   ===================================================== */
.nav .lang {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; letter-spacing: 0.08em; padding: 5px 11px 5px 8px;
  border: 1px solid var(--line-2); border-radius: 99px;
}
/* Flag of the language the link switches to (emoji flags don't render on Windows). */
.nav .lang::before {
  content: ""; flex: none; width: 18px; height: 12px; border-radius: 2px;
  box-shadow: 0 0 0 1px rgb(var(--ink) / 0.14);
  background: center / cover no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 5 3'%3E%3Cpath fill='%23000' d='M0 0h5v1H0z'/%3E%3Cpath fill='%23D00' d='M0 1h5v1H0z'/%3E%3Cpath fill='%23FFCE00' d='M0 2h5v1H0z'/%3E%3C/svg%3E");
}
.nav .lang[hreflang="en"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 30'%3E%3Cpath fill='%23012169' d='M0 0h60v30H0z'/%3E%3Cpath stroke='%23fff' stroke-width='6' d='M0 0l60 30M60 0L0 30'/%3E%3Cpath stroke='%23C8102E' stroke-width='2' d='M0 0l60 30M60 0L0 30'/%3E%3Cpath stroke='%23fff' stroke-width='10' d='M30 0v30M0 15h60'/%3E%3Cpath stroke='%23C8102E' stroke-width='6' d='M30 0v30M0 15h60'/%3E%3C/svg%3E");
}

/* First-visit hint pointing at the language switch (placed by main.js). */
.lang-tip {
  position: fixed; z-index: 60; width: min(290px, 100vw - 32px);
  padding: 16px 44px 16px 18px; border: 1px solid var(--line-2); border-radius: 14px;
  background: var(--surface); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
  font-size: 14px; line-height: 1.45; color: var(--soft);
  animation: tip-in 0.5s var(--ease) both;
}
.lang-tip::before {
  content: ""; position: absolute; top: -6px; right: var(--arrow, 22px); width: 10px; height: 10px;
  background: var(--surface); border: solid var(--line-2); border-width: 1px 0 0 1px; transform: rotate(45deg);
}
.lang-tip b { display: block; color: var(--text); font-weight: 500; font-size: 15px; margin-bottom: 2px; }
.lang-tip a { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; color: var(--accent-b); }
.lang-tip a svg { width: 12px; height: 12px; }
.lang-tip button { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border-radius: 50%; font-size: 20px; line-height: 1; color: var(--muted); }
.lang-tip button:hover { color: var(--text); }
@keyframes tip-in { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .lang-tip { animation: none; } }
@media (max-width: 860px) {
  .site-header .nav .lang { border-width: 0 0 1px; border-radius: 0; }
}

.logos { margin-top: -72px; padding: 0 var(--gutter) 56px; text-align: center; }
.logos ul {
  list-style: none; padding: 0; margin: 28px auto 0; max-width: 1100px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 28px 56px;
}
.logos img {
  height: 26px; width: auto; filter: brightness(0) invert(1); opacity: 0.5;
  transition: opacity 0.3s;
}
.logos li:hover img { opacity: 0.9; }

.docs {
  list-style: none; padding: 0; margin: 0 auto 72px; text-align: left;
  width: min(900px, 100% - 2 * var(--gutter)); border-top: 1px solid var(--line-2);
}
.docs li { border-bottom: 1px solid var(--line-2); }
.docs a { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 24px; padding: 28px 4px; }
.doc-kind { font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.docs b { font-weight: 400; font-size: 20px; margin-top: 8px; transition: color 0.2s; }
.doc-desc { color: var(--muted); font-size: 16px; margin-top: 4px; }
.doc-dl {
  grid-column: 2; grid-row: 1 / span 3; align-self: center;
  display: inline-flex; align-items: center; gap: 8px; color: var(--soft); font-size: 15px; transition: color 0.2s;
}
.doc-dl svg { width: 16px; height: 16px; }
.docs a:hover b { color: var(--accent-b); }
.docs a:hover .doc-dl { color: var(--text); }

@media (max-width: 860px) {
  .logos { margin-top: -48px; }
  .logos ul { gap: 22px 36px; }
  .logos img { height: 20px; }
}
@media (max-width: 640px) {
  .docs b { font-size: 17px; }
  .doc-desc { font-size: 14px; }
  .doc-dl span, .doc-dl { font-size: 0; }
  .doc-dl svg { width: 20px; height: 20px; }
}

/* =====================================================
   Light theme — warm paper, never pure white.
   <html data-theme="light"> is set before first paint by the <head> script.
   ===================================================== */
[data-theme="light"] {
  --bg: #f1efea;
  --surface: #e7e4dd;
  --hover: #dcd8cf;
  --text: #1c1b19;
  --muted: #67635c;
  --soft: #3b3935;
  --faint: #827d74;
  --ink: 28 27 25;
  --accent-a: #1a5fd0;
  --accent-b: #0a78ab;
  --media: #e2dfd8;
  --ok: #178a4a;
  color-scheme: light;
}
[data-theme="light"] .stars, [data-theme="light"] .shoot { display: none; }
[data-theme="light"] .logos img { filter: brightness(0); opacity: 0.55; }
[data-theme="light"] .li-icon svg { filter: invert(0.9); }
[data-theme="light"] .portrait { background: radial-gradient(60% 60% at 50% 40%, #e9e6df 0%, #dcd8cf 70%, #d3cec4 100%); }
[data-theme="light"] .hero-kicker .face {
  background:
    url(assets/martin.webp) 50% 8% / 150% auto no-repeat content-box,
    radial-gradient(60% 60% at 50% 40%, #e9e6df, #d6d1c8) content-box,
    linear-gradient(var(--bg), var(--bg)) padding-box,
    linear-gradient(135deg, var(--accent-a), var(--accent-b)) border-box;
}
[data-theme="light"] .media-rac { background: radial-gradient(90% 70% at 70% 30%, #b9dcc0 0%, #d6e8d6 45%, #e6e9e1 100%); }
[data-theme="light"] .media-pocket { background: radial-gradient(80% 70% at 40% 40%, #bcd0ec 0%, #d6e0ee 45%, #e5e6e6 100%); }
[data-theme="light"] .media-roam { background: radial-gradient(80% 70% at 40% 40%, #d5e0ab 0%, #e2e7cb 45%, #e9e8df 100%); }
[data-theme="light"] .space-card {
  background: radial-gradient(40% 60% at 72% 20%, rgb(26 95 208 / 0.07) 0%, transparent 70%), linear-gradient(180deg, #e9e6df 0%, #e4e1d9 100%);
}
[data-theme="light"] .ref-card, [data-theme="light"] .quote-card { background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%); }
[data-theme="light"] .contact::before { opacity: 0.55; }
[data-theme="light"] .horizon {
  box-shadow: 0 -2px 0 rgb(120 90 210 / 0.55), 0 -10px 40px rgb(150 110 230 / 0.35), 0 -30px 120px rgb(150 110 230 / 0.25);
}
[data-theme="light"] .lang-tip { box-shadow: 0 18px 40px rgb(0 0 0 / 0.14); }
/* The RAC card shows the matching dashboard screenshot per theme. */
.media-rac .desk.light, [data-theme="light"] .media-rac .desk.dark { display: none; }
[data-theme="light"] .media-rac .desk.light { display: block; }

/* Theme switch (built by main.js, sits right after the language switch). */
.theme { display: inline-flex; align-items: center; gap: 12px; }
.theme-track {
  position: relative; width: 46px; height: 26px; border-radius: 99px; border: 1px solid var(--line-2);
  transition: border-color 0.2s;
}
.theme:hover .theme-track { border-color: rgb(var(--ink) / 0.35); }
.theme-knob {
  position: absolute; top: 3px; left: 23px; width: 18px; height: 18px; border-radius: 50%;
  display: grid; place-items: center; background: var(--text); color: var(--bg);
  transition: left 0.3s var(--ease);
}
[data-theme="light"] .theme-knob { left: 3px; }
.theme-knob svg { width: 12px; height: 12px; }
.theme-knob .sun, [data-theme="light"] .theme-knob .moon { display: none; }
[data-theme="light"] .theme-knob .sun { display: block; }
.theme-label { display: none; }
@media (max-width: 860px) {
  .site-header .nav .theme {
    justify-content: space-between; font-size: 22px; padding: 14px 0; border-bottom: 1px solid rgb(var(--ink) / 0.07);
  }
  .theme-label { display: inline; }
}
@media (prefers-reduced-motion: reduce) { .theme-knob { transition: none; } }
