:root {
  color-scheme: light dark;
  --page: light-dark(#fcfbfe, #15121b);
  --surface: light-dark(#fff, #201b29);
  --purple: light-dark(#590085, #d6aff4);
  --accent-hover: light-dark(#440066, #e6c6ff);
  --on-accent: light-dark(#fff, #251431);
  --ink: light-dark(#23162d, #f1eaf6);
  --muted: light-dark(#706779, #bcb0c9);
  --line: light-dark(#e8e1ec, #40354b);
  --control-line: light-dark(#d5c5df, #776589);
  --lavender: light-dark(#f2ebf8, #2d243a);
  --focus: light-dark(#9f60c7, #ddadff);
  --shadow: light-dark(#260b3820, #0006);
  --error-text: light-dark(#8e173b, #ffb4c4);
  --error-background: light-dark(#fff0f4, #392130);
  --error-line: light-dark(#efc7d3, #805065);
  --serif: Georgia, "Times New Roman", serif;
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--ink);
  font-size: 16px;
  background: var(--page);
  scroll-behavior: smooth;
  scroll-padding-top: 1rem;
}
:root[data-theme="light"] {
  color-scheme: light;
}
:root[data-theme="dark"] {
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
a {
  color: var(--purple);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
textarea,
select {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: wait;
  opacity: 0.6;
}
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}
[hidden] {
  display: none !important;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 400;
}
h1 {
  font-size: clamp(2.8rem, 6.1vw, 5.4rem);
  line-height: 1.06;
  letter-spacing: -0.045em;
}
h2 {
  font-size: clamp(2rem, 3.4vw, 3rem);
  line-height: 1.14;
  letter-spacing: -0.035em;
}
h3 {
  font-size: 1.5rem;
  line-height: 1.24;
}
p {
  line-height: 1.7;
}
em {
  color: var(--purple);
}
.skip {
  position: absolute;
  left: 1rem;
  top: -5rem;
  padding: 1rem;
  background: var(--surface);
  z-index: 10;
}
.skip:focus {
  top: 1rem;
}
.eyebrow {
  font-family: system-ui, sans-serif;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  line-height: 1.5;
  color: var(--purple);
}
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.8rem 1.2rem;
  border: 1px solid var(--purple);
  border-radius: 7px;
  background: var(--purple);
  color: var(--on-accent);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.3;
}
.button:hover {
  background: var(--accent-hover);
}
.button.secondary {
  background: var(--surface);
  color: var(--purple);
  border-color: var(--control-line);
}
.button.light {
  background: var(--surface);
  color: var(--purple);
  border-color: var(--surface);
}
.text-link {
  display: block;
  width: fit-content;
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0.75rem 0;
}
.site-header {
  max-width: 1280px;
  margin: auto;
  min-height: 106px;
  padding: 1.5rem 3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.35;
}
.brand b {
  display: block;
  font-weight: 650;
}
.site-header nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}
.site-header nav a {
  font-size: 0.9rem;
  color: var(--ink);
  text-decoration: none;
}
.site-header nav a:hover {
  text-decoration: underline;
}
.site-header nav .account-link {
  border: 1px solid var(--control-line);
  padding: 0.65rem 0.9rem;
  border-radius: 6px;
  color: var(--purple);
}
.theme-select {
  min-height: 44px;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--control-line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.875rem;
  cursor: pointer;
}
.theme-select:hover {
  background: var(--lavender);
}
main {
  max-width: 1280px;
  margin: auto;
  padding: 0 3rem;
}
.hero {
  padding: 4.5rem 0 4rem;
}
.hero h1 {
  margin: 1.1rem 0 1.6rem;
}
.hero-copy {
  max-width: 480px;
  color: var(--muted);
  font-size: 1.05rem;
}
.library {
  border-top: 1px solid var(--line);
  padding: 3rem 0;
}
.section-title {
  margin-bottom: 0.75rem;
}
.section-title h2 {
  margin: 0;
}
.section-title .eyebrow {
  margin-bottom: 0.6rem;
}
.recipe-controls {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 0.75rem 0 0.65rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--line);
  background: var(--page);
}
.recipe-controls-row {
  display: flex;
  align-items: end;
  gap: 1rem;
}
.recipe-search {
  flex: 1;
  min-width: 0;
}
.recipe-controls .sort-label {
  padding-bottom: 0.35rem;
}
.sort-label {
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-shrink: 0;
}
.sort-label select {
  font-size: 0.875rem;
  color: var(--ink);
  border: 1px solid var(--control-line);
  border-radius: 6px;
  padding: 0.65rem 0.7rem;
  background: var(--surface);
}
.search-label {
  display: block;
  font-size: 0.875rem;
  margin-bottom: 0.6rem;
  font-weight: 600;
}
.search-box {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  background: var(--surface);
  border: 1px solid var(--control-line);
  border-radius: 8px;
  padding: 0.8rem 1rem;
}
.search-box:focus-within {
  outline: 2px solid var(--purple);
  outline-offset: 2px;
}
.search-box svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: var(--purple);
  stroke-width: 1.7;
  flex-shrink: 0;
}
.search-box input {
  border: 0;
  outline: none;
  min-width: 0;
  flex: 1;
  font-size: 1rem;
  background: none;
  color: var(--ink);
  min-height: 28px;
}
.search-box input::placeholder,
.field input::placeholder,
.field textarea::placeholder {
  color: var(--muted);
}
.search-box kbd {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 7px;
  color: var(--muted);
  font-size: 0.8rem;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.8rem 0 0.65rem;
}
.filter {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
  color: var(--ink);
  font-size: 0.875rem;
  min-height: 40px;
}
.filter span {
  font-size: 0.75rem;
  margin-left: 0.4rem;
  opacity: 0.75;
}
.filter.active {
  background: var(--purple);
  border-color: var(--purple);
  color: var(--on-accent);
}
.filter:hover:not(.active) {
  background: var(--lavender);
}
.results-count {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0;
}
.recipe-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.recipe-card {
  background: var(--surface);
  position: relative;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.6rem;
  display: flex;
  flex-direction: column;
  min-height: 240px;
  transition:
    transform 0.15s,
    border-color 0.15s,
    box-shadow 0.15s;
}
.recipe-card:hover {
  transform: translateY(-3px);
  border-color: var(--control-line);
  box-shadow: 0 8px 22px var(--shadow);
}
.category-label {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 650;
  color: var(--purple);
  margin-bottom: 1.4rem;
}
.recipe-card h3 {
  font-size: 1.65rem;
  margin-bottom: 0.7rem;
}
.recipe-card h3 a {
  color: var(--ink);
  text-decoration: none;
}
.recipe-card h3 a:after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 10px;
}
.recipe-card h3 a:focus-visible {
  outline: none;
}
.recipe-card:focus-within {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
.recipe-card p {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
}
.card-bottom {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--line);
  padding-top: 0.85rem;
  font-size: 0.75rem;
  color: var(--muted);
}
.empty-state {
  text-align: center;
  padding: 3rem;
}
.empty-state p {
  color: var(--muted);
}
footer {
  max-width: 1280px;
  padding: 1.8rem 3rem;
  margin: auto;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.8rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
}
.recipe-page {
  max-width: 1000px;
  padding-top: 2.5rem;
  padding-bottom: 4rem;
}
.back-link {
  font-size: 0.9rem;
}
.recipe-heading {
  padding: 2.5rem 0 2rem;
  border-bottom: 1px solid var(--line);
}
.recipe-heading h1 {
  font-size: clamp(2.7rem, 5vw, 4.3rem);
  margin: 0.75rem 0 1.5rem;
}
.recipe-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.recipe-content {
  max-width: 800px;
  margin: 2rem auto 0;
}
.recipe-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1.5rem;
  margin: 0 0 2.5rem;
  padding: 1.4rem;
  background: var(--lavender);
  border-radius: 8px;
}
.recipe-facts dt {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}
.recipe-facts dd {
  margin: 0;
  font-weight: 600;
  font-size: 1rem;
}
.recipe-content h2 {
  font-size: 2rem;
  margin: 2.5rem 0 1rem;
  color: var(--purple);
}
.recipe-content h3,
.recipe-content h4 {
  font-family: system-ui, sans-serif;
  font-weight: 600;
  color: var(--purple);
  margin: 1.35rem 0 0.6rem;
}
.recipe-content h3 {
  font-size: 1.3rem;
}
.recipe-content h4 {
  font-size: 1.05rem;
}
.equipment-details {
  margin: 0;
}
.equipment-details > div {
  display: grid;
  grid-template-columns: minmax(5rem, 1fr) minmax(0, 2fr);
  gap: 1rem;
  padding: .85rem 0;
  border-bottom: 1px solid var(--line);
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.equipment-details dt {
  font-weight: 600;
}
.equipment-details dd {
  margin: 0;
}
.recipe-equipment {
  margin-top: 1.5rem;
}
.recipe-equipment h2 {
  font-size: 1.35rem;
  margin-bottom: .6rem;
}
.recipe-equipment ul {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.25rem;
  padding: 0;
  margin: 0;
  list-style: none;
}
.recipe-content p,
.recipe-content li {
  font-size: 1rem;
  line-height: 1.8;
}
.ingredients {
  list-style: none;
  padding: 1.2rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.ingredients li {
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
}
.ingredients li:last-child {
  border: 0;
}
.directions {
  padding-left: 1.8rem;
}
.directions li {
  padding-left: 0.5rem;
  margin-bottom: 1.15rem;
}
.directions li::marker {
  font-weight: 700;
  color: var(--purple);
}
.recipe-table-scroll {
  overflow-x: auto;
  margin: 1.5rem 0;
}
.recipe-table {
  width: 100%;
  min-width: 28rem;
  border-collapse: collapse;
  font-size: 0.95rem;
  background: var(--surface);
}
.recipe-table th,
.recipe-table td {
  padding: 0.65rem;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.equipment-table {
  min-width: 0;
  overflow-wrap: anywhere;
}
.equipment-table th:first-child {
  width: 45%;
}
.recipe-table thead {
  background: var(--lavender);
}
.notice {
  padding: 1rem 1.2rem;
  border: 1px solid var(--control-line);
  border-radius: 8px;
  background: var(--lavender);
  line-height: 1.6;
}
.error {
  color: var(--error-text);
  background: var(--error-background);
  border-color: var(--error-line);
}
