/* ========== Reset / Base ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
}

html, body {
  height: 100%;
  background-color: #0e0e0e; /* prevent flash between pages */
}

body {
  background: #0e0e0e;
  color: #e0e0e0;
  line-height: 1.6;

  /* Sticky footer layout */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Main content grows; footer sits at the bottom on short pages */
main {
  flex: 1 0 auto;
}

/* Improve keyboard visibility */
a:focus-visible, button:focus-visible {
  outline: 2px dashed #00bfff;
  outline-offset: 3px;
}

/* ========== Header / Nav ========== */
header {
  background: #002244;
  padding: 2rem 1rem;
  text-align: center;
}
header h1 { font-size: 2rem; }

nav { margin-top: 1rem; }
nav a {
  margin: 0 1rem;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  transition: color .2s ease, opacity .2s ease;
}
nav a[aria-current="page"] { border-bottom: 2px solid currentColor; }
nav a:hover { color: #00bfff; }

/* --- Mobile header --- */
.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand p { opacity: .8; font-size: .9rem; margin-top: .25rem; }

/* Hide toggle on desktop */
.nav-toggle { display: none; }

@media (max-width: 780px) {
  header { text-align: left; }
  .brand h1 { font-size: 1.3rem; }
  .brand p { font-size: .85rem; line-height: 1.3; }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    line-height: 1;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,.25);
    background: transparent;
    color: #fff;
    cursor: pointer;
  }

  /* Collapse the nav into a panel */
  nav#siteNav {
    display: grid;
    grid-template-rows: 0fr;    /* Collapsed */
    overflow: hidden;
    transition: grid-template-rows .25s ease, padding .25s ease;
    padding: 0;
    margin-top: .5rem;
    gap: 0;
  }
  nav#siteNav[aria-expanded="true"] {
    grid-template-rows: 1fr;    /* Expanded */
    padding: .5rem 0;
    gap: .25rem;
  }
  nav#siteNav a {
    display: block;
    padding: .6rem .3rem;
    margin: 0;
    text-align: center;
  }
}

/* --- Desktop header fix (center brand + inline nav) --- */
@media (min-width: 781px) {
  header { text-align: center; }

  /* Stack brand above nav and center it */
  .nav-bar {
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: .5rem;
  }

  /* Desktop nav shows inline, no collapse */
  nav#siteNav {
    display: inline-block;
    padding: 0;
    margin-top: .75rem;
  }

  /* Horizontal links on desktop */
  nav#siteNav a {
    display: inline-block;
    padding: 0;               /* desktop uses global spacing via margin */
    margin: 0 1rem;
    text-align: left;
  }

  /* Hide hamburger on desktop */
  .nav-toggle { display: none !important; }
}

/* Slightly larger title on larger desktops */
@media (min-width: 981px) {
  header h1 { font-size: 2.2rem; }
}

