/* ---------------------------------------------------
   BASE VARIABLES & RESETS
--------------------------------------------------- */
:root {
  --bg: #030416;
  --bg-alt: #070821;
  --card: #0d0e43;
  --accent: #6ce3ff;
  --accent-soft: rgba(108, 227, 255, 0.14);
  --text: #f7f7ff;
  --muted: #a5a7d4;

  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(108, 227, 255, 0.25);

  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-pill: 999px;

  --shadow-soft: 0 18px 60px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 18px rgba(108, 227, 255, 0.5);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #14164e 0, #030416 45%, #02010b 100%);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

/* ---------------------------------------------------
   STARFIELD BACKGROUND
--------------------------------------------------- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: url('data:image/svg+xml;utf8,\
    <svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%">\
      <circle cx="10" cy="10" r="1" fill="white" opacity="0.5"/>\
      <circle cx="200" cy="200" r="1" fill="white" opacity="0.4"/>\
      <circle cx="400" cy="600" r="1" fill="white" opacity="0.3"/>\
    </svg>');
  opacity: 0.18;
  animation: drift 60s linear infinite;
  pointer-events: none;
  z-index: -1;
}

@keyframes drift {
  0% { transform: translateY(0); }
  100% { transform: translateY(-120px); }
}

/* ---------------------------------------------------
   PAGE WRAPPER
--------------------------------------------------- */
.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 16px 80px;
}

/* ---------------------------------------------------
   HEADER / NAVIGATION
--------------------------------------------------- */
header {
  position: sticky;
  top: 0;
  z-index: 9999;
  backdrop-filter: blur(12px);
  background: rgba(3, 4, 20, 0.58);
  padding: 14px 4px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: 0.35s ease;
}

header.shrink {
  padding: 6px 4px 10px !important;
  background: rgba(3, 4, 20, 0.92);
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  letter-spacing: 0.06em;
  font-size: 0.9rem;
  text-transform: uppercase;
}

.logo-image {
  width: 32px;
  height: 32px;
  transition: 0.35s ease;
}

.logo-image:hover {
  filter: drop-shadow(0 0 14px rgba(108, 227, 255, 0.85));
  transform: scale(1.06);
}

/* ---------------------------------------------------
   DESKTOP NAV
--------------------------------------------------- */
nav {
  display: flex;
  gap: 14px;
  font-size: 0.86rem;
  transition: 0.3s ease;
}

nav a {
  color: var(--muted);
  padding: 6px 10px;
  position: relative;
  text-decoration: none;
  border-radius: var(--radius-pill);
}

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

/* Hover + active underline */
nav a::after {
  content: "";
  position: absolute;
  bottom: 1px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--accent);
  transform: translateX(-50%);
  transition: width 0.32s ease;
}

nav a:hover::after,
nav a.active::after {
  width: 70%;
}

/* ---------------------------------------------------
   HAMBURGER BUTTON (animated)
--------------------------------------------------- */
#navToggle {
  display: none;
  cursor: pointer;
  width: 36px;
  height: 32px;
  border: none;
  background: none;
  position: relative;
}

#navToggle span {
  position: absolute;
  width: 100%;
  height: 3px;
  background: var(--muted);
  left: 0;
  transition: 0.35s ease;
  border-radius: 4px;
}

#navToggle span:nth-child(1) { top: 6px; }
#navToggle span:nth-child(2) { top: 14px; }
#navToggle span:nth-child(3) { top: 22px; }

/* OPEN STATE (X) */
#navToggle.open span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
#navToggle.open span:nth-child(2) {
  opacity: 0;
}
#navToggle.open span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* ---------------------------------------------------
   MOBILE NAV (SLIDE-IN PANEL)
