:root {
  --page: #f5f5f7;
  --surface: #ffffff;
  --surface-soft: #fbfbfd;
  --text: #1d1d1f;
  --secondary: #6e6e73;
  --tertiary: #a1a1a6;
  --line: rgba(0, 0, 0, 0.1);
  --line-strong: rgba(0, 0, 0, 0.16);
  --blue: #0071e3;
  --accent: #0071e3;
  --blue-soft: #eaf4ff;
  --teal: #007c89;
  --green: #34c759;
  --amber: #ff9f0a;
  --coral: #ff6b5f;
  --ink: #0b1115;
  --radius-lg: 34px;
  --radius-md: 22px;
  --radius-sm: 14px;
  --shadow-lg: 0 28px 80px rgba(0, 0, 0, 0.11);
  --shadow-sm: 0 10px 30px rgba(0, 0, 0, 0.07);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 980px;
  color: var(--text);
  background: var(--page);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

button,
textarea {
  font: inherit;
}

button {
  border: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px;
  height: 48px;
  padding: 0 42px;
  background: rgba(245, 245, 247, 0.82);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  backdrop-filter: saturate(180%) blur(20px);
}

.brand,
.nav-links {
  display: flex;
  align-items: center;
}

.brand {
  gap: 9px;
  color: #202124;
  font-size: 15px;
  font-weight: 600;
}

.brand-mark {
  width: 21px;
  height: 21px;
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.7), transparent 42%),
    linear-gradient(135deg, #0b2f35, #007c89 58%, #8ee6f5);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.58);
}

.nav-links {
  justify-content: center;
  gap: 28px;
}

.nav-links a,
.github-link {
  color: rgba(29, 29, 31, 0.72);
  font-size: 13px;
  font-weight: 450;
}

.nav-links a:hover,
.github-link:hover {
  color: var(--text);
}

.github-link {
  justify-self: end;
  color: var(--blue);
}

.studio-band {
  padding: 56px 42px 60px;
}

.hero-copy {
  width: min(930px, 100%);
  margin: 0 auto 34px;
  text-align: center;
}

.hero-kicker {
  margin: 0 0 10px;
  color: var(--teal);
  font-size: 19px;
  font-weight: 650;
}

.hero-copy h1 {
  margin: 0 auto 16px;
  max-width: 880px;
  color: var(--text);
  font-size: 60px;
  line-height: 1.03;
  letter-spacing: -0.035em;
  font-weight: 700;
}

.hero-copy p:not(.hero-kicker) {
  max-width: 720px;
  margin: 0 auto;
  color: var(--secondary);
  font-size: 20px;
  line-height: 1.38;
  letter-spacing: -0.01em;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 26px;
}

.primary-link,
.secondary-link,
.generate-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 999px;
  padding: 0 20px;
  font-size: 15px;
  font-weight: 520;
  cursor: pointer;
}

.primary-link,
.generate-button {
  color: #fff;
  background: var(--blue);
  box-shadow: 0 8px 22px rgba(0, 113, 227, 0.18);
}

.secondary-link {
  color: var(--blue);
}

.primary-link:hover,
.generate-button:hover {
  background: #0077ed;
}

.secondary-link:hover {
  color: #005eb8;
}

.studio-card {
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: 16px;
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 42px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.66)),
    var(--surface);
  box-shadow: var(--shadow-lg);
}

.studio-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 8px 12px 18px;
}

.studio-title div {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
}

.studio-title strong {
  font-weight: 650;
}

.studio-caption {
  color: var(--secondary);
  font-size: 13px;
}

.pulse-mark {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(52, 199, 89, 0.12);
}

.studio-surface {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(330px, 1fr) minmax(360px, 1.08fr);
  gap: 16px;
}

.panel,
.contract-panel,
.workflow-step,
.scene-panel {
  border: 1px solid rgba(0, 0, 0, 0.075);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.92);
}

.panel {
  min-height: 640px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 74px;
  padding: 20px 22px 16px;
}

