/* ========================================
   Portfolio - CSS
   Theme: classic white and gray, one accent (terracotta)
   Light is the default; dark is an optional toggle.
   ======================================== */

/* ========================================
   CSS Custom Properties
   ======================================== */
:root {
  /* Accent - used sparingly: links, buttons, active states, key numbers */
  --accent: #8a6d1f;
  --accent-hover: #6f5718;
  --accent-soft: rgba(138, 109, 31, 0.12);

  /* Backgrounds - light theme (default) */
  --bg-primary: #ffffff;
  --bg-secondary: #f6f5f3;
  --bg-tertiary: #ececE8;
  --bg-card: #ffffff;

  /* Text */
  --text-primary: #1c1b1a;
  --text-secondary: #55534e;
  --text-muted: #8c8a84;

  /* UI */
  --border-color: rgba(28, 27, 26, 0.12);
  --shadow-sm: 0 1px 2px rgba(28, 27, 26, 0.06);
  --shadow-md: 0 4px 12px rgba(28, 27, 26, 0.08);
  --shadow-lg: 0 16px 36px rgba(28, 27, 26, 0.12);

  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.75rem;
  --spacing-md: 1.25rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3.5rem;

  /* Border Radius */
  --radius-sm: 3px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --radius-xl: 14px;
  --radius-full: 50%;

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease;

  /* Fonts */
  --font-primary: 'Archivo', sans-serif;
  --font-headings: 'Archivo', sans-serif;
}

/* Dark theme, opt-in via the toggle */
[data-theme="dark"] {
  --accent: #d4a83f;
  --accent-hover: #e0b856;
  --accent-soft: rgba(212, 168, 63, 0.18);

  --bg-primary: #171615;
  --bg-secondary: #1f1e1b;
  --bg-tertiary: #292824;
  --bg-card: #1f1e1b;

  --text-primary: #f2f0ec;
  --text-secondary: #b6b3ab;
  --text-muted: #817e75;

  --border-color: rgba(242, 240, 236, 0.12);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 18px 40px rgba(0, 0, 0, 0.45);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font-primary);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color var(--transition-base), color var(--transition-base);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

.section {
  padding: var(--spacing-xl) 0;
  position: relative;
}

/* ========================================
   Typography
   ======================================== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-headings);
  font-weight: 600;
  line-height: 1.2;
}

.section-title {
  font-size: 1.9rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-primary);
}

.title-number {
  font-size: 1.4rem;
  color: var(--accent);
  font-weight: 600;
  font-family: var(--font-headings);
}

.title-line {
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

/* ========================================
   Buttons
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1.35rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition-base);
  cursor: pointer;
  border: none;
  font-size: 0.9rem;
  font-family: var(--font-primary);
}

.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
}

.btn-secondary:hover {
  background: var(--accent);
  color: white;
}

/* ========================================
   Navigation Bar
   ======================================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  transition: all var(--transition-base);
}

.navbar.scrolled {
  box-shadow: var(--shadow-sm);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem var(--spacing-md);
}

.logo {
  font-size: 1.5rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text-primary);
  font-family: var(--font-headings);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.logo-bracket {
  color: var(--accent);
  font-weight: 700;
}

.logo-text {
  font-family: 'Courier New', monospace;
  font-size: 0.95em;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 2rem;
}

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

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width var(--transition-base);
}

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

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.theme-toggle {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-base);
}

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

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 5px;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--transition-base);
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translateY(8px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translateY(-8px);
}

/* ========================================
   Hero Section
   ======================================== */
.hero {
  min-height: unset;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 90px 0 3rem;
  overflow: hidden;
}

.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 65%);
  z-index: -1;
}

.hero-container {
  width: 100%;
  position: relative;
  z-index: 1;
}

.hero-content {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2.5rem;
  align-items: center;
}

.hero-text {
  animation: fadeInLeft 1s ease-out;
}

