/* Copyright 2026 Nate DiNiro <unclenate@gmail.com>
   SPDX-License-Identifier: LicenseRef-Proprietary

   Missionary of Meat: implements docs/design/design-system.md (v0.1.1).
   Every color/size lives on :root; component rules reference tokens only.
   The only literal sizes outside :root are the @media breakpoints (design system §2). */

/* ── Tokens (design system §2) ─────────────────────────────────────────── */
:root {
  /* Color: brand */
  --ink:          #211A15;
  --paper:        #F5EFE4;
  --paper-raised: #FBF7EE;
  --oxblood:      #6E2230;
  --oxblood-deep: #4C1620;
  --brass:        #A8814B;
  --brass-deep:   #7E5F2F;
  --smoke:        #6F6155;
  --line:         #E0D5C1;

  /* Color: semantic */
  --status-active:    #3D5A3C;
  --status-exploring: var(--brass-deep);
  --status-shelved:   var(--smoke);
  --focus-ring:       var(--brass);

  /* Typography */
  --font-display: "Fraunces", Georgia, serif;
  --font-body:    "Inter", system-ui, sans-serif;
  --text-sm:   0.875rem;
  --text-base: 1.0625rem;
  --text-lg:   1.25rem;
  --text-xl:   1.625rem;
  --text-2xl:  2.125rem;
  --text-3xl:  clamp(2.5rem, 6vw, 3.5rem);

  /* Spacing: 4px base */
  --s-1: 0.25rem;  --s-2: 0.5rem;  --s-3: 0.75rem;  --s-4: 1rem;
  --s-6: 1.5rem;   --s-8: 2rem;    --s-12: 3rem;    --s-16: 4rem;  --s-24: 6rem;

  /* Shape & elevation */
  --radius: 2px;
  --frame: 1px solid var(--line);
  --shadow-card: 0 1px 2px rgba(33, 26, 21, 0.06);

  /* Motion */
  --speed: 150ms;
  --ease: cubic-bezier(0.2, 0, 0, 1);

  /* Layout */
  --measure: 42rem;
  --wrap: 70rem;
  --gutter: 1.25rem;
  --photo-max: 30rem;
  --card-min: 18rem;

  /* Implementation tokens (v0.1.1) */
  --weight-body: 400;  --weight-medium: 500;  --weight-display: 600;
  --leading-body: 1.65;  --leading-lede: 1.5;  --leading-head: 1.2;  --leading-h1: 1.05;
  --tracking-eyebrow: 0.08em;  --tracking-label: 0.06em;
  --underline-offset: 3px;
  --hairline: 1px;  --focus-width: 2px;  --focus-offset: 2px;
}

/* ── Fonts: self-hosted, latin subset, SIL OFL (public/fonts/*-OFL.txt) ── */
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/fraunces-600-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("/fonts/inter-var-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: var(--weight-body);
  font-size: var(--text-base);
  line-height: var(--leading-body);
}

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

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: var(--weight-display);
  line-height: var(--leading-head);
  margin: 0 0 var(--s-4);
}
h1 { font-size: var(--text-3xl); line-height: var(--leading-h1); margin-bottom: var(--s-6); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }

p { margin: 0 0 var(--s-4); }

/* Links (§4) */
a {
  color: var(--oxblood);
  text-decoration: underline;
  text-underline-offset: var(--underline-offset);
  transition: color var(--speed) var(--ease);
}
a:hover { color: var(--oxblood-deep); }

:focus-visible {
  outline: var(--focus-width) solid var(--focus-ring);
  outline-offset: var(--focus-offset);
}

.skip-link {
  position: absolute;
  left: var(--s-4);
  top: calc(-1 * var(--s-16));
  background: var(--paper-raised);
  padding: var(--s-2) var(--s-4);
  z-index: 1;
}
.skip-link:focus { top: var(--s-4); }

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

.prose { max-width: var(--measure); }

/* Type roles (§3) */
.lede {
  font-size: var(--text-lg);
  line-height: var(--leading-lede);
  color: var(--smoke);
  max-width: var(--measure);
}

.eyebrow {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--oxblood);
  margin: 0 0 var(--s-4);
}

