/* ============================================================
   Lyes Hammadouche — Portfolio
   Dark, elegant, serif+sans, ESP gate, framed sections
   ============================================================ */

/* ── TOKENS ──────────────────────────────────── */
:root {
  --bg:        #000000; /* Pure black */
  --bg2:       #0c0c0c;
  --bg3:       #141414;
  --surface:   #161616;
  --fg:        #ffffff; /* Pure white */
  --fg-dim:    #a0a0a0;
  --fg-muted:  #555555;
  --accent:    #8b5cf6; /* Spiritual Violet (Dark Mode) */
  --accent-hover: #7c3aed;
  --accent2:   #c9a84c;
  --border:    #ffffff; /* High contrast borders */
  --border-subtle: #222222;
  --border-fine: #333333;

  --serif:  'Cormorant Garamond', Georgia, 'Noto Serif SC', serif;
  --sans:   'Plus Jakarta Sans', 'Inter', system-ui, 'Noto Sans SC', sans-serif;
  --mono:   ui-monospace, 'JetBrains Mono', monospace;

  --hero:    clamp(38px, 5.5vw, 68px);
  --h2:      clamp(26px, 3.5vw, 42px);
  --h3:      clamp(18px, 2.2vw, 24px);
  --body:    17px;
  --sm:      14.5px;
  --xs:      12px;

  --s1: 4px; --s2: 8px; --s3: 16px; --s4: 24px; --s5: 40px; --s6: 64px; --s7: 100px;
  --nav-height: 64px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --overlay-bg: rgba(0, 0, 0, 0.95);
}

[data-theme="light"] {
  --bg: #ffffff; /* Pure white */
  --bg2: #fcfcfc;
  --bg3: #f5f5f5;
  --surface: #efefef;
  --fg: #000000; /* Pure black */
  --fg-dim: #444444;
  --fg-muted: #888888;
  --accent: #6d28d9; /* Spiritual Violet (Light Mode) */
  --accent-hover: #5b21b6;
  --border: #000000; /* High contrast borders */
  --border-subtle: #e5e5e5;
  --border-fine: #dddddd;
  --overlay-bg: rgba(255, 255, 255, 0.95);
}

/* ── RESET ───────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; scroll-behavior: smooth; background: var(--bg); }
body {
  font-family: var(--sans); font-size: var(--body); line-height: 1.6;
  color: var(--fg); background: transparent;
  overflow-x: hidden;
}
#site-canvas-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1 !important;
  pointer-events: none;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font: inherit; border: none; background: none; color: inherit; }
ul { list-style: none; }

.font-serif { font-family: var(--serif); }
.font-mono  { font-family: var(--mono); }
.text-dim   { color: var(--fg-dim); }
.text-muted { color: var(--fg-muted); }
.text-accent { color: var(--accent); }
.text-sm    { font-size: var(--sm); }

/* ── NAV ─────────────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--s3) clamp(40px, 6vw, 100px);
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 0.4s, border-color 0.4s;
}
.nav.scrolled { background: var(--bg2); border-bottom-color: var(--border-subtle); backdrop-filter: blur(12px); }
.nav__logo { display: inline-flex; align-items: center; gap: var(--s2); font-family: var(--sans); font-size: var(--xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; }
.nav__logo a { display: inline-flex; align-items: center; gap: var(--s3); color: inherit; }
.nav__logo img, .nav__logo svg { width: 42px; height: 42px; display: block; flex-shrink: 0; }
.nav__logo span { font-family: var(--sans) !important; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; }
.nav__logo-text-mobile { display: none; }
.nav__links { display: flex; gap: var(--s4); align-items: center; }
.nav__links a {
  font-family: var(--mono); font-size: var(--xs); letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--fg-dim); transition: color 0.2s;
  position: relative;
  padding-bottom: 4px;
  display: inline-flex;
  align-items: center;
}
.nav__links a:hover { color: var(--fg); }
.nav__link-icon {
  margin-right: 8px;
  font-size: 1.15em;
  color: var(--fg-muted);
  transition: transform 0.35s var(--ease-out), color 0.25s;
  display: inline-block;
  line-height: 1;
}
.nav__links a:hover .nav__link-icon {
  color: var(--accent);
}
.nav__links a.active .nav__link-icon {
  color: var(--accent);
}

/* Hide nav link icons in the header menu (desktop) */
.nav__links:not(.open) .nav__link-icon {
  display: none;
}

