/* ───────────────────────────────────────────────────────────
   SeigneurCut — app chrome, theme tokens, menus, dialogs
   ─────────────────────────────────────────────────────────── */
:root {
  color-scheme: dark;
  /* surfaces */
  --gutter: #0e0e0e;          /* space between panels */
  --app: #151515;             /* title bar / app frame */
  --panel: #1d1d1d;           /* panel body */
  --panel-2: #232323;         /* raised rows, inputs */
  --panel-3: #2b2b2b;         /* hover */
  --panel-head: #1a1a1a;      /* tab strip */
  --field: #141414;           /* text fields, timeline track bg */
  --line: #2f2f2f;            /* hairlines */
  --line-2: #3a3a3a;
  /* text */
  --text: #d6d6d6;
  --text-hi: #f2f2f2;
  --text-2: #a3a3a3;
  --text-3: #6f6f6f;
  /* accents */
  --accent: #2d8ceb;          /* focus, selection */
  --accent-2: #4b9cf5;
  --timecode: #4b9cf5;        /* monitor / timeline timecode */
  --playhead: #2d8ceb;
  --focus-ring: #2d8ceb;
  --brand: #ff8a3d;           /* personal brand: amber */
  --brand-2: #ffb36b;
  --danger: #e5484d;
  --ok: #3fb950;
  --warn: #e3b341;
  --in-out: rgba(61, 142, 240, .14);
  /* clip label colours */
  --c-violet: #a690e0;
  --c-iris: #729acc;
  --c-caribbean: #29d698;
  --c-lavender: #e384e3;
  --c-cerulean: #2fbfde;
  --c-forest: #51b858;
  --c-rose: #f76fa4;
  --c-mango: #eda63b;
  --c-teal: #2a9d9d;
  --c-tan: #cec195;
  --c-yellow: #e2e264;
  /* type */
  --font: 'Source Sans 3', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Source Code Pro', ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --fs: 12px;
  --fs-s: 11px;
  --fs-l: 13px;
  /* metrics */
  --titlebar-h: 34px;
  --wsbar-h: 44px;
  --status-h: 22px;
  --tab-h: 28px;
  --radius: 4px;
  --ui-brightness: 1;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--gutter);
  color: var(--text);
  font: 400 var(--fs)/1.35 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: default; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 1px; }
/* visible to screen readers and search engines only */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
::selection { background: rgba(61,142,240,.45); }

.i { width: 16px; height: 16px; flex: none; display: block; }
.i.sm { width: 12px; height: 12px; }
.i.lg { width: 20px; height: 20px; }

