/* ===== Base, tokens, and accessibility ===== */
:root {
  --bg: #000000;
  --surface: rgba(255, 255, 255, 0.06);
  --text: #ffffff;
  --muted: #cbd5e1;
  --accent: #FFA500;
  --brand: #ffffff;
}

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

html,
body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Roboto', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a:hover,
a:focus-visible {
  text-decoration: underline;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}


/* ===== Layout helpers ===== */
.container {
  width: min(1100px, 92vw);
  margin-inline: auto;
  padding: 2rem 0;
}

.section-header {
  margin: 0 0 1rem 0;
  font-family: 'Merriweather', Georgia, 'Times New Roman', serif;
}

/* ===== Top navigation ===== */
.topnav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #000;
  color: #fff;
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--surface);

  /* JS toggles these for show/hide on scroll */
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.5s linear, visibility 0.5s linear;
}

.topnav .brand {
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--brand);
  white-space: nowrap;
}

.menu-toggle {
  background: transparent;
  border: 1px solid var(--surface);
  color: #fff;
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
  font-size: 1rem;
  cursor: pointer;
  display: none; /* visible on small screens */
}

.nav-list {
  list-style: none;
  display: flex;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
}

.nav-list a {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
}
.nav-list a:hover,
.nav-list a:focus-visible {
  background: var(--surface);
  text-decoration: none;
}

/* Mobile nav */
@media (max-width: 800px) {
  .menu-toggle {
    display: inline-block;
    margin-left: auto;
  }

  .nav-list {
    display: none;
    position: absolute;
    top: 100%;
    right: 0.5rem;
    left: 0.5rem;
    background: #000;
    border: 1px solid var(--surface);
    border-radius: 8px;
    padding: 0.5rem;
    flex-direction: column;
    gap: 0.25rem;
  }

  .topnav.responsive .nav-list {
    display: flex;
  }
}

/* ===== Hero ===== */
.hero {
  min-height: 100vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding-top: 4rem; /* space for fixed nav */
  /* Fallback background */
  background-image: linear-gradient(180deg, rgba(0,0,0,0.55), rgba(0,0,0,0.8)), url("../images/background.jpg");
  /* Modern formats with responsive sources */
  background-image: linear-gradient(180deg, rgba(0,0,0,0.55), rgba(0,0,0,0.8)), image-set(
    url("../images/optimized/background-1024.avif") type("image/avif"),
    url("../images/optimized/background-1024.webp") type("image/webp"),
    url("../images/optimized/background-1024.jpg") type("image/jpeg")
  );
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  background-attachment: scroll;
}

.hero-content {
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--surface);
  border-radius: 12px;
  max-width: 900px;
  width: calc(100% - 2rem);
}

.logo {
  width: 96px;
  height: auto;
  margin-bottom: 0.5rem;
}

.hero h1 {
  margin: 0.25rem 0 0.25rem 0;
  font-family: 'Merriweather', Georgia, 'Times New Roman', serif;
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
}

.subtitle {
  margin: 0.25rem 0 0.25rem 0;
  color: var(--muted);
  font-size: clamp(1rem, 2.6vw, 1.125rem);
}

.location {
  margin: 0.25rem 0 0.75rem 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.social-links {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--surface);
}
.social-links a:hover,
.social-links a:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  text-decoration: none;
}
.social-links img {
  width: 28px;
  height: 28px;
}

/* ===== Sections ===== */
section {
  scroll-margin-top: 4.5rem; /* account for fixed nav when jumping */
}

.section {
  background: transparent;
}

.lead {
  font-size: 1.05rem;
  color: var(--muted);
  margin: 0.25rem 0 0.75rem 0;
}

/* Core Strengths pills */
.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0;
  margin: 0.5rem 0 0 0;
  list-style: none;
}

.pill-list li {
  border: 1px solid var(--surface);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.95rem;
}

/* Experience */
.experience-group {
  margin-top: 1rem;
  border-top: 1px solid var(--surface);
  padding-top: 1rem;
}

.role {
  margin: 1rem 0;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--surface);
}

.role h3 {
  margin: 0 0 0.25rem 0;
  font-size: 1.15rem;
}

.role .meta {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0 0 0.5rem 0;
}

.role ul {
  margin: 0.25rem 0 0 1.1rem;
}

/* Education */
.edu-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0 0;
}

.edu-list li + li {
  margin-top: 0.5rem;
}

.edu-list .degree {
  font-weight: 600;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--surface);
  color: var(--muted);
  padding: 1.5rem 0;
  text-align: center;
  font-size: 0.95rem;
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  .topnav {
    transition: none;
  }
}

