/*! theme.css - Hyprland-inspired, optimized theme */

/* ===== CSS Variables ===== */
:root {
  color-scheme: dark;

  /* Colors — neutral charcoal palette */
  --bg: #111118;
  --panel: #18181f;
  --card: #1e1e28;
  --card-2: #16161f;
  --code: #1a1a24;

  --text: #d4d3dc;
  --muted: #8a8898;

  --accent: #8b5cf6;
  --accent-2: #ef4444;

  --border: rgba(255, 255, 255, 0.06);

  /* Effects — minimal */
  --glow-purple: none;
  --glow-red: none;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.08);

  /* Layout */
  --container: 1100px;
  --btn-radius: 999px;
  --btn-pad-y: 12px;
  --btn-pad-x: 16px;
  --btn-font: 14px;

  /* Typography Scale */
  --text-xs: 12px;
  --text-sm: 14px;
  --text-base: 16px;
  --text-lg: 18px;
  --text-xl: 20px;
  --text-2xl: 24px;
  --text-3xl: 30px;
  --text-4xl: 36px;

  /* Spacing Scale */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 24px;
  --space-2xl: 32px;
  --space-3xl: 48px;

  /* Animation Timing */
  --transition-fast: 150ms;
  --transition-base: 200ms;
  --transition-slow: 300ms;
  --transition-slower: 500ms;

  /* Z-index Scale */
  --z-base: 0;
  --z-dropdown: 10;
  --z-sticky: 50;
  --z-modal: 100;
  --z-tooltip: 200;
}

/* ===== Base Styles ===== */
* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100vh;
  min-height: 100dvh;
  /* Dynamic viewport height for mobile keyboards */
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  width: 100%;
}

/* ===== Mobile Input Optimizations ===== */
/* Ensure inputs don't zoom on focus in iOS (min 16px font) */
@media (pointer: coarse) {

  input[type="text"],
  input[type="number"],
  input[type="email"],
  input[type="tel"],
  input[type="search"],
  textarea,
  select {
    font-size: 16px;
  }
}

/* Visual viewport handling for virtual keyboards */
@supports (height: 100dvh) {
  .site-footer {
    padding-bottom: max(40px, env(safe-area-inset-bottom));
  }
}

/* Safe area insets for notched devices */
@supports (padding: max(0px)) {
  body {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }

  .site-header {
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
  }
}

/* ===== Skip Link (Accessibility) ===== */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  z-index: 1000;
  padding: 12px 20px;
  background: var(--accent);
  color: #ffffff;
  text-decoration: none;
  font-weight: 600;
  border-radius: 0 0 8px 0;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 0;
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

/* ===== Screen Reader Only Utility ===== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.sr-only-focusable:focus,
.sr-only-focusable:active {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

html {
  background: var(--bg);
  background-color: var(--bg);
  scroll-behavior: smooth;
}

body {
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.65;
  position: relative;
  z-index: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background: transparent;
}

/* Selection */
::selection {
  background: rgba(139, 92, 246, 0.4);
  color: #fff;
}

/* Focus */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ===== Links ===== */
a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #ffffff;
  text-decoration: underline;
}

/* ===== Layout ===== */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

.row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.row.between {
  justify-content: space-between;
}

.row.center-y {
  align-items: center;
}