/* ========== Global links ========== */
a:link, a:visited { color: #ffffff; text-decoration: none; }
a:hover { color: #00bfff; text-decoration: underline; }

/* ========== Sections ========== */
section {
  padding: 2rem 1rem;
  max-width: 900px;
  margin: 0 auto;
}
.section-title {
  color: #00bfff;
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

/* ========== Footer (sticky) ========== */
footer {
  background: #002244;
  color: #ccc;
  text-align: center;
  padding: 1rem;
  margin-top: auto;     /* pushes footer to bottom */
  opacity: 0.95;
}
footer a { color: inherit; text-decoration: underline; }
footer a:hover { text-decoration: none; }

/* ========== About ========== */
.about-content {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
.about-photo {
  width: 120px; height: 120px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.about-text { flex: 1; }
.about-text p { margin-bottom: .8rem; }

/* ========== Tags / keywords (shared) ========== */
.exp-keywords, .edu-keywords {
  display: flex; flex-wrap: wrap;
  gap: 8px; justify-content: center;
  margin-top: .5rem;
}
.keyword-tag {
  padding: 6px 10px;
  border-radius: 999px;
  background: #eef5f8;
  border: 1px solid #d4e2e8;
  font-size: .85rem;
  white-space: nowrap;
}

/* ========== Carousels (shared) ========== */
.carousel-container,
.edu-carousel-container,
.exp-carousel-container {
  position: relative;
  display: flex;
  align-items: center;
  overflow: visible;
}

.carousel,
.edu-carousel,
.exp-carousel {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  gap: 1rem;
  padding: 1rem 0;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;                 /* Firefox */
  -webkit-overflow-scrolling: touch;     /* iOS momentum */
}
.carousel::-webkit-scrollbar,
.edu-carousel::-webkit-scrollbar,
.exp-carousel::-webkit-scrollbar { display: none; }  /* WebKit */

.carousel-item,
.education-card,
.experience-card {
  background: #ffffff;
  color: #222;
  border-radius: 12px;
  padding: 1.2rem;
  flex: 0 0 calc(50% - 1rem);
  min-width: calc(50% - 1rem);
  max-width: calc(50% - 1rem);
  text-align: center;
  scroll-snap-align: start;
  box-shadow: 0 0 15px rgba(0, 191, 255, 0.3);
  transition: transform .3s ease, box-shadow .3s ease;
}
.carousel-item:hover,
.education-card:hover,
.experience-card:hover {
  transform: translateY(-6px) scale(1.06);
  box-shadow: 0 16px 36px rgba(0,0,0,0.22);
}

/* Logos inside cards (shared) */
.education-logo,
.employer-logo {
  display: block;
  height: 90px;
  width: auto;
  max-width: 85%;
  margin: 0 auto 12px auto;
  object-fit: contain;
}

/* Education text details */
.education-card strong {
  color: #002244;
  font-weight: 700;
  display: block;
  margin-bottom: .25rem;
}
.education-card p { color: #555; margin-bottom: .5rem; }

/* Experience text details */
.exp-name { font-weight: 700; margin: 4px 0; font-size: 1.05rem; }
.exp-title, .exp-dates { display: block; }
.exp-dates { color: #555; font-size: .9rem; }

/* Carousel arrows */
.carousel-btn {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.9);
  border: none;
  border-radius: 50%;
  width: 42px; height: 42px;
  font-size: 1.4rem; font-weight: bold;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 10px rgba(0,0,0,.15);
  transition: background .2s ease, transform .2s ease;
  z-index: 2;
}
.carousel-btn:hover {
  background: rgba(240,240,240,.95);
  transform: translateY(-50%) scale(1.08);
}
.carousel-btn.left  { left: -14px; }
.carousel-btn.right { right: -14px; }

/* Comfortable card widths on phones */
@media (max-width: 900px) {
  .exp-carousel > .experience-card,
  .edu-carousel > .education-card,
  .carousel > .carousel-item {
    flex: 0 0 85vw;
    min-width: 85vw;
    max-width: 85vw;
  }
}

/* Hide arrow buttons on very small screens; swipe instead */
@media (max-width: 520px) {
  .carousel-btn { display: none; }
}

/* ========== Privacy Modal (shared) ========== */
.policy-modal { position: fixed; inset: 0; display: none; z-index: 60; }
.policy-modal[aria-hidden="false"] { display: block; }
.policy-modal__backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.55);
  opacity: 0; transition: opacity .2s ease;
}
.policy-modal[aria-hidden="false"] .policy-modal__backdrop { opacity: 1; }

.policy-modal__panel {
  position: relative;
  width: min(820px, 92vw);
  margin: 8vh auto;
  background: rgba(17,24,39,.98);
  color: #eaf0ff;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 18px;
  box-shadow: 0 12px 30px rgba(0,0,0,.35);
  transform: translateY(10px);
  opacity: 0;
  transition: transform .2s ease, opacity .2s ease;
  padding: 22px 22px 18px;
}
.policy-modal[aria-hidden="false"] .policy-modal__panel {
  transform: translateY(0); opacity: 1;
}
.policy-modal__close {
  position: absolute; right: 10px; top: 6px;
  border: 0; background: transparent; color: #eaf0ff;
  font-size: 28px; cursor: pointer; line-height: 1;
}
.policy-body h4 { margin: 14px 0 6px; }
.policy-body p, .policy-body li { color: #cfd8ef; }
.policy-body ul { margin: 6px 0 10px 18px; }
.policy-cta {
  margin-top: 14px; width: 100%;
  border: 0; cursor: pointer; color: white;
  padding: 12px 16px; border-radius: 999px;
  background: linear-gradient(90deg,#1e3a8a,#3b82f6);
  box-shadow: 0 8px 16px rgba(59,130,246,.35);
}

/* ========== Misc helpers ========== */
.job-title { font-weight: 700; color: #002244; }
.company { color: #555; }

/* ========== Page transitions (no flash during hydration) ========== */
body.__hydrating { opacity: 0; }              /* hide until partials are ready */
body.__fade-ready { transition: opacity .22s ease; opacity: 1; }
body.__fade-leave { opacity: 0; transition: opacity .16s ease; }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  body.__fade-ready, body.__fade-leave,
  .carousel, .edu-carousel, .exp-carousel,
  nav#siteNav {
    transition: none !important;
  }
}

