/* mattharris.net — "The Kitchen Table"
   Design contract: BRIEF.md + artifact afdb5aaf (Kitchen Table direction).
   Palette converted to OKLCH, neutral hues nudged 25% toward paprika (h33.9). */

/* ---------- fonts ---------- */

@font-face {
  font-family: "Young Serif";
  src: url("/assets/fonts/young-serif-v2-latin-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Libre Baskerville";
  src: url("/assets/fonts/libre-baskerville-v24-latin-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Libre Baskerville";
  src: url("/assets/fonts/libre-baskerville-v24-latin-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Libre Baskerville";
  src: url("/assets/fonts/libre-baskerville-v24-latin-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ---------- tokens ---------- */

:root {
  color-scheme: light;

  /* surfaces */
  --paper: oklch(97.4% 0.015 73);      /* page ground        (#FBF6EB) */
  --sheet: oklch(99.4% 0.009 79);      /* cards, recipe sheets (#FFFDF6) */
  --mat: oklch(94% 0.023 70);          /* tinted surfaces      (#F3EADA) */
  --mat-white: oklch(99.6% 0.004 79);  /* photo mats — warm, never pure white */
  --line: oklch(88.6% 0.035 71);       /* hairlines            (#E5D8C0) */

  /* ink */
  --ink: oklch(28.2% 0.031 63);        /* text — never pure black (#332718) */
  --soft: oklch(54.2% 0.041 64);       /* captions, meta       (#7E6C55) */

  /* accents */
  --paprika: oklch(53.6% 0.171 34);      /* the one accent     (#BC3A1D) */
  --paprika-deep: oklch(46% 0.148 34);   /* hover, meta caps   (#992D14) */
  --cobalt: oklch(44.6% 0.135 263.5);    /* diversions links only (#2B4F9E) */

  /* type */
  --disp: "Young Serif", Georgia, serif;
  --body: "Libre Baskerville", Georgia, serif;

  /* scale — 1.333 ratio around 16px, fewer sizes with more contrast */
  --text-xs: 0.75rem;      /* 12px  legal, badge */
  --text-sm: 0.84375rem;   /* 13.5px meta, captions */
  --text-base: 1rem;       /* 16px  body */
  --text-lg: 1.1875rem;    /* 19px  h3, leads */
  --text-xl: clamp(1.5rem, 1rem + 2.2vw, 1.875rem);  /* h2, recipe titles */
  --text-hero: clamp(1.75rem, 1.1rem + 3.2vw, 2.625rem);

  /* rhythm — body 16px × 1.72 ≈ 27.5px; spacing on a 4pt scale */
  --leading: 1.72;
  --space-2xs: 4px;
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 40px;
  --space-2xl: 64px;
  --space-3xl: clamp(56px, 5vw + 32px, 96px);

  --measure: 68ch;
  --wrap-max: 960px;

  --shadow-mat: 0 3px 12px oklch(35% 0.05 63 / 0.10);
  --shadow-card: 0 2px 14px oklch(35% 0.05 63 / 0.07);

  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
}

/* ---------- base ---------- */

* { box-sizing: border-box; }

html {
  background: var(--paper);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: var(--text-base);
  line-height: var(--leading);
  font-kerning: normal;
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3, h4 {
  font-family: var(--disp);
  font-weight: 400;
  line-height: 1.15;
  text-wrap: balance;
  margin: 0;
}

h1 { font-size: var(--text-hero); }
h2 { font-size: var(--text-xl); }
h3 { font-size: var(--text-lg); }

p {
  margin: 0 0 1em;
  max-width: var(--measure);
}

a {
  color: var(--paprika);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover { color: var(--paprika-deep); }
a:focus-visible {
  outline: 2px solid var(--paprika);
  outline-offset: 2px;
}

img, video {
  max-width: 100%;
  height: auto;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: var(--space-lg) 0;
}

::selection {
  background: oklch(88% 0.06 34);
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--sheet);
  padding: var(--space-xs) var(--space-md);
  z-index: 10;
}
.skip:focus { left: var(--space-md); }

/* shared text utilities */

.eyebrow {
  font-size: 0.6875rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--soft);
  margin: 0 0 var(--space-xs);
}

.note {
  font-size: var(--text-sm);
  color: var(--soft);
  font-style: italic;
}

/* ---------- page frame ---------- */

.site-head,
main,
.site-foot {
  max-width: var(--wrap-max);
  margin-inline: auto;
  padding-inline: clamp(18px, 4vw, 48px);
}

.site-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-md);
  flex-wrap: wrap;
  padding-top: clamp(20px, 3vw, 36px);
  padding-bottom: var(--space-lg);
}

.wordmark {
  font-family: var(--disp);
  font-size: 1.25rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.wordmark .ast { color: var(--paprika); }

.site-nav {
  display: flex;
  gap: clamp(14px, 2.5vw, 24px);
  font-size: var(--text-sm);
}
.site-nav a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: 1px;
}
.site-nav a:hover,
.site-nav a[aria-current] {
  border-bottom-color: var(--paprika);
}

main {
  padding-bottom: var(--space-3xl);
}

/* ---------- footer ---------- */

.site-foot {
  padding-bottom: max(var(--space-xl), env(safe-area-inset-bottom));
}
/* hairline spans only the content column, so it lives on the row */
.site-foot .foot-row {
  border-top: 1px solid var(--line);
  padding-top: var(--space-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.rotnote {
  font-style: italic;
  color: var(--soft);
  font-size: var(--text-sm);
  transition: opacity 0.5s var(--ease-out-quart);
}

.badge {
  width: 88px;
  height: 31px;
  border: 1px solid var(--ink);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--sheet);
  flex: none;
}
.badge b {
  font-family: var(--body);
  font-size: 0.53125rem; /* 8.5px */
  letter-spacing: 0.12em;
  font-weight: 700;
}

.foot-meta {
  display: flex;
  gap: var(--space-md) var(--space-lg);
  flex-wrap: wrap;
  margin-top: var(--space-md);
  font-size: var(--text-xs);
  color: var(--soft);
}
.foot-meta a { color: var(--soft); }
.foot-meta .elsewhere-link { color: var(--cobalt); }

/* ---------- photo mats ---------- */

.matframe {
  margin: 0;
  background: var(--mat-white);
  border: 1px solid var(--line);
  padding: 10px 10px 8px;
  box-shadow: var(--shadow-mat);
}
.matframe img { display: block; width: 100%; }
.matframe figcaption {
  font-size: var(--text-xs);
  color: var(--soft);
  font-style: italic;
  padding-top: 7px;
  text-align: right;
}
.matframe.tilt { transform: rotate(0.4deg); }

/* ---------- homepage ---------- */

.hero {
  display: grid;
  gap: clamp(22px, 4vw, 40px);
  align-items: center;
  padding-top: var(--space-md);
}

.hero-copy p {
  font-size: var(--text-base);
}

.hero-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
  margin-top: var(--space-md);
  font-size: var(--text-base);
}

.hero h1 {
  margin-bottom: var(--space-md);
}

.invites {
  display: grid;
  gap: clamp(20px, 3vw, 34px);
  margin-top: var(--space-2xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--line);
}

.invites h2 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-sm);
}

.invites ul {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: var(--text-sm);
  line-height: 2.1;
}

.invites .more {
  font-size: var(--text-sm);
  margin-top: var(--space-xs);
}

.thumbrow {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xs);
  margin: var(--space-2xs) 0 var(--space-xs);
}
.thumbrow a { display: block; }
.thumbrow img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  border: 1px solid var(--line);
  background: var(--mat);
}

