/* ============================================================
   MAIN.CSS
   ============================================================ */

/* --- Fonts locales --- */
@font-face {
  font-family: 'Bisteron';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/bisteron.woff2') format('woff2');
}

@font-face {
  font-family: 'Calvia';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/calvia.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/inter-400-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/inter-400.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Syne';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/syne-400.woff2') format('woff2');
}

@font-face {
  font-family: 'DM Serif Display';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/dm-serif-normal-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'DM Serif Display';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/dm-serif-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'DM Serif Display';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/dm-serif-italic-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'DM Serif Display';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/dm-serif-italic.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

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

:root {
  --bg:     #f5f4f0;
  --fg:     #111010;
  --muted:  #6a6a6a;
  --line:   #d8d6cf;
  --tag-bg: #e8e6df;
  --serif:  'DM Serif Display', serif;
  --sans:   'Helvetica Neue', Helvetica, Arial, sans-serif;
}

html[data-theme="dark"] {
  --bg:     #0e0e0e;
  --fg:     #f0ede6;
  --muted:  #777;
  --line:   #252525;
  --tag-bg: #1a1a1a;
}
html[data-theme="light"] {
  --bg:     #f5f4f0;
  --fg:     #111010;
  --muted:  #6a6a6a;
  --line:   #d8d6cf;
  --tag-bg: #e8e6df;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.7;
  cursor: none;
}

/* --- Cursor --- */
*, *::before, *::after { cursor: none !important; }

.cursor {
  width: 8px; height: 8px;
  background: var(--fg);
  border-radius: 50%;
  position: fixed;
  top: -20px; left: -20px;
  pointer-events: none;
  z-index: 9999;
  transition: width 0.2s, height 0.2s, background 0.2s, border-color 0.2s;
  transform: translate(-50%, -50%);
}
.cursor.grow {
  width: 40px; height: 40px;
  background: transparent;
  border: 1.5px solid var(--fg);
}
.cursor.light { background: #fff; }
.cursor.light.grow { background: transparent; border-color: #fff; }
.cursor.on-dark { background: #fff; }
.cursor.on-dark.grow { background: transparent; border-color: #fff; }

/* --- Liens internes --- */
.eseo-link, .meta-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  transition: border-color 0.2s;
}
.eseo-link:hover, .meta-link:hover { border-bottom-color: var(--fg); }

/* --- Nav --- */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 48px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  opacity: 0;
  animation: fadeDown 0.6s 0.2s forwards;
}
.nav-logo {
  font-family: var(--serif);
  font-size: 18px;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--fg);
}

/* Links desktop */
.nav-links-desktop {
  position: fixed;
  top: 0; right: 48px;
  z-index: 101;
  display: flex;
  align-items: center;
  height: 72px;
  opacity: 0;
  animation: fadeDown 0.6s 0.2s forwards;
}
.nav-links-desktop ul { display: flex; gap: 32px; list-style: none; }
.nav-links-desktop a {
  text-decoration: none;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 0.2s;
}
.nav-links-desktop a:hover { color: var(--fg); }

/* Burger — caché sur desktop */
.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  padding: 4px;
  width: 32px; height: 32px;
  position: relative;
}
.burger span {
  display: block;
  width: 22px; height: 1.5px;
  background: var(--fg);
  transition: transform 0.3s ease, opacity 0.2s ease;
  transform-origin: center;
}
.burger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Menu mobile — élément indépendant hors de nav */
.mobile-menu {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: var(--bg);
  z-index: 9990;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease;
  flex-direction: column;
  justify-content: center;
}
.mobile-menu.open { opacity: 1; visibility: visible; }
.mobile-menu ul { list-style: none; padding: 0; margin: 0; }
.mobile-menu li { border-bottom: 1px solid var(--line); }
.mobile-menu li:first-child { border-top: 1px solid var(--line); }
.mobile-menu a {
  display: block;
  padding: 22px 32px;
  font-size: 22px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--fg);
}

