:root {
  --accent: #6d28d9;
  --accent-dark: #5b21b6;
  --ink: #111827;
  --muted: #4b5563;
  --line: #d1d5db;
  --soft: #f3f4f6;
  --bad: #b91c1c;
  --ok: #047857;
  --radius: 16px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  color: var(--ink);
  background: #fff;
  font: 17px/1.5 system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

main, .topbar, .footer { max-width: 640px; margin: 0 auto; padding: 0 16px; }
.topbar { padding-top: 14px; padding-bottom: 6px; }
.brand { font-weight: 800; color: var(--ink); text-decoration: none; font-size: 18px; }
/* On a hub trend page: the hub's name, then the trend page (a breadcrumb). */
.crumbs { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.crumbs .crumb-page { color: var(--muted); text-decoration: none; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.crumb-sep { color: var(--muted); }

h1 { font-size: 2.1rem; line-height: 1.1; margin: 8px 0; font-weight: 900; letter-spacing: -0.02em; }
h2 { font-size: 1.3rem; margin: 0 0 8px; }
p { margin: 0 0 12px; }
a { color: var(--accent-dark); }

.subtitle { font-size: 1.1rem; color: var(--muted); }
.hint { color: var(--muted); font-size: 0.95rem; }
.center { text-align: center; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.hero { display: flex; flex-direction: column; gap: 12px; padding: 8px 0 12px; }
.hero-media { display: flex; justify-content: center; }
.hero-video, .hero-placeholder {
  width: min(100%, 260px);
  aspect-ratio: 9 / 16;
  border-radius: var(--radius);
  background: var(--soft);
  object-fit: cover;
}
.hero-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(160deg, var(--accent), #db2777);
}

.card {
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: 16px;
  margin: 8px 0 24px;
  background: #fff;
}

.step[hidden], [hidden] { display: none !important; }
.step { display: flex; flex-direction: column; gap: 10px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 20px;
  border: 2px solid var(--accent);
  border-radius: 999px;
  background: #fff;
  color: var(--accent-dark);
  font: inherit;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-big { min-height: 56px; font-size: 1.1rem; width: 100%; }
.btn-ghost { border-color: var(--line); color: var(--ink); }
.btn-link { border: 0; background: none; text-decoration: underline; min-height: 44px; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.btn-row { display: flex; flex-direction: column; gap: 8px; }
:focus-visible { outline: 3px solid #f59e0b; outline-offset: 2px; }

.crop-wrap { display: flex; justify-content: center; }
#crop-canvas {
  width: min(100%, 270px);
  aspect-ratio: 9 / 16;
  height: auto;
  border-radius: 12px;
  background: #000;
  touch-action: none;
  cursor: grab;
}
.zoom-row { display: flex; align-items: center; gap: 12px; font-weight: 700; }
.zoom-row input { flex: 1; min-height: 44px; }

.spinner {
  width: 44px; height: 44px; margin: 8px auto;
  border: 5px solid var(--soft); border-top-color: var(--accent); border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
.busy-text { font-weight: 700; }
@keyframes spin { to { transform: rotate(360deg); } }

.notice { padding: 12px 14px; border-radius: 12px; background: #fef3c7; border: 2px solid #f59e0b; margin-bottom: 12px; }
.error { color: var(--bad); font-weight: 700; }
.tips { margin: 0; padding-left: 20px; }
.tips li { margin-bottom: 6px; }

.preview-box { position: relative; width: min(100%, 240px); aspect-ratio: 9 / 16; margin: 0 auto; overflow: hidden; border-radius: 12px; background: #000; }
/* The still is shown clear (the buyer checks the likeness) under the same watermark as the order page;
   a landscape still (a 16:9 clip) sits letterboxed in the phone-shaped box. */
.preview-box img { width: 100%; height: 100%; object-fit: contain; }
.preview-box .preview-mark { font-size: 1.8rem; }
#preview-note { margin-top: 6px; }

.tier-list { display: flex; flex-direction: column; gap: 8px; }
.tier {
  display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 14px;
  border: 2px solid var(--line); border-radius: 14px; cursor: pointer;
}
.tier input { width: 22px; height: 22px; accent-color: var(--accent); flex: none; }
.tier.selected { border-color: var(--accent); background: #f5f3ff; }
.tier-main { flex: 1; }
.tier-main strong { display: block; }
.tier-main span { color: var(--muted); font-size: 0.92rem; }
.tier-price { font-weight: 900; font-size: 1.15rem; }

.check { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; padding: 6px 0; cursor: pointer; }
.check input { width: 22px; height: 22px; margin-top: 2px; flex: none; accent-color: var(--accent); }
.consents { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 8px; }

.section { padding: 8px 0 16px; }
.steps { padding-left: 22px; }
.steps li { margin-bottom: 8px; }
details { border-bottom: 1px solid var(--line); padding: 10px 0; }
summary { font-weight: 700; cursor: pointer; min-height: 32px; }
.prose h2 { margin-top: 20px; }

.order-video { width: 100%; max-width: 320px; aspect-ratio: 9 / 16; border-radius: 12px; background: #000; display: block; margin: 0 auto 10px; }
.job { margin-bottom: 20px; }
.progress { height: 12px; border-radius: 999px; background: var(--soft); overflow: hidden; }
.progress > span { display: block; height: 100%; width: 40%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), #db2777); animation: slide 1.6s ease-in-out infinite alternate; }
@keyframes slide { from { margin-left: 0; } to { margin-left: 60%; } }
.eta { font-size: 1.4rem; font-weight: 900; text-align: center; }

.footer { padding-top: 24px; padding-bottom: 32px; color: var(--muted); font-size: 0.92rem; border-top: 1px solid var(--line); margin-top: 16px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 8px; }
.footer-links a { min-height: 32px; display: inline-flex; align-items: center; }

@media (min-width: 700px) {
  .hero { flex-direction: row; align-items: center; }
  .hero-text { flex: 1; }
  .btn-row { flex-direction: row; }
  .btn-big { width: auto; }
  .step > .btn-big, #pay { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .spinner, .progress > span { animation: none; }
  * { scroll-behavior: auto !important; transition: none !important; }
}

/* Hub: drifting wall of examples behind the headline, then the trend picker */
.stage {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  min-height: min(78vh, 600px);
  margin: 4px 0 20px;
  border-radius: 24px;
  background: #111827;
  isolation: isolate;
}
.stage-plain { min-height: 0; background: linear-gradient(160deg, var(--accent), #db2777); }
.stage::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.1) 0%, rgba(17, 24, 39, 0.45) 45%, rgba(17, 24, 39, 0.94) 100%);
}
.stage-text { position: relative; z-index: 1; padding: 28px 20px 22px; color: #fff; }
.stage-text h1 { color: #fff; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35); }
.stage-text .subtitle { color: #e5e7eb; }
.wall {
  position: absolute;
  inset: -12% -10%;
  z-index: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  transform: rotate(-7deg);
}
.wall-col { animation: drift-up 42s linear infinite; will-change: transform; }
.wall-col:nth-child(2) { animation-name: drift-down; animation-duration: 50s; }
.wall-col:nth-child(3) { animation-duration: 58s; }
/* Margins, not gap: the two halves of a column must be the same height for a seamless loop. */
.wall-tile { display: block; margin-bottom: 10px; aspect-ratio: 9 / 16; border-radius: 14px; overflow: hidden; background: linear-gradient(160deg, var(--accent), #db2777); }
.wall-clip, .trend-clip, .match-clip { display: block; width: 100%; height: 100%; object-fit: cover; }
.clip-empty { background: linear-gradient(160deg, var(--accent), #db2777); }
.wall.still .wall-col { animation: none; }
@keyframes drift-up { from { transform: translateY(0); } to { transform: translateY(-50%); } }
@keyframes drift-down { from { transform: translateY(-50%); } to { transform: translateY(0); } }

.trend-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.trend-card a { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: inherit; border-radius: var(--radius); }
.trend-media { position: relative; display: block; aspect-ratio: 9 / 16; border-radius: var(--radius); overflow: hidden; background: var(--soft); transition: transform 0.15s ease; }
.trend-card a:hover .trend-media, .trend-card a:focus-visible .trend-media { transform: translateY(-3px); }
.trend-badge {
  position: absolute; left: 8px; bottom: 8px;
  padding: 4px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.92); color: var(--ink);
  font-size: 0.8rem; font-weight: 800;
}
.trend-name { font-weight: 800; line-height: 1.25; margin-top: 4px; }
.trend-line { font-size: 0.9rem; color: var(--muted); line-height: 1.35; }
.trend-meta { font-size: 0.9rem; font-weight: 700; color: var(--accent-dark); }
.empty { padding: 24px; border: 2px dashed var(--line); border-radius: var(--radius); text-align: center; color: var(--muted); }

/* Trend page: the example in a phone frame, and the buyer's photo next to it after upload */
.phone { position: relative; width: min(100%, 260px); border: 6px solid var(--ink); border-radius: 28px; overflow: hidden; background: #000; }
.phone .hero-video { width: 100%; border-radius: 0; display: block; }
.phone-badge {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%);
  padding: 6px 14px; border-radius: 999px; white-space: nowrap;
  background: rgba(255, 255, 255, 0.94); color: var(--ink); font-weight: 800; font-size: 0.9rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}
.hero-cta { align-self: flex-start; }
.match { display: flex; align-items: center; justify-content: center; gap: 10px; }
.match figure { margin: 0; width: min(42%, 150px); text-align: center; }
.match .match-clip { aspect-ratio: 9 / 16; height: auto; border-radius: 12px; background: var(--soft); }
.match figcaption { font-size: 0.85rem; font-weight: 700; color: var(--muted); margin-top: 4px; }
.match-arrow { font-size: 1.6rem; font-weight: 900; color: var(--accent); }

@media (min-width: 700px) {
  .trend-list { grid-template-columns: repeat(3, 1fr); }
  .stage-text { padding: 36px 32px 30px; }
}

@media (prefers-reduced-motion: reduce) {
  .wall-col { animation: none; }
  .trend-media { transition: none; }
}

/* The original post: numbers, then the platform player after a tap */
.proof { font-size: 0.95rem; color: var(--muted); }
.proof strong { color: var(--ink); }
.proof a { margin-left: 4px; font-weight: 700; }
.original-stats { font-size: 1.25rem; margin-bottom: 2px; }
.original-meta { color: var(--muted); font-size: 0.9rem; }
.original-frame { display: flex; justify-content: center; margin: 8px 0 10px; }
.original-frame.playing { width: min(100%, 325px); aspect-ratio: 9 / 16; margin-left: auto; margin-right: auto; border-radius: var(--radius); overflow: hidden; background: #000; }
.original-frame iframe { width: 100%; height: 100%; border: 0; }
.trend-stats { font-size: 0.85rem; font-weight: 700; color: var(--ink); }

/* The trend in numbers: dated lower bounds from the copy-wave check */
.wave-stats { list-style: none; padding: 0; margin: 8px 0 10px; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.wave-stats li { background: var(--soft); border-radius: 12px; padding: 10px 12px; }
.wave-stats strong { display: block; font-size: 1.4rem; line-height: 1.2; }
.wave-stats span { color: var(--muted); font-size: 0.88rem; line-height: 1.35; }

/* First screen: the example is capped so the creator card starts above the fold on a phone */
.hero-video, .hero-placeholder { max-height: min(56vh, 520px); }
.hero-placeholder { width: min(100%, 260px, calc(min(56vh, 520px) * 9 / 16)); }
.hero-media .phone { width: min(100%, 260px, calc(min(56vh, 520px) * 9 / 16 + 12px)); }
.phone .hero-video { width: 100%; height: auto; max-height: none; }
.hero-cta { width: 100%; }
.trust { margin: 0; font-size: 0.88rem; line-height: 1.4; color: var(--muted); }
.cta-photo.is-disabled { opacity: 0.45; cursor: not-allowed; }
.btn:has(+ .visually-hidden:focus-visible) { outline: 3px solid #f59e0b; outline-offset: 2px; }

/* Photo tips: the marks are drawn in CSS */
.photo-tips { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.photo-tips li { position: relative; padding-left: 30px; min-height: 24px; font-size: 0.95rem; font-weight: 600; }
.photo-tips li::before, .photo-tips li::after { content: ''; position: absolute; box-sizing: border-box; }
.tip-yes::before { left: 8px; top: 3px; width: 7px; height: 13px; border: solid var(--ok); border-width: 0 3px 3px 0; transform: rotate(45deg); }
.tip-no::before, .tip-no::after { left: 5px; top: 9px; width: 14px; height: 3px; border-radius: 2px; background: var(--bad); }
.tip-no::before { transform: rotate(45deg); }
.tip-no::after { transform: rotate(-45deg); }

/* Order page: post it */
.post-it h3 { margin-bottom: 4px; }
.post-steps { margin: 0 0 12px; padding-left: 22px; }
.post-steps li { margin-bottom: 4px; }

/* Bottom bar on phones, shown by app.js once the hero button scrolls away */
.sticky-cta { display: none; }
@media (max-width: 639px) {
  .hero h1 { font-size: 1.75rem; }
  .hero .subtitle { font-size: 1rem; margin-bottom: 4px; }
  .hero { gap: 8px; }
  .sticky-cta {
    display: block;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid var(--line);
    box-shadow: 0 -4px 16px rgba(17, 24, 39, 0.12);
    transform: translateY(100%);
    visibility: hidden;
    transition: transform 0.2s ease, visibility 0.2s;
  }
  .sticky-cta.on { transform: none; visibility: visible; }
  .sticky-cta .btn { width: 100%; }
  .footer { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
}
@media (min-width: 700px) {
  .hero-cta { width: auto; }
}

/* Order page preview: the watermark sits over the player until the buyer keeps the video */
.preview-wrap { position: relative; }
.preview-mark {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none;
  font-size: clamp(2rem, 12vw, 4rem); font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55); text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45); transform: rotate(-24deg);
}
.keep .hint { margin-top: 6px; }
.example-note { margin: 6px 0 0; font-size: 0.82rem; color: var(--muted); text-align: center; }

/* Why make it here: short promises with a check mark, the redo-then-refund line under the pay button. */
.why-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.why-list li { position: relative; padding-left: 30px; }
.why-list li::before { content: "\2713"; position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 0.8rem; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.why-list strong { display: block; }
.promise { font-weight: 700; color: var(--ink); margin-bottom: 0; }

/* More trends: the hub's other trend pages under the FAQ, and the way back to the hub. */
.more-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.more-list li { background: var(--soft); border-radius: 12px; padding: 10px 12px; }
.more-list a { font-weight: 800; display: block; }
.more-list span { color: var(--muted); font-size: 0.92rem; }
