/* =====================================================================
   PREMIUM ENHANCEMENT LAYER  —  KIETO PORTFOLIO
   Loaded AFTER style.min.css + custom.css so it can refine without
   breaking the base template. All accent usage flows through the
   existing --kieto-accent token system so the style-switcher stays
   the single source of truth for colour.
   ---------------------------------------------------------------------
   Sections:
     0  Foundations (tokens, fonts, reduced-motion guards)
     1  Typography upgrade (display font + scale + rhythm)
     2  Card depth system (layered, tinted shadows)
     3  Hero refinement (texture, layout, CTA, image)
     5  Magnetic + micro-interactions
     6  Section header polish
     7  Portfolio + skill + service polish
   ===================================================================== */

/* ------------------------------------------------------------------ *
 * 0. FOUNDATIONS
 * ------------------------------------------------------------------ */

:root {
  /* Premium depth tokens — tinted to neutral, never pure black. */
  --prem-shadow-xs: 0 1px 2px rgb(15 23 42 / 0.04);
  --prem-shadow-sm: 0 2px 6px -1px rgb(15 23 42 / 0.06),
                    0 1px 2px -1px rgb(15 23 42 / 0.05);
  --prem-shadow-md: 0 10px 24px -8px rgb(15 23 42 / 0.10),
                    0 4px 8px -4px rgb(15 23 42 / 0.06);
  --prem-shadow-lg: 0 24px 48px -16px rgb(15 23 42 / 0.14),
                    0 8px 16px -8px rgb(15 23 42 / 0.08);
  --prem-shadow-accent: 0 16px 40px -12px rgb(var(--kieto-accent-rgb) / 0.45);

  /* Refined radii (template uses rounded-2xl = 16px; lock to that family). */
  --prem-radius-card: 18px;
  --prem-radius-pill: 999px;

  /* Motion easing curves (premium, never linear). */
  --prem-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --prem-ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --prem-dur: 0.6s;

  /* Surface tokens for the tinted grain overlay. */
  --prem-grain-opacity: 0.035;
}

/* =====================================================================
 * THEME TOKENS + VARIABLE TRANSITION — EduPro-style
 * Dark/light + accent switch via CSS variables — every element that
 * uses these tokens interpolates smoothly, no Tailwind class swap jank.
 * Reduced-motion overrides below so a11y is preserved.
 * ===================================================================== */

:root {
  --theme-bg-section: #ffffff;
  --theme-bg-surface: rgb(240 242 245);
  --theme-bg-page: rgb(240 242 245);
  --theme-fg: #0f172a;
  --theme-fg-muted: rgb(15 23 42 / 0.7);
  --theme-border: rgb(232 232 232);
  --theme-border-subtle: rgb(15 23 42 / 0.06);
  --theme-shadow-section: var(--prem-shadow-md);
  --theme-surface-glass: rgb(255 255 255 / 0.82);
  --theme-transition: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  --theme-hero-bubble-glass: rgb(255 255 255 / 0.82);
  --theme-hero-bubble-fg: #0f172a;
  --theme-hero-ring-glow: rgb(var(--kieto-accent-rgb) / 0.14);
  --theme-portfolio-overlay: linear-gradient(180deg, transparent 0%, transparent 38%, rgb(15 23 42 / 0.55) 78%, rgb(15 23 42 / 0.92) 100%);
}
html.dark {
  --theme-bg-section: rgb(33 34 35);
  --theme-bg-surface: rgb(45 46 47);
  --theme-bg-page: rgb(24 25 26);
  --theme-fg: #f8fafc;
  --theme-fg-muted: rgb(255 255 255 / 0.7);
  --theme-border: rgb(67 68 69);
  --theme-border-subtle: rgb(255 255 255 / 0.06);
  --theme-shadow-section: var(--prem-shadow-lg), inset 0 1px 0 0 rgb(255 255 255 / 0.04);
  --theme-surface-glass: rgb(45 46 47 / 0.85);
  --theme-hero-bubble-glass: rgb(45 46 47 / 0.85);
  --theme-hero-bubble-fg: #f8fafc;
  --theme-hero-ring-glow: rgb(var(--kieto-accent-rgb) / 0.25);
  --theme-portfolio-overlay: linear-gradient(180deg, transparent 0%, transparent 38%, rgb(0 0 0 / 0.55) 78%, rgb(0 0 0 / 0.94) 100%);
}

/* =====================================================================
 * PAGE BACKGROUND PRESET SYSTEM
 * Three presets selectable via KSP panel: default (dashed lines),
 * glow (ambient gradient orbs), grain (noise texture overlay).
 * Each preset auto-matches --kieto-accent and supports light/dark.
 * ===================================================================== */

/* --- Preset wrapper: applied to body, defines the full-page background --- */

/* === DEFAULT: Flat page + animated dashed lines (current = unchanged) === */
.bg-preset--default .bg-lines { display: block; }

/* === GLOW: Ambient gradient orbs positioned at page corners === */
.bg-preset--glow {
  position: relative;
}
.bg-preset--glow::before,
.bg-preset--glow::after {
  content: '';
  position: fixed;
  pointer-events: none;
  z-index: -2;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.55;
  transition: opacity 0.8s var(--prem-ease-out), filter 0.8s var(--prem-ease-out);
}
.bg-preset--glow::before {
  width: 620px;
  height: 620px;
  top: -180px;
  right: -120px;
  background: radial-gradient(circle at center, rgb(var(--kieto-accent-rgb) / 0.38), transparent 70%);
}
.bg-preset--glow::after {
  width: 480px;
  height: 480px;
  bottom: -100px;
  left: -80px;
  background: radial-gradient(circle at center, rgb(var(--kieto-accent-rgb) / 0.28), transparent 70%);
}
/* Third orb: extra depth via body pseudo on a child-free element */
body.bg-preset--glow {
  background:
    radial-gradient(ellipse 700px 500px at 85% 65%, rgb(var(--kieto-accent-rgb) / 0.12), transparent 70%) fixed,
    var(--theme-bg-page);
  transition: background 0.8s var(--prem-ease-out);
}
/* Glow → hide dashed lines */
.bg-preset--glow .bg-lines { display: none; }

/* Dark mode: orbs brighter, more ethereal */
html.dark .bg-preset--glow::before {
  opacity: 0.65;
  background: radial-gradient(circle at center, rgb(var(--kieto-accent-rgb) / 0.30), transparent 70%);
  filter: blur(140px);
}
html.dark .bg-preset--glow::after {
  opacity: 0.50;
  background: radial-gradient(circle at center, rgb(var(--kieto-accent-rgb) / 0.22), transparent 70%);
  filter: blur(130px);
}
html.dark body.bg-preset--glow {
  background:
    radial-gradient(ellipse 700px 500px at 85% 65%, rgb(var(--kieto-accent-rgb) / 0.08), transparent 70%) fixed,
    var(--theme-bg-page);
}

/* Slow float animation for glow orbs */
@media (prefers-reduced-motion: no-preference) {
  .bg-preset--glow::before {
    animation: bg-glow-float-1 18s ease-in-out infinite;
  }
  .bg-preset--glow::after {
    animation: bg-glow-float-2 22s ease-in-out infinite;
  }
}
@keyframes bg-glow-float-1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-40px, 30px) scale(1.08); }
  66% { transform: translate(20px, -20px) scale(0.94); }
}
@keyframes bg-glow-float-2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -25px) scale(0.95); }
  66% { transform: translate(-25px, 15px) scale(1.06); }
}
@media (prefers-reduced-motion: reduce) {
  .bg-preset--glow::before,
  .bg-preset--glow::after { animation: none !important; }
}

/* === GRAIN: SVG noise texture overlay on flat background === */
.bg-preset--grain::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 180px 180px;
  transition: opacity 0.8s var(--prem-ease-out);
}
/* Grain → hide dashed lines */
.bg-preset--grain .bg-lines { display: none; }

/* Dark mode: slightly more visible grain */
html.dark .bg-preset--grain::before {
  opacity: 0.07;
}

