/* InspectIA — EMPIRE house tokens + per-project accent/display only. */

:root {
  --font-display: 'Syne', 'Inter', sans-serif;
  --accent: #c45c26;
  --accent-hover: #a84d1f;
  --accent-subtle: #f6ebe4;
  --accent-on: #ffffff;
}

html { scroll-behavior: smooth; }
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.03em; text-wrap: balance; }
h1 { font-weight: 700; line-height: 1.12; }
h2 { font-weight: 650; line-height: 1.2; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.skip {
  position: absolute; left: -999px;
}
.skip:focus { left: var(--space-2); top: var(--space-2); background: var(--surface); padding: var(--space-2) var(--space-3); z-index: 80; box-shadow: var(--focus); }

body.site::after {
  content: "";
  position: fixed; inset: 0; pointer-events: none; z-index: 60;
  opacity: 0.035;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* —— buttons —— */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  border: 0; border-radius: var(--radius-full);
  padding: 10px 16px;
  min-height: 40px;
  text-decoration: none; font-weight: 600; font-size: 0.9375rem;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out), background var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: scale(0.98); }
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn .ico {
  width: 22px; height: 22px; border-radius: var(--radius-full);
  display: grid; place-items: center;
  background: rgb(255 255 255 / .16); font-size: 12px;
}
.btn-primary { background: var(--text); color: var(--bg); }
.btn-primary:hover { background: #111113; }
.btn-ghost { background: transparent; border: 1px solid var(--border-strong); color: var(--text); }
.btn-ghost:hover { background: var(--bg-muted); }
.btn-accent { background: var(--accent); color: var(--accent-on); }
.btn-accent:hover { background: var(--accent-hover); }
.btn-big { min-height: 48px; padding: 12px 18px; font-size: 1rem; }
.btn-link { background: none; border: 0; color: var(--text-muted); min-height: 40px; padding: 8px; }
.btn-link:hover { color: var(--text); }

/* —— marketing nav —— */
.nav {
  position: sticky; top: var(--space-3); z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1200px; margin: var(--space-3) auto 0; padding: 6px 8px 6px 14px;
  background: rgb(255 255 255 / .88);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(16px);
  height: 56px;
}
.brand { display: flex; align-items: center; gap: var(--space-2); text-decoration: none; font-weight: 650; letter-spacing: -0.02em; }
.brand img { width: 28px; height: 28px; border-radius: var(--radius-sm); object-fit: cover; }
.nav-links { display: flex; gap: var(--space-6); font-size: 0.875rem; color: var(--text-muted); font-weight: 500; }
.nav-links a { text-decoration: none; }
.nav-links a:hover { color: var(--text); }
.nav-cta { display: flex; gap: var(--space-2); }

/* —— landing —— */
.hero {
  max-width: 1200px; margin: 0 auto; padding: var(--space-8) var(--space-5) var(--space-12);
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: var(--space-10); align-items: end;
  min-height: calc(100dvh - 80px);
}
.kicker {
  font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent); font-weight: 600; margin: 0 0 var(--space-3);
}
.hero h1 { font-size: clamp(2.25rem, 5vw, 3.75rem); margin: 0 0 var(--space-4); max-width: 16ch; }
.lede { font-size: 1.125rem; line-height: 1.5; color: var(--text-muted); max-width: 42ch; margin: 0 0 var(--space-6); }
.hero-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.hero-visual {
  padding: var(--space-1); background: var(--bg-muted);
  border-radius: var(--radius-2xl); box-shadow: var(--ring);
}
.hero-visual img { width: 100%; height: min(58vh, 520px); object-fit: cover; border-radius: calc(var(--radius-2xl) - 4px); }
.hero-cap {
  display: flex; justify-content: space-between; gap: var(--space-3);
  padding: var(--space-3) var(--space-2) var(--space-1);
  font-size: 0.75rem; color: var(--text-subtle); font-family: var(--font-mono);
}

.section { max-width: 1200px; margin: 0 auto; padding: var(--space-20) var(--space-5); }
.section h2 { font-size: clamp(1.75rem, 3vw, 2.5rem); margin: 0 0 var(--space-3); }
.sub { color: var(--text-muted); max-width: 54ch; margin: 0 0 var(--space-8); }