.meta {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--smoke);
}

/* ── Header / footer (§4) ──────────────────────────────────────────────── */
.site-header { border-bottom: var(--frame); }

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-2) var(--s-6);
  padding-top: var(--s-6);
  padding-bottom: var(--s-6);
}

.wordmark {
  font-family: var(--font-display);
  font-weight: var(--weight-display);
  font-size: var(--text-lg);
  color: var(--ink);
  text-decoration: none;
}
.wordmark:hover { color: var(--oxblood); }

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-6);
}

.site-nav a {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] { color: var(--oxblood); }
.site-nav a[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: var(--underline-offset);
}

main { flex: 1; }

.site-footer {
  border-top: var(--frame);
  padding: var(--s-8) 0;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--smoke);
}
.site-footer p { margin: 0; }

/* ── Sections (§5 page shell) ──────────────────────────────────────────── */
.section { padding: var(--s-16) 0; }
.section + .section { border-top: var(--frame); }
.section--raised { background: var(--paper-raised); }
.section--hero { padding: var(--s-24) 0 var(--s-16); }
.section-head { margin-bottom: var(--s-8); }

/* ── Archive photo figure (§4) ─────────────────────────────────────────── */
.archive {
  margin: 0;
  max-width: var(--photo-max);
  background: var(--paper-raised);
  border: var(--frame);
  padding: var(--s-2);
  transition: box-shadow var(--speed) var(--ease);
}
.archive img { width: 100%; }
.archive figcaption {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--smoke);
  padding: var(--s-2) var(--s-1) var(--s-1);
}

a.archive-link { display: block; text-decoration: none; color: inherit; }
a.archive-link:hover .archive { box-shadow: var(--shadow-card); }

/* Solo figure inside prose: breaks the column, keeps the mat. */
.prose .archive { margin: var(--s-8) 0; }

/* ── Photo band (§4) ───────────────────────────────────────────────────── */
.photo-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--s-4);
  margin: var(--s-8) 0;
  padding: 0;
  list-style: none;
}
.photo-band:first-child { margin-top: 0; }
.photo-band:last-child { margin-bottom: 0; }
.photo-band--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.photo-band .archive { max-width: none; height: 100%; }
.photo-band img { aspect-ratio: 4 / 3; object-fit: cover; }

@media (max-width: 640px) {
  .photo-band,
  .photo-band--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 420px) {
  .photo-band,
  .photo-band--3 { grid-template-columns: minmax(0, 1fr); }
}

/* ── Status chip (§4) ──────────────────────────────────────────────────── */
.chip {
  display: inline-block;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  line-height: var(--leading-lede);
  padding: var(--s-1) var(--s-3);
  border: var(--hairline) solid currentColor;
  border-radius: var(--radius);
  background: transparent;
}
.chip--exploring { color: var(--status-exploring); }
.chip--active    { color: var(--status-active); }
.chip--shelved   { color: var(--status-shelved); }

/* ── Experiment card (§4) + card grid (§5) ─────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(var(--card-min), 100%), 1fr));
  gap: var(--s-6);
  margin: 0;
  padding: 0;
  list-style: none;
}

.card {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  height: 100%;
  background: var(--paper-raised);
  border: var(--frame);
  border-radius: var(--radius);
  padding: var(--s-6);
  color: var(--ink);
  text-decoration: none;
  transition: border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}
.card .chip { align-self: flex-start; }
.card h3 { margin: 0; }
.card p { margin: 0; }
.card .card-more { margin-top: auto; color: var(--oxblood); font-weight: var(--weight-medium); }

a.card:hover {
  border-color: var(--brass);
  box-shadow: var(--shadow-card);
  color: var(--ink);
}

/* ── Primary button (§4; one per page max) ─────────────────────────────── */
.button {
  display: inline-block;
  background: var(--oxblood);
  color: var(--paper);
  font-weight: var(--weight-medium);
  text-decoration: none;
  border-radius: var(--radius);
  padding: var(--s-3) var(--s-6);
  transition: background-color var(--speed) var(--ease);
}
.button:hover { background: var(--oxblood-deep); color: var(--paper); }

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