/* ═══ Base (formerly common.css) ═══ */
/* -----------------------------------------------------------------
   Common resets, tokens and utility rules shared by every phase.
   ----------------------------------------------------------------- */

:root {
  --site-blue: #2238c7;
  --site-blue-rgb: 34, 56, 199;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  margin: 0;
  padding: 0;
  min-height: 100%;
  /* Bottom-right glow always visible behind everything */
  background:
    radial-gradient(70vw 70vw at 100% 100%, rgba(var(--site-blue-rgb), 0.18) 0%, rgba(var(--site-blue-rgb), 0.06) 28%, transparent 52%),
    #000000;
  background-attachment: fixed;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: transparent;
  color: #f5f5f5;
  font-family: "Cabinet Grotesk", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection {
  background: rgba(var(--site-blue-rgb), 0.34);
  color: #ffffff;
}

html {
  scrollbar-color: var(--site-blue) rgba(var(--site-blue-rgb), 0.12);
  scrollbar-width: thin;
}

html[data-theme="light"] {
  scrollbar-color: var(--site-blue) rgba(0, 0, 0, 0.12);
}

::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: rgba(var(--site-blue-rgb), 0.10);
}

html[data-theme="light"]::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.10);
}

::-webkit-scrollbar-thumb {
  background:
    linear-gradient(180deg, rgba(var(--site-blue-rgb), 0.82), var(--site-blue));
  border: 3px solid transparent;
  border-radius: 999px;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background:
    linear-gradient(180deg, rgba(var(--site-blue-rgb), 0.94), var(--site-blue));
  background-clip: content-box;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

button {
  font-family: inherit;
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

/* Screen-reader only */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Respect user motion preferences */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}


/* ═══ Site (formerly modern.css) ═══ */
/* =================================================================
   Modern 2026 — Light/Dark Theme Support
   ================================================================= */

/* ── ROOT THEME TOKENS ────────────────────────────────────────────── */
:root {
  --theme-transition: background 0.5s ease, color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
  --max: 1200px;
  --content-pad: clamp(20px, 5vw, 48px);
  --hd-h: 72px;
  --mhd-blur-h: 160px;
  --mhd-blur-offset: -24px;
  /* Theme toggle, CV, and subpage Back — same outer size (incl. border) */
  --mhd-control-size: 36px;
}

/* Kill the base section’s dark corner glow on light theme */
html[data-theme="light"] {
  background: #ffffff;
  background-image: none;
}

/* ── DARK THEME (default) ────────────────────────────────────────── */
[data-theme="dark"] {
  --bg:        #000000;
  --bg-1:      #0a0a0a;
  --bg-2:      #111111;
  --fg:        #ffffff;
  --fg-1:      #ffffff;
  --fg-2:      rgba(255,255,255,0.68);
  --fg-3:      rgba(255,255,255,0.62);
  --border:    rgba(255,255,255,0.08);
  --line:      rgba(255,255,255,0.08);
  --line-hi:   rgba(255,255,255,0.16);
  --accent:    var(--site-blue);
  --sphere-color: rgba(220,235,255,1);
  --sphere-glow: rgba(180,210,255,0.65);
  --logo-filter: invert(1);
  --btn-glow-bg: radial-gradient(circle at 50% -20%, rgba(var(--site-blue-rgb), 0.78), var(--site-blue) 74%);
  --btn-glow-shadow: rgba(31, 60, 255, 0.32);
  --card-bg: transparent;
  --hero-gradient: linear-gradient(160deg, #fff 0%, rgba(255,255,255,0.82) 60%, rgba(180,200,255,0.78) 100%);
  --photo-overlay: rgba(0,0,0,0.2);
  --cursor-glow: rgba(255, 255, 255, 0.055);
}

/* ── LIGHT THEME ─────────────────────────────────────────────────── */
[data-theme="light"] {
  --bg:        #ffffff;
  --bg-1:      #f8f8f8;
  --bg-2:      #f0f0f0;
  --fg:        #0a0a0a;
  --fg-1:      #0a0a0a;
  --fg-2:      rgba(10,10,10,0.68);
  --fg-3:      rgba(10,10,10,0.62);
  --border:    rgba(0,0,0,0.08);
  --line:      rgba(0,0,0,0.08);
  --line-hi:   rgba(0,0,0,0.16);
  --accent:    var(--site-blue);
  /* Hero sphere: same icy white as dark — reads on black tee (alex-light.jpg) */
  --sphere-color: rgba(220,235,255,1);
  --sphere-glow: rgba(180,210,255,0.65);
  --logo-filter: invert(0);
  --btn-glow-bg: radial-gradient(circle at 50% -20%, rgba(var(--site-blue-rgb), 0.78), var(--site-blue) 74%);
  --btn-glow-shadow: rgba(31, 60, 255, 0.25);
  --card-bg: rgba(0,0,0,0.02);
  --hero-gradient: linear-gradient(160deg, #0a0a0a 0%, rgba(30,30,50,0.85) 60%, rgba(50,70,140,0.8) 100%);
  --photo-overlay: rgba(255,255,255,0.1);
  --cursor-glow: rgba(30, 30, 60, 0.04);
}

/* ── Body theme transition ───────────────────────────────────────── */
[data-theme] body {
  background: var(--bg);
  transition: var(--theme-transition);
}

/* ── TOKENS ──────────────────────────────────────────────────────── */
.modern {
  background: transparent;
  color: var(--fg);
  font-family: "Cabinet Grotesk", system-ui, sans-serif;
  min-height: 100vh;
  transition: var(--theme-transition);
}

.modern::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 60;
  opacity: 0;
  background: radial-gradient(
    280px circle at var(--cursor-x, -999px) var(--cursor-y, -999px),
    var(--cursor-glow),
    transparent 70%
  );
  transition: opacity 0.18s ease;
}

@media (min-width: 768px) and (hover: hover) and (pointer: fine) {
  .modern.has-cursor-glow::after {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .modern::after {
    transition: none;
  }
}

.modern *:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ── HEADER ──────────────────────────────────────────────────────── */

.mhd {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 80;
  width: 100%;
  height: var(--hd-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 0 var(--content-pad);
  background: transparent;
  border: none;
  box-shadow: none;
  isolation: isolate;
}

/* Frosted header — single backdrop layer + gradient mask (factory.ai pattern). */
.mhd__backdrop {
  pointer-events: none;
  position: absolute;
  left: 0;
  right: 0;
  top: var(--mhd-blur-offset);
  z-index: 0;
  height: var(--mhd-blur-h);
  transform: translateZ(0);
  backdrop-filter: blur(64px) saturate(150%);
  -webkit-backdrop-filter: blur(64px) saturate(150%);
  -webkit-mask-image: linear-gradient(
    to bottom,
    #000 0%,
    #000 34%,
    rgba(0, 0, 0, 0.78) 52%,
    rgba(0, 0, 0, 0.42) 74%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    #000 0%,
    #000 34%,
    rgba(0, 0, 0, 0.78) 52%,
    rgba(0, 0, 0, 0.42) 74%,
    transparent 100%
  );
}

.mhd__logo,
.mhd__nav,
.mhd__right,
.mhd__back {
  position: relative;
  z-index: 1;
}

@media (prefers-reduced-motion: reduce) {
  .mhd__backdrop {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }
}

.mhd__logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.mhd__logo img {
  width: 34px;
  height: 34px;
  display: block;
  filter: var(--logo-filter);
  transition: opacity 0.2s ease, filter 0.4s ease;
}
.mhd__logo:hover img { opacity: 0.65; }

/* Subpages (legal, etc.): Back + theme only */
.mhd--sub {
  justify-content: space-between;
}
.mhd__back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  border: 1px solid var(--line-hi);
  border-radius: 999px;
  box-sizing: border-box;
  min-height: var(--mhd-control-size);
  padding: 0 16px;
  font-size: 14px;
  line-height: 1;
  font-weight: 500;
  color: var(--fg-2);
  transition: border-color 0.2s ease, color 0.2s ease;
}
.mhd__back:hover {
  border-color: var(--fg-3);
  color: var(--fg);
}
.mhd__back .ti {
  font-size: 15px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}

/* Skip link — first focusable, WCAG 2.4.1 */
.skip-link {
  position: fixed;
  left: 12px;
  top: 12px;
  z-index: 100002;
  padding: 10px 16px;
  border-radius: 10px;
  background: rgba(12, 12, 14, 0.96);
  color: #f4f4f5;
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  clip-path: inset(100%);
  clip: rect(0 0 0 0);
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  white-space: nowrap;
}
.skip-link:focus {
  clip-path: none;
  clip: auto;
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
[data-theme="light"] .skip-link {
  background: #fff;
  color: #111;
  border-color: rgba(0, 0, 0, 0.12);
}

/* Legal / simple inner pages (imprint, privacy) */
.sub-prose {
  max-width: 720px;
  margin: 0 auto;
  padding: calc(var(--hd-h) + clamp(32px, 5vw, 56px)) clamp(20px, 4vw, 32px) 100px;
  font-size: 16px;
  line-height: 1.75;
  color: var(--fg-2);
}
.sub-prose h1 {
  font-family: "Instrument Serif", serif;
  font-weight: 400;
  font-size: clamp(40px, 6vw, 72px);
  letter-spacing: -0.025em;
  line-height: 1.05;
  color: var(--fg);
  margin-bottom: 40px;
}
.sub-prose h2,
.sub-prose h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--fg-2);
  margin: 32px 0 8px;
  letter-spacing: 0.01em;
}
.sub-prose p,
.sub-prose ul {
  margin-bottom: 14px;
}
.sub-prose ul {
  padding-left: 20px;
}
.sub-prose li {
  margin-bottom: 4px;
}
.sub-prose a {
  color: var(--accent);
  text-underline-offset: 3px;
}
.sub-prose a:hover {
  color: var(--fg);
}

.mhd__right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* ── Theme Toggle Button ────────────────────────────────────────── */
.mhd__theme-toggle {
  position: relative;
  box-sizing: border-box;
  width: var(--mhd-control-size);
  height: var(--mhd-control-size);
  flex: 0 0 var(--mhd-control-size);
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.25s ease, background 0.25s ease, transform 0.25s ease;
  overflow: hidden;
}

.mhd__back,
.mhd__theme-toggle,
.mfooter__link,
.carousel-btn,
.lb-btn,
.btn {
  -webkit-tap-highlight-color: transparent;
}

.mhd__theme-toggle:hover {
  border-color: var(--line-hi);
  transform: scale(1.08);
}

.mhd__theme-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 16px;
  line-height: 1;
  color: var(--fg-2);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}

/* Dark theme: show moon, hide sun */
[data-theme="dark"] .mhd__theme-icon--sun {
  transform: translate(-50%, -50%) rotate(-90deg) scale(0);
  opacity: 0;
}
[data-theme="dark"] .mhd__theme-icon--moon {
  transform: translate(-50%, -50%) rotate(0) scale(1);
  opacity: 1;
}

/* Light theme: show sun, hide moon */
[data-theme="light"] .mhd__theme-icon--sun {
  transform: translate(-50%, -50%) rotate(0) scale(1);
  opacity: 1;
}
[data-theme="light"] .mhd__theme-icon--moon {
  transform: translate(-50%, -50%) rotate(90deg) scale(0);
  opacity: 0;
}

.mhd__nav {
  display: flex;
  gap: 36px;
  font-family: "Instrument Serif", serif;
  font-size: 20px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.mhd__nav a {
  text-decoration: none;
  color: var(--fg-3);
  letter-spacing: 0.01em;
  transition: color 0.15s ease;
}
.mhd__nav a:hover { color: var(--fg); }

.mhd__cv {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-sizing: border-box;
  height: var(--mhd-control-size);
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--fg-2);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  letter-spacing: 0.02em;
  line-height: 1;
  transition: border-color 0.2s ease, color 0.2s ease;
}

@media (max-width: 480px) {
  .mhd__cv { padding: 0 14px; }
}
.mhd__cv:hover {
  border-color: var(--line-hi);
  color: var(--fg);
}

/* ── Language switcher (EN / DE dropdown) ──────────────────────────── */
.mhd__lang {
  position: relative;
  flex-shrink: 0;
}

.mhd__lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-sizing: border-box;
  height: var(--mhd-control-size);
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--fg-2);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.mhd__lang-btn:hover {
  border-color: var(--line-hi);
  color: var(--fg);
}

