:root {
  --bg: #0b0602;
  --bg-raised: #140a03;
  --orange: #ff7a1a;
  --amber: #ffac02;
  --text: #f6e7d4;
  --muted: #9c7a5b;
  --hairline: color-mix(in srgb, var(--orange) 18%, transparent);
  --hairline-strong: color-mix(in srgb, var(--orange) 45%, transparent);

  --font-pixel: "Silkscreen", "Courier New", monospace;
  --font-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;

  color-scheme: dark;
}

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

html { background: var(--bg); }

body {
  position: relative;
  min-height: 100vh;
  margin: 0;
  padding: 0 clamp(1rem, 4vw, 3rem) 3rem;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  /* Halo orange + trame de points 3px */
  background:
    radial-gradient(ellipse 80% 50% at 70% 0%, color-mix(in srgb, var(--orange) 10%, transparent), transparent 70%),
    repeating-conic-gradient(color-mix(in srgb, var(--orange) 5%, transparent) 0% 25%, transparent 0% 50%) 0 0 / 3px 3px,
    var(--bg);
  background-attachment: fixed;
  overflow-x: hidden;
}

/* Grain */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  opacity: .08;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 .6 0 0 0 0 .2 0 0 0 1.2 -.2'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

::selection { background: var(--orange); color: var(--bg); }

/* ---------- Champ de pixels animé ---------- */

#field {
  position: absolute;
  top: 0;
  left: 0;
  z-index: -1;
  width: 100%;
  height: 440px;
  image-rendering: pixelated;
  -webkit-mask-image: linear-gradient(#000 35%, transparent);
          mask-image: linear-gradient(#000 35%, transparent);
  opacity: .7;
}
body { isolation: isolate; }

/* ---------- En-tête ---------- */

.hero {
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(3.5rem, 12vh, 7rem) 0 3rem;
  animation: rise .7s ease-out both;
}

.eyebrow {
  font-family: var(--font-pixel);
  font-size: .75rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--amber);
}
.eyebrow .bracket, .eyebrow .sep { color: var(--muted); }

h1 {
  margin: .6rem 0 .4rem;
  font-family: var(--font-pixel);
  font-weight: 700;
  font-size: clamp(1.6rem, 7.5vw, 5.5rem);
  line-height: .95;
  letter-spacing: .02em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
  color: var(--text);
  text-shadow: 0 0 28px color-mix(in srgb, var(--orange) 45%, transparent);
}

.tagline {
  margin: 0 0 2.2rem;
  max-width: 60ch;
  color: var(--muted);
}

.search {
  display: flex;
  align-items: center;
  gap: .7rem;
  width: min(100%, 440px);
  padding: .7rem .9rem;
  border: 1px solid var(--hairline-strong);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(3px);
  transition: border-color .15s, box-shadow .15s;
}
.search:focus-within {
  border-color: var(--orange);
  box-shadow: 0 0 0 1px var(--orange), 0 0 24px color-mix(in srgb, var(--orange) 25%, transparent);
}
.prompt { color: var(--orange); font-weight: 500; }
#search {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  caret-color: var(--orange);
}
#search::placeholder { color: var(--muted); opacity: .7; }
#search::-webkit-search-cancel-button { display: none; }

kbd {
  display: inline-block;
  min-width: 1.5em;
  padding: 0 .35em;
  border: 1px solid var(--hairline-strong);
  font-family: var(--font-mono);
  font-size: .75rem;
  line-height: 1.5;
  text-align: center;
  color: var(--muted);
}

/* ---------- Sections ---------- */

main { max-width: 1100px; margin: 0 auto; }

section { margin-top: 2.5rem; animation: rise .7s .1s ease-out both; }

h2 {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0 0 1rem;
  font-family: var(--font-pixel);
  font-weight: 400;
  font-size: .8rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--orange);
}
h2::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--hairline);
}
h2 .n { color: var(--muted); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 1rem;
}

/* ---------- Cartes ---------- */

