:root {
  --ink: #24291f;
  --paper: #ede8da;
  --paper-raised: #f5f1e6;
  --amber: #b8793a;
  --matcha: #5b6b45;
  --rust: #8b4438;
  --line: #d9d0bc;

  --serif: "Fraunces", Georgia, serif;
  --sans: "Work Sans", -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.5;
}

.wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2 {
  font-family: var(--serif);
  font-weight: 600;
  margin: 0 0 0.4em;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); line-height: 1.08; }
h1 em { font-style: italic; font-weight: 500; color: var(--amber); }
h2 { font-size: 1.6rem; }

p { margin: 0 0 1em; max-width: 62ch; }

a { color: var(--rust); }

/* --- Header --- */

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 5;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  padding-bottom: 16px;
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 30px; height: 30px; }
.brand-name { font-family: var(--serif); font-weight: 600; font-size: 1.15rem; }

.site-nav { display: flex; gap: 24px; }
.site-nav a { color: var(--ink); text-decoration: none; font-size: 0.95rem; border-bottom: 1px solid transparent; }
.site-nav a:hover { border-color: var(--amber); }

/* --- Hero --- */

.hero {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 32px;
  align-items: center;
  padding-top: 64px;
  padding-bottom: 56px;
}

.hero-sub { color: #4a4f42; }

.btn {
  display: inline-block;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  padding: 12px 22px;
  border-radius: 3px;
  font-size: 0.95rem;
  margin-top: 8px;
}
.btn:hover { background: var(--rust); }

.hero-art svg { width: 100%; height: auto; max-width: 280px; margin: 0 auto; display: block; }

/* --- Catalog section --- */

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
  margin-bottom: 8px;
}

.filters { display: flex; gap: 8px; flex-wrap: wrap; }

.filter-btn {
  font-family: var(--sans);
  font-size: 0.85rem;
  background: none;
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
}
.filter-btn.active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.catalog { padding-top: 48px; padding-bottom: 8px; }

.loading { color: #7a7a6d; font-style: italic; }

.shelf-row {
  display: grid;
  grid-template-columns: 14px 1.4fr 2.4fr auto;
  gap: 20px;
  align-items: start;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.shelf-row:hover .tea-name { color: var(--rust); }

.type-swatch {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-top: 8px;
}
.type-green { background: var(--matcha); }
.type-black { background: var(--rust); }
.type-oolong { background: var(--amber); }
.type-white { background: #cfc9b4; }
.type-herbal { background: #a9975f; }
.type-pu-erh { background: #5a3a2a; }

.tea-name {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
}
.tea-origin { font-size: 0.85rem; color: #6d7160; margin-top: 2px; }

.tea-desc { font-size: 0.95rem; color: #4a4f42; margin: 0; }
.tea-meta { text-align: right; font-size: 0.85rem; color: #6d7160; white-space: nowrap; }
.tea-meta .rating { color: var(--amber); font-weight: 600; display: block; }

/* --- Brewing guide --- */

.guide { padding-top: 40px; padding-bottom: 72px; }

.guide-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.guide-steps li { display: flex; gap: 16px; align-items: flex-start; }
.step-num {
  font-family: var(--serif);
  font-weight: 600;
  color: var(--amber);
  border: 1px solid var(--line);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  min-width: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}
.guide-steps div { padding-top: 2px; }

/* --- Modal --- */

.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(36, 41, 31, 0.5);
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 20;
}
.modal-backdrop.open { display: flex; }

.modal {
  background: var(--paper-raised);
  border-radius: 6px;
  max-width: 560px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 32px;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  color: var(--ink);
}

.modal h3 { font-family: var(--serif); font-size: 1.5rem; margin: 0 0 4px; }
.modal .tea-origin { margin-bottom: 14px; }

.stat-row { display: flex; gap: 20px; margin: 16px 0; font-size: 0.9rem; }
.stat-row div strong { display: block; font-family: var(--serif); font-size: 1.1rem; }

.review-list { list-style: none; margin: 16px 0; padding: 0; border-top: 1px solid var(--line); }
.review-list li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.review-author { font-weight: 600; font-size: 0.9rem; }
.review-rating { color: var(--amber); font-size: 0.85rem; margin-left: 6px; }
.review-note { margin: 4px 0 0; font-size: 0.92rem; }

.review-form { margin-top: 20px; display: grid; gap: 10px; }
.review-form input,
.review-form select,
.review-form textarea {
  font-family: var(--sans);
  font-size: 0.9rem;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--paper);
  color: var(--ink);
}
.review-form textarea { min-height: 70px; resize: vertical; }
.review-form button {
  justify-self: start;
  background: var(--matcha);
  color: var(--paper);
  border: none;
  padding: 10px 18px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.9rem;
}
.review-form button:hover { background: var(--ink); }
.form-message { font-size: 0.85rem; color: var(--matcha); min-height: 1em; }

/* --- Footer --- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 24px 0;
  font-size: 0.85rem;
  color: #6d7160;
}

/* --- Responsive --- */

@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; padding-top: 40px; }
  .hero-art { order: -1; }
  .shelf-row { grid-template-columns: 12px 1fr; }
  .tea-desc, .tea-meta { grid-column: 2 / 3; }
  .tea-meta { text-align: left; margin-top: 4px; }
}

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

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