/* ============================================================
   MERIDIAN — FX sections & components
   ============================================================ */

/* ===== 02 MAGNETIC LINK BASE ===== */
.mag-link { display: inline-block; transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1); }

/* ===== 08 HAMBURGER ===== */
.burger { display: none; width: 40px; height: 40px; flex-direction: column; gap: 5px; align-items: center; justify-content: center; }
.burger span { width: 20px; height: 1.5px; background: var(--ink); transition: transform 0.35s var(--ease), opacity 0.25s var(--ease); }
.burger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.burger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: 0; top: 0; z-index: 95; background: var(--paper);
  transform: translateX(100%); transition: transform 0.45s var(--ease);
  display: flex; flex-direction: column; justify-content: center; gap: 40px; padding: 96px 28px 40px;
}
.mobile-menu.open { transform: none; }
.mobile-menu__links { display: flex; flex-direction: column; }
.mobile-menu__links a { font-family: var(--serif); font-style: italic; font-size: clamp(32px, 9vw, 44px); padding: 12px 0; border-bottom: 1px solid var(--ghost); }
.mobile-menu__foot { display: flex; gap: 28px; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--mid); }
@media (min-width: 881px) { .mobile-menu { display: none; } }
@media (max-width: 880px) { .burger { display: flex; } }

/* ===== 08 ADD-TO-CART MORPH ===== */
.card__add { position: relative; transition: color 0.2s var(--ease), transform 0.2s var(--ease); }
.card__add.morphing { color: transparent; transform: scale(1.08); }
.card__add.morphing svg { opacity: 0; }
.card__add.morphing::after {
  content: '✓'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #1a8a3e; font-size: 14px; font-weight: 600;
}

/* ===== 17 CONFETTI ===== */
.confetti { position: fixed; top: 0; left: 0; z-index: 490; pointer-events: none; border-radius: 1px; will-change: transform, opacity; }

/* ===== 14 PAGE WIPE ===== */
.page-wipe { position: fixed; inset: 0; background: var(--ink); z-index: 600; transform: translateX(-101%); pointer-events: none; }
.page-wipe.cover { transform: translateX(0); transition: transform 0.4s var(--ease); }
.page-wipe.clear { transform: translateX(101%); transition: transform 0.36s var(--ease); }

