﻿/*
 * Enter any custom CSS here.
 * This file will not be overwritten by theme updates.
*/

/* ---------- Design tokens ---------- */
:root {
  --ui-radius: 14px;
  --ui-radius-sm: 10px;
  --ui-border: rgba(255, 255, 255, 0.08);
  --ui-border-strong: rgba(255, 255, 255, 0.16);
  --ui-glass: rgba(255, 255, 255, 0.035);
  --ui-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.6);
  --ui-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Base ---------- */
html { scroll-behavior: smooth; }

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  letter-spacing: 0.005em;
}

::selection {
  background: rgba(var(--cl-accent), 0.45);
  color: #fff;
}

/* ---------- Animated background effects ---------- */
/* Drifting colour orbs */
body::before {
  content: "";
  position: fixed;
  inset: -20%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 25%, rgba(var(--cl-accent), 0.28), transparent 38%),
    radial-gradient(circle at 80% 30%, rgba(168, 85, 247, 0.18), transparent 38%),
    radial-gradient(circle at 55% 85%, rgba(56, 189, 248, 0.16), transparent 42%);
  filter: blur(30px);
  animation: ui-drift 24s ease-in-out infinite alternate;
}

/* Moving grid that fades out toward the edges */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 35%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 70% at 50% 35%, #000 20%, transparent 75%);
  animation: ui-grid 28s linear infinite;
}

@keyframes ui-drift {
  0%   { transform: translate3d(-4%, -3%, 0) scale(1) rotate(0deg); }
  50%  { transform: translate3d(5%, 4%, 0) scale(1.12) rotate(4deg); }
  100% { transform: translate3d(-2%, 6%, 0) scale(1.05) rotate(-3deg); }
}

@keyframes ui-grid {
  from { background-position: 0 0, 0 0; }
  to   { background-position: 56px 56px, 56px 56px; }
}

#app { position: relative; z-index: 1; }


/* ---------- Custom cursor ---------- */
/* Base cursor: pure CSS (SVG), works without JavaScript */
html, body {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cg stroke-linecap='round'%3E%3Cpath d='M16 3v10M16 19v10M3 16h10M19 16h10' stroke='%23000' stroke-opacity='0.55' stroke-width='4.5'/%3E%3Cpath d='M16 3v10M16 19v10M3 16h10M19 16h10' stroke='%23ffffff' stroke-width='2'/%3E%3C/g%3E%3Ccircle cx='16' cy='16' r='2' fill='%236571ff' stroke='%23ffffff' stroke-width='1'/%3E%3C/svg%3E") 16 16, crosshair;
}

a, button, label, summary, select, [role="button"], .choices, input[type="submit"],
input[type="checkbox"], input[type="radio"] {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cg stroke-linecap='round'%3E%3Cpath d='M8 8l16 16M24 8L8 24' stroke='%23000' stroke-opacity='0.55' stroke-width='6'/%3E%3Cpath d='M8 8l16 16M24 8L8 24' stroke='%236571ff' stroke-width='3.5'/%3E%3Cpath d='M8 8l16 16M24 8L8 24' stroke='%23ffffff' stroke-width='1.5'/%3E%3C/g%3E%3C/svg%3E") 16 16, pointer;
}

input[type="text"], input[type="email"], input[type="password"], input[type="search"],
input[type="number"], textarea {
  cursor: text;
}

/* Follower ring + spotlight (added by script in layouts/master.njk) */
.cursor-ring, .cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  border-radius: 50%;
  will-change: transform;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.cursor-ring.is-visible, .cursor-glow.is-visible { opacity: 1; }

.cursor-ring {
  z-index: 2147483647;
  width: 38px; height: 38px;
  margin: -19px 0 0 -19px;
  border: 1.5px solid rgba(101, 113, 255, 0.8);
  transition: opacity 0.3s ease, width 0.25s var(--ui-ease), height 0.25s var(--ui-ease),
              margin 0.25s var(--ui-ease), background-color 0.25s ease;
}
.cursor-ring.is-hover {
  width: 58px; height: 58px;
  margin: -29px 0 0 -29px;
  background: rgba(101, 113, 255, 0.15);
}
.cursor-ring.is-down {
  width: 26px; height: 26px;
  margin: -13px 0 0 -13px;
  background: rgba(101, 113, 255, 0.35);
}
.cursor-glow {
  z-index: 0;
  width: 420px; height: 420px;
  margin: -210px 0 0 -210px;
  background: radial-gradient(circle, rgba(101, 113, 255, 0.16), transparent 65%);
}

