/* CropNow products: the farm shed in 3D, and each product's details below.
 *
 * The shed fills the window. Its controls float over the picture in the
 * site's chalk and forest, softly frosted so the room shows through.
 */

/* -- The shed -------------------------------------------------------------- */

.shed {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 34rem;
  overflow: hidden;
  background: #2a2119;
  color: var(--ink);
}

.shed__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Chalk washes at the top and bottom keep the header and controls legible. */
.shed::before,
.shed::after {
  content: "";
  position: absolute;
  right: 0;
  left: 0;
  z-index: 1;
  pointer-events: none;
}

.shed::before {
  top: 0;
  height: calc(var(--header-h) + 9rem);
  background: linear-gradient(rgb(248 250 247 / .92), rgb(248 250 247 / .55) 55%, rgb(248 250 247 / 0));
}

.shed::after {
  bottom: 0;
  height: 9rem;
  background: linear-gradient(rgb(248 250 247 / 0), rgb(248 250 247 / .5));
}

.shed__top {
  position: absolute;
  top: var(--header-h);
  left: var(--gutter);
  right: var(--gutter);
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: .75rem 2rem;
}

.shed__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 1.4rem + 2.6vw, 3.8rem);
  font-weight: 900;
  line-height: .95;
}

.shed__sub {
  max-width: 24rem;
  margin: .5rem 0 0;
  font-weight: 600;
  line-height: 1.35;
}

.shed__tabs {
  display: flex;
  gap: .4rem;
  padding: .3rem;
  border-radius: 999px;
  background: rgb(248 250 247 / .7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.shed__tab {
  display: grid;
  gap: .1rem;
  padding: .55rem 1.1rem .6rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--forest);
  text-align: left;
  cursor: pointer;
  transition: background-color .3s var(--ease), color .3s var(--ease);
}

.shed__tab:hover {
  background: rgb(197 209 181 / .5);
}

.shed__tab[aria-selected="true"] {
  background: var(--forest);
  color: var(--chalk);
}

.shed__tab-name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1;
}

.shed__tab-kind {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .02em;
  opacity: .8;
}

/* -- Loading ---------------------------------------------------------------- */

.shed__loader {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 1rem;
  padding: var(--gutter);
  background: var(--chalk);
  text-align: center;
  transition: opacity .8s var(--ease), visibility 0s linear .8s;
}

.shed__loader.is-done {
  opacity: 0;
  visibility: hidden;
}

.shed__loader-text {
  margin: 0;
  max-width: 26rem;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 1.2rem + 2vw, 2.8rem);
  font-weight: 900;
  line-height: 1;
}

.shed__loader-bar {
  position: relative;
  width: min(18rem, 70vw);
  height: 3px;
  border-radius: 3px;
  background: rgb(197 209 181 / .8);
  overflow: hidden;
}

.shed__loader-bar i {
  position: absolute;
  inset: 0;
  background: var(--green);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .3s var(--ease);
}

.shed__loader-pct {
  margin: 0;
  color: var(--forest);
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .14em;
  font-variant-numeric: tabular-nums;
}

.shed.is-unavailable .shed__loader-bar,
.shed.is-unavailable .shed__loader-pct {
  display: none;
}

/* -- Numbered points on the products ------------------------------------------------ */

.hotspots {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.hotspot {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  margin: -1.1rem 0 0 -1.1rem;
  padding: 0;
  border: 2px solid var(--chalk);
  border-radius: 50%;
  background: var(--green);
  color: var(--chalk);
  font: 700 .72rem/1 var(--font-text);
  letter-spacing: .04em;
  box-shadow: 0 .4rem 1.2rem rgb(13 59 9 / .35);
  cursor: pointer;
  pointer-events: auto;
  transition: opacity .3s var(--ease), background-color .3s var(--ease), scale .3s var(--ease);
}

/* A slow ring that invites a tap. */
.hotspot::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2px solid var(--green);
  animation: spot-ring 2.6s ease-out infinite;
}

.hotspot span {
  position: absolute;
  left: calc(100% + .55rem);
  padding: .3rem .65rem;
  border-radius: 999px;
  background: rgb(248 250 247 / .92);
  color: var(--forest);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: 0;
  white-space: nowrap;
  opacity: 0;
  translate: -.3rem 0;
  pointer-events: none;
  transition: opacity .25s var(--ease), translate .25s var(--ease);
}

.hotspot:hover span,
.hotspot:focus-visible span,
.hotspot.is-active span {
  opacity: 1;
  translate: 0 0;
}

.hotspot:hover,
.hotspot.is-active {
  background: var(--forest);
  scale: 1.12;
}

.hotspot.is-off,
.hotspot.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.hotspot.is-hidden:not(.is-off) {
  opacity: .25;
}

