/* =========================================================
   Sébastien Schneider — Personal site
   Swiss private banking aesthetic: ink navy + ivory + discreet gold
   ========================================================= */

@import url('https://api.fontshare.com/v2/css?f[]=switzer@400,500,600,700&f[]=gambarino@400&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,300;9..144,400;9..144,500&display=swap');

:root {
  /* Type scale */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.5rem + 2vw, 3.25rem);
  --text-3xl: clamp(2.5rem, 1.5rem + 3.5vw, 4.5rem);
  --text-hero: clamp(2.75rem, 1rem + 6vw, 6.5rem);

  /* Spacing */
  --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem;
  --space-4: 1rem; --space-5: 1.25rem; --space-6: 1.5rem;
  --space-8: 2rem; --space-10: 2.5rem; --space-12: 3rem;
  --space-16: 4rem; --space-20: 5rem; --space-24: 6rem;
  --space-32: 8rem;

  /* Color — Swiss banking palette */
  --ink: #0E1A2B;            /* deep navy/ink */
  --ink-2: #1A2738;
  --ink-soft: #2A3548;
  --ivory: #F5F1E8;          /* warm ivory bg */
  --ivory-2: #EFEADE;
  --paper: #FBF8F1;          /* card surface */
  --rule: #D9D1BC;           /* hairline */
  --rule-2: #C7BC9F;
  --text: #0E1A2B;
  --text-muted: #5A6373;
  --text-faint: #8A8678;
  --gold: #A4854B;           /* discreet brass */
  --gold-soft: #C9B587;
  --teal: #1F4F4A;           /* alt accent (rare) */
  --night: #0B1422;
  --night-2: #111D30;
  --glass: rgba(255,255,255,0.58);
  --glass-border: rgba(164,133,75,0.24);

  /* Radii / shadows */
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 8px;
  --shadow-sm: 0 1px 0 rgba(14,26,43,0.04);
  --shadow-md: 0 12px 32px rgba(14,26,43,0.06);

  --content-narrow: 720px;
  --content-default: 1080px;
  --content-wide: 1280px;

  --font-body: 'Switzer', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  --font-display: 'Fraunces', 'Times New Roman', Georgia, serif;

  --transition: 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* Dark mode — deep luxury navy with dynamic luminous background */
[data-theme="dark"] {
  --ivory: #050914;
  --ivory-2: #07101D;
  --paper: #0A1424;
  --rule: #1A2A42;
  --rule-2: #2B4160;
  --text: #ECE6D5;
  --text-muted: #9AA8BC;
  --text-faint: #68778E;
  --ink: #ECE6D5;
  --ink-2: #C8C0AB;
  --ink-soft: #95A0B3;
  --gold: #C9B587;
  --glass: rgba(20,32,54,0.58);
  --glass-border: rgba(201,181,135,0.22);
}

