/* ============================================================
   Ninebar — warm café-luxe minimalism
   Palette: espresso / crema gold / paper. Fraunces + Archivo.
   ============================================================ */

:root {
  --espresso: #2b1e16;
  --roast: #4a3426;
  --taupe: #8a7563;
  --crema: #c89b5a;
  --gold: #b8863b;
  --sienna: #a65e2e;
  --olive: #7d7a62;
  --paper: #faf6ef;
  --card: #f4ecdd;
  --card-deep: #ede2cd;
  --hairline: #e3d8c3;
  --white: #fffdf8;
  --serif: "Fraunces", "Georgia", serif;
  --sans: "Archivo", "Helvetica Neue", sans-serif;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(43, 30, 22, 0.06), 0 8px 28px rgba(43, 30, 22, 0.07);
  --shadow-lift: 0 2px 4px rgba(43, 30, 22, 0.08), 0 16px 44px rgba(43, 30, 22, 0.13);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--espresso);
  background:
    radial-gradient(1200px 500px at 85% -8%, rgba(200, 155, 90, 0.14), transparent 60%),
    var(--paper);
}

h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.12; letter-spacing: -0.01em; }

a { color: inherit; }

::selection { background: var(--crema); color: var(--espresso); }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px clamp(20px, 5vw, 56px);
  background: rgba(250, 246, 239, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hairline);
}
.wordmark {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--serif); font-size: 24px; font-weight: 600;
  text-decoration: none; letter-spacing: -0.01em;
}
.wordmark-gauge { color: var(--gold); }
.site-nav { display: flex; gap: clamp(14px, 3vw, 32px); }
.site-nav a {
  text-decoration: none; font-size: 14px; font-weight: 500;
  letter-spacing: 0.04em; text-transform: uppercase; color: var(--roast);
  padding: 4px 2px; border-bottom: 2px solid transparent;
  transition: border-color 0.2s, color 0.2s;
}
.site-nav a:hover { color: var(--espresso); border-bottom-color: var(--crema); }

/* ---------- hero ---------- */
.hero {
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(24px, 5vw, 64px);
  align-items: center;
  padding: clamp(48px, 9vh, 110px) clamp(20px, 6vw, 72px) clamp(40px, 7vh, 80px);
  max-width: 1240px; margin: 0 auto;
}
.hero-kicker {
  font-size: 13px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 18px;
}
.hero h1 { font-size: clamp(40px, 5.6vw, 68px); }
.hero h1 em { font-style: italic; color: var(--sienna); }
.hero-sub {
  margin-top: 22px; max-width: 54ch; font-size: 17px; color: var(--roast);
}
.hero-actions { margin-top: 32px; display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 26px; border-radius: 999px;
  font-family: var(--sans); font-size: 15px; font-weight: 600; letter-spacing: 0.01em;
  text-decoration: none; cursor: pointer; border: 1.5px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s;
}
.btn-primary { background: var(--espresso); color: var(--paper); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-lift); }
.btn-ghost { border-color: var(--espresso); color: var(--espresso); background: transparent; }
.btn-ghost:hover { background: rgba(43, 30, 22, 0.05); }
.btn-gold { background: var(--gold); color: var(--white); }
.btn-gold:hover { background: var(--sienna); transform: translateY(-1px); }
.btn-small { padding: 8px 16px; font-size: 13px; }