@media (max-width: 768px) {
  nav { padding: 20px 24px; z-index: 9998; }
  .burger { display: flex; }
  .nav-links-desktop { display: none; }
  .mobile-menu { display: flex; }

  body { cursor: auto; }
  *, *::before, *::after { cursor: auto !important; }
  .cursor { display: none !important; }

  section { padding: 64px 24px; }
  .section-divider { margin: 0 24px; }
  #about .about-grid { grid-template-columns: 1fr; gap: 40px; }
  #experiences .experiences-list { grid-template-columns: 1fr; }
  .contact-inner { flex-direction: column; gap: 48px; align-items: flex-start; }
  footer { flex-direction: column; gap: 8px; }
}

/* --- Hero --- */
#hero {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 45% 55%;
  overflow: hidden;
}

.hero-col-photo {
  height: 100vh;
  position: sticky;
  top: 0;
}
.hero-photo-wrap {
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--tag-bg);
}
.hero-photo {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}
.hero-photo-placeholder {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 8px; background: var(--tag-bg);
}
.photo-placeholder-icon { font-size: 48px; opacity: 0.2; }
.photo-placeholder-hint { font-size: 11px; color: var(--muted); text-align: center; line-height: 1.8; }

.hero-col-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 120px 64px 80px;
  opacity: 0;
  animation: fadeUp 0.9s 0.4s cubic-bezier(0.22,1,0.36,1) forwards;
}
.hero-col-text h1 {
  font-family: var(--serif);
  font-size: clamp(40px, 4.5vw, 72px);
  line-height: 0.95;
  letter-spacing: -0.02em;
  margin-bottom: 32px;
  opacity: 0;
  animation: fadeUp 0.9s 0.3s cubic-bezier(0.22,1,0.36,1) forwards;
}
.hero-col-text h1 em { font-style: normal; text-transform: uppercase; color: var(--muted); }
.hero-col-name { display: none; }

.hero-tag {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 6px 12px;
  border-radius: 100px;
  margin-bottom: 20px;
  width: fit-content;
}
.hero-desc { font-size: 14px; line-height: 1.7; margin-bottom: 28px; }
.hero-links { display: flex; gap: 12px; flex-wrap: wrap; }

.hero-cta {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none;
  background: var(--fg); color: var(--bg);
  padding: 14px 28px;
  font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase;
  transition: transform 0.2s;
}
.hero-cta:hover { transform: translateY(-2px); }
.hero-cta--ghost { background: transparent; color: var(--fg); border: 1px solid var(--line); }
.hero-cta--ghost:hover { background: var(--tag-bg); }

.hero-scroll {
  position: fixed;
  bottom: 40px; right: 48px;
  writing-mode: vertical-rl;
  font-size: 11px; letter-spacing: 0.12em;
  color: var(--muted); text-transform: uppercase;
  display: flex; align-items: center; gap: 12px;
  opacity: 0; animation: fadeIn 1s 1.4s forwards;
  z-index: 10;
}
.hero-scroll::before {
  content: ''; display: block;
  width: 1px; height: 48px; background: var(--line);
}

/* --- Dividers & Sections --- */
.section-divider { height: 1px; background: var(--line); margin: 0 48px; }
section { padding: 96px 48px; }

.section-header {
  display: flex; align-items: baseline; gap: 24px;
  margin-bottom: 64px;
}
.section-num { font-size: 11px; color: var(--muted); letter-spacing: 0.1em; }
.section-title {
  font-family: var(--serif);
  font-size: clamp(32px, 4vw, 52px);
  letter-spacing: -0.02em; line-height: 1;
}

/* --- About --- */
#about .about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px; align-items: start;
}
.about-left, .about-right { display: flex; flex-direction: column; gap: 40px; }

.about-text p { font-size: 14px; line-height: 1.65; margin-bottom: 12px; }

.about-block-title {
  font-size: 11px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 16px;
}

