/* ──────────────────────────────────────────────────────────
   Polina Virki — UI in the style of fuzzy-commit-157995.framer.app
   Light theme, bold typography, vibrant case study cards.
   ────────────────────────────────────────────────────────── */

/* ─────────── Self-hosted variable fonts ─────────── */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("assets/fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
    U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC,
    U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("assets/fonts/inter-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Oswald";
  font-style: normal;
  font-weight: 200 700;
  font-display: swap;
  src: url("assets/fonts/oswald-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
    U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC,
    U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Oswald";
  font-style: normal;
  font-weight: 200 700;
  font-display: swap;
  src: url("assets/fonts/oswald-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

:root {
  /* ─── Light theme (default) ─── */
  --bg: #ffffff;
  --bg-elev: #ffffff;
  --bg-blur: rgba(255, 255, 255, 0.94);
  --ink: #0d0d0d;
  --ink-2: #2b2b2b;
  --muted: #8a8a8a;
  --line: rgba(13, 13, 13, 0.1);
  --chip-bg: #ffffff;

  /* Background decorations */
  --dot-color: rgba(13, 13, 13, 0.04);
  --grid-line: rgba(13, 13, 13, 0.05);
  --deco-ink: rgba(13, 13, 13, 0.35);

  --green: #4ade80;
  --accent: #ff5b2c;

  /* Card palettes (shared between themes) */
  --c-blue-bg: #1f2a4d;
  --c-blue-fg: #f4f1e9;

  --c-lavender-bg: #d9d3ff;
  --c-lavender-fg: #1b1640;

  --c-amber-bg: #f4c95d;
  --c-amber-fg: #2a1f00;

  --c-sage-bg: #b8d8b8;
  --c-sage-fg: #14361a;

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --ease: cubic-bezier(0.6, 0.05, 0.1, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --pad-x: clamp(20px, 5vw, 56px);
  --max-w: 1280px;

  color-scheme: light;
}

/* ─── Dark theme ─── */
[data-theme="dark"] {
  --bg: #0b0b0c;
  --bg-elev: #161618;
  --bg-blur: rgba(11, 11, 12, 0.92);
  --ink: #f1efea;
  --ink-2: #c8c5bd;
  --muted: #7a7770;
  --line: rgba(241, 239, 234, 0.12);
  --chip-bg: #161618;

  --dot-color: rgba(241, 239, 234, 0.05);
  --grid-line: rgba(241, 239, 234, 0.06);
  --deco-ink: rgba(241, 239, 234, 0.4);

  /* Slightly lift card backgrounds for better contrast on dark */
  --c-blue-bg: #2c3a66;
  --c-blue-fg: #f4f1e9;
  --c-lavender-bg: #c5beff;
  --c-lavender-fg: #15103a;
  --c-amber-bg: #f1c252;
  --c-amber-fg: #261c00;
  --c-sage-bg: #a7ceac;
  --c-sage-fg: #0e2e15;

  color-scheme: dark;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}
html,
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition:
    background-color 0.45s var(--ease-out),
    color 0.45s var(--ease-out);
}

/* ─────────── Background dot grid ─────────── */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(
    circle,
    var(--dot-color) 1px,
    transparent 1.4px
  );
  background-size: 22px 22px;
  background-position: 0 0;
  mask-image: radial-gradient(
    ellipse at 50% 30%,
    rgba(0, 0, 0, 1) 0%,
    rgba(0, 0, 0, 0.6) 60%,
    transparent 100%
  );
  -webkit-mask-image: radial-gradient(
    ellipse at 50% 30%,
    rgba(0, 0, 0, 1) 0%,
    rgba(0, 0, 0, 0.6) 60%,
    transparent 100%
  );
  transition: background-image 0.45s var(--ease-out);
}

/* Subtle grain overlay — barely visible, but adds depth */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 220px 220px;
}
[data-theme="dark"] body::after {
  opacity: 0.05;
}

/* Make sure interactive content is above decorations */
main,
.top,
.footer {
  position: relative;
  z-index: 1;
}

/* Smooth color transition for themed surfaces — but not on first paint or animations */
html.theme-anim *,
html.theme-anim *::before,
html.theme-anim *::after {
  transition:
    background-color 0.45s var(--ease-out),
    border-color 0.45s var(--ease-out),
    color 0.45s var(--ease-out),
    fill 0.45s var(--ease-out),
    stroke 0.45s var(--ease-out);
}

body {
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}
ul,
ol {
  list-style: none;
}

::selection {
  background: var(--ink);
  color: var(--bg);
}

/* ─────────── Top bar ─────────── */
.top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px var(--pad-x);
  font-size: 14px;
  font-weight: 500;
  background: var(--bg-blur);
  border-bottom: 1px solid var(--line);
  transition:
    background-color 0.45s var(--ease-out),
    border-color 0.45s var(--ease-out);
}
.top__logo {
  font-weight: 600;
  letter-spacing: -0.005em;
}
.top__right {
  display: flex;
  align-items: center;
  gap: 24px;
}
.top__nav {
  display: flex;
  gap: 28px;
}

/* Section anchors group (index page only) */
.top__nav--sections {
  position: relative;
  padding-right: 20px;
  margin-right: 4px;
  gap: 22px;
}
.top__nav--sections::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 14px;
  background: var(--line);
  opacity: 0.7;
}
.top__nav--sections a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-soft, var(--ink));
  opacity: 0.7;
  transition:
    opacity 0.3s var(--ease-out),
    color 0.3s var(--ease-out);
}
.top__nav--sections a::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0;
  transform: scale(0.4);
  transition:
    opacity 0.3s var(--ease-out),
    transform 0.3s var(--ease-out);
}
.top__nav--sections a:hover {
  opacity: 1;
  color: var(--accent);
}
.top__nav--sections a.is-active {
  opacity: 1;
  color: var(--ink);
}
.top__nav--sections a.is-active::before {
  opacity: 1;
  transform: scale(1);
}
/* Hide the underline on section nav (we use the dot instead) */
.top__nav--sections a::after {
  display: none;
}
/* Hide section anchors on tablets and below — keep nav compact */
@media (max-width: 1024px) {
  .top__nav--sections {
    display: none;
  }
}

