/* drone.licketysplitconstruction.ca -- one stylesheet, one responsive page.
   Palette per reference/drone_site_brief.md section 7: near-black ground,
   off-white type, one boreal-lake blue accent; colour comes from the imagery.
   Dark-first, with a light variant under prefers-color-scheme. Every colour
   is a token on :root and is redefined, never introduced, in the media query. */

:root {
  color-scheme: dark;
  --ground: #0f1417;
  --ground-2: #161d22;
  --ground-3: #1e272d;
  --line: #2a353c;
  --ink: #e8edf0;        /* 15.4:1 on --ground */
  --ink-2: #aab5bc;      /*  8.6:1 on --ground */
  --ink-3: #7f8c94;      /*  5.0:1 on --ground: captions, never below this */
  --accent: #63c7ea;     /*  9.6:1 on --ground */
  --accent-ink: #0b1418; /* text on an accent button */
  --accent-soft: rgba(99, 199, 234, 0.14);
  --todo: #f2a51a;
  --todo-ink: #1a1200;
  --shadow: 0 1px 0 rgba(0,0,0,.4), 0 12px 32px rgba(0,0,0,.35);
  --radius: 8px;
  --font: Inter, "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --wrap: 1120px;
  --gutter: clamp(16px, 4vw, 40px);
}
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --ground: #f5f7f8;
    --ground-2: #ffffff;
    --ground-3: #e9eef1;
    --line: #d3dbe0;
    --ink: #14191c;
    --ink-2: #3f4b52;
    --ink-3: #5b6970;    /* 5.4:1 on --ground */
    --accent: #0b6d8c;   /* 6.0:1 on --ground */
    --accent-ink: #ffffff;
    --accent-soft: rgba(11, 109, 140, 0.10);
    --shadow: 0 1px 0 rgba(0,0,0,.05), 0 12px 32px rgba(20,30,40,.12);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img, video { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
h1, h2, h3 { font-weight: 700; letter-spacing: -0.015em; line-height: 1.15; margin: 0 0 0.5em; }
h1 { font-size: clamp(2rem, 5.2vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 3.2vw, 2.1rem); }
h3 { font-size: 1.2rem; font-weight: 600; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
strong { font-weight: 600; }
.num, .stat-n, td, .counter { font-variant-numeric: tabular-nums; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding-inline: var(--gutter); }
.muted { color: var(--ink-2); }
.small { font-size: 0.92rem; }
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; min-width: 420px; font-size: 0.95rem; }
th, td { text-align: left; padding: 0.55em 0.8em; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--ink-2); font-weight: 600; }
ul { padding-left: 1.2em; }
li { margin-bottom: 0.3em; }

/* skip link */
.skip { position: absolute; left: 8px; top: -60px; background: var(--accent); color: var(--accent-ink);
  padding: 0.5em 1em; border-radius: var(--radius); z-index: 100; font-weight: 600; }
.skip:focus { top: 8px; }

/* draft-only chips: build_site.py --draft renders every unfilled config key as one */
.todo { background: var(--todo); color: var(--todo-ink); font-weight: 700; font-size: 0.8em;
  padding: 0.1em 0.5em; border-radius: 4px; white-space: nowrap; letter-spacing: 0.02em; }

/* ---------- nav ---------- */
.nav { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--ground) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; }
.brand { color: var(--ink); text-decoration: none; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; }
.brand small { display: block; font-weight: 500; color: var(--ink-3); font-size: 0.72rem; letter-spacing: 0.02em; }
.nav-links { display: flex; align-items: center; gap: 4px 22px; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--ink-2); text-decoration: none; font-weight: 500; padding: 0.4em 0; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); color: var(--ink); font: inherit;
  font-weight: 600; padding: 0.45em 0.9em; border-radius: var(--radius); cursor: pointer; }
.btn { display: inline-block; background: var(--accent); color: var(--accent-ink); text-decoration: none;
  font-weight: 700; padding: 0.7em 1.15em; border-radius: var(--radius); border: 0; font: inherit; font-weight: 700;
  cursor: pointer; line-height: 1.2; }