@keyframes spot-ring {
  from { scale: 1; opacity: .8; }
  to { scale: 1.9; opacity: 0; }
}

[data-motion="paused"] .hotspot::before {
  animation: none;
  opacity: 0;
}

/* -- The card for a point ---------------------------------------------------------------- */

.spot-card {
  position: absolute;
  top: 50%;
  right: var(--gutter);
  z-index: 4;
  width: min(23rem, 100vw - 2 * var(--gutter));
  padding: 1.5rem 1.5rem 1.2rem;
  border-radius: 1.4rem;
  background: rgb(248 250 247 / .9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 1.5rem 3rem rgb(13 59 9 / .22);
  translate: 0 -50%;
}

.spot-card.is-in {
  animation: card-in .45s var(--ease);
}

@keyframes card-in {
  from { opacity: 0; transform: translateX(1rem); }
}

.spot-card__close {
  position: absolute;
  top: .7rem;
  right: .7rem;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--forest);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}

.spot-card__close:hover {
  background: rgb(197 209 181 / .6);
}

.spot-card__label {
  margin: 0;
  color: var(--green);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.spot-card__title {
  margin: .6rem 2rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 1.3rem + 1vw, 2.2rem);
  font-weight: 900;
  line-height: 1;
}

.spot-card__body {
  margin: .8rem 0 0;
  font-size: 1rem;
  line-height: 1.6;
}

.spot-card__nav {
  display: flex;
  justify-content: space-between;
  margin-top: 1.1rem;
}

.spot-card__nav button {
  padding: .4rem 0;
  border: 0;
  background: none;
  color: var(--forest);
  font: 600 .85rem/1 var(--font-text);
  cursor: pointer;
}

.spot-card__nav button:hover {
  color: var(--green);
}

/* -- Controls ------------------------------------------------------------------------- */

.dock {
  position: absolute;
  bottom: 1.4rem;
  left: 50%;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: .35rem;
  padding: .35rem;
  border-radius: 999px;
  background: rgb(248 250 247 / .82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 .8rem 2rem rgb(13 59 9 / .16);
  translate: -50% 0;
}

.dock__btn,
.dock__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--forest);
  font: 600 .88rem/1 var(--font-text);
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .25s var(--ease), color .25s var(--ease);
}

.dock__btn {
  padding: 0 1rem;
}

.dock__icon {
  width: 2.5rem;
  font-size: 1.15rem;
}

.dock__btn:hover,
.dock__icon:hover {
  background: rgb(197 209 181 / .6);
}

.dock__btn[aria-pressed="true"] {
  background: var(--forest);
  color: var(--chalk);
}

.dock__btn[hidden] {
  display: none;
}

.dock__led {
  width: .45rem;
  height: .45rem;
  border-radius: 50%;
  background: rgb(13 59 9 / .3);
  transition: background-color .25s var(--ease), box-shadow .25s var(--ease);
}

.dock__btn[aria-pressed="true"] .dock__led {
  background: #8fe08a;
  box-shadow: 0 0 .5rem #8fe08a;
}

.dock__btn.is-busy .dock__led {
  animation: led-busy .6s ease-in-out infinite alternate;
}

@keyframes led-busy {
  to { opacity: .2; }
}

.shed__hint,
.shed__down {
  position: absolute;
  bottom: 2.15rem;
  z-index: 3;
  margin: 0;
  color: var(--forest);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .04em;
}

.shed__hint {
  left: var(--gutter);
}

.shed__down {
  right: var(--gutter);
  text-decoration: none;
}

.shed__down:hover {
  color: var(--green);
}

/* Narrow screens: the card becomes a sheet at the bottom, the controls wrap. */
@media (max-width: 760px), (max-aspect-ratio: 1/1) {
  .shed__top {
    align-items: flex-start;
    flex-direction: column;
  }

  .shed__tabs {
    max-width: 100%;
    overflow-x: auto;
  }

  .shed__tab {
    padding: .5rem .85rem;
  }

  .shed__tab-kind {
    display: none;
  }

  .spot-card {
    top: auto;
    right: var(--gutter);
    bottom: 5.2rem;
    left: var(--gutter);
    width: auto;
    translate: none;
  }

  .shed__hint,
  .shed__down {
    display: none;
  }

  .dock {
    bottom: 1rem;
  }

  .dock__btn {
    padding: 0 .8rem;
    font-size: .8rem;
  }

  .dock__icon {
    width: 2.2rem;
  }
}

/* -- Details ------------------------------------------------------------------------------- */

.details {
  --pd-w: min(64rem, 100vw - 2 * var(--gutter));
  position: relative;
  padding: clamp(4rem, 12vh, 7rem) 0 clamp(5rem, 14vh, 9rem);
}

