@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&family=Inter:wght@300;400;500;600&family=Noto+Sans+Devanagari:wght@400;500;600&display=swap');

/* ─── Variables ──────────────────────────────────────────────── */
:root {
  --primary:      #1c2b3a;
  --accent:       #c94a3f;
  --accent-warm:  #d4a853;
  --bg:           #fafaf8;
  --bg-alt:       #f2ede6;
  --white:        #ffffff;
  --text:         #2d2d2d;
  --text-muted:   #767676;
  --border:       #e4dfd8;
  --shadow-sm:    0 1px 8px rgba(0,0,0,0.06);
  --shadow:       0 4px 24px rgba(0,0,0,0.10);
  --shadow-lg:    0 8px 48px rgba(0,0,0,0.14);
  --radius-sm:    4px;
  --radius:       10px;
  --radius-lg:    20px;
  --max-w:        1120px;
  --nav-h:        72px;
  --ease:         cubic-bezier(0.4, 0, 0.2, 1);
  --t:            0.3s var(--ease);
}

/* ─── Reset ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { color-scheme: light dark; font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg); color: var(--text);
  line-height: 1.7; -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; }

/* ─── Typography ────────────────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: 'Playfair Display', Georgia, serif;
  line-height: 1.25; color: var(--primary);
}
.nepali, [lang="ne"] {
  font-family: 'Noto Sans Devanagari', sans-serif;
  line-height: 1.9;
}

/* ─── Layout ──────────────────────────────────────────────────────── */
.container { width: 100%; max-width: var(--max-w); margin: 0 auto; padding: 0 1.5rem; }
main { padding-top: var(--nav-h); }

/* ─── Navigation ──────────────────────────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 1000; transition: box-shadow var(--t);
}
.nav.scrolled { box-shadow: var(--shadow); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 100%; }
.nav-logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem; font-weight: 700;
  color: var(--primary); text-decoration: none; letter-spacing: -0.02em;
  display: flex; align-items: center; gap: 0.55rem;
}
.nav-logo span { color: var(--accent); }
.nav-logo-img { height: 36px; width: 36px; object-fit: contain; display: block; flex-shrink: 0; }
.nav-links { display: flex; gap: 2rem; list-style: none; }
.nav-links a {
  font-size: 0.82rem; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text); text-decoration: none;
  transition: color var(--t); position: relative; padding-bottom: 2px;
}
.nav-links a::after {
  content: ''; position: absolute; bottom: -4px; left: 0; right: 0;
  height: 2px; background: var(--accent);
  transform: scaleX(0); transition: transform var(--t); transform-origin: left;
}
.nav-links a:hover, .nav-links a.active { color: var(--accent); }
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); }

.nav-toggle {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer; padding: 8px 10px; transition: border-color var(--t);
}
.nav-toggle:hover { border-color: var(--accent); }
.nav-toggle span {
  display: block; width: 22px; height: 2px; background: var(--accent);
  transition: transform var(--t), opacity var(--t);
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Nav-only mobile overrides (hero overrides are after the hero section below) */
@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .nav-links {
    display: none; position: fixed;
    top: var(--nav-h); left: 0; right: 0;
    background: var(--white); flex-direction: column;
    padding: 1.5rem 2rem; gap: 1.25rem;
    border-bottom: 1px solid var(--border); box-shadow: var(--shadow);
  }
  .nav-links.open { display: flex; }
}

/* ─── Hero ───────────────────────────────────────────────────────── */
.hero {
  min-height: 90vh; display: flex; align-items: center;
  background: linear-gradient(140deg, var(--primary) 0%, #253d56 60%, #1a3a2e 100%);
  color: white; position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 70% 50%, rgba(212,168,83,0.08) 0%, transparent 60%);
}
.hero-inner {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 4rem; align-items: center; width: 100%;
}
.hero-content { position: relative; z-index: 1; }
.hero-visual {
  display: flex; justify-content: center; align-items: center;
  position: relative; z-index: 1;
}
.hero-logo-bg {
  width: min(460px, 100%); aspect-ratio: 1;
  border-radius: 50%; padding: 2rem;
  background: rgba(0, 0, 0, 0.50);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  display: flex; justify-content: center; align-items: center;
  animation: hero-float 9s ease-in-out infinite;
  -webkit-mask-image: radial-gradient(circle closest-side at center, black 82%, transparent 98%);
  mask-image: radial-gradient(circle closest-side at center, black 82%, transparent 98%);
}
.hero-logo {
  width: 100%; height: auto;
  filter: drop-shadow(0 0 32px rgba(80,220,120,0.25))
          drop-shadow(0 0 64px rgba(0,80,255,0.18));
}
@keyframes hero-float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-16px); }
}
.hero-eyebrow {
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--accent-warm);
  margin-bottom: 1.25rem; display: block;
}
.hero-name {
  font-size: clamp(2.8rem, 7vw, 5.5rem); font-weight: 700;
  color: white; line-height: 1.05; margin-bottom: 0.75rem;
}
.hero-title {
  font-size: 1.1rem; font-weight: 300;
  color: rgba(255,255,255,0.65); margin-bottom: 1.75rem;
  letter-spacing: 0.02em;
}
.hero-motto {
  font-family: 'Playfair Display', serif; font-size: 1.35rem; font-style: italic;
  color: var(--accent-warm); border-left: 3px solid var(--accent-warm);
  padding-left: 1.25rem; margin: 2rem 0 2.5rem; line-height: 1.5;
}
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