/* =====================================================================
 * KSP BACKGROUND PRESET PICKER STYLES
 * ===================================================================== */

.ksp__bg-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.ksp__bg-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 10px 6px;
  border-radius: 10px;
  border: 1.5px solid rgba(15 23 42 / 0.10);
  background: transparent;
  color: rgba(15 23 42 / 0.50);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition:
    background-color 0.28s var(--prem-ease-out),
    border-color 0.28s var(--prem-ease-out),
    color 0.28s var(--prem-ease-out),
    box-shadow 0.28s var(--prem-ease-out),
    transform 0.26s var(--prem-ease-spring);
}
.ksp__bg-btn:hover {
  border-color: rgb(var(--kieto-accent-rgb) / 0.40);
  color: var(--kieto-accent);
  background: rgb(var(--kieto-accent-rgb) / 0.06);
  transform: translateY(-1px);
}
.ksp__bg-btn.is-active {
  background: var(--kieto-accent);
  border-color: var(--kieto-accent);
  color: #ffffff;
  box-shadow: 0 6px 18px -8px rgb(var(--kieto-accent-rgb) / 0.7);
  transform: scale(1.04);
}
.ksp__bg-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.8;
  transition: opacity 0.28s var(--prem-ease-out);
}
.ksp__bg-btn:hover svg,
.ksp__bg-btn.is-active svg {
  opacity: 1;
}
.dark .ksp__bg-btn {
  border-color: rgba(255 255 255 / 0.10);
  color: rgba(255 255 255 / 0.45);
}
.dark .ksp__bg-btn.is-active {
  color: #ffffff;
}

@media (prefers-reduced-motion: reduce) {
  .ksp__bg-btn { transition: none !important; transform: none !important; }
  .bg-preset--glow::before,
  .bg-preset--glow::after { animation: none !important; }
}

/* Section cards — one rule set driven by tokens */
.hero-section,
.about-section,
.skills-section,
.resume-section,
.blog-section,
.services-section,
.service-section,
.contact-section,
.portfolio-section {
  background-color: var(--theme-bg-section);
  color: var(--theme-fg);
  border-color: var(--theme-border-subtle);
  box-shadow: var(--theme-shadow-section);
  transition:
    background-color var(--theme-transition),
    color var(--theme-transition),
    border-color var(--theme-transition);
}

/* Global: every element that changes color/background on theme switch */
footer,
header,
nav,
.card,
.prem-card {
  transition:
    background-color 0.5s cubic-bezier(0.4, 0, 0.2, 1),
    color 0.5s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Accent-driven elements — smooth color switch */
.btn-theme,
.switcher-input button,
.accent-swatch,
.hero-section .text-content .text-theme,
.hero-section .text-content [style*="var(--kieto-accent)"],
.hero-section .text-content i,
.service-section .card-item i,
.blog-section .blog-item i,
.skills-section .progressCircle .circle,
a,
.section-name,
.text-theme {
  transition:
    background-color 0.5s cubic-bezier(0.4, 0, 0.2, 1),
    color 0.5s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Inner surfaces — sidebar, blog list, skill area, about tags */
.minfo__sidebar {
  background-color: var(--theme-bg-section);
  color: var(--theme-fg);
  transition: background-color var(--theme-transition), color var(--theme-transition);
}

/* Body — EduPro-style: one transition that cascades through CSS vars */
body {
  transition: background-color var(--theme-transition), color var(--theme-transition);
}

/* Respect users who asked for less motion — disable every premium
   transform/transition animation. Content stays fully visible. */

/* Blog list items — surface var for smooth dark/light */
.blog-item,
.blog-list > * {
  background-color: var(--theme-bg-section);
  border-color: var(--theme-border-subtle);
  transition: background-color var(--theme-transition), border-color var(--theme-transition);
}

/* About section tag areas (border-dashed containers) */
.about-section [class*="border-dashed"],
.about-section .user-meta-info + div {
  border-color: var(--theme-border);
  transition: border-color var(--theme-transition), background-color var(--theme-transition);
}

/* Skills nav buttons */
#skill .button-prev,
#skill .button-next,
#skill .skills-slider-navigation .button-prev,
#skill .skills-slider-navigation .button-next {
  border-color: var(--theme-border);
  transition: border-color var(--theme-transition), background-color var(--theme-transition);
}
#skill .button-prev:hover,
#skill .button-next:hover,
#skill .skills-slider-navigation .button-prev:hover,
#skill .skills-slider-navigation .button-next:hover {
  background-color: var(--theme-bg-surface);
}
#skill .button-prev svg,
#skill .button-next svg {
  transition: fill 0.4s ease;
}

/* Sidebar / mobile menu inner panels */
.minfo__area,
.menu__panel,
.hamburger svg,
[class*="mobile-menu"],
[class*="sidebar"] {
  transition: background-color var(--theme-transition), color var(--theme-transition), border-color var(--theme-transition);
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ------------------------------------------------------------------ *
 * 1. TYPOGRAPHY UPGRADE
 * Sora is loaded in head.php and applied ONLY to display headings so
 * the body copy (Poppins / Be Vietnam Pro) and the Vietnamese i18n
 * stack are untouched.
 * ------------------------------------------------------------------ */

.font-display,
h1.display,
h2.display,
.hero-section h1 {
  font-family: 'Sora', 'Poppins', system-ui, sans-serif;
  font-feature-settings: 'ss01' on, 'cv01' on;
  letter-spacing: -0.02em;
}

/* Section title rhythm — refined scale + tighter leading. */
.section-title .title,
.about-section .title,
.resume-section .title,
.services-section .title,
.skills-section .title,
.portfolio-section .title,
.blog-section .title,
.contact-section .title {
  letter-spacing: -0.022em;
}

/* Editorial accent word — keep it bold of the SAME family, never
   inject a random serif. The teal accent already differentiates it. */
.section-title .title span.text-theme,
.title span.text-theme {
  font-weight: 700;
  background: linear-gradient(
    120deg,
    var(--kieto-accent),
    var(--kieto-accent-hover)
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  /* Fallback solid colour if clip-text unsupported. */
}

/* Body paragraph refinement — measure + leading for readability. */
.about-section p,
.services-section .service-content p,
.blog-section .blog-content p {
  max-width: 62ch;
  line-height: 1.8;
}

/* ------------------------------------------------------------------ *
 * 2. CARD DEPTH SYSTEM
 * Replace flat white/dark cards with layered, tinted elevation that
 * reads as "expensive" without becoming heavy. Applies to every
 * rounded-2xl section card.
 * ------------------------------------------------------------------ */

.hero-section,
.about-section,
.skills-section,
.resume-section,
.blog-section,
.services-section,
.service-section,
.contact-section,
.portfolio-section {
  position: relative;
}

/* Hover lift on interactive cards (services, blog, portfolio items). */
.service-section .service-card-wrapper .card-item,
.blog-section .blog-item,
#portfolio .portfolio_wrapper > .item {
  transition:
    transform 0.5s var(--prem-ease-out),
    box-shadow 0.5s var(--prem-ease-out),
    border-color 0.4s var(--prem-ease-out);
}

.service-section .service-card-wrapper .card-item:hover,
.blog-section .blog-item:hover {
  transform: translateY(-6px);
  box-shadow: var(--prem-shadow-lg);
}

/* ------------------------------------------------------------------ *
 * 3. HERO REFINEMENT
 * ------------------------------------------------------------------ */

.hero-section {
  overflow: visible;
  isolation: isolate;
}

.hero-content {
  overflow: visible;
}

/* Allow tool tiles to extend outside section/card bounds on desktop. */
#home {
  overflow: visible;
}

/* Hero headline — refined scale + tracking, premium display feel. */
.hero-section h1 {
  letter-spacing: -0.03em;
  line-height: 1.08 !important;
  text-wrap: balance;
}

