/* ========================================
   GLOBAL RESET
======================================== */

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

html {
  scroll-behavior: smooth;
}

/* ========================================
   COLOR VARIABLES
======================================== */

:root {
  --bg: #f4f8f4;
  --card: #ffffff;
  --text: #1f2933;
  --muted: #5f6b7a;
  --primary: #3a7a57;
  --primary-dark: #28563d;
  --border: #d7e4da;
  --shadow: rgba(20, 40, 30, 0.08);
}

body.dark-mode {
  --bg: #121212;
  --card: #1e1e1e;
  --text: #f5f5f5;
  --muted: #b8c0cc;
  --primary: #4304a8;
  --primary-dark: #93c5fd;
  --border: #333333;
  --shadow: rgba(0, 0, 0, 0.35);
}

/* ========================================
   BASE PAGE STYLES
======================================== */

body {
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.7;
  color: var(--text);
  margin: 0;
  background:
    linear-gradient(rgba(255,255,255,0.35), rgba(255,255,255,0.35)),
    linear-gradient(to right, rgba(47, 111, 79, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(47, 111, 79, 0.06) 1px, transparent 1px),
    radial-gradient(circle at top left, rgba(58, 122, 87, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(40, 86, 61, 0.14), transparent 25%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg) 100%);
  background-size:
    auto,
    20px 20px,
    20px 20px,
    auto,
    auto,
    auto;
}

body.dark-mode {
  background:
    linear-gradient(rgba(0,0,0,0.35), rgba(0,0,0,0.35)),
    linear-gradient(to right, rgba(96, 165, 250, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(96, 165, 250, 0.06) 1px, transparent 1px),
    radial-gradient(circle at top left, rgba(96, 165, 250, 0.14), transparent 28%),
    radial-gradient(circle at top right, rgba(147, 197, 253, 0.10), transparent 25%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg) 100%);
}

p {
  margin-bottom: 14px;
}

ul {
  margin-left: 20px;
}

li {
  margin-bottom: 8px;
}

/* ========================================
   HEADER
======================================== */

header {
  text-align: center;
  padding: 60px 20px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
}

header h1 {
  font-size: 5.5rem;
  margin-bottom: 10px;
}

header p {
  font-size: 1.1rem;
  color: #e6eef6;
}

/* ========================================
   NAVIGATION
======================================== */

nav {
  margin-top: 20px;
}

nav a {
  display: inline-block;
  margin: 0 10px 10px;
  color: white;
  text-decoration: none;
  font-weight: bold;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

nav a:hover {
  background: rgba(255, 255, 255, 0.24);
  transform: translateY(-2px);
}

/* Options Menu */

.options-menu {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 2000;
}

.options-toggle {
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 10px 24px var(--shadow);
}

.options-panel {
  position: absolute;
  top: 58px;
  left: 0;
  min-width: 190px;
  padding: 14px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: 0 12px 32px var(--shadow);
  display: none;
  flex-direction: column;
  gap: 10px;
}

.options-panel.show {
  display: flex;
}

.options-panel a,
.options-panel button {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border-radius: 999px;
  border: none;
  background: var(--primary);
  color: white;
  text-align: center;
  text-decoration: none;
  font-weight: bold;
  cursor: pointer;
}

.options-panel a:hover,
.options-panel button:hover,
.options-toggle:hover {
  background: var(--primary-dark);
}

/* ========================================
   DARK MODE BUTTON
======================================== */

.theme-toggle {
  margin-top: 16px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  font-weight: bold;
}

.theme-toggle:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

/* ========================================
   MAIN LAYOUT
======================================== */

main {
  max-width: 950px;
  margin: 40px auto;
  padding: 0 20px;
}

section {
  background: var(--card);
  color: var(--text);
  margin-bottom: 24px;
  padding: 30px;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 10px 30px var(--shadow);
}

section h2 {
  color: var(--primary);
  margin-bottom: 12px;
  font-size: 1.5rem;
}

.section-intro {
  margin-bottom: 22px;
  color: var(--muted);
}

/* ========================================
   PROFILE LINKS
======================================== */

.profile-links {
  list-style: none;
  margin-left: 0;
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.profile-links li {
  margin-bottom: 0;
}

.profile-links a {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--primary);
  color: white;
  text-decoration: none;
  font-weight: bold;
}

.profile-links a:hover {
  background: var(--primary-dark);
}

/* ========================================
   PROJECT SECTION
======================================== */

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.project-card {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 10px 28px var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 36px var(--shadow);
}

.project-card h3 {
  color: var(--primary);
  font-size: 1.2rem;
}

.project-card p {
  margin-bottom: 0;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-tags span {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(47, 111, 79, 0.12);
  color: var(--primary-dark);
  font-size: 0.85rem;
  font-weight: 600;
}

.project-link {
  margin-top: auto;
  align-self: flex-start;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--primary);
  color: white;
  text-decoration: none;
  font-weight: bold;
}

.project-link:hover {
  background: var(--primary-dark);
}

/* ========================================
   SKILLS SECTION
======================================== */

.skills-layout {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
}

.skill-group {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 8px 24px var(--shadow);
}

.skill-group h3 {
  color: var(--primary);
  margin-bottom: 16px;
}

.skill-item {
  margin-bottom: 18px;
}

.skill-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-weight: bold;
  margin-bottom: 8px;
}

.skill-top span:last-child {
  color: var(--muted);
  font-size: 0.9rem;
}

.skill-bar {
  height: 10px;
  background: rgba(47, 111, 79, 0.12);
  border-radius: 999px;
  overflow: hidden;
}

.skill-bar div {
  height: 100%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 999px;
}

.skill-pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.skill-pill-list span {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(47, 111, 79, 0.12);
  color: var(--primary-dark);
  font-weight: bold;
  font-size: 0.9rem;
}

.featured-skill {
  grid-column: 1 / -1;
  border-left: 5px solid var(--primary);
}

/* ========================================
   DARK MODE SECTION ADJUSTMENTS
======================================== */

body.dark-mode .project-tags span,
body.dark-mode .skill-pill-list span {
  background: rgba(96, 165, 250, 0.14);
  color: var(--primary-dark);
}

body.dark-mode .skill-bar {
  background: rgba(96, 165, 250, 0.14);
}

/* ========================================
   FOOTER
======================================== */

footer {
  text-align: center;
  padding: 30px 20px;
  color: var(--muted);
}

/* ========================================
   RESPONSIVE DESIGN
======================================== */

@media (max-width: 600px) {
  header {
    padding: 45px 16px;
  }

  header h1 {
    font-size: 2rem;
  }

  section {
    padding: 22px;
  }

  .profile-links {
    flex-direction: column;
  }

  .profile-links a {
    text-align: center;
    width: 100%;
  }

  .project-link {
    width: 100%;
    text-align: center;
  }

  .skills-layout {
    grid-template-columns: 1fr;
  }

  .featured-skill {
    grid-column: auto;
  }
}

/* ========================================
   ANIMATIONS
======================================== */

nav a,
.theme-toggle,
.project-card,
.project-link,
.profile-links a {
  transition:
    background 0.2s ease,
    transform 0.2s ease,
    opacity 0.2s ease,
    box-shadow 0.22s ease;
}

/* Scroll Reveal Animation */

.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition:
    opacity 0.8s ease,
    transform 0.8s ease;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Card-Specific Scroll Reveal Animation */

.project-card.reveal,
.skill-card.reveal,
.skill-group.reveal {
  transform: translateY(30px) scale(0.98);
}

.project-card.reveal.active,
.skill-card.reveal.active,
.skill-group.reveal.active {
  transform: translateY(0) scale(1);
}

/* Back to Top Button */

.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-size: 1.5rem;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 10px 24px var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition:
    opacity 0.25s ease,
    transform 0.25s ease,
    visibility 0.25s ease,
    background 0.2s ease;
  z-index: 1000;
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--primary-dark);
  transform: translateY(-3px);
}

/* ========================= */
/* Thumbnail Gallery */
/* ========================= */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  margin-top: 2rem;
}

.gallery-thumbnail {
  width: 100%;
  height: 180px;
  object-fit: cover;

  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);

  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.gallery-thumbnail:hover {
  transform: scale(1.04);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
}

/* ========================= */
/* Lightbox */
/* ========================= */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);

  display: none;
  justify-content: center;
  align-items: center;

  padding: 30px;
  z-index: 9999;
}

.lightbox.active {
  display: flex;
}

.lightbox img {
  max-width: 95%;
  max-height: 90vh;
  object-fit: contain;

  border-radius: 12px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;

  background: transparent;
  border: none;
  color: white;

  font-size: 3rem;
  cursor: pointer;
}