:root {
  color-scheme: dark;
  --bg: #0a0910;
  --surface: #12111b;
  --surface-raised: #1b1927;
  --line: #ffffff19;
  --text: #f7f4ff;
  --muted: #b1abbe;
  --lavender: #c7b3ff;
  --cyan: #8de8ec;
  --gradient: linear-gradient(112deg, #bf9cff, #9eacff 60%, #a2eff0);
  font-family: Inter, "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  line-height: 1.55;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  background: radial-gradient(ellipse 68% 500px at 56% 0, #231b3b 0, transparent 87%), var(--bg);
}
a { color: inherit; text-decoration: none; }
button, textarea, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .7; }
button:focus-visible, a:focus-visible, textarea:focus-visible, .choices input:focus-visible + span {
  outline: 2px solid var(--cyan);
  outline-offset: 4px;
}
.skip-link {
  position: fixed;
  z-index: 2;
  top: 8px;
  left: 8px;
  padding: 8px 16px;
  border-radius: 6px;
  background: var(--surface-raised);
  transform: translateY(-150%);
}
.skip-link:focus { transform: none; }
.shell { width: min(1180px, calc(100% - 56px)); margin-inline: auto; }

.nav, .footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.nav { min-height: 76px; border-bottom: 1px solid var(--line); }
.nav nav { display: flex; align-items: center; gap: 26px; font-size: .88rem; }
.workflow-link, .footer > a:last-child { color: var(--muted); }
.workflow-link:hover, .footer > a:last-child:hover { color: var(--text); }
.brand { display: inline-flex; align-items: center; gap: 0; white-space: nowrap; font-size: 1.22rem; font-weight: 780; letter-spacing: -.045em; }
.brand > span:last-child { color: var(--lavender); }
.brand-mark {
  display: grid;
  width: 31px;
  height: 31px;
  margin-right: 8px;
  place-items: center;
  border-radius: 8px;
  background: var(--gradient);
  color: #1d1230;
  font-size: 1rem;
  font-weight: 850;
  font-style: italic;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  min-height: 46px;
  padding: 9px 18px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: var(--gradient);
  color: #1a1029;
  font-weight: 750;
  line-height: 1.25;
}
.button:hover { filter: brightness(1.12); }
.button-small { min-height: 38px; padding-inline: 12px; font-size: .84rem; }
.button-outline { border-color: #c7b3ff40; background: #a189ce13; color: var(--text); }
.button span { font-size: 1.12em; }

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, .86fr) minmax(0, 1.14fr);
  align-items: center;
  gap: clamp(28px, 6vw, 86px);
  padding: clamp(58px, 8vw, 110px) 0 clamp(54px, 7vw, 95px);
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: var(--lavender);
  font-size: .75rem;
  font-weight: 680;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.eyebrow span { width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); }
