/* Glasshouse website.
 *
 * Every colour here is a token from tokens.css. No literal values.
 *
 * The ground is ink and the artwork sits on it in framed plates. An earlier
 * version tried to match the page to the cream the artwork carries, which
 * cannot be done: the artwork is about six levels lighter at its top than at
 * its bottom, so any flat ground matches one edge and misses the other, and
 * a near miss reads as a mistake. Contrasting deliberately and drawing a
 * hairline round the plate says the edge is meant to be there.
 *
 * There are no shadows. Depth is a hairline on a flat ground.
 */

/* ---- base ---------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

/* The user agent's display:none for [hidden] is a type selector, so any
 * class here that sets display would quietly beat it and reveal a hidden
 * element. Several do. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--on-ground);
  font-family: var(--ui);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

img, video { display: block; max-width: 100%; height: auto; }

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.22;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; }

a { color: inherit; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--moss);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---- shared type -------------------------------------------------------- */

.label {
  font-family: var(--ui);
  font-size: 13px;
  line-height: 1.5;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  opacity: var(--o-label);
  margin: 0;
}

/* An eyebrow is the section's real heading, so it is an h2 wearing the
 * label treatment. Reset the display face the base rule would give it. */
h2.label {
  font-family: var(--ui);
  font-weight: 400;
  line-height: 1.5;
}

/* A Latin binomial is always this face, always italic. */
.botanical {
  font-family: var(--botanical);
  font-style: italic;
}

/* Inside an uppercase label run the binomial keeps its own case, because a
 * binomial is Genus species and never GENUS SPECIES. */
.label .botanical {
  text-transform: none;
  letter-spacing: 0;
  font-size: 15px;
}

.lede {
  font-size: 16px;
  opacity: var(--o-body);
}

/* ---- layout ------------------------------------------------------------- */

.band { padding: 84px 28px; }

.wrap {
  max-width: 38rem;   /* about 65 characters of Work Sans at 16px */
  margin: 0 auto;
}

.wrap--wide {
  max-width: 72rem;
  margin: 0 auto;
}

.band__lede {
  max-width: 38rem;
  margin-top: 10px;
}

.rule {
  height: 1px;
  border: 0;
  margin: 0;
  background: var(--rule-quiet);
}

/* ---- framed media ------------------------------------------------------- */

/* The plate. A hairline and a radius, so the artwork's own cream is
 * obviously a picture on a ground rather than a failed colour match. */
.framed {
  border: 1px solid var(--rule);
  border-radius: var(--r-card);
}

/* ---- hero --------------------------------------------------------------- */

.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 48px 28px 56px;
  text-align: center;
}

.hero__wordmark {
  font-family: var(--display);
  font-size: 30px;
  line-height: 1;
  margin: 0;
}

.hero__stage {
  width: 100%;
  display: flex;
  justify-content: center;
}

/* Contained, never cropped: the plant occupies the middle of a 9:16 canvas
 * and cover-cropping to a wide band would cut the flower off. */
.hero__video {
  width: auto;
  height: min(56svh, 460px);
  aspect-ratio: 9 / 16;
  object-fit: contain;
}