/* ========== Reset ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}
body {
  min-height: 100dvh;
  line-height: 1.6;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text);
  background-color: var(--ivory);
  background-image:
    radial-gradient(circle at 12% 8%, color-mix(in srgb, var(--gold) 12%, transparent) 0, transparent 24rem),
    radial-gradient(circle at 90% 22%, color-mix(in srgb, var(--teal) 10%, transparent) 0, transparent 28rem);
  font-feature-settings: "ss01", "cv01", "cv11";
}
body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  z-index: -1;
  pointer-events: none;
  border-radius: 999px;
  opacity: 0;
  filter: blur(10px);
  transform: translate3d(0,0,0);
}
body::before {
  width: 34rem;
  height: 34rem;
  left: -10rem;
  top: 18vh;
  background: radial-gradient(circle, rgba(201,181,135,0.18), rgba(201,181,135,0.05) 38%, transparent 72%);
}
body::after {
  width: 42rem;
  height: 42rem;
  right: -18rem;
  top: 42vh;
  background: radial-gradient(circle, rgba(45,108,125,0.22), rgba(45,108,125,0.05) 42%, transparent 72%);
}
[data-theme="dark"] body::before,
[data-theme="dark"] body::after {
  opacity: 1;
  animation: ambient-drift 18s ease-in-out infinite alternate;
}
[data-theme="dark"] body::after { animation-duration: 24s; animation-delay: -6s; }
@keyframes ambient-drift {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(5vw, -4vh, 0) scale(1.08); }
  100% { transform: translate3d(2vw, 8vh, 0) scale(0.94); }
}
img, svg, picture { display: block; max-width: 100%; height: auto; }
button { cursor: pointer; background: none; border: none; color: inherit; font: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, h5, h6 { text-wrap: balance; line-height: 1.12; letter-spacing: -0.01em; }
p { text-wrap: pretty; }

::selection { background: var(--gold-soft); color: var(--ink); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

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

/* ========== Layout primitives ========== */
.container {
  width: 100%;
  max-width: var(--content-wide);
  margin: 0 auto;
  padding-inline: clamp(var(--space-5), 5vw, var(--space-12));
}
.container--narrow { max-width: var(--content-narrow); }
.section {
  padding-block: clamp(var(--space-16), 9vw, var(--space-32));
  position: relative;
}
.section--tight { padding-block: clamp(var(--space-12), 6vw, var(--space-20)); }
.section--glass {
  border-block: 1px solid var(--rule);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--glass) 52%, transparent), color-mix(in srgb, var(--paper) 34%, transparent));
  backdrop-filter: blur(24px) saturate(145%);
  -webkit-backdrop-filter: blur(24px) saturate(145%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.28), inset 0 -1px 0 rgba(255,255,255,0.08);
}
[data-theme="dark"] .section--glass {
  background:
    radial-gradient(circle at 84% 18%, rgba(201,181,135,0.08), transparent 28rem),
    linear-gradient(135deg, rgba(12,24,42,0.68), rgba(5,9,20,0.48));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), inset 0 -1px 0 rgba(255,255,255,0.03);
}

.eyebrow {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
}
.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--gold);
  display: inline-block;
}

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

