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

html { background: var(--page); }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--t1);
  font-family: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
h1, h2, p { margin: 0; }
button, input, select { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--t1);
  outline-offset: 2px;
}

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

.icon {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Barre du haut ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 24px;
  background: var(--side);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-symbol { flex: none; width: 18px; height: 18px; }
.brand-name {
  font-size: 17px;
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.03em;
}
.brand-mention {
  color: var(--t3);
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 12px;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--t2);
  cursor: pointer;
}
.icon-button:hover { color: var(--t1); border-color: var(--line2); }

/* ---------- Contenu ---------- */
.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 48px 24px 64px;
}

.hero h1 {
  font-size: 36px;
  line-height: 40px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.hero p { margin-top: 8px; color: var(--t2); }

.search-field {
  position: relative;
  margin: 28px 0 40px;
}
.search-icon {
  position: absolute;
  left: 14px;
  top: 13px;
  color: var(--t3);
  pointer-events: none;
}
.search-field input {
  width: 100%;
  height: 44px;
  padding: 0 14px 0 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--raised);
  color: var(--t1);
}
.search-field input::placeholder { color: var(--t3); }
.search-field input:focus { border-color: var(--acc); outline: none; }

.section-title {
  margin: 0 0 14px;
  color: var(--t3);
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ---------- Plateformes ---------- */
.platform-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}

.platform-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
}
.platform-card:hover { border-color: var(--line2); }

.tile {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--raised);
}
.tile svg { width: 24px; height: 24px; }

.platform-body { flex: 1; min-width: 0; }
.platform-name { display: block; font-size: 17px; line-height: 1.2; font-weight: 600; }
.platform-role { display: block; margin-top: 4px; color: var(--t2); font-size: 13px; }
.platform-url {
  display: block;
  margin-top: 8px;
  color: var(--t3);
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.arrow {
  width: 18px;
  height: 18px;
  flex: none;
  color: var(--t3);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.platform-card:hover .arrow { color: var(--acc); }

/* ---------- Outils externes ---------- */
.tool-list {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  overflow: hidden;
}

.tool-row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 56px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
}
.tool-row:last-child { border-bottom: 0; }
.tool-row:hover { background: var(--raised); }

.tool-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--t2);
}

.tool-body { flex: 1; min-width: 0; }
.tool-name { display: block; font-size: 14px; font-weight: 500; }
.tool-url {
  display: block;
  color: var(--t3);
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.tool-row:hover .arrow { color: var(--acc); }

.add-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  margin-top: 14px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--t2);
  font-size: 13px;
  cursor: pointer;
}
.add-link:hover { color: var(--t1); border-color: var(--line2); }

.empty { margin-top: 24px; color: var(--t3); }

/* ---------- Dialogue « Ajouter un lien » ---------- */
.dialog {
  width: min(540px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  color: var(--t1);
}
.dialog::backdrop { background: var(--overlay, rgba(0, 0, 0, 0.55)); }
.dialog-inner { padding: 24px; }
.dialog h2 { font-size: 20px; font-weight: 500; }
.dialog p { margin-top: 6px; color: var(--t2); font-size: 13px; }
.dialog code {
  padding: 2px 5px;
  border-radius: 4px;
  background: var(--raised);
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 12px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 18px;
}
.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--t3);
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 12px;
}
.form-grid input,
.form-grid select {
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--raised);
  color: var(--t1);
  font-family: "Geist", sans-serif;
  font-size: 14px;
}
.form-grid input:focus,
.form-grid select:focus { border-color: var(--acc); outline: none; }

.snippet {
  margin: 16px 0 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--raised);
  color: var(--t2);
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--t1);
  color: var(--page);
  font-size: 13px;
  cursor: pointer;
}
.button.secondary {
  border-color: var(--line);
  background: var(--card);
  color: var(--t2);
}
.button.secondary:hover { color: var(--t1); border-color: var(--line2); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .platform-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .topbar { padding: 0 16px; }
  .page { padding: 32px 16px 48px; }
  .hero h1 { font-size: 30px; line-height: 34px; }
  .platform-grid { grid-template-columns: 1fr; gap: 12px; }
  .tool-row { flex-wrap: wrap; padding: 12px 16px; }
  .tool-url { flex-basis: 100%; padding-left: 46px; }
  .form-grid { grid-template-columns: 1fr; }
}
