/* ===== DESIGN TOKENS ===== */
:root {
  --c-bg: #0d1117;
  --c-bg-deep: #020617;
  --c-surface: rgba(22, 27, 34, 0.7);
  --c-surface-nav: rgba(22, 27, 34, 0.6);
  --c-border: rgba(255, 255, 255, 0.06);
  --c-border-faint: rgba(255, 255, 255, 0.08);
  --c-border-dark: #30363d;
  --c-text: #e6edf3;
  --c-text-secondary: #c9d1d9;
  --c-text-muted: #8b949e;
  --c-green: #2cea25;
  --c-green-alt: #1bd96a;
  --c-blue: #58a6ff;
  --c-blue-dark: #1f9dff;
  --c-dark: #0d1117;
  --gradient-brand: linear-gradient(90deg, #2cea25, #58a6ff);
  --gradient-btn: linear-gradient(90deg, #2cea25, #1f9dff);
  --radius-card: 16px;
  --radius-btn: 10px;
  --radius-social: 12px;

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --t-fast: 0.18s;
  --t-med: 0.32s;
  --t-slow: 0.55s;
}

/* ===== RESET ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ===== BASE ===== */
html {
  min-height: 100%;
  background: radial-gradient(circle at top, var(--c-bg), var(--c-bg-deep));
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--c-text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Anchored sections (e.g. docs nav) clear the fixed header offset */
[id] {
  scroll-margin-top: 90px;
}

/* ===== PARTICLES BACKGROUND ===== */
#particles-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -3;
  pointer-events: none;
}

/* ===== GLOW BLOBS ===== */
body::before {
  content: "";
  position: fixed;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(44, 234, 37, 0.12), transparent 70%);
  top: -200px;
  left: -200px;
  filter: blur(80px);
  z-index: -2;
  pointer-events: none;
}

body::after {
  content: "";
  position: fixed;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(88, 166, 255, 0.12), transparent 70%);
  bottom: -200px;
  right: -200px;
  filter: blur(80px);
  z-index: -2;
  pointer-events: none;
}

/* ===== HOME BUTTON ===== */
.home-btn {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1000;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--c-surface-nav);
  backdrop-filter: blur(10px);
  color: var(--c-text);
  text-decoration: none;
  font-weight: bold;
  border: 1px solid var(--c-border-faint);
  transition: transform var(--t-fast) var(--ease-out),
              box-shadow var(--t-fast) var(--ease-out),
              border-color var(--t-fast) var(--ease-out);
  line-height: 1;
}

.home-btn:hover {
  transform: scale(1.06);
  border-color: rgba(44, 234, 37, 0.3);
  box-shadow: 0 0 20px rgba(44, 234, 37, 0.45);
}

/* ===== HEADER ===== */
header {
  text-align: center;
  padding: 96px 20px 56px;
}

/* Staggered entrance for the hero on first paint */
@keyframes rise-in {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

header > * {
  animation: rise-in 0.7s var(--ease-out) both;
}

header .status-pill { animation-delay: 0.05s; }
header h1           { animation-delay: 0.13s; }
header .subtitle    { animation-delay: 0.21s; }
header .tagline     { animation-delay: 0.29s; }
header nav          { animation-delay: 0.37s; }

/* ===== STATUS PILL ===== */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 20px;
  background: rgba(44, 234, 37, 0.07);
  border: 1px solid rgba(44, 234, 37, 0.22);
  color: var(--c-green);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 22px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c-green);
  flex-shrink: 0;
  animation: dot-pulse 2.4s ease-in-out infinite;
}

@keyframes dot-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

