/* ========== Global Styles ========== */
:root {
  --clr-bg: #f3f3f3;
  --clr-primary: #1f2937;
  --clr-accent: #1e3a8a;
  --clr-light: #ffffff;
  --clr-muted: #6b7280;

  /* Personal flair */
  --clr-gradient-start: #1e3a8a;
  --clr-gradient-end: #475569;

  --fs-base: 16px;
  --fs-sm: 0.875rem;
  --fs-lg: 1.25rem;
  --fs-xl: 1.8rem;

  --radius: 10px;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

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

body {
  font-family: "Poppins", sans-serif;
  background: var(--clr-bg);
  color: var(--clr-primary);
  line-height: 1.6;
}

img {
  max-width: 100%;
  display: block;
}

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

.container {
  width: min(90%, 1100px);
  margin-inline: auto;
}

.section {
  padding: 4rem 0;
}

/* ========== Navigation ========== */
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: var(--clr-light);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.nav__brand {
  margin-right: auto;
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--clr-accent);
}

.nav__links {
  list-style: none;
  display: flex;
  gap: 2rem;
}

.nav__links a {
  font-weight: 500;
  transition: color 0.3s ease;
}

.nav__links a:hover {
  color: var(--clr-accent);
}

/* ========== Hero ========== */
.hero {
  padding: 6rem 0 4rem;
  background: linear-gradient(135deg, var(--clr-gradient-start), var(--clr-gradient-end));
  color: var(--clr-light);
  text-align: center;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 700;
}

.hero h2 {
  font-size: 1.5rem;
  font-weight: 400;
  margin-top: 1rem;
}

.hero__socials {
  margin: 1.5rem 0;
}

.hero__socials a {
  font-size: 2rem;
  color: var(--clr-dark);
  margin: 0 0.75rem;
  transition: transform 0.2s ease-in-out;
  display: inline-block;
}

.hero__socials a:hover {
  transform: scale(1.2);
}

.hero__cta {
  margin-top: 2rem;
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 500;
  transition: transform 0.2s ease;
}

.btn--primary {
  background: var(--clr-light);
  color: var(--clr-primary);
}

.btn--secondary {
  background: transparent;
  border: 2px solid var(--clr-light);
  color: var(--clr-light);
}

.btn:hover {
  transform: translateY(-3px);
}

.btn--secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* ========== Contact Section ========== */
.section--contact {
  text-align: center;
}

.section--contact a.btn {
  margin-top: 1rem;
}

/* ========== About Section ========== */
.section--about p {
  font-size: var(--fs-lg);
}

/* ========== Category Heading ========== */
.category-heading {
  margin-top: 3rem;
  margin-bottom: 1rem;
  font-size: var(--fs-xl);
  color: var(--clr-primary);
}

/* ========== Projects Grid ========== */
.project-grid {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  align-items: center;
}

.project-tile {
  display: grid;
  grid-template-columns: 260px 1fr; /* fixed image column + flexible description */
  width: 1000px;      /* fixed overall width */
  margin: 0 auto;     /* centered within the grid container */
  background: var(--clr-light);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.project-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  grid-row: 1 / -1; /* ensure it spans full tile height */
}

.project-info {
  padding: 1rem;
  grid-column: 2;
  font-size: 0.9rem; /* shrink overall text */
  line-height: 1.4;
}

.project-info h3 {
  font-size: 1.25rem; /* smaller headline inside tile */
  margin: 0;
}

.project-info h4 {
  font-size: 1rem; /* following hierarchy */
  margin-top: 0.75em;
  margin-bottom: 0.25em;
  font-weight: 600;
}

.project-info .overlay-list {
  margin-left: 1.5em;
  font-size: 0.85rem; /* keep bullets slightly smaller */
}

.project-info p {
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

/* --- Project Tags --- */
.project-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.5rem 0 0;
}

.project-tags li {
  background: var(--clr-accent);
  color: #fff;
  font-size: var(--fs-sm);
  padding: 0.15rem 0.6rem;
  border-radius: var(--radius);
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
  .project-tile {
    grid-template-columns: 1fr; /* stack image above text on narrow screens */
    grid-template-rows: auto auto;
  }
}

/* ========== Footer ========== */
.footer {
  text-align: center;
  padding: 2rem 0;
  background: var(--clr-light);
  color: var(--clr-muted);
  font-size: var(--fs-sm);
  box-shadow: var(--shadow) inset 0 6px 12px -6px rgba(0, 0, 0, 0.05);
}

/* ========== Navigation Brand ========== */
.nav__brand {
  font-weight: 600;
  font-size: var(--fs-lg);
  color: var(--clr-primary);
}

/* Brighter brand color in dark theme */
.dark-theme .nav__brand {
  color: #cbd5ff; /* soft light blue for contrast */
}

/* ========== Theme Toggle Button ========== */
.theme-toggle {
  margin-left: 2rem;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--clr-primary);
  transition: transform 0.2s ease;
  display: flex;
  align-items: center;
}
.theme-toggle:hover { transform: scale(1.2); }

/* ========== Dark Theme Overrides ========== */
.dark-theme {
  --clr-bg: #0f172a;
  --clr-primary: #f1f5f9;
  --clr-light: #1e293b;
  --clr-muted: #94a3b8;
  --clr-accent: #3a4db9;
  --clr-gradient-start: #1e293b;
  --clr-gradient-end: #0f172a;
}

/* Dark theme overrides for hero/text contrast */
.dark-theme .hero h1,
.dark-theme .hero h2,
.dark-theme .hero p {
  color: var(--clr-primary);
}

.dark-theme .hero__socials a {
  color: var(--clr-primary);
}

.dark-theme .btn--primary {
  background: transparent;
  border: 2px solid #ffffff; /* white border for contrast */
}

.dark-theme .btn--primary:hover {
  background: #ffffff;
  color: var(--clr-bg);
}

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

.dark-theme .btn--secondary:hover {
  background: var(--clr-primary);
  color: var(--clr-bg);
}

/* ========== Scroll Animation ========== */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}
