/* =========================================================
   Progrow FRCM use case: isometric field figure, live panel,
   device cards and the arpView mock. The figure's base styles
   are the Anatomy kit's (css/anatomy.css); this file maps its
   tokens onto the ARP palette in both themes.
   ========================================================= */

/* ---------- Figure tokens: navy and gold ---------- */
.pg-plate.iso {
  --anatomy-card: #0f1e31; --anatomy-paper: #0f1e31;
  --anatomy-face: #15273d; --anatomy-top: #182c44;
  --anatomy-shade-0: #0c1828; --anatomy-shade-1: #0f1d30; --anatomy-shade-2: #122237; --anatomy-shade-3: #15273e;
  --anatomy-lit-top: #2a3f5c; --anatomy-lit-shade: #213450;
  --anatomy-hi: #d6e2ef; --anatomy-mid: #7a91ad; --anatomy-lo: #455d7e; --anatomy-faint: #2a3e59; --anatomy-lit: #ebb54a;
  --anatomy-halo: #03080f; --anatomy-halo-opacity: .9; --anatomy-dot: #e8eef5;
  --anatomy-text: #9fb0c3; --anatomy-muted: #7d8fa5; --anatomy-strong: #e8eef5;
  --pg-cut: #1b3049; --pg-led: #6fdc9b;
}
[data-theme="light"] .pg-plate.iso {
  --anatomy-card: #fbfcfd; --anatomy-paper: #fbfcfd;
  --anatomy-face: #ffffff; --anatomy-top: #ffffff;
  --anatomy-shade-0: #d8dfe8; --anatomy-shade-1: #e2e8ef; --anatomy-shade-2: #ebeff4; --anatomy-shade-3: #f3f6f9;
  --anatomy-lit-top: #fff6e2; --anatomy-lit-shade: #f6e8c6;
  --anatomy-hi: #1d2b3d; --anatomy-mid: #7b8ca1; --anatomy-lo: #aab7c6; --anatomy-faint: #d2dae4; --anatomy-lit: #b07800;
  --anatomy-halo: #6b7d92; --anatomy-halo-opacity: .3; --anatomy-dot: #2d3c4f;
  --anatomy-text: #4b5d73; --anatomy-muted: #6b7d92; --anatomy-strong: #0f1f33;
  --pg-cut: #eef2f7; --pg-led: #1f9d5a;
}