.hero-greeting {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.hero-name {
  font-size: 3.1rem;
  margin-bottom: 0.6rem;
  color: var(--text-primary);
  position: relative;
  display: inline-block;
}

.hero-name::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

.hero-title {
  font-size: 1.4rem;
  color: var(--text-secondary);
  margin-bottom: 0.9rem;
  min-height: 2rem;
  display: flex;
  align-items: center;
  font-family: var(--font-headings);
}

.typing-text {
  color: var(--accent);
}

.cursor {
  color: var(--text-primary);
  animation: blink 1s infinite;
}

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

.hero-description {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  max-width: 600px;
}

.hero-buttons {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.hero-social {
  display: flex;
  gap: 1rem;
}

.social-icon {
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 1.25rem;
  transition: all var(--transition-base);
}

.social-icon:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.hero-image {
  display: flex;
  justify-content: center;
}

.image-wrapper {
  position: relative;
  width: 100%;
  max-width: 480px;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: bottom center;
  position: relative;
  z-index: 3;
  /* Fade the bottom so the cutout blends into the page instead of a hard edge */
  -webkit-mask-image: linear-gradient(to bottom, #000 76%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 76%, transparent 100%);
}

.scroll-indicator {
  display: none;
}

.scroll-indicator a {
  color: var(--accent);
  font-size: 2rem;
  text-decoration: none;
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-10px); }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ========================================
   About Section
   ======================================== */
.about {
  position: relative;
  background: var(--bg-secondary);
}

.about::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, var(--border-color) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
  z-index: 0;
}

.about .container { position: relative; z-index: 1; }

.about-content {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 2.5rem;
  align-items: start;
}

/* Image, circular with corner bracket decorators */
.about-image {
  display: flex;
  justify-content: center;
}

.about-image-wrapper {
  position: relative;
  width: 200px;
  height: 200px;
}

.about-monogram {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--accent);
  font-family: var(--font-headings);
  font-weight: 700;
  font-size: 3.2rem;
  letter-spacing: 0.02em;
  position: relative;
  z-index: 3;
  box-sizing: border-box;
}

/* Bracket corners */
.about-image-border {
  position: absolute;
  inset: -14px;
  z-index: 4;
  pointer-events: none;
}

.about-image-border::before,
.about-image-border::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-color: var(--text-muted);
  border-style: solid;
  transition: all var(--transition-base);
}

.about-image-border::before {
  top: 0; left: 0;
  border-width: 2px 0 0 2px;
  border-radius: 3px 0 0 0;
}

.about-image-border::after {
  bottom: 0; right: 0;
  border-width: 0 2px 2px 0;
  border-radius: 0 0 3px 0;
}

.about-image-wrapper:hover .about-image-border::before,
.about-image-wrapper:hover .about-image-border::after {
  border-color: var(--accent);
  width: 24px;
  height: 24px;
}

/* Text side */
.about-bio,
.about-objective {
  margin-bottom: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.65;
  font-size: 0.95rem;
}

/* Highlight first letter of bio */
.about-bio::first-letter {
  font-size: 2.2em;
  font-weight: 600;
  font-family: var(--font-headings);
  float: left;
  line-height: 0.85;
  margin: 0.05em 0.08em 0 0;
  color: var(--accent);
}

/* Info cards */
.about-info {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin-top: 1rem;
}

.info-card {
  background: var(--bg-card);
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  display: flex;
  gap: 0.6rem;
  align-items: center;
  transition: all var(--transition-base);
}

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

.info-card i {
  font-size: 1.1rem;
  color: var(--accent);
  flex-shrink: 0;
}

.info-card div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.info-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 0.1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.info-value {
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 1024px) {
  .about-content {
    grid-template-columns: 1fr;
  }
  .about-info {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 600px) {
  .about-info {
    grid-template-columns: 1fr;
  }
  .about-image-wrapper {
    width: 160px;
    height: 160px;
  }
}

/* ========================================
   Education Section
   ======================================== */
.education-timeline {
  position: relative;
  padding-left: 2rem;
}

.education-timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border-color);
}

.education-item {
  position: relative;
  margin-bottom: 1.5rem;
  padding-left: 2rem;
}

.education-item::before {
  content: '';
  position: absolute;
  left: -2.45rem;
  top: 0.2rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg-primary);
  border: 3px solid var(--accent);
  z-index: 2;
}

.education-card {
  background: var(--bg-card);
  padding: 1.1rem 1.4rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  transition: all var(--transition-base);
}

