:root {
  --bg: #0a0b0a;
  --panel: #111311;
  --panel2: #141714;
  --panel3: #1a1e1a;
  --line: #1f231f;
  --line2: #2a2f29;
  --text: #dcdfd2;
  --dim: #8d9387;
  --accent: #dfe9bd;
  --accent2: #3f8a6c;
  --deep: #0d2620;
  --rec: #ff3b30;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --display: "Bricolage Grotesque", "Inter Tight", -apple-system, sans-serif;
  --sans: "Inter Tight", -apple-system, "Helvetica Neue", Arial, sans-serif;
  --lbl: 52px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 13px/1.45 var(--sans); -webkit-font-smoothing: antialiased; }
body { overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
.mono { font-family: var(--mono); font-feature-settings: "tnum"; }
.dim { color: var(--dim); }
.hidden { display: none !important; }
::selection { background: var(--accent); color: var(--deep); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Boot ---------- */

/* ---------- Shell ---------- */
#app { height: 100vh; display: grid; grid-template-rows: 48px minmax(0, 1fr) 14px var(--tl-h, 150px); }
#app.tl-off { grid-template-rows: 48px minmax(0, 1fr) 14px 0px; }
#app.tl-off .timeline { display: none; }
.topbar { display: flex; align-items: center; gap: 20px; padding: 0 20px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: .02em; white-space: nowrap; }
.brand .mono { font-size: 11px; font-weight: 400; letter-spacing: 0; }
.menus { display: flex; gap: 2px; margin-left: 4px; }
.menu { padding: 5px 9px; border-radius: 6px; color: #b8bdb0; }
.menu:hover, .menu.open { background: var(--panel3); color: var(--text); }
.dropdown { position: fixed; z-index: 60; min-width: 230px; background: #171a17; border: 1px solid var(--line2); border-radius: 8px; padding: 4px; box-shadow: 0 18px 44px rgba(0,0,0,.55); display: flex; flex-direction: column; }
.dd-item { display: flex; justify-content: space-between; gap: 22px; padding: 6px 10px; border-radius: 5px; text-align: left; font-size: 12.5px; }
.dd-item:hover, .dd-item:focus-visible { background: var(--accent); color: var(--deep); outline: none; }
.dd-item:hover .dim, .dd-item:focus-visible .dim { color: var(--deep); }
.dd-sep { height: 1px; background: var(--line2); margin: 4px 2px; }

/* resume window */
.resume .r-head p { margin: 2px 0 10px; font-size: 11px; }
.resume .btn-row { margin-bottom: 4px; }
.resume .r-sec { font: 500 10.5px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); margin: 18px 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.edl { display: grid; grid-template-columns: 34px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.edl:last-of-type { border-bottom: 0; }
.edl-n { font: 11px var(--mono); color: var(--accent); padding-top: 2px; }
.edl b { font-weight: 600; }
.edl-tc { float: right; font: 10.5px var(--mono); color: var(--dim); padding-left: 10px; }
.edl p, .resume > p { margin: 4px 0 0; font-size: 12.5px; color: #c6cabb; }
.edl ul { margin: 6px 0 0; padding-left: 16px; font-size: 12.5px; color: #c6cabb; }
.edl li { margin-bottom: 4px; }
.win-body table.skills td { text-align: left; font-family: var(--sans); color: #c6cabb; padding: 6px 0; }
.win-body table.skills td:first-child { font: 10.5px var(--mono); color: var(--dim); width: 92px; padding-right: 10px; }

.nav { display: flex; gap: 4px; margin-left: auto; }
.nav button { padding: 7px 13px; border-radius: 7px; color: #a7ad9f; transition: background .15s, color .15s; }
.nav button:hover { color: var(--text); background: var(--panel2); }
.nav button.on { background: var(--panel3); color: var(--text); }
.icon-btn { width: 28px; height: 28px; border-radius: 7px; color: var(--dim); font: 500 12px var(--mono); border: 1px solid var(--line2); }
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }
.topbar .tc { color: var(--accent); font-size: 12px; min-width: 88px; text-align: right; }

.stage { display: flex; gap: 12px; padding: 12px 12px 0; min-height: 0; }

/* ---------- Monitor ---------- */
.monitor { flex: 999 1 640px; min-width: 0; border-radius: 12px; overflow: hidden; position: relative; background: #000; }
.viewer { position: absolute; inset: 0; }
#gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.overlay { position: absolute; inset: 0; pointer-events: none; padding: clamp(24px, 6.5%, 64px) 40% 90px clamp(84px, 7%, 104px); color: #f4f1e6; }
.overlay::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.62) 0%, rgba(0,0,0,.25) 48%, transparent 70%); pointer-events: none; }
.overlay > * { pointer-events: auto; position: relative; }
.card-title { font-weight: 900; font-size: clamp(56px, 8.4vw, 132px); line-height: .84; letter-spacing: -.05em; margin: 0; }
.card-title.sm { font-size: clamp(44px, 5.6vw, 88px); }
.card-sub { margin-top: 20px; max-width: 330px; font-size: clamp(14px, 1.15vw, 16px); line-height: 1.5; text-shadow: 0 1px 8px rgba(0,0,0,.7); }
.card-links { margin-top: 22px; display: flex; gap: 8px; flex-wrap: wrap; }
.pill { font: 500 13px var(--sans); padding: 11px 18px; border-radius: 999px; border: 1px solid rgba(255,255,255,.3); color: #f4f1e6; background: rgba(0,0,0,.25); backdrop-filter: blur(4px); transition: background .15s, color .15s, border-color .15s; }
.pill:hover { border-color: #fff; }
.pill.primary { background: var(--accent); color: var(--deep); border-color: var(--accent); font-weight: 600; }
.pill.primary:hover { filter: brightness(1.08); }
/* product shot: the project's screenshots in a phone body or desktop window, over the scene */

.vslider { position: absolute; left: 28px; top: 50%; transform: translateY(-50%); height: min(48%, 300px); width: 32px; border-radius: 16px; background: rgba(6,8,6,.85); display: flex; flex-direction: column; align-items: center; padding: 12px 0 10px; gap: 8px; cursor: ns-resize; touch-action: none; z-index: 3; }
.vs-track { position: relative; flex: 1; width: 2px; background: rgba(255,255,255,.15); border-radius: 2px; }
.vs-fill { position: absolute; left: 0; right: 0; bottom: 0; background: var(--accent); border-radius: 2px; }
.vs-knob { position: absolute; left: 50%; width: 14px; height: 5px; border-radius: 3px; background: #f4f1e6; transform: translate(-50%, 50%); box-shadow: 0 0 0 3px rgba(0,0,0,.45); }
.vs-val { font-size: 8px; letter-spacing: .04em; color: #c8ccbe; }
.vs-icon { width: 13px; height: 13px; fill: none; stroke: #e6e8dc; stroke-width: 1.3; stroke-linecap: round; flex: none; }
.vslider { width: 36px; }
.vslider:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.transport { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); display: flex; align-items: center; gap: 2px; padding: 5px; border-radius: 12px; background: rgba(8,10,8,.82); border: 1px solid rgba(255,255,255,.08); backdrop-filter: blur(6px); z-index: 4; }
.transport button { width: 34px; height: 32px; border-radius: 8px; display: grid; place-items: center; color: #c9cdbf; }
.transport button:hover { background: rgba(255,255,255,.08); color: #fff; }
.transport svg { width: 14px; height: 14px; fill: currentColor; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.transport [data-act="full"] svg { fill: none; }
.transport .play { background: var(--accent); color: var(--deep); }
.transport .play:hover { background: var(--accent); color: var(--deep); filter: brightness(1.08); }
.transport .sep { width: 1px; height: 18px; background: rgba(255,255,255,.12); margin: 0 4px; }
.fx-toggle { font: italic 600 12px var(--mono); }
.fx-toggle.on { background: rgba(255,255,255,.12) !important; color: var(--accent) !important; }

.fx-pop { position: absolute; right: 16px; bottom: 66px; width: 300px; max-height: calc(100% - 90px); overflow: auto; scrollbar-width: thin; padding: 14px; border-radius: 12px; background: rgba(14,16,14,.94); border: 1px solid var(--line2); backdrop-filter: blur(10px); z-index: 5; box-shadow: 0 24px 60px rgba(0,0,0,.5); }
.fx-title { font-weight: 600; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.fx-badge { font: italic 600 9.5px var(--mono); background: var(--accent); color: var(--deep); padding: 0 4px; border-radius: 2px; }
.fx-row { display: grid; grid-template-columns: 74px 1fr 40px; align-items: center; gap: 8px; padding: 4px 0; color: #b8bdb0; font-size: 12px; }
.fx-row output { font: 10.5px var(--mono); text-align: right; color: var(--accent); }
.fx-row .seg { grid-column: 2 / 4; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 2px; background: var(--line2); border-radius: 2px; outline: none; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); cursor: pointer; }
input[type=range]::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: var(--accent); cursor: pointer; }
.seg { display: flex; flex-wrap: wrap; gap: 3px; }
.seg button { padding: 3px 7px; border-radius: 5px; background: var(--panel3); color: var(--dim); font-size: 11px; }
.seg button.on { color: var(--deep); background: var(--accent); }
.swatches { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.swatch { height: 36px; border-radius: 6px; border: 1px solid var(--line2); position: relative; overflow: hidden; }
.swatch span { position: absolute; left: 4px; bottom: 2px; font: 9px var(--mono); color: #fff; text-shadow: 0 1px 2px #000; }
.swatch.on { outline: 2px solid var(--accent); outline-offset: 1px; }
.ghost { color: var(--dim); font-size: 11px; padding: 8px 0 0; }
.ghost:hover { color: var(--accent); }

.monitor.max { position: fixed; inset: 0; z-index: 50; border-radius: 0; }

/* ---------- Side ---------- */
.side { flex: 0 0 var(--side-w, 300px); width: var(--side-w, 300px); display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow: auto; padding-bottom: 4px; scrollbar-width: thin; }

.info { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 2px; }
.info-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.info-head img { width: 30px; height: 30px; border-radius: 7px; }
.info-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.info-head .dim { font-size: 11.5px; }
.meta { display: grid; grid-template-columns: 78px 1fr; gap: 4px 10px; font-size: 12px; margin: 0 0 10px; }
.meta dt { color: var(--dim); font: 10.5px var(--mono); padding-top: 1px; }
.meta dd { margin: 0; }
.info-body p { margin: 0 0 8px; color: #c6cabb; font-size: 12.5px; }
.info-body ul { margin: 0 0 8px; padding-left: 16px; color: #c6cabb; font-size: 12.5px; }
.info-body li { margin-bottom: 4px; }
.info-body h4 { margin: 12px 0 6px; font: 500 10.5px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 10px; }
.tag { font: 10.5px var(--mono); padding: 2px 6px; border-radius: 4px; background: var(--panel3); color: #b8bdb0; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 7px; background: var(--panel3); border: 1px solid var(--line2); color: var(--text); font-size: 12px; }
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--deep); border-color: var(--accent); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); color: var(--deep); }
.btn-row { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- Timeline ---------- */
.timeline { margin: 0 12px 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); position: relative; overflow: hidden; display: grid; grid-template-rows: 24px 1fr 34px; user-select: none; touch-action: none; cursor: text; }
.tl-ruler-row, .tl-row { display: grid; grid-template-columns: var(--lbl) 1fr; min-width: 0; }
.tl-ruler-row { border-bottom: 1px solid var(--line); }
.tl-row { padding: 6px 12px 3px 0; }
.tl-row.a { padding: 3px 12px 6px 0; }
.tl-lbl { font-size: 11px; color: var(--dim); display: grid; place-items: center; }
.ruler { position: relative; margin-right: 12px; cursor: ew-resize; }
.ruler .tick { position: absolute; top: 5px; font: 10px var(--mono); color: var(--dim); transform: translateX(-50%); }
.ruler .tick:first-child { transform: none; }
.ruler .marker { position: absolute; bottom: 0; width: 8px; height: 8px; background: var(--accent); clip-path: polygon(0 0, 100% 0, 50% 100%); transform: translateX(-4px); opacity: .8; }
.track { position: relative; }
.clip { position: absolute; top: 0; bottom: 0; border-radius: 6px; overflow: hidden; cursor: pointer; background: #000 left center/auto 100% repeat-x; image-rendering: pixelated; transition: filter .15s, opacity .15s; opacity: .62; }
.clip:hover { opacity: .9; }
.clip.sel { opacity: 1; box-shadow: inset 0 0 0 2px var(--accent); }
.clip label { position: absolute; left: 6px; top: 5px; font: 10px var(--mono); color: #f4f1e6; background: rgba(0,0,0,.6); padding: 1px 5px; border-radius: 3px; pointer-events: none; white-space: nowrap; }
.audio { border-radius: 5px; overflow: hidden; }
#wave { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.tl-hit { position: absolute; top: 0; bottom: 0; left: var(--lbl); right: 12px; pointer-events: none; }
.playhead { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--rec); z-index: 5; }
.playhead i { position: absolute; top: 0; left: -6px; width: 13px; height: 13px; background: var(--rec); clip-path: polygon(0 0, 100% 0, 100% 55%, 50% 100%, 0 55%); }

/* ---------- Floating windows ---------- */
.win { position: fixed; z-index: 30; width: min(520px, 92vw); max-height: 92vh; min-width: 300px; min-height: 120px; resize: both; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line2); border-radius: 10px; box-shadow: 0 30px 80px rgba(0,0,0,.6); overflow: hidden; animation: winIn .22s cubic-bezier(.2,.9,.3,1.2); }
.win.focus { border-color: color-mix(in srgb, var(--accent) 45%, var(--line2)); }
@keyframes winIn { from { opacity: 0; transform: scale(.96) translateY(6px); } }
.win-bar { height: 32px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 10px; background: var(--panel2); border-bottom: 1px solid var(--line); cursor: grab; user-select: none; touch-action: none; }
.win-bar:active { cursor: grabbing; }
.lights { display: flex; gap: 6px; }
.lights button { width: 11px; height: 11px; border-radius: 50%; background: #3a3f39; padding: 0; }
.lights .close { background: #ff5f57; }
.lights .min { background: #febc2e; }
.lights .zoom { background: #28c840; }
.win-title { font: 11px var(--mono); color: var(--dim); flex: 1; text-align: center; margin-right: 40px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win-body { overflow: auto; padding: 16px 18px 20px; flex: 1; min-height: 0; }
.win.min .win-body { display: none; }
.win-body h2 { margin: 0 0 4px; font-size: 22px; font-weight: 800; letter-spacing: -.03em; }
.win-body h4 { margin: 14px 0 6px; }
.win-body table { width: 100%; border-collapse: collapse; font-size: 12px; margin: 6px 0 12px; }
.win-body td { padding: 6px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.win-body td:last-child { text-align: right; font-family: var(--mono); color: var(--accent); padding-left: 10px; }
.kbd { font: 10.5px var(--mono); padding: 1px 5px; border: 1px solid var(--line2); border-bottom-width: 2px; border-radius: 4px; background: var(--panel2); }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 7px 14px; align-items: center; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .overlay { padding-right: 30%; }
}
@media (max-width: 860px) {
  .splitter, .tl-resize, #sideBtn { display: none; }
  .win { resize: none; }
  body { overflow: auto; }
  #app { height: auto; display: flex; flex-direction: column; }
  .stage { display: contents; }
  .monitor { order: 1; margin: 10px 10px 0; }
  .timeline { order: 2; }
  .side { order: 3; padding: 0 10px 24px; }
  .topbar { padding: 0 14px; height: 48px; gap: 10px; }
  .menus, #helpBtn { display: none; }
  .brand { font-size: 0; gap: 0; }
  .nav { gap: 0; }
  .nav button { padding: 6px 8px; }
  .topbar .tc { display: none; }
  .monitor { flex: none; aspect-ratio: 4 / 5; }
  .overlay { padding: 28px 22px 90px 70px; }
  .side { max-width: none; overflow: visible; }
  .timeline { margin: 10px; height: 130px; }
  .fx-pop { left: 10px; right: 10px; width: auto; }
  .vslider { left: 16px; }
}

/* contact composer */
.compose { display: flex; flex-direction: column; gap: 12px; }
.compose h2 { margin: 0; }
.compose p { margin: 0; }
.compose .topics { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.compose .topics legend { margin-bottom: 6px; }
.compose .topics label { cursor: pointer; }
.compose .topics input { position: absolute; opacity: 0; pointer-events: none; }
.compose .topics span { display: inline-block; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line2); font-size: 13px; }
.compose .topics input:checked + span { background: var(--accent); color: #0b0c0a; border-color: var(--accent); }
.compose .topics input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.compose .field { display: flex; flex-direction: column; gap: 6px; }
.compose input[name], .compose textarea { font: inherit; color: inherit; background: var(--panel2); border: 1px solid var(--line2); border-radius: 8px; padding: 10px 12px; resize: vertical; }
.compose input[name]:focus, .compose textarea:focus { outline: none; border-color: var(--accent); }

/* project story windows: why, then key decisions */
.story h4 { margin: 18px 0 6px; font: 500 10.5px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.story p { margin: 0; line-height: 1.55; }
.story .decisions { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; line-height: 1.5; }
.story .decisions b { color: var(--text); }
.story .btn-row { margin-top: 14px; }

/* resizable panels */
.stage { gap: 0; }
.monitor { margin-right: 0; }
.splitter { flex: 0 0 12px; cursor: col-resize; position: relative; touch-action: none; }
.splitter::after { content: ""; position: absolute; top: 50%; left: 5px; width: 2px; height: 36px; margin-top: -18px; border-radius: 2px; background: var(--line2); transition: background .15s, height .15s; }
.splitter:hover::after, body.resizing .splitter::after { background: var(--accent); height: 64px; margin-top: -32px; }
#app.side-off .side { display: none; }
#app.side-off .splitter { flex-basis: 12px; }
.tl-resize { position: relative; cursor: row-resize; touch-action: none; }
.tl-resize::after { content: ""; position: absolute; top: 50%; left: 50%; width: 44px; height: 3px; margin: -1.5px 0 0 -22px; border-radius: 2px; background: var(--line2); transition: background .15s, width .15s, margin .15s; }
.tl-resize:hover::after, body.resizing .tl-resize::after { background: var(--accent); width: 80px; margin-left: -40px; }
body.resizing { user-select: none; }
body.resizing canvas { pointer-events: none; }
#sideBtn[aria-pressed="false"] { color: var(--dim); }
.win::-webkit-resizer { background: transparent; }
#tlBtn[aria-pressed="false"] { color: var(--dim); }
/* export */
#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 12px); z-index: 80; background: #171a17; border: 1px solid var(--line2); color: var(--text); font: 12px var(--mono); padding: 8px 14px; border-radius: 8px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }

/* idle monitor: controls fade, cursor hides */
.transport, .vslider { transition: opacity .5s ease, transform .5s ease; }
.viewer.idle .transport, .viewer.idle .vslider { opacity: 0; pointer-events: none; }
.viewer.idle .transport { transform: translate(-50%, 6px); }
.viewer.idle { cursor: none; }

/* fx switch */
.switch { position: relative; width: 30px; height: 17px; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: var(--panel3); border: 1px solid var(--line2); transition: background .15s; pointer-events: none; }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 11px; height: 11px; border-radius: 50%; background: #b8bdb0; transition: transform .15s, background .15s; }
.switch input:checked + i { background: var(--accent); border-color: var(--accent); }
.switch input:checked + i::after { transform: translateX(13px); background: var(--deep); }
.switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }
/* title transition: lines rise in one after another */
@keyframes riseIn { from { opacity: 0; transform: translateY(14px); } }
.overlay .rise { display: inline-block; animation: riseIn .8s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i, 0) * 80ms + 120ms); }
.overlay .card-sub.rise, .overlay .card-links.rise { display: block; }
.overlay .card-links.rise { display: flex; }

/* fx bypass */
.fx-master { border-bottom: 1px solid var(--line2); padding-bottom: 10px; margin-bottom: 10px; grid-template-rows: auto auto; }
.fx-master span:first-child { color: var(--text); font-weight: 600; }
.fx-master small { grid-column: 1 / -1; font-size: 10px; }
.fx-pop.bypassed .fx-row:not(.fx-master), .fx-pop.bypassed .fx-title, .fx-pop.bypassed .swatches { opacity: .4; }
.fx-toggle.bypassed { text-decoration: line-through; color: var(--dim) !important; }

/* About: Work / Off the clock takes */
.overlay .takes { display: inline-flex; gap: 2px; margin-top: 16px; padding: 3px; border-radius: 999px; background: rgba(8,10,8,.6); border: 1px solid rgba(255,255,255,.12); }
.takes button { font: 500 12px var(--sans); padding: 6px 12px; border-radius: 999px; color: #c9cdbf; }
.takes button:hover { color: #fff; }
.takes button[aria-pressed="true"] { background: var(--accent); color: var(--deep); }
.takes button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.overlay .takes + .card-sub { margin-top: 14px; }
.overlay .hobbies { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 6px; max-width: 330px; }
.hobbies li { display: grid; grid-template-columns: 104px 1fr; gap: 10px; font-size: 13px; line-height: 1.4; text-shadow: 0 1px 8px rgba(0,0,0,.7); }
.hobbies b { font-weight: 600; }
.hobbies span { color: #d9dccf; }
.hobbies a { color: var(--accent); }
.hobbies a:hover { text-decoration: underline; }
/* Monitor text fits the monitor: type scales with the monitor's own size, and anything
   that still doesn't fit scrolls inside it instead of being cut off */
.monitor { container-type: size; }
.card-title { font-size: clamp(40px, min(13cqi, 15cqh), 132px); }
.card-title.sm { font-size: clamp(34px, min(9cqi, 11cqh), 88px); }
.card-sub { font-size: clamp(13px, min(1.6cqi, 2.6cqh), 16px); }
.overlay { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.25) transparent; }
/* the scrim is the overlay's own background, so it stays put while the text scrolls */
.overlay::before { display: none; }
.overlay { background: linear-gradient(90deg, rgba(0,0,0,.62) 0%, rgba(0,0,0,.25) 48%, transparent 70%); }
/* thumbnails are frames captured from the monitor */
.clip { background: #000 center/cover no-repeat; image-rendering: auto; }

/* ripple trim handles on timeline clips */
.clip .trim { position: absolute; top: 0; bottom: 0; width: 9px; cursor: ew-resize; z-index: 2; touch-action: none; }
.clip .trim.l { left: 0; } .clip .trim.r { right: 0; }
.clip .trim::after { content: ""; position: absolute; top: 3px; bottom: 3px; width: 3px; border-radius: 2px; background: var(--accent); opacity: 0; transition: opacity .15s; }
.clip .trim.l::after { left: 2px; } .clip .trim.r::after { right: 2px; }
.clip:hover .trim::after { opacity: .55; }
.clip .trim:hover::after, .clip.trimming .trim::after { opacity: 1; }
.clip .dur { position: absolute; right: 12px; bottom: 5px; font-size: 10px; color: #0b0c0a; background: var(--accent); padding: 1px 5px; border-radius: 3px; opacity: 0; transition: opacity .15s; pointer-events: none; }
.clip.trimming { opacity: 1; z-index: 3; }
.clip.trimming .dur { opacity: 1; }
body.trimming, body.trimming * { cursor: ew-resize !important; user-select: none; }
body:not(.trimming) .clip { transition: left .3s ease, width .3s ease, filter .15s, opacity .15s; }

/* audio tracks: commentary (A1) and ambience (A2), each with mute and solo */
.tl-row.vo { padding: 3px 12px 0 0; }
.tl-hd { display: flex !important; align-items: center; justify-content: center; gap: 3px; }
.tl-hd > span { width: 18px; text-align: center; }
.tl-hd button { width: 17px; height: 15px; border-radius: 3px; font: 600 9px var(--mono); color: var(--dim); background: var(--panel3); border: 1px solid var(--line2); display: grid; place-items: center; padding: 0; }
.tl-hd button:hover { color: var(--text); }
.tl-hd button[data-mute][aria-pressed="true"] { background: #d9a03a; border-color: #d9a03a; color: #0b0c0a; }
.tl-hd button[data-solo][aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #0b0c0a; }
.vo-clip { position: absolute; top: 0; bottom: 0; border-radius: 4px; overflow: hidden; background: #2a2440;
  background-image: repeating-linear-gradient(90deg, transparent 0 2px, rgba(198,182,255,.55) 2px 3px); background-size: 100% 46%; background-repeat: repeat-x; background-position: 0 50%;
  border: 1px solid rgba(198,182,255,.35); }
body:not(.trimming) .vo-clip { transition: left .3s ease, width .3s ease; }
.vo-clip label { position: absolute; left: 6px; top: 50%; transform: translateY(-50%); font: 9.5px var(--mono); color: #e8e2ff; background: rgba(20,16,36,.75); padding: 0 5px; border-radius: 3px; pointer-events: none; white-space: nowrap; }
.tl-row.silent .track { opacity: .35; filter: grayscale(.6); transition: opacity .2s, filter .2s; }
.sound-btn svg { width: 15px; height: 15px; fill: currentColor; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.sound-btn[aria-pressed="true"] { color: var(--accent) !important; }

/* master volume: slides out from the speaker on hover or focus */
.sound-wrap { display: inline-flex; align-items: center; }
.transport .vol { width: 0; opacity: 0; margin: 0; accent-color: var(--accent); transition: width .2s ease, opacity .2s ease, margin .2s ease; cursor: pointer; }
.sound-wrap:hover .vol, .sound-wrap:focus-within .vol { width: 72px; opacity: 1; margin: 0 6px 0 2px; }
@media (hover: none) { .transport .vol { display: none; } }

/* plain-HTML copy: off screen, but read by screen readers and search engines.
   It appears if someone follows the skip link or if JavaScript is off. */
.text-version { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.text-version:focus, .text-version:target { position: fixed; inset: 0; z-index: 200; width: auto; height: auto; overflow: auto; clip: auto; clip-path: none; white-space: normal;
  background: var(--bg, #0b0c0a); color: var(--text); padding: 40px max(24px, calc(50vw - 360px)); font-size: 16px; line-height: 1.6; outline: none; }
.text-version h1 { font-size: 44px; margin: 0 0 8px; } .text-version h2 { margin: 36px 0 8px; } .text-version h4 { margin: 16px 0 4px; color: var(--dim); }
.text-version a { color: var(--accent); }
.skip-link { position: fixed; left: 12px; top: -60px; z-index: 300; background: var(--accent); color: #0b0c0a; padding: 8px 12px; border-radius: 6px; font-weight: 600; transition: top .15s; }
.skip-link:focus { top: 10px; }
noscript ~ * .tv-back, .tv-back { margin: 0 0 24px; font-size: 14px; }

/* ---------- phones ---------- */
@media (max-width: 860px) {
  .side { width: auto; flex: none; }                      /* cards span the screen, not the desktop sidebar width */
  #tlBtn { display: none; }                                /* the timeline can't be resized or hidden on a phone */
  .tl-lbl { font-size: 10px; }
  .clip label { font-size: 9px; left: 4px; top: 4px; }
  .clip .trim { width: 14px; }                             /* easier to grab with a finger */
  .info .meta dt:nth-last-of-type(-n+2), .info .meta dd:nth-last-of-type(-n+2) { display: none; }   /* Source / Grade: editor detail */
  .info [data-fx] { display: none; }
  .win { left: 4vw !important; width: 92vw !important; max-height: 82vh; }
  .transport { bottom: 12px; }
  .vslider { height: min(40%, 220px); }
}

/* display face: the big titles only; body text and the editor UI stay in Inter Tight */
.card-title { font-family: var(--display); font-weight: 800; letter-spacing: -.04em; line-height: .86; }
.win-body h2, .text-version h1 { font-family: var(--display); font-weight: 800; letter-spacing: -.03em; }

/* sidebar is just the info panel now */
.info { border-top: 0; padding-top: 2px; margin-top: 0; }

/* first-visit nudge on the play button */
@keyframes nudge { 0% { box-shadow: 0 0 0 0 rgba(223,233,189,.55); } 70% { box-shadow: 0 0 0 12px rgba(223,233,189,0); } 100% { box-shadow: 0 0 0 0 rgba(223,233,189,0); } }
.transport .play.nudge { animation: nudge 2.2s ease-out 3; }

/* screenshots in story windows: a supporting image, not a poster */
.story img.shot { width: auto; max-width: 100%; max-height: 200px; margin: 16px auto 0; object-fit: contain; }
.story p + p { margin-top: 10px; }

/* Experience: highlights set like a credit roll */
.overlay .card-sub:has(.credits) { max-width: 420px; }
.credits { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.credits li { display: grid; gap: 1px; }
.credits b { font: 600 10.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.credits span { font-size: clamp(12.5px, min(1.45cqi, 2.3cqh), 15px); line-height: 1.4; }

/* sound credits in Shortcuts & info */
.credits-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 12.5px; }
.credits-list li { display: flex; justify-content: space-between; gap: 12px; }
.credits-list span { color: var(--dim); font-family: var(--mono); font-size: 10.5px; white-space: nowrap; }
.credits-kicker { margin: 0 0 10px; font-size: clamp(13px, min(1.6cqi, 2.6cqh), 16px); }
.credits b { text-transform: none; letter-spacing: .02em; font: 600 13px var(--sans); color: var(--accent); }

/* ======================================================================
   Phone layout: stacked like a mobile video editor.
   Monitor on top (title only), control row, a strip of clips under a fixed
   playhead, the clip's text on a solid panel, and a tab bar for the sections.
   ====================================================================== */
.ph-only { display: none !important; }
@media (max-width: 860px) {
  body.phone { overflow-x: hidden; overflow-y: auto; }
  body.phone #app { height: auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
  .phone .ph-only { display: flex !important; }
  .phone .timeline, .phone .side, .phone .transport { display: none !important; }

  /* top bar: brand, Export, more */
  .phone .topbar { order: 0; flex: none; height: 46px; padding: 0 12px 0 16px; padding-top: env(safe-area-inset-top); box-sizing: content-box; border-bottom: 0; gap: 4px; }
  .phone .brand { font-size: 14px; }
  .phone .menus { display: flex; margin-left: auto; gap: 6px; }
  .phone .menus .menu { display: none; }
  .phone .menus .menu[data-menu="export"] { display: block; border: 1px solid var(--line2); padding: 5px 11px; font-weight: 600; font-size: 12.5px; }
  .phone .menus .menu.more { display: block !important; font-size: 18px; line-height: 1; padding: 4px 8px; letter-spacing: .05em; }
  .phone .nav, .phone #tlBtn, .phone #helpBtn, .phone .topbar .tc { display: none; }
  .phone .dropdown { min-width: 0; max-width: calc(100vw - 16px); }
  .phone .dd-item { padding: 10px 12px; font-size: 14px; }

  /* monitor: the scene and the title, nothing else */
  .phone .monitor { order: 1; flex: none; margin: 0; border-radius: 0; aspect-ratio: 16 / 10; max-height: 42vh; width: 100%; }
  .phone .overlay { padding: 14px 16px; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden;
    background: linear-gradient(to top, rgba(0,0,0,.55), transparent 60%); }
  .phone .overlay > :not(.card-title) { display: none; }
  .phone .card-title { font-size: clamp(36px, 15cqh, 64px); }
  .phone .monitor.max { position: fixed; inset: 0; z-index: 50; max-height: none; aspect-ratio: auto; height: 100%; }
  .phone .card-title.sm { font-size: clamp(30px, 12cqh, 52px); }

  /* control row */
  .pbar { order: 2; flex: none; height: 50px; align-items: center; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--line); }
  .ptc { font-size: 10.5px; color: var(--dim); flex: 1 1 0; white-space: nowrap; }
  .pright { flex: 1 1 0; display: flex; justify-content: flex-end; align-items: center; gap: 4px; }
  .pbar .psound { width: 34px; height: 34px; }
  .pbar .psound[aria-pressed="true"] { color: var(--accent); }
  .pbar .psound svg { width: 17px; height: 17px; }
  .pmid { flex: none; display: flex; align-items: center; gap: 10px; }
  .pbar button { display: grid; place-items: center; color: #cfd3c6; width: 36px; height: 36px; border-radius: 50%; }
  .pbar svg { width: 15px; height: 15px; fill: currentColor; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
  .pbar .pplay { width: 40px; height: 40px; background: var(--accent); color: var(--deep); }
  .pbar .pplay.nudge { animation: nudge 2.2s ease-out 3; }

  /* phone timeline: clips from the left at their real lengths, one ambience track, moving playhead */
  .pstrip { order: 3; flex: none; padding: 10px 14px 12px; border-bottom: 1px solid var(--line); }
  .strip { position: relative; width: 100%; height: 82px; touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: pointer; }
  .sc { position: absolute; top: 0; height: 54px; border-radius: 6px; background: #000 center/cover no-repeat; overflow: hidden; opacity: .55; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); transition: opacity .2s, box-shadow .2s; }
  .sc.on { opacity: 1; box-shadow: inset 0 0 0 2px var(--accent); }
  .sc span { position: absolute; left: 4px; top: 4px; max-width: calc(100% - 8px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 8.5px var(--mono); background: rgba(0,0,0,.65); color: #f4f1e6; padding: 1px 4px; border-radius: 3px; }
  .sa { position: absolute; left: 0; right: 3px; top: 60px; height: 20px; border-radius: 4px; background: repeating-linear-gradient(90deg, #2b5a4b 0 2px, #16302a 2px 5px); transition: opacity .25s, filter .25s; }
  .sa span { position: absolute; left: 6px; top: 50%; transform: translateY(-50%); font: 9px var(--mono); color: #a9d6c2; background: rgba(10,24,20,.8); padding: 0 5px; border-radius: 3px; }
  .strip.silent .sa { opacity: .4; filter: grayscale(.6); }
  .sph { position: absolute; top: -6px; bottom: -2px; width: 2px; margin-left: -1px; background: var(--rec); pointer-events: none; z-index: 2; }
  .sph::before { content: ""; position: absolute; top: 0; left: -5px; width: 12px; height: 11px; background: var(--rec); clip-path: polygon(0 0, 100% 0, 100% 55%, 50% 100%, 0 55%); }

  /* night ↔ day: the monitor's slider, on the right edge */
  .phone .vslider { display: flex !important; left: auto; right: 12px; top: 12px; transform: none; height: calc(100% - 24px); max-height: 180px; width: 32px; padding: 9px 0 8px; gap: 6px; }
  .phone .vslider .vs-val { display: none; }

  /* text panel */
  .pbody { order: 4; flex: 1 0 auto; flex-direction: column; padding: 18px 18px calc(96px + env(safe-area-inset-bottom)); }
  .pcard { color: var(--text); }
  .pcard .rise { display: block; animation: riseIn .7s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i, 0) * 70ms + 60ms); }
  .pcard .card-links.rise, .pcard .takes.rise { display: flex; }
  .pcard .takes.rise { display: inline-flex; }
  .pkick { display: flex !important; align-items: center; gap: 8px; font: 500 10.5px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--dim); margin-bottom: 10px; }
  .pkick img { width: 20px; height: 20px; border-radius: 5px; }
  .pcard .card-sub { margin: 0; max-width: none; font-size: 15.5px; line-height: 1.55; color: #d3d7c8; text-shadow: none; }
  .pcard .card-links { margin-top: 16px; gap: 8px; flex-wrap: wrap; }
  .pcard .pill { padding: 11px 16px; font-size: 14px; backdrop-filter: none; background: var(--panel3); border-color: var(--line2); }
  .pcard .pill.primary { background: var(--accent); border-color: var(--accent); color: var(--deep); }
  .pcard .takes { gap: 2px; margin: 0 0 14px; padding: 3px; border-radius: 10px; background: var(--panel3); }
  .pcard .takes button { padding: 8px 14px; border-radius: 8px; font-size: 13px; font-weight: 600; }
  .pcard .hobbies { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; }
  .pcard .hobbies li { font-size: 14px; text-shadow: none; grid-template-columns: 110px 1fr; }
  .pcard .credits-kicker { font-size: 15.5px; margin-bottom: 12px; }
  .pcard .credits { gap: 12px; }
  .pcard .credits span { font-size: 14.5px; line-height: 1.5; color: #d3d7c8; }
  .pcard .credits b { font-size: 14px; }

  .pdet { margin-top: 18px; border-top: 1px solid var(--line); }
  .pdet summary { list-style: none; display: flex; justify-content: space-between; align-items: center; padding: 14px 0; font-size: 14px; color: #c6cabb; cursor: pointer; }
  .pdet summary::-webkit-details-marker { display: none; }
  .pdet summary .dim { font-size: 11px; }
  .pdet[open] summary .dim { visibility: hidden; }
  .pdet .info-head { display: none; }
  .pdet .meta { grid-template-columns: 96px 1fr; font-size: 13px; gap: 7px 12px; }
  .pdet .meta dt { font-size: 11px; }
  .pdet .info .meta dt:nth-last-of-type(-n+2), .pdet .info .meta dd:nth-last-of-type(-n+2) { display: none; }
  .pdet .info-body p, .pdet .info-body ul { font-size: 14px; line-height: 1.5; }
  .pdet .btn-row:empty { display: none; }
  .pdet .btn { padding: 10px 14px; font-size: 13.5px; }

  /* tab bar */
  .ptabs { order: 5; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; border-top: 1px solid var(--line); background: var(--panel); padding: 6px 4px max(8px, env(safe-area-inset-bottom)); }
  .ptabs button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 0; font-size: 11px; font-weight: 500; color: var(--dim); min-height: 48px; justify-content: center; }
  .ptabs svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  .ptabs button.on { color: var(--accent); }

  /* windows become bottom sheets */
  .phone #windows:has(.win) { position: fixed; inset: 0; z-index: 29; background: rgba(0,0,0,.5); animation: fadeIn .2s ease; }
  .phone .win { left: 0 !important; right: 0; top: auto !important; bottom: 0; width: 100% !important; min-width: 0; max-height: 84vh; max-height: 84dvh;
    border-radius: 18px 18px 0 0; border-width: 1px 0 0; animation: sheetIn .28s cubic-bezier(.2,.8,.2,1); }
  .phone .win.min .win-body { display: block; }
  .phone .win-bar { height: 44px; position: relative; flex-direction: row-reverse; padding: 0 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
  .phone .win-bar::before { content: ""; position: absolute; left: 50%; top: 6px; width: 38px; height: 4px; margin-left: -19px; border-radius: 3px; background: #4a5046; }
  .phone .win-title { text-align: left; margin: 0; font-size: 11px; }
  .phone .lights .min, .phone .lights .zoom { display: none; }
  .phone .lights .close { width: auto; height: auto; background: none; border-radius: 6px; color: var(--accent); font: 600 14px var(--sans); padding: 6px 2px; }
  .phone .lights .close::after { content: "Done"; }
  .phone .win-body { padding: 16px 18px max(24px, env(safe-area-inset-bottom)); font-size: 14.5px; line-height: 1.55; }
  .phone .story img.shot { max-height: 160px; }
}
@keyframes sheetIn { from { transform: translateY(100%); } }
@keyframes fadeIn { from { opacity: 0; } }

/* effects: the panel's sheet header only shows on phones */
.fx-sheet-head { display: none; }
@media (max-width: 860px) {
  .pbar .pfx { width: 34px; height: 34px; font: italic 600 13px var(--mono); color: #cfd3c6; }
  .pbar .pfx.on { background: var(--panel3); color: var(--accent); }
  .phone .fx-pop { position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: auto; max-height: 52vh; max-height: 52dvh; z-index: 40;
    border-radius: 18px 18px 0 0; border-width: 1px 0 0; padding: 0 18px max(20px, env(safe-area-inset-bottom)); background: rgba(14,16,14,.97);
    animation: sheetIn .28s cubic-bezier(.2,.8,.2,1); overscroll-behavior: contain; }
  .phone .fx-sheet-head { display: flex; position: sticky; top: 0; z-index: 1; justify-content: space-between; align-items: center; padding: 14px 0 10px; margin-bottom: 4px; background: rgba(14,16,14,.97); }
  .phone .fx-sheet-head b { font-size: 15px; }
  .phone .fx-sheet-head button { color: var(--accent); font-weight: 600; font-size: 14px; }
  .phone .fx-master small { display: none; }
  .phone .fx-row { grid-template-columns: 84px 1fr 44px; padding: 7px 0; font-size: 13.5px; }
  .phone .fx-row output { font-size: 11.5px; }
  .phone .fx-pop input[type=range] { height: 3px; }
  .phone .fx-pop input[type=range]::-webkit-slider-thumb { width: 22px; height: 22px; }
  .phone .fx-pop input[type=range]::-moz-range-thumb { width: 22px; height: 22px; }
  .phone .fx-pop .seg button { padding: 7px 10px; font-size: 12.5px; }
  .phone .fx-pop .switch { transform: scale(1.25); transform-origin: left center; }
  .phone .swatch { height: 44px; }
  .phone .fx-pop .ghost { padding: 14px 0 4px; font-size: 13px; }
}

/* phone: full-screen button on the monitor; it and the slider fade when idle, a tap brings them back */
.fs-btn { display: none; }
@media (max-width: 860px) {
  .phone .fs-btn { display: grid; place-items: center; position: absolute; right: 10px; bottom: 10px; z-index: 4; width: 36px; height: 36px; border-radius: 10px;
    background: rgba(6,8,6,.75); color: #e6e8dc; transition: opacity .5s ease; }
  .fs-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
  .fs-btn .fs-out, .monitor.max .fs-btn .fs-in { display: none; }
  .monitor.max .fs-btn .fs-out { display: block; }
  .viewer.idle .fs-btn { opacity: 0; pointer-events: none; }
  .phone .vslider { max-height: 150px; height: calc(100% - 70px); }
  html.fs, html.fs body { overflow: hidden; }
  /* full screen: landscape. If the phone is still upright, the monitor is turned sideways. */
  .phone .monitor.max .card-title { font-size: clamp(40px, 16cqh, 96px); }
  .phone .monitor.max .vslider { max-height: 200px; top: 50%; transform: translateY(-50%); height: 60%; right: 16px; }
  .phone .monitor.max .fs-btn { right: 16px; bottom: 16px; }
}
@media (max-width: 860px) and (orientation: portrait) {
  .phone .monitor.max { inset: auto; top: 0; left: 0; width: 100vh; width: 100dvh; height: 100vw; transform-origin: top left; transform: translateX(100vw) rotate(90deg); }
}
