:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-alt: #f3f4f6;
  --border: #e5e7eb;
  --text: #111827;
  --text-muted: #6b7280;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --max: 1100px;
  --transition: 180ms ease;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto,
    Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

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

img {
  max-width: 100%;
  display: block;
}

/* ----- Container ----- */
.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ----- Header / Nav ----- */
.site-header {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

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

.brand {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  letter-spacing: -0.01em;
}

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

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

.nav-links a {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
}

.nav-links a:hover {
  color: var(--text);
  background: var(--surface-alt);
}

.nav-links a.active {
  color: var(--accent);
  background: rgba(37, 99, 235, 0.08);
}

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--text);
}

.nav-toggle svg {
  width: 24px;
  height: 24px;
}

/* ----- Hero ----- */
.hero {
  padding: 5rem 0 3.5rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 3rem;
  align-items: center;
}

.hero-eyebrow {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  background: rgba(37, 99, 235, 0.08);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 1.25rem;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 1rem;
}

.hero h1 .accent {
  color: var(--accent);
}

.hero p.lead {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 560px;
  margin-bottom: 1.75rem;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-primary {
  background: var(--text);
  color: var(--surface);
}

.btn-primary:hover {
  background: var(--accent);
  color: var(--surface);
}

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

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

.profile-photo {
  width: 280px;
  height: 280px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-alt);
  box-shadow: var(--shadow-md);
  border: 4px solid var(--surface);
  justify-self: end;
}

/* ----- Section ----- */
section {
  padding: 3rem 0;
}

.section-header {
  margin-bottom: 2.5rem;
}

.section-header h2 {
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin-bottom: 0.5rem;
}

.section-header p {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 640px;
}

/* ----- Cards Grid ----- */
.grid {
  display: grid;
  gap: 1.25rem;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: transform var(--transition), box-shadow var(--transition),
    border-color var(--transition);
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #d1d5db;
}

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

.card h3 {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

.card h3 a {
  color: inherit;
}

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

.card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  flex-grow: 1;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.lang-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
}

.lang-Python { background: #3572A5; }
.lang-Dart { background: #00B4AB; }
.lang-JavaScript { background: #f1e05a; }
.lang-CPP { background: #f34b7d; }
.lang-C { background: #555555; }
.lang-HTML { background: #e34c26; }

.tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--surface-alt);
  color: var(--text-muted);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ----- Project card with image ----- */
.project-card {
  padding: 0;
  overflow: hidden;
}

.project-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: linear-gradient(135deg, #e5e7eb 0%, #f3f4f6 100%);
}

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

.project-year {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 0.5rem;
}

/* ----- Info blocks (home page) ----- */
.info-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.info-item {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.info-item:last-child {
  border-bottom: none;
}

.info-item .year {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding-top: 0.15rem;
}

.info-item h4 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.info-item .place {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.info-item p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ----- Skills ----- */
.skill-group {
  margin-bottom: 1.5rem;
}

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

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

.skill-tags span {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--text);
}

/* ----- Footer ----- */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 2rem 0;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 1.25rem;
}

.footer-links a {
  color: var(--text-muted);
}

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

/* ----- Responsive ----- */
@media (max-width: 820px) {
  .hero {
    padding: 3rem 0 2rem;
  }
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }
  .profile-photo {
    width: 200px;
    height: 200px;
    justify-self: center;
    grid-row: 1;
  }
  .hero-actions {
    justify-content: center;
  }
  .hero p.lead {
    margin-left: auto;
    margin-right: auto;
  }
  .nav-toggle {
    display: block;
  }
  .nav-links {
    position: absolute;
    top: 64px;
    right: 1.5rem;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.5rem;
    box-shadow: var(--shadow-md);
    min-width: 180px;
    display: none;
  }
  .nav-links.open {
    display: flex;
  }
  .info-item {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
}