--------------------------------------------------- */
@media (max-width: 900px) {
  #navToggle {
    display: block;
    position: relative;
    z-index: 10000;
  }

  #siteNav {
    position: fixed;
    top: 0;
    right: -260px;
    width: 240px;
    height: 100vh;
    background: rgba(5, 6, 20, 0.97);
    backdrop-filter: blur(14px);
    display: flex;
    flex-direction: column;
    padding: 80px 22px;
    gap: 18px;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    transition: right 0.35s ease;
    z-index: 9998;
  }

  body.nav-open #siteNav {
    right: 0;
  }

  body.nav-open {
    overflow: hidden;
  }

  nav a {
    font-size: 1.08rem;
    padding: 10px;
  }
}

/* ---------------------------------------------------
   TYPOGRAPHY & SECTION HEADERS
--------------------------------------------------- */
h1, h2, h3 {
  font-weight: 650;
  letter-spacing: 0.02em;
}

h1 {
  font-size: clamp(2.3rem, 4vw, 2.9rem);
  line-height: 1.12;
}

h2 {
  font-size: 1.35rem;
  margin-bottom: 6px;
}

h3 {
  font-size: 1.02rem;
}

.section-header {
  margin-bottom: 10px;
}

.section-kicker {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin-bottom: 2px;
}

.section-description {
  font-size: 0.9rem;
  color: var(--muted);
  max-width: 42rem;
}

/* ---------------------------------------------------
   SECTION CONTAINERS
--------------------------------------------------- */
section {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: linear-gradient(
      140deg,
      rgba(13, 14, 67, 0.96),
      rgba(4, 5, 30, 0.98)
  );
  padding: 48px 22px;
  margin-top: 46px;
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
  animation: borderPulse 14s ease-in-out infinite;
}

/* Glow divider at top of each section */
section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 40%;
  width: 20%;
  height: 3px;
  background: radial-gradient(circle, rgba(108, 227, 255, 0.55), transparent);
  filter: blur(6px);
}

@keyframes borderPulse {
  0%, 100% { border-color: rgba(255, 255, 255, 0.04); }
  50%      { border-color: rgba(108, 227, 255, 0.25); }
}

section.compact {
  padding: 32px 20px;
}

/* ---------------------------------------------------
   FADE-IN ANIMATION
--------------------------------------------------- */
.fade-in {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.9s ease, transform 1s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------------------------------------------------
   HERO
--------------------------------------------------- */
.hero-layout {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 32px;
  align-items: center;
}

.eyebrow {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 8px;
}

.hero-subtitle {
  margin-top: 14px;
  color: var(--muted);
  max-width: 36rem;
  font-size: 0.98rem;
}

.hero-tags {
  display: flex;
  gap: 8px;
  margin: 16px 0 20px;
  flex-wrap: wrap;
}

/* Tags / chips */
.tag {
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
  background: rgba(4, 5, 30, 0.86);
}
.tag.accent {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(108, 227, 255, 0.08);
}

/* Hero actions / buttons */
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  margin-bottom: 12px;
}

.btn {
  font-size: 0.9rem;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-primary {
  background: linear-gradient(130deg, #6ce3ff, #5ab8ff);
  color: #02020a;
  font-weight: 600;
  box-shadow: 0 0 24px rgba(108, 227, 255, 0.7);
}
.btn-primary:hover {
  filter: brightness(1.05);
  text-decoration: none;
}

.btn-ghost {
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--muted);
  background: rgba(4, 5, 30, 0.8);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

/* Metrics strip */
.metric-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  font-size: 0.8rem;
  margin-top: 6px;
}

.metric-pill {
  border-radius: var(--radius-pill);
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: radial-gradient(circle at top left, var(--accent-soft), #050622);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.metric-label {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.68rem;
}

.metric-value {
  font-weight: 600;
  font-size: 0.9rem;
}

/* HERO Photo */
.hero-right {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}

.hero-photo-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.35s ease-out;
}

.hero-photo {
  width: 100%;
  border-radius: 22px;
  max-width: 360px;
  box-shadow: 0 0 32px rgba(108, 227, 255, 0.35);
  opacity: 0;
  transform: translateY(28px) scale(0.96);
  transition: 1s ease;
  object-fit: cover;
}
.hero-photo.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* HERO Card */
.hero-card {
  border-radius: var(--radius-lg);
  padding: 16px 14px;
  background: radial-gradient(circle at top,
      rgba(108, 227, 255, 0.16),
      #050620);
  border: 1px solid rgba(108, 227, 255, 0.25);
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.86rem;
  width: 100%;
}

.hero-card-header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.pill-soft {
  font-size: 0.72rem;
  padding: 4px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--muted);
  background: rgba(3, 4, 22, 0.9);
}

.hero-arch-diagram {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco,
    Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.78rem;
  background: rgba(3, 4, 22, 0.88);
  border-radius: var(--radius-md);
  padding: 10px 10px 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  overflow-x: auto;
  white-space: pre;
}

/* ---------------------------------------------------
   LAYOUT HELPERS & CONTENT BLOCKS
--------------------------------------------------- */
.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 18px;
  margin-top: 10px;
}