/* ===== H1 ===== */
h1 {
  font-size: 3.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Prevent gradient bleeding onto emojis */
.emoji {
  -webkit-text-fill-color: initial;
  background: none;
  display: inline-block;
}

.subtitle {
  color: var(--c-text-muted);
  margin-top: 12px;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tagline {
  margin-top: 14px;
  font-size: 1.05rem;
  color: var(--c-text-secondary);
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

/* ===== NAVBAR ===== */
nav {
  margin-top: 36px;
  display: inline-flex;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 12px;
  background: var(--c-surface-nav);
  backdrop-filter: blur(10px);
  border: 1px solid var(--c-border-faint);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.nav-link {
  appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 7px 16px;
  border-radius: 8px;
  color: var(--c-text-muted);
  font-weight: 600;
  font-size: 0.875rem;
  font-family: inherit;
  position: relative;
  transition: color var(--t-fast) var(--ease-smooth),
              background-color var(--t-fast) var(--ease-smooth);
}

.nav-link:hover {
  color: var(--c-text);
  background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
  color: var(--c-text);
  background: rgba(255, 255, 255, 0.08);
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 3px;
  height: 2px;
  background: var(--gradient-brand);
  border-radius: 2px;
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
  transform: scaleX(1);
}

/* ===== SECTIONS WRAPPER ===== */
.sections-wrapper {
  position: relative;
  overflow: hidden;
}

/* ===== PAGE SECTIONS ===== */
.page-section {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t-med) var(--ease-smooth), visibility var(--t-med);
  pointer-events: none;
  padding: 52px 0 80px;
}

.page-section.active {
  position: relative;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Content rises and fades in, staggered, each time a section is shown */
@keyframes section-enter {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.page-section.active > .container > *:not(.achievements-grid):not(.contact-grid):not(.ach-panel) {
  animation: section-enter 0.5s var(--ease-out) backwards;
}

.page-section.active > .container > *:nth-child(1) { animation-delay: 0.04s; }
.page-section.active > .container > *:nth-child(2) { animation-delay: 0.10s; }
.page-section.active > .container > *:nth-child(3) { animation-delay: 0.16s; }
.page-section.active > .container > *:nth-child(4) { animation-delay: 0.22s; }
.page-section.active > .container > *:nth-child(5) { animation-delay: 0.28s; }
.page-section.active > .container > *:nth-child(n+6) { animation-delay: 0.32s; }

/* Grids stagger their own items rather than animating as one block */
.page-section.active .achievements-grid > .card,
.page-section.active .contact-grid > * {
  animation: section-enter 0.5s var(--ease-out) backwards;
}

.page-section.active .achievements-grid > .card:nth-child(1),
.page-section.active .contact-grid > *:nth-child(1) { animation-delay: 0.16s; }
.page-section.active .achievements-grid > .card:nth-child(2),
.page-section.active .contact-grid > *:nth-child(2) { animation-delay: 0.21s; }
.page-section.active .achievements-grid > .card:nth-child(3),
.page-section.active .contact-grid > *:nth-child(3) { animation-delay: 0.26s; }
.page-section.active .achievements-grid > .card:nth-child(4),
.page-section.active .contact-grid > *:nth-child(4) { animation-delay: 0.31s; }
.page-section.active .achievements-grid > .card:nth-child(5),
.page-section.active .contact-grid > *:nth-child(5) { animation-delay: 0.36s; }
.page-section.active .achievements-grid > .card:nth-child(6),
.page-section.active .contact-grid > *:nth-child(6) { animation-delay: 0.41s; }
.page-section.active .achievements-grid > .card:nth-child(7),
.page-section.active .contact-grid > *:nth-child(7) { animation-delay: 0.46s; }
.page-section.active .achievements-grid > .card:nth-child(n+8),
.page-section.active .contact-grid > *:nth-child(n+8) { animation-delay: 0.50s; }

/* ===== ACHIEVEMENT INNER TABS ===== */
.ach-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 5px 8px;
  border-radius: 12px;
  background: var(--c-surface-nav);
  backdrop-filter: blur(10px);
  border: 1px solid var(--c-border-faint);
  margin-top: 20px;
  animation: section-enter 0.5s var(--ease-out) 0.16s backwards;
}

.ach-tab {
  appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 6px 16px;
  border-radius: 8px;
  color: var(--c-text-muted);
  font-weight: 600;
  font-size: 0.82rem;
  font-family: inherit;
  position: relative;
  transition: color var(--t-fast) var(--ease-smooth),
              background-color var(--t-fast) var(--ease-smooth);
}

.ach-tab:hover {
  color: var(--c-text);
  background: rgba(255, 255, 255, 0.05);
}

.ach-tab.active {
  color: var(--c-text);
  background: rgba(255, 255, 255, 0.08);
}

.ach-tab::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 3px;
  height: 2px;
  background: var(--gradient-brand);
  border-radius: 2px;
  transform: scaleX(0);
  transition: transform 0.3s var(--ease-out);
}

.ach-tab.active::after {
  transform: scaleX(1);
}

/* Panel visibility — JS toggles [hidden] */
.ach-panel[hidden] {
  display: none;
}

/* Animation when switching panels */
@keyframes panel-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ach-panel.panel-entering > *,
.ach-panel.panel-entering .achievements-grid > .card {
  animation: panel-in 0.4s var(--ease-out) backwards;
}

.ach-panel.panel-entering > *:nth-child(1) { animation-delay: 0.00s; }
.ach-panel.panel-entering > *:nth-child(2) { animation-delay: 0.06s; }
.ach-panel.panel-entering > *:nth-child(3) { animation-delay: 0.12s; }
.ach-panel.panel-entering > *:nth-child(n+4) { animation-delay: 0.16s; }

.ach-panel.panel-entering .achievements-grid > .card:nth-child(1)  { animation-delay: 0.14s; }
.ach-panel.panel-entering .achievements-grid > .card:nth-child(2)  { animation-delay: 0.19s; }
.ach-panel.panel-entering .achievements-grid > .card:nth-child(3)  { animation-delay: 0.24s; }
.ach-panel.panel-entering .achievements-grid > .card:nth-child(4)  { animation-delay: 0.29s; }
.ach-panel.panel-entering .achievements-grid > .card:nth-child(5)  { animation-delay: 0.34s; }
.ach-panel.panel-entering .achievements-grid > .card:nth-child(6)  { animation-delay: 0.39s; }
.ach-panel.panel-entering .achievements-grid > .card:nth-child(n+7) { animation-delay: 0.44s; }

/* ===== SECTION HEADINGS ===== */
.page-section > .container > h2 {
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-section > .container > h2::before {
  content: "";
  flex-shrink: 0;
  width: 3px;
  height: 1.3em;
  background: var(--gradient-brand);
  border-radius: 3px;
}

.section-desc {
  color: var(--c-text-muted);
  margin-bottom: 4px;
  padding-left: 15px;
}

/* ===== CONTAINER ===== */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== CARD ===== */
.card {
  background: var(--c-surface);
  backdrop-filter: blur(10px);
  padding: 28px 30px;
  border-radius: var(--radius-card);
  margin-top: 20px;
  border: 1px solid var(--c-border);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
  transition: transform var(--t-med) var(--ease-out),
              box-shadow var(--t-med) var(--ease-out),
              border-color var(--t-med) var(--ease-out);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 38px rgba(44, 234, 37, 0.12);
  border-color: rgba(44, 234, 37, 0.18);
}

.card h2,
.card h3 {
  margin-bottom: 10px;
}

/* ===== CARD LISTS ===== */
.card ul {
  text-align: left;
  margin-top: 12px;
  line-height: 1.9;
  color: var(--c-text-secondary);
  list-style: none;
  padding: 0;
}

/* ===== PROJECT CARD ===== */
.project-card {
  transition: transform var(--t-med) var(--ease-out),
              box-shadow var(--t-med) var(--ease-out),
              border-color var(--t-med) var(--ease-out);
}

.project-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 48px rgba(44, 234, 37, 0.18);
  border-color: rgba(44, 234, 37, 0.22);
}

/* ===== PROJECT META ROW ===== */
.project-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
  gap: 12px;
}

.project-num {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--c-text-muted);
  padding-top: 2px;
  flex-shrink: 0;
}

/* ===== TECH TAGS ===== */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: flex-end;
}

