:root {
  --bg: #0a0a0b;
  --ink: #f5f5f7;
  --muted: rgba(245, 245, 247, 0.52);
  --blue: #0a84ff;
  --green: #30d158;
  --purple: #bf5af2;
  --amber: #ff9f0a;
  --accent: var(--blue);
  --line: rgba(255, 255, 255, 0.08);
}
html[data-ec-theme="light"] {
  --bg: #f5f5f7;
  --ink: #1d1d1f;
  --muted: rgba(29, 29, 31, 0.58);
  --line: rgba(0, 0, 0, 0.08);
}
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html, body {
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: "Manrope", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
#main {
  position: relative;
  overflow: hidden;
}
.scene {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  overflow: hidden;
  opacity: 0;
  width: 100%;
}
.grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  opacity: 0.06;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}
.grid-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black 20%, transparent 75%);
}
.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
}
.glow-a {
  width: 700px;
  height: 700px;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 35%, transparent), transparent 70%);
}
.glow-b {
  width: 500px;
  height: 500px;
  bottom: -80px;
  right: 10%;
  background: radial-gradient(circle, rgba(191, 90, 242, 0.16), transparent 70%);
}

.pad {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  padding: 48px 80px 32px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 28px;
}
.hero-title {
  font-size: 72px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.02;
  max-width: 1100px;
}
.hero-sub {
  margin-top: 20px;
  font-size: 26px;
  font-weight: 400;
  color: var(--muted);
  max-width: 820px;
  line-height: 1.45;
}

.row-split {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 56px;
  padding: 44px 100px 32px;
}
.chat {
  width: 640px;
  border-radius: 28px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}
.chat-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
  font-weight: 700;
}
.chat-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px rgba(48, 209, 88, 0.6);
}
.chat-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.bubble {
  max-width: 92%;
  padding: 14px 18px;
  border-radius: 16px;
  font-size: 16px;
  line-height: 1.45;
}
.bubble-user {
  align-self: flex-end;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--accent) 28%, transparent),
    rgba(48, 209, 88, 0.1)
  );
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
}
.bubble-ai {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.tool-panel {
  width: 680px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.tool-card {
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.tool-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.tool-icon .ec-lucide {
  width: 22px;
  height: 22px;
  stroke-width: 2;
}
.tool-icon.accent {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent);
}
.tool-icon.blue {
  background: rgba(10, 132, 255, 0.15);
  color: var(--blue);
}
.tool-icon.green {
  background: rgba(48, 209, 88, 0.15);
  color: var(--green);
}
.tool-icon.purple {
  background: rgba(191, 90, 242, 0.15);
  color: var(--purple);
}
.tool-icon.amber {
  background: rgba(255, 159, 10, 0.15);
  color: var(--amber);
}
.tool-text {
  flex: 1;
  min-width: 0;
}
.tool-name {
  font-size: 17px;
  font-weight: 700;
}
.tool-desc {
  font-size: 14px;
  color: var(--muted);
  margin-top: 2px;
}
.tool-status {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--green);
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(48, 209, 88, 0.12);
  border: 1px solid rgba(48, 209, 88, 0.25);
}

.story-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 1320px;
  margin-top: 36px;
}
.story-frame {
  aspect-ratio: 16 / 10;
  border-radius: 14px;
  border: 1px solid var(--line);
  overflow: hidden;
  position: relative;
  background: rgba(255, 255, 255, 0.04);
}
.story-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.story-frame.active {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent);
}
.story-frame .idx {
  position: absolute;
  left: 8px;
  top: 8px;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
}

.prompt-shell {
  width: 100%;
  max-width: 920px;
  margin-top: 32px;
  padding: 22px 26px;
  border-radius: 22px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  background: rgba(255, 255, 255, 0.04);
  text-align: left;
  font-size: 22px;
  line-height: 1.45;
  min-height: 88px;
}
.prompt-cursor {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background: var(--accent);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: hw-blink 1s step-end infinite;
}
@keyframes hw-blink {
  50% {
    opacity: 0;
  }
}

