:root {
  color-scheme: dark;
  --page: #0c1017;
  --surface: #111822;
  --surface-raised: #171f2b;
  --edge: #2a3748;
  --text: #eff5ff;
  --muted: #aab8ca;
  --accent: #80b8ff;
  --bright: #abd8ff;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  color: var(--text);
  background: var(--page);
  scroll-behavior: smooth;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
h1, h2, h3, p, pre { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
img, video, canvas { display: block; max-width: 100%; }
[hidden] { display: none !important; }

::selection { color: var(--page); background: var(--accent); }
:focus-visible { outline: 2px solid var(--bright); outline-offset: 4px; }
section[id] { scroll-margin-top: 1.5rem; }

.container {
  width: min(100% - clamp(2rem, 7vw, 4rem), 67rem);
  margin-inline: auto;
}

.symbols { position: absolute; pointer-events: none; }
.icon {
  display: block;
  flex: none;
  width: 1.125rem;
  height: 1.125rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.skip-link {
  position: absolute;
  z-index: 2;
  inset: .75rem auto auto .75rem;
  transform: translateY(-200%);
  padding: .6rem 1rem;
  border-radius: .5rem;
  color: var(--page);
  background: var(--bright);
}
.skip-link:focus { transform: none; }

.site-header {
  border-bottom: 1px solid #253244;
  background: #0e141d;
}
.nav, .footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.nav { min-height: 4rem; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  color: var(--text);
  font-size: 1.125rem;
  font-weight: 720;
  letter-spacing: -.035em;
}
.brand img { border: 1px solid #30465b; border-radius: 50%; }
.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(.75rem, 2.5vw, 1.65rem);
  color: var(--muted);
  font-size: .875rem;
  font-weight: 600;
}
.nav-links a:hover, .footer a:hover { color: var(--bright); }
.nav-github {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .45rem .75rem;
  border: 1px solid var(--edge);
  border-radius: .5rem;
  color: var(--text);
}
.nav-github .icon { width: .95rem; height: .95rem; }

.hero {
  position: relative;
  isolation: isolate;
  padding-top: clamp(3rem, 5.7vw, 5.375rem);
}
.hero::before {
  content: "";
  position: absolute;
  z-index: -2;
  inset: 0 0 12%;
  background:
    radial-gradient(ellipse at 50% 4%, #1b3450 0%, transparent 57%),
    radial-gradient(ellipse at 78% 0%, #162d3f 0%, transparent 46%);
}
.hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 0 18%;
  background-image:
    linear-gradient(#b4d6ff0f 1px, transparent 1px),
    linear-gradient(90deg, #b4d6ff0f 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: center top;
  mask-image: radial-gradient(ellipse 75% 65% at 50% 0%, black, transparent 91%);
  pointer-events: none;
}
.hero-copy { text-align: center; }
.eyebrow {
  margin-bottom: .95rem;
  color: #a2c4e8;
  font: 600 .8125rem/1.5 var(--mono);
  letter-spacing: .11em;
  text-transform: uppercase;
}
h1 {
  font-size: clamp(2.35rem, 7.1vw, 4.85rem);
  font-weight: 750;
  line-height: 1.015;
  letter-spacing: -.062em;
  text-wrap: balance;
}
h1 span {
  color: #9dc6ff;
  background: linear-gradient(100deg, #9eb9ff 4%, #8bc4ff 55%, #83e4e7 96%);
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-summary {
  max-width: 34rem;
  margin: 1.3rem auto 0;
  color: #becce0;
  font-size: clamp(1.0625rem, 2.2vw, 1.2rem);
  line-height: 1.55;
  text-wrap: balance;
}
.hero-actions {
  display: flex;
  justify-content: center;
  gap: .65rem;
  margin-top: 1.65rem;
}
.button {
  display: inline-flex;
  min-height: 2.85rem;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  padding: .65rem 1rem;
  border: 1px solid transparent;
  border-radius: .55rem;
  font-size: .9375rem;
  font-weight: 680;
  text-align: center;
  transition: background-color .15s, border-color .15s;
}
.primary {
  border-color: #abccff;
  background: var(--accent);
  color: #081728;
  box-shadow: 0 5px 22px #5a9fff2e;
}
.primary:hover { background: var(--bright); }
.secondary { border-color: #3b4e66; background: #182435; }
.secondary:hover { border-color: #7594b6; background: #203349; }

.demo {
  max-width: 63rem;
  margin: clamp(2.25rem, 5vw, 3.25rem) auto 0;
  border: 1px solid #38516e;
  border-radius: .9rem;
  background: #101722;
  box-shadow: 0 0 0 5px #789edc0b, 0 26px 65px -27px #2a79bf63, 0 10px 28px #06090e80;
}
.demo-header {
  display: flex;
  min-height: 3.6rem;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .6rem clamp(.65rem, 2vw, 1rem);
  border-bottom: 1px solid #2b3a4c;
  border-radius: .85rem .85rem 0 0;
  background: var(--surface-raised);
}
.demo-title {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-size: .875rem;
  font-weight: 650;
}
.demo-title img { border: 1px solid #3a5066; border-radius: 50%; }
.mode-switch {
  display: grid;
  grid-auto-flow: column;
  gap: .2rem;
  padding: .2rem;
  border: 1px solid #2b394d;
  border-radius: .55rem;
  background: #101721;
}
.mode-switch button, .tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  border: 1px solid transparent;
  border-radius: .35rem;
  background: transparent;
  color: var(--muted);
  font-size: .875rem;
  font-weight: 600;
}
.mode-switch button { padding: .3rem .6rem; min-height: 2rem; }
.mode-switch button .icon { width: 1rem; height: 1rem; }
.mode-switch button:hover, .tool:hover:not(:disabled) { color: var(--text); background: #1f2c3c; }
.mode-switch button[aria-pressed="true"], .tool[aria-pressed="true"] {
  border-color: #3b5069;
  background: #26374b;
  color: #d8eaff;
}
.demo-panel { padding: clamp(.55rem, 1.4vw, 1rem) clamp(.55rem, 1.7vw, 1.125rem) .8rem; }
.demo-media {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  border: 1px solid #283649;
  border-radius: .5rem;
  overflow: hidden;
  background: #080d14;
}
.demo-media > * {
  grid-area: 1 / 1;
  width: min(100%, 49rem);
  height: auto;
  aspect-ratio: 16 / 9;
}
.image-media canvas { cursor: crosshair; touch-action: none; }

.transport {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(.45rem, 1.2vw, .8rem);
  margin: .5rem 0 .4rem;
}
.tool { min-width: 2.45rem; min-height: 2.45rem; padding: .35rem .55rem; }
.tool:disabled { opacity: .47; }
.play-button { border-color: #334963; color: #e5f0ff; background: #21334a; }
.play-button .icon { width: 1.3rem; height: 1.3rem; }
.time, .selection-time { color: var(--muted); font: .8125rem/1.2 var(--mono); }
.time { font-variant-numeric: tabular-nums; }

.scrub {
  --progress: 16.67%;
  appearance: none;
  width: 100%;
  height: 1.8rem;
  margin: 0;
  border: 0;
  border-radius: .25rem;
  background:
    linear-gradient(to right, var(--accent) var(--progress), #2c3b4d var(--progress))
    center / 100% 4px no-repeat;
  cursor: pointer;
}
.scrub::-webkit-slider-thumb {
  appearance: none;
  width: .875rem;
  height: .875rem;
  border-radius: 50%;
  background: #d7e8fd;
}
.scrub::-moz-range-thumb {
  width: .875rem;
  height: .875rem;
  border: none;
  border-radius: 50%;
  background: #d7e8fd;
}

.timeline {
  --start: 16.67%;
  --end: 83.33%;
  position: relative;
  height: 3rem;
  margin-inline: .55rem;
}
.filmstrip, .trim-selection {
  position: absolute;
  inset: 0;
  border-radius: .28rem;
}
.filmstrip {
  border: 1px solid #36485c;
  background: #243344 url("./assets/filmstrip.webp") center / cover;
  overflow: hidden;
}
.filmstrip::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0 calc(12.5% - 1px), #101620b5 0 12.5%);
}
.trim-selection {
  left: var(--start);
  right: calc(100% - var(--end));
  border: 2px solid var(--accent);
  background: #397bd42b;
  box-shadow: 0 0 0 100vmax #070c14a8;
  clip-path: inset(0 -80vw round .28rem);
}
.timeline { clip-path: inset(-5px -.7rem round .3rem); }
.trim-handle {
  appearance: none;
  position: absolute;
  inset: 0 auto 0 -.55rem;
  width: calc(100% + 1.1rem);
  height: 100%;
  margin: 0;
  border: 0;
  background: transparent;
  pointer-events: none;
}
.trim-handle:focus-visible { outline: none; }
.trim-handle::-webkit-slider-thumb {
  appearance: none;
  width: 1.1rem;
  height: 3rem;
  border: 1px solid #b5d4ff;
  border-radius: .28rem;
  background: linear-gradient(90deg, #294e7d 1px, transparent 1px 3px, #294e7d 3px 4px) center / 4px 13px no-repeat, #81b8ff;
  cursor: ew-resize;
  pointer-events: auto;
}
.trim-handle::-moz-range-thumb {
  width: calc(1.1rem - 2px);
  height: calc(3rem - 2px);
  border: 1px solid #b5d4ff;
  border-radius: .28rem;
  background: linear-gradient(90deg, #294e7d 1px, transparent 1px 3px, #294e7d 3px 4px) center / 4px 13px no-repeat, #81b8ff;
  cursor: ew-resize;
  pointer-events: auto;
}
.trim-handle:focus-visible::-webkit-slider-thumb { outline: 2px solid #fff; outline-offset: 2px; }
.trim-handle:focus-visible::-moz-range-thumb { outline: 2px solid #fff; outline-offset: 2px; }
.trim-handle:focus { z-index: 1; }

.demo-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem;
  margin-top: .7rem;
  color: var(--muted);
  font-size: .875rem;
  line-height: 1.4;
}
.selection-time { white-space: nowrap; }
.demo-message { padding-top: .65rem; color: var(--muted); font-size: .875rem; }
.image-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-top: .65rem;
}
.drawing-tools, .image-actions { display: flex; gap: .3rem; }
.image-actions .tool { border-color: #334963; }

.features { padding-block: clamp(4.5rem, 9vw, 7rem) clamp(3.5rem, 7vw, 5.2rem); }
.features h2, .setup h2 {
  font-size: clamp(2.05rem, 5vw, 3.05rem);
  line-height: 1.07;
  font-weight: 730;
  letter-spacing: -.05em;
  text-wrap: balance;
}
.section-intro, .setup-copy p {
  margin-top: .75rem;
  color: var(--muted);
  font-size: 1.075rem;
  line-height: 1.55;
}
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .8rem;
  margin-top: 2rem;
}
.feature {
  padding: clamp(1.15rem, 2.8vw, 1.65rem);
  border: 1px solid #293747;
  border-radius: .7rem;
  background: linear-gradient(145deg, #141e2b, #101721 80%);
}
.feature-icon {
  width: 2.3rem;
  height: 2.3rem;
  padding: .48rem;
  border: 1px solid #354e6b;
  border-radius: .48rem;
  background: #1a2d43;
  color: var(--bright);
}
.feature h3 { margin-top: .9rem; font-size: 1.1rem; line-height: 1.3; letter-spacing: -.018em; }
.feature p { margin-top: .48rem; color: var(--muted); font-size: 1rem; line-height: 1.58; }
kbd { color: #caddf5; font: .875em var(--mono); white-space: nowrap; }

.setup { padding-bottom: clamp(3.5rem, 8vw, 6rem); }
.setup-card {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  align-items: center;
  gap: clamp(1.8rem, 5vw, 4.25rem);
  padding: clamp(1.2rem, 5.2vw, 3.75rem);
  border: 1px solid #334b66;
  border-radius: .85rem;
  background: radial-gradient(ellipse at 0% 0%, #1b324d, #141f2d 70%);
}
.setup-copy .button { margin-top: 1.15rem; }
.setup-steps { color: var(--muted); line-height: 1.55; }
.setup-steps p + p { margin-top: .7rem; }
.setup-steps code { color: #d6e7ff; font: .875em/1.6 var(--mono); }
.setup-steps pre {
  margin-top: .65rem;
  padding: .7rem .8rem;
  border: 1px solid #30465f;
  border-radius: .48rem;
  overflow-x: auto;
  background: #0c1520;
}
.site-footer { border-top: 1px solid #243242; }
.footer { padding-block: 1.4rem; color: var(--muted); font-size: .875rem; }
.footer .brand { font-size: 1rem; }

@media (max-width: 48rem) {
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .setup-card { grid-template-columns: 1fr; }
}

@media (max-width: 33rem) {
  .feature-grid { grid-template-columns: 1fr; }
  .demo-title img, .mode-switch .icon { display: none; }
  .mode-switch button { padding-inline: .45rem; }
  .image-actions .tool span { display: none; }
  .hero-actions .button { padding-inline: .7rem; }
  .nav-github .icon { display: none; }
}

@media (max-width: 21rem) {
  .hero-actions { display: grid; justify-content: stretch; }
  .nav-links { gap: .5rem; }
  .nav-github { padding-inline: .45rem; }
  .demo-meta { display: grid; }
}

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

@media (forced-colors: active) {
  h1 span { -webkit-text-fill-color: currentColor; }
}