.btn:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--ink-2); }
.btn-ghost:hover { border-color: var(--ink); filter: none; }
.btn-sm { padding: 0.5em 0.9em; font-size: 0.95rem; }
@media (max-width: 820px) {
  .nav-toggle { display: inline-block; }
  .nav-cta { display: none; }
  .nav-links { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column;
    align-items: stretch; gap: 0; background: var(--ground-2); border-bottom: 1px solid var(--line);
    padding: 8px var(--gutter) 16px; box-shadow: var(--shadow); }
  .nav-links a { display: block; padding: 0.75em 0; border-bottom: 1px solid var(--line); }
  .nav-links li:last-child a { border-bottom: 0; }
  .nav.is-open .nav-links { display: flex; }
  .nav-links .btn { margin-top: 12px; text-align: center; }
}
@media (min-width: 821px) { .nav-links .nav-cta-mobile { display: none; } }

/* ---------- hero ---------- */
.hero { position: relative; min-height: min(78vh, 760px); display: flex; align-items: flex-end;
  background: var(--ground-3); overflow: hidden; }
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(15,20,23,.15) 0%, rgba(15,20,23,.35) 45%, rgba(15,20,23,.9) 100%); }
.hero .wrap { position: relative; z-index: 1; width: 100%; padding-block: clamp(48px, 9vw, 120px) 24px; }
.hero h1 { max-width: 15ch; color: #f4f7f9; text-shadow: 0 1px 2px rgba(0,0,0,.5); }
.hero .sub { max-width: 58ch; font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: #d9e1e6; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.hero .btn-ghost { color: #f4f7f9; border-color: #c9d3d9; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 1.4em; }
.hero .cap { position: relative; z-index: 1; color: #b9c4cb; }
.cap { font-size: 0.85rem; color: var(--ink-3); margin-top: 0.6em; line-height: 1.45; }
.cap b { color: var(--ink-2); font-weight: 600; }
.hero-cap { background: var(--ground); }
.hero-cap .cap { margin: 0; padding: 10px 0; border-bottom: 1px solid var(--line); }

/* ---------- sections ---------- */
.section { padding-block: clamp(56px, 8vw, 104px); }
.section + .section { border-top: 1px solid var(--line); }
.section-head { max-width: 62ch; margin-bottom: clamp(24px, 4vw, 40px); }
.kicker { color: var(--accent); font-weight: 600; font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 0.6em; }
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.grid-2 { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.tile { background: var(--ground-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 22px 20px; }
.tile h3 { margin-bottom: 0.4em; }
.tile .fmt { color: var(--ink-2); font-size: 0.92rem; margin-top: 0.8em; }
.tile .fmt b { color: var(--ink); font-weight: 600; }
.note { border-left: 3px solid var(--accent); padding: 0.2em 0 0.2em 1em; color: var(--ink-2); font-size: 0.95rem; margin-top: 1em; }

/* counter band: only rendered when site_config.json stats_verified is true */
.counters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; }
.counter { text-align: left; padding: 18px 0; border-top: 2px solid var(--line); }
.counter .n { font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1; }
.counter .l { color: var(--ink-2); margin-top: 0.4em; }

/* work cards */
.card { background: var(--ground-2); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column; }
.card .media { position: relative; aspect-ratio: 16 / 9; background: var(--ground-3); }
.card .media img { width: 100%; height: 100%; object-fit: cover; }
.card .body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 0.6em; flex: 1; }
.card .stat { color: var(--accent); font-weight: 700; font-size: 1.6rem; letter-spacing: -0.02em; line-height: 1; }
.card h3 { font-size: 1.25rem; font-weight: 700; }
.card .body p { color: var(--ink-2); }
.card .more { margin-top: auto; padding-top: 0.6em; font-weight: 600; }

/* stat block at the top of a case study */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 16px; margin: 1.5em 0; }
.stat-n { font-size: clamp(1.8rem, 3.6vw, 2.6rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1; }
.stat-l { color: var(--ink-2); margin-top: 0.35em; font-size: 0.95rem; }
.stat-box { padding: 18px 0; border-top: 2px solid var(--line); }
.prose { max-width: 68ch; }
.prose h3 { margin-top: 1.6em; }

/* accuracy block, verbatim from the brief, on the home services section and every case study */
.accuracy { background: var(--ground-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 24px; max-width: 78ch; }
.accuracy p { margin: 0; }

/* steps */
.steps { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); counter-reset: step; }
.step { border-top: 2px solid var(--line); padding-top: 14px; }
.step::before { counter-increment: step; content: counter(step, decimal-leading-zero); display: block;
  color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; margin-bottom: 0.4em; }

/* about */
.about { display: grid; gap: 32px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); align-items: start; }
.about figure { margin: 0; }
.about figure img { border-radius: var(--radius); width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--ground-3); }
.about figcaption { margin-top: 0.5em; }
.about .photo-todo { aspect-ratio: 4 / 3; border: 1px dashed var(--line); border-radius: var(--radius);
  display: grid; place-items: center; background: var(--ground-2); }
.trust { list-style: none; padding: 0; margin: 1em 0 0; }
.trust li { padding: 0.55em 0; border-top: 1px solid var(--line); }
.trust li:last-child { border-bottom: 1px solid var(--line); }
.trust b { font-weight: 600; }

/* contact */
.contact { display: grid; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.contact .direct a { font-size: 1.15rem; font-weight: 600; word-break: break-word; }
.contact dl { margin: 0; }
.contact dt { color: var(--ink-3); font-size: 0.85rem; letter-spacing: 0.04em; text-transform: uppercase; margin-top: 1em; }
.contact dd { margin: 0.15em 0 0; }

/* ---------- viewers ---------- */
/* One shell serves the ortho map, the video and the 3D model: a poster, a
   button, and nothing loaded until the button (or, for the case-study map,
   a scroll that brings it into view). */
.viewer { position: relative; background: #0b0f11; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); aspect-ratio: 16 / 9; }
@media (max-width: 640px) { .viewer { aspect-ratio: 4 / 3; } }
.viewer .poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.viewer .map { position: absolute; inset: 0; background: #0b0f11; }
.viewer .overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 10px; background: linear-gradient(180deg, rgba(11,15,17,.15), rgba(11,15,17,.55)); }
.viewer .overlay .hint { color: #d9e1e6; font-size: 0.9rem; text-shadow: 0 1px 2px rgba(0,0,0,.7); text-align: center; padding-inline: 16px; }
.viewer.is-live .poster, .viewer.is-live .overlay { display: none; }
.viewer video { position: absolute; inset: 0; width: 100%; height: 100%; background: #000; }
.viewer model-viewer { position: absolute; inset: 0; width: 100%; height: 100%; background: #0b0f11; --poster-color: transparent; }
.viewer model-viewer img[slot="poster"] { width: 100%; height: 100%; object-fit: cover; }
.leaflet-container { font-family: var(--font); }
.leaflet-container .leaflet-control-attribution { background: rgba(15,20,23,.75); color: #c9d3d9; font-size: 11px; }
.leaflet-container .leaflet-control-attribution a { color: #c9d3d9; }
.leaflet-container .leaflet-control-scale-line { background: rgba(15,20,23,.75); color: #e8edf0; border-color: #c9d3d9; }
.leaflet-bar a { background: var(--ground-2); color: var(--ink); border-bottom-color: var(--line); }
.leaflet-bar a:hover { background: var(--ground-3); }

/* gallery */
.gallery { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.gallery a { display: block; border-radius: 6px; overflow: hidden; background: var(--ground-3); aspect-ratio: 4 / 3; }
.gallery img { width: 100%; height: 100%; object-fit: cover; }

/* case-page hero */
.page-hero { position: relative; aspect-ratio: 21 / 9; min-height: 240px; max-height: 520px; background: var(--ground-3); overflow: hidden; }
.page-hero img { width: 100%; height: 100%; object-fit: cover; }
.page-title { padding-block: clamp(28px, 5vw, 56px) 0; }
.page-title h1 { max-width: 20ch; }
.crumbs { font-size: 0.9rem; color: var(--ink-3); margin-bottom: 1em; }
.crumbs a { color: var(--ink-2); text-decoration: none; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); padding-block: 32px 40px; color: var(--ink-2); font-size: 0.92rem; }
.footer .creds { display: flex; flex-wrap: wrap; gap: 6px 0; padding: 0; margin: 0 0 1em; list-style: none; }
.footer .creds li + li::before { content: "·"; margin: 0 0.6em; color: var(--ink-3); }
.footer .ojep { max-width: 78ch; color: var(--ink-3); }
.footer .fine { margin-top: 1em; color: var(--ink-3); font-size: 0.85rem; }
