/* ============================================================
   HALE & CROW — BASE
   Reset, fonts, typography, layout primitives, utilities.
   Mobile-first: base styles target ~375px.
   ============================================================ */

/* ---- Fonts (only the weights the site loads — see README) ---- */
@font-face {
  font-family: 'Boska';
  src: url('../fonts/Boska-Light.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Boska';
  src: url('../fonts/Boska-LightItalic.woff2') format('woff2');
  font-weight: 300;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Boska';
  src: url('../fonts/Boska-MediumItalic.woff2') format('woff2');
  font-weight: 500;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Boska';
  src: url('../fonts/Boska-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'General Sans';
  src: url('../fonts/GeneralSans-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'General Sans';
  src: url('../fonts/GeneralSans-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'General Sans';
  src: url('../fonts/GeneralSans-Semibold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('../fonts/JetBrainsMono-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ---- Reset ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  /* clip (not hidden) so position: sticky keeps working down the tree */
  overflow-x: hidden;
  overflow-x: clip;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  overflow-x: hidden;
  overflow-x: clip;
  background: var(--clr-bg);
  color: var(--clr-text);
  font-family: var(--ff-text);
  font-weight: 400;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}

body.is-locked {
  overflow: hidden;
}

/* ---- Lenis smooth/inertia scroll (coordination CSS) ---- */
html.lenis,
html.lenis body {
  height: auto;
}
.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}
.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}
.lenis.lenis-stopped {
  overflow: clip;
}
.lenis.lenis-smooth iframe {
  pointer-events: none;
}

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

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

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

fieldset {
  border: 0;
  min-width: 0;
}

ul, ol {
  list-style: none;
}

::selection {
  background: var(--clr-brass);
  color: var(--clr-ink);
}

/* ---- Focus ---- */
:focus {
  outline: none;
}
:focus-visible {
  outline: var(--hairline) solid var(--clr-brass);
  outline-offset: 4px;
}

/* ---- Skip link ---- */
.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: calc(var(--z-preloader) + 1);
  padding: 0.75rem 1.25rem;
  background: var(--clr-ink);
  color: var(--clr-text);
  font-family: var(--ff-mono);
  font-size: var(--fs-mono);
  border: var(--hairline) solid var(--clr-brass);
  transform: translateY(-200%);
  transition: transform var(--dur-fast) var(--ease-out);
}
.skip-link:focus-visible {
  transform: translateY(0);
}

/* ---- Typography ---- */
h1, h2, h3 {
  font-family: var(--ff-display);
  font-weight: 300;
  line-height: var(--lh-display);
  letter-spacing: -0.01em;
}

.display-italic {
  font-family: var(--ff-display);
  font-style: italic;
  font-weight: 300;
}

.eyebrow {
  display: inline-block;
  font-family: var(--ff-text);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--clr-muted);
}

.mono {
  font-family: var(--ff-mono);
  font-size: var(--fs-mono);
  letter-spacing: 0.06em;
  color: var(--clr-muted);
}

.mono--brass {
  color: var(--clr-brass);
}

p {
  max-width: 62ch;
}

.text-muted {
  color: var(--clr-muted);
}

/* ---- Layout primitives ---- */
.wrap {
  width: 100%;
  padding-inline: var(--sp-gutter);
  margin-inline: auto;
  max-width: 100rem;
}

.section {
  padding-block: var(--sp-section);
  position: relative;
}

.grid-12 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-3);
}

@media (min-width: 1024px) {
  .grid-12 {
    grid-template-columns: repeat(12, 1fr);
    column-gap: var(--sp-3);
  }
}

/* ---- Hairline rules ---- */
.rule {
  border: 0;
  height: var(--hairline);
  background: var(--clr-brass-dim);
  opacity: 0.5;
}

/* ---- Image frames ---- */
.frame {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-frame);
  background: var(--clr-surface);
}
.frame > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---- Grain overlay (fixed — never on scrolling containers) ---- */
.grain {
  position: fixed;
  inset: 0;
  z-index: var(--z-grain);
  pointer-events: none;
  background-image: url('../img/ui/grain.svg');
  background-size: 180px 180px;
  opacity: 0.04;
}

/* ---- Screen-reader only ---- */
.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;
}

/* ---- Brass underline-draw link (shared pattern) ---- */
.link-draw {
  position: relative;
  display: inline-block;
  padding-bottom: 2px;
}
.link-draw::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: var(--hairline);
  background: var(--clr-brass);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--dur-fast) var(--ease-out);
}
.link-draw:hover::after,
.link-draw:focus-visible::after {
  transform: scaleX(1);
}
