/* Covelant: one stylesheet in four parts.
   1 Tokens · 2 Base · 3 Components · 4 Sections (+ entrance and reveals) */

/* =========================================================================
   1 · TOKENS
   ========================================================================= */
:root {
  --paper: #f3f2ef;       /* page */
  --paper-deep: #e9e8e4;  /* the supply band */
  --ink: #1b1c1e;         /* charcoal: headings, body */
  --grey: #5c5f63;        /* secondary text (AA on both papers) */
  --line: rgba(27, 28, 30, 0.14);
  --line-strong: rgba(27, 28, 30, 0.32);
  --accent: #8c4f2e;      /* muted copper: mark, numerals, the rule. Nothing else. */

  --mark-a: var(--ink);
  --mark-b: var(--accent);

  --font: 'Hanken Grotesk', 'Sans Fallback', 'Helvetica Neue', Arial, sans-serif;
  --fs-display: min(1rem + 13.5vw, 9rem);
  --fs-lead: clamp(1.125rem, 1rem + 0.55vw, 1.4375rem);
  --fs-title: clamp(1.375rem, 1.1rem + 0.9vw, 1.875rem);
  --fs-body: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  --fs-small: 0.8125rem;

  --wrap: 1360px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --section-y: clamp(5rem, 3rem + 7vw, 9rem);
  --header-h: clamp(4.5rem, 3.5rem + 3vw, 6.5rem);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

/* =========================================================================
   2 · BASE
   ========================================================================= */
@font-face { font-family: 'Hanken Grotesk'; src: url('/assets/fonts/hanken-grotesk-var.woff2') format('woff2'); font-weight: 400 600; font-style: normal; font-display: swap; }
/* Metric-matched local fallback (measured in Chrome against the web font) so the swap does not move the layout. */
@font-face { font-family: 'Sans Fallback'; src: local('Arial'); size-adjust: 101.7%; ascent-override: 98.3%; descent-override: 29.8%; line-gap-override: 0%; }

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--paper);
  color-scheme: light;
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.6;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
h1, h2, h3 { font-size: inherit; font-weight: 600; text-wrap: balance; }
p { text-wrap: pretty; }
ul { list-style: none; padding: 0; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--ink); color: var(--paper); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; border-radius: 2px; }

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

.skip-link {
  position: absolute; left: 1rem; top: 1rem; z-index: 10;
  padding: 0.6rem 1rem; background: var(--ink); color: var(--paper);
  font-size: var(--fs-small); font-weight: 600;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

/* =========================================================================
   3 · COMPONENTS
   ========================================================================= */
.brand { display: inline-flex; align-items: center; gap: 0.7rem; }
.mark { width: 30px; height: 30px; flex: none; }
.wordmark {
  font-size: 0.9375rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.18em; margin-right: -0.18em; line-height: 1;
}

.eyebrow {
  font-size: var(--fs-small); font-weight: 500; text-transform: uppercase;
  letter-spacing: 0.16em; color: var(--grey); line-height: 1.2;
}

/* =========================================================================
   4 · SECTIONS
   ========================================================================= */

/* Header: logo only */
.header { display: flex; align-items: center; height: var(--header-h); }

/* Hero: typographic, ends on a measured rule */
.hero {
  min-height: calc(70vh - var(--header-h));
  min-height: calc(70svh - var(--header-h));
  display: flex; flex-direction: column; justify-content: flex-end;
  padding-top: clamp(3rem, 8vh, 6rem);
}
.hero__title {
  font-size: var(--fs-display);
  line-height: 0.92;
  letter-spacing: -0.035em;
  margin-left: -0.05em; /* optical: the E's stem sits on the grid line */
}
.hero__line { display: block; overflow: hidden; padding-block: 0.04em 0.12em; margin-block: -0.04em -0.12em; }
.hero__line > span { display: block; }
.hero__lead {
  max-width: 34ch;
  margin-top: clamp(1.75rem, 3vw, 2.75rem);
  font-size: var(--fs-lead);
  line-height: 1.5;
  color: var(--grey);
}
@media (min-width: 1000px) {
  .hero { min-height: calc(80vh - var(--header-h)); min-height: calc(80svh - var(--header-h)); }
  .hero__body { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); align-items: end; }
  .hero__title { grid-column: 1 / span 8; font-size: min(1rem + 8.6vw, 9rem); }
  .hero__lead { grid-column: 9 / -1; margin-top: 0; padding-bottom: 0.35em; max-width: 30ch; }
}
/* A 12-division scale rule: hairline, tick marks, a short copper lead-in. */
.rule {
  position: relative;
  height: 10px;
  margin-top: clamp(3rem, 7vw, 5.5rem);
  border-bottom: 1px solid var(--line-strong);
  border-right: 1px solid var(--line-strong);
  background: linear-gradient(90deg, var(--line-strong) 1px, transparent 1px) 0 0 / calc(100% / 12) 100% repeat-x;
  transform-origin: left;
}
.rule::before {
  content: ''; position: absolute; left: 0; bottom: -1px;
  width: clamp(3rem, 8vw, 6rem); height: 2px; background: var(--accent);
}

/* What we supply */
.supply { background: var(--paper-deep); padding-block: var(--section-y); margin-top: clamp(3.5rem, 2rem + 5vw, 6rem); }
.supply__grid {
  display: grid; grid-template-columns: 1fr;
  gap: clamp(2.5rem, 5vw, 4rem) var(--gutter);
  margin-top: clamp(2.5rem, 5vw, 4rem);
}
.supply__item { border-top: 1px solid var(--line-strong); padding-top: 1.5rem; }
.supply__num {
  display: block; font-size: var(--fs-small); font-weight: 600;
  letter-spacing: 0.08em; color: var(--accent); font-variant-numeric: tabular-nums;
}
.supply__title {
  margin-top: clamp(1.5rem, 3vw, 2.75rem);
  font-size: var(--fs-title); line-height: 1.15; letter-spacing: -0.015em;
}
.supply__item p { margin-top: 0.75rem; max-width: 30ch; color: var(--grey); }
@media (min-width: 700px) { .supply__grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .supply__grid { grid-template-columns: repeat(4, 1fr); } }

/* Footer */
.footer__inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 1.25rem 2rem; padding-block: clamp(2.5rem, 5vw, 3.5rem);
}
.footer__legal { font-size: var(--fs-small); color: var(--grey); }

/* ---------- Entrance (from first paint) and scroll reveals ----------
   Hidden states live only under .motion-ok, which the <head> guard sets and removes again if main.js never runs.
   The headline starts part-way up its mask (not fully hidden) so the browser registers it as painted straight away. */
@keyframes line-up { from { transform: translateY(40%); } to { transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes draw { from { transform: scaleX(0); } to { transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.motion-ok .hero__line > span { animation: line-up 1.1s var(--ease-expo) both; }
.motion-ok .hero__line:nth-child(2) > span { animation-delay: 0.08s; }
.motion-ok .hero__line:nth-child(3) > span { animation-delay: 0.16s; }
.motion-ok .hero__lead { animation: rise 0.9s var(--ease) 0.45s both; }
.motion-ok .rule { animation: draw 1.4s var(--ease-expo) 0.7s both; }
.motion-ok .header .brand { animation: fade 0.8s var(--ease) both; }

.motion-ok [data-reveal] {
  opacity: 0; transform: translateY(18px);
  transition: opacity 0.9s var(--ease) var(--d, 0s), transform 0.9s var(--ease) var(--d, 0s);
}
.motion-ok [data-reveal].is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
