/* ==========================================================================
   DEEP-5 — IDENTITÉ VISUELLE 05 : BRUTALISME NÉO-TOKYO & ENCRE ACIDE
   Bricolage Grotesque (Display) + Public Sans (Body) + Space Mono (Tech)
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,600;12..96,700;12..96,800&family=Public+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Space+Mono:ital,wght@0,400;0,700;1,400&display=swap');

:root {
  --bg: #F4F3EF;
  --bg-soft: #EAE8E1;
  --bg-card: #FFFFFF;
  --bg-elevated: #FFFFFF;
  --bg-tint: #F3E8FF;
  --border: #111111;
  --border-soft: #111111;
  --text: #111111;
  --text-soft: #27272A;
  --text-muted: #52525B;
  --text-dim: #52525B;
  --navy: #111111;
  --navy-soft: #111111;
  --orange: #6D28D9;
  --orange-deep: #5B21B6;
  --orange-soft: #BEF264;
  --orange-glow: rgba(190, 242, 100, 0.35);
  --yellow: #BEF264;
  --acid: #BEF264;
  --violet: #6D28D9;
  --violet-soft: #DDD6FE;
  --green: #15803D;
  --green-soft: #DCFCE7;
  --blue: #1D4ED8;
  --blue-soft: #DBEAFE;
  --red: #DC2626;
  --red-soft: #FEE2E2;
  /* Compatibility aliases for legal.html */
  --ink: #111111;
  --ink-soft: #27272A;
  --ink-faint: #52525B;
  --accent: #6D28D9;
  --accent-soft: #BEF264;
  --line: #111111;
  --line-strong: #111111;
  --display: 'Bricolage Grotesque', -apple-system, BlinkMacSystemFont, sans-serif;
  --body: 'Public Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --sans: 'Public Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'Space Mono', monospace;
  --shadow-sm: 3px 3px 0px #111111;
  --shadow-md: 5px 5px 0px #111111;
  --shadow-lg: 8px 8px 0px #111111;
  --shadow-orange: 4px 4px 0px #111111;
}

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  font-size: 16.5px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--acid);
  color: #111111;
}

/* TYPOGRAPHY */
h1, h2, h3, h4,
.explore-card h3,
.value-card h3,
.tool-name,
.next-link-title,
.toc-title {
  font-family: var(--display);
  color: #111111;
}

h1 {
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.06;
}

h1 .highlight {
  background: var(--violet-soft);
  color: #111111;
  border: 2.5px solid #111111;
  padding: 0 10px;
  box-shadow: 4px 4px 0px #111111;
  display: inline-block;
}
h1 .highlight::after {
  display: none !important;
}

h2 .underline {
  background: var(--acid);
  padding: 0 6px;
  border: 2px solid #111111;
  box-shadow: 3px 3px 0px #111111;
}
h2 .underline::after {
  display: none !important;
}

/* NAVIGATION */
nav.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #FFFFFF !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-bottom: 2.5px solid #111111 !important;
}

nav.nav .nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

nav.nav .logo {
  display: inline-flex;
  align-items: center;
  font-family: var(--display) !important;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.03em;
  color: #111111 !important;
  background: var(--acid);
  border: 2.5px solid #111111;
  padding: 4px 12px;
  box-shadow: 3px 3px 0px #111111;
  border-radius: 0 !important;
  gap: 1px;
  transition: transform 0.12s, box-shadow 0.12s;
}
nav.nav .logo:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0px #6D28D9;
}
nav.nav .logo .logo-deep {
  background: transparent !important;
  color: #111111 !important;
  padding: 0 !important;
  border-radius: 0 !important;
}
nav.nav .logo .logo-five {
  color: #6D28D9 !important;
  font-weight: 800;
  margin-left: 2px;
}
nav.nav .logo .logo-dot {
  color: #111111 !important;
  font-size: 24px;
  line-height: 0.5;
  margin-left: 0;
}

