/* ==========================================================================
   TRACLABS LIQUID GLASS  —  design system
   --------------------------------------------------------------------------
   Materials   : data-material="crystal | clear | frost | dark"
   Components  : .glass-nav (GlassNavbar) · .glass-panel (GlassPanel)
                 .glass-card (GlassCard)  · .glass-btn (GlassButton)
   Hooks (JS)  : data-light  → cursor-following light + (with .tilt) 3D tilt
                 data-sweep  → ambient light reflection that drifts across
                 data-par    → scroll / pointer parallax
   Everything is driven by CSS variables so light/dark share one material.
   ========================================================================== */

@property --d    { syntax: "<length>"; inherits: true; initial-value: 4px; }
@property --glow { syntax: "<number>";     inherits: true; initial-value: .3; }

:root {
  color-scheme: light;
  --spring: cubic-bezier(.3, 1.35, .5, 1);
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  interpolate-size: allow-keywords;
}
@supports (transition-timing-function: linear(0, 1)) {
  :root {
    --spring: linear(0, 0.019, 0.07, 0.143, 0.229, 0.324, 0.421, 0.516, 0.607, 0.69, 0.765, 0.831, 0.887, 0.935, 0.973, 1.003, 1.026, 1.043, 1.054, 1.06, 1.063, 1.063, 1.06, 1.056, 1.051, 1.045, 1.039, 1.033, 1.027, 1.022, 1.017, 1.012, 1.008, 1.005, 1);
  }
}

