/* Main stylesheet for personal site (dark mode default) */
:root {
  --bg: #1A1A1A;
  --bg-gradient: linear-gradient(145deg, #1A1A1A, #232323);
  --text: #e0e0e0;
  --primary: #2ecc71;
  --accent: #2ecc71;
  --accent-hover: #27ae60;
  --card-bg: #242424;
  --card-border: 1px solid #2a2a2a;
  --card-radius: 16px;
  --footer-bg: #181818;
  --font: 'Inter', sans-serif;
  --text-light: #bbbbbb;
  --header-height: 56px;
  --sidebar-width: 200px;
  --font-heading: 'Poppins', sans-serif;
  --letter-spacing-base: 0.5px;
  --letter-spacing-heading: 1px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--bg);
}

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background: var(--bg-gradient);
  color: var(--text);
  line-height: 1.6;
  letter-spacing: var(--letter-spacing-base);
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

header {
  background: rgba(18,18,18,0.8);
  -webkit-backdrop-filter: blur(10px);
  color: var(--text);
  backdrop-filter: blur(8px);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1003;
  height: calc(var(--header-height) + env(safe-area-inset-top));
  transition: top 0.3s ease-in-out;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  padding-top: env(safe-area-inset-top);
}

/* Hide header on scroll */
header.hide-header {
  top: calc(-1 * var(--header-height) * 2 );
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1000px;
  margin: auto;
  height: 100%;
  padding: 0 0.75rem;
}

.nav-links { display: flex; gap: 0.75rem; }
.nav-links a {
  color: var(--text);
  font-weight: 500;
  position: relative;
  letter-spacing: var(--letter-spacing-base);
}
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 3px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}
.nav-links a:hover::after {
  transform: scaleX(1);
}

.burger { display: none; flex-direction: column; gap: 5px; cursor: pointer; }
.burger div { width: 25px; height: 3px; background: var(--accent); }

/* Hide mobile nav-close button on desktop */
.nav-close {
  display: none;
}

main { max-width: 1000px; margin: 3rem auto; padding: 0 1rem; }

#about h2, #projects h2, #contact h2 {
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: .75rem;
  position: relative;
  display: inline-block;
}

#about h2::after,
#projects h2::after,
#contact h2::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -0.25rem;
  width: 50px;
  height: 4px;
  background: var(--accent);
  border-radius: 2px;
}

#about p {
  font-size: 1.05rem;
  line-height: 1.6;
  max-width: 700px;
  margin-bottom: 1rem;
}

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

.project-card {
  background: linear-gradient(145deg, #242424, #2a2a2a);
  border: var(--card-border);
  padding: 28px;
  border-radius: var(--card-radius);
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
  margin-bottom: 1rem;
  position: relative;
  display: flex;
  flex-direction: column;
  padding-bottom: 64px;
}

.featured-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--accent);
  color: #fff;
  padding: 2px 6px;
  font-size: 10px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-base);
}

.project-card:hover {
  border-color: var(--accent);
  transform: translateY(-5px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.4);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.project-card h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 0.75rem;
  text-align: left;
}

.project-card p {
  line-height: 1.5;
  margin-bottom: 30px;
  text-align: left;
  font-size: 12px;
}

footer {
  text-align: center;
  padding: 1rem;
  background: var(--footer-bg);
  color: var(--text);
  padding-bottom: 60px;
}

@media (max-width: 768px) {
  /* Close button for mobile nav */
  .nav-close {
    display: block;
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text);
    cursor: pointer;
    z-index: 1003;
  }
  .nav-links {
    display: none;
    flex-direction: column;
    background: var(--bg-gradient);
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    padding: 2rem 1rem;
    justify-content: center;
    align-items: center;
    height: 100vh;
  }
  .nav-links.open {
    display: flex;
  }
  .nav-links a {
    padding: 0.5rem 0;
    font-size: 1.25rem;
  }
  .burger {
    display: flex;
  }
  .projects-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }
}

@media (max-width: 576px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
  body {
    font-size: 15px;
  }
  h1, h2 {
    font-size: 1.8em;
  }
  .project-card {
    padding: 15px;
  }
}

