@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=DM+Serif+Display&display=swap");

:root {
  color-scheme: light;
  font-family: "DM Sans", system-ui, sans-serif;
  color: #20231f;
  background: #f4efe5;
  font-synthesis: none;
  --ink: #20231f;
  --muted: #716f67;
  --line: #d8d1c3;
  --paper: #fffdf7;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(90deg, rgb(32 35 31 / 3%) 1px, transparent 1px) 0 0 / 24px 24px,
    #f4efe5;
}

button, a { -webkit-tap-highlight-color: transparent; }

button {
  border: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}

.site-header p {
  margin: 0;
  color: var(--muted);
  font-size: .83rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  font-weight: 700;
  letter-spacing: -.02em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: white;
  font-family: "DM Serif Display", Georgia, serif;
  font-size: 1.1rem;
  font-weight: 400;
}

main {
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto;
}

.hero { padding: clamp(72px, 11vw, 150px) 0 90px; }

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent, #9f503c);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .17em;
  text-transform: uppercase;
}

h1, h2, p { margin-top: 0; }

h1, h2 {
  font-family: "DM Serif Display", Georgia, serif;
  font-weight: 400;
  letter-spacing: -.035em;
}

.hero h1 {
  max-width: 1000px;
  margin-bottom: 28px;
  font-size: clamp(3.4rem, 8.3vw, 8rem);
  line-height: .88;
}

.intro {
  max-width: 610px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.65;
}

.collection-heading,
.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--ink);
}

.collection-heading h2,
.section-heading h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.3rem);
}

.collection-heading span,
.section-heading > p {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: .8rem;
}

.recipe-list { margin-bottom: 120px; }

.recipe-card {
  position: relative;
  display: grid;
  grid-template-columns: 90px 1fr auto;
  align-items: center;
  gap: 20px;
  min-height: 180px;
  padding: 30px 34px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
  transition: color .2s;
}

.recipe-card::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--pale);
  content: "";
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform .25s ease;
}

.recipe-card:hover::before,
.recipe-card:focus-visible::before { transform: scaleY(1); }

.card-number {
  align-self: start;
  color: var(--accent);
  font-size: .72rem;
  font-weight: 700;
}

.card-copy { display: grid; gap: 6px; }

.card-copy strong {
  font-family: "DM Serif Display", Georgia, serif;
  font-size: clamp(2rem, 5vw, 4.1rem);
  font-weight: 400;
  letter-spacing: -.035em;
  line-height: 1;
}

.card-copy > span:last-child {
  color: var(--muted);
  font-size: .82rem;
}

.card-kicker {
  color: var(--accent);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.card-arrow {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 1.4rem;
  transition: transform .2s, background .2s, color .2s;
}

.recipe-card:hover .card-arrow {
  background: var(--accent);
  color: white;
  transform: rotate(45deg);
}

.back-button {
  margin: 40px 0 56px;
  padding: 10px 0;
  background: transparent;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 600;
}

.back-button:hover { color: var(--accent); }

.recipe-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(290px, .42fr);
  gap: clamp(50px, 8vw, 120px);
  align-items: end;
  padding-bottom: 66px;
}

.recipe-header h1 {
  max-width: 800px;
  margin-bottom: 24px;
  font-size: clamp(4rem, 8vw, 7.4rem);
  line-height: .86;
}

.recipe-description {
  max-width: 620px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.65;
}

.recipe-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0;
  padding: 20px 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

.recipe-facts div + div {
  padding-left: 18px;
  border-left: 1px solid var(--line);
}

.recipe-facts dt {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.recipe-facts dd {
  margin: 0;
  font-family: "DM Serif Display", Georgia, serif;
  font-size: 1.1rem;
}

.controls {
  display: flex;
  align-items: center;
  gap: 34px;
  margin-bottom: 80px;
  padding: 20px 24px;
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line));
  border-radius: 18px;
  background: var(--pale);
}

.control-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.control-label {
  color: color-mix(in srgb, var(--accent) 60%, var(--ink));
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.portion-stepper,
.segmented-control {
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: 12px;
  background: rgb(255 255 255 / 65%);
}

.portion-stepper button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 9px;
  background: transparent;
  font-size: 1.2rem;
}

.portion-stepper button:hover,
.segmented-control button:hover { background: white; }

.portion-stepper output {
  min-width: 105px;
  text-align: center;
  font-weight: 600;
}