/* Individual micro-animations for menu icons on hover */
.nav__links a[href*="news"]:hover .nav__link-icon {
  transform: rotate(90deg) scale(1.2);
}
.nav__links a[href*="focus"]:hover .nav__link-icon {
  transform: scale(1.25);
}
.nav__links a[href*="work"]:hover .nav__link-icon {
  transform: rotate(45deg) scale(1.15);
}
.nav__links a[href*="lab"]:hover .nav__link-icon {
  transform: rotate(180deg) scale(1.2);
}
.nav__links a[href*="career"]:hover .nav__link-icon {
  transform: scale(1.2) translateY(-2px);
}
.nav__links a[href*="videos"]:hover .nav__link-icon {
  transform: scale(1.2) translateX(2px);
}
.nav__links a[href*="about"]:hover .nav__link-icon {
  transform: scale(1.2) rotate(15deg);
}
.nav__links a[href^="mailto"]:hover .nav__link-icon {
  transform: translate(4px, -4px) scale(1.1);
}
.nav__links a::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform 0.25s var(--ease-out);
  transform-origin: bottom left;
}
.nav__links a.active { color: var(--accent) !important; font-weight: 600; }
.nav__links a.active::after { transform: scaleX(1); background: var(--accent) !important; }

/* Chinese nav text bolding */
[data-lang="zh"] .nav__links a,
[data-lang="zh"] .nav__lang-btn,
.nav .lang-zh,
.nav__logo-zh,
.nav__logo .lang-zh,
.nav__links a .lang-zh {
  font-weight: 700 !important;
  font-family: var(--sans) !important;
}
.nav__logo-zh,
.nav__logo .lang-zh {
  margin-left: 8px !important;
  color: var(--fg-dim) !important;
}

.nav__controls { display: flex; align-items: center; gap: var(--s3); }
.nav__lang-btn {
  font-family: var(--mono); font-size: var(--xs); padding: 2px 6px;
  color: var(--fg-muted); border: 1px solid transparent; transition: all 0.2s;
}
.nav__lang-btn.active { color: var(--fg); border-color: var(--border); }
.nav__theme-toggle { font-size: 16px; padding: 2px 6px; }

/* Mobile nav burger button and menu */
.nav__burger {
  display: none;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  z-index: 101;
}

.nav__burger span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--fg);
  transition: all 150ms cubic-bezier(0.16, 1, 0.3, 1);
}

.nav__burger.open span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}

.nav__burger.open span:nth-child(2) {
  opacity: 0;
}

.nav__burger.open span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

@media (max-width: 768px) {
  .nav__logo-text-full {
    display: none;
  }
  .nav__logo-text-mobile {
    display: inline;
  }
  .nav__links {
    display: none;
  }
  .nav__burger {
    display: flex;
  }
  .nav__links.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 100vh;
    background: var(--overlay-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: var(--s7) clamp(40px, 6vw, 100px) var(--s5);
    gap: var(--s3);
    z-index: 99;
    justify-content: center;
    align-items: flex-start;
    border-bottom: 1px solid var(--border-subtle);
    animation: mobileMenuFadeIn 0.35s var(--ease-out) forwards;
  }
  .nav__links.open a {
    font-size: var(--h3);
    letter-spacing: 0.04em;
    width: 100%;
    padding: var(--s2) 0;
    border-bottom: 1px dashed var(--border-subtle);
    opacity: 0;
    transform: translateY(15px);
    animation: mobileLinkStaggerIn 0.4s var(--ease-out) forwards;
  }
  .nav__links.open a:last-child {
    border-bottom: none;
  }
  .nav__links.open a:nth-child(1) { animation-delay: 0.05s; }
  .nav__links.open a:nth-child(2) { animation-delay: 0.10s; }
  .nav__links.open a:nth-child(3) { animation-delay: 0.15s; }
  .nav__links.open a:nth-child(4) { animation-delay: 0.20s; }
  .nav__links.open a:nth-child(5) { animation-delay: 0.25s; }
  .nav__links.open a:nth-child(6) { animation-delay: 0.30s; }
  .nav__links.open a:nth-child(7) { animation-delay: 0.35s; }
  .nav__links.open a:nth-child(8) { animation-delay: 0.40s; }
}

@keyframes mobileMenuFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes mobileLinkStaggerIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.lang-fr, .lang-en, .lang-zh { display: none; }
[data-lang="fr"] .lang-fr { display: initial; }
[data-lang="fr"] .lang-fr.block { display: block; }
[data-lang="en"] .lang-en { display: initial; }
[data-lang="en"] .lang-en.block { display: block; }
[data-lang="zh"] .lang-zh { display: initial; }
[data-lang="zh"] .lang-zh.block { display: block; }

/* ── ESP GATE ────────────────────────────────── */
.esp-gate {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--bg);
  transition: opacity 0.8s ease;
}
.esp-gate.hidden { opacity: 0; pointer-events: none; }
.esp-gate__title {
  font-family: var(--serif); font-size: clamp(18px, 2.5vw, 28px);
  margin-bottom: var(--s2); text-align: center;
}
.esp-gate__subtitle {
  font-family: var(--mono); font-size: var(--xs); color: var(--fg-dim);
  margin-bottom: var(--s6); text-align: center;
}
.esp-gate__target {
  width: clamp(80px, 12vw, 120px); height: clamp(80px, 12vw, 120px);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: var(--s5);
  border: none;
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
  pointer-events: none;
}
.esp-gate__target.show {
  opacity: 1;
  transform: scale(1);
}
.esp-gate__choices {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border: 1px solid var(--border-subtle);
  background: transparent;
  margin-bottom: var(--s5);
  position: relative;
}
.esp-card {
  width: clamp(55px, 9vw, 75px); height: clamp(55px, 9vw, 75px);
  display: flex; align-items: center; justify-content: center;
  border-right: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  background: transparent;
  position: relative;
  transition: background 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out), transform 0.2s;
}
/* Remove outer borders */
.esp-card:nth-child(4n) { border-right: none; }
.esp-card:nth-child(n+13) { border-bottom: none; }

