/* Prevent Safari/iOS from forcing light mode */
@media (prefers-color-scheme: dark) {
  html,
  body {
    color-scheme: dark;
    background-color: #020617 !important;
  }
}

@supports (-webkit-touch-callout: none) {
  html {
    -webkit-text-size-adjust: 100%;
    color-scheme: dark;
    background-color: #020617 !important;
  }

  body::before,
  body::after {
    display: none !important;
  }

  img,
  video {
    -webkit-filter: unset !important;
  }
}

:root {
  --bg: #050816;
  --bg-alt: #0b1020;
  --text: #e6edf6;
  --muted: #9fb0c3;
  --card: #10172a;
  --border: #1e293b;
  --accent: #7dd3fc;
  --accent-soft: rgba(125, 211, 252, 0.12);
  --shadow: 0 14px 30px rgba(15, 23, 42, 0.65);
  --shadow-strong: 0 20px 40px rgba(15, 23, 42, 0.85);
}

/* Global reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: radial-gradient(circle at top, #111827 0, #020617 55%);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
}

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

a:hover {
  color: #a5e4ff;
}

/* Accessibility */
.skip-link {
  position: absolute;
  top: -44px;
  left: 12px;
  background: var(--card);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 8px;
  z-index: 100;
  text-decoration: none;
  border: 1px solid var(--border);
}

.skip-link:focus {
  top: 12px;
}

a:focus-visible,
.button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Background effects */
.interactive-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
}

.bg-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(26px);
  opacity: 0.32;
  animation: floatBlob 16s ease-in-out infinite;
}

.blob-a {
  width: 460px;
  height: 460px;
  top: 12%;
  left: -110px;
  background: radial-gradient(circle, rgba(45, 212, 191, 0.32), transparent 62%);
}

.blob-b {
  width: 520px;
  height: 520px;
  bottom: -170px;
  right: -120px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.34), transparent 62%);
  animation-duration: 21s;
}

.bg-grid {
  position: absolute;
  inset: 0;
  opacity: 0.16;
  background-image:
    linear-gradient(rgba(125, 211, 252, 0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(125, 211, 252, 0.16) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(circle at center, black 30%, transparent 88%);
}

@keyframes floatBlob {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  50% {
    transform: translate(22px, -20px) scale(1.04);
  }
}

/* Soft background glows */
body::before,
body::after {
  content: "";
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(8px);
  opacity: 0.6;
  pointer-events: none;
  z-index: -1;
}

body::before {
  top: -120px;
  right: -80px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.18), transparent 60%);
}

body::after {
  bottom: -160px;
  left: -40px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.18), transparent 60%);
}

/* Layout */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

.page-title {
  margin-bottom: 18px;
}

.text-muted {
  color: var(--muted);
}

.prose {
  max-width: 740px;
}

