/* ========== Base / Reset ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
} /* Reduce tap highlight/ghost focus on mobile */

:root {
  --topbar-reserved: 140px;
  --brand: #2fcc23;
  --hero-img: url("../assets/images/Me at Taft Point.jpg");
  --icon-size: 50px;
  --topbar-bg: rgba(18, 18, 20, 0.7);
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu,
    Cantarell, sans-serif;
  line-height: 1.6;
  color: #333;
  background: #fff;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== Fixed overlay (nav + greeting stacked) ===== */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: var(
    --topbar-bg
  ); /* Remove this, if transparent background is used. */
  /* background: transparent;         Optional: transparent over hero at top */
  transition:
    background 0.25s ease,
    box-shadow 0.25s ease;
  will-change: background;
}
.topbar.is-mounted {
  transform: translateY(0);
  opacity: 1;
}

/* Topbar fully hidden */
.topbar.is-hidden {
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition:
    opacity 0.25s ease,
    transform 0.25s ease,
    background 0.25s ease,
    box-shadow 0.25s ease;
}

/* Animate the greeting when bar hides */
.topbar.is-hidden .greeting {
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
}

.topbar.scrolled {
  background: var(--topbar-bg);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  backdrop-filter: saturate(1.1) blur(6px);
}
/* Make active link green in BOTH transparent and scrolled states */
.nav-links a.active {
  color: var(--brand);
}
.topbar.scrolled .nav-links a.active {
  color: var(--brand);
} /* when topbar is dark */

/* Keep hover behavior consistent for active link */
.nav-links a.active:hover {
  color: #e5e7eb;
}

/* ===== Nav (overlay mode) ===== */
.nav {
  position: static;
}
.nav.nav--overlay {
  background: transparent;
  border-bottom: 0;
  padding: 14px 0;
}
.nav-links {
  display: flex;
  justify-content: center;
  align-items: center;
  list-style: none;
  gap: 32px;
  flex-wrap: wrap;
}
.nav-links a {
  color: #888888;
  text-decoration: none;
  font-weight: 700;
  transition: color 0.2s ease;
}
/* Active section link styling */
.nav-links a.active {
  color: var(--brand);
  /* text-decoration: underline;  Optional */
}
.topbar.scrolled .nav-links a {
  color: #888888;
}

@media (hover: hover) {
  .nav-links a:hover {
    color: #e5e7eb;
  }
  .topbar.scrolled .nav-links a:hover {
    color: #e5e7eb;
  }
}

.nav-links a:focus {
  outline: none;
}
.nav-links a:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* Greeting line */
.greeting {
  position: relative;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  padding: 10px 44px 10px 16px; /* leave space for the X button */
  font-size: 1rem;
  line-height: 1.6;
  color: #eef3f8;
}

.greeting__text {
  text-align: center;
  /* prevent weird shrinking on tiny widths */
  min-width: 0;
}

.greeting__close {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}
.greeting__close:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Keyboard focus visibility */
.greeting__close:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* Tight screens: slightly smaller, keep spacing */
@media (max-width: 420px) {
  .greeting {
    padding-right: 48px;
  }
  .greeting__close {
    width: 32px;
    height: 32px;
    font-size: 20px;
    right: 8px;
  }
}

.topbar.scrolled .greeting {
  color: #e5e7eb;
}

/* Special “email” word */
.email-link {
  color: var(--brand);
  text-decoration: none;
  font-weight: 700;
}
.email-link:hover {
  color: #eef3f8;
  /* Optional: text-decoration: underline; */
}

/* ===== HERO (image starts at very top) ===== */
.header.hero {
  min-height: 100vh; /* full viewport height */
  position: relative;
  background: #0b1b2a center/cover no-repeat;
  background-image: var(--hero-img);
  color: #fff;
  padding-top: calc(var(--topbar-reserved) + 16px);
  padding-bottom: 90px;
  text-align: center;
}
.header__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.35));
}
.hero__content {
  position: relative;
  z-index: 1;
}
.header h1 {
  font-size: 8rem;
  font-weight: 600;
  margin-bottom: 16px;
}
.tagline {
  font-size: 1.3rem;
  color: #e6eef6;
  max-width: 720px;
  margin: 0 auto;
  line-height: 1.85;
}