/* Create perpendicular crosshairs at grid intersections */
.esp-card::after {
  content: '';
  position: absolute;
  right: -5px;
  bottom: -5px;
  width: 9px;
  height: 9px;
  pointer-events: none;
  z-index: 10;
  background: linear-gradient(to bottom, transparent 4px, var(--border-subtle) 4px, var(--border-subtle) 5px, transparent 5px),
              linear-gradient(to right, transparent 4px, var(--border-subtle) 4px, var(--border-subtle) 5px, transparent 5px);
}
.esp-card:nth-child(4n)::after { display: none; }
.esp-card:nth-child(n+13)::after { display: none; }

.esp-card:hover {
  background: rgba(139, 92, 246, 0.05);
  transform: scale(1.04);
  z-index: 2;
}

.esp-card.correct {
  box-shadow: inset 0 0 0 1.5px #10a37f, 0 0 0 1.5px #10a37f;
  background: rgba(16, 163, 127, 0.12) !important;
  z-index: 5;
}
.esp-card.wrong {
  box-shadow: inset 0 0 0 1.5px #ef4444, 0 0 0 1.5px #ef4444;
  background: rgba(239, 68, 68, 0.12) !important;
  z-index: 5;
}
.esp-card.target-reveal {
  box-shadow: inset 0 0 0 1.5px #10a37f, 0 0 0 1.5px #10a37f;
  background: rgba(16, 163, 127, 0.06) !important;
  z-index: 4;
}

.esp-card svg { width: 55%; height: 55%; transition: transform 0.3s; }
.esp-card:hover svg { transform: scale(1.06); }

/* Full-screen Flash Reinforcement */
.esp-gate__flash {
  position: absolute;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
  opacity: 0;
}
@keyframes flash-success-anim {
  0% { background: rgba(16, 100, 70, 0.7); opacity: 1; }
  10% { background: rgba(255, 255, 255, 0.8); opacity: 1; }
  100% { background: transparent; opacity: 0; }
}
@keyframes flash-failure-anim {
  0% { background: rgba(200, 30, 30, 0.6); opacity: 1; }
  100% { background: transparent; opacity: 0; }
}
.esp-gate__flash.success {
  animation: flash-success-anim 0.7s cubic-bezier(0.1, 0.8, 0.1, 1) forwards;
}
.esp-gate__flash.failure {
  animation: flash-failure-anim 0.7s cubic-bezier(0.1, 0.8, 0.1, 1) forwards;
}

.esp-gate__result {
  font-family: var(--serif); font-size: var(--h3);
  min-height: 40px; text-align: center; margin-bottom: var(--s4);
  opacity: 0; transition: opacity 0.4s;
  color: var(--fg);
}
.esp-gate__result.show { opacity: 1; }
.esp-gate__enter {
  font-family: var(--mono); font-size: var(--xs); letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--fg-dim);
  border: 1px solid var(--border); padding: var(--s2) var(--s4);
  opacity: 0; transition: opacity 0.4s 0.2s, color 0.2s, border-color 0.2s;
  background: transparent;
}
.esp-gate__enter.show { opacity: 1; }
.esp-gate__enter:hover { color: var(--fg); border-color: var(--fg-dim); background: rgba(255,255,255,0.05); }

/* ── HERO ────────────────────────────────────── */
.hero {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  max-width: 1400px; margin: 0 auto;
  padding: calc(var(--nav-height) + var(--s6)) clamp(40px, 6vw, 100px) var(--s6);
  position: relative; z-index: 1;
}
.hero__grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--s6);
  align-items: center;
  width: 100%;
  z-index: 2;
}
@media (max-width: 900px) {
  .hero__grid {
    grid-template-columns: 1fr;
    gap: var(--s5);
  }
}
.hero__left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}
@media (max-width: 900px) {
  .hero__left {
    align-items: center;
    text-align: center;
  }
}
.hero__artist-name {
  font-family: var(--sans); font-size: var(--xs); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--accent); margin-bottom: var(--s3);
  display: flex; align-items: center; gap: var(--s2);
}
.hero__title {
  font-family: var(--sans); font-size: var(--hero); line-height: 1.15; letter-spacing: -0.02em;
  margin-bottom: var(--s4); color: var(--fg); font-weight: 800;
  text-transform: uppercase; letter-spacing: -0.02em;
}
.hero__bio {
  font-family: var(--serif); font-size: var(--body); color: var(--fg-dim);
  line-height: 1.7; margin-bottom: var(--s4); max-width: 58ch;
}
.hero__sub {
  font-family: var(--serif); font-size: var(--sm); color: var(--fg-muted); line-height: 1.6;
  margin-bottom: var(--s4); max-width: 58ch;
  border-left: 2px solid var(--border-fine); padding-left: var(--s3);
}
@media (max-width: 900px) {
  .hero__sub {
    border-left: none; padding-left: 0; margin: 0 auto var(--s4);
  }
}
.hero__ctas { display: flex; gap: var(--s3); }