/* ---------- THEME TOKENS : LIGHT (crystal clear · white · violet) ---------- */
:root {
  --bg: #ffffff;
  --bg2: #f6f3ff;
  --text: #0e0b1a;
  --mut: #5f5a7d;
  --pri: #5b21b6;
  --pri-h: #4c1d95;
  --pri2: #7c3aed;
  --accent: #5b21b6;
  --soft: rgba(91, 33, 182, .08);
  --line: rgba(24, 16, 56, .09);
  --line2: rgba(24, 16, 56, .18);
  --err: #c62828;
  --ok: #0f8a5f;
  --well: rgba(91, 33, 182, .055);
  --well-in: inset 0 2px 5px rgba(40, 20, 110, .10), inset 0 1px 1px rgba(40, 20, 110, .08), 0 1px 0 rgba(255, 255, 255, .9);
  --fallback: rgba(255, 255, 255, .92);

  /* atmosphere */
  --o1: rgba(167, 139, 250, .55);
  --o2: rgba(129, 140, 248, .38);
  --o3: rgba(244, 143, 205, .30);
  --streak: rgba(139, 92, 246, .22);
  --spot: rgba(139, 92, 246, .16);
  --aurora-op: .5;

  /* lighting */
  --light-hot: rgba(255, 255, 255, .85);
  --sheen: rgba(255, 255, 255, .55);
  --sheen2: rgba(167, 139, 250, .16);

  /* rim = bright reflective edge */
  --rim: linear-gradient(135deg, #fff 0%, rgba(167, 139, 250, .6) 13%, rgba(255, 255, 255, .75) 32%, rgba(124, 58, 237, .10) 55%, rgba(129, 140, 248, .35) 80%, rgba(255, 255, 255, .95) 100%);

  /* crystal */
  --crystal-fill: linear-gradient(135deg, rgba(255, 255, 255, .78) 0%, rgba(255, 255, 255, .40) 38%, rgba(221, 214, 254, .34) 72%, rgba(255, 255, 255, .62) 100%);
  --crystal-inner: inset 0 1px 0 #fff, inset 0 -1px 0 rgba(124, 58, 237, .16), inset 0 0 34px rgba(255, 255, 255, .55), inset 0 -26px 34px -26px rgba(139, 92, 246, .30), inset 0 22px 30px -26px #fff;
  --crystal-outer: 0 2px 4px rgba(60, 30, 140, .06), 0 28px 60px -22px rgba(76, 29, 149, .32), 0 0 80px -30px rgba(124, 58, 237, .35);
  /* clear */
  --clear-fill: linear-gradient(135deg, rgba(255, 255, 255, .50), rgba(255, 255, 255, .12) 55%, rgba(196, 181, 253, .20));
  --clear-inner: inset 0 1px 0 rgba(255, 255, 255, .95), inset 0 -1px 0 rgba(124, 58, 237, .14), inset 0 0 22px rgba(255, 255, 255, .35), inset 0 -18px 26px -20px rgba(139, 92, 246, .28);
  --clear-outer: 0 2px 4px rgba(60, 30, 140, .05), 0 22px 44px -22px rgba(76, 29, 149, .30);
  /* frost */
  --frost-fill: linear-gradient(145deg, rgba(255, 255, 255, .86), rgba(250, 247, 255, .66));
  --frost-inner: inset 0 1px 0 #fff, inset 0 -1px 0 rgba(124, 58, 237, .12), inset 0 0 30px rgba(255, 255, 255, .6);
  --frost-outer: 0 2px 4px rgba(60, 30, 140, .05), 0 22px 50px -22px rgba(76, 29, 149, .26);
  /* dark liquid (still dark in light mode: a smoked slab) */
  --dark-fill: linear-gradient(150deg, rgba(70, 40, 150, .78), rgba(22, 12, 54, .86));
  --dark-inner: inset 0 1px 0 rgba(255, 255, 255, .55), inset 0 -1px 0 rgba(255, 255, 255, .12), inset 0 0 50px rgba(139, 92, 246, .22), inset 0 -34px 44px -30px rgba(196, 181, 253, .45);
  --dark-outer: 0 2px 6px rgba(30, 10, 80, .25), 0 34px 70px -24px rgba(60, 20, 150, .6);
  --dark-rim: linear-gradient(135deg, #fff 0%, rgba(196, 181, 253, .65) 14%, rgba(255, 255, 255, .10) 40%, rgba(255, 255, 255, .06) 62%, rgba(147, 197, 253, .55) 84%, #fff 100%);
}

/* ---------- THEME TOKENS : DARK (deep liquid glass · violet illumination) ---------- */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #05040a;
  --bg2: #0d0b14;
  --text: #f6f4ff;
  --mut: #a9a5c4;
  --pri: #7c3aed;
  --pri-h: #8b5cf6;
  --pri2: #c4b5fd;
  --accent: #c4b5fd;
  --soft: rgba(139, 92, 246, .16);
  --line: rgba(255, 255, 255, .10);
  --line2: rgba(255, 255, 255, .22);
  --err: #ff8a8a;
  --ok: #6ee7b7;
  --well: rgba(0, 0, 0, .30);
  --well-in: inset 0 2px 6px rgba(0, 0, 0, .55), inset 0 1px 1px rgba(0, 0, 0, .5), 0 1px 0 rgba(255, 255, 255, .07);
  --fallback: rgba(19, 17, 28, .94);

  --o1: rgba(124, 58, 237, .55);
  --o2: rgba(67, 56, 202, .46);
  --o3: rgba(192, 38, 211, .26);
  --streak: rgba(167, 139, 250, .26);
  --spot: rgba(139, 92, 246, .20);
  --aurora-op: .42;

  --light-hot: rgba(220, 205, 255, .30);
  --sheen: rgba(255, 255, 255, .10);
  --sheen2: rgba(139, 92, 246, .14);

  --rim: linear-gradient(135deg, rgba(255, 255, 255, .95) 0%, rgba(196, 181, 253, .55) 12%, rgba(255, 255, 255, .07) 32%, rgba(255, 255, 255, .04) 60%, rgba(147, 197, 253, .42) 84%, rgba(255, 255, 255, .85) 100%);

  --crystal-fill: linear-gradient(135deg, rgba(255, 255, 255, .15) 0%, rgba(255, 255, 255, .045) 38%, rgba(160, 130, 255, .07) 70%, rgba(255, 255, 255, .10) 100%);
  --crystal-inner: inset 0 1px 0 rgba(255, 255, 255, .42), inset 0 -1px 0 rgba(255, 255, 255, .10), inset 0 0 44px rgba(139, 92, 246, .10), inset 0 -26px 38px -28px rgba(196, 181, 253, .34), inset 0 20px 28px -24px rgba(255, 255, 255, .24);
  --crystal-outer: 0 2px 6px rgba(0, 0, 0, .4), 0 32px 70px -22px rgba(0, 0, 0, .75), 0 0 90px -28px rgba(124, 58, 237, .45);
  --clear-fill: linear-gradient(135deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .012) 55%, rgba(139, 92, 246, .06));
  --clear-inner: inset 0 1px 0 rgba(255, 255, 255, .5), inset 0 -1px 0 rgba(255, 255, 255, .14), inset 0 0 26px rgba(139, 92, 246, .10), inset 0 -20px 28px -22px rgba(196, 181, 253, .36);
  --clear-outer: 0 2px 6px rgba(0, 0, 0, .35), 0 24px 50px -22px rgba(0, 0, 0, .7), 0 0 60px -24px rgba(124, 58, 237, .5);
  --frost-fill: linear-gradient(145deg, rgba(255, 255, 255, .17), rgba(255, 255, 255, .07));
  --frost-inner: inset 0 1px 0 rgba(255, 255, 255, .34), inset 0 -1px 0 rgba(255, 255, 255, .08), inset 0 0 36px rgba(255, 255, 255, .04);
  --frost-outer: 0 2px 6px rgba(0, 0, 0, .35), 0 24px 54px -22px rgba(0, 0, 0, .7);
  --dark-fill: linear-gradient(150deg, rgba(52, 30, 104, .52), rgba(6, 4, 16, .66));
  --dark-inner: inset 0 1px 0 rgba(255, 255, 255, .5), inset 0 -1px 0 rgba(255, 255, 255, .14), inset 0 0 56px rgba(139, 92, 246, .18), inset 0 -36px 48px -32px rgba(196, 181, 253, .5);
  --dark-outer: 0 2px 8px rgba(0, 0, 0, .5), 0 36px 80px -26px rgba(0, 0, 0, .85), 0 0 100px -26px rgba(124, 58, 237, .55);
  --dark-rim: linear-gradient(135deg, #fff 0%, rgba(196, 181, 253, .6) 12%, rgba(255, 255, 255, .06) 38%, rgba(255, 255, 255, .04) 62%, rgba(147, 197, 253, .5) 84%, #fff 100%);
}

/* ==========================================================================
   BASE GLASS MATERIAL
   ========================================================================== */
.glass {
  --r: 24px;
  --fill: var(--crystal-fill);
  --blur: 20px;
  --sat: 1.7;
  --bri: 1.06;
  --inner: var(--crystal-inner);
  --outer: var(--crystal-outer);
  --edge: var(--rim);
  --mx: 28%;
  --my: 0%;
  position: relative;
  isolation: isolate;
  border-radius: var(--r);
  background: var(--fallback);
  box-shadow: var(--inner), var(--outer);
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass {
    background: var(--fill);
    -webkit-backdrop-filter: blur(var(--blur)) saturate(var(--sat)) brightness(var(--bri));
    backdrop-filter: blur(var(--blur)) saturate(var(--sat)) brightness(var(--bri));
  }
}
.glass[data-material="clear"] { --fill: var(--clear-fill); --blur: 7px; --sat: 1.5; --bri: 1.03; --inner: var(--clear-inner); --outer: var(--clear-outer); }
.glass[data-material="frost"] { --fill: var(--frost-fill); --blur: 38px; --sat: 1.35; --bri: 1.04; --inner: var(--frost-inner); --outer: var(--frost-outer); }
.glass[data-material="dark"]  { --fill: var(--dark-fill);  --blur: 28px; --sat: 1.9;  --bri: 1;    --inner: var(--dark-inner);  --outer: var(--dark-outer); --edge: var(--dark-rim); }
.glass[data-material="dark"] { color: #f6f4ff; }

/* refraction-like distortion (Chromium only, enabled by glass.js) */
.refract .glass[data-refract] {
  -webkit-backdrop-filter: blur(calc(var(--blur) * .7)) url(#lg-refract) saturate(var(--sat)) brightness(var(--bri));
  backdrop-filter: blur(calc(var(--blur) * .7)) url(#lg-refract) saturate(var(--sat)) brightness(var(--bri));
}

/* bright reflective edge */
.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: var(--rim-w, 1.5px);
  background: var(--edge);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  pointer-events: none;
  z-index: 3;
}
/* cursor light + directional sheen (sits above the glass, under the content) */
.glass::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(380px circle at var(--mx) var(--my), var(--light-hot), transparent 62%),
    linear-gradient(118deg, var(--sheen) 0%, transparent 26%, transparent 68%, var(--sheen2) 100%);
  opacity: .55;
  transition: opacity .5s ease;
}
.glass:hover::after, .glass.lit::after { opacity: 1; }

/* ambient light reflection that slowly drifts across (compositor-only) */
.sweep {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  pointer-events: none;
  z-index: -1;
}
.sweep::before {
  content: "";
  position: absolute;
  top: -25%;
  bottom: -25%;
  left: 0;
  width: 42%;
  background: linear-gradient(100deg, transparent 0%, rgba(255, 255, 255, .10) 34%, rgba(214, 200, 255, .22) 52%, rgba(160, 200, 255, .08) 66%, transparent 100%);
  transform: translateX(-130%) skewX(-16deg);
  animation: sweep 11s var(--ease-io) var(--sd, 0s) infinite;
  animation-play-state: paused;
}
:root:not([data-theme="dark"]) .sweep::before {
  background: linear-gradient(100deg, transparent 0%, rgba(255, 255, 255, .55) 38%, rgba(196, 181, 253, .30) 54%, transparent 100%);
}
@keyframes sweep {
  0%   { transform: translateX(-130%) skewX(-16deg); }
  38%  { transform: translateX(330%) skewX(-16deg); }
  100% { transform: translateX(330%) skewX(-16deg); }
}

/* ==========================================================================
   GlassPanel  /  GlassCard  /  GlassNavbar
   ========================================================================== */
.glass-panel { --r: 28px; }
.glass-card  { --r: 26px; }
.glass-nav   { --r: 22px; }

.tilt {
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--lift, 0px));
  transition: transform .8s var(--spring), box-shadow .5s ease;
}
.tilt:hover { --lift: -6px; will-change: transform; transition: transform .16s ease-out, box-shadow .5s ease; }