.tag {
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: rgba(44, 234, 37, 0.07);
  border: 1px solid rgba(44, 234, 37, 0.2);
  color: var(--c-green);
  white-space: nowrap;
}

.tag.blue {
  background: rgba(88, 166, 255, 0.07);
  border-color: rgba(88, 166, 255, 0.2);
  color: var(--c-blue);
}

.tag.gray {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--c-border-dark);
  color: var(--c-text-muted);
}

.tag.red {
  background: rgba(255, 0, 0, 0.07);
  border-color: rgba(255, 0, 0, 0.2);
  color: #ff4d4d;
}

.tag.cyan {
  background: rgba(0, 255, 255, 0.07);
  border-color: rgba(0, 255, 255, 0.2);
  color: #00ffff;
}

.tag.gold {
  background: rgba(255, 215, 0, 0.07);
  border-color: rgba(255, 215, 0, 0.2);
  color: #ffbb00;
}

.tag.white {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

/* ===== PROJECT LINKS ===== */
.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 20px;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 4px 4px;
  padding: 10px 20px;
  border-radius: var(--radius-btn);
  background: var(--gradient-btn);
  color: white;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.875rem;
  border: none;
  cursor: pointer;
  transition: transform var(--t-fast) var(--ease-out),
              box-shadow var(--t-fast) var(--ease-out),
              filter var(--t-fast) var(--ease-out);
  box-shadow: 0 0 16px rgba(44, 234, 37, 0.28);
}