/* ─────────── Language toggle ─────────── */
.lang-toggle {
  appearance: none;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
  height: 36px;
  min-width: 36px;
  padding: 0 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition:
    background-color 0.3s var(--ease-out),
    border-color 0.3s var(--ease-out),
    color 0.3s var(--ease-out),
    transform 0.3s var(--ease-out);
}
.lang-toggle:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transform: scale(1.04);
}

/* Smooth content fade when switching languages */
html.lang-anim main {
  animation: lang-fade 0.5s var(--ease-out);
}
@keyframes lang-fade {
  0% {
    opacity: 0.4;
    filter: blur(2px);
  }
  100% {
    opacity: 1;
    filter: blur(0);
  }
}

/* ─────────── Theme toggle ─────────── */
.theme-toggle {
  appearance: none;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  position: relative;
  cursor: pointer;
  transition:
    background-color 0.3s var(--ease-out),
    border-color 0.3s var(--ease-out),
    color 0.3s var(--ease-out),
    transform 0.3s var(--ease-out);
}
.theme-toggle:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transform: rotate(-12deg);
}
.theme-toggle__icon {
  position: absolute;
  width: 18px;
  height: 18px;
  transition:
    opacity 0.4s var(--ease-out),
    transform 0.5s var(--ease-out);
}
.theme-toggle__icon--sun {
  opacity: 0;
  transform: rotate(-90deg) scale(0.4);
}
.theme-toggle__icon--moon {
  opacity: 1;
  transform: rotate(0) scale(1);
}
[data-theme="dark"] .theme-toggle__icon--sun {
  opacity: 1;
  transform: rotate(0) scale(1);
}
[data-theme="dark"] .theme-toggle__icon--moon {
  opacity: 0;
  transform: rotate(90deg) scale(0.4);
}

/* ─────────── Burger button (mobile only) ─────────── */
.burger {
  display: none;
  appearance: none;
  background: transparent;
  border: 1px solid var(--line);
  width: 36px;
  height: 36px;
  border-radius: 999px;
  cursor: pointer;
  position: relative;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0;
  transition:
    background-color 0.3s var(--ease-out),
    border-color 0.3s var(--ease-out);
}
.burger span {
  display: block;
  width: 16px;
  height: 1.5px;
  background: var(--ink);
  border-radius: 2px;
  transition:
    transform 0.35s var(--ease-out),
    opacity 0.25s var(--ease-out);
}
.burger.is-active span:nth-child(1) {
  transform: translateY(5.5px) rotate(45deg);
}
.burger.is-active span:nth-child(2) {
  opacity: 0;
}
.burger.is-active span:nth-child(3) {
  transform: translateY(-5.5px) rotate(-45deg);
}

/* ─────────── Mobile menu overlay ─────────── */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 49;
  background: var(--bg-blur);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 72px var(--pad-x) 0;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.35s var(--ease-out),
    visibility 0.35s var(--ease-out);
}
.mobile-menu.is-open {
  opacity: 1;
  visibility: visible;
}
.mobile-menu__nav {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.mobile-menu__nav a {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.01em;
  padding: 8px 0;
  color: var(--ink);
  transition:
    color 0.3s var(--ease-out),
    opacity 0.3s var(--ease-out);
  opacity: 0.85;
}
.mobile-menu__nav a:hover,
.mobile-menu__nav a:active {
  opacity: 1;
  color: var(--accent);
}
.mobile-menu__sep {
  width: 32px;
  height: 1px;
  background: var(--line);
  margin: 8px 0;
}
.mobile-menu__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-top: 8px;
}
.mobile-menu__actions .lang-toggle,
.mobile-menu__actions .theme-toggle {
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
}

@media (min-width: 641px) {
  .mobile-menu {
    display: none !important;
  }
}

@media (max-width: 540px) {
  .top__nav {
    gap: 18px;
  }
  .top__right {
    gap: 14px;
  }
}
.top__nav a {
  position: relative;
  padding: 4px 0;
  transition: color 0.3s var(--ease-out);
}
.top__nav a:hover {
  color: var(--accent);
}
.top__nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.5s var(--ease-out);
}
.top__nav a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* ─────────── Badge ─────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px 7px 12px;
  background: var(--chip-bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
}
.badge i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.55);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.55);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(74, 222, 128, 0);
  }
}

/* ─────────── Hero ─────────── */
.hero {
  padding: 140px var(--pad-x) 80px;
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.85fr);
  gap: 56px;
  align-items: end;
}
.hero__main {
  display: flex;
  flex-direction: column;
  gap: 28px;
  min-width: 0;
}
.hero .badge {
  align-self: flex-start;
}