/* hero cup + steam */
.hero-art { display: flex; justify-content: center; }
.hero-cup { width: min(320px, 70vw); }
.hero-cup .saucer { fill: var(--card-deep); }
.hero-cup .cup-body { fill: var(--white); stroke: var(--espresso); stroke-width: 3; }
.hero-cup .cup-handle { stroke: var(--espresso); stroke-width: 3; }
.hero-cup .crema { fill: var(--crema); }
.hero-cup .crema-inner { fill: var(--gold); opacity: 0.55; }
.steam path {
  stroke: var(--taupe); stroke-width: 3; stroke-linecap: round;
  stroke-dasharray: 6 10; opacity: 0;
  animation: steam-rise 3.6s ease-in-out infinite;
}
.steam .steam-2 { animation-delay: 1.2s; }
.steam .steam-3 { animation-delay: 2.2s; }
@keyframes steam-rise {
  0%   { opacity: 0; transform: translateY(10px); }
  25%  { opacity: 0.75; }
  70%  { opacity: 0.35; }
  100% { opacity: 0; transform: translateY(-16px); }
}
@media (prefers-reduced-motion: reduce) {
  .steam path { animation: none; opacity: 0.5; }
  html { scroll-behavior: auto; }
}

/* ---------- sections ---------- */
section { max-width: 1240px; margin: 0 auto; padding: clamp(48px, 8vh, 96px) clamp(20px, 6vw, 72px); }
.section-head { max-width: 720px; margin-bottom: clamp(28px, 4vh, 48px); }
.eyebrow {
  font-size: 12px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 10px;
}
.section-head h2 { font-size: clamp(30px, 3.6vw, 44px); }
.section-sub { margin-top: 12px; color: var(--roast); font-size: 16px; }

/* ---------- finder ---------- */
.finder-section {
  border-top: 1px solid var(--hairline);
}
.finder-app {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: 18px;
  padding: clamp(24px, 4vw, 48px);
  box-shadow: var(--shadow);
  min-height: 320px;
}

.finder-progress { display: flex; align-items: center; gap: 10px; margin-bottom: 30px; flex-wrap: wrap; }
.progress-cup {
  width: 34px; height: 34px; border-radius: 50%;
  border: 2px solid var(--taupe); color: var(--taupe);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; background: transparent;
  transition: all 0.25s;
}
.progress-cup.done { background: var(--crema); border-color: var(--crema); color: var(--espresso); }
.progress-cup.active { background: var(--espresso); border-color: var(--espresso); color: var(--paper); transform: scale(1.12); }
.progress-line { flex: 0 0 22px; height: 2px; background: var(--hairline); }
.progress-label { margin-left: 8px; font-size: 13px; color: var(--taupe); font-weight: 500; letter-spacing: 0.04em; }

.finder-step h3 { font-size: clamp(22px, 2.6vw, 30px); margin-bottom: 6px; }
.finder-step .step-note { color: var(--roast); font-size: 15px; margin-bottom: 26px; max-width: 60ch; }

.option-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.option-card {
  text-align: left; cursor: pointer;
  background: var(--white); border: 1.5px solid var(--hairline); border-radius: var(--radius);
  padding: 18px 18px 16px; font-family: var(--sans);
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.option-card:hover { border-color: var(--crema); transform: translateY(-2px); box-shadow: var(--shadow); }
.option-card.selected { border-color: var(--espresso); box-shadow: inset 0 0 0 1px var(--espresso); }
.option-card .opt-title { display: block; font-weight: 600; font-size: 16px; margin-bottom: 4px; }
.option-card .opt-desc { display: block; font-size: 13.5px; color: var(--taupe); line-height: 1.45; }
.option-card .opt-price { display: inline-block; margin-top: 10px; font-size: 12.5px; font-weight: 600; color: var(--gold); letter-spacing: 0.06em; text-transform: uppercase; }

.finder-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 30px; }
.finder-back {
  background: none; border: none; cursor: pointer; font-family: var(--sans);
  font-size: 14px; font-weight: 500; color: var(--taupe); padding: 8px 4px;
}
.finder-back:hover { color: var(--espresso); }

