:root {
  --bg: #07080c;
  --panel: #101117;
  --panel-2: #15171e;
  --text: #f5f5f7;
  --muted: #9497a3;
  --line: rgba(255,255,255,.095);
  --accent: #b9ff37;
  --accent-2: #d8ff91;
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.noise { position: fixed; inset: 0; z-index: 20; pointer-events: none; opacity: .025; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 140 140' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.88' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E"); }

.topbar { position: sticky; top: 0; z-index: 10; height: 76px; padding: 0 clamp(22px, 5vw, 76px); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(7,8,12,.78); backdrop-filter: blur(20px); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: white; text-decoration: none; font-weight: 850; letter-spacing: -.5px; }
.brand > span:last-child > span { color: var(--accent); }
.brand-mark { width: 28px; height: 28px; display: grid; place-items: center; border: 2px solid var(--accent); transform: skew(-7deg); }
.brand-mark > span { width: 8px; height: 12px; background: var(--accent); clip-path: polygon(0 0,100% 50%,0 100%); }
nav { display: flex; align-items: center; gap: 28px; }
.nav-link { color: var(--muted); text-decoration: none; font-size: 14px; }
.nav-link.active { color: white; }
.saved-link { border: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.saved-link { background: transparent; color: var(--muted); }
.saved-link:hover { color: white; }
.saved-link svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.saved-link span { min-width: 20px; height: 20px; display: grid; place-items: center; border-radius: 99px; color: var(--bg); background: var(--accent); font-size: 11px; font-weight: 800; }
.manage-link { padding: 9px 13px; border: 1px solid rgba(185,255,55,.35); border-radius: 9px; background: rgba(185,255,55,.08); color: var(--accent); cursor: pointer; font-size: 12px; font-weight: 800; }
.manage-link:hover { background: var(--accent); color: #111407; }

.hero { min-height: 570px; padding: 105px 24px 90px; display: flex; align-items: center; flex-direction: column; position: relative; overflow: hidden; text-align: center; border-bottom: 1px solid var(--line); }
.eyebrow, .kicker { color: var(--accent); font-size: 11px; font-weight: 850; letter-spacing: 2.2px; }
.eyebrow { display: flex; align-items: center; gap: 9px; }
.eyebrow span { width: 24px; height: 1px; background: var(--accent); }
h1 { max-width: 900px; margin: 22px 0 18px; font-size: clamp(49px, 7vw, 92px); line-height: .95; letter-spacing: -5px; }
h1 em { font-weight: 350; color: transparent; -webkit-text-stroke: 1px rgba(255,255,255,.62); }
.hero > p { max-width: 590px; margin: 0; color: var(--muted); line-height: 1.7; font-size: 16px; }
.hero-glow { position: absolute; z-index: -1; width: 720px; height: 260px; top: 115px; border-radius: 50%; background: rgba(185,255,55,.1); filter: blur(100px); }
.search-shell { position: relative; width: min(690px, 100%); margin-top: 42px; }
.search-shell > svg { position: absolute; left: 19px; top: 50%; width: 21px; transform: translateY(-50%); fill: none; stroke: var(--muted); stroke-width: 1.7; }
.search-shell input { width: 100%; height: 64px; padding: 0 70px 0 54px; border: 1px solid rgba(255,255,255,.16); border-radius: 14px; outline: 0; background: rgba(17,18,24,.92); color: white; box-shadow: 0 24px 70px rgba(0,0,0,.25); }
.search-shell input:focus { border-color: rgba(185,255,55,.65); box-shadow: 0 0 0 4px rgba(185,255,55,.08), 0 24px 70px rgba(0,0,0,.25); }
.search-shell input::placeholder { color: #747783; }
.search-shell kbd { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; background: #20222a; color: #858895; font-size: 11px; }

.library { max-width: 1320px; margin: auto; padding: 88px 28px 110px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
h2 { margin: 10px 0 0; font-size: clamp(32px, 4vw, 50px); letter-spacing: -2px; line-height: 1.05; }
.result-count { color: var(--muted); font-size: 13px; }
.result-count strong { color: white; }
.filters { margin: 34px 0 30px; padding-bottom: 18px; display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filter-chip { flex: 0 0 auto; padding: 10px 15px; border: 1px solid var(--line); border-radius: 99px; background: transparent; color: var(--muted); cursor: pointer; font-size: 13px; }
.filter-chip:hover { border-color: rgba(255,255,255,.3); color: white; }
.filter-chip.active { border-color: var(--accent); background: var(--accent); color: #111407; font-weight: 800; }
.clip-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.clip-card { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel); transition: transform .22s ease, border-color .22s ease; animation: reveal .42s both; }
.clip-card:hover { transform: translateY(-5px); border-color: rgba(255,255,255,.22); }
@keyframes reveal { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.thumb { position: relative; aspect-ratio: 16/9; overflow: hidden; background: #1b1e26; }
.thumb-button { width: 100%; padding: 0; border: 0; display: block; color: inherit; cursor: pointer; text-align: inherit; }
.thumb::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(4,5,8,.72), transparent 60%); }
.thumb-art { position: absolute; inset: 0; background: linear-gradient(135deg, #171920, #292d38); background-size: cover; background-position: center; transform: scale(1.04); transition: transform .5s ease; }
.clip-card:hover .thumb-art { transform: scale(1.1); }
.thumb-label { position: absolute; z-index: 1; inset: 0; display: grid; place-items: center; color: rgba(255,255,255,.36); font-size: clamp(20px,3vw,34px); font-weight: 850; letter-spacing: -1px; }
.thumb-art::before, .thumb-art::after { content: ""; position: absolute; border-radius: 50%; filter: blur(2px); }
.thumb-art::before { width: 46%; aspect-ratio: 1; left: 27%; top: 18%; background: rgba(255,255,255,.2); box-shadow: 0 0 70px rgba(255,255,255,.12); }
.thumb-art::after { width: 74%; height: 16%; left: 13%; bottom: 18%; border: 1px solid rgba(255,255,255,.22); transform: rotate(-8deg); }
.duration, .quality { position: absolute; z-index: 2; top: 14px; padding: 6px 8px; border-radius: 6px; backdrop-filter: blur(10px); font-size: 10px; font-weight: 800; }
.quality { left: 14px; background: var(--accent); color: #111407; }
.duration { right: 14px; background: rgba(5,6,8,.68); }
.play-icon { position: absolute; z-index: 2; left: 50%; top: 50%; width: 48px; height: 48px; display: grid; place-items: center; transform: translate(-50%,-50%); border: 1px solid rgba(255,255,255,.38); border-radius: 50%; background: rgba(7,8,12,.43); backdrop-filter: blur(8px); opacity: 0; transition: opacity .2s; }
.play-icon::after { content: ""; margin-left: 3px; border-left: 9px solid white; border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.clip-card:hover .play-icon { opacity: 1; }
.thumb-button:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.card-body { padding: 18px; }
.card-top { display: flex; gap: 14px; align-items: start; }
.card-top > div { flex: 1; min-width: 0; }
.card-top h3 { margin: 0 0 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 16px; }
.person-name { display: block; margin: -1px 0 6px; color: var(--accent); font-size: 11px; font-weight: 800; }
.metadata { color: var(--muted); font-size: 11px; }
.save-btn { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: transparent; cursor: pointer; }
.save-btn:hover { border-color: rgba(255,255,255,.3); }
.save-btn svg { width: 17px; fill: none; stroke: var(--muted); stroke-width: 1.8; }
.save-btn.saved svg { fill: var(--accent); stroke: var(--accent); }
.tags { display: flex; gap: 7px; margin: 15px 0 17px; overflow: hidden; }
.tags span { flex: 0 0 auto; padding: 5px 8px; border-radius: 5px; background: var(--panel-2); color: #a2a5ae; font-size: 10px; }
.download-btn { width: 100%; height: 40px; border: 1px solid var(--line); border-radius: 9px; background: #191b22; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 12px; font-weight: 750; }
.download-btn:hover { border-color: var(--accent); color: var(--accent); }
.download-btn svg { width: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.empty-state { padding: 80px 20px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); }
.empty-state > div { font-size: 40px; color: var(--accent); }
.empty-state h3 { margin: 12px 0 4px; color: white; }
.empty-state p { margin: 0 0 20px; }
.empty-state button { padding: 10px 16px; border: 0; border-radius: 8px; background: var(--accent); color: #101308; font-weight: 800; cursor: pointer; }

.how-it-works { max-width: 1320px; margin: 0 auto 110px; padding: 58px; display: grid; grid-template-columns: 1fr 1.2fr; gap: 80px; border: 1px solid var(--line); border-radius: 24px; background: linear-gradient(140deg, #11131a, #0c0d12); }
.how-it-works ol { margin: 0; padding: 0; list-style: none; }
.how-it-works li { display: flex; gap: 22px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.how-it-works li:first-child { padding-top: 0; }
.how-it-works li:last-child { border-bottom: 0; padding-bottom: 0; }
.how-it-works li > span { color: var(--accent); font-family: ui-monospace, monospace; font-size: 12px; }
.how-it-works strong { font-size: 15px; }
.how-it-works p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
footer { padding: 30px clamp(22px,5vw,76px); display: flex; justify-content: space-between; align-items: center; gap: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
footer p { margin: 0; }
.toast { position: fixed; z-index: 30; right: 24px; bottom: 24px; max-width: 360px; padding: 15px; display: flex; gap: 12px; align-items: center; border: 1px solid rgba(185,255,55,.25); border-radius: 12px; background: #171a13; box-shadow: 0 20px 60px rgba(0,0,0,.4); transform: translateY(120px); opacity: 0; transition: .3s ease; }
.toast.show { transform: translateY(0); opacity: 1; }
.toast > span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: #111407; font-weight: 900; }
.toast p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.toast strong { color: white; }

.preview-modal[hidden] { display: none; }
.preview-modal { position: fixed; z-index: 50; inset: 0; display: grid; place-items: center; padding: 22px; }
.preview-backdrop { position: absolute; inset: 0; border: 0; background: rgba(2,3,5,.82); backdrop-filter: blur(12px); cursor: pointer; }
.preview-panel { position: relative; width: min(720px, 100%); max-height: min(860px, calc(100vh - 44px)); overflow: auto; padding: 24px; border: 1px solid rgba(255,255,255,.16); border-radius: 20px; background: #101117; box-shadow: 0 30px 100px rgba(0,0,0,.65); }
.preview-head { display: flex; align-items: start; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.preview-head h2 { margin-top: 5px; font-size: clamp(25px, 4vw, 38px); }
.preview-close { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 50%; background: #191b22; cursor: pointer; font-size: 26px; line-height: 1; }
.preview-close:hover { border-color: var(--accent); color: var(--accent); }
.preview-media { width: 100%; min-height: 360px; display: grid; place-items: center; overflow: hidden; border-radius: 14px; background: #090a0e; }
.preview-media iframe, .preview-media video { width: 100%; height: min(610px, 68vh); border: 0; background: #090a0e; }
.preview-media video { object-fit: contain; }
.preview-unavailable { min-height: 360px; display: grid; place-items: center; align-content: center; gap: 10px; color: var(--muted); text-align: center; }
.preview-unavailable span { width: 58px; height: 58px; display: grid; place-items: center; padding-left: 4px; border: 1px solid rgba(185,255,55,.45); border-radius: 50%; color: var(--accent); }
.preview-unavailable strong { color: white; }
.preview-unavailable p { margin: 0; font-size: 12px; }
.preview-panel > p { margin: 14px 2px 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
body.modal-open { overflow: hidden; }

.editor-modal[hidden] { display: none; }
.editor-modal { position: fixed; z-index: 55; inset: 0; display: grid; place-items: center; padding: 22px; }
.editor-panel { position: relative; width: min(980px, 100%); max-height: min(900px, calc(100vh - 44px)); overflow: auto; padding: 24px; border: 1px solid rgba(255,255,255,.16); border-radius: 20px; background: #101117; box-shadow: 0 30px 100px rgba(0,0,0,.7); }
.editor-head { position: sticky; z-index: 2; top: -24px; margin: -24px -24px 18px; padding: 24px; background: rgba(16,17,23,.96); backdrop-filter: blur(18px); border-bottom: 1px solid var(--line); }
.editor-head p { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.editor-list { display: grid; gap: 12px; }
.editor-row { display: grid; grid-template-columns: 150px 1fr auto; gap: 16px; align-items: center; padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: #0c0d12; }
.editor-thumb { width: 150px; aspect-ratio: 16/9; object-fit: cover; border-radius: 9px; background: #1b1e26; }
.editor-fields { min-width: 0; display: grid; gap: 9px; }
.editor-fields > span { color: var(--accent); font-size: 10px; font-weight: 800; }
.editor-fields input[type="text"] { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; outline: none; background: #171920; color: white; }
.editor-fields input[type="text"]:focus { border-color: var(--accent); }
.thumbnail-picker { width: fit-content; padding: 8px 11px; border: 1px solid rgba(185,255,55,.38); border-radius: 8px; background: rgba(185,255,55,.08); color: var(--accent); cursor: pointer; font-size: 11px; font-weight: 800; }
.thumbnail-picker:hover { background: var(--accent); color: #111407; }
.thumbnail-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.editor-save { min-width: 112px; padding: 10px 13px; border: 0; border-radius: 9px; background: var(--accent); color: #111407; cursor: pointer; font-size: 12px; font-weight: 850; }
.editor-save:disabled { opacity: .55; cursor: wait; }
.editor-status { min-height: 14px; color: var(--muted); font-size: 10px; }
.editor-status.success { color: var(--accent); }
.editor-status.error { color: #ff7b7b; }

.frame-modal[hidden] { display: none; }
.frame-modal { position: fixed; z-index: 60; inset: 0; display: grid; place-items: center; padding: 22px; }
.frame-panel { position: relative; width: min(900px, 100%); max-height: calc(100vh - 44px); overflow: auto; padding: 24px; border: 1px solid rgba(255,255,255,.16); border-radius: 20px; background: #101117; box-shadow: 0 30px 100px rgba(0,0,0,.75); }
.frame-panel .preview-head p { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.frame-video-shell { position: relative; min-height: 360px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #050609; }
.frame-video-shell video { display: block; width: 100%; max-height: 62vh; background: #050609; }
.frame-loading { position: absolute; inset: 0; display: grid; place-items: center; padding: 30px; background: #090a0e; color: var(--muted); text-align: center; }
.frame-loading[hidden] { display: none; }
.frame-controls { margin-top: 18px; display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: center; }
.frame-controls > span { color: var(--accent); font-family: ui-monospace, monospace; font-size: 12px; }
.frame-controls input { width: 100%; accent-color: var(--accent); cursor: pointer; }
.frame-controls button { padding: 11px 16px; border: 0; border-radius: 9px; background: var(--accent); color: #111407; cursor: pointer; font-weight: 850; }
.frame-controls button:disabled { opacity: .45; cursor: wait; }
.frame-help { margin: 12px 0 0; color: var(--muted); font-size: 11px; }
.frame-help.error { color: #ff7b7b; }

.admin-login-modal[hidden] { display: none; }
.admin-login-modal { position: fixed; z-index: 70; inset: 0; display: grid; place-items: center; padding: 20px; }
.admin-login-panel { position: relative; width: min(430px, 100%); padding: 30px; display: grid; gap: 14px; border: 1px solid rgba(255,255,255,.16); border-radius: 20px; background: #101117; box-shadow: 0 30px 100px rgba(0,0,0,.75); }
.admin-login-panel h2 { margin: 0; }
.admin-login-panel p { margin: -5px 0 4px; color: var(--muted); font-size: 13px; }
.admin-login-panel label { color: var(--muted); font-size: 11px; }
.admin-login-panel input { padding: 12px 13px; border: 1px solid var(--line); border-radius: 9px; outline: 0; background: #171920; color: white; }
.admin-login-panel input:focus { border-color: var(--accent); }
.admin-login-panel button { padding: 12px; border: 0; border-radius: 9px; background: var(--accent); color: #111407; cursor: pointer; font-weight: 850; }
.admin-login-panel a { color: var(--muted); text-align: center; text-decoration: none; font-size: 11px; }

@media (max-width: 950px) {
  .clip-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .how-it-works { margin-inline: 24px; grid-template-columns: 1fr; gap: 40px; }
  .nav-link, .saved-link { display: none; }
}
@media (max-width: 620px) {
  .topbar { height: 68px; }
  .hero { min-height: 510px; padding-top: 82px; }
  h1 { letter-spacing: -3px; }
  .search-shell input { height: 58px; padding-right: 20px; }
  .search-shell kbd { display: none; }
  .library { padding: 66px 18px 78px; }
  .clip-grid { grid-template-columns: 1fr; }
  .section-head { align-items: start; flex-direction: column; }
  .how-it-works { margin: 0 18px 78px; padding: 34px 24px; }
  footer { flex-direction: column; text-align: center; }
  .toast { left: 16px; right: 16px; bottom: 16px; }
  .preview-modal { padding: 10px; }
  .preview-panel { padding: 17px; max-height: calc(100vh - 20px); }
  .preview-media, .preview-unavailable { min-height: 280px; }
  .preview-media iframe, .preview-media video { height: 62vh; }
  .editor-modal { padding: 8px; }
  .editor-panel { padding: 14px; max-height: calc(100vh - 16px); }
  .editor-head { top: -14px; margin: -14px -14px 14px; padding: 16px 14px; }
  .editor-row { grid-template-columns: 96px 1fr; gap: 11px; }
  .editor-thumb { width: 96px; }
  .editor-save { grid-column: 1 / -1; width: 100%; }
  .frame-modal { padding: 8px; }
  .frame-panel { max-height: calc(100vh - 16px); padding: 15px; }
  .frame-video-shell { min-height: 240px; }
  .frame-controls { grid-template-columns: 48px 1fr; }
  .frame-controls button { grid-column: 1 / -1; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
