/* ==========================================================================
   Quickloop Studio — styles
   Light theme by default, dark theme via [data-theme="dark"] on <html>.
   ========================================================================== */

:root {
  --bg: #fafaf7;
  --bg-alt: #f1f0eb;
  --surface: #ffffff;
  --text: #141414;
  --muted: #6b6b66;
  --line: #e2e1db;
  --accent: #ff5a1f;
  --accent-soft: #ffe7dc;
  --btn-bg: #141414;
  --btn-text: #fafaf7;
  --scene-bg: #f1f0eb;
  --scene-ink: #141414;
  --radius: 14px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #111111;
  --bg-alt: #181818;
  --surface: #1c1c1c;
  --text: #f1f0eb;
  --muted: #9a9a93;
  --line: #2c2c2a;
  --accent: #ff6a33;
  --accent-soft: #3a2117;
  --btn-bg: #f1f0eb;
  --btn-text: #111111;
  --scene-bg: #1f1f1f;
  --scene-ink: #f1f0eb;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s, color 0.3s;
}
h1, h2, h3 { line-height: 1.12; letter-spacing: -0.025em; margin: 0; }
p { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }

.wrap { width: min(1160px, 100% - 48px); margin-inline: auto; }
.muted { color: var(--muted); }
.eyebrow {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 14px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 26px;
  border: 1px solid var(--btn-bg);
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-text);
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  transition: transform 0.15s, background-color 0.2s, color 0.2s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--text); }
.btn-small { padding: 9px 18px; font-size: 14px; }
.btn-large { padding: 17px 34px; font-size: 17px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 24px; }
.logo { font-weight: 700; font-size: 18px; letter-spacing: -0.03em; text-decoration: none; }
.logo-dot { color: var(--accent); }
.nav { display: flex; gap: 28px; }
.nav a { text-decoration: none; color: var(--muted); font-size: 15px; transition: color 0.2s; }
.nav a:hover { color: var(--text); }
.header-actions { display: flex; align-items: center; gap: 12px; }

.theme-toggle {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
}
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }

/* ---------- Hero ---------- */
.hero { padding: 72px 0 96px; overflow: hidden; }
.hero-inner { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(40px, 5.6vw, 72px); font-weight: 700; }
.hero .lead { margin-top: 24px; max-width: 560px; font-size: 19px; color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.hero-note { margin-top: 18px; font-size: 15px; color: var(--muted); }
.hero-note strong { color: var(--text); }
.hero-facts { display: flex; gap: 40px; list-style: none; padding: 0; margin: 48px 0 0; }
.hero-facts li { display: flex; flex-direction: column; }
.hero-facts strong { white-space: nowrap; font-size: 22px; letter-spacing: -0.02em; }
.hero-facts span { font-size: 14px; color: var(--muted); }

.hero-art svg { width: 100%; max-width: 420px; display: block; margin-left: auto; }
.ring { fill: none; stroke: var(--line); stroke-width: 1.5; }
.r1 { stroke: var(--text); stroke-opacity: 0.15; }
.r2 { stroke-dasharray: 4 10; stroke: var(--text); stroke-opacity: 0.3; transform-origin: 200px 200px; animation: spin 30s linear infinite; }
.r3 { stroke: var(--accent); stroke-width: 2; stroke-dasharray: 300 140; transform-origin: 200px 200px; animation: spin 8s linear infinite reverse; }
.orbit-dot { fill: var(--accent); transform-origin: 200px 200px; animation: spin 12s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Sections ---------- */
.section { padding: 112px 0; }
.section-alt { background: var(--bg-alt); }
.section-head { max-width: 680px; margin-bottom: 56px; }
.section-head h2 { font-size: clamp(32px, 4vw, 48px); }
.section-sub { margin-top: 16px; color: var(--muted); font-size: 18px; }
.section-head-row { max-width: none; display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; flex-wrap: wrap; }
.section-head-row > div:first-child { max-width: 640px; }

/* ---------- Steps ---------- */
.steps { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.step {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 24px;
  padding: 32px 0;
  border-bottom: 1px solid var(--line);
}
.step-num { font-size: 15px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 4px; }
.step h3 { font-size: 24px; margin-bottom: 8px; }
.step p { color: var(--muted); max-width: 640px; }
.step-time {
  display: inline-block;
  margin-top: 14px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}

.terms {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 48px;
  margin-top: 64px;
  padding: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.terms h3 { font-size: 24px; margin-bottom: 8px; }
.terms p { color: var(--muted); }
.terms-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.terms-list li { padding-left: 22px; position: relative; color: var(--muted); }
.terms-list li::before { content: ""; position: absolute; left: 0; top: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.terms-list strong { color: var(--text); }
.link-arrow { display: inline-block; margin-top: 20px; font-weight: 600; text-decoration: none; border-bottom: 1px solid currentColor; }
.link-arrow::after { content: " →"; }

/* ---------- Pricing ---------- */
.packages { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.package {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.package h3 { font-size: 20px; }
.package .price { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.package p:not(.price) { color: var(--muted); font-size: 15px; flex: 1; }
.package .btn { align-self: flex-start; }
.package-featured { border-color: var(--text); }
.badge {
  position: absolute; top: -11px; left: 24px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}
.fineprint { margin-top: 20px; font-size: 14px; color: var(--muted); }

/* ---------- Scenes ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filter {
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  font-size: 14px;
  color: var(--muted);
}
.filter.is-active { background: var(--text); border-color: var(--text); color: var(--bg); }

.scene-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.scene {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  text-align: left;
  padding: 0;
  transition: border-color 0.2s, transform 0.2s;
}
.scene:hover { transform: translateY(-2px); }
.scene.is-hidden { display: none; }
.scene.is-selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.scene-select {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
}
.scene-example {
  position: absolute;
  top: 10px; left: 10px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px 6px 10px;
  border: 0;
  border-radius: 999px;
  background: rgba(20, 20, 20, 0.82);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  backdrop-filter: blur(6px);
  transition: background-color 0.2s;
}
.scene-example:hover { background: var(--accent); }
.scene-example svg { width: 11px; height: 11px; fill: currentColor; }

/* Real example dialog */
.example-dialog {
  width: min(960px, 100% - 32px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  overflow: hidden;
}
.example-dialog::backdrop { background: rgba(10, 10, 10, 0.6); backdrop-filter: blur(4px); }
.example-dialog video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.dialog-head, .dialog-foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 22px; }
.dialog-head .eyebrow { margin-bottom: 4px; }
.dialog-head h3 { font-size: 22px; }
.dialog-close { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; background: transparent; font-size: 22px; line-height: 1; }
.dialog-caption { color: var(--muted); font-size: 15px; }
.dialog-tabs { display: flex; gap: 8px; margin-top: 10px; }
.dialog-tabs:empty { display: none; }
.dialog-tabs .is-active { background: var(--text); border-color: var(--text); color: var(--bg); }
@media (max-width: 600px) { .dialog-foot { flex-direction: column; align-items: flex-start; } }

.scene-preview { aspect-ratio: 16 / 9; background: var(--scene-bg); color: var(--scene-ink); display: block; }
.scene-preview svg, .scene-preview video { width: 100%; height: 100%; display: block; object-fit: cover; }
.scene-body { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 16px 18px 18px; }
.scene-body h3 { font-size: 16px; letter-spacing: -0.01em; }
.scene-body p { font-size: 14px; color: var(--muted); margin-top: 4px; }
.scene-check {
  flex: none;
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: grid; place-items: center;
  transition: background-color 0.2s, border-color 0.2s;
}
.scene-check svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.scene-check .tick { display: none; }
.scene.is-selected .scene-check { background: var(--accent); border-color: var(--accent); color: #fff; }
.scene.is-selected .scene-check .plus { display: none; }
.scene.is-selected .scene-check .tick { display: block; }

/* Scene preview animation helpers (shapes live in js/scenes.js) */
.scene-preview .ink { fill: currentColor; }
.scene-preview .stroke { fill: none; stroke: currentColor; stroke-width: 2; }
.scene-preview .acc { fill: var(--accent); }
.scene-preview .acc-stroke { fill: none; stroke: var(--accent); stroke-width: 2.5; }
.scene-preview .faint { opacity: 0.18; }
.scene-preview * { transform-box: fill-box; transform-origin: center; }

/* ---------- Order form ---------- */
.order-wrap { max-width: 860px; }
.order-form { display: grid; gap: 20px; }
fieldset {
  margin: 0;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
legend { float: left; width: 100%; padding: 0; margin-bottom: 18px; font-size: 20px; font-weight: 700; letter-spacing: -0.02em; display: flex; align-items: center; gap: 12px; }
legend + * { clear: both; }
.legend-num { width: 28px; height: 28px; border-radius: 50%; background: var(--text); color: var(--bg); display: grid; place-items: center; font-size: 14px; }
.hint { color: var(--muted); font-size: 15px; margin-bottom: 14px; }

.chosen { display: flex; flex-wrap: wrap; gap: 8px; }
.chosen-empty { color: var(--muted); font-size: 15px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 8px 7px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--text);
  font-size: 14px;
  border: 0;
}
.chip-x { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); font-size: 13px; line-height: 1; }

.type-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.type-card { position: relative; cursor: pointer; }
.type-card input { position: absolute; opacity: 0; pointer-events: none; }
.type-card span {
  display: flex; flex-direction: column;
  height: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: border-color 0.2s, background-color 0.2s;
}
.type-card small { color: var(--muted); font-size: 13px; }
.type-card input:checked + span { border-color: var(--accent); background: var(--accent-soft); }
.type-card input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.presets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.preset { padding: 8px 14px; border: 1px dashed var(--line); border-radius: 999px; background: transparent; font-size: 14px; }
.preset:hover, .preset.is-active { border-style: solid; border-color: var(--text); }

.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
.field input, .field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-weight: 400;
  font-size: 16px;
  transition: border-color 0.2s;
}
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--text); }
.field input.is-invalid { border-color: #d93025; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-footer { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; margin-top: 8px; }
.form-note { color: var(--muted); font-size: 14px; max-width: 360px; }
.form-error { color: #d93025; font-size: 15px; }

.form-success { padding: 40px; border: 1px solid var(--accent); border-radius: var(--radius); background: var(--surface); }
.form-success h3 { font-size: 28px; margin-bottom: 8px; }
.form-success p { color: var(--muted); }
.summary {
  margin: 24px 0;
  padding: 18px;
  border-radius: 10px;
  background: var(--bg-alt);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  white-space: pre-wrap;
  color: var(--text);
}

/* Sticky bar after selecting scenes */
.order-bar {
  position: fixed;
  left: 50%; bottom: 20px;
  z-index: 30;
  display: flex; align-items: center; gap: 16px;
  padding: 8px 8px 8px 20px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  transform: translateX(-50%);
  animation: rise 0.3s ease-out;
}
@keyframes rise { from { opacity: 0; transform: translate(-50%, 12px); } }

/* ---------- FAQ ---------- */
.faq-wrap { max-width: 860px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq details:first-child { border-top: 1px solid var(--line); }
.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 22px 40px 22px 0;
  font-size: 19px;
  font-weight: 600;
  position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 18px; font-size: 26px; font-weight: 400; color: var(--muted); transition: transform 0.2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 0 24px; color: var(--muted); max-width: 720px; }

/* ---------- Footer ---------- */
.site-footer { padding: 40px 0; border-top: 1px solid var(--line); font-size: 15px; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.site-footer a { text-decoration: none; color: var(--muted); }
.site-footer a:hover { color: var(--text); }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Contract page ---------- */
.doc { padding: 64px 0 112px; }
.doc .wrap { max-width: 760px; }
.doc h1 { font-size: clamp(32px, 4vw, 44px); margin-bottom: 12px; }
.doc h2 { font-size: 20px; margin: 40px 0 12px; }
.doc p, .doc li { color: var(--muted); }
.doc p + p { margin-top: 10px; }
.doc ol { padding-left: 20px; }
.doc .note { margin: 24px 0 8px; padding: 16px 20px; border-radius: 10px; background: var(--accent-soft); color: var(--text); font-size: 15px; }
.doc table { width: 100%; border-collapse: collapse; font-size: 15px; margin-top: 8px; }
.doc th, .doc td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.doc th { color: var(--text); }
.doc td { color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .nav { display: none; }
  .packages { grid-template-columns: repeat(2, 1fr); }
  .scene-grid { grid-template-columns: repeat(2, 1fr); }
  .terms { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 720px) {
  .hero { padding: 40px 0 64px; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-art { display: none; }
  .hero-facts { gap: 24px; }
  .section { padding: 80px 0; }
  .step { grid-template-columns: 1fr; gap: 8px; }
  .packages, .scene-grid, .field-grid { grid-template-columns: 1fr; }
  .type-options { grid-template-columns: 1fr 1fr; }
  .terms, fieldset { padding: 22px; }
  .header-actions .btn { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