.mhd__lang-chev {
  width: 10px;
  height: 10px;
  display: block;
  transition: transform 0.2s ease;
}
.mhd__lang.is-open .mhd__lang-chev {
  transform: rotate(180deg);
}

.mhd__lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 5;
  min-width: 64px;
  display: flex;
  flex-direction: column;
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg-1);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  opacity: 0;
  transform: translateY(-6px) scale(0.97);
  transform-origin: top right;
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
}
.mhd__lang.is-open .mhd__lang-menu {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.mhd__lang-opt {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--fg-3);
  transition: background 0.15s ease, color 0.15s ease;
}
.mhd__lang-opt:hover {
  background: var(--card-bg);
  color: var(--fg);
}
.mhd__lang-opt.is-active {
  color: var(--accent);
}

@media (max-width: 768px) {
  .mhd { padding: 0 20px; }
  .mhd__nav { display: none; }
}

/* ── BUTTONS ──────────────────────────────────────────────────────── */

.btn {
  --btn-hover-x: 0px;
  --btn-hover-y: 0px;
  --btn-press-y: 0px;
  --btn-scale: 1;
  --btn-fx-hover: 0;
  --btn-fx-x: 50%;
  --btn-fx-y: 50%;
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transform: translate(
      var(--btn-hover-x),
      calc(var(--btn-hover-y) + var(--btn-press-y))
    )
    scale(var(--btn-scale));
  transition: transform 0.18s ease, box-shadow 0.25s ease, opacity 0.15s ease, color 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.btn::before,
.btn::after {
  content: "";
  position: absolute;
  border-radius: inherit;
  pointer-events: none;
  opacity: var(--btn-fx-hover);
}

.btn::before {
  inset: -24px;
  z-index: -1;
  background: radial-gradient(
    170px circle at var(--btn-fx-x) var(--btn-fx-y),
    rgba(255, 255, 255, 0.18),
    transparent 62%
  );
  filter: blur(28px);
  transition: opacity 0.35s ease;
}

.btn::after {
  inset: -1px;
  z-index: 1;
  padding: 3px;
  background:
    radial-gradient(
      86px circle at var(--btn-fx-x) var(--btn-fx-y),
      rgba(255, 255, 255, 0.72) 0%,
      rgba(255, 255, 255, 0.36) 24%,
      rgba(220, 230, 255, 0.18) 48%,
      transparent 70%
    ),
    linear-gradient(to bottom, rgba(255,255,255,0.12), rgba(255,255,255,0.02) 36%, transparent 58%);
  mix-blend-mode: screen;
  transition: opacity 0.16s ease;
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
}

.btn:hover {
  --btn-hover-y: -1px;
  --btn-scale: 1.02;
  --btn-fx-hover: 1;
}

.btn:active {
  --btn-press-y: 3px;
  --btn-scale: 0.99;
}

/* Primary glow button */
.btn--glow {
  color: #fff;
  background-color: #2238c7;
  background-image: var(--btn-glow-bg);
  border: 2px solid rgba(255,255,255,0.18);
  outline: 0;
  outline-offset: 0;
  box-shadow:
    var(--btn-glow-shadow) 0 4px 14px,
    rgba(255, 255, 255, 0.22) 0 3px 5px inset;
  transition: var(--theme-transition), transform 0.18s ease;
}
.btn--glow:hover {
  --btn-hover-y: -2px;
  box-shadow:
    var(--btn-glow-shadow) 0 6px 20px,
    rgba(255, 255, 255, 0.28) 0 3px 5px inset;
  border-color: rgba(255,255,255,0.24);
}

.btn--ring {
  background: transparent;
  color: var(--fg-2);
  border: 2px solid var(--line);
  transition: var(--theme-transition), transform 0.18s ease;
}
.btn--ring:hover {
  border-color: var(--line-hi);
  color: var(--fg);
}

/* Shared media controls used by case-study galleries and overlays. */
.carousel-wrap {
  position: relative;
  margin: 16px 0;
}

.carousel-track {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 10px 0 16px;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.carousel-track::-webkit-scrollbar {
  height: 4px;
}

.carousel-track::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.carousel-track::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.carousel-track::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

.carousel-btn,
.lb-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #fff;
  cursor: pointer;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  z-index: 10;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 18px;
  opacity: 0;
  transform: translateY(-50%);
  transition: background 0.2s, border-color 0.2s, opacity 0.2s;
}

.carousel-wrap:hover .carousel-btn {
  opacity: 1;
}

.carousel-btn:hover {
  background: rgba(0, 0, 0, 0.8);
  border-color: rgba(255, 255, 255, 0.3);
}

.carousel-btn--prev {
  left: -12px;
}

.carousel-btn--next {
  right: -12px;
}

.carousel-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.lb-btn {
  position: fixed;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.1);
  font-size: 20px;
  transition: background 0.2s;
}