/* ==========================================================================
   GlassButton   — physical, raised, thick, glossy
   ========================================================================== */
.glass-btn {
  --d: 4px;
  --glow: .30;
  --mx: 50%;
  --my: 0%;
  --r: 16px;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 50px;
  padding: 0 26px;
  border: 0;
  border-radius: var(--r);
  font-family: inherit;
  font-weight: 600;
  font-size: 15.5px;
  line-height: 1;
  letter-spacing: -.005em;
  color: #fff;
  cursor: pointer;
  text-shadow: 0 1px 0 rgba(40, 10, 110, .55), 0 0 14px rgba(255, 255, 255, .16);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  background:
    radial-gradient(120% 70% at 50% -18%, rgba(255, 255, 255, .62) 0%, rgba(255, 255, 255, .14) 48%, transparent 62%),
    linear-gradient(180deg, rgba(255, 255, 255, .22) 0%, rgba(255, 255, 255, .03) 49%, rgba(0, 0, 0, 0) 50%, rgba(20, 0, 80, .14) 100%),
    linear-gradient(180deg, rgba(139, 92, 246, .96) 0%, rgba(108, 52, 224, .97) 55%, rgba(84, 34, 190, .98) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .92),
    inset 0 0 0 1px rgba(255, 255, 255, .26),
    inset 0 -1px 0 rgba(30, 5, 90, .6),
    inset 0 10px 14px -8px rgba(255, 255, 255, .5),
    inset 0 -12px 16px -8px rgba(214, 200, 255, .55),
    0 0 0 1px rgba(46, 16, 130, .75),
    0 calc(var(--d) * .5) 0 1px #5b2bd0,
    0 var(--d) 0 1px #3b1a96,
    0 calc(var(--d) + 1px) 0 2px rgba(20, 6, 70, .55),
    0 calc(var(--d) + 10px) 22px -6px rgba(109, 40, 217, .62),
    0 calc(var(--d) + 26px) 44px -14px rgba(0, 0, 0, .42),
    0 0 34px -2px rgba(139, 92, 246, var(--glow));
  transition:
    transform .6s var(--spring),
    --d .6s var(--spring),
    --glow .45s ease,
    filter .35s ease,
    opacity .3s;
}
/* top-edge specular + pointer-follow light */
.glass-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(130px circle at var(--mx) var(--my), rgba(255, 255, 255, .55), transparent 70%),
    linear-gradient(112deg, rgba(255, 255, 255, .22) 0%, transparent 30%, transparent 72%, rgba(255, 255, 255, .12) 100%);
  opacity: .35;
  transition: opacity .4s ease;
}
/* the travelling light beam: layered like a reflection, not a white stripe */
.glass-btn::after {
  content: "";
  position: absolute;
  top: -35%;
  bottom: -35%;
  left: 0;
  width: 58%;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(100deg,
      transparent 0%,
      rgba(150, 120, 255, 0) 12%,
      rgba(168, 139, 250, .16) 30%,
      rgba(236, 228, 255, .42) 43%,
      rgba(255, 255, 255, .78) 50%,
      rgba(186, 220, 255, .34) 57%,
      rgba(168, 139, 250, .14) 70%,
      transparent 100%);
  filter: blur(1.2px);
  mix-blend-mode: soft-light;
  opacity: 0;
  transform: translateX(-135%) skewX(-18deg);
}
.glass-btn:not(:disabled):hover,
.glass-btn:not(:disabled):focus-visible {
  --d: 6px;
  --glow: .62;
  transform: translateY(-2px);
  filter: brightness(1.07) saturate(1.08);
}
.glass-btn:not(:disabled):hover::before { opacity: 1; }
.glass-btn:not(:disabled):hover::after,
.glass-btn:not(:disabled):active::after { animation: beam 1.05s cubic-bezier(.35, .1, .25, 1) 1 both; }
.glass-btn:not(:disabled):active {
  --d: 1px;
  --glow: .38;
  transform: translateY(3px) scale(.992);
  filter: brightness(.97);
  transition: transform .09s ease-out, --d .09s ease-out, --glow .2s, filter .2s;
}
.glass-btn:focus-visible { outline: 2px solid var(--pri2); outline-offset: 4px; }
.glass-btn:disabled { opacity: .55; cursor: not-allowed; --d: 2px; --glow: .12; filter: saturate(.55); }
@keyframes beam {
  0%   { transform: translateX(-135%) skewX(-18deg); opacity: 0; }
  14%  { opacity: 1; }
  72%  { opacity: .85; }
  100% { transform: translateX(285%) skewX(-18deg); opacity: 0; }
}
@keyframes beam-idle {
  0%        { transform: translateX(-135%) skewX(-18deg); opacity: 0; }
  3%        { opacity: 1; }
  15%       { transform: translateX(285%) skewX(-18deg); opacity: 0; }
  100%      { transform: translateX(285%) skewX(-18deg); opacity: 0; }
}
.glass-btn.is-idle:not(:hover):not(:active):not(:disabled)::after { animation: beam-idle 7s ease-in-out 2s infinite; }

