/* EnviroSense Monitoring - site styles */
:root {
  --bg: #ffffff;
  --surface: #f8fafc;
  --surface-2: #f1f5f9;
  --line: #e2e8f0;
  --text: #0f172a;
  --body: #334155;
  --muted: #475569;
  --accent: #0e7490;        /* brand cyan, darkened for readable text and buttons on white */
  --accent-hover: #155e75;
  --accent-bright: #22d3ee; /* original brand cyan, used for dots, rings and highlights */
  --accent-soft: #ecfeff;
  --accent-ink: #ffffff;
  --good: #15803d;
  --warn: #b45309;
  --bad: #dc2626;
  --shadow-s: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.08);
  --shadow-m: 0 12px 32px -12px rgba(15, 23, 42, 0.18);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --fast: 180ms;
  --radius-s: 8px;
  --radius-m: 14px;
  --wrap: 1080px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font-family: Geist, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.6;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; transition: color var(--fast) ease, text-decoration-thickness var(--fast) ease, text-underline-offset var(--fast) ease; }
a:hover { color: var(--accent-hover); text-decoration-thickness: 2px; text-underline-offset: 4px; }
:focus-visible { outline: 3px solid var(--accent-bright); outline-offset: 3px; border-radius: 4px; transition: outline-offset var(--fast) ease; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; z-index: 10; }

