/* Dark modern styles - cleaned and validated */
:root {
  --bg: #0b0f14;
  --card: #0f1720;
  --surface: #0a0c0f;
  --text: #e6eef8;
  --muted: #98a0ad;
  --accent: #06b6d4;
  --accent-600: #0891b2;
  --radius: 10px;
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial;
  background: radial-gradient(
      1200px 600px at 10% 10%,
      rgba(6, 11, 15, 0.6),
      transparent
    ),
    var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.container {
  max-width: 920px;
  margin: 40px auto;
  padding: 24px;
}

header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.02),
    rgba(255, 255, 255, 0.01)
  );
  padding: 22px;
  border-radius: var(--radius);
  box-shadow: 0 8px 30px rgba(2, 6, 23, 0.6);
}
header h1 {
  font-size: 1.8rem;
  margin: 0;
}
header p.lead {
  color: var(--muted);
  margin-top: 4px;
}

nav {
  width: 100%;
}
nav ul {
  list-style: none;
  display: flex;
  gap: 10px;
  justify-content: center;
  padding: 0;
  margin: 0;
}
nav button {
  appearance: none;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.03);
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  transition: all 160ms ease;
}
/* remove strong glow - make active subtle */
nav button:hover {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
}
nav button:focus {
  outline: 2px solid rgba(6, 182, 212, 0.14);
  outline-offset: 3px;
}
nav button.active {
  background: rgba(6, 182, 212, 0.12);
  color: var(--text);
  box-shadow: none;
  transform: none;
}

main {
  margin-top: 22px;
}
section {
  margin-bottom: 28px;
  background: linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.02),
      rgba(255, 255, 255, 0.01)
    ),
    var(--card);
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(2, 6, 23, 0.6);
}
section h2 {
  text-align: center;
  margin-top: 0;
  margin-bottom: 12px;
}

/* About layout: image left, text right */
.section-row {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}
.about-figure {
  flex: 0 0 170px;
  margin: 0;
}
.about-photo {
  width: 160px;
  height: 160px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.04);
  box-shadow: 0 6px 20px rgba(2, 6, 23, 0.6);
}
.about-text {
  flex: 1 1 auto;
  color: var(--text);
  font-size: 0.98rem;
}

/* visually-hidden helper */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.project-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.project {
  padding: 16px;
}

.project-card {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.02),
    rgba(255, 255, 255, 0.01)
  );
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 12px 36px rgba(2, 6, 23, 0.6);
  cursor: pointer;
  transition: transform 220ms cubic-bezier(0.2, 0.9, 0.2, 1), box-shadow 220ms;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.project-card:focus {
  outline: 3px solid rgba(6, 182, 212, 0.12);
  outline-offset: 4px;
}
.project-card:hover {
  transform: translateY(-6px) rotate(-0.5deg);
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.7);
}

.project-media {
  overflow: hidden;
  border-radius: 8px;
  display: block;
  position: relative;
}
.project-media img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
  transition: transform 350ms ease, filter 220ms ease;
}
.project-media:hover img {
  transform: scale(1.08) rotate(-0.6deg);
  filter: brightness(0.95) saturate(1.02);
}
.card-body:hover {
  background: rgba(255, 255, 255, 0.01);
}

.project-detail {
  margin-top: 18px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
}

/* Project gallery inside details */
.project-gallery {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.gallery-thumb {
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  border-radius: 6px;
  overflow: hidden;
  width: 120px;
  height: 80px;
}
.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.muted {
  color: var(--muted);
  font-size: 0.95rem;
}

/* overlay tags */
.overlay {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: flex;
  gap: 8px;
}
.tag {
  background: linear-gradient(
    90deg,
    rgba(6, 182, 212, 0.16),
    rgba(6, 182, 212, 0.06)
  );
  color: var(--text);
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  backdrop-filter: blur(4px);
}

/* lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: linear-gradient(
    180deg,
    rgba(2, 6, 23, 0.82),
    rgba(2, 6, 23, 0.9)
  );
  z-index: 1200;
}
.lightbox.open {
  display: flex;
}
.lightbox-inner {
  max-width: 92%;
  max-height: 86%;
  background: transparent;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-inner img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 36px 90px rgba(2, 6, 23, 0.7);
}
.lightbox-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 100%;
  max-height: 100%;
}
.lightbox-caption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.95rem;
  text-align: center;
  max-width: 80vw;
}
.lightbox-close {
  position: absolute;
  top: 18px;
  right: 18px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.03),
    rgba(255, 255, 255, 0.02)
  );
  border: none;
  color: var(--text);
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}

/* lightbox nav buttons */
.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.4);
  color: var(--text);
  border: none;
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
}
.lightbox-prev {
  left: 8px;
}
.lightbox-next {
  right: 8px;
}