.panel-heading h2 {
  margin: 0 0 3px;
  color: var(--text);
  font-size: 21px;
  letter-spacing: -0.018em;
  font-weight: 650;
}

.panel-heading p {
  margin: 0;
  color: var(--secondary);
  font-size: 13px;
  line-height: 1.3;
}

.step-badge {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--ink);
  font-size: 13px;
  font-weight: 650;
}

.panel-menu,
.state-pill {
  justify-self: end;
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--secondary);
  background: #f5f5f7;
  font-size: 12px;
  font-weight: 520;
}

.state-pill.running {
  color: #8a5a00;
  background: #fff4d8;
}

.state-pill.complete {
  color: #1d7d3d;
  background: #e6f7eb;
}

.tab-row,
.preset-row,
.scene-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 22px 16px;
}

.tab-row button,
.preset-row button,
.scene-chip-row button {
  min-height: 32px;
  border-radius: 999px;
  padding: 0 12px;
  color: var(--secondary);
  background: #f5f5f7;
  font-size: 13px;
  font-weight: 520;
  cursor: pointer;
}

.tab-row button.active,
.preset-row button:hover,
.scene-chip-row button:hover,
.scene-chip-row button.active {
  color: #fff;
  background: var(--ink);
}

.tab-row button:disabled,
.preset-row button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

.source-panel textarea {
  flex: 1;
  min-height: 218px;
  margin: 0 22px 18px;
  resize: none;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-md);
  padding: 18px;
  color: var(--text);
  background: #fbfbfd;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 14px;
  line-height: 1.6;
  outline: none;
}

.source-panel textarea:focus {
  border-color: rgba(0, 113, 227, 0.48);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.08);
}

.generate-button {
  width: calc(100% - 44px);
  margin: 0 22px 18px;
}

.generate-button:disabled {
  cursor: progress;
  opacity: 0.68;
}

.formula-detect {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 9px;
  margin: auto 22px 22px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: #f5fbf9;
}

.formula-detect strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 620;
}

.formula-detect code {
  grid-column: 2;
  color: var(--teal);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.signal-dot {
  width: 9px;
  height: 9px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--green);
}

.pipeline-list {
  display: grid;
  gap: 7px;
  padding: 0 18px 10px;
}

.pipeline-step {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  width: 100%;
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 18px;
  padding: 10px;
  color: var(--text);
  background: #fbfbfd;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.pipeline-step:hover,
.pipeline-step:focus-visible {
  border-color: rgba(0, 113, 227, 0.3);
  background: #fff;
  outline: none;
  transform: translateY(-1px);
}

.pipeline-step.active {
  border-color: rgba(0, 113, 227, 0.38);
  background: var(--blue-soft);
  box-shadow: 0 10px 26px rgba(0, 113, 227, 0.08);
}

.pipeline-step.done {
  border-color: rgba(52, 199, 89, 0.28);
}

.pipeline-step.running {
  border-color: rgba(255, 159, 10, 0.38);
  background: #fff8e8;
}

.pipeline-index {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--secondary);
  background: #f1f1f3;
  font-size: 12px;
  font-weight: 650;
}

.pipeline-step.active .pipeline-index {
  color: #fff;
  background: var(--blue);
}

.pipeline-step.done .pipeline-index {
  color: #fff;
  background: var(--green);
}

.pipeline-step.running .pipeline-index {
  color: #fff;
  background: var(--amber);
}

.pipeline-copy strong {
  display: block;
  margin-bottom: 2px;
  font-size: 14px;
  letter-spacing: -0.01em;
  font-weight: 650;
}

.pipeline-copy p {
  margin: 0;
  color: var(--secondary);
  font-size: 12px;
  line-height: 1.28;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.pipeline-status {
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--secondary);
  background: #f1f1f3;
  font-size: 11px;
  font-style: normal;
  font-weight: 550;
}

.pipeline-step.active .pipeline-status,
.pipeline-step.running .pipeline-status {
  color: #8a5a00;
  background: #ffedbd;
}

.pipeline-step.done .pipeline-status {
  color: #1d7d3d;
  background: #e6f7eb;
}

