:root {
  color-scheme: light;
  --canvas: #f9f8f4;
  --paper: #fffefa;
  --ink: #211a2b;
  --muted: #655d6d;
  --line: #ded8e2;
  --purple: #5b3a74;
  --lime: #e0fa82;
  --lime-hover: #ecffa6;
  --focus: #774f9c;
  --radius: 1.35rem;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100svh; display: flex; flex-direction: column; background: var(--canvas); color: var(--ink); }
button, input, select { font: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
button:disabled { cursor: not-allowed; opacity: .55; }
video { display: block; }
.shell { width: min(calc(100% - 3.5rem), 73rem); margin-inline: auto; }
.skip-link { position: fixed; inset: .75rem auto auto .75rem; z-index: 10; padding: .7rem 1rem; background: var(--paper); color: var(--ink); transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }

.site-header { border-bottom: 1px solid #e9e4e8; }
.site-header__inner { min-height: 4.6rem; display: flex; align-items: center; justify-content: space-between; }
.site-header__actions { display: flex; flex-wrap: wrap; justify-content: end; align-items: center; gap: .6rem; }
.brand { display: inline-flex; align-items: center; gap: .65rem; color: var(--ink); text-decoration: none; font-size: 1.25rem; font-weight: 900; letter-spacing: -.075em; }
.brand-studio { margin-left: .15rem; font-weight: 500; letter-spacing: -.045em; }
.brand-mark { width: 2rem; height: 2rem; display: inline-flex; align-items: center; justify-content: center; gap: 3px; border-radius: 8px; background: var(--ink); }
.brand-mark i { width: 3px; height: 10px; border-radius: 4px; background: var(--lime); }
.brand-mark i:nth-child(2) { height: 17px; }
.brand-mark i:nth-child(3) { height: 13px; }
.beta, .ratio-chip, .aspect-label { display: inline-flex; align-items: center; padding: .36rem .63rem; border-radius: .45rem; font-size: .875rem; font-weight: 650; line-height: 1; }
.beta { border: 1px solid #dcd2e2; color: #503366; background: #f5eef8; }

main { flex: 1; }
.hero { display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(0, .82fr); gap: clamp(2rem, 5vw, 5.2rem); align-items: stretch; padding-block: clamp(2.7rem, 6vw, 5.5rem) clamp(2rem, 5vw, 3.4rem); }
.hero h1 { margin: 0; font-size: clamp(2.6rem, 5.65vw, 5.2rem); font-weight: 850; line-height: .98; letter-spacing: -.083em; }
.hero h1 em { color: var(--purple); font-style: normal; }
.hero__copy > p:not(.status) { max-width: 35rem; margin: 1.23rem 0 1.55rem; color: var(--muted); font-size: clamp(1.04rem, 1.75vw, 1.15rem); line-height: 1.6; }
.hero-break { display: none; }

.drop-zone { min-height: 13.4rem; padding: 1.3rem; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .62rem; border: 1px dashed #aaa0b1; border-radius: var(--radius); background: var(--paper); transition: background .2s ease, border-color .2s ease; text-align: center; }
.drop-zone.is-dragging, .drop-zone.dragging, .drop-zone[data-dragging="true"] { border-color: var(--purple); background: #f4edfb; }
.drop-zone p { margin: .05rem 0 .18rem; color: var(--ink); font-weight: 670; line-height: 1.4; }
.drop-or { font-weight: 470; color: var(--muted); }
.upload-icon { display: inline-grid; width: 2.8rem; height: 2.8rem; place-items: center; border: 1px solid #e8dff0; border-radius: .75rem; background: #f4edf9; color: var(--purple); }
.file-note { color: var(--muted); font-size: .875rem; }
.button { display: inline-flex; min-height: 2.9rem; align-items: center; justify-content: center; gap: .45rem; border: 1px solid transparent; border-radius: .64rem; padding: .6rem 1rem; color: var(--ink); text-decoration: none; font-size: 1rem; font-weight: 750; line-height: 1.2; cursor: pointer; transition: background .16s ease, border-color .16s ease, box-shadow .16s ease; }
.button-primary { border-color: #c6df62; background: var(--lime); }
.button-primary:not(:disabled):hover { border-color: #9bb43b; background: var(--lime-hover); box-shadow: 0 3px 12px #c6d9954d; }
.button-secondary { border-color: var(--line); background: var(--paper); }
.button-secondary:not(:disabled):hover { border-color: #aba0b2; background: #f8f3fc; }
.button-small { min-height: 2.54rem; padding: .5rem .75rem; font-size: .9rem; }
.status:empty, .export-format:empty { display: none; }
.status { margin: .82rem 0 0; color: var(--muted); font-size: .94rem; line-height: 1.5; }
.status[data-error="true"], .status.error { color: #8d2342; }

.youtube-source { margin-top: .8rem; padding: .75rem .85rem; border: 1px solid var(--line); border-radius: .7rem; background: var(--paper); }
.youtube-source summary { width: fit-content; min-height: 1.6rem; color: var(--purple); font-size: .95rem; font-weight: 720; cursor: pointer; }
.youtube-form { display: grid; gap: .32rem; margin-top: .65rem; }
.youtube-form label { color: #463c50; font-size: .89rem; font-weight: 650; }
.youtube-form .status { margin-top: .24rem; }
.youtube-field { display: flex; flex-wrap: wrap; align-items: stretch; gap: .45rem; }
.youtube-field input { flex: 1 1 12rem; min-width: 0; min-height: 2.75rem; padding: .45rem .6rem; border: 1px solid var(--line); border-radius: .55rem; background: #fbf8fc; color: var(--ink); font-size: 1rem; }
.youtube-field input[aria-invalid="true"] { border-color: #8d2342; }
.youtube-reference { display: grid; gap: .55rem; margin-top: .65rem; padding-top: .65rem; border-top: 1px solid var(--line); }
.youtube-form .secondary { margin: 0 0 .3rem; font-size: .88rem; }
.youtube-form progress { width: 100%; height: .45rem; accent-color: var(--purple); }
.youtube-reference .button { justify-self: start; }

.demo-panel { min-height: 25rem; display: flex; flex-direction: column; border: 1px solid #39284c; border-radius: var(--radius); overflow: hidden; background: #2b2037; color: #fff9ff; box-shadow: 0 18px 52px -26px #2b203773; }
.studio-illustration { position: relative; isolation: isolate; flex: 1; min-height: 19rem; overflow: hidden; background: radial-gradient(ellipse at 61% 64%, #6f4b8f 0%, #3d2b52 40%, #2c2039 80%); }
.visual-grid { position: absolute; inset: 0; z-index: -1; background-image: linear-gradient(90deg, #fff2 1px, transparent 1px), linear-gradient(#fff2 1px, transparent 1px); background-size: 2.4rem 2.4rem; mask-image: radial-gradient(ellipse at center, #000 19%, transparent 76%); }
.film-strip { position: absolute; left: 51%; top: 48%; display: flex; gap: .2rem; width: 118%; height: 41%; padding: .6rem .52rem; transform: translate(-50%, -50%) rotate(-10deg); border-block: 1px solid #9f7db887; background: #24192fb3; box-shadow: 0 5px 20px #21192e5c; }
.film-frame { flex: 1; border-radius: .34rem; border: 1px solid #bea0d459; opacity: .75; }
.film-frame--one { background: radial-gradient(ellipse at 50% 85%, #b08dc9 1%, #6a4b82 32%, #30213e 61%); }
.film-frame--two { background: linear-gradient(124deg, #8b5ca8, #342143 56%, #78549c); }
.film-frame--three { background: repeating-linear-gradient(158deg, #6e4d8d 0%, #6e4d8d 19%, #53396c 20%, #53396c 36%); }
.clip-frame { position: absolute; top: 50%; left: 50%; height: 77%; width: auto; aspect-ratio: 9/16; transform: translate(-50%, -50%) rotate(9deg); border: 2px solid #e6fba3; border-radius: 1rem; background: linear-gradient(156deg, #251933 8%, #583776 75%, #ab7bc9); box-shadow: 0 13px 36px #160d246b, inset 0 0 0 5px #2c2039a0; overflow: hidden; }
.clip-orbit { position: absolute; left: 50%; top: 54%; width: 136%; height: 52%; transform: translate(-50%, -50%) rotate(-31deg); border: 1px solid #b892d7aa; border-radius: 50%; }
.clip-orbit::before, .clip-orbit::after { content: ""; position: absolute; inset: 14% -6%; border: 1px solid #c4a5d580; border-radius: 50%; }
.clip-orbit::after { inset: 28% -11%; }
.clip-shape { position: absolute; left: 50%; top: 54%; height: 43%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 53% 47% 49% 51% / 34% 63% 37% 66%; background: radial-gradient(circle at 31% 24%, #f3ffb9, #cde879 48%, #8aa447 80%); box-shadow: 0 0 18px #dfff9a62; }
.clip-play { position: absolute; left: 50%; top: 53%; width: 0; height: 0; border-top: 11px solid transparent; border-bottom: 11px solid transparent; border-left: 17px solid #241831; transform: translate(-39%, -50%); }
.clip-corner { position: absolute; width: .77rem; height: .77rem; border: 1px solid #ede4f6a8; }
.clip-corner--tl { top: .75rem; left: .75rem; border-width: 1px 0 0 1px; }
.clip-corner--tr { top: .75rem; right: .75rem; border-width: 1px 1px 0 0; }
.clip-corner--bl { bottom: .75rem; left: .75rem; border-width: 0 0 1px 1px; }
.clip-corner--br { bottom: .75rem; right: .75rem; border-width: 0 1px 1px 0; }
.aspect-label { position: absolute; right: .85rem; bottom: .85rem; border: 1px solid #c8b1d951; background: #30233bdc; color: #eee1fa; font-variant-numeric: tabular-nums; }
.demo-panel__footer { display: flex; align-items: center; justify-content: space-between; gap: .6rem 1rem; padding: .82rem; border-top: 1px solid #b28cd646; }
.demo-panel__footer > span { color: #e6d7ef; font-size: .9rem; }
.demo-button { min-height: 2.5rem; padding: .48rem .74rem; border-color: #c5a8dc73; color: #fffaff; background: #4f3b63; font-size: .9rem; white-space: nowrap; }
.demo-button:not(:disabled):hover { border-color: #d0b4e5; background: #684e81; }
.demo-button:focus-visible { outline-color: var(--lime); }

.workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.workspace:has(> :not([hidden])) { padding-bottom: 3.4rem; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1rem, 2.75vw, 1.7rem); background: var(--paper); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: .7rem; margin-bottom: 1rem; }
.panel h2 { margin: 0 0 .3rem; font-size: clamp(1.25rem, 2.65vw, 1.65rem); font-weight: 800; letter-spacing: -.055em; }
.panel h3 { margin: 0 0 .6rem; font-size: 1rem; font-weight: 750; letter-spacing: -.015em; }
.panel .source-name { margin: 0 0 .25rem; font-size: 1rem; font-weight: 630; overflow-wrap: anywhere; }
.secondary { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.5; }
.source-video { width: 100%; max-height: 24rem; min-height: 8rem; aspect-ratio: 16/9; border-radius: .77rem; background: #211a2b; }
.suggestion-area { margin-top: 1.15rem; }
.suggestions { display: flex; flex-wrap: wrap; gap: .5rem; }
.suggestions:empty { display: none; }
.suggestions button { min-width: 5rem; padding: .6rem .72rem; border: 1px solid #e1d7e7; border-radius: .55rem; background: #f9f4fb; color: #482e5c; text-align: left; font-size: .9rem; font-weight: 650; cursor: pointer; }
.suggestions button:hover { border-color: #b89bcc; }
.suggestions button[aria-pressed="true"], .suggestions button.is-active, .suggestions button.active { border-color: #8962a4; background: #eadcf4; }
.ratio-chip { border: 1px solid #e4d6ed; background: #f5edf9; color: #5a3b70; }
.fields { display: grid; grid-template-columns: .68fr .68fr 1.45fr; gap: .55rem; }
.fields label { display: flex; min-width: 0; flex-direction: column; gap: .34rem; color: #463c50; font-size: .9rem; font-weight: 650; }
.fields input, .fields select, .subtitle-language select { width: 100%; height: 2.8rem; padding: .52rem .55rem; border: 1px solid var(--line); border-radius: .55rem; background-color: #fbf8fc; color: var(--ink); font-size: .98rem; }
.fields select, .subtitle-language select { appearance: none; padding-right: 1.65rem; background-image: linear-gradient(45deg, transparent 50%, #644a77 50%), linear-gradient(135deg, #644a77 50%, transparent 50%); background-position: calc(100% - .9rem) center, calc(100% - .6rem) center; background-size: .3rem .3rem; background-repeat: no-repeat; }
.subtitle-block { margin-top: 1rem; padding: .85rem; border: 1px solid #e8dfef; border-radius: .7rem; background: #faf6fc; }
.subtitle-block h3 { margin-bottom: .23rem; }
.subtitle-language { display: flex; flex-wrap: wrap; align-items: center; gap: .38rem .65rem; margin-top: .67rem; color: #463c50; font-size: .9rem; font-weight: 650; }
.subtitle-language select { width: auto; max-width: 100%; height: 2.3rem; padding-block: .28rem; background-color: var(--paper); font-size: .9rem; font-weight: 500; }
.subtitle-actions { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .68rem; }
.subtitle-import { position: relative; }
.subtitle-import:focus-within { outline: 3px solid var(--focus); outline-offset: 4px; }
.subtitle-import input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.subtitle-review { margin-top: .65rem; color: #52376a; font-size: .9rem; }
.subtitle-review summary { cursor: pointer; font-weight: 680; }
.subtitle-review textarea { display: block; width: 100%; margin-top: .6rem; padding: .6rem; resize: vertical; border: 1px solid var(--line); border-radius: .45rem; background: var(--paper); color: var(--ink); font: inherit; line-height: 1.5; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-top: 1rem; }
.export-format { margin-inline-start: auto; color: var(--muted); font-size: .875rem; }
.panel progress { display: block; width: 100%; height: .55rem; margin-top: .75rem; accent-color: #72508f; }
.result { display: flex; flex-direction: column; align-items: flex-start; gap: .85rem; }
.result:has(> :not([hidden])) { margin-top: 1rem; }
.result video { width: min(100%, 17rem); max-height: min(65vh, 28rem); aspect-ratio: 9/16; border-radius: .75rem; background: #211a2b; }

.site-footer { margin-top: auto; border-top: 1px solid #e9e4e8; }
.site-footer__inner { display: flex; min-height: 4.1rem; align-items: center; justify-content: space-between; gap: .6rem 1.4rem; color: var(--muted); font-size: .875rem; }
.footer-brand { color: var(--ink); font-weight: 730; }
.privacy-note { display: inline-flex; align-items: center; gap: .38rem; line-height: 1.4; }
.privacy-note svg { flex: none; color: var(--purple); }

@media (max-width: 53rem) {
  .hero { gap: 1.5rem; }
  .demo-panel__footer { flex-wrap: wrap; }
  .fields { grid-template-columns: 1fr 1fr; }
  .framing-field { grid-column: 1 / -1; }
}

@media (max-width: 42rem) {
  .shell { width: min(calc(100% - 2rem), 73rem); }
  .site-header__inner { min-height: 3.9rem; }
  .hero { grid-template-columns: 1fr; padding-block: 2.1rem 1.7rem; }
  .hero h1 { max-width: 36rem; }
  .hero__copy > p:not(.status) { margin-block: .9rem 1.16rem; }
  .demo-panel { min-height: 15.5rem; }
  .studio-illustration { min-height: 12.1rem; }
  .demo-panel__footer { flex-wrap: nowrap; }
  .workspace { grid-template-columns: 1fr; }
  .workspace:has(> :not([hidden])) { padding-bottom: 2.4rem; }
  .fields { grid-template-columns: .8fr .8fr 1.45fr; }
  .framing-field { grid-column: auto; }
}

@media (max-width: 25rem) {
  .demo-panel__footer { flex-wrap: wrap; }
  .fields { grid-template-columns: 1fr 1fr; }
  .framing-field { grid-column: 1 / -1; }
  .site-footer__inner { padding-block: .8rem; flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

.suggestions button { display: grid; flex: 1 1 12rem; grid-template-columns: 1fr auto; gap: .3rem .7rem; }
.suggestions button span { white-space: nowrap; font-variant-numeric: tabular-nums; }
.suggestions button small { grid-column: 1 / -1; font-size: .82rem; font-weight: 480; line-height: 1.4; }
.clip-settings { min-width: 0; margin: 0 0 1.2rem; padding: 0; border: 0; }
.clip-settings legend { padding: 0; margin-bottom: .55rem; font-weight: 750; }
.duration-options { display: flex; flex-wrap: wrap; gap: .4rem; }
.duration-options label { position: relative; cursor: pointer; }
.duration-options input { position: absolute; opacity: 0; }
.duration-options span { display: inline-flex; align-items: center; min-height: 2.65rem; padding: .4rem .72rem; border: 1px solid var(--line); border-radius: .65rem; background: var(--paper); font-weight: 650; font-size: .93rem; }
.duration-options input:checked + span { color: white; background: var(--purple); border-color: var(--purple); }
.duration-options input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.clip-settings[disabled] { opacity: .65; }
.cut-options { margin-top: .65rem; }
.cut-options summary { width: fit-content; color: var(--purple); font-size: .92rem; font-weight: 650; cursor: pointer; }
.natural-end { display: flex; align-items: center; gap: .4rem; margin: .7rem 0; }
.natural-end input, #framing-position { accent-color: var(--purple); }
.skip-fields { display: flex; flex-wrap: wrap; gap: .65rem 1rem; }
.skip-fields label { display: grid; gap: .35rem; font-size: .88rem; }
.skip-fields input { width: 6rem; height: 2.5rem; padding: .4rem; border: 1px solid var(--line); border-radius: .45rem; background: var(--paper); color: var(--ink); }
.framing-preview { display: flex; align-items: center; gap: 1rem; margin: 1rem 0; }
.framing-preview canvas { display: block; width: clamp(4.5rem, 20vw, 7.5rem); height: auto; aspect-ratio: 9 / 16; background: #17131b; border-radius: .6rem; }
.framing-preview figcaption { flex: 1; min-width: 0; }
#position-field { max-width: 16rem; margin-top: .7rem; font-size: .88rem; }
#framing-position { display: block; width: 100%; margin: .3rem 0; }
.position-labels { display: flex; justify-content: space-between; color: var(--muted); }
