/* =====================
   CSS Variables & Three-Color System
   ===================== */
:root {
  /* Base Colors */
  --bg: #f8f9fa;
  --surface: #ffffff;
  --text: #1a202c;
  --text-light: #4a5568;
  --muted: #718096;
  --border: #e2e8f0;
  
  /* Brand Colors - Strict Three-Color System */
  --primary: #fffeff;
  --secondary: #14326f;
  --accent: #d73a35;
  
  /* Shadows - Neutral only */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.12);
  
  /* Spacing */
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}

/* =====================
   Accessibility
   ===================== */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--secondary);
  color: var(--primary);
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  z-index: 9999;
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  left: 12px;
  top: 12px;
}

/* =====================
   Navbar
   ===================== */
.site-header {
  backdrop-filter: blur(10px);
  background: var(--surface) !important;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  border-bottom: 1px solid var(--border);
}

.navbar-brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--secondary) !important;
  transition: all 0.2s ease;
}

.navbar-brand:hover {
  color: var(--accent) !important;
}

.nav-link {
  font-weight: 500;
  color: var(--text) !important;
  transition: all 0.2s ease;
  position: relative;
  padding: 0.5rem 1rem !important;
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 1rem;
  right: 1rem;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--secondary) !important;
}

.nav-link:hover::after,
.nav-link.active::after {
  transform: scaleX(1);
}

/* =====================
   Hero Section
   ===================== */
.hero-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 6rem 0;
  background: var(--surface);
  position: relative;
  overflow: hidden;
}

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

/* =====================
   Hero Content
   ===================== */
.hero-content {
  max-width: 600px;
}

.hero-subtitle {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeInUp 0.6s ease forwards;
}

.hero-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  color: var(--secondary);
  opacity: 0;
  animation: fadeInUp 0.6s ease 0.1s forwards;
}

.hero-description {
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  line-height: 1.8;
  color: var(--text-light);
  margin-bottom: 2.5rem;
  opacity: 0;
  animation: fadeInUp 0.6s ease 0.2s forwards;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
  opacity: 0;
  animation: fadeInUp 0.6s ease 0.3s forwards;
}

.hero-contact-hint {
  font-size: 0.95rem;
  color: var(--muted);
  margin: 0;
  opacity: 0;
  animation: fadeInUp 0.6s ease 0.4s forwards;
}

/* =====================
   Hero Photo
   ===================== */
.hero-photo-wrapper {
  margin: 0;
  display: flex;
  justify-content: center;
  opacity: 0;
  animation: fadeInScale 0.8s ease 0.2s forwards;
  position: relative;
}

.hero-photo-frame {
  width: 100%;
  max-width: 450px;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  transition: all 0.4s ease;
  position: relative;
  border: 4px solid var(--secondary);
}

.hero-photo-frame:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}

.hero-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.hero-photo-frame:hover .hero-photo-img {
  transform: scale(1.05);
}

/* =====================
   Buttons
   ===================== */
.btn {
  border-radius: var(--radius);
  padding: 0.75rem 1.75rem;
  font-weight: 600;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.btn-lg {
  padding: 0.875rem 2rem;
  font-size: 1rem;
}

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

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

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

.btn-outline-dark:hover {
  background: var(--secondary);
  border-color: var(--secondary);
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

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

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

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

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

/* =====================
   Section Styling
   ===================== */
.section-about,
.section-features,
.section-projects,
.section-contact {
  padding: 6rem 0;
}

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

.section-features {
  background: var(--surface);
}

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

.section-contact {
  background: var(--surface);
}

/* Section Headers */
.section-head {
  position: relative;
}

.section-title {
  font-size: clamp(2rem, 4vw, 2.5rem);
  font-weight: 800;
  margin-bottom: 0;
  color: var(--secondary);
}

.section-underline {
  width: 60px;
  height: 4px;
  background: var(--accent);
  margin: 1rem auto 0;
  border-radius: 2px;
}

.section-subtitle {
  font-size: 1.1rem;
  color: var(--text-light);
  margin-top: 1rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.7;
}

/* =====================
   About Section
   ===================== */
.about-card {
  border: 2px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 3rem;
  transition: all 0.3s ease;
  position: relative;
}

.about-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--secondary);
}

.about-text {
  font-size: 1.15rem;
  line-height: 1.8;
  color: var(--text-light);
  margin: 0;
  text-align: center;
}

/* =====================
   Feature Cards
   ===================== */
.feature-card {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: var(--surface);
  padding: 2.5rem 2rem;
  transition: all 0.3s ease;
  text-align: center;
  position: relative;
}

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

.feature-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--secondary);
  border-radius: var(--radius) var(--radius) 0 0;
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

.feature-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.5rem;
  background: var(--secondary);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  transition: all 0.3s ease;
}

.feature-card:hover .feature-icon {
  background: var(--accent);
  transform: scale(1.1);
}

.feature-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--secondary);
}

.feature-description {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-light);
  margin: 0;
}

