/* Autelica Studio. Brand tokens from docs/brand/BRAND.md: night/paper/flare, Archivo + JetBrains Mono. */
:root {
  --night: #0B0C0E; --night-2: #15171B; --night-3: #23262C; --night-4: #2E323A;
  --paper: #F4F2ED; --flare: #FF5A1F; --flare-2: #FF7A45;
  --ink-2: #A9ADB5; --ink-3: #6E737C;
  --glass: rgba(17, 19, 23, .72); --hair: rgba(244, 242, 237, .1);
  --font: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --r: 18px; --gutter: clamp(16px, 3vw, 40px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--night); color: var(--paper); font: 16px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--flare-2); text-decoration: none; } a:hover { color: var(--flare); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--flare); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--mono); }
.label { font: 500 12px/1.3 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
.label.flare { color: var(--flare-2); }
.muted { color: var(--ink-2); }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- top bar */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px var(--gutter); background: rgba(11, 12, 14, .82); backdrop-filter: blur(14px); border-bottom: 1px solid var(--hair); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--paper); }
.brand img { height: 20px; width: auto; }
.brand .tag { font: 500 11px var(--mono); letter-spacing: .12em; color: var(--ink-2); border: 1px solid var(--night-3); border-radius: 999px; padding: 3px 9px; }
.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav a { color: var(--ink-2); padding: 10px 12px; border-radius: 10px; font-size: 15px; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--paper); background: var(--night-2); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--night-3); object-fit: cover; }

/* ---------------------------------------------------------------- buttons, chips */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: 999px;
  border: 1px solid var(--night-4); background: var(--night-2); color: var(--paper); font-weight: 600; font-size: 15px; transition: background .2s var(--ease), transform .2s var(--ease); }
.btn:hover { background: var(--night-3); color: var(--paper); }
.btn:active { transform: scale(.98); }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn { white-space: nowrap; }
.btn.flare { background: var(--flare); border-color: var(--flare); color: var(--night); }
.btn.flare:hover { background: var(--flare-2); }
.btn.paper { background: var(--paper); border-color: var(--paper); color: var(--night); }
.btn.ghost { background: transparent; }
.btn.sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; border: 1px solid transparent; background: transparent; color: var(--ink-2); display: grid; place-items: center; }
.icon-btn:hover { background: var(--night-3); color: var(--paper); }
.icon-btn[aria-pressed="true"] { background: var(--paper); color: var(--night); }
.icon-btn svg { width: 20px; height: 20px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font: 500 12px var(--mono); letter-spacing: .06em; padding: 5px 9px; border-radius: 8px; background: var(--night-3); color: var(--paper); }
.chip.paper { background: var(--paper); color: var(--night); }
.chip.real { background: #1f2a22; color: #b9e2c4; } .chip.blended { background: #2e2519; color: #ffcf9e; } .chip.estimated { background: #3a1d14; color: #ffb38f; }
.card { background: var(--night-2); border: 1px solid var(--night-3); border-radius: var(--r); }

/* ---------------------------------------------------------------- pages */
.page { max-width: 1320px; margin: 0 auto; padding: 32px var(--gutter) 80px; display: grid; gap: 28px; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
.h1 { font-size: clamp(36px, 5vw, 64px); line-height: .98; letter-spacing: -.025em; font-weight: 700; font-stretch: 88%; }
.h2 { font-size: clamp(26px, 3vw, 36px); letter-spacing: -.02em; font-weight: 700; font-stretch: 90%; }
.lead { font-size: 18px; color: var(--ink-2); max-width: 64ch; margin: 0; }
.big { font-size: 40px; font-weight: 700; font-stretch: 75%; letter-spacing: -.01em; line-height: 1; font-variant-numeric: tabular-nums; }
.grid-cards { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.stack { display: grid; gap: 12px; }
.pill-row { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--night-3); background: transparent; color: var(--ink-2); font-size: 14px; }
.pill[aria-pressed="true"] { background: var(--paper); color: var(--night); border-color: var(--paper); font-weight: 600; }

/* moment cards */
.moment { display: grid; overflow: hidden; color: var(--paper); transition: transform .3s var(--ease), border-color .3s var(--ease); }
.moment:hover { transform: translateY(-3px); border-color: var(--night-4); color: var(--paper); }
.moment .thumb { position: relative; aspect-ratio: 16 / 10; background: var(--night-3); overflow: hidden; }
.moment .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; filter: saturate(.9); }
.moment .thumb .chip { position: absolute; bottom: 10px; right: 10px; background: rgba(11,12,14,.8); }
.moment .body { padding: 14px 16px 16px; display: grid; gap: 6px; }
.moment .title { font-size: 17px; font-weight: 650; }
.moment .meta { font: 13px var(--mono); color: var(--ink-2); }
.progress { height: 4px; background: var(--night-3); border-radius: 2px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--flare); width: 0; transition: width .4s var(--ease); }