.hero__right {
  display: flex; justify-content: center; align-items: center;
}
.hero__portrait-frame {
  border: 1px solid var(--border);
  padding: var(--s2);
  background: var(--bg2);
  width: 100%;
  max-width: 360px;
  aspect-ratio: 3/4;
  overflow: hidden;
  position: relative;
  transition: transform 0.5s var(--ease-out);
}
.hero__portrait-frame:hover {
  transform: translate(-4px, -4px);
  box-shadow: 8px 8px 0 var(--accent);
}
.hero__portrait-frame img {
  width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(15%) contrast(1.02);
  transition: filter 0.3s;
}
.hero__portrait-frame:hover img {
  filter: grayscale(0%) contrast(1);
}

.page-watermark {
  position: absolute;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 60vw; max-width: 650px;
  opacity: 0.015; pointer-events: none; z-index: 1;
  color: var(--fg);
}
[data-theme="light"] .page-watermark {
  opacity: 0.01;
}

/* ── BUTTONS ─────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: var(--s1);
  font-family: var(--mono); font-size: var(--xs); letter-spacing: 0.06em;
  text-transform: uppercase; padding: var(--s2) var(--s4);
  border: 1px solid var(--border); transition: all 0.25s;
}
.btn:hover { border-color: var(--fg-dim); }
.btn--accent { border-color: var(--accent); color: var(--accent); }
.btn--accent:hover { background: var(--accent); color: #fff; }

/* ── SECTION FRAME ───────────────────────────── */
.section {
  padding: var(--s7) clamp(40px, 6vw, 100px);
  max-width: 1400px; margin: 0 auto;
  position: relative;
  z-index: 1;
}
.section--framed {
  border: 1px solid var(--border-subtle);
  padding: var(--s6) clamp(40px, 6vw, 100px);
  margin-bottom: var(--s6);
}
.section--textured {
  background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h40v40H0z' fill='none'/%3E%3Cpath d='M0 40L40 0' stroke='%23ffffff' stroke-width='0.3' opacity='0.03'/%3E%3C/svg%3E");
}
[data-theme="light"] .section--textured {
  background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h40v40H0z' fill='none'/%3E%3Cpath d='M0 40L40 0' stroke='%23000000' stroke-width='0.3' opacity='0.02'/%3E%3C/svg%3E");
}
.section__label {
  font-family: var(--mono); font-size: var(--xs); color: var(--fg-dim);
  letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: var(--s2);
}
.section__title {
  font-family: var(--serif); font-size: var(--h2); margin-bottom: var(--s5);
  font-weight: 400; /* Less bold and elegant */
}

/* ── ARTWORK GALLERY ─────────────────────────── */
.gallery-header {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: var(--s5); flex-wrap: wrap; gap: var(--s3);
}
.filters { display: flex; gap: var(--s2); }
.filter-btn {
  font-family: var(--mono); font-size: var(--xs); padding: var(--s1) var(--s2);
  color: var(--fg-dim); border: 1px solid transparent; transition: all 0.2s;
}
.filter-btn.active { color: var(--fg); border-color: var(--border); }
.filter-btn:hover { color: var(--fg); }

.artwork-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-flow: dense;
  gap: 2px;
}
@media (max-width: 900px) { .artwork-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .artwork-grid { grid-template-columns: 1fr; } }

.artwork-card {
  position: relative; aspect-ratio: 1; overflow: hidden;
  background: var(--bg3); cursor: pointer;
  border: 1px solid var(--border-subtle);
}
.artwork-card img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.25,0.46,0.45,0.94), filter 0.6s;
  filter: grayscale(15%) contrast(1.02);
  will-change: transform;
  backface-visibility: hidden;
}
.artwork-card:hover img { transform: scale(1.04); filter: grayscale(0%) contrast(1); }

.artwork-card__overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: var(--s4);
  background: linear-gradient(0deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.1) 40%, transparent 60%);
  opacity: 0; transition: opacity 0.4s;
}
.artwork-card:hover .artwork-card__overlay { opacity: 1; }
.artwork-card__title {
  font-family: var(--serif); font-size: var(--h3); color: #fff;
  margin-bottom: var(--s1);
}
.artwork-card__meta {
  font-family: var(--mono); font-size: var(--xs); color: rgba(255,255,255,0.6);
}