.lb-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* shared section label (no dot) */
.msec-label {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin: 0 0 14px;
}

/* ── HERO ──────────────────────────────────────────────────────────── */

.mhero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: var(--hd-h);
  min-height: 100svh;
  scroll-margin-top: var(--hd-h);
}

.mhero__fig {
  position: relative;
  margin: 0;
  width: 100%;
  max-width: 640px;
  /* Fade bottom of photo into black background */
  -webkit-mask-image: linear-gradient(to bottom, black 55%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 55%, transparent 100%);
}

.mhero__fig img {
  width: 100%;
  height: auto;
  display: block;
}

@media (max-width: 480px) {
  .mhero {
    height: 100svh;
    overflow: hidden;
  }
  .mhero__fig {
    flex: 1;
    min-height: 0;
    max-height: 52svh;
    overflow: hidden;
  }
  .mhero__fig img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
  }
  .mhero__caption {
    flex-shrink: 0;
    padding: 0 20px 20px;
    gap: 14px;
  }
  .mhero__badge {
    margin-bottom: 8px;
  }

  .mhero__sphere-wrap {
    /* Keep it present but never face-covering on small screens */
    --hero-fx-size: clamp(104px, 30vw, 160px);
  }
}

/* Between hands — particle sphere (icy white in both themes; pops on dark tee) */
.mhero__sphere-wrap {
  /* Bigger on desktop, still clamped to avoid covering the face on mobile */
  --hero-fx-size: clamp(104px, 26vw, 190px);
  position: absolute;
  left: 50%;
  top: 66%;
  width: var(--hero-fx-size);
  height: var(--hero-fx-size);
  transform: translate(-50%, -50%);
  pointer-events: none;
  cursor: default;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.mhero__sphere-wrap:hover {
  transform: translate(-50%, -50%) scale(1.12);
}

.mhero__sphere-three {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Caption below photo */
/* Glass name badge */
.mhero__badge {
  display: inline-flex;
  align-items: center;
  padding: 7px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-family: "Instrument Serif", serif;
  font-size: 15px;
  color: var(--fg-2);
  letter-spacing: 0.01em;
  margin-bottom: 16px;
  transition: var(--theme-transition);
}

.mhero__caption {
  width: 100%;
  padding: 0 clamp(20px, 5vw, 80px) clamp(60px, 8vw, 100px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 28px;
}

.mhero__title {
  margin: 0;
  padding-bottom: 10px;
  font-family: "Instrument Serif", serif;
  font-weight: 400;
  font-size: clamp(34px, 5vw, 78px);
  line-height: 1.04;
  letter-spacing: -0.025em;
  text-wrap: pretty;
  max-width: 1050px;
  background: var(--hero-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: background 0.4s ease;
}

.mhero__actions {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.mhero__select-box,
.mhero__demo-cursor {
  display: none;
}

@media (hover: hover) and (pointer: fine) {
  .mhero__actions.is-demoing .btn {
    animation: action-demo-btn 1.8s cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  .mhero__actions.is-demoing .mhero__select-box,
  .mhero__actions.is-demoing .mhero__demo-cursor {
    display: block;
  }

  .mhero__select-box {
    position: absolute;
    inset: -9px -10px;
    z-index: 3;
    pointer-events: none;
    border: 1px solid var(--accent);
    opacity: 0;
    transform: scale(0.985);
    animation: action-select-box 3.1s cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  .mhero__select-box::before,
  .mhero__select-box::after,
  .mhero__select-box span::before,
  .mhero__select-box span::after {
    content: "";
    position: absolute;
    width: 7px;
    height: 7px;
    background: var(--accent);
    border: 1px solid var(--accent);
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.75),
      0 0 10px rgba(91, 141, 239, 0.28);
  }

  .mhero__select-box::before { top: -4px; left: -4px; }
  .mhero__select-box::after { top: -4px; right: -4px; }
  .mhero__select-box span::before { bottom: -4px; left: -4px; }
  .mhero__select-box span::after { right: -4px; bottom: -4px; }

  .mhero__demo-cursor {
    position: absolute;
    right: -30px;
    bottom: -38px;
    z-index: 4;
    width: 18px;
    height: 18px;
    pointer-events: none;
    color: var(--accent);
    filter: drop-shadow(0 7px 12px rgba(91, 141, 239, 0.3));
    transform: translate(50px, 34px) rotate(-13deg);
    opacity: 0;
    animation: action-demo-cursor 3.1s cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  .mhero__demo-cursor svg {
    display: block;
    width: 100%;
    height: 100%;
  }
}

@keyframes action-select-box {
  0%, 14% { opacity: 0; transform: scale(0.985); }
  23%, 82% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.01); }
}

@keyframes action-demo-cursor {
  0% { opacity: 0; transform: translate(62px, 42px) rotate(-13deg); }
  14% { opacity: 1; }
  30%, 82% { opacity: 1; transform: translate(0, 0) rotate(-13deg); }
  100% { opacity: 0; transform: translate(8px, 8px) rotate(-13deg); }
}

@keyframes action-demo-btn {
  0%, 22%, 100% { filter: none; }
  38%, 68% { filter: brightness(1.04); }
}

@media (max-width: 480px) {
  .mhero__title {
    font-size: clamp(28px, 7.6vw, 44px);
    line-height: 1.06;
    letter-spacing: -0.02em;
    text-wrap: balance;
  }
}

/* ── CASE STUDIES ──────────���─────────────────────────────────────── */

.mcases {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(60px, 8vw, 120px) var(--content-pad);
  scroll-margin-top: var(--hd-h);
}

.mcases__eyebrow {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-3);
  font-weight: 400;
  margin: 0 0 32px;
}

.mcases__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

/* Three case cards: two in the first row, third left-aligned below (same width as one column). */
@media (min-width: 641px) {
  .mcases__grid .mcase:nth-child(3) {
    grid-column: 1 / 2;
  }
}

@media (max-width: 640px) {
  .mcases__grid { grid-template-columns: 1fr; }
}

.mcase__link {
  display: block;
  text-decoration: none;
  color: var(--fg);
  border-radius: 20px;
  overflow: hidden;
  background: var(--card-bg);
  border: 1px solid var(--line);
  transition: border-color 0.25s ease, transform 0.25s ease, background 0.4s ease;
}
.mcase__link:hover { border-color: var(--line-hi); transform: translateY(-4px); }

.mcase__img-wrap {
  position: relative;
  aspect-ratio: 16/10;
  overflow: hidden;
}
.mcase__img-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
  display: block;
}
.mcase__link:hover .mcase__img-wrap img { transform: scale(1.04); }

.mcase__hover-cta {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 20px;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.mcase__link:hover .mcase__hover-cta { opacity: 1; }

.mcase__body { padding: 22px 24px 28px; }

.mcase__meta {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin: 0 0 8px;
}

.mcase__title {
  margin: 0 0 10px;
  font-family: "Instrument Serif", serif;
  font-weight: 400;
  font-size: clamp(22px, 3vw, 30px);
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.mcase__desc {
  margin: 0;
  font-size: 14px;
  color: var(--fg-2);
  line-height: 1.6;
}

/* ── WHAT I DO — scroll-snap horizontal ───────────────────────────── */

.mwhat {
  padding: clamp(60px, 8vw, 120px) 0;
  scroll-margin-top: var(--hd-h);
  /* clip overflowing card diagonals without forming a scroll container */
  overflow: clip;
}

.mwhat__sticky {
  /* Fallback layout wrapper — no sticky needed in this approach */
}

.mwhat__hd {
  padding: 0 clamp(20px, 5vw, 64px);
  margin-bottom: 40px;
}

.mwhat__title {
  margin: 0;
  font-family: "Instrument Serif", serif;
  font-weight: 400;
  font-size: clamp(36px, 5vw, 72px);
  letter-spacing: -0.025em;
  line-height: 1;
  background: var(--hero-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Overflow wrapper — horizontal scroll */
.mwhat__overflow {
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 0 clamp(20px, 5vw, 64px) 32px;
  cursor: grab;
  /* Tell the browser: horizontal pan is ours, pass vertical to page scroll */
  touch-action: pan-x;
}
.mwhat__overflow:active { cursor: grabbing; }
.mwhat__overflow::-webkit-scrollbar { display: none; }

.mwhat__track {
  display: flex;
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
  width: max-content;
  align-items: flex-start;
}

.mwhat__card {
  flex: 0 0 clamp(260px, 30vw, 380px);
  scroll-snap-align: start;
  scroll-snap-stop: always;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: clamp(24px, 2.5vw, 36px) clamp(20px, 2vw, 32px);
  display: flex;
  flex-direction: column;
  gap: 18px;
  /* Diagonal via margin-top — layout-aware, never clips */
  margin-top: 0;
  /* Fly-in state */
  opacity: 0;
  transform: translateX(70px);
  transition: background 0.3s ease, border-color 0.3s ease, var(--theme-transition);
}

/* Diagonal staircase — permanent layout positions */
.mwhat__card:nth-child(1) { margin-top: 0px;   }
.mwhat__card:nth-child(2) { margin-top: 40px;  }
.mwhat__card:nth-child(3) { margin-top: 80px;  }

/* Revealed state — just fade+slide, diagonal stays via margin-top above */
.mwhat__card.is-in {
  opacity: 1;
  transform: none;
}

.mwhat__card:hover {
  border-color: var(--line-hi);
}

@media (max-width: 768px) {
  .mwhat__card {
    flex: 0 0 min(320px, 82vw);
    margin-top: 0 !important;  /* no diagonal on mobile */
  }
}

.mwhat__card-icon {
  flex-shrink: 0;
  line-height: 0;
}
.mwhat__card-icon img {
  width: 100px;
  height: 100px;
  display: block;
  object-fit: contain;
}

.mwhat__card-title {
  margin: 0;
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.mwhat__card-desc {
  margin: 0;
  font-size: 14px;
  color: var(--fg-2);
  line-height: 1.7;
}

/* Drag hint below track */
.mwhat__arrow-hint {
  display: flex;
  gap: 8px;
  margin: 18px 0 0;
  padding: 0 clamp(20px, 5vw, 64px);
  color: var(--fg-3);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  align-items: center;
}
.mwhat__arrow-hint svg { width: 14px; height: 14px; }

@media (max-width: 768px) {
  .mwhat__card { flex: 0 0 min(380px, 86vw); }
}

/* ── ABOUT ME ────────────────────────────────────────────────────── */

.mabout-sec {
  background: transparent;
  scroll-margin-top: var(--hd-h);
}

.mabout-sec__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(60px, 8vw, 120px) var(--content-pad);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}

@media (max-width: 900px) {
  .mabout-sec__inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}

.mabout-sec__title {
  margin: 0 0 24px;
  padding-bottom: 10px;
  font-family: "Instrument Serif", serif;
  font-weight: 400;
  font-size: clamp(32px, 4vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  background: var(--hero-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.mabout-sec__body {
  margin: 0 0 16px;
  font-size: clamp(15px, 1.6vw, 17px);
  color: var(--fg-2);
  line-height: 1.72;
  max-width: 56ch;
}

.mabout-sec__links {
  display: flex;
  gap: 20px;
  margin-top: 24px;
}

.mabout-sec__link {
  color: var(--fg-3);
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
  border-bottom: none;
  padding-bottom: 0;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}
[data-theme="dark"] .mabout-sec__link {
  text-decoration-color: rgba(255, 255, 255, 0.28);
}
[data-theme="light"] .mabout-sec__link {
  text-decoration-color: rgba(0, 0, 0, 0.28);
}
.mabout-sec__link:hover {
  color: var(--fg-2);
  text-decoration-color: var(--accent);
}

/* Photo carousel */
.mabout-sec__carousel-wrap {
  position: relative;
}

.mphoto-carousel {
  position: relative;
  /* No overflow:hidden here so dots are never clipped */
}

.mphoto-carousel__viewport {
  overflow: hidden;
  border-radius: 20px;
  /* allow horizontal gesture capture, vertical stays for page scroll */
  touch-action: pan-y;
}

.mphoto-carousel__track {
  display: flex;
  transition: transform 0.55s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.mphoto-carousel__slide {
  flex: 0 0 100%;
  aspect-ratio: 4/3;
  overflow: hidden;
}

.mphoto-carousel__slide img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.mphoto-carousel__dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  padding: 4px 0;   /* ensure dots never clip */
}

.mphoto-carousel__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
[data-theme="dark"] .mphoto-carousel__dot {
  background: rgba(255, 255, 255, 0.28);
}
[data-theme="dark"] .mphoto-carousel__dot.is-active {
  background: #fff;
  transform: scale(1.3);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}
[data-theme="light"] .mphoto-carousel__dot {
  background: rgba(0, 0, 0, 0.16);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}
[data-theme="light"] .mphoto-carousel__dot.is-active {
  background: var(--accent);
  transform: scale(1.35);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.12);
}

/* ── DESIGN GARDEN ──────────────────────────���────────────────────── */

.mgarden {
  scroll-margin-top: var(--hd-h);
}

.mgarden__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(60px, 8vw, 120px) var(--content-pad);
}

.mgarden__hd {
  margin-bottom: 40px;
}

.mgarden__title {
  margin: 0;
  padding-top: 0.08em;
  font-family: "Instrument Serif", serif;
  font-weight: 400;
  font-size: clamp(28px, 4vw, 52px);
  letter-spacing: -0.02em;
  line-height: 1.12;
  background: var(--hero-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── LIGHTBOX ────────────────────────────────────────────────────── */

.mlightbox {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0,0,0,0.93);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  animation: lb-in 0.22s ease;
}

[data-theme="light"] .mlightbox {
  background: rgba(255,255,255,0.95);
}

@keyframes lb-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.mlightbox[hidden] { display: none !important; }

.mlightbox__close {
  position: absolute;
  top: 24px; right: 24px;
  width: 44px; height: 44px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: #fff;
  transition: background 0.15s ease;
}
.mlightbox__close:hover { background: rgba(255,255,255,0.2); }
.mlightbox__close svg { width: 18px; height: 18px; }

[data-theme="light"] .mlightbox__close {
  background: rgba(0,0,0,0.08);
  border-color: rgba(0,0,0,0.15);
  color: #000;
}
[data-theme="light"] .mlightbox__close:hover { background: rgba(0,0,0,0.15); }

#mlightbox-img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
  pointer-events: none;
  user-select: none;
}

/* ── CONTACTS ────────────────────────────────────────────────────── */

.mcontact-sec {
  background: transparent;
  scroll-margin-top: var(--hd-h);
}

.mcontact-sec__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(80px, 10vw, 140px) var(--content-pad);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 24px;
}

.mcontact-sec__title {
  margin: 0;
  padding-bottom: 10px;
  font-family: "Instrument Serif", serif;
  font-weight: 400;
  font-size: clamp(56px, 10vw, 140px);
  line-height: 1.0;
  letter-spacing: -0.035em;
  background: var(--hero-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.mcontact-sec__sub {
  margin: -8px 0 8px;
  color: var(--fg-3);
  font-size: 16px;
}

/* Email copy button — uses the same style as "See my work" */
.mcontact-sec__email-btn {
  font-size: 14px;
  letter-spacing: 0.01em;
}
.mcontact-sec__email-btn .ti {
  font-size: 16px;
  color: inherit;
}

/* Toast */
.mcontact-sec__toast {
  display: block;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  font-size: 13px;
  color: var(--fg-2);
  letter-spacing: 0.01em;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}
.mcontact-sec__toast.is-visible {
  opacity: 1;
  transform: none;
}

/* Social icons */
.mcontact-sec__social {
  display: flex;
  gap: 16px;
  margin-top: 8px;
}

.mcontact-sec__social-link {
  width: 48px; height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--fg-3);
  text-decoration: none;
  font-size: 20px;
  transition: border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}
.mcontact-sec__social-link:hover {
  border-color: var(--line-hi);
  color: var(--fg);
  transform: translateY(-3px);
}

/* ── FOOTER WAVES ────────────────────────────────────────────────── */

/* Closing block: contacts + footer sit on top of the waves */
.mend {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.mwaves {
  --mwaves-line: rgba(255,255,255,0.3);
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 45%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 45%);
}

[data-theme="light"] .mwaves {
  --mwaves-line: rgba(10,10,10,0.26);
}

.mwaves canvas {
  position: absolute;
  display: block;
}

.mwaves canvas:not(.mwaves__word) {
  inset: 0;
  width: 100%;
  height: 100%;
}

/* The name is drawn in WebGL (warped by the waves); the DOM text only keeps the layout */
.mend__word.is-gl span {
  visibility: hidden;
}

/* Soft clearing behind the contact content so text stays readable over the lines */
.mend .mcontact-sec__inner {
  position: relative;
  padding-bottom: clamp(40px, 5vw, 72px);
}

.mend .mcontact-sec__inner::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%;
  top: 46%;
  width: min(920px, 100%);
  height: 78%;
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, var(--bg) 0%, var(--bg) 35%, transparent 100%);
  opacity: 0.82;
  transition: var(--theme-transition);
}

.mend .mfooter {
  border-top: 0;
}

.mend .mfooter__copy,
.mend .mfooter__link {
  color: var(--fg-2);
}

.mend .mfooter__link:hover { color: var(--fg); }

/* Giant name at the very bottom: foreground colour at the top of the letters,
   fading to transparent, so the lines take over in the lower half. */
.mend__word {
  position: relative;
  display: flex;
  justify-content: center;
  padding: clamp(24px, 5vw, 72px) var(--content-pad) 0;
  pointer-events: none;
  user-select: none;
}

.mend__word span {
  display: block;
  white-space: nowrap;
  font-family: "Instrument Serif", serif;
  font-weight: 400;
  font-size: var(--mend-word-size, 21vw);
  line-height: 1;
  letter-spacing: -0.035em;
  margin-bottom: -0.14em;
  background: linear-gradient(to bottom, var(--fg) 0%, transparent 92%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* Phones: stack the name, one word per line, so it stays big */
@media (max-width: 600px) {
  .mend__word {
    justify-content: flex-start;
  }
  .mend__word span {
    white-space: normal;
    width: min-content;
    line-height: 0.88;
  }
}

/* Comfortable tap area for the legal links */
.mend .mfooter__link {
  padding: 12px 6px;
  margin: -12px -6px;
}

/* ── FOOTER ──────────────────────────────────────────────────────── */

.mfooter {
  padding: 28px var(--content-pad);
  border-top: 1px solid var(--line);
}

.mfooter__inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.mfooter__copy {
  font-family: "Instrument Serif", serif;
  font-size: 15px;
  color: var(--fg-3);
}

.mfooter__links {
  margin-left: auto;
  display: flex;
  gap: 20px;
}

.mfooter__link {
  font-size: 13px;
  color: var(--fg-3);
  text-decoration: none;
  transition: color 0.15s ease;
}
.mfooter__link:hover { color: var(--fg-2); }

@media (max-width: 600px) {
  .mfooter {
    padding: 28px 20px;
  }
  .mfooter__inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
  }
  .mfooter__links {
    margin-left: 0;
    gap: 24px;
  }
}

/* ── SCROLL-REVEAL (Framer-style dissolve) ───────────────────────── */

/*
 * Framer signature: opacity + translateY share the same long ease-out,
 * blur clears slightly faster so content "comes into focus" before
 * the float fully settles — creates a cinematic materialization.
 */
.reveal {
  opacity: 0;
  transform: translateY(36px);
  filter: blur(10px);
  will-change: opacity, transform, filter;
  transition:
    opacity   1.2s cubic-bezier(0.16, 1, 0.3, 1),
    transform 1.2s cubic-bezier(0.16, 1, 0.3, 1),
    filter    0.9s cubic-bezier(0.25, 1, 0.5, 1);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
  filter: blur(0);
}

/* Heading variant — large, dramatic, unhurried */
.reveal-hd {
  opacity: 0;
  transform: translateY(52px);
  filter: blur(18px);
  will-change: opacity, transform, filter;
  transition:
    opacity   1.6s cubic-bezier(0.16, 1, 0.3, 1),
    transform 1.6s cubic-bezier(0.16, 1, 0.3, 1),
    filter    1.1s cubic-bezier(0.25, 1, 0.5, 1);
}
.reveal-hd.is-visible {
  opacity: 1;
  transform: none;
  filter: blur(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-hd {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    transition: none !important;
    will-change: auto;
  }
}

/* ── About timeline ─────────────────────────────────────────── */
.mabout-timeline {
  margin-top: 2rem;
  display: grid;
  gap: 1rem;
}
.mabout-timeline__item {
  position: relative;
  display: grid;
  grid-template-columns: 0.875rem 7rem 1fr;
  gap: 0.1rem 0.75rem;
  align-items: baseline;
  opacity: 0.72;
  transition: opacity 0.35s ease;
}
.mabout-timeline__item:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 0.3125rem;
  top: 1.05rem;
  bottom: -1.05rem;
  width: 1px;
  background: var(--fg-3);
  opacity: 0.48;
  transition: opacity 0.35s ease;
}
.mabout-timeline__item.is-filled:not(:last-child)::before {
  opacity: 0.8;
}
.mabout-timeline__item.is-filled,
.mabout-timeline__item:hover {
  opacity: 1;
}
.mabout-timeline__dot {
  position: relative;
  z-index: 1;
  grid-row: 1 / span 2;
  width: 0.625rem;
  height: 0.625rem;
  margin-top: 0.35rem;
  border-radius: 999px;
  border: 1px solid var(--fg-3);
  background:
    radial-gradient(circle at center, var(--fg) 0 48%, transparent 52%) center / 0 0 no-repeat,
    transparent;
  box-shadow: 0 0 0 4px rgba(255,255,255,0.03);
  transition: background-size 0.45s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.35s ease, box-shadow 0.35s ease;
}
[data-theme="light"] .mabout-timeline__dot {
  box-shadow: 0 0 0 4px rgba(0,0,0,0.03);
}
.mabout-timeline__item.is-filled .mabout-timeline__dot {
  border-color: var(--fg);
  background-size: 100% 100%;
  box-shadow: 0 0 0 4px rgba(255,255,255,0.10);
}
[data-theme="light"] .mabout-timeline__item.is-filled .mabout-timeline__dot {
  box-shadow: 0 0 0 4px rgba(0,0,0,0.10);
}
.mabout-timeline__year {
  font-size: 0.75rem;
  color: var(--fg-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.mabout-timeline__role {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--fg-1);
}
.mabout-timeline__note {
  grid-column: 3;
  font-size: 0.75rem;
  color: var(--fg-3);
  line-height: 1.4;
}
@media (max-width: 480px) {
  .mabout-timeline__item {
    grid-template-columns: 0.875rem 1fr;
  }
  .mabout-timeline__year,
  .mabout-timeline__role,
  .mabout-timeline__note {
    grid-column: 2;
  }
}

/* ── Design Garden — polaroid drag board ────────────────────── */
.mgarden__board {
  position: relative;
  width: 100%;
  height: 470px;
  overflow: visible;
  border-radius: 0;
  background: transparent;
  border: 0;
  touch-action: none; /* let JS handle all pointer events */
  user-select: none;
  -webkit-user-select: none;
  z-index: 2;
}

.mgarden__card {
  position: absolute;
  width: 200px;
  background: #fff;
  border-radius: 4px;
  padding: 8px;
  box-shadow:
    0 2px 4px rgba(0,0,0,0.25),
    0 8px 24px rgba(0,0,0,0.20),
    0 0 0 1px rgba(0,0,0,0.06);
  cursor: grab;
  will-change: transform;
  transition: box-shadow 0.15s ease, transform 0.05s ease;
}
.mgarden__card:active,
.mgarden__card.is-dragging {
  cursor: grabbing;
  box-shadow:
    0 8px 16px rgba(0,0,0,0.35),
    0 24px 48px rgba(0,0,0,0.28),
    0 0 0 1px rgba(0,0,0,0.08);
  z-index: 1000 !important;
  transition: box-shadow 0.1s ease;
}
.mgarden__card img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
  border-radius: 2px;
  pointer-events: none;
}

.mgarden__hint {
  font-size: 11px;
  color: var(--fg-3);
  margin-top: 6px;
  margin-bottom: 0;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Mobile: reduce board height, smaller cards */
@media (max-width: 600px) {
  .mgarden__board {
    height: 360px;
  }
  .mgarden__card {
    width: 150px;
    padding: 6px;
  }
  .mgarden__card img {
    height: 108px;
  }
}

/* Respect reduced motion — disable drag rotation flare */
@media (prefers-reduced-motion: reduce) {
  .mgarden__card {
    transition: none;
  }
}

/* ============================================================
   Preloader — orb fills the wordmark, grows, thinks, then
   scatters as the site reveals underneath.
   ============================================================ */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: var(--bg, #000);
  opacity: 1;
  /* slow, cinematic reveal of the site underneath */
  transition: opacity 1.15s ease;
  -webkit-tap-highlight-color: transparent;
}

/* Phase 4: the whole overlay fades out to uncover the site */
.preloader.is-revealing {
  opacity: 0;
  pointer-events: none;
}

.preloader__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  padding: 0 24px;
  animation: pl-rise 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.preloader__orb {
  flex: 0 0 auto;
  display: block;
}

.preloader__name {
  font-family: "Cabinet Grotesk", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-size: clamp(1.35rem, 4.5vw, 2rem);
  line-height: 1;
  color: var(--fg, #fff);
  white-space: nowrap;
  transition:
    opacity 0.5s ease,
    max-height 0.5s ease,
    margin 0.5s ease,
    transform 0.5s ease;
  max-height: 2.4em;
  overflow: hidden;
}

/* Each letter starts faint, then "fills in" to full ink left→right */
.preloader__ch {
  display: inline-block;
  white-space: pre;
  opacity: 0.14;
  color: var(--fg, #fff);
  transform: translateY(0.06em);
  transition:
    opacity 0.42s ease,
    transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.preloader.is-filling .preloader__ch {
  opacity: 1;
  transform: translateY(0);
}

.preloader__pct {
  font-family: "Cabinet Grotesk", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  color: var(--fg-3, rgba(128, 128, 128, 0.62));
  transition:
    opacity 0.45s ease,
    max-height 0.45s ease,
    transform 0.45s ease;
  max-height: 2em;
}

/* Phase 2: name + percent gracefully clear out so the orb owns the frame */
.preloader.is-growing .preloader__name,
.preloader.is-growing .preloader__pct {
  opacity: 0;
  max-height: 0;
  margin: 0;
  transform: translateY(6px);
}

@keyframes pl-rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .preloader__inner { animation: none; }
  .preloader { transition: opacity 0.4s ease; }
  .preloader__name,
  .preloader__pct { transition: opacity 0.3s ease; }
}
