/* Shared layout primitives and small components used on every page:
   12-column grid, section backgrounds, labels, heading sizes, links,
   buttons and media frames. Page and part stylesheets build on these. */

/* Layout */

.grid {
  display: grid;
  grid-template-columns: repeat(var(--theme-columns), minmax(0, 1fr));
  column-gap: var(--theme-gutter);
  padding-inline: var(--theme-margin);
}

.wrap {
  padding-inline: var(--theme-margin);
}

.section {
  padding-block: var(--theme-space-xl);
}

.section--surface {
  background: var(--theme-color-surface);
}

.section--inverse {
  background: var(--theme-color-inverse);
  color: var(--theme-color-text-inverse);
}

.section--alt {
  background: var(--theme-color-surface-alt);
}

.section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--theme-space-sm);
  padding-inline: var(--theme-margin);
  margin-block-end: clamp(1.5rem, 2.55vw, 2.5rem);
}

.section__head .link-arrow {
  margin-block-end: 0.45em;
}

/* Section label, the small text in the left column */

.eyebrow {
  font-size: var(--theme-fs-sm);
  line-height: var(--theme-lh-snug);
}

.eyebrow--caps {
  font-size: var(--theme-fs-2xs);
  text-transform: uppercase;
  letter-spacing: var(--theme-tracking-caps);
}

/* Headings */

.heading-display {
  font-size: var(--theme-fs-7xl);
  line-height: var(--theme-lh-heading);
}

.heading-section {
  font-size: var(--theme-fs-8xl);
  line-height: 1.053;
}

.heading-large {
  font-size: var(--theme-fs-9xl);
  line-height: 1.083;
}

.heading-medium {
  font-size: var(--theme-fs-3xl);
  line-height: 1.3;
}

/* Links */

.link-underline {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3em;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  padding-block-end: 0.15em;
  font-size: clamp(1rem, 1.25vw, 1.125rem);
  line-height: 1.056;
  white-space: nowrap;
  border-block-end: 1px solid currentcolor;
}

.link-arrow svg {
  width: 0.8em;
  height: auto;
  transition: translate var(--theme-duration) var(--theme-ease-signature);
}

.link-arrow:hover svg {
  translate: 0.2em 0;
}

.link-arrow--back svg {
  rotate: 180deg;
}

.link-arrow--back:hover svg {
  translate: -0.2em 0;
}

/* Small uppercase text links, used in CTA blocks */

.link-caps {
  font-size: var(--theme-fs-2xs);
  text-transform: uppercase;
  letter-spacing: var(--theme-tracking-caps);
  line-height: 1;
  padding-block-end: 0.35em;
  border-block-end: 1px solid currentcolor;
  transition: opacity var(--theme-duration) var(--theme-ease-signature);
}

.link-caps:hover {
  opacity: 0.6;
}

.link-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem 1.2rem;
}

/* Buttons */

.button {
  display: inline-flex;
  align-items: center;
  gap: 1.1em;
  min-height: 2.375rem;
  padding: 0.55em 2em;
  font-size: clamp(0.625rem, 0.764vw, 0.6875rem);
  text-transform: uppercase;
  letter-spacing: var(--theme-tracking-caps);
  line-height: 1;
  border: 1px solid var(--theme-color-inverse);
  border-radius: var(--theme-radius-pill);
  transition:
    background-color var(--theme-duration) var(--theme-ease-signature),
    color var(--theme-duration) var(--theme-ease-signature);
}

.button svg {
  width: 0.9em;
}

.button:hover {
  background: var(--theme-color-inverse);
  color: var(--theme-color-text-inverse);
}

.button--primary {
  background: var(--theme-color-primary);
  border-color: var(--theme-color-primary);
  color: var(--theme-color-text-inverse);
}

.button--primary:hover {
  background: var(--theme-color-accent);
  border-color: var(--theme-color-accent);
}

.button--solid {
  border-radius: 0;
  background: var(--theme-color-contrast);
  border-color: var(--theme-color-contrast);
  color: var(--theme-color-text-inverse);
  font-size: var(--theme-fs-xs);
  padding: 0.6em 1.5em;
  min-height: 0;
}

.button--solid:hover {
  background: var(--theme-color-heading-alt);
  border-color: var(--theme-color-heading-alt);
}

.button-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

/* Media frames: fixed aspect, image covers */

.media {
  position: relative;
  overflow: hidden;
  background: var(--theme-color-surface);
}

.media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Background videos (breevast_video) fade in once their first frame is there, so they
   do not pop in; main.js adds is-ready. */

@media (prefers-reduced-motion: no-preference) {
  video[data-video],
  video[data-timeline-video] {
    transition: opacity 1.6s var(--theme-ease-signature);
  }

  .js-reveal video[data-video]:not(.is-ready),
  .js-reveal video[data-timeline-video]:not(.is-ready) {
    opacity: 0;
  }
}

/* Accessibility */

.screen-reader-text,
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  inset-block-start: 0.5rem;
  inset-inline-start: 0.5rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--theme-color-inverse);
  color: var(--theme-color-text-inverse);
  translate: 0 -200%;
}

.skip-link:focus {
  translate: 0 0;
}

/* Small screens: collapse the 12-column grid helpers */

@media (width <= 768px) {
  .section__head {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Page transitions: a quick, subtle crossfade between pages (cross-document
   view transitions). Browsers without support get a short fade-in of the
   content instead. Both are off for visitors who prefer reduced motion. */

@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }

  ::view-transition-group(root) {
    animation-duration: 0.25s;
    animation-timing-function: var(--theme-ease-signature);
  }

  @supports not (view-transition-name: none) {
    @keyframes page-enter {
      from {
        opacity: 0;
      }
    }

    main {
      animation: page-enter 0.3s var(--theme-ease-signature) backwards;
    }
  }
}