/* ---------- Hero: ecosystem at a glance ---------- */
.pg-glance { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.pg-glance li {
  display: flex; gap: 18px; align-items: flex-start; padding: 20px 22px;
  border: 1px solid var(--line); border-radius: 16px; background: var(--card);
}
.pg-glance__n { font-family: var(--mono); font-size: 13px; color: var(--gold); padding-top: 2px; }
.pg-glance b { display: block; font-size: 16.5px; }
.pg-glance span:not(.pg-glance__n) { display: block; color: var(--muted); font-size: 14.5px; margin-top: 2px; }
[data-theme="light"] .pg-glance li { background: #fff; box-shadow: 0 10px 30px -22px rgba(15, 31, 51, .45); }
[data-theme="light"] .pg-glance__n { color: var(--gold-ink); }

/* ---------- Figure card ---------- */
.pg-figure { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.pg-side { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); grid-template-rows: auto 1fr; gap: 16px 24px; align-items: start; }
.pg-side .pg-live { grid-row: 1 / span 2; }
.pg-plate {
  position: relative; margin: 0; padding: 44px 14px 40px; border-radius: 20px;
  background: var(--anatomy-card); border: 1px solid var(--line);
}
[data-theme="light"] .pg-plate { box-shadow: 0 30px 60px -40px rgba(15, 31, 51, .45); }
.pg-plate__corners { position: absolute; inset: 18px 22px; pointer-events: none; }
.pg-plate__corners span {
  position: absolute; font-family: var(--mono); font-size: 11px; line-height: 1; letter-spacing: .04em;
  color: var(--anatomy-muted); white-space: nowrap;
}
.pg-plate__corners [data-corner="fig"] { top: 0; left: 0; color: var(--anatomy-text); }
.pg-plate__corners [data-corner="title"] { top: 0; right: 0; text-transform: uppercase; letter-spacing: .1em; }
.pg-plate__corners [data-corner="hint"] { bottom: 0; left: 0; text-transform: uppercase; letter-spacing: .1em; }
.pg-plate__corners [data-corner="readout"] { bottom: 0; right: 0; color: var(--anatomy-strong); max-width: 70%; overflow: hidden; text-overflow: ellipsis; }
.pg-stage { outline: none; }
/* cap the field so the whole figure fits on screen at once */
.pg-stage .iso-svg { display: block; width: 100%; max-width: min(860px, calc((100vh - 220px) * 1.375)); height: auto; margin: 0 auto; overflow: visible; }
.pg-stage [data-dev]:not([data-dev="soil"]) { cursor: pointer; }

/* figure parts that are not kit primitives */
.pg-plate .cut { fill: var(--pg-cut); }
.pg-plate .led { fill: var(--anatomy-lo); transition: fill .25s ease; }
.pg-plate .led[data-on] { fill: var(--pg-led); }
.pg-plate .sense .iso-line { transition: stroke .3s ease; }
.pg-plate .sense[data-on] .iso-line { stroke: var(--anatomy-lit); }
.pg-plate .link { opacity: 0; transition: opacity .45s ease; pointer-events: none; }
.pg-plate .link[data-on] { opacity: 1; }
.pg-plate .link .iso-line { stroke-dasharray: 1.2 4.2; stroke-width: 1; }
.pg-plate .pkt { fill: var(--anatomy-lit); }

/* ---------- Live panel ---------- */
.pg-live {
  padding: 22px; border-radius: 20px; border: 1px solid var(--line); background: var(--card);
}
[data-theme="light"] .pg-live { background: #fff; box-shadow: 0 10px 30px -22px rgba(15, 31, 51, .45); }
.pg-live__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pg-live__k { font-family: var(--mono); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); }
[data-theme="light"] .pg-live__k { color: var(--gold-ink); }
.pg-live__name { font-size: 19px; margin: 10px 0 14px; }
.pg-live__list { margin: 0; display: grid; gap: 0; }
.pg-live__list div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; }
.pg-live__list dt { color: var(--muted); }
.pg-live__list dd { margin: 0; font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--text); font-weight: 600; }
.pg-live__list dd.is-fresh { color: var(--gold); }
[data-theme="light"] .pg-live__list dd.is-fresh { color: var(--gold-ink); }
.pg-live__foot { margin-top: 12px; font-family: var(--mono); font-size: 12px; color: var(--muted); }

