/* ============================================================
   livee — brand tokens, plus the components the shared Castomo system doesn't have.

   css/styles.css is the Aperture design system, cloned unchanged so the family
   stays one visual language (and so upstream fixes stay diffable). This file
   re-points that system at livee's own brand and adds livee's own components:
   the camera wall, the alert scene, the builder, the payload block, the channel
   fan-out, the FAQ and the demo form.

   Two colours carry meaning, and only two:
     --accent  livee lime (brand-kit/livee/tokens.css, --brand-2) — the brand, and
               the "live / connected / healthy" state. The mark is a live signal;
               the colour means the same thing everywhere it appears.
     --alert   amber — alert, armed, attention. Status only, never brand.
   Anything else on the page is grey.
   ============================================================ */

:root {
  /* From brand-kit/livee/tokens.css — the ramp, verbatim. */
  --brand-1: #536d17;
  --brand-2: #9ed61f;
  --brand-3: #d4e9a5;
  --brand-plate: #0b0c10;

  --accent: var(--brand-2);
  --accent-soft: rgba(158, 214, 31, .16);
  --accent-contrast: #0b0c10;

  --alert: #f5a623;
  --alert-soft: rgba(245, 166, 35, .16);
  --alert-line: rgba(245, 166, 35, .45);

  --live: var(--brand-2);
}

/* The system redefines --accent per theme, and those rules outrank a bare :root —
   so each theme gets livee's own value back here, where the cascade lands later.
   Light theme takes the dark end of the ramp: lime on white fails contrast. */
html[data-theme="light"] {
  --accent: #46600f;
  --accent-soft: rgba(83, 109, 23, .16);
  --accent-contrast: #ffffff;
  --alert: #8a5a00;
  --alert-soft: rgba(138, 90, 0, .14);
  --alert-line: rgba(138, 90, 0, .4);
  --live: #46600f;
}
html[data-theme="hc-dark"] {
  --accent: #b4ea33;
  --accent-soft: rgba(180, 234, 51, .24);
  --accent-contrast: #000000;
  --alert: #ffc46b;
  --alert-soft: rgba(255, 196, 107, .24);
  --alert-line: rgba(255, 196, 107, .6);
  --live: #b4ea33;
}

/* ---------- the mark ---------- */

.logo__mark { width: 28px; height: 28px; }
/* The centre dot is the signal, so it is the part that breathes. */
.logo__signal { animation: livee-breathe 2.4s ease-in-out infinite; transform-origin: 12px 12px; }
@keyframes livee-breathe { 50% { opacity: .35; } }

/* ---------- hero console: the camera wall inside the app mockup ---------- */

.wall {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  padding: 14px;
}
.feed {
  border: 1px solid var(--line-soft); border-radius: 10px;
  background: var(--bg-2); overflow: hidden;
}
.feed--alert, .feed--stall { border-color: var(--alert-line); }
.feed__head, .feed__foot {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 8px; font-size: 9px; color: var(--muted);
}
.feed__head { border-bottom: 1px solid var(--line-soft); }
.feed__foot { border-top: 1px solid var(--line-soft); justify-content: space-between; }
.feed__cam { font-family: var(--mono); letter-spacing: .08em; color: var(--text); }
.feed__place { flex: 1; }
.feed__state { font-weight: 600; letter-spacing: .08em; color: var(--live); }
.feed--alert .feed__state, .feed--stall .feed__state { color: var(--alert); }
.feed__state::before {
  content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 50%;
  background: currentColor; margin-right: 5px; vertical-align: middle;
}
.feed--alert .feed__state::before { animation: livee-blink 1s steps(2, end) infinite; }
@keyframes livee-blink { 50% { opacity: .15; } }

/* Each scene is drawn, not photographed: racking stripes, a floor band, and a
   state tint. Cheap, themeable, and impossible to mistake for a customer's site. */