/* ========== Header / Nav ========== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--ivory) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition), background var(--transition);
}
[data-theme="dark"] .site-header {
  background: rgba(5,9,20,0.78);
  box-shadow: 0 18px 60px rgba(0,0,0,0.24);
}
.site-header.scrolled { border-bottom-color: var(--rule); }

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  padding-block: var(--space-5);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--ink);
}
.brand-mark { width: 42px; height: 26px; }
.brand:hover .brand-mark { filter: drop-shadow(0 10px 24px color-mix(in srgb, var(--gold) 25%, transparent)); }
.brand-text {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.0625rem;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.brand-text em { font-style: italic; color: var(--text-muted); }

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  list-style: none;
}
.nav-links a {
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.02em;
  position: relative;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a.active { color: var(--ink); }
.nav-links a.active::after {
  content: "";
  position: absolute;
  bottom: -6px; left: 0; right: 0;
  height: 1px;
  background: var(--gold);
}

.nav-meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.lang-toggle {
  font-size: var(--text-xs);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 10px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
}
.lang-toggle button { color: var(--text-muted); padding: 0 2px; font-weight: 500; }
.lang-toggle button.active { color: var(--ink); }
.lang-toggle span.sep { color: var(--rule-2); }

.theme-toggle {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
}
.theme-toggle:hover { color: var(--ink); border-color: var(--ink); }

.nav-toggle {
  display: none;
  width: 36px; height: 36px;
  align-items: center; justify-content: center;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
}

@media (max-width: 880px) {
  .nav-links { display: none; }
  .nav-toggle { display: inline-flex; }
  .lang-toggle { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);
    position: absolute;
    inset-inline: 0;
    top: 100%;
    background: var(--ivory);
    padding: var(--space-6) clamp(var(--space-5), 5vw, var(--space-12));
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
  }
}

/* ========== Buttons ========== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  padding: 14px 22px;
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.04em;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  white-space: nowrap;
  transition: var(--transition);
}
.btn--primary {
  background: var(--ink);
  color: var(--ivory);
}
.btn--primary:hover { background: var(--ink-2); }
.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule-2);
}
.btn--ghost:hover { border-color: var(--ink); }
.btn .arrow {
  width: 14px; height: 14px;
  transition: transform var(--transition);
}
.btn:hover .arrow { transform: translateX(3px); }

[data-theme="dark"] .btn--primary { background: var(--gold); color: #0B1422; border-color: var(--gold); }
[data-theme="dark"] .btn--primary:hover { background: var(--gold-soft); }
[data-theme="dark"] .btn--ghost { color: var(--ink); border-color: var(--rule-2); }

/* ========== HERO ========== */
.hero {
  padding-block: clamp(var(--space-20), 14vw, var(--space-32));
  border-bottom: 1px solid var(--rule);
  position: relative;
  overflow: hidden;
}
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
  z-index: -1;
}
.hero::before {
  width: 38rem;
  height: 38rem;
  right: 10vw;
  top: -18rem;
  background: radial-gradient(circle, color-mix(in srgb, var(--gold) 18%, transparent), transparent 68%);
  filter: blur(4px);
}
.hero::after {
  width: 28rem;
  height: 28rem;
  left: 42vw;
  bottom: -14rem;
  background: radial-gradient(circle, rgba(61,118,135,0.18), transparent 70%);
  filter: blur(8px);
}
[data-theme="dark"] .hero::before {
  background: radial-gradient(circle, rgba(201,181,135,0.26), rgba(201,181,135,0.06) 42%, transparent 72%);
  animation: ambient-drift 20s ease-in-out infinite alternate;
}
[data-theme="dark"] .hero::after {
  background: radial-gradient(circle, rgba(62,130,154,0.28), rgba(62,130,154,0.05) 48%, transparent 72%);
  animation: ambient-drift 26s ease-in-out infinite alternate-reverse;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-12);
  align-items: center;
}
@media (min-width: 960px) {
  .hero-grid { grid-template-columns: 1.4fr 1fr; gap: var(--space-20); }
}
.hero-eyebrow { margin-bottom: var(--space-8); }
.hero-title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: var(--text-hero);
  line-height: 0.98;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: var(--space-8);
}
.hero-title em {
  font-style: italic;
  font-weight: 400;
  color: var(--gold);
}
.hero-sub {
  font-size: var(--text-lg);
  color: var(--text-muted);
  max-width: 56ch;
  margin-bottom: var(--space-10);
  font-weight: 400;
  line-height: 1.45;
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}
.hero-visual {
  position: relative;
  display: grid;
  gap: var(--space-6);
}
.liquid-card {
  position: relative;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--glass) 78%, transparent), color-mix(in srgb, var(--paper) 52%, transparent));
  border: 1px solid var(--glass-border);
  box-shadow: 0 24px 80px rgba(14,26,43,0.10), inset 0 1px 0 rgba(255,255,255,0.45);
  backdrop-filter: blur(22px) saturate(145%);
  -webkit-backdrop-filter: blur(22px) saturate(145%);
}
[data-theme="dark"] .liquid-card {
  box-shadow: 0 24px 80px rgba(0,0,0,0.30), inset 0 1px 0 rgba(255,255,255,0.08);
}
.portrait-card {
  overflow: hidden;
  min-height: clamp(420px, 50vw, 620px);
  border-radius: 32px 6px 32px 6px;
  isolation: isolate;
  transform: translateZ(0);
}
.portrait-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(180deg, transparent 44%, rgba(11,20,34,0.46)),
    radial-gradient(circle at 25% 20%, rgba(255,255,255,0.28), transparent 26rem);
  mix-blend-mode: soft-light;
}
.portrait-img {
  width: 100%;
  height: 100%;
  min-height: inherit;
  object-fit: cover;
  object-position: center top;
  filter: saturate(0.92) contrast(1.02);
  transform: scale(1.015);
}
.portrait-glass {
  position: absolute;
  z-index: 3;
  left: var(--space-6);
  right: var(--space-6);
  bottom: var(--space-6);
  padding: var(--space-5);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 18px 4px 18px 4px;
  background: rgba(11,20,34,0.42);
  color: #F5F1E8;
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}
.portrait-glass span {
  display: block;
  font-size: var(--text-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(245,241,232,0.68);
  margin-bottom: var(--space-2);
}
.portrait-glass strong {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-lg);
  color: #F5F1E8;
}
.portrait-orb {
  position: absolute;
  z-index: 1;
  border-radius: 999px;
  filter: blur(2px);
  opacity: 0.72;
  pointer-events: none;
}
.portrait-orb--gold {
  width: 220px;
  height: 220px;
  right: -80px;
  top: 48px;
  background: radial-gradient(circle, rgba(201,181,135,0.45), transparent 68%);
}
.portrait-orb--blue {
  width: 260px;
  height: 260px;
  left: -110px;
  bottom: -70px;
  background: radial-gradient(circle, rgba(31,79,74,0.28), transparent 70%);
}
.hero-meta {
  padding: var(--space-6);
  border-radius: 22px 4px 22px 4px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6) var(--space-8);
}
.hero-meta-item .label {
  font-size: var(--text-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: var(--space-2);
}
.hero-meta-item .value {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 400;
  color: var(--ink);
  line-height: 1.2;
}

/* Hero decorative mark (right column) */
.hero-mark {
  display: none;
}
@media (min-width: 960px) {
  .hero-mark {
    display: block;
    color: var(--ink);
    opacity: 0.075;
    position: absolute;
    right: -80px;
    bottom: 6px;
    width: 620px;
    pointer-events: none;
  }
  [data-theme="dark"] .hero-mark { opacity: 0.12; color: var(--gold); }
}

/* ========== Metrics band ========== */
.metrics {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--glass) 54%, transparent), color-mix(in srgb, var(--paper) 36%, transparent));
  border-block: 1px solid var(--rule);
  padding-block: var(--space-16);
  backdrop-filter: blur(24px) saturate(145%);
  -webkit-backdrop-filter: blur(24px) saturate(145%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.24), inset 0 -1px 0 rgba(255,255,255,0.08);
}
[data-theme="dark"] .metrics,
[data-theme="dark"] .section[style*="background: var(--paper)"] {
  background:
    radial-gradient(circle at 90% 10%, rgba(201,181,135,0.08), transparent 24rem),
    linear-gradient(135deg, rgba(12,24,42,0.66), rgba(5,9,20,0.46)) !important;
}
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-8);
}
.metric {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding-right: var(--space-4);
  border-left: 1px solid var(--rule-2);
  padding-left: var(--space-5);
}
.metric .num {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-2xl);
  color: var(--ink);
  line-height: 1;
  font-variant-numeric: lining-nums tabular-nums;
}
.metric .num em { color: var(--gold); font-style: normal; }
.metric .label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-muted);
}

