/* ============================================================
   ONE ROOF LABS — dark intelligence system
   Derived from logo 07: mono ink-on-paper, inverted to dark.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600;700;800;900&family=Hanken+Grotesk:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=JetBrains+Mono:wght@300;400;500;600&display=swap');

:root {
  /* warm near-black surfaces */
  --bg:        #100D09;
  --bg-2:      #16120D;
  --surface:   #1A150F;
  --surface-2: #221C14;
  --hair:      rgba(241,230,207,0.10);
  --hair-2:    rgba(241,230,207,0.18);

  /* paper becomes the ink */
  --paper:     #F1E6CF;
  --paper-dim: #C9BEA6;
  --ink:       #F1E6CF;
  --muted:     #9A8E78;
  --faint:     #6B6253;

  /* damage score scale — harmonized warm oklch */
  --score-high: oklch(0.63 0.18 28);   /* red    75-100 */
  --score-med:  oklch(0.74 0.14 62);   /* amber  50-74  */
  --score-low:  oklch(0.83 0.13 92);   /* yellow 25-49  */
  --score-ok:   oklch(0.70 0.11 150);  /* green  0-24   */

  --display: 'Cinzel', serif;
  --body: 'Hanken Grotesk', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;

  --maxw: 1280px;
  --gut: 40px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: var(--paper); color: var(--bg); }

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ---- type scale ---- */
.display {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.02;
}
.kicker {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
}
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.tnum { font-variant-numeric: tabular-nums; }

.lead {
  font-size: 21px;
  line-height: 1.55;
  color: var(--paper-dim);
  font-weight: 400;
}

/* ---- layout ---- */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gut); }
.section { padding: 120px 0; position: relative; }
.section--tight { padding: 84px 0; }

/* ---- coordinate grid backdrop ---- */
.gridlines {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--hair) 1px, transparent 1px),
    linear-gradient(90deg, var(--hair) 1px, transparent 1px);
  background-size: 80px 80px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 30%, transparent 80%);
          mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 30%, transparent 80%);
  opacity: 0.6;
}

/* corner ticks helper */
.ticked { position: relative; }
.ticked::before, .ticked::after {
  content: ""; position: absolute; width: 9px; height: 9px;
  border: 1px solid var(--hair-2); pointer-events: none;
}
.ticked::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.ticked::after  { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--gut);
  background: linear-gradient(180deg, rgba(16,13,9,0.92), rgba(16,13,9,0.55) 70%, transparent);
  backdrop-filter: blur(6px);
}
.nav.scrolled {
  background: rgba(16,13,9,0.94);
  border-bottom: 1px solid var(--hair);
  backdrop-filter: blur(14px);
}
.nav-logo { display: flex; align-items: center; gap: 2px; cursor: pointer; }
.nav-logo .ring { width: 30px; height: 30px; }
.nav-logo .wm {
  font-family: var(--display); font-weight: 600; font-size: 21px;
  letter-spacing: 0.12em; color: var(--paper);
}
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-link {
  font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted);
  padding: 8px 14px; transition: color 0.2s; position: relative;
}
.nav-link:hover { color: var(--paper); }
.nav-link.active { color: var(--paper); }
.nav-link.active::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 2px;
  height: 1px; background: var(--paper);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 13px; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 14px 24px; border: 1px solid var(--paper);
  background: var(--paper); color: var(--bg);
  cursor: pointer; transition: all 0.18s; white-space: nowrap;
}
.btn:hover { background: transparent; color: var(--paper); }
.btn .arrow { transition: transform 0.18s; }
.btn:hover .arrow { transform: translateX(4px); }
.btn--ghost {
  background: transparent; color: var(--paper);
  border-color: var(--hair-2);
}
.btn--ghost:hover { border-color: var(--paper); background: rgba(241,230,207,0.05); }

/* ============================================================
   CARDS / SURFACES
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--hair);
  padding: 32px;
  position: relative;
  transition: border-color 0.25s, background 0.25s;
}
.card:hover { border-color: var(--hair-2); }

.spec-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 14px 0; border-bottom: 1px solid var(--hair);
  font-family: var(--mono); font-size: 14px;
}
.spec-row:last-child { border-bottom: 0; }
.spec-row .k { color: var(--muted); letter-spacing: 0.04em; }
.spec-row .v { color: var(--paper); }

/* stat */
.stat-num {
  font-family: var(--mono); font-weight: 300;
  font-size: clamp(38px, 3.6vw, 52px); line-height: 1;
  color: var(--paper); letter-spacing: -0.01em;
}
.stat-label {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted); margin-top: 12px;
}

/* score chips */
.score-dot { width: 10px; height: 10px; display: inline-block; flex-shrink: 0; }
.s-high { background: var(--score-high); }
.s-med  { background: var(--score-med); }
.s-low  { background: var(--score-low); }
.s-ok   { background: var(--score-ok); }
.c-high { color: var(--score-high); }
.c-med  { color: var(--score-med); }
.c-low  { color: var(--score-low); }
.c-ok   { color: var(--score-ok); }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  border-top: 1px solid var(--hair);
  background: var(--bg-2);
  padding: 80px 0 48px;
}
.footer-tagline {
  font-family: var(--display); font-style: italic; font-weight: 400;
  font-size: 22px; color: var(--paper-dim); letter-spacing: 0.04em;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes scanSweep {
  0% { transform: translateY(-100%); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(100vh); opacity: 0; }
}
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s cubic-bezier(.2,.7,.3,1), transform 0.7s cubic-bezier(.2,.7,.3,1); }
.reveal.in { opacity: 1; transform: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 860px) {
  :root { --gut: 22px; }
  body { font-size: 16px; }
  .section { padding: 80px 0; }
  .nav-links { display: none; }
  .lead { font-size: 18px; }
}