/* Gradient accent word inside hero (the "Digital Design" span). */
.hero-section h1 .text-theme {
  position: relative;
  font-weight: 700;
  background: linear-gradient(
    115deg,
    var(--kieto-accent) 0%,
    var(--kieto-accent-hover) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Hero paragraph — measure + weight rhythm. */
.hero-section .text-content > p {
  max-width: 38ch;
  line-height: 1.75;
  color: rgb(100 116 139);
}
.dark .hero-section .text-content > p {
  color: rgb(203 213 225);
}

/* Available-for-work status pills — refined to a single live dot. */
.hero-section .text-content > ul li {
  gap: 0.5rem;
  font-size: 0.85rem;
  letter-spacing: 0.01em;
  color: rgb(71 85 105);
}
.dark .hero-section .text-content > ul li {
  color: rgb(148 163 184);
}

/* Live status dot — only on the status/badges list, NOT the buttons list. */
.hero-section .text-content > ul:not(.buttons) li:first-child {
  display: inline-flex;
  align-items: center;
}
.hero-section .text-content > ul:not(.buttons) li:first-child::before {
  content: none;
}
/* Keep the explicit helper class working too (used in static markup). */
.hero-status-live {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.hero-status-live::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: var(--prem-radius-pill);
  background: #10b981;
  box-shadow: 0 0 10px 0 rgb(16 185 129 / 0.35);
  animation: prem-pulse 2.4s var(--prem-ease-out) infinite;
  flex-shrink: 0;
}
@keyframes prem-pulse {
  0% { opacity: 0.55; }
  50% { opacity: 1; }
  100% { opacity: 0.55; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-status-live::before { animation: none; }
}

/* ------------------------------------------------------------------ *
 * HERO COMPOSITE — masked model + gradient rings + orbit + bubbles
 * The model is a transparent PNG so the rings read through it.
 * Works in both light and dark mode via --kieto-accent tokens.
 * ------------------------------------------------------------------ */

/* Square container: orbit (z2) + rings (z1) + bubbles (z4) all
   anchor to this element. Extra overflow visible so the orbit
   circle and bubbles extend outside the square. */
.hero-image {
  position: relative;
  width: 20rem;
  aspect-ratio: 1 / 1;
  flex: 0 0 20rem;
  isolation: isolate;
  overflow: visible;
  margin-inline: 0;
}

/* Remove the old bordered-frame. */
.hero-image::after { display: none; }

/* Stage fills the square and acts as coordinate origin. */
.hero-stage {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  overflow: visible;
}

/* --- The masked character model (z3: above rings, below bubbles) --- */
.hero-model {
  position: relative;
  z-index: 3;
  width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 20px 28px rgb(15 23 42 / 0.26));
  transition: transform 0.6s var(--prem-ease-out), filter 0.6s var(--prem-ease-out);
}

/* Only promote to GPU layer during active animation */
.prem-will-animate {
  will-change: transform;
}
html.dark .hero-model {
  filter: drop-shadow(0 20px 32px rgb(0 0 0 / 0.48));
}

/* --- 3 gradient rings hugging the model (concentric, behind) --- */
.hero-rings {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.hero-ring {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid rgb(var(--kieto-accent-rgb) / 0.35);
  background: radial-gradient(
    circle at center,
    var(--theme-hero-ring-glow),
    transparent 70%
  );
}
/* ring--1: tight hug to model (78% model → ring at ~82%) */
.hero-ring--1 {
  width: 82%;
  aspect-ratio: 1;
  animation: hero-ring-pulse 6s var(--prem-ease-out) infinite;
}
/* ring--2: second layer */
.hero-ring--2 {
  width: 94%;
  aspect-ratio: 1;
  border-color: rgb(var(--kieto-accent-rgb) / 0.22);
  background: radial-gradient(
    circle at center,
    var(--theme-hero-ring-glow),
    transparent 72%
  );
  animation: hero-ring-pulse 6s var(--prem-ease-out) infinite 1s;
}
/* ring--3: outermost dashed — static, no spin (logos no longer orbit) */
.hero-ring--3 {
  width: 106%;
  aspect-ratio: 1;
  border: 1px dashed rgb(var(--kieto-accent-rgb) / 0.28);
  background: none;
}

@keyframes hero-ring-pulse {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.04); opacity: 1; }
}

/* --- 4 discipline bubbles (text pills, closer to model) --- */
.hero-bubble {
  position: absolute;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.85rem;
  border-radius: var(--prem-radius-pill);
  background: var(--theme-hero-bubble-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--theme-border-subtle);
  color: var(--theme-hero-bubble-fg);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  box-shadow: var(--prem-shadow-sm);
  pointer-events: none;
  animation: hero-bubble-float 5s var(--prem-ease-out) infinite;
}
.hero-bubble__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--kieto-accent);
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgb(var(--kieto-accent-rgb) / 0.18);
}
/* Bubbles — outer corners (logos stay tight on ring). */
.hero-bubble--designer { top: 6%;  left: 4%;  animation-delay: 0s; }
.hero-bubble--uiux    { top: 20%; right: 4%;  animation-delay: 0.8s; }
.hero-bubble--3d      { bottom: 28%; left: 4%; animation-delay: 1.6s; }
.hero-bubble--motion  { bottom: 8%;  right: 6%; animation-delay: 2.4s; }

@keyframes hero-bubble-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* --- Floating tool tiles — hug the portrait ring, not the text column --- */
.hero-tools {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  overflow: visible;
}
.hero-tool {
  position: absolute;
  display: grid;
  place-items: center;
  width: 2.65rem;
  height: 2.65rem;
  padding: 0.45rem;
  border-radius: 0.7rem;
  background: var(--theme-surface-glass);
  border: 1px solid var(--theme-border-subtle);
  box-shadow: var(--prem-shadow-md);
  animation: hero-tool-float 5.5s var(--prem-ease-out) infinite;
  transform-origin: center center;
}
html.dark .hero-tool {
  box-shadow: 0 12px 32px -12px rgba(0 0 0 / 0.55), 0 4px 12px -6px rgba(0 0 0 / 0.35);
}
.hero-tool img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/*
 * Logo layout — 5 tiles on outer ring, bubbles stay inner.
 * Each logo sits in a clear quadrant, no overlap with pills.
 *
 *        vscode          figma
 *     Designer            UI/UX
 *            [model]
 *     3D Artist    ae
 *        ps      Motion  maya
 */
.hero-tool--vscode {
  top: 0%;
  right: -2%;
  --tool-tilt: 9deg;
  animation-delay: 0.7s;
}
.hero-tool--figma {
  top: 30%;
  left: -4%;
  --tool-tilt: -7deg;
  animation-delay: 0s;
  
}
.hero-tool--ae {
  top: 42%;
  right: -5%;
  --tool-tilt: 11deg;
  animation-delay: 1.4s;
}
.hero-tool--ps {
  bottom: 0%;
  left: -4%;
  --tool-tilt: 6deg;
  animation-delay: 2.8s;
}
.hero-tool--maya {
  bottom: 10%;
  right: -10%;
  --tool-tilt: -8deg;
  animation-delay: 2.1s;
}

@keyframes hero-tool-float {
  0%, 100% {
    transform: translateY(0) rotate(var(--tool-tilt, 0deg));
  }
  50% {
    transform: translateY(-10px) rotate(var(--tool-tilt, 0deg));
  }
}

/* Reduced motion: stop all hero animations, keep static composition. */
@media (prefers-reduced-motion: reduce) {
  .hero-ring--1, .hero-ring--2, .hero-ring--3,
  .hero-bubble,
  .hero-tool { animation: none !important; }
  .hero-tool { transform: rotate(var(--tool-tilt, 0deg)); }
}

/* Mobile: hide bubbles + tool tiles to keep the hero clean. */
@media (max-width: 767px) {
  .hero-bubble,
  .hero-tools { display: none; }
  .hero-ring--3 { display: none; }
}

/* ------------------------------------------------------------------ *
 * 5. MAGNETIC + MICRO-INTERACTIONS
 * ------------------------------------------------------------------ */

/* Primary CTA — accent depth + shine sweep + tactile push.
 * Applied to ALL .btn-theme instances site-wide (not just hero) +
 * any outline-style buttons that share the theme colour. */
