/*
  ReelYank — clean & minimal
  White page, one centred column, the paste box is the whole hero.
  One typeface (Geist), near-black actions, colour only for platform dots and status.
*/
:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --soft: #f6f6f7;
  --ink: #18181b;
  --muted: #71717a;
  --faint: #a1a1aa;
  --line: #e7e7ea;
  --btn: #18181b;
  --btn-ink: #ffffff;
  --ok: #16a34a;
  --err: #dc2626;
  --font: 'Geist', 'Noto Sans Sinhala', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0c0c0e;
  --surface: #151518;
  --soft: #1c1c20;
  --ink: #f4f4f5;
  --muted: #a1a1aa;
  --faint: #71717a;
  --line: #2a2a30;
  --btn: #f4f4f5;
  --btn-ink: #0c0c0e;
  color-scheme: dark;
}

* { box-sizing: border-box; min-width: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.6 var(--font); -webkit-font-smoothing: antialiased; overflow-x: clip; }
html[lang="si"] body { line-height: 1.75; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 8px; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.wrap { width: min(720px, 100% - 40px); margin-inline: auto; }

/* ── Header ── */
.top { position: static; }
.top-row { width: min(1120px, 100% - 40px); margin-inline: auto; display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; font-weight: 600; font-size: 1.05rem; letter-spacing: -.01em; }
.brand img { border-radius: 7px; }
.top-nav { display: flex; align-items: center; gap: 4px; }
.top-nav a { text-decoration: none; color: var(--muted); font-size: .94rem; padding: 8px 12px; border-radius: 8px; }
.top-nav a:hover { color: var(--ink); }
.pill { display: grid; place-items: center; min-width: 40px; height: 40px; padding: 0 10px; border: 0; background: transparent; border-radius: 10px; color: var(--muted); font-size: .92rem; font-weight: 500; cursor: pointer; }
.pill:hover { background: var(--soft); color: var(--ink); }
@media (max-width: 560px) { .top-nav a { display: none; } }

/* ── Hero: just the tool ── */
.hero { padding: clamp(48px, 12vh, 128px) 0 28px; text-align: center; }
h1 { font-size: clamp(2.2rem, 5.5vw, 3.4rem); line-height: 1.08; font-weight: 600; letter-spacing: -.035em; margin: 0 auto 14px; text-wrap: balance; }
html[lang="si"] h1 { letter-spacing: 0; line-height: 1.3; }
.lede { color: var(--muted); font-size: 1.08rem; max-width: 46ch; margin: 0 auto 36px; text-wrap: balance; }

.deck { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 32px -12px rgba(0, 0, 0, .12); text-align: left; transition: border-color .15s, box-shadow .15s; }
.deck:focus-within { border-color: var(--faint); box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 12px 40px -12px rgba(0, 0, 0, .18); }
.slot { flex: 1; display: flex; align-items: center; gap: 10px; }
.plat { width: 22px; height: 22px; flex: none; border-radius: 6px; display: grid; place-items: center; color: var(--faint); font: 700 .6rem/1 var(--font); }
.plat:empty::before { content: ''; width: 18px; height: 18px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M10 14a4 4 0 0 0 5.7 0l3-3a4 4 0 0 0-5.7-5.7l-1 1M14 10a4 4 0 0 0-5.7 0l-3 3a4 4 0 0 0 5.7 5.7l1-1' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M10 14a4 4 0 0 0 5.7 0l3-3a4 4 0 0 0-5.7-5.7l-1 1M14 10a4 4 0 0 0-5.7 0l-3 3a4 4 0 0 0 5.7 5.7l1-1' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center/contain no-repeat; }
.plat[class*="p-"] { color: #fff; }
#url { flex: 1; display: block; box-sizing: border-box; resize: none; border: 0; outline: 0; background: transparent; color: var(--ink); font: 400 1.05rem/1.4 var(--font); padding: 13px 0; min-height: 50px; max-height: 160px; overflow-y: hidden; -webkit-appearance: none; appearance: none; border-radius: 0; }
#url::placeholder { line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#url::placeholder { color: var(--faint); }
.slot-btn { flex: none; display: grid; place-items: center; min-height: 40px; border: 0; background: transparent; color: var(--muted); font-weight: 500; font-size: .94rem; padding: 0 12px; border-radius: 10px; cursor: pointer; }
.slot-btn:hover { background: var(--soft); color: var(--ink); }
.go { position: relative; flex: none; min-height: 50px; padding: 0 24px; border: 0; border-radius: 12px; background: var(--btn); color: var(--btn-ink); font-weight: 600; font-size: 1rem; cursor: pointer; transition: opacity .15s; }
.go:hover { opacity: .88; }
.go:active { transform: scale(.98); }
.go .spinner { display: none; }
.go.loading .btn-label { visibility: hidden; }
.go.loading .spinner { display: block; position: absolute; inset: 0; margin: auto; border-color: color-mix(in srgb, var(--btn-ink) 30%, transparent); border-top-color: var(--btn-ink); }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--ink); animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 560px) {
  .deck { flex-direction: column; align-items: stretch; padding: 8px; }
  .slot { padding-left: 10px; }
  .go { width: 100%; }
}

