/**
 * Gearline Outdoor, temporary landing page.
 *
 * A trimmed-down copy of the theme's own tokens and rules, taken from
 * `src/snippets/css-variables.liquid` and `src/assets/critical.css` so this page
 * and the shop are set in the same type at the same sizes. Only what this one
 * screen needs is here.
 *
 * Colour and type reasoning that matters is kept with the rule. The rest of the
 * design brief lives in the theme.
 */

/**
 * Fraunces, variable, latin subset.
 *
 * The file carries four axes and its built-in defaults are wght 900 and WONK 1,
 * so headings render heavy and wonky unless both are set. That is what
 * --font-heading--variations below pins. Do not drop it.
 */
@font-face {
  font-family: 'Fraunces';
  src: url('fonts/fraunces-variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* Inter, variable, latin subset. */
@font-face {
  font-family: 'Inter';
  src: url('fonts/inter-variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/**
 * Archivo, for the wordmark only, subset to the 16 glyphs that spell
 * "GEARLINE OUTDOOR EST 2026". `font-display: block` because a wordmark that
 * swaps in late looks broken, and at 4 KB the block period is imperceptible.
 */
@font-face {
  font-family: 'Archivo';
  src: url('fonts/archivo-wordmark.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: block;
}

:root {
  --color-paper: #faf9f5;
  --color-sand-light: #f0e9dc;
  --color-white: #ffffff;
  --color-ink: #1c2620;
  --color-forest: #22382c;

  /* Brass is 3.3:1 on paper: never for body text. It marks lines and accents. */
  --color-brass: #b0813c;

  /**
   * Brass light. Brass itself is 3.58:1 on forest, this is 5.37:1, which clears
   * AA for normal text. Reserved for text on forest; on paper it is far too
   * light.
   */
  --color-brass-light: #c9a467;

  --color-error: #a63d2f;

  /* Text on a forest background, at the three weights the design uses. */
  --color-on-forest: #faf9f5;
  --color-on-forest-muted: rgb(250 249 245 / 80%);
  --color-on-forest-faint: rgb(250 249 245 / 70%);

  --font-heading--family: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body--family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-wordmark--family: 'Archivo', 'Arial Narrow', Impact, sans-serif;

  /**
   * SOFT 0 keeps the terminals sharp, WONK 0 switches off the playful
   * alternates. opsz is deliberately absent so `font-optical-sizing: auto` can
   * track the rendered size. Naming opsz here would freeze it.
   */
  --font-heading--variations: 'SOFT' 0, 'WONK' 0;

  --font-size-h1: 30px;
  --font-size-body: 16px;
  --font-size-small: 14px;
  --font-size-lede: 15px;

  --line-height-h1: 1.15;
  --line-height-body: 1.6;
  --line-height-small: 1.5;

  --radius-control: 6px;

  /* Emphasis is a 2px brass line, never a frame. */
  --border-emphasis: 2px solid var(--color-brass);

  /* Space on an 8px base. */
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 40px;
  --space-6: 48px;

  --page-margin: 20px;
}

@media screen and (min-width: 750px) {
  :root {
    --font-size-h1: 44px;
    --font-size-lede: 17px;
    --line-height-h1: 1.12;
    --page-margin: 40px;
  }
}

/** Reset, after Josh Comeau's. */

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

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

input {
  font: inherit;
  border-radius: var(--radius-control);
}

p {
  text-wrap: pretty;
}

/** Base */

body {
  min-height: 100svh;
  font-family: var(--font-body--family);
  font-size: var(--font-size-body);
  line-height: var(--line-height-body);

  /* No monospace anywhere. Figures line up through tabular figures instead. */
  font-variant-numeric: tabular-nums;
  background-color: var(--color-forest);
  color: var(--color-on-forest);
  -webkit-font-smoothing: antialiased;
}

h1 {
  font-family: var(--font-heading--family);
  font-size: var(--font-size-h1);
  font-weight: 400;
  line-height: var(--line-height-h1);
  font-optical-sizing: auto;
  font-variation-settings: var(--font-heading--variations);
  text-wrap: balance;
  color: var(--color-on-forest);
}

a {
  color: var(--color-on-forest-faint);
  text-decoration: underline;

  /* Where brass appears the thing is clickable. It is never decorative. */
  text-decoration-color: var(--color-brass);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--color-on-forest);
  text-decoration-color: var(--color-on-forest);
}

/* Fields signal focus through their own border and fill, not through a ring. */
:focus-visible {
  outline: 2px solid var(--color-brass);
  outline-offset: 2px;
}

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

/* A 48px brass rule to open a block. Brass as a line beside a block, never a frame. */
.brass-rule {
  width: 48px;
  border-top: var(--border-emphasis);
}

/** The button. 16px/1 at weight 500, 6px radius, no shadow and no gradient. */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 15px var(--space-3);
  border: none;
  border-radius: var(--radius-control);
  font-family: var(--font-body--family);
  font-size: var(--font-size-body);
  font-weight: 500;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;

  /* Colour change only. */
  transition: background-color 120ms ease;

  /* On forest the forest-filled primary would disappear, so it inverts. */
  background-color: var(--color-white);
  color: var(--color-forest);
}

.button:hover {
  background-color: var(--color-sand-light);
}

/** The logo lockup: the badger above the wordmark, centred. */

.logo {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  color: var(--color-on-forest);
  text-align: center;
}

.logo__mark {
  display: block;
  flex: none;
  height: 76px;
}

.logo__mark svg {
  display: block;
  width: auto;
  height: 100%;
}

.logo__text {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

/* Archivo 900. The only place this family is used. */
.logo__wordmark {
  font-family: var(--font-wordmark--family);
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

/* The second word drops to 500, which is what separates the two words. */
.logo__wordmark-secondary {
  font-weight: 500;
  color: var(--color-brass-light);
}

.logo__established {
  font-family: var(--font-wordmark--family);
  font-size: 9px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.3em;
  color: var(--color-brass);
}

/** The page itself. */

.landing {
  display: flex;
  flex-direction: column;
  min-height: 100svh;

  /**
   * Brass at 16%, rising from below the bottom edge.
   *
   * The design brief rules out gradients and the theme ships no gradient
   * utility. This is the one exception, and it earns it: it is what keeps a
   * screen with this little on it from reading as an error page.
   */
  background-image: radial-gradient(
    ellipse 500px 400px at 50% 115%,
    rgb(176 129 60 / 16%),
    transparent 70%
  );
}

.landing__stage {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-6) var(--page-margin);
  text-align: center;
}

.landing__rule {
  margin-block: var(--space-3);
}

.landing__heading {
  max-width: 640px;
}

.landing__text {
  max-width: 520px;
  margin-block-start: var(--space-2);
  font-size: var(--font-size-lede);
  color: var(--color-on-forest-muted);
}

.landing__form {
  width: 100%;
  margin-block-start: var(--space-4);
}

/* Field and button stack on mobile and sit side by side from 750px. */
.landing__field-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/**
 * The field sits on forest, where the theme's sand light is too close in value
 * to read as an input, so it lifts to paper.
 */
.landing__field {
  flex: 1;
  min-width: 0;
  padding: 15px var(--space-2);
  background-color: var(--color-paper);
  border: 1px solid rgb(250 249 245 / 30%);
  color: var(--color-ink);
}

.landing__field::placeholder {
  color: #5a5f55;
}

/* Focus is a brass border plus a lift to white, not an outline ring. */
.landing__field:focus {
  outline: none;
  border-color: var(--color-brass);
  background-color: var(--color-white);
}

.landing__field[aria-invalid='true'] {
  border-color: var(--color-error);
  background-color: var(--color-white);
}

/**
 * The design sets this line at 13px in cream at 55%. The brief puts the floor at
 * 14px and never lifts it, so it moves up one step to the small size and to the
 * existing faint token.
 */
.landing__note {
  margin-block-start: 12px;
  font-size: var(--font-size-small);
  line-height: var(--line-height-small);
  color: var(--color-on-forest-faint);
}

/**
 * --color-error is #a63d2f, which is 2.0:1 on forest and unreadable there. This
 * light amber is 5.8:1. It exists for this one message.
 */
.landing__error {
  margin-block-start: var(--space-2);
  font-size: var(--font-size-small);
  line-height: var(--line-height-small);
  color: #d9a05b;
}

.landing__success {
  max-width: 420px;
  margin-block-start: var(--space-4);
  color: var(--color-on-forest);
}

/**
 * The decoy field. A bot that fills in every input it finds trips over this one.
 * Kept out of the tab order and out of the accessibility tree, so no visitor
 * ever meets it. Not display:none, because some bots skip those.
 */
.landing__decoy {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.landing__footer {
  padding: 0 var(--page-margin) var(--space-3);
  font-size: var(--font-size-small);
  line-height: var(--line-height-small);
  color: var(--color-on-forest-faint);
  text-align: center;
}

@media screen and (min-width: 750px) {
  .landing {
    background-image: radial-gradient(
      ellipse 1000px 640px at 50% 120%,
      rgb(176 129 60 / 16%),
      transparent 70%
    );
  }

  .landing__stage {
    padding-block: var(--space-6);
  }

  .landing__rule {
    margin-block: var(--space-4);
  }

  .logo {
    gap: 20px;
  }

  .logo__mark {
    height: 96px;
  }

  .logo__text {
    gap: 6px;
  }

  .logo__wordmark {
    font-size: 26px;
  }

  .logo__established {
    font-size: 10px;
  }

  .landing__form {
    max-width: 460px;
  }

  .landing__field-row {
    flex-direction: row;
  }
}
