/* ============================================================
   Manu Aryal – Academic Portfolio
   Clean, modern, fully responsive (mobile-first)
   ============================================================ */

/* ---------- CSS Custom Properties (Theme) ---------- */
:root {
  --color-bg: #fafbfc;
  --color-bg-alt: #f0f4f8;
  --color-surface: #ffffff;
  --color-text: #1a202c;
  --color-text-muted: #4a5568;
  --color-primary: #2b6cb0;
  --color-primary-dark: #1a4f8b;
  --color-accent: #3182ce;
  --color-border: #e2e8f0;
  --color-badge: #ebf4ff;
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --radius: 10px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.1);
  --header-height: 64px;
  --max-width: 1100px;
  --transition: 0.25s ease;
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--color-primary-dark);
}

ul {
  list-style: none;
}

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.25;
  color: var(--color-text);
}
/* ---------- Peek / Coverflow Carousel ---------- */
.carousel {
  position: relative;
  max-width: 900px;
  height: auto;
  margin: 0 auto 1.5rem;
  overflow: hidden;
  padding: 0 60px;          /* room for side peeks */
}

.carousel-track {
  display: flex;
  transition: transform 0.45s cubic-bezier(0.25, 0.8, 0.25, 1);
  will-change: transform;
}

.carousel-slide {
  flex: 0 0 70%;            /* main slide takes 70% width */
  margin: 0 12px;
  transition: transform 0.45s ease, filter 0.45s ease, opacity 0.45s ease;
  filter: blur(3px);
  opacity: 0.55;
  transform: scale(0.88);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
}

.carousel-slide.active {
  filter: none;
  opacity: 1;
  transform: scale(1);
  z-index: 2;
}

.carousel-slide img {
   width: 100% !important;
  height: 600px !important;
  min-height: 600px;
  object-fit: cover;
  display: block;
}

.carousel-slide figcaption {
  padding: 0.7rem 1rem;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  background: var(--color-surface);
}

/* Arrows */
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: rgba(43, 108, 176, 0.9);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  transition: background 0.2s, transform 0.2s;
}
.carousel-btn:hover {
  background: var(--color-primary-dark);
  transform: translateY(-50%) scale(1.08);
}
.carousel-btn.prev { left: 12px; }
.carousel-btn.next { right: 12px; }

/* optional: hide arrows on very small screens if you prefer pure swipe */
@media (max-width: 480px) {
  .carousel-btn { width: 40px; height: 40px; font-size: 1.3rem; }
}

/* Dots */
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin-top: 1.1rem;
}
.carousel-dots button {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: none;
  background: var(--color-border);
  cursor: pointer;
  padding: 0;
  transition: background 0.2s;
}
.carousel-dots button.active {
  background: var(--color-primary);
}

/* Mobile: make main slide wider */
@media (max-width: 640px) {
  .carousel { padding: 0 40px; }
  .carousel-slide { flex: 0 0 82%; margin: 0 8px;}
  .carousel-slide img { max-height: 340px; }
}
/* ---------- Layout Helpers ---------- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.section {
  padding-block: 4rem;
}

.section-alt {
  background: var(--color-bg-alt);
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  margin-bottom: 0.5rem;
  text-align: center;
}

.section-intro {
  text-align: center;
  color: var(--color-text-muted);
  max-width: 640px;
  margin: 0 auto 2.5rem;
}

.subsection-title {
  font-size: 1.25rem;
  margin: 2.5rem 0 1.25rem;
  color: var(--color-primary-dark);
}

/* ---------- Header / Navigation ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
  height: var(--header-height);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--color-text);
}

.logo:hover {
  color: var(--color-primary);
}

.nav-list {
  display: flex;
  gap: 0.15rem;
}

.nav-link {
  display: block;
  padding: 0.4rem 0.7rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-muted);
  border-radius: 6px;
}

.nav-link:hover,
.nav-link.active {
  color: var(--color-primary);
  background: var(--color-badge);
}

/* Hamburger (mobile) */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  width: 40px;
  height: 40px;
}

.hamburger,
.hamburger::before,
.hamburger::after {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: var(--transition);
  position: relative;
}

.hamburger::before,
.hamburger::after {
  content: "";
  position: absolute;
  left: 0;
}

