/* MEHERMA Atelier 1.1 — considered motion, editorial browsing. */
:root {
  --motion-ease: cubic-bezier(.22, 1, .36, 1);
}
html { scroll-padding-top: 176px; }
.site-header { position: sticky; top: 0; z-index: 35; transition: box-shadow .35s ease; }
.has-scrolled .site-header { box-shadow: 0 8px 30px #0000001c; }
.page-progress { position: absolute; bottom: 0; left: 0; width: 100%; height: 2px; pointer-events: none; overflow: hidden; }
.page-progress span { display: block; width: 100%; height: 100%; background: var(--gold); transform: scaleX(0); transform-origin: left; }
.site-header .brand-logo { transition: transform .6s var(--motion-ease); }
.site-header .brand:hover .brand-logo { transform: rotate(-5deg); }
.main-nav > a { position: relative; }
.main-nav > a::after { content: ''; position: absolute; bottom: 10px; left: 0; width: 100%; height: 1px; background: var(--gold); transform: scaleX(0); transform-origin: right; transition: transform .35s var(--motion-ease); }
.main-nav > a:hover::after, .main-nav > a:focus-visible::after { transform: scaleX(1); transform-origin: left; }
.button { transition: background .25s ease, color .25s ease, border-color .25s ease, box-shadow .35s ease; }
.button svg, .text-link svg, .category-info > svg, .editorial-secondary svg { transition: transform .4s var(--motion-ease); flex-shrink: 0; }
.button:hover svg:last-child, .text-link:hover svg:last-child, .category-card:hover .category-info > svg, .editorial-secondary:hover svg { transform: translateX(4px); }
.button:active { box-shadow: inset 0 0 0 2px #bca26a66; }
.button:focus-visible, .icon-button:focus-visible, .rail-button:focus-visible, .hero-chapters button:focus-visible, .hero-navigation button:focus-visible { outline: 2px solid var(--gold); outline-offset: 5px; }
.icon-button { transition: color .2s, background .2s, transform .3s var(--motion-ease); }
.icon-button:active { transform: scale(.94); }

/* Slides share one grid cell, so changing chapters never shifts the page. */
.premium-hero { min-height: 640px; isolation: isolate; }
.hero-slides { display: grid; touch-action: pan-y; }
.hero-slide { grid-area: 1 / 1; position: relative; min-width: 0; background: #161713; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .9s ease, visibility 0s .9s; }
.hero-slide.is-active { opacity: 1; visibility: visible; pointer-events: auto; z-index: 1; transition: opacity .9s ease, visibility 0s; }
.premium-hero .hero-content { min-height: 640px; }
.premium-hero .hero-copy { padding-top: 38px; padding-bottom: 106px; }
.premium-hero .hero-bottom { display: none; }
.premium-hero .hero-visual { overflow: hidden; }
.premium-hero .hero-visual img { transform: scale(1.035); transition: transform 8s linear; }
.premium-hero .hero-slide.is-active .hero-visual img { transform: scale(1); }
.premium-hero .hero-copy > * { opacity: 0; transform: translateY(18px); transition: opacity .65s ease, transform .85s var(--motion-ease); }
.premium-hero .is-active .hero-copy > * { opacity: 1; transform: translateY(0); }
.premium-hero .is-active .hero-copy > :nth-child(2) { transition-delay: .08s; }
.premium-hero .is-active .hero-copy > :nth-child(3) { transition-delay: .14s; }
.premium-hero .is-active .hero-copy > :nth-child(4) { transition-delay: .2s; }
.premium-hero .hero-image-note { bottom: 116px; }
.hero-slide--beauty .hero-visual img { object-position: center 55%; }
.hero-slide--gifting .hero-visual { background: #0b0c0d; }
.hero-slide--gifting .hero-visual img { object-fit: contain; object-position: center; padding: 30px; }
.hero-slide--gifting .hero-title, .hero-slide--beauty .hero-title { font-size: clamp(60px, 5.8vw, 88px); }
.hero-controls { position: absolute; bottom: 27px; left: 50%; transform: translateX(-50%); width: 100%; display: flex; justify-content: space-between; align-items: flex-end; gap: 26px; z-index: 3; }
.hero-chapters { display: flex; gap: 26px; max-width: 440px; }
.hero-chapters button { position: relative; display: flex; gap: 9px; align-items: center; min-height: 48px; padding: 12px 1px; border: 0; border-bottom: 1px solid #f4ecd333; background: transparent; color: #cecabd; font-size: 9px; letter-spacing: 1.45px; text-transform: uppercase; transition: color .3s ease; }
.hero-chapters button::after { content: ''; position: absolute; bottom: -1px; left: 0; width: 100%; height: 2px; background: var(--gold); transform: scaleX(0); transform-origin: left; transition: transform .6s var(--motion-ease); }
.hero-chapters button.is-active, .hero-chapters button[aria-pressed=true] { color: #f9f1df; }
.hero-chapters button.is-active::after, .hero-chapters button[aria-pressed=true]::after { transform: scaleX(1); }
.chapter-number { color: #b39d73; font-size: 8px; letter-spacing: 0; }
.hero-navigation { display: flex; gap: 8px; align-items: center; }
.hero-navigation button { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid #eee3c84a; color: #f7efdf; border-radius: 50%; background: #16171340; transition: background .25s, border-color .25s; }
.hero-navigation button:hover { background: #b69a64; border-color: #b69a64; color: #171812; }
.hero-navigation svg { width: 18px; height: 18px; }
.hero-navigation [data-carousel-toggle] { margin-right: 10px; border-color: transparent; background: transparent; }
.hero-navigation [data-carousel-toggle] svg { width: 15px; height: 15px; }
.arrow-previous svg { transform: rotate(180deg); }
svg[hidden], [data-play-icon][hidden], [data-pause-icon][hidden] { display: none !important; }

/* Native momentum + scroll-snap: all collections remain reachable by touch. */
[data-rail-track] { scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-behavior: smooth; overscroll-behavior-x: contain; }
[data-rail-track]::-webkit-scrollbar { display: none; }
[data-rail-track]:focus-visible { outline: 2px solid var(--gold-dark); outline-offset: 5px; }
.collection-carousel .category-grid, .recent-grid { display: grid; grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: calc((100% - 72px) / 4); gap: 24px; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scroll-padding: 0; padding: 4px 0 8px; }
[data-rail-track] > * { scroll-snap-align: start; min-width: 0; }
.collection-carousel .category-image { aspect-ratio: .89; }
.collection-carousel .category-image img { transition: transform .9s var(--motion-ease), filter .6s ease; }
.category-card:hover .category-image img { transform: scale(1.055); filter: saturate(1.04); }
.collection-carousel .category-number { background: #fbf9f5ee; border: 1px solid #fff8; border-radius: 50%; width: 29px; height: 29px; font-size: 8px; }
.category-info { min-height: 76px; align-items: flex-start; }
.category-info > svg { margin-top: 5px; }
.rail-footer { display: flex; align-items: center; gap: 24px; margin-top: 27px; }
.rail-footer > p { font-size: 10px; line-height: 1.7; color: var(--muted); margin: 0; }
.rail-progress { height: 1px; background: #d9d2c3; flex: 1; max-width: 250px; margin-left: auto; overflow: hidden; }
.rail-progress span { display: block; width: 100%; height: 100%; background: var(--gold-dark); transform: scaleX(.5); transform-origin: left; transition: transform .2s ease; }
.rail-controls { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.rail-button { display: grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0; border: 1px solid #cdc6b7; border-radius: 50%; color: var(--ink); background: transparent; transition: color .25s, background .25s, border-color .25s; }
.rail-button:hover:not(:disabled) { background: var(--dark); color: var(--paper); border-color: var(--dark); }
.rail-button:disabled { color: #b8b2a8; border-color: #e2ddd2; cursor: default; }
.rail-button svg { width: 17px; height: 17px; }
[data-rail-position] { font-size: 9px; letter-spacing: 1px; color: var(--muted); min-width: 75px; text-align: center; font-variant-numeric: tabular-nums; }

/* Small interactions reinforce the shopping actions. */
.product-card .product-image { transition: box-shadow .5s ease; }
.product-card:hover .product-image { box-shadow: 0 12px 28px -20px #2d291b70; }
.product-save[aria-pressed=true] svg { animation: meherma-heart .35s ease; }
.quick-add.is-added, .button.is-added { background: #344b37; color: #fff; }
.quick-add.is-added { transform: translateY(0); }
.quick-add.is-added svg, .button.is-added svg { animation: meherma-check .35s ease; }
.product-card:focus-within { z-index: 1; }
.product-name a:hover { color: var(--gold-dark); }
.shop-tabs button { transition: background .25s, color .25s, border-color .25s; }
.search-shortcut { font-size: 9px; min-width: 23px; padding: 4px 6px; border: 1px solid var(--line); color: var(--muted); font-family: var(--sans); text-align: center; }
.editorial-photo img { transition: transform 1.2s var(--motion-ease); }
.editorial-section:hover .editorial-photo img { transform: scale(1.025); }
.faq-list details { transition: background .25s ease; }
.faq-list details[open] { background: #faf8f380; }
.faq-list details[open] > p { animation: meherma-fade .35s ease; }
dialog[open] { animation: meherma-dialog .4s var(--motion-ease); }
dialog.drawer[open] { animation: meherma-drawer .45s var(--motion-ease); }
dialog.menu-drawer[open] { animation: meherma-menu .4s var(--motion-ease); }
dialog[open]::backdrop { animation: meherma-fade .35s ease; }
.toast { transition: transform .4s var(--motion-ease), opacity .3s ease; }

/* Browsing history uses the same elegant horizontal rhythm. */
.recently-section { border-bottom: 1px solid var(--line); }
.recently-section[hidden] { display: none !important; }
.recently-section .section-heading { align-items: flex-end; }
.recent-clear { background: transparent; border: 0; border-bottom: 1px solid #b9af99; color: var(--muted); min-height: 44px; padding: 6px 0; font: 10px var(--sans); }
.recent-clear:hover { color: var(--ink); }
.recent-image { display: block; aspect-ratio: 1; background: var(--cream); overflow: hidden; }
.recent-image img { height: 100%; width: 100%; object-fit: cover; transition: transform .7s var(--motion-ease); }
.recent-card:hover .recent-image img { transform: scale(1.05); }
.recent-info { padding-top: 15px; }
.recent-info h3 { font: 400 25px/1.1 var(--serif); }
.recent-info .text-link { font-size: 9px; min-height: 40px; margin-top: 5px; gap: 12px; }
.recent-info .text-link svg { width: 14px; }

/* Enhancement only: untouched HTML stays readable if JavaScript is unavailable. */
.reveal-ready { transition: opacity .8s ease var(--reveal-delay, 0ms), transform .9s var(--motion-ease) var(--reveal-delay, 0ms); }
.reveal-ready:not(.is-revealed) { opacity: 0; transform: translateY(22px); }
.reveal-ready.is-revealed { opacity: 1; transform: translateY(0); }
.back-to-top { display: grid; place-items: center; position: fixed; right: 24px; bottom: 84px; width: 42px; height: 42px; border: 1px solid #d6cdbb; border-radius: 50%; background: var(--paper); color: var(--ink); z-index: 24; box-shadow: 0 4px 18px #0000000d; opacity: 0; visibility: hidden; transform: translateY(12px); transition: opacity .3s ease, transform .4s var(--motion-ease), visibility .3s, background .2s; }
.back-to-top[hidden] { display: none; }
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { background: var(--dark); color: var(--paper); }
.back-to-top svg { width: 17px; height: 17px; transform: rotate(180deg); }

@keyframes meherma-heart { 50% { transform: scale(1.18); } }
@keyframes meherma-check { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: scale(1); } }
@keyframes meherma-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes meherma-dialog { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes meherma-drawer { from { opacity: .2; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes meherma-menu { from { opacity: .2; transform: translateX(-40px); } to { opacity: 1; transform: translateX(0); } }

@media (min-width: 1441px) {
  .premium-hero .hero-visual { left: 44%; }
  .premium-hero .hero-content, .premium-hero { min-height: 700px; }
}
@media (max-width: 1100px) {
  .hero-chapters { gap: 21px; }
  .premium-hero .hero-copy { width: 51%; }
  .collection-carousel .category-grid, .recent-grid { grid-auto-columns: calc((100% - 40px) / 3); gap: 20px; }
  .rail-progress { max-width: 160px; }
}
@media (max-width: 850px) {
  html { scroll-padding-top: 108px; }
  .premium-hero, .premium-hero .hero-content { min-height: 610px; }
  .premium-hero .hero-copy { width: 60%; }
  .premium-hero .hero-title { font-size: 71px; }
  .premium-hero .hero-copy { padding-top: 40px; padding-bottom: 100px; }
  .premium-hero .hero-visual { left: 37%; }
  .hero-navigation { gap: 5px; }
  .hero-navigation [data-carousel-toggle] { margin-right: 0; }
  .hero-chapters { gap: 19px; }
  .hero-chapters button { font-size: 8px; letter-spacing: 1px; gap: 6px; }
  .collection-carousel .category-grid, .recent-grid { grid-auto-columns: calc((100% - 36px) / 2.55); gap: 18px; }
  .collection-carousel .category-info h3 { font-size: 24px; }
  .rail-footer { gap: 17px; }
  .rail-progress { display: none; }
  .rail-controls { margin-left: auto; }
}
@media (max-width: 600px) {
  html { scroll-padding-top: 95px; }
  .premium-hero, .premium-hero .hero-content { min-height: 650px; }
  .premium-hero .hero-visual { left: 0; }
  .premium-hero .hero-visual::after { background: linear-gradient(90deg, #0f110ce8 0%, #0f110c80 60%, #0f110c35 100%), linear-gradient(0deg, #0f110cfa 0%, #0f110c15 72%); }
  .premium-hero .hero-copy { width: 100%; max-width: 400px; padding: 62px 0 149px; }
  .premium-hero .hero-title { font-size: clamp(59px, 16vw, 77px); }
  .premium-hero .hero-slide--beauty .hero-title, .premium-hero .hero-slide--gifting .hero-title { font-size: clamp(55px, 15.3vw, 73px); }
  .premium-hero .hero-description { max-width: 300px; }
  .premium-hero .hero-slide--gifting .hero-visual img { padding: 0; object-fit: cover; object-position: 64% center; opacity: .7; }
  .premium-hero .hero-slide--beauty .hero-visual img { object-position: 56% 42%; }
  .hero-controls { bottom: 22px; align-items: center; flex-wrap: wrap; gap: 10px; }
  .hero-chapters { gap: 18px; width: 100%; max-width: none; justify-content: space-between; }
  .hero-chapters button { font-size: 9px; flex: 1; justify-content: center; gap: 8px; }
  .hero-navigation { width: 100%; justify-content: flex-end; gap: 7px; }
  .hero-navigation button { width: 38px; height: 38px; min-height: 44px; min-width: 44px; }
  .hero-navigation [data-carousel-toggle] { margin-right: auto; }
  .collection-carousel .category-grid, .recent-grid { grid-auto-columns: calc((100% - 16px) / 1.4); gap: 16px; margin-right: -21px; padding-right: 21px; scroll-padding-right: 21px; }
  .collection-carousel .category-image { aspect-ratio: .94; }
  .collection-carousel .category-info h3 { font-size: 25px; }
  .collection-carousel .category-info p { font-size: 9px; line-height: 1.5; }
  .collection-carousel .category-info > svg { width: 17px; margin-right: 4px; }
  .rail-footer { align-items: center; margin-top: 18px; gap: 14px; }
  .rail-footer > p { font-size: 9px; max-width: 140px; }
  .rail-controls { gap: 4px; }
  [data-rail-position] { font-size: 8px; min-width: 65px; letter-spacing: .4px; }
  .rail-button { min-width: 44px; min-height: 44px; }
  .recently-section .section-heading { gap: 18px; align-items: flex-start; }
  .recently-section .section-heading h2 { max-width: 240px; }
  .recent-clear { white-space: nowrap; font-size: 9px; }
  .recent-info h3 { font-size: 25px; }
  .back-to-top { right: 18px; bottom: 78px; min-width: 44px; min-height: 44px; }
  .search-shortcut { display: none; }
}
@media (max-width: 370px) {
  .premium-hero .hero-title { font-size: 58px; }
  .premium-hero .hero-slide--beauty .hero-title, .premium-hero .hero-slide--gifting .hero-title { font-size: 53px; }
  .hero-chapters { gap: 12px; }
  .hero-chapters button { font-size: 8px; }
  .rail-footer > p { max-width: 114px; }
  .rail-controls { gap: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  html, [data-rail-track] { scroll-behavior: auto !important; }
  .hero-slide, .premium-hero .hero-copy > *, .reveal-ready { transition: none !important; }
  .reveal-ready:not(.is-revealed) { opacity: 1; transform: none; }
  .premium-hero .hero-visual img, .editorial-photo img, .recent-image img { transform: none !important; }
}
@media print {
  .hero-controls, .rail-footer, .back-to-top, .recent-clear { display: none !important; }
  .reveal-ready { opacity: 1 !important; transform: none !important; }
  [data-rail-track] { display: grid !important; grid-auto-flow: row !important; grid-template-columns: repeat(4, 1fr) !important; overflow: visible !important; }
}
