/* ==========================================================================
   NAVBAR (The Floating Island) + HERO (Nature is the Algorithm)
   ========================================================================== */

/* --------------------------------------------------------------------------
   A. NAVBAR — fixed pill that morphs from transparent to glassmorphic
   -------------------------------------------------------------------------- */
/* Must outrank the drawer: the island owns the close control. */
.site-nav {
  position: fixed;
  top: var(--nav-top);
  left: 0;
  right: 0;
  z-index: calc(var(--z-nav) + 2);
  display: flex;
  justify-content: center;
  padding-inline: var(--gutter);
  pointer-events: none;
}

.site-nav__island {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: clamp(0.5rem, 2vw, 1.75rem);
  width: 100%;
  /* Wide enough for the longest locale (English) plus the language switcher.
     At 76rem the CTA overflowed the island's own inner edge. */
  max-width: 90rem;
  height: var(--nav-h);
  padding: 0.4rem 0.4rem 0.4rem 1.15rem;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  background: transparent;
  transition:
    background-color 0.55s var(--ease-out),
    border-color 0.55s var(--ease-out),
    box-shadow 0.55s var(--ease-out),
    max-width 0.6s var(--ease-out),
    backdrop-filter 0.55s var(--ease-out),
    padding 0.5s var(--ease-out);
}

/* Scrolled state — white/60 glassmorphic blur, ocean text, subtle border */
.site-nav.is-drawered .site-nav__island {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(242, 240, 233, 0.16);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
}

.site-nav.is-drawered .brand__mark {
  box-shadow: 0 0 0 1px rgba(242, 240, 233, 0.18);
}

.site-nav.is-drawered .nav-toggle {
  border-color: rgba(242, 240, 233, 0.4);
  color: var(--cream-50);
}

.site-nav.is-stuck .site-nav__island {
  /* Narrowed, but only as far as the content still fits — at 62rem the
     English labels plus the language switcher overflowed the pill. */
  max-width: 72rem;
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(20, 55, 94, 0.1);
  box-shadow: var(--sh-glass);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  padding-left: 0.75rem;
}

/* — Brand ---------------------------------------------------------------- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  /* Never yields a pixel on desktop: the island has room and a clipped name
     would be the wrong trade. Phones relax this below. */
  flex: none;
  min-width: 0;
  color: var(--cream-50);
  transition: color 0.5s var(--ease-out);
}

.site-nav.is-stuck .brand {
  color: var(--ocean);
}

.brand__mark {
  --mark-size: 2.5rem;
  transition: transform 0.6s var(--ease-spring);
}

.brand:hover .brand__mark {
  transform: rotate(-6deg) scale(1.06);
}

.brand__text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  line-height: 1;
}

.brand__name {
  font-family: var(--ff-display);
  font-size: 1.0625rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  /* Truncates rather than pushing the controls out of the island. */
  display: block;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  /* The island is transparent at the top of the page, so the wordmark sits on
     the hero photograph and reads in the brand gold. */
  color: var(--brand-gold);
}

/* Scrolled: the island turns into light glass, where gold measures 2.6:1. */
.site-nav.is-stuck .brand__name {
  color: var(--brand-navy);
}

.brand__sub {
  font-family: var(--ff-mono);
  font-size: 0.5rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.62;
}

/* — Primary links -------------------------------------------------------- */
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  margin-inline: auto;
  /* Shrinkable: on a narrow island the links give way before the brand or the
     call to action are pushed out of the pill. */
  min-width: 0;
  flex: 0 1 auto;
}

.nav-links a {
  position: relative;
  padding: 0.55rem 0.9rem;
  border-radius: var(--r-pill);
  font-family: var(--ff-display);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.82);
  transition: color 0.4s var(--ease-out), background-color 0.4s var(--ease-out);
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0.9rem;
  right: 0.9rem;
  bottom: 0.35rem;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s var(--ease-out);
}

.nav-links a:hover::after,
.nav-links a.is-active::after {
  transform: scaleX(1);
}

.nav-links a:hover {
  color: #fff;
}

.site-nav.is-stuck .nav-links a {
  color: rgba(20, 55, 94, 0.72);
}