.feed__scene {
  position: relative; aspect-ratio: 16 / 10;
  background:
    linear-gradient(to bottom, transparent 62%, rgba(252, 252, 252, .05) 62%),
    repeating-linear-gradient(90deg, rgba(252, 252, 252, .07) 0 3px, transparent 3px 26px),
    linear-gradient(160deg, #1b2029, #101218);
}
.feed__scene::after {
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, .22) 0 1px, transparent 1px 3px);
}
.feed__scene--alert { box-shadow: inset 0 0 0 2px var(--alert-line); }
.feed__scene--stall { filter: saturate(.4); }
.feed__scene--stall::before {
  content: ""; position: absolute; inset: 18% 8%;
  border: 1px dashed var(--alert); border-radius: 4px;
}
.feed__chip {
  position: absolute; z-index: 1; left: 6px; top: 6px;
  font-family: var(--mono); font-size: 8.5px; letter-spacing: .1em;
  padding: 3px 6px; border-radius: 999px;
  background: rgba(16, 17, 23, .8); color: var(--text); border: 1px solid var(--line);
}
.feed--alert .feed__chip, .feed--stall .feed__chip { color: var(--alert); border-color: var(--alert-line); }

@media (max-width: 900px) { .wall { grid-template-columns: 1fr 1fr; padding: 10px; } }

/* ---------- the proximity scene beside the alert-types section ---------- */

.scene {
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--surface); overflow: hidden;
}
/* A camera view is a product mockup, so it keeps dark chrome in the light theme —
   the same rule the system already applies to .app, .browser and .player. */
html[data-theme="light"] .scene {
  --bg-2: #101216;
  --surface: #23242e;
  --surface-2: #272834;
  --line: rgba(252, 252, 252, .10);
  --line-soft: rgba(252, 252, 252, .06);
  --text: #fcfcfc;
  --muted: #81859f;
  --accent: #9ed61f;
  --alert: #f5a623;
  --alert-line: rgba(245, 166, 35, .45);
  --alert-soft: rgba(245, 166, 35, .16);
}
.scene__head, .scene__foot {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; font-family: var(--mono); font-size: 10.5px;
  letter-spacing: .08em; color: var(--muted);
}
.scene__head { border-bottom: 1px solid var(--line-soft); }
.scene__foot { border-top: 1px solid var(--line-soft); }
.scene__state, .scene__class { color: var(--alert); }
.scene__plate {
  position: relative; aspect-ratio: 4 / 3;
  background:
    linear-gradient(to bottom, transparent 58%, rgba(252, 252, 252, .045) 58%),
    repeating-linear-gradient(90deg, rgba(252, 252, 252, .06) 0 4px, transparent 4px 44px),
    linear-gradient(165deg, #1c222c, #0f1116);
}
/* The keep-out radius, the marked point it is measured from, and the subject that
   crossed it — the whole product explained in one drawing. */
.scene__ring {
  position: absolute; left: 50%; top: 42%; width: 58%; aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border: 1px dashed var(--alert); border-radius: 50%;
  background: rgba(245, 166, 35, .07); /* the armed radius fill */
}
.scene__point {
  position: absolute; left: 50%; top: 26%; transform: translateX(-50%);
  font-family: var(--mono); font-size: 10px; letter-spacing: .1em; color: var(--alert);
  border: 1px solid var(--alert); border-radius: 4px; padding: 6px 12px;
  background: rgba(245, 166, 35, .08);
}
.scene__person {
  position: absolute; left: 50%; top: 58%; transform: translateX(-50%);
  width: 16px; height: 34px; border-radius: 8px 8px 4px 4px;
  background: var(--text); opacity: .85;
}
.scene__person::before {
  content: ""; position: absolute; left: 50%; top: -14px; transform: translateX(-50%);
  width: 12px; height: 12px; border-radius: 50%; background: var(--text);
}
.scene__person::after {
  content: ""; position: absolute; left: 50%; top: -26px; height: 24px;
  border-left: 1px solid var(--alert);
}
.scene__measure {
  position: absolute; left: 58%; top: 46%;
  font-family: var(--mono); font-size: 13px; font-weight: 500; color: var(--alert);
}

/* ---------- payload block ---------- */

.payload {
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--bg-2); padding: 20px 22px; overflow-x: auto;
}
.payload__label {
  font-family: var(--mono); font-size: 10px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 14px;
}
.payload pre { margin: 0; }
.payload code {
  font-family: var(--mono); font-size: 12px; line-height: 1.75; color: var(--muted);
  white-space: pre;
}
.payload .k { color: var(--text); }
.payload .v { color: var(--live); }
.payload .n { color: var(--alert); }

/* ---------- channel fan-out ---------- */

/* One event at the top, its destinations underneath — the parallel delivery drawn
   rather than described. */
