/*
 * Public pages (landing + technology). Same palette as the weather dashboard
 * (telemetry/static/telemetry/dashboard.css) so the site reads as one product.
 */
:root {
  --bg: #0f1419;
  --bg-raised: #161b22;
  --card: #181e26;
  --text: #e6edf3;
  --text-strong: #ffffff;
  --muted: #8b949e;
  --border: #30363d;
  --accent: #5dc97c;
  --heat: #ff8a3d;
  --radio: #3fc9ff;
  --bark: #5b4636;
  --sapwood: #d9c38f;
  --heartwood: #9c7a52;
  --radius: 10px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); }
body {
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
}
a { color: var(--accent); }
a:hover { color: var(--text-strong); }
img, svg { max-width: 100%; height: auto; }
.container { max-width: 1120px; margin: 0 auto; padding: 0 1.25rem; }

.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: #0f1419; padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ------------------------------------------------------------------ header / footer */
.site-header { background: var(--bg-raised); border-bottom: 1px solid var(--border); }
.site-header .nav { display: flex; align-items: center; gap: 1.5rem; min-height: 60px; flex-wrap: wrap; }
.brand { color: var(--text-strong); font-weight: 700; letter-spacing: .04em; text-decoration: none; }
.site-header nav { display: flex; gap: 1.25rem; margin-left: auto; flex-wrap: wrap; }
.site-header nav a { color: var(--muted); text-decoration: none; font-size: .95rem; }
.site-header nav a:hover, .site-header nav a[aria-current="page"] { color: var(--text-strong); }
.site-header nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--accent); }
.site-footer { color: var(--muted); font-size: .85rem; text-align: center; padding: 2rem 0; border-top: 1px solid var(--border); margin-top: 4rem; }