.site-nav.is-stuck .nav-links a:hover,
.site-nav.is-stuck .nav-links a.is-active {
  color: var(--ocean);
}

.site-nav.is-stuck .nav-links a.is-active {
  background: rgba(20, 55, 94, 0.07);
}

/* — Right cluster -------------------------------------------------------- */
.site-nav__cta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: none;
  /* Keeps the switcher and CTA pinned to the pill's inner edge. */
  margin-left: auto;
}

.nav-meta {
  font-family: var(--ff-mono);
  font-size: var(--t-nano);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
  transition: color 0.5s var(--ease-out), opacity 0.35s var(--ease-out);
  /* Must be allowed to shrink: the island narrows on scroll and this label has
     no intrinsic flex basis, so it was the element that got clipped mid-token
     ("Est. 5 2021") instead of yielding. */
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/*
 * The build date is decorative. Once the island narrows it is the first thing
 * to go, rather than letting it collide with the links or the language switch.
 */
.site-nav.is-stuck .nav-meta {
  color: var(--ink-faint);
  opacity: 0;
  width: 0;
  margin: 0;
  padding: 0;
  pointer-events: none;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: var(--cream-50);
  transition:
    background-color 0.45s var(--ease-out),
    border-color 0.45s var(--ease-out),
    color 0.45s var(--ease-out);
}

.site-nav.is-stuck .nav-toggle {
  border-color: rgba(20, 55, 94, 0.2);
  color: var(--ocean);
}

.nav-toggle:hover {
  background: rgba(255, 255, 255, 0.14);
}

.nav-toggle__bars {
  position: relative;
  width: 1.1rem;
  height: 0.6rem;
}

.nav-toggle__bars span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 1.5px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.45s var(--ease-out), opacity 0.3s var(--ease-out), top 0.45s var(--ease-out);
}