/* Light mode overrides */
body.light {
  --bg: #ffffff;
  --text: #333333;
  --primary: #007acc;
  --card-bg: #f9f9f9;
  --card-border: #ddd;
  --footer-bg: #f1f1f1;
}

/* Ensure nav and toggle button align */
nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Theme toggle button styling */
.theme-toggle {
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
}

/* Refined search input style */
#project-search {
  padding: 10px 14px;
  border: 1px solid var(--accent);
  border-radius: var(--card-radius);
  background-color: var(--card-bg);
  color: var(--text);
  letter-spacing: var(--letter-spacing-base);
  width: 100%;
  max-width: 300px;
  font-size: 1rem;
  margin: 0;
}
#project-search::placeholder {
  color: var(--text-light);
}
#project-search:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.3);
}

/* Loading spinner */
.spinner {
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top: 4px solid var(--primary);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin: 2rem auto;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Scroll-to-top button */
.scroll-top {
  position: fixed;
  bottom: 65px;
  right: 16px;
  background: var(--accent);
  color: var(--text);
  border: none;
  border-radius: 50%;
  width: 3rem;
  height: 3rem;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 4px 4px 12px rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.scroll-top:hover {
  background: var(--accent-hover);
  color: var(--text);
}

/* Add SVG icon styling and hover animation for scroll-to-top */
.scroll-top svg {
  width: 1.5rem;
  height: 1.5rem;
  transition: transform 0.3s ease;
}

/* style the SVG arrow stroke on the polyline */
.scroll-top svg polyline {
  stroke: var(--text);
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.3s ease;
}

.scroll-top:hover svg {
  transform: translateY(-2px);
}

.scroll-top:hover svg polyline {
  stroke: var(--text);
}

/* Theme toggle icons visibility */
.sun-icon, .moon-icon { display: none; }
body.light .moon-icon { display: block; }
body:not(.light) .sun-icon { display: block; }

/* Project image styling */
.project-image {
  width: 100%;
  height: 150px;
  border-radius: var(--card-radius);
  object-fit: cover;
  margin-bottom: 1rem;
}

/* CTA buttons styling */
.project-card .cta-buttons {
  margin: 0;
  position: absolute;
  bottom: 28px;
  left: 28px;
}
.project-card .cta-button {
  display: inline-block;
  background-color: var(--accent);
  color: white;
  padding: 6px 12px;
  text-decoration: none;
  border-radius: 24px;
  margin-top: 15px;
  margin-right: 15px;
  font-size: 12px;
  letter-spacing: var(--letter-spacing-base);
  transition: background-color 0.3s ease, transform 0.3s ease;
}
.project-card .cta-button:hover {
  background-color: var(--accent-hover);
  transform: translateY(-2px);
}

/* Emphasize Projects heading */
#projects h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent);
}

/* Section spacing */
section {
  padding: 3rem 1rem;
}

/* Ensure consistent text contrast */
.project-card p, .project-card a {
  color: var(--text-light);
}

/* Hide age paragraph */
#about p:nth-of-type(2) { display: none; }

h1, h2, h3, h4, h5 {
  font-family: var(--font-heading);
  letter-spacing: var(--letter-spacing-heading);
}

.nav-container h1 a {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  letter-spacing: var(--letter-spacing-heading);
  color: var(--accent);
  text-decoration: none;
}

/* Search container styling */
.search-container {
  flex: 1;
  display: flex;
  justify-content: center;
  margin: 0 2rem;
}

/* Navigation link hover color change */
.nav-links a:hover {
  color: var(--accent);
  text-decoration: none;
}

/* Project image placeholder styling */
.project-image.placeholder {
  background: linear-gradient(145deg, #242424, #2a2a2a);
  background-image:
    repeating-linear-gradient(45deg, rgba(255,255,255,0.05) 0, rgba(255,255,255,0.05) 1px, transparent 1px, transparent 8px),
    linear-gradient(145deg, rgba(46,204,113,0.2), rgba(46,204,113,0.05));
  height: 150px;
  border-radius: var(--card-radius);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.project-icon {
  font-size: 3rem;
  color: var(--accent);
  opacity: 0.7;
}

/* Mobile grid: 1 column under 600px, 2 columns under 900px */
@media (max-width: 600px) {
  .projects-grid { grid-template-columns: 1fr; }
  .project-card h3 {
    font-size: 18px;
  }
  .project-card p {
    font-size: 12px;
    margin-bottom: 45px;
  }

  .project-card .cta-buttons {
    bottom: 15px;
    left: 15px;
  }
}
@media (min-width: 601px) and (max-width: 900px) {
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Toggle header name display */
.full-name {
  display: inline;
}

.short-name {
  display: none;
}

/* Mobile: hide full name and show abbreviation */
@media (max-width: 768px) {
  .full-name {
    display: none;
  }

  .short-name {
    display: inline;
  }
}

/* Dropdown menu for Tools */
.dropdown {
  position: relative;
}
.dropdown-toggle {
  background: none;
  border: none;
  color: var(--text);
  font-size: inherit;
  font-weight: 500;
  cursor: pointer;
  letter-spacing: var(--letter-spacing-base);
  padding: 0;
  position: relative;
}
.dropdown-toggle::after,
.dropdown-toggle::-webkit-details-marker,
.dropdown-toggle::marker {
  display: none !important;
}
.dropdown-toggle::after {
  content: '';
  border: solid var(--text);
  border-width: 0 2px 2px 0;
  display: inline-block;
  padding: 4px;
  margin-left: 0.5em;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}
.dropdown[open] .dropdown-toggle::after {
  transform: rotate(135deg);
}
.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  margin-top: 0.5rem;
  left: 0;
  background: var(--bg);
  padding: 0.5rem 0;
  border-radius: var(--card-radius);
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
  width: max-content;
  min-width: unset;
  white-space: nowrap;
  z-index: 1002;
}
.dropdown-menu a {
  display: block;
  padding: 0.5rem 1rem;
  color: var(--text);
  text-decoration: none;
}
.dropdown-menu a:hover {
  background: var(--accent-hover);
  color: var(--text);
}
.dropdown:hover .dropdown-menu {
  display: block;
}
.dropdown[open] .dropdown-menu {
  display: block;
}

/* Mobile adjustments for dropdown */
@media (max-width: 768px) {
  .dropdown-menu {
    position: static;
    box-shadow: none;
    width: 100%;
    margin: 1rem 0;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: var(--card-radius);
  }
  .dropdown-toggle {
    display: block;
    width: 100%;
    text-align: center;
    margin: 0.5rem 0;
    font-size: 1.25rem;
  }
  .dropdown-menu a {
    padding: 0.75rem 0;
    font-size: 1rem;
  }
}

/* Prevent overflow for dropdown at right edge */
.nav-links .dropdown:last-child .dropdown-menu {
  left: auto;
  right: 0;
}

/* Active navigation link */
.nav-links a.active {
  color: var(--accent);
}
.nav-links a.active::after {
  transform: scaleX(1);
}

/* Highlight Tools toggle when open */
.dropdown[open] > .dropdown-toggle {
  color: var(--accent);
}

/* Remove default marker for details summary elements */
details summary {
  list-style: none;
}
details summary::-webkit-details-marker {
  display: none;
}
details summary::marker {
  display: none;
}

/* Scroll-to-Bottom button styling */
.scroll-bottom {
  position: fixed;
  bottom: 0.5rem;
  right: 1rem;
  left: auto;
  background: var(--accent);
  color: var(--text);
  border: none;
  border-radius: 50%;
  width: 3rem;
  height: 3rem;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 4px 4px 12px rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1001;
}
.scroll-bottom:hover {
  background: var(--accent-hover);
}
.scroll-bottom svg {
  width: 1.5rem;
  height: 1.5rem;
  transition: transform 0.3s ease;
}
.scroll-bottom svg polyline {
  stroke: var(--text);
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.3s ease;
}


.pwa-standalone .nav-close {
  
}