:root {
  --bg-color: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --wiki-blue: #2563eb;
  --wiki-blue-hover: #1d4ed8;
  --border-color: #cbd5e1;
  --tag-bg: #f1f5f9;
}

body {
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-main);
  background-color: var(--bg-color);
  max-width: 760px;
  margin: 60px auto;
  padding: 0 24px;
}

/* Modernized Wikipedia Article Title */
h1.wiki-heading {
  font-family: Garamond, Georgia, serif;
  font-size: 2.2rem;
  font-weight: normal;
  color: #0f172a;
  margin: 0 0 24px 0;
}

/* Unified Composite Panel Layout */
.wiki-composite-panel {
  border-left: 3px solid var(--wiki-blue);
  border-bottom: 1px solid var(--wiki-blue);
  background-color: var(--tag-bg);
  border-radius: 6px 6px 0 0;
  margin-bottom: 30px;
}

/* Minimal Modern Meta Ribbon */
.wiki-meta-ribbon {
  padding: 16px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid rgba(203, 213, 225, 0.6);
}

.wiki-profile-wrapper {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
}

/* Upgraded Profile Image Frame */
.wiki-profile-img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #ffffff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
  display: block;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Interactive Active Contributor Pill Tag Overlay */
.active-contributor-tag {
  text-align: center;
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%) scale(1);
  white-space: nowrap;
  background-color: #277cd1;
  color: #ffffff;
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 10px;
  border: 1.5px solid #ffffff;
  box-shadow: 0 2px 6px rgba(39, 124, 209, 0.3);
  user-select: none;
  cursor: help;
  transform-origin: center center;
  will-change: transform, background-color;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Combined Hover Micro-Interactions */
.wiki-profile-wrapper:hover .wiki-profile-img {
  transform: scale(1.04);
  box-shadow: 0 6px 16px rgba(39, 124, 209, 0.2);
}

.wiki-profile-wrapper:hover .active-contributor-tag {
  background-color: #1d6fa5;
  box-shadow: 0 4px 10px rgba(39, 124, 209, 0.45);
  transform: translateX(-50%) scale(1.08) translateY(-1px);
}

.wiki-meta-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* .wiki-meta-ribbon span {
  color: var(--text-muted);
} */

.wiki-meta-ribbon strong {
  color: var(--text-main);
}

/* Attached Action Bar Accordion Style */
.wiki-accordion {
  width: 100%;
}

.wiki-accordion summary {
  font-family: system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-main);
  cursor: pointer;
  user-select: none;
  outline: none;
  padding: 10px 16px;
  background-color: #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color 0.2s ease;
}

.wiki-accordion summary:hover {
  background-color: #cbd5e1;
  color: var(--wiki-blue);
}

/* Dynamic CSS Toggling Logic */
.accordion-status {
  font-size: 12px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
  color: var(--text-muted);
}

.wiki-accordion:not([open]) .accordion-status::before {
  content: "[Open]";
}

.wiki-accordion[open] .accordion-status::before {
  content: "[Close]";
}

/* Inner Content Paragraph inside panel */
.wiki-accordion p {
  margin: 0;
  padding: 16px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text-main);
  background-color: var(--tag-bg);
}

/* Inline Areas of Interest Row Container */
.panel-interests-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background-color: var(--tag-bg);
  border-top: 1px solid rgba(203, 213, 225, 0.6);
  flex-wrap: wrap; /* Ensures fluid layout on lower responsive viewport sizes */
}

.panel-section-title {
  font-family: system-ui, sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.75px;
  color: var(--text-muted);
  white-space: nowrap; /* Forces title to stay fixed on a single text line */
}