/* Header */
.site-head { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, 0.86); backdrop-filter: saturate(160%) blur(10px); -webkit-backdrop-filter: saturate(160%) blur(10px); border-bottom: 1px solid transparent; transition: border-color 240ms ease, box-shadow 240ms ease, background-color 240ms ease; }
.site-head.scrolled { border-bottom-color: var(--line); box-shadow: 0 6px 20px -14px rgba(15, 23, 42, 0.35); background: rgba(255, 255, 255, 0.94); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 600; font-size: 17px; letter-spacing: -0.01em; }
.brand-mark { width: 26px; height: 26px; }
.nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.nav a { color: var(--muted); text-decoration: none; font-size: 15px; padding: 8px 10px; border-radius: var(--radius-s); transition: color var(--fast) ease, background-color var(--fast) ease, border-color var(--fast) ease; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.nav a.login { color: var(--text); border: 1px solid var(--line); margin-left: 4px; background: var(--bg); }
.nav a.login:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* Type */
h1, h2, h3 { margin: 0; letter-spacing: -0.025em; line-height: 1.12; font-weight: 650; }
h1 { font-size: clamp(34px, 5.2vw, 54px); text-wrap: balance; }
h2 { font-size: clamp(26px, 3.4vw, 36px); text-wrap: balance; }
h3 { font-size: 20px; letter-spacing: -0.015em; line-height: 1.3; }
p { margin: 0; }
.lede { font-size: 19px; color: var(--body); max-width: 34em; }
.muted { color: var(--muted); }
.small { font-size: 15px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: var(--radius-s); font: inherit; font-size: 16px; font-weight: 600; text-decoration: none; border: 1px solid transparent; cursor: pointer; transition: background-color var(--fast) ease, border-color var(--fast) ease, color var(--fast) ease, box-shadow var(--fast) ease, transform var(--fast) var(--ease); }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); transition-duration: 60ms; }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 1px 2px rgba(14, 116, 144, 0.25); }
.btn-primary:hover { background: var(--accent-hover); color: var(--accent-ink); box-shadow: 0 8px 20px -8px rgba(14, 116, 144, 0.55); }
.btn-ghost { color: var(--text); border-color: #cbd5e1; background: var(--bg); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.btn:disabled { opacity: 0.6; cursor: default; transform: none; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* Sections */
section { padding: 88px 0; }
section + section { border-top: 1px solid var(--line); }
.section-head { max-width: 640px; margin-bottom: 40px; }
.section-head p { margin-top: 14px; color: var(--muted); }

/* Hero */
.hero { padding: 64px 0 80px; background: radial-gradient(60% 70% at 85% 10%, rgba(34, 211, 238, 0.10), transparent 70%), linear-gradient(180deg, #f8fafc, #ffffff 70%); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 48px; align-items: center; }
.hero h1 { margin-bottom: 22px; }
.hero-note { margin-top: 22px; font-size: 15px; color: var(--muted); }

/* Annotated day chart (the signature element) */
.day { margin: 0; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 22px 22px 18px; box-shadow: var(--shadow-m); }
.day-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 6px; flex-wrap: wrap; }
.day-title { font-weight: 600; }
.day-tag { font-size: 13px; color: var(--muted); }
.day svg { width: 100%; height: auto; }
.day svg text { font-family: inherit; }
.day-foot { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 10px; font-size: 13px; color: var(--muted); }
.key { display: inline-flex; align-items: center; gap: 6px; }
.key i { width: 14px; height: 0; border-top: 2px dashed currentColor; display: inline-block; }

/* What you get */
.get-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.get-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 28px; }
.get-list h3 { margin-bottom: 6px; }
.get-list p { color: var(--muted); }
.email { background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 22px 24px; font-size: 15px; line-height: 1.55; box-shadow: var(--shadow-m); transition: transform 300ms var(--ease), box-shadow 300ms var(--ease); }
.email:hover { transform: translateY(-3px); box-shadow: 0 20px 40px -16px rgba(15, 23, 42, 0.22); }
.email-meta { font-size: 13px; color: #475569; border-bottom: 1px solid #e2e8f0; padding-bottom: 12px; margin-bottom: 14px; }
.email-meta b { color: #0f172a; font-weight: 600; }
.email h4 { margin: 0 0 10px; font-size: 17px; }
.email dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0 0 14px; }
.email dt { color: #64748b; }
.email dd { margin: 0; font-weight: 600; }
.email .todo { background: #ecfeff; border-left: 3px solid #0891b2; padding: 10px 12px; border-radius: 4px; }

/* Why care homes */
.why { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.why h3 { margin-bottom: 8px; }
.why p { color: var(--muted); }
.why .measure { font-size: 15px; color: var(--text); margin-top: 10px; }

/* Steps */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; counter-reset: step; }
.steps li { counter-increment: step; border-top: 2px solid var(--accent-bright); padding-top: 18px; }
.steps li::before { content: counter(step); display: block; font-size: 15px; font-weight: 600; color: var(--accent); margin-bottom: 8px; }
.steps h3 { margin-bottom: 8px; }
.steps p { color: var(--muted); }

/* Proof */
.proof { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.figures { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; }
.fig { background: var(--bg); padding: 20px; transition: background-color var(--fast) ease; }
.fig:hover { background: var(--surface); }
.fig b { display: block; font-size: 30px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.fig span { color: var(--muted); font-size: 15px; }
.fig.alert b { color: var(--bad); }

/* Sensors */
.sensors { width: 100%; border-collapse: collapse; font-size: 16px; }
.sensors th, .sensors td { text-align: left; padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: top; transition: background-color var(--fast) ease; }
.sensors tbody tr:hover td { background: var(--surface); }
.sensors th { color: var(--muted); font-weight: 500; font-size: 14px; }
.sensors td:first-child { font-weight: 600; white-space: nowrap; }
.privacy-note { margin-top: 24px; padding: 18px 20px; background: var(--surface-2); border-radius: var(--radius-m); border: 1px solid var(--line); }

/* Other sectors */
.sectors { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.sectors p { color: var(--muted); margin-top: 6px; }

/* FAQ */
.faq { max-width: 760px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; padding: 20px 36px 20px 0; font-weight: 600; font-size: 18px; position: relative; transition: color var(--fast) ease; }
.faq summary:hover { color: var(--accent); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 16px; font-size: 24px; font-weight: 400; color: var(--muted); transition: transform 240ms var(--ease), color var(--fast) ease; }
.faq details[open] summary::after { transform: rotate(45deg); color: var(--accent); }
.faq details p { padding: 0 0 20px; color: var(--muted); max-width: 62ch; }

/* About */
.about { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 48px; align-items: start; }
.about p + p { margin-top: 14px; }

/* Contact form */
.contact { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 48px; align-items: start; }
.form { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 26px; display: grid; gap: 18px; box-shadow: var(--shadow-m); }
.field { display: grid; gap: 6px; }
.field label { font-size: 15px; font-weight: 600; }
.field .hint { font-weight: 400; color: var(--muted); }
.field input, .field select, .field textarea { font: inherit; font-size: 16px; color: var(--text); background: var(--bg); border: 1px solid #cbd5e1; border-radius: var(--radius-s); padding: 12px 14px; width: 100%; transition: border-color var(--fast) ease, box-shadow var(--fast) ease; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: #94a3b8; }
.field input::placeholder, .field textarea::placeholder { color: #64748b; }
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.35); }
.form-status { font-size: 15px; min-height: 1.4em; }
.form-status.ok { color: var(--good); }
.form-status.err { color: var(--bad); }
.hp { position: absolute; left: -9999px; }

/* Pricing page */
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.plan { border: 1px solid var(--line); border-radius: var(--radius-m); padding: 26px; display: flex; flex-direction: column; gap: 14px; background: var(--bg); box-shadow: var(--shadow-s); transition: transform 300ms var(--ease), box-shadow 300ms var(--ease), border-color 300ms ease; }
.plan:hover { transform: translateY(-4px); box-shadow: var(--shadow-m); border-color: #cbd5e1; }
.plan.featured { border-color: var(--accent); background: linear-gradient(180deg, var(--accent-soft), var(--bg) 40%); }
.plan h3 { font-size: 22px; }
.price { font-size: 34px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.price small { font-size: 16px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.plan ul { margin: 0; padding-left: 20px; color: var(--muted); display: grid; gap: 6px; }
.plan .btn { margin-top: auto; }
.founding { margin-top: 28px; border: 1px solid var(--accent); border-radius: var(--radius-m); padding: 26px; display: grid; grid-template-columns: minmax(0, 1.4fr) auto; gap: 24px; align-items: center; background: linear-gradient(0deg, rgba(34, 211, 238, 0.06), rgba(34, 211, 238, 0.06)), var(--surface); }
.founding p { color: var(--muted); margin-top: 6px; }
.included { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 40px; }
.included p { color: var(--muted); margin-top: 4px; }

/* Prose pages (privacy, terms) */
.prose { max-width: 720px; padding: 56px 0 88px; }
.prose h1 { font-size: clamp(32px, 4.4vw, 44px); margin-bottom: 8px; }
.prose h2 { font-size: 22px; margin: 40px 0 12px; }
.prose p, .prose li { color: var(--body); }
.prose p + p { margin-top: 12px; }
.prose ul { padding-left: 22px; display: grid; gap: 6px; margin: 12px 0 0; }
.prose .updated { color: var(--muted); margin-bottom: 28px; }

/* Footer */
.site-foot { border-top: 1px solid var(--line); padding: 40px 0 48px; font-size: 15px; color: var(--muted); background: var(--surface); }
.site-foot .wrap { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.site-foot nav { display: flex; gap: 18px; flex-wrap: wrap; }
.site-foot a { color: var(--muted); }
.site-foot a:hover { color: var(--text); }


/* Eyebrow labels */
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }

/* Hero photo */
.hero-photo { margin: 0; position: relative; }
.hero-photo img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-m); box-shadow: var(--shadow-m); }
.live-badge { position: absolute; left: -18px; bottom: 22px; display: flex; gap: 12px; align-items: center; background: rgba(255, 255, 255, 0.95); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; box-shadow: 0 18px 40px -16px rgba(15, 23, 42, 0.35); backdrop-filter: blur(6px); }
.live-badge .dot { width: 10px; height: 10px; border-radius: 50%; background: #f59e0b; box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.2); flex: none; }
.live-badge b { display: block; font-size: 15px; font-variant-numeric: tabular-nums; }
.live-badge span:not(.dot) { font-size: 13px; color: var(--muted); }

/* Trust strip */
.trust { list-style: none; margin: 0; padding: 18px 20px; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 36px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface-2); font-size: 15px; color: var(--muted); }
.trust li { display: flex; align-items: center; gap: 8px; }
.trust li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-bright); }
.trust + section { border-top: 0; }

/* Day chart section */
.day-grid { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 48px; align-items: center; }
.day-grid .section-head { margin-bottom: 0; }

/* Photos */
.wide-photo { margin: 0 0 40px; }
.wide-photo img { width: 100%; height: auto; max-height: 420px; object-fit: cover; object-position: center 35%; border-radius: var(--radius-m); }
.contact-photo { margin-top: 28px; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius-m); }
.credit { font-size: 12px; opacity: 0.8; }

/* Full-width photo band */
.band { position: relative; padding: 0; min-height: 420px; display: flex; align-items: flex-end; overflow: hidden; }
.band img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 40%; max-width: none; }
.band::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(15, 23, 42, 0.05) 30%, rgba(15, 23, 42, 0.88) 100%); }
.band-inner { position: relative; z-index: 1; padding-top: 140px; padding-bottom: 44px; width: 100%; }
.band-quote { color: #ffffff; text-shadow: 0 1px 12px rgba(15, 23, 42, 0.35); font-size: clamp(22px, 3vw, 30px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.3; max-width: 26em; text-wrap: balance; }

/* Responsive */
@media (max-width: 900px) {
  .hero-grid, .get-grid, .proof, .about, .contact, .day-grid { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .why, .steps, .sectors, .plans { grid-template-columns: minmax(0, 1fr); }
  .founding { grid-template-columns: minmax(0, 1fr); }
  .included { grid-template-columns: minmax(0, 1fr); }
  section { padding: 64px 0; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .hero { padding: 40px 0 56px; }
  .nav a.hide-sm { display: none; }
  .day { padding: 16px 12px 14px; }
  .figures { grid-template-columns: minmax(0, 1fr); }
  .sensors td:first-child { white-space: normal; }
  .live-badge { left: 10px; bottom: 10px; padding: 10px 12px; }
  .band { min-height: 320px; }
}
/* Motion. Everything here is switched off for people who prefer reduced motion. */
@media (prefers-reduced-motion: no-preference) {
  /* Hero: content fades and slides in on page load */
  .hero-grid > * { animation: rise 700ms var(--ease) both; }
  .hero-grid > :nth-child(2) { animation-delay: 120ms; }
  .live-badge { animation: rise 600ms var(--ease) 650ms both; }

  /* Sections: fade and slide up as they scroll into view (classes added by site.js) */
  .js .rv { opacity: 0; transform: translateY(18px); transition: opacity 650ms var(--ease), transform 650ms var(--ease); transition-delay: var(--d, 0ms); }
  .js .rv.in { opacity: 1; transform: none; }

  /* Chart draws itself when it comes into view */
  .js .day .trace { stroke-dasharray: 1400; stroke-dashoffset: 1400; }
  .js .day .note { opacity: 0; }
  .js .day.in .trace { animation: draw 2s ease-out 0.25s forwards; }
  .js .day.in .note { animation: fade 0.5s ease-out forwards; }
  .js .day.in .note.n1 { animation-delay: 1.1s; }
  .js .day.in .note.n2 { animation-delay: 1.5s; }
  .js .day.in .note.n3 { animation-delay: 1.9s; }

  /* FAQ answers ease open */
  .faq details[open] p { animation: rise 320ms var(--ease) both; }

  /* Photos zoom very slightly on hover */
  .wide-photo, .hero-photo { overflow: visible; }
  .wide-photo img, .contact-photo { transition: transform 600ms var(--ease); }
  .wide-photo:hover img, .contact-photo:hover { transform: scale(1.015); }

  /* Page fades in on navigation between pages */
  main { animation: fade 400ms ease both; }

  @keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
  @keyframes draw { to { stroke-dashoffset: 0; } }
  @keyframes fade { from { opacity: 0; } to { opacity: 1; } }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-delay: 0ms !important; }
  .btn:hover, .plan:hover, .email:hover { transform: none; }
}
