:root {
  --bg: #0b1513;
  --bg2: #0e1c19;
  --ink: #e0f2e6;
  --ink-dim: rgba(224, 242, 230, 0.58);
  --green-dark: #005d67;
  --green-mid: #2e8b7a;
  --line: rgba(224, 242, 230, 0.26);
  --card-bg: rgba(13, 26, 23, 0.88);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(1200px 800px at 50% 45%, rgba(46, 139, 122, 0.14), transparent 60%),
    radial-gradient(900px 600px at 18% 90%, rgba(0, 93, 103, 0.16), transparent 60%);
}

/* ---------- En-tête ---------- */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  pointer-events: none;
}
header a, header button { pointer-events: auto; }

#logo img {
  display: block;
  height: 20px;
  width: auto;
}

nav { display: flex; gap: 30px; }

.nav-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 0;
  color: var(--ink-dim);
  font: inherit;
  font-size: 14px;
  letter-spacing: 0.14em;
  position: relative;
  transition: color 0.2s;
}
.nav-btn:hover { color: var(--ink); }
.nav-btn.active { color: var(--ink); }
.nav-btn.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 1px;
  background: var(--green-mid);
}

/* ---------- Sections ---------- */
main { position: fixed; inset: 0; }

.section { position: absolute; inset: 0; display: none; }
.section.active { display: block; }
.section iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  display: block;
}

/* ---------- Projets : calques ---------- */
#scene {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
}

#lines {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
#lines line {
  stroke: var(--line);
  stroke-width: 1;
}

#stage {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}
#stage > * {
  position: absolute;
  pointer-events: auto;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  transform: translate(-50%, -50%);
  cursor: grab;
}
#stage > *:active { cursor: grabbing; }

/* ---------- Éléments ---------- */
.p-label {
  color: var(--ink);
  font-size: 14px;
  letter-spacing: 0.12em;
  cursor: pointer;
  padding: 8px 12px;
  white-space: nowrap;
  transition: color 0.2s;
}
.p-label:hover { color: var(--green-mid); }

.p-card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  padding: 20px 24px;
  width: 360px;
  max-width: 90vw;
  max-height: 72vh;
  overflow-y: auto;
  color: var(--ink);
  backdrop-filter: blur(5px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  line-height: 1.5;
}
.p-card .k {
  display: block;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--ink-dim);
  margin-top: 14px;
}
.p-card .k:first-child { margin-top: 0; }
.p-card .v {
  display: block;
  font-size: 14px;
  margin-top: 4px;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.p-img {
  display: block;
  max-width: 600px;
  max-height: 500px;
  width: auto;
  height: auto;
  border: 1px solid var(--line);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  background: var(--bg2);
}

.p-close {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  background: var(--card-bg);
  color: var(--ink);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, border-color 0.2s;
}
.p-close:hover { color: var(--green-mid); border-color: var(--green-mid); }

/* ---------- Messages ---------- */
#notice {
  position: absolute;
  left: 50%;
  bottom: 90px;
  transform: translateX(-50%);
  max-width: 560px;
  text-align: center;
  color: var(--ink-dim);
  font-size: 12px;
  line-height: 1.7;
  letter-spacing: 0.06em;
  z-index: 4;
  display: none;
  pointer-events: none;
}
#notice.show { display: block; }
#notice code { color: var(--ink); }

#hint {
  position: absolute;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%);
  color: var(--ink-dim);
  font-size: 11px;
  letter-spacing: 0.2em;
  z-index: 4;
  pointer-events: none;
  transition: opacity 0.4s;
}
