/* ==========================================================================
   knewAline — shell.css (owned by the shell agent)
   Preloader · view-switch veil · custom cursor · sound toggle · header polish · film grain
   ========================================================================== */

/* ---------- preloader ---------- */
.preloader {
  position: fixed; inset: 0;
  z-index: var(--z-preloader);
  pointer-events: auto;
  --mark-h: clamp(76px, 11.5vh, 124px);
}
.preloader__bg { position: absolute; inset: 0; background: #000; }
.preloader__stage {
  position: absolute; left: 50%; top: 47%;
  transform: translate(-50%, -50%);
  display: grid; justify-items: center;
}
.preloader__mark {
  position: relative;
  height: var(--mark-h); width: auto;
  aspect-ratio: 170 / 246;
  overflow: visible;
  will-change: transform;
}
.preloader__ghost path { fill: none; stroke: rgba(255, 255, 255, .13); stroke-width: 1.6; stroke-linejoin: round; }
/* before the JS modules arrive (slow network): a quiet breathing outline */
.preloader:not(.is-live) .preloader__ghost { animation: pl-ghost 2.2s ease-in-out infinite alternate; }
@keyframes pl-ghost { from { opacity: .45; } to { opacity: 1; } }
.preloader__stroke {
  fill: none; stroke: #fff; stroke-width: 1.9; stroke-linejoin: round; stroke-linecap: round;
  stroke-dasharray: 1000; stroke-dashoffset: 1000; /* JS replaces with the real path length */
}
.preloader__white { opacity: 0; }
/* light floor the mark stands on — becomes the horizon sweep on exit */
.preloader__floor {
  position: relative;
  width: clamp(180px, 22vw, 300px); height: 1px;
  margin-top: calc(var(--mark-h) * .1);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .95) 50%, transparent);
  transform: scaleX(.12);
  will-change: transform, opacity;
}
.preloader__floor::after {
  content: ""; position: absolute; left: 0; right: 0; top: -14px; height: 29px;
  background: radial-gradient(50% 50% at 50% 50%, rgba(255, 255, 255, .22), transparent 70%);
}
.preloader__reflection {
  height: calc(var(--mark-h) * .62); overflow: hidden;
  margin-top: calc(var(--mark-h) * .03);
  opacity: .2;
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 85%);
          mask-image: linear-gradient(180deg, #000, transparent 85%);
}
.preloader__reflection svg { height: var(--mark-h); width: auto; aspect-ratio: 170 / 246; transform: scaleY(-1); overflow: visible; }
.preloader__count {
  position: absolute; left: 50%; bottom: calc(clamp(28px, 5.5vh, 56px) + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  font-size: 11px; line-height: 1; letter-spacing: .42em; margin-right: -.42em;
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
}

/* header choreography around the preloader (classes set by preloader.js) */
html.shell-intro .site-nav,
html.shell-intro .site-header__actions { opacity: 0; transform: translate3d(0, -10px, 0); }
html.brand-pending .site-header__brand { opacity: 0; }
html.shell-enter .site-nav { transition: opacity 1.1s var(--ease-out) .05s, transform 1.3s var(--ease-out) .05s; }
html.shell-enter .site-header__actions { transition: opacity 1.1s var(--ease-out) .2s, transform 1.3s var(--ease-out) .2s; }

/* ---------- view-switch veil ---------- */
.veil {
  position: fixed; inset: 0;
  z-index: 19; /* above content, below the header so the nav indicator stays crisp */
  visibility: hidden; pointer-events: none;
}
.veil.is-active { visibility: visible; pointer-events: auto; }
.veil__glass {
  position: absolute; inset: 0; opacity: 0;
  background:
    radial-gradient(120% 80% at 50% 50%, rgba(0, 0, 0, .42), rgba(0, 0, 0, .72));
  -webkit-backdrop-filter: blur(12px) saturate(115%);
          backdrop-filter: blur(12px) saturate(115%);
}
/* touch devices: no backdrop blur (fill-rate), a slightly denser veil instead */
html.touch .veil__glass {
  -webkit-backdrop-filter: none; backdrop-filter: none;
  background: radial-gradient(120% 70% at 50% 50%, rgba(0, 0, 0, .86), rgba(0, 0, 0, .7));
}
.veil__center {
  position: absolute; left: 0; right: 0; top: 50%;
  display: grid; justify-items: center;
}
.veil__line {
  position: relative; display: block;
  width: min(46vw, 620px); height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .95) 50%, transparent);
  transform: scaleX(0);
  will-change: transform, opacity;
}
.veil__line::after {
  content: ""; position: absolute; left: 10%; right: 10%; top: -16px; height: 33px;
  background: radial-gradient(50% 50% at 50% 50%, rgba(255, 255, 255, .18), transparent 70%);
}
.veil__label {
  margin-top: 26px;
  font-size: var(--fs-eyebrow); letter-spacing: var(--track-eyebrow); margin-right: calc(var(--track-eyebrow) * -1);
  text-transform: uppercase; color: var(--ink-2);
  opacity: 0;
}