.two-column {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 10px;
}

.bullet-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.9rem;
}

.bullet-list li::before {
  content: "•";
  color: var(--accent);
  margin-right: 6px;
}

.highlight-box {
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(4, 5, 28, 0.96);
  padding: 10px 12px;
  font-size: 0.86rem;
  color: var(--muted);
}

/* Portfolio grid / cards */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
  margin-top: 12px;
}

.card {
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: radial-gradient(circle at top,
      rgba(108, 227, 255, 0.08),
      #050622);
  padding: 12px 12px 10px;
  font-size: 0.86rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card h3 {
  font-size: 0.94rem;
}

/* Chips in cards */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.chip {
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--muted);
  background: rgba(5, 6, 28, 0.98);
}

.chip.accent {
  border-color: var(--accent);
  color: var(--accent);
}

/* Timeline */
.timeline {
  border-left: 1px solid rgba(255, 255, 255, 0.18);
  padding-left: 14px;
  margin-top: 6px;
}

.timeline-item {
  margin-bottom: 10px;
  position: relative;
  padding-left: 4px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -15px;
  top: 5px;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(108, 227, 255, 0.7);
}

/* Pills */
.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.pill {
  font-size: 0.76rem;
  padding: 4px 9px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--muted);
  background: rgba(3, 4, 22, 0.96);
}

.pill.strong {
  border-color: var(--accent);
  color: var(--accent);
}

/* Contact row */
.contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 10px;
}

.contact-item {
  font-size: 0.88rem;
  color: var(--muted);
}

/* About / Journey photo */
.about-photo-wrapper {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
}

.about-photo {
  width: 100%;
  max-width: 340px;
  border-radius: 20px;
  box-shadow: 0 0 22px rgba(108, 227, 255, 0.25);
  object-fit: cover;
  margin-bottom: 14px;
}

/* ---------------------------------------------------
   FOOTER
--------------------------------------------------- */
footer {
  margin-top: 40px;
  font-size: 0.78rem;
  text-align: center;
  opacity: 0.82;
  color: var(--muted);
}

/* ---------------------------------------------------
   BACK TO TOP
--------------------------------------------------- */
#backToTop {
  position: fixed;
  bottom: 26px;
  right: 26px;
  background: var(--accent);
  color: #02020a;
  padding: 10px 14px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 0 18px rgba(108, 227, 255, 0.6);
  transition: opacity 0.35s, transform 0.35s ease;
}

#backToTop.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-4px);
}

/* ---------------------------------------------------
   RESPONSIVE
--------------------------------------------------- */
@media (max-width: 900px) {
  .hero-layout {
    grid-template-columns: 1fr;
  }
  .hero-right {
    order: -1;
  }
}

@media (max-width: 600px) {
  section {
    padding: 24px 16px;
  }

  .section-header h2 {
    font-size: 1.58rem;
    line-height: 1.25;
  }

  .hero-photo {
    max-width: 100%;
  }

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