/* Hero mobile overrides — MUST come after the base hero styles above */
@media (max-width: 768px) {
  .hero-inner { grid-template-columns: 1fr; gap: 2.5rem; text-align: center; }
  .hero-motto { margin-left: auto; margin-right: auto; }
  .hero-actions { justify-content: center; }
  .hero-logo-bg { width: min(220px, 65vw); }
}

/* ─── Buttons ────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.8rem 1.75rem; border-radius: var(--radius);
  font-size: 0.88rem; font-weight: 600; letter-spacing: 0.02em;
  text-decoration: none; transition: all var(--t);
  border: 2px solid transparent; cursor: pointer;
}
.btn-primary { background: var(--accent); color: white; border-color: var(--accent); }
.btn-primary:hover { background: #b03830; border-color: #b03830; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(201,74,63,0.35); }
.btn-outline { background: transparent; color: white; border-color: rgba(255,255,255,0.45); }
.btn-outline:hover { background: rgba(255,255,255,0.1); border-color: white; transform: translateY(-2px); }
.btn-outline-dark { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline-dark:hover { background: var(--primary); color: white; transform: translateY(-2px); }

/* ─── Sections ─────────────────────────────────────────────────────── */
.section { padding: 5rem 0; }
.section-alt { background: var(--bg-alt); }
.section-header { margin-bottom: 3rem; }
.section-header .eyebrow {
  font-size: 0.73rem; font-weight: 700; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--accent);
  margin-bottom: 0.75rem; display: block;
}
.section-header h2 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); }
.section-header p { color: var(--text-muted); margin-top: 0.75rem; max-width: 520px; }
.section-header.center { text-align: center; }
.section-header.center p { margin: 0.75rem auto 0; }

/* ─── Home: Section Nav Cards ────────────────────────────────────────────── */
.section-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}
.section-card {
  background: var(--white); border-radius: var(--radius-lg);
  padding: 2rem 1.5rem; text-align: center;
  border: 1px solid var(--border); text-decoration: none; color: inherit;
  display: flex; flex-direction: column; align-items: center; gap: 1rem;
  transition: all var(--t);
}
.section-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: transparent; }
.section-card-icon {
  width: 64px; height: 64px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; flex-shrink: 0;
}
.icon-gallery  { background: #fef3e2; }
.icon-achieve  { background: #e8f4e8; }
.icon-dear     { background: #fce4ec; }
.icon-articles { background: #ebe8f5; }
.icon-games    { background: #e8f0fe; }
.section-card h3 { font-size: 1.1rem; }
.section-card p { font-size: 0.875rem; color: var(--text-muted); line-height: 1.5; }

/* ─── Gallery ───────────────────────────────────────────────────────── */
.filter-bar { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 2rem; }
.filter-group { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.filter-label { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); min-width: 4rem; }
.filter-btn {
  padding: 0.4rem 1.1rem; border-radius: 100px;
  font-size: 0.83rem; font-weight: 500;
  border: 1.5px solid var(--border); background: var(--white);
  color: var(--text); cursor: pointer; transition: all var(--t);
}
.filter-btn:hover, .filter-btn.active {
  background: var(--primary); color: white; border-color: var(--primary);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.gallery-item {
  position: relative; overflow: hidden; border-radius: var(--radius);
  cursor: pointer; background: var(--bg-alt); aspect-ratio: 4/3;
}
.gallery-placeholder {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, var(--bg-alt) 0%, var(--border) 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.5rem; color: var(--text-muted); font-size: 0.8rem;
}
.gallery-placeholder .ph-icon { font-size: 2.5rem; opacity: 0.4; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--t); }
.gallery-item:hover img, .gallery-item:hover .gallery-placeholder { transform: scale(1.05); }
.gallery-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.65) 0%, transparent 55%);
  opacity: 0; transition: opacity var(--t);
  display: flex; align-items: flex-end; padding: 1rem; color: white; font-size: 0.85rem;
}
.gallery-item:hover .gallery-overlay { opacity: 1; }

/* ─── Lightbox ────────────────────────────────────────────────────── */
dialog.lightbox {
  display: none; border: none; padding: 2rem;
  background: rgba(0,0,0,0.9);
  width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh;
  align-items: center; justify-content: center;
}
dialog.lightbox[open] { display: flex; }
dialog.lightbox::backdrop { background: transparent; }
.lightbox-img { max-width: 90vw; max-height: 80vh; border-radius: var(--radius); }
.lightbox-close {
  position: absolute; top: 1.5rem; right: 1.5rem;
  background: none; border: none; color: white; font-size: 2rem;
  cursor: pointer; line-height: 1;
}
.lightbox-caption {
  position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,0.75); font-size: 0.9rem; text-align: center;
}

/* ─── Achievements Timeline ──────────────────────────────────────────────── */
.timeline-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; }
@media (max-width: 768px) { .timeline-grid { grid-template-columns: 1fr; } }
.timeline-col h3 { font-size: 1.1rem; margin-bottom: 1.75rem; padding-bottom: 0.75rem; border-bottom: 2px solid var(--border); }

