/* ==========================================================================
   SAMMES — Base: fonts, reset, typography, accessibility
   ========================================================================== */

/* --- Self-hosted fonts (latin subset, variable) -------------------------- */
@font-face {
  font-family: "Inter Tight";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-tight-var.woff2") format("woff2");
}
@font-face {
  font-family: "Inter Tight";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-tight-italic-var.woff2") format("woff2");
}
@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("../fonts/newsreader-var.woff2") format("woff2");
}
@font-face {
  font-family: "Newsreader";
  font-style: italic;
  font-weight: 200 800;
  font-display: swap;
  src: url("../fonts/newsreader-italic-var.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("../fonts/jetbrains-mono-var.woff2") format("woff2");
}

/* --- Reset --------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
* {
  margin: 0;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
body {
  min-height: 100svh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-display);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
  height: auto;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  background: none;
  border: 0;
}
a {
  color: inherit;
  text-decoration: none;
}
ul,
ol {
  list-style: none;
  padding: 0;
}
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 800;
  line-height: var(--lh-snug);
  letter-spacing: var(--tracking-tight);
  text-wrap: balance;
}
p {
  text-wrap: pretty;
}
table {
  border-collapse: collapse;
  width: 100%;
}
hr {
  border: 0;
  border-top: var(--rule) solid var(--line);
}

/* --- Selection & focus --------------------------------------------------- */
::selection {
  background: var(--accent);
  color: var(--on-accent);
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 1px;
}

/* --- Accessibility helpers ---------------------------------------------- */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute;
  top: 0;
  left: 0;
  z-index: calc(var(--z-overlay) + 1);
  padding: var(--space-xs) var(--space-sm);
  background: var(--accent);
  color: var(--on-accent);
  font-size: var(--fs-label);
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
  transform: translateY(-120%);
  transition: transform var(--dur-fast) var(--ease-out);
}
.skip-link:focus {
  transform: translateY(0);
}

/* --- Typographic primitives --------------------------------------------- */
/* Micro label: the connective tissue of the whole brand. */
.micro {
  font-family: var(--font-display);
  font-size: var(--fs-micro);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--tracking-micro);
  line-height: 1.35;
}
.label {
  font-family: var(--font-display);
  font-size: var(--fs-label);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
  line-height: 1.3;
}
.mono {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.02em;
  font-weight: 400;
}
.serif {
  font-family: var(--font-serif);
  font-weight: 300;
  letter-spacing: -0.01em;
}
.muted {
  color: var(--muted);
}
.accent {
  color: var(--accent);
}
.italic {
  font-style: italic;
}

/* Editorial statement: the Born-style mixed-opacity paragraph. */
.statement {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: var(--fs-quote);
  line-height: 1.18;
  letter-spacing: -0.015em;
  max-width: 34ch;
  text-wrap: pretty;
}
.statement em {
  font-style: italic;
}
.statement .dim {
  color: var(--muted);
  opacity: 0.72;
}

/* --- Reveal on scroll ---------------------------------------------------- */
/* Only hide while JavaScript is available to reveal it again. Without JS the
   content simply renders — the site is fully readable with scripts off. */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(1.25rem);
  transition:
    opacity var(--dur-slow) var(--ease-out),
    transform var(--dur-slow) var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] {
    opacity: 1;
    transform: none;
  }
}

/* --- Grain overlay ------------------------------------------------------- */
.grain::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.5;
  mix-blend-mode: overlay;
  background-image: url("../img/grain.svg");
  background-size: 180px 180px;
}

@media print {
  .grain::after,
  .site-nav {
    display: none;
  }
  body {
    background: #fff;
    color: #000;
  }
}
