/* ==========================================================================
   main.css — site-wide styles
   --------------------------------------------------------------------------
   Contents:
     1. Design tokens (colors)
     2. Base elements
     3. Header & navigation (incl. responsive "More" overflow nav)
     4. Accessibility helpers (focus rings, skip link)
     5. Page layout & typography
     6. Buttons, chips & actions
     7. Cards & content grids
     8. Tags & research figure
     9. Projects & featured cards
    10. Recommendations
    11. Contact & forms
    12. Footer & back-to-top
    13. Responsive breakpoints & reduced motion
   ========================================================================== */

/* ==========================================================================
   1. Design tokens
   ========================================================================== */

:root {
  color-scheme: dark;
  --bg: #f8fbff;
  --surface: #ffffff;
  --surface-alt: #f1f5ff;
  --text: #f8fafc;
  --muted: #e2e8f0;
  --accent: #7dd3fc;
  --accent-dark: #38bdf8;
  --border: rgba(255, 255, 255, 0.2);
  --shadow: rgba(2, 6, 23, 0.25);
}

/* ==========================================================================
   2. Base elements
   ========================================================================== */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  font-size: 1.05rem;
  line-height: 1.7;
  color: #e2f0ff;
  background: #020617;
  position: relative;
  isolation: isolate;
  overflow-x: hidden;
  text-shadow: 0 1px 2px rgba(2, 6, 23, 0.7);
}

#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

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

img {
  display: block;
  max-width: 100%;
}

/* ==========================================================================
   3. Header & navigation
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(2, 6, 23, 0.68);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.nav {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  --brand-hue: 199;
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #f8fafc;
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .brand {
    background: linear-gradient(
      90deg,
      hsl(var(--brand-hue), 92%, 70%),
      hsl(calc(var(--brand-hue) + 70), 92%, 70%),
      #f8fafc,
      hsl(var(--brand-hue), 92%, 70%)
    );
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
    animation: brand-flow 4s linear infinite, brand-hue-cycle 18s linear infinite;
  }
}

/* Gradient tiles seamlessly (first and last stops match), so sliding it by
   exactly one tile width per cycle loops without a visible jump. */
@keyframes brand-flow {
  from {
    background-position: 0% 50%;
  }
  to {
    background-position: 150% 50%;
  }
}

@keyframes brand-hue-cycle {
  to {
    filter: hue-rotate(360deg);
  }
}

.nav-list {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.nav-list a {
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  color: #e2e8f0;
  font-weight: 600;
  transition: all 0.2s ease;
}

.nav-list a:hover {
  background: var(--surface-alt);
  color: var(--accent-dark);
}

.nav-list a.active {
  color: var(--accent-dark);
  font-weight: 700;
}

@media (min-width: 641px) {
  .nav-list.priority-nav {
    flex: 1;
    min-width: 0;
    margin-left: 1.5rem;
    justify-content: flex-end;
    flex-wrap: nowrap;
  }

  .nav-list.priority-nav .nav-link,
  .nav-list.priority-nav .nav-dropdown-toggle {
    white-space: nowrap;
  }
}

.nav-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(125, 211, 252, 0.25);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.85);
  cursor: pointer;
}

.nav-toggle-bar {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: #e2f0ff;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.nav-toggle.open .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.open .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle.open .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.8rem;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #e2e8f0;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-dropdown-toggle:hover,
.nav-dropdown.open .nav-dropdown-toggle {
  background: var(--surface-alt);
  color: var(--accent-dark);
}

.nav-dropdown.has-active .nav-dropdown-toggle {
  color: var(--accent-dark);
  font-weight: 700;
}

.nav-caret {
  font-size: 0.7em;
  transition: transform 0.25s ease;
}

.nav-dropdown.open .nav-caret {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 0.65rem);
  right: 0;
  min-width: 200px;
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.5rem;
  background: rgba(2, 6, 23, 0.97);
  border: 1px solid rgba(125, 211, 252, 0.22);
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.55);
}

