/* INFECTEDHARDWARE — page de liens. Noir, une touche de rouge, glitch discret. */

@font-face { font-family: "Chakra Petch"; src: url("/assets/fonts/chakra-petch-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/assets/fonts/jetbrains-mono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --bg: #060606;
  --card: #0e0e0f;
  --card-hover: #141314;
  --fg: #ededed;
  --muted: #8a8a8a;
  --faint: #4d4d4d;
  --line: rgba(255, 255, 255, 0.07);
  --red: #ff2a2a;
  --red-line: rgba(255, 42, 42, 0.4);

  --display: "Chakra Petch", "Arial Narrow", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(ellipse 60% 40% at 50% 0%, rgba(255, 42, 42, 0.08), transparent 70%),
    var(--bg);
  color: var(--fg);
  font: 400 15px/1.5 var(--mono);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; }
h1, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
[hidden] { display: none !important; }

::selection { background: var(--red); color: #000; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

.offscreen { position: fixed; left: -9999px; opacity: 0; }

/* ---------- Glitch texte : seulement pendant un glitch du pseudo ---------- */
.glitch { position: relative; display: inline-block; }
.glitch::before {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  color: var(--red);
  pointer-events: none;
  opacity: 0;
}
.glitch.is-glitching::before { opacity: 1; animation: slice 0.3s steps(2) infinite; }
@keyframes slice {
  0%   { clip-path: inset(15% 0 60% 0); transform: translateX(-3px); }
  33%  { clip-path: inset(60% 0 10% 0); transform: translateX(3px); }
  66%  { clip-path: inset(35% 0 40% 0); transform: translateX(-2px); }
  100% { clip-path: inset(80% 0 0 0);   transform: translateX(2px); }
}

/* ---------- Écran d'entrée ---------- */
.gate {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: var(--bg);
  cursor: pointer;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
.gate.is-gone { opacity: 0; visibility: hidden; pointer-events: none; }
.gate-btn {
  font: 400 13px/1 var(--mono);
  letter-spacing: 0.4em;
  padding: 14px 4px 14px calc(4px + 0.4em);
  color: var(--muted);
  cursor: pointer;
  animation: breathe 2.4s ease-in-out infinite;
}
.gate-btn::before { content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 14px 2px 0; background: var(--red); border-radius: 50%; }
.gate:hover .gate-btn { color: var(--fg); }
@keyframes breathe { 50% { opacity: 0.45; } }

/* ---------- Bouton son ---------- */
.sound {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 70;
  font: 400 11px/1 var(--mono);
  letter-spacing: 0.12em;
  color: var(--faint);
  cursor: pointer;
}
.sound:hover { color: var(--fg); }
.sound[aria-pressed="true"] { color: var(--muted); }

/* ---------- Page ---------- */
.page {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: clamp(32px, 9vh, 96px) 16px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ---------- Pseudo 3D ---------- */
.logo {
  position: relative;
  width: min(100vw, 960px);
  height: clamp(110px, 18vw, 200px);
}
.logo-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: pan-y;
}
.logo-fallback {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font: 700 clamp(26px, 7.5vw, 72px)/1 var(--display);
  letter-spacing: 0.02em;
  white-space: nowrap;
  color: #e9e9ec;
  transition: opacity 0.4s ease;
}
.logo.is-3d .logo-fallback { opacity: 0; }

/* ---------- Statut ---------- */
.status {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 400 11px/1 var(--mono);
  letter-spacing: 0.24em;
  color: var(--muted);
}
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 8px var(--red);
  animation: breathe 1.6s ease-in-out infinite;
}

/* ---------- Onglets ---------- */
.tabs {
  margin-top: 44px;
  display: flex;
  gap: 28px;
}
.tabs [role="tab"] {
  position: relative;
  padding: 6px 0;
  font: 700 14px/1 var(--display);
  letter-spacing: 0.2em;
  color: var(--faint);
  cursor: pointer;
  transition: color 0.2s ease;
}
.tabs [role="tab"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0.2em;
  bottom: -2px;
  height: 2px;
  background: var(--red);
  transform: scaleX(0);
  transition: transform 0.25s ease;
}
.tabs [role="tab"]:hover { color: var(--muted); }
.tabs [role="tab"][aria-selected="true"] { color: var(--fg); }
.tabs [role="tab"][aria-selected="true"]::after { transform: scaleX(1); }
.tab-count { font: 400 11px/1 var(--mono); letter-spacing: 0; color: var(--red); }
.tab-count:empty { display: none; }

.panel { width: 100%; margin-top: 24px; }

/* ---------- Liens ---------- */
.links { display: grid; gap: 8px; }

.link {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.link:hover { background: var(--card-hover); border-color: var(--red-line); }

.link-tag {
  flex: none;
  width: 22px;
  font: 700 12px/1 var(--display);
  letter-spacing: 0.04em;
  color: var(--red);
}

.link-text { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 12px; }
.link-text strong { font: 700 16px/1.3 var(--display); letter-spacing: 0.02em; white-space: nowrap; }
.link-text small {
  font: 400 12px/1.3 var(--mono);
  color: var(--faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-go { flex: none; color: var(--faint); transition: color 0.2s ease, transform 0.2s ease; }
.link-go-copy { font-size: 11px; letter-spacing: 0.08em; }
.link:hover .link-go { color: var(--red); transform: translate(2px, -2px); }
.link:hover .link-go-copy { transform: none; }

/* ---------- Noiz ---------- */
.noiz {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}
.noiz-item {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.noiz-item:hover { background: var(--card-hover); border-color: var(--red-line); }
.noiz-item strong { font: 700 16px/1.2 var(--display); letter-spacing: 0.02em; overflow-wrap: anywhere; }
.noiz-item small { font: 400 11px/1.3 var(--mono); color: var(--faint); overflow-wrap: anywhere; }
.noiz-empty { padding: 24px 16px; text-align: center; color: var(--faint); font-size: 12px; }

/* ---------- Pied ---------- */
.footer { margin-top: 48px; font: 400 10px/1 var(--mono); letter-spacing: 0.24em; color: var(--faint); }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 95;
  transform: translate(-50%, 16px);
  padding: 10px 16px;
  background: var(--fg);
  color: var(--bg);
  border-radius: 8px;
  font: 400 12px/1.2 var(--mono);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Curseur custom (souris uniquement) ---------- */
html.has-cursor, html.has-cursor * { cursor: none !important; }
.cursor {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: var(--red);
  pointer-events: none;
  transition: width 0.2s ease, height 0.2s ease, margin 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
  border: 1px solid transparent;
}
.cursor.is-hover {
  width: 32px;
  height: 32px;
  margin: -16px 0 0 -16px;
  background: transparent;
  border-color: var(--red);
}

/* ---------- 404 ---------- */
.lost .page { min-height: 100vh; justify-content: center; gap: 24px; }
.lost-title { font: 700 clamp(80px, 26vw, 160px)/1 var(--display); color: var(--fg); }
.lost-back { max-width: 300px; }

@media (prefers-reduced-motion: reduce) {
  .glitch.is-glitching::before, .gate-btn, .status-dot { animation: none !important; }
  .glitch.is-glitching::before { opacity: 0; }
}
