/* staging-v2/shared/base.css
 * Lil Big Web V2 — reset + composants partagés
 */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--text-bright);
  background: var(--bg-deep);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg, video { display: block; max-width: 100%; }

button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }

/* === TYPOGRAPHIE === */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--text-bright);
}

p { color: var(--text-mid); }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--phosphor); }

code, pre, .mono {
  font-family: var(--font-mono);
  font-feature-settings: "calt" 1, "ss01" 1;
}

::selection {
  background: var(--phosphor);
  color: var(--bg-deep);
}

/* === LAYOUT === */
.container {
  width: min(var(--container-base), 100% - 2rem);
  margin-inline: auto;
}

.container-wide {
  width: min(var(--container-wide), 100% - 2rem);
  margin-inline: auto;
}

.section {
  padding-block: var(--space-section);
}

/* === TERMINAL BLOCK === */
.terminal {
  background: var(--bg-surface);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: 1.7;
  color: var(--text-mid);
  overflow: hidden;
  box-shadow:
    0 0 0 1px var(--border-faint),
    0 20px 60px -20px rgba(0, 0, 0, 0.6);
}

.terminal__bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.9rem;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-faint);
}

.terminal__dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--text-faint);
}

.terminal__dot:nth-child(1) { background: #ef4444; }
.terminal__dot:nth-child(2) { background: #f59e0b; }
.terminal__dot:nth-child(3) { background: var(--phosphor); }

.terminal__title {
  font-size: var(--text-2xs);
  color: var(--text-dim);
  margin-left: auto;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.terminal__body {
  padding: var(--space-lg);
  min-height: 200px;
}

.terminal__line { display: block; min-height: 1.5em; }
.terminal__line--prompt::before {
  content: "$ ";
  color: var(--phosphor);
  font-weight: 600;
}
.terminal__line--out  { color: var(--text-mid); }
.terminal__line--ok   { color: var(--phosphor); }
.terminal__line--warn { color: var(--accent-warn); }
.terminal__line--dim  { color: var(--text-dim); }

.cursor {
  display: inline-block;
  width: 0.55ch;
  height: 1.1em;
  background: var(--phosphor);
  vertical-align: text-bottom;
  margin-left: 2px;
  animation: blink 1s steps(2) infinite;
  box-shadow: 0 0 8px var(--phosphor-glow);
}

@keyframes blink {
  50% { opacity: 0; }
}

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.4rem;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 500;
  text-transform: lowercase;
  letter-spacing: 0.02em;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-mid);
  background: transparent;
  color: var(--text-bright);
  cursor: pointer;
  transition:
    color var(--dur-base) var(--ease-out-expo),
    border-color var(--dur-base) var(--ease-out-expo),
    box-shadow var(--dur-base) var(--ease-out-expo),
    background var(--dur-base) var(--ease-out-expo);
}

.btn::before {
  content: "> ";
  color: var(--phosphor);
  opacity: 0;
  transform: translateX(-4px);
  transition: all var(--dur-base) var(--ease-out-expo);
  width: 0;
  overflow: hidden;
}

.btn:hover {
  border-color: var(--phosphor);
  color: var(--phosphor);
  box-shadow: 0 0 0 4px var(--phosphor-glow);
}

.btn:hover::before {
  opacity: 1;
  width: 1.4ch;
  transform: translateX(0);
}

.btn--primary {
  background: var(--phosphor);
  color: var(--bg-deep);
  border-color: var(--phosphor);
  font-weight: 700;
}

.btn--primary:hover {
  background: var(--phosphor-dim);
  color: var(--bg-deep);
  box-shadow: 0 0 32px var(--phosphor-glow);
}

.btn--ghost {
  border-color: transparent;
  color: var(--text-mid);
}

/* === METRIC TILE === */
.metric {
  background: var(--bg-surface);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: border-color var(--dur-base) var(--ease-out-expo);
}

.metric:hover {
  border-color: var(--border-mid);
}

.metric__label {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.metric__value {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--text-bright);
}

.metric__value--phosphor { color: var(--phosphor); }
.metric__value--warn     { color: var(--accent-warn); }

.metric__hint {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-mid);
}

/* === GRID BG (subtil, technique) === */
.grid-bg {
  background-image:
    linear-gradient(var(--border-faint) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-faint) 1px, transparent 1px);
  background-size: 80px 80px;
}

.grid-bg--fine {
  background-image:
    linear-gradient(var(--border-faint) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-faint) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* === HELPERS === */
.text-phosphor { color: var(--phosphor); }
.text-warn     { color: var(--accent-warn); }
.text-bright   { color: var(--text-bright); }
.text-mid      { color: var(--text-mid); }
.text-dim      { color: var(--text-dim); }

.uppercase { text-transform: uppercase; letter-spacing: 0.1em; }

.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 700ms var(--ease-out-expo),
    transform 700ms var(--ease-out-expo);
}
.fade-in.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-in[data-delay="1"] { transition-delay: 80ms; }
.fade-in[data-delay="2"] { transition-delay: 160ms; }
.fade-in[data-delay="3"] { transition-delay: 240ms; }
.fade-in[data-delay="4"] { transition-delay: 320ms; }

/* === STAGING NAV (dev only — caché en prod) === */
.staging-nav {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 100;
  background: var(--bg-elevated);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-md);
  padding: 0.4rem 0.8rem;
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  color: var(--text-mid);
  backdrop-filter: blur(8px);
}
.staging-nav a { color: var(--phosphor); margin-left: 0.5rem; }