/* Topbar: start hidden above, slide in */
.topbar {
  /* keep your existing transitions; add these: */
  transform: translateY(-110%);
  opacity: 0;
  transition:
    transform 0.6s ease,
    opacity 0.6s ease,
    background 0.25s ease,
    box-shadow 0.25s ease;
}
.topbar.is-mounted {
  transform: translateY(0);
  opacity: 1;
}
/* Hero text: start slightly below and invisible */
.hero__content .reveal-up {
  opacity: 0;
  transform: translateY(28px);
  transition:
    transform 0.7s cubic-bezier(0.22, 0.61, 0.36, 1),
    opacity 0.6s ease;
  will-change: transform, opacity;
}
.hero__content .reveal-up.is-in {
  opacity: 1;
  transform: translateY(0);
}
/* Optional stagger for multiple items (h1 then p) */
.hero__content h1.reveal-up {
  transition-delay: 0.2s;
}
.hero__content .tagline.reveal-up {
  transition-delay: 0.35s;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .topbar {
    transform: none !important;
    opacity: 1 !important;
    transition: none !important;
  }
  .hero__content .reveal-up {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* Social icons: clean slide-up reveal */
.social .reveal-up {
  opacity: 0;
  transform: translateY(28px);
  transition:
    transform 0.7s cubic-bezier(0.22, 0.61, 0.36, 1),
    opacity 0.6s ease;
  will-change: transform, opacity;
}

.social .reveal-up.is-in {
  opacity: 1;
  transform: translateY(0);
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .social .reveal-up {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* Scroll down button */
.scroll-down {
  position: absolute;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
  -webkit-tap-highlight-color: transparent;
}

/* Circle around arrow only */
.scroll-down__circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: rgba(0, 0, 0, 0.35);
  transition:
    background 0.25s ease,
    transform 0.2s ease;
}

.scroll-down__circle:hover {
  background: rgba(0, 0, 0, 0.55);
  transform: translateY(-2px);
}

.scroll-down__arrow {
  font-size: 1.6rem;
  font-weight: 900;
  line-height: 1;
  animation: bob-down 1.6s ease-in-out infinite;
}

.scroll-down__text {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #fff;
}

@keyframes bob-down {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(4px);
  }
}

/* Back to top button */
.back-to-top {
  /* container styles as before (position, circle, opacity, transitions, etc.) */
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 400;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 1.6rem;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease,
    background 0.25s ease;
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top:hover {
  background: rgba(0, 0, 0, 0.55);
}

/* Arrow inside button animates */
.back-to-top__arrow {
  display: inline-block;
  animation: bob-up 1.6s ease-in-out infinite;
}

@keyframes bob-up {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

/* Social icons */
.social {
  margin-top: 22px;
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}
.social__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  transition:
    transform 0.2s ease,
    background 0.2s ease;
}
.social__link:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.2);
}
.icon {
  width: var(--icon-size);
  height: var(--icon-size);
  fill: #fff;
  transition: fill 0.2s ease;
}
.social__link:hover .icon {
  fill: var(--brand);
}

/* Anchor offset for in-page links (so headings aren’t hidden under topbar) */
.section,
.contact {
  scroll-margin-top: calc(var(--topbar-reserved) + 12px);
}

/* ===== Sections ===== */
.section {
  padding: 64px 0;
  border-bottom: 1px solid #e9ecef;
  background: #fff;
}
.section:last-child {
  border-bottom: none;
}
.section-title {
  font-size: 2rem;
  font-weight: 500;
  margin-bottom: 36px;
  color: #2c3e50;
  text-align: center;
}
.intro {
  font-size: 1.06rem;
  line-height: 1.85;
  color: #555;
  margin-bottom: 24px;
}

/* ===== Dark About & Projects===== */
.section--dark {
  background: #0f1114;
  color: #e8eaed;
  border-bottom-color: #1b1f24;
}
.section--dark .section-title {
  color: #fff;
}
.section--dark .intro {
  color: #c9d1d9;
}

/* About grid: carousel LEFT, text RIGHT */
.about__grid {
  display: grid;
  grid-template-columns: 0.7fr 1.3fr; /* left smaller, right larger */
  gap: 32px;
  align-items: center; /* vertical centering */
  margin-bottom: 32px;
  min-height: 300px; /* helps centering feel balanced */
}
.about__grid .about-carousel {
  order: 1;
  justify-self: center;
}
.about__grid .intro {
  order: 2;
}

@media (max-width: 900px) {
  .about__grid {
    grid-template-columns: 1fr; /* stack on smaller screens */
    align-items: start;
  }
  .about__grid .about-carousel {
    justify-self: center;
    margin-bottom: 20px;
  }
}

/* Circular carousel */
.about-carousel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.about-carousel__viewport {
  position: relative;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
.about-carousel__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.04);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}
.about-carousel__img.is-active {
  opacity: 1;
  transform: scale(1);
}
.about-carousel__dots {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}
.about-carousel__dots button {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: #6b7280;
  cursor: pointer;
}
.about-carousel__dots button.is-active {
  background: var(--brand);
}

