/* ===== Base: variables, fonts, color tokens ===== */
:root {
  /* Typography */
  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;

  /* Type scale (desktop-ish; tune as needed) */
  --size-hero: clamp(2.25rem, 4vw, 3.25rem);
  --size-h1: clamp(1.875rem, 3vw, 2.5rem);
  --size-h2: clamp(1.5rem, 2.5vw, 2rem);
  --size-h3: clamp(1.25rem, 2vw, 1.5rem);
  --size-body: 1rem;
  --size-small: 0.875rem;

  --weight-hero: 800;
  --weight-h: 700;
  --weight-strong: 600;
  --weight-body: 400;

  /* Spacing scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;

  /* Radius & shadows */
  --radius: 12px;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-2: 0 6px 24px rgba(0, 0, 0, 0.08);

  /* Light theme colors */
  --bg: #ffffff;
  --bg-elev: #f8fafc;
  --text: #0b1220;
  --muted: #4a5568;
  --border: #e5e7eb;
  --hover-bg: #f1f5f9;

  /* Accent: Nordic finance blue */
  --primary: #1a73a7;
  --primary-600: #155d87;
  --primary-100: #dceef8;
  --accent: #2a9fd6;

  /* Interactive states */
  --focus: 0 0 0 3px rgba(26, 115, 167, 0.35);
}

/* Dark theme */
[data-theme="dark"] {
  --bg: #0d1117;
  --bg-elev: #161b22;
  --text: #e6edf3;
  --muted: #8b949e;
  --border: #2d333b;
  --hover-bg: #2d333b;

  --primary: #5aafdb;
  --primary-600: #3d97c7;
  --primary-100: #15394f;
  --accent: #6dc4e8;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-2: 0 6px 24px rgba(0, 0, 0, 0.4);
}

/* Auto dark theme based on system preference */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1117;
    --bg-elev: #161b22;
    --text: #e6edf3;
    --muted: #8b949e;
    --border: #2d333b;
    --hover-bg: #2d333b;

    --primary: #5aafdb;
    --primary-600: #3d97c7;
    --primary-100: #15394f;
    --accent: #6dc4e8;

    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-2: 0 6px 24px rgba(0, 0, 0, 0.4);
  }
}

/* ===== Resets & base ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: light dark;
  scroll-behavior: smooth;
}

@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;
  }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--size-body);
  font-weight: var(--weight-body);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ===== Typography hierarchy ===== */
.hero-title {
  font-size: var(--size-hero);
  font-weight: var(--weight-hero);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 var(--space-4);
  color: var(--text);
}

h1, h2, h3 {
  margin: var(--space-8) 0 var(--space-3);
  line-height: 1.2;
  letter-spacing: -0.01em;
  font-weight: var(--weight-h);
}

h1 {
  font-size: var(--size-h1);
  color: var(--text);
}

h2 {
  font-size: var(--size-h2);
  color: var(--text);
}

h3 {
  font-size: var(--size-h3);
  color: var(--text);
}

p {
  margin: 0 0 var(--space-4);
  color: var(--text);
}

p.muted,
.muted {
  color: var(--muted);
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  text-decoration: underline;
}

a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ===== Layout helpers ===== */
.container {
  max-width: 1100px;
  padding: 0 var(--space-4);
  margin: 0 auto;
}

.section {
  padding: var(--space-12) 0;
  background: transparent;
}

.section.elev {
  background: var(--bg-elev);
}

/* ===== Navigation ===== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(150%) blur(12px);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  border-bottom: 1px solid var(--border);
  transition: all 0.3s ease;
}

.nav-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  min-height: 64px;
}

.nav-brand {
  font-weight: var(--weight-strong);
  letter-spacing: 0.02em;
  color: var(--text);
  font-size: 1.125rem;
  transition: color 0.2s ease;
}

.nav-brand:hover {
  color: var(--primary);
  text-decoration: none;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-link {
  color: var(--muted);
  font-weight: 500;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius);
  transition: all 0.2s ease;
  display: inline-block;
}

.nav-link:hover {
  color: var(--text);
  background: var(--bg-elev);
  text-decoration: none;
}

/* Theme Toggle Button */
.theme-toggle {
  background: none;
  border: 2px solid var(--border);
  color: var(--text);
  padding: var(--space-2);
  border-radius: 50%;
  cursor: pointer;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  font-size: 1.25rem;
}

