/* ============================================
   CSS Variables & Theme System - Cafe Minimalist (Dark Mode Default)
   ============================================ */
:root {
  /* Cafe Theme - Dark Mode */
  --bg-primary: #1a1614;
  --bg-secondary: #2d2624;
  --bg-tertiary: #3d3432;
  --text-primary: #f5f0eb;
  --text-secondary: #c4b8b0;
  --text-tertiary: #8a7a70;
  --accent-primary: #c4a77d;
  --accent-secondary: #d4b896;
  --accent-tertiary: #a08060;
  --accent-gradient: linear-gradient(135deg, #c4a77d 0%, #d4b896 100%);
  --accent-glow: rgba(196, 167, 125, 0.3);
  --border-color: #3d3432;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.3);
  --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.35);
  --card-bg: #2d2624;
  --nav-bg: rgba(26, 22, 20, 0.9);
  --overlay-bg: rgba(0, 0, 0, 0.7);
  
  /* Spacing */
  --container-width: 1200px;
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 2rem;
  --spacing-lg: 4rem;
  --spacing-xl: 6rem;
  
  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
  
  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-theme: 0.35s ease;
}

/* ============================================
   Light Mode Theme - Cafe Minimalist
   ============================================ */
[data-theme="light"] {
  /* Cafe Theme - Light Mode */
  --bg-primary: #f8f4f0;
  --bg-secondary: #ffffff;
  --bg-tertiary: #ebe4dc;
  --text-primary: #2d2624;
  --text-secondary: #5a4a42;
  --text-tertiary: #8a7a70;
  --accent-primary: #8b6f4c;
  --accent-secondary: #a08060;
  --accent-tertiary: #6b5a4a;
  --accent-gradient: linear-gradient(135deg, #8b6f4c 0%, #a08060 100%);
  --accent-glow: rgba(139, 111, 76, 0.22);
  --border-color: #d4c8be;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.15);
  --card-bg: #ffffff;
  --nav-bg: rgba(255, 255, 255, 0.95);
  --overlay-bg: rgba(0, 0, 0, 0.5);
}

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

html {
  scroll-behavior: smooth;
}

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

/* Background gradient effect */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(ellipse 60% 50% at 20% 10%, var(--accent-glow) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 80% 90%, var(--accent-glow) 0%, transparent 60%);
  pointer-events: none;
  z-index: -1;
  transition: background var(--transition-theme);
}

::selection {
  background: var(--accent-primary);
  color: white;
}

/* ============================================
   Navigation
   ============================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  transition: all var(--transition-base);
  box-shadow: 0 4px 12px rgba(255, 51, 51, 0.05);
}

.nav-container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 800;
  font-size: 1.25rem;
  transition: all var(--transition-fast);
  letter-spacing: 0.05em;
}

.logo-link:hover {
  transform: translateY(-2px);
  color: var(--accent-primary);
}

.logo-symbol {
  font-size: 1.5rem;
  filter: drop-shadow(0 0 8px rgba(255, 51, 51, 0.3));
  transition: all var(--transition-fast);
}

.logo-link:hover .logo-symbol {
  filter: drop-shadow(0 0 12px rgba(255, 51, 51, 0.5));
  transform: scale(1.1);
}

.theme-toggle {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
  color: var(--accent-primary);
}

.theme-toggle:hover {
  transform: scale(1.1);
  border-color: var(--accent-primary);
  background: rgba(255, 51, 51, 0.1);
  box-shadow: 0 0 12px var(--accent-glow);
}

.sun-icon,
.moon-icon {
  position: absolute;
  transition: all var(--transition-base);
}

/* Theme toggle icon visibility */
[data-theme="dark"] .sun-icon {
  opacity: 1;
  transform: rotate(0deg);
}

[data-theme="dark"] .moon-icon {
  opacity: 0;
  transform: rotate(90deg);
}

[data-theme="light"] .sun-icon {
  opacity: 0;
  transform: rotate(-90deg);
}

[data-theme="light"] .moon-icon {
  opacity: 1;
  transform: rotate(0deg);
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  padding: 8rem 2rem 4rem;
  max-width: var(--container-width);
  margin: 0 auto;
  position: relative;
}

.hero-content {
}

