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

:root {
  --primary-bg: #ededed;
  --secondary-bg: #ededed;
  --card-bg: #ffffff;
  --text-primary: #1a1a1a;
  --text-secondary: #666666;
  --gradient-purple: #c587b2;
  --gradient-blue: #458bdc;
  --gradient-yellow: #f4b942;
  --gradient-orange: #d29511;
}

/* Dark Mode Colors */
body.dark-mode {
  --primary-bg: #2a2a2a;
  --secondary-bg: #1e1e1e;
  --card-bg: #2d2d2d;
  --text-primary: #ffffff;
  --text-secondary: #e8e4e1;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: var(--primary-bg);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.header {
  padding: 24px 0;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
}

.nav-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-weight: 600;
  font-size: 16px;
  color: var(--text-primary);
  padding: 0 12px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav a {
  text-decoration: none;
  color: #000 !important;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.3s;
}

.nav a:hover {
  color: #222 !important;
}

.theme-toggle {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  transition: transform 0.3s ease;
}

.theme-toggle:hover {
  transform: scale(1.1);
}

.theme-toggle .icon-sun {
  filter: invert(0) brightness(0) saturate(100%) !important;
}

/* Hero Section */
.hero {
  padding: 0 60px 0 80px;
  background-color: var(--primary-bg);
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 30px 0 rgba(0, 0, 0, 0.15);
}

.hero-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.hero-text h2 {
  font-size: 56px;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 16px;
}

.gradient-text {
  background: var(--gradient-purple);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 18px;
  color: var(--text-secondary);
  margin-top: 16px;
}

.hero-image {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: visible;
}

.hero-image img {
  width: 150%;
  object-fit: contain;
  object-position: center;
  margin-right: 64px;
}

/* Section Styles */
.section {
  padding: 70px 0 0 0;
  background-color: var(--secondary-bg);
}

.engineering-section {
  background-color: var(--secondary-bg);
}

.section-title {
  font-size: 42px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 24px;
}

.highlight-blue {
  color: var(--gradient-blue);
}

.highlight-yellow {
  color: var(--gradient-yellow);
}

.highlight-purple {
  color: var(--gradient-purple);
}

.word-cycle {
  display: inline-block;
  min-width: 200px;
}

.word-cycle::before {
  content: "Creatives";
  animation: cycle 5s ease forwards;
  color: var(--gradient-blue);
}

@keyframes cycle {
  0%,
  22% {
    content: "Creatives";
    color: var(--gradient-blue);
  }
  25%,
  47% {
    content: "Engineers";
    color: var(--gradient-yellow);
  }
  50%,
  72% {
    content: "Storytellers";
    color: var(--gradient-orange);
  }
  75%,
  100% {
    content: "Developers";
    color: var(--gradient-purple);
  }
}

/* --- Software Engineering Cards Grid --- */
.projects-flex {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: repeat(2, 200px);
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.projects-flex a {
  display: block;
  text-decoration: none;
  height: 100%;
}

.project-card {
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  transition: transform 0.3s, box-shadow 0.3s;
  cursor: pointer;
  min-height: 140px;
  height: 100%;
  background-color: var(--card-bg);
}

.project-card.large {
  grid-row: span 2;
  height: 424px; /* Sum of two rows (200px * 2) plus gap (24px) */
}

.project-card.medium {
  height: 200px;
  grid-row: 1;
  grid-column: 2;
}

.project-small-row {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  gap: 24px;
  height: 200px;
}

.project-small-row a {
  flex: 1;
}

.project-card:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  z-index: 2;
}

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

.project-card .card-content {
  width: 100%;
  height: 100%;
  position: absolute;
  display: flex;
  flex-direction: column; /* Stack children vertically */
  justify-content: flex-end; /* Align children to the bottom */
  align-items: flex-start; /* Align children to the left */
  padding: 24px;
  background: linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.55) 0%,
    rgba(0, 0, 0, 0) 100%
  );
  color: #fff;
  border-radius: 0 0 20px 20px;
}

