/* ==========================================================================
   ActiRoam

   The original site was built on Squarespace's 24-column fluid grid (8 columns
   below 768px). Both the grid maths and the type scale below are carried over
   from it verbatim, so every element lands in its original position.
   ========================================================================== */

:root {
  /* Palette */
  --cream: #f1f0e0;   /* page background          */
  --green: #125d32;   /* sign-up section          */
  --gold:  #ebc470;   /* accent / primary CTA     */
  --black: #000;
  --field: #ccdbd2;   /* form input fill on green */

  /* Fonts */
  --font-heading: "Space Grotesk", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-body: "Raleway", "Helvetica Neue", Helvetica, Arial, sans-serif;

  /* Layout */
  --max-page-width: 1400px;
  --page-padding: 4vw;
  --page-padding-mobile: 6vw;

  /* Width of the grid's content area, used by the row height + type scale */
  --container-width: min(var(--max-page-width), calc(100vw - var(--page-padding) * 2));

  /* Type scale: size = (step - 1) * (0.012 * reference) + 1rem, where
     1rem = 14px. The original measures against viewport height on small
     screens and against the (capped) page width from 768px up. */
  --type-step: calc(0.012 * min(100vh, 900px));
  --h1: calc((4.6 - 1) * var(--type-step) + 1rem);
  --h3: calc((2.6 - 1) * var(--type-step) + 1rem);
  --h4: calc((2.0 - 1) * var(--type-step) + 1rem);
  --text: calc((1.2 - 1) * var(--type-step) + 1rem);
  --text-small: 1rem;

  /* Fluid-engine row height */
  --row-h: calc(var(--container-width) * 0.0215);
}

/* ==========================================================================
   Base
   ========================================================================== */

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

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

body {
  margin: 0;
  background-color: var(--cream);
  color: var(--green);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--text);
  line-height: 1.5em;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }

h1, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 500;
  letter-spacing: -0.05em;
  margin: 0;
}

/* Heading line-height, as in the original: 1.2em * (1 + (1 - step) / 25) */
h1 { font-size: var(--h1); line-height: 1.0272em; }
h3 { font-size: var(--h3); line-height: 1.1232em; }
h4 { font-size: var(--h4); line-height: 1.152em; }

p { margin: 0; }

.t-black { color: var(--black); }

.skip-link { position: absolute; left: -9999px; top: 0; }
.skip-link:focus {
  left: 0;
  z-index: 100;
  padding: 0.75em 1.25em;
  background: var(--black);
  color: var(--cream);
}

:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }

/* ==========================================================================
   Grid

   Mirrors Squarespace's fluid engine: flexible gutters either side of a fixed
   number of capped columns, so content sits flush to a 4vw page margin and
   stops growing once the page hits its maximum width.
   ========================================================================== */

.section { position: relative; }
.section--cream { background-color: var(--cream); }
.section--green { background-color: var(--green); color: var(--cream); }

.grid {
  --gap: 0px;
  display: grid;
  row-gap: var(--gap);
  column-gap: var(--gap);
  --grid-gutter: calc(var(--page-padding-mobile) - var(--gap));
  --cell-max-width: calc((var(--max-page-width) - (var(--gap) * 7)) / 8);
  grid-template-columns:
    minmax(var(--grid-gutter), 1fr)
    repeat(8, minmax(0, var(--cell-max-width)))
    minmax(var(--grid-gutter), 1fr);
}

.grid--gap { --gap: 11px; }

@media (min-width: 768px) {
  :root { --type-step: calc(0.012 * min(100vw, var(--max-page-width))); }

  .grid {
    --grid-gutter: calc(var(--page-padding) - var(--gap));
    --cell-max-width: calc((var(--max-page-width) - (var(--gap) * 23)) / 24);
    grid-template-columns:
      minmax(var(--grid-gutter), 1fr)
      repeat(24, minmax(0, var(--cell-max-width)))
      minmax(var(--grid-gutter), 1fr);
  }
}

/* ==========================================================================
   Header

   Overlays the top of the hero, which reserves space for it with padding.
   ========================================================================== */

