:root {
  --bg: #f2f6f3;
  --surface: #ffffff;
  --ink: #14261f;
  --muted: #3d5249;
  --line: #c5d3cb;
  --accent: #0b5d4b;
  --accent-ink: #ffffff;
  --focus: #1f3fdb;
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101a16;
    --surface: #17251f;
    --ink: #eaf3ee;
    --muted: #b4c7bd;
    --line: #2e443a;
    --accent: #6fd3b3;
    --accent-ink: #08221a;
    --focus: #9db4ff;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 1.0625rem/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow-wrap: anywhere;
}

h1,
h2 {
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.2;
  margin: 0;
}

h1 {
  font-size: clamp(2.25rem, 9vw, 3.5rem);
}

h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
main:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

main:focus {
  outline: none;
}

.skip-link {
  position: absolute;
  left: 0.5rem;
  top: -4rem;
  padding: 0.75rem 1rem;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: var(--radius);
  z-index: 10;
}

.skip-link:focus {
  top: 0.5rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.page-header,
main {
  max-width: 62rem;
  margin: 0 auto;
  padding: 1.25rem 1rem;
}

.page-header {
  padding-top: 2rem;
}

.page-header p {
  margin: 0.5rem 0 0;
  max-width: 60ch;
  color: var(--muted);
}

.servings {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-bottom: 1.25rem;
}

.servings label {
  font-weight: 700;
}

.stepper {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
}

.stepper button,
.switcher button {
  min-width: 2.75rem;
  min-height: 2.75rem;
  font: inherit;
  font-weight: 700;
  color: var(--accent-ink);
  background: var(--accent);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  cursor: pointer;
}

.stepper button {
  font-size: 1.5rem;
  line-height: 1;
}

.stepper button[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
}

.stepper input {
  width: 4.5rem;
  min-height: 2.75rem;
  font: inherit;
  font-weight: 700;
  text-align: center;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius);
}

.columns {
  display: block;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.panel[hidden] {
  display: none;
}

.ingredients {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ingredients li {
  display: flex;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
}

.ingredients li:last-child {
  border-bottom: 0;
}

.qty {
  flex: 0 0 6.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.method {
  margin: 0;
  padding-left: 1.4rem;
  max-width: 60ch;
}

.method li {
  padding-left: 0.25rem;
  margin-bottom: 0.9rem;
}

.switcher {
  display: flex;
  gap: 0.5rem;
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 0.5rem 0;
  margin-bottom: 0.75rem;
  background: var(--bg);
}

.switcher button {
  flex: 1;
  color: var(--accent);
  background: var(--surface);
}

.switcher button[aria-pressed="true"] {
  color: var(--accent-ink);
  background: var(--accent);
}

@media (min-width: 45rem) {
  .switcher {
    display: none;
  }

  .columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
    gap: 1.5rem;
    align-items: start;
  }

  .panel[hidden] {
    display: block;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
