:root {
  --paper: #f8f7f2;
  --ink: #1d3028;
  --muted: #616d63;
  --line: #d9dcd1;
  --forest: #223e30;
  --serif:
    "Baskerville", "Times New Roman", "Noto Serif SC", "Songti SC",
    "STZhongsong", "SimSun", serif;
  font-family:
    "DM Sans", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input {
  font: inherit;
}
button,
a,
input,
label {
  touch-action: manipulation;
}
button {
  cursor: pointer;
  color: inherit;
}
button {
  border: 0;
  background: none;
}
a {
  color: inherit;
}
a,
button,
input,
label {
  -webkit-tap-highlight-color: transparent;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
.ingredient:has(input:focus-visible) {
  outline: 3px solid #aa7d34;
  outline-offset: 3px;
}
button:disabled {
  cursor: default;
}
[hidden] {
  display: none !important;
}
h1,
h2,
h3,
p {
  margin: 0;
}
svg {
  width: 19px;
  height: 19px;
  vertical-align: middle;
  flex: none;
}
.wrap {
  width: min(1280px, 90%);
  margin-inline: auto;
}
.mast {
  border-bottom: 1px solid var(--line);
}
.topbar {
  min-height: 76px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font: 600 31px/1 var(--serif);
  letter-spacing: -1.4px;
}
.brand i,
footer i {
  font-weight: 400;
}
.brand-icon {
  background: var(--forest);
  color: #f3e4b7;
  border-radius: 50%;
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
}
.brand-icon svg {
  width: 25px;
  height: 25px;
}
.topbar nav {
  display: flex;
  gap: 6px;
}
.topbar nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 24px;
  color: var(--muted);
}
.topbar nav a[aria-current="page"] {
  background: #e4ebdf;
  color: #294b38;
}
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 380px;
  margin-top: 30px;
  border-radius: 18px;
  background: #162b22;
  color: white;
  display: flex;
  align-items: center;
}
.hero > img {
  width: 64%;
  height: 100%;
  position: absolute;
  right: 0;
  top: 0;
  z-index: -3;
  object-fit: cover;
  object-position: center 29%;
}
.hero:before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background: linear-gradient(
    90deg,
    #192f25 0%,
    #192f25 34%,
    rgba(25, 47, 37, 0.94) 40%,
    rgba(25, 47, 37, 0.42) 54%,
    transparent 75%
  );
}
.hero-content {
  width: 54%;
  padding: 38px clamp(28px, 4.4vw, 72px);
}
.hero-label,
.eyebrow,
.card-en {
  font:
    600 12px/1.4 Georgia,
    var(--serif);
  letter-spacing: 1.7px;
}
.hero-label {
  color: #f2ddb0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 3px;
}
.hero-label span {
  height: 1px;
  width: 28px;
  background: #ccb47b;
}
.hero h1 {
  font: 600 clamp(44px, 4.5vw, 67px) / 1.16 var(--serif);
  letter-spacing: 0.035em;
  margin-top: 17px;
}
.hero #hero-english {
  font: italic 32px/1.22 var(--serif);
  color: #e0cba1;
  margin-top: 3px;
}
.hero p {
  color: #e2e8db;
  font-size: 14px;
  line-height: 1.8;
  max-width: 360px;
  margin-top: 15px;
}
.recipe-link {
  background: #f4ebd8;
  border-radius: 7px;
  color: #243c2d;
  padding: 12px 19px;
  display: inline-flex;
  align-items: center;
  gap: 18px;
  font-size: 14px;
  font-weight: 650;
  margin-top: 23px;
}
.recipe-link:hover {
  background: white;
}
.hero-controls {
  position: absolute;
  right: 23px;
  bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.hero-controls > span {
  font:
    12px Georgia,
    serif;
  letter-spacing: 2px;
  background: #1b281dc9;
  border-radius: 20px;
  padding: 6px 9px;
}
.hero-controls button {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background: #14251caa;
  border: 1px solid #ffffff85;
  color: white;
  display: grid;
  place-items: center;
}
.hero-controls svg {
  width: 15px;
  height: 15px;
}
.catalog {
  margin-top: 39px;
}
.catalog-head,
.filterbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.catalog-head h2,
#pantry h1 {
  font: 650 clamp(29px, 3vw, 39px) / 1.3 var(--serif);
  letter-spacing: 0.035em;
}
.search {
  display: flex;
  gap: 10px;
  align-items: center;
  width: 277px;
  background: #fffefa;
  border: 1px solid #d4d8ce;
  border-radius: 9px;
  padding: 0 13px;
  height: 41px;
  color: #6d796f;
}
.search:focus-within {
  border-color: #3b664c;
}
.search input {
  min-width: 0;
  width: 100%;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--ink);
  font-size: 13px;
}
.filterbar {
  margin: 19px 0 21px;
}
.filterbar > span {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}
#filters {
  display: flex;
  gap: 8px;
}
#filters button {
  border-radius: 22px;
  border: 1px solid var(--line);
  background: transparent;
  padding: 7px 17px;
  font-size: 13px;
  min-height: 34px;
}
#filters button[aria-pressed="true"] {
  background: var(--forest);
  border-color: var(--forest);
  color: white;
}
.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}
.card {
  text-align: left;
  border-radius: 13px;
  background: #fffefa;
  border: 1px solid var(--line);
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition:
    transform 0.18s,
    box-shadow 0.18s;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 22px #1d302815;
}
.card-photo {
  position: relative;
  aspect-ratio: 1.85;
  width: 100%;
  overflow: hidden;
  background: #33483b;
}
.card-photo img,
.detail-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 46%;
  display: block;
}
.base {
  position: absolute;
  top: 13px;
  left: 14px;
  background: #f7f4e9eb;
  color: #28372a;
  padding: 4px 10px;
  border-radius: 16px;
  font-size: 11px;
  font-weight: 650;
}
.card-body {
  position: relative;
  padding: 18px 21px 20px;
  width: 100%;
}
.card-en,
.eyebrow {
  color: #776445;
  letter-spacing: 1.9px;
  text-transform: uppercase;
  font-size: 11px;
}
.card h3 {
  font: 650 26px/1.4 var(--serif);
  margin: 3px 0 9px;
}
.meta {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.meta svg {
  width: 14px;
  height: 14px;
}
.card-arrow {
  position: absolute;
  right: 19px;
  bottom: 20px;
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border: 1px solid var(--line);
  border-radius: 50%;
}
.card-arrow svg {
  width: 15px;
}
.missing {
  margin-top: 10px;
  font-size: 13px;
  color: #89601c;
}
.empty {
  padding: 45px 20px;
  background: #eeefe7;
  border-radius: 12px;
  text-align: center;
  color: var(--muted);
}
footer {
  border-top: 1px solid var(--line);
  margin-top: 45px;
  padding: 22px 0 30px;
  display: flex;
  gap: 14px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}
footer span:first-child {
  font: 600 20px var(--serif);
  color: var(--ink);
  letter-spacing: -0.8px;
}
#pantry {
  margin-top: 30px;
  padding: 30px clamp(22px, 4vw, 48px);
  border: 1px solid #ccdac9;
  border-radius: 18px;
  background: #eaf0e5;
}
.pantry-head,
.pantry-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.pantry-head p {
  color: #4c5e4d;
  font-size: 15px;
  margin-top: 8px;
}
.pantry-icon svg {
  width: 43px;
  height: 43px;
  color: #668166;
}
fieldset {
  margin: 21px 0 12px;
  border: 0;
  padding: 0;
  position: relative;
}
legend {
  padding: 0;
  font-weight: 650;
  font-size: 15px;
}
.pantry-tools {
  position: absolute;
  right: 0;
  top: -23px;
  font-size: 12px;
}
.pantry-tools button {
  text-decoration: underline;
  text-underline-offset: 3px;
  min-height: 28px;
  padding: 3px;
}
#ingredients {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 15px;
}
.ingredient {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #c4d0c1;
  border-radius: 8px;
  padding: 10px 15px;
  background: #fafbf7;
  cursor: pointer;
  font-size: 14px;
}
.ingredient input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.ingredient:has(input:checked) {
  background: var(--forest);
  color: white;
  border-color: var(--forest);
}
.checkbox {
  width: 15px;
  height: 15px;
  border: 1px solid #a2b09e;
  border-radius: 3px;
}
.checkbox svg {
  width: 12px;
  height: 12px;
  display: none;
  vertical-align: top;
}
.ingredient input:checked + .checkbox svg {
  display: block;
}
#pantry small {
  font-size: 12px;
  color: var(--muted);
}
.modal-open {
  overflow: hidden;
}
dialog {
  margin: auto;
  padding: 0;
  width: min(720px, 94vw);
  max-height: 90vh;
  max-height: 90dvh;
  overflow: auto;
  overscroll-behavior: contain;
  border: 0;
  border-radius: 17px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 25px 90px #06150c55;
}
dialog::backdrop {
  background: #101b15ae;
}
.close {
  position: sticky;
  float: right;
  top: 12px;
  margin: 12px 12px -50px 0;
  z-index: 2;
  border: 1px solid #ddd9cf;
  background: #f9f7f0;
  width: 37px;
  height: 37px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.detail-photo {
  height: 185px;
  overflow: hidden;
}
.detail-copy {
  padding: 24px 32px;
}
.detail-copy h2 {
  font: 650 34px/1.4 var(--serif);
  margin: 3px 0;
}
.detail-copy > p {
  font-size: 14px;
  line-height: 1.75;
  color: var(--muted);
}
.detail-columns {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 28px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
  margin-top: 20px;
}
.detail-copy h3 {
  font: 650 21px var(--serif);
  margin-bottom: 10px;
}
.detail-copy h3 small {
  font: 12px sans-serif;
  color: var(--muted);
}
.amounts {
  list-style: none;
  padding: 0;
  margin: 0;
}
.amounts li {
  display: flex;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px dotted var(--line);
  font-size: 14px;
}
.amounts strong {
  font-weight: 600;
}
.fine,
.detail-copy .detail-version {
  font-size: 12px;
  line-height: 1.65;
  color: var(--muted);
  margin-top: 10px;
}
.detail-copy ol {
  padding-left: 21px;
  margin: 0;
}
.detail-copy ol li {
  font-size: 14px;
  line-height: 1.75;
  margin: 0 0 9px;
  padding-left: 2px;
}
.detail-version {
  border-top: 1px solid var(--line);
  padding-top: 13px;
}
.detail-version a {
  white-space: nowrap;
}
@media (max-width: 900px) {
  .cards {
    gap: 16px;
  }
  .hero {
    min-height: 335px;
  }
  .hero-content {
    padding: 32px;
  }
  .hero h1 {
    font-size: 46px;
  }
  .hero p {
    font-size: 13px;
  }
  .card-body {
    padding: 15px;
  }
  .card-arrow {
    right: 12px;
    bottom: 16px;
  }
}
@media (max-width: 700px) {
  .wrap {
    width: calc(100% - 32px);
  }
  .topbar {
    min-height: 64px;
    gap: 8px;
  }
  .brand {
    font-size: 24px;
    gap: 7px;
  }
  .brand-icon {
    width: 30px;
    height: 30px;
  }
  .brand-icon svg {
    width: 21px;
    height: 21px;
  }
  .topbar nav {
    gap: 1px;
  }
  .topbar nav a {
    padding: 9px;
    font-size: 12px;
    gap: 5px;
  }
  .topbar nav svg {
    width: 15px;
    height: 15px;
  }
  .hero {
    min-height: 315px;
    margin-top: 17px;
    border-radius: 13px;
  }
  .hero > img {
    width: 82%;
    object-position: 57% center;
  }
  .hero:before {
    background: linear-gradient(
      90deg,
      #192f25 0%,
      #192f25 19%,
      #192f25b3 47%,
      #192f251a 100%
    );
  }
  .hero-content {
    width: 75%;
    padding: 25px 20px 32px;
  }
  .hero h1 {
    font-size: 40px;
    margin-top: 14px;
  }
  .hero #hero-english {
    font-size: 25px;
  }
  .hero p {
    font-size: 13px;
    max-width: 205px;
    line-height: 1.7;
  }
  .hero-label {
    font-size: 12px;
  }
  .hero-controls {
    right: 12px;
    bottom: 13px;
    gap: 5px;
  }
  .hero-controls button {
    width: 31px;
    height: 31px;
  }
  .hero-controls > span {
    font-size: 10px;
    letter-spacing: 0.7px;
  }
  .recipe-link {
    font-size: 13px;
    padding: 10px 13px;
    margin-top: 16px;
  }
  .catalog {
    margin-top: 26px;
  }
  .catalog-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 13px;
  }
  .search {
    width: 100%;
    height: 42px;
  }
  .filterbar {
    margin: 13px 0 16px;
    gap: 8px;
  }
  #filters {
    gap: 6px;
  }
  #filters button {
    padding: 6px 13px;
  }
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .card {
    border-radius: 10px;
  }
  .card-photo {
    aspect-ratio: 1.28;
  }
  .base {
    top: 8px;
    left: 8px;
    font-size: 10px;
    padding: 3px 8px;
  }
  .card-en {
    font-size: 9px;
    letter-spacing: 1px;
  }
  .card h3 {
    font-size: 21px;
    margin: 4px 0 6px;
  }
  .card-body {
    padding: 12px 10px;
  }
  .card-arrow {
    display: none;
  }
  .meta {
    font-size: 11px;
    gap: 4px;
  }
  .meta svg {
    width: 11px;
  }
  .filterbar > span {
    font-size: 12px;
  }
  #pantry {
    margin-top: 17px;
    padding: 22px 16px;
  }
  .pantry-head p {
    font-size: 13px;
  }
  .pantry-icon {
    display: none;
  }
  .ingredient {
    padding: 10px 12px;
  }
  .detail-columns {
    grid-template-columns: 1fr;
    gap: 19px;
  }
  .detail-photo {
    height: 145px;
  }
  .detail-copy {
    padding: 20px;
  }
  .detail-copy h2 {
    font-size: 30px;
  }
  footer {
    margin-top: 27px;
  }
}
@media (max-width: 365px) {
  .brand {
    font-size: 21px;
  }
  .topbar nav a {
    padding: 8px 5px;
  }
  .topbar nav svg {
    display: none;
  }
  .cards {
    gap: 8px;
  }
  .meta {
    gap: 3px;
  }
  .hero-count {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