.site-header {
  position: absolute;
  inset: 0 0 auto;
  z-index: 10;
  display: flex;
  justify-content: center;
  padding-top: 14px;
}

.site-logo { display: block; }
.site-logo img { width: 190px; height: auto; }

@media (min-width: 768px) {
  .site-logo img { width: 236px; }
}

/* ==========================================================================
   Hero
   ========================================================================== */

/* The hero grows on unusually tall viewports, as the original section did.
   Below roughly 1450px of viewport height the content height wins out. */
.hero {
  padding-top: 115px;
  padding-bottom: 27px;
  min-height: 33vh;
}

.hero .grid {
  grid-template-rows: auto auto;
  row-gap: 0;              /* the lede sits directly beneath the heading */
}

.hero__title {
  grid-area: 1 / 2 / 2 / 10;
  color: var(--green);
  text-align: center;
}
.hero__title strong { font-weight: 700; }

.hero__col { grid-area: 2 / 2 / 3 / 10; }

.hero__cta {
  display: flex;
  justify-content: flex-end;
  margin-top: 36px;
}

@media (min-width: 768px) {
  .hero { padding-top: 80px; padding-bottom: 0; }

  .hero .grid {
    /* The heading is centred in a grid slightly taller than itself; the extra
       space scales with the content width, as it does on the original. */
    padding-block: calc(0.03585 * var(--container-width));
    grid-template-rows: auto;
    align-items: start;
  }

  /* h1 in columns 1–10 */
  .hero__title { grid-area: 1 / 2 / 2 / 12; }

  /* lede + button in columns 13–24 */
  .hero__col { grid-area: 1 / 14 / 2 / 26; }

  .hero__cta {
    justify-content: flex-start;
    margin-top: 27px;
  }
}

/* ==========================================================================
   Product image

   Sits flush to the bottom of the cream area, six grid rows tall.
   ========================================================================== */

.showcase .grid { grid-template-rows: repeat(4, minmax(24px, auto)); }

.showcase__media {
  grid-area: 1 / 6 / 5 / 10;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

/* Fills the height of its cell, centred within it, as on the original. */
.showcase__media img {
  width: auto;
  height: 96px;              /* four 24px mobile rows */
}

@media (min-width: 768px) {
  .showcase .grid { grid-template-rows: repeat(6, minmax(var(--row-h), auto)); }
  .showcase__media { grid-area: 1 / 16 / 7 / 22; }
  .showcase__media img { height: calc(var(--row-h) * 6); }
}

/* ==========================================================================
   Sign-up section
   ========================================================================== */

.signup .grid { grid-template-rows: repeat(42, minmax(24px, auto)); }

.signup__intro { grid-area: 2 / 2 / 14 / 10; }
.signup__hook  { grid-area: 14 / 2 / 20 / 10; }
.signup__form  { grid-area: 21 / 2 / 38 / 10; }

.signup__media {
  grid-area: 39 / 1 / 43 / 7;
  display: flex;
  justify-content: center;
  align-items: center;
}

.signup__intro,
.signup__hook {
  text-align: center;
  color: var(--cream);
}

.signup__media img {
  width: auto;
  height: calc(var(--row-h) * 6);
}

/* Gold underline behind "get exclusive early access" */
.highlight {
  background-image: linear-gradient(var(--gold), var(--gold));
  background-repeat: no-repeat;
  background-size: 100% 0.1em;
  background-position: 0 92%;
}

@media (min-width: 768px) {
  .signup .grid { grid-template-rows: repeat(32, minmax(var(--row-h), auto)); }

  .signup__intro { grid-area: 2 / 6 / 8 / 22; }
  .signup__hook  { grid-area: 8 / 6 / 11 / 22; }
  .signup__form  { grid-area: 13 / 9 / 26 / 19; }
  .signup__media { grid-area: 27 / 6 / 33 / 12; }
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 300px;
  padding: 21px 30.8px;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 500;
  line-height: 18px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.btn:hover { opacity: 0.85; }

/* The hero CTA is four grid columns wide */
.btn--dark {
  background-color: var(--black);
  color: #fff;
  width: calc((100% - 7 * 11px) / 8 * 4 + 33px);
}

@media (min-width: 768px) {
  .btn--dark {
    width: calc((var(--container-width) - 23 * 11px) / 24 * 4 + 33px);
    padding-block: 25px;   /* slightly taller than the submit button */
  }
}

.btn--gold {
  background-color: var(--gold);
  color: var(--black);
}

/* ==========================================================================
   Form
   ========================================================================== */

.form-block { color: var(--cream); }

.hidden-field { position: absolute; left: -9999px; }

.field { margin: 0 0 1.5em; padding: 0; border: 0; }
.field--tight { margin-top: -1.1em; }

.field__label {
  display: block;
  font-family: var(--font-body);
  font-size: var(--text);
  font-weight: 500;
  line-height: 1.5em;
  color: var(--cream);
  padding: 0 0 4px;
}

.req {
  font-size: var(--text-small);
  opacity: 0.7;
}

.input {
  width: 100%;
  height: 44px;
  background-color: var(--field);
  border: 0;
  border-radius: 25px;
  padding: 8px 15px;
  font-family: var(--font-body);
  font-size: var(--text);
  font-weight: 500;
  line-height: 1.5em;
  letter-spacing: 0.01em;
  color: #1b3527;
}

.input::placeholder { color: rgba(27, 53, 39, 0.55); }
.input:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* Select */
.select-wrap { position: relative; }

.select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 37px;
  cursor: pointer;
}
.select:invalid { color: rgba(27, 53, 39, 0.55); }

.select-chevron {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: #1b3527;
  pointer-events: none;
}

/* Checkboxes */
.option-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em 1.7em;
  margin-top: 0.5em;
}