.timeline { position: relative; padding-left: 1.75rem; }
.timeline::before {
  content: ''; position: absolute; left: 0; top: 0.4rem; bottom: 0;
  width: 2px; background: var(--border);
}
.timeline-item { position: relative; margin-bottom: 2.25rem; }
.timeline-item::before {
  content: ''; position: absolute; left: -2.19rem; top: 0.35rem;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--white); border: 3px solid var(--accent);
}
.timeline-date {
  font-size: 0.75rem; font-weight: 600; color: var(--accent);
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.3rem;
}
.timeline-title { font-size: 1.05rem; font-weight: 600; color: var(--primary); margin-bottom: 0.4rem; }
.timeline-body { font-size: 0.88rem; color: var(--text-muted); line-height: 1.6; }

/* ─── Family Tree ─────────────────────────────────────────────────────── */
.ftree-wrap { overflow-x: auto; padding-bottom: 1rem; }

.ftree ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; align-items: center; }
.ftree ul > li { display: flex; flex-direction: column; align-items: center; }

.ftree ul ul {
  flex-direction: row; gap: 0;
  padding-top: 3.5rem;
  position: relative;
}

.ftree ul ul::before {
  content: ''; position: absolute;
  top: 0; left: 50%; transform: translateX(-1px);
  width: 2px; height: 1.75rem;
  background: var(--border);
}

.ftree ul ul > li { position: relative; display: flex; flex-direction: column; align-items: center; padding: 0 1.5rem; }

.ftree ul ul > li::before {
  content: ''; position: absolute;
  top: -1.75rem; left: 0; right: 0; height: 2px;
  background: var(--border);
}
.ftree ul ul > li:first-child::before { left: 50%; }
.ftree ul ul > li:last-child::before  { right: 50%; }
.ftree ul ul > li:only-child::before  { display: none; }

.ftree ul ul > li::after {
  content: ''; position: absolute;
  top: -1.75rem; left: 50%; transform: translateX(-1px);
  width: 2px; height: 1.75rem;
  background: var(--border);
}

.ftcouple { display: flex; align-items: center; gap: 0.6rem; }
.ftheart  { font-size: 1.1rem; color: var(--accent); flex-shrink: 0; }

.ftperson {
  appearance: none; font-family: inherit;
  background: var(--white); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem 1rem;
  cursor: pointer; width: 160px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
  transition: all var(--t); flex-shrink: 0;
}
.ftperson:hover { box-shadow: var(--shadow); transform: translateY(-3px); border-color: var(--accent); }

.ftavatar {
  width: 88px; height: 88px; border-radius: 50%;
  background: var(--bg-alt); overflow: hidden;
  border: 2.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem; flex-shrink: 0;
}
.ftavatar img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }

.ftname     { font-size: 0.9rem;  font-weight: 600; color: var(--primary); line-height: 1.3; }
.ftrelation { font-size: 0.72rem; font-weight: 700; color: var(--accent);  text-transform: uppercase; letter-spacing: 0.06em; }

