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

:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #94a3b8;
  --accent: #0891b2;
  --accent-hover: #0e7490;
  --accent-light: #ecfeff;
  --card-bg: #ffffff;
  --card-border: #e2e8f0;
  --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --card-shadow-hover: 0 10px 25px rgba(0, 0, 0, 0.08), 0 4px 10px rgba(0, 0, 0, 0.04);
  --nav-bg: rgba(255, 255, 255, 0.85);
  --radius: 12px;
  --radius-sm: 8px;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}

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

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

/* ── Navigation ── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.nav.scrolled {
  border-bottom-color: var(--card-border);
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.04);
}

.nav-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.nav-logo {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.nav-logo:hover { color: var(--accent); }

.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
  position: relative;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
}

.nav-links a.active::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}

.nav-cta {
  background: var(--accent);
  color: #fff !important;
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
  transition: background 0.2s, transform 0.2s;
}

.nav-cta:hover {
  background: var(--accent-hover);
  color: #fff !important;
  transform: translateY(-1px);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

/* ── Hero ── */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 100px 24px 60px;
  position: relative;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(8, 145, 178, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(14, 116, 144, 0.05) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(8, 145, 178, 0.04) 0%, transparent 50%);
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-greeting {
  font-size: 1.15rem;
  color: var(--text-secondary);
  font-weight: 400;
  margin-bottom: 8px;
}

.hero h1 {
  font-size: 4rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.hero-tagline {
  font-size: 1.2rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 8px;
}

.typed-text {
  color: var(--accent);
  font-weight: 600;
}

.typed-cursor {
  color: var(--accent);
  font-weight: 300;
  animation: blink 0.8s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.hero-location {
  color: var(--text-tertiary);
  font-size: 0.95rem;
  margin-bottom: 36px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  padding: 14px 32px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
  border: none;
  cursor: pointer;
}

.btn:hover {
  background: var(--accent-hover);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(8, 145, 178, 0.3);
}

.btn-arrow {
  transition: transform 0.2s;
}

.btn:hover .btn-arrow {
  transform: translateX(3px);
}

.scroll-indicator {
  margin-top: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-tertiary);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.scroll-arrow {
  animation: bounce 2s infinite;
  color: var(--text-tertiary);
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(6px); }
  60% { transform: translateY(3px); }
}

/* ── Sections ── */
.section {
  padding: 100px 0;
}

.section-alt {
  background: var(--bg-secondary);
}

.section-label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 12px;
}

.section-heading {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 24px;
  color: var(--text-primary);
}

/* ── About ── */
.about-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 48px;
  align-items: start;
  margin-bottom: 48px;
}

.about-text {
  color: var(--text-secondary);
  font-size: 1.1rem;
  line-height: 1.8;
  margin-bottom: 0;
}

.about-photo {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--card-shadow-hover);
}

.about-photo img {
  width: 100%;
  height: 320px;
  object-fit: cover;
  display: block;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--card-shadow);
  transition: transform 0.3s, box-shadow 0.3s;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--card-shadow-hover);
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ── Experience ── */
.experience-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.exp-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--card-shadow);
  transition: box-shadow 0.3s;
}

.exp-card:hover {
  box-shadow: var(--card-shadow-hover);
}

.exp-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.exp-info h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.exp-title {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.exp-meta {
  font-size: 0.85rem;
  color: var(--text-tertiary);
}

.exp-preview {
  margin-top: 12px;
}

.exp-preview p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

.exp-details {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, margin 0.3s ease, opacity 0.3s ease;
  opacity: 0;
}

.exp-details.open {
  max-height: 600px;
  margin-top: 16px;
  opacity: 1;
}

.exp-details ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.exp-details li {
  color: var(--text-secondary);
  font-size: 0.92rem;
  padding-left: 18px;
  position: relative;
  line-height: 1.6;
}

.exp-details li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
}

.exp-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 12px;
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
  transition: color 0.2s;
}

.exp-toggle:hover {
  color: var(--accent-hover);
}

.toggle-icon {
  font-size: 1rem;
  font-weight: 400;
  transition: transform 0.3s;
}

.exp-toggle.active .toggle-icon {
  transform: rotate(45deg);
}

/* ── Skills ── */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}