nav.nav .nav-links {
  display: flex;
  list-style: none;
  gap: 8px;
  align-items: center;
}
nav.nav .nav-links > li {
  list-style: none;
}
nav.nav .nav-links a,
nav.nav .nav-links summary {
  color: #111111 !important;
  font-family: var(--sans) !important;
  font-size: 13.5px;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: 0 !important;
  border: 2px solid transparent;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.12s;
}
nav.nav .nav-links a:hover,
nav.nav .nav-links summary:hover {
  background: var(--acid) !important;
  color: #111111 !important;
  border-color: #111111;
  box-shadow: 2px 2px 0px #111111;
}
nav.nav .nav-links a.active {
  background: var(--violet) !important;
  color: #FFFFFF !important;
  border-color: #111111;
  box-shadow: 2px 2px 0px #111111;
}

.nav-group { position: relative; }
.nav-group details { position: relative; }
.nav-group summary { list-style: none; }
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group summary::after {
  content: '▾';
  margin-left: 6px;
  color: #111111;
  font-size: 11px;
}
.nav-group details[open] summary {
  background: var(--violet) !important;
  color: #FFFFFF !important;
  border-color: #111111;
  box-shadow: 2px 2px 0px #111111;
}
.nav-group details[open] summary::after {
  color: #BEF264;
}

.nav-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 230px;
  padding: 8px;
  display: grid;
  gap: 4px;
  background: #FFFFFF;
  border: 2.5px solid #111111;
  border-radius: 0;
  box-shadow: 6px 6px 0px #111111;
  z-index: 110;
}
.nav-panel a {
  display: block;
}

.nav-toggle { display: none; }

