@font-face {
  font-family: 'Norwester';
  src: url('/fonts/norwester.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@layer reset, base, layout, components;

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  * { margin: 0; }
  img, svg, video { display: block; max-width: 100%; height: auto; }
  input, button, textarea, select { font: inherit; }
  html { -webkit-text-size-adjust: 100%; }
}

@layer base {
  :root {
    color-scheme: dark light;
    --bg: #0b0b0b;
    --fg: #f2f2f2;
    --blend: #111;
    --red: #9a1a1d;

    /* Fluid type and spacing: no breakpoints needed */
    --step-0: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
    --step-1: clamp(1.25rem, 1.1rem  + 0.6vw,  1.5rem);    /* lead text / small heading */
    --step-2: clamp(1.5rem,  1.2rem  + 1.5vw,  2.5rem);    /* section heading */
    --step-3: clamp(2rem, 1.4rem + 3vw, 4.5rem);
    --space: clamp(1rem, 0.5rem + 2.5vw, 3rem);
    --gutter: max(var(--space), env(safe-area-inset-left));
  }
  body {
    background: var(--bg);
    color: var(--fg);
    font: var(--step-0) / 1.6 system-ui, sans-serif;
    min-block-size: 100dvh;
  }
  h1 { 
      color: var(--red);
      font-family: 'Norwester', Impact, 'Arial Narrow', sans-serif;
      font-size: var(--step-3);
      line-height: 1.05;
      text-wrap: balance;
  }
  h2 { 
      color: var(--red);
      font-family: 'Norwester', Impact, 'Arial Narrow', sans-serif;
      font-size: var(--step-2);
      line-height: 1.05;
      margin-block-end: 0.4em;
      text-wrap: balance;
  }
  p  { 
    text-wrap: pretty;
    margin-inline: auto;
    max-inline-size: 65ch;
    text-align: center;
    font-family: 'Norwester', Impact, 'Arial Narrow', sans-serif;
  }
}

@layer layout {
  .intro {
    min-block-size: 100svh;
    display: grid;
    place-content: center;
    padding: var(--gutter);
    background: url("/img/bg.webp") center / cover no-repeat;
  }
  .wrap {
     inline-size: min(100% - 2 * var(--gutter), 42rem);
     margin-inline: auto;
  }
  .wrap > p    { max-inline-size: 65ch; }
  .hero { min-block-size: 100svh; display: grid; place-content: center; }
  .video { padding-block: clamp(3rem, 8vw, 7rem); }
  .video-frame {
    aspect-ratio: 4 / 3;
    inline-size: min(100%, 50rem, calc(85svh * 4 / 3));
    margin-inline: auto;
    background: #000;
  }
  .video-frame video {
    inline-size: 100%;
    block-size: 100%;
    object-fit: contain;
  }

  .bio { padding-block: clamp(3rem, 8vw, 7rem); }
  .bio .wrap { max-inline-size: 42rem; text-align: center; }
  .bio p + p { margin-block-start: 1em; }

  .site-footer { padding-block: 2rem; text-align: center; }

  .site-footer .wrap {
    display: grid;
    justify-items: center;
    gap: 1rem;
  }

  .social-link {
    display: grid;
    place-items: center;
    inline-size: 2.75rem;        /* 44px tap target around a 28px icon */
    block-size: 2.75rem;
    color: var(--fg);
    transition: color 0.2s ease, transform 0.2s ease;
  }

  @media (hover: hover) {
    .social-link:hover { color: var(--red); transform: scale(1.1); }
  }

  .social-link:active { color: var(--red); }

  .social-link:focus-visible {
    color: var(--red);
    outline: 2px solid currentColor;
    outline-offset: 4px;
  }

  @media (prefers-reduced-motion: reduce) {
    .social-link { transition: none; }
    .social-link:hover { transform: none; }
  }

  .below {
    position: relative;
    isolation: isolate;          /* keeps the bg layer inside this block */
    overflow: clip;              /* trims the bg at the bottom of the footer */
    background-color: #111;
  }

  .below-bg {
    position: sticky;
    top: 0;
    z-index: -1;
    block-size: 100lvh;
    margin-block-end: -100lvh;   /* takes up no layout space */
    container-type: size;
    overflow: hidden;
  }

  .below-bg::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url("/img/blackbg.webp") center / cover no-repeat;
  }

  .below-bg::after {             /* readability scrim */
    content: "";
    position: absolute;
    inset: 0;
    background: rgb(0 0 0 / 0.45);
  }

  .intro::after {
    content: "";
    position: absolute;
    inset-inline: 0;
    inset-block-end: 0;
    block-size: clamp(6rem, 25svh, 16rem);
    background: linear-gradient(to bottom,
      transparent,
      color-mix(in srgb, var(--blend) 10%, transparent),
      color-mix(in srgb, var(--blend) 35%, transparent),
      color-mix(in srgb, var(--blend) 70%, transparent),
      var(--blend));
    pointer-events: none;
  }
  .scroll-cue { z-index: 1; }   /* keeps the arrow above the fade */

  /* top of the lower section fades IN from the colour */
  .below::after {
    content: "";
    position: absolute;
    inset-inline: 0;
    inset-block-start: 0;
    block-size: clamp(6rem, 25svh, 16rem);
    background: linear-gradient(to top,
      transparent,
      color-mix(in srgb, var(--blend) 10%, transparent),
      color-mix(in srgb, var(--blend) 35%, transparent),
      color-mix(in srgb, var(--blend) 70%, transparent),
      var(--blend));
    z-index: -1;                /* above the bg image, below the content */
    pointer-events: none;
  }

  @container (aspect-ratio > 1) {
    .below-bg::before {
      inset: auto;
      top: 50%;
      left: 50%;
      width: 100cqh;
      height: 100cqw;
      translate: -50% -50%;
      rotate: 90deg;             /* use -90deg if it turns the wrong way */
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}