.hero-copy h1 {
  max-width: 9ch;
  margin: 20px 0;
  font-size: clamp(3.2rem, 5.65vw, 5.5rem);
  font-weight: 800;
  line-height: .99;
  letter-spacing: -.077em;
}
.hero-copy h1 em { display: block; font-style: normal; color: #cfbaff; }
.hero-copy > p:not(.eyebrow) { max-width: 38ch; margin: 0 0 27px; color: var(--muted); font-size: clamp(1rem, 1.6vw, 1.18rem); }
.hero-board {
  min-width: 0;
  overflow: hidden;
  margin: 0;
  padding: 13px;
  border: 1px solid #c8adff34;
  border-radius: 19px;
  background: linear-gradient(154deg, #222035, #100f18 57%);
  box-shadow: 0 25px 90px #050409b3, 0 0 58px #7977f717;
}
.frame-header, .frame-caption { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 0 3px 10px; font-size: .78rem; color: #c0bbcf; }
.frame-caption { padding: 11px 3px 9px; }
.frame-caption span:first-child { color: var(--text); font-size: .88rem; font-weight: 640; }
.frame-format { white-space: nowrap; }
.frame-format b { padding-inline: 4px; color: var(--lavender); }
.scene-art {
  position: relative;
  aspect-ratio: 16 / 9;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid #d8c4ff34;
  border-radius: 10px;
  background:
    radial-gradient(ellipse 36% 25% at 57% 78%, #9f76ed78, transparent 90%),
    radial-gradient(ellipse at 50% 7%, #282854, #13112c 62%, #0a0912);
}
.art-grid {
  position: absolute;
  inset: 57% -22% -29%;
  transform: perspective(140px) rotateX(50deg) scale(1.35);
  background: repeating-linear-gradient(0deg, transparent 0 20px, #bb9fff4c 21px 22px),
    repeating-linear-gradient(90deg, transparent 0 31px, #bb9fff42 32px 33px);
  -webkit-mask-image: linear-gradient(transparent, #000 45%);
  mask-image: linear-gradient(transparent, #000 45%);
}
.art-halo {
  position: absolute;
  inset: 12% 24% 12% auto;
  aspect-ratio: 1;
  border: 2px solid #d8c3ffb0;
  border-left-color: #a5aaff63;
  border-radius: 50%;
  background: radial-gradient(circle at 66% 48%, #d3bcff5c, #9d60ff29 51%, transparent 73%);
  box-shadow: inset 0 0 40px #b18aff68, 0 0 28px #a878ffaa;
  transform: rotate(25deg) skew(-8deg, -11deg);
}
.art-slab {
  position: absolute;
  top: 49%;
  bottom: 10%;
  left: 47%;
  width: 18%;
  clip-path: polygon(38% 0, 60% 0, 65% 28%, 81% 100%, 12% 100%, 32% 28%);
  background: linear-gradient(90deg, #0a0915 25%, #25234e 69%, #4c4594 72%, #13132d 77%);
  filter: drop-shadow(0 0 10px #0a0914);
}
.scene-art::after {
  position: absolute;
  content: "";
  inset: 43% 16% 38% 47%;
  clip-path: polygon(0 42%, 100% 0, 100% 100%, 0 58%);
  background: linear-gradient(90deg, #c7f8f3bf, #9cdce942, transparent);
  filter: blur(2px);
}
.frame-corner { position: absolute; z-index: 1; width: 14px; height: 14px; border: 0 solid #e0d5ff80; }
.top-left { top: 13px; left: 13px; border-top-width: 1px; border-left-width: 1px; }
.top-right { top: 13px; right: 13px; border-top-width: 1px; border-right-width: 1px; }
.bottom-left { bottom: 13px; left: 13px; border-bottom-width: 1px; border-left-width: 1px; }
.bottom-right { bottom: 13px; right: 13px; border-bottom-width: 1px; border-right-width: 1px; }
.mini-timeline { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 0; padding: 0; list-style: none; }
.mini-timeline li { display: grid; grid-template-columns: min-content 1fr; column-gap: 5px; padding: 7px 8px; border: 1px solid #c8adff26; border-radius: 6px; background: #ad8cea15; }
.mini-timeline li:nth-child(2) { background: #ad8cea25; }
.mini-timeline span, .mini-timeline small { color: #dbcbff; font-size: .68rem; font-variant-numeric: tabular-nums; }
.mini-timeline strong { overflow: hidden; text-overflow: ellipsis; font-size: .73rem; font-weight: 650; white-space: nowrap; }
.mini-timeline small { grid-column: 2; }

.feature-story { display: grid; grid-template-columns: minmax(175px, .8fr) minmax(0, 2.2fr); gap: 25px; padding-block: 26px; border-block: 1px solid var(--line); }
.feature-story h2 { max-width: 12ch; align-self: center; margin: 0; font-size: clamp(1.35rem, 2.4vw, 1.9rem); line-height: 1.09; letter-spacing: -.048em; }
.feature-story ol { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 19px; margin: 0; padding: 0; list-style: none; }
.feature-story li { display: flex; gap: 9px; }
.step-number { align-self: flex-start; min-width: 25px; padding: 4px 3px; border-radius: 5px; background: #ac90ed22; color: var(--lavender); text-align: center; font-size: .68rem; }
.feature-story strong { display: block; color: #ece8f7; font-size: .84rem; line-height: 1.4; }
.feature-story p { margin: 4px 0 0; color: var(--muted); font-size: .79rem; line-height: 1.45; }

.workspace { padding-block: 72px 88px; scroll-margin-top: 20px; }
.section-heading { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 24px; margin-bottom: 22px; }
.section-heading h2 { margin: 0; font-size: clamp(2rem, 4vw, 3.15rem); line-height: 1; letter-spacing: -.066em; }
.section-heading p { margin: 8px 0 0; color: var(--muted); }
.section-heading .scope-note { font-size: .8rem; }
.generator-shell { display: grid; grid-template-columns: minmax(260px, .82fr) minmax(0, 1.18fr); overflow: hidden; border: 1px solid var(--line); border-radius: 19px; background: var(--surface); }
.generator-controls, .workspace-content { min-width: 0; padding: clamp(18px, 3.2vw, 36px); }
.generator-controls { border-right: 1px solid var(--line); }
.generator-field, .option-group legend { font-size: .86rem; font-weight: 720; }
.generator-controls textarea { display: block; width: 100%; margin: 8px 0 7px; padding: 12px; resize: vertical; min-height: 6rem; border: 1px solid #c7b3ff37; border-radius: 9px; background: #0e0d16; color: var(--text); }
.generator-controls textarea::placeholder { color: #9189a1; }
.example-button { padding: 0; border: 0; background: transparent; color: var(--lavender); font-size: .79rem; text-decoration: underline; text-underline-offset: 4px; }
.example-button:hover { color: var(--cyan); }
.option-group { min-width: 0; margin: 17px 0 0; padding: 0; border: 0; }
.option-group legend { margin-bottom: 6px; padding: 0; }
.choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.choices label { position: relative; display: block; cursor: pointer; }
.choices input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.choices span { display: block; padding: 8px 6px; border: 1px solid var(--line); border-radius: 7px; background: #1b1924; color: var(--muted); text-align: center; font-size: .83rem; }
.choices input:checked + span { border-color: #c7b3ff93; background: #ae95ef26; color: var(--text); }
.generator-submit { width: 100%; margin-top: 25px; }
.form-message { margin: 10px 0 0; min-height: 1.3em; color: var(--muted); font-size: .81rem; }
.form-message[data-state="error"] { color: #ffabb9; }
.form-message[data-state="success"] { color: var(--cyan); }
.workspace-content { background: #0d0c14; }
.workspace-content h3 { margin: 0 0 9px; font-size: .97rem; letter-spacing: -.025em; }
.project-detail { margin-bottom: 21px; padding-bottom: 21px; border-bottom: 1px solid var(--line); }
.workspace-status { margin: 0; color: var(--muted); font-size: .86rem; }
.project-meta { display: flex; flex-wrap: wrap; gap: 5px 10px; color: var(--lavender); font-size: .77rem; }
.project-prompt { margin: 6px 0 12px; color: #e2dcec; font-size: .88rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.shot-list, .project-list { margin: 0; padding: 0; list-style: none; }
.shot-list { display: grid; gap: 7px; }
.shot-list li { padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: #c7b3ff0b; }
.shot-heading { display: flex; justify-content: space-between; gap: 8px; color: #edebf3; font-size: .8rem; }
.shot-heading span { color: var(--lavender); white-space: nowrap; }
.shot-list p { margin: 3px 0 0; color: var(--muted); overflow-wrap: anywhere; font-size: .78rem; }
.project-list { display: grid; gap: 6px; max-height: 286px; overflow-y: auto; }
.project-entry { display: grid; grid-template-columns: minmax(0, 1fr) max-content; gap: 8px; width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: #1a1723; color: var(--text); text-align: left; font-size: .83rem; }
.project-entry[aria-current="true"] { border-color: #c7b3ff93; background: #a586f226; }
.project-entry-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-entry-meta { color: var(--muted); font-size: .74rem; }
.project-history .example-button { margin-top: 7px; }
.footer { min-height: 87px; border-top: 1px solid var(--line); }
.footer > a:last-child { font-size: .83rem; }

@media (max-width: 800px) {
  .shell { width: min(1180px, calc(100% - 38px)); }
  .home-hero { grid-template-columns: 1fr; gap: 32px; padding-block: 55px 44px; }
  .hero-copy h1 { max-width: 12ch; }
  .hero-board { width: min(100%, 580px); }
  .feature-story { grid-template-columns: 1fr; gap: 18px; }
  .feature-story h2 { max-width: none; }
  .generator-shell { grid-template-columns: 1fr; }
  .generator-controls { border-right: none; border-bottom: 1px solid var(--line); }
  .workspace { padding-block: 54px 64px; }
}

@media (max-width: 490px) {
  .nav { min-height: 65px; }
  .nav nav { gap: 0; }
  .workflow-link { display: none; }
  .button-small { padding-inline: 8px; }
  .home-hero { padding-top: 46px; }
  .hero-copy h1 { font-size: clamp(2.65rem, 12.6vw, 3.35rem); }
  .hero-board { padding: 8px; }
  .feature-story ol { grid-template-columns: 1fr; gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