.hero-badge {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: rgba(255, 51, 51, 0.1);
  border: 1px solid var(--accent-primary);
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent-primary);
  margin-bottom: 1.5rem;
  letter-spacing: 0.05em;
  box-shadow: inset 0 0 20px rgba(255, 51, 51, 0.05);
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
}

.title-line {
  display: block;
}

.highlight {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 900;
  position: relative;
}

.highlight::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 0%;
  height: 2px;
  background: var(--accent-gradient);
  opacity: 0;
}

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

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

.btn {
  padding: 1rem 2.5rem;
  border-radius: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  letter-spacing: 0.05em;
  position: relative;
  overflow: hidden;
  transform: translateY(0);
}

.btn-primary {
  background: var(--accent-gradient);
  color: white;
  box-shadow: 0 8px 24px rgba(255, 51, 51, 0.3);
  border: 2px solid transparent;
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.1);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(255, 51, 51, 0.4);
}

.btn-primary:hover::before {
  opacity: 1;
}

.btn-secondary {
  background: rgba(255, 51, 51, 0.1);
  color: var(--accent-primary);
  border: 2px solid var(--accent-primary);
}

.btn-secondary:hover {
  background: var(--accent-primary);
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(255, 51, 51, 0.3);
}

/* Hero Visual - Floating Cards */
.hero-visual {
  position: relative;
  height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.floating-card {
  position: absolute;
  background: var(--card-bg);
  border: 2px solid var(--border-color);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  transition: all var(--transition-base);
  backdrop-filter: blur(8px);
}

.floating-card:hover {
  transform: translateY(-12px);
  border-color: var(--accent-primary);
  box-shadow: 0 20px 40px rgba(255, 51, 51, 0.3), inset 0 0 20px rgba(255, 51, 51, 0.05);
  background: rgba(255, 51, 51, 0.05);
}

.card-icon {
  font-size: 3rem;
  filter: drop-shadow(0 0 8px rgba(255, 51, 51, 0.2));
}

.card-label {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--accent-primary);
  letter-spacing: 0.05em;
}

.card-1 {
  top: 10%;
  left: 10%;
}

.card-2 {
  top: 20%;
  right: 5%;
}

.card-3 {
  bottom: 25%;
  left: 5%;
}

.card-4 {
  bottom: 15%;
  right: 15%;
}

/* ============================================
   About Section
   ============================================ */
.about {
  padding: var(--spacing-xl) 2rem;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.container {
  max-width: var(--container-width);
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: var(--spacing-lg);
}

.section-badge {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: rgba(255, 51, 51, 0.1);
  border: 1px solid var(--accent-primary);
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent-primary);
  margin-bottom: 1rem;
  letter-spacing: 0.05em;
  box-shadow: inset 0 0 20px rgba(255, 51, 51, 0.05);
}

.section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 900;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: start;
  max-width: 800px;
  margin: 0 auto;
}

.about-text {
  font-size: 1.125rem;
  color: var(--text-secondary);
}

.about-text p {
  margin-bottom: 1.5rem;
}

.about-list {
  list-style: none;
  margin: 2rem 0;
}

.about-list li {
  padding: 0.75rem 0;
  padding-left: 1.5rem;
  position: relative;
  transition: all var(--transition-fast);
}

.about-list li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent-primary);
  font-weight: 900;
  font-size: 1.2em;
}

.about-list li:hover {
  padding-left: 2rem;
  color: var(--accent-primary);
}

.about-list strong {
  color: var(--text-primary);
}

/* ============================================
   Projects Section
   ============================================ */
.projects {
  padding: var(--spacing-xl) 2rem;
  background: var(--bg-primary);
}

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

.project-card {
  background: var(--card-bg);
  border: 2px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
  transition: all var(--transition-base);
  display: flex;
  flex-direction: column;
  position: relative;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-gradient);
  opacity: 0;
  transition: opacity var(--transition-base);
  z-index: 1;
}

.project-card:hover {
  transform: translateY(-12px);
  box-shadow: 0 20px 50px rgba(255, 51, 51, 0.25);
  border-color: var(--accent-primary);
  background: rgba(255, 51, 51, 0.03);
}

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

