/* Palette alignée sur le thème Authentik (vert jade), en version claire. */
:root {
  --bg: #f4f6f2;
  --surface: #ffffff;
  --border: #dbe4dd;
  --text: #14211b;
  --muted: #51625a;
  --accent: #2b7a5d;
  --accent-2: #a5643a;
  --accent-soft: rgba(43, 122, 93, 0.09);
  --glow: rgba(143, 209, 179, 0.28);
  --jade: #8fd1b3;
  --jade-light: #a8dec5;
  --night: #0d1512;
}

:root {
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --hero-text: #f3f0fa;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }

/* En-tête posé sur l'illustration */
.top {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1040px;
  margin: 0 auto;
  padding: 24px;
}
.brand { color: var(--hero-text); font-weight: 600; }
.brand-mark { color: var(--jade); margin-right: 4px; }
.top nav { display: flex; gap: 24px; font-size: 15px; }
.top nav a { color: rgba(243, 240, 250, 0.75); }
.top nav a:hover { color: var(--hero-text); text-decoration: none; }

/* Hero */
.hero {
  position: relative;
  min-height: clamp(600px, 92vh, 880px);
  display: flex;
  align-items: flex-end;
  color: var(--hero-text);
  background:
    linear-gradient(90deg, rgba(6, 10, 8, 0.72) 0%, rgba(6, 10, 8, 0.35) 60%, rgba(6, 10, 8, 0.1) 100%),
    linear-gradient(180deg, rgba(6, 10, 8, 0.5) 0%, rgba(6, 10, 8, 0.3) 40%, rgba(6, 10, 8, 0.88) 84%, var(--bg) 100%),
    url("hero.webp") center 30% / cover no-repeat var(--night);
}
.hero-inner {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 140px 24px 72px;
}
.eyebrow, .tag {
  font: 13px/1.4 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 16px;
}
.hero .eyebrow { color: rgba(255, 255, 255, 0.85); }
h1 {
  font-size: clamp(48px, 9vw, 92px);
  line-height: 1;
  letter-spacing: -0.025em;
  margin: 0 0 24px;
  text-shadow: 0 2px 30px rgba(9, 15, 12, 0.6);
}
.alias {
  display: block;
  font: italic 400 clamp(22px, 3.2vw, 32px)/1.3 var(--serif);
  letter-spacing: 0;
  color: rgba(255, 255, 255, 0.9);
  margin-top: 10px;
}
.lead {
  font-size: 20px;
  max-width: 38em;
  margin: 0 0 48px;
  color: #fff;
  text-shadow: 0 1px 12px rgba(9, 15, 12, 0.7);
}
.stats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  overflow: hidden;
  backdrop-filter: blur(6px);
}
.stats li { background: rgba(6, 10, 8, 0.72); padding: 18px 20px; }
.stats strong { display: block; font-size: 30px; line-height: 1.1; color: #fff; }
.stats span { font-size: 14px; color: rgba(255, 255, 255, 0.82); }

/* Sections */
main { max-width: 1040px; margin: 0 auto; padding: 0 24px; }
section { padding: 96px 0 0; }
main > section:first-child { padding-top: 72px; }

h2 {
  font: 500 14px/1.4 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}
h2::after { content: ""; flex: 1; height: 1px; background: var(--border); }
h3 { font-size: 21px; line-height: 1.3; margin: 0 0 10px; }
.intro { font-size: 19px; color: var(--muted); max-width: 40em; margin: 0 0 36px; }

.grid { display: grid; gap: 20px; }
.grid.two { grid-template-columns: repeat(2, 1fr); }
.grid.three { grid-template-columns: repeat(3, 1fr); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
}
.card > p { color: var(--muted); margin: 0 0 18px; }
.card > .tag { color: var(--accent-2); font-size: 12px; margin-bottom: 10px; }
.card > .icon { font-size: 26px; line-height: 1; color: var(--accent); margin: 0 0 16px; }
.card-link { display: block; color: inherit; transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s ease; }
.card-link:hover, .card-link:focus-visible { text-decoration: none; border-color: var(--accent); box-shadow: 0 14px 36px rgba(20, 33, 27, 0.14); transform: scale(1.03); }
.card-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.card-link h3::after { content: " →"; color: var(--accent); font-size: 0.8em; }
.card-link[target="_blank"] h3::after { content: " ↗"; }

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; }
.chips li {
  font: 12.5px/1 var(--mono);
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 10px;
}

.list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.list li { color: var(--muted); padding-left: 22px; position: relative; }
.list li::before { content: "✦"; position: absolute; left: 0; top: 0; color: var(--accent); font-size: 13px; }
.list strong { color: var(--text); font-weight: 600; }

.card > .note { font-size: 14px; color: var(--muted); margin: 18px 0 0; font-style: italic; }

