@import url('https://fonts.googleapis.com/css2?family=Geist+Mono:wght@100..900&display=swap');
@import url('https://cdn.jsdelivr.net/gh/eigilnikolajsen/commit-mono@latest/css/commit-mono.css');

/* ========== VARIABLES ========== */
:root {
  /* Colors - THÈME SOMBRE */
  --bg: #0d0d0d;
  --surface: #121212;
  --line: #232323;
  --text: #f2f2f2;
  --text-soft: #a8a8a8;
  --text-muted: #909090;
  --text-dim: #6f6f6f;
  --mono: #c6c6c6;
  --mono-soft: #9a9a9a;

  /* Typography */
  --font-sans: 'Switzer-Variable', sans-serif;
  --font-mono: 'CommitMono', monospace;
  --text-xs: .64rem;
  --text-sm: .74rem;
  --text-md: .92rem;
  --tracking-ui: .05em;
  --tracking-wide: .08em;

  /* Layout */
  --header-h: 52px;
  --footer-h: 40px;
  --timeline-h: 30px;
  --page-padding: 1.2rem;
  --gap-sm: .6rem;
  --gap-md: 1.2rem;
  --gap-lg: 1.4rem;
  --radius-sm: .35rem;
  --radius-md: .5rem;
  --radius-lg: .8rem;

  /* Effects */
  --blur-ui: 14px;
  --panel-bg: rgba(13, 13, 13, .86);
  --ease: cubic-bezier(.16, 1, .3, 1);
  --transition-fast: .25s;
  --transition-medium: .45s;
  --transition-slow: 1s;
  --shadow-project: 0 30px 80px rgba(0, 0, 0, .32);
  --card-width: min(74vw, 1180px);
}

/* ========== FONTS ========== */
@font-face {
  font-family: 'Switzer-Variable';
  src: url('../fonts/switzer/Switzer-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

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

html {
  scroll-behavior: smooth;
}

/* ========== BASE ========== */
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  animation: pageReveal .7s cubic-bezier(.16, 1, .3, 1);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .018;
  background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, .16) 1px, transparent 0);
  background-size: 7px 7px;
  z-index: 999;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at center, transparent 35%, rgba(0, 0, 0, .34) 100%);
  z-index: 998;
}

img { display: block; }
a { color: inherit; text-decoration: none; }

/* ========== ANIMATIONS ========== */
@keyframes pageReveal {
  from { opacity: 0; transform: translateY(8px); filter: brightness(.7); }
  to { opacity: 1; transform: none; filter: brightness(1); }
}

@keyframes pulse {
  0%, 100% { opacity: .9; }
  50% { opacity: .3; }
}

/* ========== TYPOGRAPHY ========== */
.mono,
.header-description,
.header-right span,
.section-title,
.section-meta,
.kicker,
.block-title,
.cv-date,
.footer-item,
.tech-level,
.ui-mono,
.content-title,
.content-meta,
.project-meta,
.project-timecode,
.project-sub,
.rec-label {
  font-family: var(--font-mono);
  font-weight: 550;
  letter-spacing: .045em;
  text-transform: uppercase;
  text-rendering: geometricPrecision;
}

.ui-mono {
  font-size: var(--text-xs);
}

.ui-dim { color: var(--text-dim); }
.ui-muted { color: var(--text-muted); }
.ui-soft { color: var(--text-soft); }

.ui-link,
.return-link {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-ui);
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color var(--transition-medium) ease, opacity var(--transition-medium) ease;
}

.ui-link:hover,
.ui-link.active,
.return-link:hover {
  color: white;
}

.glass-panel {
  background: var(--panel-bg);
  backdrop-filter: blur(var(--blur-ui));
}

/* ========== HEADER ========== */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-h);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--page-padding);
  border-bottom: 1px solid var(--line);
  background: var(--panel-bg);
  backdrop-filter: blur(var(--blur-ui));
}

.header-left,
.header-right {
  display: flex;
  align-items: center;
}

.header-left { gap: var(--gap-md); }
.header-right { gap: .9rem; }

.logo {
  font-size: .84rem;
  font-weight: 500;
  letter-spacing: -.035em;
  text-transform: uppercase;
}

.header-separator {
  width: 1px;
  height: 12px;
  background: var(--line);
}

.header-description,
.header-right span {
  font-size: .72rem;
  color: var(--mono);
}

/* ========== STATUS DOT ========== */
.status {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: white;
  animation: pulse 2.4s ease-in-out infinite;
}

/* ========== FOOTER ========== */
footer {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 100%;
  height: var(--footer-h);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--page-padding);
  border-top: 1px solid var(--line);
  background: #0f0f0f;
  will-change: transform;
}

.footer-left,
.footer-links {
  display: flex;
  align-items: center;
  gap: var(--gap-md);
}

.footer-item {
  font-size: var(--text-xs);
  color: var(--mono-soft);
}

/* ========== SYSTEM MESSAGES ========== */
.system-message,
.sequence-indicator {
  position: fixed;
  left: var(--page-padding);
  z-index: 70;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-ui);
  text-transform: uppercase;
}

.system-message {
  bottom: calc(var(--footer-h) + 18px);
  color: var(--text-dim);
}

.sequence-indicator {
  bottom: calc(var(--footer-h) + 38px);
  color: var(--text-soft);
}

/* ========== PAGE TRANSITION OVERLAY ========== */
#page-transition-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  pointer-events: none;
  background: var(--bg);
  opacity: 0;
  transition: opacity .35s ease;
}

#page-transition-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* BANDS HORIZONTALES */
#transition-bands {
  position: absolute;
  inset: 0;
  z-index: 10002;
  pointer-events: none;
}

.transition-band {
  position: absolute;
  left: 0;
  width: 0%;
  background: var(--bg);
  will-change: width;
}

/* SCAN LINE VERTICALE */
#transition-scanline {
  position: absolute;
  top: 0;
  left: -3px;
  width: 3px;
  height: 100%;
  z-index: 10003;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(255,255,255,.15) 20%,
    rgba(255,255,255,.95) 45%,
    rgba(255,255,255,1)   50%,
    rgba(255,255,255,.95) 55%,
    rgba(255,255,255,.15) 80%,
    transparent 100%
  );
  box-shadow:
    0 0 18px 4px rgba(255,255,255,.35),
    0 0 40px 8px rgba(255,255,255,.12);
  will-change: transform, opacity;
}

/* TIMECODE OVERLAY */
#transition-tc-overlay {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10004;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: .12em;
  color: rgba(255,255,255,.9);
  opacity: 0;
  pointer-events: none;
  text-transform: uppercase;
  transition: opacity .2s ease;
}

/* STATE LABEL */
#transition-state-label {
  position: absolute;
  bottom: calc(var(--footer-h) + 18px);
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: .54rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-dim);
  white-space: nowrap;
  z-index: 10001;
  transition: color .3s ease;
}

/* PAGE FADE EFFECT */
.page-transition-effect {
  transition: opacity .35s ease, transform .35s ease, filter .35s ease;
}

.page-transition-effect.out {
  opacity: 0;
  transform: translateY(-6px);
  filter: brightness(.5);
}

.page-transition-effect.in {
  opacity: 1;
  transform: translateY(0);
  filter: brightness(1);
}


/* Touch-friendly scrolling sur mobile */
@media(max-width: 900px) {
  html {
    touch-action: pan-y pinch-zoom;
  }
  
  body {
    overscroll-behavior: contain;
  }
  
  a, button {
    -webkit-tap-highlight-color: transparent;
  }
}