.hint { margin: 14px 0 0; font-size: .88rem; color: var(--faint); }
.works { margin-top: 40px; font-size: .88rem; color: var(--muted); }
.works > span { display: block; margin-bottom: 10px; color: var(--faint); }
.works ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; }
.works li { display: flex; align-items: center; gap: 7px; }
.works li i { width: 7px; height: 7px; border-radius: 50%; }

/* platform colours — dots and tiny badges only */
.p-youtube { background: #ff0033 !important; } .p-tiktok { background: #18181b !important; } .p-facebook { background: #1877f2 !important; }
.p-instagram { background: #e1306c !important; } .p-linkedin { background: #0a66c2 !important; } .p-twitter { background: #52525b !important; }
.p-reddit { background: #ff4500 !important; } .p-vimeo { background: #1ab7ea !important; } .p-pinterest { background: #e60023 !important; }
.p-threads { background: #71717a !important; } .p-snapchat { background: #f5d90a !important; color: #111 !important; } .p-twitch { background: #9146ff !important; }
.p-dailymotion { background: #0066dc !important; } .p-soundcloud { background: #ff5500 !important; } .p-bilibili { background: #00a1d6 !important; }
:root[data-theme="dark"] .p-tiktok { background: #e4e4e7 !important; color: #111 !important; }

/* ── Results ── */
.results { display: grid; gap: 16px; padding-top: 12px; }
.card { display: block; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; }
.head { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 20px; align-items: start; margin-bottom: 14px; }
@media (max-width: 560px) { .card { padding: 16px; } .head { grid-template-columns: 112px minmax(0, 1fr); gap: 14px; } }
.media { position: relative; display: block; width: 100%; padding: 0; border: 0; aspect-ratio: 16 / 10; background: var(--soft); border-radius: 12px; overflow: hidden; }
button.media { cursor: pointer; }
.media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: filter .15s; }
.media .dur { position: absolute; right: 6px; bottom: 6px; background: rgba(0, 0, 0, .72); color: #fff; font-size: .72rem; font-weight: 500; padding: 2px 6px; border-radius: 5px; font-variant-numeric: tabular-nums; }
.media .dur:empty { display: none; }
.media .src { display: none; }
.play { position: absolute; inset: 0; margin: auto; width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 255, 255, .92); box-shadow: 0 4px 14px rgba(0, 0, 0, .25); transition: transform .15s; }
.play::after { content: ''; position: absolute; left: 17px; top: 13px; border-style: solid; border-width: 9px 0 9px 14px; border-color: transparent transparent transparent #18181b; }
button.media:hover .play { transform: scale(1.08); }
button.media:hover img, .media.on img { filter: brightness(.8); }
.media.on .play { opacity: 0; }
.watch { margin-top: 10px; display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px; border: 1px solid var(--line); background: var(--surface); border-radius: 9px; font-size: .88rem; font-weight: 500; cursor: pointer; }
.watch::before { content: ''; border-style: solid; border-width: 5px 0 5px 8px; border-color: transparent transparent transparent currentColor; }
.watch:hover { background: var(--soft); }
.watch.on::before { width: 9px; height: 10px; border-width: 0 3px; border-color: currentColor; }
.player { margin: 4px 0 16px; background: #000; border-radius: 12px; overflow: hidden; }
.player video { display: block; width: 100%; max-height: min(70vh, 560px); background: #000; }
.player-msg { margin: 0; padding: 28px 20px; color: #d4d4d8; font-size: .94rem; text-align: center; }
.body { min-width: 0; }
.ttl { font-size: 1.05rem; font-weight: 600; line-height: 1.35; margin: 2px 0 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta { margin: 0 0 16px; color: var(--muted); font-size: .9rem; display: flex; flex-wrap: wrap; gap: 2px 14px; }

.seg { display: flex; gap: 20px; border-bottom: 1px solid var(--line); margin-bottom: 4px; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { border: 0; background: none; padding: 8px 0 10px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--muted); font-size: .92rem; font-weight: 500; cursor: pointer; white-space: nowrap; }
.seg button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }

.rows { list-style: none; margin: 0; padding: 0; }
.row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.q { font-weight: 500; font-size: .98rem; display: flex; align-items: center; gap: 8px; }
.tag { font-size: .7rem; font-weight: 500; padding: 1px 6px; border-radius: 5px; background: var(--soft); color: var(--muted); border: 1px solid var(--line); }
.q-sub { color: var(--faint); font-size: .85rem; font-variant-numeric: tabular-nums; }
.dl { min-height: 36px; padding: 0 14px; border: 1px solid var(--line); background: var(--surface); border-radius: 9px; font-weight: 500; font-size: .88rem; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s; }
.dl:hover { background: var(--btn); color: var(--btn-ink); border-color: var(--btn); }
.dl:disabled { opacity: .35; cursor: not-allowed; background: var(--surface); color: var(--ink); border-color: var(--line); }
.row.active .dl { display: none; }

.prog { grid-column: 1 / -1; display: grid; gap: 7px; padding-top: 2px; }
.prog-top { display: flex; justify-content: space-between; gap: 10px; font-size: .86rem; }
.prog-top b { font-weight: 500; }
.prog-top span { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar { height: 4px; background: var(--soft); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--ink); border-radius: inherit; transition: width .3s ease; }
.prog.wait .bar i { width: 28% !important; animation: slide 1.1s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(360%); } }
.prog.ok .bar i { background: var(--ok); }
.prog.ok b { color: var(--ok); }
.save-row { display: flex; flex-wrap: wrap; gap: 8px; }
button.save { border: 0; cursor: pointer; font-family: inherit; }
button.save:disabled { opacity: .6; cursor: progress; }
.save.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.prog.bad b { color: var(--err); font-weight: 500; }
.save { justify-self: start; display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 10px; background: var(--btn); color: var(--btn-ink); font-weight: 500; font-size: .92rem; text-decoration: none; }

.card.err { display: grid; }
.card.soon { display: grid; border-style: dashed; }
.card.soon h3 { margin: 0 0 4px; font-size: 1rem; font-weight: 600; }
.card.soon p { margin: 0 0 6px; color: var(--muted); font-size: .94rem; }
.card.soon code { display: block; font: .82rem/1.4 var(--font); color: var(--faint); overflow-wrap: anywhere; }
.card.err h3 { margin: 0 0 4px; font-size: 1rem; font-weight: 600; }
.card.err p { margin: 0 0 6px; color: var(--muted); font-size: .94rem; }
.card.err code { display: block; font: .82rem/1.4 var(--font); color: var(--faint); overflow-wrap: anywhere; margin-bottom: 6px; }
.text-btn { border: 0; background: none; padding: 6px 0; font-weight: 500; font-size: .92rem; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; justify-self: start; }

.sk { background: linear-gradient(90deg, var(--soft), var(--line), var(--soft)); background-size: 200% 100%; animation: sh 1.2s infinite; border-radius: 8px; }
@keyframes sh { to { background-position: -200% 0; } }

/* ── Sections ── */
.block { padding-top: clamp(72px, 10vw, 112px); }
.block h2 { font-size: 1.4rem; font-weight: 600; letter-spacing: -.02em; margin: 0 0 24px; }
.block-head { display: flex; justify-content: space-between; align-items: baseline; }
.block-head h2 { margin-bottom: 12px; }
.history { padding-top: 48px; }

.history-list { list-style: none; margin: 0; padding: 0; }
.history-list li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; font-size: .94rem; }
.history-list li:hover .h-t { text-decoration: underline; text-underline-offset: 3px; }
.h-p { width: 7px; height: 7px; border-radius: 50%; }
.h-t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h-d { color: var(--faint); font-size: .84rem; white-space: nowrap; }

.what-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 40px; margin: 0; }
@media (max-width: 560px) { .what-list { grid-template-columns: minmax(0, 1fr); gap: 20px; } }
.what-list dt { font-weight: 500; margin-bottom: 2px; }
.what-list dd { margin: 0; color: var(--muted); font-size: .94rem; }

.steps { list-style: none; counter-reset: s; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
@media (max-width: 640px) { .steps { grid-template-columns: minmax(0, 1fr); gap: 20px; } }
.steps li { counter-increment: s; }
.steps li::before { content: counter(s); display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); color: var(--muted); font-size: .85rem; font-weight: 500; margin-bottom: 12px; }
.steps h3 { margin: 0 0 2px; font-size: 1rem; font-weight: 500; }
.steps p { margin: 0; color: var(--muted); font-size: .94rem; }

.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 16px; padding: 16px 0; font-weight: 500; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--faint); font-size: 1.3rem; line-height: 1; font-weight: 300; }
.faq details[open] summary::after { content: '−'; }
.faq details p { margin: 0 0 18px; color: var(--muted); font-size: .96rem; max-width: 62ch; }

.foot { margin-top: clamp(80px, 12vw, 128px); border-top: 1px solid var(--line); color: var(--faint); font-size: .86rem; }
.foot-row { width: min(1120px, 100% - 40px); display: flex; flex-wrap: wrap; gap: 6px 20px; padding: 24px 0 32px; }
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--ink); }
.foot-note { margin-left: auto; }
@media (max-width: 560px) { .foot-note { margin-left: 0; } }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 50; transform: translate(-50%, calc(100% + 40px)); visibility: hidden; background: var(--btn); color: var(--btn-ink); padding: 11px 16px; border-radius: 12px; font-size: .92rem; font-weight: 500; max-width: calc(100vw - 32px); transition: transform .25s ease; }
.toast.show { transform: translate(-50%, 0); visibility: visible; }

/* legal page */
.legal { padding: 40px 0 0; }
.legal h1 { text-align: left; font-size: 2rem; margin: 0 0 8px; }
.legal h2 { font-size: 1.1rem; font-weight: 600; margin-top: 32px; }
.legal p, .legal li { color: var(--muted); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