.badge-container {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.wiki-badge {
  position: relative;
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 20px;
  cursor: help;
  transition: all 0.2s ease;
}

.wiki-badge:hover {
  background-color: var(--wiki-blue);
  border-color: var(--wiki-blue);
  color: #ffffff;
}

/* Absolute Popups with High-Level Stack Layering */
.wiki-badge::after {
  content: attr(data-details);
  position: absolute;
  bottom: 135%;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background-color: #0f172a;
  color: #ffffff;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: normal;
  line-height: 1.5;
  border-radius: 6px;
  width: 260px;
  white-space: normal;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition:
    opacity 0.15s ease,
    transform 0.15s ease;
  z-index: 2147483647; /* Highest standard value to ensure visibility above parent boxes */
}

.wiki-badge::before {
  content: "";
  position: absolute;
  bottom: 120%;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  border-width: 6px;
  border-style: solid;
  border-color: #0f172a transparent transparent transparent;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition:
    opacity 0.15s ease,
    transform 0.15s ease;
  z-index: 2147483647;
}

.wiki-badge:hover::after,
.wiki-badge:hover::before {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Content Sections Styling Outside Card */
h2 {
  font-family: Garamond, Georgia, serif;
  font-size: 1.6rem;
  font-weight: normal;
  color: #0f172a;
  margin-top: 40px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 6px;
}

a {
  color: var(--wiki-blue);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--wiki-blue-hover);
  text-decoration: underline;
}

ol {
  padding-left: 20px;
  margin-bottom: 24px;
}

li {
  margin-bottom: 10px;
}

.wiki-categories {
  margin-top: 60px;
  padding: 10px 14px;
  border: 1px dashed var(--border-color);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-muted);
}

/* Impact Section Layout Dashboard */
.wiki-stat-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  flex: 1 1 160px;
  max-width: calc(50% - 6px);
  background-color: var(--tag-bg);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

@media (max-width: 380px) {
  .stat-card {
    max-width: 100%;
  }
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.05);
  border-color: var(--wiki-blue);
}

.stat-icon {
  font-size: 20px;
  background: #ffffff;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border-color);
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
}

/* Article Impact List Formatting */
.wiki-article-list-header {
  font-family: system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-top: 24px;
  margin-bottom: 10px;
}

.wiki-article-list {
  border: 1px solid var(--border-color);
  border-radius: 6px;
  overflow: hidden;
  background-color: #ffffff;
}

.article-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.15s ease;
}

.article-row:last-child {
  border-bottom: none;
}

.article-row:hover {
  background-color: var(--tag-bg);
}

.article-title {
  font-weight: 500;
  color: var(--text-main);
  font-size: 14px;
}

.article-metrics {
  display: flex;
  align-items: center;
  gap: 12px;
}

.view-count {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  font-weight: 500;
}

.sparkline {
  font-size: 14px;
  opacity: 0.75;
}

.location-badge-tag {
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  background-color: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
  padding: 3px 8px;
  border-radius: 12px; /* Smooth curved pill structure */
  display: inline-flex;
  align-items: center;
  transition: all 0.15s ease;
}

.article-row:hover .location-badge-tag {
  background-color: #ffffff;
  border-color: var(--wiki-blue);
  color: var(--wiki-blue);
}

.location-badge-tag-active {
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background-color: #277cd1;
  color: #ffffff;
  border: 1px solid #0e53a7;
  padding: 3px 10px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  user-select: none;

  /* Layering setup to keep text above the custom effects */
  z-index: 1;

  /* Hardware-accelerated transformations for buttery smooth 60fps renders */
  transform: translateZ(0);
  will-change: transform, box-shadow;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);

  /* Ambient micro-pulse on initial display */
  animation: badge-entrance-pulse 2s infinite ease-in-out;
}

/* 1. Interactive Hover State (Scale & Drop Shadow Lift) */
.location-badge-tag-active:hover {
  transform: translateY(-2px) scale(1.03);
  background-color: #1d6fa5;
  border-color: #0b3e7e;
  box-shadow:
    0 4px 12px rgba(39, 124, 209, 0.4),
    0 0 0 3px rgba(39, 124, 209, 0.15);
}

/* 2. Tactile Click/Active Feedback State */
.location-badge-tag-active:active {
  transform: translateY(0) scale(0.96);
  box-shadow: 0 2px 6px rgba(39, 124, 209, 0.3);
  transition: all 0.05s linear;
}