.artwork-card--wide {
  grid-column: span 2;
  aspect-ratio: 2 / 1;
}
@media (max-width: 520px) {
  .artwork-card--wide {
    grid-column: span 1;
    aspect-ratio: 1;
  }
}

.artwork-card--tall {
  grid-row: span 2;
  aspect-ratio: 1 / 2;
}
@media (max-width: 520px) {
  .artwork-card--tall {
    grid-row: span 1;
    aspect-ratio: 1;
  }
}

.artwork-card--double {
  grid-column: span 2;
  grid-row: span 2;
  aspect-ratio: 1;
}
@media (max-width: 520px) {
  .artwork-card--double {
    grid-column: span 1;
    grid-row: span 1;
    aspect-ratio: 1;
  }
}

/* ── LAB SECTION ─────────────────────────────── */
.lab-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: var(--s4);
}
@media (max-width: 900px) { .lab-grid { grid-template-columns: 1fr; } }
.lab-card {
  border: 1px solid var(--border); padding: var(--s4);
  transition: border-color 0.3s, background 0.3s;
  background: var(--bg2);
}
.lab-card:hover { border-color: var(--accent); background: var(--bg3); }
.lab-card__icon { font-size: 22px; margin-bottom: var(--s3); color: var(--accent); }
.lab-card__title { font-family: var(--serif); font-size: var(--h3); margin-bottom: var(--s2); font-weight: 400; }
.lab-card__desc { font-size: var(--sm); color: var(--fg-dim); margin-bottom: var(--s2); line-height: 1.6; }
.lab-card__tag { font-family: var(--mono); font-size: var(--xs); color: var(--fg-muted); }

/* ── TIMELINE/CAREER GRID ──────────────────────── */
.career-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s6);
  margin-top: var(--s4);
}
@media (max-width: 1024px) {
  .career-grid {
    grid-template-columns: 1fr;
    gap: var(--s5);
  }
}
.career-column__title {
  font-family: var(--sans);
  font-size: var(--xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  border-bottom: 1px solid var(--border-fine);
  padding-bottom: var(--s2);
  margin-bottom: var(--s4);
}

.timeline { border-left: 1px solid var(--border-fine); margin-left: var(--s2); }
.timeline__item {
  padding: var(--s2) 0 var(--s4) var(--s4);
  position: relative;
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color 0.25s;
}
.timeline__item:hover {
  background-color: rgba(139, 92, 246, 0.02);
}
.timeline__item::before {
  content: ''; position: absolute; left: -4px; top: var(--s3);
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--fg-muted); border: 1px solid var(--bg);
  transition: background-color 0.25s, transform 0.25s;
}
.timeline__item--major::before {
  background: var(--accent); width: 9px; height: 9px; left: -5px;
}
.timeline__item:hover::before {
  background: var(--accent);
  transform: scale(1.3);
}
.timeline__year { font-family: var(--mono); font-size: var(--xs); color: var(--accent); margin-bottom: 2px; }
.timeline__title { font-family: var(--serif); font-size: var(--sm); margin-bottom: 2px; font-weight: 500; }
.timeline__venue { font-size: var(--xs); color: var(--fg-dim); }
.timeline__type { font-family: var(--mono); font-size: var(--xs); color: var(--fg-muted); display: block; margin-top: var(--s1); }

/* ── ABOUT ───────────────────────────────────── */
.bio-grid {
  display: grid; grid-template-columns: 0.8fr 1.2fr; gap: var(--s6);
  align-items: start;
}
@media (max-width: 768px) { .bio-grid { grid-template-columns: 1fr; } }
.bio__portrait { border: 1px solid var(--border); padding: var(--s2); background: var(--bg2); }
.bio__portrait img { width: 100%; aspect-ratio: 3/4; object-fit: cover; filter: grayscale(15%); }
.bio__text p { margin-bottom: var(--s3); line-height: 1.7; font-family: var(--serif); font-size: var(--body); }
.bio__social { display: flex; gap: var(--s3); margin: var(--s4) 0; }
.bio__social a {
  font-family: var(--mono); font-size: var(--xs); color: var(--fg-dim);
  border: 1px solid var(--border); padding: var(--s1) var(--s2);
  transition: all 0.2s;
}
.bio__social a:hover { color: var(--fg); border-color: var(--accent); }
.bio__contact { margin-top: var(--s4); }

