/* Header */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 6px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  flex: none;
  background: var(--accent);
  color: var(--on-accent);
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.brand-name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.035em;
}

.brand-eyebrow {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.lang-switch button {
  padding: 7px 13px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--on-surf-muted);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  cursor: pointer;
}

.lang-switch button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--on-accent);
}

/* Hero */

.hero {
  display: flex;
  flex-wrap: wrap;
  gap: 56px;
  align-items: center;
  justify-content: space-between;
  /*
   * A floor, not a fixed height. `min()` stops the hero stretching on tall
   * viewports; `calc` reserves the header, the section gap and a deliberate
   * ~85px peek of "How it works" below the fold.
   */
  min-height: min(calc(100dvh - 210px), 660px);
}

.hero-copy {
  flex: 1 1 420px;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  /*
   * The hero runs one step wider than the rest of the page: `--gap-block` here
   * and `--gap-group` inside `.hero-intro`, where body sections take
   * `--gap-group` / `--gap-tight`. It is the only section read before anything
   * is scrolled, so it gets the air; the scale itself is unchanged.
   */
  gap: var(--gap-block);
}

.hero-intro {
  display: flex;
  flex-direction: column;
  gap: var(--gap-group);
}

.chip {
  align-self: flex-start;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--chip-text);
  background: var(--chip-bg);
  padding: 6px 11px;
  border-radius: 999px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(34px, 6vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.035em;
  font-weight: 700;
  text-wrap: pretty;
}

.lede {
  margin: 0;
  font-size: 17px;
  line-height: 1.65;
  color: var(--muted);
  max-width: 430px;
  text-wrap: pretty;
}

/* No auto margin here: it absorbs the free space and defeats the hero's
   `space-between`, centring the phone instead of anchoring it right. */
.hero-mockup {
  flex: 0 0 auto;
}

.phone {
  width: min(300px, 78vw);
  height: auto;
  display: block;
}

/* Wraps below 840px: copy basis 420 + gap 56 + phone 300 + 64px shell padding.
   Once wrapped each column is alone on its line, so `space-between` degrades to
   `flex-start` and both need centring back. */
@media (max-width: 839px) {
  .hero-copy {
    flex-basis: 100%;
    margin-inline: auto;
  }

  /*
   * Wrapped, this gap is vertical and separates the two halves of one section, so
   * it has to stay above `.hero-copy`'s own `--gap-block` -- otherwise the CTA
   * sits as far from the copy above it as the mockup does, and the two halves
   * stop reading as two halves. That leaves `--gap-section` as the only step up.
   */
  .hero {
    gap: var(--gap-section);
  }

  .hero-mockup {
    margin-inline: auto;
  }
}

@media (max-width: 640px) {
  .hero {
    min-height: 62dvh;
  }
}