.nav-dropdown.open .nav-dropdown-menu {
  display: flex;
  animation: nav-fade-in 0.2s ease;
}

.nav-dropdown-menu a {
  border-radius: 12px;
  padding: 0.55rem 0.8rem;
}

@keyframes nav-fade-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* No-JS fallback header — served inside <noscript> on every page, reusing the
   real header's classes minus the JS-only hamburger and "More" dropdown.
   Never rendered when JavaScript is enabled. */

.noscript-header .nav {
  flex-wrap: wrap;
  gap: 0.5rem;
}

.noscript-header .nav-list {
  flex: 1;
  min-width: 0;
  margin-left: 1.5rem;
  justify-content: flex-end;
}

@media (max-width: 640px) {
  .noscript-header .nav-list {
    position: static;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-left: 0;
    padding: 0;
    max-height: none;
    overflow: visible;
    background: transparent;
    backdrop-filter: none;
    border-bottom: none;
    box-shadow: none;
  }
}

/* ==========================================================================
   4. Accessibility helpers
   ========================================================================== */

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

#header-placeholder {
  min-height: 76px;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  background: var(--accent);
  color: #0f172a;
  font-weight: 700;
  transform: translateY(-200%);
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

/* ==========================================================================
   5. Page layout & typography
   ========================================================================== */

main {
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  position: relative;
  z-index: 1;
  flex: 1 0 auto;
}

.reveal {
  opacity: 1;
  transform: none;
}

.reveal.reveal-animated {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.reveal-animated.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.page-shell {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.page-hero {
  padding: 2.2rem 0 0.4rem;
}

.hero-section {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
  align-items: center;
  padding: 3rem 0 2rem;
}

.eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  font-weight: 800;
  color: #7dd3fc;
}

h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0 0 1rem;
}

h1 {
  font-size: clamp(2rem, 3.2vw, 3.2rem);
  color: #ffffff;
  font-weight: 800;
  text-shadow: 0 2px 10px rgba(2, 6, 23, 0.8);
}

h2 {
  font-size: clamp(1.6rem, 2.2vw, 2.2rem);
}

.hero-text,
.section-heading p,
.info-card p,
.license-card p,
footer p {
  color: #e2e8f0;
  font-weight: 600;
}

/* ==========================================================================
   6. Buttons, chips & actions
   ========================================================================== */

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.interactive-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.2rem;
}

.availability-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 1.1rem 0 0;
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.14);
  border: 1px solid rgba(74, 222, 128, 0.35);
  color: #dcfce7;
  font-weight: 700;
  font-size: 0.95rem;
}

.availability-pill::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #4ade80;
  animation: availability-pulse 2s ease-out infinite;
}

@keyframes availability-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.55);
  }
  70% {
    box-shadow: 0 0 0 9px rgba(74, 222, 128, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(74, 222, 128, 0);
  }
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  background: rgba(125, 211, 252, 0.12);
  color: #e2f0ff;
  border: 1px solid rgba(125, 211, 252, 0.2);
  font-weight: 700;
  transition: transform 0.2s ease, background 0.2s ease;
}

.chip:hover {
  transform: translateY(-2px);
  background: rgba(125, 211, 252, 0.2);
}

.btn {
  display: inline-block;
  padding: 0.8rem 1.2rem;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: #0f172a;
  color: #f8fafc;
  box-shadow: 0 10px 25px rgba(2, 6, 23, 0.22);
}

.btn-primary:hover {
  background: #111827;
}

.btn-secondary {
  background: #0f172a;
  color: #f8fafc;
  border: 1px solid rgba(125, 211, 252, 0.25);
}

.btn-secondary:hover {
  background: #111827;
  color: #f8fafc;
}

/* ==========================================================================
   7. Cards & content grids
   ========================================================================== */

.hero-card,
.section-card {
  background: rgba(2, 6, 23, 0.88);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 24px;
  box-shadow: 0 10px 30px rgba(2, 6, 23, 0.24);
}

.hero-card {
  padding: 1.2rem;
  background: linear-gradient(145deg, rgba(8, 15, 36, 0.9), rgba(15, 23, 42, 0.84));
  border: 1px solid rgba(125, 211, 252, 0.16);
}