.theme-toggle:hover {
  border-color: var(--primary);
  background-color: var(--bg-elev);
  transform: scale(1.05);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5ch;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--primary-600);
  background: var(--primary);
  color: white;
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--shadow-1);
  transition: all 0.2s ease;
  cursor: pointer;
  font-size: var(--size-body);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
  text-decoration: none;
}

.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn-secondary {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

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

/* ===== Cards & "project tiles" ===== */
.card {
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: var(--radius);
  padding: var(--space-6);
  box-shadow: var(--shadow-1);
  transition: all 0.3s ease;
}

.card:hover {
  box-shadow: var(--shadow-2);
  border-color: color-mix(in srgb, var(--primary) 50%, var(--border));
}

.project-card {
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: var(--radius);
  padding: var(--space-6);
  box-shadow: var(--shadow-1);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

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

.project-title {
  font-size: var(--size-h3);
  font-weight: var(--weight-h);
  margin: 0 0 var(--space-3);
  color: var(--primary);
}

.project-meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 var(--space-3);
  letter-spacing: 0.01em;
}

.project-description {
  color: var(--muted);
  margin-bottom: var(--space-4);
  flex-grow: 1;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.tag {
  display: inline-block;
  font-size: var(--size-small);
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, var(--bg-elev));
  border: 1px solid color-mix(in srgb, var(--primary) 25%, var(--border));
}

/* ===== Hero Section ===== */
.hero {
  display: flex;
  align-items: center;
  padding: var(--space-12) 0;
}

.hero-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-12);
  align-items: center;
  width: 100%;
}

.hero-content {
  max-width: 600px;
  text-align: left;
}

.hero-content h1 {
  font-size: var(--size-hero);
  font-weight: var(--weight-hero);
  margin-bottom: var(--space-4);
  color: var(--text);
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--muted);
  margin-bottom: var(--space-6);
  font-weight: 500;
}

.hero-content p {
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--muted);
  margin: 0 0 var(--space-4);
}

.hero-buttons {
  margin-top: var(--space-8);
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}

/* Hero Image Section */
.hero-image {
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-circle {
  position: relative;
  width: 350px;
  height: 350px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid var(--primary);
  box-shadow: var(--shadow-2);
}

.profile-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

.profile-img.active {
  opacity: 1;
}

/* ===== Scroll Hint (mobile hero) ===== */
.scroll-hint {
  display: none;
  position: fixed;
  bottom: var(--space-6);
  left: 50%;
  transform: translateX(-50%);
  color: var(--muted);
  z-index: 10;
  animation: scrollBounce 2s ease-in-out infinite;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

@keyframes scrollBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.5; }
  50% { transform: translateX(-50%) translateY(8px); opacity: 1; }
}

/* ===== Skills Section ===== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-6);
  margin-top: var(--space-8);
  padding: var(--space-4);
}

.skill-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-4);
  border-radius: var(--radius);
  transition: all 0.3s ease;
}

.skill-item:hover {
  background: var(--bg-elev);
  transform: translateY(-4px);
}

.skill-link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.skill-link:hover {
  text-decoration: none;
}

.skill-link:hover .skill-name {
  color: var(--primary);
}

.skill-icon {
  width: 64px;
  height: 64px;
  margin-bottom: var(--space-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}

.skill-icon img,
.skill-icon svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.skill-name {
  font-weight: var(--weight-strong);
  color: var(--text);
  font-size: var(--size-small);
}

/* Dark-mode invert for monochrome (black) SVG icons */
[data-theme="dark"] .skill-icon img.dark-invert {
  filter: invert(0.85);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .skill-icon img.dark-invert {
    filter: invert(0.85);
  }
}

/* Tech tags grid (Core Technologies section) */
.tech-tags-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: center;
  max-width: 800px;
  margin: 0 auto;
}

.tech-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-weight: var(--weight-strong);
  font-size: var(--size-body);
  text-decoration: none;
  transition: all 0.2s ease;
}

.tech-tag:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 8%, var(--bg));
  transform: translateY(-2px);
  box-shadow: var(--shadow-1);
  text-decoration: none;
}

/* Fallback for old skills list */
.skills-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-6);
  margin-top: var(--space-6);
}

.skill-category h3 {
  color: var(--primary);
  margin-bottom: var(--space-4);
}