/* Header / nav */
.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(5, 8, 22, 0.95);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.nav {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav-brand {
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.02em;
  color: var(--text);
  white-space: nowrap;
}

.brand-link {
  text-decoration: none;
  color: inherit;
}

.nav-links {
  display: flex;
  gap: 16px;
  row-gap: 8px;
  flex-wrap: wrap;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.nav a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.nav a.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

/* Typography */
h1,
h2,
h3 {
  font-weight: 650;
  letter-spacing: 0.01em;
}

h1 {
  font-size: clamp(32px, 4vw, 40px);
  margin-bottom: 12px;
}

h2 {
  font-size: 22px;
  margin: 24px 0 8px;
}

h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

p {
  margin-bottom: 12px;
  color: var(--text);
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 28px 0;
}

/* Lists */
ul,
ol {
  margin-left: 20px;
  margin-bottom: 12px;
}

li {
  margin-bottom: 4px;
}

/* Hero */
.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.hero-text {
  flex: 2;
  min-width: 260px;
}

.hero-media {
  flex: 1;
  min-width: 220px;
  display: flex;
  justify-content: flex-end;
}

.hero-kicker {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: 8px;
}

.hero-lead {
  font-size: 15px;
  max-width: 540px;
  color: var(--muted);
}

.hero-highlights {
  margin-left: 18px;
  margin-top: 8px;
  margin-bottom: 16px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

/* Headshots */
.headshot {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.9);
}

.headshot-side {
  width: 260px;
  float: right;
  margin: 0 0 20px 24px;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  object-fit: cover;
}

/* Sections */
.section {
  margin-top: 32px;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.section-kicker {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.section-title {
  font-size: 20px;
}

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  margin: 14px 0;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: rgba(125, 211, 252, 0.36);
  box-shadow: var(--shadow-strong);
}

.card p:last-child,
.card ul:last-child,
.card ol:last-child {
  margin-bottom: 0;
}

.project-card,
.experience-card {
  position: relative;
  overflow: hidden;
}

.project-card::after,
.experience-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(130deg, rgba(125, 211, 252, 0.08), transparent 42%);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.project-card:hover::after,
.experience-card:hover::after {
  opacity: 1;
}

.meta-row {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 10px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 14px;
}

.card-muted {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 4px;
}

/* Tags */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  border: 1px solid var(--border);
  background: var(--accent-soft);
  color: var(--accent);
  margin-right: 6px;
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 14px;
  text-decoration: none;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease,
    box-shadow 0.2s ease, border-color 0.2s ease;
}

.button-primary {
  background: linear-gradient(135deg, #38bdf8, #0ea5e9);
  color: #020617;
  border-color: transparent;
  box-shadow: 0 14px 30px rgba(8, 47, 73, 0.7);
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.7);
  border-color: var(--accent);
}

.button-primary:hover {
  background: linear-gradient(135deg, #0ea5e9, #38bdf8);
  color: #020617;
}

.cta-inline {
  display: inline-flex;
  margin-top: 8px;
}

/* Certifications */
.cert-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
  margin-top: 1rem;
}

.cert-card {
  max-width: 260px;
  text-align: center;
}

.cert-card img {
  width: 100%;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

/* About page */
.about-container {
  max-width: 1050px;
  margin: 0 auto;
}

.about-title {
  margin-bottom: 18px;
}

.about-hero {
  display: block;
}

.about-main {
  min-width: 0;
}

.about-intro {
  font-size: 16px;
}

.about-images {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
  align-items: start;
  justify-items: center;
  margin: 36px 0 28px;
}

.about-img {
  text-align: center;
  width: 100%;
}

.about-img img {
  width: 100%;
  max-width: 260px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 50%;
  margin: 0 auto 12px;
  display: block;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.45);
}

.about-caption {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  margin-bottom: 0;
}

.about-divider {
  margin: 32px 0 24px;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 12px;
}

.about-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
}

.about-box p {
  margin-top: 8px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 820px) {
  .about-images {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .about-grid {
    grid-template-columns: 1fr;
  }
}

/* Contact page */
.contact-container {
  max-width: 1000px;
  margin: 0 auto;
}

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.2fr);
  gap: 24px;
  margin-top: 16px;
  align-items: flex-start;
}

.contact-main {
  min-width: 0;
}

.contact-intro {
  font-size: 16px;
}

.contact-list {
  margin-top: 14px;
}

.contact-list li {
  margin-bottom: 10px;
}

.contact-card h2 {
  margin-top: 0;
}

.contact-note {
  color: var(--muted);
  font-size: 14px;
  margin-top: 12px;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 16px 20px 24px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
  background: #020617;
}

/* Responsiveness */
@media (max-width: 900px) {
  .about-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .nav {
    flex-direction: column;
    align-items: flex-start;
  }

  .container {
    padding: 18px 16px 32px;
  }

  .hero {
    flex-direction: column-reverse;
    align-items: flex-start;
  }

  .hero-media {
    justify-content: flex-start;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

  .about-layout {
    flex-direction: column;
  }

  .about-images {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }

  .headshot-side {
    float: none;
    display: block;
    margin: 0 auto 20px;
    width: 180px;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 28px;
  }

  .nav-links {
    gap: 12px;
  }

  .about-card img,
  .about-image {
    max-width: 180px;
    height: 180px;
  }

  .button {
    width: 100%;
    justify-content: center;
  }
}

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

  .bg-blob,
  .card,
  .button,
  .nav a {
    animation: none !important;
    transition: none !important;
  }
}