.skill-group h3 {
  font-size: 0.85rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent);
}

.skill-group ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.skill-group li {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.4;
}

/* ── Projects ── */
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.project-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: transform 0.3s, box-shadow 0.3s;
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow-hover);
  color: var(--text-primary);
}

.project-card-header {
  height: 160px;
  background-size: cover;
  background-position: center;
  position: relative;
  transition: transform 0.4s ease;
  overflow: hidden;
}

/* Zoom the background image on card hover */
.project-card:hover .project-card-header {
  transform: scale(1.03);
}

/* Subtle dark overlay for text readability if needed later */
.project-card-header::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.15));
}

.project-card-body {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.project-card-body h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.project-card-body p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
  flex: 1;
  margin-bottom: 16px;
}

.project-link {
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 600;
  transition: color 0.2s;
}

.project-card:hover .project-link {
  color: var(--accent-hover);
}

/* ── Footer ── */
.footer {
  background: var(--text-primary);
  color: var(--bg-primary);
  padding: 80px 0 32px;
}

.footer-cta {
  text-align: center;
  max-width: 500px;
  margin: 0 auto 60px;
}

.footer-cta h2 {
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
  color: #fff;
}

.footer-cta p {
  color: var(--text-tertiary);
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 32px;
}

.footer .btn {
  background: var(--accent);
}

.footer .btn:hover {
  background: var(--accent-hover);
}

.footer-bottom {
  text-align: center;
  padding-top: 40px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
  font-size: 0.82rem;
  color: var(--text-tertiary);
}

.photo-credit {
  margin-top: 8px;
  font-size: 0.75rem !important;
  color: var(--text-tertiary);
}

.photo-credit a {
  color: var(--text-tertiary);
  text-decoration: underline;
}

/* ── Scroll Animations ── */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.stats .animate-on-scroll:nth-child(2) { transition-delay: 0.1s; }
.stats .animate-on-scroll:nth-child(3) { transition-delay: 0.2s; }
.stats .animate-on-scroll:nth-child(4) { transition-delay: 0.3s; }

.experience-list .animate-on-scroll:nth-child(2) { transition-delay: 0.08s; }
.experience-list .animate-on-scroll:nth-child(3) { transition-delay: 0.16s; }
.experience-list .animate-on-scroll:nth-child(4) { transition-delay: 0.24s; }
.experience-list .animate-on-scroll:nth-child(5) { transition-delay: 0.32s; }

.skills-grid .animate-on-scroll:nth-child(2) { transition-delay: 0.1s; }
.skills-grid .animate-on-scroll:nth-child(3) { transition-delay: 0.2s; }
.skills-grid .animate-on-scroll:nth-child(4) { transition-delay: 0.3s; }

.project-grid .animate-on-scroll:nth-child(2) { transition-delay: 0.1s; }
.project-grid .animate-on-scroll:nth-child(3) { transition-delay: 0.2s; }
.project-grid .animate-on-scroll:nth-child(4) { transition-delay: 0.3s; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .hero h1 { font-size: 2.5rem; }
  .hero-tagline { font-size: 1.05rem; }

  .section { padding: 72px 0; }
  .section-heading { font-size: 1.75rem; }

  .about-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .about-photo {
    order: -1;
  }

  .about-photo img {
    height: 240px;
  }

  .stats { grid-template-columns: repeat(2, 1fr); }
  .skills-grid { grid-template-columns: repeat(2, 1fr); gap: 24px; }
  .project-grid { grid-template-columns: 1fr; }

  .exp-card { padding: 24px; }

  .nav-toggle { display: flex; }

  .nav-links {
    display: none;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--nav-bg);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    flex-direction: column;
    padding: 20px 24px;
    gap: 16px;
    border-bottom: 1px solid var(--card-border);
  }

  .nav-links.open { display: flex; }

  .nav-cta {
    text-align: center;
  }

  .footer-cta h2 { font-size: 1.75rem; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 2rem; }
  .hero { padding: 80px 20px 40px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat-card { padding: 20px 14px; }
  .stat-number { font-size: 1.6rem; }
  .skills-grid { grid-template-columns: 1fr; }
  .section { padding: 56px 0; }
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .animate-on-scroll {
    opacity: 1;
    transform: none;
  }
}