.elsewhere a { color: var(--cobalt); }
.elsewhere .note { font-style: italic; }

@media (min-width: 720px) {
  .hero {
    grid-template-columns: 1.05fr 0.95fr;
  }
  .invites {
    grid-template-columns: 1.25fr 0.9fr 0.85fr;
  }
}

/* ---------- inner pages ---------- */

.page-head {
  padding-top: var(--space-md);
  margin-bottom: var(--space-xl);
}
.page-head h1 { margin-bottom: var(--space-sm); }
.page-lede {
  font-size: var(--text-base);
  color: var(--soft);
}

/* ---------- recipe index ---------- */

.recipe-cat {
  margin-bottom: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--line);
}
.recipe-cat h2 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-sm);
}
.recipe-cat ul {
  list-style: none;
  margin: 0;
  padding: 0;
  line-height: 2.1;
  font-size: var(--text-base);
  columns: 2 22ch;
  column-gap: var(--space-2xl);
  max-width: var(--measure);
}
.recipe-cat li { break-inside: avoid; }
.recipe-cat .serves {
  font-size: var(--text-xs);
  color: var(--soft);
  font-style: italic;
  white-space: nowrap;
}

/* ---------- recipe page ---------- */

.recipe {
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-card);
  padding: clamp(24px, 4vw, 48px);
  max-width: calc(var(--measure) + 2 * 48px);
  margin-top: var(--space-md);
}