.ftperson--you { border-color: var(--accent-warm); background: linear-gradient(135deg,#fffdf7,#fff8e8); }
.ftperson--you .ftrelation { color: var(--accent-warm); }

.ftperson--child .ftavatar { border-color: #c8e6c9; background: #f1f8f1; }

.ftperson--expected {
  border: 2px dashed var(--border); background: var(--bg-alt);
}
.ftperson--expected .ftname     { color: var(--text-muted); font-style: italic; }
.ftperson--expected .ftrelation { color: var(--accent-warm); }
.ftperson--expected .ftavatar   { animation: ftpulse 2.4s ease-in-out infinite; will-change: transform, opacity; }
@keyframes ftpulse {
  0%, 100% { transform: scale(1);    opacity: 0.9; }
  50%       { transform: scale(0.9); opacity: 0.45; }
}

@media (max-width: 820px) {
  .ftperson    { width: 124px; padding: 0.85rem 0.7rem; }
  .ftavatar    { width: 62px;  height: 62px; font-size: 1.8rem; }
  .ftname      { font-size: 0.76rem; }
  .ftrelation  { font-size: 0.63rem; }
  .ftheart     { font-size: 0.95rem; }
  .ftcouple    { gap: 0.5rem; }
  .ftree       { min-width: 0; }

  .ftree ul ul {
    flex-direction: column;
    align-items: flex-start;
    padding-top: 1.25rem;
    padding-left: 2.25rem;
    gap: 0;
  }

  .ftree ul ul::before {
    top: 0; left: 0; transform: none;
    width: 2px; height: 1.25rem;
  }

  .ftree ul ul > li {
    display: flex; flex-direction: column; align-items: flex-start;
    padding: 0 0 1.5rem;
    position: relative;
  }

  .ftree ul ul > li::before {
    display: block;
    left: -2.25rem; right: auto; top: 0;
    width: 2px; height: 100%;
  }
  .ftree ul ul > li:last-child::before  { height: 2.5rem; right: auto; }
  .ftree ul ul > li:first-child::before { left: -2.25rem; }
  .ftree ul ul > li:only-child::before  { display: none; }

  .ftree ul ul > li::after {
    display: block;
    left: -2.25rem; right: auto;
    top: 2.5rem; bottom: auto;
    transform: none;
    width: 2.25rem; height: 2px;
  }
  .ftree ul ul > li:last-child::after  { display: block; }
  .ftree ul ul > li:only-child::after  { display: none; }

  .ftree ul > li { align-items: flex-start; }
}

.ftree-reveal-section {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.65s ease, opacity 0.35s ease;
}
.ftree-reveal-section.is-open {
  max-height: 3000px;
  opacity: 1;
  transition: max-height 0.65s ease, opacity 0.35s ease 0.15s;
}

.ftree-reveal-header {
  display: flex; flex-direction: column; align-items: center;
  gap: 0.25rem;
  padding: 2.5rem 0 1.75rem;
  border-top: 1.5px solid var(--border);
  margin-top: 2.5rem;
}
.ftree-reveal-title {
  font-size: 1.35rem; font-weight: 700;
  color: var(--primary); margin: 0;
}
.ftree-reveal-close {
  margin-top: 0.75rem;
  font: inherit; font-size: 0.8rem; font-weight: 600;
  background: none; border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 0.35rem 0.9rem;
  cursor: pointer; color: var(--text-muted);
  transition: all var(--t);
}
.ftree-reveal-close:hover { border-color: var(--accent); color: var(--accent); }

.ftperson--linked {
  border-color: #7c3aed;
  position: relative;
}
.ftperson--linked::after {
  content: '↷';
  position: absolute; top: 0.4rem; right: 0.45rem;
  font-size: 0.65rem; color: #7c3aed; opacity: 0.75;
  line-height: 1;
}
.ftperson--linked .ftrelation { color: #7c3aed; }

@keyframes ftlink-flash {
  0%, 100%    { opacity: 1; }
  20%, 60%    { opacity: 0.3; }
  40%, 80%    { opacity: 1; }
}
.ftperson--flash { animation: ftlink-flash 0.9s ease; will-change: opacity; }

.ftlink-svg {
  position: absolute; top: 0; left: 0;
  pointer-events: none; overflow: visible;
}

.person-modal-link {
  margin-top: 1.1rem; padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.person-modal-link-btn {
  font: inherit; font-size: 0.82rem; font-weight: 600;
  background: none; border: 1.5px solid #7c3aed;
  border-radius: var(--radius); padding: 0.45rem 1rem;
  cursor: pointer; color: #7c3aed;
  transition: all var(--t);
}
.person-modal-link-btn:hover { background: #f5f3ff; }

/* ─── Person modal ─────────────────────────────────────────────────────── */
dialog.person-modal {
  display: none; border: none; border-radius: var(--radius-lg);
  padding: 2.5rem 2rem; text-align: center;
  background: var(--white); width: min(420px, 90vw);
  box-shadow: var(--shadow-lg); position: fixed;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
}
dialog.person-modal[open] { display: block; }
dialog.person-modal::backdrop { background: rgba(0,0,0,0.55); }
.person-modal-close {
  position: absolute; top: 1rem; right: 1.25rem;
  background: none; border: none; font-size: 1.6rem;
  color: var(--text-muted); cursor: pointer; line-height: 1;
  transition: color var(--t);
}
.person-modal-close:hover { color: var(--accent); }
#modalAvatar {
  width: 130px; height: 130px; border-radius: 50%; overflow: hidden;
  background: var(--bg-alt); border: 3px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 3.5rem; margin: 0 auto 1.25rem;
}
#modalAvatar img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.person-modal-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem; font-weight: 700; color: var(--primary); margin-bottom: 0.3rem;
}
.person-modal-relation {
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 1.25rem;
}
.person-modal-note { font-size: 1rem; color: var(--text-muted); font-style: italic; line-height: 1.7; }

/* ─── Article List ──────────────────────────────────────────────────────── */
.article-list { display: flex; flex-direction: column; }
.article-item {
  display: grid; grid-template-columns: 3rem 1fr 7rem;
  gap: 1.25rem; align-items: start;
  padding: 1.5rem 0; border-bottom: 1px solid var(--border);
  text-decoration: none; color: inherit; transition: background var(--t);
}
.article-item:hover .article-title   { color: var(--accent); }
.article-item:hover .article-num     { color: var(--accent); }
.article-item:hover .article-excerpt { color: var(--text); }
.article-num { font-size: 0.78rem; color: var(--text-muted); padding-top: 0.4rem; font-variant-numeric: tabular-nums; transition: color var(--t); }
.article-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem; font-weight: 600; color: var(--primary);
  margin-bottom: 0.35rem; transition: color var(--t);
  line-height: 1.3;
}
.article-title.nepali {
  font-family: 'Noto Sans Devanagari', serif;
  font-size: 1.2rem;
}
.article-meta { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.article-tag {
  padding: 0.15rem 0.65rem; border-radius: 100px;
  background: var(--bg-alt); font-size: 0.72rem;
  font-weight: 600; color: var(--text-muted); letter-spacing: 0.04em;
}
.article-tag.poem    { background: #ebe8f5; color: #5a4e8a; }
.article-tag.essay   { background: #e8f4e8; color: #2d6a3f; }
.article-tag.lang-ne    { background: #fce7f3; color: #9d174d; }
.article-tag.lang-en    { background: #dbeafe; color: #1e40af; }
.article-tag.translation { background: #fef3c7; color: #92400e; }
.article-excerpt { font-size: 0.85rem; color: var(--text-muted); line-height: 1.5; margin-top: 0.4rem; }
.article-excerpt.nepali { font-family: 'Noto Sans Devanagari', sans-serif; }
.article-date { font-size: 0.78rem; color: var(--text-muted); padding-top: 0.5rem; text-align: right; }

@media (max-width: 600px) {
  .article-item { grid-template-columns: 1fr; gap: 0.4rem; }
  .article-num, .article-date { display: none; }
}

/* ─── Article / Post page ────────────────────────────────────────────────────────── */
.post-wrap { max-width: 760px; margin: 0 auto; padding: 0 1.5rem; }
.post-header { padding: 3rem 0 2.25rem; border-bottom: 1px solid var(--border); margin-bottom: 2.5rem; }
.post-eyebrow { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.75rem; }
.post-title { font-size: clamp(1.8rem, 4.5vw, 3rem); margin-bottom: 1rem; }
.post-title.nepali { font-family: 'Noto Sans Devanagari', serif; }
.post-meta { display: flex; gap: 1.5rem; font-size: 0.83rem; color: var(--text-muted); flex-wrap: wrap; align-items: center; }
.post-body { font-size: 1.05rem; line-height: 1.9; }
.post-body p { margin-bottom: 1.35rem; }
.post-body h2 { font-size: 1.45rem; margin: 2.25rem 0 1rem; }
.post-body.nepali {
  font-family: 'Noto Sans Devanagari', sans-serif;
  font-size: 1.15rem; line-height: 2.1;
}
.post-poem {
  font-size: 1.2rem; margin: 0;
}
.post-poem.nepali {
  font-family: 'Noto Sans Devanagari', serif;
}
.post-poem p {
  line-height: 2; margin: 0 0 2.25rem;
}
.post-poem p:last-child { margin-bottom: 0; }
.post-poem em { font-style: italic; color: var(--accent); }
.post-poem-coda {
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-weight: 600;
}
.post-nav {
  display: flex; justify-content: space-between; gap: 2rem;
  padding: 2rem 0; border-top: 1px solid var(--border); margin-top: 3rem;
  font-size: 0.88rem;
}
.post-nav a { color: var(--text-muted); text-decoration: none; transition: color var(--t); }
.post-nav a:hover { color: var(--accent); }

/* ─── Language Toggle ──────────────────────────────────────────────────────── */
.lang-toggle {
  display: flex;
  margin-top: 1rem;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  width: fit-content;
  font-size: 0.78rem;
}
.lang-btn {
  background: none;
  border: none;
  border-right: 1.5px solid var(--border);
  padding: 0.3rem 0.75rem;
  cursor: pointer;
  color: var(--text-muted);
  font-family: inherit;
  font-size: inherit;
  line-height: 1;
  transition: background var(--t), color var(--t);
}
.lang-btn:last-child { border-right: none; }
.lang-btn.active { background: var(--accent); color: #fff; }
.lang-btn:not(.active):hover { background: var(--bg-alt); color: var(--text); }

/* Original vs translation sub-labels */
.lang-toggle[data-original] .lang-btn {
  display: flex; flex-direction: column; align-items: center;
  gap: 0.12rem; padding-top: 0.4rem; padding-bottom: 0.35rem;
}
.lang-toggle[data-original] .lang-btn::after {
  font-size: 0.6rem; letter-spacing: 0.05em; text-transform: uppercase;
  opacity: 0.55; line-height: 1;
}
.lang-toggle[data-original="ne"] .lang-btn[data-lang="ne"]::after { content: "original"; }
.lang-toggle[data-original="ne"] .lang-btn[data-lang="en"]::after { content: "translation"; }
.lang-toggle[data-original="en"] .lang-btn[data-lang="en"]::after { content: "original"; }
.lang-toggle[data-original="en"] .lang-btn[data-lang="ne"]::after { content: "translation"; }

/* ─── Social Links ──────────────────────────────────────────────────────── */
.social-links { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.social-link {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--border); text-decoration: none;
  transition: all var(--t); font-size: 1rem; color: var(--text-muted);
}
.social-link:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-2px); }
.social-link svg { width: 18px; height: 18px; fill: currentColor; }

/* ─── Footer ────────────────────────────────────────────────────────── */
.footer { background: var(--primary); color: rgba(255,255,255,0.65); padding: 3.5rem 0 2rem; }
.footer-top {
  display: grid; grid-template-columns: 1fr auto;
  gap: 2rem; align-items: start; margin-bottom: 2.5rem;
}
.footer-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem; color: white; margin-bottom: 0.4rem;
}
.footer-motto { font-style: italic; font-size: 0.9rem; color: var(--accent-warm); margin-bottom: 1rem; }
.footer-bio { font-size: 0.875rem; max-width: 400px; line-height: 1.7; }
.footer-social .social-link { border-color: rgba(255,255,255,0.2); color: rgba(255,255,255,0.55); }
.footer-social .social-link:hover { color: white; border-color: white; }
.footer-divider { border: none; border-top: 1px solid rgba(255,255,255,0.1); margin-bottom: 1.5rem; }
.footer-bottom {
  display: flex; justify-content: space-between;
  align-items: center; flex-wrap: wrap; gap: 1rem;
  font-size: 0.78rem;
}
.footer-bottom a { color: rgba(255,255,255,0.4); text-decoration: none; transition: color var(--t); }
.footer-bottom a:hover { color: white; }

@media (max-width: 600px) {
  .footer-top { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
}

/* ─── Animations ──────────────────────────────────────────────────────── */
.animate {
  opacity: 0; transform: translateY(22px);
  transition: opacity 0.65s var(--ease), transform 0.65s var(--ease);
}
.animate.delay-1 { transition-delay: 0.1s; }
.animate.delay-2 { transition-delay: 0.2s; }
.animate.delay-3 { transition-delay: 0.3s; }
.animate.delay-4 { transition-delay: 0.4s; }
.animate.visible { opacity: 1; transform: translateY(0); }

/* ─── Page header (non-home pages) ─────────────────────────────────────────────────── */
.page-header {
  background: var(--primary); color: white;
  padding: 3.5rem 0 3rem;
}
.page-header .eyebrow {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--accent-warm); margin-bottom: 0.75rem;
}
.page-header h1 { font-size: clamp(2rem, 5vw, 3.25rem); color: white; }
.page-header p { color: rgba(255,255,255,0.6); margin-top: 0.75rem; font-size: 1rem; }

/* ─── Utilities ───────────────────────────────────────────────────────── */
.text-center  { text-align: center; }
.text-accent  { color: var(--accent); }
.text-warm    { color: var(--accent-warm); }
.text-muted   { color: var(--text-muted); }
.mt-sm { margin-top: 1rem; }
.mt-md { margin-top: 2rem; }
.mt-lg { margin-top: 4rem; }
.mb-sm { margin-bottom: 1rem; }
.mb-md { margin-bottom: 2rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ─── Professional Polish ─────────────────────────────────────────────────────────────── */

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
::selection { background: rgba(201,74,63,0.15); }

.hero::after {
  content: ''; position: absolute; inset: 0; z-index: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.055) 1px, transparent 1px);
  background-size: 36px 36px; pointer-events: none;
}

.hero-scroll {
  position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 0.4rem;
  color: rgba(255,255,255,0.35); font-size: 0.68rem; letter-spacing: 0.14em;
  text-transform: uppercase; user-select: none; z-index: 1;
}
.hero-scroll svg {
  width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2px;
  stroke-linecap: round; stroke-linejoin: round;
  animation: scroll-bounce 2.4s ease-in-out infinite;
}
@keyframes scroll-bounce {
  0%, 100% { transform: translateY(0);   opacity: 0.35; }
  50%       { transform: translateY(6px); opacity: 0.85; }
}
@media (max-width: 768px) { .hero-scroll { display: none; } }

.about-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 4rem; align-items: center;
}
@media (max-width: 768px) {
  .about-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .about-photo-wrap { max-width: 320px; margin: 0 auto; }
}
.about-photo-wrap {
  aspect-ratio: 3/4; border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.about-photo-wrap img {
  width: 100%; height: 100%; object-fit: cover; object-position: center top;
}

.stats-row {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1px; background: var(--border);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; margin-top: 4rem;
}
.stat-item {
  background: var(--white); padding: 2rem 1rem; text-align: center;
  transition: background var(--t);
}
.stat-item:hover { background: var(--bg); }
.stat-num {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 3.5vw, 2.75rem); font-weight: 700;
  color: var(--primary); line-height: 1; display: block;
}
.stat-num sup { font-size: 0.55em; vertical-align: super; font-weight: 600; }
.stat-label {
  font-size: 0.75rem; color: var(--text-muted);
  margin-top: 0.5rem; display: block; font-weight: 500; line-height: 1.4;
}
@media (max-width: 640px) { .stats-row { grid-template-columns: repeat(2, 1fr); } }

.section-card-icon { transition: transform 0.4s var(--ease); }
.section-card:hover .section-card-icon { transform: scale(1.1) rotate(-4deg); }
.section-card-icon svg {
  width: 28px; height: 28px;
  stroke: currentColor;
  stroke-linecap: round; stroke-linejoin: round; fill: none; stroke-width: 1.5;
}
.icon-gallery  { color: #b45309; }
.icon-achieve  { color: #15803d; }
.icon-dear     { color: #be123c; }
.icon-articles { color: #6d28d9; }
.icon-games    { background: #e8f0fe; }

.back-to-top {
  position: fixed; bottom: 2rem; right: 2rem; z-index: 900;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--primary); color: white; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  opacity: 0; transform: translateY(10px);
  transition: opacity var(--t), transform var(--t), background var(--t), box-shadow var(--t);
  pointer-events: none;
}
.back-to-top.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.back-to-top:hover { background: var(--accent); box-shadow: 0 6px 24px rgba(201,74,63,0.4); }
.back-to-top svg {
  width: 18px; height: 18px; fill: none; stroke: currentColor;
  stroke-width: 2.5px; stroke-linecap: round; stroke-linejoin: round;
}

.page-header {
  background: linear-gradient(140deg, var(--primary) 0%, #253d56 60%, #1a3a2e 100%);
  position: relative; overflow: hidden;
}
.page-header::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 80% 50%, rgba(212,168,83,0.08) 0%, transparent 55%);
  pointer-events: none;
}
.page-header .container { position: relative; z-index: 1; }

.timeline-title { transition: color var(--t); }
.timeline-item:hover .timeline-title { color: var(--accent); }

.cta-section {
  background: linear-gradient(140deg, var(--primary) 0%, #253d56 60%, #1a3a2e 100%);
  padding: 5.5rem 0; text-align: center; position: relative; overflow: hidden;
}
.cta-section::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(212,168,83,0.12) 0%, transparent 55%);
  pointer-events: none;
}
.cta-section .container { position: relative; z-index: 1; }
.cta-section .eyebrow { color: var(--accent-warm); }
.cta-section h2 { color: white; font-size: clamp(1.75rem, 3.5vw, 2.5rem); margin-bottom: 1rem; }
.cta-section p { color: rgba(255,255,255,0.6); max-width: 480px; margin: 0 auto 2.5rem; font-size: 1rem; }

.footer-nav {
  display: flex; gap: 1.5rem; flex-wrap: wrap; margin-top: 1rem;
}
.footer-nav a {
  font-size: 0.8rem; font-weight: 500;
  color: rgba(255,255,255,0.45); text-decoration: none;
  transition: color var(--t); letter-spacing: 0.02em;
}
.footer-nav a:hover { color: rgba(255,255,255,0.9); }

.reading-progress {
  position: fixed; top: var(--nav-h); left: 0; right: 0; height: 3px;
  background: transparent; z-index: 999; pointer-events: none;
}
.reading-progress-bar {
  height: 100%; background: var(--accent); width: 0%;
  transition: width 0.1s linear;
}

/* ─── Creations Corner ────────────────────────────────────────────────────────── */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}
.game-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: all var(--t);
}
.game-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: transparent; }
.game-card-header {
  padding: 2.5rem 1.5rem 2rem;
  display: flex; flex-direction: column; align-items: center; gap: 0.75rem;
}
.game-header-uno    { background: linear-gradient(135deg, #c94a3f 0%, #7a1a10 100%); }
.game-header-tambola { background: linear-gradient(135deg, #4a0080 0%, #1a0040 100%); }
.game-header-bingo  { background: linear-gradient(135deg, #1a5c3a 0%, #0a2d1e 100%); }
.game-header-shoshit  { background: linear-gradient(135deg, #9a3412 0%, #431407 100%); }
.game-header-sai2sai  { background: linear-gradient(135deg, #d97706 0%, #7c2d12 100%); }
.game-header-ludo     { background: linear-gradient(135deg, #d97706 0%, #78350f 100%); }
.game-header-melody   { background: linear-gradient(135deg, #5b21b6 0%, #1e1b4b 100%); }
.game-card-icon { font-size: 3rem; line-height: 1; }
.game-card-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem; font-weight: 700; color: white; margin: 0;
}
.game-card-tag-row { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: center; }
.game-tag {
  padding: 0.25rem 0.75rem; border-radius: 100px;
  background: rgba(255,255,255,0.18); color: rgba(255,255,255,0.9);
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.05em;
}
.game-card-body { padding: 1.75rem 1.5rem 1.25rem; flex: 1; }
.game-card-body p { font-size: 0.9rem; color: var(--text-muted); line-height: 1.7; margin-bottom: 1.25rem; }
.game-tech { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.game-tech-tag {
  padding: 0.2rem 0.6rem; border-radius: var(--radius-sm);
  background: var(--bg-alt); border: 1px solid var(--border);
  font-size: 0.72rem; font-weight: 600; color: var(--text-muted);
}
.game-card-footer {
  padding: 1.25rem 1.5rem 1.5rem;
  display: flex; gap: 0.75rem; flex-wrap: wrap;
  border-top: 1px solid var(--border);
}

/* ─── Dark mode ──────────────────────────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  :root {
    --bg:         #0e1c28;
    --bg-alt:     #152232;
    --white:      #1a2d40;
    --text:       #dde9f2;
    --text-muted: #7fa3b7;
    --border:     #243749;
    --shadow-sm:  0 1px 8px rgba(0,0,0,0.4);
    --shadow:     0 4px 24px rgba(0,0,0,0.55);
    --shadow-lg:  0 8px 48px rgba(0,0,0,0.75);
  }

  /* Elements that hardcode color: var(--primary) for dark-on-light text */
  h1, h2, h3, h4,
  .nav-logo,
  .article-title,
  .timeline-title,
  .ftname,
  .person-modal-name,
  .ftree-reveal-title,
  .stat-num { color: #c5d5e3; }

  /* Hero/footer/page-header headings stay white — their parent overrides win */

  /* Nav */
  .nav { background: rgba(14, 28, 40, 0.97); }
  .nav-links a { color: var(--text); }

  /* Back-to-top: var(--primary) on dark bg is near-invisible */
  .back-to-top { background: #253d56; }

  /* Gallery filter active/hover */
  .filter-btn:hover, .filter-btn.active {
    background: #253d56; color: white; border-color: #253d56;
  }

  /* Section card icons: tinted dark backgrounds + brighter icon colours */
  .icon-gallery  { background: rgba(254,243,226,0.1); color: #f59e0b; }
  .icon-achieve  { background: rgba(232,244,232,0.1); color: #4ade80; }
  .icon-dear     { background: rgba(252,228,236,0.1); color: #fb7185; }
  .icon-articles { background: rgba(235,232,245,0.1); color: #a78bfa; }
  .icon-games    { background: rgba(232,240,254,0.1); color: #60a5fa; }

  /* Article tags */
  .article-tag.poem    { background: rgba(235,232,245,0.15); color: #c4b5fd; }
  .article-tag.essay   { background: rgba(232,244,232,0.15); color: #86efac; }
  .article-tag.lang-ne { background: rgba(252,231,243,0.15); color: #f9a8d4; }
  .article-tag.lang-en { background: rgba(219,234,254,0.15); color: #93c5fd; }

  /* Timeline dot fill */
  .timeline-item::before { background: var(--bg); }

  /* Family tree */
  .ftperson--you { background: linear-gradient(135deg, #1e2d1a, #192614); }

  /* Modals */
  dialog.person-modal { background: var(--white); }
  .person-modal-link-btn:hover { background: rgba(124,58,237,0.15); }

  /* btn-outline-dark: primary border/text becomes invisible on dark */
  .btn-outline-dark { color: #c5d5e3; border-color: #c5d5e3; }
  .btn-outline-dark:hover { background: #c5d5e3; color: var(--bg); }

  /* Selection */
  ::selection { background: rgba(201,74,63,0.35); }
}
