@font-face {
	font-family: "JetBrains Mono";
	src: url("/wp-content/themes/anduro/assets/fonts/jetbrains-mono-latin.woff2") format("woff2");
	font-weight: 100 800;
	font-display: swap;
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Track names in Romanian (ă, ș, ț) and other languages need the second half of the theme's font. */
@font-face {
	font-family: "JetBrains Mono";
	src: url("/wp-content/themes/anduro/assets/fonts/jetbrains-mono-latin-ext.woff2") format("woff2");
	font-weight: 100 800;
	font-display: swap;
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
	--base: #05070a;
	--surface: #0d1218;
	--text: #c9d6df;
	--dim: #8a99a5;
	--cyan: #35e4ff;
	--yellow: #fbc916;
	--rule: 1px solid #1f2a35;
	--mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	grid-template-rows: auto minmax(220px, 1fr) auto auto auto;
	grid-template-areas: "bar bar bar" "meter stage list" "meter scroller list" "meter strip list" "status status status";
	background: var(--base);
	color: var(--text);
	font: 13px/1.5 var(--mono);
}

.bar { grid-area: bar; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: var(--rule); }
h1 { margin: 0 8px 0 0; font-size: 14px; font-weight: 600; color: var(--cyan); }
h1 a { color: inherit; text-decoration: none; }
h1 a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1 a:focus-visible { outline: 1px solid var(--cyan); outline-offset: 2px; }
.grow { flex: 1; }
.clock { min-width: 5ch; font-size: 15px; font-variant-numeric: tabular-nums; }
.clock--left { min-width: 6ch; margin-left: -4px; color: var(--dim); }

button, .btn, select {
	padding: 5px 12px;
	border: var(--rule);
	border-radius: 2px;
	background: var(--surface);
	color: var(--text);
	font: inherit;
	cursor: pointer;
}
button:hover:not(:disabled), .btn:hover { border-color: var(--cyan); color: var(--cyan); }
button:focus-visible, .btn:focus-within, select:focus-visible { outline: 1px solid var(--cyan); outline-offset: 1px; }
button:disabled { opacity: 0.4; cursor: default; }
#play { min-width: 7ch; border-color: var(--cyan); color: var(--cyan); }
.opt { display: inline-flex; align-items: center; gap: 8px; color: var(--dim); }

.zoom { display: inline-flex; gap: 4px; }
.zoom button { padding: 5px 9px; min-width: 2.2em; }
#scroller { grid-area: scroller; display: block; width: 100%; height: 14px; margin: 0; accent-color: var(--cyan); }
/* Always there, so that zooming in or out never changes the height of the timeline. */
#scroller:disabled { opacity: 0.25; }
#stage { grid-area: stage; position: relative; min-height: 0; }
#stage.is-over { outline: 1px dashed var(--cyan); outline-offset: -8px; }
canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: text; touch-action: none; }
.empty[hidden] { display: none; }
.empty { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: var(--dim); pointer-events: none; }

/* The playlist: a panel on the right that can be put away, so the lanes get the whole width. */
.playlist { grid-area: list; display: flex; flex-direction: column; width: 22rem; min-height: 0; border-left: var(--rule); background: var(--base); }
.playlist[hidden] { display: none; }
.playlist__head, .panel__head { display: flex; align-items: center; gap: 1ch; padding: 6px 8px 6px 16px; border-bottom: var(--rule); color: var(--dim); }
.playlist__title, .panel__title { color: var(--cyan); font-weight: 600; }
.playlist__count, .panel__count { flex: 1; }
#listClose, #meterClose { padding: 1px 9px; }

