/* ==========================================================================
   Goodwill Fabric Studio — hanger rail experience
   Only transform / opacity / clip-path are animated.
   ========================================================================== */

@property --fab { syntax: "<color>"; inherits: true; initial-value: #2a2622; }

.studio-page { --obsidian: #080a06; --brass-1: #f3dd9a; --brass-2: #b88a2c; --brass-3: #6e4f14; background: var(--obsidian); }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

/* Masked line reveal helper */
.studio-page .m { display: block; overflow: hidden; padding-bottom: .08em; margin-bottom: -.08em; }
.studio-page .m > span { display: block; will-change: transform; }

/* ---------------- 1. Intro ---------------- */
.studio-intro { min-height: 100svh; display: flex; align-items: center; padding: 130px 0 110px; background: var(--obsidian); isolation: isolate; }
.studio-intro::after { background: radial-gradient(ellipse 80% 70% at 30% 50%, rgba(201, 162, 39, .10), transparent 60%), linear-gradient(180deg, rgba(11, 10, 9, 0) 60%, var(--obsidian)); z-index: 1; }
.intro-copy { position: relative; z-index: 3; }
.intro-title { margin: 1.4rem 0 1.6rem; max-width: 12ch; font-size: clamp(3rem, 8.4vw, 7.4rem); line-height: .98; }
.intro-title em { font-style: italic; color: var(--gold-soft); }
.studio-intro .lead { max-width: 560px; }
.intro-chips { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 2.2rem; }
.chip { display: inline-flex; align-items: center; gap: .6rem; padding: .45rem 1rem .45rem .45rem; border-radius: 999px; border: 1px solid rgba(248, 244, 236, .18); color: var(--cream); font-size: .88rem; font-weight: 500; background: rgba(248, 244, 236, .03); transition: border-color .3s ease, background .3s ease, transform .3s ease; }
.chip i { width: 30px; height: 30px; border-radius: 999px; background-size: 140%; background-position: center; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .15); }
.chip:hover, .chip:focus-visible { border-color: var(--gold); background: rgba(201, 162, 39, .08); transform: translateY(-2px); }
.intro-cue { position: absolute; z-index: 3; left: 50%; bottom: 28px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: .7rem; font-size: .7rem; letter-spacing: .3em; text-transform: uppercase; color: rgba(248, 244, 236, .55); }
.intro-cue span { width: 1px; height: 44px; background: linear-gradient(var(--gold), transparent); transform-origin: top; animation: cue 2.2s cubic-bezier(.6, 0, .2, 1) infinite; }
@keyframes cue { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

.intro-curtain { display: none; position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.studio-motion .intro-curtain { display: block; }
.intro-curtain span { position: absolute; top: 0; bottom: 0; width: 50.5%; background-size: 260px; background-repeat: repeat; will-change: transform; }
.intro-curtain span::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0, 0, 0, .55), rgba(0, 0, 0, .05) 40%, rgba(0, 0, 0, .35) 70%, rgba(0, 0, 0, .7)); }
.intro-curtain span:first-child { left: 0; }
.intro-curtain span:last-child { right: 0; transform: scaleX(-1); }
.studio-motion .intro-title .m > span { transform: translateY(110%); }
.studio-motion .intro-fade { opacity: 0; }

/* ---------------- 2. Rail ---------------- */
.rail { --rod: 15svh; --dock-h: 96px; position: relative; height: 100svh; min-height: 600px; overflow: hidden; background: var(--obsidian); color: var(--cream); outline: none; }
.rail-bg { position: absolute; inset: 0; background: var(--obsidian); }
.rail-bg::after { content: ""; position: absolute; inset: 0; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }

.rail-rod { position: absolute; z-index: 2; top: var(--rod); left: 4vw; right: 4vw; height: 7px; border-radius: 7px;
  background: linear-gradient(180deg, var(--brass-1), var(--brass-2) 45%, var(--brass-3));
  box-shadow: 0 10px 24px -6px rgba(0, 0, 0, .8), 0 0 40px -10px rgba(233, 212, 154, .35); }
.rail-rod::before, .rail-rod::after { content: ""; position: absolute; top: -9px; width: 6px; height: 26px; border-radius: 3px; background: linear-gradient(90deg, var(--brass-3), var(--brass-1), var(--brass-3)); }
.rail-rod::before { left: 6%; } .rail-rod::after { right: 6%; }

