/* ============================================================
   THEME — shared, base-page-loaded design layer
   Loaded by layouts/page.njk so every page inherits it. Holds
   the reusable site theme: layout primitive, section headers,
   text treatments, chips/tags, the card surface + hover effect,
   plus text-selection and keyboard-focus styling.
   Page-specific CSS lives in each page's own stylesheet.
   ============================================================ */

/* ── Text selection ─────────────────────────────────────────── */
::selection {
  background: var(--primary-glow);
  color: var(--text-primary);
}

/* ── Keyboard focus ─────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ── Layout primitive ───────────────────────────────────────── */
.container {
  position: relative;
  z-index: 1;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================================
   SECTION HEADERS
   ============================================================ */
.section-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 40px;
  font-family: var(--font-mono);
}
.section-header h2 {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}
.section-header .line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--primary), transparent);
}
.section-header .num {
  color: var(--primary);
  font-size: 0.9rem;
}

/* ============================================================
   TEXT TREATMENTS
   ============================================================ */
/* Animated gradient heading */
.gradient-text,
.hero-name {
  background: linear-gradient(135deg, #fff 0%, var(--primary) 50%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 6s ease infinite;
  background-size: 200% 200%;
}
@keyframes gradientShift {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}
/* Mono subtitle with glow */
.text-glow,
.hero-title {
  font-family: var(--font-mono);
  color: var(--primary);
  text-shadow:
    0 0 20px var(--primary-glow),
    0 0 40px var(--primary-glow);
}

/* ============================================================
   SITE LOGO — reusable DZ brand mark (see macros/logo.njk)
   Square by design (favicon viewBox 32×32). Size is driven by
   the --site-logo-size custom property: set it inline via the
   siteLogo() macro, or from a context rule. Defaults to 2rem
   for standalone use.
   ============================================================ */
.site-logo {
  width: var(--site-logo-size, 2rem);
  height: var(--site-logo-size, 2rem);
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
  object-fit: contain;
}

/* ── Scroll indicator ───────────────────────────────────────── */
.scroll-indicator {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  animation: float 2s ease-in-out infinite;
}
.scroll-indicator svg {
  color: var(--text-muted);
}
@keyframes float {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(10px);
  }
}

/* ============================================================
   CHIPS
   ============================================================ */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 50px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: all 0.3s;
  backdrop-filter: blur(10px);
}
.chip:hover {
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 8px 32px 0 rgba(0, 212, 255, 0.2);
  transform: translateY(-2px);
}
.chip svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Brand icons in chips via mask-image (CDN auto-updated) */
.chip-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  background-color: currentColor;
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
}
.chip-icon--linkedin {
  -webkit-mask-image: url('https://cdn.jsdelivr.net/npm/simple-icons@latest/icons/linkedin.svg');
  mask-image: url('https://cdn.jsdelivr.net/npm/simple-icons@latest/icons/linkedin.svg');
}
.chip-icon--github {
  -webkit-mask-image: url('https://cdn.jsdelivr.net/npm/simple-icons@latest/icons/github.svg');
  mask-image: url('https://cdn.jsdelivr.net/npm/simple-icons@latest/icons/github.svg');
}
.chip:hover .chip-icon--linkedin {
  background-color: #0A66C2;
}
.chip:hover .chip-icon--github {
  background-color: #ffffff;
}

/* ============================================================
   TAGS
   ============================================================ */
.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.skill-tag {
  display: inline-block;
  padding: 4px 10px;
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid rgba(0, 212, 255, 0.15);
  border-radius: 4px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  transition: all 0.3s;
}
.skill-tag:hover {
  background: rgba(0, 212, 255, 0.15);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 0 8px var(--primary-glow);
}

/* ============================================================
   GRID
   ============================================================ */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

/* ============================================================
   CARD — surface + mouse-glow / lift hover effect
   `.theme-card` is the generic class for any page; the CV's
   `.skill-card` shares the same surface and effect (its content
   layout and colour variants stay in components.css).
   ============================================================ */
.theme-card,
.skill-card {
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  transition: all 0.4s ease;
  backdrop-filter: blur(10px);
  position: relative;
  /* `clip` (not `hidden`) so the card does not become a scroll container —
     otherwise scrollIntoView on inner headings scrolls the card's internal
     content and clips the icon above the heading. */
  overflow: clip;
  perspective: 1000px;
}
.theme-card:hover,
.skill-card:hover {
  border-color: var(--primary);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  /* The default transform is defined here; JS overrides it
     dynamically on the CV skill cards when supported. */
  transform: translateY(-4px) rotateX(2deg);
}
.theme-card::before,
.skill-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: radial-gradient(800px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255,255,255,0.06), transparent 40%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
@media (hover: hover) and (pointer: fine) {
  .theme-card:hover::before,
  .skill-card:hover::before {
    opacity: 1;
  }
}
.theme-card::after,
.skill-card::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, var(--primary-glow) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}
.theme-card:hover::after,
.skill-card:hover::after {
  opacity: 0.15;
}

/* Flat panel surface — the same themed surface as `.theme-card` but
   with no interactive hover / 3D-tilt / mouse-glow. For control
   panels that host forms, tables and buttons rather than display
   cards. */
.theme-panel {
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  backdrop-filter: blur(10px);
}