/* Ghost / crystal variant */
.glass-btn.is-ghost {
  color: var(--text);
  text-shadow: none;
  --gh-top: rgba(255, 255, 255, .9);
  --gh-a: rgba(255, 255, 255, .86);
  --gh-b: rgba(237, 232, 255, .62);
  background:
    radial-gradient(120% 70% at 50% -18%, rgba(255, 255, 255, .95) 0%, rgba(255, 255, 255, .2) 50%, transparent 64%),
    linear-gradient(180deg, var(--gh-a), var(--gh-b));
  box-shadow:
    inset 0 1px 0 #fff,
    inset 0 0 0 1px rgba(255, 255, 255, .7),
    inset 0 -1px 0 rgba(124, 58, 237, .25),
    inset 0 -12px 16px -8px rgba(196, 181, 253, .5),
    0 0 0 1px rgba(91, 33, 182, .26),
    0 calc(var(--d) * .5) 0 1px rgba(255, 255, 255, .9),
    0 var(--d) 0 1px rgba(124, 58, 237, .30),
    0 calc(var(--d) + 10px) 22px -8px rgba(91, 33, 182, .30),
    0 0 30px -4px rgba(139, 92, 246, var(--glow));
}
:root[data-theme="dark"] .glass-btn.is-ghost {
  --gh-a: rgba(255, 255, 255, .15);
  --gh-b: rgba(255, 255, 255, .04);
  background:
    radial-gradient(120% 70% at 50% -18%, rgba(255, 255, 255, .34) 0%, rgba(255, 255, 255, .06) 50%, transparent 64%),
    linear-gradient(180deg, var(--gh-a), var(--gh-b));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .6),
    inset 0 0 0 1px rgba(255, 255, 255, .14),
    inset 0 -1px 0 rgba(255, 255, 255, .06),
    inset 0 -12px 16px -8px rgba(196, 181, 253, .30),
    0 0 0 1px rgba(255, 255, 255, .16),
    0 calc(var(--d) * .5) 0 1px rgba(255, 255, 255, .06),
    0 var(--d) 0 1px rgba(0, 0, 0, .55),
    0 calc(var(--d) + 10px) 22px -8px rgba(0, 0, 0, .7),
    0 0 30px -4px rgba(139, 92, 246, var(--glow));
}
.cta .glass-btn.is-ghost {
  -webkit-backdrop-filter: blur(14px) saturate(1.6);
  backdrop-filter: blur(14px) saturate(1.6);
}
.glass-btn.is-ghost::after { mix-blend-mode: normal; opacity: 0; filter: blur(1.5px); }
:root[data-theme="dark"] .glass-btn.is-ghost::after { mix-blend-mode: plus-lighter; }