.education-card:hover {
  transform: translateX(10px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}

.education-header {
  display: flex;
  align-items: start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.education-logo {
  font-size: 2.5rem;
}

.education-info h3 {
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
}

.education-institution {
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.education-meta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.education-meta span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.education-cgpa {
  color: var(--accent-hover);
  background: var(--accent-soft);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-sm);
  font-variant-numeric: tabular-nums;
}

.education-achievements {
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--border-color);
}

.education-achievements ul {
  list-style: none;
  padding: 0;
}

.education-achievements li {
  padding: 0.25rem 0;
  font-size: 0.87rem;
  color: var(--text-secondary);
  position: relative;
  padding-left: 1.5rem;
}

.education-achievements li::before {
  content: '\2013';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

/* ========================================
   Skills Section
   ======================================== */
.skills-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.25rem;
}

.skill-category {
  background: var(--bg-card);
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  transition: all var(--transition-base);
}

.skill-category:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.category-title {
  font-size: 1rem;
  margin-bottom: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: var(--font-primary);
  font-weight: 700;
}

.category-title i {
  color: var(--accent);
  font-size: 0.9rem;
}

.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skill-card {
  background: var(--bg-secondary);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.skill-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-sm);
  border-color: var(--accent);
}

.skill-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0;
  gap: 0.5rem;
}

.skill-name {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--text-primary);
}

.skill-name i {
  color: var(--accent);
  font-size: 0.9rem;
}

.skill-level {
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.skill-progress {
  width: 100%;
  height: 5px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  overflow: hidden;
}

.skill-progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 1s ease;
  width: 0;
}

.skill-card:hover .skill-progress-bar {
  width: var(--skill-width);
}

/* ========================================
   Projects Section
   ======================================== */
.project-filters {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: var(--spacing-lg);
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.65rem 1.4rem;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  font-weight: 600;
  transition: all var(--transition-base);
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
}

.project-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
  transition: all var(--transition-base);
  opacity: 1;
  transform: scale(1);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.project-card.hidden {
  display: none;
}

.project-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}

.project-image {
  width: 100%;
  height: 160px;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.project-card:hover .project-image img {
  transform: scale(1.06);
}

.project-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(28, 27, 26, 0.72);
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  transition: opacity var(--transition-base);
}

.project-card:hover .project-overlay {
  opacity: 1;
}

.project-link {
  width: 45px;
  height: 45px;
  background: white;
  color: var(--accent);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 1.25rem;
  transition: all var(--transition-fast);
}

.project-link:hover {
  transform: scale(1.1);
}

