/* ==========================================================================
   Roman Ekimov - Modern Portfolio & CV Styles
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Variables & Themes
   -------------------------------------------------------------------------- */
:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Dark Theme (Default) */
[data-theme="dark"] {
  --bg-body: #090d16;
  --bg-nav: rgba(9, 13, 22, 0.85);
  --bg-surface: #101726;
  --bg-surface-elevated: #182238;
  --bg-surface-hover: #1e2b47;
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --border-color: #1e293b;
  --border-subtle: rgba(255, 255, 255, 0.07);
  
  --accent-primary: #38bdf8;
  --accent-secondary: #818cf8;
  --accent-glow: rgba(56, 189, 248, 0.15);
  --accent-gradient: linear-gradient(135deg, #38bdf8 0%, #818cf8 100%);
  
  --badge-bg: rgba(56, 189, 248, 0.1);
  --badge-text: #7dd3fc;
  --badge-border: rgba(56, 189, 248, 0.25);
  
  --timeline-line: #1e293b;
  --card-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.4);

  /* Ambient background (k8s hex lattice + terminal grid) */
  --bg-hex-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='100' viewBox='0 0 56 100'%3E%3Cg fill='none' stroke='%2338bdf8' stroke-width='1.1'%3E%3Cpath d='M28 66L0 50L0 16L28 0L56 16L56 50L28 66L28 100'/%3E%3Cpath d='M28 0L28 34L0 50M28 34L56 50'/%3E%3C/g%3E%3C/svg%3E");
  --bg-hex-opacity: 0.07;
  --bg-grid-line: rgba(148, 163, 184, 0.055);
  --bg-glow-a: rgba(56, 189, 248, 0.11);
  --bg-glow-b: rgba(129, 140, 248, 0.09);
}

/* Light Theme */
[data-theme="light"] {
  --bg-body: #f8fafc;
  --bg-nav: rgba(248, 250, 252, 0.88);
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f1f5f9;
  --bg-surface-hover: #e2e8f0;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  
  --border-color: #e2e8f0;
  --border-subtle: rgba(0, 0, 0, 0.06);
  
  --accent-primary: #0284c7;
  --accent-secondary: #4f46e5;
  --accent-glow: rgba(2, 132, 199, 0.1);
  --accent-gradient: linear-gradient(135deg, #0284c7 0%, #4f46e5 100%);
  
  --badge-bg: #f0f9ff;
  --badge-text: #0369a1;
  --badge-border: #bae6fd;
  
  --timeline-line: #e2e8f0;
  --card-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05);

  /* Ambient background (k8s hex lattice + terminal grid) */
  --bg-hex-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='100' viewBox='0 0 56 100'%3E%3Cg fill='none' stroke='%230284c7' stroke-width='1.1'%3E%3Cpath d='M28 66L0 50L0 16L28 0L56 16L56 50L28 66L28 100'/%3E%3Cpath d='M28 0L28 34L0 50M28 34L56 50'/%3E%3C/g%3E%3C/svg%3E");
  --bg-hex-opacity: 0.06;
  --bg-grid-line: rgba(15, 23, 42, 0.045);
  --bg-glow-a: rgba(2, 132, 199, 0.08);
  --bg-glow-b: rgba(79, 70, 229, 0.06);
}

/* --------------------------------------------------------------------------
   Base & Reset
   -------------------------------------------------------------------------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

html {
  background-color: var(--bg-body);
}

body {
  font-family: var(--font-sans);
  background-color: transparent;
  color: var(--text-secondary);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  text-decoration: none;
  opacity: 0.9;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

p {
  margin-bottom: 1rem;
}

p:last-child {
  margin-bottom: 0;
}

/* Ambient background: terminal grid + accent glow (::before)
   and a Kubernetes-style hexagon lattice (::after). Decorative only. */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

body::before {
  background-image:
    radial-gradient(880px 460px at 80% -10%, var(--bg-glow-a), transparent 70%),
    radial-gradient(720px 420px at 2% 8%, var(--bg-glow-b), transparent 72%),
    linear-gradient(var(--bg-grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-grid-line) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 56px 56px, 56px 56px;
}

body::after {
  background-image: var(--bg-hex-image);
  background-size: 56px 100px;
  opacity: var(--bg-hex-opacity);
  /* fade the lattice out towards the bottom so text stays the focus */
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0.35) 62%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0.35) 62%, transparent 100%);
}

.container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* --------------------------------------------------------------------------
   Navigation Bar
   -------------------------------------------------------------------------- */
.nav-bar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: var(--bg-nav);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.nav-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.brand-code {
  color: var(--accent-primary);
  font-weight: 800;
}