@media (max-width: 900px) {
  nav.nav .nav-inner { padding: 12px 18px; flex-wrap: wrap; gap: 0; }
  nav.nav .nav-toggle {
    display: inline-flex;
    margin-left: auto;
    align-items: center;
    gap: 4px;
    border: 2px solid #111111;
    border-radius: 0;
    background: var(--acid);
    color: #111111;
    padding: 8px 12px;
    font: 700 12px var(--mono);
    box-shadow: 3px 3px 0px #111111;
  }
  nav.nav .nav-toggle span { display: block; width: 13px; height: 2px; background: #111111; }
  nav.nav .nav-toggle b { margin-left: 4px; font-weight: 700; }
  nav.nav .nav-links {
    display: none;
    flex: 0 0 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    overflow: visible;
    padding: 14px 0 6px;
    margin-top: 12px;
    border-top: 2px solid #111111;
  }
  nav.nav.nav-open .nav-links { display: flex; }
  nav.nav .nav-links a, nav.nav .nav-links summary { display: block; font-size: 13.5px; padding: 10px 12px; }
  nav.nav .nav-group details { width: 100%; }
  .nav-panel { position: static; min-width: 0; display: none; padding: 4px 0 6px 12px; background: #F4F3EF; border: 0; box-shadow: none; }
  .nav-group details[open] .nav-panel { display: grid; grid-template-columns: 1fr; }
}

/* PAGE TAGS, EYEBROWS & BADGES */
.page-tag,
.eyebrow,
.chapter-eyebrow {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  font-family: var(--mono) !important;
  font-size: 11.5px !important;
  font-weight: 700 !important;
  text-transform: uppercase;
  letter-spacing: 0.1em !important;
  background: var(--acid) !important;
  color: #111111 !important;
  border: 2px solid #111111 !important;
  padding: 5px 12px !important;
  border-radius: 0 !important;
  box-shadow: 3px 3px 0px #111111;
  margin-bottom: 18px;
}
.page-tag::before {
  content: "// " !important;
  color: #6D28D9 !important;
  font-weight: 700;
}

.meta-badge,
.threat-tag,
.tool-license,
.tech-id {
  font-family: var(--mono) !important;
  border: 1.5px solid #111111 !important;
  border-radius: 0 !important;
  background: #FFFFFF !important;
  color: #111111 !important;
  font-weight: 700 !important;
  box-shadow: 2px 2px 0px #111111;
}
.threat-badge,
.norm-badge,
.case-tag {
  font-family: var(--mono) !important;
  border: 1.5px solid #111111 !important;
  border-radius: 0 !important;
  background: var(--violet-soft) !important;
  color: #111111 !important;
  font-weight: 700 !important;
  box-shadow: 2px 2px 0px #111111;
}

/* BUTTONS */
.btn {
  border-radius: 0 !important;
  border: 2.5px solid #111111 !important;
  font-family: var(--sans) !important;
  font-weight: 700 !important;
  box-shadow: 4px 4px 0px #111111 !important;
  transition: transform 0.12s, box-shadow 0.12s !important;
}
.btn-primary {
  background: var(--acid) !important;
  color: #111111 !important;
}
.btn-primary:hover {
  background: var(--violet) !important;
  color: #FFFFFF !important;
  transform: translate(-2px, -2px) !important;
  box-shadow: 6px 6px 0px #111111 !important;
}
.btn-secondary {
  background: #FFFFFF !important;
  color: #111111 !important;
}
.btn-secondary:hover {
  background: var(--violet-soft) !important;
  transform: translate(-2px, -2px) !important;
  box-shadow: 6px 6px 0px #111111 !important;
}

/* CARDS, BOXES & CONTAINERS */
.explore-card,
.featured-card,
.tool-card,
.value-card,
.book-card,
.next-link,
.toc,
.toc-card,
.toc a,
.stat-box,
.top10-item,
.guide-card,
.step,
.layer-card,
.paradigm-card,
.diagram-box,
.tri-col,
.synthesis-item,
.glossary-card,
.flow-node,
.pipeline-row {
  background: #FFFFFF !important;
  border: 2px solid #111111 !important;
  border-radius: 0 !important;
  box-shadow: 5px 5px 0px #111111 !important;
}

.explore-card:hover,
.featured-card:hover,
.tool-card:hover,
.value-card:hover,
.next-link:hover,
.toc a:hover,
.glossary-card:hover {
  transform: translate(-2px, -2px) !important;
  box-shadow: 7px 7px 0px #6D28D9 !important;
  border-color: #111111 !important;
}

.explore-icon {
  background: var(--acid) !important;
  color: #111111 !important;
  border: 2px solid #111111 !important;
  border-radius: 0 !important;
  box-shadow: 3px 3px 0px #111111 !important;
}

/* CALLOUTS & EXAMPLES */
.callout,
.threat-example,
.pattern-answers,
.tech-example,
.testcase,
.case-lesson,
.watch-box,
.source-note,
.disclaimer {
  background: #FFFFFF !important;
  border: 2px solid #111111 !important;
  border-left: 6px solid #6D28D9 !important;
  border-radius: 0 !important;
  box-shadow: 4px 4px 0px #111111 !important;
  color: #1F2937 !important;
}

/* CODE BLOCKS & ATTACK SURFACE TERMINALS */
.code-block,
.attack-surface {
  background: #111111 !important;
  border: 2.5px solid #111111 !important;
  border-radius: 0 !important;
  box-shadow: 6px 6px 0px #6D28D9 !important;
}
.code-head,
.attack-surface-head {
  background: #1E1E24 !important;
  border-bottom: 2px solid #3F3F46 !important;
}
.code-label,
.attack-surface-label {
  color: var(--acid) !important;
  font-weight: 700 !important;
}
.code-label::before,
.attack-surface-label::before {
  color: #A78BFA !important;
}
.code-block code {
  color: #F4F3EF !important;
}
.tk-kw { color: #BEF264 !important; font-weight: 700; }
.tk-str { color: #A78BFA !important; }
.tk-cmt { color: #9CA3AF !important; }
.tk-num, .tk-val { color: #FDE047 !important; }
.tk-fn, .tk-prop { color: #67E8F9 !important; }

code.inline,
.post code {
  background: var(--violet-soft) !important;
  color: #111111 !important;
  border: 1.5px solid #111111 !important;
  border-radius: 0 !important;
  padding: 1px 6px !important;
  font-weight: 700;
}

/* TABLES & MATRICES */
.table-wrap,
.matrix-wrap {
  border: 2.5px solid #111111 !important;
  border-radius: 0 !important;
  box-shadow: 6px 6px 0px #111111 !important;
  background: #FFFFFF !important;
}
thead th,
.matrix th {
  background: #111111 !important;
  color: var(--acid) !important;
  border-bottom: 2px solid #111111 !important;
}
tbody td,
.matrix td {
  background: #FFFFFF !important;
  color: #1F2937 !important;
  border-top: 1.5px solid #111111 !important;
}

/* SPECIAL SECTIONS (NORMS STRIP, HIGHLIGHT BOX, PAGE CTA) */
.norms {
  background: var(--violet-soft) !important;
  color: #111111 !important;
  border-top: 2.5px solid #111111;
  border-bottom: 2.5px solid #111111;
}
.norms h2,
.norms .norm-card strong {
  color: #111111 !important;
}
.norms .section-sub,
.norms .norm-card span {
  color: #27272A !important;
}
.norms .norm-card {
  background: #FFFFFF !important;
  border: 2px solid #111111 !important;
  border-radius: 0 !important;
  box-shadow: 5px 5px 0px #111111 !important;
}

.highlight-box,
.page-cta {
  background: #111111 !important;
  color: #F4F3EF !important;
  border: 2.5px solid #111111 !important;
  border-radius: 0 !important;
  box-shadow: 7px 7px 0px #BEF264 !important;
}
.highlight-box h3,
.page-cta h2 {
  color: #FFFFFF !important;
}
.highlight-box p,
.page-cta p {
  color: #E4E4E7 !important;
}
.highlight-box .case-tag {
  background: var(--acid) !important;
  color: #111111 !important;
  display: inline-block;
  padding: 3px 8px;
}
.highlight-box a {
  color: var(--acid) !important;
}

/* FOOTER */
footer {
  background: #FFFFFF !important;
  border-top: 2.5px solid #111111 !important;
}
.footer-meta {
  color: #111111 !important;
  font-weight: 700;
}
.footer-meta a:hover {
  background: var(--acid);
  color: #111111 !important;
}


/* ==========================================================================
   HYPERLIENS & MODALE PÉDAGOGIQUE : OAUTH 2.0 & OPENID CONNECT (OIDC)
   ========================================================================== */
a.proto-link {
  display: inline;
  color: #111111;
  font-weight: 700;
  text-decoration: none;
  background: rgba(190, 242, 100, 0.45);
  border-bottom: 2px solid #6D28D9;
  padding: 0 4px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, box-shadow 0.12s;
}
a.proto-link::after {
  content: " ↗";
  font-family: var(--mono);
  font-size: 0.78em;
  color: #6D28D9;
  font-weight: 700;
}
a.proto-link:hover {
  background: var(--acid);
  color: #111111;
  box-shadow: 2px 2px 0px #111111;
}

/* Adaptation dans les terminaux sombres (.attack-surface, .lab-banner, etc.) */
.attack-surface a.proto-link,
.lab-banner a.proto-link,
.highlight-box a.proto-link {
  color: var(--acid) !important;
  background: rgba(109, 40, 217, 0.38);
  border-bottom: 1.5px dashed var(--acid);
}
.attack-surface a.proto-link::after,
.lab-banner a.proto-link::after,
.highlight-box a.proto-link::after {
  color: #FFFFFF;
}

.proto-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(17, 17, 17, 0.72);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.proto-modal-backdrop.is-open {
  display: flex;
}

.proto-modal {
  width: 100%;
  max-width: 860px;
  max-height: 88vh;
  background: #FFFFFF;
  border: 3px solid #111111;
  box-shadow: 10px 10px 0px #BEF264, 10px 10px 0px 3px #111111;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: protoModalIn 0.14s ease-out;
}

@keyframes protoModalIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.proto-modal-head {
  background: #111111;
  color: #FFFFFF;
  padding: 16px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 2.5px solid #111111;
}
.proto-modal-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--acid);
  display: block;
  margin-bottom: 2px;
}
.proto-modal-title {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 800;
  color: #FFFFFF !important;
  margin: 0;
}
.proto-modal-close {
  background: var(--acid);
  color: #111111;
  border: 2px solid #111111;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  cursor: pointer;
  box-shadow: 3px 3px 0px #6D28D9;
  transition: transform 0.1s;
}
.proto-modal-close:hover {
  transform: translate(-1px, -1px);
  background: #FFFFFF;
}

.proto-tabs {
  display: flex;
  flex-wrap: wrap;
  background: var(--bg-soft);
  border-bottom: 2.5px solid #111111;
}
.proto-tab {
  flex: 1;
  min-width: 180px;
  padding: 12px 16px;
  background: transparent;
  border: 0;
  border-right: 2px solid #111111;
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 700;
  color: #27272A;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s, color 0.12s;
}
.proto-tab:last-child {
  border-right: 0;
}
.proto-tab:hover {
  background: var(--violet-soft);
  color: #111111;
}
.proto-tab.is-active {
  background: var(--acid);
  color: #111111;
  box-shadow: inset 0 -3px 0 #111111;
}
.proto-tab-tag {
  display: block;
  font-family: var(--mono);
  font-size: 10.5px;
  color: #6D28D9;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.proto-modal-body {
  padding: 24px 26px;
  overflow-y: auto;
  font-size: 15.5px;
  line-height: 1.65;
  color: #1F2937;
}
.proto-panel {
  display: none;
}
.proto-panel.is-active {
  display: block;
}
.proto-panel h3 {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 10px;
  color: #111111;
}
.proto-panel h4 {
  font-family: var(--display);
  font-size: 16.5px;
  font-weight: 800;
  margin: 20px 0 8px;
  color: #111111;
}
.proto-analogy {
  background: var(--violet-soft);
  border: 2px solid #111111;
  border-left: 6px solid #6D28D9;
  box-shadow: 4px 4px 0px #111111;
  padding: 14px 16px;
  margin: 14px 0 18px;
}
.proto-analogy strong {
  color: #111111;
}
.proto-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 12px 0 18px;
}
.proto-card {
  background: #F4F3EF;
  border: 2px solid #111111;
  box-shadow: 3px 3px 0px #111111;
  padding: 12px 14px;
}
.proto-card-label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  color: #6D28D9;
  text-transform: uppercase;
  display: block;
  margin-bottom: 4px;
}
.proto-card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}
.proto-code {
  background: #111111;
  color: #F4F3EF;
  border: 2px solid #111111;
  box-shadow: 4px 4px 0px #6D28D9;
  padding: 12px 16px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.55;
  overflow-x: auto;
  margin: 12px 0 16px;
}
.proto-agentic-box {
  background: #DCFCE7;
  border: 2px solid #111111;
  border-left: 6px solid #15803D;
  box-shadow: 4px 4px 0px #111111;
  padding: 14px 16px;
  margin-top: 16px;
}
.proto-table {
  width: 100%;
  border-collapse: collapse;
  border: 2px solid #111111;
  font-size: 14px;
  margin: 12px 0 18px;
}
.proto-table th {
  background: #111111;
  color: var(--acid);
  font-family: var(--mono);
  font-size: 12px;
  text-align: left;
  padding: 10px 12px;
}
.proto-table td {
  padding: 10px 12px;
  border-top: 1.5px solid #111111;
  vertical-align: top;
}
@media (max-width: 680px) {
  .proto-grid { grid-template-columns: 1fr; }
  .proto-modal-body { padding: 18px 16px; }
}
