/* ================================
   STYLE CSS – Base du portfolio
   ================================ */

/* =============================
   Polices auto-hébergées
   ============================= */
@font-face {
  font-family: 'General Sans';
  src: url('../fonts/GeneralSans-Variable.woff2') format('woff2');
  font-weight: 200 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'General Sans';
  src: url('../fonts/GeneralSans-VariableItalic.woff2') format('woff2');
  font-weight: 200 700;
  font-style: italic;
  font-display: swap;
}

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

/* =============================
   Base globale
   ============================= */
html {
  background-color: var(--color-bg);
}

body {
  font-family: var(--font-base);
  font-size: var(--text-base);
  font-weight: 400;
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.6;
  overflow-x: hidden;
}

.js body {
  overflow: hidden;
}

button {
  color: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
}

::selection {
  background-color: var(--color-primary);
  color: var(--color-text-inverse);
}

/* =============================
   Accessibilité
   ============================= */
:focus-visible {
  outline: 1px solid var(--color-primary);
  outline-offset: 6px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* =============================
   Utilitaires typographiques
   ============================= */
.label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 400;
  letter-spacing: var(--tracking-label);
  line-height: 1.4;
}

.upper {
  text-transform: uppercase;
}

/* =============================
   Repères fixes (coins)
   ============================= */
.corner {
  position: fixed;
  z-index: var(--z-sticky);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--color-text-light);
}

.corner-tr { top: var(--space-lg); right: var(--space-lg); }
.corner-bl { bottom: var(--space-lg); left: var(--space-lg); }
.corner-br { bottom: var(--space-lg); right: var(--space-lg); }

.corner a,
.corner button {
  color: inherit;
  padding: var(--space-sm);
  transition: color var(--transition-base);
}

.corner a:hover,
.corner button:hover,
.corner [aria-current='page'] {
  color: var(--color-text);
}

.lang-switch {
  z-index: var(--z-modal);
  animation: fade 0.8s ease both 0.2s;
}

/* Fondu natif entre les pages FR / EN (navigateurs compatibles) */
@view-transition {
  navigation: auto;
}

/* Changement de langue : on n'accueille pas deux fois */
.no-intro .entry-letter,
.no-intro .entry-rule,
.no-intro .entry-enter,
.no-intro .lang-switch {
  animation: none;
}

/* =============================
   Animations partagées
   ============================= */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(0.4em);
    filter: blur(8px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes breathe {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  /* Restent actifs : dérive lente des bulles, scintillement discret des formes cliquables */
  *:not(.ambient-orb, .ambient-orbit, .shape, .object-name),
  *::before,
  *:not(.object-trigger)::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }
}