.console-log {
  min-height: 88px;
  max-height: 96px;
  margin: auto 18px 18px;
  overflow: auto;
  border-radius: 20px;
  padding: 13px 14px;
  color: rgba(255, 255, 255, 0.84);
  background: #111316;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.55;
}

.detail-panel {
  background: linear-gradient(180deg, #ffffff, #fbfbfd);
}

.step-detail {
  margin: 0 22px 16px;
  padding: 16px;
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: var(--radius-md);
  background: #f8f8fa;
}

.step-detail .detail-label {
  display: inline-flex;
  margin-bottom: 10px;
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 12px;
  font-weight: 620;
}

.step-detail h3 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 22px;
  line-height: 1.12;
  letter-spacing: -0.02em;
  font-weight: 650;
}

.step-detail p {
  margin: 0 0 14px;
  color: var(--secondary);
  font-size: 13.5px;
  line-height: 1.4;
}

.detail-grid {
  display: grid;
  gap: 9px;
}

.detail-row {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 12px;
  font-size: 12px;
}

.detail-row span {
  color: var(--tertiary);
}

.detail-row strong,
.detail-row code {
  color: var(--text);
  font-weight: 560;
  overflow-wrap: anywhere;
}

.detail-row code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.film-heading {
  min-height: auto;
  padding-top: 0;
  padding-bottom: 10px;
}

.film-heading::before,
.film-heading::after {
  display: none;
}

.result-shell {
  position: relative;
  min-height: 210px;
  margin: 0 22px 14px;
  overflow: hidden;
  border-radius: 28px;
  background: #050608;
}

.result-placeholder,
.result-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.result-placeholder {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  justify-items: center;
  gap: 14px;
  padding: 26px;
  color: #fff;
  text-align: center;
}

.result-placeholder img {
  width: min(320px, 86%);
  border-radius: 18px;
  opacity: 0.52;
  filter: saturate(0.8);
}

.result-placeholder strong {
  display: block;
  margin-bottom: 5px;
  font-size: 17px;
  font-weight: 650;
}

.result-placeholder span {
  color: rgba(255, 255, 255, 0.66);
  font-size: 13px;
}

.result-cover {
  display: none;
  padding: 0;
  color: #fff;
  background: #050608;
  cursor: pointer;
}

.result-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.result-cover span {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  border-radius: 999px;
  padding: 10px 16px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(14px);
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}

.result-shell video {
  display: none;
  width: 100%;
  height: 100%;
  min-height: 210px;
  object-fit: cover;
  background: #050608;
}

.result-shell.complete .result-placeholder {
  display: none;
}

.result-shell.complete .result-cover {
  display: block;
}

.result-shell.complete.playing .result-cover {
  display: none;
}

.result-shell.complete.playing video {
  display: block;
}

.scene-chip-row {
  padding-top: 0;
  padding-bottom: 12px;
}

.film-note {
  margin: auto 22px 22px;
  color: var(--secondary);
  font-size: 12px;
  line-height: 1.42;
}

.film-note a {
  color: var(--accent);
  font-weight: 650;
  text-decoration: none;
}

.film-note a:hover {
  text-decoration: underline;
}

.workflow-band,
.demo-band,
.contracts-band {
  padding: 74px 42px;
}

.workflow-band {
  background: #fff;
}

.section-heading {
  width: min(1100px, 100%);
  margin: 0 auto 30px;
  text-align: center;
}

.section-heading.compact {
  margin-bottom: 20px;
  text-align: left;
}

.section-heading h2 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 44px;
  line-height: 1.08;
  letter-spacing: -0.028em;
  font-weight: 680;
}

.section-heading p {
  max-width: 720px;
  margin: 0 auto;
  color: var(--secondary);
  font-size: 18px;
  line-height: 1.45;
}

.section-heading.compact p {
  margin-left: 0;
}

