/* ============================================================
   Variables & Reset
   ============================================================ */
:root {
  --bg:         #f7f7fc;
  --surface:    #ffffff;
  --border:     #ddddf0;
  --text:       #1e1e2e;
  --muted:      #5560a0;
  --accent:     #6030c8;
  --accent-dim: rgba(96, 48, 200, 0.08);
  --link:       #4060b8;
  --radius:     6px;
  --max-w:      900px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 16px;
}

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

/* ============================================================
   Layout helpers
   ============================================================ */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

section {
  padding: 5rem 0;
}

/* ============================================================
   Nav
   ============================================================ */
#nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  background: rgba(247, 247, 252, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s;
}

#nav.scrolled {
  border-color: var(--border);
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  letter-spacing: 0.08em;
  font-family: 'Courier New', Courier, monospace;
}
.nav-logo:hover {
  color: var(--accent);
  text-decoration: none;
}

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

.nav-links a {
  font-size: 0.875rem;
  color: var(--muted);
  transition: color 0.15s;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  text-decoration: none;
}

/* ============================================================
   Section title  (left-bar style, echoing blog h2)
   ============================================================ */
.section-title {
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2.5rem;
  padding-left: 0.9rem;
  border-left: 5px solid var(--accent);
  line-height: 1.3;
}

/* ============================================================
   Hero
   ============================================================ */
#hero {
  padding-top: 8rem;
  padding-bottom: 5rem;
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  background-image: url('../background.jpg');
  background-size: cover;
  background-position: center;
}

/* Gradient veil: opaque on the left where text sits, fades out toward the right */
#hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(247, 247, 252, 0.94) 0%,
    rgba(247, 247, 252, 0.78) 45%,
    rgba(247, 247, 252, 0.40) 100%
  );
  pointer-events: none;
}

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

.hero-greeting {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.95rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.hero-name {
  font-size: clamp(2.2rem, 7vw, 3.6rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
  color: #111128;
}

.hero-title {
  font-size: 1.25rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.hero-sub {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 2rem;
}

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

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-block;
  padding: 0.55rem 1.35rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  transition: opacity 0.15s, transform 0.15s;
  cursor: pointer;
  line-height: 1.5;
}
.btn:hover {
  opacity: 0.82;
  transform: translateY(-1px);
  text-decoration: none;
}

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

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
  opacity: 1;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  opacity: 1;
}

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

/* ============================================================
   About
   ============================================================ */
.about-content p {
  color: var(--muted);
  max-width: 68ch;
  margin-bottom: 1rem;
}

.about-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.contact-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 2rem;
  padding: 0.4rem 0.95rem;
  transition: border-color 0.15s, color 0.15s;
}
.contact-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

/* ============================================================
   Projects
   ============================================================ */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.project-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(96, 48, 200, 0.08);
}

.project-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: var(--accent-dim);
  border-bottom: 1px solid var(--border);
}

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

.project-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.project-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.project-links {
  display: flex;
  gap: 0.75rem;
  flex-shrink: 0;
}

.project-links a {
  font-size: 0.8rem;
  color: var(--muted);
  transition: color 0.15s;
}
.project-links a:hover {
  color: var(--accent);
  text-decoration: none;
}

.project-badge {
  font-size: 0.72rem;
  font-family: 'Courier New', Courier, monospace;
  color: var(--muted);
  background: var(--accent-dim);
  padding: 0.18rem 0.6rem;
  border-radius: 2rem;
  white-space: nowrap;
}

.project-desc {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.65;
  flex: 1;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: auto;
  padding-top: 0.25rem;
}

/* ============================================================
   Tags
   ============================================================ */
.tag {
  display: inline-block;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 0.72rem;
  padding: 0.18rem 0.6rem;
  border-radius: 2rem;
  font-family: 'Courier New', Courier, monospace;
  white-space: nowrap;
}

/* ============================================================
   CV — block title
   ============================================================ */
.cv-block {
  margin-bottom: 3.5rem;
}

.cv-block-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 1.5rem;
  font-family: 'Courier New', Courier, monospace;
}

/* ============================================================
   CV — vertical timeline
   ============================================================ */
.timeline {
  border-left: 2px solid var(--border);
  margin-left: 0.6rem;
}

.timeline-item {
  position: relative;
  padding: 0 0 2rem 1.75rem;
}
.timeline-item:last-child {
  padding-bottom: 0;
}

/* Dot marker */
.timeline-item::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 0.35rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
}

.timeline-date {
  display: inline-block;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

.timeline-content h4 {
  font-size: 0.975rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.15rem;
}

.timeline-org {
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

.timeline-detail {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.65;
}

/* ============================================================
   CV — skills
   ============================================================ */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.75rem;
}

.skill-group-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

/* ============================================================
   Contact
   ============================================================ */
#contact {
  text-align: center;
}

.contact-text {
  color: var(--muted);
  max-width: 50ch;
  margin: 0 auto 2rem;
  font-size: 0.95rem;
}

/* ============================================================
   Footer
   ============================================================ */
footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  text-align: center;
}

footer p {
  font-size: 0.825rem;
  color: var(--muted);
}

/* ============================================================
   Scroll fade-in
   ============================================================ */
.fade-in {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: none;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 640px) {
  section {
    padding: 3.5rem 0;
  }

  #hero {
    padding-top: 6rem;
    min-height: auto;
  }

  .nav-links {
    gap: 1.1rem;
  }

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

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

@media (max-width: 400px) {
  .skills-grid {
    grid-template-columns: 1fr;
  }

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