.btn-theme {
  position: relative;
  overflow: hidden;
  box-shadow:
    0 8px 20px -8px rgb(var(--kieto-accent-rgb) / 0.50),
    inset 0 1px 0 0 rgb(255 255 255 / 0.18);
  transition:
    transform 0.25s var(--prem-ease-out),
    box-shadow 0.35s var(--prem-ease-out);
}
.btn-theme:hover {
  box-shadow:
    var(--prem-shadow-accent),
    inset 0 1px 0 0 rgb(255 255 255 / 0.22);
  transform: translateY(-2px);
}
.btn-theme:active {
  transform: translateY(0) scale(0.985);
}
/* Shine sweep */
.btn-theme::after {
  content: '';
  position: absolute;
  top: 0;
  left: -130%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    100deg,
    transparent,
    rgb(255 255 255 / 0.30),
    transparent
  );
  transform: skewX(-18deg);
  transition: left 0.65s var(--prem-ease-out);
  pointer-events: none;
  z-index: 1;
}
.btn-theme:hover::after {
  left: 130%;
}

/* Outline / border buttons that share the accent colour.
 * These use the template classes for Download CV, contact-feedback,
 * portfolio tab active, etc. Shared depth + shine. */
.project-live-preview-btn,
.portfolio-live-preview-link,
.contact-feedback-action,
.portfolio-tab-btn.is-active,
.sidebar-download-btn {
  position: relative;
  overflow: hidden;
  transition:
    transform 0.25s var(--prem-ease-out),
    box-shadow 0.3s var(--prem-ease-out),
    background-color 0.3s var(--prem-ease-out),
    color 0.3s var(--prem-ease-out);
}
.project-live-preview-btn::after,
.portfolio-live-preview-link::after,
.contact-feedback-action::after,
.sidebar-download-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -130%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    100deg,
    transparent,
    rgb(255 255 255 / 0.24),
    transparent
  );
  transform: skewX(-18deg);
  transition: left 0.6s var(--prem-ease-out);
  pointer-events: none;
  z-index: 1;
}
.project-live-preview-btn:hover::after,
.portfolio-live-preview-link:hover::after,
.contact-feedback-action:hover::after,
.sidebar-download-btn:hover::after {
  left: 130%;
}
.project-live-preview-btn:hover,
.portfolio-live-preview-link:hover,
.contact-feedback-action:hover,
.sidebar-download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px -8px rgb(var(--kieto-accent-rgb) / 0.55);
}
.project-live-preview-btn:active,
.portfolio-live-preview-link:active,
.contact-feedback-action:active,
.sidebar-download-btn:active {
  transform: translateY(0) scale(0.985);
}

/* Keep the .is-magnetic class working for any explicitly-tagged CTA. */
.btn-theme.is-magnetic,
.is-magnetic.btn-theme { /* already inherits .btn-theme rules above */ }

/* Sidebar "DOWNLOAD CV" — shine sweep ONLY, no lift/scale/magnetic
 * movement. Its own bg/border colour hover (hover:bg-themeHover) stays
 * exactly as-is; this just layers the same diagonal light streak used
 * on .btn-theme, with zero transform. */
.cv-shine-btn {
  position: relative;
  overflow: hidden;
}
.cv-shine-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -130%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    100deg,
    transparent,
    rgb(255 255 255 / 0.30),
    transparent
  );
  transform: skewX(-18deg);
  transition: left 0.65s var(--prem-ease-out);
  pointer-events: none;
  z-index: 1;
}
.cv-shine-btn:hover::after {
  left: 130%;
}

/* Generic link underline-grow for nav + section links. */
.link-underline {
  position: relative;
}
.link-underline::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background: var(--kieto-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--prem-ease-out);
}
.link-underline:hover::after { transform: scaleX(1); }

/* ------------------------------------------------------------------ *
 * 6. SECTION HEADER POLISH
 * ------------------------------------------------------------------ */

/* The pill "section-name" badges — refined border + accent dot. */
.section-name {
  gap: 0.55rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.7rem;
  backdrop-filter: blur(6px);
  background: var(--theme-surface-glass);
  color: var(--theme-fg);
  border-color: var(--theme-border-subtle);
}

/* Skill / stat counters — larger, tabular numbers. */
.counter,
.skills-section .counter {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

/* ------------------------------------------------------------------ *
 * 7. PORTFOLIO + SKILL + SERVICE POLISH
 * ------------------------------------------------------------------ */

/* Portfolio grid items — refined image zoom + overlay depth. */
#portfolio .portfolio_wrapper > .item {
  border-radius: var(--prem-radius-card);
  overflow: hidden;
}
#portfolio .portfolio_wrapper > .item img {
  transition: transform 0.7s var(--prem-ease-out);
}
#portfolio .portfolio_wrapper > .item:hover img {
  transform: scale(1.06);
}
#portfolio .portfolio_wrapper > .item:hover {
  box-shadow: var(--prem-shadow-lg);
}

/* Skill chips — subtle hover lift + accent edge. */
.skills-section .skill-item,
.skills-section [class*='skill'] {
  transition:
    transform 0.35s var(--prem-ease-out),
    box-shadow 0.35s var(--prem-ease-out);
}
.skills-section .skill-item:hover {
  transform: translateY(-3px);
}

/* Service icon discs — refined accent ring on hover. */
.services-section .service-item .service-icon,
.services-section [class*='icon'] {
  transition:
    transform 0.4s var(--prem-ease-spring),
    color 0.3s var(--prem-ease-out);
}
.services-section .service-item:hover [class*='icon'] {
  transform: scale(1.08) rotate(-3deg);
}

/* Smooth scroll behaviour for the one-page anchor nav. */
html {
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* Contact info SVG icons: inherit accent colour from the --kieto-accent
   token so stroke="currentColor" picks up the active theme colour.
   Only applies to non-Lucide SVGs (Lucide uses stroke-only, fill=none). */
.contact-section .contact-info .icon svg,
.contact-section .contact-info .icon svg path {
  color: var(--kieto-accent);
}
.contact-section .contact-info .icon svg:not([data-lucide]),
.contact-section .contact-info .icon svg:not([data-lucide]) path {
  fill: var(--kieto-accent);
}

/* Selection colour ties text selection to the brand accent. */
::selection {
  background: rgb(var(--kieto-accent-rgb) / 0.22);
  color: inherit;
}

/* Focus-visible ring — consistent, accent-tinted, accessible. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid rgb(var(--kieto-accent-rgb) / 0.7);
  outline-offset: 2px;
  border-radius: 4px;
}

/* =====================================================================
 * P2 — PORTFOLIO SECTION PREMIUM REFINEMENT
 * Editorial overlay, layered depth, bento rhythm, accent edge-glow.
 * Honours the existing data-card-size="large|small" system from the
 * admin; only the visual surface is refined, never the data model.
 * ===================================================================== */

/* --- 2.1 Card frame: refined border + accent-tinted edge on hover.
 * Replace the flat platinum border with a softer hairline that lifts
 * into an accent-tinted glow on hover. */
#portfolio .portfolio_wrapper > .item > .block,
#portfolio .portfolio_wrapper > .item > div:first-child {
  border-color: rgb(15 23 42 / 0.06) !important;
  transition:
    border-color 0.45s var(--prem-ease-out),
    box-shadow 0.5s var(--prem-ease-out),
    transform 0.5s var(--prem-ease-out);
}
.dark #portfolio .portfolio_wrapper > .item > .block,
.dark #portfolio .portfolio_wrapper > .item > div:first-child {
  border-color: rgb(255 255 255 / 0.06) !important;
}
#portfolio .portfolio_wrapper > .item:hover > .block,
#portfolio .portfolio_wrapper > .item:hover > div:first-child {
  border-color: rgb(var(--kieto-accent-rgb) / 0.35) !important;
  box-shadow:
    var(--prem-shadow-lg),
    0 0 0 1px rgb(var(--kieto-accent-rgb) / 0.10);
  transform: translateY(-4px);
}

