/* =============================================================================
   layout.css — reset, grid and the handful of utilities this site actually uses.

   This replaces Bootstrap 5.3.2 (~230KB of CSS from a CDN, of which the site
   used the reboot, the grid, and about twenty utility classes — every visual
   decision was already being overridden in custom.css).

   Loaded BEFORE custom.css so the cascade order Bootstrap occupied is
   preserved: mechanics here, design there.

   Class names are deliberately unchanged. They are the standard 12-column
   vocabulary, the templates already speak it, and renaming ~65 classes across
   every layout and page would have been a much larger diff for no gain.
   ============================================================================= */

/* -----------------------------------------------------------------------------
   1. Reset
   Mirrors the parts of Bootstrap's Reboot the design depends on. The margin
   values are Bootstrap's, not new choices — changing them here would shift
   spacing on every page.
   -------------------------------------------------------------------------- */

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

body {
  margin: 0;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

h1, h2, h3, h4, h5, h6 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

/* Bootstrap's fluid heading scale. Most headings here carry a class that sets
   its own size, but bare ones (the 404, post markdown) inherited these — drop
   them and those silently fall back to the browser's smaller defaults. */
h1 { font-size: calc(1.375rem + 1.5vw); }
h2 { font-size: calc(1.325rem + 0.9vw); }
h3 { font-size: calc(1.3rem + 0.6vw); }
h4 { font-size: calc(1.275rem + 0.3vw); }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

@media (min-width: 1200px) {
  h1 { font-size: 2.5rem; }
  h2 { font-size: 2rem; }
  h3 { font-size: 1.75rem; }
  h4 { font-size: 1.5rem; }
}

p {
  margin-top: 0;
  margin-bottom: 1rem;
}

ul, ol {
  margin-top: 0;
  margin-bottom: 1rem;
  padding-left: 2rem;
}

ul ul, ol ol, ul ol, ol ul { margin-bottom: 0; }

dl { margin-top: 0; margin-bottom: 1rem; }
dt { font-weight: 700; }
dd { margin-bottom: 0.5rem; margin-left: 0; }

blockquote { margin: 0 0 1rem; }
figure { margin: 0 0 1rem; }

hr {
  margin: 1rem 0;
  color: inherit;
  border: 0;
  border-top: 1px solid;
  opacity: 0.25;
}

b, strong { font-weight: bolder; }

small { font-size: 0.875em; }

sub, sup {
  position: relative;
  font-size: 0.75em;
  line-height: 0;
  vertical-align: baseline;
}
sub { bottom: -0.25em; }
sup { top: -0.5em; }

/* Deliberately no `img { max-width: 100%; height: auto }` here. That is not
   part of Bootstrap's reboot, and `height: auto` overrides an HTML height
   attribute — it silently blew the navbar logo up to its intrinsic size.
   Images that need to be fluid say so in custom.css. */
img, svg { vertical-align: middle; }

table {
  caption-side: bottom;
  border-collapse: collapse;
}
th { text-align: inherit; }

/* Form controls don't inherit type on their own. */
button, input, optgroup, select, textarea {
  margin: 0;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

button {
  border-radius: 0;
  text-transform: none;
  background-color: transparent;
  background-image: none;
  border: 0;
}

button, [type="button"], [type="submit"] {
  -webkit-appearance: button;
  appearance: button;
}

button:not(:disabled), [type="button"]:not(:disabled), [type="submit"]:not(:disabled) {
  cursor: pointer;
}

code, kbd, samp, pre {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 1em;
}

pre { margin-top: 0; margin-bottom: 1rem; overflow: auto; }

[hidden] { display: none !important; }

/* -----------------------------------------------------------------------------
   2. Grid
   Twelve columns on a flex row, gutters carried as custom properties so the
   `g-*` classes can change both axes at once — the same mechanism Bootstrap
   used, so the arithmetic comes out identical.

   Breakpoints: sm 576 · md 768 · lg 992 · xl 1200 · xxl 1400
   -------------------------------------------------------------------------- */

.container {
  --gutter-x: 1.5rem;
  width: 100%;
  margin-inline: auto;
  padding-inline: calc(var(--gutter-x) * 0.5);
}

@media (min-width: 576px)  { .container { max-width: 540px; } }
@media (min-width: 768px)  { .container { max-width: 720px; } }
@media (min-width: 992px)  { .container { max-width: 960px; } }
@media (min-width: 1200px) { .container { max-width: 1140px; } }
@media (min-width: 1400px) { .container { max-width: 1320px; } }

.row {
  --gutter-x: 1.5rem;
  --gutter-y: 0;
  display: flex;
  flex-wrap: wrap;
  margin-top: calc(var(--gutter-y) * -1);
  margin-inline: calc(var(--gutter-x) * -0.5);
}

.row > * {
  flex-shrink: 0;
  width: 100%;
  max-width: 100%;
  padding-inline: calc(var(--gutter-x) * 0.5);
  margin-top: var(--gutter-y);
}

/* Gutter scale — matches Bootstrap's spacers. */
.g-0 { --gutter-x: 0;      --gutter-y: 0; }
.g-1 { --gutter-x: 0.25rem; --gutter-y: 0.25rem; }
.g-2 { --gutter-x: 0.5rem;  --gutter-y: 0.5rem; }
.g-3 { --gutter-x: 1rem;    --gutter-y: 1rem; }
.g-4 { --gutter-x: 1.5rem;  --gutter-y: 1.5rem; }
.g-5 { --gutter-x: 3rem;    --gutter-y: 3rem; }

.col { flex: 1 0 0%; }
.col-auto { flex: 0 0 auto; width: auto; }

.col-1  { flex: 0 0 auto; width: 8.33333333%; }
.col-2  { flex: 0 0 auto; width: 16.66666667%; }
.col-3  { flex: 0 0 auto; width: 25%; }
.col-4  { flex: 0 0 auto; width: 33.33333333%; }
.col-5  { flex: 0 0 auto; width: 41.66666667%; }
.col-6  { flex: 0 0 auto; width: 50%; }
.col-7  { flex: 0 0 auto; width: 58.33333333%; }
.col-8  { flex: 0 0 auto; width: 66.66666667%; }
.col-9  { flex: 0 0 auto; width: 75%; }
.col-10 { flex: 0 0 auto; width: 83.33333333%; }
.col-11 { flex: 0 0 auto; width: 91.66666667%; }
.col-12 { flex: 0 0 auto; width: 100%; }

@media (min-width: 576px) {
  .col-sm-1  { flex: 0 0 auto; width: 8.33333333%; }
  .col-sm-2  { flex: 0 0 auto; width: 16.66666667%; }
  .col-sm-3  { flex: 0 0 auto; width: 25%; }
  .col-sm-4  { flex: 0 0 auto; width: 33.33333333%; }
  .col-sm-5  { flex: 0 0 auto; width: 41.66666667%; }
  .col-sm-6  { flex: 0 0 auto; width: 50%; }
  .col-sm-7  { flex: 0 0 auto; width: 58.33333333%; }
  .col-sm-8  { flex: 0 0 auto; width: 66.66666667%; }
  .col-sm-9  { flex: 0 0 auto; width: 75%; }
  .col-sm-10 { flex: 0 0 auto; width: 83.33333333%; }
  .col-sm-11 { flex: 0 0 auto; width: 91.66666667%; }
  .col-sm-12 { flex: 0 0 auto; width: 100%; }
}

@media (min-width: 768px) {
  .col-md-1  { flex: 0 0 auto; width: 8.33333333%; }
  .col-md-2  { flex: 0 0 auto; width: 16.66666667%; }
  .col-md-3  { flex: 0 0 auto; width: 25%; }
  .col-md-4  { flex: 0 0 auto; width: 33.33333333%; }
  .col-md-5  { flex: 0 0 auto; width: 41.66666667%; }
  .col-md-6  { flex: 0 0 auto; width: 50%; }
  .col-md-7  { flex: 0 0 auto; width: 58.33333333%; }
  .col-md-8  { flex: 0 0 auto; width: 66.66666667%; }
  .col-md-9  { flex: 0 0 auto; width: 75%; }
  .col-md-10 { flex: 0 0 auto; width: 83.33333333%; }
  .col-md-11 { flex: 0 0 auto; width: 91.66666667%; }
  .col-md-12 { flex: 0 0 auto; width: 100%; }
}

@media (min-width: 992px) {
  .col-lg-1  { flex: 0 0 auto; width: 8.33333333%; }
  .col-lg-2  { flex: 0 0 auto; width: 16.66666667%; }
  .col-lg-3  { flex: 0 0 auto; width: 25%; }
  .col-lg-4  { flex: 0 0 auto; width: 33.33333333%; }
  .col-lg-5  { flex: 0 0 auto; width: 41.66666667%; }
  .col-lg-6  { flex: 0 0 auto; width: 50%; }
  .col-lg-7  { flex: 0 0 auto; width: 58.33333333%; }
  .col-lg-8  { flex: 0 0 auto; width: 66.66666667%; }
  .col-lg-9  { flex: 0 0 auto; width: 75%; }
  .col-lg-10 { flex: 0 0 auto; width: 83.33333333%; }
  .col-lg-11 { flex: 0 0 auto; width: 91.66666667%; }
  .col-lg-12 { flex: 0 0 auto; width: 100%; }
}

@media (min-width: 1200px) {
  .col-xl-1  { flex: 0 0 auto; width: 8.33333333%; }
  .col-xl-2  { flex: 0 0 auto; width: 16.66666667%; }
  .col-xl-3  { flex: 0 0 auto; width: 25%; }
  .col-xl-4  { flex: 0 0 auto; width: 33.33333333%; }
  .col-xl-5  { flex: 0 0 auto; width: 41.66666667%; }
  .col-xl-6  { flex: 0 0 auto; width: 50%; }
  .col-xl-7  { flex: 0 0 auto; width: 58.33333333%; }
  .col-xl-8  { flex: 0 0 auto; width: 66.66666667%; }
  .col-xl-9  { flex: 0 0 auto; width: 75%; }
  .col-xl-10 { flex: 0 0 auto; width: 83.33333333%; }
  .col-xl-11 { flex: 0 0 auto; width: 91.66666667%; }
  .col-xl-12 { flex: 0 0 auto; width: 100%; }
}

/* -----------------------------------------------------------------------------
   3. Utilities
   Only the ones the templates use. Spacing scale is Bootstrap's:
   1 = .25rem · 2 = .5rem · 3 = 1rem · 4 = 1.5rem · 5 = 3rem
   -------------------------------------------------------------------------- */

.d-none  { display: none !important; }
.d-block { display: block !important; }
.d-flex  { display: flex !important; }
.d-inline-flex { display: inline-flex !important; }

.flex-column { flex-direction: column !important; }
.flex-wrap { flex-wrap: wrap !important; }

.align-items-start   { align-items: flex-start !important; }
.align-items-center  { align-items: center !important; }
.align-items-stretch { align-items: stretch !important; }

.justify-content-start   { justify-content: flex-start !important; }
.justify-content-center  { justify-content: center !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-end     { justify-content: flex-end !important; }

.text-start  { text-align: left !important; }
.text-center { text-align: center !important; }
.text-end    { text-align: right !important; }

.mx-auto { margin-inline: auto !important; }
.ms-auto { margin-left: auto !important; }
.me-auto { margin-right: auto !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mt-5 { margin-top: 3rem !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-5 { margin-bottom: 3rem !important; }

.me-2 { margin-right: 0.5rem !important; }
.me-3 { margin-right: 1rem !important; }

.py-2 { padding-block: 0.5rem !important; }
.py-3 { padding-block: 1rem !important; }
.px-4 { padding-inline: 1.5rem !important; }

.w-100 { width: 100% !important; }
.h-100 { height: 100% !important; }

.order-1 { order: 1 !important; }
.order-2 { order: 2 !important; }

.d-grid { display: grid !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 1rem !important; }
.gap-4 { gap: 1.5rem !important; }

.py-5 { padding-block: 3rem !important; }

.fw-normal   { font-weight: 400 !important; }
.fw-semibold { font-weight: 600 !important; }
.fw-bold     { font-weight: 700 !important; }

.small { font-size: 0.875em; }
.lead  { font-size: 1.25rem; font-weight: 300; }

.display-1 { font-size: calc(1.625rem + 4.5vw); font-weight: 300; line-height: 1.2; }
@media (min-width: 1200px) { .display-1 { font-size: 5rem; } }

/* Was Bootstrap's #0d6efd — an off-brand blue that had quietly leaked onto
   the 404 numeral. Points at the site's own primary now. */
.text-primary { color: var(--primary) !important; }

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

@media (min-width: 576px) {
  .d-sm-flex  { display: flex !important; }
  .d-sm-block { display: block !important; }
  .justify-content-sm-center { justify-content: center !important; }
}

@media (min-width: 768px) {
  .d-md-flex  { display: flex !important; }
  .d-md-none  { display: none !important; }
  .text-md-end { text-align: right !important; }
  .justify-content-md-end { justify-content: flex-end !important; }
  .g-md-0 { --gutter-x: 0;       --gutter-y: 0; }
  .g-md-3 { --gutter-x: 1rem;    --gutter-y: 1rem; }
  .g-md-4 { --gutter-x: 1.5rem;  --gutter-y: 1.5rem; }
  .g-md-5 { --gutter-x: 3rem;    --gutter-y: 3rem; }
}

@media (min-width: 992px) {
  .d-lg-none  { display: none !important; }
  .d-lg-block { display: block !important; }
  .d-lg-flex  { display: flex !important; }
  .order-lg-1 { order: 1 !important; }
  .order-lg-2 { order: 2 !important; }
  .g-lg-0 { --gutter-x: 0;       --gutter-y: 0; }
  .g-lg-3 { --gutter-x: 1rem;    --gutter-y: 1rem; }
  .g-lg-4 { --gutter-x: 1.5rem;  --gutter-y: 1.5rem; }
  .g-lg-5 { --gutter-x: 3rem;    --gutter-y: 3rem; }
}

/* -----------------------------------------------------------------------------
   4. Button base
   Mechanics only — every colour, radius, size and transition is custom.css's.
   `line-height: 1.5` matters: without it buttons inherit the body's 1.65 and
   grow ~2px, which is enough to shift the vertically-centred hero.
   -------------------------------------------------------------------------- */

.btn {
  display: inline-block;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  vertical-align: middle;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  background-color: transparent;
  border: 1px solid transparent;
}

.btn:hover { text-decoration: none; }

/* -----------------------------------------------------------------------------
   5. Navbar mechanics
   Layout only — every colour, size and transition lives in custom.css under
   #mainNav. `.navbar-expand-lg` is the one breakpoint this site uses, so it's
   written out rather than generated for breakpoints nothing references.
   -------------------------------------------------------------------------- */

.navbar {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding-block: 0.5rem;
}

.navbar > .container {
  display: flex;
  flex-wrap: inherit;
  align-items: center;
  justify-content: space-between;
}

.fixed-top {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 1030;
}

.navbar-brand {
  padding-block: 0.3125rem;
  margin-right: 1rem;
  text-decoration: none;
  white-space: nowrap;
}

.navbar-nav {
  display: flex;
  flex-direction: column;
  padding-left: 0;
  margin-bottom: 0;
  list-style: none;
}

.navbar-nav .nav-link { display: block; text-decoration: none; }

.navbar-collapse {
  flex-basis: 100%;
  flex-grow: 1;
  align-items: center;
}

.navbar-toggler {
  padding: 0.25rem 0.75rem;
  line-height: 1;
  background-color: transparent;
  border: 1px solid transparent;
  border-radius: 0.375rem;
}

/* The disclosure itself. `.collapsing` animates height between the two states;
   parallax.js sets it, so a JS failure leaves the menu closed rather than
   stuck half-open. */
.collapse:not(.show) { display: none; }

.collapsing {
  height: 0;
  overflow: hidden;
  transition: height 0.35s ease;
}

@media (prefers-reduced-motion: reduce) {
  .collapsing { transition: none; }
}

@media (min-width: 992px) {
  .navbar-expand-lg { flex-wrap: nowrap; justify-content: flex-start; }
  .navbar-expand-lg .navbar-nav { flex-direction: row; }
  .navbar-expand-lg .navbar-collapse {
    display: flex !important;
    flex-basis: auto;
  }
  .navbar-expand-lg .navbar-toggler { display: none; }
  /* Above the breakpoint the panel is always open, so never leave it mid-animation. */
  .navbar-expand-lg .collapsing { height: auto !important; transition: none; }
}