@media (min-width: 900px) and (min-aspect-ratio: 1/1) {
  .details {
    --pd-w: min(62rem, 100vw - 26rem);
  }
}

.product-details {
  width: var(--pd-w);
  margin: 0 auto;
  container-type: inline-size;
}

.product-details.is-entering {
  animation: details-in .7s var(--ease);
}

@keyframes details-in {
  from { opacity: 0; transform: translateY(1.25rem); }
}

[data-motion="paused"] .product-details.is-entering {
  animation: none;
}

.pd-intro .sec-eyebrow {
  display: flex;
  align-items: center;
  gap: .85rem;
  margin: 0;
  color: var(--green);
  font: 600 .8rem/1.2 var(--font-text);
  letter-spacing: .16em;
  text-transform: uppercase;
}

.pd-name {
  margin: .75rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(4rem, 2rem + 8vw, 8.5rem);
  font-weight: 900;
  line-height: .85;
}

.product-details .pd-lede {
  max-width: 36rem;
  margin: 1.1rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 1.1rem + 2.2vw, 3rem);
  font-weight: 900;
  line-height: 1;
  text-wrap: balance;
}

/* Low priority (:where) so the larger text styles below still apply. */
.pd-text,
.product-details :where(p) {
  font-size: clamp(1.02rem, .9rem + .35vw, 1.18rem);
  line-height: 1.65;
  text-wrap: pretty;
}

.pd-text {
  max-width: 40rem;
  margin: 1rem 0 0;
}

.pd-text--big {
  max-width: 44rem;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 1.1rem + 1.6vw, 2.4rem);
  font-weight: 900;
  line-height: 1.1;
}

.pd-block {
  margin-top: clamp(3.5rem, 9vh, 6rem);
}

.pd-h3 {
  margin: 0 0 1.25rem;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 1.2rem + 1.6vw, 2.7rem);
  font-weight: 900;
  line-height: 1;
  text-wrap: balance;
}

.pd-split {
  display: grid;
  gap: 3rem;
}

@container (min-width: 46rem) {
  .pd-split {
    grid-template-columns: 1fr 1fr;
  }
}