/* ========== Section header ========== */
.section-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
  margin-bottom: var(--space-16);
}
@media (min-width: 880px) {
  .section-head { grid-template-columns: 1fr 1.4fr; gap: var(--space-12); align-items: end; }
}
.section-title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: var(--text-2xl);
  color: var(--ink);
  letter-spacing: -0.015em;
  line-height: 1.05;
}
.section-title em { font-style: italic; color: var(--gold); font-weight: 400; }
.section-lead {
  font-size: var(--text-base);
  color: var(--text-muted);
  max-width: 60ch;
}

/* ========== Expertise ========== */
.expertise-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0;
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
}
.expertise-card {
  padding: var(--space-8) var(--space-6);
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: color-mix(in srgb, var(--ivory) 86%, transparent);
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.expertise-card:hover {
  background: var(--paper);
  transform: translateY(-4px);
  box-shadow: 0 24px 60px rgba(14,26,43,0.08);
}
.expertise-card .num {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  color: var(--gold);
  letter-spacing: 0.18em;
  margin-bottom: var(--space-4);
}
.expertise-card h3 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-base);
  color: var(--ink);
  margin-bottom: var(--space-3);
}
.expertise-card p {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.55;
}

/* ========== Experience timeline ========== */
.timeline {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}
.timeline-item {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  padding-top: var(--space-8);
  border-top: 1px solid var(--rule);
}
@media (min-width: 880px) {
  .timeline-item {
    grid-template-columns: 200px 1fr;
    gap: var(--space-12);
  }
}
.timeline-meta {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.timeline-period {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 400;
  color: var(--ink);
}
.timeline-location {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-faint);
}
.timeline-body h3 {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-1);
  color: var(--ink);
}
.timeline-body .org {
  font-size: var(--text-sm);
  color: var(--gold);
  letter-spacing: 0.02em;
  margin-bottom: var(--space-4);
  font-weight: 500;
}
.timeline-body p { color: var(--text-muted); font-size: var(--text-base); margin-bottom: var(--space-3); }
.timeline-body ul { list-style: none; margin-top: var(--space-3); }
.timeline-body li {
  font-size: var(--text-sm);
  color: var(--text-muted);
  padding-left: var(--space-5);
  position: relative;
  margin-bottom: var(--space-2);
  line-height: 1.55;
}
.timeline-body li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.7em;
  width: 10px; height: 1px;
  background: var(--gold);
}