.glass-btn svg { position: relative; z-index: 1; }
.glass-btn.is-block { width: 100%; }

/* Icon button (menu etc.) */
.glass-btn.is-icon { --r: 15px; --d: 3px; width: 44px; min-height: 44px; height: 44px; padding: 0; }
.glass-btn.is-icon svg { width: 20px; height: 20px; }

.spin { width: 17px; height: 17px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: sp .7s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }

/* ==========================================================================
   Inputs, switches, wells
   ========================================================================== */
.well {
  background: var(--well);
  box-shadow: var(--well-in);
  border-radius: 16px;
  position: relative;
}
.field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  height: 56px;
  border-radius: 16px;
  color: var(--mut);
  background: var(--well);
  box-shadow: var(--well-in), 0 0 0 1px var(--line);
  transition: box-shadow .35s ease, color .3s, background .3s;
}
.field:focus-within {
  color: var(--pri2);
  background: color-mix(in srgb, var(--well) 70%, rgba(139, 92, 246, .18));
  box-shadow:
    var(--well-in),
    0 0 0 1px rgba(167, 139, 250, .95),
    0 0 0 5px rgba(139, 92, 246, .20),
    0 0 36px -2px rgba(139, 92, 246, .55),
    0 -1px 0 rgba(255, 255, 255, .25);
}
:root:not([data-theme="dark"]) .field:focus-within { color: var(--pri); }
.field input { flex: 1; min-width: 0; height: 100%; font-size: 16px; color: var(--text); background: none; border: 0; outline: 0; }
.field input::placeholder { color: color-mix(in srgb, var(--mut) 70%, transparent); }