.skills-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 0; }
.skill-tag {
  font-size: 12px; padding: 8px 16px;
  background: var(--tag-bg); border: 1px solid var(--line);
  letter-spacing: 0.04em; transition: background 0.2s, color 0.2s;
}
.skill-tag:hover { background: var(--fg); color: var(--bg); }
a.skill-tag { text-decoration: none; color: var(--fg); cursor: pointer; }
.skill-tag--soft { background: var(--bg); border-style: dashed; }

.about-meta { display: flex; flex-direction: column; }
.meta-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 0; border-bottom: 1px solid var(--line); font-size: 13px;
}
.meta-row:first-child { border-top: 1px solid var(--line); }
.meta-label { color: var(--muted); }
.meta-value { font-weight: 500; }

.languages-list { display: flex; flex-direction: column; }
.lang-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 13px;
}
.lang-row:first-child { border-top: 1px solid var(--line); }
.lang-badge {
  font-size: 11px; padding: 3px 10px;
  background: var(--tag-bg); border: 1px solid var(--line);
  letter-spacing: 0.08em; color: var(--muted);
}

.interests-list { display: flex; flex-direction: column; gap: 12px; }
.interest-row { display: flex; flex-direction: column; gap: 2px; }
.interest-cat { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.interest-detail { font-size: 13px; line-height: 1.6; }

/* --- Expériences --- */
#experiences .experiences-list {
  display: grid; grid-template-columns: 1fr 1fr; gap: 2px;
}
.exp-card {
  background: var(--tag-bg); padding: 40px;
  border: 1px solid var(--line); transition: background 0.25s, border-color 0.25s;
}
.exp-card:hover { background: var(--fg); border-color: var(--fg); }
.exp-card:hover .exp-period,
.exp-card:hover .exp-location,
.exp-card:hover .exp-title,
.exp-card:hover .exp-desc { color: var(--bg); }
.exp-card:hover .exp-type {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.3);
  color: rgba(255,255,255,0.85);
}
.exp-card:hover .stack-item {
  border-color: rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.7);
}
.exp-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.exp-meta { display: flex; flex-direction: column; gap: 4px; }
.exp-header-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.exp-link {
  font-size: 18px;
  text-decoration: none;
  color: var(--muted);
  transition: color 0.2s;
}
.exp-link:hover { color: var(--fg); }
.exp-card:hover .exp-link { color: rgba(255,255,255,0.6); }
.exp-card:hover .exp-link:hover { color: #fff; }
.exp-period { font-size: 11px; letter-spacing: 0.08em; color: var(--muted); text-transform: uppercase; }
.exp-type {
  display: inline-block; font-size: 10px; padding: 3px 10px;
  border: 1px solid var(--line); border-radius: 100px;
  color: var(--muted); background: var(--bg); letter-spacing: 0.06em; width: fit-content;
}
.exp-location { font-size: 11px; color: var(--muted); text-align: right; letter-spacing: 0.04em; }
.exp-title { font-family: var(--serif); font-size: 26px; letter-spacing: -0.02em; margin-bottom: 12px; }
.exp-desc { font-size: 13px; color: var(--muted); line-height: 1.8; }

/* --- Parcours --- */
.timeline { display: flex; flex-direction: column; max-width: 700px; }
.timeline-item {
  display: grid; grid-template-columns: 140px 1fr;
  gap: 32px; padding: 32px 0; border-bottom: 1px solid var(--line);
}
.timeline-item:first-child { border-top: 1px solid var(--line); }
.timeline-year { font-size: 12px; color: var(--muted); letter-spacing: 0.06em; padding-top: 4px; }
.timeline-content h3 { font-family: var(--serif); font-size: 20px; margin-bottom: 4px; letter-spacing: -0.01em; }
.timeline-content .tl-place { font-size: 12px; color: var(--muted); margin-bottom: 12px; letter-spacing: 0.04em; }
.timeline-content p { font-size: 13px; line-height: 1.8; }

/* --- Stack items --- */
.project-stack, .proj-detail-stack { display: flex; flex-wrap: wrap; gap: 6px; }
.stack-item {
  font-size: 11px; color: var(--muted);
  padding: 4px 10px; background: var(--bg);
  border: 1px solid var(--line); letter-spacing: 0.04em;
}

/* --- Contact --- */
#contact { background: var(--fg); color: var(--bg); padding: 96px 48px; }
#contact .section-title { color: rgba(255,255,255,0.9); }
#contact .section-num   { color: rgba(255,255,255,0.3); }
.contact-inner { display: flex; justify-content: space-between; align-items: flex-end; }
.contact-left h2 {
  font-family: var(--serif);
  font-size: clamp(42px, 6vw, 80px);
  letter-spacing: -0.03em; line-height: 1; margin-bottom: 32px;
}
.contact-left h2 em { font-style: italic; color: rgba(255,255,255,0.4); }
.contact-links { display: flex; gap: 12px; flex-wrap: wrap; }
.contact-link {
  display: inline-flex; align-items: center; gap: 12px;
  text-decoration: none; color: var(--bg);
  font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
  border: 1px solid rgba(255,255,255,0.25); padding: 14px 28px;
  transition: background 0.2s, color 0.2s;
}
.contact-link:hover { background: var(--bg); color: var(--fg); }
.contact-right { text-align: right; }
.contact-right p { font-size: 12px; color: rgba(255,255,255,0.4); letter-spacing: 0.06em; margin-bottom: 8px; }

/* --- Footer --- */
footer {
  background: var(--fg); color: rgba(255,255,255,0.3);
  padding: 24px 48px;
  display: flex; justify-content: space-between;
  font-size: 11px; letter-spacing: 0.06em;
  border-top: 1px solid rgba(255,255,255,0.1);
}

/* --- Animations --- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.reveal {
  opacity: 0; transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.22,1,0.36,1), transform 0.7s cubic-bezier(0.22,1,0.36,1);
}
.reveal.visible { opacity: 1; transform: translateY(0); }

@media (max-width: 900px) {
  #hero { grid-template-columns: 1fr; min-height: auto; }
  .hero-col-photo { height: auto; aspect-ratio: 4/3; position: relative; }
  .hero-col-text { padding: 40px 32px 60px; }
  .hero-col-text h1 { font-size: clamp(44px, 8vw, 72px); margin-bottom: 24px; }
  .hero-scroll { display: none; }
}

@media (max-width: 768px) {
  /* Sections */
  section { padding: 56px 24px; }
  .section-divider { margin: 0 24px; }
  .section-header { margin-bottom: 40px; }

  /* About — 1 colonne */
  #about .about-grid { grid-template-columns: 1fr; gap: 40px; }

  /* Expériences — 1 colonne */
  #experiences .experiences-list { grid-template-columns: 1fr; }

  /* Projets */
  .projects-wrapper {
    grid-template-columns: 40px 1fr;
    height: 480px;
  }
  .proj-dots { display: none; }
  .project-slide-inner { grid-template-columns: 1fr; }
  .project-image-wrap { height: 160px; border-left: none; border-top: 1px solid var(--line); }
  .project-content { padding: 24px; }

  /* Timeline */
  .timeline-item { grid-template-columns: 1fr; gap: 8px; }
  .timeline-year { padding-top: 0; }

  /* Contact */
  .contact-inner { flex-direction: column; gap: 32px; align-items: flex-start; }
  #contact { padding: 64px 24px; }

  /* Footer */
  footer { flex-direction: column; gap: 8px; padding: 24px; }
}

