@font-face { font-family: 'Source Sans 3'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/source-sans-3-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Source Sans 3'; font-style: italic; font-weight: 400; font-display: swap; src: url('fonts/source-sans-3-latin-400-italic.woff2') format('woff2'); }
@font-face { font-family: 'Source Sans 3'; font-style: normal; font-weight: 500 600; font-display: swap; src: url('fonts/source-sans-3-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Source Sans 3'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/source-sans-3-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/ibm-plex-mono-latin-500-normal.woff2') format('woff2'); }

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

/* Kiira Consulting: deep navy ground, Kiira blue for everything you can click,
   Kiira orange reserved for buffers and the few brand moments. Status colours stay semantic. */
:root {
  color-scheme: dark;
  --bg:      #061226;
  --bg2:     #0B1C38;
  --bg3:     #12284A;
  --bg4:     #1B3660;
  --border:  rgba(150,185,235,0.10);
  --border2: rgba(150,185,235,0.20);
  --text:    #EEF3FA;
  --text2:   #A9B8CF;
  --text3:   #6E82A2;
  --accent:  #1A9BF0;   /* Kiira blue */
  --accent2: #5AB8F5;
  --brand-orange: #F7931E; /* Kiira orange */
  --red:     #F87171;
  --yellow:  #FBBF24;
  --green:   #4ADE80;
  --blue:    #60A5FA;
  --radius:  8px;
  --radius2: 12px;
  --sans:    'Source Sans 3', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --mono:    'IBM Plex Mono', ui-monospace, Menlo, monospace;
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  font-size: 16px;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent); color: var(--bg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ─── TYPOGRAPHY ─── */
h1 { font-size: 2.4rem; font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; }
h2 { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.01em; }
h3 { font-size: 1.1rem; font-weight: 600; }
h4 { font-size: 0.9rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text2); }
p  { color: var(--text2); line-height: 1.7; }

.mono { font-family: var(--mono); }

/* ─── LAYOUT ─── */
.container { max-width: 1140px; margin: 0 auto; padding: 0 24px; position: relative; z-index: 1; }

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px; border-radius: var(--radius); border: 1px solid var(--border2);
  font-family: var(--sans); font-size: 0.95rem; font-weight: 600;
  cursor: pointer; transition: all 0.18s ease; text-decoration: none;
  background: transparent; color: var(--text);
  position: relative; z-index: 1;
}
.btn:hover { background: var(--bg3); border-color: var(--border2); }
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--accent); color: #04122A; border-color: var(--accent); font-weight: 700;
}
.btn-primary:hover { background: var(--accent2); border-color: var(--accent2); }

.btn-lg { padding: 15px 32px; font-size: 1rem; }

.btn-ghost { border-color: transparent; color: var(--text2); }
.btn-ghost:hover { background: var(--bg3); border-color: var(--border); color: var(--text); }

/* ─── CARDS ─── */
.card {
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius2);
  padding: 20px;
}
.card-sm { padding: 14px 16px; border-radius: var(--radius); }

/* ─── BADGE ─── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 100px; font-size: 0.72rem; font-weight: 500;
  background: var(--bg3); border: 1px solid var(--border2); color: var(--text2);
  letter-spacing: 0.04em; text-transform: uppercase;
}
.badge-accent { background: rgba(26,155,240,0.12); border-color: rgba(26,155,240,0.3); color: var(--accent); }
.badge-green  { background: rgba(74,222,128,0.1);  border-color: rgba(74,222,128,0.3);  color: var(--green); }
.badge-red    { background: rgba(248,113,113,0.1);   border-color: rgba(248,113,113,0.3);  color: var(--red); }
.badge-blue   { background: rgba(96,165,250,0.1);  border-color: rgba(96,165,250,0.3); color: var(--blue); }

/* ─── ZONE BARS ─── */
.zone-bar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; gap: 2px; }
.zone-bar .z-red    { background: var(--red);    flex-shrink: 0; }
.zone-bar .z-yellow { background: var(--yellow); flex-shrink: 0; }
.zone-bar .z-green  { background: var(--green);  flex: 1; }

/* ─── FORM ELEMENTS ─── */
.form-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.form-row label { font-size: 0.78rem; font-weight: 500; color: var(--text2); text-transform: uppercase; letter-spacing: 0.06em; }
.form-row .row { display: flex; align-items: center; gap: 10px; }

input[type="range"] {
  -webkit-appearance: none; appearance: none;
  height: 4px; border-radius: 2px; background: var(--bg4);
  outline: none; cursor: pointer; flex: 1;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px;
  border-radius: 50%; background: var(--accent); cursor: pointer;
  border: 2px solid var(--bg);
  transition: transform 0.15s;
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.2); }

select {
  background: var(--bg3); border: 1px solid var(--border2);
  color: var(--text); padding: 9px 12px; border-radius: var(--radius);
  font-family: var(--sans); font-size: 0.9rem; cursor: pointer;
  outline: none;
}
select:focus { border-color: var(--accent); }

.val-display {
  font-family: var(--mono); font-size: 0.82rem; color: var(--accent);
  min-width: 36px; text-align: right; font-weight: 500;
}

/* ─── TOGGLE ─── */
.toggle-wrap { display: flex; align-items: center; gap: 10px; }
.toggle {
  position: relative; width: 40px; height: 22px; display: inline-block; flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-track {
  position: absolute; inset: 0; border-radius: 11px;
  background: var(--bg4); border: 1px solid var(--border2);
  transition: background 0.2s, border-color 0.2s; cursor: pointer;
}
.toggle input:checked ~ .toggle-track { background: var(--accent); border-color: var(--accent); }
.toggle-thumb {
  position: absolute; top: 3px; left: 3px; width: 16px; height: 16px;
  border-radius: 50%; background: var(--text2);
  transition: transform 0.2s, background 0.2s; pointer-events: none;
}
.toggle input:checked ~ .toggle-thumb { transform: translateX(18px); background: #04122A; }

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--bg4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border2); }

/* ─── UTILS ─── */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.text-sm { font-size: 0.82rem; }
.text-xs { font-size: 0.72rem; }
.text-accent { color: var(--accent); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-muted { color: var(--text2); }
.font-mono { font-family: var(--mono); }
.text-right { text-align: right; }
.w-full { width: 100%; }
.opacity-0 { opacity: 0; }
.hidden { display: none !important; }

/* ─── DIVIDER ─── */
.divider { height: 1px; background: var(--border); margin: 20px 0; }

/* ─── ANIMATIONS ─── */
@keyframes fadeIn { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.5} }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes glow { 0%,100%{box-shadow:0 0 0 0 rgba(26,155,240,0.4)} 50%{box-shadow:0 0 0 6px rgba(26,155,240,0)} }

.fade-in { animation: fadeIn 0.4s ease both; }
.pulse { animation: pulse 2s ease infinite; }

/* ─── STEP BUFFER NODES (SVG OVERLAYS) ─── */
.node-buffered { filter: drop-shadow(0 0 6px rgba(247,147,30,0.35)); }
.node-selected { filter: drop-shadow(0 0 8px rgba(96,165,250,0.6)); }
