:root {
  color-scheme: light;
  --ink: #191713;
  --muted: #6b655a;
  --paper: #e9eee5;
  --cell: #f9faf3;
  --wash: #d7dfce;
  --line: #15130f;
  --accent: #ba690c;
  --accent-dark: #8d4a05;
  --shadow: 0 18px 60px rgb(24 22 18 / 16%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #dfe8dd;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button {
  color: inherit;
  font: inherit;
}

.page-shell {
  width: min(1120px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 42px 0 64px;
}

.hero {
  padding: 10px 0 20px;
  border-bottom: 2px solid var(--line);
}

.site-brand {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  border-bottom: 1.5px solid rgb(21 19 15 / 28%);
  padding-bottom: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.site-brand span {
  font-size: clamp(22px, 4vw, 36px);
  font-weight: 950;
  letter-spacing: -0.08em;
  text-transform: uppercase;
}

.site-brand small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.22em;
  text-align: right;
  text-transform: uppercase;
}

.top-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}

.top-tabs button,
.recipe-chip {
  border: 1.5px solid var(--line);
  background: transparent;
  cursor: pointer;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  padding: 10px 13px;
  text-transform: uppercase;
}

.top-tabs button.active,
.recipe-chip.active {
  background: var(--line);
  color: #fffdf4;
}

.eyebrow {
  margin: 0 0 16px;
  color: #9b6a22;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.32em;
  text-transform: uppercase;
}

.title-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

h1 {
  margin: 0;
  font-size: clamp(54px, 9vw, 102px);
  line-height: 0.82;
  letter-spacing: -0.095em;
}

h1 span {
  position: relative;
  top: -0.42em;
  margin-left: 4px;
  font-size: 0.14em;
  letter-spacing: 0;
}

.subtitle {
  max-width: 520px;
  margin: 22px 0 0;
  color: #2d2b26;
  font-size: clamp(20px, 2.2vw, 28px);
  line-height: 1.25;
}

.start-button {
  min-width: 150px;
  border: 0;
  background: var(--accent);
  color: #fff8e9;
  cursor: pointer;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 900;
  padding: 13px 18px;
  box-shadow: inset 0 -2px 0 rgb(0 0 0 / 18%);
}

.start-button:hover {
  background: var(--accent-dark);
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 26px;
  margin: 28px 0 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
}

.stats div {
  display: flex;
  gap: 8px;
}

.stats dt {
  color: var(--muted);
  text-transform: uppercase;
}

.stats dd {
  margin: 0;
  font-weight: 900;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 24px;
}

.segmented {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.button-row {
  display: flex;
  gap: 7px;
}

.segmented span {
  color: var(--muted);
  letter-spacing: 0.18em;
}

.segmented button {
  min-width: 42px;
  border: 1.5px solid var(--line);
  background: transparent;
  cursor: pointer;
  padding: 8px 10px;
}

.segmented button.active {
  background: var(--line);
  color: #fffdf4;
}

.recipe-picker {
  margin-top: 18px;
}

.recipe-list {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 0 6px;
  scrollbar-width: thin;
}

.recipe-chip {
  flex: 0 0 auto;
  background: rgb(255 255 255 / 25%);
  letter-spacing: 0.02em;
  text-transform: none;
}

.recipe-board {
  margin-top: 24px;
  overflow-x: auto;
  border: 2px solid var(--line);
  background: var(--cell);
  box-shadow: var(--shadow);
}

.board-header {
  min-width: 1020px;
  background: #1f1b17;
  color: #fff9ee;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
  padding: 16px;
  text-align: center;
  text-transform: uppercase;
}

.flow-grid {
  display: grid;
  background:
    linear-gradient(var(--line), var(--line)) left top / 100% 1px no-repeat,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) left top / 122px 100%,
    var(--cell);
}

.ingredient {
  display: flex;
  align-items: center;
  grid-column: 1;
  border-right: 1.5px solid var(--line);
  border-bottom: 1.5px solid var(--line);
  padding: 0 14px;
  font-size: 15px;
  line-height: 1.2;
  min-width: 0;
}

.ingredient strong {
  margin-right: 5px;
  font-weight: 950;
}

.ingredient span {
  margin-left: 4px;
  color: var(--muted);
  font-size: 13px;
}

.step {
  display: grid;
  place-content: center;
  border-right: 1.5px solid var(--line);
  border-bottom: 1.5px solid var(--line);
  background: var(--wash);
  cursor: pointer;
  padding: 14px;
  text-align: center;
  transition: background 140ms ease, box-shadow 140ms ease;
}

.step:hover,
.step:focus,
.step.active {
  background: #c5d1bc;
  box-shadow: inset 0 0 0 3px #7c8f70;
  outline: none;
}

.step h2 {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 15px;
  line-height: 1.1;
}

.step p {
  margin: 7px 0 0;
  color: #514d45;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  line-height: 1.35;
}

.cook-mode {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: min(390px, calc(100vw - 48px));
  border: 2px solid var(--line);
  background: #fffdf4;
  box-shadow: var(--shadow);
  padding: 22px;
}

.close-button {
  position: absolute;
  top: 9px;
  right: 10px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 25px;
  line-height: 1;
}

.mode-label {
  margin: 0 0 9px;
  color: var(--accent-dark);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.cook-mode h2 {
  margin: 0;
  font-size: 30px;
  letter-spacing: -0.04em;
  text-transform: capitalize;
}

.cook-mode p:not(.mode-label) {
  color: #3d3932;
  font-size: 16px;
  line-height: 1.45;
}

.mode-actions {
  display: flex;
  gap: 10px;
}

.mode-actions button {
  flex: 1;
  border: 1.5px solid var(--line);
  background: transparent;
  cursor: pointer;
  font-weight: 800;
  padding: 10px;
}

.mode-actions button:last-child {
  background: var(--line);
  color: #fffdf4;
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100% - 20px, 1120px);
    padding-top: 24px;
  }

  .title-row {
    align-items: start;
    flex-direction: column;
  }

  .site-brand {
    align-items: start;
    flex-direction: column;
    gap: 4px;
  }

  .site-brand small {
    text-align: left;
  }

  .start-button {
    width: 100%;
  }

  .button-row,
  .top-tabs {
    width: 100%;
  }

  .top-tabs button {
    flex: 1;
  }

  .recipe-board {
    margin-left: -10px;
    margin-right: -10px;
    border-left: 0;
    border-right: 0;
  }
}
