/* ============================================================
   CSS Custom Properties
   ============================================================ */
:root {
  --blue-deep:    #050e2b;
  --blue-mid:     #0a2260;
  --blue-bright:  #1553c7;
  --blue-accent:  #3b82f6;
  --blue-glow:    #60a5fa;
  --blue-pale:    #bfdbfe;
  --text-primary: #e8f0ff;
  --text-muted:   #7ea9d4;
  --card-bg:      rgba(8, 22, 70, 0.55);
  --card-border:  rgba(96, 165, 250, 0.18);
  --radius-card:  20px;
  --radius-btn:   12px;
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-mono:    'DM Mono', 'Courier New', monospace;
  --transition:   0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --page-gutter:  clamp(1.5rem, 5vw, 5rem);
}

/* ============================================================
   Reset & Base
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

/* ============================================================
   Contact Modal
   ============================================================ */
.contact-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(5, 14, 43, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--page-gutter);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.contact-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.contact-overlay.open .contact-card {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.contact-card {
  position: relative;
  background: rgba(8, 22, 70, 0.88);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  padding: 2.5rem 2.75rem;
  max-width: 420px;
  width: 100%;
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.04) inset,
    0 32px 80px rgba(5, 14, 43, 0.65);
  opacity: 0;
  transform: translateY(16px) scale(0.97);
  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.contact-close {
  position: absolute;
  top: 1.1rem;
  right: 1.25rem;
  background: rgba(96, 165, 250, 0.08);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.contact-close:hover {
  background: rgba(96, 165, 250, 0.18);
  color: #fff;
}

.contact-label {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--blue-accent);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.contact-label::before {
  content: '';
  display: block;
  width: 24px;
  height: 1px;
  background: var(--blue-accent);
  opacity: 0.7;
}

.contact-name {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 300;
  color: #fff;
  letter-spacing: -0.01em;
  line-height: 1;
  margin-bottom: 0.35rem;
}

.contact-title-line {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.contact-divider {
  height: 1px;
  background: linear-gradient(90deg, rgba(96, 165, 250, 0.25), transparent);
  margin-bottom: 1.5rem;
}

.contact-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.contact-row:last-child { margin-bottom: 0; }

.contact-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contact-link {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--blue-pale);
  text-decoration: none;
  transition: color var(--transition);
}

.contact-link:hover { color: #fff; }

.contact-muted {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

body {
  min-height: 100dvh;
  background: linear-gradient(
    135deg,
    var(--blue-deep)   0%,
    #091a4f            30%,
    #0e307a            60%,
    #0a1f5e           100%
  );
  color: var(--text-primary);
  font-family: var(--font-mono);
  position: relative;
  overflow-x: hidden;
}

/* ============================================================
   Animated Background Blobs
   ============================================================ */
.bg-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.22;
  animation: drift 18s ease-in-out infinite alternate;
}

.blob-1 {
  width: 620px; height: 620px;
  background: radial-gradient(circle, #1e5fd4, transparent 70%);
  top: -160px; left: -120px;
  animation-duration: 20s;
}

.blob-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #0ea5e9, transparent 70%);
  bottom: 0; right: -80px;
  animation-duration: 24s;
  animation-delay: -8s;
}

.blob-3 {
  width: 380px; height: 380px;
  background: radial-gradient(circle, #3b82f6, transparent 70%);
  top: 60%; left: 40%;
  transform: translate(-50%, -50%);
  animation-duration: 16s;
  animation-delay: -4s;
}

@keyframes drift {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(40px, 30px) scale(1.08); }
  100% { transform: translate(-20px, 50px) scale(0.95); }
}

/* ============================================================
   Blueprint Grid Overlay
   ============================================================ */
.grid-overlay {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(96, 165, 250, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(96, 165, 250, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
}

/* ============================================================
   Shared Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.75rem 1.6rem;
  border-radius: var(--radius-btn);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    background var(--transition),
    box-shadow var(--transition),
    transform var(--transition),
    border-color var(--transition),
    color var(--transition);
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--blue-bright), #1d6ae8);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.15);
  box-shadow:
    0 4px 20px rgba(21, 83, 199, 0.5),
    0 1px 0 rgba(255,255,255,0.12) inset;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #1a61d4, #2878f5);
  box-shadow: 0 6px 28px rgba(21, 83, 199, 0.65), 0 1px 0 rgba(255,255,255,0.15) inset;
  transform: translateY(-2px);
}

.btn-ghost {
  background: rgba(96, 165, 250, 0.08);
  color: var(--blue-pale);
  border: 1px solid var(--card-border);
}

.btn-ghost:hover {
  background: rgba(96, 165, 250, 0.18);
  border-color: rgba(96, 165, 250, 0.45);
  color: #fff;
  transform: translateY(-2px);
}

.btn-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.btn-sm {
  padding: 0.45rem 1rem;
  font-size: 0.75rem;
}

/* ============================================================
   CTA Group
   ============================================================ */
.cta-group {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ============================================================
   Header
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;

  background: rgba(5, 14, 43, 0.65);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);

  border-bottom: 1px solid var(--card-border);
}

/* Inner layout */
.header-inner {
  max-width: 1800px;
  margin: 0 auto;
  padding: 1.2rem var(--page-gutter);

  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Name (left) */
.header-name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: #fff;
  text-decoration: none;
  letter-spacing: 0.02em;
}

/* Nav (right) */
.header-nav {
  display: flex;
  gap: 1.2rem;
}

/* Links */
.nav-link {
  font-family: var(--font-mono);
  font-size: 1rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  position: relative;
  transition: color var(--transition);
}

/* Hover effect */
.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 1px;
  background: var(--blue-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
}

.nav-link:hover {
  color: #fff;
}

.nav-link:hover::after {
  transform: scaleX(1);
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: clamp(2rem, 6vw, 6rem);
  min-height: 100dvh;
  padding: clamp(3rem, 8vh, 6rem) var(--page-gutter);
  max-width: 1200px;
  margin: 0 auto;
}

/* Left column */
.hero-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  animation: rise 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero-label {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--blue-accent);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.hero-label::before {
  content: '';
  display: block;
  width: 32px;
  height: 1px;
  background: var(--blue-accent);
  opacity: 0.7;
}

.hero-name {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 9vw, 7rem);
  font-weight: 300;
  line-height: 0.95;
  color: #fff;
  letter-spacing: -0.02em;
}

.hero-name em {
  font-style: italic;
  font-weight: 300;
  color: var(--blue-pale);
}

.hero-sub {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 300;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.hero-bio {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  font-weight: 300;
  line-height: 1.75;
  color: rgba(232, 240, 255, 0.8);
  max-width: 52ch;
}

/* Right column — photo */
.hero-photo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  animation: rise 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.12s both;
  flex-shrink: 0;
}

.hero-photo-frame {
  position: relative;
  width: clamp(24rem, 28rem, 34rem);
  aspect-ratio: 3 / 4;
}

/* Engineering tick marks at corners */
.tick {
  position: absolute;
  display: block;
  width: 14px;
  height: 14px;
  border-color: rgba(96, 165, 250, 0.55);
  border-style: solid;
  z-index: 2;
}

.tick-tl { top: -6px;  left: -6px;  border-width: 1.5px 0 0 1.5px; }
.tick-tr { top: -6px;  right: -6px; border-width: 1.5px 1.5px 0 0; }
.tick-bl { bottom: -6px; left: -6px;  border-width: 0 0 1.5px 1.5px; }
.tick-br { bottom: -6px; right: -6px; border-width: 0 1.5px 1.5px 0; }

.hero-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 4px;
  border: 1px solid var(--card-border);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.04) inset,
    0 32px 80px rgba(5, 14, 43, 0.6),
    0 0 60px rgba(59, 130, 246, 0.1);
  filter: brightness(0.92) contrast(1.05);
}

.photo-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  opacity: 0.6;
  text-transform: uppercase;
}