/* brewing transition */
.brewing { text-align: center; padding: 60px 20px; }
.brewing h3 { font-size: 26px; margin-top: 24px; }
.brewing p { color: var(--taupe); margin-top: 6px; font-size: 14.5px; }
.pour {
  width: 90px; margin: 0 auto; display: block;
}
.pour .stream {
  stroke: var(--sienna); stroke-width: 5; stroke-linecap: round;
  animation: pour-stream 1.1s ease-in-out infinite;
}
.pour .pf { fill: var(--espresso); }
@keyframes pour-stream {
  0%, 100% { stroke-dashoffset: 0; opacity: 0.9; }
  50% { stroke-dashoffset: 12; opacity: 0.6; }
}

/* results */
.kit-head { margin-bottom: 26px; }
.kit-head h3 { font-size: clamp(24px, 3vw, 34px); }
.kit-head .kit-rationale { color: var(--roast); margin-top: 8px; max-width: 70ch; font-size: 15px; }
.kit-total {
  display: inline-flex; align-items: baseline; gap: 10px; margin-top: 16px;
  background: var(--espresso); color: var(--paper); border-radius: 999px; padding: 10px 22px;
}
.kit-total strong { font-family: var(--serif); font-size: 24px; font-weight: 600; }
.kit-total span { font-size: 12.5px; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.75; }

.kit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; margin-top: 8px; }
.kit-role {
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 8px;
}
.alternates { margin-top: 36px; }
.alternates h4 { font-family: var(--serif); font-size: 20px; font-weight: 500; margin-bottom: 14px; }
.restart-row { margin-top: 30px; display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- catalog ---------- */
.catalog-section { border-top: 1px solid var(--hairline); }
.catalog-layout { display: grid; grid-template-columns: 250px 1fr; gap: clamp(20px, 3vw, 40px); align-items: start; }

.filters {
  position: sticky; top: 84px;
  background: var(--card); border: 1px solid var(--hairline); border-radius: 14px;
  padding: 20px; font-size: 14px;
}
.filters h3 { font-size: 15px; font-family: var(--sans); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 4px; }
.filter-group { padding: 14px 0; border-top: 1px solid var(--hairline); }
.filter-group:first-of-type { border-top: none; padding-top: 6px; }
.filter-group > strong { display: block; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--taupe); margin-bottom: 10px; }
.filter-check { display: flex; align-items: center; gap: 9px; padding: 3.5px 0; cursor: pointer; color: var(--roast); }
.filter-check:hover { color: var(--espresso); }
.filter-check input { accent-color: var(--gold); width: 15px; height: 15px; cursor: pointer; }
.filter-check .count { margin-left: auto; font-size: 12px; color: var(--taupe); }
.filter-sub { padding-left: 14px; }
.price-row { display: flex; gap: 8px; align-items: center; }
.price-row input {
  width: 100%; padding: 8px 10px; border: 1px solid var(--hairline); border-radius: 8px;
  font-family: var(--sans); font-size: 14px; background: var(--white); color: var(--espresso);
}
.price-row input:focus { outline: 2px solid var(--crema); border-color: var(--crema); }
.filter-clear {
  margin-top: 14px; width: 100%; background: none; border: 1px solid var(--hairline);
  border-radius: 8px; padding: 8px; font-family: var(--sans); font-size: 13px; font-weight: 500;
  color: var(--roast); cursor: pointer;
}
.filter-clear:hover { border-color: var(--espresso); color: var(--espresso); }

.catalog-toolbar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin-bottom: 18px; flex-wrap: wrap;
}
.result-count { font-size: 14px; color: var(--taupe); }
.search-row { display: flex; gap: 8px; flex: 1; max-width: 380px; }
.search-row input {
  flex: 1; padding: 10px 16px; border: 1px solid var(--hairline); border-radius: 999px;
  font-family: var(--sans); font-size: 14px; background: var(--white); color: var(--espresso);
}
.search-row input:focus { outline: 2px solid var(--crema); border-color: var(--crema); }

.catalog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.loading-note { color: var(--taupe); font-style: italic; }