/* Skills grid in About */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin: 24px 0 0;
}
.skill-card {
  background: #f8f9fa;
  padding: 26px;
  border-radius: 10px;
  border-left: 4px solid var(--brand);
}
.section--dark .skill-card {
  background: #15181c;
}
.skill-card h3 {
  font-size: 1.1rem;
  color: #2c3e50;
  margin-bottom: 10px;
}
.section--dark .skill-card h3 {
  color: #e8eaed;
}
.skill-card p {
  color: #666;
}
.section--dark .skill-card p {
  color: #c9d1d9;
}

/* ===== Work Experience / Education items ===== */
.experience-item {
  margin-bottom: 46px;
  position: relative;
  padding-left: 30px;
}
.experience-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 5px;
  width: 12px;
  height: 12px;
  background: var(--brand);
  border-radius: 50%;
}
.experience-item::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 17px;
  width: 2px;
  height: calc(100% - 12px);
  background: #e9ecef;
}
.experience-item:last-child::after {
  display: none;
}
.experience-date {
  font-size: 0.95rem;
  color: var(--brand);
  font-weight: 700;
  margin-bottom: 8px;
}
.experience-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 6px;
}
.experience-company {
  color: #666;
  margin-bottom: 12px;
}
.experience-description {
  color: #555;
  line-height: 1.75;
}

/* ===== Projects ===== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 32px;
  margin-top: 20px;
}
.project-card {
  background: #15181c;
  /* Optional Border: border:1px solid #e9ecef; border-radius:10px; padding: 0px; */
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}
.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}
.project-title {
  font-size: 1.25rem;
  color: #2c3e50;
  margin-bottom: 10px;
}
.project-description {
  color: #555;
  margin-bottom: 16px;
}
.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.tech-tag {
  background: var(--brand);
  color: #fff;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}
.project-links a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 600;
  margin-right: 18px;
}
.project-links a:hover {
  text-decoration: underline;
}

/* ===== Projects gallery thumbs ===== */
.projects-grid--gallery {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.project-thumb {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  overflow: hidden;
  border-radius: 10px;
}

.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  transition:
    transform 0.25s ease,
    filter 0.25s ease;
}

.project-thumb__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0));
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 14px;
  transition: background 0.25s ease;
}

.project-thumb__title {
  color: #fff;
  font-weight: 700;
  text-align: center;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.project-thumb:hover img {
  transform: scale(1.06);
  filter: saturate(1.1);
}
.project-thumb:hover .project-thumb__overlay {
  background: linear-gradient(to top, rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0.1));
}

/* ===== Project modal ===== */
.project-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
}

.project-modal.is-open {
  display: block;
}

.project-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
}

.project-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(1000px, 92vw);
  margin: 6vh auto;
  background: #fff;
  color: #111;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr; /* image | text */
  gap: 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.section--dark ~ .section .project-modal__dialog {
  color: #111;
} /* keep text dark */