.option {
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  cursor: pointer;
  line-height: 1.5em;
}

.option input {
  position: absolute;
  opacity: 0;
  width: 22px;
  height: 22px;
  margin: 0;
  cursor: pointer;
}

.option__box {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  background-color: var(--field);
  border-radius: 4px;
  position: relative;
}

.option input:checked + .option__box::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 3px;
  width: 7px;
  height: 12px;
  border: solid #1b3527;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}

.option input:focus-visible + .option__box {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.option__text {
  font-size: var(--text-small);
  color: var(--cream);
}

/* Submit */
.form-actions {
  display: flex;
  justify-content: center;
  margin-top: 37px;
}

/* The original's form is a little more generous below the small screens'
   two-line checkbox group, and its inputs are marginally shorter. */
@media (max-width: 767px) {
  .input { height: 42px; }
  .signup__form fieldset.field { margin-bottom: 56px; }
  .form-actions { margin-top: 25px; }
}

/* Validation + success */
.form-error {
  color: var(--gold);
  font-size: var(--text-small);
  margin-top: 1em;
  text-align: center;
}

.form-success {
  text-align: center;
  color: var(--cream);
  padding: 1em 0;
}
.form-success p { margin: 0 0 0.5em; }
.form-success strong { font-weight: 700; }

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer .grid {
  grid-template-rows: repeat(3, minmax(24px, auto));
  align-items: center;
}

.footer__contact   { grid-area: 2 / 2 / 3 / 8; }
.footer__copyright { grid-area: 3 / 2 / 4 / 10; }

.footer__contact,
.footer__copyright {
  font-size: var(--text-small);
  line-height: 1.5em;
}

.footer__social {
  grid-area: 2 / 7 / 3 / 10;
  display: flex;
  justify-content: center;
  gap: 14px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer__social a { display: block; }
.footer__social svg { width: 24px; height: 24px; fill: var(--black); }

@media (min-width: 768px) {
  .site-footer .grid { grid-template-rows: repeat(3, minmax(var(--row-h), auto)); }

  .footer__contact   { grid-area: 2 / 2 / 3 / 8; }
  .footer__copyright { grid-area: 3 / 2 / 4 / 8; }
  .footer__social    { grid-area: 2 / 22 / 3 / 26; justify-content: flex-start; }
}
