:root {
  --pink: #c45c74;
  --pink-deep: #a3445c;
  --sage: #5f7f62;
  --leaf: #3f5c42;
  --cream: #f7f1e8;
  --sand: #e8dccb;
  --ink: #2c2824;
  --mist: rgba(255, 252, 247, 0.92);
  --shadow: 0 18px 40px rgba(44, 40, 36, 0.18);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  background: #1c1916;
  color: #fff;
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, "Times New Roman", serif;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

button, input { font-family: "Avenir Next", "Segoe UI", sans-serif; }

#preloader {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: #f7f1e8;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s ease;
}
#preloader.done { opacity: 0; pointer-events: none; }

.preloader-inner { width: min(320px, 80vw); text-align: center; color: var(--ink); }
.wordmark {
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: 13px;
  letter-spacing: 0.42em;
  font-weight: 600;
  color: var(--pink-deep);
}
.preloader-title {
  margin: 14px 0 6px;
  font-size: 28px;
  letter-spacing: -0.03em;
  color: var(--leaf);
}
.preloader-sub {
  font-family: "Avenir Next", sans-serif;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #7a7168;
  margin-bottom: 28px;
}
.preloader-bar {
  height: 3px;
  background: rgba(95, 127, 98, 0.18);
  border-radius: 99px;
  overflow: hidden;
}
.preloader-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--sage), var(--pink));
  transition: width 0.25s ease;
}

.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 20;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: linear-gradient(180deg, rgba(28, 25, 22, 0.55), transparent);
  pointer-events: none;
}
.brand, .chip { pointer-events: auto; }
.brand { display: flex; align-items: baseline; gap: 10px; }
.brand-name {
  font-family: "Avenir Next", sans-serif;
  font-size: 12px;
  letter-spacing: 0.36em;
  font-weight: 700;
  text-shadow: 0 1px 8px rgba(0,0,0,0.45);
}
.brand-pulse {
  font-family: Georgia, serif;
  font-size: 18px;
  letter-spacing: 0.08em;
  font-style: italic;
  color: #f3d3c6;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(247, 241, 232, 0.16);
  border: 1px solid rgba(255,255,255,0.22);
  backdrop-filter: blur(10px);
  font-family: "Avenir Next", sans-serif;
  font-size: 12px;
}

.feed {
  position: fixed;
  inset: 0;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}
.feed::-webkit-scrollbar { display: none; }

.card {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  overflow: hidden;
  background: #2a2420;
}
.card-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
  background-color: #2a2420;
  background-size: cover;
  background-position: 50% 40%;
  background-repeat: no-repeat;
}
.card-bg .blur,
.card-bg .hero {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: 50% 40%;
  background-repeat: no-repeat;
}
.card-bg .blur {
  filter: blur(28px) brightness(0.7);
  transform: scale(1.12);
}
.hero-img {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 130%;
  height: 130%;
  max-width: none;
  object-fit: cover;
  object-position: center;
  display: block;
  transform: translate(-50%, -50%) scale(1.08);
}
.shade {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(28,22,18,0.42) 0%, rgba(28,22,18,0.05) 32%, rgba(28,22,18,0.08) 52%, rgba(28,22,18,0.62) 78%, rgba(28,22,18,0.88) 100%);
}

.heat, .countdown {
  position: absolute;
  top: 78px;
  z-index: 8;
  font-family: "Avenir Next", sans-serif;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 11px;
  border-radius: 999px;
  backdrop-filter: blur(10px);
}
.heat {
  left: 16px;
  background: rgba(28, 25, 22, 0.42);
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.heat-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #e8b4a2;
  box-shadow: 0 0 8px #e8b4a2;
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.45; transform: scale(0.85); } }
.countdown {
  right: 16px;
  background: rgba(196, 92, 116, 0.88);
}

