:root {
  --syn-green: #50e600;
  --white: #fff;
  --glass: rgba(255, 255, 255, 0.05);
  /* 1vw, but never more than 1vw of a 16:9 screen of the same height, so wide/short screens shrink content to fit */
  --vw: min(1vw, 1.7778vh);
  --gutter: clamp(20px, calc(6.6 * var(--vw)), 127px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { background: #020a02; }

body {
  font-family: 'Poppins', sans-serif;
  font-weight: 300;
  color: var(--white);
  min-height: 100vh;
  overflow-x: hidden;
}

img { display: block; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Page & backgrounds ---------- */
.page {
  position: relative;
  min-height: 100vh;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.bg, .bg-overlay {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: -2;
}
.bg-overlay { z-index: -3; }

.grid-wrap {
  position: absolute; inset: 0; z-index: -1;
  mix-blend-mode: screen; pointer-events: none;
  transform: translateZ(0);
  background: url("assets/bg-grid.png") center / cover no-repeat;
}
.grid-wrap img { display: none; }

/* ---------- Header ---------- */
.menu {
  position: absolute;
  left: calc(max(0px, (100vw - 1920px) / 2) + clamp(16px, 2.45vw, 47px));
  top: clamp(16px, calc(2.1 * var(--vw)), 40px);
  width: 33px; height: 22px;
  background: none; border: 0; cursor: pointer;
}
.menu img { width: 100%; height: 100%; }

.app-title {
  position: absolute;
  left: calc(max(0px, (100vw - 1920px) / 2) + clamp(16px, 2.45vw, 47px) + 50px);
  top: clamp(18px, calc(2.03 * var(--vw)), 39px);
  font-size: clamp(12px, calc(0.83 * var(--vw)), 16px);
  white-space: nowrap;
}

/* ---------- Layout ---------- */
.layout {
  flex: 1;
  width: 100%; max-width: 1920px; margin-inline: auto; /* design width: stays put on 2K+ screens */
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: clamp(24px, calc(3 * var(--vw)), 60px);
  align-items: center;
  padding: clamp(64px, calc(6 * var(--vw)), 110px) clamp(16px, calc(3.5 * var(--vw)), 51px) clamp(20px, calc(3.125 * var(--vw)), 60px) var(--gutter);
}

.left { min-width: 0; }

.right {
  --gap: clamp(12px, calc(1.5 * var(--vw)), 28px);
  /* Card width is limited by viewport height so both cards always fit on screen */
  --card-w: calc((100vh - 290px) * 495 / 837);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  align-self: center;
  width: min(calc(var(--card-w) * 2 + var(--gap)), 57vw, 1094px);
}

.fullscreen {
  position: absolute;
  right: calc(max(0px, (100vw - 1920px) / 2) + clamp(16px, 2.45vw, 47px));
  top: clamp(14px, calc(1.9 * var(--vw)), 36px);
  width: 30px; height: 30px; padding: 0;
  background: none; border: 0; color: var(--white);
  cursor: pointer; opacity: .85; transition: opacity .15s;
}
.fullscreen:hover, .fullscreen:focus-visible { opacity: 1; }
.fullscreen svg { display: block; width: 100%; height: 100%; }

/* ---------- Hero copy ---------- */
.title {
  font-weight: 300;
  font-size: clamp(36px, calc(3.65 * var(--vw)), 70px);
  line-height: 1.157;
  letter-spacing: -0.05em;
  color: var(--syn-green);
}

.intro {
  margin-top: clamp(20px, calc(2 * var(--vw)), 38px);
  max-width: 614px;
  font-size: clamp(15px, calc(1.04 * var(--vw)), 20px);
  line-height: 1.55;
}
.intro br { display: none; }

/* ---------- Controls panel ---------- */
.panel {
  --pad: clamp(16px, calc(1.9 * var(--vw)), 36px);
  --radio: clamp(20px, calc(1.53 * var(--vw)), 29.4px);
  --col: clamp(32px, calc(4.1 * var(--vw)), 79px);
  margin-top: clamp(24px, calc(3.1 * var(--vw)), 60px);
  max-width: 588px;
  padding: var(--pad);
  background: rgba(80, 230, 0, 0.1);
  border-radius: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(3, var(--col));
  row-gap: clamp(14px, calc(1.2 * var(--vw)), 23px);
  align-items: center;
}

.panel-label, .levels { font-size: clamp(10px, calc(0.68 * var(--vw)), 13px); }
.panel-label { grid-column: 1; }
.levels { display: contents; }
.levels span { text-align: center; }

.row { display: contents; border: 0; }
.row-name {
  grid-column: 1;
  display: flex; align-items: center; gap: clamp(6px, calc(1 * var(--vw)), 20px);
}
.row-icon {
  flex: none; object-fit: contain;
  width: clamp(18px, calc(1.5 * var(--vw)), 29px); height: clamp(18px, calc(1.5 * var(--vw)), 29px);
}
.row-label { font-size: clamp(14px, calc(1.35 * var(--vw)), 23.83px); line-height: 1.2; white-space: nowrap; }

.radio { justify-self: center; display: block; line-height: 0; cursor: pointer; }

/* Custom radio: styled input, no images */
input[type="radio"] {
  -webkit-appearance: none; appearance: none;
  display: grid; place-content: center;
  width: var(--radio); height: var(--radio);
  margin: 0; flex: none; cursor: pointer;
  background: transparent;
  border: 1px solid var(--syn-green);
  border-radius: 50%;
  box-shadow: 0 0 14px rgba(80, 230, 0, 0.45);
}
input[type="radio"]::before {
  content: "";
  width: min(22px, calc(var(--radio) - 4px)); height: min(22px, calc(var(--radio) - 4px));
  border-radius: 50%;
  background: var(--syn-green);
  box-shadow: 0 0 8px var(--syn-green);
  transform: scale(0);
  transition: transform .15s ease-out;
}
input[type="radio"]:checked { background: rgba(80, 230, 0, 0.15); box-shadow: 0 0 18px rgba(80, 230, 0, 0.8); }
input[type="radio"]:checked::before { transform: scale(1); }
input[type="radio"]:focus-visible { outline: 2px solid var(--syn-green); outline-offset: 4px; }

.divider {
  grid-column: 1 / -1;
  width: 100%; border: 0; border-top: 1px solid rgba(255, 255, 255, 0.2);
  margin-top: clamp(4px, calc(0.6 * var(--vw)), 12px);
}
.timing-title {
  grid-column: 1 / -1;
  font-size: clamp(17px, calc(1.35 * var(--vw)), 26px);
}

.timing {
  grid-column: 1 / -1;
  min-width: 0; width: 100%;
  border: 0;
  display: flex; align-items: flex-start;
  padding-top: 4px;
}
.stop {
  display: flex; flex-direction: column; gap: 8px;
  position: relative; cursor: pointer;
  font-size: clamp(11px, calc(0.68 * var(--vw)), 13px); text-align: center;
}
.early { align-items: flex-start; text-align: left; }
.mid { align-items: center; }
.late { align-items: flex-end; text-align: right; }
.timing .line {
  flex: 1; min-width: 20px; height: 1px; max-width: none;
  margin-top: calc(var(--radio) / 2);
}

/* Reset button (bottom right of the panel) */
.reset {
  grid-column: 1 / -1; justify-self: end;
  display: flex; align-items: center; gap: 6px;
  margin: calc(var(--pad) * -0.2) calc(var(--pad) * -0.5) calc(var(--pad) * -0.6) 0;
  padding: 0; background: none; border: 0;
  color: var(--white); font: inherit; font-size: clamp(10px, calc(0.68 * var(--vw)), 13px);
  opacity: .5; cursor: pointer; transition: opacity .15s;
}
.reset:hover, .reset:focus-visible { opacity: 1; }
.reset img { width: 14px; height: 14px; }

/* ---------- Comparison columns ---------- */
.compare { min-width: 0; }

.dropdown {
  position: relative; z-index: 2; display: flex; align-items: center; gap: 0.5em;
  width: 100%; height: clamp(38px, calc(2.45 * var(--vw)), 47px);
  margin-bottom: clamp(8px, calc(0.78 * var(--vw)), 15px);
  padding: 0 clamp(10px, calc(0.9 * var(--vw)), 12px);
  background: var(--glass); border: 0; border-radius: 10px;
  color: inherit; font: inherit; font-size: clamp(14px, calc(1.04 * var(--vw)), 20px);
  cursor: pointer; text-align: left;
}
.dd-value { color: rgba(255, 255, 255, 0.25); }
.dd-value.selected { color: var(--syn-green); }
.chev {
  margin-left: auto; width: 9px; height: 9px; max-width: none;
  transform: rotate(135deg);
}

.card {
  position: relative; overflow: hidden;
  width: 100%; aspect-ratio: 495 / 837;
  container-type: inline-size;
  background: var(--glass); border-radius: 10px;
}
.plant {
  position: absolute; left: -62.19%; top: 0;
  width: 230.29%; height: 100%; max-width: none; pointer-events: none;
}
.score {
  position: absolute; right: 3.8%; bottom: 3.2%;
  width: 24%; aspect-ratio: 1;
}
.score-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 1.4px solid var(--syn-green);
  box-shadow: 0 0 7px 1px rgba(80, 230, 0, 0.7), inset 0 0 7px 1px rgba(80, 230, 0, 0.7);
  pointer-events: none;
}
.score span {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-weight: 200; font-size: 8.9cqw; letter-spacing: -0.05em; color: var(--syn-green);
}
.zoom {
  position: absolute; left: 5%; bottom: 2.5%;
  width: 5.8%; padding: 0; border: 0; background: none; cursor: pointer;
}
.zoom img { width: 100%; height: auto; transition: transform .15s; }
.zoom:hover img { transform: scale(1.1); }

.footnote {
  width: 100%; max-width: 1920px; margin-inline: auto;
  padding: 0 var(--gutter) 20px;
  font-size: clamp(10px, calc(0.68 * var(--vw)), 13px);
  color: rgba(255, 255, 255, 0.3);
}

/* ---------- Slightly smaller condition labels under 1440px ---------- */
@media (max-width: 1439px) {
  .row-label { font-size: clamp(13px, 1.2vw, 18px); }
}

/* ---------- Under 1024px: stack panel above comparison ---------- */
@media (max-width: 1023px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 32px;
    padding: 80px 24px 24px;
    align-items: start;
    align-content: start;
    grid-template-columns: minmax(0, 1fr);
  }
  .right { width: 100%; --card-w: auto; }
  .left { padding-block: 0; }
  .title { font-size: clamp(40px, 7vw, 64px); }
  .intro { font-size: 17px; }
  .panel { max-width: 640px; --col: 64px; }
  .panel-label, .levels { font-size: 13px; }
  .row-label { font-size: 20px; }
  .timing-title { font-size: 22px; }
  .stop { font-size: 13px; }
  .dropdown { font-size: 16px; height: 44px; }
  .footnote { padding-inline: 24px; font-size: 12px; }
}

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
  .layout { padding: 72px 16px 16px; row-gap: 28px; }
  .app-title { font-size: 12px; }
  .title { font-size: 38px; }
  .intro { font-size: 15px; }
  .panel { --col: 46px; --radio: 24px; padding: 18px; }
  .panel-label { font-size: 11px; grid-column: 1; }
  .levels span { font-size: 11px; }
  .row-label { font-size: 16px; }
  .timing-title { font-size: 18px; }
  .right { gap: 10px; }
  .dropdown { font-size: 12px; height: 38px; padding: 0 8px; gap: 4px; }
  .dd-label { display: none; }
  .footnote { padding-inline: 16px; }
}

/* ---------- Alpine ---------- */
[x-cloak] { display: none !important; }

/* ---------- Treatment dropdown ---------- */
.select { position: relative; z-index: 5; }
.select .dropdown { margin-bottom: clamp(8px, calc(0.78 * var(--vw)), 15px); border: 1px solid transparent; }
.dropdown.is-open {
  border-color: var(--syn-green);
  box-shadow: 0 0 6px rgba(80, 230, 0, 0.3);
}
.dropdown.is-open .chev { transform: rotate(-45deg); }
.dropdown .chev { margin-top: 0; }

.dd-menu {
  position: absolute; left: 0; right: 0;
  top: calc(100% + 7px);
  list-style: none; padding: 4px;
  background: rgba(32, 32, 32, 0.96);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-radius: 10px;
  box-shadow: 0 0 6px rgba(80, 230, 0, 0.3);
}
.dd-menu button {
  display: block; width: 100%;
  padding: 4px clamp(10px, calc(0.9 * var(--vw)), 14px);
  background: none; border: 0; border-radius: 8px;
  color: inherit; font: inherit; font-size: clamp(14px, calc(1.04 * var(--vw)), 20px);
  line-height: 1.5; text-align: left; cursor: pointer;
}
.dd-menu button:hover,
.dd-menu button:focus-visible { background: rgba(255, 255, 255, 0.12); outline: 0; }
.dd-menu button.active { color: var(--syn-green); }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
}
.lightbox::before {
  content: ""; position: absolute;
  inset: 2.7vh 2.45vw;
  background: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(24.5px); backdrop-filter: blur(24.5px);
  border-radius: 10px;
  z-index: -1;
}
.lightbox-frame {
  width: min(65.4vw, 85.3vh * 1256 / 921);
  aspect-ratio: 1256 / 921;
  border-radius: 11px; overflow: hidden;
}
.lightbox-frame img {
  display: block; width: 100%; height: 100%; object-fit: cover;
  transition: transform .2s ease-out;
}
.lightbox-controls {
  position: absolute; top: clamp(24px, 4.8vh, 52px); right: clamp(24px, 4.8vw, 93px);
  display: flex; align-items: center; gap: 11px;
}
.lightbox-controls button { background: none; border: 0; padding: 0; cursor: pointer; line-height: 0; }
.lightbox-controls button img { width: 26px; height: 26px; }
.lightbox-controls button:disabled { opacity: .35; cursor: default; }
.lightbox-controls .lightbox-close { margin-left: 14px; }
.lightbox-controls .lightbox-close img { width: 33px; height: 33px; }

@media (max-width: 640px) {
  .lightbox-frame { width: 92vw; }
  .lightbox-controls { top: 14px; right: 16px; }
}