.nav-toggle__bars span:nth-child(1) {
  top: 0;
}
.nav-toggle__bars span:nth-child(2) {
  top: 100%;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:nth-child(1) {
  top: 50%;
  transform: rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:nth-child(2) {
  top: 50%;
  transform: rotate(-45deg);
}

@media (max-width: 30rem) {
  .brand__sub {
    display: none;
  }
}

/*
 * Phones (320-544px). The island is one row with two zones: the identity on
 * the left and the controls on the right. Everything that carries function
 * keeps its size — the wordmark is what yields, with an ellipsis, and the
 * tagline is already gone — so nothing is pushed past the pill's edge.
 */
@media (max-width: 34rem) {
  /* Only here may the identity give way: on a phone the wordmark is the one
     thing that can shrink, so the switcher and the menu button stay on screen. */
  .brand {
    flex: 0 1 auto;
  }

  .site-nav__island {
    gap: 0.5rem;
    padding-left: 0.75rem;
    padding-right: 0.35rem;
  }

  .brand {
    gap: 0.55rem;
  }

  .brand__mark {
    --mark-size: 2.125rem;
  }

  /* The full name on two short lines reads better than a clipped one, and
     the pill's height (4.25rem) has room for it once the tagline is gone. */
  .brand__name {
    font-size: 0.8125rem;
    line-height: 1.14;
    letter-spacing: 0.01em;
    white-space: normal;
    max-height: 2.3em;
  }

  .site-nav__cta {
    gap: 0.4rem;
  }
}

/*
 * Very narrow phones (<=22rem). The language switcher lives in the drawer as
 * well, so on these widths it yields its place to the name instead of
 * squeezing every element on the row.
 */
@media (max-width: 22rem) {
  .site-nav__cta .lang-switch {
    display: none;
  }
}

@media (max-width: 68rem) {
  .nav-links,
  .nav-meta,
  .site-nav__cta .btn {
    display: none;
  }
  .nav-toggle {
    display: inline-flex;
  }
  .site-nav__island {
    justify-content: space-between;
  }
  .site-nav.is-stuck .site-nav__island,
  .site-nav.is-drawered .site-nav__island {
    max-width: 100%;
  }
}

/* — Mobile drawer -------------------------------------------------------- */
.nav-drawer {
  position: fixed;
  inset: 0;
  /* Below the island so the toggle remains clickable to close it. */
  z-index: calc(var(--z-nav) + 1);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.25rem;
  padding: calc(var(--nav-h) + var(--nav-top) * 2 + 1.5rem) var(--gutter) var(--gutter);
  background: var(--charcoal);
  color: var(--cream);
  /* Seven links, the switcher and the call to action do not fit a short phone
     (720px needs ~36px more): the drawer scrolls instead of cutting them off.
     The auto margins below keep the block centred whenever there is room, so
     centring and scrolling do not fight. */
  overflow-y: auto;
  overscroll-behavior: contain;
  clip-path: circle(0% at calc(100% - 3rem) 2.5rem);
  transition: clip-path 0.75s var(--ease-in-out);
  pointer-events: none;
}

/* Never squash the content to fit: the drawer scrolls. */
.nav-drawer > * {
  flex: none;
}

.nav-drawer > nav {
  margin-top: auto;
}

.nav-drawer > :last-child {
  margin-bottom: auto;
}

.nav-drawer.is-open {
  clip-path: circle(145% at calc(100% - 3rem) 2.5rem);
  pointer-events: auto;
}

.nav-drawer a {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--rule-dark);
  font-family: var(--ff-display);
  font-size: clamp(1.75rem, 8vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  opacity: 0;
  transform: translateY(1.25rem);
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out), color 0.3s var(--ease-out);
}

.nav-drawer.is-open a {
  opacity: 1;
  transform: translateY(0);
}

.nav-drawer a:hover {
  color: var(--clay-400);
}

.nav-drawer a i {
  font-family: var(--ff-mono);
  font-size: 0.625rem;
  font-style: normal;
  letter-spacing: 0.18em;
  color: var(--clay);
}

.nav-drawer__cta {
  align-self: flex-start;
  margin-top: 1.75rem;
  opacity: 0;
  transform: translateY(0.75rem);
  transition: opacity 0.5s var(--ease-out) 0.5s, transform 0.5s var(--ease-out) 0.5s;
}

.nav-drawer.is-open .nav-drawer__cta {
  opacity: 1;
  transform: translateY(0);
}

/*
 * Short screens. Seven entries at the roomy size need ~800px, which a720px
 * phone does not have; the menu tightens so the whole list, the switcher and
 * the call to action are visible at once. The drawer still scrolls if a
 * translated label ever needs the room.
 */
@media (max-height: 64rem) {
  .nav-drawer {
    padding-top: calc(var(--nav-h) + var(--nav-top) + 1rem);
    gap: 0;
  }

  .nav-drawer a {
    padding: 0.5rem 0;
    font-size: clamp(1.25rem, 5.5vw, 1.75rem);
  }

  .nav-drawer__cta {
    margin-top: 1rem;
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
  }
}

.nav-drawer__foot {
  margin-top: auto;
  padding-top: var(--s-6);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-4);
  align-items: center;
  justify-content: space-between;
  font-family: var(--ff-mono);
  font-size: var(--t-micro);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--on-dark-faint);
}

/* --------------------------------------------------------------------------
   B. HERO SECTION
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  isolation: isolate;
  overflow: hidden;
  background: var(--ocean-900);
}

.hero__media {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.hero__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
  will-change: transform;
  /* The photograph carries a strong olive-green cast (haul trucks, foliage)
     that fights the orange/blue palette. Strip most of the chroma here and let
     the .hero__tint multiply pass lay the ocean blue back in — cleaner than
     relying on blend modes alone. */
  filter: saturate(0.22) contrast(1.1) brightness(0.92);
}

/* Colour-correction veil. The supplied hero photography is dominated by an
   olive-green cast (haul trucks, foliage). A multiply pass pulls that cast
   toward the ocean blue and a soft-light pass restores the contrast that
   multiply flattens. Without it the imagery fights the palette. */
.hero__tint {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: #14375e;
  mix-blend-mode: multiply;
  opacity: 0.5;
}

.hero__tint::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #14375e;
  mix-blend-mode: soft-light;
  opacity: 0.45;
}

/* Heavy Ocean-to-Black gradient overlay */
.hero__scrim {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(8, 26, 48, 0.92) 0%, rgba(10, 28, 50, 0.4) 32%, rgba(8, 24, 44, 0.74) 68%, rgba(8, 26, 48, 0.98) 100%),
    radial-gradient(120% 90% at 12% 100%, rgba(20, 55, 94, 0.9) 0%, rgba(10, 28, 50, 0) 62%);
}