.project-content {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.project-title {
  font-size: 1.1rem;
  margin-bottom: 0.4rem;
  color: var(--text-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.flagship-badge {
  font-size: 0.72rem;
  background: var(--text-primary);
  color: var(--bg-primary);
  padding: 4px 10px;
  border-radius: 50px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.flagship-card {
  border: 1.5px solid var(--accent);
}

.flagship-card:hover {
  box-shadow: var(--shadow-lg);
}

.project-description {
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-technologies {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
}

.tech-badge {
  padding: 0.25rem 0.75rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
}

/* ========================================
   Experience Section
   ======================================== */
.experience-timeline {
  position: relative;
  padding-left: 2rem;
}

.experience-timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border-color);
}

.experience-item {
  position: relative;
  margin-bottom: 1.75rem;
  padding-left: 2rem;
}

.experience-item::before {
  content: '';
  position: absolute;
  left: -2.45rem;
  top: 0.2rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg-primary);
  border: 3px solid var(--accent);
  z-index: 2;
}

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

.experience-card:hover {
  transform: translateX(10px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}

.experience-header {
  margin-bottom: 1rem;
}

.experience-role {
  font-size: 1.05rem;
  margin-bottom: 0.3rem;
  color: var(--text-primary);
}

.experience-company {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.3rem;
}

.experience-meta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.experience-meta span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.experience-type {
  padding: 0.25rem 0.75rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 600;
}

.experience-responsibilities {
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--border-color);
}

.experience-responsibilities ul {
  list-style: none;
  padding: 0;
}

.experience-responsibilities li {
  padding: 0.3rem 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
  position: relative;
  padding-left: 1.5rem;
}

.experience-responsibilities li::before {
  content: '\2013';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

.experience-technologies {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* ========================================
   Certifications Section
   ======================================== */
.certifications-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  align-items: stretch;
  justify-items: center;
}

.certification-card {
  background: var(--bg-card);
  padding: 1rem 1.1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  border-top: 3px solid var(--border-color);
  text-align: left;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 380px;
  height: 100%;
  line-height: 1.45;
}

.certification-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-top-color: var(--accent);
}

.certification-icon {
  font-size: 1.5rem;
  margin-bottom: 0.6rem;
  color: var(--accent);
}

.certification-name {
  font-size: 1rem;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
  line-height: 1.25;
}

.certification-issuer {
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
  line-height: 1.3;
}

.certification-date {
  color: var(--text-muted);
  font-size: 0.7rem;
  margin-bottom: 0.6rem;
  line-height: 1.2;
}

.certification-description {
  color: var(--text-secondary);
  font-size: 0.8rem;
  line-height: 1.45;
  margin: 0 0 0.6rem;
}

.certification-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  margin-top: auto;
}

.certification-link {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.375rem;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  transition: all var(--transition-fast);
}

.certification-link i {
  font-size: 0.75rem;
  opacity: 0.75;
}

.certification-link:hover {
  color: var(--accent-hover);
  transform: translateX(3px);
}

/* ========================================
   Contact Section
   ======================================== */
.contact-content {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: var(--spacing-lg);
}

.contact-info h3 {
  font-size: 1.6rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.contact-info p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  font-size: 0.92rem;
  line-height: 1.6;
}

.connect-cta {
  margin-bottom: clamp(1.25rem, 3vw, 1.8rem);
}

.contact-details {
  margin-bottom: 2rem;
}

.contact-item {
  display: flex;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-bottom: 1rem;
  transition: all var(--transition-base);
}

.contact-item:hover {
  border-color: var(--accent);
  transform: translateX(5px);
}

.contact-item i {
  font-size: 1.5rem;
  color: var(--accent);
}

.contact-item div {
  display: flex;
  flex-direction: column;
}

.contact-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.contact-value {
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
}

.contact-value:hover {
  color: var(--accent);
}

.contact-social {
  display: flex;
  gap: 1rem;
}

.contact-form {
  background: var(--bg-card);
  padding: 2rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  font-weight: 600;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.875rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-primary);
  font-size: 1rem;
  transition: all var(--transition-base);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.error-message {
  display: block;
  color: #b3261e;
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

.form-status {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  text-align: center;
  font-weight: 600;
  display: none;
}

.form-status.success {
  background: var(--accent-soft);
  color: var(--accent-hover);
  border: 1px solid var(--accent);
  display: block;
}

.form-status.error {
  background: rgba(179, 38, 30, 0.08);
  color: #b3261e;
  border: 1px solid #b3261e;
  display: block;
}

/* ========================================
   Footer
   ======================================== */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 0 0 1rem;
  position: relative;
}

/* Motto banner */
.footer-motto {
  border-bottom: 1px solid var(--border-color);
  padding: 1.1rem 0;
  text-align: center;
}

.footer-motto-text {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-style: italic;
  letter-spacing: 0.02em;
  font-family: var(--font-headings);
}

/* Main row */
.footer-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.25rem 0 1rem;
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-logo {
  font-size: 1.25rem;
  font-weight: 600;
  font-family: var(--font-headings);
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.footer-social {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.footer-social .social-icon {
  width: 34px;
  height: 34px;
  font-size: 1rem;
}

/* Inline nav */
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1.25rem;
  justify-content: flex-end;
}

.footer-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  transition: color var(--transition-fast);
  position: relative;
}

.footer-nav a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width var(--transition-fast);
}

.footer-nav a:hover {
  color: var(--accent);
}

.footer-nav a:hover::after {
  width: 100%;
}

/* Bottom bar */
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.78rem;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.footer-bottom p { margin: 0; }

.footer-bottom i {
  color: var(--accent);
}

@media (max-width: 768px) {
  .footer-main {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  .footer-nav {
    justify-content: flex-start;
  }
  .footer-bottom {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }
}

/* ========================================
   Scroll to Top Button
   ======================================== */
.scroll-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
  z-index: 999;
  box-shadow: var(--shadow-md);
}

.scroll-top.visible {
  opacity: 1;
  visibility: visible;
}

.scroll-top:hover {
  background: var(--accent-hover);
  transform: translateY(-4px);
}

/* ========================================
   Animations
   ======================================== */