/* ========== Projects (homepage preview) ========== */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  border-top: 1px solid var(--rule);
}
.project-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  padding-block: var(--space-8);
  border-bottom: 1px solid var(--rule);
  align-items: start;
  transition: background var(--transition);
}
.project-row:hover {
  background: color-mix(in srgb, var(--paper) 76%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
@media (min-width: 880px) {
  .project-row {
    grid-template-columns: 80px 1.2fr 1.4fr 180px;
    gap: var(--space-8);
    align-items: center;
  }
}
.project-num {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  color: var(--gold);
  letter-spacing: 0.18em;
}
.project-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-lg);
  color: var(--ink);
  line-height: 1.2;
}
.project-desc { color: var(--text-muted); font-size: var(--text-sm); line-height: 1.55; }
.project-tag {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-faint);
  text-align: left;
}
@media (min-width: 880px) {
  .project-tag { text-align: right; }
}

/* ========== Case study (projects page) ========== */
.case {
  padding-block: clamp(var(--space-16), 8vw, var(--space-24));
  border-bottom: 1px solid var(--rule);
}
.case:last-child { border-bottom: 0; }
.case-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-10);
}
@media (min-width: 880px) {
  .case-head { grid-template-columns: 80px 1fr 280px; gap: var(--space-8); align-items: baseline; }
}
.case-num {
  font-family: var(--font-display);
  font-size: var(--text-base);
  color: var(--gold);
  letter-spacing: 0.16em;
}
.case-title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: var(--text-xl);
  color: var(--ink);
  letter-spacing: -0.01em;
}
.case-meta {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
}
.case-meta span { color: var(--text-faint); }

.case-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-10);
}
@media (min-width: 880px) {
  .case-grid {
    grid-template-columns: 80px 1fr 1fr;
    gap: var(--space-12);
  }
}
.case-block h4 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--gold);
  margin-bottom: var(--space-4);
  display: flex; align-items: center; gap: var(--space-3);
}
.case-block h4::before {
  content: "";
  width: 18px; height: 1px; background: var(--gold);
}
.case-block p {
  font-size: var(--text-base);
  color: var(--text);
  line-height: 1.55;
  margin-bottom: var(--space-3);
}
.case-block p + p { margin-top: var(--space-2); }
.case-impact ul { list-style: none; }
.case-impact li {
  font-size: var(--text-sm);
  color: var(--text);
  padding-block: var(--space-3);
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
}
.case-impact li:last-child { border-bottom: 1px solid var(--rule); }
.case-impact .v {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--ink);
  font-variant-numeric: tabular-nums lining-nums;
  white-space: nowrap;
}
.case-impact .k { color: var(--text-muted); }

.case-skills {
  margin-top: var(--space-6);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.case-skills .chip {
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 4px 10px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  background: var(--paper);
}

/* ========== About / Credentials ========== */
.creds {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
}
@media (min-width: 880px) {
  .creds { grid-template-columns: 1fr 1fr; gap: var(--space-16); }
}
.creds-block h3 {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--gold);
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--rule);
}
.creds-list { list-style: none; display: flex; flex-direction: column; gap: var(--space-4); }
.creds-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-4);
  font-size: var(--text-sm);
}
.creds-list .name { color: var(--ink); }
.creds-list .year { color: var(--text-faint); font-variant-numeric: tabular-nums; font-family: var(--font-display); }