.hero-card img {
  border-radius: 20px;
  height: 360px;
  object-fit: cover;
  width: 100%;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.profile-highlights {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.8rem;
  margin-top: 1rem;
}

.profile-highlights div {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.92));
  border: 1px solid rgba(125, 211, 252, 0.22);
  border-radius: 16px;
  padding: 0.9rem;
  text-align: center;
  min-height: 84px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.profile-highlights strong {
  display: block;
  color: #f8fafc;
  font-size: 1rem;
  margin-bottom: 0.2rem;
}

.profile-highlights span {
  font-size: 0.9rem;
  color: #cbd5e1;
}

.section-card {
  padding: 2rem;
  margin-top: 1.5rem;
}

.section-heading {
  margin-bottom: 1.2rem;
}

.card-grid,
.license-grid,
.content-grid {
  display: grid;
  gap: 1rem;
}

.card-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.content-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.content-grid.three-up {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.content-grid.two-up {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.info-card,
.license-card {
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.8), rgba(30, 41, 59, 0.74));
  border: 1px solid rgba(125, 211, 252, 0.14);
  border-radius: 18px;
  padding: 1.2rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.info-card:hover,
.license-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(20, 33, 61, 0.08);
}

.license-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.license-card img {
  height: 120px;
  width: 100%;
  object-fit: contain;
  margin-bottom: 0.8rem;
}

.license-card p {
  margin: 0;
  font-weight: 600;
  text-align: center;
  color: #e2e8f0;
}

/* ==========================================================================
   8. Tags & research figure
   ========================================================================== */

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.9rem;
}

.research-figure {
  margin: 1.75rem 0 0;
}

.research-figure img {
  display: block;
  width: 100%;
  max-width: 860px;
  height: auto;
  margin: 0 auto;
  border-radius: 18px;
}

.research-figure figcaption {
  margin-top: 0.85rem;
  text-align: center;
  font-size: 0.9rem;
  color: #94a3b8;
}

.paper-meta {
  margin-top: 0.35rem;
  font-size: 0.95rem;
  color: #94a3b8;
}

.paper-doi {
  color: #7dd3fc;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.award-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.7rem 0 0;
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.35);
  color: #fde68a;
  font-weight: 700;
  font-size: 0.92rem;
}

/* Career timeline (About page) */

.timeline {
  list-style: none;
  margin: 0.4rem 0 0;
  padding: 0;
}

.timeline li {
  position: relative;
  margin-left: 0.4rem;
  padding: 0 0 1.5rem 1.6rem;
  border-left: 2px solid rgba(125, 211, 252, 0.25);
}

.timeline li:last-child {
  padding-bottom: 0.2rem;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 0.4rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #7dd3fc;
  box-shadow: 0 0 0 4px rgba(125, 211, 252, 0.15);
}

.timeline-period {
  margin: 0;
  color: #7dd3fc;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.timeline-role {
  margin: 0.15rem 0 0;
  font-weight: 800;
  color: #f8fafc;
}

.timeline-desc {
  margin: 0.25rem 0 0;
  color: #e2e8f0;
  font-size: 0.95rem;
  line-height: 1.6;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  background: rgba(125, 211, 252, 0.16);
  color: #e2f0ff;
  font-size: 0.9rem;
  border: 1px solid rgba(125, 211, 252, 0.25);
}

.compact-card h3 {
  margin-bottom: 0.4rem;
}

/* ==========================================================================
   9. Projects & featured cards
   ========================================================================== */

.featured-project-shell {
  margin-top: 0.4rem;
}

.featured-project-card {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.2rem 1.2rem;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.82));
  border: 1px solid rgba(125, 211, 252, 0.24);
  color: #f8fafc;
  box-shadow: 0 12px 30px rgba(2, 6, 23, 0.18);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.featured-project-card:hover {
  transform: translateY(-2px);
  border-color: rgba(125, 211, 252, 0.45);
}

.featured-project-content {
  flex: 1;
}

