/* Tang-IA: base.css
   Reset moderne, typographie de base, layout primitives */

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

* {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

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

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: none;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--duration-base) var(--ease-out);
}

ul, ol {
  list-style: none;
}

/* === HEADINGS === */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--leading-tight);
  letter-spacing: -0.025em;
  color: var(--text-primary);
}

h1 {
  font-size: var(--text-6xl);
  font-weight: 600;
  letter-spacing: -0.04em;
}

h2 {
  font-size: var(--text-5xl);
  font-weight: 600;
  letter-spacing: -0.035em;
}

h3 {
  font-size: var(--text-3xl);
  font-weight: 600;
  letter-spacing: -0.025em;
}

h4 {
  font-size: var(--text-2xl);
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* Headline em : surligne vert, texte bleu nuit */
h1 em, h2 em, h3 em, .text-accent-display {
  font-style: normal;
  font-weight: 600;
  color: var(--text-primary);
  position: relative;
  display: inline-block;
}

h1 em::after, h2 em::after, h3 em::after, .text-accent-display::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0.05em;
  width: 100%;
  height: 0.22em;
  background: var(--accent);
  z-index: -1;
  transform: skew(-6deg);
  opacity: 0.7;
}

p {
  line-height: var(--leading-relaxed);
}

em, i {
  font-style: italic;
}

strong, b {
  font-weight: 600;
}

/* === SELECTION === */
::selection {
  background: var(--accent);
  color: var(--text-primary);
}

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

/* === FOCUS === */
:focus-visible {
  outline: 2px solid var(--text-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

button:focus-visible,
a:focus-visible {
  outline-offset: 4px;
}

/* === LAYOUT PRIMITIVES === */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-padding);
}

.container-narrow {
  width: 100%;
  max-width: var(--container-narrow);
  margin-inline: auto;
  padding-inline: var(--container-padding);
}

section {
  padding-block: clamp(var(--space-16), 8vw, var(--space-24));
  position: relative;
}

section.tight {
  padding-block: clamp(var(--space-12), 6vw, var(--space-16));
}

/* === UTILITY === */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-accent {
  color: var(--accent-deep);
}

.text-secondary {
  color: var(--text-secondary);
}

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

.text-italic {
  font-style: italic;
}

.text-serif {
  font-family: var(--font-serif);
}

.text-center {
  text-align: center;
}

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }

/* === SCROLLBAR === */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: var(--bg-subtle);
}

::-webkit-scrollbar-thumb {
  background: var(--border-medium);
  border-radius: var(--radius-full);
  border: 3px solid var(--bg-subtle);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* === SCROLL REVEAL ANIMATIONS === */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--duration-slower) var(--ease-out),
              transform var(--duration-slower) var(--ease-out);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 100ms; }
.reveal-delay-2 { transition-delay: 200ms; }
.reveal-delay-3 { transition-delay: 300ms; }
.reveal-delay-4 { transition-delay: 400ms; }
.reveal-delay-5 { transition-delay: 500ms; }

/* === MOBILE === */
@media (max-width: 768px) {
  section {
    padding-block: clamp(var(--space-12), 12vw, var(--space-16));
  }
}
