/* light-theme: manual
   Site-wide polish layer (all pages, after navbar.css), driven by
   assets/js/polish.js:
   - a subtle ✕ on a few main cards (span.nx-ps)
   - pointer spotlight + subtle 3D tilt on cards
   - keyword gradient (.kw / .kw-craft / .kw-space / .kw-pal)
   - typography sharpening, skeleton loaders, scroll progress under the navbar */

/* ============================================================ typography */
:root h1,
:root h2 { letter-spacing: -0.02em; text-wrap: balance; }
:root h3 { letter-spacing: -0.01em; text-wrap: balance; }
:root main p { text-wrap: pretty; }

/* ============================================================ keywords */
:root .kw {
  background: linear-gradient(100deg, #38bdf8, #818cf8 55%, #c084fc);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 700;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

:root .kw-craft { background-image: linear-gradient(100deg, #34d399, #38bdf8); }
:root .kw-space { background-image: linear-gradient(100deg, #c084fc, #60a5fa); }
:root .kw-pal { background-image: linear-gradient(100deg, #fb923c, #f472b6); }

html[data-theme="light"] .kw { background-image: linear-gradient(100deg, #0369a1, #4f46e5 55%, #9333ea); }
html[data-theme="light"] .kw-craft { background-image: linear-gradient(100deg, #047857, #0369a1); }
html[data-theme="light"] .kw-space { background-image: linear-gradient(100deg, #7e22ce, #1d4ed8); }
html[data-theme="light"] .kw-pal { background-image: linear-gradient(100deg, #c2410c, #be185d); }

/* ============================================================ card details
   (originally a full "Printstream" set; reduced on request to a single,
   subtle ✕ on a few main cards - see X_CARDS in polish.js) */
.has-ps { --ps: rgba(148, 163, 184, 0.28); --ps-hot: rgba(125, 211, 252, 0.7); }

.nx-ps {
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  pointer-events: none;
  overflow: hidden;
  transition: opacity 0.3s ease;
}

/* pointer spotlight */
.nx-ps::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(380px circle at var(--ps-mx, 50%) var(--ps-my, 0%), rgba(56, 189, 248, 0.11), transparent 62%);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.has-ps.ps-hover .nx-ps::before { opacity: 1; }

.nx-ps i { position: absolute; display: block; }

/* ✕ top right */
.ps-x { top: 13px; right: 13px; width: 8px; height: 8px; }
.ps-x::before,
.ps-x::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  width: 1.5px;
  height: 100%;
  margin-left: -0.75px;
  background: var(--ps);
  transform: rotate(45deg);
  transition: background 0.3s ease;
}
.ps-x::after { transform: rotate(-45deg); }

.has-ps.ps-hover { --ps: var(--ps-hot); }

/* subtle 3D tilt (pointer devices only, see polish.js) */
.ps-tilt {
  transition: rotate 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.ps-tilt.ps-hover { rotate: var(--ps-ax, 0) var(--ps-ay, 0) 0 var(--ps-deg, 0deg); }

html[data-theme="light"] .has-ps { --ps: rgba(71, 85, 105, 0.25); --ps-hot: rgba(3, 105, 161, 0.6); }
html[data-theme="light"] .nx-ps::before { background: radial-gradient(380px circle at var(--ps-mx, 50%) var(--ps-my, 0%), rgba(14, 165, 233, 0.09), transparent 62%); }

/* ============================================================ skeletons */
.nx-skel {
  display: block;
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.1) 0%, rgba(148, 163, 184, 0.22) 40%, rgba(148, 163, 184, 0.1) 80%) 0 0 / 300% 100%;
  animation: nxSkel 1.4s ease-in-out infinite;
}

.nx-skel + .nx-skel { margin-top: 0.55rem; }
.nx-skel-card { padding: 1.3rem 1.4rem; border-radius: var(--radius-lg, 20px); border: 1px solid rgba(148, 163, 184, 0.12); background: rgba(15, 23, 42, 0.5); }
.nx-skel-card + .nx-skel-card { margin-top: 1rem; }

@keyframes nxSkel { from { background-position: 100% 0; } to { background-position: -50% 0; } }

html[data-theme="light"] .nx-skel { background-image: linear-gradient(90deg, rgba(15, 23, 42, 0.06) 0%, rgba(15, 23, 42, 0.13) 40%, rgba(15, 23, 42, 0.06) 80%); }
html[data-theme="light"] .nx-skel-card { background: #fff; border-color: rgba(15, 23, 42, 0.08); }

/* ============================================================ scroll progress
   (ux-motion.js creates .ux-progress) - sits on the navbar's bottom line */
:root .ux-progress { top: var(--nav-h, 64px); height: 2px; z-index: 1001; }

@media (prefers-reduced-motion: reduce) {
  .nx-skel { animation: none; }
  .ps-tilt.ps-hover { rotate: none; }
}

/* ============================================================ index project cards (pc2)
   compact glass cards: logo + kind/name header, live badges, text, one main
   link and one small secondary action. Accent colour per project via --c/--c2. */
:root .projects-grid-section .projects-grid { gap: 1.2rem; align-items: stretch; }

:root .projects-grid-section .pc2 {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.5rem 1.5rem 1.4rem;
  border-radius: var(--radius-lg, 20px);
  border: 1px solid rgba(148, 163, 184, 0.14);
  background:
    radial-gradient(120% 70% at 0% 0%, color-mix(in srgb, var(--c) 12%, transparent), transparent 60%),
    rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  overflow: hidden;
  box-shadow: none;
  min-height: 0;
}

/* accent hairline on top */
:root .projects-grid-section .pc2::before {
  content: "";
  position: absolute;
  left: 1.5rem;
  right: 1.5rem;
  top: 0;
  height: 2px;
  border-radius: 0 0 2px 2px;
  background: linear-gradient(90deg, var(--c), var(--c2));
  box-shadow: 0 0 14px color-mix(in srgb, var(--c) 70%, transparent);
}

:root .projects-grid-section .pc2:hover { border-color: color-mix(in srgb, var(--c) 45%, transparent); }

:root .pc2-head { display: flex; align-items: center; gap: 0.9rem; }

:root .pc2-logo {
  flex: none;
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--c) 30%, transparent), transparent 70%);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--c) 45%, transparent), 0 0 26px color-mix(in srgb, var(--c) 30%, transparent);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

:root .pc2-logo img { width: 56px; height: 56px; object-fit: contain; border-radius: 50%; }
:root .pc2:hover .pc2-logo { transform: scale(1.08) rotate(-4deg); }

:root .pc2-title { min-width: 0; }

:root .pc2-kind {
  display: block;
  margin-bottom: 0.15rem;
  color: color-mix(in srgb, var(--c) 80%, #fff);
  font: 700 0.7rem/1.2 "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

:root .projects-grid-section .pc2 h3 { margin: 0; font-size: 1.45rem; font-weight: 800; }
:root .projects-grid-section .pc2 p { margin: 0; color: #94a3b8; line-height: 1.6; flex: 1; }
:root .projects-grid-section .pc2 .project-card-badges { margin: 0; }

:root .pc2-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }

:root .pc2-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  border-radius: 12px;
  background: linear-gradient(110deg, var(--c), var(--c2));
  color: #04111d;
  font-weight: 800;
  font-size: 0.9rem;
  text-decoration: none;
  box-shadow: 0 8px 22px color-mix(in srgb, var(--c) 30%, transparent);
  transition: filter 0.2s ease, transform 0.2s ease;
}

:root .pc2-primary i { transition: transform 0.2s ease; }
:root .pc2-primary:hover { filter: brightness(1.1); }
:root .pc2-primary:hover i { transform: translateX(3px); }

:root .pc2-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 0.9rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  color: #cbd5e1;
  font-weight: 700;
  font-size: 0.88rem;
  text-decoration: none;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

:root .pc2-ghost:hover { border-color: color-mix(in srgb, var(--c) 60%, transparent); color: #fff; background: color-mix(in srgb, var(--c) 10%, transparent); }

:root .pc2-soon {
  margin: 1.2rem auto 0;
  max-width: max-content;
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  border: 1px dashed rgba(148, 163, 184, 0.3);
  color: #94a3b8;
  font-size: 0.88rem;
  text-align: center;
}

:root .pc2-soon i { color: #a78bfa; margin-right: 0.3rem; }
:root .pc2-soon a { color: #7dd3fc; font-weight: 700; text-decoration: none; }
:root .pc2-soon a:hover { text-decoration: underline; }

html[data-theme="light"] .projects-grid-section .pc2 {
  background: radial-gradient(120% 70% at 0% 0%, color-mix(in srgb, var(--c) 10%, transparent), transparent 60%), #fff;
  border-color: rgba(15, 23, 42, 0.1);
}
html[data-theme="light"] .projects-grid-section .pc2 h3 { color: #0f172a; }
html[data-theme="light"] .projects-grid-section .pc2 p { color: #475569; }
html[data-theme="light"] .pc2-kind { color: color-mix(in srgb, var(--c) 75%, #000); }
html[data-theme="light"] .pc2-ghost { color: #334155; border-color: rgba(15, 23, 42, 0.15); }
html[data-theme="light"] .pc2-ghost:hover { color: #0f172a; }
html[data-theme="light"] .pc2-soon { color: #475569; border-color: rgba(15, 23, 42, 0.2); }
html[data-theme="light"] .pc2-soon a { color: #0369a1; }

/* ============================================================ empty states
   small illustration above "nothing here yet" messages */
:root .nw-empty::before,
:root .st-chart-empty::before,
:root div.lb-empty-state::before {
  content: "";
  display: block;
  width: 180px;
  height: 120px;
  margin: 0 auto 0.6rem;
  background: url("../../images/ill/empty.svg") center / contain no-repeat;
}

:root .nw-empty { text-align: center; padding: 1.5rem 0; }
:root .st-chart-empty { gap: 0.4rem; align-content: center; }

/* ============================================================ project hero ambience
   (polish.js heroFx) - sits behind the hero content via isolation + z-index -1 */
:root .project-hero-box.has-hero-fx { position: relative; isolation: isolate; overflow: hidden; }
.hero-fx { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.hero-fx i { position: absolute; display: block; }

/* NexCraft: floating pixel blocks */
.fx-block {
  width: var(--s); height: var(--s);
  opacity: 0.55;
  image-rendering: pixelated;
  box-shadow: inset -3px -3px 0 rgba(0, 0, 0, 0.3), inset 3px 3px 0 rgba(255, 255, 255, 0.18);
  animation: fxFloat var(--d) ease-in-out infinite;
}
.fx-grass { background: linear-gradient(#5fbf3a 0 34%, #8b5a2b 34%); }
.fx-dirt { background: #8b5a2b; }
.fx-stone { background: #7f7f7f; }
.fx-gold { background: linear-gradient(135deg, #fde047, #ca8a04); }
.fx-diamond { background: linear-gradient(135deg, #67e8f9, #0891b2); }
@keyframes fxFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-14px) rotate(8deg); }
}

/* NexSpace: twinkling stars + a slow planet */
.fx-star {
  width: 2px; height: 2px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 6px rgba(196, 181, 253, 0.9);
  opacity: 0.2;
  animation: fxTwinkle var(--d) ease-in-out var(--delay) infinite;
}
@keyframes fxTwinkle { 50% { opacity: 0.95; transform: scale(1.6); } }
.fx-planet {
  left: -60px; top: 62%;
  width: 46px; height: 46px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #c4b5fd, #6d28d9 70%);
  box-shadow: 0 0 30px rgba(167, 139, 250, 0.45);
  opacity: 0.5;
  animation: fxDrift 60s linear infinite;
}
.fx-planet::after {
  content: ""; position: absolute; left: -12px; right: -12px; top: 50%; height: 10px; margin-top: -5px;
  border: 2px solid rgba(196, 181, 253, 0.6); border-radius: 50%; transform: rotate(-18deg);
}
@keyframes fxDrift { to { transform: translateX(calc(100vw + 120px)) translateY(-40px); } }

/* NexPal: paw prints tapping across */
.fx-paw {
  font-size: 15px;
  color: rgba(217, 123, 63, 0.55);
  opacity: 0;
  transform: rotate(80deg);
  animation: fxPaw 5s ease-in-out var(--delay) infinite;
}
.fx-paw:nth-child(even) { transform: rotate(100deg); }
@keyframes fxPaw { 0%, 100% { opacity: 0; } 12%, 45% { opacity: 1; } 70% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .fx-block, .fx-star, .fx-planet, .fx-paw { animation: none; }
  .fx-paw { opacity: 0.4; }
}

/* ============================================================ UX moments */
/* floating bubble: "✓ Kopiert" / "↗" */
.nx-bubble {
  position: fixed;
  z-index: 9600;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: #0f172a;
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: #f1f5f9;
  font: 700 0.75rem/1.2 Inter, system-ui, sans-serif;
  pointer-events: none;
  transform: translate(-50%, -110%);
  animation: nxBubble 1.05s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.nx-bubble.is-ok { border-color: rgba(74, 222, 128, 0.55); color: #4ade80; }
.nx-bubble.is-ext { border-color: rgba(125, 211, 252, 0.5); color: #7dd3fc; }
@keyframes nxBubble {
  0% { opacity: 0; transform: translate(-50%, -60%) scale(0.8); }
  20% { opacity: 1; transform: translate(-50%, -130%) scale(1); }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -190%); }
}

/* external link click nudge */
.nx-ext-pop { animation: nxExt 0.45s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes nxExt { 40% { transform: translate(3px, -3px); } }

/* copy chips (status IP etc.) */
[data-copy-self] { cursor: copy; border-bottom: 1px dashed currentColor; }

/* live number changed */
.nx-pulse { animation: nxPulse 0.9s ease-out; }
@keyframes nxPulse { 0% { text-shadow: 0 0 0 transparent; } 25% { text-shadow: 0 0 14px rgba(125, 211, 252, 0.9); } 100% { text-shadow: 0 0 0 transparent; } }

/* sliding tab highlight */
.has-glider { position: relative; }
.has-glider > :not(.nx-glider) { position: relative; z-index: 1; }
.nx-glider {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  border-radius: 12px;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1), width 0.38s cubic-bezier(0.22, 1, 0.36, 1), background 0.3s ease, opacity 0.2s ease;
}
.st-tabs .nx-glider, .nw-filters .nx-glider { border-radius: 999px; }
.has-glider .lb-tab.active,
.has-glider .st-tab.is-active,
.has-glider .nw-chip.is-active { background: transparent !important; box-shadow: none !important; border-color: transparent !important; }

/* new personal best */
.nx-record {
  position: fixed;
  left: 50%;
  top: 84px;
  z-index: 9500;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.75rem 1.1rem;
  border-radius: 16px;
  border: 1px solid rgba(253, 224, 71, 0.5);
  background: rgba(20, 14, 2, 0.95);
  color: #fef9c3;
  font: 600 0.95rem Inter, system-ui, sans-serif;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5), 0 0 30px rgba(253, 224, 71, 0.25);
  transform: translateX(-50%);
  animation: nxSecIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.nx-record i { color: #fde047; font-size: 1.2rem; }
.nx-record b { color: #fde047; }
.nx-record.out { opacity: 0; transition: opacity 0.35s ease; }
@keyframes nxSecIn { from { opacity: 0; transform: translate(-50%, -20px) scale(0.9); } }

.nx-confetti-bit {
  position: fixed;
  z-index: 9499;
  width: 9px;
  height: 14px;
  border-radius: 2px;
  pointer-events: none;
  animation: nxConfBit var(--d) cubic-bezier(0.2, 0.6, 0.4, 1) forwards;
}
@keyframes nxConfBit { to { transform: translate(var(--x), var(--y)) rotate(var(--r)); opacity: 0; } }

html[data-theme="light"] .nx-bubble { background: #fff; color: #0f172a; box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12); }
html[data-theme="light"] .nx-bubble.is-ok { color: #15803d; }
html[data-theme="light"] .nx-bubble.is-ext { color: #0369a1; }

@media (prefers-reduced-motion: reduce) {
  .nx-bubble, .nx-ext-pop, .nx-pulse { animation: none; }
  .nx-glider { transition: none; }
}

/* ============================================================ reveal fix
   Page styles (e.g. nexspace-cosmic.css) set their own `transition` on cards,
   which dropped the fade/slide of the scroll reveal - cards popped in hard.
   Keep the reveal properties in every case, plus the usual hover ones. */
html.ux-motion .ux-reveal {
  transition-property: opacity, translate, scale, transform, box-shadow, border-color, background-color, color !important;
  transition-duration: 0.7s, 0.8s, 0.8s, 0.35s, 0.35s, 0.35s, 0.35s, 0.35s !important;
  transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1) !important;
  transition-delay: var(--ux-delay, 0ms), var(--ux-delay, 0ms), var(--ux-delay, 0ms), 0s, 0s, 0s, 0s, 0s !important;
}

@media (prefers-reduced-motion: reduce) {
  html.ux-motion .ux-reveal { transition: none !important; }
}

/* ============================================================ card photo
   index.html project cards: a real screenshot (NexSpace: its flight scene), faded in from the
   right behind the content so the text stays readable. */
:root .projects-grid-section .pc2-photo { position: relative; isolation: isolate; }
:root .projects-grid-section .pc2-photo-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: 60% 45% / cover no-repeat;
  opacity: 0.32;
  -webkit-mask-image: linear-gradient(105deg, transparent 18%, #000 75%);
  mask-image: linear-gradient(105deg, transparent 18%, #000 75%);
  transition: opacity 0.4s ease, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
:root .projects-grid-section .pc2-photo-craft { background-image: url(../../images/screens/NexCraft/nexcraft-spawn-front-800.webp); }
:root .projects-grid-section .pc2-photo-space { background-image: url(../../images/screens/NexSpace/nexspace-flug.webp); background-position: 78% 50%; background-size: auto 115%; opacity: 0.95; }
:root .projects-grid-section .pc2-photo-pal { background-image: url(../../images/screens/NexPal/Palworld-Base.webp); background-position: 65% 55%; }
:root .projects-grid-section .pc2-photo:hover .pc2-photo-bg { opacity: 0.45; transform: scale(1.03); }
html[data-theme="light"] .projects-grid-section .pc2-photo-bg { opacity: 0.22; }