.featured-recommendation-card {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  padding: 1.3rem 1.3rem;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.82));
  border: 1px solid rgba(125, 211, 252, 0.24);
  color: #f8fafc;
  box-shadow: 0 12px 30px rgba(2, 6, 23, 0.18);
}

.featured-recommendation-badge {
  display: inline-flex;
  align-self: flex-start;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(125, 211, 252, 0.16);
  color: #7dd3fc;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.featured-recommendation-quote {
  margin: 0;
  font-size: 1.04rem;
  line-height: 1.8;
  color: #e2f0ff;
}

.featured-recommendation-author {
  font-weight: 800;
  color: #f8fafc;
}

.featured-recommendation-meta {
  color: #7dd3fc;
  font-size: 0.95rem;
}

.project-carousel {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.carousel-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  margin-top: 1rem;
}

.carousel-btn {
  border: 1px solid rgba(125, 211, 252, 0.3);
  background: rgba(15, 23, 42, 0.92);
  color: #f8fafc;
  border-radius: 999px;
  width: 42px;
  height: 42px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.carousel-btn:hover:not(:disabled) {
  background: rgba(125, 211, 252, 0.18);
  transform: translateY(-1px);
}

.carousel-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.page-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: #cbd5e1;
}

.project-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.project-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.8rem;
  padding: 1rem;
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.9), rgba(30, 41, 59, 0.78));
  border: 1px solid rgba(125, 211, 252, 0.18);
  color: #f8fafc;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.project-item:hover {
  transform: translateY(-2px);
  border-color: rgba(125, 211, 252, 0.4);
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.18);
}

.project-name {
  font-weight: 700;
  line-height: 1.35;
  margin: 0.2rem 0 0.4rem;
}

.project-meta {
  color: #7dd3fc;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0;
}

.project-description {
  margin: 0;
  color: #e2e8f0;
  font-size: 0.95rem;
  line-height: 1.6;
}

.project-link-pill {
  flex-shrink: 0;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  background: rgba(125, 211, 252, 0.16);
  color: #f8fafc;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.section-footer-link {
  margin-top: 1.2rem;
  display: flex;
  justify-content: center;
}

/* ==========================================================================
   10. Recommendations
   ========================================================================== */

.recommendation-carousel {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.recommendation-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
}

.recommendation-card {
  padding: 1.3rem;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.82));
  border: 1px solid rgba(125, 211, 252, 0.22);
  box-shadow: 0 12px 30px rgba(2, 6, 23, 0.18);
}

.recommendation-quote {
  margin: 0 0 1rem;
  font-size: 1.02rem;
  line-height: 1.8;
  color: #e2f0ff;
}

.recommendation-author {
  font-weight: 800;
  color: #f8fafc;
}

.recommendation-role {
  color: #7dd3fc;
  font-size: 0.95rem;
  margin-top: 0.2rem;
}

.recommendation-date {
  color: #cbd5e1;
  font-size: 0.9rem;
  margin-top: 0.4rem;
}

/* ==========================================================================
   11. Contact & forms
   ========================================================================== */

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.contact-links a {
  padding: 0.7rem 1rem;
  border-radius: 999px;
  background: rgba(125, 211, 252, 0.16);
  color: #f8fafc;
  font-weight: 700;
  border: 1px solid rgba(125, 211, 252, 0.35);
}

.contact-links a:hover {
  background: var(--accent);
  color: #0f172a;
}

.contact-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 0.7rem;
}

.contact-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  background: rgba(125, 211, 252, 0.16);
  color: #f8fafc;
  font-weight: 700;
  border: 1px solid rgba(125, 211, 252, 0.35);
}

.contact-actions a:hover {
  background: var(--accent);
  color: #0f172a;
}

.contact-icon {
  font-size: 1rem;
  line-height: 1;
}

.contact-form {
  display: grid;
  gap: 1rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-weight: 600;
  color: #e2e8f0;
}

.field span {
  font-size: 0.95rem;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid rgba(125, 211, 252, 0.25);
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.95);
  color: #0f172a;
  font: inherit;
}

