/* Copied from Scriptbook (screenplay-app/app/theme.css), selectors adapted. Chrome theme ("codec console", from Euclid's EUCLID-UI.md). Every colour, font, shape and effect of the
   app housing lives here; swap this one file to re-theme. The on-screen script page uses --paper/--ink
   (console by default; body.page-paper switches to white). PDF/print stay black on white. */
@font-face { font-family: "Rajdhani"; font-weight: 600; src: url(fonts/Rajdhani-SemiBold.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Rajdhani"; font-weight: 700; src: url(fonts/Rajdhani-Bold.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Share Tech Mono"; src: url(fonts/ShareTechMono-Regular.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Orbitron"; font-weight: 700; src: url(fonts/Orbitron-Display.woff2) format("woff2"); font-display: swap; }
:root {
  /* Euclid palette */
  --void: #05080D; --hull: #0E1622; --hull-2: #162233; --bevel-hi: #3A4E66; --bevel-lo: #020407; --rule: #24364C;
  --phosphor: #5CFF9D; --phosphor-dim: #1F7A4C; --amber: #FFB547; --cyan: #4FD8FF; --alert: #FF4D5E;
  --text: #D7E3F0; --text-dim: #7F93AB;
  /* app tokens used by app.css */
  --bg: var(--void); --fg: var(--text); --muted: var(--text-dim); --panel: var(--hull); --panel-2: var(--hull-2);
  --field: var(--void); --border: var(--rule); --acc: var(--phosphor); --acc-fg: #000; --warn: var(--amber);
  --danger: var(--alert); --chip: var(--hull);
  --font-ui: "Rajdhani", system-ui, sans-serif; --font-mono: "Share Tech Mono", ui-monospace, monospace;
  --font-display: "Orbitron", "Rajdhani", sans-serif; --track-ui: .08em;
  --radius: 6px; --radius-lg: 6px; --chip-radius: 4px; --bracket: 10px; --slant: 12px;
  --bevel: inset 1px 1px 0 var(--bevel-hi), inset -1px -1px 0 var(--bevel-lo);
  --glow: 0 0 8px rgb(92 255 157 / .4); --shadow: var(--bevel), 0 10px 30px #000c; --backdrop: rgb(5 8 13 / .8);
  --tap: 44px; --row: 48px; --strip-h: 52px; --card-h: 64px;
  --ease: cubic-bezier(.2,.8,.2,1); --t-fast: 120ms; --t-panel: 200ms;
  --scanlines: repeating-linear-gradient(to bottom, rgb(255 255 255 / .04) 0 1px, transparent 1px 3px);
  --theme-color: #05080D;
  color-scheme: dark;
  /* on-screen script page (console default). body.page-paper overrides to white. */
  --paper: var(--hull); --ink: var(--text);
  --page-caret: var(--phosphor); --page-sel-bg: var(--phosphor); --page-sel-fg: var(--void);
}
body.page-paper {
  --paper: #ffffff; --ink: #111111;
  --page-caret: #111111; --page-sel-bg: #1F7A4C; --page-sel-fg: #ffffff;
}
@media (prefers-reduced-motion: reduce) { :root { --t-fast: 1ms; --t-panel: 1ms; } }

/* ---- housing ---- */
body { font-family: var(--font-ui); font-weight: 600; }
button, .btn, select { box-shadow: var(--bevel); letter-spacing: .03em; transition: box-shadow var(--t-fast) var(--ease), background var(--t-fast) var(--ease); }
button:active, .btn:active { background: var(--hull-2); box-shadow: var(--bevel), var(--glow); }
button.primary { font-weight: 700; text-transform: uppercase; letter-spacing: var(--track-ui); }
header { background: var(--hull); box-shadow: var(--bevel); border-bottom: 1px solid var(--rule); }
header h1, dialog h2 { font: 700 18px/1 var(--font-ui); text-transform: uppercase; letter-spacing: var(--track-ui); color: var(--phosphor);
  background: var(--hull-2); padding: 8px 22px 8px 10px; clip-path: polygon(0 0, 100% 0, calc(100% - var(--slant)) 100%, 0 100%); }
#list header h1 { font-family: var(--font-display); }
header h1 { flex: 1; }
.muted, .rows li .open span, #pv .copy { font-family: var(--font-mono); font-weight: 400; }
#led { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--phosphor); box-shadow: var(--glow); }
#led[data-s=dirty] { background: var(--amber); box-shadow: 0 0 8px rgb(255 181 71 / .4); }
#led[data-s=error] { background: var(--alert); }
#led.pulse { animation: led var(--t-panel) var(--ease); }
@keyframes led { 50% { transform: scale(1.8); } }

/* project list = memory-card screen: bevel cards with chevron cursor on press */
#list { min-height: 100vh; background-image: linear-gradient(rgb(31 122 76 / .08) 1px, transparent 1px), linear-gradient(90deg, rgb(31 122 76 / .08) 1px, transparent 1px); background-size: 24px 24px; }
.rows { padding: 8px; display: grid; gap: 8px; }
.rows li { min-height: var(--card-h); background: var(--hull); border: 0; border-radius: var(--radius); box-shadow: var(--bevel); position: relative; }
.rows li .open b { font-weight: 700; font-size: 18px; }
.rows li:active { box-shadow: var(--bevel), var(--glow); }
.rows li:active::before { content: "▶"; position: absolute; left: -2px; color: var(--phosphor); font-size: 12px; }
.rows li.empty { flex-direction: column; background: none; box-shadow: none; padding: 40px 12px; }
.rows li.empty b { font: 700 28px var(--font-display); color: var(--phosphor); letter-spacing: .12em; }
#new { background: var(--phosphor); color: #000; font-weight: 700; text-transform: uppercase; clip-path: polygon(0 0, 100% 0, calc(100% - 8px) 100%, 0 100%); padding-right: 18px; }

/* codec frame: corner brackets on dialogs and popovers */
.codec, dialog, .pop { --c: var(--phosphor); --b: var(--bracket);
  background: linear-gradient(var(--c),var(--c)) top left/var(--b) 2px, linear-gradient(var(--c),var(--c)) top left/2px var(--b),
    linear-gradient(var(--c),var(--c)) top right/var(--b) 2px, linear-gradient(var(--c),var(--c)) top right/2px var(--b),
    linear-gradient(var(--c),var(--c)) bottom left/var(--b) 2px, linear-gradient(var(--c),var(--c)) bottom left/2px var(--b),
    linear-gradient(var(--c),var(--c)) bottom right/var(--b) 2px, linear-gradient(var(--c),var(--c)) bottom right/2px var(--b), var(--hull);
  background-repeat: no-repeat; box-shadow: var(--shadow); }
dialog::backdrop { backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
dialog[open], .pop:not([hidden]) { animation: tune var(--t-panel) var(--ease); }
@keyframes tune { from { transform: scaleY(.96); opacity: 0; } }
#switcher button { font-family: var(--font-mono); min-height: var(--row); counter-increment: ch; }
#switcher { counter-reset: ch; }
#switcher button::before { content: counter(ch, decimal-leading-zero) "  "; color: var(--phosphor-dim); }
.pop button:active { color: var(--phosphor); }
#lock { accent-color: var(--amber); width: 22px; height: 22px; }

/* element strip: fighter-tile chips, arrows in a darker well, edge fades */
#act { min-height: var(--strip-h); background: var(--hull); box-shadow: var(--bevel); border-top: 1px solid var(--rule); }
#types { scroll-snap-type: x mandatory; -webkit-mask-image: linear-gradient(90deg, transparent, #000 10px, #000 calc(100% - 10px), transparent); mask-image: linear-gradient(90deg, transparent, #000 10px, #000 calc(100% - 10px), transparent); padding: 0 6px; }
.chip, #keys > div { min-width: var(--tap); min-height: var(--tap); display: flex; align-items: center; justify-content: center; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; color: var(--phosphor-dim); box-shadow: var(--bevel); }
.chip.on { color: #000; box-shadow: var(--glow); clip-path: polygon(0 0, 100% 0, calc(100% - 8px) 100%, 0 100%); padding-right: 16px; }
#keys { background: var(--void); padding: 3px; border-radius: var(--radius); box-shadow: inset 1px 1px 0 var(--bevel-lo), inset -1px -1px 0 var(--bevel-hi); }
#keys > div { color: var(--phosphor); min-width: 36px; }

/* scanlines: cheap overlay, housing only (never over the script page), off by setting or reduced transparency */
#list::after { content: ""; position: fixed; inset: 0; pointer-events: none; background: var(--scanlines); z-index: 40; }
header::after, #act::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: var(--scanlines); }
header { position: sticky; }
body.no-fx #list::after, body.no-fx header::after, body.no-fx #act::after { display: none; }
@media (prefers-reduced-transparency: reduce) { #list::after, header::after, #act::after { display: none; } }
@media (prefers-reduced-motion: reduce) { dialog[open], .pop:not([hidden]), #led.pulse { animation: none; } }