.fanout {
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--surface); padding: 24px;
}
.fanout__event {
  font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--alert); padding: 12px 14px; border-radius: var(--radius);
  background: var(--alert-soft); border: 1px solid var(--alert-line);
}
.fanout__list { display: grid; gap: 10px; margin-top: 18px; padding-left: 18px; position: relative; }
/* The spine the branches hang off. */
.fanout__list::before {
  content: ""; position: absolute; left: 0; top: -14px; bottom: 22px;
  border-left: 1px solid var(--line);
}
.fanout__row {
  position: relative; display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: var(--radius);
  background: var(--bg-2); border: 1px solid var(--line-soft);
  font-size: 14px; color: var(--text);
}
.fanout__row::before {
  content: ""; position: absolute; left: -18px; width: 18px;
  border-top: 1px solid var(--line);
}
.fanout__pip {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

/* ---------- chips ---------- */

.tagchips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.tagchip {
  font-family: var(--mono); font-size: 10px; letter-spacing: .08em;
  padding: 6px 10px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--muted);
}
.route { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.route span {
  font-size: 11.5px; padding: 5px 10px; border-radius: 999px;
  background: var(--bg-2); border: 1px solid var(--line-soft); color: var(--muted);
}

/* ---------- use-case cards ---------- */

/* Four cards in the cloned 3-up grid leave the fourth alone on its own row; two columns
   divide evenly and give each photo enough width to read. */
/* 901px, not a round number: the cloned sheet collapses this grid to one column at 900px and
   below, and overlapping the two would give a 40px band of cramped two-up cards. */
@media (min-width: 901px) {
  .stories__grid { grid-template-columns: repeat(2, 1fr); }
}
/* Absolute, not just height:100%: the photos are 3:2 and 16:9, and an in-flow image resolves
   its own intrinsic ratio against the box's aspect-ratio, which made the cards different
   heights. Out of flow, the 16/9 box is the only thing deciding the crop. */
.story__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* The photos come from four different rooms and light sources. A single tint pulls them into
   one set and keeps the lime tag legible on whatever happens to be underneath it. */
.story__media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(11,12,16,.42), rgba(11,12,16,.12) 45%, rgba(11,12,16,.55));
}
.story__tag { z-index: 1; }
/* The route chips are livee's own addition to the cloned card, so they need the card's inset. */
.story .route { padding: 0 20px 18px; margin-top: 12px; }
.stories__credit { color: var(--muted); font-size: 12px; margin-top: 22px; }
.stories__credit a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.stories__credit a:hover { color: var(--text); }

/* ---------- limits ---------- */

.limits { display: grid; gap: 12px; margin-top: 32px; }
@media (min-width: 860px) { .limits { grid-template-columns: 1fr 1fr; } }
.limits li {
  position: relative; padding: 18px 20px 18px 30px; font-size: 14px; color: var(--muted);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.limits li::before {
  content: ""; position: absolute; left: 16px; top: 22px;
  width: 2px; height: calc(100% - 44px); min-height: 14px;
  background: var(--accent); border-radius: 2px;
}

/* ---------- alert builder ---------- */

.builder { display: grid; gap: 18px; margin-top: 36px; }
@media (min-width: 900px) { .builder { grid-template-columns: .85fr 1.15fr; } }
.builder__col {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 22px;
}
.builder__label {
  display: block; font-family: var(--mono); font-size: 10px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 12px;
}
.builder__label + .builder__label, .builder .tagchips + .builder__note { margin-top: 20px; }
.builder__note { font-size: 13px; color: var(--muted); margin-top: 14px; }
.builder__note strong { color: var(--text); }
.field { margin-top: 22px; }

.pick-list { display: grid; gap: 8px; }
.pick {
  display: flex; flex-direction: column; gap: 2px; min-height: 44px;
  padding: 10px 14px; text-align: left;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--muted); transition: border-color .15s, color .15s, background .15s;
}
.pick strong { color: var(--text); font-size: 14px; }
.pick small { font-size: 11.5px; }
.pick[aria-pressed="true"] { border-color: var(--accent); background: var(--surface-2); color: var(--text); }

.seg { display: grid; gap: 8px; }
@media (min-width: 560px) { .seg { grid-template-columns: repeat(3, 1fr); } }
.seg button {
  min-height: 44px; padding: 10px 12px; font-size: 13.5px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--text); transition: background .15s, color .15s, border-color .15s;
}
.seg button[aria-pressed="true"] {
  background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); font-weight: 600;
}