/* Part by part: the numbered points, as a list. */
.pd-parts {
  display: grid;
  gap: 2rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

@container (min-width: 46rem) {
  .pd-parts {
    grid-template-columns: 1fr 1fr;
    column-gap: 3rem;
  }
}

.pd-parts li {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  gap: 1rem;
}

.pd-parts__num {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  background: var(--green);
  color: var(--chalk);
  font-size: .8rem;
  font-weight: 700;
}

.pd-parts__label {
  margin: .1rem 0 0;
  color: var(--green);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.pd-parts__title {
  margin: .3rem 0 0;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 900;
  line-height: 1;
}

.pd-parts p {
  margin: .5rem 0 0;
}

.pd-link {
  margin-top: .6rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--forest);
  font: 600 .9rem/1.2 var(--font-text);
  text-decoration: underline;
  text-decoration-color: rgb(66 146 62 / .5);
  text-underline-offset: .25em;
  cursor: pointer;
}

.pd-link:hover {
  color: var(--green);
}

/* Lists with a green tick. */
.pd-ticks {
  display: grid;
  gap: .6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pd-ticks li {
  position: relative;
  padding-left: 1.6rem;
  line-height: 1.5;
}

.pd-ticks li::before {
  content: "";
  position: absolute;
  top: .55em;
  left: .1rem;
  width: .55rem;
  height: .3rem;
  border-bottom: 2px solid var(--green);
  border-left: 2px solid var(--green);
  rotate: -45deg;
}

/* 14 parameters: a bar for each group, as long as its count. */
.pd-sensors {
  display: grid;
  gap: .9rem;
}

.pd-sensor {
  display: grid;
  grid-template-columns: 2.5rem 7rem minmax(0, 1fr);
  align-items: center;
  gap: .75rem;
}

.pd-sensor b {
  font-family: var(--font-display);
  font-size: 2.4rem;
  line-height: 1;
}

.pd-sensor span {
  font-weight: 600;
}

.pd-sensor i {
  height: .6rem;
  border-radius: 1rem;
  background: linear-gradient(90deg, var(--green) calc(var(--n) / 9 * 100%), rgb(197 209 181 / .6) 0);
}

.pd-note {
  margin: 1rem 0 0;
  color: var(--forest);
}

/* Label and value pairs. */
.pd-glance {
  display: grid;
  gap: 1.5rem 2.5rem;
  margin: 0;
}

@container (min-width: 46rem) {
  .pd-glance {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .pd-glance--four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.pd-glance div,
.pd-specs div,
.pd-numbers div {
  margin: 0;
}

.pd-glance dt,
.pd-specs dt,
.pd-numbers dt {
  color: var(--green);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.pd-glance dd {
  margin: .35rem 0 0;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 900;
  line-height: 1.05;
}

.pd-specs {
  display: grid;
  gap: 1rem;
  margin: 0;
}

.pd-specs dd {
  margin: .25rem 0 0;
  font-size: 1.05rem;
  line-height: 1.5;
}

/* NEST variants side by side, each a column on a sage wash. */
.pd-variants {
  display: grid;
  gap: 1.25rem;
  margin-top: 1.75rem;
}

@container (min-width: 46rem) {
  .pd-variants {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.pd-variant {
  padding: 1.4rem;
  border-radius: 1.4rem;
  background: linear-gradient(180deg, rgb(197 209 181 / .42), rgb(197 209 181 / .12));
}

.pd-variant h4 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 900;
  line-height: 1;
}

.pd-variant p {
  margin: .5rem 0 0;
  font-size: .98rem;
}

.pd-variant__use {
  color: var(--forest);
  font-weight: 600;
}

.pd-variant__count {
  color: var(--green);
  font-weight: 700;
}

.pd-variant .pd-ticks {
  margin: 1rem 0;
  font-size: .95rem;
}

.pd-variant__senses,
.pd-variant__crops {
  color: rgb(13 59 9 / .8);
}

.pd-compare {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
}

.pd-compare th,
.pd-compare td {
  padding: .9rem .75rem .9rem 0;
  text-align: left;
  vertical-align: top;
}

.pd-compare thead th {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 900;
}

.pd-compare tbody th {
  color: var(--green);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.pd-compare tbody tr:nth-child(odd) {
  background: rgb(197 209 181 / .22);
}

.pd-compare tbody tr > :first-child {
  padding-left: .75rem;
}

/* CropDesk's screens. */
.pd-screens {
  position: relative;
  margin: clamp(2.5rem, 6vh, 4rem) 0 0;
  padding-bottom: 2.5rem;
}

.pd-screens img {
  height: auto;
  border-radius: 1rem;
  box-shadow: 0 1.5rem 3rem rgb(13 59 9 / .16);
}

.pd-screens__desktop {
  width: 88%;
}

.pd-screens__phone {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 20%;
  border-radius: 1.4rem !important;
}

.pd-langs {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pd-langs li {
  padding: .5rem 1.1rem;
  border-radius: 999px;
  background: rgb(197 209 181 / .55);
  color: var(--forest);
  font-size: 1.15rem;
  font-weight: 600;
}

.pd-numbers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem;
  margin: 0;
}

@container (min-width: 46rem) {
  .pd-numbers {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.pd-numbers div {
  display: flex;
  flex-direction: column-reverse;
}

.pd-numbers dd {
  margin: 0 0 .4rem;
  color: var(--green);
  font-family: var(--font-display);
  font-size: clamp(3.4rem, 2rem + 4vw, 5rem);
  font-weight: 900;
  line-height: .9;
}

.pd-numbers dt {
  color: var(--forest);
  letter-spacing: .02em;
  text-transform: none;
  font-size: .95rem;
}

/* -- Icons -------------------------------------------------------------------------
 * Used only where they explain something: beside NEST's sensor groups and
 * for each thing SEED does at a stop (templates/website/products/_motif.html).
 */

.motif {
  display: block;
  width: 2.2rem;
  height: 2.2rem;
  color: var(--forest);
}

.motif svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.motif svg * {
  transform-box: view-box;
  transform-origin: 24px 24px;
}

.motif .m-line { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.motif .m-soft { stroke-opacity: .45; }
.motif .m-light { stroke: var(--chalk); stroke-opacity: .85; stroke-width: 1.6; }
.motif .m-ray { fill: var(--sun); transform: rotate(calc(var(--r) * 30deg)); }
.motif .m-sun { fill: #e7a94a; }
.motif .m-leaf { fill: rgb(66 146 62 / .85); }

.pd-sensor {
  grid-template-columns: 2.2rem 2.5rem 7rem minmax(0, 1fr);
}

/* Each part of the details eases up into view once (main.js). */
.details.is-armed .pd-block {
  transition: opacity .9s var(--ease), transform 1s var(--ease);
}

.details.is-armed .pd-block:not(.is-in) {
  opacity: 0;
  transform: translateY(1.5rem);
}

[data-motion="paused"] .details *,
[data-motion="paused"] .details *::before,
[data-motion="paused"] .details *::after {
  animation: none !important;
}

[data-motion="paused"] .details.is-armed .pd-block {
  transition: none;
}