/* ============================================================
   Section Rule / Divider
   ============================================================ */
.section-rule {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0 var(--page-gutter);
  max-width: 1200px;
  margin: 0 auto 3rem;
}

.section-rule::before,
.section-rule::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(96, 165, 250, 0.25), transparent);
}

.rule-label {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.22em;
  color: var(--text-muted);
  opacity: 0.7;
  white-space: nowrap;
}

/* ============================================================
   PROJECTS SECTION
   ============================================================ */
.projects {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  padding: 0 var(--page-gutter) 5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.project-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 48px rgba(5, 14, 43, 0.45);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  animation: rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.project-card:nth-child(1) { animation-delay: 0.05s; }
.project-card:nth-child(2) { animation-delay: 0.12s; }
.project-card:nth-child(3) { animation-delay: 0.19s; }

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 24px 64px rgba(5, 14, 43, 0.55), 0 0 0 1px rgba(96, 165, 250, 0.22);
  border-color: rgba(96, 165, 250, 0.3);
}

.project-img-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--blue-mid);
}

.project-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  filter: brightness(0.88) saturate(0.85);
}

.project-card:hover .project-img {
  transform: scale(1.04);
  filter: brightness(0.95) saturate(1);
}

.project-num {
  position: absolute;
  top: 0.75rem;
  right: 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  color: rgba(191, 219, 254, 0.5);
}