/* home hero */
.hero { position: relative; min-height: min(78vh, 760px); display: grid; align-items: end; border-radius: 28px; overflow: hidden; background: var(--night-2); }
.hero canvas, .hero .hero-media { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero .hero-media { object-fit: cover; object-position: 50% 30%; }
.drone-cut { width: 100%; border-radius: var(--r); border: 1px solid var(--night-3); display: block; background: #000; aspect-ratio: 16 / 9; }
.hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(0deg, rgba(11,12,14,.88) 0%, rgba(11,12,14,.55) 32%, rgba(11,12,14,0) 62%); }
.hero .copy { position: relative; z-index: 1; padding: clamp(20px, 4vw, 48px); display: grid; gap: 16px; max-width: 820px; }
.hero .hud { z-index: 1; }
.hero .hud { position: absolute; top: 16px; right: 16px; display: flex; gap: 8px; }
.steps { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.steps .card { padding: 22px; display: grid; gap: 8px; }
.steps .n { font: 500 13px var(--mono); color: var(--flare-2); }

/* pricing */
.plans { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.plan { padding: 22px; display: grid; gap: 12px; align-content: start; }
.plan.pop { border: 2px solid var(--flare); }
.plan ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 14px; }
.plan .btn { margin-top: 8px; }
.table { display: grid; font: 14px var(--mono); }
.table > div { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--night-3); }

/* ---------------------------------------------------------------- viewer page */
.studio { position: fixed; inset: 0; top: 0; display: grid; grid-template-rows: auto 1fr auto; background: var(--night); }
.studio .bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--hair); }
.studio .bar .title { display: grid; gap: 2px; min-width: 0; }
.studio .bar .title b { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.studio .main { display: grid; grid-template-columns: 60px 1fr 340px; min-height: 0; }
.rail { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 8px; border-right: 1px solid var(--hair); overflow-y: auto; }
.rail hr { width: 28px; border: 0; border-top: 1px solid var(--night-3); margin: 6px 0; }
.stage { position: relative; min-width: 0; min-height: 0; background: #07080A; }
.stage canvas.view { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
.stage .overlay { position: absolute; inset: 0; pointer-events: none; }
.stage .hud-tl { position: absolute; left: 14px; top: 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.stage .hud-tr { position: absolute; right: 14px; top: 14px; display: flex; gap: 8px; }
.stage .ruler-label { position: absolute; transform: translate(-50%, -140%); background: var(--paper); color: var(--night); font: 600 13px var(--mono); padding: 4px 8px; border-radius: 6px; }
.stage .loading { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 12px; color: var(--ink-2); font: 14px var(--mono); }
.stage .bignum { position: absolute; left: 18px; bottom: 16px; display: grid; gap: 2px; pointer-events: none; text-shadow: 0 2px 18px rgba(0,0,0,.6); }
.stage .bignum .big { font-size: 56px; }
.coverage { position: absolute; right: 14px; bottom: 14px; width: 132px; height: 132px; pointer-events: none; }
.side { border-left: 1px solid var(--hair); display: grid; grid-template-rows: auto 1fr; min-height: 0; }
.tabs { display: flex; gap: 2px; padding: 8px; border-bottom: 1px solid var(--hair); }
.tabs button { flex: 1; min-height: 38px; border: 0; background: transparent; color: var(--ink-2); border-radius: 10px; font-size: 14px; }
.tabs button[aria-selected="true"] { background: var(--night-3); color: var(--paper); }
.panel { padding: 16px; overflow-y: auto; display: grid; gap: 16px; align-content: start; }
.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.stat-grid .unit { font-size: 13px; color: var(--ink-2); }
.pip { width: 100%; aspect-ratio: 464 / 584; max-height: 300px; border-radius: 12px; background: var(--night-2); display: block; }
.cam-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cam-row .btn { padding: 0 8px; }
.cam-row .btn.near { border-color: var(--flare); }
.keys { display: grid; gap: 6px; }
.keys > div { display: flex; justify-content: space-between; align-items: center; background: var(--night-2); border-radius: 10px; padding: 8px 10px; font: 13px var(--mono); }
.note { font-size: 13px; line-height: 1.45; color: var(--ink-2); margin: 0; }

.timeline { display: grid; grid-template-columns: auto auto 1fr auto auto; align-items: center; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--hair); }
.timeline .time { font: 13px var(--mono); color: var(--ink-2); font-variant-numeric: tabular-nums; min-width: 104px; }
.scrub { position: relative; height: 48px; cursor: pointer; touch-action: none; }
.scrub canvas { width: 100%; height: 100%; display: block; }
.play { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--paper); color: var(--night); display: grid; place-items: center; }
select.rate { min-height: 36px; background: var(--night-2); border: 1px solid var(--night-3); border-radius: 10px; padding: 0 8px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--paper); color: var(--night); padding: 12px 18px; border-radius: 12px; font-weight: 600; z-index: 99; box-shadow: 0 10px 40px rgba(0,0,0,.4); }
.keys-help { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: grid; place-items: center; z-index: 50; }
.keys-help .card { padding: 24px; max-width: 460px; display: grid; gap: 10px; }
.keys-help kbd { font: 12px var(--mono); background: var(--night-3); padding: 3px 7px; border-radius: 6px; }

/* upload wizard */
.drop { border: 2px dashed var(--night-4); border-radius: 22px; padding: 48px 24px; display: grid; place-items: center; gap: 12px; text-align: center; transition: border-color .2s, background .2s; }
.drop.over { border-color: var(--flare); background: rgba(255, 90, 31, .05); }
.steps-bar { display: flex; gap: 8px; flex-wrap: wrap; }
.steps-bar span { font: 500 12px var(--mono); letter-spacing: .1em; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--night-3); color: var(--ink-3); }
.steps-bar span.on { background: var(--flare); border-color: var(--flare); color: var(--night); }
.steps-bar span.done { background: var(--night-2); color: var(--ink-2); }
.cam-cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.cam-card { overflow: hidden; display: grid; }
.cam-card video { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--night-3); display: block; }
.cam-card .body { padding: 14px; display: grid; gap: 8px; }
.cam-card.warn { border: 2px solid var(--flare); }
.field { display: grid; gap: 6px; font-size: 14px; }
.field input, .field select { width: 100%; min-width: 0; min-height: 44px; background: var(--night); border: 1px solid var(--night-4); border-radius: 10px; padding: 0 12px; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 14px; }
.checks li { display: flex; justify-content: space-between; gap: 12px; }
.ok { color: var(--flare-2); }

@media (max-width: 1000px) {
  .studio .main { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .rail { flex-direction: row; border-right: 0; border-top: 1px solid var(--hair); order: 2; overflow-x: auto; }
  .rail hr { width: 1px; height: 28px; border-top: 0; border-left: 1px solid var(--night-3); margin: 0 6px; }
  .side { display: none; }
  .side.open { display: grid; position: fixed; inset: auto 0 0 0; max-height: 60vh; background: var(--night); z-index: 30; border-top: 1px solid var(--hair); border-left: 0; }
  .timeline { grid-template-columns: auto 1fr auto; }
  .timeline .time, .timeline .extra { display: none; }
  .stage .bignum .big { font-size: 40px; }
  .coverage { width: 96px; height: 96px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

.legal h2 { font-size: 22px; margin-top: 12px; } .legal h3 { font-size: 17px; } .legal p, .legal li { color: var(--ink-2); max-width: 70ch; } .legal ul { display: grid; gap: 4px; }
table.admin { border-collapse: collapse; font-size: 13px; min-width: 100%; } table.admin th, table.admin td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--night-3); white-space: nowrap; } table.admin th { color: var(--ink-2); font: 500 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