.rail-stage { position: absolute; z-index: 3; left: 0; right: 0; top: calc(var(--rod) - 6px); bottom: calc(var(--dock-h) + 34px); }
.look { position: absolute; top: 0; left: 50%; height: 100%; aspect-ratio: 400 / 760; margin: 0; will-change: transform; }
.look-swing, .look-kick, .look-sway, .look-art { width: 100%; height: 100%; transform-origin: 50% 0.6%; will-change: transform; }
.look-art svg, .look-art img { width: 100%; height: 100%; display: block; filter: drop-shadow(0 34px 34px rgba(0, 0, 0, .55)); }
.look-art img { object-fit: cover; object-position: 50% 0; filter: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent); }
.look-cap { display: none; }

.rail-curtain { position: absolute; z-index: 5; left: 0; right: 0; top: 4px; bottom: -40px; background-size: 240px; visibility: hidden; clip-path: inset(0% 0% 100% 0%); will-change: clip-path; }
.rail-curtain::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0, 0, 0, .7), rgba(0, 0, 0, .15) 20%, rgba(0, 0, 0, .45) 35%, rgba(0, 0, 0, .1) 55%, rgba(0, 0, 0, .5) 75%, rgba(0, 0, 0, .75)); }

/* Edit label at the top of each rail */
.rail-head { position: absolute; z-index: 4; left: 6vw; top: calc(var(--rod) + 22px); max-width: 26vw; pointer-events: none; }
.rail-kicker { font: 600 .9rem/1 var(--sans); letter-spacing: .01em; color: var(--brass, #c9a45c); }
@media (max-height: 860px) { .rail-title { display: none; } }
.rail-title { margin-top: .5rem; font-family: var(--serif); font-style: italic; font-size: 1.05rem; color: rgba(248, 244, 236, .7); }
.rail + .rail { border-top: 1px solid rgba(248, 244, 236, .06); }
.rail:not(.is-kinetic) .rail-head { top: 100px; }
@media (max-width: 767px) {
  .rail-head { left: 22px; top: calc(var(--rod) - 22px); max-width: none; }
  .rail-title { display: none; }
}

/* Copy column */
.rail-copy { position: absolute; z-index: 4; left: 6vw; top: calc(50% + 36px); transform: translateY(-46%); width: min(30vw, 400px); pointer-events: none; }
.copy { position: absolute; top: 0; left: 0; right: 0; transform: translateY(-50%); }
.copy-idx { display: flex; align-items: center; gap: .7rem; font: 600 .72rem/1 var(--sans); letter-spacing: .28em; color: var(--gold-soft); }
.copy-idx i { width: 34px; height: 1px; background: currentColor; opacity: .5; }
.copy-title { font-family: var(--serif); font-weight: 500; font-size: clamp(2.4rem, 4.4vw, 4.3rem); line-height: 1; letter-spacing: -.02em; margin: 1.1rem 0 .9rem; }
.copy-occ { font-size: 1rem; color: rgba(248, 244, 236, .72); }
.copy-fabric { margin-top: 1.4rem; font-family: var(--serif); font-style: italic; font-size: 1.15rem; color: var(--gold-soft); }
.copy-details { margin-top: 1.4rem; display: grid; gap: .55rem; }
.copy-details li { display: flex; align-items: center; gap: .7rem; font-size: .9rem; color: rgba(248, 244, 236, .82); }
.copy-details li::before { content: ""; width: 18px; height: 1px; background: var(--gold); flex: none; }

/* Ticks */
.rail-ticks { position: absolute; z-index: 4; right: 4vw; top: 50%; transform: translateY(-50%); display: grid; gap: .3rem; }
.rail-ticks button { display: flex; align-items: center; justify-content: flex-end; gap: .8rem; padding: .45rem 0; color: rgba(248, 244, 236, .45); font-size: .78rem; letter-spacing: .08em; }
.rail-ticks button::after { content: ""; width: 18px; height: 1px; background: currentColor; transition: width .4s cubic-bezier(.2, .8, .2, 1), background .3s; }
.rail-ticks button span { opacity: 0; transform: translateX(8px); transition: opacity .35s, transform .35s; white-space: nowrap; }
.rail-ticks button:hover span, .rail-ticks button:focus-visible span, .rail-ticks button[aria-current="true"] span { opacity: 1; transform: none; }
.rail-ticks button[aria-current="true"] { color: var(--cream); }
.rail-ticks button[aria-current="true"]::after { width: 42px; background: var(--gold); }

/* Fabric dock */
.fabric-dock { position: absolute; z-index: 6; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; align-items: center; gap: 1.2rem; padding: 12px 12px 12px 22px; min-height: var(--dock-h); border-radius: 999px;
  background: rgba(18, 16, 14, .62); border: 1px solid rgba(248, 244, 236, .1); backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2); box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .9); }
