/* ==========================================================================
   UHBC — Base, typography & utilities
   ========================================================================== */

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

/* The scrollbar's space is always reserved, so pausing scroll (menu, image viewer) never shifts the page. */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-gutter: stable;
}

/* Only without JS: ScrollTrigger needs instant programmatic scrolling to measure positions. */
html:not(.js) {
  scroll-behavior: smooth;
}

html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--c-paper);
  color: var(--c-ink);
  font-family: var(--f-sans);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: var(--lh-body);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
dl,
dd,
figure,
blockquote {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}

address {
  font-style: normal;
}

em {
  font-family: var(--f-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
}

::selection {
  background: var(--c-accent);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 4px;
  border-radius: var(--radius);
}

main:focus,
[tabindex="-1"]:focus {
  outline: none;
}

[hidden] {
  display: none !important;
}

/* --- Layout ------------------------------------------------------------- */

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

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

.section-head {
  display: grid;
  gap: clamp(1.25rem, 2vw, 2rem);
  margin-bottom: clamp(3rem, 6vw, 6rem);
}

/* --- Typography --------------------------------------------------------- */

.label {
  font-family: var(--f-mono);
  font-size: var(--fs-label);
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--c-slate);
}

.label--ink {
  color: var(--c-ink);
}

.label--light {
  color: rgba(247, 247, 244, 0.68);
}

/* Section label, led in by a short accent line. */
.section-index {
  display: inline-flex;
  align-items: center;
  gap: 0.9em;
}

.section-index::before {
  content: "";
  width: 2.5rem;
  height: 1px;
  background: var(--c-accent-ink);
  opacity: 0.75;
}

.label--light.section-index::before {
  background: var(--c-accent-light);
}

/* Brand-red full stop, echoing the roof in the logo. */
.accent-dot {
  color: var(--c-accent);
}

.display-1,
.display-2,
.display-3 {
  font-family: var(--f-sans);
  font-weight: 400;
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-display);
  text-wrap: balance;
}

.display-1 { font-size: var(--fs-display-1); }
.display-2 { font-size: var(--fs-display-2); }
.display-3 { font-size: var(--fs-display-3); line-height: 1; }

.display-1 em,
.display-2 em,
.display-3 em {
  letter-spacing: -0.02em;
}

/* Masked line reveals */
.line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.08em;
  margin-bottom: -0.08em;
}

.line__inner {
  display: inline-block;
  will-change: transform;
}

.word {
  display: inline-block;
}

/* --- Accessibility utilities -------------------------------------------- */

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

.skip-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: calc(var(--z-curtain) + 1);
  padding: 0.8rem 1.2rem;
  background: var(--c-ink);
  color: var(--c-paper);
  font-size: var(--fs-small);
  transform: translateY(-200%);
  transition: transform var(--dur-fast) var(--ease-out);
}

.skip-link:focus {
  transform: none;
}

/* --- Reduced motion ----------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
