/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #0e0f14;
  --bg2:      #13151d;
  --bg3:      #1a1d28;
  --surface:  #1f2232;
  --border:   #2a2d3e;
  --border2:  #363a52;
  --text:     #e2e4f0;
  --text2:    #9095b0;
  --text3:    #585d78;

  /* Accents par diagramme */
  --c-classes:  #4a90d9;
  --c-usecase:  #e8763a;
  --c-sequence: #5bbf7e;
  --c-accent:   #c778dd;

  --font-head: 'Outfit', sans-serif;
  --font-body: 'Lora', Georgia, serif;
  --font-mono: 'Fira Code', monospace;

  --sidebar-w: 220px;
  --radius: 8px;
  --radius-lg: 14px;
}

html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  display: flex;
  min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0; left: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform .3s ease;
  overflow-y: auto;
}
.sidebar-header {
  padding: 1.5rem 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
}
.logo {
  font-family: var(--font-head);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
}
.logo span { color: var(--c-accent); }

.nav-group { padding: 1rem 0 0.5rem; }
.nav-group-label {
  padding: 0 1.25rem 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text3);
  font-weight: 500;
}
.nav-link {
  display: block;
  padding: 0.4rem 1.25rem;
  font-family: var(--font-head);
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text2);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: all .18s;
}
.nav-link:hover { color: var(--text); background: rgba(255,255,255,0.03); }
.nav-link.active {
  color: var(--text);
  background: rgba(255,255,255,0.05);
  border-left-color: var(--page-color, var(--c-accent));
}

/* Section nav links (within a page) */
.nav-section-link {
  display: block;
  padding: 0.3rem 1.25rem 0.3rem 2rem;
  font-family: var(--font-head);
  font-size: 0.78rem;
  color: var(--text3);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: all .18s;
}
.nav-section-link:hover { color: var(--text2); }
.nav-section-link.active { color: var(--text); border-left-color: var(--page-color, var(--c-accent)); }

/* ===== HAMBURGER ===== */
.hamburger {
  display: none;
  position: fixed; top: .8rem; left: .8rem;
  z-index: 200;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  cursor: pointer;
  flex-direction: column;
  gap: 4px;
}
.hamburger span { display: block; width: 18px; height: 2px; background: var(--text); border-radius: 2px; }

/* ===== MAIN ===== */
.main { margin-left: var(--sidebar-w); flex: 1; min-width: 0; }

/* ===== SECTIONS ===== */
.section {
  padding: 3.5rem min(5rem, 5vw);
  border-bottom: 1px solid var(--border);
  max-width: 1200px;
}
.section:nth-child(even) { background: var(--bg2); }

.section-header { margin-bottom: 2rem; }
.section-tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--page-color, var(--c-accent));
  background: color-mix(in srgb, var(--page-color, var(--c-accent)) 12%, transparent);
  padding: .2em .6em;
  border-radius: 3px;
  margin-bottom: .6rem;
  display: inline-block;
}
.section-title {
  font-family: var(--font-head);
  font-size: clamp(1.6rem, 2.5vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.1;
  color: var(--text);
}
.lead {
  font-size: 1.05rem;
  color: var(--text2);
  max-width: 65ch;
  margin: 1rem 0 1.5rem;
  line-height: 1.7;
}

/* ===== HERO (index) ===== */
.hero {
  min-height: 100vh;
  padding: 5rem;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
}
.hero-bg-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.3;
  pointer-events: none;
}
.hero-content { position: relative; z-index: 1; width: 100%; }
.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--text3);
  margin-bottom: 1rem;
}
.hero-title {
  font-family: var(--font-head);
  font-size: clamp(3rem, 6vw, 6rem);
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: .95;
  color: var(--text);
  margin-bottom: 1.5rem;
}
.hero-title em { font-style: normal; color: var(--c-accent); }
.hero-sub {
  font-size: 1.1rem;
  color: var(--text2);
  max-width: 55ch;
  margin-bottom: 4rem;
}

/* ===== DIAGRAM CARDS ===== */
.diagram-cards { display: flex; flex-direction: column; gap: 1.25rem; margin-bottom: 3.5rem; }
.diag-card {
  display: grid;
  grid-template-columns: 100px 1fr 40px;
  align-items: center;
  gap: 2rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  text-decoration: none;
  color: var(--text);
  transition: transform .2s, border-color .2s, box-shadow .2s;
  border-left: 3px solid transparent;
}
.diag-card:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}
.diag-card--classes  { border-left-color: var(--c-classes); }
.diag-card--classes:hover  { border-color: var(--c-classes); }
.diag-card--usecase  { border-left-color: var(--c-usecase); }
.diag-card--usecase:hover  { border-color: var(--c-usecase); }
.diag-card--sequence { border-left-color: var(--c-sequence); }
.diag-card--sequence:hover { border-color: var(--c-sequence); }

