/* Nora gallery storefront: navy and gold, matching the shop's logo.
   Phones get a full-screen feed (one piece per screen); larger screens get a
   profile page with a grid and a viewer. Without JavaScript the grid and the
   product pages work as plain links. */

:root {
  --night: #0E1424;
  --navy: #18223B;
  --navy-2: #222E4B;
  --gold: #E3B65A;
  --gold-2: #C9963A;
  --gold-light: #F4D892;
  --ivory: #F7F1E6;
  --muted: #A9B0C2;
  --line: rgba(247, 241, 230, .12);
  --heart: #F0637F;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: "Vazirmatn", Tahoma, sans-serif; color: var(--ivory); background: var(--night); line-height: 1.8; min-height: 100vh; }
button, select { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
h1, h2, h3 { line-height: 1.5; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.gold-text { background: linear-gradient(90deg, var(--gold-light), var(--gold) 45%, var(--gold-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo { width: 32px; height: 32px; border-radius: 50%; box-shadow: 0 0 0 1.5px var(--gold); object-fit: cover; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }

/* ---------- top bar ---------- */
.top { position: sticky; top: 0; z-index: 30; padding: 10px max(14px, calc(50vw - 560px)); background: rgba(14, 20, 36, .96); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; gap: 10px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 900; font-size: 1.02rem; white-space: nowrap; }
.rate { margin-inline-start: auto; min-width: 0; overflow: hidden; display: flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 999px; background: rgba(247, 241, 230, .1); font-size: .7rem; white-space: nowrap; }
.rate::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #6FD39A; }
.rate.is-stale::before { background: #E0A43A; }
.rate.is-stale { flex-wrap: wrap; white-space: normal; border-radius: 12px; }
[data-gold-warning] { color: #ffd28a; font-size: .7rem; line-height: 1.5; }
[data-gold-warning][hidden] { display: none; }
.rate b { font-weight: 800; color: var(--gold); }
.rate [data-gold-updated]:not(:empty) { color: var(--muted); }
.toggle { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: rgba(247, 241, 230, .1); }
.toggle svg { width: 18px; height: 18px; }

/* ---------- story circles ---------- */
.stories { display: flex; gap: 12px; overflow-x: auto; scrollbar-width: none; }
.stories::-webkit-scrollbar { display: none; }
.story { flex: none; width: 62px; text-align: center; font-size: .66rem; opacity: .72; }
.story .ring { display: block; width: 58px; height: 58px; margin: 0 auto 3px; padding: 2.5px; border-radius: 50%; background: rgba(247, 241, 230, .22); }
.story img, .story .ico { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 2px solid var(--night); background: var(--navy); }
.story .ico { display: grid; place-items: center; font-size: 1.15rem; color: var(--gold); }
.story[aria-current="true"], .story[aria-pressed="true"] { opacity: 1; font-weight: 800; }
.story[aria-current="true"] .ring, .story[aria-pressed="true"] .ring { background: conic-gradient(from 200deg, var(--gold-light), var(--gold), var(--gold-2), var(--gold-light)); }
.top .stories { display: none; margin-top: 10px; max-height: 90px; transition: max-height .3s ease, opacity .3s ease, margin .3s ease; }

/* ---------- profile and grid ---------- */
.profile { width: min(480px, 100%); margin-inline: auto; padding-bottom: 30px; }
.phead { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; align-items: center; padding: 18px 16px 6px; }
.big-logo { grid-row: span 2; width: 84px; height: 84px; border-radius: 50%; box-shadow: 0 0 0 2px var(--night), 0 0 0 4px var(--gold); }
.phead h1 { font-size: 1.2rem; font-weight: 900; }
.stats { display: flex; gap: 18px; font-size: .74rem; color: var(--muted); }
.stats b { display: block; font-size: 1rem; color: var(--ivory); }
.bio { padding: 4px 16px 0; font-size: .8rem; color: var(--muted); line-height: 1.9; }
.bio b { color: var(--ivory); font-weight: 700; }
.pbtns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px 16px; }
.pbtns a { padding: 9px; border-radius: 10px; text-align: center; font-size: .82rem; font-weight: 800; background: var(--navy-2); }
.pbtns a.main { background: var(--gold); color: var(--night); }
.profile .stories { padding: 6px 16px 4px; }
.cat-title { padding: 14px 16px 0; font-size: 1.2rem; font-weight: 900; }
.tools { position: sticky; top: 54px; z-index: 5; display: flex; gap: 6px; align-items: center; overflow-x: auto; padding: 10px 16px; background: var(--night); border-bottom: 1px solid var(--line); scrollbar-width: none; }
.tools::-webkit-scrollbar { display: none; }
.tools button, .tools select { flex: none; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); font-size: .74rem; color: var(--muted); }
.tools select { color: var(--ivory); background: var(--navy); }
.tools button[aria-pressed="true"] { background: var(--ivory); border-color: var(--ivory); color: var(--night); font-weight: 700; }
.count { padding: 10px 16px 6px; font-size: .74rem; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.tile { position: relative; display: block; width: 100%; aspect-ratio: 4 / 5; overflow: hidden; background: var(--navy); }
.tile > img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.noimg { display: grid; place-items: center; width: 100%; height: 100%; }
.noimg img { width: 40%; border-radius: 50%; opacity: .5; }
.tile .tp { position: absolute; bottom: 6px; inset-inline-start: 6px; padding: 1px 8px; border-radius: 999px; background: rgba(14, 20, 36, .78); font-size: .66rem; font-weight: 700; color: var(--gold); }
.tile .star { position: absolute; top: 6px; inset-inline-start: 6px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--gold); color: var(--night); font-size: .72rem; box-shadow: 0 2px 6px rgba(0, 0, 0, .35); }
.meta .star-chip { background: var(--gold); color: var(--night); font-weight: 800; }
.tile .th { position: absolute; top: 6px; inset-inline-end: 6px; font-size: .8rem; color: var(--heart); text-shadow: 0 1px 4px rgba(0, 0, 0, .6); }
.tile .hov { display: none; }
.empty { grid-column: 1 / -1; padding: 60px 20px; text-align: center; color: var(--muted); }
.note { padding: 18px 16px 0; font-size: .72rem; color: var(--muted); line-height: 1.9; }

/* ---------- a single piece (product pages, also without JavaScript) ---------- */
.piece-detail { display: grid; gap: 16px; margin: 10px 16px 18px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.pd-media { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.pd-photo { position: relative; flex: none; width: 100%; overflow: hidden; border-radius: 16px; background: #000; aspect-ratio: 4 / 5; scroll-snap-align: start; }
.pd-photo img, .pd-photo video { width: 100%; height: 100%; object-fit: contain; }
.pd-photo figcaption, .media-cap { position: absolute; inset: auto 0 0 0; padding: 18px 12px 8px; background: linear-gradient(transparent, rgba(0, 0, 0, .7)); font-size: .78rem; }
.old-price { color: var(--muted); font-size: .9rem; }
.strip { display: flex; gap: 6px; margin-top: 10px; overflow-x: auto; }
.strip button { flex: none; width: 54px; height: 66px; overflow: hidden; border-radius: 8px; border: 2px solid transparent; background: #000; }
.strip button[aria-pressed="true"] { border-color: var(--gold); }
.strip img { width: 100%; height: 100%; object-fit: cover; }
.strip .vid { display: grid; place-items: center; width: 100%; height: 100%; color: var(--gold); }
.sheet-media { display: grid; gap: 8px; margin-bottom: 12px; }
.sheet-media figure { position: relative; overflow: hidden; border-radius: 14px; background: #000; }
.sheet-media img, .sheet-media video { width: 100%; max-height: 60vh; object-fit: contain; }
.meta { display: flex; gap: 6px; flex-wrap: wrap; font-size: .7rem; }
.meta span { padding: 2px 10px; border-radius: 999px; background: rgba(247, 241, 230, .14); }
.piece-title { margin-top: 6px; font-size: 1.3rem; font-weight: 900; }
.price { margin-top: 4px; font-size: 1.75rem; font-weight: 900; line-height: 1.3; }
.price small { font-size: .74rem; font-weight: 500; color: var(--ivory); -webkit-text-fill-color: var(--ivory); opacity: .75; }
.calc { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; margin: 14px 0; padding: 12px 0; border-block: 1px dashed var(--line); font-size: .86rem; }
.calc dt { color: var(--muted); }
.calc dd { text-align: end; }
.cap { font-size: .8rem; color: var(--muted); }
.order { display: inline-flex; align-items: center; justify-content: center; gap: 8px; margin-top: 12px; padding: 11px 20px; border-radius: 999px; background: var(--gold); color: var(--night); font-weight: 800; font-size: .9rem; }
.order svg { width: 18px; height: 18px; }

/* ---------- full-screen feed (phones) ---------- */
.feed { display: none; position: relative; width: min(480px, 100%); margin-inline: auto; height: 100vh; height: 100dvh; overflow-y: auto; scroll-snap-type: y mandatory; scrollbar-width: none; overscroll-behavior: contain; background: #000; }
.feed::-webkit-scrollbar { display: none; }
.view-feed { overflow: hidden; }
.view-feed .feed { display: block; }
.view-feed .profile, .view-feed .site-foot { display: none; }
.view-feed .top { position: fixed; inset: 0 0 auto 0; width: min(480px, 100%); margin-inline: auto; padding: 10px 14px 16px; border: 0; backdrop-filter: none; background: linear-gradient(180deg, rgba(14, 20, 36, .95) 30%, rgba(14, 20, 36, 0)); transition: transform .3s ease; }
.view-feed .top .stories { display: flex; }
.view-feed .top.compact .stories { max-height: 0; opacity: 0; margin-top: 0; }
.slide { position: relative; height: 100vh; height: 100dvh; scroll-snap-align: start; scroll-snap-stop: always; overflow: hidden; touch-action: manipulation; }
.slide .bg, .vphoto .bg { position: absolute; inset: -40px; width: calc(100% + 80px); height: calc(100% + 80px); max-width: none; object-fit: cover; filter: blur(26px) brightness(.5) saturate(1.15); }
.slide .ph, .vphoto .ph { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.slide::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, rgba(14, 20, 36, .96) 90%); pointer-events: none; }
.info { position: absolute; z-index: 2; inset: auto 16px calc(20px + env(safe-area-inset-bottom)) 74px; }
.info h2 { margin-top: 6px; font-size: 1.15rem; font-weight: 800; }
.info .w { font-size: .8rem; color: var(--muted); }
.basis { font-size: .68rem; color: var(--muted); }
.acts { position: absolute; z-index: 2; left: 10px; bottom: calc(28px + env(safe-area-inset-bottom)); display: grid; gap: 16px; justify-items: center; font-size: .64rem; }
.acts button { display: grid; justify-items: center; gap: 2px; min-width: 48px; }
.acts svg { width: 28px; height: 28px; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .5)); }
[data-fav][aria-pressed="true"] svg { fill: var(--heart); stroke: var(--heart); }
.pos { position: absolute; z-index: 2; top: 50%; left: 14px; transform: translateY(-50%); writing-mode: vertical-rl; font-size: .64rem; opacity: .45; }
.burst { position: fixed; z-index: 40; top: 50%; left: 50%; width: 110px; height: 110px; margin: -55px; fill: var(--heart); opacity: 0; pointer-events: none; }
.burst.go { animation: burst .8s ease-out; }
@keyframes burst { 20% { opacity: .95; transform: scale(1.1); } 70% { opacity: .9; transform: scale(1); } 100% { opacity: 0; transform: scale(1.2); } }
.feed .empty { height: 100dvh; display: grid; place-items: center; }

/* ---------- bottom sheet (phones) ---------- */
.sheet { position: fixed; inset: 0; z-index: 200; display: flex; align-items: flex-end; justify-content: center; background: rgba(5, 8, 15, .6); opacity: 0; pointer-events: none; transition: opacity .25s ease; }
.sheet.on { opacity: 1; pointer-events: auto; }
.sheet-panel { position: relative; width: min(480px, 100%); max-height: 88vh; overflow: auto; padding: 8px 20px calc(24px + env(safe-area-inset-bottom)); border-radius: 22px 22px 0 0; background: var(--navy); transform: translateY(40px); transition: transform .3s cubic-bezier(.2, .8, .2, 1); }
.sheet.on .sheet-panel { transform: none; }
.grip { width: 44px; height: 4px; border-radius: 4px; margin: 4px auto 10px; background: var(--ivory); opacity: .25; }
.sheet .x { position: absolute; top: 10px; left: 12px; width: 34px; height: 34px; border-radius: 50%; background: rgba(247, 241, 230, .1); font-size: 1.3rem; }
.sheet .order { display: flex; }

/* ---------- desktop viewer ---------- */
.viewer { position: fixed; inset: 0; z-index: 60; display: none; place-items: center; padding: 3vh 4vw; background: rgba(5, 8, 15, .86); backdrop-filter: blur(6px); }
.viewer.on { display: grid; }
.vpanel { position: relative; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, 1fr); width: min(1120px, 100%); height: min(88vh, 780px); border-radius: 18px; overflow: hidden; background: var(--navy); box-shadow: 0 40px 80px rgba(0, 0, 0, .5); }
.vphoto { position: relative; overflow: hidden; background: #000; }
.vinfo { display: flex; flex-direction: column; padding: 30px 30px 26px; overflow: auto; }
.vinfo .who { display: flex; align-items: center; gap: 10px; padding-bottom: 16px; border-bottom: 1px solid var(--line); font-weight: 800; }
.vinfo .meta { margin-top: 16px; }
.vinfo .piece-title { margin-top: 12px; font-size: 1.6rem; }
.vinfo .price { font-size: 2.3rem; margin-top: 8px; }
.vacts { display: flex; gap: 10px; margin-top: auto; padding-top: 20px; }
.vacts .order { margin: 0; flex: 1; }
.vacts button { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--navy-2); }
.vacts svg { width: 22px; height: 22px; }
.vnav { position: absolute; top: 50%; z-index: 2; display: grid; place-items: center; width: 46px; height: 46px; margin-top: -23px; border-radius: 50%; background: rgba(247, 241, 230, .92); color: var(--night); font-size: 1.4rem; }
.vprev { right: 1.2vw; }
.vnext { left: 1.2vw; }
.vclose { position: absolute; top: 18px; left: 22px; z-index: 2; width: 40px; height: 40px; border-radius: 50%; background: rgba(247, 241, 230, .12); font-size: 1.4rem; }
.vpos { position: absolute; bottom: 14px; right: 14px; padding: 2px 10px; border-radius: 999px; background: rgba(0, 0, 0, .5); font-size: .72rem; }

.toast { position: fixed; z-index: 300; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); max-width: min(420px, 90vw); padding: 11px 18px; border-radius: 14px; background: var(--ivory); color: var(--night); font-size: .84rem; font-weight: 700; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); opacity: 0; pointer-events: none; transition: opacity .25s ease, transform .25s ease; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- footer, about and error pages ---------- */
.site-foot { width: min(1120px, 100% - 32px); margin: 30px auto 0; padding: 30px 0 24px; border-top: 1px solid var(--line); font-size: .82rem; color: var(--muted); }
.foot-grid { display: grid; gap: 24px; }
.foot-brand { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; color: var(--ivory); font-size: .95rem; }
.foot-brand .logo { width: 28px; height: 28px; }
.site-foot h2 { margin-bottom: 8px; font-size: .9rem; color: var(--ivory); }
.site-foot ul { list-style: none; display: grid; gap: 4px; }
.site-foot a:hover { color: var(--gold); }
.copyright { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); text-align: center; font-size: .76rem; }
.page-main { width: min(760px, 100% - 32px); margin: 40px auto 0; }
.page-main h1 { font-size: 1.6rem; font-weight: 900; }
.page-main h2 { margin: 26px 0 8px; font-size: 1.1rem; font-weight: 800; color: var(--gold); }
.page-main p { color: var(--muted); }
.lead { margin-top: 8px; }
.contact { display: grid; gap: 10px; margin-top: 18px; padding: 18px; border-radius: 16px; background: var(--navy); }
.contact b { display: block; color: var(--ivory); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.btn { display: inline-flex; padding: 10px 20px; border-radius: 999px; font-weight: 800; font-size: .88rem; background: var(--navy-2); }
.btn.main { background: var(--gold); color: var(--night); }
.error-page { padding: 60px 0; text-align: center; }
.error-page .actions { justify-content: center; }

@media (max-width: 899px) {
  .bar { flex-wrap: wrap; }
  .brand { flex: 0 0 auto; }
  .toggle { margin-inline-start: auto; }
  .rate { order: 3; flex: 0 0 100%; margin-inline-start: 0; flex-wrap: wrap; white-space: normal; justify-content: center; border-radius: 12px; }
}
@media (max-width: 380px) {
  .brand { font-size: .92rem; }
}
@media (min-width: 900px) {
  .toggle { display: none; }
  .profile { width: min(1120px, 100% - 48px); }
  .phead { padding: 30px 0 10px; gap: 8px 32px; }
  .big-logo { width: 140px; height: 140px; }
  .phead h1 { font-size: 1.7rem; }
  .stats { gap: 34px; font-size: .85rem; }
  .stats b { font-size: 1.25rem; }
  .bio { padding: 0; margin-inline-start: 172px; max-width: 46rem; font-size: .9rem; }
  .pbtns { width: 360px; margin-inline-start: 172px; padding: 14px 0; }
  .profile .stories { padding: 18px 0 8px; gap: 22px; }
  .profile .story { width: 84px; font-size: .78rem; }
  .profile .story .ring { width: 78px; height: 78px; }
  .cat-title { padding-inline: 0; font-size: 1.5rem; }
  .tools { top: 55px; padding: 12px 0; }
  .count, .note { padding-inline: 0; }
  .grid { grid-template-columns: repeat(4, 1fr); gap: 14px; }
  .tile { border-radius: 10px; }
  .tile:hover > img { transform: scale(1.04); }
  .tile .hov { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; padding: 14px; background: linear-gradient(180deg, transparent 45%, rgba(14, 20, 36, .92)); opacity: 0; transition: opacity .25s ease; }
  .tile:hover .hov, .tile:focus-visible .hov { opacity: 1; }
  .tile:hover .tp { opacity: 0; }
  .tile .hov b { font-size: .95rem; }
  .tile .hov span { font-size: .8rem; color: var(--muted); }
  .piece-detail { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; margin: 10px 0 24px; }
  .foot-grid { grid-template-columns: 1.4fr 1fr 1.2fr; gap: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  .burst.go { animation: none; }
  .top, .stories, .tile > img, .sheet, .sheet-panel { transition: none; }
}
