/* --- Variables --- */
:root {
  --bg: #fafaf9;
  --bg-alt: #f5f5f4;
  --text: #1c1917;
  --text-muted: #57534e;
  --accent: #0d9488;
  --accent-hover: #0f766e;
  --border: #e7e5e4;
  --radius: 8px;
  --radius-lg: 12px;
  --font-sans: "DM Sans", system-ui, sans-serif;
  --font-display: "Sora", system-ui, sans-serif;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.08);
}

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

html {
  scroll-behavior: smooth;
}

/* --- Scroll-triggered section animations --- */
section.animate-on-scroll {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
  will-change: opacity, transform;
}

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

@media (prefers-reduced-motion: reduce) {
  section.animate-on-scroll {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

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

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

/* --- Layout --- */
.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.container--wide {
  max-width: 1120px;
}

/* --- Header & Nav --- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(250, 250, 249, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
}

.logo {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--text);
}

.logo:hover {
  color: var(--accent);
  text-decoration: none;
}

.nav-links {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 1.75rem;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.9375rem;
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--text);
  text-decoration: none;
}

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

.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
}

/* --- Hero --- */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 6rem 0 4rem;
  position: relative;
}

.hero-inner {
  display: grid;
  gap: 2rem;
  align-items: center;
}

@media (min-width: 768px) {
  .hero-inner {
    grid-template-columns: 1fr auto;
    gap: 3rem;
  }

  .hero-photo-wrap {
    order: 2;
  }
}

.hero-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-photo-wrap {
  display: flex;
  justify-content: center;
}

.hero-photo {
  width: 100%;
  max-width: 280px;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid var(--border);
  box-shadow: var(--shadow-lg);
}

@media (min-width: 768px) {
  .hero-photo {
    max-width: 320px;
  }
}

.hero-greeting {
  font-size: 1rem;
  color: var(--text-muted);
  margin: 0 0 0.25rem 0;
  font-weight: 500;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 0.75rem 0;
  letter-spacing: -0.02em;
}

.hero-tagline {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 32ch;
  margin: 0 0 2rem 0;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-scroll {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  border-radius: 1px;
  animation: scroll-pulse 2s ease-in-out infinite;
}

@keyframes scroll-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: var(--radius);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  border: 2px solid transparent;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: #fff;
  text-decoration: none;
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

/* --- Sections --- */
.section {
  padding: 4.5rem 0;
}

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

.section-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0 0 2rem 0;
  letter-spacing: -0.02em;
}

/* --- About --- */
.about-grid {
  display: grid;
  gap: 2rem;
}

.about-sidebar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.about-photo-wrap {
  display: flex;
  justify-content: center;
}

.about-photo {
  width: 100%;
  max-width: 200px;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--border);
  box-shadow: var(--shadow);
}

@media (min-width: 640px) {
  .about-grid {
    grid-template-columns: auto 1fr;
    align-items: start;
    gap: 3rem;
  }

  .about-sidebar {
    align-items: flex-start;
    min-width: 240px;
  }

  .about-photo {
    max-width: 240px;
  }

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

.about-lead {
  font-size: 1.125rem;
  color: var(--text);
  margin: 0 0 1rem 0;
}

.about-text p {
  margin: 0 0 1rem 0;
  color: var(--text-muted);
}

.about-text p:last-child {
  margin-bottom: 0;
}

.meta-list {
  list-style: none;
  margin: 0;
  padding: 1.25rem 1.5rem;
  background: var(--bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  min-width: 220px;
}

.about-sidebar .meta-list {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.meta-list li {
  padding: 0.35rem 0;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.meta-list strong {
  display: inline-block;
  width: 6rem;
  color: var(--text);
}

.cert-list {
  list-style: disc;
  margin: 0 0 0 1.25rem;
  padding: 0;
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.cert-list li {
  margin-bottom: 0.25rem;
}

.cert-list li:last-child {
  margin-bottom: 0;
}

/* Education + Certifications side by side */
.edu-certs-grid {
  display: grid;
  gap: 2.5rem;
}

@media (min-width: 768px) {
  .edu-certs-grid {
    grid-template-columns: 1fr 1fr;
    align-items: start;
    gap: 3rem;
  }
}

.certs-block .section-title {
  margin-bottom: 1rem;
}

.cert-timeline .timeline-item:last-child {
  padding-bottom: 0;
}

/* --- Skills --- */
.skills-grid {
  display: grid;
  gap: 2rem;
}

@media (min-width: 640px) {
  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .skills-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.skill-group {
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  background: var(--bg);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.skill-group:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border);
}

.skill-group h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.75rem 0;
  color: var(--text);
  transition: color 0.2s ease;
}

.skill-group:hover h3 {
  color: var(--accent);
}

.skill-tags {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skill-tags li {
  padding: 0.4rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  color: var(--text);
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.skill-tags li:hover {
  transform: translateY(-2px);
  background: rgba(13, 148, 136, 0.08);
  border-color: var(--accent);
  color: var(--accent);
}

/* --- Experience (Timeline) --- */
.timeline {
  position: relative;
}

.timeline-item {
  position: relative;
  padding-left: 2rem;
  padding-bottom: 2rem;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-marker {
  position: absolute;
  left: 0;
  top: 0.35rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 2px var(--accent);
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 1.25rem;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-item:last-child::before {
  display: none;
}

.timeline-date {
  font-size: 0.875rem;
  color: var(--accent);
  font-weight: 600;
}

.timeline-content h3 {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0.25rem 0 0.15rem 0;
}

.timeline-company {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin: 0 0 0.5rem 0;
}

.timeline-responsibilities {
  margin: 0.5rem 0 0 0;
  padding-left: 1.25rem;
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.timeline-responsibilities li {
  margin-bottom: 0.4rem;
}

.timeline-responsibilities li:last-child {
  margin-bottom: 0;
}

/* --- Projects --- */
.projects-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
  padding-bottom: 0.5rem;
  margin: 0 -1.25rem;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.projects-scroll:active {
  cursor: grabbing;
}

.projects-scroll::-webkit-scrollbar {
  height: 8px;
}

.projects-scroll::-webkit-scrollbar-track {
  background: var(--bg-alt);
  border-radius: 4px;
}

.projects-scroll::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.projects-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

.projects-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 1.5rem;
  min-width: min-content;
}

.project-card {
  flex: 0 0 auto;
  width: 300px;
  min-width: 280px;
  max-width: 320px;
  scroll-snap-align: start;
  scroll-snap-stop: normal;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s, border-color 0.2s;
}

.project-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.75rem;
}

.project-card h3 {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0;
}

.project-year {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.project-card > p {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin: 0 0 1rem 0;
  line-height: 1.5;
}

.project-links {
  display: flex;
  gap: 1rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.project-links a:hover {
  text-decoration: none;
}

/* --- Contact --- */
.contact-inner {
  text-align: center;
}

.contact-text {
  max-width: 36ch;
  margin: 0 auto 1.5rem;
  color: var(--text-muted);
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

/* --- Footer --- */
.footer {
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.footer p {
  margin: 0;
}

/* --- Mobile menu --- */
@media (max-width: 639px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 4rem;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 1.5rem;
    gap: 0.5rem;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.2s, opacity 0.2s, visibility 0.2s;
  }

  .nav-links.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .nav-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  .nav-toggle span {
    transition: transform 0.2s, opacity 0.2s;
  }
}