/* ------------------------------------------------------------------ type + layout */
.kicker { color: var(--accent); font-size: .8rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; margin: 0 0 .5rem; }
h1, h2, h3 { color: var(--text-strong); line-height: 1.2; font-weight: 650; }
h1 { font-size: clamp(2rem, 4.5vw, 3.1rem); margin: 0 0 1rem; letter-spacing: -.015em; }
h2 { font-size: clamp(1.45rem, 2.6vw, 2rem); margin: 0 0 .75rem; }
h3 { font-size: 1.1rem; margin: 0 0 .4rem; }
.lead { font-size: 1.2rem; color: var(--text); max-width: 46rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
section.band { padding: 4rem 0; border-top: 1px solid var(--border); }
section.band:first-of-type { border-top: none; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 3rem; align-items: center; }
.split.wide-right { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
@media (max-width: 860px) { .split, .split.wide-right { grid-template-columns: minmax(0, 1fr); gap: 2rem; } }

/* ------------------------------------------------------------------ buttons */
.btn { display: inline-flex; align-items: center; gap: .5rem; padding: .7rem 1.2rem; border-radius: 8px; border: 1px solid var(--border);
       color: var(--text-strong); background: transparent; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--accent); color: var(--text-strong); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #0f1419; }
.btn.primary:hover { filter: brightness(1.08); color: #0f1419; }
.btn small { font-weight: 400; opacity: .75; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }

/* ------------------------------------------------------------------ landing */
.hero { padding: 5rem 0 3rem; }
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
@media (max-width: 760px) { .cards { grid-template-columns: minmax(0, 1fr); } }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column;
        text-decoration: none; color: var(--text); transition: border-color .2s, transform .2s; }
.card:hover { border-color: var(--accent); transform: translateY(-2px); color: var(--text); }
.card .media { aspect-ratio: 16 / 9; background: #e4e8eb; display: block; width: 100%; object-fit: cover; }
.card .media.dark { background: var(--bg-raised); }
.card .body { padding: 1.25rem 1.4rem 1.5rem; }
.card .go { color: var(--accent); font-weight: 600; font-size: .95rem; }
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; counter-reset: step; list-style: none; padding: 0; margin: 2rem 0 0; }
@media (max-width: 860px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.steps li { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.2rem; counter-increment: step; }
.steps li::before { content: counter(step); display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%;
                    background: var(--bg-raised); border: 1px solid var(--accent); color: var(--accent); font-weight: 700; font-size: .85rem; margin-bottom: .6rem; }
.steps p { margin: 0; color: var(--muted); font-size: .95rem; }

/* ------------------------------------------------------------------ technology: figures */
.figure { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
.figure figcaption { color: var(--muted); font-size: .82rem; margin-top: .5rem; text-align: center; }
.facts { list-style: none; padding: 0; margin: 1.25rem 0 0; display: grid; gap: .9rem; }
.facts li { padding-left: 1.6rem; position: relative; }
.facts li::before { content: ""; position: absolute; left: 0; top: .55rem; width: .6rem; height: .6rem; border-radius: 2px; background: var(--accent); }
.facts strong { color: var(--text-strong); }
.tag { display: inline-block; font-size: .75rem; padding: .1rem .5rem; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); }

/* installation diagram */
.install text { fill: var(--text); font-size: 13px; font-family: inherit; }
.install .lbl-muted { fill: var(--muted); font-size: 11.5px; }
.install .leader { stroke: var(--muted); stroke-width: 1; fill: none; stroke-dasharray: 2 3; }

/* heat-pulse explainer */
.pulse .heat { fill: url(#heatGlow); transform-box: fill-box; transform-origin: center; animation: pulse 6s ease-in-out infinite; }
.pulse .flow { stroke: var(--radio); stroke-width: 2; fill: none; stroke-dasharray: 6 10; animation: flow 1.6s linear infinite; opacity: .8; }
@keyframes pulse {
  0%   { opacity: 0; transform: translateY(0) scale(.2); }
  12%  { opacity: 1; transform: translateY(0) scale(.45); }
  70%  { opacity: .55; transform: translateY(-34px) scale(1.25); }
  100% { opacity: 0; transform: translateY(-48px) scale(1.5); }
}
@keyframes flow { to { stroke-dashoffset: -32; } }

/* wireless chain */
.chain { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem .75rem; margin: 1.75rem 0 1.5rem; }
.chain .node { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem 1rem; text-align: center; min-width: 8.5rem; }
.chain .node b { display: block; color: var(--text-strong); }
.chain .node span { color: var(--muted); font-size: .82rem; }
.chain .link { height: 2px; width: 2.5rem; background: repeating-linear-gradient(90deg, var(--radio) 0 6px, transparent 6px 12px); background-size: 24px 2px; animation: dash 1s linear infinite; }
@keyframes dash { to { background-position: 24px 0; } }
@media (max-width: 760px) {
  .chain { flex-direction: column; align-items: stretch; }
  .chain .link { align-self: center; }
  .chain .link { width: 2px; height: 1.5rem; background: repeating-linear-gradient(180deg, var(--radio) 0 6px, transparent 6px 12px); animation: none; }
}
.radio-rings circle { fill: none; stroke: var(--radio); stroke-width: 1.5; transform-box: fill-box; transform-origin: center; animation: ring 3s ease-out infinite; opacity: 0; }
.radio-rings circle:nth-child(2) { animation-delay: 1s; }
.radio-rings circle:nth-child(3) { animation-delay: 2s; }
@keyframes ring { 0% { opacity: .9; transform: scale(.2); } 100% { opacity: 0; transform: scale(1.6); } }

/* ------------------------------------------------------------------ technology: 3D viewer (loads on request) */

/* ------------------------------------------------------------------ technology: renders + film */
.render { margin: 0; }
.render img { display: block; width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg-raised); }
.render figcaption { color: var(--muted); font-size: .85rem; margin-top: .5rem; }
.hero-render { margin-top: 2.5rem; }
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; margin-top: 3rem; }
@media (max-width: 860px) { .gallery { grid-template-columns: minmax(0, 1fr); } }
.film-frame { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: #000; aspect-ratio: 16 / 9; }
.film-frame video { display: block; width: 100%; height: 100%; }

@media (prefers-reduced-motion: reduce) {
  .pulse .heat, .pulse .flow, .chain .link, .radio-rings circle { animation: none; }
  .pulse .heat { opacity: .8; transform: translateY(-18px) scale(.9); }
  .radio-rings circle { opacity: .5; }
  .card { transition: none; }
}

/* ---------------------------------------------------------------- technology page: title + 3D sandbox window
   The window previews the viewer (static/pages/viewer/?preview=1); it links to the full sandbox page (/technology/3d/). */
.tech-head { text-align: center; padding: 3.5rem 1.25rem 2rem; }
.tech-head h1 { margin: .35rem 0 .75rem; font-size: clamp(2.6rem, 8vw, 6.5rem); font-weight: 800; line-height: .95; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text-strong, #fff); text-shadow: 0 0 40px rgba(63, 201, 255, .25); }
.tech-head .kicker { color: var(--radio); letter-spacing: .2em; }
.tech-head .lead { margin: 0 auto; max-width: 40rem; }
.sandbox-wrap { padding: 0 1.25rem 4rem; }
.sandbox-window { position: relative; max-width: 1400px; height: min(74vh, 860px); min-height: 420px; margin: 0 auto; overflow: hidden;
  border-radius: 32px; background: #04090f; border: 1px solid rgba(110, 200, 255, .28);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .4), 0 30px 80px rgba(0, 0, 0, .45), 0 0 70px rgba(63, 201, 255, .1); }
.sandbox-window iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.sandbox-window img { display: block; width: 100%; height: 100%; object-fit: cover; }
.sandbox-enter { position: absolute; inset: 0; z-index: 1; display: flex; align-items: flex-end; justify-content: center; padding: 0 0 1.75rem;
  border: 0; background: none; cursor: zoom-in; color: var(--text); font: inherit; text-decoration: none; }
.sandbox-enter span { padding: .6rem 1.2rem; border-radius: 999px; border: 1px solid rgba(110, 200, 255, .4); background: rgba(4, 9, 15, .72);
  backdrop-filter: blur(6px); font-size: .95rem; letter-spacing: .04em; transition: background .2s, border-color .2s; }
.sandbox-enter:hover span, .sandbox-enter:focus-visible span { background: rgba(63, 201, 255, .18); border-color: var(--radio); }
.sandbox-enter:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--radio); border-radius: 32px; }
.center { text-align: center; }
@media (max-width: 760px) {
  .tech-head { padding: 2.75rem 1rem 1.5rem; }
  .sandbox-wrap { padding: 0 .75rem 3rem; }
  .sandbox-window { height: 62svh; border-radius: 22px; }
}

/* ---------------------------------------------------------------- technology page: two instruments side by side
   Each .sandbox-item is a preview window (the shared viewer, ?preview=1) linking to its own full sandbox page, with a
   caption under it. The logger concept wears its hologram's amber instead of the sap flow cyan. */
.sandbox-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.75rem; max-width: 1500px; margin: 0 auto; padding: 0 1.25rem 4rem; }
.sandbox-pair > noscript, .sandbox-pair > .pair-note { grid-column: 1 / -1; }
.sandbox-item { margin: 0; min-width: 0; }
.sandbox-item .sandbox-window { max-width: none; height: min(54vh, 600px); min-height: 360px; border-radius: 26px; }
.sandbox-item .sandbox-enter:focus-visible { border-radius: 26px; }
.sandbox-item.logger .sandbox-window { background: #0b0804; border-color: rgba(255, 181, 71, .3);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .4), 0 30px 80px rgba(0, 0, 0, .45), 0 0 70px rgba(255, 181, 71, .08); }
.sandbox-item.logger .sandbox-enter span { border-color: rgba(255, 181, 71, .45); background: rgba(11, 8, 4, .72); }
.sandbox-item.logger .sandbox-enter:hover span, .sandbox-item.logger .sandbox-enter:focus-visible span { background: rgba(255, 181, 71, .16); border-color: #ffb547; }
.sandbox-item.logger .sandbox-enter:focus-visible { box-shadow: inset 0 0 0 2px #ffb547; }
.sandbox-caption { padding: 1.1rem .35rem 0; }
.sandbox-caption h2 { margin: 0 0 .35rem; font-size: 1.45rem; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.sandbox-caption h2 a { color: var(--text-strong, #fff); text-decoration: none; }
.sandbox-caption h2 a:hover { color: var(--radio); }
.sandbox-item.logger .sandbox-caption h2 a:hover { color: #ffb547; }
.sandbox-caption p { margin: 0; color: var(--muted); }
.tag { display: inline-block; padding: .15rem .55rem; border-radius: 999px; border: 1px solid rgba(255, 181, 71, .55); color: #ffb547;
  font-size: .7rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.instrument-head { padding: 4.5rem 0 0; border-top: 1px solid var(--border); scroll-margin-top: 4rem; }
.instrument-head h2 { margin: 0; font-size: clamp(2rem, 4.5vw, 3.2rem); line-height: 1.05; }
.instrument-head .lead { max-width: 46rem; margin: 1rem 0 0; }
.instrument-head + section.band { border-top: none; }
#logger.instrument-head .kicker { color: #ffb547; }
.gallery.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gallery.four .render.wide { grid-column: 1 / -1; }
.facts.open li::before { background: none; border: 2px solid var(--muted); width: .45rem; height: .45rem; }
.page-note { padding: 0 0 3rem; }
@media (max-width: 900px) {
  .sandbox-pair { grid-template-columns: minmax(0, 1fr); gap: 2.25rem; padding: 0 .75rem 3rem; }
  .sandbox-item .sandbox-window { height: 48svh; min-height: 300px; border-radius: 22px; }
  .gallery.four { grid-template-columns: minmax(0, 1fr); }
  .instrument-head { padding-top: 3rem; }
}
#logger-design .split { align-items: start; }

/* Drone "What it carries": a short capabilities list, two columns on wide screens */
.facts.cols { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 2.5rem; max-width: 62rem; }
@media (max-width: 760px) { .facts.cols { grid-template-columns: minmax(0, 1fr); } }

/* Landing technology card: two renders side by side in one 16:9 frame */
.card .media.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; background: var(--border); }
.card .media.duo picture, .card .media.duo img { display: block; width: 100%; height: 100%; min-height: 0; }
.card .media.duo img { object-fit: cover; }
