/* =========================================================
   Joe Wainscott — Portfolio
   Custom styles on top of Bootstrap 5
   Theming via CSS variables; light is default, dark via
   [data-theme="dark"] on <html>.
========================================================== */

/* ---------- Theme tokens: LIGHT (default) ---------- */
:root {
  --navy:        #0d1b3e;
  --navy-2:      #13294b;
  --navy-3:      #1d3a6e;
  --accent:      #2f6fed;   /* bright blue used for CTAs/links */
  --accent-soft: rgba(47, 111, 237, 0.12);

  --bg:          #ffffff;
  --bg-alt:      #f4f6fb;   /* alternating section background */
  --surface:     #ffffff;   /* card surface */
  --text:        #1a2238;
  --text-muted:  #5a6580;
  --border:      #e3e8f2;
  --shadow:      0 10px 30px rgba(13, 27, 62, 0.08);
  --shadow-hover:0 18px 40px rgba(13, 27, 62, 0.16);

  --nav-bg:      rgba(255, 255, 255, 0.92);
  --nav-text:    #1a2238;
  --hero-grad:   linear-gradient(135deg, #0d1b3e 0%, #1d3a6e 60%, #2f6fed 130%);
}

/* ---------- Theme tokens: DARK ---------- */
[data-theme="dark"] {
  --accent:      #5b8def;
  --accent-soft: rgba(91, 141, 239, 0.18);

  --bg:          #0a0f1f;
  --bg-alt:      #0f1730;
  --surface:     #131c36;
  --text:        #e9edf7;
  --text-muted:  #9aa6c4;
  --border:      #25304f;
  --shadow:      0 10px 30px rgba(0, 0, 0, 0.45);
  --shadow-hover:0 18px 40px rgba(0, 0, 0, 0.6);

  --nav-bg:      rgba(10, 15, 31, 0.92);
  --nav-text:    #e9edf7;
  --hero-grad:   linear-gradient(135deg, #070b18 0%, #122146 60%, #1d3a6e 130%);
}

/* ---------- Base ---------- */
* { scroll-margin-top: 80px; }

html { scroll-behavior: smooth; }

body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.65;
  transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3 { font-weight: 700; color: var(--text); }

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

.text-accent { color: var(--accent) !important; }

/* ---------- Buttons ---------- */
.btn-accent {
  background-color: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
.btn-accent:hover,
.btn-accent:focus {
  background-color: var(--navy-3);
  border-color: var(--navy-3);
  color: #fff;
  transform: translateY(-2px);
}

.btn-outline-accent {
  border: 2px solid var(--accent);
  color: var(--accent);
  background: transparent;
  font-weight: 600;
}
.btn-outline-accent:hover,
.btn-outline-accent:focus {
  background-color: var(--accent);
  color: #fff;
}

.btn { transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease; }

/* =========================================================
   NAVBAR
========================================================== */
#mainNav {
  background-color: var(--nav-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}
#mainNav.scrolled { box-shadow: var(--shadow); }

.navbar-brand {
  color: var(--nav-text) !important;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.15rem;
}
.brand-mark {
  color: var(--accent);
  font-size: 1.4rem;
  line-height: 1;
  vertical-align: -3px;
}

.navbar-nav .nav-link {
  color: var(--nav-text);
  font-weight: 500;
  margin: 0 0.15rem;
  position: relative;
  transition: color 0.2s ease;
}
.navbar-nav .nav-link::after {
  content: "";
  position: absolute;
  left: 0; bottom: 2px;
  width: 0; height: 2px;
  background: var(--accent);
  transition: width 0.25s ease;
}
.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: var(--accent);
  text-decoration: none;
}
.navbar-nav .nav-link:hover::after,
.navbar-nav .nav-link.active::after { width: 100%; }

.navbar-toggler {
  border-color: var(--border);
  color: var(--nav-text);
}
.navbar-toggler:focus { box-shadow: 0 0 0 0.2rem var(--accent-soft); }
/* Recolor the hamburger icon per theme */
.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%231a2238' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}
[data-theme="dark"] .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23e9edf7' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Theme toggle button */
.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1.05rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}
.theme-toggle:hover { transform: rotate(20deg); color: var(--accent); }

/* =========================================================
   HERO
========================================================== */
.hero {
  background: var(--hero-grad);
  color: #fff;
  padding: 8rem 0 6rem;
  position: relative;
  overflow: hidden;
}
.hero::after {
  /* subtle decorative glow (drifts on scroll via --hero-parallax) */
  content: "";
  position: absolute;
  top: -20%; right: -10%;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(91,141,239,0.25), transparent 70%);
  border-radius: 50%;
  transform: translateY(var(--hero-parallax, 0));
  will-change: transform;
}
.hero .container { position: relative; z-index: 1; }

