/* Portfolio Site Styles - Clean Portfolio-Only Design */

/* CSS Variables - Design Tokens */
:root {
  --background: hsl(0, 0%, 100%);
  --foreground: hsl(0, 0%, 9%);
  --card: hsl(0, 0%, 100%);
  --card-foreground: hsl(0, 0%, 9%);
  --primary: hsl(217, 33%, 8%);
  --primary-foreground: hsl(0, 0%, 98%);
  --primary-glow: hsl(217, 33%, 16%);
  --secondary: hsl(0, 0%, 96%);
  --secondary-foreground: hsl(0, 0%, 9%);
  --muted: hsl(0, 0%, 96%);
  --muted-foreground: hsl(0, 0%, 45%);
  --accent: hsl(217, 33%, 97%);
  --accent-foreground: hsl(217, 33%, 8%);
  --border: hsl(0, 0%, 89%);
  --ring: hsl(217, 33%, 8%);
  --radius: 0.5rem;
  --shadow-minimal: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-professional: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-dramatic: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-glow: 0 0 40px hsl(217 33% 16% / 0.15);
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --gradient-primary: linear-gradient(135deg, hsl(217, 33%, 8%), hsl(217, 33%, 16%));
  --gradient-subtle: linear-gradient(180deg, hsl(0, 0%, 100%), hsl(217, 33%, 99%));
  --gradient-accent: linear-gradient(45deg, hsl(217, 33%, 97%), hsl(217, 33%, 94%));
  --gradient-hero: linear-gradient(135deg, hsl(0, 0%, 100%) 0%, hsl(217, 33%, 98%) 50%, hsl(217, 33%, 96%) 100%);
}

/* Dark Mode */
[data-theme="dark"] {
  --background: hsl(0, 0%, 4%);
  --foreground: hsl(0, 0%, 98%);
  --card: hsl(0, 0%, 6%);
  --card-foreground: hsl(0, 0%, 98%);
  --primary: hsl(217, 33%, 78%);
  --primary-foreground: hsl(0, 0%, 9%);
  --primary-glow: hsl(217, 33%, 85%);
  --secondary: hsl(0, 0%, 12%);
  --secondary-foreground: hsl(0, 0%, 98%);
  --muted: hsl(0, 0%, 12%);
  --muted-foreground: hsl(0, 0%, 63%);
  --accent: hsl(217, 33%, 14%);
  --accent-foreground: hsl(217, 33%, 90%);
  --border: hsl(0, 0%, 18%);
  --ring: hsl(217, 33%, 78%);
  --shadow-glow: 0 0 40px hsl(217 33% 50% / 0.2);
  --gradient-primary: linear-gradient(135deg, hsl(217, 33%, 78%), hsl(217, 33%, 85%));
  --gradient-subtle: linear-gradient(180deg, hsl(0, 0%, 4%), hsl(217, 33%, 6%));
  --gradient-accent: linear-gradient(45deg, hsl(217, 33%, 8%), hsl(217, 33%, 12%));
  --gradient-hero: linear-gradient(135deg, hsl(0, 0%, 4%) 0%, hsl(217, 33%, 6%) 50%, hsl(217, 33%, 8%) 100%);
}

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

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-feature-settings: "rlig" 1, "calt" 1;
  background-color: var(--background);
  color: var(--foreground);
  line-height: 1.6;
  letter-spacing: -0.01em;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'DM Sans', 'Inter', system-ui, sans-serif;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Skip Link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 200;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--primary-foreground);
  background: var(--primary);
  border-radius: var(--radius);
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 1rem;
}

/* Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

@media (min-width: 768px) {
  .container {
    padding: 0 2rem;
  }
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: var(--transition-smooth);
}

.header.scrolled {
  background: color-mix(in srgb, var(--background) 80%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom-color: color-mix(in srgb, var(--border) 50%, transparent);
  box-shadow: var(--shadow-minimal);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  position: relative;
}

.logo {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  font-size: 1.125rem;
  color: var(--foreground);
  transition: var(--transition-smooth);
}

.logo-sub {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--muted-foreground);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.logo:hover {
  color: var(--primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.theme-toggle:hover {
  background: color-mix(in srgb, var(--muted) 50%, transparent);
  color: var(--foreground);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

/* Main Content */
.main-content {
  flex: 1;
  padding-top: 80px;
}

/* Sections */
.section {
  padding: 3rem 0;
}

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

.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--foreground);
}

.section-subtitle {
  font-size: 1rem;
  color: var(--muted-foreground);
  max-width: 600px;
}

/* Filter Buttons */
.filter-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 2.5rem;
}

