
/* Variables et couleurs */

:root {
  color-scheme: light;

  --color-primary: #f7b13c;
  --color-primary-dark: #c3763c;
  --color-primary-light: #fef4cc;

  --color-background: #fafafa;
  --color-surface: #ffffff;
  --color-text: #171717;
  --color-text-muted: #737373;
  --color-border: #e5e5e5;

  --color-hover: #e7bd72;
  --color-shadow: rgb(0 0 0 / 4%);

  --radius: 12px;
  --container-width: 1300px;
}

/* Dark Mode */

:root[data-theme="dark"] {
  color-scheme: dark;

  --color-primary: #f7b13c;
  --color-primary-dark: #f7b13c;
  --color-primary-light: #3b2b17;

  --color-background: #111111;
  --color-surface: #1b1b1b;
  --color-text: #f5f5f5;
  --color-text-muted: #a1a1aa;
  --color-border: #303030;

  --color-hover: #d99527;
  --color-shadow: rgb(0 0 0 / 15%);
}

/* Base */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body {
  margin: 0;
  background: var(--color-background);
  color: var(--color-text);
  font-family:
    Inter, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-size: 16px;
  line-height: 1.6;

  transition:
    background-color 200ms ease,
    color 200ms ease;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

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

.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;
}

/* En-tête */

.header {
  max-width: var(--container-width);
  min-height: 76px;
  margin: 0 auto;
  padding: 16px 24px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;

  border-bottom: 1px solid var(--color-border);

  transition: border-color 200ms ease;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;

  font-size: 1.5rem;
  font-weight: 750;
  letter-spacing: -0.01em;
}

.logo img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.navigation {
  display: flex;
  align-items: center;
  margin-left: auto;
  margin-right: 15px;
  gap: 24px;
}

.navigation a {
  color: var(--color-text-muted);
  font-size: 1rem;
  transition: color 150ms ease;
}

.navigation a:hover {
  color: var(--color-primary-dark);
}

/* Bouton Dark Mode */

/* Bouton de changement de thème */

.theme-toggle {
  display: grid;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  margin-left: 0;
  place-items: center;

  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface);

  cursor: pointer;

  transition:
    background-color 150ms ease,
    border-color 150ms ease,
    transform 150ms ease;
}

.theme-toggle:hover {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
}

.theme-toggle:active {
  transform: scale(0.94);
}

.theme-toggle img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

/* Présentation */

.hero {
  max-width: 900px;
  margin: 0 auto;
  padding: 88px 24px 64px;
  text-align: center;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 18px;
  padding: 5px 12px;

  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-primary-light);

  color: var(--color-primary-dark);
  font-size: 0.8rem;
  font-weight: 600;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.5rem, 6vw, 4rem);
  line-height: 1.12;
  letter-spacing: -0.04em;
}

.hero h1 span {
  color: var(--color-primary-dark);
}

.hero > p {
  max-width: 520px;
  margin: 20px auto 30px;
  color: var(--color-text-muted);
}

/* Barre de recherche */

.search {
  display: flex;
  align-items: center;
  gap: 12px;

  padding: 7px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);

  text-align: left;
  box-shadow: 0 4px 16px var(--color-shadow);

  transition:
    background-color 200ms ease,
    border-color 200ms ease;
}

.search > span {
  padding-left: 10px;
  color: var(--color-text-muted);
  font-size: 1.5rem;
}

.search input {
  width: 100%;
  min-width: 0;
  padding: 9px 0;

  border: 0;
  outline: none;
  background: transparent;
  color: var(--color-text);
}

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

.search input:focus-visible {
  outline: none;
}

.search button {
  flex-shrink: 0;
  padding: 10px 16px;

  border: 0;
  border-radius: 8px;
  background: var(--color-primary);
  color: #171717;

  font-size: 0.875rem;
  font-weight: 650;
  cursor: pointer;

  transition: background 150ms ease;
}

.search button:hover {
  background: var(--color-hover);
}

/* Sections */

.tools,
.categories {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px 64px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.section-heading h2,
.categories h2 {
  margin: 0;
  font-size: 1.4rem;
  letter-spacing: -0.035em;
}

.section-heading p {
  margin: 5px 0 0;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

/* Cartes des outils */

.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.tool-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;

  min-height: 220px;
  padding: 22px;

  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);

  transition:
    background-color 200ms ease,
    border-color 150ms ease,
    color 200ms ease,
    transform 150ms ease,
    box-shadow 150ms ease;
}

.tool-card:hover {
  transform: translateY(-2px);
  border-color: var(--color-hover);
  box-shadow: 0 8px 24px var(--color-shadow);
}

.tool-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;

  border-radius: 10px;
  background: var(--color-primary-light);
  color: var(--color-primary-dark);

  font-size: 1.5rem;
  font-weight: 650;
}

.tool-card h3 {
  margin: 18px 0 4px;
  font-size: 1.05rem;
  letter-spacing: -0.025em;
}

.tool-card p {
  margin: 0 0 20px;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.tool-link {
  margin-top: auto;
  color: var(--color-primary-dark);
  font-size: 0.875rem;
  font-weight: 600;
}

/* Catégories */

.categories {
  padding-bottom: 72px;
}

.categories h2 {
  margin-bottom: 20px;
}

.category-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.category-list a {
  padding: 9px 14px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);

  color: var(--color-text-muted);
  font-size: 0.875rem;

  transition:
    background-color 200ms ease,
    color 150ms ease,
    border-color 150ms ease;
}

.category-list a:hover {
  border-color: var(--color-primary);
  color: var(--color-primary-dark);
}

/* Mobile */

@media (max-width: 600px) {
  .header {
    min-height: 64px;
    padding: 14px 18px;
    gap: 12px;
  }

  .navigation {
    gap: 14px;
  }

  .navigation a {
    font-size: 0.8rem;
  }

  .theme-toggle {
    width: 36px;
    height: 36px;
  }

  .hero {
    padding: 64px 20px 48px;
  }

  .hero h1 {
    font-size: clamp(2.4rem, 11vw, 3.2rem);
  }

  .search {
    flex-wrap: wrap;
  }

  .search input {
    flex: 1;
  }

  .search button {
    width: 100%;
  }

  .tools,
  .categories {
    padding-right: 18px;
    padding-left: 18px;
  }

  .tool-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .tool-card {
    min-height: 190px;
  }
}

/* Respect du réglage de réduction des animations */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
