/* Draft D: feed. Mobile pattern of short-video apps: full-screen vertical
   video, title and one line over the video, a single pink pill button,
   actions on the right edge, tab bar with a raised center "+". The tool
   lives in a bottom sheet.
   Also: refs/oxi-instruments (black and grey, color from the content). */

:root {
  --bg: #0b0b10;
  --sheet: #17171f;
  --s1: rgba(255, 255, 255, 0.05);
  --s2: rgba(255, 255, 255, 0.09);
  --line: rgba(255, 255, 255, 0.1);
  --text: #f1f1f5;
  --text-2: rgba(241, 241, 245, 0.72);
  --text-3: rgba(241, 241, 245, 0.48);
  --pink: #ff2e79;
  --pink-press: #e3195f;
  --ok: #5ee08a;
  --top-h: 56px;
  --tab-h: 64px;
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --out: cubic-bezier(0.16, 1, 0.3, 1);
  --font: 'Archivo', ui-sans-serif, system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; color-scheme: dark; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 16px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
body.sheet-open { overflow: hidden; }
img, video { display: block; max-width: 100%; }
button { font: inherit; color: inherit; touch-action: manipulation; }
a { color: inherit; }
:focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -48px; padding: 8px 12px; background: #fff; color: #000; border-radius: 8px; z-index: 50; }
.skip:focus { top: 12px; }
.i-on, [aria-pressed="true"] > .i-off { display: none; }
[aria-pressed="true"] > .i-on { display: block; }

/* ---------- top bar ---------- */
.top { position: sticky; top: 0; z-index: 20; height: var(--top-h); display: flex; align-items: center; justify-content: space-between; padding: 0 14px; background: var(--bg); }
.brand { font: 800 20px/1 var(--font); font-stretch: 70%; letter-spacing: 0.01em; text-transform: uppercase; text-decoration: none; }
.signin { display: inline-flex; align-items: center; height: 40px; padding: 0 18px; border-radius: 999px; background: #fff; color: #111; font-weight: 700; text-decoration: none; transition: transform 120ms var(--ease); }
.signin:active { transform: scale(0.96); }

/* ---------- feed ---------- */
.layout { display: block; }
.rail-left, .rail-right { display: none; }
.slide { position: relative; overflow: hidden; background: #000; }
.slide video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slide::after { content: ""; position: absolute; inset: auto 0 0; height: 46%; background: linear-gradient(to top, rgba(11, 11, 16, 0.86), rgba(11, 11, 16, 0)); pointer-events: none; }
.meta { position: absolute; left: 16px; right: 76px; bottom: 18px; z-index: 2; display: grid; gap: 8px; justify-items: start; }
.kicker { margin: 0; padding: 4px 10px; border-radius: 6px; background: rgba(255, 255, 255, 0.16); font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.title { margin: 0; font: 800 44px/0.92 var(--font); font-stretch: 62%; letter-spacing: 0; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35); }
.meta p { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.4; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5); max-width: 34ch; }
.actions { position: absolute; right: 12px; bottom: 110px; z-index: 2; display: grid; gap: 12px; }
.act { width: 48px; height: 48px; border: 0; border-radius: 999px; display: grid; place-items: center; font-size: 22px; color: #fff; background: rgba(20, 20, 26, 0.55); text-decoration: none; cursor: pointer; transition: transform 120ms var(--ease); }
.act:active { transform: scale(0.92); }

.make {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 54px; padding: 0 24px; border: 3px solid #fff; border-radius: 999px; cursor: pointer; text-decoration: none;
  background: var(--pink); color: #fff; font: 800 20px/1 var(--font); font-stretch: 92%;
  transition: transform 120ms var(--ease), background-color 160ms var(--ease);
}
.make span { font-size: 14px; font-weight: 700; opacity: 0.92; }
.make:active { transform: scale(0.96); }
@media (hover: hover) { .make:hover { background: var(--pink-press); } }
.make:disabled { background: #3a3a46; border-color: #3a3a46; color: var(--text-3); cursor: not-allowed; transform: none; }
.make-full { width: 100%; margin-top: 16px; border: 0; }

/* ---------- info, FAQ, footer (after the feed) ---------- */
.info { padding: 40px 16px calc(var(--tab-h) + 40px); scroll-snap-align: start; }
.info h2 { margin: 0 0 12px; font: 800 40px/1 var(--font); font-stretch: 62%; }
.info details { border-bottom: 1px solid var(--line); }
.info summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 12px; padding: 16px 0; font-weight: 700; }
.info summary::-webkit-details-marker { display: none; }
.info summary::after { content: "+"; font-size: 22px; line-height: 1; color: var(--pink); }
.info details[open] summary::after { content: "\2212"; }
.info details p { margin: 0 0 16px; color: var(--text-2); }
.foot { margin-top: 32px; display: grid; gap: 10px; font-size: 14px; color: var(--text-3); }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.foot a { text-decoration: none; color: var(--text-2); }
.foot p { margin: 0; }

/* ---------- tab bar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; height: calc(var(--tab-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); display: grid; grid-template-columns: 1fr 96px 1fr; align-items: center;
  background: var(--bg); box-shadow: 0 -1px 0 var(--line);
}
.tab { display: grid; justify-items: center; gap: 2px; padding: 6px 0; border: 0; background: none; color: var(--text-3); font-size: 12.5px; font-weight: 700; text-decoration: none; cursor: pointer; }
.tab i { font-size: 24px; }
.tab.is-on { color: #fff; }
.tab-make { justify-self: center; width: 64px; height: 50px; border-radius: 16px; background: var(--pink); color: #fff; border: 3px solid #fff; transform: translateY(-10px); display: grid; place-items: center; transition: transform 120ms var(--ease); }
.tab-make i { font-size: 26px; }
.tab-make:active { transform: translateY(-10px) scale(0.94); }

/* ---------- sheet ---------- */
.scrim { position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, 0.55); opacity: 0; pointer-events: none; transition: opacity 220ms var(--ease); }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 31; max-height: 92svh; overflow-y: auto; overscroll-behavior: contain;
  padding: 10px 18px calc(22px + env(safe-area-inset-bottom)); border-radius: 24px 24px 0 0; background: var(--sheet);
  transform: translateY(104%); transition: transform 320ms var(--out); visibility: hidden;
}
body.sheet-open .scrim { opacity: 1; pointer-events: auto; }
body.sheet-open .sheet { transform: none; visibility: visible; }
@media (prefers-reduced-motion: reduce) { .sheet, .scrim { transition: none; } }
.grab { width: 40px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.22); margin: 0 auto 6px; }
.close { position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; border: 0; border-radius: 999px; display: grid; place-items: center; background: var(--s2); cursor: pointer; font-size: 18px; }
.s-title { margin: 8px 48px 14px 0; font: 800 30px/1 var(--font); font-stretch: 64%; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chips button { min-height: 42px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--s2); cursor: pointer; font-weight: 700; transition: transform 120ms var(--ease), background-color 160ms var(--ease); }
.chips button:active { transform: scale(0.96); }
.chips button[aria-pressed="true"] { background: #fff; color: #111; }

.drop { display: grid; grid-template-columns: 30px 1fr; gap: 12px; align-items: center; padding: 18px 16px; border-radius: 16px; border: 1.5px dashed rgba(255, 255, 255, 0.28); cursor: pointer; transition: border-color 160ms var(--ease), background-color 160ms var(--ease); }
.drop i { font-size: 30px; color: var(--pink); }
.drop b { display: block; font-size: 17px; }
.drop small { color: var(--text-3); }
.drop:hover, .drop[data-over="yes"], .drop:focus-within { border-color: var(--pink); background: var(--s1); }
.samples { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; color: var(--text-3); font-size: 14px; }
.sample { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 12px 4px 4px; border: 0; border-radius: 999px; background: var(--s2); cursor: pointer; font-weight: 600; font-size: 14px; }
.sample img { width: 30px; height: 30px; border-radius: 999px; object-fit: cover; }
.file-row { display: none; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; padding: 8px; border-radius: 16px; background: var(--s2); }
.file-row img { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; }
.file-meta { display: grid; min-width: 0; }
.file-meta b { overflow-wrap: anywhere; }
.file-meta small { color: var(--text-3); }
.status[data-ok="yes"] { color: var(--ok); font-weight: 700; }
.x { width: 40px; height: 40px; border: 0; border-radius: 999px; background: none; display: grid; place-items: center; cursor: pointer; color: var(--text-2); font-size: 18px; }
[data-photo="yes"] .drop, [data-photo="yes"] .samples { display: none; }
[data-photo="yes"] .file-row { display: grid; }
[data-style="classic"] .photo-block { display: none; }
.consent { display: flex; gap: 12px; align-items: flex-start; margin-top: 16px; font-size: 14px; color: var(--text-2); cursor: pointer; }
.consent input { width: 22px; height: 22px; margin: 0; accent-color: var(--pink); flex: none; }
.fine { margin: 10px 0 0; text-align: center; font-size: 13px; color: var(--text-3); }

.s-gen, .s-result, .done-copy { display: none; }
[data-state="generating"] .s-idle, [data-state="preview"] .s-idle, [data-state="unlocked"] .s-idle { display: none; }
[data-state="generating"] .s-gen { display: grid; justify-items: center; gap: 10px; padding: 36px 0 12px; text-align: center; }
[data-state="preview"] .s-result, [data-state="unlocked"] .s-result { display: block; }
[data-state="unlocked"] .paywall-copy { display: none; }
[data-state="unlocked"] .done-copy { display: block; }
.gen-pct { font: 800 96px/0.9 var(--font); font-stretch: 62%; font-variant-numeric: tabular-nums; }
.s-gen p { margin: 0; color: var(--text-2); }
.bar { width: 100%; height: 6px; border-radius: 999px; background: var(--s2); overflow: hidden; }
.bar-fill { height: 100%; background: var(--pink); transform-origin: left; transform: scaleX(0); }

.r-frame { position: relative; width: min(100%, 230px, 26svh); aspect-ratio: 9 / 16; margin: 6px auto 4px; border-radius: 18px; overflow: hidden; background: #000; }
.r-frame video { width: 100%; height: 100%; object-fit: cover; }
.r-frame .act-sm { position: absolute; right: 8px; bottom: 8px; width: 40px; height: 40px; font-size: 18px; }
.wm { position: absolute; inset: 0; display: none; place-items: center; pointer-events: none; font: 800 40px/1 var(--font); font-stretch: 70%; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255, 255, 255, 0.5); transform: rotate(-22deg); }
[data-state="preview"] .wm { display: grid; }
.locked { position: absolute; inset: 0; display: none; place-items: center; background: rgba(11, 11, 16, 0.55); }
[data-locked="yes"] .locked { display: grid; }
.ghost { padding: 10px 14px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, 0.92); color: #111; font-weight: 700; cursor: pointer; }
.done-copy .ghost { margin-top: 12px; background: var(--s2); color: var(--text); }
.packs { display: grid; gap: 8px; }
.pack { display: grid; grid-template-columns: 20px 1fr auto; gap: 12px; align-items: center; min-height: 52px; padding: 0 14px; border-radius: 14px; background: var(--s1); box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; }
.pack input { width: 18px; height: 18px; margin: 0; accent-color: var(--pink); }
.pack span { font-weight: 600; }
.pack em { font-style: normal; color: var(--text-3); font-size: 13px; margin-left: 4px; }
.pack b { font-variant-numeric: tabular-nums; }
.pack:has(input:checked) { background: var(--s2); box-shadow: inset 0 0 0 2px var(--pink); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.ghost-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 54px; padding: 0 20px; border: 0; border-radius: 999px; background: var(--s2); font-weight: 700; cursor: pointer; }

/* ---------- phones: the feed scrolls on its own, one video per swipe ----------
   The page itself never scrolls here, so the browser's toolbar can't resize
   the slides mid-swipe (that was what made swiping feel sticky). */
@media (max-width: 1023px) {
  html, body { height: 100%; overflow: hidden; }
  .top { position: fixed; left: 0; right: 0; top: 0; }
  .feed {
    position: fixed; left: 0; right: 0; top: var(--top-h);
    bottom: calc(var(--tab-h) + env(safe-area-inset-bottom));
    overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y;
    scroll-snap-type: y mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  .feed::-webkit-scrollbar { display: none; }
  .slide { height: 100%; min-height: 0; scroll-snap-align: start; scroll-snap-stop: always; }
  .info { scroll-snap-align: start; padding-bottom: 40px; }
}

/* ---------- desktop: the feed becomes a phone-width column with rails ---------- */
@media (min-width: 1024px) {
  html { scroll-snap-type: none; }
  .top { padding: 0 max(24px, calc((100% - 1280px) / 2)); }
  .layout { display: grid; grid-template-columns: 300px 440px 300px; gap: 48px; justify-content: center; padding: 16px 24px 48px; }
  .rail-left, .rail-right { display: block; position: sticky; top: calc(var(--top-h) + 16px); align-self: start; }
  .rail-title { margin: 24px 0 12px; font: 800 52px/0.95 var(--font); font-stretch: 62%; }
  .rail-left p { color: var(--text-2); margin: 0 0 20px; }
  .rail-left ol { margin: 0; padding-left: 20px; color: var(--text-2); display: grid; gap: 8px; }
  .rail-left b { color: var(--text); }
  .box { padding: 18px; border-radius: 18px; background: var(--s1); box-shadow: inset 0 0 0 1px var(--line); margin-top: 24px; }
  .box + .box { margin-top: 12px; }
  .box-label { margin: 0 0 10px; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
  .box p { margin: 0; color: var(--text-2); }
  .box dl { margin: 0; display: grid; }
  .box dl div { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); }
  .box dl div:last-child { border-bottom: 0; }
  .box dt { color: var(--text-2); }
  .box dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
  .slide { height: calc(100vh - var(--top-h) - 32px); max-height: 860px; border-radius: 22px; margin-bottom: 16px; }
  .info { padding: 32px 0 48px; }
  .tabbar { display: none; }
  .sheet { left: 50%; right: auto; bottom: auto; top: 50%; width: 460px; max-height: 88vh; border-radius: 24px; transform: translate(-50%, -46%); opacity: 0; transition: transform 260ms var(--out), opacity 200ms var(--ease); }
  body.sheet-open .sheet { transform: translate(-50%, -50%); opacity: 1; }
  .grab { display: none; }
}

/* "Link copied" note when a computer copies instead of opening a share sheet */
.toast {
  position: fixed; left: 50%; top: calc(var(--top-h) + 12px); z-index: 60;
  padding: 10px 16px; border-radius: 999px; background: #fff; color: var(--bg);
  font-weight: 700; font-size: 14px; white-space: nowrap; pointer-events: none;
  opacity: 0; transform: translate(-50%, -6px);
  transition: opacity 160ms var(--ease), transform 160ms var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }
