/* ===========================
   Root Variables & Reset
   =========================== */
:root {
  --color-bg: #f8f9fa;
  --color-surface: #ffffff;
  --color-primary: #1a5276;
  --color-primary-dark: #154360;
  --color-accent: #2e86c1;
  --color-accent-light: #aed6f1;
  --color-text: #212529;
  --color-text-muted: #6c757d;
  --color-border: #dee2e6;
  --color-shadow: rgba(0, 0, 0, 0.08);
  --font-sans: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'Fira Code', 'Consolas', monospace;
  --radius: 8px;
  --radius-lg: 16px;
  --transition: 0.2s ease;
  --max-width: 1100px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

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

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

ul {
  list-style: none;
}

/* ===========================
   Navigation
   =========================== */
.nav {
  background: var(--color-primary);
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.nav__brand {
  font-size: 1.2rem;
  font-weight: 700;
  color: #ffffff;
  text-decoration: none;
  letter-spacing: 0.02em;
}

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

.nav__links {
  display: flex;
  gap: 0.25rem;
}

.nav__links a {
  color: rgba(255,255,255,0.85);
  font-weight: 500;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius);
  transition: background var(--transition), color var(--transition);
  text-decoration: none;
  font-size: 0.95rem;
}

.nav__links a:hover,
.nav__links a.active {
  background: rgba(255,255,255,0.15);
  color: #ffffff;
}

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

.nav__toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: #ffffff;
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

@media (max-width: 640px) {
  .nav__toggle {
    display: flex;
  }

  .nav__links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--color-primary-dark);
    padding: 0.75rem 1rem;
    gap: 0.25rem;
  }

  .nav__links.open {
    display: flex;
  }

  .nav__links a {
    padding: 0.6rem 0.85rem;
  }
}

/* ===========================
   Main content wrapper
   =========================== */
.page {
  flex: 1;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ===========================
   Hero / Bio Section
   =========================== */
.hero {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
  color: #ffffff;
  padding: 5rem 1.5rem 4rem;
}

.hero__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 3rem;
  flex-wrap: wrap;
}

.hero__photo {
  flex-shrink: 0;
}

.hero__photo img,
.hero__photo .photo-placeholder {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  border: 4px solid rgba(255,255,255,0.7);
  object-fit: cover;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.photo-placeholder {
  background: rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-placeholder svg {
  width: 90px;
  height: 90px;
  opacity: 0.7;
}

.hero__content {
  flex: 1;
  min-width: 240px;
}

.hero__name {
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 0.35rem;
}

.hero__title {
  font-size: 1.15rem;
  opacity: 0.85;
  margin-bottom: 1.25rem;
  font-weight: 400;
}

.hero__bio {
  font-size: 1rem;
  opacity: 0.9;
  max-width: 600px;
  line-height: 1.75;
}

@media (max-width: 640px) {
  .hero {
    padding: 3rem 1.25rem;
  }

  .hero__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
  }

  .hero__name {
    font-size: 1.9rem;
  }
}

/* ===========================
   Sections
   =========================== */
.section {
  padding: 3.5rem 1.5rem;
}

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

.section__inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section__title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 0.4rem;
}

.section__divider {
  width: 48px;
  height: 3px;
  background: var(--color-accent);
  border-radius: 2px;
  margin-bottom: 2rem;
}

/* ===========================
   Contact Info
   =========================== */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.contact-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem 0.85rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  box-shadow: 0 1px 4px var(--color-shadow);
  transition: box-shadow var(--transition), border-color var(--transition);
  min-width: 0;
  overflow: hidden;
}

.contact-card:hover {
  box-shadow: 0 4px 14px var(--color-shadow);
  border-color: var(--color-accent-light);
}

.contact-card__icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
}

.contact-card__icon svg {
  width: 24px;
  height: 24px;
  display: block;
}

.contact-card__icon--github {
  color: #000000;
}
.contact-card__icon--github svg {
  width: 29px;
  height: 29px;
}

.contact-card__icon--linkedin {
  color: #0A66C2;
}

.contact-card__text {
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.contact-card__label {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.1rem;
  white-space: nowrap;
}

.contact-card__value {
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contact-card__value a {
  color: var(--color-text);
}

.contact-card__value a:hover {
  color: var(--color-accent);
  text-decoration: none;
}

/* ===========================
   Page Header (inner pages)
   =========================== */
.page-header {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
  color: #ffffff;
  padding: 3.5rem 1.5rem 2.5rem;
}

.page-header__inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.page-header__title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
}

.page-header__subtitle {
  font-size: 1rem;
  opacity: 0.85;
}

/* ===========================
   Cards (Projects / Repos)
   =========================== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

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

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px var(--color-shadow);
}

.card__badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.65rem;
  border-radius: 20px;
  margin-bottom: 0.85rem;
  background: var(--color-accent-light);
  color: var(--color-primary);
  align-self: flex-start;
}

.card__title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--color-text);
}

.card__description {
  font-size: 0.92rem;
  color: var(--color-text-muted);
  flex: 1;
  line-height: 1.65;
  margin-bottom: 1.1rem;
}

/* ===========================
   Card Thumbnail (optional)
   =========================== */
.card__thumbnail {
  /* 80% of card width, centred */
  width: 80%;
  margin: 0 auto 1.1rem;
  /* Let height grow naturally with the image */
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  /* Establish a containing block for the zoom transition */
  container-type: inline-size;
}

.card__thumbnail img {
  width: 100%;
  /* Square crop: height = width */
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center top;
  display: block;
  transition: transform 0.35s ease;
}

.card:hover .card__thumbnail img {
  transform: scale(1.03);
}

/* ===========================
   Card Footer
   =========================== */
.card__footer {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.6rem;
  margin-top: auto;
  overflow: hidden;
  min-width: 0;
}

/* ===========================
   Card Authorship (optional)
   =========================== */
.card__authors {
  margin-left: auto;
  flex-shrink: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: clamp(0.62rem, 1.8cqi, 0.78rem);
  font-style: italic;
  color: var(--color-text-muted);
}

/* ===========================
   Buttons
   =========================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background var(--transition), color var(--transition);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

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

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

.btn--outline {
  background: transparent;
  color: var(--color-accent);
  border: 1.5px solid var(--color-accent);
}

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

/* Language tag */
.lang-tag {
  font-size: 0.78rem;
  padding: 0.15rem 0.55rem;
  border-radius: 20px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
}

/* Repo stats */
.repo-stat {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.82rem;
  color: var(--color-text-muted);
}

.repo-stat svg {
  width: 14px;
  height: 14px;
}

/* ===========================
   Empty / Loading states
   =========================== */
.state-placeholder {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--color-text-muted);
}

.state-placeholder svg {
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  opacity: 0.4;
}

.state-placeholder p {
  font-size: 1rem;
}

/* ===========================
   Resume Page
   =========================== */
.resume-placeholder {
  background: var(--color-surface);
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg);
  padding: 5rem 2rem;
  text-align: center;
  max-width: 600px;
  margin: 2rem auto;
}

.resume-placeholder svg {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  color: var(--color-text-muted);
  opacity: 0.5;
}

.resume-placeholder h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}

.resume-placeholder p {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  max-width: 380px;
  margin: 0 auto 1.5rem;
}

/* ===========================
   Footer
   =========================== */
.footer {
  background: var(--color-primary-dark);
  color: rgba(255,255,255,0.7);
  text-align: center;
  padding: 1.5rem 1rem;
  font-size: 0.875rem;
}

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

/* ===========================
   Spinner
   =========================== */
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 3rem auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
