:root {
  --beige: #DACBA8;
  --beige-deep: #CDBB91;
  --taupe: #B3A27F;
  --taupe-dark: #9C8A66;
  --cream: #FBF3E4;
  --ink: #1E1A16;
  --muted: #5E5141;
  --terra: #B8735A;
  --terra-dark: #9A5B44;
  --white: #FFFFFF;
  --line: rgba(30, 26, 22, 0.35);
  --serif: 'Lora', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --radius: 22px;
  --shadow: 0 18px 40px -24px rgba(30, 26, 22, 0.45);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--beige);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
em { font-family: var(--serif); font-style: italic; font-weight: 700; color: var(--terra); }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: clamp(2rem, 4.2vw, 3.2rem); line-height: 1.08; }
.muted { color: var(--muted); }

/* header */
.site-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 22px clamp(16px, 5vw, 64px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; text-decoration: none; }
.brand-logo { height: 48px; width: auto; }
.tagline { margin: 0; letter-spacing: 0.06em; font-size: 0.95rem; text-align: center; }
.nav { display: flex; justify-content: flex-end; align-items: center; gap: 26px; font-size: 0.85rem; letter-spacing: 0.06em; }
.nav a { text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.nav a:hover { color: var(--terra-dark); }
.count:not(:empty) {
  background: var(--terra); color: var(--white); border-radius: 999px;
  font-size: 0.7rem; min-width: 18px; height: 18px; display: inline-grid; place-items: center; padding: 0 5px;
}

main { flex: 1; width: 100%; max-width: 1360px; margin: 0 auto; padding: clamp(24px, 4vw, 56px) clamp(16px, 5vw, 64px); }
.screen { animation: fade 0.35s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.kicker { display: flex; align-items: center; gap: 14px; color: var(--terra); font-size: 0.85rem; letter-spacing: 0.08em; margin: 0 0 14px; }
.kicker span { width: 48px; height: 1px; background: var(--terra); }

/* landing */
.landing { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(24px, 4vw, 64px); align-items: center; }
.hero-copy h1 { font-size: clamp(3.2rem, 8.2vw, 7.4rem); line-height: 0.98; margin-bottom: 28px; }
.hero-copy h1 em { font-weight: 700; }
.lede { font-size: clamp(1.05rem, 1.6vw, 1.3rem); max-width: 34em; margin: 0 0 26px; color: #2B241D; }
.hero-copy hr { border: 0; border-top: 1px solid var(--line); margin: 0 0 22px; }
.steps { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px 28px; font-size: 0.95rem; letter-spacing: 0.03em; }
.steps b { color: var(--terra); font-weight: 600; margin-right: 4px; }

.bottle { display: flex; flex-direction: column; align-items: center; width: 100%; max-width: 520px; justify-self: center; }
.bottle-cap {
  width: 70%; background: var(--taupe); border-radius: 18px 18px 14px 14px; padding: 22px 18px;
  text-align: center; font-size: 0.85rem; color: #3A3127; clip-path: polygon(0 6%, 50% 0, 100% 6%, 100% 100%, 0 100%);
}
.bottle-cap p { margin: 0 0 4px; }
.bottle-cap .small { font-size: 0.78rem; opacity: 0.8; }
.bottle-neck { width: 46%; height: 34px; background: var(--taupe); }
.bottle-body {
  width: 100%; background: var(--taupe); border-radius: 56px 56px 44px 44px; padding: 26px;
  display: block; cursor: pointer; transition: transform 0.2s ease;
}
.bottle-body:hover, .bottle-body.drag { transform: translateY(-3px); }
.drop-inner {
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  background: var(--white); border-radius: 30px; padding: 46px 20px; outline: 1px dashed rgba(30, 26, 22, 0.18); outline-offset: -12px;
}
.bottle-body.drag .drop-inner { outline-color: var(--terra); background: #FFFDF8; }
.drop-icon { width: 54px; height: 54px; border-radius: 50%; background: #EBDFDC; display: grid; place-items: center; margin-bottom: 8px; }
.drop-inner strong { font-family: var(--serif); font-weight: 500; font-size: 1.1rem; }
.drop-inner small { color: #8E8577; margin-top: 10px; font-size: 0.8rem; }
.bottle-base { width: 62%; height: 26px; background: var(--taupe); border-radius: 0 0 10px 10px; }
.upload-error { color: var(--terra-dark); min-height: 1.5em; margin: 10px 0 0; text-align: center; font-weight: 500; }

.samples { grid-column: 1 / -1; }
.samples-title { font-family: var(--serif); font-style: italic; font-size: 1.15rem; margin: 0 0 12px; }
.sample-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.sample {
  position: relative; border: 0; padding: 0; border-radius: 16px; overflow: hidden; background: var(--taupe);
  aspect-ratio: 16 / 9; box-shadow: var(--shadow); transition: transform 0.2s ease;
}
.sample:hover { transform: translateY(-3px); }
.sample img { width: 100%; height: 100%; object-fit: cover; }
.sample span {
  position: absolute; left: 12px; bottom: 10px; color: var(--cream); font-family: var(--serif); font-size: 1.1rem;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
}

/* chat */
.chat-screen { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(16px, 3vw, 40px); align-items: start; }
.photo-panel { background: var(--cream); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); position: sticky; top: 16px; }
.photo-panel img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.reading { padding: 18px 20px 22px; }
.eyebrow { margin: 0 0 10px; font-size: 0.75rem; letter-spacing: 0.1em; color: var(--terra); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid rgba(184, 115, 90, 0.5); color: var(--terra-dark); background: #FFF8EE; border-radius: 999px;
  padding: 4px 12px; font-size: 0.85rem; animation: pop 0.4s ease both;
}
.chip:nth-child(2) { animation-delay: 0.08s; } .chip:nth-child(3) { animation-delay: 0.16s; }
.chip:nth-child(4) { animation-delay: 0.24s; } .chip:nth-child(5) { animation-delay: 0.32s; } .chip:nth-child(6) { animation-delay: 0.4s; }
@keyframes pop { from { opacity: 0; transform: scale(0.85); } to { opacity: 1; transform: none; } }
.shimmer {
  color: transparent; border-color: transparent; width: 180px;
  background: linear-gradient(90deg, #EFE3CC 25%, #F8EFDF 50%, #EFE3CC 75%); background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear; position: relative;
}
.shimmer::after { content: 'Reading your image…'; position: absolute; inset: 4px 12px; color: var(--muted); }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.scene { margin: 12px 0 0; font-family: var(--serif); font-style: italic; color: var(--muted); }

.chat-panel { background: rgba(251, 243, 228, 0.55); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; min-height: 560px; }
.chat-log { flex: 1; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; max-height: 62vh; padding-right: 4px; }
.msg { max-width: 86%; padding: 12px 16px; border-radius: 18px; animation: fade 0.3s ease; white-space: pre-wrap; }
.msg.bot { background: var(--cream); border-bottom-left-radius: 6px; align-self: flex-start; box-shadow: 0 6px 18px -14px rgba(30, 26, 22, 0.5); }
.msg.user { background: var(--terra); color: var(--white); border-bottom-right-radius: 6px; align-self: flex-end; }
.msg.bot .who { display: block; font-size: 0.72rem; letter-spacing: 0.08em; color: var(--terra); margin-bottom: 2px; }
.typing { display: inline-flex; gap: 4px; padding: 16px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--taupe-dark); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: 0.2s; } .typing i:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 12px; }
.quick button {
  border: 1px solid var(--terra); background: transparent; color: var(--terra-dark); border-radius: 999px; padding: 8px 14px;
  font-size: 0.9rem; transition: background 0.15s ease, color 0.15s ease;
}
.quick button:hover { background: var(--terra); color: var(--white); }
.composer { display: flex; gap: 8px; background: var(--white); border-radius: 999px; padding: 6px 6px 6px 18px; }
.composer input { flex: 1; border: 0; outline: none; font: inherit; background: transparent; min-width: 0; }
.composer button { border: 0; width: 42px; height: 42px; border-radius: 50%; background: var(--ink); color: var(--cream); display: grid; place-items: center; }
.composer button:disabled, .composer input:disabled { opacity: 0.45; }

/* finding */
.finding, .done { display: grid; place-items: center; min-height: 55vh; text-align: center; }
.finding-inner, .done-inner { max-width: 560px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 0.8; } 50% { transform: scale(1.08); opacity: 1; } }

/* results */
.results-head { margin-bottom: 28px; }
.results-sub { color: var(--muted); max-width: 48em; margin: 12px 0 0; }
.offline-note { display: inline-block; margin-top: 10px; background: #F2E6CF; border-radius: 8px; padding: 6px 10px; font-size: 0.85rem; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.card { background: var(--cream); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); animation: fade 0.5s ease both; }
.card:nth-child(2) { animation-delay: 0.12s; } .card:nth-child(3) { animation-delay: 0.24s; }
.card-img { background: linear-gradient(180deg, #F3E9D6, #E8DBC0); display: grid; place-items: center; height: 230px; position: relative; }
.card-img img { height: 210px; width: auto; object-fit: contain; mix-blend-mode: multiply; }
.card-img .rank { position: absolute; top: 14px; left: 16px; font-family: var(--serif); font-size: 1.6rem; color: var(--terra); }
.save-btn { position: absolute; top: 12px; right: 12px; border: 0; background: rgba(255, 255, 255, 0.75); border-radius: 50%; width: 38px; height: 38px; display: grid; place-items: center; }
.save-btn.on { color: var(--terra); }
.card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-body .brand-name { font-size: 0.75rem; letter-spacing: 0.1em; color: var(--muted); text-transform: uppercase; }
.card-body h3 { font-size: 1.45rem; line-height: 1.15; }
.desc { margin: 0; }
.desc b { font-family: var(--serif); font-weight: 600; }
.why { background: var(--white); border-radius: 14px; padding: 12px 14px; }
.why p { margin: 0 0 6px; font-size: 0.75rem; letter-spacing: 0.08em; color: var(--terra); font-weight: 600; }
.why ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 0.93rem; }
.notes { display: flex; flex-wrap: wrap; gap: 6px; }
.note { font-size: 0.78rem; background: #EFE3CC; border-radius: 999px; padding: 3px 10px; }
.meta { font-size: 0.82rem; color: var(--muted); }
.wear { font-family: var(--serif); font-style: italic; font-size: 0.95rem; margin: 0; }
.card-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: auto; padding-top: 6px; }
.btn {
  display: inline-flex; justify-content: center; align-items: center; gap: 8px; text-decoration: none; text-align: center;
  border-radius: 999px; padding: 12px 20px; border: 1px solid var(--ink); background: transparent; font-weight: 500; font-size: 0.95rem;
  transition: background 0.15s ease, color 0.15s ease;
}
.btn.primary { background: var(--ink); color: var(--cream); }
.btn.primary:hover { background: #3A3127; }
.btn.ghost:hover, .btn.small:hover { background: var(--ink); color: var(--cream); }
.btn.small { padding: 9px 12px; font-size: 0.85rem; }
.btn.added { background: var(--terra); border-color: var(--terra); color: var(--white); }
.results-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* bag, checkout, product, saved, how */
.bag h2, .checkout h2, .saved h2 { margin-bottom: 20px; }
.bag-list { background: var(--cream); border-radius: var(--radius); padding: 8px 20px; max-width: 760px; }
.bag-row { display: flex; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid rgba(30, 26, 22, 0.12); }
.bag-row img { width: 46px; height: 60px; object-fit: contain; mix-blend-mode: multiply; }
.bag-row .grow { flex: 1; }
.bag-row button { border: 0; background: none; color: var(--muted); text-decoration: underline; }
.bag-total { display: flex; justify-content: space-between; padding: 16px 0; font-weight: 600; }
.bag-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.checkout-form { display: grid; gap: 14px; max-width: 520px; background: var(--cream); border-radius: var(--radius); padding: 24px; }
.checkout-form label { display: grid; gap: 6px; font-size: 0.85rem; letter-spacing: 0.03em; }
.checkout-form input { font: inherit; padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(30, 26, 22, 0.2); background: var(--white); }
.row2 { display: grid; grid-template-columns: 1fr 2fr; gap: 12px; }
.total { font-weight: 600; margin: 4px 0; }
.product-wrap { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 40px; align-items: center; background: var(--cream); border-radius: var(--radius); padding: clamp(18px, 4vw, 40px); }
.product-wrap img { max-height: 420px; margin: 0 auto; mix-blend-mode: multiply; }
.price { font-family: var(--serif); font-size: 2rem; margin: 8px 0; }
.cards.compact .card-img { height: 170px; }
.cards.compact .card-img img { height: 150px; }
.empty { background: var(--cream); border-radius: var(--radius); padding: 28px; max-width: 620px; }
.how h2 { margin-bottom: 30px; }
.how-steps { list-style: none; padding: 0; margin: 0 0 36px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.how-steps li { background: var(--cream); border-radius: var(--radius); padding: 22px; }
.how-steps b { color: var(--terra); font-family: var(--serif); font-size: 1.6rem; }
.how-steps h3 { font-size: 1.25rem; margin: 8px 0; }
.how-steps p { margin: 0; color: #3A3127; font-size: 0.95rem; }
.how-arch { margin-bottom: 30px; }
.how-arch h3 { font-size: 1.5rem; margin-bottom: 14px; }
.arch { display: flex; flex-wrap: wrap; align-items: stretch; gap: 10px; }
.arch div { background: var(--ink); color: var(--cream); border-radius: 16px; padding: 14px 18px; flex: 1 1 160px; display: grid; gap: 4px; }
.arch div span { font-size: 0.85rem; opacity: 0.8; }
.arch i { align-self: center; font-style: normal; font-size: 1.4rem; color: var(--terra); }

.site-footer {
  display: flex; justify-content: space-between; gap: 24px; padding: 18px clamp(16px, 5vw, 64px); border-top: 1px solid var(--line);
  font-size: 0.78rem; color: var(--muted);
}

/* responsive */
@media (max-width: 1080px) {
  .cards { grid-template-columns: 1fr 1fr; }
  .how-steps { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .site-header { grid-template-columns: 1fr auto; }
  .tagline { display: none; }
  .nav { gap: 16px; }
  .landing, .chat-screen { grid-template-columns: 1fr; }
  .bottle { max-width: 420px; }
  .photo-panel { position: static; }
  .photo-panel img { aspect-ratio: 16 / 9; }
  .chat-panel { min-height: 0; }
  .chat-log { max-height: none; }
  .product-wrap { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .cards, .how-steps { grid-template-columns: 1fr; }
  .sample-row { grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
  .sample span { font-size: 0.85rem; left: 8px; bottom: 6px; }
  .nav a:first-child { display: none; }
  .brand-logo { height: 38px; }
  .site-footer { flex-direction: column; gap: 6px; }
  .msg { max-width: 94%; }
}
