/* ---------------------------------------------------------------------------
 * base.css — reset, base typography, layout primitives.
 *
 * The :root below holds LAYOUT AND MOTION MEASURES ONLY. Every colour and
 * every family lives in variables.css, which is the runtime authority and
 * loads first — a brand value declared here would shadow it and a rebrand
 * would have nothing to edit (scripts/check-tokens.js fails on it).
 * ------------------------------------------------------------------------- */
:root {
  --base-size: 1rem;
  --line-height: 1.6;
  --section-pad: clamp(3.5rem, 6vw, 5rem);
  --section-pad-mobile: 2.5rem;
  --gap: clamp(1.25rem, 3vw, 2rem);
  --gap-sm: 1rem;
  --gutter: clamp(20px, 3vw, 50px);
  --gutter-mobile: 1.5rem;
  /* The content measure is owned by variables.css (--container-content); this
     file loads after it, so a literal here would shadow the authority. These
     two delegate; the intermediate measures below are layout-only and have no
     theme.json counterpart. */
  --container: var(--container-content);
  --container-md: 100rem;
  --container-sm: 75rem;
  --container-xs: 48rem;
  --container-lg: var(--container-wide);
  --radius: 0;
  --radius-lg: 0;
  /* 50px tall buttons: 12px + 12px around a 20px/1.2 label plus the 1px
     transparent border .btn-layout declares on each side. */
  --button-padding-y: 0.75rem;
  --button-padding-x: 1.875rem;

  /* Scroll-reveal measures, consumed by the .reveal-* rules and the @keyframes
     further down. They belong in a :root because a @keyframes resolves a
     custom property against the ANIMATING element, not against the rule that
     started the animation — a component-level declaration could not reach
     them. */
  --reveal-distance: 48px;
  --reveal-duration: 1.2s;
  --reveal-delay: 0ms;
  --reveal-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  /* --sans, not --serif: the body family is the project's text face, and the
     starter's placeholder stacks both resolve to the same neutral sans until
     Pass 2 replaces them. --serif stays declared for the long-form/quote face. */
  font-family: var(--sans);
  font-size: var(--base-size);
  line-height: var(--line-height);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

main {
  display: block;
}

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

a {
  color: var(--brand);
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover,
a:focus-visible {
  color: var(--brand-dark);
}

button,
input,
textarea,
select {
  font: inherit;
}

/* Typography scale — themes calibrate the clamp() max values to the design's intended viewport.
   These are starter defaults; override in theme's variables.css or here as needed. */
h1, h2, h3, h4, h5, h6 {
  margin: 0 0 0.5em;
  font-family: var(--heading);
  font-weight: 400;
  color: var(--neutral-dark);
}

/* Calibrated to the design: section titles are Black Ops One, fluid from 26px
   at the 769px breakpoint to 36px at the 1440px design width. */
h1,
h2 {
  font-size: clamp(1.625rem, 2.5vw, 2.25rem); /* 26px → 36px */
  line-height: 1.25;
}

h2.is-large {
  font-size: clamp(1.75rem, 2.92vw, 2.625rem); /* 28px → 42px — the overlay band title */
}

h3 {
  font-size: clamp(1.5rem, 2.5vw, 2.25rem); /* 24px → 36px — the container card titles */
  line-height: 1.5;
}

h4 {
  font-size: clamp(1.125rem, 1.4vw, 1.25rem);
  line-height: 1.3;
}

/* Body utilities — reusable non-heading text. Add more only if a pattern recurs across pages. */
.t-body {
  font-family: var(--sans);
  font-size: clamp(1rem, 1.15vw, 1.25rem); /* ~20px */
  font-weight: 300;
  line-height: 1.5;
}

.t-lead {
  font-family: var(--sans);
  font-size: clamp(1.125rem, 1.5vw, 1.625rem); /* ~26px — about/lead body paragraphs */
  font-weight: 400;
  line-height: 1.54;
}

.t-quote {
  font-family: var(--serif);
  font-size: clamp(1rem, 1.05vw, 1.125rem); /* ~18px — testimonial/quote body */
  font-weight: 300;
  line-height: 1.55;
}

p,
ul,
ol,
blockquote {
  margin: 0 0 1em;
}

.container {
  width: 100%;
  max-width: calc(var(--container) + (var(--gutter) * 2));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container-lg {
  width: 100%;
  max-width: var(--container-lg);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container-fluid,
.container-full {
  width: 100%;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section-pad {
  padding-block: var(--section-pad);
}

.btn-layout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  padding: var(--button-padding-y) var(--button-padding-x);
  border: 1px solid transparent;
  border-radius: 0;
  font-family: var(--sans);
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

/* NO LIFT ON HOVER.
 *
 * The base ships `.btn-layout:hover { transform: translateY(-1px) }`, and this
 * design does not have it: the source site's buttons stay put and answer the
 * pointer with colour alone. A button that rises is a house default, not
 * something the design asked for, so it is removed here rather than reproduced.
 * `transform` also comes out of the transition above — nothing left to animate.
 *
 * The hover itself is not gone: every variant still changes background and
 * border (see .btn-layout.default, .blue and .hollow), which is the whole of
 * the effect this design uses. */

.btn-layout.default {
  background: var(--button-bg);
  color: var(--button-text);
  border-color: var(--button-bg);
}

.btn-layout.default:hover,
.btn-layout.default:focus-visible {
  background: var(--button-bg-hover);
  border-color: var(--button-bg-hover);
  color: var(--button-text);
}

.btn-layout.hollow {
  background: transparent;
  color: var(--button-outline-color);
  border-color: var(--button-outline-color);
}

.btn-layout.hollow:hover,
.btn-layout.hollow:focus-visible {
  background: var(--button-outline-hover-bg);
  color: var(--button-outline-hover-color);
  border-color: var(--button-outline-hover-bg);
}

.entry-content > * + * {
  margin-top: 1.25rem;
}

.entry-list {
  display: grid;
  gap: var(--gap);
}

.entry-card {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.entry-card__title {
  margin-bottom: 0.5rem;
}

.entry-card__excerpt > *:last-child {
  margin-bottom: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.reveal-pending {
  opacity: 0;
  will-change: opacity, transform;
}

.reveal-pending.scroll,
.reveal-pending.scroll-up,
.reveal-pending[data-reveal="up"] {
  transform: translate3d(0, var(--reveal-distance), 0);
}

.reveal-pending.scroll-down,
.reveal-pending[data-reveal="down"] {
  transform: translate3d(0, calc(var(--reveal-distance) * -1), 0);
}

.reveal-pending.scroll-left,
.reveal-pending[data-reveal="left"] {
  transform: translate3d(calc(var(--reveal-distance) * -1), 0, 0);
}

.reveal-pending.scroll-right,
.reveal-pending[data-reveal="right"] {
  transform: translate3d(var(--reveal-distance), 0, 0);
}

.ready,
.ready-up,
.ready-down,
.ready-left,
.ready-right {
  opacity: 1;
  animation-duration: var(--reveal-duration);
  animation-delay: var(--reveal-delay);
  animation-fill-mode: both;
  animation-timing-function: var(--reveal-ease);
  will-change: opacity, transform;
}

.ready,
.ready-up {
  animation-name: fadeInUp;
}

.ready-down {
  animation-name: fadeInDown;
}

.ready-left {
  animation-name: fadeInLeft;
}

.ready-right {
  animation-name: fadeInRight;
}

.reveal-visible {
  opacity: 1;
  transform: none;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translate3d(0, calc(var(--reveal-distance) * -1), 0);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translate3d(0, var(--reveal-distance), 0);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translate3d(calc(var(--reveal-distance) * -1), 0, 0);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translate3d(var(--reveal-distance), 0, 0);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal-pending,
  .ready,
  .ready-up,
  .ready-down,
  .ready-left,
  .ready-right,
  .reveal-visible {
    opacity: 1 !important;
    animation: none !important;
    transform: none !important;
    transition: none !important;
  }
}

/* ---------------------------------------------------------------------------
 * Cross-document view transitions.
 *
 * Same-origin navigations crossfade instead of blanking. Both documents have to
 * opt in, which every page of the theme does because the rule ships in the
 * global stylesheet. Browsers without the at-rule ignore it entirely and
 * navigate the way they always did — there is no JS and nothing to fall back to.
 *
 * The header opts out of the crossfade and into its own group (see
 * `view-transition-name: site-header` in header.css), so the fixed bar is
 * painted continuously while the page under it changes.
 * ------------------------------------------------------------------------ */
@view-transition {
  navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 220ms;
  animation-timing-function: ease;
}

/* Reduced motion kills the crossfade. The guards are written one transition
   NAME per selector list on purpose: a parser that does not recognise a given
   `::view-transition-*(name)` drops the whole list it appears in, so keeping
   the names apart means an unknown one cannot take the others down with it. */
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(root),
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none !important;
  }

  ::view-transition-group(site-header),
  ::view-transition-old(site-header),
  ::view-transition-new(site-header) {
    animation: none !important;
  }
}

@media (max-width: 575px) {
  .container,
  .container-fluid,
  .container-full,
  .container-lg {
    padding-inline: var(--gutter-mobile);
  }

  .section-pad {
    padding-block: var(--section-pad-mobile);
  }
}