.project-body {
  padding: 1.4rem 1.5rem 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex: 1;
}

.project-tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue-accent);
}

.project-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: #fff;
  line-height: 1.2;
}

.project-desc {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 300;
  line-height: 1.75;
  color: var(--text-muted);
  flex: 1;
  margin-top: 0.25rem;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--blue-glow);
  text-decoration: none;
  transition: gap var(--transition), color var(--transition);
}

.project-link svg {
  width: 14px; height: 14px;
  transition: transform var(--transition);
}

.project-link:hover {
  color: #fff;
  gap: 0.65rem;
}

.project-link:hover svg {
  transform: translateX(3px);
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  position: relative;
  z-index: 1;
  padding: 0 var(--page-gutter) 2rem;
  max-width: 1200px;
  margin: 0 auto;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  opacity: 0.6;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.site-footer a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition);
}

.site-footer a:hover { color: var(--blue-pale); opacity: 1; }
.sep { opacity: 0.4; }

/* ============================================================
   Entrance animation (shared)
   ============================================================ */
@keyframes rise {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   RESUME PAGE
   ============================================================ */
.page-resume {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0;
}

.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  background: rgba(5, 14, 43, 0.72);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--card-border);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition);
}

.back-link svg { width: 18px; height: 18px; }
.back-link:hover { color: var(--blue-pale); }

.topbar-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: #fff;
  letter-spacing: 0.01em;
}

.viewer-card {
  position: relative;
  z-index: 1;
  margin-top: 56px;
  width: 100%;
  height: calc(100dvh - 56px);
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
}

.pdf-frame {
  flex: 1;
  width: 100%;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  background: rgba(8, 22, 70, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.04) inset,
    0 24px 80px rgba(5, 14, 43, 0.5);
  display: block;
  animation: rise 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.pdf-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.page-resume .site-footer {
  padding-bottom: 0.75rem;
}

/* ── Contact card note ── */
.contact-note {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.7;
  color: var(--text-muted);
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(96,165,250,0.12);
  font-style: italic;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
  .hero {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    min-height: unset;
    padding-top: 4rem;
    padding-bottom: 3rem;
    gap: 2.5rem;
  }

  .hero-photo-wrap {
    order: -1;
    align-items: flex-start;
  }

  .hero-photo-frame {
    width: clamp(140px, 40vw, 200px);
  }

  .cta-group {
    flex-direction: column;
  }

  .btn {
    justify-content: center;
  }

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

  .topbar { padding: 0 1rem; }
  .topbar-title { font-size: 0.9rem; }
  .viewer-card { padding: 0.75rem; }
  .pdf-frame { border-radius: 14px; }
}