.recipe .eyebrow a {
  color: var(--soft);
  text-decoration: none;
}
.recipe .eyebrow a:hover { color: var(--paprika); }

.recipe-title { font-size: var(--text-xl); }

.headnote {
  font-style: italic;
  color: var(--soft);
  font-size: var(--text-base);
  margin: var(--space-sm) 0 0;
}

.recipe-meta {
  font-size: var(--text-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--paprika-deep);
  margin: var(--space-md) 0 var(--space-lg);
}

.printbtn {
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: var(--paprika);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.printbtn:hover { color: var(--paprika-deep); }

.recipe-lead {
  margin-bottom: var(--space-lg);
}
.recipe-lead img,
.step-photo img {
  display: block;
  width: 100%;
  height: auto;
  background: var(--mat-white);
  border: 1px solid var(--line);
  padding: 8px;
  box-shadow: var(--shadow-mat);
}
.step-photo {
  display: block;
  max-width: 440px;
  margin: var(--space-sm) 0 var(--space-xs);
}

.rsec { margin-top: var(--space-lg); }

.rsec-head {
  font-family: var(--body);
  font-weight: 700;
  font-size: var(--text-xs);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: var(--space-sm);
}

.rsec-body ul,
.rsec-body ol {
  margin: 0;
  padding-left: 1.3em;
  line-height: 1.9;
  font-size: var(--text-sm);
  max-width: var(--measure);
}
.rsec-body li { margin-bottom: 0.45em; }
.rsec-body p {
  font-size: var(--text-sm);
  margin: 0.6em 0;
}
.rsec-body strong {
  display: block;
  margin-top: var(--space-sm);
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
}

/* "from the margins" — Notes as marginalia */
.rsec-notes {
  background: var(--mat);
  border-radius: 8px;
  padding: var(--space-md) var(--space-lg);
}
.rsec-notes .rsec-head { color: var(--soft); }
.rsec-notes ul { font-style: italic; color: var(--soft); }
.rsec-notes a { overflow-wrap: anywhere; }

.source { margin-top: var(--space-lg); }
.source a { color: var(--soft); }

/* ---------- photography: portfolio ---------- */

.folio {
  display: grid;
  gap: var(--space-3xl);
  padding-top: var(--space-lg);
  max-width: 960px;
}
.folio-frame {
  margin: 0;
}
.folio-frame img {
  display: block;
  width: 100%;
  height: auto;
}

/* ---------- photography: collections block on /photos ---------- */

.collections-block {
  margin-top: var(--space-3xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--line);
}
.collections-block h2 { margin-bottom: var(--space-sm); }
.collections-block .page-lede { margin-bottom: var(--space-lg); }

.collection-card {
  display: grid;
  gap: var(--space-md) var(--space-lg);
  align-items: center;
  text-decoration: none;
  color: var(--ink);
  padding: var(--space-lg) 0;
  border-top: 1px solid var(--line);
}
.collection-card:first-of-type { border-top: 0; }
.collection-thumb img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  background: var(--mat-white);
  border: 1px solid var(--line);
  padding: 6px;
  box-shadow: var(--shadow-mat);
}
.collection-info { display: block; }
.collection-title {
  display: block;
  font-family: var(--disp);
  font-size: var(--text-lg);
  margin-bottom: 2px;
}
.collection-card:hover .collection-title { color: var(--paprika); }
.collection-place {
  display: block;
  font-size: var(--text-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--soft);
  margin-bottom: var(--space-xs);
}
.collection-intro {
  display: block;
  font-size: var(--text-sm);
  color: var(--soft);
  font-style: italic;
  max-width: 52ch;
}

@media (min-width: 720px) {
  .collection-card { grid-template-columns: 260px 1fr; }
}

/* ---------- photography: collection essay ---------- */

.essay-intro { max-width: 56ch; }
.essay {
  display: grid;
  gap: var(--space-2xl);
  max-width: 820px;
  padding-top: var(--space-md);
}
.essay-frame { margin: 0; }

.backlink {
  margin-top: var(--space-2xl);
  font-size: var(--text-sm);
}

