/* ==========================================================================
   Moziy family restaurant — vizitka
   Dizayn tokenlari :root da. Hujjat: docs/design-system.md
   ========================================================================== */

:root {
  /* Ranglar */
  --bordo: #591313;
  --bordo-deep: #3f0c0c;
  --bordo-ink: #2b0a0a;
  --cream: #f5ebdd;
  --cream-logo: #f9e3bb;
  --sand: #ebdcc3;
  --gold: #b8893b;
  --ink: #2a1a16;
  --ink-soft: #6a5047;

  /* Shrift */
  --font-display: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Oraliq */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 72px;

  /* Shakl */
  --r-pill: 999px;
  --r-card: 20px;
  --r-sheet: 26px;
  --line: rgba(89, 19, 19, 0.18);

  /* Harakat */
  --ease: cubic-bezier(0.22, 0.8, 0.24, 1);
  --t-fast: 0.18s;
  --t-sheet: 0.32s;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}
html.lock, html.lock body { overflow: hidden; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
img, svg { display: block; max-width: 100%; }
h1, h2, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip {
  position: absolute;
  left: var(--s-4);
  top: -80px;
  z-index: 100;
  padding: var(--s-3) var(--s-4);
  background: var(--bordo);
  color: var(--cream);
  border-radius: var(--r-pill);
  text-decoration: none;
}
.skip:focus { top: var(--s-3); }

/* ---------- Yuqori panel ---------- */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: calc(var(--s-4) + env(safe-area-inset-top)) var(--s-5) var(--s-3);
}

.top__brand {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  color: var(--bordo);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
}

.lang {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.35);
}
.lang__btn {
  min-width: 46px;
  height: 36px;
  padding: 0 var(--s-3);
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--bordo);
  transition: background var(--t-fast), color var(--t-fast);
}
.lang__btn[aria-pressed="true"] {
  background: var(--bordo);
  color: var(--cream);
}
.lang__btn:not([aria-pressed="true"]):hover { background: rgba(89, 19, 19, 0.08); }

/* ---------- Asosiy sahifa ---------- */

.page {
  flex: 1;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: var(--s-3) var(--s-5) var(--s-7);
}

.hero {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas:
    "title"
    "lead"
    "art"
    "actions";
  gap: 0;
  justify-items: center;
  text-align: center;
}
.hero__copy { display: contents; }

.hero__title {
  grid-area: title;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.5rem, 11vw, 3.4rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
  color: var(--bordo);
  text-wrap: balance;
}
.hero__lead {
  grid-area: lead;
  max-width: 30ch;
  margin-top: var(--s-3);
  color: var(--ink-soft);
  font-size: 1rem;
  text-wrap: balance;
}

/* ---------- Ravoq va yozuvlar ---------- */

.art {
  grid-area: art;
  position: relative;
  container-type: inline-size;
  width: min(100%, 320px);
  aspect-ratio: 360 / 430;
  margin: var(--s-4) 0 var(--s-5);
}
.art__svg { width: 100%; height: 100%; overflow: visible; }

.art__logo {
  position: absolute;
  left: 50%;
  top: 63%;
  width: 21.5%;
  height: auto;
  transform: translate(-50%, -50%);
}

.callout {
  position: absolute;
  width: 25%;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(13.5px, 4.6cqw, 21px);
  line-height: 1.12;
  color: var(--bordo);
  transform: translateY(-50%);
}
.callout--l1, .callout--l2 { left: 0; text-align: right; padding-right: 2px; }
.callout--r1, .callout--r2 { right: 0; text-align: left; padding-left: 2px; }
.callout--l1, .callout--r1 { top: 39.5%; }
.callout--l2, .callout--r2 { top: 82%; }

/* ---------- Tugmalar ---------- */

.actions {
  grid-area: actions;
  display: grid;
  gap: var(--s-3);
  width: 100%;
  max-width: 420px;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-3);
  min-height: 58px;
  padding: 0 var(--s-5);
  border-radius: var(--r-pill);
  border: 1px solid var(--bordo);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast);
}
.btn:active { transform: scale(0.985); }
.btn__icon { width: 22px; height: 22px; flex: none; }

.btn--primary {
  background: var(--bordo);
  color: var(--cream);
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}
.btn--primary:hover { background: var(--bordo-deep); }
.btn--primary .btn__icon { transition: transform var(--t-fast); }
.btn--primary:hover .btn__icon { transform: translateX(3px); }

