@font-face {
  font-family: Geist;
  src: url('./fonts/Geist.ttf') format('truetype');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  font-family: Geist, system-ui, sans-serif;
  color: #20242b;
  background: #f0f1f3;
  color-scheme: light;
  --ink: #20242b;
  --muted: #555e6b;
  --line: #d5d8de;
  --panel: #fafafa;
  --accent: #2855d9;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
p, h1, h2, dl, dd { margin: 0; }
button, input, select, summary, a { font: inherit; }
button:not(:disabled), select:not(:disabled), input[type="color"]:not(:disabled), summary { cursor: pointer; }
button { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.shell { width: min(1120px, calc(100% - 64px)); margin-inline: auto; }
main.shell { padding-bottom: 36px; }

.topbar {
  min-height: 73px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}
.wordmark { display: flex; align-items: center; gap: 10px; font-size: 1.125rem; font-weight: 720; letter-spacing: -.045em; }
.brand-mark { position: relative; width: 28px; height: 28px; border-radius: 7px; background: #242933; }
.brand-mark::before, .brand-mark::after { position: absolute; content: ''; width: 8px; height: 8px; border: 1.5px solid #adc3ff; }
.brand-mark::before { top: 6px; left: 6px; border-right: 0; border-bottom: 0; }
.brand-mark::after { bottom: 6px; right: 6px; border-left: 0; border-top: 0; }
.privacy { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .81rem; }
.privacy-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

.intro { padding: clamp(40px, 6vw, 81px) 0 clamp(28px, 4vw, 45px); }
h1 { font-size: clamp(2.4rem, 6vw, 4.875rem); font-weight: 675; line-height: 1.04; letter-spacing: -.061em; }
h1 span { color: var(--muted); white-space: nowrap; }
.intro p { margin-top: 15px; font-size: clamp(.94rem, 2vw, 1.11rem); color: var(--muted); line-height: 1.5; }

.workspace { display: grid; grid-template-columns: minmax(0, 1.73fr) minmax(310px, 1fr); gap: 18px; align-items: start; }
.panel {
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: clamp(16px, 2.3vw, 25px);
  box-shadow: 0 2px 3px #20242b05, 0 10px 25px #20242b07;
}
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 31px; margin-bottom: 15px; }
h2 { font-size: 1.04rem; font-weight: 680; letter-spacing: -.025em; }
.subtle { border: 0; background: none; min-height: 34px; padding: 3px 0; font-size: .8rem; color: var(--muted); }
.subtle:hover { color: #20242b; text-decoration: underline; text-underline-offset: 3px; }
.format { color: var(--muted); font: .68rem var(--mono); letter-spacing: .03em; white-space: nowrap; }

.stage {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  width: 100%;
  min-width: 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 11px;
  background: #232833;
  color: #f9fafc;
}
.stage:has(.drop-prompt:not([hidden])) {
  background:
    radial-gradient(ellipse at 50% 52%, #303747 0%, transparent 78%),
    #232833;
}
.stage:has(.drop-prompt:not([hidden]))::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(circle, #a5b1c936 1px, transparent 1px);
  background-size: 18px 18px;
  mask-image: radial-gradient(ellipse at center, transparent 15%, #000 85%);
}
.stage::after { content: ''; position: absolute; inset: 12px; border: 1px dashed #acb8cf6b; border-radius: 7px; pointer-events: none; }
.stage:has(.stage-media:not([hidden]))::after { display: none; }
.stage.drag::after { display: block; border: 2px solid #adc3ff; }
.drop-prompt { text-align: center; padding: 20px; }
.frame-mark { display: grid; place-items: center; width: 62px; height: 62px; margin: 0 auto 18px; border: 1px solid #738099; border-radius: 16px; background: #262c39; color: #c3d2ff; }
.frame-mark span { position: relative; width: 28px; height: 22px; border: 1px solid currentColor; border-radius: 4px; }
.frame-mark span::before, .frame-mark span::after { content: ''; position: absolute; top: 3px; bottom: 3px; width: 3px; background: repeating-linear-gradient(to bottom, currentColor 0 2px, transparent 2px 5px); }
.frame-mark span::before { left: 3px; }
.frame-mark span::after { right: 3px; }
.drop-title { font-size: clamp(1rem, 2.6vw, 1.4rem); font-weight: 650; letter-spacing: -.031em; }
.drop-formats { margin-top: 6px; color: #c1c9d8; font: .75rem var(--mono); }

.stage-media { position: absolute; inset: 0; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; }
.stage-media img, .stage-media video { display: block; width: 100%; min-width: 0; height: 100%; object-fit: contain; }
.stage-media video { background: #111; }
.source-actions, .pickers, .tabs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.source-actions { justify-content: space-between; margin-top: 15px; }
.secondary, .tabs button {
  min-height: 41px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #868f9d;
  border-radius: 8px;
  background: transparent;
  padding: 0 12px;
  font-size: .84rem;
  font-weight: 590;
}
.secondary:hover:not(:disabled), .tabs button:hover { background: #e9edf4; }
.icon { position: relative; flex: none; display: inline-block; width: 14px; height: 12px; border: 1.4px solid currentColor; border-radius: 2px; }
.icon-files { width: 10px; height: 12px; margin-right: 2px; box-shadow: 3px -2px 0 -1px var(--panel), 4px -3px 0 -1px currentColor; }
.icon-folder::before { content: ''; position: absolute; top: -4px; left: -1px; width: 6px; height: 3px; border: 1.4px solid currentColor; border-bottom: 0; border-radius: 2px 2px 0 0; }
.tabs { gap: 3px; padding: 3px; background: #eceef2; border-radius: 8px; }
.tabs button { min-height: 33px; border: 0; font-size: .76rem; padding: 0 9px; }
.tabs button[aria-pressed="true"] { background: var(--panel); box-shadow: 0 1px 3px #20242b22; }

.field { min-width: 0; display: grid; gap: 7px; }
.field label, .scrubber-label label { font-size: .84rem; font-weight: 640; }
.field input:not([type="color"]), .field select, .unit-field {
  width: 100%;
  min-width: 0;
  min-height: 43px;
  border: 1px solid #868f9d;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}
.field input:not([type="color"]), .field select { padding: 0 11px; font-size: .9rem; }
.field input::placeholder { color: #626b79; opacity: 1; }
.unit-field { display: flex; align-items: center; }
.unit-field input:not([type="color"]) { flex: 1; width: 0; min-height: 41px; border: 0; }
.unit-field:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.unit-field input:focus-visible { outline: 0; }
.unit-field span { padding-inline: 8px 12px; color: var(--muted); font: .73rem var(--mono); }
.sequence-choice, .frame-controls { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 14px; }
.scrubber-label { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.scrubber-label output, .frame-name { color: var(--muted); font: .75rem/1.4 var(--mono); overflow-wrap: anywhere; }
#frame-slider { margin: 5px 0; width: 100%; height: 30px; accent-color: var(--accent); }
.warning, .status { margin-top: 12px; padding: 10px 11px; border-radius: 7px; font-size: .83rem; line-height: 1.5; overflow-wrap: anywhere; }
.warning { color: #684a15; background: #fbefd6; }
.gap-choice { width: min(100%, 235px); margin-top: 8px; }

.export-fields, .advanced-fields { display: grid; gap: 15px; }
.presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.presets button { min-height: 33px; border: 1px solid var(--line); border-radius: 6px; background: transparent; font: .73rem var(--mono); }
.presets button:hover:not(:disabled) { background: #edf0f6; }
.presets button[aria-pressed="true"] { background: #e7eeff; color: #2145b1; border-color: #99b0ed; font-weight: 650; }
.advanced { border-top: 1px solid var(--line); }
.advanced summary { display: flex; justify-content: space-between; align-items: center; min-height: 48px; font-size: .84rem; font-weight: 610; list-style: none; }
.advanced summary::-webkit-details-marker { display: none; }
.advanced summary::after { content: ''; margin-right: 3px; width: 7px; height: 7px; border-right: 1px solid; border-bottom: 1px solid; transform: rotate(45deg) translateY(-2px); }
.advanced[open] summary::after { transform: rotate(225deg) translate(-2px,-2px); }
.advanced-fields { padding-bottom: 14px; }
.field-hint { margin: 0; color: var(--muted); font-size: .73rem; line-height: 1.42; }
.color-field { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.color-field .field-hint { margin-top: 4px; }
.color-field input { width: 46px; height: 36px; padding: 3px; border-radius: 7px; border: 1px solid #aeb6c4; background: #fff; flex: none; }
.export-footer {
  position: sticky;
  z-index: 1;
  top: 0;
  bottom: 0;
  margin-top: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  background: var(--panel);
}
.export-panel :is(input, select, summary) { scroll-margin: 145px 0; }
.stats { display: grid; grid-template-columns: .77fr 1.35fr .88fr; column-gap: 8px; margin-bottom: 15px; }
.stats div + div { padding-left: 10px; border-left: 1px solid var(--line); }
.stats dt { font-size: .68rem; color: var(--muted); }
.stats dd { margin-top: 5px; font: 600 .73rem/1.4 var(--mono); overflow-wrap: anywhere; }
.primary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 47px;
  gap: 12px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  padding: 9px 14px;
  text-align: left;
  font-size: .88rem;
  font-weight: 670;
  text-decoration: none;
}
.primary span { font-size: 1.15rem; line-height: 1; }
.primary:hover:not(:disabled) { background: #2148bd; }
.primary:disabled { background: #e7eaf0; border-color: var(--line); color: #596474; }
.cancel { width: 100%; margin-top: 8px; }
progress { display: block; width: 100%; height: 8px; margin-top: 12px; accent-color: var(--accent); }
.status { color: #234296; background: #eaf0ff; }
.status[data-error="true"] { color: #892918; background: #f9e9e1; }
.status + #download { margin-top: 10px; }
.status[hidden] + #download { margin-top: 0; }

@media (max-width: 760px) {
  .shell { width: calc(100% - 32px); }
  .topbar { min-height: 60px; }
  .workspace { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .intro { padding-top: 38px; }
  .stage:has(.drop-prompt:not([hidden])) { min-height: 190px; }
}
@media (max-width: 370px) {
  .privacy { font-size: .69rem; }
  .secondary { padding-inline: 7px; gap: 6px; font-size: .81rem; }
}

.wordmark { color: var(--ink); text-decoration: none; }
.brand-mark, .privacy-dot { flex: none; }
.tool-nav { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.tool-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--muted);
  font-size: .86rem;
  font-weight: 610;
  text-decoration: none;
}
.tool-nav a:hover { background: #e9edf4; color: var(--ink); }
.tool-nav a[aria-current="page"] { background: #e7eeff; color: #2145b1; border-color: #b0bff0; }
.tool-nav + .intro { padding-block: clamp(26px, 3.1vw, 42px) 32px; }
.range-fields, .tool-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tool-footer { position: static; padding-bottom: 0; }
.playhead-button { justify-self: start; color: #2145b1; }
.range-error { margin-top: 4px; color: #892918; }
.source-name { min-width: 0; }
.primary .action-label { font: inherit; }
@media (max-width: 420px) {
  .tool-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
  .tool-nav a { justify-content: center; padding-inline: 3px; text-align: center; font-size: .74rem; }
  h1 span { white-space: normal; }
}

.visually-hidden { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
.stage-media > canvas { display: block; width: 100%; height: 100%; object-fit: contain; }
.timeline-controls { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.step-controls { display: flex; align-items: center; gap: 6px; }
.step-controls .secondary { width: 40px; padding-inline: 0; font-size: 1rem; }
.jump-frame { width: 82px; min-height: 41px; padding-inline: 8px; border: 1px solid #868f9d; border-radius: 8px; color: var(--ink); background: #fff; }
.filmstrip { display: grid; grid-template-columns: repeat(var(--sample-count, 5), minmax(0, 1fr)); gap: 6px; margin-top: 12px; }
.filmstrip:empty { display: none; }
.filmstrip > button {
  min-width: 0;
  padding: 3px;
  background: #eceef2;
  border: 1px solid var(--line);
  border-radius: 7px;
  display: grid;
  gap: 4px;
  color: var(--muted);
  font: .7rem var(--mono);
}
.filmstrip > button:hover:not(:disabled), .filmstrip > button.in-range { background: #e7eeff; color: #2145b1; }
.filmstrip > button[aria-pressed="true"] { border-color: var(--accent); color: #2145b1; box-shadow: inset 0 0 0 1px var(--accent); }
.filmstrip canvas { display: block; width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 4px; background: #232833; }
.naming-options { margin-top: 0; }
.batch-naming { margin-top: 16px; }
.shot-editors { display: grid; gap: 12px; padding: 12px; border-radius: 8px; background: #eef2f9; }
.name-preview { display: grid; gap: 4px; padding: 11px 12px; border: 1px solid #d7e1f7; border-radius: 8px; background: #eef3fd; }
.name-preview-label { font-size: .75rem; font-weight: 660; color: #2145b1; }
.name-preview code, .file-mapping { font: .76rem/1.45 var(--mono); overflow-wrap: anywhere; }
.name-preview code { color: var(--ink); }
.file-mapping { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: start; gap: 8px; color: var(--muted); }
.file-mapping code { color: #2145b1; font: inherit; }
.media-tool .intro { padding-block: clamp(24px, 2.6vw, 36px) 28px; }
.media-tool h1 { font-size: clamp(2.25rem, 5.6vw, 4.35rem); }
.media-tool .stage:has(.stage-media:not([hidden])) { max-height: 305px; }
.media-tool #frame-browser { border-top: 0; margin-top: 10px; padding-top: 0; }
.batch-preview {
  background: conic-gradient(#252b38 25%, #303748 0 50%, #252b38 0 75%, #303748 0) 0 0 / 20px 20px;
}
.warning[data-error="true"] { color: #892918; background: #f9e9e1; }
@media (min-width: 761px) and (min-height: 680px) {
  .media-tool .source-panel { position: sticky; top: 16px; }
}

/* Site navigation and single-file converter */
.topbar { display: grid; grid-template-columns: 1fr auto 1fr; }
.topbar .privacy { justify-self: end; }
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding-inline: 11px;
  border-radius: 7px;
  color: var(--muted);
  font-size: .85rem;
  font-weight: 610;
  text-decoration: none;
}
.site-nav a:hover { background: #e9edf4; color: var(--ink); }
.site-nav a[aria-current] { color: #2145b1; background: #e7eeff; }
.render-page .intro { padding-block: clamp(26px, 4vw, 50px) 22px; }
.render-nav { margin: 0 0 17px; }
.render-nav a { background: var(--panel); border-color: var(--line); }
.single-intro { padding-block: clamp(34px, 6vw, 79px) 29px; text-align: center; }
.single-intro h1 { font-size: clamp(2.7rem, 7vw, 5.2rem); }
.single-converter { width: min(100%, 660px); margin-inline: auto; padding: clamp(15px, 3vw, 28px); }
.single-formats { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 11px; align-items: end; }
.format-arrow { color: var(--muted); font-size: 1.1rem; align-self: end; display: grid; place-items: center; min-height: 43px; }
.single-formats select { min-height: 43px; text-overflow: ellipsis; }
.single-drop { margin-top: 16px; position: relative; overflow: hidden; border-radius: 11px; background: #232833; color: #f9fafc; }
.single-pick, .chosen-file {
  width: 100%;
  min-height: 144px;
  padding: 18px;
  border: 1px solid transparent;
  background: radial-gradient(ellipse at 50% 60%, #323b51, #232833 75%);
  color: inherit;
  border-radius: 11px;
}
.single-pick { display: grid; justify-items: center; align-content: center; gap: 12px; }
.single-pick::after, .single-drop.drag::after {
  content: ''; position: absolute; inset: 8px; border: 1px dashed #8fa1c077; border-radius: 7px; pointer-events: none;
}
.single-pick:hover { background: radial-gradient(ellipse at 50% 60%, #3b4864, #262e40 75%); }
.single-pick:focus-visible { outline-offset: -5px; outline-color: #adc3ff; }
.single-drop.drag::after { border: 2px solid #adc3ff; }
.single-file-icon { display: inline-block; flex: none; width: 23px; height: 29px; border: 1px solid #a7baf0; border-radius: 4px; position: relative; }
.single-file-icon::after { content: ''; position: absolute; left: 5px; right: 5px; bottom: 7px; height: 4px; border-block: 1px solid #a7baf0; }
.single-pick strong { display: block; font-size: 1.07rem; letter-spacing: -.025em; }
.single-pick-hint { display: block; margin-top: 4px; color: #c5cee0; font-size: .81rem; }
.chosen-file { display: flex; align-items: center; gap: 12px; min-height: 91px; }
.chosen-file-text { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.chosen-file-text strong { display: block; }
.chosen-file-text span { display: block; margin-top: 4px; color: #c5cee0; font: .73rem var(--mono); }
.chosen-file .subtle { color: #dce6ff; flex: none; padding-inline: 5px; }
.chosen-file :focus-visible { outline-color: #adc3ff; }
.conversion-hint { margin-top: 11px; }
.single-actions { margin-top: 16px; }
.single-actions .primary { min-height: 48px; }
.single-footer {
  width: min(100%, 660px);
  margin: 14px auto 0;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  column-gap: 16px;
  row-gap: 6px;
  color: var(--muted);
  font-size: .78rem;
}
.single-footer a { color: inherit; text-decoration: none; }
.single-footer a span { color: #2145b1; font-weight: 630; }
.single-footer a:hover span { text-decoration: underline; }
@media (max-width: 700px) {
  .topbar { grid-template-columns: minmax(0, 1fr) auto; column-gap: 10px; row-gap: 0; padding-block: 12px 7px; }
  .topbar .privacy { grid-area: 1 / 2; }
  .site-nav { grid-column: 1 / -1; margin-top: 6px; }
  .site-nav a { padding-inline: 8px; font-size: .8rem; }
  .single-intro { padding-block: 32px 23px; }
}
@media (max-width: 420px) {
  .single-formats { gap: 6px; }
  .single-formats select { padding-inline: 6px; font-size: .8rem; }
  .render-nav { grid-template-columns: 1.13fr 1fr 1fr; }
}