.skill-category ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.skill-category li {
  padding: var(--space-2) 0;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

.skill-category li:last-child {
  border-bottom: none;
}

/* ===== Project Grid ===== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-6);
  margin-top: var(--space-6);
}

/* Featured projects: always 2x2 on desktop/tablet */
.featured-grid {
  grid-template-columns: repeat(2, 1fr);
}

/* ===== Page Intro (shared across content pages) ===== */
.page-intro {
  font-size: 1.125rem;
  color: var(--muted);
  margin-bottom: var(--space-12);
  text-align: left;
  max-width: 800px;
}

.projects-cta {
  text-align: center;
  margin-top: 4rem;
}

.projects-cta h2 {
  margin-bottom: var(--space-4);
}

.projects-cta-text {
  color: var(--muted);
  margin-bottom: var(--space-8);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.projects-cta-button {
  display: flex;
  justify-content: center;
}

/* ===== Lists ===== */
ul.tight {
  list-style: disc inside;
  margin: var(--space-4) 0;
  padding: 0;
  color: var(--muted);
}

ul.tight li + li {
  margin-top: var(--space-2);
}

/* ===== Contact Form ===== */
.contact-form {
  max-width: 600px;
  margin: var(--space-6) auto;
}

/* ===== Contact Page Specific ===== */
.contact-faq {
  margin-top: 4rem;
}

.contact-faq h2 {
  text-align: center;
  margin-bottom: var(--space-8);
}

.form-group {
  margin-bottom: var(--space-6);
}

.form-group label {
  display: block;
  margin-bottom: var(--space-2);
  font-weight: var(--weight-strong);
  color: var(--text);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: var(--space-3);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background-color: var(--bg);
  color: var(--text);
  font-size: var(--size-body);
  font-family: var(--font-sans);
  transition: all 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent);
}

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

/* ===== Footer ===== */
.footer {
  padding: var(--space-8) 0;
  border-top: 1px solid var(--border);
  color: var(--muted);
  background: var(--bg);
  margin-top: var(--space-12);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.social-links {
  display: flex;
  gap: var(--space-4);
}

.social-links a {
  color: var(--muted);
  font-weight: 500;
  transition: color 0.2s ease;
}

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

/* ===== Mobile Navigation ===== */
.mobile-nav {
  display: none;
  align-items: center;
  gap: var(--space-3);
}

.mobile-theme-toggle {
  background: none;
  border: 2px solid var(--border);
  color: var(--text);
  padding: var(--space-2);
  border-radius: 50%;
  cursor: pointer;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  font-size: 1.25rem;
}

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

.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001;
  transition: all 0.3s ease;
}

.hamburger-line {
  width: 25px;
  height: 3px;
  background-color: var(--text);
  margin: 2px 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center;
  border-radius: 2px;
}

.hamburger.active .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.hamburger.active .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.hamburger.active .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

.mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background-color: var(--bg);
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
}

.mobile-menu.active {
  transform: translateX(0);
}

.mobile-menu-list {
  list-style: none;
  text-align: center;
  padding: 0;
  margin: 0;
}

.mobile-menu-list li {
  margin: var(--space-6) 0;
}

.mobile-nav-link {
  color: var(--text);
  text-decoration: none;
  font-size: 2rem;
  font-weight: 600;
  transition: all 0.3s ease;
  display: block;
  padding: var(--space-4) var(--space-6);
  border-radius: var(--radius);
}

.mobile-nav-link:hover {
  color: var(--primary);
  background-color: var(--bg-elev);
  transform: scale(1.05);
}

/* ===== Utilities ===== */
.max-w-prose {
  max-width: 68ch;
}

.grid {
  display: grid;
  gap: var(--space-6);
}

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

.grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Animation for fade-in */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.6s ease-out;
}

/* ===== Responsive Design ===== */
@media (max-width: 900px) {
  .grid.cols-2,
  .grid.cols-3 {
    grid-template-columns: 1fr;
  }

  .skills-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: var(--space-4);
  }
}

