/* RemoteSure landing page */

:root {
  /* Logo palette (Option B): navy #0F1F3D, teal #00B1B7 */
  --navy: #0F1F3D;         /* logo navy: headings on light backgrounds */
  --ink: #0A1730;          /* deeper navy: hero, footer */
  --ink-deep: #071122;     /* instrument panel */
  --teal: #007A80;         /* buttons and links on light backgrounds (white text passes contrast) */
  --teal-dark: #00636A;    /* hover state */
  --teal-bright: #00B1B7;  /* logo teal: accents on navy */
  --paper: #F4F7FA;
  --mist: #D5E0EA;
  --text: #111E33;
  --muted: #586A80;
  --line: #223A63;         /* signal lines on navy */
  --radius: 8px;
}

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--teal-bright);
  outline-offset: 2px;
}

/* ---------- Nav (sits on top of the hero) ---------- */

.site-nav {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 10;
  padding: 1.25rem 0;
}

.brand { display: inline-flex; line-height: 0; }
.brand img { height: 120px; width: auto; }
@media (max-width: 575px) { .brand img { height: 100px; } }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  color: #fff;
  padding: 8.5rem 0 5rem;
  background-color: var(--ink);
  /* Sensor dot grid: one 1.5px dot every 22px */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22'%3E%3Ccircle cx='11' cy='11' r='1.5' fill='%231E3560'/%3E%3C/svg%3E");
  background-size: 22px 22px;
}
@media (min-width: 992px) {
  .hero { padding: 7.5rem 0 10.5rem; }  /* bottom room is for the sensors under the panel */
}

.hero-title {
  font-size: clamp(2.5rem, 5.4vw, 4rem);
  text-wrap: balance;
  font-weight: 800;
  font-stretch: 120%;
  line-height: .95;
  letter-spacing: -0.025em;
  margin: 0 0 1.5rem;
}

@media (min-width: 992px) and (max-width: 1199.98px) {
  .hero-title { font-size: 3.25rem; }
}

.hero-lede {
  font-size: 1.15rem;
  line-height: 1.65;
  max-width: 33em;
  color: rgba(255, 255, 255, .85);
  margin-bottom: 2.25rem;
}

/* Newsletter signup */
.signup { max-width: 31rem; }
.signup-label { display: block; font-weight: 600; margin-bottom: .6rem; }
.signup-row { display: flex; gap: .5rem; }
.signup-row input {
  flex: 1;
  min-width: 0;
  padding: .8rem 1rem;
  border: 0;
  border-radius: var(--radius);
  font: inherit;
  color: var(--text);
}
@media (max-width: 480px) { .signup-row { flex-direction: column; } }