/* Photo on the right side of the hero */
.hero__photo {
  position: relative;
  margin: 0;
  /* Pin to the top of the grid row so it doesn't shift vertically
     when the title text wraps differently (e.g. on lang switch). */
  align-self: start;
  width: 100%;
  max-width: 460px;
  margin-left: auto;
  border-radius: 20px;
  overflow: hidden;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  aspect-ratio: 4 / 5;
  transform: rotate(-1.2deg);
  box-shadow:
    0 30px 60px -25px rgba(0, 0, 0, 0.22),
    0 6px 14px -6px rgba(0, 0, 0, 0.1);
  z-index: 1;
}
.hero__photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero__photo figcaption {
  position: absolute;
  left: 12px;
  bottom: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(13, 13, 13, 0.78);
  color: #fff;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.005em;
  width: fit-content;
}
.hero__photo figcaption .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.55);
  animation: pulse 2.4s ease-in-out infinite;
  flex-shrink: 0;
}
[data-theme="dark"] .hero__photo {
  box-shadow:
    0 30px 60px -25px rgba(0, 0, 0, 0.6),
    0 6px 14px -6px rgba(0, 0, 0, 0.4);
}
.hero__title {
  font-family: "Oswald", sans-serif;
  font-weight: 700;
  font-size: clamp(40px, 6vw, 92px);
  line-height: 1.25;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  max-width: 16ch;
  position: relative;
  cursor: default;
}
.hero__title .glass-lens {
  position: absolute;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%);
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.15) 0%,
    rgba(255, 255, 255, 0.06) 40%,
    transparent 70%
  );
  backdrop-filter: blur(6px) brightness(1.2) saturate(1.3);
  -webkit-backdrop-filter: blur(6px) brightness(1.2) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    inset 0 0 30px rgba(255, 255, 255, 0.08),
    0 8px 32px rgba(0, 0, 0, 0.06);
  transition: opacity 0.35s var(--ease-out);
  z-index: 2;
  will-change: left, top;
}
[data-theme="dark"] .hero__title .glass-lens {
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.08) 0%,
    rgba(255, 255, 255, 0.03) 40%,
    transparent 70%
  );
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow:
    inset 0 0 30px rgba(255, 255, 255, 0.04),
    0 8px 32px rgba(0, 0, 0, 0.2);
}
.hero__sub {
  max-width: 64ch;
  font-size: clamp(16px, 1.3vw, 20px);
  line-height: 1.5;
  color: var(--ink-2);
  margin-top: 8px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
  font-size: clamp(15px, 1.1vw, 17px);
  font-weight: 500;
  color: var(--ink-2);
}
.tags__sep {
  color: var(--muted);
  font-weight: 400;
}

/* ─────────── Experience (compact list) ─────────── */
.experience {
  padding: 40px var(--pad-x) 80px;
  max-width: var(--max-w);
  margin: 0 auto;
}
.experience__list {
  margin-top: 32px;
}
.experience__list li {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(180px, 1fr) 2fr;
  gap: 14px;
  align-items: baseline;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  font-size: clamp(15px, 1.15vw, 18px);
  position: relative;
}
.experience__list li::before {
  display: none;
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.5s var(--ease-out);
}
.experience__company {
  font-weight: 600;
}
.experience__date {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.experience__role {
  color: var(--ink-2);
  text-align: right;
}

@media (max-width: 760px) {
  .experience__list li {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "company date"
      "role role";
    gap: 4px 12px;
  }
  .experience__company {
    grid-area: company;
  }
  .experience__date {
    grid-area: date;
    text-align: right;
  }
  .experience__role {
    grid-area: role;
    text-align: left;
    color: var(--muted);
    font-size: 14px;
  }
}

/* ─────────── Works / cards ─────────── */
.works {
  padding: 88px var(--pad-x) 80px;
  max-width: var(--max-w);
  margin: 0 auto;
}
.works__list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.card {
  border-radius: 24px;
  overflow: hidden;
  position: relative;
  transform: translateZ(0);
}
.card__link {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
  padding: 36px;
  min-height: 460px;
  position: relative;
}
.card__link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(0, 0, 0, 0);
  transition: background 0.3s var(--ease-out);
  pointer-events: none;
  z-index: 3;
}
.card:hover .card__link::after {
  background: rgba(0, 0, 0, 0.06);
}
.card:active .card__link::after {
  background: rgba(0, 0, 0, 0.12);
}
.card__content {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  min-width: 0;
}
.card__top {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.card__title {
  font-weight: 600;
  font-size: clamp(26px, 2.7vw, 38px);
  line-height: 1.08;
  letter-spacing: -0.025em;
}
.card__desc {
  font-size: clamp(15px, 1.05vw, 16px);
  line-height: 1.5;
  opacity: 0.85;
  max-width: 38ch;
}
.card__metrics {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 24px;
  font-size: 14px;
  opacity: 0.95;
}
.card__metrics > div {
  border-left: 1px solid currentColor;
  padding-left: 14px;
}
.card__metrics > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.card__metrics strong {
  font-weight: 600;
  font-size: clamp(17px, 1.4vw, 20px);
  letter-spacing: -0.01em;
}
.card__metrics span {
  opacity: 0.7;
  font-size: 12px;
}

.card__year {
  position: absolute;
  top: 24px;
  right: 30px;
  font-size: 13px;
  font-weight: 500;
  opacity: 0.7;
  font-variant-numeric: tabular-nums;
  z-index: 2;
}

/* ─────────── Card cover image (right column) ─────────── */
.card__cover {
  position: relative;
  margin-top: 28px;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  align-self: stretch;
  isolation: isolate;
}
.card__cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

/* Dark variants of the cards (lavender/amber/sage) — invert the cover frame */
.card--lavender .card__cover,
.card--amber .card__cover,
.card--sage .card__cover {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.12);
}

/* Decorative animated visuals — kept for case-hero only.
   On home cards we now show the actual product cover instead. */

/* Card colour variants */
.card--blue {
  background: var(--c-blue-bg);
  color: var(--c-blue-fg);
}
.card--lavender {
  background: var(--c-lavender-bg);
  color: var(--c-lavender-fg);
}
.card--amber {
  background: var(--c-amber-bg);
  color: var(--c-amber-fg);
}
.card--sage {
  background: var(--c-sage-bg);
  color: var(--c-sage-fg);
}