.diag-card-icon {
  display: flex; align-items: center; justify-content: center;
  width: 80px; height: 60px;
}
.diag-card--classes  .diag-card-icon { color: var(--c-classes); }
.diag-card--usecase  .diag-card-icon { color: var(--c-usecase); }
.diag-card--sequence .diag-card-icon { color: var(--c-sequence); }
.diag-card-icon svg { width: 80px; height: 60px; }

.diag-card h2 {
  font-family: var(--font-head);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: .35rem;
}
.diag-card p { font-size: .9rem; color: var(--text2); margin: 0 0 .75rem; }
.diag-card-tags { display: flex; flex-wrap: wrap; gap: .4rem; }
.diag-card-tags span {
  font-family: var(--font-mono);
  font-size: .68rem;
  padding: .15em .55em;
  border-radius: 3px;
  background: rgba(255,255,255,0.06);
  color: var(--text2);
}
.diag-card-arrow {
  font-size: 1.4rem;
  color: var(--text3);
  font-family: var(--font-head);
  text-align: right;
  transition: transform .2s;
}
.diag-card:hover .diag-card-arrow { transform: translateX(4px); color: var(--text); }

/* ===== COMPARISON TABLE ===== */
.comparison-table { max-width: 800px; }
.comparison-table h3 {
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-size: .8rem;
}
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th {
  text-align: left;
  padding: .6rem 1rem;
  background: var(--bg3);
  color: var(--text2);
  font-family: var(--font-mono);
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  border-bottom: 1px solid var(--border);
}
td {
  padding: .65rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text2);
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); color: var(--text); }

.badge {
  font-family: var(--font-mono);
  font-size: .7rem;
  padding: .2em .6em;
  border-radius: 4px;
  font-weight: 500;
  white-space: nowrap;
}
.badge-classes  { background: rgba(74,144,217,.15); color: var(--c-classes); }
.badge-usecase  { background: rgba(232,118,58,.15); color: var(--c-usecase); }
.badge-sequence { background: rgba(91,191,126,.15);  color: var(--c-sequence); }
.badge-guide    { background: rgba(240,192,96,.15);  color: #f0c060; }

/* guide card */
.diag-card--guide { border-left-color: #f0c060; }
.diag-card--guide:hover  { border-color: #f0c060; }
.diag-card--guide .diag-card-icon { color: #f0c060; }

/* ===== PAGE LAYOUTS (classes / usecase / sequence) ===== */
.page-hero {
  background: var(--bg2);
  padding: 3.5rem min(5rem, 5vw);
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  max-width: 1200px;
}
.page-hero::before {
  content: attr(data-title);
  position: absolute;
  right: 4rem; top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-head);
  font-size: 9rem;
  font-weight: 900;
  color: rgba(255,255,255,0.025);
  pointer-events: none;
  letter-spacing: -.05em;
  white-space: nowrap;
}
.page-eyebrow {
  font-family: var(--font-mono);
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--page-color, var(--c-accent));
  margin-bottom: .75rem;
}
.page-title {
  font-family: var(--font-head);
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.05;
  color: var(--text);
  margin-bottom: 1rem;
}
.page-desc {
  font-size: 1rem;
  color: var(--text2);
  max-width: 55ch;
}
.breadcrumb {
  display: flex; align-items: center; gap: .5rem;
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--text3);
  margin-bottom: 1.5rem;
}
.breadcrumb a { color: var(--text2); text-decoration: none; }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb span { color: var(--text3); }

/* ===== TWO-COL ===== */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 3rem;
  align-items: start;
}
@media(max-width:900px) { .two-col { grid-template-columns: 1fr; } }

/* ===== UML DIAGRAM CONTAINER ===== */
.diag-wrap {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  overflow-x: auto;
}
.diag-wrap svg { display: block; }