@media (max-width: 768px) {
  .nav-menu {
    display: none;
  }

  .mobile-nav {
    display: flex;
  }

  .hero {
    min-height: 70vh;
    padding: var(--space-8) 0;
  }

  .hero-split {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .hero-content {
    max-width: 100%;
  }

  .hero-content h1,
  .hero-subtitle {
    text-align: center;
  }

  .hero-content p:not(.hero-subtitle) {
    text-align: left;
  }

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

  h2,
  h3 {
    line-height: 1.4;
  }

  .projects-cta h2 {
    text-align: center;
  }

  .projects-cta-text {
    text-align: left;
  }

  .hero-content h1 {
    font-size: clamp(2rem, 8vw, 2.5rem);
  }

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

  .hero-content p {
    font-size: 1rem;
  }

  .profile-circle {
    width: 250px;
    height: 250px;
  }

  .container {
    padding: 0 var(--space-3);
  }

  .section {
    padding: var(--space-8) 0;
  }

  .projects-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  /* Keep featured grid 2-col on tablet */
  .featured-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .scroll-hint {
    display: flex;
  }

  .skills-grid {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: var(--space-3);
  }

  .skill-icon {
    width: 48px;
    height: 48px;
    font-size: 2.5rem;
  }

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

  body.mobile-menu-open {
    overflow: hidden;
  }
}

@media (max-width: 480px) {
  .featured-grid {
    grid-template-columns: 1fr;
  }

  .container {
    padding: 0 var(--space-2);
  }

  .nav-container {
    padding: 0 var(--space-2);
  }

  h1 {
    font-size: clamp(1.75rem, 7vw, 2rem);
  }

  h2 {
    font-size: clamp(1.5rem, 6vw, 1.75rem);
  }

  .btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.9375rem;
  }

  .skills-grid {
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  }

  .skill-icon {
    width: 40px;
    height: 40px;
    font-size: 2rem;
  }
}

/* Hide mobile navigation on desktop */
@media (min-width: 769px) {
  .mobile-nav,
  .mobile-menu {
    display: none !important;
  }
}

/* ===== Project Filter Controls ===== */
.filter-container {
  margin: var(--space-8) 0;
  padding-top: var(--space-6);
  padding-left: var(--space-6);
  padding-right: var(--space-6);
  padding-bottom: 0;
  background: var(--bg-elev);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.filter-section {
  margin-bottom: var(--space-6);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  overflow: hidden;
}

.filter-section:first-of-type {
  margin-top: 0;
}

.filter-section:last-of-type {
  margin-bottom: 0;
}

.filter-section-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-4);
  background: var(--bg);
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: background 0.2s ease;
}

.filter-section-header:hover {
  background: var(--hover-bg);
}

.filter-section-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
}

.filter-section-toggle {
  font-size: 0.875rem;
  color: var(--muted);
  transition: transform 0.2s ease;
}

.filter-section-content {
  padding: var(--space-4);
  background: var(--bg);
}

.job-role-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: center;
}

.job-role-filter-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-sans);
}

.job-role-filter-btn:hover {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 5%, var(--bg));
  transform: translateY(-2px);
}

.job-role-filter-btn.active {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow-1);
}

.job-role-filter-btn.active:hover {
  background: var(--primary-600);
}

.job-role-filter-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.tag-category {
  margin-bottom: var(--space-4);
}

.tag-category:last-child {
  margin-bottom: 0;
}

.tag-category-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 var(--space-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tag-category-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: center;
  margin-top: var(--space-4);
}

.filter-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 2px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  font-size: var(--size-small);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-sans);
}

.filter-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 5%, var(--bg));
  transform: translateY(-2px);
}

.filter-btn.active {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow-1);
}

.filter-btn.active:hover {
  background: var(--primary-600);
}

.filter-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.clear-all-filters {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  font-size: var(--size-small);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-sans);
}

.clear-all-filters:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 5%, var(--bg));
}

.clear-all-filters:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

@media (max-width: 768px) {
  .filter-container {
    padding: var(--space-4);
  }

  .filter-section-header {
    padding: var(--space-3);
  }

  .filter-section-title {
    font-size: 1rem;
  }

  .filter-section-content {
    padding: var(--space-3);
  }

  .job-role-filters {
    gap: var(--space-2);
  }

  .job-role-filter-btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.9375rem;
  }

  .tag-category {
    margin-bottom: var(--space-3);
  }

  .tag-category-title {
    font-size: 0.875rem;
  }

  .filter-buttons {
    gap: var(--space-1);
  }

  .filter-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.8125rem;
  }
}