.workflow-rail,
.demo-layout,
.demo-library,
.contract-grid {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.workflow-rail {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
}

.workflow-step {
  min-height: 206px;
  padding: 18px;
  border-radius: 24px;
  background: var(--surface-soft);
}

.workflow-step span,
.contract-panel span {
  display: inline-flex;
  margin-bottom: 12px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 650;
}

.workflow-step h3,
.contract-panel h3 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 18px;
  line-height: 1.15;
  letter-spacing: -0.014em;
  font-weight: 650;
}

.workflow-step p,
.contract-panel p {
  margin: 0 0 12px;
  color: var(--secondary);
  font-size: 13px;
  line-height: 1.4;
}

.workflow-step code,
.contract-panel code {
  color: var(--tertiary);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  overflow-wrap: anywhere;
}

.demo-band {
  background: var(--page);
}

.demo-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(340px, 0.75fr);
  gap: 18px;
  align-items: start;
}

.evidence-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 30px;
  background: #050608;
  box-shadow: var(--shadow-sm);
}

.scene-panel {
  overflow: hidden;
  border-radius: 30px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.compact-panel-heading {
  min-height: 66px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.compact-panel-heading h2 {
  margin: 0;
  font-size: 18px;
}

.scene-list {
  display: grid;
  gap: 8px;
  padding: 0 14px 14px;
}

.scene-button {
  width: 100%;
  border-radius: 16px;
  padding: 12px;
  color: var(--text);
  background: #f7f7f9;
  text-align: left;
  cursor: pointer;
}

.scene-button.active,
.scene-button:hover {
  background: var(--blue-soft);
}

.scene-button span,
.scene-button small {
  display: block;
  color: var(--secondary);
  font-size: 12px;
}

.scene-button strong {
  display: block;
  margin: 4px 0;
  font-size: 14px;
  font-weight: 650;
}

.scene-detail {
  margin: 0 14px 14px;
  padding: 14px;
  border-radius: 18px;
  background: #fbfbfd;
}

.scene-detail strong {
  display: block;
  margin-bottom: 7px;
  font-size: 15px;
}

.scene-detail p {
  margin: 0 0 12px;
  color: var(--secondary);
  font-size: 13px;
  line-height: 1.45;
}

.scene-detail dl {
  display: grid;
  gap: 7px;
  margin: 0;
}

.scene-detail dl div {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 10px;
  font-size: 12px;
}

.scene-detail dt {
  color: var(--tertiary);
}

.scene-detail dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.demo-library {
  padding-top: 42px;
}

.library-heading {
  width: 100%;
}

.library-heading h2 {
  font-size: 34px;
}

.library-heading p {
  max-width: 640px;
}

.demo-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.demo-card {
  overflow: hidden;
  border-radius: 28px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.library-video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #050608;
}

.demo-card-body {
  padding: 18px 18px 20px;
}

.demo-card-body span {
  display: block;
  margin-bottom: 9px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 650;
}

.demo-card-body h3 {
  margin: 0 0 9px;
  color: var(--text);
  font-size: 20px;
  line-height: 1.14;
  letter-spacing: -0.016em;
  font-weight: 680;
}

.demo-card-body p {
  min-height: 58px;
  margin: 0;
  color: var(--secondary);
  font-size: 13px;
  line-height: 1.45;
}

.demo-card-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.demo-card-actions button,
.demo-card-actions a {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  border-radius: 999px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
}

.demo-card-actions button {
  color: #fff;
  background: var(--accent);
  cursor: pointer;
}

.demo-card-actions a {
  color: var(--accent);
  background: var(--blue-soft);
}

.demo-card-actions button:hover {
  background: #005bbd;
}

.demo-card-actions a:hover {
  background: #d8ebff;
}

.contracts-band {
  background: #fff;
}

.contract-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.contract-panel {
  min-height: 220px;
  padding: 24px;
  border-radius: 28px;
  background: var(--surface-soft);
}

@media (max-width: 1180px) {
  body {
    min-width: 980px;
  }

  .studio-surface {
    grid-template-columns: 0.9fr 1fr 1fr;
  }

  .hero-copy h1 {
    font-size: 60px;
  }

  .workflow-rail {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}
