/* Global Robotus: one stylesheet for the whole site. No external requests.
   Light by default, cool dark grey (never black) when the system or the toggle says dark.
   Amber is the brand highlight: link underlines, the status chip, focus rings. Text stays ink-coloured. */

@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  --bg: #ffffff;
  --panel: #f3f4f6;
  --line: #e1e3e7;
  --text: #17191c;
  --dim: #5b6068;
  --amber: #ffb45a;
  --cold: #2f7fd8;   /* the app's condensation blue */
  --on-amber: #1a1a1a;
  --slot: #17191c;   /* the bolt's slot in the mark */
  /* The app's "Ironbow" palette (inferno), cold → hot. */
  --ironbow: linear-gradient(90deg, #000004 0%, #1b0c41 11%, #4a0c6b 22%, #781c6d 33%, #a52c60 44%,
    #cf4446 55%, #ed6925 66%, #fb9b06 77%, #f7d13d 88%, #fcffa4 100%);
  --page: 1040px;
  --gutter: clamp(20px, 5vw, 48px);
  --measure: 66ch;
  --head: 87.5%;     /* headings: Archivo semi-condensed */
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1d1f22; --panel: #26292d; --line: #373b41; --text: #e8e9eb; --dim: #a0a5ad; --cold: #5aa2f0; --slot: #1d1f22;
  }
}
:root[data-theme="dark"] {
  --bg: #1d1f22; --panel: #26292d; --line: #373b41; --text: #e8e9eb; --dim: #a0a5ad; --cold: #5aa2f0; --slot: #1d1f22;
}

* { box-sizing: border-box; }
html { background: var(--bg); color-scheme: light dark; }
html[data-theme="light"] { color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Archivo", system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: underline; text-decoration-color: var(--amber);
  text-decoration-thickness: 2px; text-underline-offset: 0.22em; }
a:hover { text-decoration-thickness: 4px; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; border-radius: 3px; }

.wrap { width: min(var(--page), 100% - 2 * var(--gutter)); margin-inline: auto; }

/* Type */
h1, h2, h3 { font-stretch: var(--head); font-weight: 700; line-height: 1.08; letter-spacing: -0.01em; margin: 0; }
h1 { font-size: clamp(2.5rem, 6vw, 4.25rem); }
h2 { font-size: 1.375rem; }
h3 { font-size: 1.0625rem; margin: 1.6rem 0 0.4rem; }
p { margin: 0 0 0.9rem; }
p:last-child { margin-bottom: 0; }
.lede { font-size: clamp(1.15rem, 2vw, 1.375rem); line-height: 1.45; max-width: 34ch; }
.dim { color: var(--dim); }

/* Header and footer */
.site-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 22px; min-height: 80px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-stretch: var(--head); font-weight: 700;
  font-size: 1.0625rem; text-decoration: none; }
.mark { width: 30px; height: 30px; flex: none; }
.mark-slot { fill: var(--slot); }
.theme { margin-left: auto; font: inherit; font-size: 0.8125rem; color: var(--dim); background: none;
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; cursor: pointer; }
.theme:hover { color: var(--text); border-color: var(--dim); }

.site-foot { border-top: 1px solid var(--line); margin-top: clamp(72px, 10vw, 128px); padding-block: 24px 48px;
  display: flex; flex-wrap: wrap; gap: 8px 28px; font-size: 0.9375rem; color: var(--dim); }
.site-foot a { color: var(--dim); text-decoration-color: var(--line); }
.site-foot a:hover { color: var(--text); text-decoration-color: var(--amber); }

/* Landing */
.intro { padding-block: clamp(32px, 7vw, 88px) clamp(32px, 5vw, 56px); }
.intro .lede { margin-top: 1rem; color: var(--dim); }

.product { background: var(--panel); border-radius: 18px; padding: clamp(24px, 4.5vw, 52px);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: clamp(24px, 5vw, 64px); align-items: center; }
.product + .product { margin-top: 20px; }
.product-text { max-width: 46ch; }
.product-text .lede { max-width: none; margin-block: 1.1rem 0.9rem; }

.app-name { display: flex; align-items: center; gap: 16px; }
.app-icon { width: 60px; height: 60px; flex: none; color: var(--text); } /* inline: nut follows the theme */
.app-name h2 { font-size: clamp(1.75rem, 3.4vw, 2.25rem); }

.status { display: inline-block; background: var(--amber); color: var(--on-amber); font-size: 0.8125rem; font-weight: 600;
  line-height: 1.5; padding: 2px 10px; border-radius: 999px; margin-right: 4px; }