/* product card */
.pcard {
  background: var(--white); border: 1px solid var(--hairline); border-radius: 14px;
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s;
}
.pcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: var(--crema); }
.pcard-art { background: var(--card); border-bottom: 1px solid var(--hairline); cursor: pointer; }
.pcard-art svg { display: block; width: 100%; height: auto; }
.pcard-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.pcard-cat { font-size: 11px; font-weight: 600; letter-spacing: 0.13em; text-transform: uppercase; color: var(--gold); }
.pcard-title { font-family: var(--serif); font-size: 18.5px; font-weight: 500; line-height: 1.22; cursor: pointer; }
.pcard-title:hover { color: var(--sienna); }
.pcard-shop { font-size: 12.5px; color: var(--taupe); }
.pcard-rating { font-size: 13px; color: var(--roast); display: flex; align-items: center; gap: 6px; }
.stars { color: var(--gold); letter-spacing: 1.5px; font-size: 13px; }
.pcard-usp { font-size: 13.5px; color: var(--roast); line-height: 1.5; flex: 1; }
.pcard-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; gap: 8px; }
.pcard-price { font-family: var(--serif); font-size: 20px; font-weight: 600; }
.pcard-price .from { font-family: var(--sans); font-size: 11px; color: var(--taupe); font-weight: 500; display: block; letter-spacing: 0.06em; text-transform: uppercase; }
.pcard-actions { display: flex; gap: 8px; align-items: center; }
.compare-toggle {
  background: none; border: 1px solid var(--hairline); border-radius: 8px;
  font-family: var(--sans); font-size: 12px; font-weight: 500; color: var(--roast);
  padding: 7px 10px; cursor: pointer; transition: all 0.15s;
}
.compare-toggle:hover { border-color: var(--gold); color: var(--gold); }
.compare-toggle.in-tray { background: var(--crema); border-color: var(--crema); color: var(--espresso); }

/* ---------- compare tray ---------- */
.compare-tray {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%);
  z-index: 60; display: flex; align-items: center; gap: 14px;
  background: var(--espresso); color: var(--paper);
  border-radius: 999px; padding: 10px 12px 10px 22px;
  box-shadow: var(--shadow-lift); max-width: min(94vw, 640px);
}
.compare-tray .tray-label { font-size: 13.5px; font-weight: 500; white-space: nowrap; }
.compare-tray .tray-items { display: flex; gap: 6px; overflow: hidden; }
.tray-chip {
  background: rgba(250, 246, 239, 0.14); border-radius: 999px; padding: 5px 12px;
  font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px;
  display: inline-flex; align-items: center; gap: 7px;
}
.tray-chip button { background: none; border: none; color: var(--crema); cursor: pointer; font-size: 14px; line-height: 1; padding: 0; }

/* ---------- modals ---------- */
.compare-modal, .product-modal {
  border: none; border-radius: 18px; padding: 0;
  width: min(94vw, 900px); max-height: 88vh;
  background: var(--paper); color: var(--espresso);
  box-shadow: var(--shadow-lift);
}
.compare-modal::backdrop, .product-modal::backdrop { background: rgba(43, 30, 22, 0.5); backdrop-filter: blur(3px); }
.modal-inner { padding: clamp(20px, 4vw, 40px); }
.modal-head { display: flex; justify-content: space-between; align-items: start; gap: 16px; margin-bottom: 20px; }
.modal-head h3 { font-size: clamp(22px, 3vw, 30px); }
.modal-close {
  background: var(--card); border: 1px solid var(--hairline); border-radius: 50%;
  width: 38px; height: 38px; font-size: 17px; cursor: pointer; color: var(--espresso); flex-shrink: 0;
}
.modal-close:hover { background: var(--card-deep); }

.spec-table-wrap { overflow-x: auto; }
.spec-table { border-collapse: collapse; width: 100%; font-size: 14px; min-width: 560px; }
.spec-table th, .spec-table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--hairline); vertical-align: top; }
.spec-table thead th { font-family: var(--serif); font-size: 16.5px; font-weight: 600; }
.spec-table tbody th { font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--taupe); font-weight: 600; white-space: nowrap; }
.spec-table .spec-price { font-family: var(--serif); font-size: 18px; font-weight: 600; }