.brand-cursor {
  display: inline-block;
  width: 7px;
  height: 14px;
  background-color: var(--accent-primary);
  animation: blink 1.2s infinite;
  border-radius: 1px;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-link {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
  position: relative;
  padding: 0.25rem 0;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-gradient);
  border-radius: 2px;
}

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

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0.65rem 1.25rem;
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.82rem;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #ffffff;
  box-shadow: 0 2px 8px var(--accent-glow);
}

.btn-primary:hover {
  opacity: 0.95;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--accent-glow);
}

.btn-outline {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  border-color: var(--border-color);
}

.btn-outline:hover {
  background: var(--bg-surface-hover);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.theme-toggle:hover {
  background: var(--bg-surface-hover);
  border-color: var(--accent-primary);
}

[data-theme="dark"] .sun-icon { display: block; }
[data-theme="dark"] .moon-icon { display: none; }
[data-theme="light"] .sun-icon { display: none; }
[data-theme="light"] .moon-icon { display: block; }

.mobile-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 36px;
  height: 36px;
  padding: 8px;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.mobile-toggle span {
  width: 100%;
  height: 2px;
  background-color: var(--text-primary);
  transition: all var(--transition-fast);
}

/* --------------------------------------------------------------------------
   Hero Section
   -------------------------------------------------------------------------- */
.hero {
  padding: 4rem 0 3rem;
  position: relative;
}

.hero-wrapper {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 3rem;
}

.hero-main {
  flex: 1;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  background: var(--badge-bg);
  color: var(--badge-text);
  border: 1px solid var(--badge-border);
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.hero-title {
  font-size: 2.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.hero-title .gradient-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
  opacity: 0.9;
}

.hero-description {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 1.75rem;
  max-width: 620px;
}

.hero-contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 2rem;
}

.contact-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.contact-pill svg {
  width: 15px;
  height: 15px;
  fill: var(--accent-primary);
}

.contact-pill:hover {
  border-color: var(--accent-primary);
  color: var(--text-primary);
  transform: translateY(-1px);
}

/* Avatar Frame */
.hero-avatar-wrapper {
  position: relative;
  flex-shrink: 0;
}

.hero-avatar {
  width: 170px;
  height: 170px;
  border-radius: 28px;
  object-fit: cover;
  border: 3px solid var(--border-color);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
  background-color: var(--bg-surface);
  transition: all var(--transition-normal);
}

.hero-avatar:hover {
  border-color: var(--accent-primary);
  transform: scale(1.02);
}

.avatar-badge {
  position: absolute;
  bottom: -8px;
  right: -8px;
  padding: 4px 10px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--accent-primary);
}

/* Highlight Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  transition: all var(--transition-fast);
}

.stat-card:hover {
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: var(--card-shadow);
}

.stat-num {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 2px;
  font-family: var(--font-mono);
}

.stat-num span {
  color: var(--accent-primary);
}

.stat-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* --------------------------------------------------------------------------
   Section Layouts
   -------------------------------------------------------------------------- */
.section {
  padding: 4rem 0;
  border-top: 1px solid var(--border-color);
}

.section-header {
  margin-bottom: 2.5rem;
}

.section-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-primary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

/* --------------------------------------------------------------------------
   Specialties / Skills Grid
   -------------------------------------------------------------------------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.skill-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  transition: all var(--transition-fast);
}

.skill-card:hover {
  border-color: var(--accent-primary);
  background: var(--bg-surface-elevated);
  transform: translateY(-2px);
  box-shadow: var(--card-shadow);
}

.skill-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 1rem;
}

.skill-icon-wrapper {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--badge-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
  flex-shrink: 0;
}

.skill-icon-wrapper svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.skill-category {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.skill-tag {
  font-size: 0.8rem;
  font-weight: 500;
  font-family: var(--font-mono);
  padding: 3px 9px;
  border-radius: var(--radius-sm);
  background: var(--bg-body);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.skill-card:hover .skill-tag {
  border-color: var(--border-subtle);
  color: var(--text-primary);
}

/* --------------------------------------------------------------------------
   Experience Timeline
   -------------------------------------------------------------------------- */
.timeline {
  position: relative;
  padding-left: 28px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 12px;
  bottom: 12px;
  width: 2px;
  background-color: var(--timeline-line);
}

.timeline-item {
  position: relative;
  margin-bottom: 2.5rem;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -28px;
  top: 24px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: var(--bg-body);
  border: 3px solid var(--accent-primary);
  box-shadow: 0 0 0 4px var(--bg-body);
  transition: all var(--transition-fast);
}

.timeline-item:hover .timeline-dot {
  background-color: var(--accent-primary);
  box-shadow: 0 0 0 6px var(--accent-glow);
}

.timeline-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: all var(--transition-fast);
  box-shadow: var(--card-shadow);
}

