/* ===================================================================
   Spinka.uz — Toshkent mebel ishlab chiqaruvchisi
   Tashqi shrift/CDN ishlatilmaydi: sayt build'siz, offline ham ochiladi.
   =================================================================== */

:root {
  --bg: #0e0d0b;
  --bg-alt: #16140f;
  --surface: #1c1913;
  --text: #f6f2ea;
  --muted: #a9a094;
  --accent: #d99a4e;
  --accent-soft: rgba(217, 154, 78, 0.14);
  --line: rgba(246, 242, 234, 0.1);

  --shell: 1160px;
  --pad: clamp(1.15rem, 4vw, 2.5rem);
  --radius: 18px;
  --header-h: 68px;

  --font: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue",
    Roboto, Arial, sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img,
video {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3 {
  line-height: 1.12;
  letter-spacing: -0.02em;
  font-weight: 700;
  text-wrap: balance;
}

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--pad);
}

.eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.lede {
  color: var(--muted);
  font-size: clamp(1rem, 1.7vw, 1.12rem);
  max-width: 58ch;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem 1.6rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 0.98rem;
  white-space: nowrap;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    background-color 0.18s ease,
    border-color 0.18s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn--primary {
  background: var(--accent);
  color: #1a1206;
}

.btn--primary:hover {
  background: #e8ad64;
}

.btn--ghost {
  border-color: rgba(246, 242, 234, 0.28);
  color: var(--text);
  backdrop-filter: blur(6px);
}

.btn--ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn--sm {
  padding: 0.6rem 1.1rem;
  font-size: 0.9rem;
}

/* ----------------------------- Header ----------------------------- */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  transition:
    background-color 0.3s ease,
    border-color 0.3s ease,
    backdrop-filter 0.3s ease;
  border-bottom: 1px solid transparent;
}

.site-header.is-scrolled {
  background: rgba(14, 13, 11, 0.86);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}

.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.logo span {
  color: var(--accent);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.2vw, 1.9rem);
  font-size: 0.95rem;
}

.site-nav a:not(.btn) {
  color: var(--muted);
  transition: color 0.18s ease;
}

.site-nav a:not(.btn):hover {
  color: var(--text);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0 10px;
  background: none;
  border: 0;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ====================== Sahna: scroll-video ======================= */

.stage {
  /* Bu balandlik scroll "yo'li" — video shu masofada scrub qilinadi.
     Qiymatni o'zgartirish scrub tezligini o'zgartiradi. */
  height: 500vh;
  position: relative;
}

.stage-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  /* Video yuklanmaguncha (va xato bo'lsa ham) fon shu poster bo'lib turadi */
  background: #0e0d0b url("poster.jpg") center / cover no-repeat;
}

.stage-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.stage--no-video .stage-video {
  display: none;
}

.stage-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      180deg,
      rgba(14, 13, 11, 0.72) 0%,
      rgba(14, 13, 11, 0.28) 34%,
      rgba(14, 13, 11, 0.62) 74%,
      rgba(14, 13, 11, 0.94) 100%
    ),
    linear-gradient(90deg, rgba(14, 13, 11, 0.62) 0%, transparent 62%);
}

.stage-content {
  position: absolute;
  inset: auto 0 0 0;
  padding-bottom: clamp(4.5rem, 11vh, 7rem);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.4rem;
}

/* Sarlavhalar bir-birining ustiga joylashadi (grid stacking),
   balandlik eng balandi bo'yicha olinadi — almashganda sakramaydi. */
.stage-captions {
  display: grid;
  max-width: 40rem;
}

.stage-caption {
  grid-area: 1 / 1;
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.5s ease,
    transform 0.5s ease;
  pointer-events: none;
}

.stage-caption.is-active {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.stage-caption h1,
.stage-caption h2 {
  font-size: clamp(2rem, 5.2vw, 3.6rem);
  margin-bottom: 0.7rem;
}

.stage-caption p {
  color: rgba(246, 242, 234, 0.82);
  font-size: clamp(1rem, 1.9vw, 1.15rem);
  max-width: 46ch;
}

.stage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 1.4rem;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(246, 242, 234, 0.5);
}

.scroll-hint i {
  width: 1px;
  height: 34px;
  background: linear-gradient(
    180deg,
    rgba(246, 242, 234, 0.55),
    transparent
  );
}

/* --------------------------- Bo'limlar --------------------------- */

.section {
  padding-block: clamp(4.5rem, 10vw, 8rem);
}

.section--alt {
  background: var(--bg-alt);
}

.section-head {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-bottom: clamp(2.5rem, 5vw, 3.8rem);
  max-width: 62ch;
}

.section-head h2 {
  font-size: clamp(1.85rem, 4vw, 2.9rem);
}

.grid {
  display: grid;
  gap: clamp(1rem, 2vw, 1.5rem);
}

.grid--4 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}

.card,
.product {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.4rem, 2.5vw, 1.9rem);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  transition:
    transform 0.25s ease,
    border-color 0.25s ease;
}

.card:hover,
.product:hover {
  transform: translateY(-4px);
  border-color: rgba(217, 154, 78, 0.45);
}

.card-num {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--accent);
}

.card h3,
.product h3 {
  font-size: 1.18rem;
}