.fade-in {
  animation: fadeIn 1s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Intersection Observer Animations */
.hidden-anim {
  opacity: 0;
  transform: translateY(50px);
  transition: all 0.8s ease;
}

.show-anim {
  opacity: 1;
  transform: translateY(0);
}

/* ========================================
   Responsive Design
   ======================================== */

/* --- Tablet --- */
@media (max-width: 1024px) {
  .certifications-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-text { order: 2; }
  .hero-image { order: 1; }

  .hero-buttons,
  .hero-social { justify-content: center; }

  .about-content { grid-template-columns: 1fr; }
  .contact-content { grid-template-columns: 1fr; }

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

/* --- Mobile --- */
@media (max-width: 768px) {

  /* Base spacing */
  .section { padding: 3.5rem 0; }
  .container { padding: 0 1rem; }

  /* Section title */
  .section-title {
    font-size: 1.6rem;
    gap: 0.6rem;
    margin-bottom: 2rem;
  }
  .title-number { font-size: 1.1rem; }

  /* Nav */
  .nav-container { padding: 0.875rem 1rem; }

  .nav-menu {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    flex-direction: column;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    transform: translateY(-110%);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
    gap: 0.25rem;
    box-shadow: var(--shadow-lg);
    z-index: 999;
  }

  .nav-menu.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-link {
    font-size: 1rem;
    padding: 0.65rem 0.5rem;
    border-bottom: 1px solid var(--border-color);
  }

  .nav-link:last-child { border-bottom: none; }

  .hamburger { display: flex; }

  /* Hero */
  .hero { padding-top: 70px; min-height: 100svh; }

  .hero-greeting { font-size: 1rem; }
  .hero-name { font-size: 2.4rem; line-height: 1.15; }
  .hero-title { font-size: 1.2rem; min-height: 2rem; justify-content: center; }
  .hero-description { font-size: 0.95rem; margin-bottom: 1.5rem; }

  .image-wrapper {
    width: 100%;
    max-width: 340px;
    height: auto;
    margin: 0 auto;
  }

  .hero {
    padding: 75px 0 2rem;
  }

  .hero-buttons {
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
  }

  .btn {
    width: 100%;
    justify-content: center;
    padding: 0.85rem 1.5rem;
    font-size: 0.95rem;
  }

  .hero-social { gap: 0.75rem; flex-wrap: wrap; justify-content: center; }

  .social-icon {
    width: 42px;
    height: 42px;
    font-size: 1.1rem;
  }

  /* About */
  .about-image { display: flex; justify-content: center; }
  .about-image-wrapper { max-width: 260px; }

  .about-bio,
  .about-objective { font-size: 0.93rem; margin-bottom: 1rem; }

  .about-info {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-top: 1.25rem;
  }

  .info-card { padding: 1rem; }
  .info-card i { font-size: 1.2rem; }

  /* Education */
  .education-timeline { padding-left: 1.25rem; }
  .education-item { padding-left: 1.25rem; margin-bottom: 2rem; }
  .education-item::before { left: -1.8rem; width: 12px; height: 12px; }
  .education-card { padding: 1.25rem; }
  .education-card:hover { transform: none; }
  .education-info h3 { font-size: 1.1rem; }
  .education-logo { font-size: 2rem; }
  .education-meta { gap: 0.5rem; font-size: 0.8rem; flex-direction: column; }

  /* Skills */
  .skills-container { grid-template-columns: 1fr; gap: 0.75rem; }
  .skill-category { padding: 1rem; }
  .skills-grid { gap: 0.4rem; }

  /* Projects */
  .projects-grid { grid-template-columns: 1fr; gap: 1.25rem; }
  .project-image { height: 160px; }
  .project-title { font-size: 1.2rem; }
  .project-content { padding: 1rem; }

  /* Experience */
  .experience-timeline { padding-left: 1.25rem; }
  .experience-item { padding-left: 1.25rem; margin-bottom: 2rem; }
  .experience-item::before { left: -1.8rem; width: 12px; height: 12px; }
  .experience-card { padding: 1.25rem; }
  .experience-card:hover { transform: none; }
  .experience-role { font-size: 1.1rem; }
  .experience-company { font-size: 1rem; }
  .experience-meta { flex-direction: column; gap: 0.4rem; font-size: 0.8rem; }

  /* Certifications */
  .certifications-grid { grid-template-columns: 1fr; gap: 1rem; }
  .certification-card { padding: 1.25rem; }
  .certification-name { font-size: 1.15rem; }

  /* Contact */
  .contact-info h3 { font-size: 1.5rem; }
  .contact-item { padding: 1rem; }
  .connect-telegram { width: 100%; justify-content: center; }
  .contact-social { flex-wrap: wrap; gap: 0.75rem; }

  /* Footer */
  .footer { padding: 2.5rem 0 1.5rem; }
  .footer-social { justify-content: center; }

  /* Scroll top */
  .scroll-top {
    bottom: 1.25rem;
    right: 1.25rem;
    width: 44px;
    height: 44px;
    font-size: 1rem;
  }
}

/* --- Small phones --- */
@media (max-width: 400px) {
  .hero-name { font-size: 2rem; }
  .hero-title { font-size: 1rem; }
  .image-wrapper { width: 100%; max-width: 260px; height: auto; }
  .section-title { font-size: 1.4rem; }
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
  .navbar,
  .scroll-top,
  .scroll-indicator,
  .theme-toggle,
  .hamburger {
    display: none;
  }

  .section {
    page-break-inside: avoid;
  }
}

/* ========================================
   Accessibility
   ======================================== */
.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;
}

/* Focus styles for keyboard navigation */
a:focus,
button:focus,
input:focus,
textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Reduced motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ========================================
   Scroll Progress Bar
   ======================================== */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: var(--accent);
  z-index: 9999;
  transition: width 0.1s linear;
}

