:root {
  --bg: #fbf6f2;
  --card: #ffffff;
  --blush: #f3dcd6;
  --rose: #c96f6a;
  --sage: #8c9a6e;
  --sage-d: #5d6b43;
  --ink: #2b2420;
  --muted: #8b7f78;
  --line: #efe5de;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --display: "Lalezar", "Vazirmatn", sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: "Vazirmatn", system-ui, sans-serif; color: var(--ink);
  background: var(--bg); -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: contain;
}
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 400; font-family: var(--display); }

/* Desktop: phone column + side panel */
.side { display: none; }
.app { max-width: 480px; margin: 0 auto; padding-bottom: calc(5rem + env(safe-area-inset-bottom)); background: var(--bg); min-height: 100vh; }

@media (min-width: 900px) {
  body {
    display: grid; grid-template-columns: 1fr 480px 1fr; min-height: 100dvh;
    background: radial-gradient(circle at 20% 20%, #f3dcd6 0, transparent 40%), radial-gradient(circle at 85% 80%, #dfe6d3 0, transparent 45%), #f6efe9;
  }
  .side {
    display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
    grid-column: 3; grid-row: 1; gap: .6rem; padding: 2rem; position: sticky; top: 0; height: 100dvh;
  }
  .side img { border-radius: 50%; box-shadow: 0 0 0 4px #fff, 0 0 0 6px var(--sage); }
  .side h1 { font-size: 3rem; color: var(--sage-d); }
  .side p { color: var(--muted); margin: 0; }
  .qr { width: 120px; height: 120px; border-radius: 20px; background: repeating-conic-gradient(var(--ink) 0 25%, #fff 0 50%) 0 0 / 20px 20px; display: grid; place-items: center; margin: 1rem 0 .4rem; }
  .qr span { background: #fff; color: var(--rose); font-size: 2rem; width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; }
  .app {
    grid-column: 2; grid-row: 1; margin: 1.5rem 0; min-height: auto; border-radius: 40px; overflow: hidden;
    box-shadow: 0 0 0 10px #1d1a18, 0 40px 80px -30px rgba(43,36,32,.55);
    height: calc(100dvh - 3rem); overflow-y: auto; position: relative; scrollbar-width: none;
  }
  .app::-webkit-scrollbar { display: none; }
  .app { padding-bottom: 0; }
  .tabs { position: sticky !important; }
}

/* Top bar */
.bar {
  position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center;
  padding: calc(.7rem + env(safe-area-inset-top)) 1rem .7rem; background: rgba(251,246,242,.9); backdrop-filter: blur(14px);
}
.who { display: flex; gap: .6rem; align-items: center; }
.who img { border-radius: 50%; }
.who div { display: flex; flex-direction: column; line-height: 1.3; }
.who b { font-family: var(--display); font-weight: 400; font-size: 1.3rem; color: var(--sage-d); }
.who small { color: var(--muted); font-size: .72rem; }
.icon { position: relative; background: var(--card); border: 1px solid var(--line); width: 42px; height: 42px; border-radius: 14px; font-size: 1.1rem; }
.icon i { position: absolute; top: -6px; left: -6px; background: var(--rose); color: #fff; font-style: normal; font-size: .7rem; min-width: 20px; height: 20px; border-radius: 10px; display: grid; place-items: center; transform: scale(0); transition: transform .3s var(--ease); }
.icon i.has { transform: scale(1); }
.icon.bump { animation: bump .4s var(--ease); }
@keyframes bump { 50% { transform: scale(1.15); } }

/* Stories */
.stories { display: flex; gap: .9rem; overflow-x: auto; padding: .4rem 1rem 1rem; scrollbar-width: none; scroll-snap-type: x mandatory; }
.stories::-webkit-scrollbar { display: none; }
.story { flex: 0 0 auto; background: none; border: 0; padding: 0; display: flex; flex-direction: column; align-items: center; gap: .35rem; font-size: .72rem; color: var(--muted); scroll-snap-align: start; width: 68px; }
.story span { width: 66px; height: 66px; border-radius: 50%; padding: 3px; background: conic-gradient(from 200deg, var(--sage), var(--rose), #e7b56a, var(--sage)); transition: transform .2s var(--ease); }
.story img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 3px solid var(--bg); }
.story:active span { transform: scale(.92); }
.story.seen span { background: var(--line); }

/* Drops carousel */
.drops { display: flex; gap: .8rem; overflow-x: auto; padding: 0 1rem; scroll-snap-type: x mandatory; scrollbar-width: none; }
.drops::-webkit-scrollbar { display: none; }
.drop {
  flex: 0 0 88%; scroll-snap-align: center; height: 240px; border-radius: 28px; background: var(--tone);
  position: relative; overflow: hidden; display: flex; color: #fff;
}
.drop img { width: 46%; height: 100%; object-fit: cover; border-radius: 0 28px 28px 0; mask-image: linear-gradient(to left, #000 75%, transparent); }
.drop div { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: .4rem; padding: 1.2rem; }
.drop small { opacity: .75; font-size: .75rem; }
.drop h2 { font-size: 1.9rem; line-height: 1.25; }
.dots { display: flex; justify-content: center; gap: .35rem; padding: .7rem 0 0; }
.dots i { width: 6px; height: 6px; border-radius: 3px; background: var(--line); transition: width .3s var(--ease), background .3s; }
.dots i.on { width: 20px; background: var(--sage); }

/* Pills */
.pill { display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 999px; padding: .55rem 1.2rem; background: var(--sage-d); color: #fff; font-weight: 700; font-size: .88rem; text-decoration: none; transition: transform .15s var(--ease); }
.pill:active { transform: scale(.95); }
.pill.light { background: #fff; color: var(--ink); }
.pill.ghost { background: var(--card); color: var(--ink); border: 1px solid var(--line); }
.pill.full { width: 100%; padding: .9rem; font-size: 1rem; }

/* Feed */
.feed { padding: 1.6rem 1rem 0; }
.feed-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .9rem; gap: .5rem; }
.feed-head h3, .reviews h3, .contact h3 { font-size: 1.5rem; }
.seg { display: flex; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: none; padding: .3rem .75rem; border-radius: 999px; font-size: .78rem; color: var(--muted); transition: background .2s, color .2s; }
.seg button.on { background: var(--ink); color: #fff; }
.grid { columns: 2; column-gap: .7rem; }
.item { break-inside: avoid; margin-bottom: .9rem; position: relative; cursor: pointer; }
.item img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 20px; transition: transform .25s var(--ease); }
.item.tall img { aspect-ratio: 3 / 5; }
.item:active img { transform: scale(.97); }
.item b { display: block; font-size: .88rem; margin-top: .45rem; }
.item span { font-size: .8rem; color: var(--rose); font-weight: 700; }
.item.is-hidden { display: none; }
.heart { position: absolute; top: .55rem; left: .55rem; width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(255,255,255,.88); font-size: 1rem; color: var(--rose); transition: transform .2s var(--ease); }
.heart.on { transform: scale(1.12); }

/* Reviews */
.reviews { margin: 1.4rem 1rem 0; padding: 1.2rem; border-radius: 28px; background: var(--blush); }
.chat { display: flex; flex-direction: column; gap: .5rem; margin-top: .8rem; }
.chat p { margin: 0; max-width: 82%; padding: .55rem .9rem; border-radius: 18px; font-size: .88rem; line-height: 1.7; }
.chat .in { background: #fff; align-self: flex-start; border-start-start-radius: 4px; }
.chat .out { background: var(--sage-d); color: #fff; align-self: flex-end; border-start-end-radius: 4px; }

/* Contact */
.contact { margin: 1rem; padding: 1.2rem; border-radius: 28px; background: var(--card); border: 1px solid var(--line); }
.contact p { color: var(--muted); font-size: .9rem; margin: .3rem 0 0; }
.actions { display: flex; gap: .5rem; margin-top: 1rem; flex-wrap: wrap; }
.tiny { font-size: .72rem !important; color: var(--muted); margin-top: 1rem !important; }

/* Bottom tabs */
.tabs {
  position: fixed; z-index: 20; bottom: 0; left: 0; right: 0; max-width: 480px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: .45rem 0 calc(.45rem + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.92); backdrop-filter: blur(14px); border-top: 1px solid var(--line);
}
.tabs a, .tabs button { display: flex; flex-direction: column; align-items: center; text-decoration: none; background: none; border: 0; font-size: 1.25rem; line-height: 1.3; color: var(--muted); }
.tabs span { font-size: .66rem; }
.tabs .on { color: var(--sage-d); }
#installTab { color: var(--rose); }

/* Story viewer */
.viewer { position: fixed; inset: 0; z-index: 50; background: #000; display: flex; flex-direction: column; animation: fade .25s; }
.viewer[hidden] { display: none; }
.viewer #vImg { flex: 1; object-fit: contain; min-height: 0; width: 100%; }
.progress { height: 3px; margin: calc(.6rem + env(safe-area-inset-top)) .8rem 0; background: rgba(255,255,255,.3); border-radius: 2px; overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: #fff; }
.progress i.run { width: 100%; transition: width 5s linear; }
.v-head { display: flex; align-items: center; gap: .6rem; color: #fff; padding: .7rem 1rem; }
.v-head img { border-radius: 50%; }
.v-head b { flex: 1; }
.v-head button { background: none; border: 0; color: #fff; font-size: 1.8rem; line-height: 1; }
.v-cta { margin: 1rem auto calc(1.2rem + env(safe-area-inset-bottom)); }
@keyframes fade { from { opacity: 0; } }

/* Product sheet */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(43,36,32,.4); animation: fade .25s; }
.scrim[hidden] { display: none; }
.sheet {
  position: fixed; z-index: 41; left: 0; right: 0; bottom: 0; max-width: 480px; margin: 0 auto;
  background: var(--bg); border-radius: 28px 28px 0 0; padding: .6rem 1rem calc(1rem + env(safe-area-inset-bottom));
  transform: translateY(105%); visibility: hidden; transition: transform .4s var(--ease), visibility 0s .4s;
}
.sheet.open { transform: none; visibility: visible; transition: transform .4s var(--ease); }
.grab { display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto .8rem; }
.sheet img { width: 100%; height: 260px; object-fit: cover; object-position: center 25%; border-radius: 20px; }
.s-body h3 { font-size: 1.5rem; margin-top: .8rem; }
.s-body > b { color: var(--rose); }
.s-body p { margin: .8rem 0 .4rem; color: var(--muted); font-size: .85rem; }
.sizes { display: flex; gap: .5rem; margin-bottom: 1rem; }
.sizes button { width: 46px; height: 46px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); }
.sizes button.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Toast */
.toast { position: fixed; z-index: 60; top: 1rem; left: 50%; transform: translate(-50%, -200%); opacity: 0; background: var(--ink); color: #fff; padding: .55rem 1.2rem; border-radius: 999px; font-size: .88rem; transition: transform .35s var(--ease), opacity .35s; pointer-events: none; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }

@media (hover: hover) {
  .item:hover img { transform: scale(1.02); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