@media (max-width: 800px) {
  .hero {
    /* Use smaller image and disable fixed attachment on mobile to avoid zoom/blank issues */
    /* Mobile background: restore PNG asset */
    background-image: linear-gradient(180deg, rgba(0,0,0,0.55), rgba(0,0,0,0.8)), url("../images/background_small.png");
    background-attachment: scroll;
    background-position: center;
    background-size: cover;
  }
}
@media (max-width: 480px) {
  .hero {
    /* Show full image on very small screens to avoid over-cropping */
    background-size: contain;
    background-position: top center;
    min-height: 85vh;
  }
}

/* ===== Hero text animations ===== */
.animate {
  margin: 0.25rem 0;
}
.animate span {
  display: inline-block;
}

/* Name animation (scoped to hero title) */
#hero-title span {
  opacity: 0;
  transform: translate(0, -100px) rotate(360deg) scale(0);
  animation: revolveDrop 1s forwards;
}


/* Keyframes */

@keyframes revolveDrop {
  30% {
    transform: translate(0, -50px) rotate(180deg) scale(1);
  }
  60% {
    transform: translate(0, 20px) scale(0.8) rotate(0deg);
  }
  100% {
    transform: translate(0) scale(1) rotate(0deg);
    opacity: 1;
  }
}

/* Staggered delays for Name: "Nicholas" (8 spans) + " Genco" (6 spans inside strong) */
#hero-title > span:nth-of-type(1)  { animation-delay: 0s; }
#hero-title > span:nth-of-type(2)  { animation-delay: 0.05s; }
#hero-title > span:nth-of-type(3)  { animation-delay: 0.10s; }
#hero-title > span:nth-of-type(4)  { animation-delay: 0.15s; }
#hero-title > span:nth-of-type(5)  { animation-delay: 0.20s; }
#hero-title > span:nth-of-type(6)  { animation-delay: 0.25s; }
#hero-title > span:nth-of-type(7)  { animation-delay: 0.30s; }
#hero-title > span:nth-of-type(8)  { animation-delay: 0.35s; }

/* Continue delay sequence into the last name spans */
#hero-title > span:nth-of-type(9)  { animation-delay: 0.40s; }
#hero-title > span:nth-of-type(10) { animation-delay: 0.45s; }
#hero-title > span:nth-of-type(11) { animation-delay: 0.50s; }
#hero-title > span:nth-of-type(12) { animation-delay: 0.55s; }
#hero-title > span:nth-of-type(13) { animation-delay: 0.60s; }
#hero-title > span:nth-of-type(14) { animation-delay: 0.65s; }

/* Subtitle animation */
#hero-subtitle.animate span {
  opacity: 0;
  transform: translate(-24px, 0) scale(0.98);
  animation: sideSlide 1.2s forwards;
}

/* Keyframes for subtitle word entrance */
@keyframes sideSlide {
  60% {
    transform: translate(12px, 0) scale(1);
    color: var(--muted);
  }
  80% {
    transform: translate(12px, 0) scale(1);
    color: var(--muted);
  }
  99% {
    transform: translate(0) scale(1.06);
    color: var(--accent);
  }
  100% {
    transform: translate(0) scale(1);
    opacity: 1;
    color: var(--muted);
  }
}

/* Staggered delays for subtitle words */
#hero-subtitle.animate > span:nth-of-type(1)  { animation-delay: 0.66s; }
#hero-subtitle.animate > span:nth-of-type(2)  { animation-delay: 0.71s; }
#hero-subtitle.animate > span:nth-of-type(3)  { animation-delay: 0.76s; }
#hero-subtitle.animate > span:nth-of-type(4)  { animation-delay: 0.81s; }
#hero-subtitle.animate > span:nth-of-type(5)  { animation-delay: 0.86s; }


/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  .animate span {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

@media (min-width: 1200px) {
  .hero {
    /* Fallback first */
    background-image: linear-gradient(180deg, rgba(0,0,0,0.55), rgba(0,0,0,0.8)), url("../images/optimized/background-1600.jpg");
    /* Modern formats */
    background-image: linear-gradient(180deg, rgba(0,0,0,0.55), rgba(0,0,0,0.8)), image-set(
      url("../images/optimized/background-1600.avif") type("image/avif"),
      url("../images/optimized/background-1600.webp") type("image/webp"),
      url("../images/optimized/background-1600.jpg") type("image/jpeg")
    );
  }
}