/* Halivia */
.feature {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 20px;
}
.feature-media { background: radial-gradient(circle at 50% 45%, #1b2a23, var(--night) 70%); padding: 36px; display: flex; align-items: center; justify-content: center; }
.feature-media img { width: 100%; height: auto; display: block; }
.feature-body { padding: 36px; }
.feature-body .tag { color: var(--accent-2); }
.feature-body h3 { font: italic 500 30px/1.25 var(--serif); margin-bottom: 14px; }
.feature-body > p { color: var(--muted); margin: 0 0 22px; }

.specs { margin: 0; }
.specs div { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.specs div:last-child { border-bottom: 0; }
.specs dt { font: 13px/1.6 var(--mono); color: var(--accent-2); text-transform: uppercase; letter-spacing: 0.05em; }
.specs dd { margin: 0; color: var(--muted); }

.progress { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.progress li { padding-left: 28px; position: relative; color: var(--muted); }
.progress li::before { position: absolute; left: 0; top: 0; font-family: var(--mono); }
.progress .done::before { content: "✓"; color: var(--accent); }
.progress .doing::before { content: "◐"; color: var(--accent-2); }

/* Homelab */
.diagram {
  margin: 0 0 20px;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.diagram svg { width: 100%; height: auto; display: block; }
.diagram figcaption { color: var(--muted); font-size: 15px; margin-top: 16px; }
.d-node rect { fill: var(--bg); stroke: var(--border); stroke-width: 1.5; }
.d-node text { fill: var(--text); font: 600 16px var(--sans); text-anchor: middle; }
.d-node .d-sub { fill: var(--muted); font: 12px var(--mono); }
.d-accent rect { stroke: var(--accent); fill: var(--accent-soft); }
.d-small text { font-size: 13px; font-weight: 500; }
.d-line { stroke: var(--muted); stroke-width: 1.5; fill: none; }
.d-dash { stroke-dasharray: 4 4; }
.d-arrow { fill: var(--muted); }

.incidents { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.incidents li { color: var(--muted); border-left: 2px solid var(--accent-2); padding-left: 14px; }
.incidents span { color: var(--text); font-weight: 600; }

/* Univers */
.lore {
  background:
    radial-gradient(600px 300px at 10% 0%, var(--glow), transparent 70%),
    var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 40px;
}
.lore blockquote { margin: 0 0 28px; padding: 0 0 0 22px; border-left: 2px solid var(--accent); }
.lore blockquote p { font: italic 22px/1.55 var(--serif); color: var(--text); margin: 0 0 10px; }
.lore blockquote footer { font: 13px var(--mono); color: var(--accent-2); letter-spacing: 0.05em; }
.lore > p { color: var(--muted); max-width: 44em; margin: 0 0 14px; }

.bottom p { margin: 0 0 6px; }
.bottom a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.bottom a:hover { color: var(--accent); }

.bottom {
  max-width: 1040px;
  margin: 96px auto 0;
  padding: 28px 24px 48px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
}

/* Page mentions légales */
.top-plain { position: static; border-bottom: 1px solid var(--border); }
.top-plain .brand { color: var(--text); }
.top-plain nav a { color: var(--muted); }
.top-plain nav a:hover { color: var(--accent); }
.legal { max-width: 760px; padding-top: 56px; }
.legal h1 { font-size: clamp(34px, 6vw, 48px); text-shadow: none; margin: 0 0 8px; }
.legal h1#confidentialite { margin-top: 72px; }
.legal .updated { color: var(--muted); font-size: 14px; margin: 0 0 8px; }
.legal section { padding: 32px 0 0; }
.legal section p { color: var(--muted); margin: 0 0 10px; }
.legal strong { color: var(--text); }

/* Pages projet */
.project { padding-top: 56px; }
.project h1 { font-size: clamp(40px, 7vw, 64px); text-shadow: none; margin: 0 0 16px; }
.project .tag { color: var(--accent-2); }
.shot { margin: 0 0 20px; padding: 12px; background: var(--night); border: 1px solid var(--border); border-radius: 14px; }
.shot img { width: 100%; height: auto; display: block; border-radius: 8px; }
.shot figcaption { color: var(--muted); font-size: 15px; padding: 14px 6px 4px; }
.project > .note { color: var(--muted); font-size: 15px; font-style: italic; margin: 28px 0 0; }

/* Mascotte NOX : fixée en haut à droite, dans la marge, sur les écrans assez larges */
.nox-companion { display: none; --nox-glow: #8fd1b3; }
@media (min-width: 1440px) {
  .nox-companion {
    display: block;
    position: fixed;
    right: 0;
    top: 88px;
    width: min(190px, calc((100vw - 1040px) / 2));
    height: 240px;
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.8s ease;
  }
  .nox-companion.is-ready { opacity: 1; }
  .nox-companion canvas { display: block; width: 100%; height: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .card-link { transition: none; }
  .card-link:hover, .card-link:focus-visible { transform: none; }
}

@media (max-width: 860px) {
  .grid.two, .grid.three, .feature { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .top { padding: 16px; }
  .top nav { gap: 14px; font-size: 14px; }
  .top nav a:nth-child(n+3) { display: none; }
  .hero { min-height: 0; }
  .hero-inner { padding: 120px 16px 48px; }
  .lead { font-size: 18px; margin-bottom: 32px; }
  .stats li { padding: 14px; }
  .stats strong { font-size: 24px; }
  main { padding: 0 16px; }
  section { padding-top: 72px; }
  .card, .feature-body, .diagram { padding: 22px; }
  .lore { padding: 26px; }
  .lore blockquote p { font-size: 19px; }
  .specs div { grid-template-columns: 1fr; gap: 2px; }
  .bottom { padding-left: 16px; padding-right: 16px; }
}