@media (max-width: 480px) {
  header h1 {
    font-size: 1.2rem;
  }
  .about-photo {
    width: 100px;
    height: 100px;
  }
  .project-media img {
    height: 110px;
  }
}

/* mobile: stack project cards vertically & nav column */
@media (max-width: 700px) {
  .project-list {
    grid-template-columns: 1fr;
  }
  nav ul {
    flex-direction: column;
    gap: 8px;
  }
  nav {
    align-items: center;
  }
  .section-row {
    flex-direction: column;
  }
  .about-figure {
    margin: 0 auto 12px;
    flex: none;
  }
  .about-text {
    text-align: left;
  }
}

/* contact form centering */
form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 560px;
  margin: 0 auto;
}
input,
textarea {
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
}
button[type="submit"] {
  /* match nav active 'lit' style: subtle cyan surface */
  background: rgba(6, 182, 212, 0.12);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.03);
  font-weight: 600;
  cursor: pointer;
  transition: background 160ms ease, transform 120ms ease;
}
button[type="submit"]:hover {
  background: rgba(6, 182, 212, 0.18);
  transform: translateY(-1px);
}
button[type="submit"]:focus {
  outline: 2px solid rgba(6, 182, 212, 0.18);
  outline-offset: 3px;
}

/* Center the response message below the form */
#response {
  text-align: center;
  margin-top: 12px;
  color: var(--accent);
  font-weight: 600;
}

/* Fade-in animation for response messages */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#response {
  opacity: 0;
  transition: opacity 240ms ease, transform 240ms ease;
}
#response.visible {
  opacity: 1;
  animation: fadeInUp 280ms ease both;
}

/* error state */
#response.error {
  color: #ff6b6b;
}

footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 18px;
}

/* --- Overrides / fixes to correct earlier malformed CSS --- */
/* ensure header lead text */
header p.lead {
  color: var(--muted);
  margin-top: 4px;
}

/* nav: remove strong glow and make active subtle */
nav button:hover {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
}
nav button:focus {
  outline: 2px solid rgba(6, 182, 212, 0.14);
  outline-offset: 3px;
}
nav button.active {
  background: rgba(6, 182, 212, 0.12);
  color: var(--text);
  box-shadow: none;
  transform: none;
}

/* main/section spacing and heading centering */
main {
  margin-top: 22px;
}
section h2 {
  text-align: center;
  margin-top: 0;
  margin-bottom: 12px;
}
section {
  margin-bottom: 28px;
  background: linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.02),
      rgba(255, 255, 255, 0.01)
    ),
    var(--card);
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(2, 6, 23, 0.6);
}

/* about layout: image left, text right */
.section-row {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}
.about-figure {
  flex: 0 0 170px;
  margin-right: 18px;
}
.about-text {
  flex: 1 1 auto;
}

/* ensure sr-only is hidden */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* center the contact form */
form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 560px;
  margin: 0 auto;
}

/* small-screen adjustments for stacked layout */
@media (max-width: 700px) {
  .project-list {
    grid-template-columns: 1fr;
  }
  nav ul {
    flex-direction: column;
    gap: 8px;
  }
  nav {
    align-items: center;
  }
  .section-row {
    flex-direction: column;
  }
  .about-figure {
    margin: 0 auto 12px;
    flex: none;
  }
  .about-text {
    text-align: left;
  }
}

.center-text {
  text-align: center;
  margin-top: 20px;
  font-size: 1.1em;
  color: #333;
}

.center-text a {
  color: #007bff;
  text-decoration: none;
  font-weight: 500;
}

.center-text a:hover {
  text-decoration: underline;
}
