:root {
  --ease: cubic-bezier(0.25, 1, 0.5, 1);
  --ink: #141414;
  --muted: #7a7a7a;
  --line: #d4d4d2;
  --dw: min(1180px, 94vw);
  --dh: min(660px, calc(100dvh - 48px));
  --nav-top: calc((100dvh - var(--dh)) / 2);
}
html { scroll-behavior: smooth; }
body.cart-open { overflow: hidden; }
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }

/* ---------- Studio backdrop ---------- */
body {
  font-family: 'Poppins', 'Inter', system-ui, sans-serif;
  color: var(--ink);
  background: radial-gradient(circle, #f3f3f3 0%, #e2e2e2 100%);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.55;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .45 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* ---------- Floating device ---------- */
.device {
  position: relative;
  width: var(--dw);
  height: var(--dh);
  padding-top: 68px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 34px;
  background: linear-gradient(180deg, #f8f8f7, #ececeb);
  box-shadow: 0 50px 80px -30px rgba(0,0,0,.35), 0 10px 24px rgba(0,0,0,.08), inset 0 1px 0 #fff;
}

/* ---------- Header menu ---------- */
.nav {
  position: fixed; top: var(--nav-top); left: 50%; transform: translateX(-50%);
  width: var(--dw); height: 68px; padding: 0 48px; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  border-radius: 34px;
  transition: top .6s var(--ease), background .4s, box-shadow .4s;
}
.nav.scrolled {
  top: 12px;
  background: rgba(246, 246, 245, .85);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 14px 30px -14px rgba(0,0,0,.3), inset 0 1px 0 #fff;
}
.logo { font-weight: 700; font-size: 18px; letter-spacing: -0.04em; }
.links { display: flex; gap: 40px; list-style: none; }
.links a { font-size: 13px; opacity: .6; transition: opacity .3s, letter-spacing .4s var(--ease); }
.links a:hover { opacity: 1; letter-spacing: .02em; }
.links a.active { opacity: 1; font-weight: 600; }
.icons { display: flex; gap: 18px; }
.icon-btn { position: relative; display: grid; place-items: center; }
.badge {
  position: absolute; top: -6px; right: -7px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 99px; background: #c0262d; color: #fff;
  font-size: 9px; font-weight: 600; display: grid; place-items: center;
}
.badge { transition: transform .35s var(--ease); }
.badge.empty { transform: scale(0); }
.badge.bump { animation: pop .45s cubic-bezier(.34,1.56,.64,1); }

/* ---------- Stage / layout ---------- */
.stage { flex: 1; min-height: 0; display: flex; padding: 0 48px 28px; }
.left {
  flex: 0 0 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: flex-basis .6s var(--ease);
}
.detail {
  flex: 0 0 0%;
  min-width: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: flex-basis .6s var(--ease), opacity .5s var(--ease);
}
.view-detail .left { flex-basis: 50%; }
.view-detail .detail { flex-basis: 50%; opacity: 1; pointer-events: auto; overflow-y: auto; }

/* ---------- Headings ---------- */
.headings {
  position: relative; flex: none; width: 100%; height: 130px;
  transition: height .6s var(--ease), opacity .5s var(--ease);
}
.view-grid .headings { height: 84px; }
.view-detail .headings { height: 0; opacity: 0; }
.h {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; letter-spacing: -0.03em;
  transition: all .6s var(--ease);
}
.h span { font-weight: 400; font-size: clamp(20px, 2.4vw, 30px); }
.h strong { font-weight: 700; font-size: clamp(38px, 5.6vw, 70px); line-height: 1.05; }
.h-hero { animation: cascade 1.1s var(--ease) backwards; }
.h-grid { flex-direction: row; gap: .45em; opacity: 0; transform: translateY(24px); letter-spacing: .18em; }
.h-grid span, .h-grid strong { font-size: clamp(15px, 1.9vw, 24px); font-weight: 500; }
.h-grid strong { font-weight: 700; }
.view-grid .h-hero, .view-detail .h-hero { opacity: 0; transform: translateY(-34px) scale(.92); letter-spacing: .1em; }
.view-grid .h-grid { opacity: 1; transform: none; letter-spacing: -0.01em; }

/* ---------- Deck / cards ---------- */
.deck {
  --w: clamp(118px, 14vw, 168px);
  flex: 1; min-height: 0; width: 100%;
  display: flex; justify-content: center; align-items: center;
  padding: 0 0 8px;
}
.card {
  --tx: 0px; --r: 0deg; --ty: 0px; --z: 1;
  position: relative; flex: none;
  width: var(--w);
  height: clamp(210px, 38vh, 290px);
  margin-left: calc(var(--w) * -0.42);
  display: flex; flex-direction: column;
  cursor: pointer;
  z-index: var(--z);
  transform: translateX(var(--tx)) rotate(var(--r)) translateY(var(--ty));
  transition: all 0.6s cubic-bezier(0.25, 1, 0.5, 1);
  animation: rise .9s var(--ease) backwards;
}
.card:first-child { margin-left: 0; }
/* Fanned 3D deck */
.card:nth-child(1) { --tx: -60px; --r: -8deg; --ty: 15px; --z: 1; animation-delay: .35s; }
.card:nth-child(2) { --tx: -30px; --r: -4deg; --ty: 5px;  --z: 2; animation-delay: .43s; }
.card:nth-child(3) { --tx: 0px;   --r: 0deg;  --ty: 0px;  --z: 3; animation-delay: .51s; }
.card:nth-child(4) { --tx: 30px;  --r: 4deg;  --ty: 5px;  --z: 2; animation-delay: .59s; }
.card:nth-child(5) { --tx: 60px;  --r: 8deg;  --ty: 15px; --z: 1; animation-delay: .67s; }

.photo {
  flex: 1; min-height: 0; overflow: hidden;
  border-radius: 20px;
  background: #e8a33d;
  box-shadow: 0 18px 30px -14px rgba(0,0,0,.45);
  transition: all .6s var(--ease);
}
.card:nth-child(2) .photo { background: #c4501f; }
.card:nth-child(3) .photo { background: #f0b88a; }
.card:nth-child(4) .photo { background: #d9622b; }
.card:nth-child(5) .photo { background: #3e8ea0; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .8s var(--ease); }

.meta {
  max-height: 0; opacity: 0; overflow: hidden;
  transition: all .6s var(--ease);
}
.meta .row { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; }
.meta .row b { font-weight: 600; }
.meta .rate { font-size: 10px; color: var(--muted); margin-top: 2px; }
.meta .rate i { color: #e0a521; font-style: normal; }

/* View 1 hover: lift, straighten, neighbours drift */
.view-hero .card:hover {
  transform: translateX(var(--tx)) rotate(0deg) translateY(-20px) scale(1.08);
  z-index: 10;
}
.view-hero .card:hover + .card { translate: 26px 0; }
.view-hero .card:has(+ .card:hover) { translate: -26px 0; }

/* View 2: grid */
.view-grid .deck {
  justify-content: safe center;
  overflow-x: auto; overflow-y: hidden;
  padding: 18px 6px 14px;
  scrollbar-width: thin;
}
.view-grid .card { transform: none; margin-left: 22px; z-index: 1; }
.view-grid .card:first-child { margin-left: 0; }
.view-grid .meta { max-height: 60px; opacity: 1; padding-top: 10px; }
.view-grid .card:hover { transform: translateY(-8px); }
.view-grid .card:hover img { transform: scale(1.06); }

.see-all {
  flex: none; margin-top: 6px;
  height: 38px; padding: 0 22px; border-radius: 99px;
  background: var(--ink); color: #fff; font-size: 12px; font-weight: 500;
  transition: all .5s var(--ease);
}
.see-all:hover { transform: translateY(-2px); letter-spacing: .03em; }
.view-grid .see-all, .view-detail .see-all { opacity: 0; transform: translateY(14px); pointer-events: none; height: 0; margin: 0; }

/* View 3: detail */
.view-detail .deck { padding: 0 0 4px; justify-content: flex-start; align-items: stretch; }
.view-detail .card {
  width: 0; margin: 0; opacity: 0; transform: none; pointer-events: none; height: auto; animation: none;
}
.view-detail .card.is-selected {
  width: 100%; opacity: 1; z-index: 5; cursor: default;
}
.view-detail .card.is-selected .photo { border-radius: 28px; box-shadow: 0 26px 40px -22px rgba(0,0,0,.5); }
.view-detail .card.is-selected .meta { max-height: 0; opacity: 0; padding: 0; }

/* Detail panel */
.detail-inner {
  min-width: 300px; min-height: 100%;
  padding-left: clamp(20px, 5vw, 64px);
  display: flex; flex-direction: column; justify-content: center; gap: 18px;
}
.d-item { opacity: 0; transform: translateX(28px); transition: all .5s var(--ease); }
.view-detail .d-item { opacity: 1; transform: none; transition-delay: calc(var(--i) * 70ms + 220ms); }
.back { align-self: flex-start; font-size: 12px; color: var(--muted); transition: color .3s, transform .3s var(--ease); }
.back:hover { color: var(--ink); transform: translateX(-4px); }
.d-name { font-size: clamp(24px, 3vw, 34px); font-weight: 700; letter-spacing: -0.03em; text-transform: uppercase; line-height: 1.1; }
.d-price { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; margin-top: -8px; }
.d-desc { font-size: 12px; line-height: 1.75; color: var(--muted); max-width: 360px; }
.label { font-size: 12px; font-weight: 700; letter-spacing: .03em; margin-bottom: 10px; text-transform: uppercase; }

.sizes, .swatches { display: flex; gap: 12px; flex-wrap: wrap; }
.size {
  width: 40px; height: 40px; border-radius: 12px;
  border: 1px solid var(--line); font-size: 12px; font-weight: 500;
  transition: background .3s, color .3s, border-color .3s;
}
.size:hover { border-color: var(--ink); }
.size.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.swatch {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--c); border: 1px solid rgba(0,0,0,.18);
  transition: box-shadow .3s var(--ease);
}
.swatch.active { box-shadow: 0 0 0 3px #f4f4f3, 0 0 0 4.5px var(--ink); }
.size.pop, .swatch.pop { animation: pop .45s cubic-bezier(.34,1.56,.64,1); }

.actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  height: 46px; padding: 0 28px; border-radius: 99px;
  border: 1.5px solid var(--ink); font-size: 13px; font-weight: 600;
  transition: transform .4s var(--ease), background .3s, color .3s;
}
.btn:hover { transform: translateY(-3px); }
.btn:active { transform: scale(.96); }
.btn.primary { background: var(--ink); color: #fff; }
.btn.ghost:hover { background: var(--ink); color: #fff; }

.toast {
  position: fixed; left: 50%; bottom: 28px;
  transform: translate(-50%, 30px); opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; font-size: 13px;
  padding: 12px 22px; border-radius: 99px; z-index: 70;
  transition: all .5s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Keyframes ---------- */
@keyframes pop { 0% { transform: scale(.95); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes cascade { from { opacity: 0; transform: translateY(-70px); letter-spacing: .12em; } }
@keyframes rise { from { opacity: 0; translate: 0 60px; } }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  :root { --dw: 100vw; --dh: 100dvh; }
  .device { border-radius: 0; padding-top: 60px; }
  .nav { height: 60px; padding: 0 20px; border-radius: 0; }
  .nav.scrolled { width: calc(100vw - 16px); top: 8px; border-radius: 22px; }
  .links { gap: 14px; }
  .links a { font-size: 11px; }
  .stage { padding: 0 16px 16px; flex-direction: column; }
  .deck { --w: clamp(88px, 24vw, 130px); }
  .card { height: clamp(190px, 34vh, 260px); }
  .headings { height: 110px; }
  .view-detail .left { flex-basis: 44%; }
  .view-detail .detail { flex-basis: 56%; }
  .detail-inner { padding: 14px 0 0; gap: 12px; min-width: 0; justify-content: flex-start; }
  .d-desc { max-width: none; }
  .view-detail .deck { align-items: stretch; }
}
@media (max-width: 560px) { .icons { gap: 12px; } .logo { font-size: 16px; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
}

/* ---------- Page sections ---------- */
#home { min-height: 100dvh; display: grid; place-items: center; }
.section { min-height: 100dvh; display: grid; place-items: center; padding: 110px 0 48px; }
.panel {
  width: var(--dw);
  display: grid; grid-template-columns: 1fr 1fr; align-items: center;
  gap: clamp(28px, 5vw, 72px);
  padding: clamp(24px, 5vw, 64px);
  border-radius: 34px;
  background: linear-gradient(180deg, #f8f8f7, #ececeb);
  box-shadow: 0 50px 80px -30px rgba(0,0,0,.35), 0 10px 24px rgba(0,0,0,.08), inset 0 1px 0 #fff;
}
.panel h2 { font-size: clamp(28px, 4vw, 52px); font-weight: 700; letter-spacing: -0.04em; line-height: 1.06; }
.panel p { font-size: 14px; line-height: 1.8; color: var(--muted); max-width: 440px; margin-top: 18px; }
.mail { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.about-photo {
  width: 100%; aspect-ratio: 4 / 5; max-height: 520px; overflow: hidden;
  border-radius: 28px; background: #d9622b;
  box-shadow: 0 26px 40px -22px rgba(0,0,0,.5);
}
.about-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

.contact-form { display: flex; flex-direction: column; gap: 20px; }
.field span { display: block; font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.field input, .field textarea {
  width: 100%; padding: 10px 0; font: inherit; font-size: 14px; color: var(--ink);
  background: transparent; border: 0; border-bottom: 1.5px solid var(--line);
  border-radius: 0; resize: vertical; transition: border-color .3s;
}
.field input:focus, .field textarea:focus { outline: none; border-bottom-color: var(--ink); }
.contact-form .btn { align-self: flex-start; }

/* ---------- Cart drawer ---------- */
.cart-overlay {
  position: fixed; inset: 0; z-index: 55;
  background: rgba(20,20,20,.3); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  opacity: 0; visibility: hidden;
  transition: opacity .5s var(--ease), visibility 0s linear .5s;
}
.cart-overlay.active { opacity: 1; visibility: visible; transition: opacity .5s var(--ease), visibility 0s; }
.cart-drawer {
  position: fixed; top: 0; right: 0; z-index: 60;
  width: min(400px, 100vw); height: 100dvh;
  display: flex; flex-direction: column;
  background: #f6f6f5;
  box-shadow: -30px 0 60px -30px rgba(0,0,0,.35);
  transform: translateX(100%); visibility: hidden;
  transition: transform .6s var(--ease), visibility 0s linear .6s;
}
.cart-drawer.active { transform: none; visibility: visible; transition: transform .6s var(--ease), visibility 0s; }
.cart-head { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 24px 28px 12px; }
.cart-head h2 { font-size: 20px; font-weight: 600; letter-spacing: -0.03em; }
.cart-close { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); transition: transform .4s var(--ease), background .3s, color .3s; }
.cart-close:hover { background: var(--ink); color: #fff; transform: rotate(90deg); }
.cart-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 28px; }
.cart-empty { padding: 28px 0; font-size: 13px; line-height: 1.7; color: var(--muted); }
.cart-items { list-style: none; }
.cart-item {
  display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center;
  padding: 14px 0; border-bottom: 1px solid var(--line);
  animation: slide-in .5s var(--ease);
  transition: opacity .3s, transform .3s var(--ease);
}
.cart-item.leaving { opacity: 0; transform: translateX(30px); }
.cart-item img { width: 64px; height: 80px; object-fit: cover; border-radius: 12px; background: #e8a33d; }
.ci-name { font-size: 13px; font-weight: 600; }
.ci-meta { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); margin-top: 3px; }
.ci-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); border: 1px solid rgba(0,0,0,.2); }
.ci-price { font-size: 13px; font-weight: 600; margin-top: 8px; }
.ci-remove { width: 28px; height: 28px; border-radius: 50%; font-size: 18px; line-height: 1; color: var(--muted); transition: background .3s, color .3s; }
.ci-remove:hover { background: var(--ink); color: #fff; }
.cart-foot { flex: none; padding: 20px 28px 28px; border-top: 1px solid var(--line); }
.cart-total { display: flex; justify-content: space-between; font-size: 14px; font-weight: 600; margin-bottom: 14px; }
.cart-foot .btn { width: 100%; }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }
@keyframes slide-in { from { opacity: 0; transform: translateX(24px); } }

@media (max-width: 760px) {
  .panel { grid-template-columns: 1fr; border-radius: 26px; }
  .about-photo { aspect-ratio: 4 / 3; }
  .section { padding: 90px 0 32px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