.select-wrap { position: relative; display: block; }
.select-wrap::after {
  content: ""; position: absolute; right: 14px; top: 50%; width: 7px; height: 7px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: translateY(-70%) rotate(45deg); pointer-events: none;
}
select, input[type="text"], input[type="email"], input[type="number"], textarea {
  width: 100%; min-height: 44px; padding: 11px 14px;
  font: inherit; font-size: 14px; color: var(--text);
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
}
select { appearance: none; padding-right: 36px; }
textarea { min-height: 96px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.range-head { display: flex; align-items: baseline; justify-content: space-between; }
.range-value { font-family: var(--mono); font-size: 16px; color: var(--accent); }
input[type="range"] { width: 100%; height: 44px; accent-color: var(--accent); }

.chan-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chan {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px;
  font-size: 13.5px; color: var(--muted);
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
}
.chan__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chan[aria-pressed="true"] { border-color: var(--accent); color: var(--text); background: var(--surface-2); }
.chan[disabled] { opacity: .45; cursor: not-allowed; }
.chan small { font-family: var(--mono); font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; }

.sentence {
  margin-top: 18px; padding: 24px 26px;
  background: var(--surface-2); border: 1px solid rgba(245, 166, 35, .35);
  border-radius: var(--radius-lg);
  font-size: clamp(18px, 2.2vw, 26px); font-weight: 500; line-height: 1.35;
}
.sentence b { color: var(--accent); font-weight: 600; }

/* ---------- platform card art ---------- */

.pcard__art--sources {
  background-image:
    repeating-linear-gradient(90deg, rgba(252, 252, 252, .07) 0 3px, transparent 3px 22px),
    linear-gradient(160deg, #1d232d, #101218);
}
.pcard__art--sources::after {
  content: ""; width: 54px; height: 34px; border: 2px solid var(--accent); border-radius: 6px;
  background: rgba(245, 166, 35, .1);
}
.pcard__art--alerts::after {
  content: ""; width: 74px; aspect-ratio: 1; border-radius: 50%;
  border: 1px dashed var(--alert); background: var(--alert-soft);
}
.pcard__art--channels { gap: 10px; }
.pcard__art--channels::before, .pcard__art--channels::after {
  content: ""; width: 46px; height: 3px; border-radius: 2px; background: var(--accent); opacity: .75;
}
.pcard__art--evidence::after {
  content: ""; width: 60px; height: 46px; border-radius: 6px;
  background: var(--surface-2); border: 1px solid var(--line);
  box-shadow: 8px 8px 0 -1px var(--bg-2), 8px 8px 0 0 var(--line);
}

/* ---------- FAQ ---------- */

.faq { max-width: 860px; margin-top: 36px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq details:first-of-type { border-top: 1px solid var(--line); }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  min-height: 60px; padding: 16px 0; cursor: pointer;
  font-weight: 600; font-size: 15px; list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq__chev { color: var(--muted); transition: transform .2s; flex: none; }
.faq details[open] .faq__chev { transform: rotate(180deg); }
.faq details p { color: var(--muted); font-size: 14.5px; margin: 0 40px 20px 0; }

/* ---------- demo form ---------- */

.form {
  display: grid; gap: 14px; padding: 24px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
}
.form label { display: block; font-size: 13px; color: var(--muted); }
.form label > span { display: block; margin-bottom: 7px; }
.form label small { font-family: var(--mono); font-size: 10px; }
.form__row { display: grid; gap: 14px; }
@media (min-width: 560px) { .form__row { grid-template-columns: 1fr 1fr; } }
.form__error { color: var(--alert); font-size: 13px; }
.form__error:empty { display: none; }
.form__note { font-size: 12px; color: var(--muted); }
.form--success { border-color: var(--accent-soft); }
.form--success h3 { font-size: 18px; }
.form--success p { color: var(--muted); font-size: 14px; }
[aria-invalid="true"] { border-color: var(--alert); }

/* The demo form's spam trap. Off-screen rather than display:none, because a
   bot that respects display:none would skip it and the trap would catch
   nothing. It is aria-hidden and out of the tab order in the markup, so a
   keyboard or screen-reader user never lands in it. */
.form__trap {
  position: absolute; left: -9999px; width: 1px; height: 1px;
  overflow: hidden; opacity: 0; pointer-events: none;
}

/* ---------- motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .logo__live, .feed__state::before { animation: none; }
}