/* ── OVERLAY ─────────────────────────────────── */
.overlay {
  position: fixed; inset: 0; z-index: 200;
  background: var(--bg); overflow-y: auto;
  opacity: 0; pointer-events: none;
  transition: opacity 0.4s;
}
.overlay.active { opacity: 1; pointer-events: all; }
.overlay__close {
  position: fixed; top: var(--s4); right: var(--s4); z-index: 201;
  font-size: 20px; padding: var(--s2);
}
.overlay__content {
  max-width: 900px; margin: 0 auto; padding: var(--s7) var(--s5);
}
.overlay__image { width: 100%; margin-bottom: var(--s5); border: 1px solid var(--border); padding: var(--s2); background: var(--bg2); }
.overlay__image img { width: 100%; max-height: 70vh; object-fit: contain; }
.overlay__title { font-family: var(--serif); font-size: var(--h2); margin-bottom: var(--s2); font-weight: 400; }
.overlay__meta { display: flex; gap: var(--s3); margin-bottom: var(--s4); flex-wrap: wrap; }
.overlay__meta span { font-family: var(--mono); font-size: var(--xs); color: var(--fg-dim); }
.overlay__desc { font-family: var(--serif); font-size: var(--body); color: var(--fg-dim); line-height: 1.7; max-width: 600px; }

/* ── FOOTER ──────────────────────────────────── */
.footer {
  position: relative; z-index: 1;
  border-top: 1px solid var(--border-fine);
  padding: var(--s5);
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--mono); font-size: var(--xs); color: var(--fg-muted);
}
.footer__social { display: flex; gap: var(--s3); }
.footer__social a { color: var(--fg-dim); transition: color 0.2s; }
.footer__social a:hover { color: var(--accent); }

/* ── SCROLLBAR ───────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-fine); }

/* ── ENGINEERING DECORATIVE CORNER MARKERS ── */
.eng-marker {
  position: absolute;
  width: 24px;
  height: 24px;
  color: var(--accent);
  pointer-events: none;
  z-index: 10;
  opacity: 0.6;
  transition: opacity 0.3s, color 0.3s;
}

/* Position variables for corner alignment */
.eng-marker--tl { top: -12px; left: -12px; }
.eng-marker--tr { top: -12px; right: -12px; }
.eng-marker--bl { bottom: -12px; left: -12px; }
.eng-marker--br { bottom: -12px; right: -12px; }

/* Let them light up slightly on hover of their parent container */
.section--framed:hover .eng-marker {
  opacity: 1;
  color: var(--fg);
}

/* ── Restructured News Layout ── */
.news-card__left-col {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  gap: var(--s5);
}

.news-card__thumbnails {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s4);
  margin-top: var(--s4);
  width: 100%;
}

.news-card__thumb {
  width: 100%;
  aspect-ratio: 1.5;
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.news-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.news-card__thumb:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  border-color: var(--fg-dim);
}

.news-card__thumb.active {
  border-color: var(--accent);
  opacity: 1;
}

.news-card__right-col {
  display: flex;
  align-items: stretch;
  width: 100%;
  height: 100%;
}

.news-card__img-main-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 380px;
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  background: var(--bg3);
}

.news-card__img-main-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s ease;
}

/* ── Scroll Indicator ── */
.hero__scroll-indicator {
  position: fixed;
  bottom: var(--s4);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s2);
  font-family: var(--mono);
  font-size: var(--xs);
  color: var(--fg-dim);
  opacity: 0;
  pointer-events: none;
  animation: pulse-scroll 2.5s infinite ease-in-out;
  z-index: 100;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

body.page-loaded .hero__scroll-indicator {
  opacity: 0.7;
}

@keyframes pulse-scroll {
  0%, 100% { opacity: 0.3; transform: translate(-50%, 0); }
  50% { opacity: 0.9; transform: translate(-50%, 8px); }
}

.scroll-arrow {
  width: 1px;
  height: 24px;
  background: var(--fg-dim);
  position: relative;
}

.scroll-arrow::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 6px;
  height: 6px;
  border-bottom: 1px solid var(--fg-dim);
  border-right: 1px solid var(--fg-dim);
  transform: translateX(-50%) rotate(45deg);
}

/* ── CAREER CAROUSEL ────────────────────────── */
.career-column--carousel {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.career-carousel {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.career-carousel__wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 1.5;
  border: 1px solid var(--border-subtle);
  background: var(--bg3);
  overflow: hidden;
}

.career-carousel__wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s ease;
}

.career-carousel__caption {
  position: absolute;
  bottom: var(--s3);
  left: var(--s3);
  background: rgba(0, 0, 0, 0.7);
  padding: var(--s1) var(--s2);
  font-size: var(--xs);
  color: var(--fg);
  border: 1px solid var(--border-subtle);
  max-width: 75%;
}

.career-carousel__indicator {
  position: absolute;
  bottom: var(--s3);
  right: var(--s3);
  background: rgba(0, 0, 0, 0.7);
  padding: var(--s1) var(--s2);
  font-size: var(--xs);
  color: var(--fg-dim);
  border: 1px solid var(--border-subtle);
}

.career-carousel__nav {
  display: flex;
  justify-content: flex-end;
  gap: var(--s2);
  margin-top: var(--s3);
}

.career-carousel__nav button {
  border: 1px solid var(--border);
  padding: var(--s1) var(--s3);
  font-family: var(--mono);
  font-size: var(--xs);
  text-transform: uppercase;
  transition: all 0.2s ease;
  min-width: 48px;
  text-align: center;
}