/* theme switch — spring knob */
.switch {
  position: relative;
  flex: none;
  width: 72px;
  height: 44px;
  border: 0;
  padding: 0;
  border-radius: 22px;
  cursor: pointer;
  background: var(--well);
  box-shadow: var(--well-in), 0 0 0 1px var(--line);
  -webkit-tap-highlight-color: transparent;
  transition: box-shadow .4s ease;
}
.switch:focus-visible { outline: 2px solid var(--pri2); outline-offset: 3px; }
.switch .ic { position: absolute; top: 50%; width: 16px; height: 16px; margin-top: -8px; color: var(--mut); transition: opacity .3s, color .3s; }
.switch .ic.s { left: 13px; }
.switch .ic.m { right: 13px; }
.switch .knob {
  position: absolute;
  top: 5px;
  left: 5px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background:
    radial-gradient(80% 60% at 35% 18%, rgba(255, 255, 255, .95), rgba(255, 255, 255, 0) 60%),
    linear-gradient(160deg, #c4b5fd, #7c3aed 70%, #5b21b6);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .9),
    inset 0 -3px 5px rgba(50, 10, 140, .5),
    0 0 0 1px rgba(60, 20, 150, .5),
    0 3px 0 rgba(60, 20, 150, .55),
    0 6px 12px rgba(60, 20, 150, .4),
    0 0 22px rgba(139, 92, 246, .55);
  transform: translateX(0);
  transition: transform .8s var(--spring);
}
:root[data-theme="dark"] .switch .knob { transform: translateX(28px); }
.switch:active .knob { transform: scale(.92) translateX(0); transition-duration: .1s; }
:root[data-theme="dark"] .switch:active .knob { transform: scale(.92) translateX(28px); }

/* ==========================================================================
   Atmosphere (background)
   ========================================================================== */
.atmos { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: var(--bg); pointer-events: none; transition: background-color .5s ease; }
.atmos > i { position: absolute; display: block; will-change: transform; }
.aurora {
  left: 50%; top: 42%;
  width: 150vmax; height: 150vmax;
  margin: -75vmax 0 0 -75vmax;
  background: conic-gradient(from 0deg at 50% 50%, transparent 0deg, rgba(124, 58, 237, .5) 40deg, transparent 100deg, rgba(79, 70, 229, .42) 170deg, transparent 230deg, rgba(192, 38, 211, .30) 290deg, transparent 360deg);
  -webkit-mask-image: radial-gradient(closest-side, transparent 10%, #000 34%, transparent 80%);
  mask-image: radial-gradient(closest-side, transparent 10%, #000 34%, transparent 80%);
  opacity: var(--aurora-op);
  animation: spin 90s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.orb { border-radius: 50%; }
.o1 { width: 62vmax; height: 62vmax; left: -18vmax; top: -22vmax; background: radial-gradient(closest-side, var(--o1), transparent 70%); animation: drift1 26s ease-in-out infinite alternate; }
.o2 { width: 56vmax; height: 56vmax; right: -20vmax; top: 6vmax; background: radial-gradient(closest-side, var(--o2), transparent 70%); animation: drift2 32s ease-in-out infinite alternate; }
.o3 { width: 48vmax; height: 48vmax; left: 18vmax; bottom: -26vmax; background: radial-gradient(closest-side, var(--o3), transparent 70%); animation: drift3 29s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate3d(9vmax, 7vmax, 0) scale(1.12); } }
@keyframes drift2 { to { transform: translate3d(-10vmax, 9vmax, 0) scale(.92); } }
@keyframes drift3 { to { transform: translate3d(8vmax, -8vmax, 0) scale(1.1); } }
.streak {
  left: -10vw; width: 120vw; height: 16vmax;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--streak), transparent);
  transform: rotate(-14deg);
  opacity: .8;
}
.st1 { top: 18%; animation: streak1 38s ease-in-out infinite alternate; }
.st2 { top: 64%; height: 10vmax; opacity: .6; animation: streak2 46s ease-in-out infinite alternate; }
@keyframes streak1 { to { transform: translate3d(6vw, 5vh, 0) rotate(-11deg); } }
@keyframes streak2 { to { transform: translate3d(-8vw, -6vh, 0) rotate(-17deg); } }
.spot {
  left: 0; top: 0; width: 640px; height: 640px; margin: -320px 0 0 -320px;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--spot), transparent 72%);
  opacity: 0;
  transition: opacity .8s ease;
}
.has-pointer .spot { opacity: 1; }

