/* =========================================================
   LAIE · FX LAYER — premium motion & micro-interactions
   Shared by site-01 / site-02 / site-03
   All hidden states are scoped to body.fx-on so the site
   stays perfectly usable if JS is unavailable or disabled.
   ========================================================= */

/* ---------------------------------------------------------
   Local Poppins — same-origin webfont, no external dependency.
   Embedded previews block Google Fonts via CSP and some networks
   cannot reach it at all; this keeps letterforms identical everywhere.
   --------------------------------------------------------- */
@font-face {
  font-family: "Poppins Local"; font-style: normal; font-weight: 300; font-display: swap;
  src: url("../fonts/poppins-300.woff2") format("woff2");
}
@font-face {
  font-family: "Poppins Local"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/poppins-400.woff2") format("woff2");
}
@font-face {
  font-family: "Poppins Local"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("../fonts/poppins-500.woff2") format("woff2");
}
@font-face {
  font-family: "Poppins Local"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("../fonts/poppins-600.woff2") format("woff2");
}
@font-face {
  font-family: "Poppins Local"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("../fonts/poppins-700.woff2") format("woff2");
}
@font-face {
  font-family: "Poppins Local"; font-style: normal; font-weight: 800; font-display: swap;
  src: url("../fonts/poppins-800.woff2") format("woff2");
}

:root {
  --fx-accent: #da251c;
  --fx-ink: #12141a;
  --fx-veil: #12141a;
  --fx-cover: #f4f2ee;
  --fx-line: rgba(18, 20, 26, .12);
  --fx-glow: rgba(218, 37, 28, .055);
  --fx-ease: cubic-bezier(.16, 1, .3, 1);
  --fx-ease-io: cubic-bezier(.76, 0, .24, 1);
}
body.site-02 {
  --fx-accent: #e02b1d;
  --fx-ink: #f1f3f5;
  --fx-veil: #0b0d0f;
  --fx-cover: #171b1f;
  --fx-line: rgba(255, 255, 255, .1);
  --fx-glow: rgba(224, 43, 29, .085);
}
body.site-03 {
  --fx-accent: #da251c;
  --fx-veil: #0f1011;
  --fx-cover: #f1efeb;
}

/* ---------------------------------------------------------
   1. Global polish
   --------------------------------------------------------- */
html { scrollbar-color: var(--fx-accent) transparent; }
body.fx-on { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body.fx-on ::-webkit-scrollbar { width: 9px; height: 9px; }
body.fx-on ::-webkit-scrollbar-track { background: transparent; }
body.fx-on ::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--fx-ink) 22%, transparent);
  border: 3px solid transparent; background-clip: padding-box; border-radius: 20px;
}
body.fx-on ::-webkit-scrollbar-thumb:hover { background: var(--fx-accent); background-clip: padding-box; }
:focus-visible { outline: 2px solid var(--fx-accent); outline-offset: 4px; }

body.fx-on :is(a, button, input, textarea, select) { -webkit-tap-highlight-color: transparent; }
body.fx-on a { transition: color .3s var(--fx-ease); }

/* ambient cursor glow */
body.fx-on::before {
  content: ""; position: fixed; inset: 0; z-index: 3; pointer-events: none;
  background: radial-gradient(480px circle at var(--gx, 50%) var(--gy, 40%), var(--fx-glow), transparent 72%);
  opacity: 0; transition: opacity .8s ease;
}
body.fx-on.fx-ambient::before { opacity: 1; }

/* section top rule draws itself in */
body.fx-on .section::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px;
  background: linear-gradient(90deg, var(--fx-accent) 0 5%, var(--fx-line) 5% 100%);
  transform: scaleX(0); transform-origin: left; opacity: .7;
  transition: transform 1.15s var(--fx-ease);
}
body.fx-on .section.fx-in::before { transform: scaleX(1); }

/* ---------------------------------------------------------
   2. Page transition veil
   The opening curtain was removed on request — content shows immediately.
   --------------------------------------------------------- */
.fx-veil {
  position: fixed; inset: 0; z-index: 1000; background: var(--fx-accent);
  transform: translateY(101%); pointer-events: none; visibility: hidden;
  transition: transform .48s var(--fx-ease-io), visibility .48s;
}
body.fx-leaving .fx-veil { transform: translateY(0); visibility: visible; }
body.fx-leaving .site-head, body.fx-leaving main, body.fx-leaving .site-foot { opacity: .35; transition: opacity .4s; }