.product-modal .pm-grid { display: grid; grid-template-columns: 260px 1fr; gap: 28px; }
.product-modal .pm-art { background: var(--card); border: 1px solid var(--hairline); border-radius: 14px; overflow: hidden; align-self: start; }
.product-modal .pm-art svg { display: block; width: 100%; height: auto; }
.pm-shop { font-size: 13px; color: var(--taupe); margin-bottom: 10px; }
.pm-desc { font-size: 15px; color: var(--roast); margin: 12px 0 16px; }
.pm-lists { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.pm-lists h4 { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--taupe); margin-bottom: 8px; }
.pm-lists ul { list-style: none; font-size: 13.5px; color: var(--roast); }
.pm-lists li { padding: 3.5px 0 3.5px 16px; position: relative; }
.pm-lists li::before { content: ""; position: absolute; left: 0; top: 11px; width: 7px; height: 7px; border-radius: 50%; background: var(--crema); }
.pm-buy-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 4px; }
.pm-price { font-family: var(--serif); font-size: 28px; font-weight: 600; }
.pm-variant-select {
  padding: 10px 14px; border: 1px solid var(--hairline); border-radius: 8px;
  font-family: var(--sans); font-size: 14px; background: var(--white); color: var(--espresso);
}

/* ---------- guide ---------- */
.guide-section { border-top: 1px solid var(--hairline); }
.guide-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }
.guide-card {
  background: var(--card); border: 1px solid var(--hairline); border-radius: 16px;
  padding: clamp(22px, 3vw, 34px);
}
.guide-card h3 { font-size: 21px; margin-bottom: 14px; }
.guide-card p { font-size: 14.5px; color: var(--roast); line-height: 1.68; }
.guide-card p + p { margin-top: 12px; }
.guide-card strong { color: var(--espresso); font-weight: 600; }

/* ---------- faq ---------- */
.faq-section { border-top: 1px solid var(--hairline); }
.faq-list { max-width: 780px; }
.faq-list details { border-bottom: 1px solid var(--hairline); }
.faq-list summary {
  cursor: pointer; list-style: none;
  font-family: var(--serif); font-size: 18px; font-weight: 500;
  padding: 20px 40px 20px 0; position: relative;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: "+"; position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  font-family: var(--sans); font-size: 22px; color: var(--gold); transition: transform 0.2s;
}
.faq-list details[open] summary::after { content: "–"; }
.faq-list details p { padding: 0 0 22px; color: var(--roast); font-size: 15px; max-width: 70ch; }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--hairline); margin-top: 40px;
  padding: 40px clamp(20px, 6vw, 72px) 56px;
  display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap;
  max-width: 1240px; margin-left: auto; margin-right: auto;
}
.wordmark-footer { font-family: var(--serif); font-size: 22px; font-weight: 600; }
.site-footer p { font-size: 13px; color: var(--taupe); max-width: 46ch; margin-top: 8px; }
.site-footer nav { display: flex; gap: 20px; flex-wrap: wrap; align-items: start; }
.site-footer nav a { font-size: 13.5px; color: var(--roast); text-decoration: none; }
.site-footer nav a:hover { color: var(--espresso); }

.noscript-note { color: var(--roast); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; text-align: left; }
  .hero-art { order: -1; }
  .hero-cup { width: min(220px, 55vw); }
  .catalog-layout { grid-template-columns: 1fr; }
  .filters { position: static; }
  .product-modal .pm-grid { grid-template-columns: 1fr; }
  .product-modal .pm-art { max-width: 280px; }
  .pm-lists { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .site-nav a { font-size: 12.5px; }
  .compare-tray { bottom: 10px; padding-left: 16px; }
  .tray-chip { max-width: 96px; }
  .option-grid { grid-template-columns: 1fr; }
}