/* The level meter: a panel on the left, the same way. */
.meter { grid-area: meter; display: flex; flex-direction: column; width: 9rem; min-height: 0; border-right: var(--rule); background: var(--base); }
.meter[hidden] { display: none; }
.meter .panel__head { padding-left: 12px; }
#levels { position: static; flex: 1; min-height: 120px; width: 100%; height: auto; }
.meter__max { display: grid; grid-template-columns: 1fr 1fr; gap: 0 6px; margin: 0; padding: 6px 10px 8px; border: 0; border-top: var(--rule); border-radius: 0; background: none; text-align: center; font-variant-numeric: tabular-nums; }
.meter__label { grid-column: span 2; color: var(--dim); font-size: 11px; }
.meter__val { color: var(--text); }
.meter__val.is-over { color: #ff4f5e; }
.meter__max:hover:not(:disabled) { border-color: #1f2a35; }
.tracks { flex: 1; min-height: 0; margin: 0; padding: 4px 0; overflow: auto; list-style: none; color: var(--dim); counter-reset: track; }
.tracks:empty { display: none; }
.playlist__empty { margin: 0; padding: 12px 16px; color: var(--dim); }
.tracks:not(:empty) + .playlist__empty { display: none; }
.tracks li { counter-increment: track; }
.tracks button {
	display: grid;
	grid-template-columns: 3ch minmax(0, 1fr);
	width: 100%;
	padding: 5px 16px 5px 8px;
	border: 0;
	border-left: 3px solid transparent;
	border-radius: 0;
	background: none;
	color: inherit;
	text-align: left;
}
.tracks button::before { content: counter(track); grid-row: span 2; color: var(--dim); font-variant-numeric: tabular-nums; }
/* Hover is a shade, not the cyan edge: that one says which track is selected. */
.tracks button:hover:not(:disabled) { color: inherit; border-color: transparent; border-left-color: #465a6b; background: var(--surface); }
.tracks button:focus-visible { outline-offset: -1px; }
.tracks .name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--text); }
.tracks .info { font-size: 12px; }
.tracks li.is-on button, .tracks li.is-on button:hover:not(:disabled) { border-left-color: var(--cyan); background: var(--surface); }

.status { grid-area: status; display: flex; justify-content: space-between; gap: 2ch; padding: 6px 16px; border-top: var(--rule); color: var(--dim); font-size: 12px; }

.group { display: inline-flex; gap: 4px; }
.opt input { width: 8ch; padding: 4px 6px; border: var(--rule); border-radius: 2px; background: var(--surface); color: var(--text); font: inherit; }
canvas { cursor: default; }
canvas:focus-visible { outline: 1px solid var(--cyan); outline-offset: -1px; }
.tracks .unsure, .tracks .far { color: var(--yellow); }
button.is-on { border-color: var(--cyan); color: var(--base); background: var(--cyan); }

.strip { grid-area: strip; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; padding: 8px 16px; border-top: var(--rule); background: var(--surface); }
.strip__name { flex: 1 1 auto; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--cyan); }
.strip__group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.strip button { padding: 3px 9px; }
.fader { display: inline-flex; align-items: center; gap: 6px; color: var(--dim); }
.fader input { width: 84px; accent-color: var(--cyan); }
.fader output { min-width: 4ch; color: var(--text); font-variant-numeric: tabular-nums; }

.tracks button:hover .name, .tracks li.is-on .name { color: var(--cyan); }

dialog { max-width: 34rem; padding: 18px 22px; border: var(--rule); background: var(--surface); color: var(--text); font: inherit; }
dialog::backdrop { background: rgba(5, 7, 10, 0.7); }
dialog h2 { margin: 0 0 8px; font-size: 13px; color: var(--cyan); }
dialog dl { display: grid; grid-template-columns: max-content 1fr; gap: 3px 16px; margin: 0 0 16px; }
dialog dt { color: var(--text); }
dialog dd { margin: 0; color: var(--dim); }

.fader--short input { width: 64px; }
#cueTempo, #bpm { width: 10ch; }

/* The strip is always there, so the timeline keeps its height. What the faders set is said up front. */
.strip { border-left: 3px solid transparent; }
.strip__head { flex: 1 1 100%; display: flex; align-items: center; gap: 10px; min-width: 0; }
.badge { flex: none; padding: 1px 8px; border: 1px solid var(--cyan); border-radius: 2px; color: var(--base); background: var(--cyan); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.strip__name .sub { color: var(--dim); }
#cueBack { visibility: hidden; }
.strip__cues { padding-left: 12px; border-left: var(--rule); }
.strip__cues #cuePrev, .strip__cues #cueNext { padding: 3px 8px; }
#cueCurve { min-width: 13ch; }
.strip.is-none .badge { border-color: #1f2a35; background: transparent; color: var(--dim); }
.strip.is-none .strip__name { color: var(--dim); }
.strip.is-cue { border-left-color: var(--yellow); background: #15140c; }
.strip.is-cue .badge { border-color: var(--yellow); background: var(--yellow); }
.strip.is-cue .strip__name { color: var(--yellow); }
.strip.is-cue #cueBack { visibility: visible; }
/* Each fader in the colour of its line and handles on the track. Key has no line: it is grey. */
.strip .fader { --c: var(--dim); }
.strip .fader:has(#vol) { --c: #ffffff; }
.strip .fader:has(#low) { --c: #ff4fa3; }
.strip .fader:has(#mid) { --c: #35e4ff; }
.strip .fader:has(#high) { --c: #e8f6fb; }
.strip .fader:has(#filter) { --c: #fbc916; }
.strip .fader:has(#pan) { --c: #7dff9a; }
.strip .fader input { accent-color: var(--c); }
.strip .fader > span, .strip .fader output { color: var(--c); }
.strip .fader > span { opacity: 0.85; }
.strip.is-cue .strip__cues { border-left-color: var(--yellow); }
.fader input:disabled { opacity: 0.4; }
dialog dt.k-low { color: #ff4fa3; }
dialog dt.k-mid { color: var(--cyan); }
dialog dt.k-high { color: #e8f6fb; }
dialog dt.k-filter { color: var(--yellow); }
#panOut { min-width: 5ch; }
dialog dt.k-pan { color: #7dff9a; }

/* On a narrow screen the playlist lies over the lanes instead of taking their width. */
@media (max-width: 760px) {
	.meter { position: fixed; top: 0; left: 0; bottom: 0; z-index: 5; background: var(--surface); box-shadow: 8px 0 24px rgba(0, 0, 0, 0.5); }
	.playlist { position: fixed; top: 0; right: 0; bottom: 0; z-index: 5; width: min(22rem, 88vw); background: var(--surface); box-shadow: -8px 0 24px rgba(0, 0, 0, 0.5); }
}