@media (hover: none), (pointer: coarse) {
  .cursor-ring, .cursor-glow { display: none; }
}

/* Slim, themed scrollbar */
* { scrollbar-width: thin; scrollbar-color: rgba(var(--cl-accent), 0.5) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(var(--cl-accent), 0.4);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(var(--cl-accent), 0.7); background-clip: padding-box; }

/* Accessible focus */
:focus-visible {
  outline: 2px solid rgb(var(--cl-accent));
  outline-offset: 2px;
  border-radius: var(--ui-radius-sm);
}

/* ---------- Surfaces: glass + rounded ---------- */
nav.component > div,
footer > div,
.bg-card\/75 {
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  border-color: var(--ui-border) !important;
  border-radius: var(--ui-radius);
  box-shadow: var(--ui-shadow);
}

nav.component > div { position: relative; }

/* ---------- Typography ---------- */
section h1 {
  background: linear-gradient(180deg, #fff 30%, rgba(255, 255, 255, 0.65));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

section h2 { letter-spacing: -0.01em; }

/* ---------- Product cards ---------- */
a.group {
  border-radius: var(--ui-radius);
  overflow: hidden;
  transition: transform 0.35s var(--ui-ease), box-shadow 0.35s var(--ui-ease), border-color 0.35s var(--ui-ease);
}

a.group:hover {
  transform: translateY(-6px);
  border-color: rgba(var(--cl-accent), 0.5) !important;
  box-shadow:
    0 18px 40px -16px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(var(--cl-accent), 0.25),
    0 0 40px -10px rgba(var(--cl-accent), 0.45);
}

a.group img {
  border-radius: var(--ui-radius-sm);
  transition: transform 0.6s var(--ui-ease), filter 0.4s ease;
}

a.group:hover img {
  transform: scale(1.05);
  filter: saturate(1.15) brightness(1.05);
}

/* ---------- Buttons & inputs ---------- */
a.inline-flex.border,
button.border,
a.border-accent-500 > *,
.border.border-accent-500 {
  border-radius: var(--ui-radius-sm);
}

a.inline-flex.border,
button[type="submit"],
.bg-accent-500 {
  transition: transform 0.2s var(--ui-ease), box-shadow 0.25s ease, background-color 0.2s ease, border-color 0.2s ease;
}

a.inline-flex.border:hover,
button[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -10px rgba(var(--cl-accent), 0.7);
}

a.inline-flex.border:active,
button[type="submit"]:active {
  transform: translateY(0) scale(0.98);
}

input:not([type="checkbox"]):not([type="radio"]),
textarea,
select,
.choices .choices__inner {
  border-radius: var(--ui-radius-sm) !important;
  border: 1px solid var(--ui-border);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

input:not([type="checkbox"]):not([type="radio"]):focus,
textarea:focus,
select:focus {
  border-color: rgb(var(--cl-accent));
  box-shadow: 0 0 0 4px rgba(var(--cl-accent), 0.18);
  outline: none;
}

.choices.is-open { border-radius: var(--ui-radius-sm); }

/* Badges / pills */
.badges > div { border-radius: 999px; }

/* ---------- Media ---------- */
img { border-radius: var(--ui-radius-sm); }
nav img, footer img { border-radius: 0; }

/* ---------- Modals / dropdowns ---------- */
.choices .choices__list--dropdown,
[role="dialog"] > div {
  border-radius: var(--ui-radius);
  overflow: hidden;
  box-shadow: var(--ui-shadow);
}

/* ---------- Entrance animation ---------- */
@keyframes ui-rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.component {
  animation: ui-rise 0.7s var(--ui-ease) both;
}
.component:nth-child(2) { animation-delay: 0.05s; }
.component:nth-child(3) { animation-delay: 0.1s; }
.component:nth-child(4) { animation-delay: 0.15s; }
.component:nth-child(5) { animation-delay: 0.2s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  a.group:hover { transform: none; }
}