/* ===== 16 CART DRAWER ===== */
.cart-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0); z-index: 300; pointer-events: none; transition: background 0.35s var(--ease); }
.cart-backdrop.show { background: rgba(0,0,0,0.45); pointer-events: auto; }
.cart-panel {
  position: fixed; top: 0; right: 0; height: 100vh; width: 380px; max-width: 88vw;
  background: var(--paper); z-index: 301; transform: translateX(100%);
  transition: transform 0.5s cubic-bezier(0.34,1.56,0.64,1);
  display: flex; flex-direction: column; box-shadow: -20px 0 50px -20px rgba(0,0,0,0.3); touch-action: pan-y;
}
.cart-panel.open { transform: translateX(0); }
.cart-panel__head { display: flex; align-items: center; justify-content: space-between; padding: 22px 24px; border-bottom: 1px solid var(--ghost); }
.cart-panel__title { font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 500; }
.cart-panel__count { font-style: normal; color: var(--mid); margin-left: 4px; }
.cart-panel__items { flex: 1; overflow-y: auto; padding: 4px 24px; }
.cart-item { display: grid; grid-template-columns: 60px 1fr auto; gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--ghost); }
.cart-item__thumb { width: 60px; height: 76px; background: linear-gradient(155deg, #e7e2d8, #c2b6a2); }
.cart-item__name { font-size: 13px; }
.cart-item__meta { font-size: 11px; color: var(--mid); margin: 4px 0 12px; }
.cart-item__qty { display: flex; align-items: center; gap: 12px; }
.qbtn { width: 24px; height: 24px; border: 1px solid var(--ghost); display: flex; align-items: center; justify-content: center; font-size: 14px; color: var(--ink); background: var(--white); transition: border-color 0.2s var(--ease); }
.qbtn:hover { border-color: var(--ink); }
.cart-item__qty span { font-size: 12px; min-width: 14px; text-align: center; }
.cart-item__price { font-size: 13px; }
.cart-panel__foot { padding: 22px 24px; border-top: 1px solid var(--ghost); display: flex; flex-direction: column; }
.cart-panel__row { display: flex; justify-content: space-between; font-size: 14px; font-weight: 500; margin-bottom: 8px; }
.cart-panel__note { font-size: 11px; color: var(--mid); margin-bottom: 18px; }
.cart-panel__checkout { width: 100%; }
.cart-panel__view { width: 100%; margin-bottom: 10px; }
.cart-panel__empty { flex: 1; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 20px; padding: 24px; text-align: center; color: var(--mid); font-size: 13px; }
.cart-panel.is-empty .cart-panel__items, .cart-panel.is-empty .cart-panel__foot { display: none; }
.cart-panel.is-empty .cart-panel__empty { display: flex; }
.cart-item__rm { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mid); margin-left: 6px; text-decoration: underline; text-underline-offset: 2px; }
.cart-item__rm:hover { color: var(--rust); }

/* ===== 11 FLIP CARDS ===== */
.flips { padding: 96px var(--pad); background: var(--cream); border-top: 1px solid var(--ghost); }
.flips__head { text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center; margin-bottom: 40px; }
.flips__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.flip { perspective: 1100px; }
.flip__inner { position: relative; transform-style: preserve-3d; transition: transform 0.6s cubic-bezier(0.16,1,0.3,1); }
.flip:hover .flip__inner { transform: rotateY(180deg); }
.flip__face { backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.flip__front .ph { height: 360px; }
.flip__info { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 2px 0; }
.flip__back {
  position: absolute; inset: 0; transform: rotateY(180deg);
  background: var(--ink); color: #fff; padding: 26px 24px; display: flex; flex-direction: column;
}
.flip__back-head { font-size: 14px; font-weight: 500; letter-spacing: 0.02em; margin-bottom: 14px; }
.flip__desc { font-size: 12px; line-height: 1.75; color: rgba(255,255,255,0.72); margin-bottom: auto; }
.flip__back .card__sizes { display: flex; gap: 6px; margin: 18px 0; }
.flip__back .size { background: transparent; color: rgba(255,255,255,0.7); border-color: rgba(255,255,255,0.25); }
.flip__back .size:hover { border-color: rgba(255,255,255,0.6); color: #fff; }
.flip__back .size.sel { border-color: #fff; color: #fff; }
.flip__back .card__add { color: #fff; align-self: flex-start; }
.flip__back .card__add:hover { color: var(--rust); }

/* image-distortion fallback (12) on look tiles */
.look:hover .ph { transform: scale(1.05) skewX(-1.3deg); }

/* ===== 05 HORIZONTAL SCROLL STORY ===== */
.hscroll { position: relative; height: 560vh; background: var(--cream); }
.hscroll__inner { position: sticky; top: 0; height: 100vh; overflow: hidden; display: flex; align-items: center; }
.hscroll__track { display: flex; height: 100vh; will-change: transform; }
.hpanel { flex: 0 0 100vw; height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; padding: 0 8vw; text-align: center; position: relative; }
.hpanel__eyebrow { font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--mid); }
.hpanel__idx { font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--mid); }
.hpanel__title { font-family: var(--serif); font-style: italic; font-size: clamp(52px, 9vw, 150px); line-height: 0.95; letter-spacing: -0.02em; }
.hpanel__title em { font-style: italic; }

/* P1 clip reveal */
.hpanel--intro .cl { display: inline-block; opacity: 0; transform: translateY(40px); clip-path: inset(0 0 110% 0); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease), clip-path 0.9s var(--ease); }
.hpanel--intro .cl:nth-child(2) { transition-delay: 0.12s; }
.hpanel--intro.in .cl { opacity: 1; transform: none; clip-path: inset(-12% 0); }

/* P2 stats */
.hpanel--stats { flex-direction: row; gap: 6vw; flex-wrap: wrap; }
.hstat { display: flex; flex-direction: column; gap: 10px; opacity: 0; transform: translateY(22px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.hstat:nth-child(2) { transition-delay: 0.1s; }
.hstat:nth-child(3) { transition-delay: 0.2s; }
.hpanel--stats.in .hstat { opacity: 1; transform: none; }
.hstat b { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: clamp(64px, 9vw, 130px); line-height: 1; color: var(--rust); }
.hstat span { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--mid); }

/* P3 image wipe */
.hpanel__photo { width: min(680px, 80vw); height: 60vh; position: relative; overflow: hidden; }
.hpanel__wipe { position: absolute; inset: 0; background: var(--cream); transform: scaleX(1); transform-origin: left; z-index: 3; }
.hpanel__photo.go .hpanel__wipe { transform: scaleX(0); transform-origin: right; transition: transform 1s var(--ease); }
.hpanel__cap { font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--mid); }

/* P4 grid */
.hgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; width: min(960px, 86vw); }
.hgrid .ph { height: 300px; }

/* P5 manifesto */
.manifesto { font-family: var(--serif); font-style: italic; font-size: clamp(28px, 3.6vw, 54px); line-height: 1.34; max-width: 1040px; }
.manifesto .mw { opacity: 0.16; transition: opacity 0.3s var(--ease); }
.manifesto .mw.lit { opacity: 1; }

/* P6 cta */
.hpanel--cta .burst { position: absolute; left: 50%; top: 58%; width: 1px; height: 1px; }

/* progress + hint */
.hscroll__progress { position: absolute; left: 8vw; right: 8vw; bottom: 40px; height: 2px; background: var(--ghost); z-index: 5; }
.hscroll__progress i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--rust); }
.hscroll__hint { position: absolute; right: 8vw; bottom: 54px; font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--mid); z-index: 5; }

/* ===== responsive ===== */
@media (max-width: 1100px) { .flips__grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 880px) {
  .hpanel__title { font-size: clamp(44px, 13vw, 90px); }
  .hgrid { grid-template-columns: repeat(2, 1fr); }
  .hgrid .ph { height: 220px; }
  .hpanel--stats { gap: 36px; }
}
@media (max-width: 560px) { .flips__grid { grid-template-columns: 1fr; } }

/* ===== reduced motion: unpin horizontal story ===== */
@media (prefers-reduced-motion: reduce) {
  .hscroll { height: auto; }
  .hscroll__inner { position: static; height: auto; overflow: visible; }
  .hscroll__track { flex-direction: column; transform: none !important; height: auto; }
  .hpanel { flex: none; width: 100%; height: auto; min-height: 72vh; padding: 80px 8vw; }
  .hpanel--intro .cl { opacity: 1; transform: none; clip-path: none; }
  .hstat { opacity: 1; transform: none; }
  .hscroll__progress, .hscroll__hint { display: none; }
}