/* ===== Header / Navigation ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 10px 0;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(17, 17, 24, 0.92);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  font-weight: 800;
  letter-spacing: 0.3px;
  padding: 12px 0;
  color: #f4edff;
  font-size: 18px;
  text-decoration: none;
}

.brand-logo {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background-image: url('../img/favicon-32.png');
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  box-shadow: var(--glow-purple);
}

@media (min-resolution: 2dppx) {
  .brand-logo {
    background-image: url('../img/favicon-512.png');
  }
}

.site-nav {
  position: relative;
  display: flex;
  gap: 14px;
  align-items: center;
}

.site-nav .nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease, background 0.15s ease;
  contain: layout;
}

.site-nav .nav-link:hover {
  color: var(--text);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.04);
}

.site-nav .nav-link.is-active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.nav-active {
  position: absolute;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: #ffffff;
  width: 0;
  left: 0;
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.25s ease;
  opacity: 1;
  pointer-events: none;
}

.nav-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.icon-btn {
  height: 44px;
  width: 44px;
  border-radius: 12px;
  display: inline-grid;
  place-items: center;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
  box-shadow: none;
  --btn-magnet-x: 0px;
  --btn-magnet-y: 0px;
  --btn-offset: 0px;
  transform: translate3d(var(--btn-magnet-x), calc(var(--btn-magnet-y) + var(--btn-offset)), 0);
  transition: color 0.15s ease, background 0.15s ease;
  cursor: pointer;
}

.icon-btn:hover {
  --btn-offset: 0px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.icon-btn:active {
  --btn-offset: 0px;
}

.menu-toggle {
  display: none;
}

.menu-toggle svg {
  transition: transform var(--transition-base) ease;
}

.menu-toggle svg path {
  transition: opacity var(--transition-base) ease,
    transform var(--transition-base) ease;
  transform-origin: 50% 50%;
}

.menu-toggle[aria-expanded="true"] svg path:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] svg path:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.menu-toggle[aria-expanded="true"] svg path:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

@media (max-width: 1024px) {
  .site-nav {
    position: fixed;
    right: 12px;
    top: 64px;
    flex-direction: column;
    gap: 4px;
    padding: 10px;
    border-radius: 12px;
    min-width: 180px;
    background: rgba(24, 24, 31, 0.97);
    border: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: opacity var(--transition-base) ease,
      transform var(--transition-base) ease;
  }

  .site-nav.open {
    display: flex;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  .menu-toggle {
    display: inline-grid;
  }
}

/* ===== Buttons ===== */
.btn {
  --btn-bg: rgba(255, 255, 255, 0.04);
  --btn-border: 1px solid var(--border);
  --btn-magnet-x: 0px;
  --btn-magnet-y: 0px;
  --btn-offset: 0px;

  appearance: none;
  user-select: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: var(--btn-pad-y) var(--btn-pad-x);
  border-radius: 10px;
  font-weight: 600;
  font-size: var(--btn-font);
  color: var(--text);
  background: var(--btn-bg);
  border: var(--btn-border);
  box-shadow: none;
  transform: translate3d(var(--btn-magnet-x), calc(var(--btn-magnet-y) + var(--btn-offset)), 0);
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
  --btn-offset: -1px;
  background: rgba(255, 255, 255, 0.08);
  text-decoration: none;
  border-color: rgba(255, 255, 255, 0.12);
}

.btn:active {
  --btn-offset: 0px;
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn.primary {
  --btn-bg: var(--accent);
  --btn-border: 1px solid var(--accent);
  color: #ffffff;
}

.btn.primary:hover {
  --btn-bg: #7c4ddb;
}

.btn.ghost {
  --btn-bg: transparent;
  --btn-border: 1px solid var(--border);
}

.btn.outline {
  --btn-bg: transparent;
  --btn-border: 1px solid rgba(255, 255, 255, 0.12);
}

.btn.xs {
  --btn-pad-y: 12px;
  --btn-pad-x: 14px;
  --btn-font: 12px;
  min-height: 44px;
  min-width: 44px;
}

/* Button Loading State */
.btn.loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn.loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
  to {
    transform: rotate(360deg);
  }
}

/* Standalone Spinner Component */
.spinner {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 3px solid rgba(139, 92, 246, 0.2);
  border-radius: 50%;
  border-top-color: var(--accent);
  animation: spinner 0.8s linear infinite;
}

.spinner.sm {
  width: 20px;
  height: 20px;
  border-width: 2px;
}

.spinner.lg {
  width: 60px;
  height: 60px;
  border-width: 4px;
}

/* ===== Cards & Grids ===== */
.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: none;
  padding: 24px;
  margin: 16px 0;
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.10);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.card h2 {
  margin: 4px 0 8px;
  font-size: clamp(18px, 3.3vw, 26px);
}

.card h3 {
  margin: 14px 0 8px;
  font-size: clamp(16px, 2.8vw, 20px);
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 900px) {
  .grid.cols-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {

  .grid.cols-2,
  .grid.cols-3 {
    grid-template-columns: 1fr;
  }
}

/* ===== Hero ===== */
.hero {
  padding: 48px 0 16px;
}

.hero h1 {
  font-size: clamp(2rem, 5vw + 0.5rem, 3.5rem);
  margin: 0;
  font-weight: 800;
  letter-spacing: -0.3px;
  background: linear-gradient(90deg, #e6d9ff 0%, #c4b5fd 35%, #fca5a5 85%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.subtitle {
  color: var(--muted);
  font-weight: 500;
}

.lead {
  font-size: 17px;
  color: var(--text);
  max-width: 65ch;
  line-height: 1.8;
}

.cta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

/* ===== Background Elements ===== */
.bg-orbs,
#constellation,
#cursor-halo {
  display: none !important;
}

/* Background logo on home */
.home .hero-landing {
  position: relative;
  padding: 34px 0 6px;
}

.home .bg-logo {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 1;
  background: none;
  filter: none;
}

.home .bg-logo::before {
  content: "";
  position: absolute;
  right: clamp(-18vw, -12vw, -8vw);
  top: clamp(-10vw, -6vw, -2vw);
  width: clamp(340px, 48vw, 900px);
  height: clamp(340px, 48vw, 900px);
  opacity: 0.05;
  filter: none;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  mix-blend-mode: luminosity;
  /* Modern browsers: AVIF (smaller file size) */
  background-image: image-set(url('../img/logo/logo1024p.avif') type('image/avif'),
      url('../img/logo/logo1024p.webp') type('image/webp'));
  /* Fallback for browsers without image-set support */
  background-image: url('../img/logo/logo1024p.avif');
  -webkit-mask-image: linear-gradient(90deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.1) 15%, rgba(0, 0, 0, 0.6) 40%, rgba(0, 0, 0, 0.4) 70%, rgba(0, 0, 0, 0) 100%);
  mask-image: linear-gradient(90deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.1) 15%, rgba(0, 0, 0, 0.6) 40%, rgba(0, 0, 0, 0.4) 70%, rgba(0, 0, 0, 0) 100%);
}

