:root {
  color-scheme: dark;
  --bg: #0c1410;
  --panel: #111d17;
  --panel-2: #17251e;
  --line: #2b3d34;
  --text: #f6f4ec;
  --muted: #9eafa6;
  --green: #38a37c;
  --green-strong: #55c79b;
  --cream: #f7f4e9;
  --orange: #ff5b25;
  --violet: #8b7cff;
  --font-display: 'Bricolage Grotesque', 'Segoe UI', sans-serif;
  --font-body: 'Hanken Grotesk', 'Segoe UI', sans-serif;
  --font-mono: 'Space Mono', Consolas, monospace;
  --danger: #ff8f81;
  font-family: var(--font-body);
}

@font-face { font-family: 'Bricolage Grotesque'; font-style: normal; font-weight: 200 800; font-display: swap; src: url('assets/fonts/bricolage-grotesque-latin.woff2') format('woff2'); }
@font-face { font-family: 'Hanken Grotesk'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('assets/fonts/hanken-grotesk-latin.woff2') format('woff2'); }
@font-face { font-family: 'Space Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('assets/fonts/space-mono-regular-latin.woff2') format('woff2'); }
@font-face { font-family: 'Space Mono'; font-style: normal; font-weight: 700; font-display: swap; src: url('assets/fonts/space-mono-bold-latin.woff2') format('woff2'); }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: radial-gradient(circle at 8% 0%, rgba(255,91,37,.32), transparent 28rem), radial-gradient(circle at 96% 8%, rgba(85,199,155,.28), transparent 25rem), radial-gradient(circle at 52% 100%, rgba(139,124,255,.2), transparent 32rem), linear-gradient(135deg, #0b1b14 0%, #101c2c 54%, #1b151f 100%); color: var(--text); min-height: 100vh; }
button, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }

.topbar { height: 74px; padding: 0 clamp(20px, 4vw, 56px); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(12,20,16,.88); backdrop-filter: blur(18px); position: sticky; top: 0; z-index: 10; }
.brand { color: var(--text); display: flex; align-items: center; gap: 13px; text-decoration: none; }
.brand img { width: 44px; height: 44px; border-radius: 13px; }
.brand span { display: grid; gap: 2px; }
.brand strong { font-family: var(--font-display); font-size: 17px; }
.brand small { color: var(--muted); }
.top-actions { display: flex; align-items: center; gap: 10px; }
.local-chip { border: 1px solid var(--line); border-radius: 999px; padding: 9px 13px; color: var(--muted); font-family: var(--font-mono); font-size: 11px; }
.local-chip i { width: 8px; height: 8px; display: inline-block; margin-right: 7px; border-radius: 50%; background: var(--green-strong); box-shadow: 0 0 0 4px rgba(85,199,155,.1); }

main { width: min(1370px, calc(100% - 48px)); margin: 0 auto; }
.hero { padding: 26px 0 22px; }
.hero-shell { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr); align-items: center; gap: clamp(24px, 4vw, 48px); }
.hero-copy { max-width: 680px; }
.eyebrow { margin: 0 0 10px; color: var(--green-strong); font-family: var(--font-mono); font-weight: 700; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
.hero h1 { margin: 0; font-family: var(--font-display); font-weight: 650; font-size: clamp(38px, 4vw, 60px); line-height: 1.02; letter-spacing: -.045em; }
.hero > p:last-child { margin: 12px 0 0; color: var(--muted); line-height: 1.55; font-size: 15px; max-width: 760px; }
.hero-copy > p:last-of-type { max-width: 580px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 22px; }
.hero-actions a { text-decoration: none; }
.hero-art { position: relative; width: min(100%, 410px); aspect-ratio: 16 / 10; justify-self: end; margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); box-shadow: 0 18px 44px rgba(0,0,0,.22); }
.hero-art img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.hero-art::after { position: absolute; inset: 0; content: ""; background: linear-gradient(100deg, rgba(12,20,16,.22), transparent 52%, rgba(12,20,16,.05)); pointer-events: none; }
.hero-art figcaption { position: absolute; right: 13px; bottom: 13px; z-index: 1; display: inline-flex; align-items: center; gap: 7px; padding: 8px 10px; border: 1px solid rgba(255,255,255,.16); border-radius: 999px; color: var(--text); background: rgba(7,17,13,.74); backdrop-filter: blur(10px); font-size: 11px; font-weight: 750; }
.hero-status-dot, .coming-dot { width: 8px; height: 8px; display: inline-block; border-radius: 50%; background: var(--green-strong); box-shadow: 0 0 0 4px rgba(85,199,155,.12); }