/* Visual variants */
.visual-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 70%;
  height: 70%;
}
.visual-grid div {
  background: currentColor;
  border-radius: 6px;
  opacity: 0.85;
  animation: pop 1.6s var(--ease-out) infinite;
}
.visual-grid div:nth-child(1) {
  animation-delay: 0s;
}
.visual-grid div:nth-child(2) {
  animation-delay: 0.1s;
  opacity: 0.7;
}
.visual-grid div:nth-child(3) {
  animation-delay: 0.2s;
  opacity: 0.55;
}
.visual-grid div:nth-child(4) {
  animation-delay: 0.1s;
  opacity: 0.7;
}
.visual-grid div:nth-child(5) {
  animation-delay: 0.2s;
}
.visual-grid div:nth-child(6) {
  animation-delay: 0.3s;
  opacity: 0.7;
}
.visual-grid div:nth-child(7) {
  animation-delay: 0.2s;
  opacity: 0.55;
}
.visual-grid div:nth-child(8) {
  animation-delay: 0.3s;
  opacity: 0.7;
}
.visual-grid div:nth-child(9) {
  animation-delay: 0.4s;
  opacity: 0.85;
}
@keyframes pop {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(0.78);
  }
}

.visual-rings {
  position: relative;
  width: 70%;
  height: 70%;
  display: grid;
  place-items: center;
}
.visual-rings span {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  animation: ring 2s var(--ease-out) infinite;
  opacity: 0;
  width: 36px;
  height: 36px;
}
.visual-rings span:nth-child(1) {
  animation-delay: 0s;
}
.visual-rings span:nth-child(2) {
  animation-delay: 0.4s;
}
.visual-rings span:nth-child(3) {
  animation-delay: 0.8s;
}
.visual-rings span:nth-child(4) {
  animation-delay: 1.2s;
}
@keyframes ring {
  0% {
    transform: scale(1);
    opacity: 0.85;
  }
  100% {
    transform: scale(5);
    opacity: 0;
  }
}

.visual-wave {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 50%;
}
.visual-wave span {
  width: 6px;
  height: 100%;
  background: currentColor;
  border-radius: 3px;
  animation: wave 1.2s var(--ease-out) infinite;
}
.visual-wave span:nth-child(1) {
  animation-delay: 0s;
}
.visual-wave span:nth-child(2) {
  animation-delay: 0.05s;
}
.visual-wave span:nth-child(3) {
  animation-delay: 0.1s;
}
.visual-wave span:nth-child(4) {
  animation-delay: 0.15s;
}
.visual-wave span:nth-child(5) {
  animation-delay: 0.2s;
}
.visual-wave span:nth-child(6) {
  animation-delay: 0.25s;
}
.visual-wave span:nth-child(7) {
  animation-delay: 0.3s;
}
.visual-wave span:nth-child(8) {
  animation-delay: 0.35s;
}
.visual-wave span:nth-child(9) {
  animation-delay: 0.4s;
}
.visual-wave span:nth-child(10) {
  animation-delay: 0.45s;
}
.visual-wave span:nth-child(11) {
  animation-delay: 0.5s;
}
.visual-wave span:nth-child(12) {
  animation-delay: 0.55s;
}
@keyframes wave {
  0%,
  100% {
    transform: scaleY(0.3);
  }
  50% {
    transform: scaleY(1);
  }
}

.visual-stack {
  position: relative;
  width: 60%;
  height: 70%;
}
.visual-stack span {
  position: absolute;
  inset: 0;
  background: currentColor;
  border-radius: 8px;
  opacity: 0.85;
  animation: stack 2.4s var(--ease-out) infinite;
}
.visual-stack span:nth-child(2) {
  animation-delay: 0.4s;
  opacity: 0.6;
}
.visual-stack span:nth-child(3) {
  animation-delay: 0.8s;
  opacity: 0.4;
}
@keyframes stack {
  0% {
    transform: translateY(0) scale(1);
    opacity: 0;
  }
  20% {
    opacity: 0.85;
  }
  100% {
    transform: translateY(-30px) scale(0.95);
    opacity: 0;
  }
}

@media (max-width: 760px) {
  .card__link {
    grid-template-columns: 1fr;
    padding: 24px;
    min-height: 0;
    gap: 24px;
  }
  .card__content {
    gap: 22px;
  }
  .card__metrics {
    border-top: 1px solid currentColor;
    padding-top: 18px;
    flex-direction: column;
    gap: 16px;
  }
  .card__metrics > div {
    border-left: none;
    padding-left: 0;
  }
  .card__cover {
    order: -1;
    aspect-ratio: 16 / 10;
  }
  .card__cover img {
    height: 100%;
  }
  .card__visual {
    display: none;
  }
}