.project-modal__media {
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.project-modal__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-modal__content {
  padding: 22px 22px 24px;
  overflow: auto;
}

.project-modal__close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  z-index: 2;
}
.project-modal__close:hover {
  background: rgba(0, 0, 0, 0.75);
}

.project-modal__desc {
  margin: 12px 0 14px;
  color: #333;
  line-height: 1.7;
}

.project-modal__stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.project-modal__stack .tech-tag {
  background: var(--brand);
  color: #fff;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

.project-modal__links a {
  display: inline-block;
  margin-right: 14px;
  font-weight: 700;
  color: var(--brand);
  text-decoration: none;
}
.project-modal__links a:hover {
  text-decoration: underline;
}

@media (max-width: 900px) {
  .project-modal__dialog {
    grid-template-columns: 1fr;
    width: 94vw;
    margin: 5vh auto;
  }
  .project-modal__media {
    max-height: 56vh;
  }
}

/* ===== Hobbies and Interests ===== */
/* Full-bleed helper: let this section ignore the standard max-width container */
.section--fullbleed .container {
  max-width: 1000px; /* keep the heading/intro nicely centered */
  padding: 0 20px;
}
.section--fullbleed {
  padding: 64px 0 0; /* top padding for heading/intro; gallery follows */
  border-bottom: none; /* optional: no divider line under this section */
}

/* Edge-to-edge 3-up gallery with zero borders/gaps */
.hobby-gallery {
  width: 100vw; /* full viewport width */
  margin-left: 50%;
  transform: translateX(-50%); /* center it even if parent has margins */
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0; /* no gaps or borders */
}

.hobby-tile {
  margin: 0;
}

.hobby-tile img {
  display: block; /* block display no gaps */
  width: 100%;
  height: clamp(380px, 50vh, 620px); /* tall enough to feel immersive */
  object-fit: cover; /* crop to fill without distortion */
  object-position: center;
  border: 0; /* explicit: no borders */
}

/* Mobile: stack for readability */
@media (max-width: 900px) {
  .hobby-gallery {
    grid-template-columns: 1fr;
  }
  .hobby-tile img {
    height: clamp(240px, 50vh, 500px);
  }
}

/* ===== Contact ===== */
.contact {
  background: #f8f9fa;
}
.contact-form {
  max-width: 640px;
  margin: 0 auto;
}
.contact-intro {
  text-align: center;
  font-size: 1.05rem;
  color: #555;
  margin-bottom: 26px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}
.form-group {
  margin-bottom: 18px;
}
.form-group label {
  display: block;
  margin-bottom: 8px;
  color: #2c3e50;
  font-weight: 600;
}
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(0, 122, 204, 0.12);
}
.form-group textarea {
  resize: vertical;
  min-height: 120px;
}
.submit-btn {
  background: var(--brand);
  color: #fff;
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  width: 100%;
  transition:
    background 0.2s ease,
    transform 0.05s ease;
  cursor: pointer;
}
.submit-btn:hover {
  background: #333;
}
.submit-btn:active {
  transform: scale(0.99);
}

.hp {
  position: absolute !important;
  left: -9999px !important;
  height: 0 !important;
  width: 0 !important;
  overflow: hidden !important;
}

/* ===== Footer ===== */
.footer {
  text-align: center;
  padding: 40px 0;
  color: #666;
  font-size: 0.95rem;
}
.footer-contact {
  margin-bottom: 14px;
}
.footer-contact p {
  margin-bottom: 4px;
}
.footer-contact a {
  color: var(--brand);
  text-decoration: none;
}
.footer-contact a:hover {
  text-decoration: underline;
}

/* ===== Animations ===== */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Responsive tweaks ===== */
@media (max-width: 768px) {
  .header h1 {
    font-size: 2.3rem;
  }
  .nav-links {
    gap: 18px;
  }
  .container {
    padding: 0 16px;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
  .projects-grid {
    grid-template-columns: 1fr;
  }
  .about-carousel__viewport {
    width: 200px;
    height: 200px;
  }
}

/* Make sure the hide state always wins over the intro state */
.topbar.is-hidden {
  transform: translateY(-110%) !important;
  opacity: 0 !important;
}
