@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600;700&family=Syne:wght@400;600;700;800&display=swap');

:root {
--bg: #07090f;
--surface: #0d1117;
--border: #1e2535;
--border-glow: #2a3555;
--text-primary: #e8edf5;
--text-secondary: #7a8ba8;
--text-muted: #3d4f6e;
--blue: #3b82f6;
--blue-glow: rgba(59, 130, 246, 0.15);
--cyan: #06b6d4;
--green: #10b981;
--amber: #f59e0b;
--red: #ef4444;
--purple: #8b5cf6;
--orange: #f97316;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
background: var(--bg);
font-family: 'Syne', sans-serif;
color: var(--text-primary);
min-height: 100vh;
padding: 40px 24px;
position: relative;
overflow-x: hidden;
}

body::before {
content: '';
position: fixed;
top: 0; left: 0; right: 0; bottom: 0;
background: 
    radial-gradient(ellipse 80% 50% at 20% 10%, rgba(59,130,246,0.05) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 90%, rgba(139,92,246,0.05) 0%, transparent 60%);
pointer-events: none;
z-index: 0;
}

.wrapper {
max-width: 900px;
margin: 0 auto;
position: relative;
z-index: 1;
}

.header {
text-align: center;
margin-bottom: 48px;
}

.header-label {
font-family: 'JetBrains Mono', monospace;
font-size: 11px;
letter-spacing: 0.25em;
color: var(--blue);
text-transform: uppercase;
margin-bottom: 12px;
}

.header h1 {
font-size: 32px;
font-weight: 800;
letter-spacing: -0.02em;
color: var(--text-primary);
margin-bottom: 8px;
}

.header p {
font-size: 14px;
color: var(--text-secondary);
font-family: 'JetBrains Mono', monospace;
}

/* ── LAYER CARD ── */
.layer {
position: relative;
border: 1px solid var(--border);
border-radius: 12px;
background: var(--surface);
padding: 20px 24px;
margin-bottom: 0;
transition: border-color 0.2s;
}

.layer:hover { border-color: var(--border-glow); }

.layer-inner {
display: flex;
align-items: center;
gap: 16px;
}

.layer-icon {
width: 44px;
height: 44px;
border-radius: 10px;
display: flex;
align-items: center;
justify-content: center;
font-size: 20px;
flex-shrink: 0;
}

.layer-body { flex: 1; min-width: 0; }

.layer-title {
font-size: 15px;
font-weight: 700;
letter-spacing: -0.01em;
margin-bottom: 3px;
}

.layer-subtitle {
font-size: 12px;
font-family: 'JetBrains Mono', monospace;
color: var(--text-secondary);
}

.layer-tags {
display: flex;
flex-wrap: wrap;
gap: 6px;
margin-top: 10px;
}

.tag {
font-family: 'JetBrains Mono', monospace;
font-size: 10px;
font-weight: 600;
padding: 3px 8px;
border-radius: 4px;
border: 1px solid;
letter-spacing: 0.05em;
}