/* --- 2.2 Image: gentler zoom, crisper edges. */
#portfolio .portfolio_wrapper > .item .img-wrapper {
  overflow: hidden;
  border-radius: 12px;
}
#portfolio .portfolio_wrapper > .item img {
  transition: transform 0.8s var(--prem-ease-out), filter 0.5s var(--prem-ease-out);
  transform: scale(1.002); /* avoid baseline sub-pixel gap */
}
/* The template's group-hover:blur is heavy; soften it to a tasteful
 * desaturation + slight zoom so the overlay reads cleanly. */
#portfolio .portfolio_wrapper > .item.group:hover img {
  filter: saturate(1.05);
  transform: scale(1.06);
}

/* --- 2.3 Overlay: editorial bottom-up gradient, hover-revealed.
 * The gradient sits hidden by default and fades in on hover so the
 * card image reads cleanly when idle (per user request). */
#portfolio .portfolio_wrapper > .item .overlay {
  background: var(--theme-portfolio-overlay) !important;
  opacity: 0 !important;
  transition: opacity 0.45s var(--prem-ease-out), background 0.5s var(--prem-ease-out);
}
#portfolio .portfolio_wrapper > .item:hover .overlay,
#portfolio .portfolio_wrapper > .item:focus-within .overlay {
  opacity: 1 !important;
}

/* --- 2.4 Caption: editorial bottom-left alignment, not centered.
 * Override the template's .position-center with a left/bottom anchor
 * so the caption reads like a magazine plate, not a placeholder. */
#portfolio .portfolio_wrapper > .item .info {
  left: 1.5rem !important;
  right: 1.5rem !important;
  top: auto !important;
  bottom: 1.5rem !important;
  transform: translateY(12px) !important;
  text-align: left !important;
  color: #ffffff !important;
  max-width: calc(100% - 3rem);
  text-shadow: 0 2px 12px rgb(0 0 0 / 0.4);
}
#portfolio .portfolio_wrapper > .item:hover .info,
#portfolio .portfolio_wrapper > .item:focus-within .info {
  transform: translateY(0) !important;
}
/* Caption typography: tight display, refined category sub-label. */
#portfolio .portfolio_wrapper > .item .info {
  font-family: 'Sora', 'Poppins', system-ui, sans-serif;
  letter-spacing: -0.01em;
  font-size: clamp(1.1rem, 2.4vw, 1.65rem) !important;
  line-height: 1.2 !important;
}
#portfolio .portfolio_wrapper > .item .info > span {
  display: block;
  margin-top: 0.25rem;
  font-family: 'Poppins', system-ui, sans-serif;
  font-size: 0.78rem !important;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgb(var(--kieto-accent-rgb) / 0.92);
  opacity: 0.92;
}

/* --- 2.5 Category pill: refined frosted style + accent on hover. */
#portfolio .portfolio_wrapper > .item ul li span,
#portfolio .portfolio_wrapper > .item ul li a {
  backdrop-filter: blur(10px);
  background: rgb(15 23 42 / 0.55) !important;
  border: 1px solid rgb(255 255 255 / 0.10);
  color: #f8fafc !important;
  font-weight: 500;
  letter-spacing: 0.04em;
  transition:
    background-color 0.3s var(--prem-ease-out),
    border-color 0.3s var(--prem-ease-out),
    color 0.3s var(--prem-ease-out),
    transform 0.3s var(--prem-ease-out);
}
#portfolio .portfolio_wrapper > .item ul li span:hover,
#portfolio .portfolio_wrapper > .item ul li a:hover {
  background: rgb(var(--kieto-accent-rgb) / 0.95) !important;
  border-color: rgb(var(--kieto-accent-rgb) / 0.6);
  color: #ffffff !important;
  transform: translateY(-1px);
}

/* --- 2.6 Bento rhythm: subtle accent corner mark on large cards.
 * Adds a small geometric accent in the top-right of feature cards so
 * the eye gets visual punctuation across the grid (bento diversity,
 * not all-image-sameness per the skill's background-diversity rule). */
#portfolio .portfolio_wrapper > .item[data-card-size='large'] .block::before,
#portfolio .portfolio_wrapper > .item[data-card-size='large'] > div:first-child::before {
  content: '';
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 22px;
  height: 22px;
  border-top: 1.5px solid rgb(var(--kieto-accent-rgb) / 0.55);
  border-right: 1.5px solid rgb(var(--kieto-accent-rgb) / 0.55);
  border-top-right-radius: 6px;
  z-index: 5;
  opacity: 0;
  transform: translate(6px, -6px);
  transition: opacity 0.4s var(--prem-ease-out), transform 0.4s var(--prem-ease-out);
  pointer-events: none;
}
#portfolio .portfolio_wrapper > .item[data-card-size='large']:hover .block::before,
#portfolio .portfolio_wrapper > .item[data-card-size='large']:hover > div:first-child::before {
  opacity: 1;
  transform: translate(0, 0);
}

/* --- 2.7 Video cards: match the editorial treatment. */
#portfolio .item .video_block {
  border-radius: 12px;
  overflow: hidden;
}
#portfolio .item .video_block video {
  transition: transform 0.8s var(--prem-ease-out);
}
#portfolio .item:hover .video_block video {
  transform: scale(1.04);
}

/* --- 2.8 "More Projects" CTA: magnetic + accent depth. */
.portfolio-section .more-blogs a {
  position: relative;
  overflow: hidden;
  box-shadow:
    0 8px 20px -8px rgb(var(--kieto-accent-rgb) / 0.5),
    inset 0 1px 0 0 rgb(255 255 255 / 0.18);
  transition:
    transform 0.3s var(--prem-ease-out),
    box-shadow 0.4s var(--prem-ease-out);
}
.portfolio-section .more-blogs a:hover {
  box-shadow:
    var(--prem-shadow-accent),
    inset 0 1px 0 0 rgb(255 255 255 / 0.22);
  transform: translateY(-2px);
}
.portfolio-section .more-blogs a:active {
  transform: translateY(0) scale(0.985);
}

/* --- 2.9 Portfolio section header: reveal + accent gradient word. */
.portfolio-section .section-title {
  letter-spacing: -0.02em;
}
.portfolio-section .section-title .title {
  font-family: 'Sora', 'Poppins', system-ui, sans-serif;
}

/* --- 2.10 Reduced motion: kill the heavy blur/zoom, keep gradient. */
@media (prefers-reduced-motion: reduce) {
  #portfolio .portfolio_wrapper > .item img,
  #portfolio .portfolio_wrapper > .item .info,
  #portfolio .portfolio_wrapper > .item > .block,
  #portfolio .portfolio_wrapper > .item > div:first-child {
    transition: none !important;
    transform: none !important;
  }
}

/* =====================================================================
 * P3 — ABOUT COUNTERS
 * ===================================================================== */
 * (values are static from HTML now, no count-up animation). */
.about-section .counters .number {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

/* =====================================================================
 * P4 — SERVICE & SKILL CARD REFINEMENT
 * The template uses .service-section (singular) for BOTH the Services and
 * Skills cards, so every selector below keys off that real class (and the
 * #skill id for skill-specific rules). Refines depth, icon, ghost number,
 * circle-progress and hover state into an editorial, "expensive" feel.
 * ===================================================================== */

/* --- 4.1 Service card frame: softer hairline + accent-tinted hover field.
 * Replace the flat platinum border with a hairline that lifts into an
 * accent-tinted glow on hover, plus a faint accent wash inside. */
.service-section .service-card-wrapper .card-item {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(
      180deg,
      rgb(var(--kieto-accent-rgb) / 0),
      rgb(var(--kieto-accent-rgb) / 0)
    );
  isolation: isolate;
}
.service-section .service-card-wrapper .card-item::before {
  /* Top accent hairline that scales in on hover. */
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    var(--kieto-accent),
    var(--kieto-accent-hover)
  );
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.5s var(--prem-ease-out);
  z-index: 2;
  pointer-events: none;
}
.service-section .service-card-wrapper .card-item::after {
  /* Soft accent wash that fades in on hover (sits behind content). */
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    120% 90% at 100% 0%,
    rgb(var(--kieto-accent-rgb) / 0.08),
    transparent 60%
  );
  opacity: 0;
  transition: opacity 0.5s var(--prem-ease-out);
  z-index: -1;
  pointer-events: none;
}
.service-section .service-card-wrapper .card-item:hover::before {
  transform: scaleX(1);
}
.service-section .service-card-wrapper .card-item:hover::after {
  opacity: 1;
}
.dark .service-section .service-card-wrapper .card-item:hover::after {
  background: radial-gradient(
    120% 90% at 100% 0%,
    rgb(var(--kieto-accent-rgb) / 0.14),
    transparent 60%
  );
}