.meta { margin-top: 1.2rem; font-size: 0.9375rem; color: var(--dim); }
.more { margin-top: 1.4rem; font-weight: 600; }

/* Screenshots: fixed pixel widths (percentages inside an auto grid track collapse the text column in Firefox). */
.shots { display: flex; gap: 14px; margin: 0; }
.shots figure { margin: 0; }
.shots img { display: block; width: clamp(140px, 17vw, 200px); height: auto; border-radius: 16px; border: 1px solid var(--line); }
.shots figcaption { font-size: 0.8125rem; color: var(--dim); margin-top: 8px; }

/* App page hero */
.app-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: clamp(24px, 5vw, 64px); align-items: center;
  padding-block: clamp(24px, 5vw, 64px) clamp(48px, 7vw, 88px); }
.app-hero .app-icon { width: 80px; height: 80px; }
.app-hero .lede { margin-block: 1.2rem 0; max-width: 40ch; }
.features { list-style: none; padding: 0; margin: 1.6rem 0 0; max-width: 46ch; }
.features li { padding: 0.5rem 0 0.5rem 22px; position: relative; }
.features li::before { content: ""; position: absolute; left: 0; top: 1.05em; width: 10px; height: 2px; background: var(--amber); }

/* Reference sections: heading left, text right, readable line length */
.doc { display: grid; grid-template-columns: 220px minmax(0, var(--measure)); gap: 12px clamp(24px, 5vw, 64px);
  padding-block: clamp(32px, 5vw, 52px); border-top: 1px solid var(--line); }
.doc > h2 { padding-top: 2px; }

.table { width: 100%; border-collapse: collapse; margin-top: 1rem; font-size: 1rem; }
.table th, .table td { text-align: left; vertical-align: top; padding: 0.7rem 1rem 0.7rem 0; border-bottom: 1px solid var(--line); }
.table thead th { font-size: 0.875rem; font-weight: 600; color: var(--dim); padding-top: 0; }
.table td:last-child, .table th:last-child { padding-right: 0; }
.table:first-child { margin-top: 0.2rem; }
.table + p { margin-top: 1rem; }
.nowrap { white-space: nowrap; }

.note { background: var(--panel); border-left: 3px solid var(--amber); padding: 14px 18px; border-radius: 0 8px 8px 0; margin-top: 1.2rem; }

/* Moisture diagram: the camera's palette with the two limits for an example room */
.dew { margin: 1.4rem 0 0; }
.dew-bar { height: 26px; background: var(--ironbow); border-radius: 4px; }
.dew-ticks { position: relative; height: 26px; font-size: 0.8125rem; color: var(--dim); font-variant-numeric: tabular-nums; }
.dew-ticks span { position: absolute; top: 8px; transform: translateX(-50%); white-space: nowrap; }
.dew-ticks span::before { content: ""; position: absolute; left: 50%; top: -8px; width: 1px; height: 6px; background: var(--dim); }
.dew-ticks span:first-child { transform: none; }
.dew-ticks span:first-child::before { left: 0; }
.dew-ticks span:last-child { transform: translateX(-100%); }
.dew-ticks span:last-child::before { left: auto; right: 0; }
.dew-limits { list-style: none; padding: 0; margin: 14px 0 0; }
.dew-limits li { margin-top: 10px; }
.dew-limits .band { display: block; height: 8px; border-radius: 2px; margin-bottom: 6px; }
.dew-limits .mould .band { background: var(--amber); }
.dew-limits .cond .band { background: var(--cold); }
.dew figcaption { margin-top: 1rem; font-size: 0.9375rem; color: var(--dim); }

/* Plain text pages (privacy, 404, auth callback) */
.page { max-width: var(--measure); padding-block: clamp(24px, 5vw, 64px) 0; }
.page h1 { font-size: clamp(2.25rem, 5vw, 3.25rem); }
.page h2 { margin: 2.4rem 0 0.6rem; }
.page .lede { max-width: none; margin-block: 1rem; }

@media (max-width: 800px) {
  .product, .app-hero { grid-template-columns: 1fr; }
  .doc { grid-template-columns: 1fr; }
  .shots img { width: min(200px, (100vw - 2 * var(--gutter) - 14px) / 2); }
  .product .shots img { width: min(200px, (100vw - 2 * var(--gutter) - 48px - 14px) / 2); } /* minus panel padding */
}

@media (prefers-reduced-motion: no-preference) {
  /* The one page-load moment: the colour scale fills in from cold to hot. */
  .dew-bar { animation: heat 1.4s cubic-bezier(.2, .7, .2, 1) both; }
  @keyframes heat { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
}