/* ── COLOR VARIANTS ── */
.c-blue  { background: rgba(59,130,246,0.12); border-color: rgba(59,130,246,0.3); color: #60a5fa; }
.c-cyan  { background: rgba(6,182,212,0.12);  border-color: rgba(6,182,212,0.3);  color: #22d3ee; }
.c-green { background: rgba(16,185,129,0.12); border-color: rgba(16,185,129,0.3); color: #34d399; }
.c-amber { background: rgba(245,158,11,0.12); border-color: rgba(245,158,11,0.3); color: #fbbf24; }
.c-red   { background: rgba(239,68,68,0.12);  border-color: rgba(239,68,68,0.3);  color: #f87171; }
.c-purple{ background: rgba(139,92,246,0.12); border-color: rgba(139,92,246,0.3); color: #a78bfa; }
.c-orange{ background: rgba(249,115,22,0.12); border-color: rgba(249,115,22,0.3); color: #fb923c; }

.icon-blue   { background: rgba(59,130,246,0.15); }
.icon-cyan   { background: rgba(6,182,212,0.15);  }
.icon-green  { background: rgba(16,185,129,0.15); }
.icon-amber  { background: rgba(245,158,11,0.15); }
.icon-red    { background: rgba(239,68,68,0.15);  }
.icon-purple { background: rgba(139,92,246,0.15); }
.icon-orange { background: rgba(249,115,22,0.15); }

/* ── ARROW ── */
.arrow {
display: flex;
flex-direction: column;
align-items: center;
gap: 0;
padding: 4px 0;
position: relative;
}

.arrow-line {
width: 2px;
height: 28px;
background: linear-gradient(to bottom, var(--border-glow), var(--border));
}

.arrow-label {
position: absolute;
left: 50%;
top: 50%;
transform: translate(14px, -50%);
font-family: 'JetBrains Mono', monospace;
font-size: 10px;
color: var(--text-muted);
white-space: nowrap;
letter-spacing: 0.05em;
}

.arrow-head {
width: 0; height: 0;
border-left: 5px solid transparent;
border-right: 5px solid transparent;
border-top: 7px solid var(--border-glow);
}

/* ── BRANCH SECTION ── */
.branch-wrapper {
position: relative;
margin: 0;
}

.branch-label {
font-family: 'JetBrains Mono', monospace;
font-size: 10px;
letter-spacing: 0.15em;
text-transform: uppercase;
color: var(--red);
padding: 6px 10px;
border: 1px dashed rgba(239,68,68,0.3);
border-radius: 6px;
display: inline-block;
margin-bottom: 10px;
margin-left: 40px;
}

.branch-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 16px;
}

.branch-path {
display: flex;
flex-direction: column;
align-items: stretch;
}

.branch-path-label {
font-family: 'JetBrains Mono', monospace;
font-size: 9px;
letter-spacing: 0.15em;
text-transform: uppercase;
margin-bottom: 8px;
padding: 0 4px;
}

/* ── SECTION DIVIDER ── */
.section-rule {
display: flex;
align-items: center;
gap: 12px;
margin: 8px 0;
}

.section-rule::before,
.section-rule::after {
content: '';
flex: 1;
height: 1px;
background: var(--border);
}

.section-rule span {
font-family: 'JetBrains Mono', monospace;
font-size: 9px;
letter-spacing: 0.2em;
text-transform: uppercase;
color: var(--text-muted);
white-space: nowrap;
}

/* ── MAIN FLOW ── */
.main-flow { display: flex; flex-direction: column; }

/* footnote */
.footnote {
margin-top: 40px;
padding: 16px 20px;
border: 1px solid var(--border);
border-radius: 8px;
background: var(--surface);
}

.footnote-title {
font-size: 11px;
font-weight: 700;
letter-spacing: 0.1em;
text-transform: uppercase;
color: var(--text-secondary);
margin-bottom: 10px;
}

.legend {
display: flex;
flex-wrap: wrap;
gap: 16px;
}

.legend-item {
display: flex;
align-items: center;
gap: 6px;
font-family: 'JetBrains Mono', monospace;
font-size: 11px;
color: var(--text-secondary);
}

.legend-dot {
width: 8px; height: 8px;
border-radius: 50%;
flex-shrink: 0;
}

/* violation path highlight */
.violation-path .layer {
border-color: rgba(239,68,68,0.35);
background: rgba(239,68,68,0.04);
}

/* animation on load */
.layer { animation: fadeUp 0.4s ease both; }
.layer:nth-child(1) { animation-delay: 0.05s; }
.layer:nth-child(2) { animation-delay: 0.1s; }
.layer:nth-child(3) { animation-delay: 0.15s; }
.layer:nth-child(4) { animation-delay: 0.2s; }

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

.small-arrow {
display: flex;
justify-content: center;
padding: 2px 0;
}

.small-arrow svg { opacity: 0.4; }
