/* Hopper Table — see DESIGN.md */

:root {
  --paper: #f6f2ea;
  --paper-deep: #efe9dd;
  --ink: #191714;
  --ink-soft: #57514a;
  --rule: #dcd3c2;
  --lilac: #6b4d6e;
  --oak: #7a5b3f;

  --display: "Bodoni Moda", Georgia, serif;
  --text: "Source Serif 4", Georgia, serif;

  --gut: clamp(1.25rem, 4vw, 3rem);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--rule) var(--paper);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: clamp(1.0625rem, 0.95rem + 0.4vw, 1.1875rem);
  font-weight: 350;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-underline-offset: 0.18em;
}

::selection { background: #6b4d6e2e; color: var(--ink); }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--paper); }
::-webkit-scrollbar-thumb { background: var(--rule); border: 3px solid var(--paper); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #c8bda6; }

:focus-visible {
  outline: 2px solid var(--lilac);
  outline-offset: 3px;
  border-radius: 1px;
}

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

a { color: var(--lilac); text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

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

.label {
  font-family: var(--text);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--oak);
  margin: 0;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 0.75rem 1.25rem;
  z-index: 100;
}
.skip:focus { left: 0; }

/* ── chrome ─────────────────────────────────────────────── */

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: clamp(1rem, 2.5vw, 1.75rem) var(--gut);
  border-bottom: 1px solid var(--rule);
}

.mark { display: block; line-height: 0; }
.mark img { width: clamp(200px, 26vw, 300px); }

@media (max-width: 599px) {
  .masthead { flex-direction: column; gap: 0.9rem; text-align: center; }
  .mark img { width: min(260px, 72vw); }
}

.nav {
  display: flex;
  gap: clamp(1rem, 3vw, 2.25rem);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.nav a {
  color: var(--ink);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: border-color 240ms var(--ease), color 240ms var(--ease);
}
.nav a:hover { border-bottom-color: var(--lilac); color: var(--lilac); }
.nav a[aria-current="page"] { border-bottom-color: var(--ink); }

.foot {
  border-top: 1px solid var(--rule);
  padding: clamp(2.5rem, 6vw, 4.5rem) var(--gut);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2.5rem;
  align-items: baseline;
  justify-content: space-between;
  color: var(--ink-soft);
  font-size: 0.9rem;
}
.foot p { margin: 0; }
.foot .rabbit { width: 42px; opacity: 0.8; }

/* ── the drifting table ─────────────────────────────────── */

.drift {
  overflow: hidden;
  padding-block: 0;
  border-bottom: 1px solid var(--rule);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}
.drift-rail {
  display: flex;
  width: max-content;
  gap: 10px;
  padding-block: clamp(1.25rem, 3vw, 2.25rem);
  animation: drift 86s linear infinite;
}
.drift:hover .drift-rail,
.drift:focus-within .drift-rail { animation-play-state: paused; }
.drift img {
  height: clamp(168px, 26vw, 368px);
  width: auto;
  object-fit: cover;
  filter: saturate(0.96);
}
@keyframes drift { to { transform: translate3d(-50%, 0, 0); } }

@media (prefers-reduced-motion: reduce) {
  .drift-rail { animation: none; }
  .drift { -webkit-mask-image: none; mask-image: none; overflow-x: auto; }
  * { scroll-behavior: auto !important; }
}

/* ── home ───────────────────────────────────────────────── */

.welcome {
  max-width: 68ch;
  margin-inline: auto;
  padding: clamp(3.5rem, 9vw, 7rem) var(--gut) clamp(3rem, 7vw, 5.5rem);
}
.welcome h1 {
  font-size: clamp(2.6rem, 1.5rem + 4.2vw, 5rem);
  letter-spacing: 0.1em;
  text-indent: 0.1em;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}
.welcome p {
  margin: 0 0 1.5em;
  font-size: 1.1em;
}
.welcome p:first-of-type {
  font-size: 1.32em;
  line-height: 1.48;
}
.welcome p:first-of-type::first-letter {
  font-family: var(--display);
  font-size: 3.1em;
  line-height: 0.82;
  float: left;
  padding: 0.06em 0.1em 0 0;
  color: var(--lilac);
}
.welcome .sign {
  font-family: var(--display);
  font-style: italic;
  font-size: 1.5rem;
  color: var(--ink-soft);
  margin-top: 2.5rem;
}

.toarchive {
  border-top: 1px solid var(--rule);
  padding: clamp(3rem, 7vw, 5.5rem) var(--gut);
  text-align: center;
}
.toarchive h2 {
  font-size: clamp(1.9rem, 1.2rem + 2.6vw, 3.1rem);
  margin: 0.6rem 0 1.5rem;
}
.toarchive p { max-width: 50ch; margin: 0 auto 2rem; color: var(--ink-soft); }

.action {
  display: inline-block;
  font-family: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--paper);
  background: var(--ink);
  padding: 1.05rem 2.4rem;
  text-decoration: none;
  transition: background 240ms var(--ease), transform 240ms var(--ease);
}
.action:hover { background: var(--lilac); transform: translateY(-2px); }
.action:active { transform: translateY(0); }

/* ── archive ────────────────────────────────────────────── */

.page-head {
  padding: clamp(3rem, 7vw, 5.5rem) var(--gut) clamp(1.75rem, 4vw, 3rem);
  max-width: 62ch;
}
.page-head h1 {
  font-size: clamp(2.4rem, 1.4rem + 3.6vw, 4.4rem);
  margin: 0.5rem 0 1rem;
}
.page-head p { color: var(--ink-soft); margin: 0; }

.mosaic {
  padding: 0 var(--gut) clamp(3rem, 7vw, 5rem);
  column-count: 2;
  column-gap: 12px;
}
@media (min-width: 680px)  { .mosaic { column-count: 3; column-gap: 16px; } }
@media (min-width: 1100px) { .mosaic { column-count: 4; column-gap: 18px; } }
@media (min-width: 1600px) { .mosaic { column-count: 5; } }

.shot {
  display: block;
  width: 100%;
  padding: 0;
  margin: 0 0 12px;
  border: 0;
  background: var(--paper-deep);
  cursor: zoom-in;
  break-inside: avoid;
  position: relative;
  overflow: hidden;
}
@media (min-width: 680px) { .shot { margin-bottom: 16px; } }
.shot img {
  width: 100%;
  transition: transform 420ms var(--ease), filter 420ms var(--ease);
}
.shot:hover img { transform: scale(1.028); filter: saturate(1.06); }

/* ── lightbox ───────────────────────────────────────────── */

.lb {
  position: fixed;
  inset: 0;
  z-index: 50;
  border: 0;
  padding: 0;
  margin: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  background: #14120fef;
  display: none;
}
.lb[open] { display: grid; }
.lb::backdrop { background: #14120fef; }
.lb-fig {
  margin: 0;
  display: grid;
  place-items: center;
  padding: clamp(0.75rem, 3vw, 3rem);
}
.lb-fig img {
  max-width: 100%;
  max-height: 88vh;
  width: auto;
  object-fit: contain;
}
.lb-bar {
  position: absolute;
  inset: auto 0 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 1.1rem;
  color: #e8e2d6;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}
.lb button {
  appearance: none;
  background: none;
  border: 1px solid #ffffff3d;
  color: #e8e2d6;
  font: inherit;
  letter-spacing: inherit;
  padding: 0.5rem 0.95rem;
  cursor: pointer;
  transition: background 240ms var(--ease), border-color 240ms var(--ease);
}
.lb button:hover { background: #ffffff1f; border-color: #ffffff85; }
.lb .lb-close { position: absolute; top: 1rem; right: 1rem; }

/* ── about ──────────────────────────────────────────────── */

.about {
  display: grid;
  gap: clamp(2rem, 5vw, 4rem);
  padding: clamp(3rem, 7vw, 6rem) var(--gut) clamp(3rem, 7vw, 5rem);
  align-items: start;
}
@media (min-width: 900px) {
  .about { grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.1fr); }
  .about figure { position: sticky; top: 2rem; }
}
.about figure { margin: 0; }
.about figcaption { margin-top: 0.85rem; color: var(--ink-soft); font-size: 0.9rem; }
.about h1 { font-size: clamp(2.4rem, 1.4rem + 3.4vw, 4rem); margin-bottom: 1.5rem; }
.about .prose { max-width: 64ch; }
.about .prose p { margin: 0 0 1.4em; }

/* ── recipe ─────────────────────────────────────────────── */

.recipe-head { padding: clamp(3rem, 7vw, 5.5rem) var(--gut) clamp(1.5rem, 4vw, 2.5rem); max-width: 62ch; }
.recipe-head h1 { font-size: clamp(2.4rem, 1.4rem + 3.6vw, 4.2rem); margin: 0.5rem 0 1rem; }
.recipe-head .standfirst { font-size: 1.15em; color: var(--ink-soft); margin: 0; }
.recipe-meta {
  display: flex; flex-wrap: wrap; gap: 0.5rem 2rem;
  padding: 0 var(--gut) 2rem; border-bottom: 1px solid var(--rule);
  font-variant-numeric: tabular-nums;
}
.recipe-meta div { display: grid; gap: 0.2rem; }
.recipe-meta strong { font-family: var(--display); font-size: 1.3rem; font-weight: 400; }

.recipe-body { display: grid; gap: clamp(2rem, 5vw, 3.5rem); padding: clamp(2.5rem, 6vw, 4rem) var(--gut) clamp(3rem, 7vw, 5rem); }
@media (min-width: 900px) { .recipe-body { grid-template-columns: minmax(250px, 0.72fr) minmax(0, 1.28fr); } }

.ingredients { background: var(--paper-deep); padding: clamp(1.5rem, 3vw, 2.25rem); align-self: start; }
@media (min-width: 900px) { .ingredients { position: sticky; top: 1.5rem; } .steps { padding-top: clamp(1.5rem, 3vw, 2.25rem); } }
.ingredients h2 { font-size: 1.6rem; margin-bottom: 1.2rem; }
.ingredients ul { list-style: none; margin: 0; padding: 0; }
.ingredients li { padding: 0.55rem 0; border-bottom: 1px solid var(--rule); font-variant-numeric: tabular-nums; }
.ingredients li:last-child { border-bottom: 0; }

.steps { max-width: 64ch; }
.steps h2 { font-size: 1.6rem; margin-bottom: 1.5rem; }
.steps ol { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 2.9rem 1fr; align-items: baseline; gap: 1rem; padding-bottom: 1.8rem; }
.steps li p { margin: 0; }
.steps li::before {
  content: counter(step);
  font-family: var(--display);
  font-size: 2.4rem;
  line-height: 1;
  color: var(--oak);
}

@media print {
  @page { margin: 16mm; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .masthead, .foot, .drift, .action, .nav, .skip { display: none !important; }
  .recipe-body { display: block; }
  .ingredients { background: none; border: 1px solid #000; padding: 10pt; position: static; margin-bottom: 14pt; }
  .steps li { break-inside: avoid; }
  .steps li::before { color: #000; }
  a { color: #000; text-decoration: none; }
}