.hero-eyebrow {
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #acc4ff;
  margin-bottom: 0.75rem;
}
.hero-title { font-size: clamp(2.2rem, 5vw, 3.4rem); color: #fff; margin-bottom: 0.5rem; }
.hero-title .text-accent { color: #9bc0ff !important; }
.hero-subtitle { font-size: clamp(1.2rem, 3vw, 1.7rem); color: #d7e3ff; font-weight: 600; margin-bottom: 1.25rem; }
.hero-tagline { font-size: 1.1rem; color: #e8eefc; max-width: 560px; margin-bottom: 2rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 1rem; }

/* Profile photo with soft vignette frame */
.hero-photo {
  position: relative;
  width: 280px;
  height: 280px;
  margin: 0 auto;
  border-radius: 50%;
  padding: 6px;
  background: rgba(255, 255, 255, 0.12);
  border: 3px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
}
.hero-photo img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
/* Vignette: soft inner darkening toward the edges */
.hero-photo::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  pointer-events: none;
  box-shadow: inset 0 0 38px 12px rgba(13, 27, 62, 0.55);
}

/* =========================================================
   SECTIONS (shared)
========================================================== */
.section { padding: 5.5rem 0; }
.section-alt { background-color: var(--bg-alt); }

.section-head { text-align: center; max-width: 640px; margin: 0 auto 3rem; }
.section-title {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  position: relative;
  display: inline-block;
  margin-bottom: 0.75rem;
}
.section-title::after {
  content: "";
  display: block;
  width: 60px; height: 4px;
  background: var(--accent);
  border-radius: 2px;
  margin: 0.6rem auto 0;
}
.section-subtitle { color: var(--text-muted); font-size: 1.05rem; }

/* =========================================================
   ABOUT
========================================================== */
.about-visual {
  aspect-ratio: 1 / 1;
  max-width: 320px;
  margin: 0 auto;
  border-radius: 20px;
  background: var(--hero-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
}
.about-visual i { font-size: 6rem; color: rgba(255, 255, 255, 0.92); }

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.1rem 0.5rem;
  box-shadow: var(--shadow);
  height: 100%;
}
.stat-number, .stat-suffix {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}
.stat-label { font-size: 0.85rem; color: var(--text-muted); margin: 0.4rem 0 0; }

/* =========================================================
   SKILLS
========================================================== */
.skill-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem 1.5rem;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.skill-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-hover); }
.skill-icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 1.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.1rem;
}
.skill-title { font-size: 1.15rem; margin-bottom: 0.9rem; }
.skill-list { list-style: none; padding: 0; margin: 0; }
.skill-list li {
  position: relative;
  padding-left: 1.3rem;
  margin-bottom: 0.45rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.skill-list li::before {
  content: "\F270"; /* bootstrap-icons check */
  font-family: "bootstrap-icons";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.85rem;
}

/* Certifications strip */
.cert-strip {
  margin-top: 3rem;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem 1.5rem;
  box-shadow: var(--shadow);
}
.cert-heading { font-size: 1.25rem; margin-bottom: 1.25rem; }
.cert-tags { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center; }
.cert-tag {
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 30px;
  padding: 0.45rem 1rem;
  font-size: 0.88rem;
  font-weight: 600;
}
.cert-tag-progress {
  background: transparent;
  border: 1px dashed var(--accent);
}

/* =========================================================
   PROJECTS
========================================================== */
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.8rem 1.5rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.project-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent);
}
.project-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}
/* Award / highlight badge (e.g. "3rd Place") */
.project-card { position: relative; }
.project-badge {
  position: absolute;
  top: 1rem; right: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: linear-gradient(135deg, #c9961f, #e9c46a);
  color: #3a2c05;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  padding: 0.28rem 0.6rem;
  border-radius: 30px;
  box-shadow: 0 4px 12px rgba(201, 150, 31, 0.35);
}
.overlay-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: linear-gradient(135deg, #c9961f, #e9c46a);
  color: #3a2c05;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.3rem 0.7rem;
  border-radius: 30px;
}

.project-title { font-size: 1.2rem; margin-bottom: 0.6rem; }
.project-desc { color: var(--text-muted); font-size: 0.95rem; flex-grow: 1; }
.tech-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.9rem 0 1rem; }
.tech-tags span {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 6px;
  padding: 0.2rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 600;
}
/* Clickable card affordance */
.project-card { cursor: pointer; }
.project-card:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
.project-more {
  margin-top: auto;
  padding-top: 0.6rem;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.project-more i { transition: transform 0.2s ease; }
.project-card:hover .project-more i { transform: translateX(4px); }

/* =========================================================
   PROJECT DETAIL OVERLAY (clean, semi-transparent)
========================================================== */
.project-overlay {
  position: fixed;
  inset: 0;
  z-index: 1080;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.project-overlay.open { display: flex; }

.project-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 13, 28, 0.55);
  backdrop-filter: blur(6px);
  animation: overlayFade 0.25s ease;
}