@media (max-width: 600px) {
  .hero-col-photo { aspect-ratio: 3/4; }
  .hero-col-text { padding: 32px 24px 48px; }
  .hero-col-text h1 { font-size: 44px; }

  /* Tags compétences plus petits */
  .skill-tag { font-size: 11px; padding: 6px 12px; }

  /* Expériences : padding réduit */
  .exp-card { padding: 28px 24px; }
  .exp-title { font-size: 22px; }
}

/* --- Dark mode --- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg:     #0e0e0e;
    --fg:     #f0ede6;
    --muted:  #777;
    --line:   #252525;
    --tag-bg: #1a1a1a;
  }

  .skill-tag:hover { background: var(--fg); color: var(--bg); }

  .exp-card { background: #141414; }
  .exp-card:hover { background: var(--fg); border-color: var(--fg); }
  .exp-card:hover .exp-period,
  .exp-card:hover .exp-location,
  .exp-card:hover .exp-title,
  .exp-card:hover .exp-desc { color: var(--bg); }

  .hero-cta { background: var(--fg); color: var(--bg); }
  .hero-cta--ghost { background: transparent; color: var(--fg); border-color: var(--line); }
  .hero-cta--ghost:hover { background: var(--tag-bg); }

  .cursor { background: var(--fg); }
  .cursor.grow { background: transparent; border-color: var(--fg); }
  .cursor.light { background: var(--bg); }
  .cursor.light.grow { background: transparent; border-color: var(--bg); }
  .cursor.on-dark { background: #fff; }
  .cursor.on-dark.grow { background: transparent; border-color: #fff; }

  footer { color: rgba(0,0,0,0.4); }

  #contact .section-title { color: rgba(0,0,0,0.9); }
  #contact .section-num   { color: rgba(0,0,0,0.3); }
  .contact-left h2 em     { color: rgba(0,0,0,0.35); }
  .contact-link           { color: var(--bg); border-color: rgba(0,0,0,0.25); }
  .contact-link:hover     { background: var(--bg); color: var(--fg); }
  .contact-right p        { color: rgba(0,0,0,0.4); }


}

/* --- Theme toggle button --- */
.theme-toggle {
  background: none;
  border: 1px solid var(--line);
  color: var(--fg);
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  flex-shrink: 0;
}
.theme-toggle:hover { background: var(--fg); color: var(--bg); }
.theme-toggle-mobile { display: none; }
@media (max-width: 768px) {
  .theme-toggle-mobile { display: flex; }
  .theme-toggle-desktop { display: none; }
}