/* --- 4.2 Service icon: refined disc + accent fill on hover.
 * The template's raw SVG sits in an absolutely-positioned .icon. Wrap it
 * in a soft disc that fills with accent on hover while the glyph rotates. */
.service-section .service-card-wrapper .card-item .icon {
  width: 3.5rem;
  height: 3.5rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgb(var(--kieto-accent-rgb) / 0.08);
  color: var(--kieto-accent);
  transition:
    transform 0.5s var(--prem-ease-spring),
    background-color 0.45s var(--prem-ease-out),
    color 0.45s var(--prem-ease-out);
  z-index: 1;
}
html.dark .service-section .service-card-wrapper .card-item .icon {
  background: rgb(var(--kieto-accent-rgb) / 0.14);
}
.service-section .service-card-wrapper .card-item .icon svg {
  width: 1.7rem;
  height: 1.7rem;
  transition: fill 0.4s var(--prem-ease-out);
}
.service-section .service-card-wrapper .card-item:hover .icon {
  background: var(--kieto-accent);
  color: #ffffff;
  transform: rotate(-12deg) scale(1.06);
  box-shadow: 0 12px 26px -10px rgb(var(--kieto-accent-rgb) / 0.6);
}
.service-section .service-card-wrapper .card-item:hover .icon svg {
  fill: #ffffff;
}

/* --- 4.3 Ghost number: refined accent treatment + scrub-friendly opacity.
 * Keep the editorial oversized "01..04" but make it accent-tinted on hover
 * and tighten its kerning so it reads as a magazine plate mark. */
.service-section .service-card-wrapper .card-item .number {
  font-family: 'Sora', 'Poppins', system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
  line-height: 1;
  color: rgb(15 23 42 / 0.12);
  transition:
    color 0.45s var(--prem-ease-out),
    opacity 0.45s var(--prem-ease-out),
    transform 0.5s var(--prem-ease-out);
}
html.dark .service-section .service-card-wrapper .card-item .number {
  color: rgb(255 255 255 / 0.10);
}
.service-section .service-card-wrapper .card-item:hover .number {
  color: rgb(var(--kieto-accent-rgb) / 0.95);
  opacity: 1 !important;
  transform: translateX(-4px);
}

/* --- 4.4 Service copy: refined measure + accent underline-grow on title. */
.service-section .service-card-wrapper .card-item h4 {
  letter-spacing: -0.015em;
  position: relative;
}
.service-section .service-card-wrapper .card-item h4::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -0.45rem;
  width: 1.75rem;
  height: 2px;
  background: var(--kieto-accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.45s var(--prem-ease-out) 0.05s;
}
.service-section .service-card-wrapper .card-item:hover h4::after {
  transform: scaleX(1);
}
.service-section .service-card-wrapper .card-item p {
  max-width: 34ch;
  line-height: 1.7;
  color: rgb(100 116 139);
}
.dark .service-section .service-card-wrapper .card-item p {
  color: rgb(203 213 225);
}

/* --- 4.5 Skill cards (Swiper slides): icon disc + progress ring.
 * #skill .service-section holds the skills-slider. Each slide has an
 * .icon img, a circular progress (.circle), and a .name. No hover
 * lift/scale/glow on this block by request — it stays static. */
#skill .skills-slider .swiper-slide {
  position: relative;
  border-radius: var(--prem-radius-card);
  padding: 0.5rem 0.5rem 1rem;
}
#skill .skills-slider .swiper-slide .icon {
  width: 4rem;
  height: 4rem;
  margin: 0 auto 1.25rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgb(255 255 255);
  border: 1px solid rgb(15 23 42 / 0.06);
  box-shadow: var(--prem-shadow-sm);
}
#skill .skills-slider .swiper-slide .icon img {
  width: 2.1rem;
  height: 2.1rem;
  object-fit: contain;
}
.dark #skill .skills-slider .swiper-slide .icon {
  background: rgb(45 46 47);
  border-color: rgb(255 255 255 / 0.08);
}
/* Circle progress container: subtle ring + crisper SVG strokes. */
#skill .skills-slider .swiper-slide .progressCircle .circle {
  position: relative;
}
#skill .skills-slider .swiper-slide .progressCircle .circle svg {
  filter: drop-shadow(0 4px 10px rgb(var(--kieto-accent-rgb) / 0.18));
}
#skill .skills-slider .swiper-slide .progressCircle .circle .label {
  font-family: 'Sora', 'Poppins', system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
/* Skill name: refined display, no hover colour change. */
#skill .skills-slider .swiper-slide .name {
  font-family: 'Sora', 'Poppins', system-ui, sans-serif;
  letter-spacing: -0.01em;
}

/* --- 4.6 Skill nav buttons: accent depth on hover (match CTA feel). */
#skill .skills-slider-navigation .button-prev,
#skill .skills-slider-navigation .button-next {
  transition:
    transform 0.3s var(--prem-ease-out),
    background-color 0.3s var(--prem-ease-out),
    border-color 0.3s var(--prem-ease-out),
    box-shadow 0.3s var(--prem-ease-out);
}
#skill .skills-slider-navigation .button-prev:hover,
#skill .skills-slider-navigation .button-next:hover {
  box-shadow: 0 10px 22px -10px rgb(var(--kieto-accent-rgb) / 0.55);
  transform: translateY(-2px);
}

/* --- 4.7 Reduced motion: kill the card transforms, keep colour changes. */
@media (prefers-reduced-motion: reduce) {
  .service-section .service-card-wrapper .card-item,
  .service-section .service-card-wrapper .card-item::before,
  .service-section .service-card-wrapper .card-item::after,
  .service-section .service-card-wrapper .card-item .icon,
  .service-section .service-card-wrapper .card-item .number,
  .service-section .service-card-wrapper .card-item h4::after,
  #skill .skills-slider .swiper-slide,
  #skill .skills-slider .swiper-slide .icon {
    transition: none !important;
    transform: none !important;
  }
  .service-section .service-card-wrapper .card-item::before {
    transform: scaleX(1);
  }
}

/* =====================================================================
 * KIETO STYLE PANEL (KSP)
 * Orbit-studio aesthetic: floating palette icon → slide-up frosted
 * panel with theme toggle + swatch row + custom colour picker.
 * Adapts colour automatically via --kieto-accent / dark class.
 * ===================================================================== */

/* --- Floating container (bottom-right fixed). */
.ksp {
  position: fixed;
  bottom: 24px;
  right: 30px;               /* centered with nav (nav center 56px - half-btn 26px) */
  z-index: 9999;
  /* Panel is absolutely positioned inside, so only the toggle button
     needs sizing. overflow: visible lets the panel extend upward. */
  width: 52px;
  height: 52px;
  overflow: visible;
}