.project-image {
  height: 220px;
  background: linear-gradient(135deg, rgba(255, 51, 51, 0.1) 0%, rgba(255, 51, 51, 0.05) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border-color);
}

.project-placeholder {
  color: var(--accent-primary);
  transition: all var(--transition-base);
  opacity: 0.6;
}

.project-card:hover .project-placeholder {
  transform: scale(1.2);
  opacity: 1;
  filter: drop-shadow(0 0 12px rgba(255, 51, 51, 0.4));
}

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

.project-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
  color: var(--text-primary);
  letter-spacing: 0.05em;
}

.project-description {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  flex: 1;
  line-height: 1.7;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.tag {
  padding: 0.5rem 1rem;
  background: rgba(255, 51, 51, 0.1);
  border: 1px solid var(--accent-primary);
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-primary);
  letter-spacing: 0.05em;
  transition: all var(--transition-fast);
}

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

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--accent-primary);
  font-weight: 700;
  text-decoration: none;
  transition: all var(--transition-fast);
  letter-spacing: 0.05em;
  width: fit-content;
}

.project-link:hover {
  gap: 1.25rem;
  filter: drop-shadow(0 0 8px rgba(255, 51, 51, 0.3));
}

.project-link svg {
  transition: transform var(--transition-fast);
}

.project-link:hover svg {
  transform: translateX(4px);
}

/* ============================================
   Footer
   ============================================ */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: var(--spacing-lg) 2rem var(--spacing-md);
}

.footer-content {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 4rem;
  margin-bottom: var(--spacing-md);
}

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

.footer-brand h3 {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.footer-brand p {
  color: var(--text-secondary);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer-links h4 {
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  letter-spacing: 0.05em;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.footer-links a:hover {
  color: var(--accent-primary);
  transform: translateX(6px);
}

.footer-links a svg {
  transition: transform var(--transition-fast);
}

.footer-links a:hover svg {
  transform: scale(1.2);
}

.footer-bottom {
  padding-top: var(--spacing-md);
  border-top: 1px solid var(--border-color);
  text-align: center;
  color: var(--text-tertiary);
  font-size: 0.875rem;
}

/* ============================================
   Animations & Effects
   ============================================ */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
}

@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(255, 51, 51, 0.3);
  }
  50% {
    box-shadow: 0 0 40px rgba(255, 51, 51, 0.5);
  }
}

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

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

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 968px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: 6rem;
    text-align: center;
  }
  
  .hero-visual {
    height: 400px;
    order: -1;
  }
  
  .hero-description {
    margin-left: auto;
    margin-right: auto;
  }
  
  .hero-cta {
    justify-content: center;
  }
  
  .about-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .footer-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .projects-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .nav-container {
    padding: 1rem;
  }
  
  .logo-link {
    font-size: 1rem;
  }
  
  .logo-symbol {
    font-size: 1.2rem;
  }
  
  .hero {
    padding: 5rem 1rem 2rem;
  }
  
  .hero-title {
    font-size: 2rem;
  }
  
  .hero-cta {
    flex-direction: column;
  }
  
  .btn {
    width: 100%;
    justify-content: center;
    padding: 0.875rem 1.5rem;
  }
  
  .section-title {
    font-size: 1.75rem;
  }
  
  .about,
  .projects {
    padding: var(--spacing-md) 1rem;
  }
  
  .floating-card {
    padding: 1rem;
  }
  
  .card-icon {
    font-size: 2rem;
  }
  
  .project-card {
    border-radius: 12px;
  }
  
  .footer-links {
    flex-direction: column;
    gap: 0.5rem;
  }
}

/* Extra small devices */
@media (max-width: 480px) {
  .hero-title {
    font-size: 1.75rem;
  }
  
  .hero-description {
    font-size: 1rem;
  }
  
  .project-title {
    font-size: 1.25rem;
  }
  
  .project-description {
    font-size: 0.9rem;
  }
  
  .tag {
    font-size: 0.7rem;
    padding: 0.4rem 0.8rem;
  }
}

/* Large devices */
@media (min-width: 1400px) {
  .container {
    max-width: 1400px;
  }
  
  .hero-title {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
  }
}

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

/* Smooth transitions for all interactive elements */
button, a {
  transition: all var(--transition-fast);
}

/* Focus visible for accessibility */
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}
