:root {
  --ink: #e9f0eb;
  --muted: #91a19a;
  --paper: #09110f;
  --panel: rgba(17, 28, 25, .82);
  --panel-solid: #111c19;
  --line: rgba(195, 221, 207, .13);
  --mint: #9ef7c9;
  --mint-dark: #052c1c;
  --coral: #ff8e78;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  line-height: 1.5;
  overflow-x: hidden;
}
button, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }

.ambient { position: fixed; z-index: -1; border-radius: 50%; filter: blur(100px); opacity: .13; pointer-events: none; }
.ambient-one { width: 480px; height: 480px; background: #52e69c; top: -220px; right: -100px; }
.ambient-two { width: 380px; height: 380px; background: #1d8d78; top: 680px; left: -260px; }
.shell { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }

.site-header { height: 84px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: flex; gap: 11px; align-items: center; color: var(--ink); text-decoration: none; font-weight: 700; letter-spacing: -.03em; }
.brand-mark { width: 27px; height: 27px; border: 1.5px solid var(--mint); border-radius: 50%; display: grid; place-items: center; }
.brand-mark span { width: 9px; height: 9px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 16px var(--mint); }
.privacy-pill, .status-badge { display: flex; align-items: center; gap: 8px; color: var(--muted); font: 12px var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.privacy-pill span, .status-badge span { width: 6px; height: 6px; background: var(--mint); border-radius: 50%; box-shadow: 0 0 10px var(--mint); }

.hero { min-height: 610px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; padding: 85px 0 75px; }
.eyebrow { color: var(--mint); font: 500 12px var(--mono); letter-spacing: .13em; text-transform: uppercase; }
h1 { max-width: 900px; margin: 20px 0 24px; font-size: clamp(52px, 7.6vw, 104px); line-height: .98; letter-spacing: -.065em; font-weight: 500; }
h1 em { color: var(--mint); font-style: normal; }
.hero-copy { max-width: 610px; margin: 0; color: var(--muted); font-size: clamp(17px, 2vw, 21px); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 38px; }
.button { min-height: 50px; padding: 0 21px; border: 1px solid transparent; border-radius: 8px; display: inline-flex; justify-content: center; align-items: center; gap: 12px; text-decoration: none; font-size: 14px; font-weight: 600; cursor: pointer; transition: transform .2s, background .2s, border-color .2s, opacity .2s; }
.button:hover:not(:disabled) { transform: translateY(-2px); }
.button:disabled { cursor: not-allowed; opacity: .38; }
.button-primary { color: #07120e; background: var(--mint); }
.button-primary:hover { background: #b9ffda; }
.button-secondary { color: var(--ink); background: #1c2b27; border-color: var(--line); }
.button-ghost { color: var(--ink); border-color: var(--line); background: rgba(255,255,255,.02); }
.button-icon { font-size: 21px; font-weight: 400; }
.button-full { width: 100%; }
.privacy-note { margin: 21px 0 0; color: #6f8078; font: 11px var(--mono); text-transform: uppercase; letter-spacing: .04em; }
.privacy-note span { color: var(--mint); margin-right: 6px; }

.workspace, .archive { padding: 100px 0; border-top: 1px solid var(--line); }
.section-heading { display: flex; justify-content: space-between; align-items: end; margin-bottom: 34px; }
.section-heading > div:first-child { display: flex; align-items: baseline; gap: 16px; }
.section-number { color: var(--mint); font: 11px var(--mono); }
h2 { margin: 0; font-size: clamp(28px, 4vw, 43px); line-height: 1.1; letter-spacing: -.045em; font-weight: 500; }
.status-badge { padding: 8px 11px; border: 1px solid var(--line); border-radius: 100px; background: rgba(255,255,255,.02); }
.status-badge.working span { background: #ffd479; animation: pulse 1s infinite; }
.status-badge.error span { background: var(--coral); }
@keyframes pulse { 50% { opacity: .25; } }

.scan-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(310px, .75fr); gap: 18px; }
.preview-card, .facts-card, .detail-card { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); backdrop-filter: blur(16px); overflow: hidden; }
.preview-frame { position: relative; aspect-ratio: 16 / 10; background: #050908; overflow: hidden; }
.preview-frame video { width: 100%; height: 100%; object-fit: cover; display: block; }
.preview-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; color: var(--muted); text-align: center; }
.preview-empty strong { color: #c2ccc7; font-size: 14px; font-weight: 500; }
.preview-empty small { font-size: 12px; }
.lens { width: 62px; height: 62px; border: 1px solid #31413c; border-radius: 50%; display: grid; place-items: center; margin-bottom: 10px; }
.lens span { width: 20px; height: 20px; border: 1px solid #53655e; border-radius: 50%; }
.preview-hud { position: absolute; inset: 17px; pointer-events: none; }
.preview-hud i { position: absolute; width: 22px; height: 22px; border-color: rgba(158,247,201,.55); border-style: solid; }
.preview-hud i:nth-child(1) { top:0; left:0; border-width:1px 0 0 1px; }
.preview-hud i:nth-child(2) { top:0; right:0; border-width:1px 1px 0 0; }
.preview-hud i:nth-child(3) { bottom:0; left:0; border-width:0 0 1px 1px; }
.preview-hud i:nth-child(4) { bottom:0; right:0; border-width:0 1px 1px 0; }
.live-badge { position: absolute; top: 27px; left: 27px; align-items: center; gap: 7px; padding: 6px 9px; color: white; background: rgba(8,14,12,.62); border: 1px solid rgba(255,255,255,.15); border-radius: 4px; font: 10px var(--mono); letter-spacing: .08em; }
.live-badge:not([hidden]) { display: flex; }
.live-badge span { width: 6px; height: 6px; background: var(--coral); border-radius: 50%; animation: pulse 1.2s infinite; }
.preview-controls { min-height: 72px; padding: 12px 15px 12px 20px; display: flex; align-items: center; gap: 12px; }
.preview-controls label { color: var(--muted); font: 10px var(--mono); text-transform: uppercase; letter-spacing: .07em; }
select { flex: 1; min-width: 0; color: var(--ink); background: transparent; border: 0; outline: 0; font-size: 13px; }
select option { color: #111; }
.icon-button { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 6px; background: transparent; cursor: pointer; }
.icon-button:disabled { opacity: .3; cursor: not-allowed; }

.facts-card { display: flex; flex-direction: column; padding: 26px; }
.card-title-row { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.card-title-row h3, .detail-card h3 { margin: 0; font-size: 14px; font-weight: 600; }
.card-title-row span { color: var(--muted); font: 10px var(--mono); }
.quick-facts { flex: 1; padding: 5px 0 20px; }
.quick-facts div { min-height: 49px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border-bottom: 1px solid var(--line); }
.quick-facts span { color: var(--muted); font-size: 12px; }
.quick-facts strong { max-width: 62%; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 500 12px var(--mono); }

.details-grid { margin-top: 18px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.detail-card { padding: 24px; }
.detail-card h3 { margin-bottom: 18px; }
.data-row { display: grid; grid-template-columns: minmax(95px, .75fr) minmax(0, 1fr); gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 11px; }
.data-row span { color: var(--muted); overflow-wrap: anywhere; }
.data-row code { color: #c9d6cf; font: 10px/1.5 var(--mono); text-align: right; overflow-wrap: anywhere; }

.archive { min-height: 500px; }
.archive-heading { align-items: center; }
.archive-actions { display: flex; gap: 9px; }
.text-button { padding: 9px 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; background: transparent; font-size: 11px; cursor: pointer; }
.text-button:hover { color: var(--ink); border-color: #496058; }
.archive-list { display: grid; gap: 10px; }
.server-panel { margin-bottom: 24px; padding: 26px; display: grid; grid-template-columns: minmax(240px, 1fr) minmax(330px, 1.15fr); align-items: center; gap: 28px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.server-copy h3 { margin: 8px 0 7px; font-size: 18px; }
.server-copy p { max-width: 520px; margin: 0; color: var(--muted); font-size: 12px; }
.retrieve-form label, .share-result span { display: block; margin-bottom: 8px; color: var(--muted); font: 10px var(--mono); text-transform: uppercase; letter-spacing: .07em; }
.retrieve-form > div { display: flex; gap: 8px; }
.retrieve-form input { min-width: 0; flex: 1; height: 50px; padding: 0 14px; color: var(--ink); border: 1px solid var(--line); border-radius: 8px; outline: 0; background: #0a1311; font: 11px var(--mono); text-transform: uppercase; }
.retrieve-form input:focus { border-color: rgba(158,247,201,.55); box-shadow: 0 0 0 3px rgba(158,247,201,.06); }
.share-result { grid-column: 1 / -1; padding-top: 20px; border-top: 1px solid var(--line); display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.share-result[hidden] { display: none; }
.share-result code { color: var(--mint); font: 500 clamp(12px, 2vw, 16px) var(--mono); letter-spacing: .04em; }
.server-tag { display: inline-block; margin-left: 7px; padding: 2px 5px; color: var(--mint); border: 1px solid rgba(158,247,201,.25); border-radius: 3px; font: 8px var(--mono); vertical-align: 1px; }
.archive-item { display: grid; grid-template-columns: 54px minmax(0,1.4fr) repeat(3,minmax(90px,.45fr)) auto; align-items: center; gap: 18px; padding: 17px 20px; border: 1px solid var(--line); border-radius: 9px; background: rgba(17,28,25,.55); }
.archive-index { color: var(--mint); font: 11px var(--mono); }
.archive-name strong { display: block; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.archive-name span, .archive-stat span { color: var(--muted); font: 10px var(--mono); }
.archive-stat strong { display: block; font: 500 11px var(--mono); }
.archive-buttons { display: flex; gap: 7px; }
.archive-buttons button { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); background: transparent; cursor: pointer; }
.archive-buttons button:hover { color: var(--mint); }
.archive-buttons button.delete:hover { color: var(--coral); }
.archive-empty { padding: 85px 20px; text-align: center; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); }
.archive-empty > span { color: var(--mint); font-size: 35px; }
.archive-empty h3 { color: var(--ink); margin: 12px 0 7px; font-size: 17px; }
.archive-empty p { max-width: 480px; margin: auto; font-size: 13px; }

footer { height: 100px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; color: #627069; font: 10px var(--mono); text-transform: uppercase; }

dialog { width: min(850px, calc(100% - 30px)); max-height: 84vh; padding: 0; color: var(--ink); border: 1px solid #35453f; border-radius: 12px; background: #0d1714; box-shadow: 0 25px 100px #000; }
dialog::backdrop { background: rgba(0,0,0,.72); backdrop-filter: blur(5px); }
.dialog-head { padding: 23px 25px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.dialog-head h2 { margin-top: 6px; font-size: 24px; }
dialog pre { max-height: 55vh; overflow: auto; margin: 0; padding: 24px; color: #b8d5c6; background: #08100e; font: 11px/1.7 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.dialog-actions { padding: 16px 24px; display: flex; justify-content: flex-end; gap: 10px; }
.toast { position: fixed; z-index: 10; left: 50%; bottom: 25px; transform: translate(-50%, 20px); padding: 11px 16px; color: #07120e; background: var(--mint); border-radius: 6px; font-size: 12px; font-weight: 600; opacity: 0; pointer-events: none; transition: .25s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { color: white; background: var(--coral); }

@media (max-width: 850px) {
  .hero { min-height: 560px; }
  .scan-grid { grid-template-columns: 1fr; }
  .details-grid { grid-template-columns: 1fr 1fr; }
  .archive-item { grid-template-columns: 38px minmax(0,1fr) auto; }
  .archive-stat { display: none; }
  .server-panel { grid-template-columns: 1fr; }
  .share-result { grid-column: auto; }
}
@media (max-width: 570px) {
  .shell { width: min(100% - 28px, 1180px); }
  .site-header { height: 70px; }
  .privacy-pill { font-size: 9px; }
  .hero { min-height: 570px; padding: 60px 0; }
  h1 { font-size: clamp(44px, 14vw, 68px); }
  .hero-actions, .hero-actions .button { width: 100%; }
  .workspace, .archive { padding: 70px 0; }
  .section-heading { align-items: flex-start; }
  .section-heading > div:first-child { gap: 10px; }
  .status-badge { font-size: 9px; }
  .details-grid { grid-template-columns: 1fr; }
  .preview-empty small { max-width: 230px; }
  .facts-card { padding: 21px; }
  .archive-heading { flex-direction: column; gap: 22px; }
  .archive-actions { width: 100%; }
  .archive-actions button { flex: 1; }
  .server-panel { padding: 21px; }
  .retrieve-form > div, .share-result { align-items: stretch; flex-direction: column; }
  .share-result code { overflow-wrap: anywhere; }
  .archive-item { padding: 14px; gap: 10px; }
  footer { height: 84px; }
  footer span:last-child { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