/* ========== Contact ========== */
.contact {
  background:
    radial-gradient(circle at 10% 20%, rgba(201,181,135,0.14), transparent 30rem),
    radial-gradient(circle at 86% 6%, rgba(31,79,74,0.26), transparent 28rem),
    var(--night);
  color: #F5F1E8;
  padding-block: clamp(var(--space-20), 9vw, var(--space-32));
}
.contact .eyebrow { color: var(--gold-soft); }
.contact .eyebrow::before { background: var(--gold-soft); }
.contact-title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: var(--text-2xl);
  color: #F5F1E8;
  margin-block: var(--space-6) var(--space-10);
  letter-spacing: -0.015em;
  line-height: 1.05;
  max-width: 22ch;
}
.contact-title em { color: var(--gold-soft); font-style: italic; }
.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: var(--space-10);
}
@media (min-width: 880px) {
  .contact-grid { grid-template-columns: repeat(4, 1fr); gap: var(--space-8); }
}
.contact-block .label {
  font-size: var(--text-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(245,241,232,0.5);
  margin-bottom: var(--space-3);
}
.contact-block a, .contact-block .value {
  display: inline-block;
  color: #F5F1E8;
  font-size: var(--text-base);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition);
}
.contact-block a:hover { border-color: var(--gold-soft); }

.availability {
  margin-top: var(--space-12);
  padding: var(--space-6);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-md);
  display: flex; align-items: center; gap: var(--space-4);
  font-size: var(--text-sm);
  color: rgba(245,241,232,0.85);
}
.availability .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--gold-soft);
  box-shadow: 0 0 0 4px rgba(201,181,135,0.18);
  flex-shrink: 0;
}

/* ========== Footer ========== */
.site-footer {
  background: var(--night);
  color: rgba(245,241,232,0.5);
  padding: var(--space-10) 0;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.footer-row a { color: rgba(245,241,232,0.7); }
.footer-row a:hover { color: var(--gold-soft); }

/* ========== Page header (sub-pages) ========== */
.page-hero {
  padding-block: clamp(var(--space-20), 11vw, var(--space-24));
  border-bottom: 1px solid var(--rule);
}
.page-hero .eyebrow { margin-bottom: var(--space-6); }
.page-hero h1 {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: var(--text-3xl);
  letter-spacing: -0.02em;
  color: var(--ink);
  max-width: 18ch;
  margin-bottom: var(--space-8);
  line-height: 1;
}
.page-hero h1 em { color: var(--gold); font-style: italic; font-weight: 400; }
.page-hero .lead {
  font-size: var(--text-lg);
  color: var(--text-muted);
  max-width: 60ch;
}

/* ========== Utility ========== */
.hidden { display: none !important; }

/* Lang toggling: hide elements not matching active language */
html[data-lang="en"] [data-lang-only="fr"] { display: none; }
html[data-lang="fr"] [data-lang-only="en"] { display: none; }

/* Reveal on scroll — only when JS enables it */
html.js-ready .reveal {
  opacity: 1;
  transform: none;
  transition: filter 700ms ease;
}
html.js-ready .reveal.in { filter: none; }
html.js-ready .expertise-card,
html.js-ready .project-row,
html.js-ready .timeline-item,
html.js-ready .metric,
html.js-ready .case {
  opacity: 1;
  transform: none;
  transition: transform 760ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 760ms cubic-bezier(0.16, 1, 0.3, 1);
}
html.js-ready .expertise-card.in,
html.js-ready .project-row.in,
html.js-ready .timeline-item.in,
html.js-ready .metric.in,
html.js-ready .case.in {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  html.js-ready .reveal,
  html.js-ready .expertise-card,
  html.js-ready .project-row,
  html.js-ready .timeline-item,
  html.js-ready .metric,
  html.js-ready .case { opacity: 1 !important; transform: none !important; }
}

@media (max-width: 640px) {
  .portrait-card { min-height: 460px; border-radius: 24px 4px 24px 4px; }
  .hero-meta { grid-template-columns: 1fr; }
  .portrait-glass { left: var(--space-4); right: var(--space-4); bottom: var(--space-4); }
}