/* ========================================
   Nav active dot indicator
   ======================================== */
.nav-link.active::before {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
}

/* ========================================
   Skills Wall
   ======================================== */
.skill-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  margin-bottom: 2rem;
}

.skill-legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.skill-wall {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.skill-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 50px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-primary);
  cursor: default;
  transition: all var(--transition-fast);
  position: relative;
}

.skill-tag:hover {
  border-color: var(--tag-color, var(--accent));
  transform: translateY(-2px);
}

.skill-tag i {
  font-size: 0.85rem;
}

.tag-level {
  font-style: normal;
  font-size: 0.58rem;
  font-weight: 700;
  padding: 0.08rem 0.35rem;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 768px) {
  .skill-tag { font-size: 0.77rem; padding: 0.38rem 0.7rem; }
  .skill-legend { gap: 0.5rem 1rem; }
}

/* ========================================
   Project Action Buttons
   ======================================== */
.project-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.project-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.btn-live {
  background: var(--accent);
  color: white;
}
.btn-live:hover { background: var(--accent-hover); transform: translateY(-2px); }

.btn-gh {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}
.btn-gh:hover { border-color: var(--accent); color: var(--accent); }

.btn-doc {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}
.btn-doc:hover { border-color: var(--accent); color: var(--accent); }

.btn-product {
  background: var(--text-primary);
  color: var(--bg-primary);
  border: none;
  font-weight: 700;
}
.btn-product:hover {
  background: var(--accent);
  color: white;
  transform: translateY(-2px);
}

/* ========================================
   Certification cards, alternating top border
   ======================================== */
.certification-card:nth-child(even):hover {
  border-top-color: var(--text-primary);
}

/* ========================================
   Alternating slide-in animations
   ======================================== */
.education-item:nth-child(even) .education-card,
.experience-item:nth-child(even) .experience-card {
  transform: translateX(30px);
  opacity: 0;
  transition: all 0.8s ease;
}
.education-item:nth-child(odd) .education-card,
.experience-item:nth-child(odd) .experience-card {
  transform: translateX(-30px);
  opacity: 0;
  transition: all 0.8s ease;
}
.show-anim .education-card,
.show-anim .experience-card {
  transform: translateX(0) !important;
  opacity: 1 !important;
}

/* ========================================
   Visitor Stats Widget (footer)
   ======================================== */
.visitor-stats {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.55rem 1rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-base);
}

.visitor-stats:hover {
  box-shadow: var(--shadow-md);
}

.visitor-stat {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.visitor-stat i {
  color: var(--accent);
  font-size: 0.85rem;
  flex-shrink: 0;
}

.visitor-stat-content {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.visitor-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
}

.visitor-count {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-headings);
  min-width: 2ch;
  font-variant-numeric: tabular-nums;
}

.visitor-divider {
  width: 1px;
  height: 28px;
  background: var(--border-color);
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .visitor-stats {
    align-self: flex-start;
    order: 3;
  }
}