/* ─────────── About ─────────── */
.about {
  padding: 100px var(--pad-x) 80px;
  max-width: var(--max-w);
  margin: 0 auto;
}
.about__title {
  font-weight: 600;
  font-size: clamp(34px, 4.6vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  max-width: 22ch;
  margin-bottom: 40px;
}
.about__copy {
  display: flex;
  flex-direction: column;
  gap: 18px;
  font-size: clamp(16px, 1.25vw, 20px);
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 60ch;
  margin-bottom: 40px;
}
.about__bullets {
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: clamp(18px, 1.7vw, 26px);
  font-weight: 500;
  letter-spacing: -0.015em;
}
.about__bullets li {
  position: relative;
  display: inline-block;
  width: fit-content;
  padding: 4px 0;
}

/* ─────────── Skills + Tools (chips) ─────────── */
.meta {
  padding: 60px var(--pad-x) 80px;
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px 56px;
}
.meta > .section-index {
  grid-column: 1 / -1;
}
.meta__label {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 18px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chips li {
  font-size: 14px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  background: var(--chip-bg);
  color: var(--ink);
  border-radius: 999px;
}

@media (max-width: 760px) {
  .meta {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

/* ─────────── CTA ─────────── */
.cta {
  padding: 120px var(--pad-x);
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: flex-start;
}
.cta__title {
  font-weight: 600;
  font-size: clamp(40px, 6.4vw, 96px);
  line-height: 1.02;
  letter-spacing: -0.04em;
  max-width: 14ch;
}
.cta__sub {
  font-size: clamp(16px, 1.3vw, 20px);
  color: var(--ink-2);
  max-width: 50ch;
}
.cta__channels {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cta__channels a {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  font-size: clamp(28px, 3.4vw, 44px);
  font-weight: 600;
  letter-spacing: -0.025em;
  padding: 6px 0;
  position: relative;
  transition: color 0.3s var(--ease-out);
}
.cta__channels a i {
  font-style: normal;
  opacity: 0.4;
  transition:
    transform 0.5s var(--ease-out),
    opacity 0.3s var(--ease-out);
}
.cta__channels a:hover {
  color: var(--accent);
}
.cta__channels a:hover i {
  transform: translate(6px, -6px);
  opacity: 1;
}
.top__email,
.cta__email {
  position: relative;
}
.top__email .copied {
  right: auto;
  left: 50%;
  top: auto;
  bottom: -32px;
  transform: translateX(-50%) scale(0.9);
}
.top__email .copied.is-visible {
  transform: translateX(-50%) scale(1);
}
.copied {
  position: absolute;
  right: -84px;
  top: 50%;
  transform: translateY(-50%) scale(0.9);
  background: var(--ink);
  color: var(--bg);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  padding: 6px 12px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.3s var(--ease-out),
    transform 0.3s var(--ease-out);
}
.copied.is-visible {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}

.cta__location {
  margin-top: 32px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--muted);
}
.cta__location .dot {
  width: 8px;
  height: 8px;
  background: var(--green);
  border-radius: 50%;
}

/* ─────────── Footer ─────────── */
.footer {
  padding: 24px var(--pad-x) 32px;
  font-size: 13px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
.footer a {
  color: var(--ink-2);
  transition: color 0.3s var(--ease-out);
}
.footer a:hover {
  color: var(--accent);
}

/* ──────────────────────────────────────────────────────────
   Case study pages
   ────────────────────────────────────────────────────────── */

.case-page main {
  padding-top: 80px;
}


.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 12px var(--pad-x) 0;
  padding: 10px 16px 10px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  background: var(--chip-bg);
  color: var(--ink-2);
  transition:
    background 0.3s var(--ease-out),
    color 0.3s var(--ease-out),
    border-color 0.3s var(--ease-out),
    gap 0.3s var(--ease-out);
}
.back-link span {
  display: inline-block;
  transition: transform 0.4s var(--ease-out);
}
.back-link:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.back-link:hover span {
  transform: translateX(-4px);
}

/* ─────────── Case hero (themed coloured banner) ─────────── */
.case-hero {
  margin: 24px var(--pad-x) 0;
  border-radius: 28px;
  padding: clamp(32px, 4.5vw, 64px) clamp(28px, 5vw, 64px);
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.case-hero__inner {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 26ch;
}

/* Hero with cover image next to title — 2 column layout */
.case-hero--with-cover {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
}
.case-hero--with-cover .case-hero__inner {
  max-width: 30ch;
}
.case-hero__cover {
  position: relative;
  margin: 0;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.06);
  aspect-ratio: 16 / 10;
  width: 100%;
  align-self: center;
  box-shadow:
    0 24px 50px -25px rgba(0, 0, 0, 0.25),
    0 4px 12px -4px rgba(0, 0, 0, 0.1);
}
.case-hero__cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}
[data-theme="dark"] .case-hero__cover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow:
    0 24px 50px -25px rgba(0, 0, 0, 0.6),
    0 4px 12px -4px rgba(0, 0, 0, 0.3);
}
@media (max-width: 900px) {
  .case-hero--with-cover {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .case-hero__cover {
    aspect-ratio: 16 / 10;
    max-width: 480px;
    margin-inline: auto;
  }
}
.case-hero__index {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  opacity: 0.7;
}
.case-hero__title {
  font-weight: 600;
  font-size: clamp(28px, 4.5vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.03em;
}
.case-hero__sub {
  font-size: clamp(14px, 1.1vw, 17px);
  line-height: 1.5;
  opacity: 0.85;
  max-width: 50ch;
}
.case-hero__visual {
  position: absolute;
  right: -60px;
  bottom: -60px;
  width: 320px;
  height: 320px;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0.22;
  z-index: -1;
}

/* ─────────── Meta strip ─────────── */
.case-meta {
  max-width: var(--max-w);
  margin: 36px auto 0;
  padding: 24px var(--pad-x);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.case-meta div {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.case-meta span {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}
.case-meta strong {
  font-weight: 600;
  font-size: clamp(16px, 1.3vw, 19px);
  letter-spacing: -0.005em;
}

/* ─────────── Case content blocks ─────────── */
.case-block {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 64px var(--pad-x);
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(0, 1fr);
  gap: clamp(28px, 6vw, 80px);
  border-bottom: 1px solid var(--line);
}
.case-block__title {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
  position: sticky;
  top: 100px;
  align-self: start;
  height: fit-content;
}
.case-block__body {
  display: flex;
  flex-direction: column;
  gap: 18px;
  font-size: clamp(17px, 1.35vw, 22px);
  line-height: 1.5;
  color: var(--ink);
  max-width: 64ch;
  letter-spacing: -0.005em;
}
.case-block__body p {
  color: var(--ink-2);
}
.case-block__body p:first-of-type {
  color: var(--ink);
}
.case-block__body strong {
  color: var(--ink);
}

.dash-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 6px 0;
}
.dash-list li {
  display: flex;
  align-items: baseline;
  gap: 14px;
  color: var(--ink-2);
  font-size: clamp(16px, 1.25vw, 20px);
}
.dash-list li::before {
  content: "—";
  color: var(--muted);
  flex-shrink: 0;
}

/* ─────────── Project cover (full-width banner under case-hero) ─────────── */
.case-cover {
  max-width: var(--max-w);
  margin: 24px auto 0;
  margin-left: max(var(--pad-x), calc((100% - var(--max-w)) / 2));
  margin-right: max(var(--pad-x), calc((100% - var(--max-w)) / 2));
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  position: relative;
  isolation: isolate;
}
.case-cover img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 460px;
  object-fit: cover;
  object-position: center;
}

@media (max-width: 1024px) {
  .case-cover img {
    max-height: 360px;
  }
}
@media (max-width: 760px) {
  .case-cover {
    border-radius: 16px;
    margin: 16px var(--pad-x) 0;
  }
  .case-cover img {
    max-height: 240px;
  }
}
@media (max-width: 480px) {
  .case-cover img {
    max-height: 200px;
  }
}

/* ─────────── Visuals / screens ─────────── */
.case-visuals {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 64px var(--pad-x) 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.case-visuals .case-block__title {
  position: static;
  margin-bottom: 12px;
}

.case-figure {
  position: relative;
  margin: 0;
  border-radius: 18px;
  overflow: hidden;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  isolation: isolate;
}
.case-figure img,
.case-figure video {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  transition: transform 0.8s var(--ease-out);
}
.case-figure figcaption {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 16px 20px 18px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.case-figure figcaption .num {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--muted);
  flex-shrink: 0;
}

.case-figure--hero img {
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.case-figure--video video {
  display: block;
  width: 100%;
}

.case-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-top: 12px;
}
.case-grid--2col {
  grid-template-columns: repeat(2, 1fr);
}
.case-grid--2col .case-figure img {
  max-height: 70vh;
  object-fit: contain;
}
.case-figure--wide {
  grid-column: 1 / -1;
}

@media (max-width: 760px) {
  .case-visuals {
    padding: 48px var(--pad-x) 16px;
    gap: 18px;
  }
  .case-grid {
    gap: 18px;
  }
  .case-grid--2col {
    grid-template-columns: 1fr;
  }
  .case-figure {
    border-radius: 14px;
  }
  .case-figure figcaption {
    padding: 12px 16px 14px;
    font-size: 12px;
    gap: 10px;
  }
}

/* ─────────── Results grid ─────────── */
.case-results {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 80px var(--pad-x);
}
.case-results .case-block__title {
  position: static;
  margin-bottom: 32px;
}
.case-results__list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.case-results__list li {
  padding: 32px 28px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 200px;
}
.case-results__list li::after {
  display: none;
}
.case-results__list .num {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.case-results__list p {
  font-size: clamp(17px, 1.5vw, 24px);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.case-results__list p strong {
  font-weight: 700;
}

/* ─────────── Prev / Next ─────────── */
.case-nav {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 40px var(--pad-x) 80px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  border-top: 1px solid var(--line);
}
.case-nav__item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px 0;
  transition: color 0.3s var(--ease-out);
}
.case-nav__next {
  text-align: right;
  align-items: flex-end;
}
.case-nav__item .caption {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}
.case-nav__item strong {
  font-size: clamp(20px, 2.4vw, 30px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.case-nav__item:hover {
  color: var(--accent);
}

/* ──────────────────────────────────────────────────────────
   Mobile optimisations
   ────────────────────────────────────────────────────────── */

/* ─── Tablet & below (≤900px) ─── */
@media (max-width: 900px) {
  .case-block {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 48px var(--pad-x);
  }
  .case-block__title {
    position: static;
    margin-bottom: 4px;
  }
  .case-results__list {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Hero switches to single column earlier to avoid cramped title */
  .hero {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .hero__photo {
    max-width: 320px;
    align-self: center;
    margin-inline: auto;
    aspect-ratio: 4 / 5;
  }
}

/* ─── Mobile (≤640px) ─── */
@media (max-width: 640px) {
  :root {
    --pad-x: 18px;
  }

  /* ─── Top bar ─── */
  .top {
    padding: 12px var(--pad-x);
    font-size: 13px;
  }
  .top__logo {
    font-size: 14px;
  }
  .top__nav--links {
    display: none;
  }
  .top__right {
    gap: 12px;
  }
  .burger {
    display: flex;
  }
  .lang-toggle {
    display: none;
  }
  .theme-toggle {
    display: none;
  }

  /* ─── Hero ─── */
  .hero {
    padding: 80px var(--pad-x) 40px;
    gap: 24px;
    grid-template-columns: 1fr;
    align-items: start;
  }
  .hero__main {
    gap: 18px;
  }
  .hero__photo {
    aspect-ratio: 4 / 5;
    width: 100%;
    max-width: 280px;
    align-self: center;
    margin-inline: auto;
    order: -1;
    transform: rotate(-1deg);
    border-radius: 16px;
  }
  .hero__photo figcaption {
    font-size: 11px;
    padding: 6px 12px;
    bottom: 10px;
    left: 10px;
    right: 10px;
  }
  .hero__title {
    font-size: clamp(32px, 10vw, 48px);
    letter-spacing: -0.02em;
    max-width: 100%;
  }
  .hero__sub {
    font-size: 15px;
    max-width: 100%;
  }
  .tags {
    gap: 8px;
    font-size: 14px;
  }
  .badge {
    font-size: 12px;
    padding: 6px 12px 6px 10px;
  }

  /* ─── Experience ─── */
  .experience {
    padding: 16px var(--pad-x) 40px;
  }
  .experience__list {
    margin-top: 16px;
  }
  .experience__list li {
    padding: 12px 0;
    font-size: 14px;
  }

  /* ─── Cards ─── */
  .works {
    padding: 16px var(--pad-x) 40px;
  }
  .works__list {
    gap: 14px;
  }
  .card {
    border-radius: 18px;
  }
  .card__link {
    padding: 28px 22px 24px;
    gap: 22px;
  }
  .card__title {
    font-size: 24px;
    letter-spacing: -0.02em;
    line-height: 1.12;
  }
  .card__desc {
    font-size: 14px;
    line-height: 1.5;
    max-width: 100%;
  }
  .card__metrics {
    gap: 16px;
    flex-direction: column;
    border-top: 1px solid currentColor;
    padding-top: 18px;
  }
  .card__metrics div {
    flex-direction: row;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
  }
  .card__metrics strong {
    font-size: 17px;
    letter-spacing: -0.005em;
  }
  .card__metrics span {
    font-size: 12px;
  }
  .card__year {
    top: 18px;
    right: 18px;
    font-size: 12px;
  }
  .card__cover {
    aspect-ratio: 16 / 11;
    border-radius: 10px;
  }

  /* ─── About ─── */
  .about {
    padding: 40px var(--pad-x);
  }
  .about__title {
    font-size: clamp(24px, 7vw, 36px);
    margin-bottom: 20px;
    max-width: 100%;
    overflow-wrap: break-word;
  }
  .about__copy {
    font-size: 15px;
    margin-bottom: 20px;
  }
  .about__bullets {
    gap: 10px;
    font-size: 16px;
    letter-spacing: -0.01em;
  }

  /* ─── Skills + Tools ─── */
  .meta {
    padding: 32px var(--pad-x) 40px;
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .meta__label {
    font-size: 14px;
    margin-bottom: 12px;
  }
  .chips li {
    font-size: 13px;
    padding: 8px 12px;
  }

  /* ─── CTA ─── */
  .cta {
    padding: 40px var(--pad-x) 56px;
    gap: 16px;
  }
  .cta__title {
    font-size: clamp(28px, 9vw, 44px);
    max-width: 100%;
    letter-spacing: -0.035em;
  }
  .cta__sub {
    font-size: 15px;
  }
  .cta__channels {
    margin-top: 12px;
    gap: 0;
    width: 100%;
  }
  .cta__channels a {
    font-size: clamp(22px, 6.5vw, 32px);
    padding: 8px 0;
    gap: 10px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  .cta__email {
    /* email is long — let it wrap */
    flex-wrap: wrap;
    word-break: break-word;
  }
  /* Re-position the "Copied" toast above on mobile */
  .copied {
    position: absolute;
    top: -30px;
    right: 0;
    transform: scale(0.9);
  }
  .copied.is-visible {
    transform: scale(1);
  }

  /* ─── Footer ─── */
  .footer {
    padding: 18px var(--pad-x) calc(24px + env(safe-area-inset-bottom, 0px));
    flex-direction: row;
    align-items: center;
    font-size: 12px;
  }

  /* ─── Case study pages ─── */
  .case-page main {
    padding-top: 64px;
  }
  .back-link {
    margin: 8px var(--pad-x) 0;
    font-size: 12px;
  }
  .case-hero {
    margin: 16px var(--pad-x) 0;
    border-radius: 18px;
    padding: 28px 20px 28px;
  }
  .case-hero__title {
    font-size: clamp(24px, 7vw, 36px);
  }
  .case-hero__sub {
    font-size: 13px;
  }
  .case-hero__cover {
    aspect-ratio: 16 / 10;
    border-radius: 10px;
  }
  .case-hero__visual {
    width: 220px;
    height: 220px;
    right: -50px;
    bottom: -50px;
    opacity: 0.18;
  }
  .case-meta {
    margin-top: 24px;
    padding: 18px var(--pad-x);
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .case-meta div {
    flex-direction: row;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
  }
  .case-meta span {
    font-size: 11px;
  }
  .case-meta strong {
    font-size: 15px;
    text-align: right;
  }
  .case-block {
    padding: 36px var(--pad-x);
  }
  .case-block__body {
    font-size: 16px;
    gap: 14px;
  }
  .dash-list li {
    font-size: 15px;
  }
  .case-results {
    padding: 48px var(--pad-x) 56px;
  }
  .case-results .case-block__title {
    margin-bottom: 20px;
  }
  .case-results__list {
    grid-template-columns: 1fr;
    border-left: none;
    border-top: 1px solid var(--line);
  }
  .case-results__list li {
    padding: 22px 0;
    min-height: 0;
    border-right: none;
    gap: 10px;
  }
  .case-results__list p {
    font-size: 17px;
  }
  .case-nav {
    grid-template-columns: 1fr;
    padding: 24px var(--pad-x) 56px;
    gap: 0;
  }
  .case-nav__item {
    padding: 18px 0;
    border-bottom: 1px solid var(--line);
  }
  .case-nav__item:last-child {
    border-bottom: none;
  }
  .case-nav__next {
    text-align: left;
    align-items: flex-start;
  }
  .case-nav__item strong {
    font-size: 18px;
  }
}

/* ─── Very narrow phones (≤380px) ─── */
@media (max-width: 380px) {
  .top__logo {
    font-size: 13px;
  }
  .hero__title {
    font-size: clamp(30px, 11vw, 42px);
  }
  .cta__channels a {
    font-size: 24px;
  }
  .card__metrics strong {
    font-size: 16px;
  }
}

/* ─── Touch devices: disable hover-only interactions that feel weird on tap ─── */
@media (hover: none) {
  .card:hover .card__link::after {
    background: transparent;
  }
  .cta__channels a:hover {
    color: inherit;
  }
  .cta__channels a:hover i {
    transform: none;
    opacity: 0.4;
  }
}

/* ──────────────────────────────────────────────────────────
   Designer-flavoured graphic accents
   (Figma-style frame crosses, asterisks, floating badges)
   ────────────────────────────────────────────────────────── */

/* ─── Frame crosses (4 corners around a region) ─── */
.frame {
  position: relative;
}
.frame > .frame__cross {
  position: absolute;
  width: 18px;
  height: 18px;
  color: var(--deco-ink);
  pointer-events: none;
  z-index: 0;
}
.frame > .frame__cross::before,
.frame > .frame__cross::after {
  content: "";
  position: absolute;
  background: currentColor;
}
.frame > .frame__cross::before {
  left: 50%;
  top: 0;
  width: 1px;
  height: 100%;
  transform: translateX(-50%);
}
.frame > .frame__cross::after {
  top: 50%;
  left: 0;
  height: 1px;
  width: 100%;
  transform: translateY(-50%);
}
.frame > .frame__cross--tl {
  top: -9px;
  left: -9px;
}
.frame > .frame__cross--tr {
  top: -9px;
  right: -9px;
}
.frame > .frame__cross--bl {
  bottom: -9px;
  left: -9px;
}
.frame > .frame__cross--br {
  bottom: -9px;
  right: -9px;
}

/* ─── Asterisk decorations (★ / ✦) ─── */
.deco-aster {
  display: inline-block;
  color: var(--accent);
  font-style: normal;
  font-size: 0.8em;
  margin: 0 0.35em;
  vertical-align: 0.15em;
  animation: spin 12s linear infinite;
}
.deco-aster--lg {
  font-size: clamp(28px, 3.5vw, 56px);
  margin: 0;
  vertical-align: middle;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Floating asterisk anchored to a section */
.deco-float {
  position: absolute;
  color: var(--accent);
  font-size: 28px;
  pointer-events: none;
  opacity: 0.85;
  animation: spin 14s linear infinite;
  z-index: 0;
}

/* ─── Section index annotation ─── */
.section-index {
  display: block;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 32px;
  position: relative;
  z-index: 1;
}

/* ─── Floating sticky badge (bottom-right corner) ─── */
.float-badge {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px 9px 12px;
  background: var(--chip-bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.06),
    0 1px 2px rgba(0, 0, 0, 0.04);
  /* backdrop-filter removed for scroll perf */
  transition:
    transform 0.4s var(--ease-out),
    opacity 0.4s var(--ease-out),
    background 0.3s var(--ease-out),
    color 0.3s var(--ease-out),
    border-color 0.3s var(--ease-out);
}
.float-badge:hover {
  transform: translateY(-2px);
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.float-badge.is-copied {
  background: var(--green);
  color: #06210e;
  border-color: var(--green);
  transform: translateY(-2px);
}
.float-badge .v {
  font-variant-numeric: tabular-nums;
  opacity: 0.65;
}
.float-badge .sep {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.4;
}
[data-theme="dark"] .float-badge {
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.4),
    0 1px 2px rgba(0, 0, 0, 0.3);
}

@media (max-width: 640px) {
  .float-badge {
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    right: 14px;
    padding: 8px 12px 8px 10px;
    font-size: 11px;
  }
  .deco-float {
    font-size: 22px;
  }
  .frame > .frame__cross {
    display: none;
  }
  .section-index {
    font-size: 11px;
    margin-bottom: 16px;
  }
}

/* ──────────────────────────────────────────────────────────
   Hero gradient orbs
   ────────────────────────────────────────────────────────── */
.hero-orbs {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
  mask-image: linear-gradient(to bottom, black 0%, black 60%, transparent 100%);
  -webkit-mask-image: linear-gradient(
    to bottom,
    black 0%,
    black 60%,
    transparent 100%
  );
}
.hero-orbs__blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.18;
  will-change: transform;
}
.hero-orbs__blob--1 {
  display: none;
}
.hero-orbs__blob--2 {
  display: none;
}
.hero-orbs__blob--3 {
  width: 350px;
  height: 350px;
  background: var(--green);
  bottom: -15%;
  left: 35%;
  animation: orb-drift-3 20s ease-in-out infinite alternate;
}
[data-theme="dark"] .hero-orbs__blob {
  opacity: 0.12;
}
@keyframes orb-drift-1 {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(80px, 60px) scale(1.15);
  }
}
@keyframes orb-drift-2 {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(-60px, 40px) scale(1.1);
  }
}
@keyframes orb-drift-3 {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(50px, -40px) scale(1.2);
  }
}
@media (max-width: 640px) {
  .hero-orbs__blob {
    filter: blur(60px);
  }
  .hero-orbs__blob--1 {
    width: 280px;
    height: 280px;
  }
  .hero-orbs__blob--2 {
    width: 220px;
    height: 220px;
  }
  .hero-orbs__blob--3 {
    width: 200px;
    height: 200px;
  }
}

/* ──────────────────────────────────────────────────────────
   Reduced motion
   ────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
