/* ==========================================================================
   naturfilms — reset, elements, layout primitives
   ========================================================================== */

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  min-height: 100svh;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background-color var(--t-slow) var(--ease-out),
              color var(--t-slow) var(--ease-out);
}

body.is-locked { overflow: hidden; }

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

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

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

a {
  color: inherit;
  text-decoration-color: color-mix(in oklab, var(--c-accent) 50%, transparent);
  text-underline-offset: 0.22em;
  text-decoration-thickness: 1px;
  transition: color var(--t-fast) var(--ease-out),
              text-decoration-color var(--t-fast) var(--ease-out);
}
a:hover { color: var(--c-accent); text-decoration-color: var(--c-accent); }

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: var(--lh-tight);
  letter-spacing: -0.015em;
  text-wrap: balance;
}

p { text-wrap: pretty; }

::selection {
  background: var(--c-accent);
  color: var(--c-bg-sink);
}

:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}
:focus:not(:focus-visible) { outline: none; }

/* Custom scrollbar — subtle, matches theme */
@supports selector(::-webkit-scrollbar) {
  ::-webkit-scrollbar { width: 11px; height: 11px; }
  ::-webkit-scrollbar-track { background: var(--c-bg-sink); }
  ::-webkit-scrollbar-thumb {
    background: var(--c-line-str);
    border-radius: var(--r-pill);
    border: 3px solid var(--c-bg-sink);
  }
  ::-webkit-scrollbar-thumb:hover { background: var(--c-accent-deep); }
}

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

.shell {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.shell--narrow { max-width: calc(var(--max-w-text) + var(--gutter) * 2); }
.shell--wide { max-width: 1860px; }

.section { padding-block: var(--sp-9); position: relative; }
.section--tight { padding-block: var(--sp-8); }
.section--flush-top { padding-top: 0; }

.stack > * + * { margin-top: var(--flow, var(--sp-4)); }
.stack--lg { --flow: var(--sp-6); }

.prose { max-width: var(--measure); color: var(--c-text-soft); }
.prose > * + * { margin-top: var(--sp-4); }
.prose strong { color: var(--c-text); font-weight: 600; }

/* ---- Typographic helpers ------------------------------------------------ */

.kicker {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--c-accent);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.kicker::before {
  content: "";
  width: clamp(18px, 4vw, 44px);
  height: 1px;
  background: currentColor;
  opacity: 0.6;
  flex: none;
}

.h-display { font-size: var(--fs-3xl); }
.h1 { font-size: var(--fs-2xl); }
.h2 { font-size: var(--fs-xl); }
.h3 { font-size: var(--fs-lg); line-height: var(--lh-snug); }
.h4 { font-size: var(--fs-md); line-height: var(--lh-snug); }

.lede {
  font-size: var(--fs-md);
  color: var(--c-text-soft);
  max-width: 54ch;
  line-height: 1.55;
}

.mono-label {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--c-text-mute);
}

.text-mute { color: var(--c-text-mute); }
.text-soft { color: var(--c-text-soft); }
.accent { color: var(--c-accent); }

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

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: var(--sp-3);
  left: var(--sp-3);
  z-index: 999;
  padding: var(--sp-3) var(--sp-5);
  background: var(--c-accent);
  color: var(--c-bg-sink);
  border-radius: var(--r-pill);
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform var(--t-mid) var(--ease-spring);
}
.skip-link:focus { transform: translateY(0); color: var(--c-bg-sink); }

[hidden] { display: none !important; }