.career-carousel__nav button:hover {
  background: var(--fg);
  color: var(--bg);
}

/* ── Restructured News Gallery ── */
.news-card--news {
  display: flex !important;
  flex-direction: column !important;
  gap: var(--s4) !important;
  width: 100% !important;
}

.news-card__images-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s4);
  width: 100%;
  margin-top: var(--s3);
}

.news-card__img-wrapper {
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--bg3);
}

.news-card__img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration-slow) var(--ease-out);
}

.news-card__img-wrapper:hover img {
  transform: scale(1.03);
}

@media (max-width: 900px) {
  .news-card__images-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 520px) {
  .news-card__images-grid {
    grid-template-columns: 1fr;
  }
}



/* ── BIO COLLAPSIBLE CV ──────────────────────── */
.bio-cv {
  margin-top: var(--s4);
  display: flex;
  flex-direction: column;
  gap: var(--s2);
}
.bio-cv details {
  border-bottom: 1px solid var(--border-fine);
  padding-bottom: var(--s2);
  transition: all 0.3s var(--ease-out);
}
.bio-cv summary {
  font-family: var(--sans);
  font-size: var(--xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  cursor: pointer;
  padding: var(--s2) 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  list-style: none;
}
.bio-cv summary::-webkit-details-marker {
  display: none;
}
.bio-cv summary::after {
  content: '＋';
  font-size: 11px;
  font-weight: 400;
  color: var(--fg-dim);
  transition: transform 0.3s;
}
.bio-cv details[open] summary::after {
  content: '－';
}
.bio-cv__list {
  padding: var(--s2) 0 var(--s3) var(--s1);
  font-family: var(--serif);
  font-size: var(--sm);
  color: var(--fg-dim);
  line-height: 1.7;
}
.bio-cv__item {
  margin-bottom: var(--s3);
  position: relative;
  padding-left: var(--s3);
}
.bio-cv__item::before {
  content: '·';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: bold;
}
.bio-cv__item strong {
  color: var(--fg);
  font-family: var(--sans);
  font-size: var(--xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.bio-cv__item em {
  font-style: italic;
  color: var(--fg-muted);
}

/* ============================================================
   FOCUS SECTION
   ============================================================ */
.focus-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s4);
  margin-top: var(--s4);
}

@media (max-width: 900px) {
  .focus-grid {
    grid-template-columns: 1fr;
    gap: var(--s3);
  }
}

.focus-card {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  transition: border-color var(--duration-fast, 0.2s), transform var(--duration-fast, 0.2s);
  display: flex;
  flex-direction: column;
}

.focus-card:hover {
  border-color: var(--fg-dim);
}

.focus-card__main {
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
}

.focus-card__image {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--bg2);
  overflow: hidden;
  position: relative;
  border-bottom: 1px solid var(--border-subtle);
}

.focus-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
  will-change: transform;
  backface-visibility: hidden;
}

.focus-card:hover .focus-card__image img {
  transform: scale(1.05);
}

.focus-card__info {
  padding: var(--s3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface);
}

.focus-card__title {
  margin: 0;
  font-size: var(--body, 16px);
  font-weight: 600;
  color: var(--fg);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.focus-card__toggle-icon {
  font-size: var(--lg, 20px);
  color: var(--accent);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), color 0.35s ease;
  user-select: none;
  display: inline-block;
}

.focus-card.open .focus-card__toggle-icon {
  color: var(--accent2, var(--accent));
  transform: rotate(45deg);
}

.focus-card__drawer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.4s ease, border-color 0.4s ease;
  opacity: 0;
  border-top: 1px solid transparent;
  background: var(--bg2);
}

.focus-card.open .focus-card__drawer {
  opacity: 1;
  border-top-color: var(--border-subtle);
}

.focus-card__drawer-content {
  padding: var(--s3);
  display: flex;
  flex-direction: column;
  gap: var(--s2);
}

.focus-card__description {
  margin: 0;
  font-family: var(--serif);
  font-size: var(--sm, 14px);
  color: var(--fg-dim);
  line-height: 1.6;
}

.focus-card__link {
  align-self: flex-start;
  font-family: var(--mono);
  font-size: var(--xs, 12px);
  color: var(--accent);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  border-bottom: 1px solid transparent;
  transition: color var(--duration-fast, 0.2s), border-color var(--duration-fast, 0.2s);
  margin-top: var(--s1);
  cursor: pointer;
}

.focus-card__link:hover {
  color: var(--fg);
  border-bottom-color: var(--fg);
}