/* Fine industrial grid, faded at the edges */
.hero__grid {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.5;
  background-image:
    linear-gradient(rgba(242, 240, 233, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(242, 240, 233, 0.055) 1px, transparent 1px);
  background-size: 5.5rem 5.5rem;
  -webkit-mask-image: radial-gradient(115% 85% at 50% 40%, #000 12%, transparent 78%);
  mask-image: radial-gradient(115% 85% at 50% 40%, #000 12%, transparent 78%);
}

.hero__inner {
  position: relative;
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
  padding-bottom: clamp(3rem, 7vh, 6rem);
  padding-top: calc(var(--nav-h) + 4rem);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: end;
  color: var(--on-dark);
}

/* Content aligned to the bottom-left third */
.hero__lead {
  grid-column: 1;
  max-width: 34rem;
}

.hero__kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: clamp(1.25rem, 3vh, 2rem);
}

.hero__title {
  margin-bottom: clamp(1.5rem, 3vh, 2.25rem);
}

/* Large-scale contrast: Bold Sans vs Massive Serif Italic */
.hero__title .sans {
  display: block;
  font-family: var(--ff-display);
  font-size: clamp(2.25rem, 6.6vw, 5rem);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: -0.045em;
  color: var(--cream-50);
}

.hero__title .serif {
  display: block;
  font-family: var(--ff-drama);
  font-style: italic;
  font-weight: 300;
  /* Sized so "Algorithm." always fits inside its grid column — the gradient
     background-box would otherwise run out of width and eat the final glyph. */
  font-size: clamp(3.5rem, 12vw, 9rem);
  line-height: 0.82;
  letter-spacing: -0.04em;
  margin-left: -0.05em;
  margin-top: 0.02em;
  /* The gradient lives on the inner span so the mask keeps its own box. */
  color: var(--brand-gold);
}

/* The accent word is a solid brand colour. It used to be painted with a
   clipped gradient, which swallowed the text colour entirely (transparent
   fill) and leaned on background-clip support for the headline's legibility. */
.serif-ink {
  display: block;
  color: var(--brand-gold);
}

.hero__body {
  display: flex;
  align-items: flex-end;
  gap: clamp(1.5rem, 3vw, 2.5rem);
  flex-wrap: wrap;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(0.65rem, 1.4vw, 0.9rem);
}

.hero__note {
  flex: 1 1 22rem;
  max-width: 36ch;
  text-align: justify;
  font-size: var(--t-small);
  line-height: 1.55;
  color: rgba(242, 240, 233, 0.8);
}

/* — Telemetry rail (right column) ---------------------------------------- */
.hero__rail {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  padding: clamp(1.25rem, 2.5vw, 1.75rem);
  border-radius: var(--r-2xl);
  border: 1px solid rgba(242, 240, 233, 0.14);
  background: rgba(22, 33, 27, 0.42);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.rail__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--rule-dark);
}

.rail__title {
  font-family: var(--ff-mono);
  font-size: var(--t-nano);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--on-dark-muted);
}

.rail__list {
  display: flex;
  flex-direction: column;
}

.rail__row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: var(--s-3);
  padding: 0.7rem 0;
  border-bottom: 1px dashed rgba(242, 240, 233, 0.1);
}

.rail__row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.rail__label {
  font-size: 0.8125rem;
  color: var(--on-dark-muted);
  transition: color 0.35s var(--ease-out);
}

.rail__row.is-hot .rail__label {
  color: var(--cream-50);
}

.rail__val {
  font-family: var(--ff-mono);
  font-size: 1rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--cream-50);
  transition: color 0.35s var(--ease-out);
}

.rail__row.is-hot .rail__val {
  color: var(--clay-400);
}

.rail__val small {
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.6;
  margin-left: 0.25rem;
}

.rail__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding-top: var(--s-3);
  border-top: 1px solid var(--rule-dark);
}

/* — Scroll cue ----------------------------------------------------------- */
.hero__scroll {
  position: absolute;
  right: var(--gutter);
  bottom: clamp(3rem, 7vh, 6rem);
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-family: var(--ff-mono);
  font-size: var(--t-nano);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--on-dark-faint);
  writing-mode: vertical-rl;
  z-index: 1;
}

