/* Home page. Loads with fonts.css, chrome.css and cookie.css: a single blue
   theme. Small text is cream on blue (AA); yellow is
   for shapes, pills, a rule, and the large quote highlight. */
html {
  -webkit-text-size-adjust: 100%;
}
body.home {
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  /* The cookie banner and footer control read these; on this page they use the palette. */
  --surface: var(--bh-cream);
  --ink: var(--bh-ink);
  --accent: var(--bh-blue);
  --line: rgba(23, 21, 15, 0.4);
  --muted: #3d3b33;
  display: flex;
  flex-direction: column;
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bh-blue);
  color: var(--bh-cream);
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  line-height: 1.4;
}
/* The body is a flex column, so the centred column needs an explicit width or it shrinks to its content. */
.home .wrap {
  width: 100%;
}
.home a {
  color: inherit;
  text-decoration: none;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}
.home .r {
  animation: rise 700ms var(--ease) both;
  animation-delay: calc(var(--i, 0) * 80ms);
}

/* Hero: the grid, eyebrow and .page-title come from chrome.css. */
.hero {
  padding-bottom: 1.5rem;
}
.page-title {
  margin-bottom: 0.875rem;
}
.geo {
  grid-column: 2;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  width: clamp(11.25rem, 17vw, 15rem);
  aspect-ratio: 1;
  margin-top: 0.375rem;
  overflow: hidden;
  border-radius: 0.625rem;
}
.geo span {
  display: block;
}
.g1 { background: var(--bh-yellow); border-radius: 0 0 100% 0; }
.g2 { background: var(--bh-red); border-radius: 50%; transform: scale(0.8); }
.g3 { background: var(--bh-cream); border-radius: 100% 0 0 0; }
.g4 { background: var(--bh-ink); }
.g5 { background: var(--bh-yellow); border-radius: 50%; transform: scale(0.55); }
.g6 { background: var(--bh-red); border-radius: 0 100% 0 0; }
.g7 { height: 50%; background: var(--bh-cream); border-radius: 0 0 999px 999px; }
.g8 { background: var(--bh-yellow); border-radius: 100% 0 0 0; }
.g9 { background: var(--bh-ink); border-radius: 50%; transform: scale(0.8); }
.quote {
  text-wrap: balance; /* no single word left alone on the last line */
  max-width: 21em;
  margin: 0 0 0.875rem;
  font-family: "Jost", system-ui, sans-serif;
  font-size: clamp(1.375rem, 2.3vw, 2rem);
  font-weight: 700;
  line-height: 1.12;
}
.quote em {
  display: block; /* white half on one line, yellow half on the next */
  font-style: normal;
  color: var(--bh-yellow);
}
.role {
  margin: 0;
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* Index rows */
.index {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 0.1875rem solid var(--bh-cream);
  border-image: linear-gradient(var(--bh-cream) 0 0) 1 0 0 0 / 0.1875rem 0 0 0 / 0 100vmax;
}
.row {
  position: relative;
  display: grid;
  grid-template-columns: 3.5rem 1fr auto 3.25rem;
  gap: 1.125rem;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1.5px solid rgba(243, 238, 227, 0.45);
  border-image: linear-gradient(rgba(243, 238, 227, 0.45) 0 0) 0 0 1 0 / 0 0 1.5px 0 / 0 100vmax;
  --shift: 1.125rem;
  /* The hover fill runs to both window edges: a spread shadow, clipped to the row's height
     (a shadow never adds horizontal scroll). The text stays in the column. */
  box-shadow: 0 0 0 100vmax transparent;
  clip-path: inset(0 -100vmax);
  transition:
    background-color 300ms ease,
    box-shadow 300ms ease,
    color 300ms ease;
}
.row:hover,
.row:focus-within {
  background: var(--bh-cream);
  box-shadow: 0 0 0 100vmax var(--bh-cream);
  color: var(--bh-ink);
}
/* On hover the text slides in from the left edge and the shape from the right. Moving
   them with transform keeps the row's layout still, so nothing reflows mid-animation. */
.num,
.mid {
  transition: transform 350ms var(--ease);
}
.row:hover .num,
.row:hover .mid,
.row:focus-within .num,
.row:focus-within .mid {
  transform: translateX(var(--shift));
}
.row:focus-within {
  outline: 3px solid currentColor;
  outline-offset: -3px;
}
.num {
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  opacity: 0.88;
}
.mid {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 1.375rem;
}
.row-link {
  font-family: "Jost", system-ui, sans-serif;
  font-size: clamp(1.875rem, 3.6vw, 3.125rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.015em;
  text-transform: uppercase;
}
.row-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1; /* above .num/.desc (their opacity paints them over an unstacked overlay) */
}
.row-link:focus-visible {
  outline: none;
}
.desc {
  font-size: 0.9375rem;
  opacity: 0.88;
}
.pills {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.pills a {
  display: inline-flex;
  align-items: center;
  min-height: 2.25rem;
  padding: 0 0.875rem;
  border: 1.5px solid var(--bh-yellow);
  border-radius: 999px;
  background: var(--bh-yellow);
  color: var(--bh-ink);
  font-size: 0.8125rem;
  font-weight: 700;
  transition:
    background-color 200ms ease,
    color 200ms ease,
    border-color 200ms ease;
}
.pills a:hover {
  border-color: var(--bh-ink);
  background: var(--bh-ink);
  color: var(--bh-cream);
}
.pills a:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 2px;
}
.glyph {
  position: relative;
  grid-column: 4;
  justify-self: end;
  width: 2.625rem;
  height: 2.625rem;
  transition: transform 500ms var(--ease);
}
.row:hover .glyph,
.row:focus-within .glyph {
  transform: translateX(calc(-1 * var(--shift))) rotate(90deg);
}
.glyph::before {
  content: "";
  position: absolute;
  inset: 0;
}
.glyph-1::before {
  border-radius: 50%;
  background: var(--bh-red);
}
.glyph-2::before {
  border-radius: 100% 0 0 0;
  background: var(--bh-yellow);
}
.glyph-3::before {
  height: 50%;
  border-radius: 0 0 999px 999px;
  background: var(--bh-cream);
  transition: background-color 300ms ease;
}
.glyph-4::before {
  background: var(--bh-ink);
}
.row:hover .glyph-3::before,
.row:focus-within .glyph-3::before {
  background: var(--bh-blue);
}

/* The page is blue, so the footer rule is cream. */
.home .site-footer {
  margin-top: 1.25rem;
  border-top-color: rgba(243, 238, 227, 0.25);
  border-image: linear-gradient(rgba(243, 238, 227, 0.25) 0 0) 1 0 0 0 / 1px 0 0 0 / 0 100vmax;
}

@media (max-width: 640px) {
  .hero {
    gap: 0 1rem;
    padding-bottom: 1rem;
    align-content: start;
    /* The shape spans both rows; let the flexible title row absorb its extra height
       so the eyebrow stays where it is on every page. */
    grid-template-rows: auto 1fr;
  }
  .intro {
    display: contents;
  }
  .geo {
    grid-column: 2;
    grid-row: 1 / span 2;
    width: 6rem;
    margin-top: 0;
  }
  .eyebrow {
    grid-column: 1;
    align-self: end;
    margin-bottom: 0.375rem;
  }
  .page-title {
    grid-column: 1;
    align-self: start;
    margin: 0;
  }
  .quote,
  .role {
    grid-column: 1 / -1;
  }
  .quote {
    margin: 1rem 0 0.625rem;
    font-size: 1.375rem;
  }
  .row {
    grid-template-columns: 1.875rem 1fr 2.375rem;
    gap: 0 0.75rem;
    padding: 0.625rem 0;
  }
  .row {
    --shift: 0.75rem;
  }
  .row:hover .pills,
  .row:focus-within .pills {
    transform: translateX(var(--shift));
  }
  .num {
    align-self: start;
    margin-top: 0.625rem;
  }
  .mid {
    display: block;
  }
  .row-link {
    display: block;
    font-size: min(2rem, 10vw);
  }
  .desc {
    display: block;
    margin-top: 0.25rem;
  }
  .pills {
    grid-column: 2;
    margin-top: 0.625rem;
  }
  .glyph {
    grid-column: 3;
    grid-row: 1 / span 2;
    width: 2.25rem;
    height: 2.25rem;
  }
  .pills {
    transition: transform 350ms var(--ease);
  }
}

@media (prefers-reduced-motion: reduce) {
  .home .r {
    animation: none;
  }
  .row,
  .num,
  .mid,
  .pills,
  .glyph,
  .pills a {
    transition: none;
  }
  .row:hover .glyph,
  .row:focus-within .glyph {
    transform: translateX(calc(-1 * var(--shift)));
  }
}

/* Desktop: the page fills the window. The rows share the spare height (capped), and
   the footer sits at the bottom. */
@media (min-width: 641px) {
  .home .wrap {
    display: flex;
    flex: 1;
    flex-direction: column;
  }
  .home main {
    display: flex;
    flex: 1;
    flex-direction: column;
  }
  .index {
    display: flex;
    flex: 1;
    flex-direction: column;
    max-height: 34rem;
  }
  .row {
    flex: 1;
  }
  .home .site-footer {
    margin-top: auto;
  }
}
/* Portrait tablets are tall: drop the cap so the rows share the whole height
   instead of leaving an empty band above the footer. */
@media (min-width: 641px) and (orientation: portrait) {
  .index {
    max-height: none;
  }
  .row-link {
    font-size: 6.5vw;
  }
  .geo {
    width: 26vw;
  }
}

/* Cookie banner in the home palette (inner pages keep the shared style). */
.home #cookie-banner {
  padding: 1.625rem;
  border: 0;
  border-radius: 0.625rem;
  background: var(--bh-cream);
  box-shadow: 0 14px 40px rgba(23, 21, 15, 0.35);
}
.home #cookie-title {
  font-family: "Jost", system-ui, sans-serif;
  font-size: 1.625rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}
.home #cookie-banner p {
  color: var(--bh-ink);
}
.home .cookie-policy {
  color: var(--bh-ink);
  font-weight: 600;
}
.home #cookie-banner button {
  border: 2px solid var(--bh-ink);
  border-radius: 999px;
  font-weight: 700;
}
.home #cookie-banner #cookie-close {
  border: 0;
}
.home #cookie-banner #cookie-accept {
  border-color: var(--bh-yellow);
  background: var(--bh-yellow);
  color: var(--bh-ink);
}
.home #cookie-banner #cookie-accept:hover {
  border-color: var(--bh-ink);
  background: var(--bh-ink);
  color: var(--bh-cream);
  box-shadow: none;
}

/* Print: the home page as a plain list. */
@media print {
  body.home {
    background: none;
    color: #000;
  }
  .geo,
  .glyph {
    display: none;
  }
  .quote em {
    color: #000;
  }
  .index,
  .row,
  .home .site-footer {
    border-image: none;
    border-color: #000;
  }
  .pills a {
    border-color: #000;
    background: none;
  }
}