.hamburger::before { top: -7px; }
.hamburger::after  { top: 7px; }

.nav-toggle[aria-expanded="true"] .hamburger {
  background: transparent;
}

.nav-toggle[aria-expanded="true"] .hamburger::before {
  top: 0;
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .hamburger::after {
  top: 0;
  transform: rotate(-45deg);
}

/* ---------- Hero ---------- */
.hero {
  padding-block: 3.5rem 4rem;
  background: linear-gradient(160deg, #edf2f7 0%, #fafbfc 60%);
}

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  text-align: center;
}

.hero-photo {
  width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid var(--color-surface);
  box-shadow: var(--shadow);
}

.hero-name {
  font-size: clamp(2rem, 5vw, 2.75rem);
  margin-bottom: 0.35rem;
}

.hero-title {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--color-primary);
  margin-bottom: 0.25rem;
}

.hero-affiliation {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

.hero-bio {
  max-width: 640px;
  margin: 0 auto 1.5rem;
  color: var(--color-text-muted);
  font-size: 0.98rem;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.15rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--color-primary-dark);
  color: #fff;
}

.btn-outline {
  background: transparent;
  border-color: var(--color-border);
  color: var(--color-text);
}

.btn-outline:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-badge);
}

/* ---------- Timeline (Education) ---------- */
.timeline {
  position: relative;
  max-width: 800px;
  margin-inline: auto;
  padding-left: 1.5rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--color-border);
}

.timeline-item {
  position: relative;
  padding-bottom: 2.5rem;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-marker {
  position: absolute;
  left: -1.5rem;
  top: 6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--color-primary);
  border: 3px solid var(--color-surface);
  box-shadow: 0 0 0 2px var(--color-primary);
}
.card-link {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-primary);
}

.card-link:hover {
  text-decoration: underline;
}
.timeline-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.timeline-img img {
  width: 110px;        /* fixed, clearer size */
  height: auto;
  max-width: none;
  border-radius: 6px;
  object-fit: contain; /* keeps logo proportions clean */
}

.timeline-body h3 {
  font-size: 1.15rem;
  margin-bottom: 0.25rem;
}

.timeline-meta {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: 0.6rem;
}

.timeline-body ul {
  list-style: disc;
  padding-left: 1.2rem;
  font-size: 0.92rem;
  color: var(--color-text-muted);
}

.timeline-body li + li {
  margin-top: 0.3rem;
}

/* ---------- Cards (shared) ---------- */
.card-grid {
  display: grid;
  gap: 1.5rem;
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition), transform var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
}

.card-thumb img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.card-body {
  padding: 1.15rem 1.25rem 1.35rem;
}

.card-body h3 {
  font-size: 1.05rem;
  margin-bottom: 0.35rem;
}

.card-meta {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
}

.card-abstract {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: var(--color-badge);
  color: var(--color-primary);
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.card-body ul {
  list-style: disc;
  padding-left: 1.15rem;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.card-body li + li {
  margin-top: 0.3rem;
}

/* Research grid */
.research-grid {
  grid-template-columns: 1fr;
}

/* Experience cards with logo */
.exp-card {
  display: flex;
  flex-direction: column;
}

.card-logo {
  padding: 1.25rem 1.25rem 0;
}

.card-logo img {
  width: auto;
  height: 60px;
  object-fit: contain;
  border-radius: 8px;
}

/* Skills */
.skills-grid {
  display: grid;
  gap: 1.75rem;
}

.skill-category h3 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
  color: var(--color-primary-dark);
}

.skill-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skill-badge {
  display: inline-block;
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 500;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-text);
  transition: border-color var(--transition), background var(--transition);
}

.skill-badge:hover {
  border-color: var(--color-primary);
  background: var(--color-badge);
}

/* Community & Awards grids */
.community-grid,
.awards-grid {
  grid-template-columns: 1fr;
}

/* ---------- Creative Corner – Tabs ---------- */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 2rem;
}