.filter-btn {
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-foreground);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 9999px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.filter-btn:hover {
  background: var(--secondary);
  color: var(--foreground);
  border-color: var(--muted-foreground);
}

.filter-btn.active {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
}

/* Projects Grid */
.projects-grid {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .projects-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Empty State */
.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

.empty-state p {
  font-size: 0.9375rem;
  color: var(--muted-foreground);
}

/* Project Card */
.project-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  border-left: 4px solid transparent;
  transition: border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

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

.project-card-content {
  padding: 1.5rem;
}

.project-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.project-category {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--primary);
  background: var(--accent);
  border-radius: 9999px;
}

.project-card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.project-status {
  font-size: 0.6875rem;
  font-weight: 600;
  color: hsl(142, 71%, 35%);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

[data-theme="dark"] .project-status {
  color: hsl(142, 71%, 55%);
}

.project-year {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-foreground);
  font-family: 'JetBrains Mono', monospace;
}

.project-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--foreground);
}

.project-context {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  margin-bottom: 0.75rem;
}

.project-description {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-type {
  display: inline-block;
  margin-top: auto;
  padding: 0.25rem 0.625rem;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--primary);
  background: var(--accent);
  border-radius: calc(var(--radius) - 2px);
  letter-spacing: 0.02em;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--card);
  border-radius: var(--radius);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.5rem 1.5rem 0;
  gap: 1rem;
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--foreground);
}

.modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: var(--secondary);
  border-radius: var(--radius);
  color: var(--muted-foreground);
  cursor: pointer;
  flex-shrink: 0;
  transition: var(--transition-smooth);
}

.modal-close:hover {
  background: var(--border);
  color: var(--foreground);
}

.modal-body {
  padding: 1.5rem;
}

.modal-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.modal-meta-item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.modal-meta-item svg {
  width: 16px;
  height: 16px;
}

.modal-description {
  font-size: 0.9375rem;
  color: var(--foreground);
  margin-bottom: 1.5rem;
  line-height: 1.7;
}

.modal-section-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
  margin-bottom: 0.75rem;
}

.modal-highlights {
  list-style: none;
  margin-bottom: 1.5rem;
}

.modal-highlights li {
  position: relative;
  padding-left: 1.25rem;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  color: var(--foreground);
}

.modal-highlights li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.5rem;
  width: 6px;
  height: 6px;
  background: var(--primary);
  border-radius: 50%;
}

.modal-project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
  height: 2.25rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--foreground);
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
  border-radius: calc(var(--radius) - 2px);
  transition: var(--transition-smooth);
}

.modal-project-link:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.modal-project-link svg {
  width: 16px;
  height: 16px;
}

/* Footer */
.footer {
  position: relative;
  padding: 4rem 0;
  border-top: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
  background: var(--gradient-accent);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  overflow: hidden;
}

.footer::before,
.footer::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  pointer-events: none;
}

.footer::before {
  width: 300px;
  height: 300px;
  background: hsl(217, 33%, 90%);
  top: -100px;
  right: -50px;
}

.footer::after {
  width: 200px;
  height: 200px;
  background: hsl(217, 33%, 85%);
  bottom: -80px;
  left: -30px;
}

[data-theme="dark"] .footer::before {
  background: hsl(217, 33%, 15%);
}

[data-theme="dark"] .footer::after {
  background: hsl(217, 33%, 12%);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.5rem;
  position: relative;
  z-index: 1;
}

.footer-text {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
}

.footer-social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  color: var(--muted-foreground);
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
  border-radius: calc(var(--radius) - 2px);
  transition: var(--transition-smooth);
}

.footer-social-link:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.footer-social-link svg {
  width: 16px;
  height: 16px;
}

.cv-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 2.25rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--foreground);
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
  border-radius: calc(var(--radius) - 2px);
  transition: var(--transition-smooth);
}

.cv-link:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.cv-link svg {
  width: 16px;
  height: 16px;
}

/* Back to Top */
.back-to-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  background: var(--primary);
  color: var(--primary-foreground);
  border: none;
  border-radius: 9999px;
  cursor: pointer;
  box-shadow: var(--shadow-professional);
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top:hover {
  box-shadow: var(--shadow-dramatic);
  transform: translateY(-4px);
}

.back-to-top svg {
  width: 20px;
  height: 20px;
}

/* Animations */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeIn 0.6s ease-out forwards;
}

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

.stagger-1 { animation-delay: 0.1s; }

.scroll-reveal {
  opacity: 0;
  transform: translateY(20px);
}

.scroll-reveal.revealed {
  animation: fadeInUp 0.5s ease-out forwards;
}

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

/* Loading */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}