/* ============================================================
   EMBEDDED INTERACTIVE MAP (single-page section)
   ============================================================ */
.map-frame { width: 100%; max-width: 1560px; margin: 40px auto 0; padding: 0 var(--gut); }
.map-embed {
  position: relative; display: flex; overflow: hidden;
  height: clamp(560px, 80vh, 880px);
  border: 1px solid var(--hair-2); background: #0A0906;
}
.intel {
  width: 318px; flex-shrink: 0; height: 100%; overflow-y: auto;
  border-right: 1px solid var(--hair); background: var(--bg-2);
  display: flex; flex-direction: column;
}
.intel-top { padding: 22px 24px 20px; border-bottom: 1px solid var(--hair); }
.intel-search { padding: 16px 24px; border-bottom: 1px solid var(--hair); }
.search-field {
  width: 100%; background: var(--surface); border: 1px solid var(--hair);
  color: var(--paper); font-family: var(--mono); font-size: 13px;
  padding: 11px 13px; outline: none;
}
.search-field:focus { border-color: var(--hair-2); }
.search-field::placeholder { color: var(--faint); }
.intel-block { padding: 22px 24px; border-bottom: 1px solid var(--hair); }
.intel-foot { padding: 16px 24px; margin-top: auto; }
.intel-foot .spec-row { font-size: 11.5px; padding: 9px 0; }

.dist-row {
  display: grid; grid-template-columns: 14px 56px 1fr auto; align-items: center; gap: 10px;
  width: 100%; background: none; border: 0; padding: 8px 0; cursor: pointer; text-align: left;
}
.dist-range { font-size: 11.5px; color: var(--muted); }
.dist-bar { height: 7px; background: rgba(241,230,207,0.06); position: relative; }
.dist-bar > span { position: absolute; left: 0; top: 0; bottom: 0; transition: width .4s; }
.dist-count { font-size: 12px; color: var(--paper); text-align: right; }

.map-stage { flex: 1; position: relative; overflow: hidden; background: #0A0806; touch-action: none; }
.roof { transition: opacity .2s; cursor: pointer; }
.roof:hover { stroke: var(--paper); stroke-width: 1.5; }
.roof.sel { stroke: var(--paper); stroke-width: 2.5; }

.map-scan {
  position: absolute; top: 0; left: 0; width: 140px; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(241,230,207,0.05) 70%, rgba(241,230,207,0.16));
  border-right: 1px solid rgba(241,230,207,0.35);
  animation: mapSweep 9s linear infinite; pointer-events: none; mix-blend-mode: screen;
}
@keyframes mapSweep { 0% { left: -160px; } 100% { left: 100%; } }
@media (prefers-reduced-motion: reduce) { .map-scan { display: none; } }

.map-hud-top {
  position: absolute; top: 16px; left: 20px; right: 20px; display: flex; justify-content: space-between;
  font-size: 11px; letter-spacing: 0.16em; color: var(--muted); pointer-events: none;
}
.map-hud-top span { white-space: nowrap; }
.map-legend {
  position: absolute; left: 20px; bottom: 18px; display: flex; flex-direction: column; gap: 8px;
  background: rgba(10,8,6,0.82); border: 1px solid var(--hair); padding: 13px 15px;
}
.leg-item { display: flex; align-items: center; gap: 10px; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.leg-item i { width: 10px; height: 10px; }
.map-zoom { position: absolute; right: 20px; bottom: 18px; display: flex; flex-direction: column; gap: 6px; }
.map-zoom button {
  width: 38px; height: 38px; background: rgba(10,8,6,0.85); border: 1px solid var(--hair);
  color: var(--paper); font-size: 17px; cursor: pointer; font-family: var(--mono);
  display: grid; place-items: center;
}
.map-zoom button:hover { border-color: var(--paper); background: var(--surface); }
.map-hint {
  position: absolute; top: 44px; left: 50%; transform: translateX(-50%);
  font-size: 10.5px; letter-spacing: 0.2em; color: var(--faint); pointer-events: none; white-space: nowrap;
}

.report {
  position: absolute; top: 0; right: 0; width: 360px; height: 100%; overflow-y: auto;
  background: var(--bg-2); border-left: 1px solid var(--hair-2); padding: 22px 24px 36px;
  display: flex; flex-direction: column; gap: 16px;
  box-shadow: -30px 0 60px rgba(0,0,0,0.4);
  animation: reportIn .28s cubic-bezier(.2,.7,.3,1);
}
@keyframes reportIn { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.report-hd { display: flex; justify-content: space-between; align-items: flex-start; }
.report-x {
  width: 30px; height: 30px; border: 1px solid var(--hair); background: transparent;
  color: var(--muted); cursor: pointer; font-size: 13px;
}
.report-x:hover { color: var(--paper); border-color: var(--paper); }
.report-score {
  display: flex; justify-content: space-between; align-items: flex-start;
  border-left: 3px solid; padding: 14px 16px; background: var(--surface);
}
.ortho { position: relative; aspect-ratio: 16/10; background: #0C0A07; border: 1px solid var(--hair); overflow: hidden; }
.ortho-grid { position: absolute; inset: 0; background-image: repeating-linear-gradient(45deg, rgba(241,230,207,0.05) 0 1px, transparent 1px 9px); }
.roof-poly { position: absolute; left: 28%; top: 30%; width: 44%; height: 40%; border: 1.5px solid; transform: rotate(-4deg); }

@media (max-width: 860px) {
  .intel { display: none; }
  .report { width: 100%; }
  .map-embed { height: 70vh; }
}