.drop-zone { min-height: 174px; border: 1px dashed #496255; border-radius: 16px; background: linear-gradient(145deg, rgba(56,163,124,.09), rgba(17,29,23,.72)); display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 18px; padding: 22px 26px; margin-top: 22px; transition: .2s ease; }
.drop-zone.dragging { border-color: var(--green-strong); background: rgba(56,163,124,.17); transform: scale(1.006); }
.drop-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; color: var(--green-strong); background: rgba(56,163,124,.13); font-size: 29px; }
.drop-copy h2 { margin: 0 0 5px; font-family: var(--font-display); font-size: 22px; }
.drop-copy p { max-width: 650px; margin: 0; color: var(--muted); line-height: 1.45; font-size: 13px; }
.drop-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }

.button { border: 1px solid transparent; border-radius: 10px; padding: 11px 16px; font-weight: 750; color: var(--text); background: transparent; }
.button.primary { color: #06120d; background: var(--green-strong); }
.button.primary:hover { background: #6bd6ad; }
.button.secondary { color: #07110d; background: var(--cream); }
.button.ghost { border-color: var(--line); }
.button.ghost:hover { border-color: #567163; background: rgba(255,255,255,.04); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); margin: 18px 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: rgba(17,29,23,.86); }
.stats div { display: flex; align-items: baseline; gap: 8px; padding: 14px 20px; border-right: 1px solid var(--line); }
.stats div:last-child { border-right: 0; }
.stats strong { color: var(--green-strong); font-size: 22px; }
.stats span { color: var(--muted); font-size: 13px; }

.action-panel { padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.action-copy > p:last-child { margin: 0; color: var(--muted); line-height: 1.5; font-size: 13px; }
.action-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 13px; }
.save-row { border-top: 1px solid var(--line); display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-top: 14px; padding-top: 14px; }
.save-row label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 700; }
select { min-width: 275px; border: 1px solid var(--line); border-radius: 9px; padding: 11px 35px 11px 12px; color: var(--text); background: var(--panel-2); }
.save-note { margin: 9px 0 0; color: var(--muted); font-size: 12px; }
code { color: var(--green-strong); font-family: var(--font-mono); font-size: .9em; }

.progress-wrap { display: flex; align-items: center; gap: 14px; margin: 20px 0; color: var(--muted); font-size: 13px; }
.progress-track { flex: 1; height: 8px; overflow: hidden; border-radius: 999px; background: var(--panel-2); }
.progress-track div { width: 0; height: 100%; background: var(--green-strong); transition: width .15s; }
.status-message { min-height: 24px; margin: 20px 2px; color: var(--muted); }
.status-message[data-type="success"] { color: var(--green-strong); }
.status-message[data-type="warning"] { color: #ffc977; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(245px, 1fr)); gap: 16px; padding-bottom: 54px; }
.media-card { overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: var(--panel); transition: .18s; }
.media-card.selected { border-color: var(--green-strong); box-shadow: 0 0 0 2px rgba(85,199,155,.18); }
.card-preview { position: relative; width: 100%; height: 210px; overflow: hidden; background: #09100c; }
.media-preview { display: block; width: 100%; height: 100%; object-fit: contain; }
.card-preview video { background: #050806; }
.check { position: absolute; z-index: 2; right: 12px; top: 12px; width: 27px; height: 27px; border: 2px solid rgba(255,255,255,.8); border-radius: 8px; display: grid; place-items: center; color: #07110d; background: rgba(7,17,13,.55); }
.check:disabled { opacity: .72; cursor: not-allowed; }
.selected .check { border-color: var(--green-strong); background: var(--green-strong); }
.video-warning { position: absolute; left: 9px; bottom: 9px; z-index: 2; max-width: calc(100% - 18px); margin: 0; padding: 6px 9px; border: 1px solid rgba(255,143,129,.7); border-radius: 7px; color: #fff4ef; background: rgba(80,28,22,.88); backdrop-filter: blur(8px); font-size: 9px; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; pointer-events: none; }
.card-body { padding: 14px; }
.card-body h3 { overflow: hidden; margin: 10px 0 5px; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.card-body p { margin: 0; color: var(--muted); font-size: 12px; }
.badges { min-height: 23px; display: flex; flex-wrap: wrap; gap: 5px; }
.badge { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 5px 7px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 10px; font-weight: 800; }
.badge-person { color: #092016; border-color: var(--green-strong); background: var(--green-strong); }
.badge-verified { color: #b7ffde; border-color: #367c61; background: #173b2d; }
.badge-working { color: #ffe0a6; }
.badge-error { color: var(--danger); border-color: #70413c; }
.badge-watch { color: #ffc977; border-color: #70552e; background: #342816; }

.empty-state { padding: 60px 20px 90px; text-align: center; color: var(--muted); }
.empty-state div { width: 48px; height: 48px; margin: auto; display: grid; place-items: center; border-radius: 50%; color: #07110d; background: var(--green-strong); font-weight: 900; }
.empty-state h2 { margin: 16px 0 7px; color: var(--text); }
.empty-state p { margin: 0; }
.tutorial-card { display: grid; grid-template-columns: .82fr 1.18fr; align-items: center; gap: clamp(24px, 4vw, 54px); margin: 8px 0 20px; padding: clamp(20px, 3vw, 38px); border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(135deg, rgba(56,163,124,.12), rgba(17,29,23,.84) 55%); }
.tutorial-copy h2, .answer-grid h2 { margin: 0; font-family: var(--font-display); font-size: clamp(25px, 3vw, 36px); font-weight: 600; line-height: 1.04; letter-spacing: -.035em; }
.tutorial-copy > p:not(.eyebrow):not(.tutorial-note) { margin: 13px 0 0; color: var(--muted); line-height: 1.6; font-size: 14px; }
.tutorial-note { display: inline-flex; align-items: center; gap: 9px; margin: 18px 0 0; color: #ffc977; font-family: var(--font-mono); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.coming-dot { background: #ffc977; box-shadow: 0 0 0 4px rgba(255,201,119,.12); }
.tutorial-frame { position: relative; width: min(100%, 540px); justify-self: end; overflow: hidden; aspect-ratio: 16 / 9; border: 1px solid #496255; border-radius: 14px; background: #09100c; }
.tutorial-frame img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tutorial-overlay { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; color: var(--text); background: linear-gradient(180deg, rgba(7,17,13,.08), rgba(7,17,13,.72)); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.play-placeholder { display: grid; place-items: center; width: 58px; height: 58px; padding-left: 4px; border: 1px solid rgba(255,255,255,.45); border-radius: 50%; color: #07110d; background: var(--green-strong); font-size: 21px; box-shadow: 0 8px 30px rgba(0,0,0,.25); }
.answer-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; padding: 18px 0 56px; }
.answer-grid article { padding: 24px; border: 1px solid var(--line); border-radius: 15px; background: rgba(17,29,23,.64); }
.answer-grid article > p:not(.eyebrow) { margin: 13px 0 0; color: var(--muted); line-height: 1.6; font-size: 14px; }
.inline-link { padding: 0; border: 0; color: var(--green-strong); background: transparent; text-decoration: underline; text-underline-offset: 3px; font-weight: 750; }
footer { border-top: 1px solid var(--line); padding: 30px 20px; color: var(--muted); text-align: center; font-size: 12px; }

dialog { width: min(570px, calc(100% - 30px)); border: 1px solid var(--line); border-radius: 18px; padding: 0; color: var(--text); background: var(--panel); }
dialog::backdrop { background: rgba(0,0,0,.72); backdrop-filter: blur(5px); }
.dialog-content { padding: 29px; }
.dialog-content h2 { margin: 0; }
.dialog-content ul { padding-left: 20px; color: var(--muted); line-height: 1.6; }
.desktop-description, .desktop-help { color: var(--muted); line-height: 1.6; }
.desktop-downloads { display: grid; gap: 10px; margin: 22px 0 16px; }
.desktop-download { display: grid; gap: 4px; text-decoration: none; }
.desktop-download span { font-size: 13px; font-weight: 500; }
.desktop-help { font-size: 13px; }
.desktop-release-link { display: inline-block; margin-bottom: 24px; color: var(--green-strong); text-underline-offset: 3px; }
.desktop-download:focus-visible, .desktop-release-link:focus-visible, button:focus-visible { outline: 3px solid var(--green-strong); outline-offset: 4px; }

@media (max-width: 760px) {
  .topbar { height: auto; padding: 14px 18px; align-items: flex-start; }
  .top-actions { flex-shrink: 0; }
  #install-app { max-width: 150px; padding: 9px 12px; font-size: 13px; }
  .brand small, .local-chip, .top-actions .ghost { display: none; }
  main { width: min(100% - 24px, 1180px); }
  .hero { padding-top: 28px; }
  .hero-shell { display: block; }
  .hero h1 { font-size: clamp(38px, 12vw, 56px); }
  .hero-art { width: 100%; max-width: 410px; margin-top: 22px; }
  .drop-zone { grid-template-columns: auto minmax(0, 1fr); min-height: 180px; padding: 20px; }
  .drop-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats div:nth-child(2) { border-right: 0; }
  .stats div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .save-row { align-items: stretch; flex-direction: column; }
  select { width: 100%; min-width: 0; }
  .tutorial-card, .answer-grid { grid-template-columns: 1fr; }
  .tutorial-frame { order: -1; }
}
