/* ============================================================
   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:  24px;
  --radius-btn:   12px;
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-mono:    'DM Mono', 'Courier New', monospace;
  --transition:   0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(
    135deg,
    var(--blue-deep)   0%,
    #091a4f            30%,
    #0e307a            60%,
    #0a1f5e           100%
  );
  color: var(--text-primary);
  font-family: var(--font-mono);
  padding: 2rem 1rem;
  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: 520px; height: 520px;
  background: radial-gradient(circle, #1e5fd4, transparent 70%);
  top: -120px; left: -100px;
  animation-duration: 20s;
}

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

.blob-3 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, #3b82f6, transparent 70%);
  top: 50%; left: 55%;
  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); }
}

/* ============================================================
   Card
   ============================================================ */
.card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 540px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  padding: 3rem 2.5rem 2.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.75rem;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.04) inset,
    0 24px 80px rgba(5, 14, 43, 0.6),
    0 0 60px rgba(59, 130, 246, 0.08);

  /* Entrance animation */
  animation: rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(28px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ============================================================
   Avatar
   ============================================================ */
.avatar-ring {
  padding: 4px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-glow), var(--blue-bright), #0ea5e9);
  box-shadow: 0 0 28px rgba(96, 165, 250, 0.35);
  flex-shrink: 0;
}

.avatar {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--blue-mid);
  border: 3px solid var(--blue-deep);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--transition);
}

.avatar-ring:hover .avatar img {
  transform: scale(1.05);
}

/* ============================================================
   Hero Text
   ============================================================ */
.hero-text {
  text-align: center;
}

.hero-text h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 2.75rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.1;
  color: #fff;
  text-shadow: 0 2px 20px rgba(96, 165, 250, 0.3);
}

.tagline {
  margin-top: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 300;
  letter-spacing: 0.06em;
  color: var(--blue-pale);
  text-transform: uppercase;
}

.dot {
  margin: 0 0.4em;
  color: var(--blue-accent);
  opacity: 0.7;
}

/* ============================================================
   About
   ============================================================ */
.about {
  width: 100%;
  padding: 1.25rem 1.5rem;
  border-left: 2px solid var(--blue-accent);
  background: rgba(59, 130, 246, 0.07);
  border-radius: 0 10px 10px 0;
}

.about p {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 300;
  line-height: 1.75;
  color: var(--text-muted);
}

/* ============================================================
   CTA Buttons
   ============================================================ */
.cta-group {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}

.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.04em;
  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);
}

/* Primary */
.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);
}

/* Ghost */
.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;
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  position: relative;
  z-index: 1;
  margin-top: 1.75rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  opacity: 0.65;
  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;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 480px) {
  .card {
    padding: 2.25rem 1.5rem 2rem;
    gap: 1.5rem;
  }

  .avatar, .avatar-ring { width: 130px; height: 130px; }
  .avatar-ring { padding: 3px; }

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

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

/* ============================================================
   Resume Page Layout
   ============================================================ */
.page-resume {
  justify-content: flex-start;
  padding: 0;
  gap: 0;
}

/* ---- Top navigation bar ---- */
.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.4rem;
  color: #fff;
  letter-spacing: 0.01em;
}

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

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

.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);
}

/* ---- Footer on resume page ---- */
.page-resume .site-footer {
  position: relative;
  z-index: 1;
  padding-bottom: 0.75rem;
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
  .topbar {
    padding:  1rem;
  }

  .topbar-title {
    font-size: 0.9rem;
  }

  .viewer-card {
    padding: 0.75rem;
  }

  .pdf-frame {
    border-radius: 14px;
  }
}