@media (max-width: 768px) {
  .home .bg-logo::before {
    width: clamp(240px, 70vw, 420px);
    height: clamp(240px, 70vw, 420px);
    right: -20vw;
    top: -12vw;
    opacity: 0.04;
  }
}

/* ===== Content / Prose ===== */
.prose {
  line-height: 1.8;
  color: var(--text);
  max-width: 65ch;
}

.prose h1,
.prose h2,
.prose h3 {
  margin: 24px 0 12px;
  letter-spacing: -0.2px;
}

.prose h1 {
  font-size: clamp(26px, 4vw, 34px);
}

.prose h2 {
  font-size: clamp(20px, 3vw, 26px);
}

.prose h3 {
  font-size: clamp(18px, 2.5vw, 22px);
}

.prose p {
  margin: 10px 0;
  color: var(--text);
}

.prose .muted,
.muted {
  color: var(--muted);
}

.prose hr {
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin: 24px 0;
}

/* ===== Tables ===== */
table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  overflow: hidden;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  text-align: left;
}

th {
  background: rgba(255, 255, 255, 0.04);
}

/* ===== Spacing Utilities ===== */
.mt-10 { margin-top: 10px !important; }
.mt-16 { margin-top: 16px !important; }
.my-6 { margin-top: 6px !important; margin-bottom: 6px !important; }

/* ===== Code Blocks ===== */
pre {
  background: var(--code);
  border: 1px solid rgba(255, 255, 255, 0.07);
  padding: 14px;
  border-radius: 14px;
  overflow: auto;
  position: relative;
}

code,
pre {
  font-family: "Source Code Pro", "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 13.5px;
}

.copy {
  position: absolute;
  right: 10px;
  top: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #0b1220;
  color: #f2ecff;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.copy:hover {
  background: rgba(124, 58, 237, 0.2);
}

/* ===== Footer ===== */
.site-footer {
  max-width: var(--container);
  margin: 30px auto 60px;
  padding: 0 20px 40px;
  color: var(--muted);
  background: transparent;
}

/* ===== Sections ===== */
.section {
  margin-top: 28px;
  padding: 36px 0;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  opacity: 0.85;
}

.section-title::before {
  content: "";
  width: 24px;
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 1px;
}

.kicker {
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

/* ===== Landing Page Styles ===== */
.hero-landing {
  position: relative;
  padding: 34px 0 6px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 28px;
  align-items: start;
}

@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Interactive Elements ===== */
.interactive {
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.interactive:hover {
  border-color: rgba(255, 255, 255, 0.10);
}

.interactive:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-color: var(--accent);
}

/* ===== Skills & Tools Grid ===== */
.skills-grid,
.tools-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.skill,
.tool {
  --acc: #8b5cf6;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  height: 56px;
  max-height: 56px;
  border-radius: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: none;
  transition: border-color 0.15s ease;
  box-sizing: border-box;
  overflow: hidden;
  min-width: 0;
}

.skill:hover,
.tool:hover {
  border-color: rgba(255, 255, 255, 0.10);
}

.skill:focus-visible,
.tool:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-color: var(--accent);
}

.skill .icon,
.tool .icon {
  font-size: 26px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.35));
}

.skill .label,
.tool .label {
  font-weight: 500;
  color: var(--text);
  flex: 1;
  min-width: 0;
  line-height: 1.2;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.skill a,
.tool a {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  width: 100%;
  height: 100%;
  min-width: 0;
}

.skill a:hover,
.tool a:hover {
  text-decoration: none;
  color: inherit;
}

.skill .imgicon,
.tool .imgicon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

.skill .imgicon img,
.tool .imgicon img {
  width: 26px;
  height: 26px;
  max-width: 26px;
  max-height: 26px;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.35));
  transition: transform 0.18s ease, filter 0.2s ease;
  /* Preserve SVG colors from simpleicons.org */
  color-scheme: light dark;
}