.hero__scroll-line {
  display: block;
  width: 1px;
  height: 4.5rem;
  background: linear-gradient(180deg, rgba(242, 240, 233, 0.5), transparent);
  position: relative;
  overflow: hidden;
}

.hero__scroll-line::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  height: 40%;
  background: var(--clay);
  animation: scroll-trace 2.6s var(--ease-in-out) infinite;
}

@keyframes scroll-trace {
  0% {
    top: -40%;
  }
  100% {
    top: 100%;
  }
}

/* — Marquee ticker under the hero ---------------------------------------- */
.ticker {
  position: relative;
  z-index: 2;
  border-block: 1px solid var(--rule);
  background: var(--cream-50);
  overflow: hidden;
  padding-block: 0.85rem;
  display: flex;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}

.ticker__track {
  display: flex;
  flex: none;
  align-items: center;
  gap: 2.5rem;
  padding-right: 2.5rem;
  animation: ticker-slide 42s linear infinite;
  will-change: transform;
}

.ticker:hover .ticker__track {
  animation-play-state: paused;
}

.ticker__item {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--ff-mono);
  font-size: var(--t-micro);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
  white-space: nowrap;
}

.ticker__item::after {
  content: "";
  width: 0.3rem;
  height: 0.3rem;
  background: var(--clay);
  transform: rotate(45deg);
  flex: none;
}

@keyframes ticker-slide {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(-50%, 0, 0);
  }
}

@media (max-width: 62rem) {
  .hero__inner {
    grid-template-columns: 1fr;
    align-items: end;
    gap: var(--s-6);
  }
  .hero__lead,
  .hero__rail {
    grid-column: 1;
  }
  .hero__rail {
    max-width: 32rem;
  }
  .hero__scroll {
    display: none;
  }
}

@media (max-width: 40rem) {
  .hero__body {
    align-items: flex-start;
  }
  .hero__actions {
    width: 100%;
  }
  .hero__actions .btn {
    flex: 1 1 100%;
  }
  .hero__title .serif {
    font-size: clamp(3rem, 16vw, 4.5rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ticker__track {
    animation: none;
  }
  .hero__scroll-line::after {
    animation: none;
  }
}

/* --------------------------------------------------------------------------
   LANGUAGE SWITCHER
   A compact segmented control. Sits in the nav cluster on desktop and in the
   drawer on small screens.
   -------------------------------------------------------------------------- */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.06);
  flex: none;
}

.lang-switch__opt {
  min-width: 2rem;
  padding: 0.28rem 0.5rem;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  font-family: var(--ff-mono);
  font-size: var(--t-nano);
  font-weight: 500;
  letter-spacing: 0.1em;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.35s var(--ease-out), color 0.35s var(--ease-out);
}

.lang-switch__opt:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.lang-switch__opt.is-active {
  background: var(--cream-50);
  color: var(--ocean);
}

/* Scrolled: the island turns light, so invert the control. */
.site-nav.is-stuck .lang-switch {
  border-color: rgba(20, 55, 94, 0.22);
  background: rgba(20, 55, 94, 0.05);
}

.site-nav.is-stuck .lang-switch__opt {
  color: rgba(20, 55, 94, 0.7);
}

.site-nav.is-stuck .lang-switch__opt:hover {
  color: var(--ocean);
  background: rgba(20, 55, 94, 0.1);
}

.site-nav.is-stuck .lang-switch__opt.is-active {
  background: var(--ocean);
  color: var(--cream-50);
}

/* Inside the dark mobile drawer. */
.nav-drawer .lang-switch {
  border-color: rgba(242, 240, 233, 0.28);
  margin-top: 1.25rem;
  align-self: flex-start;
  opacity: 0;
  transform: translateY(0.75rem);
  transition: opacity 0.5s var(--ease-out) 0.45s, transform 0.5s var(--ease-out) 0.45s;
}

.nav-drawer.is-open .lang-switch {
  opacity: 1;
  transform: translateY(0);
}

.nav-drawer .lang-switch__opt.is-active {
  background: var(--ocean);
  color: var(--cream-50);
}
