:root {
  --bg: #ffffff;
  --bg-alt: #f4f5f7;
  --text: #1a1d23;
  --text-muted: #5a6270;
  --border: #e2e4e9;
  --accent: #d33f49;
  --accent-contrast: #ffffff;
  --code-bg: #1a1d23;
  --code-text: #e9ebef;
  --radius: 10px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a;
    --bg-alt: #1c1f24;
    --text: #eceef1;
    --text-muted: #9aa1ad;
    --border: #2b2f36;
    --accent: #ef5b64;
    --accent-contrast: #14161a;
    --code-bg: #0e0f12;
    --code-text: #e9ebef;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.hero {
  position: relative;
  padding: 5rem 0 4rem;
  text-align: center;
  background: linear-gradient(180deg, var(--bg-alt), var(--bg));
  border-bottom: 1px solid var(--border);
}

.lang-switch {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  padding: 0.3rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
}

.lang-switch:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 0.75rem;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  margin: 0 0 1rem;
}

.tagline {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 40rem;
  margin: 0 auto 2rem;
}

.cta-group {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.section .cta-group {
  justify-content: flex-start;
}

.button {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  border: 1px solid transparent;
  transition: transform 0.1s ease, opacity 0.15s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  background: var(--accent);
  color: var(--accent-contrast);
}

.button-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.stats {
  padding: 3rem 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1.5rem;
  text-align: center;
}

.stat-value {
  display: block;
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--accent);
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.section {
  padding: 3rem 0;
}

.section-alt {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section h2 {
  font-size: 1.6rem;
  margin-bottom: 1.5rem;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.card {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}

.card h3 {
  margin-top: 0;
  font-size: 1.05rem;
}

.card p {
  color: var(--text-muted);
  margin-bottom: 0;
}

.code-block {
  background: var(--code-bg);
  color: var(--code-text);
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 0.9rem;
  margin: 0 0 0.75rem;
}

.code-block code {
  font-family: "SF Mono", Consolas, Monaco, monospace;
}

.note {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.note a {
  color: var(--accent);
}

table.endpoints {
  width: 100%;
  border-collapse: collapse;
  overflow-x: auto;
  display: block;
}

table.endpoints th,
table.endpoints td {
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}

table.endpoints th {
  color: var(--text-muted);
  font-weight: 600;
}

table.endpoints code {
  font-family: "SF Mono", Consolas, Monaco, monospace;
  color: var(--accent);
}

details {
  margin-top: 1.25rem;
}

details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--accent);
  padding: 0.4rem 0;
}

details[open] summary {
  margin-bottom: 0.75rem;
}

.set-ids-table-wrap {
  max-height: 420px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.set-ids-table-wrap table.endpoints {
  border: none;
}

.search-form {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin: 1.5rem 0 0.75rem;
}

.search-form input {
  flex: 1 1 260px;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
}

.search-form input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.search-form button {
  border: none;
  cursor: pointer;
  font-size: 1rem;
}

.turnstile-widget {
  flex-basis: 100%;
}

.search-status {
  color: var(--text-muted);
  font-size: 0.9rem;
  min-height: 1.3em;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.card-tile {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.card-tile-media {
  aspect-ratio: 5 / 7;
  border-radius: calc(var(--radius) - 4px);
  background: var(--bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.card-tile-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.card-tile-placeholder {
  color: var(--text-muted);
  font-size: 0.8rem;
  text-align: center;
  padding: 0 0.5rem;
}

.card-tile h4 {
  margin: 0.15rem 0 0;
  font-size: 0.95rem;
  line-height: 1.3;
}

.card-tile-meta {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.card-tile-price {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.price-line {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: inherit;
  text-decoration: none;
}

a.price-line:hover {
  text-decoration: underline;
}

.price-icon {
  width: 14px;
  height: 14px;
  object-fit: contain;
  flex-shrink: 0;
}

.console {
  margin-top: 1.25rem;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.console-output {
  background: var(--code-bg);
  color: var(--code-text);
  font-family: "SF Mono", Consolas, Monaco, monospace;
  font-size: 0.85rem;
  padding: 1rem 1.25rem;
  max-height: 360px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.console-output:empty::before {
  content: "Aucune commande exécutée pour l'instant.";
  color: #8a8f98;
}

.console-line-cmd {
  color: #7ee787;
  margin: 0 0 0.15rem;
}

.console-line-cmd::before {
  content: "$ ";
  opacity: 0.6;
}

.console-line-error {
  color: #ff7b72;
  margin: 0 0 1rem;
}

.console-line-result {
  margin: 0 0 1rem;
}

.json-key { color: #79c0ff; }
.json-string { color: #a5d6ff; }
.json-number { color: #f2cc60; }
.json-boolean { color: #ff9492; }
.json-null { color: #8a8f98; }

.console-input-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--code-bg);
  padding: 0.6rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.console-prompt {
  color: #7ee787;
  font-family: "SF Mono", Consolas, Monaco, monospace;
  font-size: 0.85rem;
  font-weight: 600;
}

.console-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--code-text);
  font-family: "SF Mono", Consolas, Monaco, monospace;
  font-size: 0.85rem;
  padding: 0.3rem 0;
}

.console-input:focus {
  outline: none;
}

.footer {
  padding: 2rem 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  border-top: 1px solid var(--border);
}

.footer-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.footer-github {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
  text-decoration: none;
}

.footer-github:hover {
  color: var(--accent);
}

.footer-sep {
  opacity: 0.5;
}