.card {
  --c: var(--hairline-strong);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  padding: 1rem 1.1rem 1rem;
  border: 1px solid var(--hairline);
  background: var(--bg-raised);
  color: inherit;
  text-decoration: none;
  outline: none;
  transition: border-color .2s, transform .2s, background-color .2s;
}

/* Coins en équerre */
.card::before, .card::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  border: 2px solid var(--c);
  transition: border-color .2s, inset .2s;
}
.card::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.card::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

.card:hover, .card:focus-visible {
  --c: var(--amber);
  border-color: var(--hairline-strong);
  transform: translate(-2px, -2px);
  background:
    repeating-conic-gradient(color-mix(in srgb, var(--orange) 12%, transparent) 0% 25%, transparent 0% 50%) 0 0 / 3px 3px,
    var(--bg-raised);
  box-shadow: 4px 4px 0 var(--orange);
}

.card-top, .card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.idx { font-family: var(--font-pixel); color: var(--orange); }

.card-body { display: flex; align-items: center; gap: 1rem; }

/* Icône : version tramée orange, vraie couleur au survol */
.icon {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border: 1px solid var(--hairline);
  background:
    repeating-conic-gradient(color-mix(in srgb, var(--orange) 8%, transparent) 0% 25%, transparent 0% 50%) 0 0 / 4px 4px,
    var(--bg);
}
.icon > * {
  grid-area: 1 / 1;
  width: 56px;
  height: 56px;
  object-fit: contain;
  image-rendering: pixelated;
  transition: opacity .25s;
}
.icon.dithered .icon-orig { opacity: 0; image-rendering: auto; }
.card:hover .icon.dithered .icon-orig,
.card:focus-visible .icon.dithered .icon-orig { opacity: 1; }
.card:hover .icon.dithered .icon-dither,
.card:focus-visible .icon.dithered .icon-dither { opacity: 0; }
.icon.glyph {
  font-family: var(--font-pixel);
  font-size: 1.8rem;
  color: var(--orange);
}

.info { min-width: 0; }
.name {
  font-family: var(--font-pixel);
  font-size: 1.15rem;
  line-height: 1.2;
  text-transform: uppercase;
  overflow-wrap: anywhere;
  color: var(--text);
  transition: color .2s;
}
.card:hover .name, .card:focus-visible .name { color: var(--amber); }
.desc { margin-top: .3rem; font-size: .85rem; color: var(--muted); }

.card-foot { padding-top: .8rem; border-top: 1px dashed var(--hairline); text-transform: none; letter-spacing: 0; }
.host { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.arrow {
  font-size: 1rem;
  color: var(--orange);
  transition: transform .2s;
}
.card:hover .arrow, .card:focus-visible .arrow { transform: translate(3px, -3px); }

/* Statut */
.status { display: inline-flex; align-items: center; gap: .45rem; }
.status i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border: 1px solid var(--muted);
}
.status[data-state="pending"] i { animation: blink 1s steps(2) infinite; }
.status[data-state="up"] { color: var(--amber); }
.status[data-state="up"] i {
  border-color: var(--amber);
  background: var(--amber);
  box-shadow: 0 0 8px var(--amber);
}
.status[data-state="down"] { color: #ff4a2a; }
.status[data-state="down"] i { border-color: #ff4a2a; }

/* ---------- Divers ---------- */

.empty {
  max-width: 1100px;
  margin: 2rem auto;
  font-family: var(--font-pixel);
  color: var(--muted);
}

footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1100px;
  margin: 4rem auto 0;
  padding-top: 1rem;
  border-top: 1px solid var(--hairline);
  font-size: .75rem;
  color: var(--muted);
}
footer #count { font-family: var(--font-pixel); letter-spacing: .1em; text-transform: uppercase; }
.keys kbd { margin-left: .8rem; margin-right: .2rem; }

@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes blink { 50% { opacity: 0; } }

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

@media (max-width: 560px) {
  .keys { display: none; }
}

@media (max-width: 380px) {
  .card { padding: .9rem; }
  .card-body { gap: .8rem; }
  .icon { width: 56px; height: 56px; }
  .icon > * { width: 44px; height: 44px; }
  .name { font-size: .95rem; }
}