.dock-label { display: grid; min-width: 150px; line-height: 1.15; }
.dock-label span { font-size: .62rem; letter-spacing: .3em; text-transform: uppercase; color: var(--gold-soft); }
.dock-label strong { font-family: var(--serif); font-weight: 500; font-size: 1.2rem; margin-top: .2rem; }
.dock-label small { font-size: .74rem; color: rgba(248, 244, 236, .6); }
.dock-swatches { display: flex; gap: .55rem; }
.sw { width: 44px; height: 44px; border-radius: 999px; background-size: 150%; background-position: center; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18), 0 6px 14px -6px rgba(0, 0, 0, .8); transition: transform .5s cubic-bezier(.2, .8, .2, 1), box-shadow .3s; }
.sw:hover { transform: translateY(-3px) scale(1.06); }
.sw[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--obsidian), 0 0 0 4px var(--gold), 0 8px 18px -6px rgba(0, 0, 0, .8); transform: scale(1.08); }
.sw:focus-visible, .chip:focus-visible, .rail-ticks button:focus-visible { outline: 2px solid var(--gold-soft); outline-offset: 3px; }
.dock-cta { min-height: 52px; padding: 0 1.4rem; will-change: transform; }

.rail-tag { position: absolute; z-index: 4; right: 4vw; bottom: calc(var(--dock-h) + 44px); font-size: .62rem; letter-spacing: .3em; text-transform: uppercase; color: rgba(248, 244, 236, .4); }

/* Hide generic floating WhatsApp while the rail owns the screen */
body.studio-rail-on .mobile-dock, body.studio-rail-on .wa-float { opacity: 0; pointer-events: none; transform: translateY(20px); transition: opacity .3s, transform .3s; }
.mobile-dock, .wa-float { transition: opacity .3s, transform .3s; }

/* ----- Static (reduced motion / no JS): a swipeable gallery ----- */
.rail:not(.is-kinetic) { height: auto; min-height: 0; padding: 170px 0 150px; }
.rail:not(.is-kinetic) .rail-rod { top: 170px; }
.rail:not(.is-kinetic) .rail-stage { position: relative; top: auto; bottom: auto; display: flex; gap: 6vw; overflow-x: auto; scroll-snap-type: x mandatory; padding: 0 12vw 20px; height: 70svh; min-height: 460px; }
.rail:not(.is-kinetic) .look { position: relative; left: auto; flex: none; scroll-snap-align: center; height: calc(100% - 64px); }
.rail:not(.is-kinetic) .look-cap { display: grid; text-align: center; gap: .2rem; margin-top: 10px; }
.rail:not(.is-kinetic) .look-cap strong { font-family: var(--serif); font-weight: 500; font-size: 1.3rem; }
.rail:not(.is-kinetic) .look-cap span { font-size: .8rem; color: rgba(248, 244, 236, .6); }
.rail:not(.is-kinetic) .rail-copy, .rail:not(.is-kinetic) .rail-ticks, .rail:not(.is-kinetic) .rail-curtain { display: none; }
.rail:not(.is-kinetic) .fabric-dock { position: sticky; bottom: 20px; margin: 20px auto 0; width: max-content; max-width: calc(100% - 24px); transform: none; left: auto; }

/* ---------------- 3. After ---------------- */
.studio-after { background: var(--cream); color: var(--ink); padding: clamp(80px, 12vw, 150px) 0; }
.studio-after .h-section { margin: 1rem 0 3rem; max-width: 18ch; }
.studio-after .h-section em { color: var(--gold-deep); }
.after-grid { display: grid; gap: 1.2rem; }
@media (min-width: 900px) { .after-grid { grid-template-columns: repeat(3, 1fr); } }
.after-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 2rem; }
.after-card .n { font: 600 .72rem/1 var(--sans); letter-spacing: .28em; color: var(--gold-deep); }
.after-card h3 { margin: 1rem 0 .7rem; }
.after-card p { color: var(--muted); line-height: 1.65; }
.after-cta { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2.6rem; }
.after-note { margin-top: 1.6rem; font-size: .8rem; color: var(--muted); max-width: 640px; }
.studio-empty { padding: 160px 0; color: var(--cream); }