/* ---------- family album ---------- */

.album-head .album-count {
  color: var(--soft);
  font-size: var(--text-sm);
  font-style: italic;
}

.album-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-xs);
}
@media (min-width: 720px) {
  .album-grid { grid-template-columns: repeat(3, 1fr); gap: var(--space-sm); }
}

.album-cell {
  display: block;
  background: var(--mat);
  border: 1px solid var(--line);
}
.album-cell img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}
.album-video video {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: var(--ink);
}

.album-nav {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-md);
  margin-top: var(--space-xl);
  font-size: var(--text-sm);
}
.album-nav .album-pageno {
  color: var(--soft);
  font-size: var(--text-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ---------- resume ---------- */

.resume {
  max-width: 72ch;
  padding-top: var(--space-md);
}
.resume-head { margin-bottom: var(--space-lg); }
.resume-head .eyebrow a { color: var(--paprika); }
.resume-head .eyebrow .printbtn {
  font-size: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
}
.resume-tagline {
  font-size: var(--text-lg);
  color: var(--soft);
  margin: var(--space-sm) 0 var(--space-xs);
  max-width: 48ch;
}
.resume-contact { font-size: var(--text-sm); color: var(--soft); }
.resume-contact a { color: var(--soft); }

.resume .rsec {
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--line);
}
.resume p, .resume li { font-size: var(--text-sm); }

.impact-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md) var(--space-lg);
}
@media (min-width: 640px) {
  .impact-row { grid-template-columns: repeat(3, 1fr); }
}
.impact b {
  display: block;
  font-family: var(--disp);
  font-weight: 400;
  font-size: var(--text-xl);
  color: var(--paprika-deep);
  line-height: 1.1;
}
.impact span {
  font-size: var(--text-xs);
  color: var(--soft);
}

.role { margin-bottom: var(--space-lg); }
.role h3 {
  font-family: var(--body);
  font-weight: 700;
  font-size: var(--text-base);
  line-height: 1.4;
}
.role-dates {
  font-size: var(--text-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--soft);
  margin: 2px 0 var(--space-xs);
}
.role ul {
  margin: 0;
  padding-left: 1.2em;
  line-height: 1.7;
}
.role li { margin-bottom: 0.4em; }

.engagements {
  list-style: none;
  margin: 0;
  padding: 0;
  line-height: 1.7;
}
.engagements li { margin-bottom: 0.7em; max-width: 68ch; }

/* ---------- 404 ---------- */

.notfound { padding-top: var(--space-2xl); }
.notfound .hero-links { margin-top: var(--space-lg); }

/* ---------- print: resume ---------- */

@media print {
  .resume { max-width: none; padding-top: 0; }
  .resume-head .eyebrow { display: none; }
  .resume p, .resume li { font-size: 10pt; }
  .resume .rsec {
    margin-top: 12pt;
    padding-top: 8pt;
    border-top-color: #999;
  }
  .resume-tagline, .resume-contact, .resume-contact a { color: #333; }
  .impact b { color: #000; }
  .role-dates, .impact span { color: #444; }
  .role h3, .role-dates { break-after: avoid-page; }
  .rsec-head { break-after: avoid-page; color: #000; }
}

/* ---------- print: recipe as a clean card ---------- */

@media print {
  .site-head,
  .site-foot,
  .printbtn,
  .skip {
    display: none;
  }

  html, body {
    background: #fff;
    color: #000;
    font-size: 11pt;
    line-height: 1.5;
  }

  main { padding: 0; max-width: none; }

  .recipe {
    border: 0;
    box-shadow: none;
    background: #fff;
    padding: 0;
    max-width: none;
    margin: 0;
  }

  .recipe-meta { color: #000; }
  .headnote, .rsec-notes ul { color: #333; }

  .recipe-lead,
  .step-photo { display: none; }

  .rsec-notes {
    background: none;
    border: 1px solid #999;
    border-radius: 0;
    padding: 10pt 12pt;
  }

  .recipe .rsec { break-inside: avoid-page; }
  a { color: #000; text-decoration: none; }
  .source { display: none; }
}

/* ---------- homepage load reveal ---------- */

@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(10px);
    animation: rise 0.65s var(--ease-out-quart) forwards;
    animation-delay: calc(var(--i, 0) * 90ms);
  }
  @keyframes rise {
    to {
      opacity: 1;
      transform: none;
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .rotnote { transition: none; }
}
