/* --- Reset minimal --- */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
img { max-width: 100%; display: block; }
a { color: inherit; }

/* --- Thème clair (défaut) --- */
:root {
  --color-bg: #faf6ee;
  --color-bg-alt: #f0e9d8;
  --color-text: #1c1a17;
  --color-text-muted: #55504a;
  --color-accent: #8a2b1d;
  --color-rule: #1c1a17;

  --font-serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* --- Thème sombre --- */
@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #1b1917;
    --color-bg-alt: #26221e;
    --color-text: #f0ebe0;
    --color-text-muted: #b8b0a2;
    --color-accent: #e2795f;
    --color-rule: #f0ebe0;
  }
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  line-height: 1.5;
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 0.5em;
}

a {
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

a:hover, a:focus-visible {
  color: var(--color-accent);
}

a:focus-visible, button:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* --- Utilitaires accessibilité --- */
.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;
}

.skip-link {
  position: absolute;
  top: -3rem;
  left: 1rem;
  background: var(--color-accent);
  color: var(--color-bg);
  padding: 0.6rem 1rem;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  z-index: 100;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 1rem;
  color: var(--color-bg);
}

/* --- Manchette --- */
.masthead {
  max-width: 60rem;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 1.5rem;
  text-align: center;
}

.kicker {
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin: 0 0 1rem;
}

.kicker-date {
  text-transform: none;
  letter-spacing: normal;
  font-weight: 400;
}

.masthead h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 900;
  margin: 0 0 0.75rem;
}

.tagline {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  color: var(--color-text-muted);
  max-width: 40rem;
  margin: 0 auto;
}

.rule {
  border: none;
  border-top: 3px double var(--color-rule);
  margin: 2rem auto 0;
  max-width: 60rem;
}

/* --- Chapô --- */
.chapo {
  max-width: 42rem;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.chapo p {
  font-family: var(--font-serif);
  font-size: clamp(1.15rem, 2vw, 1.35rem);
  line-height: 1.6;
}

/* --- Projets --- */
.projects {
  max-width: 72rem;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

.projects h2 {
  font-size: 1.75rem;
  border-bottom: 3px solid var(--color-rule);
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}

.category-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.category-filter button {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.4rem 0.9rem;
  border: 2px solid var(--color-rule);
  border-radius: 999px;
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
}

.category-filter button[aria-pressed="true"] {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-bg);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 1.5rem;
}

.project-card {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-rule);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.project-kicker {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
  line-height: 1.5;
  min-height: 2.25rem;
  margin: 0;
}

.project-card h3 {
  font-size: 1.25rem;
  line-height: 1.2;
  min-height: 3rem;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.project-favicon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  border-radius: 2px;
}

.project-desc {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  flex-grow: 1;
  margin: 0;
}

.project-stack {
  font-size: 0.8rem;
  font-family: monospace;
  margin: 0;
}

.project-links {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
}

.project-card[hidden] {
  display: none;
}

/* --- Compétences --- */
.skills {
  max-width: 72rem;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1.5rem;
  border-top: 3px solid var(--color-rule);
}

.skills h2 {
  grid-column: 1 / -1;
  font-size: 1.75rem;
  margin-top: 1.5rem;
}

.skill-block h3 {
  font-size: 1.1rem;
  border-bottom: 1px solid var(--color-text-muted);
  padding-bottom: 0.3rem;
}

.skill-block p {
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

/* --- Pied de page --- */
.masthead-foot {
  max-width: 72rem;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  border-top: 3px double var(--color-rule);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 1.5rem;
  font-size: 0.9rem;
}

.foot-col h4 {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
}

.foot-col p {
  margin: 0.25rem 0;
}

.foot-note {
  grid-column: 1 / -1;
  color: var(--color-text-muted);
  font-size: 0.8rem;
  margin-top: 1rem;
}

/* --- Responsive : mobile --- */
@media (max-width: 30rem) {
  .masthead {
    padding: 1.5rem 1rem 1rem;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }
}