/* --- Toggle button: orbit-style circular frosted button. */
.ksp__toggle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255 255 255 / 0.90);
  border: 1.5px solid rgb(var(--kieto-accent-rgb) / 0.30);
  color: var(--kieto-accent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow:
    0 8px 24px -8px rgba(0 0 0 / 0.18),
    0 0 0 0 rgb(var(--kieto-accent-rgb) / 0.20);
  cursor: pointer;
  transition:
    transform 0.38s var(--prem-ease-spring),
    box-shadow 0.38s var(--prem-ease-out),
    border-color 0.3s var(--prem-ease-out);
}
.ksp__toggle svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}
.ksp__toggle:hover {
  transform: rotate(20deg) scale(1.06);
  box-shadow:
    0 12px 30px -10px rgba(0 0 0 / 0.22),
    0 0 0 6px rgb(var(--kieto-accent-rgb) / 0.12);
  border-color: rgb(var(--kieto-accent-rgb) / 0.55);
}
.ksp__toggle[aria-expanded="true"] {
  transform: rotate(60deg);
  border-color: rgb(var(--kieto-accent-rgb) / 0.65);
}
.dark .ksp__toggle {
  background: rgba(18 20 28 / 0.92);
  border-color: rgb(var(--kieto-accent-rgb) / 0.35);
  box-shadow:
    0 8px 28px -8px rgba(0 0 0 / 0.55),
    0 0 0 0 rgb(var(--kieto-accent-rgb) / 0.25);
}
.dark .ksp__toggle:hover {
  box-shadow:
    0 12px 32px -10px rgba(0 0 0 / 0.65),
    0 0 0 6px rgb(var(--kieto-accent-rgb) / 0.16);
}

/* --- Panel: frosted card that slides up from button. */
.ksp__panel {
  /* Absolute so it never takes up layout space or blocks page content. */
  position: absolute;
  bottom: calc(100% + 12px); /* floats above the toggle button */
  right: 0;
  display: none; /* JS toggles via .is-open */
  flex-direction: column;
  gap: 14px;
  padding: 20px 18px;
  width: 230px;
  border-radius: 18px;
  background: rgba(255 255 255 / 0.88);
  border: 1.5px solid rgba(15 23 42 / 0.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow:
    0 24px 56px -16px rgba(0 0 0 / 0.16),
    0 4px 12px -4px rgba(0 0 0 / 0.08),
    inset 0 1px 0 rgb(255 255 255 / 0.7);
  transform-origin: bottom right;
  /* animation via .is-animating applied on next frame */
  opacity: 0;
  transform: translateY(10px) scale(0.97);
  transition:
    opacity 0.25s var(--prem-ease-out),
    transform 0.25s var(--prem-ease-out);
}
.ksp__panel.is-open {
  display: flex; /* show first */
}
.ksp__panel.is-open.is-animating {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.ksp__panel:not(.is-open) {
  pointer-events: none;
}
.dark .ksp__panel {
  background: rgba(14 16 24 / 0.94);
  border-color: rgba(255 255 255 / 0.08);
  box-shadow:
    0 24px 60px -16px rgba(0 0 0 / 0.6),
    0 4px 16px -4px rgba(0 0 0 / 0.38),
    inset 0 1px 0 rgba(255 255 255 / 0.06);
}

/* --- Section label. */
.ksp__label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(15 23 42 / 0.42);
  margin-bottom: -4px;
}
.dark .ksp__label {
  color: rgba(255 255 255 / 0.38);
}

/* --- Theme row: two equal pill buttons. */
.ksp__theme-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.ksp__theme-btn {
  border-radius: 10px;
  overflow: hidden;
}
.ksp__theme-btn button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  padding: 10px 8px;
  border-radius: 10px;
  border: 1.5px solid rgba(15 23 42 / 0.10);
  background: transparent;
  color: rgba(15 23 42 / 0.55);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    background-color 0.28s var(--prem-ease-out),
    border-color 0.28s var(--prem-ease-out),
    color 0.28s var(--prem-ease-out),
    box-shadow 0.28s var(--prem-ease-out);
}
.ksp__theme-btn button i {
  font-size: 1.15rem;
  transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}
.ksp__theme-btn button.theme-spin i {
  transform: rotate(360deg);
}
.ksp__theme-btn button:hover {
  border-color: rgb(var(--kieto-accent-rgb) / 0.40);
  color: var(--kieto-accent);
  background: rgb(var(--kieto-accent-rgb) / 0.06);
}
.ksp__theme-btn button.active {
  background: var(--kieto-accent);
  border-color: var(--kieto-accent);
  color: #ffffff;
  box-shadow: 0 6px 18px -8px rgb(var(--kieto-accent-rgb) / 0.7);
}
.dark .ksp__theme-btn button {
  border-color: rgba(255 255 255 / 0.10);
  color: rgba(255 255 255 / 0.45);
}

/* --- Swatch row. */
.ksp__swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}
.ksp__swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--sw);
  border: 2px solid transparent;
  box-shadow: 0 0 0 1.5px rgba(15 23 42 / 0.14);
  cursor: pointer;
  transition:
    transform 0.26s var(--prem-ease-spring),
    box-shadow 0.26s var(--prem-ease-out),
    border-color 0.26s var(--prem-ease-out);
  position: relative;
}
.ksp__swatch:hover {
  transform: scale(1.18);
  box-shadow: 0 0 0 1.5px rgba(15 23 42 / 0.20);
}
.ksp__swatch.is-active {
  border-color: #ffffff;
  box-shadow:
    0 0 0 2.5px var(--sw),
    0 0 18px 2px rgba(0 0 0 / 0.05);
  transform: scale(1.12);
}
.dark .ksp__swatch {
  box-shadow: 0 0 0 1.5px rgba(255 255 255 / 0.12);
}
.dark .ksp__swatch.is-active {
  border-color: rgba(255 255 255 / 0.7);
}
/* Fallback: if the accent-swatch old classes are in play, keep them compatible. */
.ksp__swatch.is-active,
.accent-swatch.is-active {
  outline: none; /* remove the old outline style */
}

/* --- Custom colour picker. */
.ksp__custom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
}
.ksp__custom span {
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(15 23 42 / 0.5);
  text-transform: uppercase;
}
.dark .ksp__custom span {
  color: rgba(255 255 255 / 0.4);
}
.ksp__custom input[type="color"] {
  width: 38px;
  height: 28px;
  border: 1.5px solid rgba(15 23 42 / 0.12);
  border-radius: 8px;
  background: none;
  cursor: pointer;
  padding: 2px 3px;
  transition: border-color 0.25s var(--prem-ease-out);
}
.dark .ksp__custom input[type="color"] {
  border-color: rgba(255 255 255 / 0.14);
}
.ksp__custom input[type="color"]:hover {
  border-color: rgb(var(--kieto-accent-rgb) / 0.55);
}

/* --- Admin link button. */
.ksp__admin {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1.5px solid rgb(var(--kieto-accent-rgb) / 0.55);
  background: var(--kieto-accent);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  overflow: hidden;
  position: relative;
  transition:
    background-color 0.28s var(--prem-ease-out),
    box-shadow 0.28s var(--prem-ease-out),
    transform 0.25s var(--prem-ease-out);
  box-shadow: 0 6px 18px -8px rgb(var(--kieto-accent-rgb) / 0.60);
}
.ksp__admin::after {
  content: '';
  position: absolute;
  top: 0; left: -130%;
  width: 60%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255 255 255 / 0.28), transparent);
  transform: skewX(-18deg);
  transition: left 0.6s var(--prem-ease-out);
  pointer-events: none;
}
.ksp__admin:hover::after { left: 130%; }
.ksp__admin:hover {
  background: var(--kieto-accent-hover);
  border-color: var(--kieto-accent-hover);
  box-shadow: 0 10px 28px -8px rgb(var(--kieto-accent-rgb) / 0.70);
  transform: translateY(-1px);
}
.ksp__admin:active { transform: translateY(0) scale(0.985); }

/* --- Reduced motion. */
@media (prefers-reduced-motion: reduce) {
  .ksp__toggle,
  .ksp__panel,
  .ksp__swatch,
  .ksp__theme-btn button,
  .ksp__admin { transition: none !important; transform: none !important; }
  .ksp__panel { opacity: 1 !important; transform: none !important; transition: none !important; }
  .ksp__panel.is-open { display: flex; }
}

/* =====================================================================
 * SCROLL-TO-TOP (STT)
 * Circular progress ring tracks page scroll depth. Button fades/scales
 * in once the user scrolls past 15% of the page. Clicking fires a
 * GSAP-powered smooth scroll (falls back to native scrollTo). All
 * accent colours come from --kieto-accent tokens. Touch-safe.
 * ===================================================================== */