/* ---------- Device picker and caption ---------- */
.pg-keys { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pg-key {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 999px;
  font: inherit; font-size: 14px; color: var(--text); background: transparent; border: 1px solid var(--line); cursor: pointer;
  text-align: left; line-height: 1.3;
  transition: border-color .2s, background .2s;
}
.pg-key span { font-family: var(--mono); font-size: 12px; color: var(--gold); }
.pg-key:hover { border-color: var(--gold); }
.pg-key[aria-pressed="true"] { border-color: var(--gold); background: rgba(235, 181, 74, .1); }
[data-theme="light"] .pg-key span { color: var(--gold-ink); }
.pg-cap { color: var(--muted); font-size: 14px; }

@media (max-width: 1000px) {
  .pg-side { grid-template-columns: minmax(0, 1fr); }
  .pg-side .pg-live { grid-row: auto; }
}
@media (max-width: 600px) {
  .pg-plate { padding: 40px 4px 44px; border-radius: 16px; }
  .pg-plate__corners { inset: 14px 14px; }
  .pg-plate__corners [data-corner="title"] { display: none; }
  .pg-plate__corners [data-corner="hint"] { display: none; }
  .pg-plate__corners [data-corner="readout"] { max-width: 100%; left: 0; }
  .pg-key { font-size: 13px; padding: 9px 13px; }
  /* keep the field readable on phones: pan it sideways */
  .pg-stage { overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; }
  .pg-stage .iso-svg { width: 760px; max-width: none; }
}

/* ---------- Device cards ---------- */
.pg-devices { display: grid; grid-template-columns: repeat(4, 1fr); }
.pg-devices .pipe { padding: 28px 22px; }
.pg-devices .pipe h3 { font-size: 19px; }
.pg-meas { list-style: none; margin: 16px 0 0; padding: 14px 0 0; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.pg-meas li { position: relative; padding-left: 16px; font-size: 13.5px; color: var(--text); }
.pg-meas li::before { content: ""; position: absolute; left: 0; top: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
@media (max-width: 1000px) {
  .pg-devices { grid-template-columns: 1fr 1fr; }
  .pg-devices .pipe:nth-child(3) { border-left: 1px solid var(--line); }
  .pg-devices .pipe:nth-child(n+3) { border-top: 0; }
  .pg-devices .pipe:nth-child(3)::before { display: none; }
}
@media (max-width: 600px) {
  .pg-devices { grid-template-columns: 1fr; }
  .pg-devices .pipe + .pipe { border-left: 1px solid var(--line); border-top: 0; }
  .pg-devices .pipe + .pipe::before { display: block; left: 20px; top: -8px; }
}

/* ---------- arpView ---------- */
.pg-arp { display: grid; grid-template-columns: 1fr 1.15fr; gap: 56px; align-items: center; }
@media (max-width: 960px) { .pg-arp { grid-template-columns: 1fr; gap: 36px; } }
.arpv { border-radius: 18px; overflow: hidden; border: 1px solid var(--line); background: #0d1a2b; color: #e8eef5; box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .7); }
.arpv__bar { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid rgba(255, 255, 255, .08); background: #0a1524; }
.arpv__title { font-family: var(--mono); font-size: 12.5px; color: #9fb0c3; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arpv__tabs { display: flex; gap: 4px; padding: 10px 14px 0; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.arpv__tabs button {
  font: inherit; font-size: 13.5px; color: #9fb0c3; background: none; border: 0; cursor: pointer;
  padding: 9px 12px 11px; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.arpv__tabs button[aria-selected="true"] { color: #e8eef5; border-bottom-color: var(--gold); }
.arpv__view { padding: 16px; }
.arpv__view[hidden] { display: none; }
.arpv__kpis { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid rgba(255, 255, 255, .08); border-radius: 12px; }
.arpv__kpis .kpi { padding: 12px 14px; }
.arpv__kpis .kpi + .kpi { border-left: 1px solid rgba(255, 255, 255, .08); }
.arpv__kpis .kpi__k { color: #9fb0c3; font-size: 11px; }
.arpv__kpis .kpi__v { font-size: clamp(16px, 2vw, 21px); }
.arpv__charts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.arpv__card { border: 1px solid rgba(255, 255, 255, .08); border-radius: 12px; padding: 12px 14px; }
.arpv__h { display: block; font-family: var(--mono); font-size: 11px; color: #9fb0c3; margin-bottom: 10px; }
.arpv__depth, .arpv__npk { display: grid; gap: 6px; }
.av-row { display: grid; grid-template-columns: 44px 1fr 48px; align-items: center; gap: 8px; font-family: var(--mono); font-size: 11.5px; color: #9fb0c3; }
.av-row b { color: #e8eef5; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.av-bar { height: 8px; border-radius: 4px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.av-bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #4f8fd6, #6fb7f0); transition: width .6s ease; }
.arpv__npk .av-bar i { background: linear-gradient(90deg, var(--gold), #f3cd7e); }
.arpv__mini { display: flex; gap: 16px; margin-top: 10px; font-family: var(--mono); font-size: 11.5px; color: #9fb0c3; }
.arpv__mini b { color: #e8eef5; }
.arpv__alert { margin-top: 12px; padding: 10px 14px; border-radius: 10px; font-size: 13px; background: rgba(235, 181, 74, .12); color: #f3cd7e; border: 1px solid rgba(235, 181, 74, .3); }
.arpv__table { width: 100%; border-collapse: collapse; font-size: 13px; }
.arpv__table th { text-align: left; font-family: var(--mono); font-size: 11px; font-weight: 400; color: #9fb0c3; padding: 8px 8px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.arpv__table td { padding: 10px 8px; border-bottom: 1px solid rgba(255, 255, 255, .05); font-variant-numeric: tabular-nums; }
.arpv__table td small { display: block; color: #9fb0c3; font-size: 11px; }
.av-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.av-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #6fdc9b; }
.av-status--warn::before { background: var(--gold); }
.av-batt { display: inline-block; width: 26px; height: 10px; border: 1px solid #9fb0c3; border-radius: 2px; position: relative; vertical-align: -1px; margin-right: 6px; }
.av-batt i { position: absolute; inset: 1px auto 1px 1px; background: #6fdc9b; border-radius: 1px; }
@media (max-width: 560px) {
  .arpv__kpis { grid-template-columns: 1fr 1fr; }
  .arpv__kpis .kpi:nth-child(3) { border-left: 0; }
  .arpv__kpis .kpi:nth-child(n+3) { border-top: 1px solid rgba(255, 255, 255, .08); }
  .arpv__charts { grid-template-columns: 1fr; }
  .arpv__table th:nth-child(3), .arpv__table td:nth-child(3) { display: none; }
}

/* ---------- Water moving through open zones ---------- */
.pg-plate .flow { fill: none; stroke: var(--pg-water); stroke-width: 1.4; stroke-linecap: round; stroke-dasharray: 2 5; opacity: 0; transition: opacity .5s ease; pointer-events: none; }
.pg-plate .flow[data-on] { opacity: 1; animation: pg-flow 1.1s linear infinite; }
@keyframes pg-flow { to { stroke-dashoffset: -7; } }
.pg-plate.iso { --pg-water: #4fa3e0; }
[data-theme="light"] .pg-plate.iso { --pg-water: #1f6fb2; }
.pg-plate .cov-band { fill: var(--anatomy-lit); opacity: .07; }
.pg-plate .cov-ring { stroke-dasharray: 4 5; }
.pg-plate .cov-ring--edge { stroke-dasharray: none; }
@media (prefers-reduced-motion: reduce) { .pg-plate .flow[data-on] { animation: none; } }

/* ---------- Automation loop and valve schedule ---------- */
.pg-auto__grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: start; }
.pg-loop { list-style: none; margin: 0; padding: 0; counter-reset: loop; display: grid; gap: 4px; }
.pg-loop li { counter-increment: loop; position: relative; padding: 14px 0 14px 52px; border-top: 1px solid var(--line); }
.pg-loop li::before { content: counter(loop, decimal-leading-zero); position: absolute; left: 0; top: 15px; font-family: var(--mono); font-size: 13px; color: var(--gold); }
[data-theme="light"] .pg-loop li::before { color: var(--gold-ink); }
.pg-loop b { display: block; font-size: 17px; }
.pg-loop span { color: var(--muted); font-size: 15px; }
.pg-zones { padding: 22px; border-radius: 20px; border: 1px solid var(--line); background: var(--card); position: sticky; top: 96px; }
[data-theme="light"] .pg-zones { background: #fff; box-shadow: 0 10px 30px -22px rgba(15, 31, 51, .45); }
.pg-zones__head { display: flex; justify-content: space-between; align-items: center; }
.pg-zones__pump { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 16px 0; font-size: 14px; }
.pg-zones__pump span { color: var(--muted); }
.pg-zones__pump b { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.pg-zones__pump b.is-on { color: var(--gold); }
[data-theme="light"] .pg-zones__pump b.is-on { color: var(--gold-ink); }
.pg-zones__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.pg-zones__list li { display: grid; place-items: center; gap: 2px; padding: 10px 4px; border-radius: 12px; border: 1px solid var(--line); font-family: var(--mono); font-size: 11px; color: var(--muted); transition: border-color .3s, background .3s, color .3s; }
.pg-zones__list li b { font-size: 15px; color: var(--text); }
.pg-zones__list li.is-open { border-color: var(--gold); background: rgba(235, 181, 74, .12); color: var(--text); }
.pg-zones__list li.is-done { color: var(--text); }
.pg-zones__note { margin-top: 14px; font-size: 13px; color: var(--muted); }
/* This page stacks many sections; the site-wide 120px top and bottom left
   ~240px gaps between them. The photo bar's zoom room stands in for part of
   the automation section's bottom padding. */
main .section { padding: 72px 0; }
.pg-auto { padding-bottom: 32px; }
@media (max-width: 700px) {
  main .section { padding: 52px 0; }
  .pg-auto { padding-bottom: 24px; }
}

/* Field photos: grayscale marquee, like the home client logos. Hovering a photo
   pauses the bar, brings back its colour and scales it up 25%. */
.pg-photos {
  overflow: hidden; margin-top: 48px;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.pg-photos__track {
  list-style: none; margin: 0; padding: 40px 28px 40px 0; /* room for the 25% hover zoom; right pad = gap keeps the loop seamless */
  display: flex; align-items: center; gap: 28px; width: max-content;
  animation: marquee 60s linear infinite;
}
.pg-photos:hover .pg-photos__track { animation-play-state: paused; }
.pg-photos__track li { flex: none; position: relative; transition: transform .35s ease; }
.pg-photos__track li:hover { transform: scale(1.25); z-index: 1; }
.pg-photos__track img {
  display: block; height: 240px; width: auto; border-radius: 14px;
  filter: grayscale(1); opacity: .7;
  transition: filter .35s ease, opacity .35s ease, box-shadow .35s ease;
}
.pg-photos__track li:hover img { filter: none; opacity: 1; box-shadow: 0 18px 40px rgba(0, 0, 0, .35); }
@media (max-width: 900px) {
  .pg-auto__grid { grid-template-columns: 1fr; }
  .pg-zones { position: static; }
}
@media (max-width: 600px) {
  .pg-photos__track { gap: 18px; padding: 28px 18px 28px 0; animation-duration: 45s; }
  .pg-photos__track img { height: 170px; }
}
@media (prefers-reduced-motion: reduce) {
  .pg-photos__track { animation: none; }
  .pg-photos { overflow-x: auto; }
}

/* ---------- Coverage farms ---------- */
.pg-farms { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 16px; }
.pg-farm { text-align: left; font: inherit; color: var(--text); background: transparent; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; cursor: pointer; transition: border-color .2s, background .2s; }
.pg-farm:hover, .pg-farm[aria-pressed="true"] { border-color: var(--gold); }
.pg-farm[aria-pressed="true"] { background: rgba(235, 181, 74, .1); }
.pg-farm b { display: block; font-size: 15px; }
.pg-farm span { display: block; font-family: var(--mono); font-size: 12px; color: var(--muted); margin-top: 2px; }
@media (max-width: 760px) { .pg-farms { grid-template-columns: 1fr 1fr; } }
#coverage .pg-cap { margin-top: 12px; }

/* ---------- arpView irrigation strip ---------- */
.arpv__irr { margin-top: 12px; border: 1px solid rgba(255, 255, 255, .08); border-radius: 12px; padding: 12px 14px; }
.arpv__irr .arpv__h b { color: #e8eef5; font-weight: 600; }
.arpv__valves { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
.arpv__valves i { height: 18px; border-radius: 4px; background: rgba(255, 255, 255, .06); font-style: normal; font-family: var(--mono); font-size: 10px; color: #9fb0c3; display: grid; place-items: center; transition: background .3s, color .3s; }
.arpv__valves i.is-open { background: rgba(79, 163, 224, .35); color: #e8eef5; }

/* ---------- Deployments ---------- */
.pg-sites { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.pg-site { padding: 26px 24px; border-radius: 18px; border: 1px solid var(--line); background: var(--card); }
[data-theme="light"] .pg-site { background: #fff; box-shadow: 0 10px 30px -22px rgba(15, 31, 51, .45); }
.pg-site--first { border-color: rgba(235, 181, 74, .55); }
.pg-site__tag { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
[data-theme="light"] .pg-site__tag { color: var(--gold-ink); }
.pg-site h3 { font-size: 20px; margin: 8px 0 8px; }
.pg-site p { color: var(--muted); font-size: 15px; }
@media (max-width: 860px) { .pg-sites { grid-template-columns: 1fr; } }

/* ---------- Founder ---------- */
.pg-founder { display: grid; grid-template-columns: 260px 1fr; gap: 48px; align-items: center; }
.pg-founder__photo { margin: 0; width: 260px; aspect-ratio: 4 / 5; border-radius: 22px; overflow: hidden; border: 1px solid var(--line); background: radial-gradient(circle at 30% 20%, rgba(235, 181, 74, .25), transparent 60%), var(--card); display: grid; place-items: center; }
.pg-founder__photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.pg-founder__mono { font-size: 54px; font-weight: 800; letter-spacing: -.02em; color: var(--gold); }
[data-theme="light"] .pg-founder__mono { color: var(--gold-ink); }
@media (max-width: 760px) { .pg-founder { grid-template-columns: 1fr; gap: 28px; } .pg-founder__photo { width: 200px; } }
