/* Home page: start a dub and see every past one, with the past dubs on a
   curved, moving row of stills. Same "Glass" look as the Studio, in light and dark; index.html sets data-theme
   before the page draws and the header button switches it (app.js), shared with the Studio. */

/* The Studio's colour tokens, copied from editor.css until both pages link one shared tokens file (the Studio session
   moves them once its own edits to editor.css are in). */
:root{
  color-scheme:light;
  --bg:#E2E8F6;
  --backdrop:radial-gradient(1100px 700px at 8% -12%,#EFE6FF 0%,transparent 60%),radial-gradient(1000px 760px at 100% -8%,#D9E7FF 0%,transparent 58%),radial-gradient(900px 600px at 55% 115%,#E6E2FF 0%,transparent 60%);
  --chrome:rgba(244,247,255,.72);--panel:rgba(255,255,255,.72);--panel-solid:#F7F9FE;--work:rgba(255,255,255,.9);--sheet:#FFFFFF;
  --input:#FFFFFF;--btn:#FFFFFF;--btn-hover:#F1F4FB;--fill:rgba(118,118,128,.12);--raised:#FFFFFF;--selected:rgba(46,102,253,.10);
  --line:rgba(37,48,77,.12);--edge:rgba(255,255,255,.75);--ink:#0A0B12;--muted:#5F6A86;
  --accent:#2E66FD;--onaccent:#FFFFFF;--focus:#5580FB;--human:#0E7F5A;--warn:#AF5300;--warnbg:rgba(255,149,0,.13);--bad:#D70015;--onbad:#FFFFFF;
  --shadow:0 2px 4px rgba(37,48,77,.07),0 10px 28px rgba(37,48,77,.13);
  --shadow-work:0 4px 8px rgba(37,48,77,.08),0 18px 40px rgba(37,48,77,.18);
  --shadow-btn:0 1px 1.5px rgba(37,48,77,.10);
  --radius:9px;--radius-card:16px;
  --sans:-apple-system,BlinkMacSystemFont,'SF Pro Text',system-ui,sans-serif;--mono:ui-monospace,'SF Mono',Menlo,Consolas,monospace;
  --hindi:'Noto Sans Devanagari',sans-serif;
}
:root[data-theme=dark]{
  color-scheme:dark;
  --bg:#000000;
  --backdrop:radial-gradient(1000px 640px at 15% -15%,rgba(32,145,252,.10) 0%,transparent 60%),radial-gradient(900px 600px at 100% 110%,rgba(120,90,255,.06) 0%,transparent 60%);
  --chrome:rgba(13,14,16,.78);--panel:rgba(20,21,23,.84);--panel-solid:#141517;--work:rgba(27,29,32,.94);--sheet:#1C1D20;
  --input:#0F1215;--btn:#202226;--btn-hover:#2A2D32;--fill:rgba(118,118,128,.24);--raised:#3A3C41;--selected:rgba(32,145,252,.17);
  --line:rgba(255,255,255,.08);--edge:rgba(255,255,255,.07);--ink:#FFFFFF;--muted:#A9B3BD;
  --accent:#2091FC;--onaccent:#000000;--focus:#31ADF9;--human:#67FCA2;--warn:#FEC345;--warnbg:rgba(254,195,69,.14);--bad:#FF6961;--onbad:#000000;
  --shadow:0 2px 5px rgba(0,0,0,.45),0 12px 28px rgba(0,0,0,.65),inset 0 .5px 0 rgba(255,255,255,.10);
  --shadow-work:0 3px 8px rgba(0,0,0,.5),0 18px 40px rgba(0,0,0,.75),inset 0 .5px 0 rgba(255,255,255,.12);
  --shadow-btn:none;
}

/* ── page ── */
*{box-sizing:border-box}
html,body{margin:0}
body{min-height:100vh;min-height:100dvh;display:grid;grid-template-rows:auto 1fr;background:var(--backdrop),var(--bg);background-attachment:fixed;color:var(--ink);font:14px/1.5 var(--sans);-webkit-font-smoothing:antialiased}
button,input,select,textarea{font:inherit;color:inherit}
:focus-visible{outline:3px solid color-mix(in srgb,var(--focus) 45%,transparent);outline-offset:2px}
[hidden]{display:none!important}
h1,h2,p{margin:0}
.muted{color:var(--muted)}
.grow{flex:1;min-width:0}
svg{fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
button{cursor:pointer}
button:disabled{cursor:default}

.top{display:flex;align-items:center;justify-content:space-between;padding:14px 32px}
/* The page fits one screen: the card takes what it needs and the row of dubs the rest. Grid rows,
   not flex: a grid area gives the row a definite height, which its tiles' container units measure against (in a
   column flexbox Chrome hands them 0). */
main{display:grid;grid-template-rows:auto 1fr}
.brand{display:inline-flex;align-items:center;gap:10px;font-size:20px;font-weight:600;letter-spacing:-.02em}
.brand .logo{height:28px;width:auto;flex-shrink:0}
.themebtn{width:36px;height:36px;padding:0;border-radius:50%;border:1px solid var(--line);background:var(--btn);box-shadow:var(--shadow-btn);display:inline-flex;align-items:center;justify-content:center;transition:background-color .15s}
.themebtn:hover{background:var(--btn-hover)}
/* signed in: free minutes left, and the account menu (its initial, the email, Sign out) */
.topend{display:flex;align-items:center;gap:10px}
.minutes{display:inline-flex;align-items:center;height:32px;padding:0 12px;border-radius:999px;background:var(--selected);color:var(--accent);font-size:13px;font-weight:600;font-variant-numeric:tabular-nums;white-space:nowrap}
.acct{position:relative}
.acct summary{display:block;list-style:none;cursor:pointer;border-radius:50%}
.acct summary::-webkit-details-marker{display:none}
.acct summary:focus-visible{outline:2px solid var(--focus);outline-offset:2px}
.initial{display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;border-radius:50%;background:var(--accent);color:var(--onaccent);font-size:15px;font-weight:600;transition:transform .1s ease-out}
.acct summary:active .initial{transform:scale(.94)}
.acctmenu{position:absolute;right:0;top:calc(100% + 8px);z-index:20;min-width:220px;padding:6px;border:1px solid var(--edge);border-radius:14px;background:var(--sheet);box-shadow:var(--shadow-work);transform-origin:top right;animation:menuin .16s ease-out}
@keyframes menuin{from{opacity:0;transform:translateY(-4px) scale(.97)}}
.acctemail{margin:0;padding:8px 10px 10px;border-bottom:1px solid var(--line);color:var(--muted);font-size:12.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.acctmenu form{margin:0}
.acctmenu button{display:block;width:100%;height:34px;margin-top:6px;padding:0 10px;border:0;border-radius:8px;background:transparent;color:var(--ink);font:inherit;text-align:left;cursor:pointer;transition:background-color .12s}
.acctmenu button:hover{background:var(--fill)}
@media (prefers-reduced-motion:reduce){.acctmenu{animation:none}}
.themebtn svg{width:17px;height:17px}
:root[data-theme=dark] .themebtn .moon,:root:not([data-theme=dark]) .themebtn .sun{display:none}

/* ── new dub ── */
.card{background:var(--panel);border:1px solid var(--edge);border-radius:var(--radius-card);box-shadow:var(--shadow);-webkit-backdrop-filter:blur(24px) saturate(1.4);backdrop-filter:blur(24px) saturate(1.4)}
.newdub{width:min(960px,calc(100% - 32px));margin:0 auto;padding:24px 28px;display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);gap:28px}
.pick{display:flex;flex-direction:column}
.head{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px 16px;margin-bottom:14px}
h1{font-size:26px;font-weight:600;letter-spacing:-.02em}

.tabs{display:inline-flex;gap:2px;padding:2px;border-radius:var(--radius);background:var(--fill)}
.tabs button{border:0;background:transparent;border-radius:7px;padding:6px 26px;color:var(--muted);transition:background-color .15s,color .15s}
.tabs button[aria-selected=true]{background:var(--raised);color:var(--accent);font-weight:500;box-shadow:var(--shadow-btn)}

.drop{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-height:150px;padding:24px;border:1.5px dashed color-mix(in srgb,var(--muted) 45%,transparent);border-radius:12px;cursor:pointer;transition:border-color .15s,background-color .15s}
.drop:hover,.drop.over{border-color:var(--accent);background:var(--selected)}
.drop .filmicon{width:44px;height:44px;color:var(--muted);stroke-width:1.5;margin-bottom:6px}
.drop strong{font-size:16px;font-weight:600}
.link{border:0;background:none;padding:0;color:var(--accent)}
.link:hover{text-decoration:underline}

.linkrow{display:flex;gap:8px}
.pick .linkrow,.pick .chosen{margin:auto 0}   /* centred in the space the drop zone fills */
.linkrow input,.who textarea{flex:1;min-width:0;border:1px solid var(--line);border-radius:var(--radius);background:var(--input);padding:10px 12px}
.linkrow button{border:1px solid var(--line);border-radius:var(--radius);background:var(--btn);box-shadow:var(--shadow-btn);padding:0 18px;font-weight:500}
.linkrow button:hover:not(:disabled){background:var(--btn-hover)}

.chosen{display:flex;align-items:center;gap:12px;padding:12px 14px;border:1px solid var(--line);border-radius:12px;background:var(--input)}
.chosen .filmicon{width:28px;height:28px;color:var(--accent);flex:none}
.chosen .name{font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chosen .meta{font:12px/1.4 var(--mono);font-variant-numeric:tabular-nums;color:var(--muted)}
.remove{width:30px;height:30px;padding:0;border:0;border-radius:50%;background:transparent;color:var(--muted);display:inline-flex;align-items:center;justify-content:center}
.remove:hover{background:var(--fill);color:var(--ink)}
.remove svg{width:16px;height:16px}

.langs{display:grid;grid-template-columns:1fr auto 1fr;align-items:end;gap:12px;margin-bottom:12px}
.lang{display:flex;flex-direction:column;gap:5px}
.lang .label{font-size:12px;font-weight:500;color:var(--muted)}
.select{position:relative;display:block}
.select select{appearance:none;-webkit-appearance:none;width:100%;height:40px;padding:0 36px 0 12px;border:1px solid var(--line);border-radius:var(--radius);background:var(--input);box-shadow:var(--shadow-btn);cursor:pointer;font-family:var(--sans),var(--hindi)}
.select::after{content:"";position:absolute;right:15px;top:15px;width:7px;height:7px;border-right:1.8px solid var(--muted);border-bottom:1.8px solid var(--muted);transform:rotate(45deg);pointer-events:none}
.arrow{width:20px;height:40px;color:var(--muted)}

.more{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:-2px 0 12px}
.more-label{font-size:12px;font-weight:500;color:var(--muted);margin-right:2px}
.chips{display:contents}
.chip{display:inline-flex;align-items:center;gap:6px;height:30px;padding:0 8px 0 12px;border:1px solid var(--line);border-radius:999px;background:var(--btn);box-shadow:var(--shadow-btn);cursor:pointer;font-size:13px}
.chip svg{width:12px;height:12px;stroke:var(--muted);stroke-width:2.2;fill:none}
.chip:hover{background:var(--btn-hover)}
.addlang select{appearance:none;-webkit-appearance:none;height:30px;padding:0 12px;border:1px dashed color-mix(in srgb,var(--accent) 55%,transparent);border-radius:999px;background:transparent;color:var(--accent);font-size:13px;font-weight:500;cursor:pointer}
.addlang select:hover{background:var(--selected)}
.who{border:1px solid var(--line);border-radius:12px;background:color-mix(in srgb,var(--input) 55%,transparent)}
.who summary{list-style:none;display:flex;align-items:center;gap:6px;padding:11px 14px;cursor:pointer}
.who summary::-webkit-details-marker{display:none}
.who summary::after{content:"";width:6px;height:6px;margin-left:2px;border-right:1.6px solid var(--muted);border-bottom:1.6px solid var(--muted);transform:rotate(-45deg);transition:transform .15s}
.who[open] summary::after{transform:rotate(45deg)}
.who textarea{display:block;width:calc(100% - 28px);margin:0 14px 14px;resize:vertical;line-height:1.5}

.start{display:block;width:100%;height:46px;margin-top:12px;border:0;border-radius:11px;background:var(--accent);color:var(--onaccent);font-size:16px;font-weight:600;transition:filter .15s,transform .1s}
.start:hover:not(:disabled){filter:brightness(1.07)}
.start:active:not(:disabled){transform:scale(.99)}
.start:disabled{opacity:.45}
.hint{margin-top:8px;text-align:center;font-size:13px;color:var(--muted)}
.error{margin-top:10px;text-align:center;font-size:13px;color:var(--bad)}
.cost{margin:14px 0 0;color:var(--muted);font-size:13px;text-align:center;font-variant-numeric:tabular-nums;text-wrap:pretty}
.plans-link{color:var(--accent);font-weight:600;text-decoration:underline;text-underline-offset:2px;margin-left:2px}
.minutes .plans-link{text-decoration:none;margin-left:6px;padding-left:8px;border-left:1px solid var(--line)}
.cost.short{color:var(--warn)}
.cost+.start{margin-top:8px}

/* ── your dubs ── */
.dubs{display:grid;grid-template-rows:auto 1fr;margin-top:16px;padding-bottom:12px}
.dubs-top,.empty{width:min(960px,calc(100% - 32px));margin-left:auto;margin-right:auto}
.dubs-top{display:flex;align-items:baseline;justify-content:space-between;flex-wrap:wrap;gap:0 16px}
.fold{display:inline-flex;align-items:center;gap:6px;border:0;background:none;padding:2px 0;font-size:24px;font-weight:600;letter-spacing:-.02em}
.fold .count{color:var(--muted);font-weight:500}
.fold svg{width:20px;height:20px;color:var(--muted);transition:transform .2s}
.fold[aria-expanded=false] svg{transform:rotate(-90deg)}
.dubs-hint{font-size:13px}
.dubs:has(.fold[aria-expanded=false]) .dubs-hint{display:none}
.empty{margin-top:12px}

/* The row (reel.js) sizes its tiles from its own height, which is whatever the screen has left; colours on a still are
   fixed, since a picture is dark in either theme. Sideways drags and scrolls are the row's (reel.js moves it), up and
   down still scroll the page. */
.reel{position:relative;min-height:240px;max-height:560px;overflow:hidden;touch-action:pan-y pinch-zoom;overscroll-behavior-x:contain;-webkit-user-select:none;user-select:none;cursor:grab}
.reel.none{display:none}
.reel.dragging,.reel.dragging .tile{cursor:grabbing}
.reel .band{position:absolute;inset:0;opacity:0;transition:opacity .5s}
.reel .band.on{opacity:1}
.tile{position:absolute;display:block;transform-style:preserve-3d;color:#fff;text-decoration:none;-webkit-user-drag:none}
.strip{position:absolute;top:0;overflow:hidden;background:#1B2130}
.strip.first{border-radius:.8em 0 0 .8em}
.strip.last{border-radius:0 .8em .8em 0}
.face{position:absolute;top:0;background:radial-gradient(120% 90% at 30% 20%,#2C3550 0%,#141824 70%)}
.face img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;transition:filter .2s}
.nostill{position:absolute;left:50%;top:38%;width:22%;height:auto;transform:translate(-50%,-50%);color:rgba(255,255,255,.22);stroke-width:1.2}
.tile:hover .face img{filter:brightness(1.12)}
.tile:focus-visible{outline:none}
.tile:focus-visible .face{outline:.2em solid var(--focus);outline-offset:-.2em}
.shade{position:absolute;inset:auto 0 0;height:60%;background:linear-gradient(transparent,rgba(0,0,0,.78))}
.cap{position:absolute;left:5%;right:5%;bottom:7%;display:flex;align-items:flex-end;justify-content:space-between;gap:.6em}
.cap .title{font-weight:600;line-height:1.25;text-shadow:0 1px 3px rgba(0,0,0,.5);overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.pill{flex:none;font-size:.8em;font-weight:600;line-height:1;padding:.4em .75em;border-radius:99px;white-space:nowrap;color:#fff;background:rgba(255,255,255,.2)}
.pill.ok{background:rgba(48,209,88,.85);color:#04210E}
.pill.warn{background:rgba(255,159,10,.9);color:#2B1700}
.pill.bad{background:rgba(255,69,58,.9)}
.pill.run{background:rgba(10,132,255,.9)}
.pill.you{background:rgba(191,90,242,.9)}

@media (max-width:820px){
  .newdub{grid-template-columns:minmax(0,1fr);gap:16px}
  .drop{min-height:130px}
}
@media (max-width:640px){
  .top{padding:12px 16px}
  .newdub{padding:22px 18px}
  .langs{grid-template-columns:1fr;gap:10px}
  .arrow{display:none}
}