/* ---------------------------------------------------------
   3. Split text reveal
   --------------------------------------------------------- */
/* padding/margin compensation keeps glyphs from being clipped by tight
   display line-heights (.98 - 1.04) while still masking the rise-in */
body.fx-on .fx-split .fx-c {
  display: inline-block; overflow: hidden; vertical-align: bottom;
  padding: .18em 0 .1em; margin: -.18em 0 -.1em;
}
body.fx-on .fx-split .fx-c > i {
  display: inline-block; font-style: normal; transform: translateY(115%);
  transition: transform .95s var(--fx-ease); transition-delay: var(--d, 0ms);
  will-change: transform;
}
body.fx-on .fx-split.fx-in .fx-c > i { transform: none; }
body.fx-on .fx-split.reveal { opacity: 1; transform: none; }
body.fx-on h1.fx-split, body.fx-on .h2.fx-split { opacity: 1; }

/* ---------------------------------------------------------
   4. Cursor system
   --------------------------------------------------------- */
.fx-ring, .fx-dot { position: fixed; left: 0; top: 0; pointer-events: none; z-index: 997; border-radius: 50%; }
.fx-ring {
  width: 34px; height: 34px; margin: -17px 0 0 -17px;
  border: 1px solid color-mix(in srgb, var(--fx-ink) 45%, transparent);
  transition: width .35s var(--fx-ease), height .35s var(--fx-ease), margin .35s var(--fx-ease),
              border-color .35s, background .35s, opacity .3s;
  display: grid; place-items: center;
}
.fx-dot {
  width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px;
  background: var(--fx-accent); transition: opacity .3s, transform .3s;
}
body.fx-hover .fx-ring {
  width: 52px; height: 52px; margin: -26px 0 0 -26px;
  border-color: var(--fx-accent); background: color-mix(in srgb, var(--fx-accent) 8%, transparent);
}
body.fx-hover .fx-dot { opacity: 0; transform: scale(.3); }
.fx-cursor-label {
  font: 500 9px/1 var(--mono, monospace); letter-spacing: .14em; text-transform: uppercase;
  color: var(--fx-accent); opacity: 0; transform: scale(.7); transition: opacity .3s, transform .3s;
  white-space: nowrap;
}
body.fx-view .fx-cursor-label { opacity: 1; transform: scale(1); }

/* ---------------------------------------------------------
   5. Buttons · magnetic + sheen
   --------------------------------------------------------- */
body.fx-on .btn, body.fx-on .lang-toggle, body.fx-on .link-u {
  transition: transform .35s var(--fx-ease), background .3s, color .3s,
              box-shadow .3s, border-color .3s, translate .4s var(--fx-ease), gap .3s;
}
body.fx-on .btn { position: relative; overflow: hidden; isolation: isolate; }
body.fx-on .btn::after {
  content: ""; position: absolute; top: -60%; bottom: -60%; left: -70%; width: 55%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.28), transparent);
  transform: translateX(-140%) skewX(-18deg); pointer-events: none; z-index: 0;
  transition: transform .75s var(--fx-ease);
}
body.fx-on .btn:hover::after { transform: translateX(430%) skewX(-18deg); }
body.fx-on .btn > span, body.fx-on .btn > i, body.fx-on .btn > b { position: relative; z-index: 1; }
body.fx-on .nav a.active::before {
  content: ""; position: absolute; top: -6px; left: 50%; width: 3px; height: 3px;
  margin-left: -1.5px; border-radius: 50%; background: var(--fx-accent);
}
body.fx-on .nav a { position: relative; }

/* ---------------------------------------------------------
   6. Image curtain + sheen on product cards
   --------------------------------------------------------- */