.hero__caption {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hero__line {
  font-size: 16px;
  opacity: var(--o-body);
  margin: 0;
}

/* ---- beats -------------------------------------------------------------- */

.beats {
  display: flex;
  flex-direction: column;
  gap: 44px;
  margin-top: 34px;
}

.beat h3 {
  font-size: 20px;
  margin-bottom: 8px;
}

.beat p { opacity: var(--o-body); }

/* ---- statement ---------------------------------------------------------- */

.statement {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.statement__first {
  font-family: var(--display);
  font-size: 24px;
  line-height: 1.3;
  text-wrap: balance;
}

.statement p:not(.statement__first) { opacity: var(--o-body); }

/* ---- the app, on a phone ------------------------------------------------ */

.phones {
  display: grid;
  grid-template-columns: 1fr;
  gap: 44px 32px;
  margin-top: 38px;
  justify-items: center;
}

.phone {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 20rem;
  width: 100%;
}

/* A device outline, not any particular handset. The screen keeps a slightly
 * tighter radius than the frame, the way a real one does. */
.phone__frame {
  border: 1px solid var(--rule);
  border-radius: var(--r-phone);
  padding: 7px;
}

.phone__screen {
  width: 100%;
  border-radius: calc(var(--r-phone) - 7px);
}

.phone__caption { text-align: center; }

/* ---- specimens ---------------------------------------------------------- */

.specimens {
  display: grid;
  grid-template-columns: 1fr;
  gap: 52px 32px;
  margin-top: 38px;
}

.specimen {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Shown in a 3:4 box rather than the artwork's own 9:16. Cover crops the top
 * and bottom, keeps the full width, and shows 75% of the canvas height,
 * which makes the plant a third larger in the same column. The offset comes
 * from the artwork: plants occupy 0.27 to 0.66 of the canvas and the soil
 * block's base sits at 0.729, so a visible band of 0.105 to 0.855 keeps all
 * of it with room above the crown. */
.specimen__media {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: center 42%;
}

.specimen__name {
  font-size: 20px;
  margin: 0;
}

.specimen__binomial {
  font-size: 15px;
  opacity: var(--o-secondary);
  margin: 0;
}

.specimen__label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* ---- buttons ------------------------------------------------------------ */

/* The primary button: paper fill, ink label, inverted from the app because
 * the ground is inverted. */
.button {
  display: inline-block;
  font-family: var(--ui);
  font-size: 17px;
  line-height: 1.2;
  color: var(--ink);
  background: var(--paper);
  border: 0;
  border-radius: var(--r-btn);
  padding: 15px 28px;
  text-decoration: none;
  cursor: pointer;
  transition: opacity var(--t-quick) var(--ease);
}

.button:hover { opacity: 0.88; }

/* ---- price -------------------------------------------------------------- */

/* Hidden until CONFIG.price is set, and then there is no placeholder to
 * remove because the section simply was not in the document. */
.price__body { margin-top: 22px; }

.price__amount { font-weight: 600; }

.store { margin-top: 26px; }

/* ---- signup ------------------------------------------------------------- */

.signup__lead {
  font-family: var(--display);
  font-size: 24px;
  line-height: 1.3;
  margin-top: 14px;
  text-wrap: balance;
}

.signup__intro {
  opacity: var(--o-body);
  margin-top: 10px;
}

.signup__form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  border: 0;
}

.signup__field {
  flex: 1 1 15rem;
  min-width: 0;
  font-family: var(--ui);
  font-size: 16px;
  color: var(--on-ground);
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: var(--r-btn);
  padding: 14px 16px;
}

.signup__field::placeholder {
  color: var(--on-ground);
  opacity: var(--o-meta);
}

.signup__field:focus { border-color: var(--moss); }

/* The site's one rose element. On this ground rose can be used at full
 * strength: an ink label on it measures 5.6, where over paper the same
 * colour could not carry text at all. */
.signup__submit {
  font-family: var(--ui);
  font-size: 17px;
  color: var(--ink);
  background: var(--rose);
  border: 0;
  border-radius: var(--r-btn);
  padding: 15px 26px;
  cursor: pointer;
  transition: opacity var(--t-quick) var(--ease);
}

.signup__submit:hover { opacity: 0.88; }

.signup__submit[disabled] {
  cursor: default;
  opacity: var(--o-secondary);
}

.signup__helper { margin-top: 16px; }

/* The three states cross-dissolve in place. No modal, no redirect. */
.signup__states {
  margin-top: 18px;
  transition: opacity var(--t-gentle) var(--ease);
}

.signup__message {
  font-size: 16px;
  opacity: var(--o-body);
}

.signup__done {
  font-family: var(--display);
  font-size: 20px;
  line-height: 1.35;
}

.is-fading { opacity: 0; }

.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---- footer ------------------------------------------------------------- */

.footer {
  padding: 44px 28px 56px;
  border-top: 1px solid var(--rule-quiet);
}

.footer__inner {
  max-width: 72rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer a {
  text-decoration-color: var(--rule);
  text-underline-offset: 3px;
}

.footer a:hover { text-decoration-color: currentColor; }

/* ---- prose pages -------------------------------------------------------- */

.prose {
  max-width: 42.5rem;   /* 680px, as specified for the legal pages */
  margin: 0 auto;
  padding: 72px 28px 24px;
}

.prose h1 { font-size: 30px; }

.prose h2 {
  font-size: 20px;
  margin-top: 44px;
}

.prose h3 {
  font-size: 16px;
  font-family: var(--ui);
  font-weight: 600;
  margin-top: 30px;
}

.prose p {
  margin-top: 14px;
  opacity: var(--o-body);
}

.prose h2 + p, .prose h3 + p { margin-top: 10px; }

.prose__updated {
  font-family: var(--ui);
  font-size: 14px;
  opacity: var(--o-meta);
  margin-top: 10px;
}

.prose__lede { margin-top: 20px; }

.prose__mail {
  font-family: var(--display);
  font-size: 20px;
  margin-top: 18px;
  display: inline-block;
}

.prose a {
  text-decoration-color: var(--rule);
  text-underline-offset: 3px;
}

.prose a:hover { text-decoration-color: currentColor; }

.back {
  display: inline-block;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  opacity: var(--o-label);
  text-decoration: none;
  border: 1px solid var(--rule-quiet);
  border-radius: var(--r-pill);
  padding: 7px 15px;
}

.back:hover { opacity: var(--o-body); }

/* ---- 404 ---------------------------------------------------------------- */

.notfound {
  min-height: 78svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  text-align: center;
  padding: 56px 28px;
}

.notfound h1 { font-size: 27px; }

/* ---- scroll reveal ------------------------------------------------------ */

/* Opacity only, 600ms. The class is added by script, so with no script every
 * section is simply visible from the start. */
.js-reveal .reveal {
  opacity: 0;
  transition: opacity var(--t-gentle) var(--ease);
}

.js-reveal .reveal.is-in { opacity: 1; }

/* On paper there is no scrolling to reveal anything, so a printed page would
 * otherwise come out blank below the hero. */
@media print {
  .js-reveal .reveal { opacity: 1; }
}

/* ---- responsive --------------------------------------------------------- */

@media (min-width: 40rem) {
  .band { padding: 100px 36px; }
  .specimens { grid-template-columns: repeat(2, 1fr); }
  .phones { grid-template-columns: repeat(3, 1fr); gap: 32px 24px; }
  .hero__video { height: min(60svh, 520px); }
  .footer, .prose { padding-left: 36px; padding-right: 36px; }
}

@media (min-width: 64rem) {
  .specimens { grid-template-columns: repeat(3, 1fr); gap: 60px 40px; }
  .phones { gap: 40px; }
}

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .js-reveal .reveal { opacity: 1; }
}