.process {
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: var(--space-8); align-items: start;
}
.process ol { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-5); }
.process li { display: grid; grid-template-columns: 48px 1fr; gap: var(--space-4); }
.process .n {
  font-family: var(--font-mono); font-size: 0.8125rem; color: var(--accent);
  padding-top: 4px;
}
.process h3 { margin: 0 0 4px; font-size: 1.125rem; font-family: var(--font-sans); letter-spacing: -0.018em; font-weight: 600; }
.process p { margin: 0; color: var(--text-muted); }
.process figure {
  margin: 0; border-radius: var(--radius-xl); overflow: hidden; box-shadow: var(--shadow-lg);
}
.process img { width: 100%; height: 100%; min-height: 360px; object-fit: cover; }

.proof {
  display: grid; gap: var(--space-6);
}
.proof-metric {
  padding: var(--space-8) 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.proof-metric .stat { font-size: clamp(2.5rem, 6vw, 4.5rem); letter-spacing: -0.04em; font-weight: 650; font-family: var(--font-display); margin: 0; }
.proof-metric .stat span { display: block; font-size: 0.9375rem; color: var(--text-muted); font-weight: 500; letter-spacing: 0; font-family: var(--font-sans); margin-top: var(--space-3); max-width: 56ch; }
.note { color: var(--text-muted); max-width: 62ch; margin: 0; }

footer.site { border-top: 1px solid var(--border); padding: var(--space-8) var(--space-5) var(--space-16); color: var(--text-subtle); font-size: 0.8125rem; }
.foot { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; gap: var(--space-5); flex-wrap: wrap; }

/* —— app chrome (Linear inverted-L, light) —— */
.app-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 100dvh;
  background: var(--bg-subtle);
}
.side {
  background: var(--bg);
  border-right: 1px solid var(--border);
  padding: var(--space-5) var(--space-3);
  z-index: 2;
}
.side .brand { margin: 0 var(--space-2) var(--space-8); color: var(--text); }
.side nav { display: grid; gap: 2px; }
.side a {
  color: var(--text-muted); text-decoration: none;
  display: block; padding: 8px 12px; border-radius: var(--radius-md);
  font-size: 0.875rem; font-weight: 500; min-height: 36px;
}
.side a:hover { background: var(--bg-muted); color: var(--text); }
.side a.active { background: var(--bg-muted); color: var(--text); font-weight: 600; }
.side .org { margin-top: var(--space-8); padding: 0 var(--space-3); font-size: 0.75rem; color: var(--text-subtle); }
.app-mobile { display: none; }
.main { padding: var(--space-6) var(--space-8) var(--space-16); min-width: 0; overflow-x: hidden; }
.topbar { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-4); margin-bottom: var(--space-6); }
.topbar h1 { font-size: 1.75rem; margin: 0; }
.topbar .addr { color: var(--text-muted); margin: var(--space-1) 0 0; font-size: 0.9375rem; }

.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-3); margin-bottom: var(--space-6); }
.kpi {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: var(--space-4) var(--space-5);
}
.kpi b { display: block; font-size: 1.5rem; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.kpi span { color: var(--text-subtle); font-size: 0.8125rem; }

.object-row {
  display: grid; grid-template-columns: 1.4fr 1.6fr 140px 1.2fr 40px;
  gap: var(--space-4); align-items: center;
  min-height: 56px; padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  text-decoration: none;
}
.object-row:first-of-type { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.object-list { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); }
.object-head {
  display: grid; grid-template-columns: 1.4fr 1.6fr 140px 1.2fr 40px;
  gap: var(--space-4); padding: var(--space-2) var(--space-4);
  font-size: 0.75rem; color: var(--text-subtle); font-weight: 600;
}
.object-row:hover { background: var(--bg-subtle); }
.object-row .title { font-weight: 600; }
.object-row .next { color: var(--text-muted); font-size: 0.875rem; }
.empty {
  padding: var(--space-10); text-align: center; color: var(--text-muted);
}

.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: var(--space-5);
}
.panel h3 { margin: 0 0 var(--space-3); font-size: 1rem; font-family: var(--font-sans); letter-spacing: -0.018em; }