/* ---------- cursor (enabled by cursor.js on hover:hover + pointer:fine only) ---------- */
.cursor { display: none; }
html.has-cursor .cursor {
  display: block;
  position: fixed; left: 0; top: 0; width: 0; height: 0;
  z-index: var(--z-cursor);
  pointer-events: none;
  mix-blend-mode: difference;
  opacity: 0;
  transition: opacity .35s ease;
}
html.has-cursor .cursor.is-visible { opacity: 1; }
html.has-cursor .cursor.is-hidden { opacity: 0; }
.cursor__dot, .cursor__ring { position: absolute; left: 0; top: 0; will-change: transform; }
.cursor__dot::before {
  content: ""; position: absolute; left: -2.5px; top: -2.5px; width: 5px; height: 5px;
  border-radius: 50%; background: #fff;
  transition: transform .45s var(--ease-out), opacity .3s;
}
.cursor__circle {
  position: absolute; left: 0; top: 0;
  width: var(--cs, 34px); height: var(--cs, 34px);
  margin: calc(var(--cs, 34px) / -2) 0 0 calc(var(--cs, 34px) / -2);
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 50%;
  transition:
    width .55s var(--ease-out), height .55s var(--ease-out), margin .55s var(--ease-out),
    background-color .4s, border-color .4s, opacity .35s, transform .45s var(--ease-out);
}
.cursor__label {
  position: absolute; left: 0; top: 0;
  transform: translate(-50%, -50%);
  font-size: 10px; line-height: 1; letter-spacing: .24em; margin-left: .12em;
  text-transform: uppercase; white-space: nowrap; color: #fff;
  opacity: 0; transition: opacity .3s;
}
.cursor__arrow {
  position: absolute; left: 0; top: 0; width: 12px; height: 12px; max-width: none;
  fill: none; stroke: #fff; stroke-width: 1.1; stroke-linecap: round; stroke-linejoin: round;
  opacity: 0;
  transition: opacity .3s, transform .55s var(--ease-out);
}
.cursor__arrow--l { transform: translate(-6px, -6px); }
.cursor__arrow--r { transform: translate(-6px, -6px); }

/* states */
.cursor.is-link { --cs: 46px; }
.cursor.is-link .cursor__circle { border-color: rgba(255, 255, 255, .4); }
.cursor.is-link .cursor__dot::before,
.cursor.is-magnet .cursor__dot::before { transform: scale(0); }
/* magnetic elements take over: the ring hands off to the element itself */
.cursor.is-magnet .cursor__circle { transform: scale(.4); opacity: 0; }
/* drag / label: a small frosted disc, normal blending so the label stays legible over the bottle prints */
html.has-cursor .cursor.is-drag, html.has-cursor .cursor.is-label { --cs: 92px; mix-blend-mode: normal; }
.cursor.is-drag .cursor__circle, .cursor.is-label .cursor__circle {
  border-color: rgba(255, 255, 255, .34);
  background: rgba(8, 9, 11, .36);
  -webkit-backdrop-filter: blur(7px) saturate(140%);
          backdrop-filter: blur(7px) saturate(140%);
}
.cursor.is-drag .cursor__dot::before, .cursor.is-label .cursor__dot::before { transform: scale(0); }
.cursor.is-drag .cursor__label, .cursor.is-label .cursor__label { opacity: 1; transition-delay: .12s; }
.cursor.is-drag .cursor__arrow { opacity: .9; transition-delay: .08s, 0s; }
.cursor.is-drag .cursor__arrow--l { transform: translate(-38px, -6px); animation: cursor-nudge-l 2.4s var(--ease-in-out) .6s infinite; }
.cursor.is-drag .cursor__arrow--r { transform: translate(26px, -6px); animation: cursor-nudge-r 2.4s var(--ease-in-out) .6s infinite; }
/* pressed: the disc clears so the bottle is fully visible while turning */
.cursor.is-down .cursor__circle { transform: scale(.86); }
.cursor.is-drag.is-down .cursor__circle {
  transform: scale(.72); background: transparent;
  -webkit-backdrop-filter: none; backdrop-filter: none;
  border-color: rgba(255, 255, 255, .5);
}
.cursor.is-drag.is-down .cursor__label { opacity: 0; transition-delay: 0s; }
.cursor.is-drag.is-down .cursor__arrow--l { animation: none; transform: translate(-48px, -6px); }
.cursor.is-drag.is-down .cursor__arrow--r { animation: none; transform: translate(36px, -6px); }
@keyframes cursor-nudge-l { 0%, 70%, 100% { transform: translate(-38px, -6px); } 82% { transform: translate(-42px, -6px); } }
@keyframes cursor-nudge-r { 0%, 70%, 100% { transform: translate(26px, -6px); } 82% { transform: translate(30px, -6px); } }

/* native cursor is kept; drag zones get grab / grabbing */
[data-cursor="drag"] { cursor: grab; }
[data-cursor="drag"]:active, html.is-grabbing, html.is-grabbing * { cursor: grabbing; }

/* ---------- sound toggle ---------- */
.sound-toggle {
  position: relative;
  width: 40px; height: 40px;
  display: inline-grid; place-items: center;
  border-radius: 50%;
  color: var(--ink-2);
  transition: color .4s var(--ease-out);
}
.sound-toggle::before {
  content: ""; position: absolute; inset: 3px; border-radius: 50%;
  border: 1px solid var(--hair);
  opacity: 0; transform: scale(.8);
  transition: opacity .4s var(--ease-out), transform .6s var(--ease-out);
}
.sound-toggle:focus-visible, .sound-toggle[aria-pressed="true"] { color: var(--ink); }
.sound-toggle:focus-visible::before { opacity: 1; transform: none; }
/* real hover only: on touch :hover sticks after the tap, and a just-muted toggle kept its ring and full ink (looked on) */
@media (hover: hover) and (pointer: fine) {
  .sound-toggle:hover { color: var(--ink); }
  .sound-toggle:hover::before { opacity: 1; transform: none; }
}
.sound-toggle:focus-visible { outline-offset: 0; border-radius: 50%; }
/* autoplay waiting for the first gesture: a slow ring invites a click */
.sound-toggle.is-pending { color: var(--ink); }
.sound-toggle.is-pending::after {
  content: ""; position: absolute; inset: 2px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .5);
  pointer-events: none;
  animation: sound-pending 2.6s var(--ease-out) infinite;
}
@keyframes sound-pending { 0% { transform: scale(.72); opacity: 0; } 25% { opacity: .85; } 100% { transform: scale(1.45); opacity: 0; } }
.sound-toggle__bars { display: flex; align-items: center; gap: 3px; height: 16px; }
.sound-toggle__bars i {
  display: block; width: 2px; height: 16px;
  border-radius: 1px; background: currentColor;
  transform: scaleY(var(--h, .2));
}
.sound-toggle__bars i:nth-child(1) { --h: .25; }
.sound-toggle__bars i:nth-child(2) { --h: .5; }
.sound-toggle__bars i:nth-child(3) { --h: .34; }
.sound-toggle__bars i:nth-child(4) { --h: .19; }

/* ---------- header polish ---------- */
.site-header { transition: transform .7s var(--ease-out); }
/* scrim behind the returning header: solid where the nav sits, so bottle prints / letter copy scrolling
   underneath read as a faint ghost at most, then a soft fall-off below the header line */
.site-header::before {
  content: ""; position: absolute; inset: 0 0 -56px 0; z-index: -1;
  pointer-events: none;
  background: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .94) 55%, rgba(0, 0, 0, .6) 75%, transparent 100%);
  opacity: 0;
  transition: opacity .8s var(--ease-out);
}
.site-header.is-scrolled::before { opacity: 1; }
.site-header.is-tucked { transform: translate3d(0, -100%, 0); }
.site-header.is-tucked::before { opacity: 0; }
.site-nav__indicator {
  width: 100px;
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: none;
  will-change: transform;
}
.site-header__brand .k-mark { transition: opacity .4s var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .site-header__brand:hover .k-mark { opacity: .72; } }

/* ---------- film grain ---------- */
.grain {
  position: fixed; inset: -120px;
  z-index: 90;
  pointer-events: none;
  opacity: .05;
  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='.82' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1.7 0 0 0 -.62'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 220px 220px;
  animation: grain-shift .9s steps(6) infinite;
}
html.grain-static .grain { animation: none; }
html.touch .grain { display: none; } /* phones: skip the extra full-screen layer */
@keyframes grain-shift {
  0% { transform: translate3d(0, 0, 0); }
  17% { transform: translate3d(-48px, 31px, 0); }
  33% { transform: translate3d(37px, -62px, 0); }
  50% { transform: translate3d(-71px, -18px, 0); }
  67% { transform: translate3d(22px, 54px, 0); }
  83% { transform: translate3d(66px, 9px, 0); }
  100% { transform: translate3d(0, 0, 0); }
}

/* ---------- responsive ---------- */
@media (max-width: 720px) {
  .preloader { --mark-h: clamp(70px, 10vh, 96px); }
  /* 44 px hit area; the ring (30 px), the pending pulse (32 px), the bars' centre and the 28×36 layout footprint stay
     what they were at 36 px (margin-right -8px) */
  .sound-toggle { width: 44px; height: 44px; margin: -4px -12px -4px -4px; }
  .sound-toggle::before { inset: 7px; }
  .sound-toggle.is-pending::after { inset: 6px; }
  .grain { opacity: .04; }
  .veil__label { margin-top: 20px; }
}

/* touch tablets / landscape phones: 44 px hit area, same 40 px footprint and ring sizes */
@media (pointer: coarse) and (min-width: 721px) {
  .sound-toggle { width: 44px; height: 44px; margin: -2px; }
  .sound-toggle::before { inset: 5px; }
  .sound-toggle.is-pending::after { inset: 4px; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .grain { animation: none; }
  .veil__glass { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(0, 0, 0, .78); }
}

/* lead: keep the preloader floor glow from widening the mobile layout viewport */
.preloader { overflow: hidden; }