.field textarea {
  min-height: 150px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid rgba(125, 211, 252, 0.4);
  border-color: var(--accent);
}

.field.full {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.form-status {
  margin: 0;
  color: #7dd3fc;
  font-weight: 700;
}

.success-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.16);
  color: #dcfce7;
  border: 1px solid rgba(74, 222, 128, 0.3);
}

.form-followup {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.form-followup button {
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(125, 211, 252, 0.35);
  background: rgba(125, 211, 252, 0.16);
  color: #f8fafc;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.form-followup button:hover {
  background: var(--accent);
  color: #0f172a;
}

/* ==========================================================================
   12. Footer & back-to-top
   ========================================================================== */

footer {
  margin: 0;
  padding: 2rem 1.5rem 1.5rem;
  text-align: center;
  position: relative;
  z-index: 1;
  background: rgba(2, 6, 23, 0.55);
  color: var(--text);
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.footer-grid,
.footer-bottom {
  max-width: 1180px;
  margin-left: auto;
  margin-right: auto;
}

.footer-brand {
  text-align: left;
}

.footer-name {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #f8fafc;
}

.footer-logo {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 1px solid rgba(125, 211, 252, 0.3);
}

.footer-tagline {
  margin-top: 0.4rem;
  color: #94a3b8;
  font-weight: 500;
  font-size: 0.95rem;
  line-height: 1.65;
}

.back-to-top {
  position: fixed;
  right: 1.2rem;
  bottom: 1.2rem;
  z-index: 40;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #38bdf8, #0f172a);
  color: #f8fafc;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(2, 6, 23, 0.24);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

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

footer a:hover {
  color: var(--accent);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1.7fr;
  gap: 2.5rem;
  text-align: left;
  padding-bottom: 1.3rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  align-content: start;
}

.footer-col h3 {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 0.8rem;
}

.footer-col a {
  display: block;
  padding: 0.28rem 0;
  color: #cbd5e1;
  font-weight: 600;
}

.link-icon {
  width: 15px;
  height: 15px;
  vertical-align: -2px;
  margin-right: 0.35rem;
  fill: currentColor;
}

.footer-bottom {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding-top: 1.2rem;
}

.footer-bottom small {
  color: #94a3b8;
}

.footer-bottom a {
  color: #cbd5e1;
  font-weight: 600;
}

/* ==========================================================================
   13. Responsive breakpoints & reduced motion
   ========================================================================== */

@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }
}

@media (max-width: 768px) {
  .footer-grid,
  .footer-brand {
    text-align: center;
  }

  .footer-name {
    justify-content: center;
  }

  .footer-links {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .footer-tagline {
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 900px) {
  .hero-section {
    grid-template-columns: 1fr;
  }


  .card-grid,
  .license-grid,
  .content-grid,
  .content-grid.two-up,
  .content-grid.three-up {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .nav-toggle {
    display: inline-flex;
  }

  .nav-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 0.35rem;
    padding: 0.9rem 1.2rem 1.2rem;
    max-height: calc(100vh - 80px);
    max-height: calc(100dvh - 80px);
    overflow-y: auto;
    overscroll-behavior: contain;
    background: rgba(2, 6, 23, 0.97);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(125, 211, 252, 0.18);
    box-shadow: 0 24px 40px rgba(2, 6, 23, 0.5);
  }

  .nav-list.open {
    display: flex;
    animation: nav-fade-in 0.25s ease;
  }

  .nav-list a {
    padding: 0.7rem 0.9rem;
    border-radius: 12px;
  }

  .nav-dropdown {
    position: static;
    display: contents;
  }

  .nav-dropdown-toggle {
    display: none;
  }

  .nav-dropdown-menu {
    position: static;
    display: contents;
  }
}

@media (max-width: 640px) {
  .hero-section,
  .section-card,
  footer {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .profile-highlights,
  .card-grid,
  .license-grid,
  .content-grid,
  .content-grid.two-up,
  .content-grid.three-up,
  .project-list,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