/* ==========================================================================
   Misc motion
   ========================================================================== */
.theming, .theming * { transition: background-color .35s ease, color .35s ease, border-color .35s ease, box-shadow .35s ease !important; }
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-old(root) { z-index: 1; }
::view-transition-new(root) { z-index: 2; }

@keyframes shimmer { to { transform: translateX(260%) skewX(-18deg); } }
.sk { position: relative; overflow: hidden; background: var(--well); }
.sk::after {
  content: ""; position: absolute; top: -20%; bottom: -20%; left: 0; width: 45%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .28), rgba(196, 181, 253, .22), transparent);
  transform: translateX(-130%) skewX(-18deg);
  animation: shimmer 1.4s var(--ease-io) infinite;
}

/* SVG refraction support */
.lg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ==========================================================================
   Reduced motion + low-power
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .tilt { transform: none; }
  .sweep { display: none; }
}
/* animations only run while their element is on screen (glass.js toggles .on-screen) */
.on-screen > .sweep::before { animation-play-state: running; }

/* LITE = phones / touch / <=4 cores. Same motion, cheaper rendering paths:
   only transform/opacity are animated, moving things carry no backdrop-filter. */
.lite .glass {
  --blur: 14px; --sat: 1.35; --bri: 1;
  -webkit-backdrop-filter: blur(var(--blur)) saturate(var(--sat));
  backdrop-filter: blur(var(--blur)) saturate(var(--sat));
}
.lite .glass[data-material="frost"] { --blur: 16px; }
.lite .aurora { width: 115vmax; height: 115vmax; margin: -57vmax 0 0 -57vmax; animation-duration: 120s; }
.lite .spot { display: none; }
.lite .tilt { transform: none; will-change: auto; }
.lite .tilt:hover { --lift: 0px; }
.lite .cta .glass-btn.is-ghost { -webkit-backdrop-filter: none; backdrop-filter: none; }