.segmented-control button {
  padding: 9px 16px;
  border-radius: 9px;
  background: transparent;
  font-size: .78rem;
  font-weight: 600;
}

.segmented-control button.active {
  background: var(--ink);
  color: white;
}

.scale-note {
  margin: 0 0 0 auto;
  color: var(--muted);
  font-size: .76rem;
}

.method-section { margin-bottom: 120px; }

.section-heading { margin-bottom: 24px; }

.section-heading .eyebrow { margin-bottom: 6px; }

.section-heading > p {
  max-width: 300px;
  text-align: right;
  line-height: 1.5;
}

.opening-actions {
  display: grid;
  grid-template-columns: 1fr;
  border: 1px solid var(--line);
  border-bottom: 0;
  background: var(--paper);
}

.opening-actions > div {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 58px;
  padding: 12px 18px;
}

.opening-actions > div + div { border-top: 1px solid var(--line); }

.opening-actions span {
  color: var(--accent);
  font-weight: 700;
}

.opening-actions p {
  margin: 0;
  font-size: .86rem;
}

.diagram-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  background: var(--paper);
  scrollbar-color: var(--accent) transparent;
}

.process-diagram {
  display: grid;
  grid-template-columns: minmax(290px, 2.5fr) repeat(var(--actions), minmax(118px, 1fr));
  grid-template-rows: repeat(var(--rows), minmax(68px, auto));
  min-width: calc(290px + var(--actions) * 118px);
}

.ingredient {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
  padding: 18px 20px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.ingredient:last-of-type { border-bottom: 0; }

.ingredient strong {
  flex: 0 0 auto;
  color: var(--accent);
  font-family: "DM Serif Display", Georgia, serif;
  font-size: 1.15rem;
  font-weight: 400;
}

.ingredient span {
  min-width: 0;
  font-size: .86rem;
  line-height: 1.35;
}

.action {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  padding: 18px 14px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--pale) 60%, white);
  animation: action-in .35s both;
  animation-delay: var(--delay);
}

.action::before {
  position: absolute;
  top: 50%;
  left: -9px;
  width: 16px;
  height: 16px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  background: var(--paper);
  content: "";
  transform: translateY(-50%);
}

.action-index {
  color: var(--accent);
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .1em;
}

.action > strong {
  font-family: "DM Serif Display", Georgia, serif;
  font-size: clamp(1.35rem, 2.3vw, 2rem);
  font-weight: 400;
  letter-spacing: -.02em;
  line-height: 1;
}

.action > span:last-child {
  color: var(--muted);
  font-size: .7rem;
  line-height: 1.35;
}

.connector {
  z-index: 2;
  align-self: end;
  border-bottom: 2px solid color-mix(in srgb, var(--accent) 58%, var(--line));
  pointer-events: none;
}

.diagram-hint {
  display: none;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: .7rem;
  text-align: right;
}

footer {
  display: flex;
  justify-content: space-between;
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto;
  padding: 26px 0 38px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .72rem;
}

[hidden] { display: none !important; }

@keyframes action-in {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}

@media (max-width: 850px) {
  .recipe-header { grid-template-columns: 1fr; }
  .controls { flex-wrap: wrap; }
  .scale-note { width: 100%; margin-left: 0; }
  .diagram-hint { display: block; }
}

@media (max-width: 620px) {
  .site-header,
  main,
  footer { width: min(100% - 28px, 1240px); }

  .site-header p { display: none; }
  .hero { padding: 66px 0 70px; }
  .hero h1 { font-size: clamp(3.2rem, 17vw, 5.2rem); }
  .collection-heading { align-items: center; }

  .recipe-card {
    grid-template-columns: 42px 1fr;
    min-height: 150px;
    padding: 24px 8px;
  }

  .card-arrow { display: none; }
  .card-copy strong { font-size: 2.2rem; }
  .back-button { margin: 24px 0 40px; }
  .recipe-header { padding-bottom: 42px; }
  .recipe-header h1 { font-size: clamp(3.6rem, 18vw, 5.3rem); }
  .recipe-facts { grid-template-columns: repeat(3, 1fr); }

  .controls {
    display: grid;
    gap: 16px;
    margin-bottom: 64px;
    padding: 16px;
  }

  .control-group { justify-content: space-between; }
  .section-heading { display: block; }
  .section-heading > p { margin-top: 12px; text-align: left; }
  .opening-actions { grid-template-columns: 1fr; }
  .opening-actions > div + div { border-top: 1px solid var(--line); border-left: 0; }
  footer { display: grid; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