.tab-btn {
  padding: 0.55rem 1.2rem;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: 8px;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.tab-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.tab-btn.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Poetry */
.poetry-block {
  max-width: 640px;
  margin-inline: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 2rem 1.75rem;
  box-shadow: var(--shadow);
}

.poetry-block h3 {
  font-size: 1.3rem;
  margin-bottom: 0.25rem;
}

.poetry-meta {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: 1.25rem;
}

.poetry-text {
  position: relative;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.poetry-text.collapsed {
  max-height: 220px;          /* adjust – how much is shown before “See more” */
}

.poetry-text.collapsed::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50px;
  background: linear-gradient(transparent, var(--color-surface));
  pointer-events: none;
}

.see-more-btn {
  display: inline-block;
  margin-top: 0.6rem;
  padding: 0;
  border: none;
  background: none;
  color: var(--color-primary);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.see-more-btn:hover {
  text-decoration: underline;
}
.poetry-text p + p {
  margin-top: 1rem;
}

/* Gallery */
.gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.gallery-item {
  cursor: pointer;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  transition: transform var(--transition), box-shadow var(--transition);
}

.gallery-item:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-hover);
}

.gallery-item img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.gallery-item figcaption {
  padding: 0.6rem 0.8rem;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* Hobbies */
.hobbies-grid {
  display: grid;
  gap: 1.25rem;
}

.hobby-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.35rem;
  box-shadow: var(--shadow);
}

.hobby-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
}

.hobby-card p {
  font-size: 0.92rem;
  color: var(--color-text-muted);
}

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  gap: 2.5rem;
  max-width: 900px;
  margin-inline: auto;
}

.contact-info h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.contact-info > p {
  color: var(--color-text-muted);
  margin-bottom: 1.25rem;
}

.contact-list li {
  margin-bottom: 0.55rem;
  font-size: 0.95rem;
}

.contact-list strong {
  display: inline-block;
  min-width: 80px;
  color: var(--color-text);
}

.contact-form {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.form-group {
  margin-bottom: 1.1rem;
}

.form-group label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-size: 0.95rem;
  font-family: inherit;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-bg);
  color: var(--color-text);
  transition: border-color var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.15);
}

.form-note {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: var(--color-primary);
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--color-text);
  color: #a0aec0;
  padding-block: 1.75rem;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  text-align: center;
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  gap: 1.25rem;
}

.footer-links a {
  color: #cbd5e0;
}

.footer-links a:hover {
  color: #fff;
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-img {
  max-width: min(90vw, 900px);
  max-height: 75vh;
  object-fit: contain;
  border-radius: 6px;
}

.lightbox-caption {
  color: #e2e8f0;
  margin-top: 1rem;
  font-size: 0.95rem;
  text-align: center;
  max-width: 600px;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.25rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem;
  opacity: 0.85;
  transition: opacity var(--transition);
}

.lightbox-close:hover {
  opacity: 1;
}

/* ============================================================
   RESPONSIVE BREAKPOINTS
   ============================================================ */

/* Tablet and up */
@media (min-width: 640px) {
  .research-grid,
  .community-grid,
  .awards-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .gallery {
    grid-template-columns: repeat(2, 1fr);
  }

  .gallery-item img {
    height: 180px;
  }

  .hobbies-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .timeline-content {
    flex-direction: row;
    align-items: flex-start;
  }

    .timeline-img img {
    width: 130px;
    height: auto;
    }
}

/* Desktop */
@media (min-width: 900px) {
  .hero-inner {
    flex-direction: row;
    text-align: left;
    gap: 3rem;
  }

  .hero-photo {
    width: 240px;
    height: 240px;
    flex-shrink: 0;
  }

  .hero-links {
    justify-content: flex-start;
  }

  .research-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .exp-grid {
    grid-template-columns: 1fr;
  }

  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .community-grid,
  .awards-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .gallery {
    grid-template-columns: repeat(4, 1fr);
  }

  .contact-grid {
    grid-template-columns: 1fr 1.2fr;
    align-items: start;
  }

  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
  }
}

/* Mobile navigation */
@media (max-width: 899px) {
  .nav-toggle {
    display: block;
  }

  .nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: 1rem;
    transform: translateY(-120%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s;
    box-shadow: var(--shadow);
  }

  .nav.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-list {
    flex-direction: column;
    gap: 0.25rem;
  }

  .nav-link {
    padding: 0.7rem 1rem;
    font-size: 1rem;
  }
}

/* Very small screens */
@media (max-width: 400px) {
  .hero-links .btn {
    flex: 1 1 100%;
  }

  .gallery {
    grid-template-columns: 1fr;
  }
}