.kind, .st {
  display: inline-flex; align-items: center;
  font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: 0.02em;
  padding: 3px 8px; border-radius: var(--radius-sm); font-weight: 500;
  background: var(--bg-muted); color: var(--text-muted);
}
.kind.OBSERVED, .st-ok, .st-VALIDATED { background: #ecf8f0; color: #166534; }
.kind.MEASURED { background: #eef2ff; color: #3730a3; }
.kind.ESTIMATED, .kind.INFERRED, .st-warn, .st-REVIEW_REQUIRED { background: #fff7ed; color: #9a3412; }
.kind.REGULATORY { background: var(--bg-muted); color: var(--text); }
.st-bad, .st-REJECTED { background: #fef2f2; color: #991b1b; }
.st-DRAFT { background: var(--bg-muted); color: var(--text-subtle); }

.tabs { display: flex; gap: var(--space-1); margin: 0 0 var(--space-6); border-bottom: 1px solid var(--border); }
.tabs a {
  padding: 10px 12px; text-decoration: none; font-size: 0.875rem; font-weight: 500;
  color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs a:hover { color: var(--text); }
.tabs a.active { color: var(--text); border-bottom-color: var(--text); }

.workspace { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); gap: var(--space-4); }

.thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-2); }
.thumbs img { height: 120px; width: 100%; object-fit: cover; border-radius: var(--radius-md); }
.stack { display: grid; gap: var(--space-3); }
.muted { color: var(--text-muted); }
.warn-box {
  background: var(--accent-subtle); border: 1px solid #ead5c6;
  padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); font-size: 0.875rem;
}

.form { display: grid; gap: var(--space-3); max-width: 560px; }
label { display: grid; gap: 6px; font-size: 0.875rem; font-weight: 600; }
input, select, textarea {
  border: 1px solid var(--border-strong); border-radius: var(--radius-md);
  padding: 10px 12px; background: var(--surface); min-height: 44px;
}
input:focus, select:focus, textarea:focus { outline: none; box-shadow: var(--focus); border-color: var(--accent); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }

/* —— capture (terrain: high contrast, no glass) —— */
.capture { background: #121417; color: #f4f4ef; min-height: 100dvh; padding: var(--space-4); }
.capture .nav { background: #1a1d21; border-color: #3a3d42; box-shadow: none; backdrop-filter: none; }
.capture .nav a, .capture .brand { color: #f4f4ef; }
.capture .muted { color: #c5c8c3; }
.shot-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-3); max-width: 720px; margin: var(--space-5) auto; }
.shot {
  display: flex; justify-content: space-between; align-items: center; gap: var(--space-3);
  background: #1c2026; border-radius: var(--radius-lg); padding: var(--space-4);
  min-height: 72px; border: 1px solid #3a3d42;
}
.shot h3 { margin: 0; font-size: 1.125rem; font-family: var(--font-sans); letter-spacing: 0; }
.shot p { margin: 4px 0 0; color: #c5c8c3; font-size: 0.875rem; }
.file-btn { position: relative; overflow: hidden; isolation: isolate; }
.file-btn input[type=file] {
  position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%;
  cursor: pointer; font-size: 0; z-index: 2;
}
.capture .warn-box { background: #2a2118; border-color: #6b4a2a; color: #f4e6d4; }
.shot.done { border-color: #2f6b4a; }

.client { max-width: 860px; margin: 0 auto; padding: var(--space-6) var(--space-4) var(--space-20); }
.client h1 { font-size: 2.25rem; margin: 0 0 var(--space-3); }
.client .lede { margin-bottom: var(--space-6); }
.client .scene-hero { margin: 0 0 24px; }

/* —— 3D twin —— */
#scene, .scene-hero {
  width: 100%; height: min(56vh, 560px); min-height: 320px;
  border-radius: var(--radius-lg); background: #d8ddd4;
  overflow: hidden; border: 1px solid var(--border); position: relative;
}
#scene canvas { display: block; width: 100% !important; height: 100% !important; touch-action: none; }
.scene-caption { margin-top: 8px; }
.scene-hud {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: space-between;
  pointer-events: none; z-index: 2; padding: 8px;
}
.scene-hud-rich .scene-top,
.scene-hud-rich .scene-bottom {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-end;
  justify-content: space-between; pointer-events: none;
}
.scene-modes, .scene-views, .scene-tools, .scene-layers {
  display: flex; gap: 6px; flex-wrap: wrap; pointer-events: auto;
}
.scene-hud button {
  min-height: 40px; padding: 8px 12px; border: 1px solid #3a3d42;
  background: #1a1d21; color: #f4f4ef; font-weight: 650; font-size: 0.8125rem;
  border-radius: 999px; cursor: pointer;
}
.scene-hud button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.scene-readout {
  margin: 0; pointer-events: none;
  background: #1a1d21; color: #f4f4ef;
  font-size: 0.75rem; font-weight: 600;
  padding: 6px 10px; border-radius: 8px; max-width: 100%;
}
.scene-inspector {
  pointer-events: auto;
  position: absolute; right: 10px; top: 56px;
  background: #1a1d21; color: #f4f4ef;
  padding: 10px 12px; border-radius: 10px; max-width: 240px;
  font-size: 0.8125rem;
}
.scene-inspector strong { display: block; margin-bottom: 4px; }
.scene-inspector p { margin: 0 0 4px; color: #c5c8c3; }
.scene-stick[hidden] { display: none !important; }
.scene-stick {
  pointer-events: auto;
  position: absolute; left: 10px; bottom: 88px;
  display: grid; gap: 6px; justify-items: center;
}
.scene-stick button {
  width: 52px; height: 52px; min-height: 52px; padding: 0;
  border-radius: 14px; font-size: 1rem;
}
.scene-stick div { display: flex; gap: 6px; }
#scene, .scene-hero {
  height: min(64vh, 640px);
}

.mini-kpis {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  margin: 0 0 12px;
}
.mini-kpis div {
  background: var(--bg-muted); border-radius: var(--radius-md); padding: 10px 8px; text-align: center;
}
.mini-kpis b { display: block; font-size: 1.25rem; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.mini-kpis span { font-size: 0.75rem; color: var(--text-muted); }

.measure-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px;
}
.measure {
  background: var(--bg-muted); border-radius: var(--radius-md); padding: 10px 12px;
}
.measure-val { margin: 0 0 4px; font-weight: 650; font-variant-numeric: tabular-nums; }

.photo-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-3); margin-top: 16px;
}
.photo-card { margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.photo-card img { width: 100%; height: 220px; object-fit: cover; }
.photo-card figcaption {
  padding: 8px 12px; font-size: 0.75rem; color: var(--text-muted); font-family: var(--font-mono);
}

.shot-thumb {
  width: 64px; height: 64px; object-fit: cover; border-radius: 10px; flex: 0 0 64px;
  border: 2px solid #2f6b4a;
}
.shot-copy { flex: 1; min-width: 0; }
.shot-copy h3 { overflow-wrap: anywhere; }

@media (max-width: 860px) {
  .hero, .process, .workspace, .app-shell, .kpis, .form-row,
  .object-row, .object-head { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .hero { padding-top: var(--space-5); }
  .hero h1 { font-size: 2.25rem; max-width: none; }
  .side { display: none; }
  .app-mobile {
    display: flex; align-items: center; gap: var(--space-4);
    padding: var(--space-3) var(--space-4);
    background: var(--bg); border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 10;
  }
  .app-mobile a { font-size: 0.875rem; font-weight: 600; text-decoration: none; color: var(--text); min-height: 44px; display: inline-flex; align-items: center; }
  .app-shell { grid-template-columns: 1fr; }
  .main { padding: var(--space-4); padding-bottom: 96px; }
  .btn-big { width: 100%; min-height: 52px; }
  .object-head { display: none; }
  .object-row { gap: var(--space-2); min-height: 64px; }
  .tabs {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px;
    margin: 0; border-bottom: 0; border-top: 1px solid var(--border);
    background: var(--bg);
    padding: 8px 8px calc(10px + env(safe-area-inset-bottom));
  }
  .tabs a {
    min-height: 52px; margin: 0; padding: 8px 4px;
    display: flex; align-items: center; justify-content: center;
    border-bottom: 0; border-radius: 12px;
    font-size: 0.8125rem; font-weight: 650; color: var(--text);
  }
  .tabs a.active {
    background: var(--accent); color: #fff; border-bottom-color: transparent;
  }
  #scene, .scene-hero { height: min(52vh, 480px); min-height: 280px; }
  .scene-hud button { min-height: 48px; padding: 10px 12px; font-size: 0.8125rem; }
  .photo-card img { height: 200px; }
  .mini-kpis { grid-template-columns: repeat(3, 1fr); }
  .decision { order: 2; }
  .workspace > div:first-child { order: 1; }
  .shot {
    display: grid;
    grid-template-columns: 64px 1fr;
    grid-template-areas: "thumb copy" "btn btn";
    align-items: center;
  }
  .shot-thumb { grid-area: thumb; }
  .shot-copy { grid-area: copy; }
  .shot .file-btn, .shot .btn { grid-area: btn; width: 100%; }
}