.timeline-card:hover {
  border-color: var(--accent-primary);
  transform: translateY(-2px);
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.timeline-role-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.timeline-role {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.timeline-company {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent-primary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.timeline-company svg {
  width: 14px;
  height: 14px;
  opacity: 0.8;
}

.timeline-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
}

.timeline-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--badge-bg);
  color: var(--badge-text);
  border: 1px solid var(--badge-border);
}

.timeline-tagline {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 1.15rem;
}

.timeline-bullets {
  list-style: none;
  padding: 0;
  margin-bottom: 1.25rem;
}

.timeline-bullets li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 0.65rem;
  font-size: 0.93rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.timeline-bullets li:last-child {
  margin-bottom: 0;
}

.timeline-bullets li::before {
  content: '▸';
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent-primary);
  font-size: 1.1rem;
}

.timeline-bullets li strong {
  color: var(--text-primary);
  font-weight: 600;
}

.timeline-tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

.timeline-tech-tag {
  font-size: 0.76rem;
  font-family: var(--font-mono);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Education Section
   -------------------------------------------------------------------------- */
.edu-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  transition: all var(--transition-fast);
}

.edu-card:hover {
  border-color: var(--accent-primary);
  box-shadow: var(--card-shadow);
}

.edu-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: var(--badge-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
  flex-shrink: 0;
}

.edu-icon svg {
  width: 26px;
  height: 26px;
  fill: currentColor;
}

.edu-info {
  flex: 1;
}

.edu-school {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.edu-degree {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.edu-years {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 4px;
}

/* --------------------------------------------------------------------------
   Contact / CTA Section
   -------------------------------------------------------------------------- */
.cta-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--accent-gradient);
}

.cta-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.cta-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 540px;
  margin: 0 auto 2rem;
}

.cta-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.footer {
  padding: 2.5rem 0;
  border-top: 1px solid var(--border-color);
  font-size: 0.88rem;
  color: var(--text-muted);
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  color: var(--text-muted);
}

.footer-links a:hover {
  color: var(--text-primary);
}

/* Hero: secondary route to the HTML CV */
.hero-alt-link {
  margin-top: 0.9rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.hero-alt-link a {
  font-weight: 500;
  border-bottom: 1px solid transparent;
}

.hero-alt-link a:hover {
  border-bottom-color: var(--accent-primary);
}

/* Languages card (shares the education card shell) */
.lang-card {
  margin-top: 1rem;
  align-items: flex-start;
}

.lang-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.75rem;
}

.lang-item {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
}

.lang-name {
  font-weight: 600;
  color: var(--text-primary);
  min-width: 84px;
}

.lang-level {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: var(--radius-sm);
  background: var(--badge-bg);
  border: 1px solid var(--badge-border);
  color: var(--badge-text);
}

.lang-note {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Responsive Breakpoints
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .hero-wrapper {
    flex-direction: column-reverse;
    align-items: center;
    text-align: center;
    gap: 2rem;
  }

  .hero-description {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-contacts {
    justify-content: center;
  }

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

  .skills-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .hero-title {
    font-size: 2.1rem;
  }

  .hero-subtitle {
    font-size: 1.15rem;
  }

  .hero-avatar {
    width: 130px;
    height: 130px;
    border-radius: 20px;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }

  .stat-card {
    padding: 0.85rem;
  }

  .stat-num {
    font-size: 1.35rem;
  }

  .timeline {
    padding-left: 20px;
  }

  .timeline::before {
    left: 4px;
  }

  .timeline-dot {
    left: -20px;
    width: 12px;
    height: 12px;
    top: 20px;
  }

  .timeline-card {
    padding: 1.25rem;
  }

  .timeline-header {
    flex-direction: column;
    gap: 0.5rem;
  }

  .nav-links {
    position: fixed;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    flex-direction: column;
    padding: 1.5rem;
    gap: 1.25rem;
    display: none;
  }

  .nav-links.open {
    display: flex;
  }

  .mobile-toggle {
    display: flex;
  }

  .mobile-toggle.active span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }
  .mobile-toggle.active span:nth-child(2) {
    opacity: 0;
  }
  .mobile-toggle.active span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }

  .cta-box {
    padding: 2rem 1.25rem;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
  }
}

/* Very small screens: keep the nav bar on a single line */
@media (max-width: 480px) {
  .nav-brand {
    font-size: 0.95rem;
  }

  .brand-name {
    white-space: nowrap;
  }

  .cv-btn span {
    display: none;
  }

  .cv-btn {
    padding: 0.5rem;
  }
}

/* Printing: drop the ambient background layers */
@media print {
  body::before,
  body::after {
    display: none;
  }
}

/* Accessibility: honour reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
