/* =========================================================================
   YOURSSELF — premium UI (Mercedes-Benz grade)
   Self-contained: system fonts only, no external CDN/fonts/trackers.
   Motion is GPU-friendly (opacity/transform) and respects reduced-motion.
   ========================================================================= */

:root {
  /* palette — graphite / platinum / silver */
  --bg:        #ffffff;
  --bg-soft:   #f6f6f4;
  --bg-dark:   #0b0c0e;
  --bg-dark-2: #15171b;
  --ink:       #0c0d0f;
  --ink-soft:  #5c6066;
  --ink-faint: #8b9097;
  --line:      #e7e7e3;
  --line-dark: rgba(255,255,255,.14);
  --silver-1:  #f2f3f5;
  --silver-2:  #c9ced4;
  --silver-3:  #9aa0a8;
  --on-dark:   #f4f5f7;
  --on-dark-soft: #b9bdc4;

  --radius:    16px;
  --radius-lg: 22px;
  --maxw:      1240px;

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

  /* premium easings + durations */
  --ease:      cubic-bezier(.4, 0, .2, 1);
  --ease-out:  cubic-bezier(.16, 1, .3, 1);
  --ease-emph: cubic-bezier(.22, 1, .36, 1);
  --dur:       .7s;
  --dur-slow:  1.1s;

  --header-h:  72px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

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

/* page-load fade-in / route fade-out */
body { opacity: 0; animation: pageIn .6s var(--ease-out) forwards; }
@keyframes pageIn { to { opacity: 1; } }
html.is-leaving body { opacity: 0; transition: opacity .22s var(--ease); animation: none; }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 26px; }

::selection { background: var(--ink); color: #fff; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 80;
  height: var(--header-h);
  display: flex; align-items: center;
  transition: background .5s var(--ease), backdrop-filter .5s var(--ease),
              border-color .5s var(--ease), box-shadow .5s var(--ease);
  background: rgba(255,255,255,.82);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; width: 100%; }

/* transparent over a dark hero, until scrolled */
body.has-hero .site-header {
  background: transparent; border-bottom-color: transparent; backdrop-filter: none;
}
body.has-hero .site-header .brand,
body.has-hero .site-header .nav a { color: var(--on-dark); }
body.has-hero .site-header .brand .dot { background: var(--on-dark); }
.site-header.scrolled {
  background: rgba(255,255,255,.86); backdrop-filter: saturate(180%) blur(14px);
  border-bottom-color: var(--line); box-shadow: 0 8px 30px rgba(0,0,0,.06);
}
body.has-hero .site-header.scrolled .brand,
body.has-hero .site-header.scrolled .nav a { color: var(--ink); }
body.has-hero .site-header.scrolled .brand .dot { background: var(--ink); }

.brand {
  font-weight: 800; font-size: 1.2rem; letter-spacing: .14em; text-transform: uppercase;
  display: flex; align-items: center; gap: 11px; transition: color .5s var(--ease);
}
.brand .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--ink); display: inline-block; transition: background .5s var(--ease);
  box-shadow: 0 0 0 4px rgba(0,0,0,.05);
}
.nav { display: flex; align-items: center; gap: 34px; }
.nav a {
  position: relative; font-size: .82rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-soft); transition: color .3s var(--ease);
}
.nav a::after {
  content: ""; position: absolute; left: 0; bottom: -6px; height: 1.5px; width: 0;
  background: currentColor; transition: width .4s var(--ease-out);
}
.nav a:hover, .nav a.active { color: inherit; }
body:not(.has-hero) .nav a:hover, body:not(.has-hero) .nav a.active { color: var(--ink); }
.nav a:hover::after, .nav a.active::after { width: 100%; }
.cart-link { font-weight: 600; }
.cart-badge {
  position: absolute; top: -10px; right: -16px;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--ink); color: #fff;
  font-size: .68rem; font-weight: 700; line-height: 18px;
  text-align: center; border-radius: 999px;
  transition: transform .3s var(--ease-emph);
}
body.has-hero .site-header:not(.scrolled) .cart-badge { background: var(--on-dark); color: var(--ink); }
.cart-badge.bump { transform: scale(1.35); }
.cart-badge[hidden] { display: none; }