.video-hero {
  position: relative;
  width: min(1180px, 92%);
  margin-top: 28px;
  border-radius: 24px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  overflow: hidden;
  aspect-ratio: 16 / 9;
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.45);
  background: #000;
}
.video-hero .ec-vid-wrap {
  position: absolute;
  inset: 0;
}
.video-hero .ec-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 1;
}
.video-hero .ec-vid {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
}
.video-hero .ec-vid.ec-on {
  opacity: 1;
}
.video-hero .ec-vid.ec-on ~ .ec-poster,
.video-hero .ec-vid-wrap:has(.ec-vid.ec-on) .ec-poster {
  opacity: 0;
}
.video-shine {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.12) 50%, transparent 60%);
  transform: translateX(-120%);
}

.masonry {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  width: 100%;
  max-width: 1320px;
  margin-top: 28px;
}
.masonry-cell {
  border-radius: 16px;
  border: 1px solid var(--line);
  overflow: hidden;
  aspect-ratio: 9 / 16;
  background: rgba(255, 255, 255, 0.04);
  position: relative;
}
.masonry-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.film-panel {
  width: 100%;
  max-width: 1320px;
  margin-top: 28px;
  border-radius: 20px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
}
.film-track {
  display: flex;
  gap: 8px;
  overflow: hidden;
}
.film-thumb {
  flex: 0 0 140px;
  height: 78px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  opacity: 0.5;
  transform: scale(0.98);
}
.film-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.film-thumb.hot {
  opacity: 1;
  transform: scale(1.04);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent);
}

.clip-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  width: 100%;
  max-width: 1200px;
  margin-top: 28px;
}
.clip-card {
  border-radius: 18px;
  border: 1px solid var(--line);
  padding: 14px;
  background: rgba(255, 255, 255, 0.03);
  text-align: left;
}
.clip-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  object-fit: cover;
  margin-bottom: 10px;
}
.clip-card .title {
  font-size: 16px;
  font-weight: 700;
}
.clip-card .meta {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

.timeline-panel {
  width: 100%;
  max-width: 1280px;
  margin-top: 28px;
  border-radius: 18px;
  border: 1px solid var(--line);
  padding: 18px 20px;
  background: rgba(255, 255, 255, 0.03);
}
.timeline-ruler {
  display: flex;
  gap: 6px;
  align-items: stretch;
  min-height: 72px;
}
.tl-clip {
  flex: 1;
  min-width: 80px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent);
  position: relative;
  overflow: hidden;
}
.tl-clip.gap {
  flex: 0 0 48px;
  border-style: dashed;
  border-color: color-mix(in srgb, var(--amber) 50%, var(--line));
  background: color-mix(in srgb, var(--amber) 8%, transparent);
}
.tl-clip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
}
.playhead {
  position: absolute;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--accent);
  box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 80%, transparent);
  left: 38%;
}

.uc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  width: 100%;
  max-width: 1320px;
  margin-top: 24px;
}
.uc {
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  padding: 22px;
  text-align: left;
}
.uc-tag {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 8px;
  color: var(--accent);
}
.uc-title {
  font-size: 20px;
  font-weight: 700;
}
.uc-body {
  margin-top: 6px;
  font-size: 14px;
  color: color-mix(in srgb, var(--ink) 72%, transparent);
  line-height: 1.45;
}

/* Mobile overrides — html width set per file */
.hw-mobile .grid-bg {
  display: none;
}
.hw-mobile .pad {
  padding: 26px 24px 22px;
}
.hw-mobile .pad-sc {
  padding: 26px 24px 28px;
}
.hw-mobile .hero-title {
  font-size: 34px;
  padding-inline: 4px;
}
.hw-mobile .hero-sub {
  font-size: 16px;
  margin-top: 10px;
  padding-inline: 4px;
}
.hw-mobile .badge {
  font-size: 12px;
}
.hw-mobile .chat {
  width: 100%;
}
.hw-mobile .tool-panel {
  width: 100%;
}
.hw-mobile .row-split {
  flex-direction: column;
  padding: 24px 22px 28px;
  gap: 20px;
}
.hw-mobile .story-grid {
  grid-template-columns: repeat(3, 1fr);
  margin-top: 20px;
}
.hw-mobile .masonry {
  grid-template-columns: repeat(2, 1fr);
}
.hw-mobile .clip-row {
  grid-template-columns: 1fr;
}
.hw-mobile .uc-grid {
  grid-template-columns: 1fr;
}