.actions {
  position: absolute;
  right: 12px;
  bottom: 168px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.action {
  background: none;
  border: 0;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.action-icon {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: rgba(247, 241, 232, 0.16);
  border: 1px solid rgba(255,255,255,0.22);
  backdrop-filter: blur(10px);
  display: grid;
  place-items: center;
}
.action.active .action-icon { background: var(--pink); border-color: var(--pink); }
.action-label { font-family: "Avenir Next", sans-serif; font-size: 11px; text-shadow: 0 1px 6px rgba(0,0,0,0.5); }

.info {
  position: absolute;
  left: 20px;
  right: 86px;
  bottom: 108px;
  z-index: 8;
}
.badge {
  display: inline-block;
  background: rgba(247, 241, 232, 0.92);
  color: var(--leaf);
  font-family: "Avenir Next", sans-serif;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 3px;
  margin-bottom: 10px;
}
.line { font-family: "Avenir Next", sans-serif; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.88; }
.name { font-size: clamp(28px, 6vw, 40px); line-height: 1.05; letter-spacing: -0.03em; text-shadow: 0 2px 16px rgba(0,0,0,0.45); margin: 4px 0 8px; }
.headline { font-size: 22px; font-style: italic; color: #f6e4d4; margin-bottom: 8px; }
.terms { font-family: "Avenir Next", sans-serif; font-size: 13px; line-height: 1.45; color: rgba(255,255,255,0.86); max-width: 36ch; }

.cta-bar {
  position: absolute;
  left: 20px; right: 20px; bottom: 28px;
  z-index: 10;
  display: flex;
  gap: 10px;
}
.cta {
  flex: 1;
  border: 0;
  background: var(--pink);
  color: #fff;
  padding: 15px 14px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(164, 68, 92, 0.35);
}
.cta.ghost {
  flex: 0 0 64px;
  background: rgba(247, 241, 232, 0.16);
  border: 1px solid rgba(255,255,255,0.24);
  box-shadow: none;
  position: relative;
  display: grid;
  place-items: center;
}
.cta-ai {
  position: absolute;
  top: 5px; right: 5px;
  background: var(--sage);
  color: #fff;
  font-size: 8px;
  font-weight: 800;
  padding: 2px 4px;
  border-radius: 99px;
}

.swipe-hint {
  position: absolute;
  top: 146px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9;
  font-family: "Avenir Next", sans-serif;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  background: rgba(28,25,22,0.45);
  padding: 6px 12px;
  border-radius: 99px;
  animation: bob 2.2s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translate(-50%, 6px); } }

.toast {
  position: fixed;
  left: 50%;
  bottom: 118px;
  transform: translateX(-50%) translateY(12px);
  background: var(--cream);
  color: var(--ink);
  padding: 10px 16px;
  border-radius: 99px;
  font-family: "Avenir Next", sans-serif;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  z-index: 40;
  pointer-events: none;
  box-shadow: var(--shadow);
  transition: 0.25s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.sheet, .chat-sheet {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(28, 25, 22, 0.42);
  backdrop-filter: blur(6px);
  display: none;
  align-items: flex-end;
  justify-content: center;
}
.sheet.show, .chat-sheet.show { display: flex; }
.sheet-panel, .chat-panel {
  width: min(520px, 100%);
  background: var(--cream);
  color: var(--ink);
  border-radius: 22px 22px 0 0;
  animation: up 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes up { from { transform: translateY(100%); } }
.sheet-panel { padding: 18px 20px 28px; }
.grip { width: 36px; height: 4px; background: #d9cfc2; border-radius: 99px; margin: 0 auto 16px; }
.sheet-title { font-size: 22px; margin-bottom: 6px; }
.sheet-sub { font-family: "Avenir Next", sans-serif; font-size: 13px; color: #6f675e; margin-bottom: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.choice {
  border: 1px solid #d8cfc3;
  background: #fff;
  color: var(--ink);
  padding: 9px 12px;
  border-radius: 99px;
  font-size: 13px;
  cursor: pointer;
}
.choice.on { background: var(--sage); color: #fff; border-color: var(--sage); }
.sheet-close {
  width: 100%;
  margin-top: 18px;
  border: 1px solid #d8cfc3;
  background: transparent;
  padding: 12px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
}

.chat-panel {
  height: min(88vh, 740px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #eadfd0;
}
.avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pink), var(--sage));
  display: grid;
  place-items: center;
  color: #fff;
  position: relative;
}
.avatar::after {
  content: "";
  position: absolute;
  right: 1px; bottom: 1px;
  width: 10px; height: 10px;
  background: #6fbf7a;
  border: 2px solid var(--cream);
  border-radius: 50%;
}
.chat-title { font-size: 16px; }
.chat-sub { font-family: "Avenir Next", sans-serif; font-size: 11px; color: #7a7168; }
.icon-btn {
  margin-left: auto;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid #d8cfc3;
  background: #fff;
  cursor: pointer;
}
.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  font-family: "Avenir Next", sans-serif;
}
.msg {
  max-width: 84%;
  padding: 10px 13px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 8px;
  white-space: pre-wrap;
}
.msg.bot { background: #fff; border-bottom-left-radius: 4px; }
.msg.user { background: var(--pink); color: #fff; margin-left: auto; border-bottom-right-radius: 4px; }
.typing { display: inline-flex; gap: 5px; padding: 12px 14px; background: #fff; border-radius: 16px; }
.typing span {
  width: 6px; height: 6px; border-radius: 50%; background: #b5aa9c;
  animation: dots 1.1s infinite ease-in-out;
}
.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes dots { 30% { transform: translateY(-3px); opacity: 1; } 0%, 60%, 100% { opacity: 0.4; } }
.suggestions {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 14px 8px;
}
.suggestions button {
  flex: 0 0 auto;
  border: 1px solid #d8cfc3;
  background: #fff;
  border-radius: 99px;
  padding: 8px 12px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.chat-input-row {
  display: flex;
  gap: 8px;
  padding: 10px 12px 8px;
  border-top: 1px solid #eadfd0;
  background: #f3ece2;
}
.chat-input {
  flex: 1;
  border: 1px solid #d8cfc3;
  background: #fff;
  border-radius: 99px;
  padding: 12px 14px;
  font-size: 14px;
  outline: none;
}
.chat-input:focus { border-color: var(--sage); }
.chat-send {
  width: 44px; height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--sage);
  color: #fff;
  cursor: pointer;
}
.chat-note {
  font-family: "Avenir Next", sans-serif;
  font-size: 10px;
  color: #8a8176;
  text-align: center;
  padding: 0 14px 10px;
}

@media (min-width: 760px) {
  .card { max-width: 430px; margin: 0 auto; width: 100%; }
  .feed { background: #ede4d8; }
  .topbar { max-width: 430px; left: 50%; right: auto; transform: translateX(-50%); }
}