.btn-bright,
.btn-teal {
  border: 0;
  border-radius: var(--radius);
  padding: .8rem 1.5rem;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  transition: background-color .15s;
}
.btn-bright { background: var(--teal-bright); color: var(--ink); }
.btn-bright:hover { background: #2CC4C9; }
.btn-teal { background: var(--teal); color: #fff; }
.btn-teal:hover { background: var(--teal-dark); }
.btn-bright:disabled,
.btn-teal:disabled { opacity: .65; cursor: progress; }

.form-note { margin: .6rem 0 0; font-size: .875rem; color: rgba(255, 255, 255, .6); }

.form-status { margin: .75rem 0 0; font-weight: 600; min-height: 1.5em; }
.form-status:empty { min-height: 0; margin: 0; }
.hero .form-status.is-success { color: var(--teal-bright); }
.hero .form-status.is-error { color: #FFB4A8; }
.pilot .form-status.is-success { color: var(--teal); }
.pilot .form-status.is-error { color: #B3261E; }

/* Honeypot: off-screen for people, visible to bots */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Signal flow (sensors > hub > servers > panel) ---------- */

.readout-wrap { position: relative; }

.flow { position: absolute; overflow: visible; pointer-events: none; }

/* Desktop: hangs below the panel; x=480 in the drawing is the panel's left edge */
.flow-desktop {
  display: none;
  width: 600px;
  height: 160px;
  top: 100%;
  left: -480px;
}
.flow-mobile {
  width: 100%;
  height: 130px;
  bottom: 100%;
  left: 0;
}
@media (min-width: 992px) {
  .flow-desktop { display: block; }
  .flow-mobile { display: none; }
}
@media (min-width: 1200px) {
  /* 20% larger on wide screens; left offset scales with it (480 x 1.2) */
  .flow-desktop { width: 720px; height: 192px; left: -576px; }
  .hero { padding-bottom: 12rem; }
}
@media (max-width: 991.98px) {
  .readout-wrap { margin-top: 140px; }
}

.flow-lines path { fill: none; stroke: var(--line); stroke-width: 1.4; }
.flow-sensors circle { fill: var(--ink); stroke: var(--teal-bright); stroke-width: 1.2; stroke-opacity: .6; }
.flow-sensor-cores circle,
.flow-led,
.flow-led circle { fill: var(--teal-bright); }
.flow-hub { fill: var(--ink-deep); stroke: var(--teal-bright); stroke-width: 1.4; }
.flow-server rect { fill: var(--ink-deep); stroke: var(--teal-bright); stroke-width: 1.2; stroke-opacity: .7; }
.flow-server-lines line { stroke: var(--line); stroke-width: 1.2; }
.pulses circle { fill: var(--teal-bright); }

/* ---------- Instrument readout ---------- */

.readout {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 1.5rem 1.5rem 1.25rem;
  background: var(--ink-deep);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 12px;
}

.readout-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: .875rem;
  color: rgba(255, 255, 255, .65);
}
.readout-live { display: inline-flex; align-items: center; gap: .45rem; }
.readout-live::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal-bright);
}

.readout-values {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1.25rem 0 .5rem;
}
.readout-values div { display: flex; flex-direction: column-reverse; }
.readout-values dt {
  font-weight: 400;
  font-size: .8rem;
  color: rgba(255, 255, 255, .6);
}
.readout-values dd {
  margin: 0;
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 700;
  font-stretch: 105%;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.readout-values small { font-size: .55em; font-weight: 500; margin-left: .1em; color: rgba(255, 255, 255, .7); }

.curve { display: block; width: 100%; height: auto; overflow: visible; }
.curve text { fill: rgba(255, 255, 255, .5); font-size: 10px; font-family: inherit; }
.curve .grid { stroke: rgba(255, 255, 255, .07); stroke-width: 1; }
.curve .target { stroke: rgba(255, 255, 255, .4); stroke-width: 1; stroke-dasharray: 4 4; }
.curve .target-label { fill: rgba(255, 255, 255, .7); }

.curve-line {
  fill: none;
  stroke: var(--teal-bright);
  stroke-width: 3;
  stroke-linejoin: round;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw 15s ease-in-out .3s forwards;
}
.end-dot { fill: var(--teal-bright); opacity: 0; animation: appear .3s ease-out 15.3s forwards; }

/* When readout.js is running it draws the line itself, in step with the readings */
.readout.is-scripted .curve-line { animation: none; stroke-dashoffset: 1; }
.readout.is-scripted .end-dot { animation: none; opacity: 0; transition: opacity .3s ease-out; }
.readout.is-scripted .end-dot.is-shown { opacity: 1; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes appear { to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .curve-line { animation: none; stroke-dashoffset: 0; }
  .end-dot { animation: none; opacity: 1; }
}

.readout figcaption { margin-top: .75rem; font-size: .85rem; color: rgba(255, 255, 255, .6); }

/* ---------- Pilot / early access ---------- */

.pilot { padding: 5rem 0; }

.pilot-intro { margin-bottom: 2rem; }
.pilot-title {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 800;
  font-stretch: 112%;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--navy);
  margin-bottom: .75rem;
}
.pilot-lede { font-size: 1.05rem; line-height: 1.65; color: var(--muted); max-width: 46em; margin: 0; }
.pilot-lede a { color: var(--teal); font-weight: 600; }

.pilot-form {
  background: #fff;
  border: 1px solid var(--mist);
  border-radius: 12px;
  padding: 1.75rem 2rem;
}
.pilot-form .form-label { font-weight: 600; color: var(--navy); margin-bottom: .35rem; }
.pilot-form .optional { font-weight: 400; color: var(--muted); }
.pilot-form .form-control {
  border-color: #C2D1DF;
  border-radius: var(--radius);
  padding: .65rem .85rem;
  font: inherit;
}
.pilot-form textarea.form-control { resize: vertical; }
.pilot-form .form-control::placeholder { color: #8A9AAD; }
.pilot-form .form-control:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 .2rem rgba(0, 122, 128, .2);
}
.pilot-form .form-check-input { border-color: var(--teal); }
.pilot-form .form-check-input:checked { background-color: var(--teal); border-color: var(--teal); }
.pilot-form .form-check-input:focus { box-shadow: 0 0 0 .2rem rgba(0, 122, 128, .2); border-color: var(--teal); }

.pilot-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: .25rem;
}

@media (max-width: 575px) { .pilot-form { padding: 1.25rem; } }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--ink);
  color: rgba(255, 255, 255, .7);
  padding: 2rem 0;
  font-size: .925rem;
}
.footer-logo { height: 50px; width: auto; }
.site-footer a { color: rgba(255, 255, 255, .85); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