.card p,
.product p,
.step p {
  color: var(--muted);
  font-size: 0.97rem;
}

.product {
  background: linear-gradient(
    160deg,
    var(--surface) 0%,
    rgba(28, 25, 19, 0.55) 100%
  );
}

.section-cta {
  margin-top: clamp(2rem, 4vw, 3rem);
  padding: clamp(1.5rem, 3vw, 2.2rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--accent-soft);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
}

.section-cta p {
  font-size: 1.05rem;
  font-weight: 600;
  max-width: 46ch;
}

/* ---------------------------- Jarayon ---------------------------- */

.steps {
  list-style: none;
  counter-reset: step;
  display: grid;
  gap: clamp(1rem, 2vw, 1.4rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
}

.step {
  counter-increment: step;
  position: relative;
  padding-top: 2.9rem;
  border-top: 1px solid var(--line);
}

.step::before {
  content: "0" counter(step);
  position: absolute;
  top: 1rem;
  left: 0;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--accent);
}

.step h3 {
  font-size: 1.12rem;
  margin-bottom: 0.5rem;
}

/* ----------------------------- Aloqa ----------------------------- */

.contact {
  display: grid;
  gap: clamp(2rem, 4vw, 3.5rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  align-items: start;
}

.contact-copy {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.contact-copy h2 {
  font-size: clamp(1.8rem, 3.6vw, 2.6rem);
}

.contact-list {
  display: grid;
  gap: 0.9rem;
}

.contact-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1.15rem 1.35rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition:
    border-color 0.2s ease,
    transform 0.2s ease;
}

a.contact-item:hover {
  border-color: var(--accent);
  transform: translateX(4px);
}

.contact-label {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}

.contact-item strong {
  font-size: 1.28rem;
  letter-spacing: -0.01em;
}

.contact-note {
  font-size: 0.88rem;
  color: var(--muted);
}

/* ----------------------------- Footer ---------------------------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding-block: clamp(2.5rem, 5vw, 3.5rem);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  align-items: flex-start;
}

.footer-note {
  color: var(--muted);
  max-width: 46ch;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem;
  font-weight: 600;
}

.footer-links a:hover {
  color: var(--accent);
}

.copyright {
  font-size: 0.85rem;
  color: rgba(169, 160, 148, 0.7);
}

/* --------------------- Suzuvchi tugmalar (mobil) ------------------ */

.floating-actions {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  padding: 0.6rem var(--pad) calc(0.6rem + env(safe-area-inset-bottom));
  gap: 0.6rem;
  background: rgba(14, 13, 11, 0.92);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}

.fab {
  flex: 1;
  text-align: center;
  padding: 0.85rem 1rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
}

.fab--call {
  background: var(--accent);
  color: #1a1206;
}

.fab--ig {
  border: 1px solid rgba(246, 242, 234, 0.3);
  color: var(--text);
}

/* ------------------- Ko'ringanda paydo bo'lish ------------------- */

[data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

.grid > [data-reveal]:nth-child(2),
.steps > [data-reveal]:nth-child(2) {
  transition-delay: 0.08s;
}
.grid > [data-reveal]:nth-child(3),
.steps > [data-reveal]:nth-child(3) {
  transition-delay: 0.16s;
}
.grid > [data-reveal]:nth-child(4),
.steps > [data-reveal]:nth-child(4) {
  transition-delay: 0.24s;
}

/* ============================ Mobil ============================== */

@media (max-width: 860px) {
  .nav-toggle {
    display: flex;
    order: 2;
  }

  .site-nav {
    order: 3;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0 var(--pad);
    background: rgba(14, 13, 11, 0.97);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  .site-nav.is-open {
    max-height: 22rem;
    padding-bottom: 1.1rem;
  }

  .site-nav a:not(.btn) {
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--line);
    font-size: 1.02rem;
  }

  .site-nav .btn {
    margin-top: 1rem;
  }
}

@media (max-width: 768px) {
  .stage {
    /* Mobilda scroll masofasi qisqaroq — barmoq bilan tez o'tiladi */
    height: 380vh;
  }

  .stage-content {
    padding-bottom: clamp(6rem, 16vh, 9rem);
  }

  .scroll-hint {
    display: none;
  }

  .floating-actions {
    display: flex;
  }

  /* Suzuvchi tugmalar footerni yopib qolmasligi uchun */
  .site-footer {
    padding-bottom: 6rem;
  }

  .section-cta {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ==================== Harakatni kamaytirish ====================== */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* JS shu klassni qo'yadi: scrub o'chadi, sahna oddiy bo'limga aylanadi */
.reduce-motion .stage {
  height: auto;
}

.reduce-motion .stage-sticky {
  position: static;
  height: auto;
  min-height: 100vh;
  display: flex;
  align-items: flex-end;
}

.reduce-motion .stage-content {
  position: static;
  padding-block: calc(var(--header-h) + 3rem) clamp(3rem, 8vh, 5rem);
}

.reduce-motion .stage-captions {
  display: flex;
  flex-direction: column;
  gap: 2.2rem;
  max-width: 46rem;
}

.reduce-motion .stage-caption {
  grid-area: auto;
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.reduce-motion [data-reveal] {
  opacity: 1;
  transform: none;
}

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