.btn--ghost {
  background: transparent;
  color: var(--bordo);
  justify-content: flex-start;
  text-align: left;
  padding-left: var(--s-5);
}
.btn--ghost:hover { background: rgba(89, 19, 19, 0.07); }
.btn__stack { display: grid; line-height: 1.2; }
.btn__label { font-size: 0.95rem; }
.btn__sub { font-size: 0.8rem; font-weight: 500; color: var(--ink-soft); }

/* ---------- Manzil ---------- */

.where {
  display: grid;
  gap: var(--s-3);
  justify-items: center;
  margin: var(--s-7) auto 0;
  max-width: 520px;
}

.where__card {
  position: relative;
  display: grid;
  grid-template-columns: 104px 1fr;
  gap: var(--s-4);
  align-items: center;
  width: 100%;
  padding: var(--s-4);
  text-align: left;
  background: var(--sand);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}
.where__card::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(184, 137, 59, 0.38);
  border-radius: calc(var(--r-card) - 5px);
  pointer-events: none;
}
.where__card:hover { box-shadow: 0 10px 30px -14px rgba(89, 19, 19, 0.35); transform: translateY(-1px); }
.where__card:active { transform: scale(0.99); }

.where__map {
  align-self: stretch;
  min-height: 132px;
  overflow: hidden;
  border-radius: 12px;
}
.where__map svg { width: 100%; height: 100%; }

.where__text { display: grid; gap: 2px; padding: var(--s-1) var(--s-1) var(--s-1) 0; }
.where__eyebrow {
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.where__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.45rem;
  line-height: 1.1;
  color: var(--bordo);
}
.where__line { font-size: 0.92rem; line-height: 1.35; margin-top: var(--s-1); }
.where__landmark { font-size: 0.82rem; line-height: 1.35; color: var(--ink-soft); }
.where__open {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  margin-top: var(--s-2);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--bordo);
}

.call {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  min-height: 44px;
  padding: 0 var(--s-4);
  border-radius: var(--r-pill);
  color: var(--bordo);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
}
.call:hover { background: rgba(89, 19, 19, 0.07); }

/* ---------- Pastki qism ---------- */

.foot { padding-bottom: calc(var(--s-5) + env(safe-area-inset-bottom)); text-align: center; }
.foot__ornament {
  height: 28px;
  margin-bottom: var(--s-4);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 28'%3E%3Cpath d='M20 2 28 14 20 26 12 14Z' fill='%23591313'/%3E%3Cpath d='M20 9 24 14 20 19 16 14Z' fill='%23F5EBDD'/%3E%3Ccircle cx='2' cy='14' r='3' fill='%23591313'/%3E%3Ccircle cx='38' cy='14' r='3' fill='%23591313'/%3E%3C/svg%3E");
  background-size: 40px 28px;
  background-repeat: repeat-x;
  background-position: center;
}
.foot__text { font-size: 0.8rem; color: var(--ink-soft); }

/* ---------- Pastdan chiquvchi oyna (xarita) ---------- */

.sheet {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(43, 10, 10, 0.55);
  opacity: 0;
  transition: opacity var(--t-sheet) var(--ease);
}
.sheet__panel {
  position: relative;
  width: 100%;
  max-width: 460px;
  padding: var(--s-3) var(--s-5) calc(var(--s-5) + env(safe-area-inset-bottom));
  background: var(--cream);
  border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  transform: translateY(100%);
  transition: transform var(--t-sheet) var(--ease);
}
.sheet.is-open .sheet__backdrop { opacity: 1; }
.sheet.is-open .sheet__panel { transform: none; }

.sheet__grab {
  width: 44px;
  height: 4px;
  margin: 0 auto var(--s-4);
  border-radius: var(--r-pill);
  background: var(--line);
}
.sheet__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.7rem;
  line-height: 1.1;
  color: var(--bordo);
}
.sheet__hint { margin-top: var(--s-1); font-size: 0.9rem; color: var(--ink-soft); }