.btn.secondary {
  background: var(--c-border-dark);
  box-shadow: none;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(44, 234, 37, 0.5);
  filter: brightness(1.05);
}

.btn:active {
  transform: translateY(0) scale(0.98);
}

.btn.secondary:hover {
  box-shadow: 0 4px 16px rgba(255, 255, 255, 0.1);
  filter: brightness(1.15);
}

/* ===== ACTION BAR (centered button group) ===== */
.action-bar {
  text-align: center;
  padding: 0 20px 16px;
}

/* ===== SOCIAL BUTTONS ===== */
.social-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  margin: 8px 6px;
  border-radius: var(--radius-social);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  color: white;
  position: relative;
  background: var(--c-dark);
  border: 1px solid var(--c-border-dark);
  transition: transform var(--t-fast) var(--ease-out),
              box-shadow var(--t-fast) var(--ease-out);
}

.social-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-social);
  padding: 1px;
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
}

.social-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.github-btn::before    { background: linear-gradient(90deg, #2cea25, #58a6ff, #2cea25); }
.github-btn:hover      { box-shadow: 0 0 25px rgba(88, 166, 255, 0.5); transform: scale(1.04); }

.instagram-btn::before { background: linear-gradient(90deg, #f58529, #dd2a7b, #8134af, #515bd4); }
.instagram-btn:hover   { box-shadow: 0 0 25px rgba(221, 42, 123, 0.5); transform: scale(1.04); }

.modrinth-btn::before  { background: linear-gradient(90deg, #1bd96a, #2cea25, #1bd96a); }
.modrinth-btn:hover    { box-shadow: 0 0 25px rgba(27, 217, 106, 0.5); transform: scale(1.04); }

/* ===== SOCIALS CONTAINER (subpages) ===== */
.socials {
  text-align: center;
  margin-top: 32px;
}

/* ===== CONTACT GRID ===== */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 28px;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  border-radius: 14px;
  text-decoration: none;
  color: white;
  position: relative;
  background: var(--c-dark);
  border: 1px solid var(--c-border-dark);
  transition: transform var(--t-med) var(--ease-out),
              box-shadow var(--t-med) var(--ease-out);
}

.contact-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 14px;
  padding: 1px;
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
}

.contact-card .social-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.contact-card strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--c-text);
}

.contact-card small {
  display: block;
  font-size: 0.76rem;
  color: var(--c-text-muted);
  margin-top: 2px;
}

.contact-github::before    { background: linear-gradient(90deg, #2cea25, #58a6ff, #2cea25); }
.contact-github:hover      { box-shadow: 0 0 24px rgba(88, 166, 255, 0.4); transform: translateY(-4px); }

.contact-instagram::before { background: linear-gradient(90deg, #f58529, #dd2a7b, #8134af, #515bd4); }
.contact-instagram:hover   { box-shadow: 0 0 24px rgba(221, 42, 123, 0.4); transform: translateY(-4px); }

.contact-modrinth::before  { background: linear-gradient(90deg, #1bd96a, #2cea25, #1bd96a); }
.contact-modrinth:hover    { box-shadow: 0 0 24px rgba(27, 217, 106, 0.4); transform: translateY(-4px); }

.contact-codeforces::before { background: linear-gradient(90deg, #1f8dd6, #e84d3d, #1f8dd6); }
.contact-codeforces:hover   { box-shadow: 0 0 24px rgba(232, 77, 61, 0.4); transform: translateY(-4px); }

.contact-leetcode::before  { background: linear-gradient(90deg, #ffa116, #f0a500, #ffa116); }
.contact-leetcode:hover    { box-shadow: 0 0 24px rgba(255, 161, 22, 0.4); transform: translateY(-4px); }

.contact-neps::before      { background: linear-gradient(90deg, #4a90d9, #1a6fb5, #4a90d9); }
.contact-neps:hover        { box-shadow: 0 0 24px rgba(74, 144, 217, 0.4); transform: translateY(-4px); }

.contact-discord::before   { background: linear-gradient(90deg, #5865f2, #7289da, #5865f2); }
.contact-discord:hover     { box-shadow: 0 0 24px rgba(88, 101, 242, 0.4); transform: translateY(-4px); }
.contact-discord           { opacity: 0.6; cursor: default; pointer-events: none; }

/* ===== INLINE CODE ===== */
code {
  background: rgba(110, 118, 129, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.875em;
  font-family: "Fira Code", "Cascadia Code", Consolas, "Courier New", monospace;
}

/* ===== CODE BLOCKS ===== */
pre {
  background: var(--c-dark);
  padding: 16px 20px;
  border-radius: 10px;
  overflow-x: auto;
  margin-top: 16px;
  border: 1px solid var(--c-border-dark);
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--c-text-secondary);
  font-family: "Fira Code", "Cascadia Code", Consolas, "Courier New", monospace;
}

/* ===== REPO STATS ===== */
.repo-stats {
  text-align: center;
  margin-bottom: 32px;
  color: var(--c-text-muted);
  font-size: 0.875rem;
}

.repo-stats span,
.repo-stats a {
  margin: 0 10px;
  display: inline-block;
}

.repo-stats a {
  color: var(--c-blue);
  text-decoration: none;
}

.repo-stats a:hover {
  text-decoration: underline;
}

/* ===== MEDAL SUMMARY ===== */
.medal-summary {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.medal-summary-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 22px;
  border-radius: 12px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  backdrop-filter: blur(10px);
  transition: transform var(--t-med) var(--ease-out),
              box-shadow var(--t-med) var(--ease-out);
}

.medal-summary-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.medal-summary-count {
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1;
}

.medal-summary-label {
  font-size: 0.78rem;
  font-weight: 500;
  opacity: 0.75;
}

.medal-summary-item.national { border-color: rgba(255, 255, 255, 1.0); }
.medal-summary-item.national .medal-summary-count { color: #00eeff; }
.medal-summary-item.national .medal-summary-label { color: #75cac0; }

.medal-summary-item.world { border-color: rgba(188, 140, 255, 0.28); }
.medal-summary-item.world .medal-summary-count { color: #bc8cff; }
.medal-summary-item.world .medal-summary-label { color: #bc8cff; }

.medal-summary-item.gold { border-color: rgba(255, 215, 0, 0.18); }
.medal-summary-item.gold .medal-summary-count { color: #ffcc00; }
.medal-summary-item.gold .medal-summary-label { color: #ffcc00; }

.medal-summary-item.silver { border-color: rgba(192, 192, 192, 0.18); }
.medal-summary-item.silver .medal-summary-count { color: #c8c8c8; }
.medal-summary-item.silver .medal-summary-label { color: #c8c8c8; }

.medal-summary-item.bronze { border-color: rgba(205, 127, 50, 0.18); }
.medal-summary-item.bronze .medal-summary-count { color: #cd7f32; }
.medal-summary-item.bronze .medal-summary-label { color: #cd7f32; }

/* ===== ACHIEVEMENTS GRID ===== */
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 20px;
}

.achievement-wide {
  grid-column: 1 / -1;
}

.achievement-wide .medal-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 32px;
  margin-top: 16px;
}

.achievement-acronym {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.achievement-fullname {
  font-size: 0.72rem;
  color: var(--c-text-secondary);
  margin-top: 1px;
  line-height: 1.35;
}

.achievement-subtitle {
  font-size: 0.75rem;
  color: var(--c-text-muted);
  margin-top: 2px;
}

.achievement-note {
  font-size: 0.72rem;
  color: #ffa116;
  margin-top: 6px;
  opacity: 0.85;
}

/* ===== MEDAL LIST ===== */
.medal-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.medal-entry {
  display: flex;
  align-items: center;
  gap: 10px;
}

.medal-group-label {
  grid-column: 1 / -1;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-text-secondary);
  padding-bottom: 5px;
  margin-top: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.medal-group-label:first-child {
  margin-top: 0;
}

.medal-group-label .medal-group-place {
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--c-text-muted);
}

.medal-year {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--c-text-secondary);
  min-width: 36px;
}

.medal-badge {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.medal-badge.national {
  background: rgba(0, 255, 255, 0.1);
  border: 1px solid rgba(0, 255, 255, 0.25);
  color: #00ffff;
}

.medal-badge.world {
  background: rgba(188, 140, 255, 0.1);
  border: 1px solid rgba(188, 140, 255, 0.3);
  color: #bc8cff;
}

.medal-badge.gold {
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid rgba(255, 215, 0, 0.25);
  color: #ffcc00;
}

.medal-badge.silver {
  background: rgba(192, 192, 192, 0.1);
  border: 1px solid rgba(192, 192, 192, 0.28);
  color: #c8c8c8;
}

.medal-badge.bronze {
  background: rgba(205, 127, 50, 0.1);
  border: 1px solid rgba(205, 127, 50, 0.28);
  color: #cd7f32;
}

.medal-badge.lost {
  background: rgba(255, 0, 0, 0.08);
  border: 1px solid rgba(255, 0, 0, 0.22);
  color: #ff5555;
}

.medal-badge.phase {
  background: rgba(88, 166, 255, 0.08);
  border: 1px solid rgba(88, 166, 255, 0.22);
  color: var(--c-blue);
}

.medal-badge.participant {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--c-text-muted);
}

.medal-entry-label {
  flex: 1;
  font-size: 0.8rem;
  color: var(--c-text-muted);
  min-width: 0;
}

/* ===== FOOTER ===== */
footer {
  text-align: center;
  padding: 40px 20px;
  color: var(--c-text-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--c-border);
  margin-top: 60px;
}

/* ===== ACCESSIBILITY ===== */
:focus-visible {
  outline: 2px solid var(--c-blue);
  outline-offset: 3px;
  border-radius: 3px;
}

/* ===== MOBILE ===== */
@media (max-width: 640px) {
  h1 { font-size: 2.4rem; }

  header { padding: 80px 16px 48px; }

  .card { padding: 20px 18px; }

  nav {
    gap: 2px;
    padding: 5px 8px;
  }

  .nav-link {
    padding: 6px 11px;
    font-size: 0.82rem;
  }

  .btn,
  .social-btn {
    padding: 10px 18px;
    font-size: 0.875rem;
  }

  .page-section {
    padding: 32px 0 60px;
  }

  .contact-grid,
  .achievements-grid {
    grid-template-columns: 1fr;
  }

  .achievement-wide .medal-list {
    grid-template-columns: 1fr;
  }

  .tags {
    justify-content: flex-start;
    margin-top: 8px;
  }

  .project-meta {
    flex-direction: column;
  }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.001ms !important;
  }
}