/* ===== CODE BLOCKS ===== */
.code-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: .84rem;
}
.code-header {
  background: var(--bg3);
  padding: .5rem 1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  border-bottom: 1px solid var(--border);
}
.code-dots { display: flex; gap: 4px; }
.code-dots span { width: 9px; height: 9px; border-radius: 50%; }
.code-dots span:nth-child(1) { background: #ff5f57; }
.code-dots span:nth-child(2) { background: #ffbd2e; }
.code-dots span:nth-child(3) { background: #28c840; }
.code-lang {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: .65rem;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .07em;
}
pre { padding: 1rem 1.25rem; overflow-x: auto; line-height: 1.75; }
code { font-family: var(--font-mono); color: var(--text); }

/* Syntax */
.kw  { color: #c792ea; }
.cl  { color: #82aaff; }
.fn  { color: #89ddff; }
.st  { color: #c3e88d; }
.nu  { color: #f78c6c; }
.cm  { color: #546e7a; font-style: italic; }
.an  { color: #ff5874; }
.ty  { color: #ffcb6b; }

p code, li code, td code {
  font-family: var(--font-mono);
  font-size: .82em;
  background: rgba(255,255,255,0.08);
  padding: .1em .35em;
  border-radius: 3px;
  color: var(--page-color, var(--c-accent));
}

/* ===== INFO / TIP BOXES ===== */
.info-box, .tip-box, .warn-box {
  display: flex;
  gap: .75rem;
  padding: .9rem 1.1rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  border-left: 3px solid;
  margin: 1.25rem 0;
  font-size: .9rem;
  color: var(--text2);
}
.info-box { background: rgba(74,144,217,.07); border-color: var(--c-classes); }
.tip-box  { background: rgba(91,191,126,.07); border-color: var(--c-sequence); }
.warn-box { background: rgba(232,118,58,.07); border-color: var(--c-usecase); }
.info-box p, .tip-box p, .warn-box p { margin: 0; }

/* ===== NOTATION TABLE ===== */
.notif-table { width: 100%; border-collapse: collapse; font-size: .88rem; margin: 1.25rem 0; }
.notif-table th {
  text-align: left;
  padding: .55rem .9rem;
  background: var(--bg3);
  color: var(--text2);
  font-family: var(--font-mono);
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  border: 1px solid var(--border);
}
.notif-table td {
  padding: .6rem .9rem;
  border: 1px solid var(--border);
  color: var(--text2);
  vertical-align: middle;
}
.notif-table td:first-child {
  font-family: var(--font-mono);
  font-size: .82em;
  color: var(--text);
  background: var(--bg2);
  white-space: nowrap;
  font-weight: 600;
}
.notif-table tr:hover td { background: rgba(255,255,255,0.02); }

/* ===== BULLET LIST ===== */
.blist { display: flex; flex-direction: column; gap: .55rem; margin: 1rem 0; }
.blist-item {
  display: flex; align-items: baseline; gap: .7rem;
  font-size: .92rem; color: var(--text2);
}
.blist-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--page-color, var(--c-accent));
  flex-shrink: 0; margin-top: .45rem;
}

/* ===== ARROW ROW (relations) ===== */
.rel-table { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.rel-row {
  display: grid;
  grid-template-columns: 140px 160px 1fr;
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.rel-row:last-child { border-bottom: none; }
.rel-row:hover { background: rgba(255,255,255,0.02); }
.rel-row.rel-header > div {
  background: var(--bg3);
  font-family: var(--font-mono);
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text3);
}
.rel-row > div {
  padding: .75rem 1rem;
  font-size: .88rem;
  color: var(--text2);
  display: flex;
  align-items: center;
  border-right: 1px solid var(--border);
}
.rel-row > div:last-child { border-right: none; }
.rel-name { font-family: var(--font-head); font-weight: 600; color: var(--text); font-size: .9rem; }
.arrow-svg { width: 140px; height: 22px; }

/* ===== CHEATSHEET ===== */
.cheat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}
.cheat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.cheat-card h4 {
  padding: .6rem 1rem;
  font-family: var(--font-head);
  font-size: .88rem;
  font-weight: 700;
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.cheat-table { width: 100%; border-collapse: collapse; font-size: .8rem; }
.cheat-table td { padding: .4rem .9rem; border-bottom: 1px solid var(--border); color: var(--text2); }
.cheat-table td:first-child { font-family: var(--font-mono); color: var(--page-color, var(--c-accent)); white-space: nowrap; }
.cheat-table tr:last-child td { border-bottom: none; }

/* ===== FOOTER ===== */
.footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 1.5rem 5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--text3);
}
.footer a { color: var(--text2); text-decoration: none; }
.footer a:hover { color: var(--text); }

/* ===== RESPONSIVE ===== */
@media(max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .hamburger { display: flex; }
  .main { margin-left: 0; }
  .section { padding: 3rem 1.5rem; }
  .hero { padding: 5rem 1.5rem 3rem; }
  .page-hero { padding: 4rem 1.5rem; }
  .page-hero::before { display: none; }
  .footer { padding: 1.5rem; flex-direction: column; gap: .5rem; text-align: center; }
  .diag-card { grid-template-columns: 60px 1fr; }
  .diag-card-arrow { display: none; }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