.stt {
  position: fixed;
  bottom: 88px; /* sits above the KSP toggle button (24px + 52px + 12px) */
  right: 30px;               /* centered with nav */
  z-index: 9998;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255 255 255 / 0.90);
  border: 1.5px solid rgb(var(--kieto-accent-rgb) / 0.25);
  color: var(--kieto-accent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow:
    0 8px 24px -8px rgba(0 0 0 / 0.15),
    0 0 0 0 rgb(var(--kieto-accent-rgb) / 0.18);
  cursor: pointer;
  /* Hidden by default — JS adds .is-visible */
  opacity: 0;
  transform: translateY(14px) scale(0.9);
  pointer-events: none;
  transition:
    opacity 0.38s var(--prem-ease-out),
    transform 0.38s var(--prem-ease-spring),
    border-color 0.3s var(--prem-ease-out),
    box-shadow 0.3s var(--prem-ease-out);
}
.stt.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.stt:hover {
  border-color: rgb(var(--kieto-accent-rgb) / 0.6);
  box-shadow:
    0 12px 30px -10px rgba(0 0 0 / 0.20),
    0 0 0 6px rgb(var(--kieto-accent-rgb) / 0.11);
  transform: translateY(-2px) scale(1.04);
}
.stt.is-visible:hover { opacity: 1; }
.stt:active { transform: translateY(0) scale(0.96); }
.dark .stt {
  background: rgba(14 16 24 / 0.92);
  border-color: rgb(var(--kieto-accent-rgb) / 0.30);
  box-shadow: 0 8px 28px -8px rgba(0 0 0 / 0.55);
}
.dark .stt:hover {
  box-shadow:
    0 12px 32px -10px rgba(0 0 0 / 0.65),
    0 0 0 6px rgb(var(--kieto-accent-rgb) / 0.15);
}

/* Arrow icon */
.stt > svg:first-child {
  width: 20px;
  height: 20px;
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  transition: transform 0.3s var(--prem-ease-spring);
}
.stt:hover > svg:first-child {
  transform: translateY(-2px);
}

/* Circular progress ring (SVG overlay) */
.stt__ring {
  position: absolute;
  inset: -1.5px;
  width: calc(100% + 3px);
  height: calc(100% + 3px);
  border-radius: 50%;
  overflow: visible;
  /* Ring rotates from 12-o'clock (−90deg) */
  transform: rotate(-90deg);
  pointer-events: none;
  z-index: 1;
}
.stt__ring-bg {
  fill: none;
  stroke: rgb(var(--kieto-accent-rgb) / 0.12);
  stroke-width: 2.2;
}
.stt__ring-fill {
  fill: none;
  stroke: var(--kieto-accent);
  stroke-width: 2.4;
  stroke-linecap: round;
  /* Circumference: 2π × 23 ≈ 144.51. JS sets stroke-dashoffset. */
  stroke-dasharray: 144.51;
  stroke-dashoffset: 144.51; /* 0% = full offset (hidden) */
  transition: stroke-dashoffset 0.25s linear, stroke 0.4s ease;
  will-change: stroke-dashoffset;
}

/* Pulse ring when close to top */
@keyframes stt-ping {
  0%   { box-shadow: 0 0 0 0   rgb(var(--kieto-accent-rgb) / 0.45); }
  70%  { box-shadow: 0 0 0 10px rgb(var(--kieto-accent-rgb) / 0); }
  100% { box-shadow: 0 0 0 0   rgb(var(--kieto-accent-rgb) / 0); }
}
.stt.is-near-top {
  animation: stt-ping 1.8s var(--prem-ease-out) 2;
}

@media (max-width: 767px) {
  .stt {
    width: 46px;
    height: 46px;
    bottom: 80px;
    right: 18px;
  }
  .stt > svg:first-child { width: 17px; height: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  .stt, .stt > svg:first-child { transition: none !important; animation: none !important; }
  .stt__ring-fill { transition: none !important; }
}

/* Center KSP + STT with nav at 2xl (≥1536px): nav right-14=56px + half-nav 40px - half-btn 26px = 70px */
@media (min-width: 1536px) {
  .ksp  { right: 70px; }
  .stt  { right: 70px; }
}

/* =====================================================================
 * CUSTOM CURSOR (orbit-studio style)
 * Replaces the old jQuery-based cursor. Two layers: a fast dot and a
 * lagging ring that expand on hover. Accent-synced. Touch/reduced-
 * motion safe. Managed by setupCursor() in premium.js.
 * ===================================================================== */

/* Hide old template cursors. */
.custom_cursor_one,
.custom_cursor_two {
  display: none !important;
}

/* New cursor elements injected by JS. */
.kc-dot,
.kc-ring {
  position: fixed;
  top: 0;
  left: 0;
  border-radius: 50%;
  pointer-events: none;
  z-index: 99999;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.28s ease;
  will-change: transform;
}
body.kc-ready .kc-dot,
body.kc-ready .kc-ring {
  opacity: 1;
}

/* Dot: small, fast, accent-filled. */
.kc-dot {
  width: 8px;
  height: 8px;
  background: var(--kieto-accent);
  box-shadow: 0 0 18px -4px rgb(var(--kieto-accent-rgb) / 0.85);
  transition:
    width 0.22s var(--prem-ease-spring),
    height 0.22s var(--prem-ease-spring),
    background-color 0.3s ease,
    opacity 0.28s ease;
}
.kc-dot.is-hovering {
  width: 12px;
  height: 12px;
  background: var(--kieto-accent);
}
.kc-dot.is-clicking {
  width: 6px;
  height: 6px;
  opacity: 0.7;
}

/* Ring: lagging, transparent centre with accent border. */
.kc-ring {
  width: 38px;
  height: 38px;
  border: 1.5px solid rgb(var(--kieto-accent-rgb) / 0.55);
  background: radial-gradient(
    circle at 50% 50%,
    rgb(var(--kieto-accent-rgb) / 0.08),
    transparent 68%
  );
  box-shadow: 0 0 28px -14px rgb(var(--kieto-accent-rgb) / 0.6);
  transition:
    width 0.42s var(--prem-ease-out),
    height 0.42s var(--prem-ease-out),
    border-color 0.32s ease,
    background 0.32s ease,
    opacity 0.28s ease;
}
.kc-ring.is-hovering {
  width: 58px;
  height: 58px;
  border-color: rgb(var(--kieto-accent-rgb) / 0.9);
  background: radial-gradient(
    circle at 50% 50%,
    rgb(var(--kieto-accent-rgb) / 0.16),
    transparent 72%
  );
}
.kc-ring.is-clicking {
  width: 34px;
  height: 34px;
  border-color: var(--kieto-accent);
}

/* Hide native cursor when custom cursor is active. */
body.kc-active,
body.kc-active * {
  cursor: none !important;
}

/* Touch / no-hover / reduced-motion: hide custom cursor. */
@media (hover: none), (pointer: coarse) {
  .kc-dot,
  .kc-ring { display: none !important; }
  body.kc-active { cursor: auto !important; }
  body.kc-active * { cursor: auto !important; }
}
@media (prefers-reduced-motion: reduce) {
  .kc-dot,
  .kc-ring {
    display: none !important;
  }
}

/* =====================================================================
 * P5 — SCROLL ANIMATION SUPPORT CLASSES (scroll-animations.js)
 * .prem-hidden  : elements hidden until GSAP reveals them
 * .prem-hero-paused : pause CSS keyframe floats during hero entrance
 * ===================================================================== */

.prem-hidden {
  opacity: 0;
  transform: translateY(28px);
}

.prem-hero-paused .hero-bubble,
.prem-hero-paused .hero-tool,
.prem-hero-paused .hero-ring--1,
.prem-hero-paused .hero-ring--2 {
  animation-play-state: paused;
}

.prem-hero-paused .hero-model {
  opacity: 0;
  transform: scale(0.92) translateY(24px);
}

@media (prefers-reduced-motion: reduce) {
  .prem-hidden {
    opacity: 1 !important;
    transform: none !important;
  }
  .prem-hero-paused .hero-model {
    opacity: 1;
    transform: none;
  }
}