.project-overlay-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2.4rem;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  animation: overlayRise 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
/* Slightly translucent, frosted panel for the "transparent" feel */
[data-theme="light"] .project-overlay-panel { background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(12px); }
[data-theme="dark"]  .project-overlay-panel { background: rgba(19, 28, 54, 0.9); backdrop-filter: blur(12px); }

.overlay-close {
  position: absolute;
  top: 1rem; right: 1rem;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.overlay-close:hover { background: var(--accent); color: #fff; transform: rotate(90deg); }

.overlay-icon {
  width: 60px; height: 60px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.1rem;
}
.overlay-title { font-size: 1.5rem; margin-bottom: 0.9rem; }
.overlay-tags { margin-bottom: 1.3rem; }
.overlay-body { color: var(--text); }
.overlay-body p { margin-bottom: 1rem; }
.overlay-body p:last-child { margin-bottom: 0; }
.overlay-body strong { color: var(--accent); }

@keyframes overlayFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes overlayRise {
  from { opacity: 0; transform: translateY(24px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* =========================================================
   CONTACT
========================================================== */
.contact-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 2.2rem;
  box-shadow: var(--shadow);
}
.form-label { font-weight: 600; color: var(--text); }
.form-control {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.7rem 0.9rem;
}
.form-control:focus {
  background: var(--bg);
  color: var(--text);
  border-color: var(--accent);
  box-shadow: 0 0 0 0.2rem var(--accent-soft);
}
.form-control::placeholder { color: var(--text-muted); }
.form-status { font-weight: 600; }
.form-status.success { color: #1f9d55; }
.form-status.error { color: #d64545; }

.contact-link {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}
.contact-link:hover { color: var(--accent); text-decoration: none; }

.social-icons { display: flex; gap: 1rem; justify-content: center; }
.social-icons a {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}
.social-icons a:hover {
  transform: translateY(-3px);
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}

/* =========================================================
   FOOTER
========================================================== */
.footer {
  background: var(--navy);
  color: #cdd6ec;
  padding: 2.5rem 0;
}
.footer .social-icons a {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  color: #fff;
}
.footer .social-icons a:hover { background: var(--accent); }
.footer-text { font-size: 0.9rem; color: #9fb0d4; }

/* =========================================================
   SCROLL-TO-TOP
========================================================== */
.scroll-top {
  position: fixed;
  right: 1.5rem; bottom: 1.5rem;
  width: 48px; height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.2s ease;
  z-index: 1030;
  box-shadow: var(--shadow);
}
.scroll-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.scroll-top:hover { background: var(--navy-3); }

/* =========================================================
   SCROLL-REVEAL ANIMATION
========================================================== */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn:hover, .skill-card:hover, .project-card:hover,
  .social-icons a:hover, .theme-toggle:hover { transform: none; }
}

/* =========================================================
   RESPONSIVE TWEAKS
========================================================== */
@media (max-width: 991.98px) {
  .navbar-nav { padding-top: 0.75rem; }
  .hero { padding: 6rem 0 4rem; text-align: center; }
  .hero-cta { justify-content: center; }
  .hero-tagline { margin-left: auto; margin-right: auto; }
  .hero-photo { margin-top: 2.5rem; width: 220px; height: 220px; }
}

@media (max-width: 575.98px) {
  .section { padding: 4rem 0; }
  .contact-form { padding: 1.5rem; }
  .hero-cta .btn { width: 100%; }
}