.maps { display: grid; gap: var(--s-2); margin-top: var(--s-4); }
.maps__item {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  min-height: 60px;
  padding: 0 var(--s-4);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbf5ec;
  font-weight: 600;
  text-decoration: none;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.maps__item:hover { background: var(--sand); border-color: var(--gold); }
.maps__dot {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
}
.maps__dot--yandex { background: #fc3f1d; }
.maps__dot--google { background: #34a853; }
.maps__dot--apple { background: #1c1c1e; }

.sheet__close {
  width: 100%;
  min-height: 52px;
  margin-top: var(--s-3);
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--bordo);
  font-weight: 700;
}
.sheet__close:hover { background: rgba(89, 19, 19, 0.07); }

/* ---------- Menyu ko'rsatgich ---------- */

.viewer {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  background: var(--bordo-ink);
  color: var(--cream);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--t-sheet) var(--ease), transform var(--t-sheet) var(--ease);
}
.viewer.is-open { opacity: 1; transform: none; }

.viewer__bar {
  display: grid;
  grid-template-columns: 48px 1fr 64px;
  align-items: center;
  padding: calc(var(--s-2) + env(safe-area-inset-top)) var(--s-3) var(--s-2);
}
.viewer__close {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(249, 227, 187, 0.1);
  color: var(--cream-logo);
}
.viewer__close:hover { background: rgba(249, 227, 187, 0.2); }
.viewer__title {
  text-align: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.5rem;
  color: var(--cream-logo);
}
.viewer__count {
  text-align: right;
  padding-right: var(--s-2);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(249, 227, 187, 0.7);
  font-variant-numeric: tabular-nums;
}

.viewer__tabs {
  display: flex;
  gap: var(--s-1);
  align-self: center;
  margin: var(--s-1) 0 var(--s-3);
  padding: 3px;
  border-radius: var(--r-pill);
  background: rgba(249, 227, 187, 0.1);
}
.viewer__tab {
  min-width: 112px;
  height: 40px;
  padding: 0 var(--s-5);
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--cream-logo);
  font-size: 0.9rem;
  font-weight: 700;
  transition: background var(--t-fast), color var(--t-fast);
}
.viewer__tab[aria-selected="true"] { background: var(--cream-logo); color: var(--bordo); }

.viewer__note {
  max-width: 560px;
  margin: 0 auto var(--s-3);
  padding: 0 var(--s-5);
  text-align: center;
  font-size: 0.85rem;
  color: rgba(249, 227, 187, 0.85);
}

.viewer__scroll {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: auto;
  outline: none;
}
.viewer__pages {
  display: grid;
  gap: var(--s-3);
  max-width: 640px;
  margin: 0 auto;
  padding: var(--s-1) var(--s-3) calc(var(--s-6) + env(safe-area-inset-bottom));
}
.viewer__page {
  width: 100%;
  height: auto;
  aspect-ratio: var(--page-ratio, 1076 / 1521);
  background: var(--cream) center / 40px no-repeat;
  border-radius: 6px;
}
.viewer__status { padding: var(--s-6) 0; text-align: center; color: rgba(249, 227, 187, 0.75); font-size: 0.9rem; }

/* ---------- Kirish animatsiyasi ---------- */

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.art__outline, .art__lines path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.5s var(--ease) 0.2s forwards; }
.art__lines path { animation-delay: 0.9s; animation-duration: 0.8s; }
.art__logo { animation: fade 0.9s ease 0.5s backwards; }
.callout { animation: fade 0.8s ease backwards; }
.callout--l1 { animation-delay: 1.1s; } .callout--r1 { animation-delay: 1.2s; }
.callout--l2 { animation-delay: 1.3s; } .callout--r2 { animation-delay: 1.4s; }
.hero__title { animation: rise 0.8s var(--ease) 0.05s backwards; }
.hero__lead  { animation: rise 0.8s var(--ease) 0.15s backwards; }
.actions     { animation: rise 0.8s var(--ease) 0.35s backwards; }
.where       { animation: rise 0.8s var(--ease) 0.5s backwards; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .art__outline, .art__lines path { stroke-dashoffset: 0; }
}

/* ---------- Kengroq ekranlar ---------- */

@media (min-width: 560px) {
  .btn--ghost { padding-left: var(--s-6); }
  .sheet { align-items: center; }
  .sheet__panel { border-radius: var(--r-sheet); transform: translateY(24px); opacity: 0; transition: transform var(--t-sheet) var(--ease), opacity var(--t-sheet) var(--ease); }
  .sheet.is-open .sheet__panel { opacity: 1; }
  .sheet__grab { display: none; }
}

@media (min-width: 880px) {
  .page { padding-top: var(--s-6); }
  .hero {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    grid-template-areas:
      "title art"
      "lead  art"
      "actions art";
    grid-template-rows: auto auto 1fr;
    column-gap: var(--s-8);
    justify-items: start;
    align-items: start;
    text-align: left;
  }
  .hero__title { font-size: clamp(3.4rem, 6vw, 4.8rem); align-self: end; padding-top: var(--s-7); }
  .hero__lead { max-width: 34ch; margin-top: var(--s-4); font-size: 1.15rem; }
  .actions { margin-top: var(--s-6); align-self: start; }
  .art { grid-area: art; justify-self: center; align-self: center; width: min(100%, 460px); margin: 0; }
  .where { margin: var(--s-8) 0 0; max-width: 560px; justify-items: start; }
  .where__card { grid-template-columns: 128px 1fr; }
}