/* --- View Transitions --- */
@view-transition { navigation: auto; }
::view-transition-old(root),
::view-transition-new(root) { animation-duration: 0.2s; animation-timing-function: ease; }

/* --- [data-theme] non-variable overrides --- */
html[data-theme="dark"] .exp-card { background: #141414; }
html[data-theme="dark"] .exp-card:hover { background: var(--fg); border-color: var(--fg); }
html[data-theme="dark"] .exp-card:hover .exp-period,
html[data-theme="dark"] .exp-card:hover .exp-location,
html[data-theme="dark"] .exp-card:hover .exp-title,
html[data-theme="dark"] .exp-card:hover .exp-desc { color: var(--bg); }
html[data-theme="dark"] .exp-card:hover .exp-type { background: rgba(0,0,0,0.06); border-color: rgba(0,0,0,0.15); color: rgba(0,0,0,0.65); }
html[data-theme="dark"] .exp-card:hover .stack-item { background: rgba(0,0,0,0.06); border-color: rgba(0,0,0,0.15); color: rgba(0,0,0,0.65); }
html[data-theme="dark"] footer { color: rgba(0,0,0,0.4); }
html[data-theme="dark"] #contact .section-title { color: rgba(0,0,0,0.9); }
html[data-theme="dark"] #contact .section-num   { color: rgba(0,0,0,0.3); }
html[data-theme="dark"] .contact-left h2 em     { color: rgba(0,0,0,0.35); }
html[data-theme="dark"] .contact-link           { color: var(--bg); border-color: rgba(0,0,0,0.25); }
html[data-theme="dark"] .contact-link:hover     { background: var(--bg); color: var(--fg); }
html[data-theme="dark"] .contact-right p        { color: rgba(0,0,0,0.4); }

html[data-theme="light"] .exp-card { background: var(--tag-bg); }
html[data-theme="light"] .exp-card:hover { background: var(--fg); border-color: var(--fg); }
html[data-theme="light"] .exp-card:hover .exp-period,
html[data-theme="light"] .exp-card:hover .exp-location,
html[data-theme="light"] .exp-card:hover .exp-title,
html[data-theme="light"] .exp-card:hover .exp-desc { color: var(--bg); }
html[data-theme="light"] .exp-card:hover .exp-type { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.3); color: rgba(255,255,255,0.85); }
html[data-theme="light"] .exp-card:hover .stack-item { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.2); color: rgba(255,255,255,0.7); }
html[data-theme="light"] .exp-card:hover .exp-link { color: rgba(255,255,255,0.6); }
html[data-theme="light"] .exp-card:hover .exp-link:hover { color: #fff; }
html[data-theme="light"] footer { color: rgba(255,255,255,0.3); }
html[data-theme="light"] #contact .section-title { color: rgba(255,255,255,0.9); }
html[data-theme="light"] #contact .section-num   { color: rgba(255,255,255,0.3); }
html[data-theme="light"] .contact-left h2 em     { color: rgba(255,255,255,0.4); }
html[data-theme="light"] .contact-link           { color: var(--bg); border-color: rgba(255,255,255,0.25); }
html[data-theme="light"] .contact-link:hover     { background: var(--bg); color: var(--fg); }
html[data-theme="light"] .contact-right p        { color: rgba(255,255,255,0.4); }

/* --- Focus visible --- */
:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 3px;
}
#contact :focus-visible { outline-color: var(--bg); }

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* --- 404 --- */
.nf-main { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.nf-content { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 20px; }
.nf-num { font-family: var(--serif); font-size: clamp(80px, 18vw, 180px); line-height: 1; letter-spacing: -0.04em; color: var(--line); }
.nf-title { font-family: var(--serif); font-size: clamp(22px, 4vw, 40px); letter-spacing: -0.02em; }
.nf-desc { font-size: 14px; color: var(--muted); }

/* --- Scroll-to-top --- */
#scroll-top {
  position: fixed; bottom: 32px; right: 32px; z-index: 200;
  width: 40px; height: 40px;
  background: var(--fg); color: var(--bg);
  border: none; cursor: pointer; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: translateY(10px);
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
}
#scroll-top.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
#scroll-top:hover { opacity: 0.75; }
@media (max-width: 768px) { #scroll-top { bottom: 20px; right: 16px; } }

/* --- High contrast --- */
@media (prefers-contrast: more) {
  :root {
    --muted: var(--fg);
    --line: var(--fg);
    --tag-bg: transparent;
  }
  html[data-theme="dark"] {
    --muted: var(--fg);
    --line: var(--fg);
    --tag-bg: transparent;
  }
  nav { border-bottom: 2px solid var(--fg); }
  .mobile-menu { border-top: 2px solid var(--fg); }
  .mobile-menu li { border-bottom: 2px solid var(--fg); }
  .section-divider { border-top: 2px solid var(--fg); }
  .stack-item, .skill-tag, .hero-tag, .exp-type { border-width: 2px; }
  .exp-card { outline: 1px solid var(--fg); }
  .hero-cta { border-width: 2px; }
  * { text-shadow: none !important; }
}

/* --- Print --- */
@media print {
  .cursor, nav, .nav-links-desktop, .mobile-menu,
  .hero-scroll, .section-divider, #projects,
  .hero-cta, footer { display: none !important; }

  body { background: #fff; color: #000; font-size: 12pt; cursor: auto; }

  #hero {
    display: block;
    min-height: auto;
    page-break-after: always;
  }
  .hero-col-photo { display: none; }
  .hero-col-text  { padding: 24pt 0; }
  .hero-col-text h1 { font-size: 28pt; }

  section { padding: 24pt 0; page-break-inside: avoid; }
  .exp-card { background: none; border: 1pt solid #ccc; break-inside: avoid; }
  .timeline-item { break-inside: avoid; }
  a { color: #000; text-decoration: none; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 9pt; color: #555; }
  .hero-tag, .exp-type, .stack-item, .skill-tag { border: 1pt solid #ccc; }
}

/* --- Custom font overrides (hero + contact) --- */
.hero-col-text h1,
.contact-left h2 {
  font-family: 'Syne', sans-serif;
}