.project-card .card-content h3 {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
}

.project-card .card-content p {
  font-size: 16px;
  color: #fff;
  margin: 0;
}

body.dark-mode .project-card {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark-mode .project-card:hover {
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}

/* About Section */
.social-links {
  text-align: center;
}

.social-links p {
  font-size: 14px;
  color: var(--text-secondary);
}

.social-links a {
  color: var(--gradient-blue);
  text-decoration: none;
  font-weight: 500;
}

.social-links a:hover {
  text-decoration: underline;
}

.about-section {
  background-color: var(--secondary-bg);
  padding-bottom: 60px;
}

.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  max-width: 1000px;
  margin: 0 auto;
}

.about-text {
  font-size: 16px;
  line-height: 1.8;
}

.about-text p {
  margin-bottom: 20px;
}

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

.about-image img {
  width: 100%;
  max-width: 400px;
  border-radius: 16px;
}

/* Footer */
.footer {
  background-color: var(--secondary-bg) !important;
  padding: 40px 0 24px 0;
  text-align: left;
  justify-content: space-around;
}

.footer p {
  font-size: 14px;
  color: var(--text-secondary);
  text-align: left;
}

.heart {
  color: #ff6b9d;
}

body.dark-mode .footer {
  border-top: 0 !important;
}

.theme-toggle-footer {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  transition: transform 0.3s ease;
}

.theme-toggle-footer:hover {
  transform: scale(1.1);
}

.theme-toggle-footer img,
.theme-toggle img {
  height: 22px;
  width: 22px;
  vertical-align: middle;
  transition: filter 0.2s;
  filter: invert(0) brightness(0) saturate(100%) !important;
}

body.dark-mode .theme-toggle-footer img {
  filter: invert(1) brightness(2) saturate(100%) !important;
}

.about-social img,
.footer-switch img {
  transition: filter 0.2s;
}

body.dark-mode .about-social img,
body.dark-mode .footer-switch img {
  filter: invert(1) brightness(2) saturate(100%) !important;
}

/* Tablet Styles */
@media (max-width: 920px) {
  .hero-text {
    padding: 80px 0px 0px 0px;
  }
}

/* Mobile Styles */
@media (max-width: 768px) {
  .hero {
    padding: 100px 10px 0 10px;
  }

  .hero-content {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .hero-text {
    padding: 0px;
    text-align: center;
  }

  .hero-text h2 {
    font-size: 42px;
  }

  .hero-image img {
    margin-right: 4px;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .project-card.large {
    grid-row: span 1;
  }

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

  .devrel-card.large {
    grid-column: span 1;
  }

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

  .about-content {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .hero {
    padding: 0px 0px 0px 0px;
  }

  body.dark-mode .logo {
    color: black;
  }

  .nav {
    gap: 16px;
  }

  .nav a {
    font-size: 13px;
  }

  .hero-text h1 {
    font-size: 32px;
  }

  .hero-subtitle {
    font-size: 16px;
  }

  .hero-content {
    display: flex;
    flex-direction: column-reverse;
    gap: 24px;
    padding-bottom: 24px;
  }

  .section-title {
    font-size: 32px;
  }

  .devrel-grid {
    grid-template-columns: 1fr;
  }

  .posts-grid {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 48px 0 0 0;
  }

  .projects-flex {
    grid-template-columns: 1fr;
    grid-template-rows: none;
  }

  .project-card.large,
  .project-card.medium,
  .project-card.small {
    height: 140px;
  }

  .project-small-row {
    grid-row: auto;
    grid-column: 1;
    flex-direction: column;
  }

  .section.devrel-section .project-small-row,
  .section.engineering-section .project-small-row {
    margin-bottom: 100px;
  }

  nav.nav a {
    display: none;
  }

  .section.about-section {
    padding-bottom: 24px;
  }
}