/* scrollbars: thin, editor-like */
* { scrollbar-width: thin; scrollbar-color: #4a4a4a transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #444; border-radius: 6px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: #5a5a5a; }
::-webkit-scrollbar-corner { background: transparent; }

/* ── App frame ──────────────────────────────────────────── */
.app {
  position: fixed; inset: 0;
  display: grid;
  grid-template-rows: var(--titlebar-h) var(--wsbar-h) 1fr var(--status-h);
  filter: brightness(var(--ui-brightness));
  opacity: 0;
  transition: opacity .35s ease;
}
.app.ready { opacity: 1; }

.titlebar {
  display: flex; align-items: center; gap: 4px;
  background: var(--app);
  padding: 0 8px 0 6px;
  border-bottom: 1px solid #0b0b0b;
  position: relative;
  z-index: 20;
}
.app-logo, .boot-logo {
  width: 24px; height: 24px; border-radius: 5px; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(145deg, #2a1608, #120a04);
  box-shadow: inset 0 0 0 1.5px var(--brand);
  color: var(--brand); font-weight: 800; font-size: 12px; letter-spacing: -.02em;
  text-decoration: none !important;
}
.app-logo span { transform: translateY(-.5px); }
.menubar { display: flex; align-items: stretch; height: 100%; margin-left: 4px; }
.menubar > button {
  padding: 0 8px; color: var(--text); font-size: var(--fs-l);
  border-radius: 3px; margin: 5px 0; line-height: 24px;
}
.menubar > button:hover, .menubar > button.open { background: var(--panel-3); color: var(--text-hi); }
.mobile-menu-btn { display: none; }
.title-center { flex: 1; text-align: center; color: var(--text-2); font-size: var(--fs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 12px; }
.doc-path, .doc-ext { color: var(--text-3); }
.title-right { display: flex; align-items: center; gap: 8px; }
.hire-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 10px 0 8px; border-radius: 12px;
  background: var(--accent); color: #fff; font-weight: 600; font-size: var(--fs);
  text-decoration: none !important;
}
.hire-btn:hover { background: var(--accent-2); }
.hire-btn .i { width: 14px; height: 14px; }

/* workspace bar */
.wsbar {
  display: flex; align-items: center; gap: 12px;
  background: var(--app); padding: 0 8px;
  border-bottom: 1px solid #0b0b0b;
}
.modes { display: flex; gap: 2px; padding-right: 12px; border-right: 1px solid var(--line); height: 20px; align-items: center; }
.mode { padding: 2px 10px; border-radius: 3px; color: var(--text-2); font-weight: 600; font-size: var(--fs-l); }
.mode:hover { color: var(--text-hi); }
.mode.active { color: var(--text-hi); background: #2a2a2a; }
.workspaces { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
.workspaces::-webkit-scrollbar { display: none; }
.workspaces button {
  padding: 4px 9px; color: var(--text-2); font-size: var(--fs-l); white-space: nowrap; position: relative;
}
.workspaces button:hover { color: var(--text-hi); }
.workspaces button.active { color: var(--accent-2); }
.workspaces button.active::after { content: ''; position: absolute; left: 9px; right: 9px; bottom: -1px; height: 2px; background: var(--accent); border-radius: 2px; }
.workspaces button small { color: var(--text-3); font-size: 10px; margin-left: 4px; }
.wsbar-right { display: flex; align-items: center; gap: 2px; }
.ws-name { color: var(--text-3); font-size: var(--fs-s); margin-right: 6px; }
.icon-btn {
  width: 24px; height: 24px; display: grid; place-items: center; border-radius: 3px; color: var(--text-2);
}
.icon-btn:hover { background: var(--panel-3); color: var(--text-hi); }
.icon-btn.on { color: var(--accent-2); }
.icon-btn:disabled { opacity: .35; pointer-events: none; }

/* status bar */
.statusbar {
  display: flex; align-items: center; gap: 14px; padding: 0 10px;
  background: var(--app); color: var(--text-3); font-size: var(--fs-s);
  border-top: 1px solid #0b0b0b; white-space: nowrap; overflow: hidden;
}
.sb-msg { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; }
.sb-spacer { flex: 1; }
.sb-render i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); margin-right: 4px; vertical-align: -1px; }
.sb-render.busy i { background: var(--warn); animation: pulse .8s infinite alternate; }
@keyframes pulse { to { opacity: .3; } }

/* ── Menus ─────────────────────────────────────────────── */
.menu-layer { position: fixed; inset: 0; z-index: 1000; pointer-events: none; }
.menu {
  position: fixed; min-width: 230px; max-width: 340px;
  background: #262626; border: 1px solid #3c3c3c; border-radius: 6px;
  box-shadow: 0 10px 28px rgba(0,0,0,.55), 0 2px 6px rgba(0,0,0,.4);
  padding: 5px; pointer-events: auto;
  font-size: var(--fs-l);
  max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); overflow-y: auto;
  animation: menuIn .09s ease-out;
}
@keyframes menuIn { from { opacity: 0; transform: translateY(-3px); } }
.menu-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 4px 10px 4px 6px; border-radius: 4px; color: var(--text); text-align: left; white-space: nowrap;
  min-height: 24px;
}
.menu-item .chk { width: 14px; flex: none; color: var(--text-hi); }
.menu-item .chk .i { width: 13px; height: 13px; }
.menu-item .lbl { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.menu-item .kbd { color: var(--text-3); font-size: var(--fs-s); padding-left: 18px; }
.menu-item .sub { color: var(--text-3); }
.menu-item:not(.disabled):hover, .menu-item.hl { background: var(--accent); color: #fff; }
.menu-item:not(.disabled):hover .kbd, .menu-item.hl .kbd, .menu-item:not(.disabled):hover .sub, .menu-item.hl .sub { color: rgba(255,255,255,.85); }
.menu-item.disabled { color: #6a6a6a; }
.menu-sep { height: 1px; background: #3a3a3a; margin: 4px 6px; }
.menu-head { padding: 4px 10px 2px 28px; color: var(--text-3); font-size: var(--fs-s); text-transform: uppercase; letter-spacing: .06em; }

/* ── Dialogs ──────────────────────────────────────────── */
.dialog-layer { position: fixed; inset: 0; z-index: 900; display: none; place-items: center; background: rgba(0,0,0,.45); padding: 16px; }
.dialog-layer.open { display: grid; }
.dialog {
  width: min(560px, 100%); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px);
  display: flex; flex-direction: column;
  background: #1f1f1f; border: 1px solid #3a3a3a; border-radius: 8px;
  box-shadow: 0 24px 60px rgba(0,0,0,.6);
  animation: dlgIn .14s ease-out;
  user-select: text; -webkit-user-select: text;
}
.dialog.wide { width: min(820px, 100%); }
@keyframes dlgIn { from { opacity: 0; transform: scale(.98) translateY(4px); } }
.dialog-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px 10px 16px; border-bottom: 1px solid #2c2c2c; }
.dialog-head h2 { flex: 1; margin: 0; font-size: 15px; font-weight: 600; color: var(--text-hi); }
.dialog-body { padding: 16px; overflow: auto; font-size: var(--fs-l); line-height: 1.55; color: var(--text); }
.dialog-body p { margin: 0 0 10px; }
.dialog-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 16px; border-top: 1px solid #2c2c2c; }
.btn {
  height: 28px; padding: 0 14px; border-radius: 14px; font-weight: 600; font-size: var(--fs-l);
  border: 1.5px solid #5a5a5a; color: var(--text-hi); display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  text-decoration: none !important; cursor: pointer;
}
.btn:hover { background: #2e2e2e; border-color: #777; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.brand { background: var(--brand); border-color: var(--brand); color: #1a0d03; }
.btn.brand:hover { background: var(--brand-2); border-color: var(--brand-2); }
.btn .i { width: 14px; height: 14px; }

.kbd-cap {
  display: inline-block; min-width: 20px; padding: 1px 5px; border-radius: 3px;
  background: #2c2c2c; border: 1px solid #3d3d3d; border-bottom-width: 2px;
  font: 500 11px/16px var(--mono); color: var(--text-hi); text-align: center;
}
.shortcut-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 4px 24px; }
.shortcut-grid h3 { grid-column: 1 / -1; margin: 12px 0 4px; font-size: var(--fs-s); text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); }
.shortcut-grid h3:first-child { margin-top: 0; }
.shortcut-row { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; border-bottom: 1px solid #262626; }
.shortcut-row span:first-child { color: var(--text-2); }

/* about dialog */
.about { display: grid; grid-template-columns: 180px 1fr; min-height: 280px; }
.about-art {
  background: radial-gradient(120% 90% at 20% 10%, #ff8a3d55, transparent 60%), radial-gradient(100% 80% at 90% 100%, #3d8ef055, transparent 60%), #120c08;
  display: grid; place-items: center; border-right: 1px solid #2c2c2c;
}
.about-art .boot-logo { width: 84px; height: 84px; border-radius: 18px; font-size: 40px; box-shadow: inset 0 0 0 3px var(--brand); }
.about-body { padding: 20px; }
.about-body h3 { margin: 0; font-size: 22px; color: var(--text-hi); font-weight: 700; }
.about-body .ver { color: var(--text-3); margin-bottom: 14px; }

/* toasts */
.toast-layer { position: fixed; right: 12px; bottom: calc(var(--status-h) + 12px); z-index: 1100; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  min-width: 240px; max-width: 360px; padding: 10px 12px; border-radius: 6px;
  background: #2a2a2a; border: 1px solid #404040; border-left: 3px solid var(--accent);
  box-shadow: 0 8px 22px rgba(0,0,0,.5); color: var(--text-hi); font-size: var(--fs-l);
  animation: toastIn .18s ease-out; pointer-events: auto;
}
.toast small { display: block; color: var(--text-2); font-size: var(--fs); margin-top: 2px; }
.toast.out { animation: toastOut .2s ease-in forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(16px); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(16px); } }

/* ── Boot splash ──────────────────────────────────────── */
.boot {
  position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center;
  background: #0b0b0b; transition: opacity .4s ease, visibility .4s;
  padding: 16px;
}
.boot.done { opacity: 0; visibility: hidden; }
.boot.skip { display: none; }
.boot-card {
  width: min(620px, 100%); display: grid; grid-template-columns: 1.1fr 1fr; overflow: hidden;
  border-radius: 10px; border: 1px solid #2a2a2a; background: #161616;
  box-shadow: 0 30px 80px rgba(0,0,0,.7);
}
.boot-art {
  min-height: 300px; position: relative; overflow: hidden;
  background:
    repeating-linear-gradient(90deg, transparent 0 22px, rgba(255,255,255,.035) 22px 23px),
    radial-gradient(90% 70% at 30% 30%, rgba(255,138,61,.55), transparent 60%),
    radial-gradient(80% 70% at 80% 90%, rgba(61,142,240,.45), transparent 65%),
    #120b06;
}
.boot-art::before {
  /* stylised timeline bars */
  content: ''; position: absolute; left: 14px; right: 14px; bottom: 18px; height: 64px;
  background:
    linear-gradient(var(--c-violet), var(--c-violet)) 0 0 / 38% 14px no-repeat,
    linear-gradient(var(--c-iris), var(--c-iris)) 40% 0 / 24% 14px no-repeat,
    linear-gradient(var(--c-violet), var(--c-violet)) 100% 0 / 34% 14px no-repeat,
    linear-gradient(var(--c-lavender), var(--c-lavender)) 12% 22px / 30% 10px no-repeat,
    linear-gradient(var(--c-caribbean), var(--c-caribbean)) 0 40px / 62% 22px no-repeat,
    linear-gradient(var(--c-caribbean), var(--c-caribbean)) 100% 40px / 36% 22px no-repeat;
  opacity: .9; border-radius: 3px;
}
.boot-art::after {
  content: ''; position: absolute; top: 0; bottom: 0; width: 2px; background: var(--playhead);
  left: 15%; animation: bootHead 2.2s cubic-bezier(.4,0,.2,1) forwards;
  box-shadow: 0 0 12px var(--playhead);
}
@keyframes bootHead { to { left: 82%; } }
.boot-info { padding: 26px 24px 20px; display: flex; flex-direction: column; gap: 6px; }
.boot-logo { width: 46px; height: 46px; border-radius: 10px; font-size: 22px; margin-bottom: 8px; }
.boot-name { font-size: 26px; font-weight: 300; color: var(--text-hi); letter-spacing: -.01em; }
.boot-name b { font-weight: 800; color: var(--brand); }
.boot-ver { color: var(--text-3); font-size: var(--fs); }
.boot-status { margin-top: auto; color: var(--text-2); font-size: var(--fs); min-height: 16px; font-family: var(--mono); font-size: 11px; }
.boot-bar { height: 3px; background: #2a2a2a; border-radius: 2px; overflow: hidden; }
.boot-bar i { display: block; height: 100%; width: 0; background: var(--brand); transition: width .2s; }
.boot-legal { color: #555; font-size: 10px; margin-top: 8px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; transition-duration: .001s !important; }
}

/* ── Main modes (big tabs) ─────────────────────────────── */
.wsbar { gap: 8px; padding: 0 8px 0 6px; }
.workspaces { gap: 4px; align-items: center; }
.workspaces .mode-tab {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center;
  height: 36px; padding: 0 16px; border-radius: 7px; color: var(--text-2);
  border: 1px solid transparent; transition: background .15s, color .15s, border-color .15s;
}
.workspaces .mode-tab b { font-size: 14.5px; font-weight: 700; line-height: 1.1; color: var(--text); letter-spacing: .005em; }
.workspaces .mode-tab small { font-size: 10.5px; color: var(--text-3); margin: 1px 0 0; line-height: 1.1; }
.workspaces .mode-tab:hover { background: #222; }
.workspaces .mode-tab:hover b { color: var(--text-hi); }
.workspaces .mode-tab.active { background: linear-gradient(180deg, #23344a, #1c2a3b); border-color: #2f4d70; }
.workspaces .mode-tab.active b { color: #fff; }
.workspaces .mode-tab.active small { color: #9cc4f5; }
.workspaces .mode-tab.active::after { display: none; }

/* ── Identity bar ──────────────────────────────────────── */
.identity { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--text-2); min-width: 0; }
.id-name { color: var(--text-hi); font-weight: 700; font-size: 13.5px; letter-spacing: .01em; white-space: nowrap; }
.id-role { color: var(--text-2); font-size: var(--fs-l); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.id-otw { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 7px; border-radius: 11px; white-space: nowrap;
  background: rgba(63, 185, 80, .14); border: 1px solid rgba(63, 185, 80, .45); color: #7ee08c; font-size: 11.5px; font-weight: 600; }
.id-otw i { width: 7px; height: 7px; border-radius: 50%; background: #3fb950; box-shadow: 0 0 0 0 rgba(63,185,80,.6); animation: otw 2s infinite; }
@keyframes otw { 70% { box-shadow: 0 0 0 6px rgba(63,185,80,0); } 100% { box-shadow: 0 0 0 0 rgba(63,185,80,0); } }
.cv-btn, .simple-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 12px; white-space: nowrap;
  border: 1px solid #4a4a4a; color: var(--text-hi); font-weight: 600; font-size: var(--fs); text-decoration: none !important;
}
.cv-btn:hover { background: #2c2c2c; border-color: #666; color: #fff; }
/* Simple view: amber (brand) so it stands out next to the blue Contact button */
.simple-btn { background: rgba(255, 138, 61, .14); border-color: rgba(255, 138, 61, .6); color: var(--brand-2); }
.simple-btn:hover { background: rgba(255, 138, 61, .26); border-color: var(--brand); color: #fff; }
.cv-btn .i { width: 13px; height: 13px; }
.cv-btn[hidden] { display: none; }

/* ── First-visit hints (js/hints.js) ─────────────────────────── */
.hint { position: fixed; z-index: 900; max-width: 300px; padding: 9px 15px; border-radius: 10px; background: #2d8ceb; color: #fff; font-size: 14.5px; font-weight: 700; line-height: 1.35;
  border: 2px solid rgba(255,255,255,.85); box-shadow: 0 8px 28px rgba(0,0,0,.55), 0 0 0 6px rgba(45,140,235,.25);
  pointer-events: none; opacity: 0; transform: translateY(6px) scale(.96); transition: opacity .3s, transform .3s cubic-bezier(.2,1.4,.4,1); }
.hint.above { transform: translateY(-6px) scale(.96); }
.hint.on { opacity: 1; transform: none; }
.hint.big { max-width: 420px; padding: 12px 20px; font-size: 17px; text-align: center; border-radius: 12px; }
.hint::before { content: ''; position: absolute; left: calc(var(--ax, 50%) - 8px); top: -9px; border: 8px solid transparent; border-top: 0; border-bottom-color: #fff; }
.hint.above::before { top: auto; bottom: -9px; border: 8px solid transparent; border-bottom: 0; border-top-color: #fff; }
.hint-ring { position: fixed; z-index: 899; border-radius: 6px; pointer-events: none; opacity: 0; transition: opacity .3s; box-shadow: 0 0 0 3px #4ba7ff; }
.hint-ring.on { opacity: 1; animation: hint-pulse 1.4s ease-out infinite; }
.hint-ring.still.on { animation: none; }
@keyframes hint-pulse { 0% { box-shadow: 0 0 0 3px #4ba7ff, 0 0 0 0 rgba(75,167,255,.7); } 70% { box-shadow: 0 0 0 3px #4ba7ff, 0 0 0 16px rgba(75,167,255,0); } 100% { box-shadow: 0 0 0 3px #4ba7ff, 0 0 0 0 rgba(75,167,255,0); } }

.tour-chip { height: 24px; padding: 0 11px; margin-right: 4px; border-radius: 12px; border: 1px dashed #4a4a4a; color: var(--text-2); font-size: 12px; white-space: nowrap; }
.tour-chip b { color: var(--text-hi); font-weight: 600; }
.tour-chip:hover { border-style: solid; border-color: var(--accent); color: var(--text-hi); }
.tour-chip[hidden] { display: none; }
@media (max-width: 1100px) { .tour-chip { display: none; } }