.skill:hover .imgicon img,
.tool:hover .imgicon img {
  transform: scale(1.05);
}

/* ===== Soft Skills ===== */
.soft-skills-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 900px) {
  .soft-skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .soft-skills-grid {
    grid-template-columns: 1fr;
  }
}

.soft-skill {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px;
  border-radius: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  transition: border-color 0.15s ease;
  contain: layout;
}

.soft-skill:hover {
  border-color: rgba(255, 255, 255, 0.10);
}

.soft-skill .ico {
  width: 18px;
  height: 18px;
  opacity: 0.9;
  margin-top: 2px;
  color: var(--accent);
}

.soft-skill h3 {
  margin: 0 0 2px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.soft-skill p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

/* ===== Passions ===== */
.passions {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 800px) {
  .passions {
    grid-template-columns: 1fr;
  }
}

.passion {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px;
  border-radius: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  transition: border-color 0.15s ease;
  contain: layout;
}

.passion.interactive:hover {
  border-color: rgba(255, 255, 255, 0.10);
}

.passion .ico {
  width: 18px;
  height: 18px;
  opacity: 0.9;
  margin-top: 2px;
}

.passion h3 {
  margin: 0 0 2px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.passion p {
  margin: 0;
  color: var(--muted);
}

/* ===== Timeline ===== */
.timeline {
  display: grid;
  gap: 12px;
}

.timeline .entry {
  padding: 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
}

.timeline .when {
  font-size: 12.5px;
  color: var(--muted);
}

.timeline .what {
  font-weight: 700;
}

/* ===== Social Links ===== */
.social {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.social a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s ease;
  contain: layout;
}

.social a:hover {
  border-color: rgba(255, 255, 255, 0.10);
  text-decoration: none;
}

.social svg {
  width: 18px;
  height: 18px;
  opacity: 0.9;
}

/* ===== Projects Grid ===== */
.projects-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 1280px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 700px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
}

.project:hover {
  border-color: rgba(255, 255, 255, 0.10);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

/* ===== Scroll Reveal ===== */
.will-reveal {
  opacity: 0;
  transform: translateY(14px) scale(0.98);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.18, 0.55, 0.15, 1);
  will-change: transform, opacity;
}

.will-reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ===== Performance Optimizations ===== */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .bg-orbs,
  .will-reveal {
    display: none !important;
  }
}

/* ===== Print Styles ===== */
@media print {

  /* Hide decorative and interactive elements */
  .bg-orbs,
  #cursor-halo,
  .nav-active,
  .menu-toggle,
  .skip-link,
  .will-reveal,
  footer {
    display: none !important;
  }

  /* Optimize header */
  .site-header {
    position: static;
    background: none;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
  }

  /* Reset colors for print */
  body {
    background: white;
    color: black;
  }

  .card {
    background: white;
    border: 1px solid #ccc;
    box-shadow: none;
    page-break-inside: avoid;
  }

  /* Show links */
  a[href]:after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    color: #666;
  }

  a[href^="#"]:after,
  a[href^="javascript:"]:after {
    content: "";
  }

  /* Optimize canvas elements */
  canvas {
    max-height: 400px;
    page-break-inside: avoid;
  }

  /* Remove interactions */
  button,
  .btn {
    border: 1px solid #333;
    background: white !important;
    color: black !important;
  }
}

@media (pointer: coarse) {

  .skill:hover,
  .tool:hover,
  .card.interactive:hover,
  .project.interactive:hover,
  .entry.interactive:hover,
  .passion.interactive:hover {
    transform: none;
  }
}

/* ===== P0-2: Fix WCAG Contrast Issues ===== */
/* Override inline styles with low contrast (rgba(235,232,248,0.6) = 2.8:1) */
/* Changed to rgba(235,232,248,0.78) which achieves 4.8:1 contrast on dark backgrounds */
[style*="color:rgba(235,232,248,0.6)"],
[style*="color: rgba(235,232,248,0.6)"] {
  color: rgba(235, 232, 248, 0.78) !important;
}

/* Also update the CSS variable for consistency */
.muted,
.text-muted {
  color: rgba(235, 232, 248, 0.78);
}

/* ===== P0-5: Reduced Motion Support ===== */
/* Honor prefers-reduced-motion for accessibility (WCAG 2.3.3) */
@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;
  }

  /* Disable transform animations but keep layout changes */
  .btn:hover,
  .card:hover,
  .skill:hover,
  .tool:hover {
    transform: none !important;
  }
}