/* 3. Pure CSS Metallic Gloss Shimmer Effect on Hover */
.location-badge-tag-active::before {
  content: "";
  position: absolute;
  top: 0;
  left: -150%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.35) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: skewX(-25deg);
  z-index: -1;
  transition: none;
}

.location-badge-tag-active:hover::before {
  left: 150%;
  transition: left 0.65s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Animation Keyframes */
@keyframes badge-entrance-pulse {
  0%,
  100% {
    box-shadow: 0 2px 6px rgba(39, 124, 209, 0.2);
  }
  50% {
    box-shadow:
      0 2px 10px rgba(39, 124, 209, 0.35),
      0 0 0 2px rgba(39, 124, 209, 0.1);
  }
}

/* ==========================================
   CONTACT SECTION & FOOTER STYLES
   ========================================== */

.wiki-contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 16px;
  margin-bottom: 40px;
}

.contact-card-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background-color: var(--tag-bg);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  text-decoration: none !important; /* Overrides global link underlines */
  transition: all 0.2s ease;
}

.contact-card-link:hover {
  background-color: #ffffff;
  border-color: var(--wiki-blue);
  box-shadow: 0 4px 12px rgba(39, 124, 209, 0.08);
  transform: translateY(-1px);
}

.contact-card-link .contact-icon {
  font-size: 20px;
  width: 38px;
  height: 38px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.contact-card-link:hover .contact-icon {
  border-color: var(--wiki-blue);
  background-color: var(--tag-bg);
}

.contact-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.contact-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.contact-value {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-main);
  word-break: break-all;
}

.contact-card-link:hover .contact-value {
  color: var(--wiki-blue);
}

/* ==========================================
   WIKIPEDIA PORTFOLIO FOOTER DESIGN SYSTEM
   ========================================== */

.wiki-footer {
  margin-top: 80px;
  padding: 32px 0 40px 0;
  border-top: 1px solid var(--border-color);
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  background-color: transparent;
}

/* Flex Container for responsive partitioning */
.footer-container {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  flex-wrap: wrap; /* Wraps cleanly into a single unified column on small screens */
}

/* Left block text engine */
.footer-content-block {
  flex: 1;
  min-width: 280px;
}

.footer-timestamp {
  font-size: 12px;
  color: var(--text-main);
  font-weight: 500;
  margin: 0 0 6px 0;
}

.footer-legal {
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0 0 16px 0;
}

.footer-legal a {
  color: var(--wiki-blue);
  text-decoration: none;
}

.footer-legal a:hover {
  text-decoration: underline;
}

/* Micro-links cluster */
.footer-meta-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 11.5px;
}

.footer-meta-links a {
  color: #475569;
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-meta-links a:hover {
  color: var(--wiki-blue);
  text-decoration: underline;
}

/* Add bullet separators dynamically via CSS between links */
.footer-meta-links a:not(:last-child)::after {
  content: " •";
  margin-left: 12px;
  color: #cbd5e1;
  display: inline-block;
  pointer-events: none;
}

/* Right block badge layouts */
.footer-badges-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}

/* Clean, two-tone structured layout pills matching real developer badges */
.footer-badge-pill {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  overflow: hidden;
  user-select: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.badge-prefix {
  background-color: #475569;
  color: #ffffff;
  padding: 3px 8px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-value {
  background-color: var(--tag-bg);
  color: var(--text-main);
  padding: 3px 10px;
}

/* Distinct color tweaks for your specialized signature */
.signature-badge {
  border-color: #cbd5e1;
}

.signature-badge .badge-prefix {
  background-color: var(--wiki-blue);
}

/* Tablet & Mobile View Alignment Rules */
@media (max-width: 768px) {
  .footer-container {
    flex-direction: column;
    gap: 24px;
  }

  .footer-badges-block {
    align-items: flex-start;
    flex-direction: row;
    width: 100%;
  }

  .footer-meta-links a:not(:last-child)::after {
    display: none; /* Drop static spacing rules on small phone widths */
  }

  .footer-meta-links {
    gap: 8px 16px;
  }
}
