:root {
  --bg: #100e0c;
  --bg-2: #191613;
  --bg-3: #241f1a;
  --line: rgba(243, 232, 214, 0.14);
  --text: #f4ecdf;
  --muted: #b4a696;
  --faint: #817566;
  --accent: #e0a15a;
  --accent-ink: #2a1b0c;
  --moss: #8ea57a;
  --danger: #d16b55;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  --serif: "Iowan Old Style", Palatino, "Palatino Linotype", "Songti SC", "Noto Serif SC", serif;
  --sans: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f4efe6;
  --bg-2: #fffaf3;
  --bg-3: #efe4d4;
  --line: rgba(48, 32, 16, 0.12);
  --text: #241c16;
  --muted: #6f6256;
  --faint: #97887a;
  --accent: #9a5620;
  --accent-ink: #fff8ef;
  --moss: #3d6844;
  --danger: #9d3b2f;
  --shadow: 0 18px 40px rgba(80, 48, 16, 0.08);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background:
    radial-gradient(900px 420px at 10% -10%, rgba(224, 161, 90, 0.16), transparent 55%),
    radial-gradient(700px 380px at 100% 0%, rgba(142, 165, 122, 0.1), transparent 50%),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
img, video { max-width: 100%; display: block; }
.wrap { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.site-header {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(16px);
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  border-bottom: 1px solid var(--line);
}
.header-row, .footer-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.stamp {
  width: 34px; height: 34px; border: 1px solid var(--accent); border-radius: 8px;
  display: grid; place-items: center; font-size: 11px; letter-spacing: 0.08em;
}
.brand strong { font-family: var(--serif); font-weight: 560; font-size: 18px; }
.nav { display: flex; gap: 18px; align-items: center; }
.nav a, .text-btn, .ghost {
  text-decoration: none; background: none; border: 0; color: var(--muted); padding: 0;
}
.nav a[aria-current="page"], .text-btn:hover, .nav a:hover { color: var(--text); }
.header-tools { display: flex; align-items: center; gap: 10px; }
.pill, .icon-btn, .primary, .secondary {
  border-radius: 999px; border: 1px solid var(--line); background: var(--bg-2);
}
.pill, .icon-btn { padding: 6px 10px; color: var(--text); text-decoration: none; }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; }
.credits-pill { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.primary, .secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px; text-decoration: none;
}
.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 620; }
.secondary { background: transparent; }
.primary:disabled, .secondary:disabled { opacity: 0.55; cursor: not-allowed; }
.google-btn { background: #fff; color: #1f1f1f; border-color: transparent; font-weight: 560; }
.google-btn svg { flex: 0 0 auto; }
.hero { padding: 64px 0 20px; display: grid; grid-template-columns: 1.3fr 0.7fr; gap: 32px; align-items: end; }
.workbench { padding-top: 18px; }
.work-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 8px; }
.work-head h1 { font-size: clamp(34px, 4vw, 48px); }
.work-quote { margin: 0; color: var(--muted); text-align: right; }
.work-quote strong { display: block; color: var(--text); font-family: var(--serif); font-size: 32px; line-height: 1; }
.film.compact { grid-auto-columns: 148px; margin-bottom: 14px; }
.film.compact .poster { height: 96px; }
.film.compact .scene small { display: none; }
.op-row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.generate { width: 100%; margin-top: 8px; min-height: 52px; font-size: 17px; }
.settings-toggle { margin-top: 10px; }
.settings-panel { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.kicker { letter-spacing: 0.16em; text-transform: uppercase; font-size: 12px; color: var(--accent); margin: 0 0 12px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 560; letter-spacing: -0.03em; margin: 0; }
h1 { font-size: clamp(52px, 8vw, 92px); line-height: 0.9; }
h2 { font-size: clamp(32px, 4vw, 48px); line-height: 1; }
.lede, .muted { color: var(--muted); }
.hero-actions, .row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.hero-side { border-left: 1px solid var(--line); padding-left: 22px; color: var(--muted); }
.hero-side strong { color: var(--text); display: block; font-size: 28px; font-family: var(--serif); }
.section { padding: 28px 0 10px; }
.section-head { display: flex; justify-content: space-between; gap: 16px; align-items: end; margin-bottom: 14px; }
.film { display: grid; grid-auto-flow: column; grid-auto-columns: 168px; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; }
.scene {
  scroll-snap-align: start; text-align: left; border: 1px solid var(--line); background: var(--bg-2);
  border-radius: 18px; padding: 8px; color: var(--text);
}
.scene.is-selected { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.poster { height: 210px; border-radius: 12px; position: relative; overflow: hidden; }
.poster::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 48%; background: linear-gradient(transparent, rgba(0,0,0,.62)); }
.poster span { position: absolute; z-index: 1; left: 10px; right: 10px; bottom: 10px; color: #f7f1e6; text-shadow: 0 1px 8px rgba(0,0,0,.45); font-family: var(--serif); font-size: 20px; line-height: 1.05; }
.scene small { display: block; color: var(--muted); padding: 8px 4px 4px; }
.ridge { background: linear-gradient(#243246, #243246 42%, #c9864a 42%, #e7c27a); }
.whiteout { background: linear-gradient(#edf2f4, #b9c6cf 70%, #2c2622); }
.doorway { background: linear-gradient(#1b140f, #1b140f 30%, #c98345 30%, #f0c48a); }
.snowlight { background: radial-gradient(circle at 30% 40%, #f0d7a4 0 3px, transparent 4px), radial-gradient(circle at 60% 30%, #f0d7a4 0 2px, transparent 3px), linear-gradient(#1c2740, #8ea4c0 70%, #d9e4ee); }
.rain { background: linear-gradient(#1d3a3a, #1d3a3a 62%, #d7b15a 62% 66%, #123 66%); }
.harvest { background: linear-gradient(#3d315c, #3d315c 36%, #d7a441 36%, #f0d48a); }
.studio { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.8fr); gap: 18px; align-items: start; }
@media (min-width: 901px) {
  #preview { position: sticky; top: 84px; }
}
.panel { background: color-mix(in srgb, var(--bg-2) 92%, transparent); border: 1px solid var(--line); border-radius: 24px; padding: 18px; box-shadow: var(--shadow); }
.choice, .seg, .models, .upload-grid { display: flex; gap: 8px; flex-wrap: wrap; }
.choice button, .seg button, .models button, .tab {
  border: 1px solid var(--line); background: transparent; border-radius: 999px; min-height: 38px; padding: 0 12px;
}
.choice button[aria-pressed="true"], .seg button[aria-pressed="true"], .models button[aria-pressed="true"], .tab[aria-pressed="true"] {
  background: var(--text); color: var(--bg); border-color: var(--text);
}
.models { display: grid; grid-template-columns: 1fr 1fr; }
.models button { border-radius: 16px; text-align: left; padding: 12px; min-height: 74px; }
.models b, .models small { display: block; }
.models small { color: var(--faint); }
label.field { display: block; margin: 14px 0; }
label.field span, .group-label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 14px; }
textarea, input[type="email"], input[type="password"], input[type="text"] {
  width: 100%; border: 1px solid var(--line); background: var(--bg); border-radius: 14px; padding: 12px; outline: none;
}
textarea { min-height: 72px; resize: vertical; }
.upload {
  flex: 1; min-width: 140px; border: 1px dashed var(--line); border-radius: 16px; min-height: 196px;
  display: grid; place-items: center; text-align: center; padding: 10px; position: relative; overflow: hidden; background: var(--bg);
}
.upload img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.quote-line { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin: 8px 0 14px; }
.quote-line strong { font-family: var(--serif); font-size: 28px; }
.check { display: flex; gap: 8px; align-items: flex-start; color: var(--muted); font-size: 14px; }
.frame {
  width: min(100%, 420px); margin: 0 auto; background: #090807; border-radius: 18px; overflow: hidden;
  display: grid; place-items: end start; position: relative; color: white;
}
.frame[data-aspect="9:16"] { aspect-ratio: 9/16; }
.frame[data-aspect="1:1"] { aspect-ratio: 1; }
.frame[data-aspect="16:9"] { aspect-ratio: 16/9; }
.frame video, .frame .poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.frame figcaption { position: relative; z-index: 1; padding: 14px; text-shadow: 0 1px 8px #000; }
.notice, .banner {
  border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; color: var(--muted); background: var(--bg-3);
}
.banner { margin: 12px 0; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.price-card, .job, .faq details, .guide-card {
  border: 1px solid var(--line); border-radius: 20px; padding: 16px; background: var(--bg-2);
}
.price-card.is-rec { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 70%, var(--line)); }
.price { font-family: var(--serif); font-size: 40px; margin: 8px 0; }
.price small { font-size: 16px; color: var(--muted); }
.tabs { display: flex; gap: 8px; margin: 12px 0 16px; }
.faq details + details, .stack > * + * { margin-top: 10px; }
.faq summary { cursor: pointer; font-weight: 600; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.captions { display: flex; gap: 8px; flex-wrap: wrap; }
.captions button { border-radius: 999px; border: 1px solid var(--line); background: transparent; padding: 8px 12px; }
.site-footer { border-top: 1px solid var(--line); margin-top: 48px; padding: 22px 0 40px; color: var(--muted); }
.footer-links { display: flex; gap: 14px; flex-wrap: wrap; }
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: grid; place-items: center; z-index: 30; padding: 18px; }
.modal { width: min(440px, 100%); }
.toast {
  position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--bg); border-radius: 999px; padding: 10px 14px; z-index: 40;
}
.legal { max-width: 760px; }
.legal p, .legal li { color: var(--muted); }
table { width: 100%; border-collapse: collapse; }
td, th { text-align: left; padding: 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.menu-btn { display: none; }
@media (max-width: 900px) {
  .hero, .studio, .split, .cards, .work-head { grid-template-columns: 1fr; }
  .work-head { display: block; }
  .work-quote { text-align: left; margin-top: 8px; }
  .hero-side { border-left: 0; padding-left: 0; }
  .nav { display: none; }
  .nav.open { display: flex; flex-direction: column; position: absolute; top: 68px; left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--line); padding: 12px 16px 16px; }
  .menu-btn { display: grid; }
  h1 { font-size: 56px; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