/* offset content below fixed header (non-hero pages) */
body:not(.has-hero) main { padding-top: var(--header-h); }

/* ---------- Buttons ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 15px 30px; border: 1px solid var(--ink);
  color: #fff; font-size: .82rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  cursor: pointer; border-radius: 999px; background: var(--ink);
  overflow: hidden; isolation: isolate;
  transition: color .45s var(--ease), border-color .45s var(--ease), transform .25s var(--ease-out);
  will-change: transform;
}
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: #fff; transform: scaleY(0); transform-origin: bottom;
  transition: transform .5s var(--ease-emph);
}
.btn:hover { color: var(--ink); }
.btn:hover::before { transform: scaleY(1); }
.btn:active { transform: translateY(1px) scale(.99); }

.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost::before { background: var(--ink); }
.btn.ghost:hover { color: #fff; }
.btn.on-dark { border-color: rgba(255,255,255,.5); background: transparent; color: #fff; }
.btn.on-dark::before { background: #fff; }
.btn.on-dark:hover { color: var(--ink); border-color: #fff; }
.btn.solid-light { background: #fff; color: var(--ink); border-color: #fff; }
.btn.solid-light::before { background: var(--ink); }
.btn.solid-light:hover { color: #fff; }
.btn.block { width: 100%; }
.btn.sm { padding: 11px 18px; font-size: .72rem; }

/* ---------- Hero (cinematic) ---------- */
.hero {
  position: relative; min-height: 100svh; display: flex; align-items: center;
  background: var(--bg-dark); color: var(--on-dark); overflow: hidden;
}
.hero__bg {
  position: absolute; inset: -8%; z-index: 0;
  background:
    radial-gradient(120% 80% at 70% 20%, #2a2e35 0%, transparent 55%),
    radial-gradient(90% 70% at 15% 90%, #1b2733 0%, transparent 50%),
    linear-gradient(135deg, #0b0c0e 0%, #15171b 55%, #0b0c0e 100%);
  background-size: 200% 200%, 200% 200%, 100% 100%;
  animation: heroDrift 22s var(--ease) infinite alternate;
  transform: scale(1.06);
}
.hero__sheen {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.06) 50%, transparent 65%);
  background-size: 250% 250%;
  animation: heroSheen 9s var(--ease) infinite;
}
.hero__grid {
  position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: .5;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(120% 80% at 50% 30%, #000 30%, transparent 75%);
}
@keyframes heroDrift {
  0%   { background-position: 0% 0%, 100% 100%, 0 0; }
  100% { background-position: 100% 50%, 0% 0%, 0 0; }
}
@keyframes heroSheen {
  0% { background-position: 200% 0; } 60%,100% { background-position: -80% 0; }
}
.hero .wrap { position: relative; z-index: 2; padding-top: var(--header-h); }
.hero__inner { max-width: 880px; }
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: .74rem; letter-spacing: .26em; text-transform: uppercase; color: var(--on-dark-soft);
  margin: 0 0 26px;
}
.hero .eyebrow::before { content: ""; width: 34px; height: 1px; background: var(--silver-3); display: inline-block; }
.hero h1 {
  font-size: clamp(2.6rem, 8vw, 6rem); line-height: .98; letter-spacing: -.035em;
  margin: 0 0 26px; font-weight: 800;
}
.hero h1 .metal {
  background: linear-gradient(180deg, #fff 0%, #c9ced4 45%, #7d828a 75%, #e9ebee 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.lead { font-size: clamp(1.05rem, 2.2vw, 1.4rem); color: var(--on-dark-soft); margin: 0 0 38px; max-width: 560px; }
.hero .actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* hero entrance — staggered rise */
.rise { opacity: 0; transform: translateY(28px); animation: rise .95s var(--ease-out) forwards; }
.rise.d1 { animation-delay: .12s; } .rise.d2 { animation-delay: .24s; }
.rise.d3 { animation-delay: .36s; } .rise.d4 { animation-delay: .48s; }
@keyframes rise { to { opacity: 1; transform: none; } }

.scroll-cue {
  position: absolute; left: 50%; bottom: 26px; z-index: 2; transform: translateX(-50%);
  color: var(--on-dark-soft); font-size: .68rem; letter-spacing: .2em; text-transform: uppercase;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.scroll-cue .line { width: 1px; height: 42px; background: linear-gradient(var(--silver-3), transparent); position: relative; overflow: hidden; }
.scroll-cue .line::after { content: ""; position: absolute; top: -50%; left: 0; width: 100%; height: 50%; background: #fff; animation: cue 2s var(--ease) infinite; }
@keyframes cue { 0% { top: -50%; } 60%,100% { top: 110%; } }

/* ---------- Scroll reveal ----------
   Hidden initial state ONLY when JS is active (html.js). No-JS = visible. */
html.js [data-reveal] {
  opacity: 0; transform: translateY(30px);
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
  transition-delay: calc(var(--i, 0) * 70ms);
  will-change: opacity, transform;
}
html.js [data-reveal].is-in { opacity: 1; transform: none; }
/* failsafe: if reveal never triggers (hidden tab, IO unavailable), show anyway */
html.reveal-all [data-reveal] { opacity: 1 !important; transform: none !important; }

/* ---------- Section ---------- */
.section { padding: clamp(64px, 10vw, 130px) 0; }
.section.alt { background: var(--bg-soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 46px; gap: 18px; flex-wrap: wrap; }
.section-head .eyebrow { font-size: .72rem; letter-spacing: .24em; text-transform: uppercase; color: var(--ink-faint); margin: 0 0 12px; }
.section-head h2 { font-size: clamp(1.8rem, 4vw, 2.8rem); letter-spacing: -.025em; margin: 0; line-height: 1.05; font-weight: 800; }
.section-head .link { color: var(--ink-soft); font-size: .82rem; letter-spacing: .06em; text-transform: uppercase; position: relative; }
.section-head .link::after { content: " →"; transition: padding .3s var(--ease-out); }
.section-head .link:hover { color: var(--ink); }
.section-head .link:hover::after { padding-left: 6px; }

/* ---------- Product grid ---------- */
.grid { display: grid; gap: 30px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.card { display: flex; flex-direction: column; }
.card .thumb {
  aspect-ratio: 4 / 5; border-radius: var(--radius);
  display: flex; align-items: flex-end; padding: 20px; color: #fff;
  position: relative; overflow: hidden;
  transition: transform .6s var(--ease-out), box-shadow .6s var(--ease-out);
  box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
.card a.thumb::after {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, transparent 45%, rgba(0,0,0,.35) 100%);
  opacity: .6; transition: opacity .6s var(--ease);
}
.card a.thumb:hover { transform: translateY(-8px); box-shadow: 0 30px 60px -20px rgba(0,0,0,.4); }
.card a.thumb:hover::after { opacity: .85; }
.card a.thumb:hover .art svg { transform: scale(1.08) rotate(-1deg); }
.card .thumb .tag {
  position: absolute; top: 16px; left: 16px; z-index: 3;
  background: rgba(255,255,255,.9); color: #111; backdrop-filter: blur(4px);
  font-size: .64rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  padding: 5px 11px; border-radius: 999px;
}
.card .thumb .ghost-name {
  position: relative; z-index: 3;
  font-weight: 700; font-size: 1.25rem; letter-spacing: -.01em;
  text-shadow: 0 1px 20px rgba(0,0,0,.35);
}
.card .meta { padding: 18px 2px 0; display: flex; flex-direction: column; gap: 6px; }
.card .meta .row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.card .meta .name { font-weight: 600; font-size: 1.02rem; letter-spacing: -.01em; }
.card .meta .price { color: var(--ink-soft); letter-spacing: .01em; }

/* shared art (svg garment illustration) */
.thumb .art { position: absolute; inset: 0; z-index: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.thumb .art svg { width: 58%; height: 58%; opacity: .55; transition: transform .7s var(--ease-out); }

/* ---------- Product detail ---------- */
.detail { display: grid; grid-template-columns: 1.05fr 1fr; gap: 64px; align-items: start; }
.detail .thumb { aspect-ratio: 4 / 5; border-radius: var(--radius-lg); display: flex; align-items: flex-end; padding: 28px; color: #fff; position: relative; overflow: hidden; box-shadow: 0 40px 80px -40px rgba(0,0,0,.5); }
.detail .thumb .ghost-name { position: relative; z-index: 2; font-weight: 700; font-size: 1.8rem; letter-spacing: -.02em; text-shadow: 0 1px 18px rgba(0,0,0,.3); }
.detail .info h1 { font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -.03em; margin: 0 0 10px; line-height: 1.02; font-weight: 800; }
.detail .info .price { font-size: 1.5rem; margin: 0 0 26px; letter-spacing: -.01em; }
.detail .info .cat { color: var(--ink-faint); text-transform: uppercase; letter-spacing: .2em; font-size: .74rem; font-weight: 700; margin: 0 0 18px; }
.detail .info p.desc { color: var(--ink-soft); font-size: 1.05rem; margin: 0 0 34px; max-width: 46ch; }
.detail .qty { display: flex; align-items: center; gap: 16px; margin-bottom: 26px; }
.crumbs { color: var(--ink-faint); font-size: .82rem; letter-spacing: .04em; text-transform: uppercase; margin: 0 0 30px; }
.crumbs a { transition: color .3s var(--ease); }
.crumbs a:hover { color: var(--ink); }

/* ---------- qty control ---------- */
.qty-ctrl { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.qty-ctrl button { width: 40px; height: 40px; border: 0; background: transparent; font-size: 1.15rem; cursor: pointer; transition: background .25s var(--ease), color .25s var(--ease); }
.qty-ctrl button:hover { background: var(--ink); color: #fff; }
.qty-ctrl span { min-width: 34px; text-align: center; font-weight: 600; }

/* ---------- Cart ---------- */
.cart-layout { display: grid; grid-template-columns: 1fr 360px; gap: 48px; align-items: start; }
.cart-row { display: grid; grid-template-columns: 96px 1fr auto; gap: 20px; align-items: center; padding: 22px 0; border-bottom: 1px solid var(--line); }
.cart-row .thumb { width: 96px; aspect-ratio: 4/5; border-radius: 12px; position: relative; overflow: hidden; }
.cart-row .name { font-weight: 600; letter-spacing: -.01em; }
.cart-row .unit { color: var(--ink-faint); font-size: .88rem; }
.cart-row .line-right { text-align: right; display: grid; gap: 10px; justify-items: end; }
.cart-row .subtotal { font-weight: 600; }
.link-remove { background: none; border: 0; color: var(--ink-faint); font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; cursor: pointer; padding: 0; transition: color .25s var(--ease); }
.link-remove:hover { color: #b00020; }

.summary { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 30px; position: sticky; top: calc(var(--header-h) + 16px); }
.summary h3 { margin: 0 0 20px; font-size: 1.1rem; letter-spacing: .02em; }
.summary .line { display: flex; justify-content: space-between; padding: 9px 0; color: var(--ink-soft); }
.summary .total { display: flex; justify-content: space-between; padding: 16px 0 20px; font-size: 1.25rem; font-weight: 700; color: var(--ink); border-top: 1px solid var(--line); margin-top: 8px; letter-spacing: -.01em; }

.empty { text-align: center; padding: 100px 20px; color: var(--ink-soft); }
.empty h2 { color: var(--ink); margin: 0 0 10px; letter-spacing: -.02em; }

/* ---------- Forms / checkout ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: .76rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
.field input {
  padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px;
  font-size: 1rem; font-family: inherit; background: #fff; transition: border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.field input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(0,0,0,.06); }

.notice {
  display: flex; gap: 13px; align-items: flex-start;
  background: linear-gradient(180deg, #fffdf5, #fff8e6); border: 1px solid #f0d98a; color: #6b5300;
  padding: 16px 18px; border-radius: 14px; font-size: .92rem; margin-bottom: 30px;
}
.notice strong { color: #5a4500; }

.success-box { text-align: center; max-width: 600px; margin: 0 auto; padding: 80px 20px; }
.success-box .check {
  width: 76px; height: 76px; border-radius: 50%;
  background: linear-gradient(180deg, #1f9d5a, #157a44); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 2.2rem; margin: 0 auto 26px;
  box-shadow: 0 16px 40px -12px rgba(21,122,68,.5);
  animation: pop .6s var(--ease-emph) both;
}
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.success-box h1 { margin: 0 0 12px; letter-spacing: -.025em; font-size: clamp(1.6rem,4vw,2.2rem); }
.success-box p { color: var(--ink-soft); }
.order-id { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700; color: var(--ink); }

/* ---------- Features strip ---------- */
.features { display: grid; grid-template-columns: repeat(3,1fr); gap: 28px; }
.feature { text-align: center; padding: 14px; }
.feature .ic { width: 52px; height: 52px; margin: 0 auto 16px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #fff; border: 1px solid var(--line); font-size: 1.3rem; box-shadow: 0 10px 24px -14px rgba(0,0,0,.3); }
.feature h4 { margin: 0 0 6px; letter-spacing: -.01em; }
.feature p { margin: 0; color: var(--ink-soft); font-size: .92rem; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line-dark); background: var(--bg-dark); color: var(--on-dark-soft); margin-top: 0; }
.site-footer .wrap { padding: 56px 26px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 18px; align-items: center; font-size: .88rem; }
.site-footer .brand { color: var(--on-dark); font-size: 1.05rem; }
.site-footer .brand .dot { background: var(--on-dark); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%) translateY(24px);
  background: var(--ink); color: #fff; padding: 14px 24px; border-radius: 999px;
  font-size: .82rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  opacity: 0; pointer-events: none; z-index: 120;
  box-shadow: 0 20px 50px -16px rgba(0,0,0,.5);
  transition: opacity .35s var(--ease-out), transform .45s var(--ease-emph);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .detail { grid-template-columns: 1fr; gap: 36px; }
  .cart-layout { grid-template-columns: 1fr; }
  .summary { position: static; }
  .features { grid-template-columns: 1fr; }
  .nav { gap: 22px; }
}
@media (max-width: 560px) {
  .form-grid { grid-template-columns: 1fr; }
  .brand { font-size: .9rem; letter-spacing: .04em; }
  .nav { gap: 16px; }
  .nav a { font-size: .68rem; letter-spacing: .03em; }
  .nav a[href="index.html"] { display: none; } /* logo is home on mobile */
  .cart-badge { right: -13px; }
  .grid { grid-template-columns: 1fr 1fr; gap: 16px; }
  .card .thumb { padding: 13px; }
  .card .thumb .ghost-name { font-size: 1rem; }
  .card .thumb .tag { font-size: .58rem; padding: 4px 8px; }
  .card .meta .row { flex-wrap: wrap; gap: 7px; }
  .btn.sm { padding: 9px 13px; font-size: .66rem; }
}

/* ---------- Reduced motion: disable all movement ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  body { opacity: 1 !important; animation: none !important; }
  [data-reveal], .rise { opacity: 1 !important; transform: none !important; }
  .hero__bg, .hero__sheen, .scroll-cue .line::after { animation: none !important; }
}