/* ---------------- Mobile ---------------- */
@media (max-width: 767px) {
  .rail { --rod: 12svh; --dock-h: 128px; min-height: 560px; }
  .rail-rod { left: -10px; right: -10px; }
  .rail-stage { bottom: auto; height: 50svh; }
  .rail-copy { left: 22px; right: 22px; width: auto; top: calc(var(--rod) + 50svh + 14px); transform: none; }
  .copy { transform: none; }
  .copy-title { font-size: 2.1rem; margin: .6rem 0 .35rem; }
  .copy-occ { font-size: .88rem; }
  .copy-fabric { margin-top: .5rem; font-size: 1rem; }
  .copy-details { display: none; }
  .rail-ticks { display: none; }
  .rail-tag { right: 22px; top: calc(var(--rod) + 18px); bottom: auto; }
  .fabric-dock { left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); transform: none; border-radius: 24px; padding: 12px; display: grid; grid-template-columns: 1fr auto; gap: 10px 12px; min-height: 0; }
  .dock-swatches { grid-column: 1 / -1; order: -1; overflow-x: auto; padding: 4px 4px 2px; scrollbar-width: none; }
  .dock-swatches::-webkit-scrollbar { display: none; }
  .sw { width: 40px; height: 40px; flex: none; }
  .dock-label { min-width: 0; }
  .dock-label strong { font-size: 1.05rem; }
  .dock-cta { min-height: 46px; padding: 0 1rem; }
  .studio-intro { padding: 120px 0 120px; }
  .rail:not(.is-kinetic) .rail-stage { padding: 0 18vw 20px; height: 62svh; }
}

@media (prefers-reduced-motion: reduce) {
  .intro-cue span { animation: none; }
  .rail-bg { transition: none; }
}

/* ==========================================================================
   Light theme (light grey wall, garments in arched niches)
   ========================================================================== */
.studio-page { background: var(--wall); }
.studio-intro { position: relative; background: var(--wall); color: var(--text); padding: 150px 0 120px; }
.studio-intro::after { display: none; }
.intro-kicker { font-size: .95rem; color: var(--brass); }
.intro-title { color: var(--text); }
.intro-title em { color: var(--brass); font-style: italic; }
.studio-intro .lead { color: var(--muted); }
.chip { color: var(--text); border-color: var(--rule); background: rgba(255,255,255,.45); }
.chip:hover, .chip:focus-visible { border-color: var(--brass); background: #fff; }
.intro-cue { color: var(--muted); }
.intro-curtain span::after { background: linear-gradient(90deg, rgba(0,0,0,.35), rgba(0,0,0,.02) 40%, rgba(0,0,0,.18) 70%, rgba(0,0,0,.4)); }

.rail { background: var(--wall); color: var(--text); }
.rail + .rail { border-top: 1px solid var(--rule); }
.rail-bg { background: var(--wall); }
.rail-bg::after { display: none; }
.rail-rod { box-shadow: 0 8px 18px -8px rgba(28,27,23,.6); }
.look-art img { border-radius: var(--arch); background: var(--niche); -webkit-mask-image: none; mask-image: none; box-shadow: 0 34px 60px -40px rgba(28,27,23,.7); }
.look-art svg { filter: drop-shadow(0 30px 30px rgba(28,27,23,.35)); }
.copy-idx { color: var(--brass); }
.copy-title { color: var(--text); }
.copy-occ { color: var(--muted); }
.copy-fabric { color: var(--brass); }
.copy-details li { color: var(--text); }
.copy-details li::before { background: var(--brass); }
.rail-kicker { color: var(--brass); }
.rail-title { color: var(--muted); }
.rail-ticks button { color: rgba(28,27,23,.4); }
.rail-ticks button[aria-current="true"] { color: var(--text); }
.rail-ticks button[aria-current="true"]::after { background: var(--brass); }
.rail-tag { color: var(--muted); }
.fabric-dock { background: rgba(243,242,239,.82); border-color: var(--rule); box-shadow: 0 30px 60px -36px rgba(28,27,23,.55); }
.dock-label span { color: var(--brass); }
.dock-label strong { color: var(--text); }
.dock-label small { color: var(--muted); }
.sw[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--brass), 0 8px 18px -6px rgba(0,0,0,.4); }
.rail:not(.is-kinetic) .look-cap strong { color: var(--text); }
.rail:not(.is-kinetic) .look-cap span { color: var(--muted); }
.studio-after { background: var(--wall-2); }
.studio-after .after-card { background: var(--card); }