body.fx-on .p-card-media::before {
  content: ""; position: absolute; inset: 0; z-index: 4; pointer-events: none;
  background: var(--fx-cover); transform: translateY(0);
  transition: transform .95s var(--fx-ease-io);
}
body.fx-on .p-card.fx-shown .p-card-media::before,
body.fx-on .fx-shown > .p-card-media::before { transform: translateY(-101%); }
body.fx-on .p-card-media::after {
  content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: linear-gradient(105deg, transparent 36%, rgba(255,255,255,.34) 50%, transparent 64%);
  transform: translateX(-120%); transition: transform .8s var(--fx-ease);
}
body.fx-on .p-card:hover .p-card-media::after { transform: translateX(120%); }
body.fx-on .p-card:hover .p-card-media > img {
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale(1.07);
}
body.fx-on .p-card-media > img { will-change: transform; }
.p-grid-fill { background: var(--paper, #f4f2ee); }
body.site-02 .p-grid-fill { background: transparent; }
body.site-03 .p-grid-fill { background: var(--white, #fff); }

/* ---------------------------------------------------------
   7. Floating HUD · section counter + back-to-top ring
   --------------------------------------------------------- */
.fx-hud {
  position: fixed; right: 22px; bottom: 22px; z-index: 96;
  display: flex; align-items: center; gap: 12px;
  opacity: 0; transform: translateY(14px); pointer-events: none;
  transition: opacity .45s var(--fx-ease), transform .45s var(--fx-ease);
}
body.fx-hud-on .fx-hud { opacity: 1; transform: none; pointer-events: auto; }
.fx-hud-count {
  display: flex; align-items: baseline; gap: 5px; padding: 8px 12px;
  background: color-mix(in srgb, var(--fx-veil) 88%, transparent);
  color: #fff; backdrop-filter: blur(12px); border-radius: 2px;
  font: 400 10px/1 var(--mono, monospace); letter-spacing: .12em;
}
.fx-hud-count b { font-size: 15px; font-weight: 600; letter-spacing: 0; color: #fff; }
.fx-hud-count span { opacity: .5; }
.fx-hud-top {
  position: relative; width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer;
  background: color-mix(in srgb, var(--fx-veil) 90%, transparent); color: #fff;
  display: grid; place-items: center; backdrop-filter: blur(12px);
  transition: transform .35s var(--fx-ease), background .35s;
}
.fx-hud-top:hover { transform: translateY(-4px); background: var(--fx-accent); }
.fx-hud-top svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.fx-hud-top circle { fill: none; stroke-width: 1.5; }
.fx-hud-top .fx-track { stroke: rgba(255,255,255,.18); }
.fx-hud-top .fx-bar { stroke: var(--fx-accent); stroke-linecap: round; transition: stroke-dashoffset .15s linear; }
.fx-hud-top > span { font-size: 15px; line-height: 1; position: relative; z-index: 1; }

/* ---------------------------------------------------------
   8. Small refinements
   --------------------------------------------------------- */
body.fx-on .site-foot a { position: relative; }
body.fx-on .site-foot a::after {
  content: ""; position: absolute; left: 0; bottom: -3px; height: 1px; width: 100%;
  background: var(--fx-accent); transform: scaleX(0); transform-origin: right;
  transition: transform .4s var(--fx-ease);
}
body.fx-on .site-foot a:hover::after { transform: scaleX(1); transform-origin: left; }
body.fx-on input:focus, body.fx-on textarea:focus, body.fx-on select:focus {
  border-color: var(--fx-accent) !important; outline: none;
  box-shadow: 0 3px 0 -1px var(--fx-accent);
}
body.fx-on .scroll-progress { box-shadow: 0 0 14px color-mix(in srgb, var(--fx-accent) 70%, transparent); }
body.fx-on .p-card { transition: translate .45s var(--fx-ease), background .35s, box-shadow .45s var(--fx-ease), border-color .35s, transform .4s var(--ease); }
body.fx-on .p-card:hover { translate: 0 -5px; }
body.site-02.fx-on .p-card:hover { translate: 0 0; }

/* ---------------------------------------------------------
   9. Accessibility / small screens — motion off
   --------------------------------------------------------- */
@media (hover: none), (pointer: coarse), (max-width: 980px) {
  .fx-ring, .fx-dot, .fx-hud { display: none !important; }
  body.fx-on::before { display: none; }
}
@media (max-width: 980px) {
  body.fx-on .fx-split .fx-c > i { transform: none !important; transition: none; }
  body.fx-on .section::before { transform: scaleX(1) !important; }
  body.fx-on .p-card-media::before { transform: translateY(-101%) !important; }
}
@media (prefers-reduced-motion: reduce) {
  .fx-veil, .fx-ring, .fx-dot, .fx-hud { display: none !important; }
  body.fx-on .fx-split .fx-c > i { transform: none !important; transition: none; }
  body.fx-on .p-card-media::before { transform: translateY(-101%) !important; }
  body.fx-on .section::before { transform: scaleX(1) !important; }
  body.fx-on .btn::after, body.fx-on .p-card-media::after { display: none; }
  body.fx-on::before { display: none; }
}
@media print { .fx-veil, .fx-ring, .fx-dot, .fx-hud { display: none !important; } }