/* ESP Interactive Widget inside Lab Card */
.lab-card--interactive { display: flex; flex-direction: column; }
.esp-widget {
  margin-top: var(--s3); padding: var(--s2);
  border: 1px solid var(--border-fine); background: var(--bg3);
  border-radius: 4px; display: flex; flex-direction: column; align-items: center; gap: var(--s2);
}
.esp-widget__status { font-size: var(--xs); color: var(--accent); width: 100%; text-align: center; }
.esp-widget__target-box {
  width: 50px; height: 50px; border: 1.2px dashed var(--border-fine);
  display: flex; align-items: center; justify-content: center; border-radius: 4px;
  background: rgba(0, 0, 0, 0.2); margin: 5px 0;
}
.esp-widget__target-placeholder { font-size: var(--h3); font-family: var(--mono); color: var(--fg-dim); }
.esp-widget__grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px;
  width: 100%; max-width: 220px; margin: var(--s1) 0;
}
.esp-widget-card {
  aspect-ratio: 1; border: 1px solid var(--border-fine);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; background: transparent; transition: background 0.2s, border-color 0.2s, transform 0.1s;
  border-radius: 3px;
}
.esp-widget-card:hover { background: rgba(139, 92, 246, 0.08); border-color: var(--accent); transform: scale(1.05); }
.esp-widget-card svg { width: 60%; height: 60%; }
.esp-widget-card.correct { background: rgba(16, 163, 127, 0.15) !important; border-color: #10a37f !important; }
.esp-widget-card.wrong { background: rgba(239, 68, 68, 0.15) !important; border-color: #ef4444 !important; }
.esp-widget-card.target-reveal { background: rgba(16, 163, 127, 0.08); border-color: #10a37f; }
.esp-widget__controls { display: flex; gap: var(--s2); width: 100%; justify-content: center; }
.esp-widget__feedback { font-size: var(--xs); min-height: 32px; text-align: center; color: var(--fg-dim); margin-top: 4px; line-height: 1.4; }

/* ── ESP OVERLAY MODAL ──────────────────────────────── */
.esp-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.esp-overlay.active {
  opacity: 1;
  visibility: visible;
}

.esp-overlay__content {
  background: var(--bg2);
  border: 1.5px solid var(--border-fine);
  border-radius: 8px;
  padding: var(--s5);
  max-width: 440px;
  width: 90%;
  position: relative;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
  animation: espModalScaleUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes espModalScaleUp {
  from {
    transform: scale(0.92) translateY(15px);
    opacity: 0;
  }
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.esp-overlay__close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: transparent;
  border: none;
  font-size: 24px;
  color: var(--fg-dim);
  cursor: pointer;
  transition: color 0.2s ease, transform 0.2s ease;
  line-height: 1;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.esp-overlay__close:hover {
  color: var(--fg);
  transform: scale(1.1);
}

/* ── IMAGE FITTING RULES ────────────────────────────── */
.artwork-card img,
.artwork-card__image {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
}

.focus-card img,
.focus-card__image img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
}

/* ── WECHAT OVERLAY MODAL ────────────────────────── */
.wechat-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 10005;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease-out), visibility 0.3s var(--ease-out);
}

.wechat-modal.active {
  opacity: 1;
  visibility: visible;
}

.wechat-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
}

[data-theme="light"] .wechat-modal__backdrop {
  background: rgba(255, 255, 255, 0.85);
}

.wechat-modal__content {
  background: var(--bg2);
  border: 1px solid var(--border);
  padding: var(--s5);
  max-width: 380px;
  width: 90%;
  position: relative;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transform: scale(0.95);
  transition: transform 0.3s var(--ease-out);
}

.wechat-modal.active .wechat-modal__content {
  transform: scale(1);
}

.wechat-modal__close {
  position: absolute;
  top: var(--s2);
  right: var(--s2);
  background: transparent;
  border: none;
  font-size: 20px;
  color: var(--fg-dim);
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--duration-fast) var(--ease-out);
}

.wechat-modal__close:hover {
  color: var(--fg);
}

.wechat-modal__icon {
  width: 48px;
  height: 48px;
  margin-bottom: var(--s3);
  color: var(--accent);
}

.wechat-modal__icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.wechat-modal__title {
  font-size: var(--sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg);
  margin-bottom: var(--s3);
}

.wechat-modal__id-box {
  display: flex;
  border: 1px solid var(--border-fine);
  background: var(--bg3);
  width: 100%;
  margin-bottom: var(--s3);
}

.wechat-modal__id {
  flex: 1;
  padding: var(--s2);
  font-size: var(--body);
  color: var(--fg);
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: all;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.wechat-modal__copy-btn {
  background: var(--accent);
  color: #ffffff;
  border: none;
  border-left: 1px solid var(--border-fine);
  padding: var(--s2) var(--s4);
  font-size: var(--xs);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out);
}

.wechat-modal__copy-btn:hover {
  background: var(--accent-hover);
}

.wechat-modal__copy-btn.copied {
  background: #10a37f;
  color: #ffffff;
}

.wechat-modal__help {
  font-size: var(--sm);
  color: var(--fg-dim);
  line-height: 1.5;
  margin: 0;
}

