/* ==========================================================================
   313 Diamond Pivot Project — Base
   Fonts, reset, typography, layout primitives, surfaces, accessibility.
   ========================================================================== */

/* ---------- Fonts (self-hosted, latin subset, variable) ---------- */
@font-face {
  font-family: "League Gothic";
  src: url("../fonts/league-gothic-wdth.woff2") format("woff2-variations"),
       url("../fonts/league-gothic-wdth.woff2") format("woff2");
  font-weight: 400;
  font-stretch: 75% 100%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Public Sans";
  src: url("../fonts/public-sans-wght.woff2") format("woff2-variations"),
       url("../fonts/public-sans-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Bodoni Moda";
  src: url("../fonts/bodoni-moda-wght-italic.woff2") format("woff2-variations"),
       url("../fonts/bodoni-moda-wght-italic.woff2") format("woff2");
  font-weight: 400 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Public Sans";
  src: url("../fonts/public-sans-wght-italic.woff2") format("woff2-variations"),
       url("../fonts/public-sans-wght-italic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 6rem; }
body, h1, h2, h3, h4, p, figure, blockquote, dl, dd, ul, ol { margin: 0; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
img, picture, svg, video { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }

/* ---------- Document ---------- */
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: 400;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Type ---------- */
.display,
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.004em;
  line-height: var(--lh-heading);
  text-wrap: balance;
}
.display, h1 { font-size: var(--fs-display); line-height: var(--lh-display); }
.accent { font-family: var(--font-accent); font-style: italic; font-weight: 500; text-transform: none; letter-spacing: 0; }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-body); font-weight: 700; line-height: 1.3; }

.lead { font-size: var(--fs-lead); line-height: var(--lh-lead); max-width: 34em; }
p, li { max-width: var(--measure); text-wrap: pretty; }
small, .small { font-size: var(--fs-small); }
strong { font-weight: 700; }

a { color: var(--link); text-decoration-thickness: 0.08em; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 0.14em; }

.flow > * + * { margin-top: var(--flow-space, 1em); }

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter-page) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter-page);
}
.grid {
  display: grid;
  grid-template-columns: repeat(var(--columns), minmax(0, 1fr));
  gap: var(--gap);
}
@media (min-width: 48em) { :root { --columns: 8; } }
@media (min-width: 64em) { :root { --columns: 12; } }

.section { padding-block: var(--section-y); position: relative; isolation: isolate; }

/* ---------- Surfaces ---------- */
.surface-blush { background-color: var(--blush); color: var(--leading); }
.surface-deep  { background-color: var(--blush-deep); color: var(--leading); --link: var(--leading); }
.surface-rose  { background-color: var(--rose); color: var(--leading); --link: var(--leading); --focus: var(--leading); --text-muted: var(--leading); }
.surface-dark {
  background-color: var(--leading);
  color: var(--text-on-dark);
  --link: var(--link-on-dark);
  --focus: var(--focus-on-dark);
  --text-muted: var(--rose);
}
.surface-action { background-color: var(--pivot); color: var(--leading); --link: var(--leading); --focus: var(--leading); --text-muted: var(--leading); }

/* Concrete grain. Applied as a layer so content stays crisp. */
.textured { position: relative; isolation: isolate; }
.textured::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: var(--tex-grain), var(--tex-cloud);
  background-size: 220px 220px, 900px 900px;
  mix-blend-mode: multiply;
  opacity: 0.16;
}
.surface-dark.textured::before { mix-blend-mode: screen; opacity: 0.07; }
.surface-rose.textured::before { opacity: 0.12; }

/* ---------- Accessibility ---------- */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  z-index: 100;
  background: var(--blush);
  color: var(--leading);
  padding: var(--space-3) var(--space-4);
  font-weight: 700;
}
.skip-link:focus { top: var(--space-4); }
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