/* ECO = data-saver or <=2 cores / <=2 GB: motion off, still glass */
.eco .aurora, .eco .streak, .eco .sweep { display: none; }
.eco .orb { animation: none; }
.eco .glass { --blur: 10px; }
.eco .glass-btn.is-idle::after { animation: none !important; }

/* ==========================================================================
   PENGATURAN PENGGUNA  (panel slider di navigasi, disimpan di localStorage "tl-prefs")
   Kelas dipasang di <html> oleh tlApply(): no-anim · no-blur · no-bg · no-fx
   ========================================================================== */
/* Matikan animasi: semua gerakan & transisi berhenti (pemutar loading .spin tetap berputar supaya terlihat sedang bekerja) */
html.no-anim { scroll-behavior: auto; }
.no-anim *:not(.spin), .no-anim *::before, .no-anim *::after {
  animation: none !important; transition-duration: .01ms !important; transition-delay: 0s !important; scroll-behavior: auto !important;
}
.no-anim .rv { opacity: 1 !important; translate: none !important; scale: 1 !important; filter: none !important; }
.no-anim .tilt { transform: none; }
.no-anim .sweep, .no-anim .spot { display: none; }
.no-anim [data-par] { translate: none !important; }

/* Matikan efek kaca: tanpa blur sama sekali, latar kaca jadi hampir solid (paling besar menghemat GPU) */
.no-blur *, .no-blur *::before, .no-blur *::after { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
.no-blur .glass { background: var(--fallback); }
.no-blur .glass[data-material="dark"] { background: linear-gradient(150deg, #3b2380, #140b30); }
.no-blur .glass[data-refract] { -webkit-backdrop-filter: none; backdrop-filter: none; }

/* Matikan latar bergerak (aurora, bola cahaya, garis cahaya): latar polos */
.no-bg .atmos > i { display: none; }

/* Matikan efek kursor & 3D: cahaya mengikuti kursor, miring 3D, parallax */
.no-fx .spot { display: none; }
.no-fx .tilt { transform: none !important; will-change: auto; }
.no-fx .tilt:hover { --lift: 0px; }
.no-fx [data-par] { translate: none !important; }