/* =====================
   Project Cards
   ===================== */
.project-card {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: var(--surface);
  overflow: hidden;
  transition: all 0.3s ease;
}

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

.project-image-placeholder {
  height: 200px;
  background: var(--secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.project-number {
  font-size: 4rem;
  font-weight: 800;
  color: rgba(255, 254, 255, 0.3);
  position: relative;
  z-index: 1;
}

.project-banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-card .card-body {
  padding: 2rem;
}

.project-category-badge {
  margin-bottom: 0.75rem;
}

.project-category-badge .badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--accent);
  color: var(--primary);
}

.project-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--secondary);
}

.project-stack {
  font-size: 0.875rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 1rem;
}

.project-description {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-light);
  margin: 0;
}

.project-card .card-footer {
  background: transparent;
  border: none;
  padding: 0 2rem 2rem;
}

/* =====================
   Contact Section
   ===================== */
.contact-card {
  border: 2px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 3rem;
  transition: all 0.3s ease;
}

.contact-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--secondary);
}

.form-label {
  font-weight: 600;
  color: var(--secondary);
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.form-control {
  border-radius: var(--radius);
  border: 2px solid var(--border);
  padding: 0.875rem 1.25rem;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: var(--surface);
}

.form-control:focus {
  border-color: var(--secondary);
  box-shadow: 0 0 0 4px rgba(20, 50, 111, 0.1);
  outline: none;
}

.form-control::placeholder {
  color: var(--muted);
}

.contact-disclaimer {
  font-size: 0.9rem;
  color: var(--muted);
  text-align: center;
  margin-top: 2rem;
  margin-bottom: 0;
}

/* =====================
   Footer
   ===================== */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.footer-text {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0;
}

.footer-right {
  display: flex;
  gap: 2rem;
}

.footer-link {
  font-size: 0.9rem;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
  position: relative;
}

.footer-link::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.footer-link:hover {
  color: var(--secondary);
}

.footer-link:hover::after {
  transform: scaleX(1);
}

@media (min-width: 768px) {
  .footer-content {
    flex-direction: row;
    justify-content: space-between;
  }
}

/* =====================
   Utility Classes
   ===================== */
.link-muted {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}

.link-muted:hover {
  color: var(--secondary);
}

.link-accent {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.link-accent:hover {
  color: var(--secondary);
  text-decoration: underline;
}

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

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* =====================
   Responsive
   ===================== */
@media (max-width: 991px) {
  .hero-section {
    min-height: auto;
    padding: 4rem 0;
  }

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

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

  .hero-photo-frame {
    max-width: 350px;
    margin: 0 auto;
  }

  .section-about,
  .section-features,
  .section-projects,
  .section-contact {
    padding: 4rem 0;
  }
}

@media (max-width: 575px) {
  .hero-section {
    padding: 3rem 0;
  }

  .hero-buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-lg {
    width: 100%;
  }

  .hero-photo-frame {
    max-width: 280px;
  }

  .about-card,
  .contact-card {
    padding: 2rem;
  }

  .feature-card {
    padding: 2rem 1.5rem;
  }

  .project-card .card-body,
  .project-card .card-footer {
    padding: 1.5rem;
  }
}

/* =====================
   Projects Page Styles
   ===================== */
.page-header {
  padding: 5rem 0 3rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.page-title {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 800;
  color: var(--secondary);
  margin-bottom: 1rem;
}

.page-description {
  font-size: 1.15rem;
  line-height: 1.8;
  color: var(--text-light);
  margin: 0;
}

.section-filter {
  padding: 3rem 0;
  background: var(--bg);
}

.category-filter-wrapper {
  display: inline-block;
}

.category-btn {
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

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

.section-projects-grid {
  padding: 3rem 0 6rem;
  background: var(--bg);
}

/* CTA Section */
.section-cta {
  padding: 6rem 0;
  background: var(--surface);
}

.cta-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 4rem 3rem;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.cta-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--secondary);
}

.cta-title {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 800;
  color: var(--secondary);
  margin-bottom: 1rem;
}

.cta-description {
  font-size: 1.15rem;
  line-height: 1.8;
  color: var(--text-light);
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

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

@media (max-width: 575px) {
  .page-header {
    padding: 4rem 0 2rem;
  }

  .section-filter {
    padding: 2rem 0;
  }

  .category-filter-wrapper .btn-group {
    display: flex;
    flex-direction: column;
    width: 100%;
  }

  .category-btn {
    width: 100%;
    margin-bottom: 0.5rem;
    border-radius: var(--radius) !important;
  }

  .section-projects-grid {
    padding: 2rem 0 4rem;
  }

  .section-cta {
    padding: 4rem 0;
  }

  .cta-card {
    padding: 3rem 2rem;
  }

  .cta-buttons {
    flex-direction: column;
  }

  .cta-buttons .btn {
    width: 100%;
  }
}

/* =====================
   Reduced Motion
   ===================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}