@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,700&family=Space+Grotesk:wght@400;500;700&display=swap');

:root {
  --bg: #f6f1e9;
  --paper: #fff9f1;
  --ink: #27170f;
  --muted: #6f5648;
  --line: #d7c1b1;
  --accent: #1b7e7a;
  --coffee: #4a2c1d;
  --coffee-top: #6a412a;
  --chip: #ead5c4;
  --shadow: 0 12px 30px rgba(39, 23, 15, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: var(--ink);
  min-height: 100vh;
  background:
    radial-gradient(circle at 90% 10%, #f2e3d6 0, transparent 30%),
    radial-gradient(circle at 10% 0%, #efe2d6 0, transparent 35%),
    linear-gradient(180deg, #fcf8f3 0%, var(--bg) 65%);
}

a {
  color: inherit;
}

.site-shell {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 20px 36px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(10px);
  background: rgba(252, 247, 241, 0.9);
  border-bottom: 1px solid rgba(215, 193, 177, 0.8);
}

.topbar-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.3rem;
  letter-spacing: 0.01em;
  text-decoration: none;
}

.nav {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.nav-link {
  text-decoration: none;
  padding: 9px 12px;
  border-radius: 999px;
  color: var(--muted);
  border: 1px solid transparent;
  font-size: 0.94rem;
}

.nav-link:hover,
.nav-link.active {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

.hero {
  padding: 42px 0 20px;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
  align-items: center;
}

.hero h1,
.page-title {
  margin: 0 0 14px;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(2rem, 4.3vw, 3.5rem);
  line-height: 1.05;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  max-width: 62ch;
}

.hero-card,
.panel,
.library,
.source-box {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 20px;
}

.section-grid {
  margin-top: 26px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.section-card {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 16px;
  padding: 18px;
  text-decoration: none;
  display: block;
}

.section-card h3 {
  margin: 0 0 7px;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.15rem;
}

.section-card p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.95rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--chip);
  padding: 5px 10px;
  font-size: 0.8rem;
}

.panel {
  margin-top: 24px;
  padding: 18px;
}

.panel h2 {
  margin: 0 0 10px;
  font-family: "Fraunces", Georgia, serif;
}

.progress-inline {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.cup-wrap {
  display: grid;
  justify-items: center;
  gap: 10px;
}

.cup {
  width: 160px;
  height: 115px;
  position: relative;
}

.cup-main {
  width: 128px;
  height: 92px;
  border: 5px solid #a68b78;
  border-top-width: 7px;
  border-radius: 0 0 22px 22px;
  background: #fdfbf8;
  overflow: hidden;
  position: relative;
}

.cup-handle {
  position: absolute;
  right: 0;
  top: 28px;
  width: 38px;
  height: 42px;
  border: 5px solid #a68b78;
  border-left: none;
  border-radius: 0 18px 18px 0;
}

.cup-plate {
  width: 164px;
  height: 14px;
  border-radius: 999px;
  background: #e8dacd;
  margin-top: 7px;
}

.coffee-fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0;
  background: linear-gradient(180deg, var(--coffee-top), var(--coffee));
  transition: height 550ms ease;
}

.fill-shine {
  position: absolute;
  left: 15%;
  top: 8%;
  width: 70%;
  height: 11px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
}

.cup-steam {
  display: flex;
  gap: 10px;
  height: 18px;
}

.cup-steam span {
  width: 6px;
  height: 18px;
  border-radius: 999px;
  background: rgba(97, 83, 72, 0.35);
  transform: translateY(8px);
  opacity: 0;
}

.cup[data-hot="true"] .cup-steam span {
  animation: steam 1.8s ease-in-out infinite;
  opacity: 1;
}

.cup[data-hot="true"] .cup-steam span:nth-child(2) {
  animation-delay: 0.25s;
}

.cup[data-hot="true"] .cup-steam span:nth-child(3) {
  animation-delay: 0.5s;
}

@keyframes steam {
  0% { transform: translateY(8px); opacity: 0; }
  30% { opacity: 0.55; }
  100% { transform: translateY(-8px); opacity: 0; }
}

.progress-number {
  font-size: 1.02rem;
  font-weight: 700;
}

.progress-caption {
  font-size: 0.85rem;
  color: var(--muted);
}

.library {
  margin-top: 20px;
  padding: 18px;
}

.toolbar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.search {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  background: #fff;
  font: inherit;
}

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

.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: #fff;
  font-size: 0.83rem;
  cursor: pointer;
}

.chip.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.result-count {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.entry {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 14px;
}

.entry h3 {
  margin: 0 0 8px;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.05rem;
  line-height: 1.2;
}

.entry p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 9px;
}

.pill {
  font-size: 0.76rem;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f2e7db;
  color: #553b2f;
}

.entry a {
  display: inline-flex;
  text-decoration: none;
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 700;
}

.source-box {
  margin-top: 18px;
  padding: 14px;
  color: var(--muted);
  font-size: 0.86rem;
}

.source-box ul {
  margin: 8px 0 0 18px;
  padding: 0;
}

.footer-note {
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.85rem;
}

@media (max-width: 940px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .section-grid,
  .card-grid {
    grid-template-columns: 1fr;
  }

  .topbar-inner {
    align-items: flex-start;
    flex-direction: column;
  }
}
