/* Portcullis tokens — drop-in from the Schema Scribe design system spec. */
@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600&display=swap");

[data-theme] {
  --font: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --num: "tnum" 1, "lnum" 1;

  --t-10: 11px; --t-11: 12px; --t-12: 13px; --t-13: 14px; --t-14: 15px;
  --t-15: 16px; --t-17: 18px; --t-20: 20px; --t-24: 24px; --t-32: 32px; --t-44: 44px;

  --lh-tight: 1.18; --lh-snug: 1.32; --lh-body: 1.5;
  --tr-cap: 0.06em; --tr-tight: -0.005em; --tr-display: -0.012em;

  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px;
  --s-7: 28px; --s-8: 32px; --s-10: 40px; --s-12: 48px; --s-16: 64px; --s-20: 80px;
  --hit: 44px;

  --r-0: 0; --r-1: 2px; --r-2: 4px; --r-3: 6px; --r-pill: 999px;

  --d-fast: 80ms; --d-med: 160ms; --d-slow: 240ms;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);

  --shadow-pop: 0 1px 0 rgba(20,19,16,.04), 0 8px 24px -8px rgba(20,19,16,.15);
}

[data-theme="light"] {
  --paper:        #F6F4EE;
  --surface:      #FFFFFF;
  --surface-sink: #EFECE4;
  --surface-overlay: #FFFFFF;
  --ink:          #221F19;
  --ink-2:        #4D4843;
  --ink-3:        #6E695F;
  --ink-4:        #908A7E;
  --ink-inv:      #F6F4EE;
  --line:         #E5E1D6;
  --line-strong:  #C9C2B5;
  --line-faint:   #EFECE4;
  --signal:       #15294B;
  --signal-2:     #233A65;
  --signal-tint:  #E8ECF4;
  --ok:           #2A6741;
  --ok-tint:      #DFE9DF;
  --caution:      #8B5A0E;
  --caution-tint: #F1E6CB;
  --overdue:      #9E2B14;
  --overdue-tint: #F2D9D0;
  --critical-bg:  #5C1408;
  --critical-fg:  #FCEDDC;
  --ring:         0 0 0 2px var(--paper), 0 0 0 4px var(--signal);
  --bar-w: 3px;
  color-scheme: light;
}

[data-theme="dark"] {
  --paper:        #0C0E11;
  --surface:      #16191D;
  --surface-sink: #0F1115;
  --surface-overlay: #1E2126;
  --ink:          #E8E4DC;
  --ink-2:        #9F9A91;
  --ink-3:        #8E887F;
  --ink-4:        #6A655C;
  --ink-inv:      #221F19;
  --line:         #262A2F;
  --line-strong:  #3D424A;
  --line-faint:   #1B1E22;
  --signal:       #7EA0D8;
  --signal-2:     #A1BAE3;
  --signal-tint:  #1A2235;
  --ok:           #6FB988;
  --ok-tint:      #1B2A21;
  --caution:      #E0AB58;
  --caution-tint: #2E2516;
  --overdue:      #E27F62;
  --overdue-tint: #321B14;
  --critical-bg:  #C2452A;
  --critical-fg:  #1A0805;
  --ring:         0 0 0 2px var(--paper), 0 0 0 4px var(--signal);
  --bar-w: 3px;
  --shadow-pop: 0 1px 0 rgba(0,0,0,.5), 0 12px 32px -8px rgba(0,0,0,.6);
  color-scheme: dark;
}

html, body { margin: 0; padding: 0; }
html[data-theme] {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-feature-settings: var(--num);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

button { font-family: inherit; }
input, textarea, select { font-family: inherit; }

:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: var(--r-1);
}

/* Skeleton pulse */
@keyframes portcullis-skel-pulse { 0%,100% { opacity: 0.55 } 50% { opacity: 1 } }
.skel {
  background: var(--surface-sink);
  border-radius: var(--r-1);
  animation: portcullis-skel-pulse 1.4s var(--ease) infinite;
}
@media (prefers-reduced-motion: reduce) {
  .skel { animation: none; opacity: 0.7 }
}

/* Custom select chevron / native scrollbars */
::selection { background: var(--signal-tint); color: var(--ink); }

/* Scrollbars — quiet */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: var(--r-1);
  border: 2px solid var(--paper);
}
*::-webkit-scrollbar-thumb:hover { background: var(--ink-4); }

/* Row hover */
.row-hover:hover { background: var(--surface-sink); }

/* Link */
a.link, .link {
  color: var(--signal);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--d-fast) var(--ease);
}
a.link:hover, .link:hover { border-bottom-color: var(--signal); }

/* Inked black bulk bar */
.ink-bar {
  background: var(--ink);
  color: var(--ink-inv);
}

/* Button hover/active */
.btn-primary:hover { background: #0e0c08 !important; }
[data-theme="dark"] .btn-primary:hover { background: #f5f1e9 !important; }
.btn-secondary:hover { background: var(--surface-sink) !important; }
.btn-ghost:hover { background: var(--surface-sink) !important; }
.btn-destructive:hover { background: var(--overdue-tint) !important; }
.btn-accent:hover { background: var(--signal-2) !important; }

/* Input focus */
.field-wrap:focus-within {
  border-color: var(--signal) !important;
  box-shadow: 0 0 0 3px var(--signal-tint);
}

/* Tab underline transition */
.tab-underline {
  position: absolute; bottom: -1px; left: 8px; right: 8px;
  height: 2px; background: var(--ink);
}

/* Slide-in panel */
@keyframes panel-slide-in {
  from { transform: translateX(16px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}
.panel-in { animation: panel-slide-in var(--d-med) var(--ease); }

/* Modal scrim fade */
@keyframes scrim-fade { from { opacity: 0 } to { opacity: 1 } }
.scrim-in { animation: scrim-fade var(--d-fast) var(--ease); }
@keyframes modal-mount {
  from { transform: translateY(-6px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.modal-in { animation: modal-mount var(--d-med) var(--ease); }

/* In-row job ticker bar */
@keyframes ticker {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
.ticker-track {
  position: relative;
  overflow: hidden;
  background: var(--surface-sink);
  height: 2px;
  border-radius: 1px;
}
.ticker-track::after {
  content: "";
  position: absolute; inset: 0;
  width: 40%;
  background: var(--ink-3);
  animation: ticker 1.6s var(--ease) infinite;
}

/* Mono-ish code that still uses Plex Sans */
.code {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

/* Disable text selection on chrome */
.no-select { user-select: none; -webkit-user-select: none; }
