/* ===================================================
   Sandip Dhakal Portfolio - Global Styles
   Domain: dhakalsandip.com.np
   =================================================== */

/* Theme Variables */
:root {
  --bg: #fcfbf9;
  --card-bg: #ffffff;
  --card-border: #e7e5e4;
  --text-dark: #1c1917;
  --text-muted: #57534e;
  --border: #e7e5e4;
  --accent: #0d6e4f;
  --accent-light: #10b981;
  --accent-warm: #b45309;
  --accent-warm-soft: #fef3c7;
  --pill-bg: #f5f5f4;
  --pill-text: #1c1917;
  --pill-dev-bg: #ecfdf5;
  --pill-dev-text: #065f46;
  --pill-teach-bg: #fef3c7;
  --pill-teach-text: #92400e;
  --table-stripe: #fafaf9;
  --badge-bg: #f5f5f4;
  --btn-primary-bg: #1c1917;
  --btn-primary-text: #ffffff;
  --btn-secondary-bg: transparent;
  --btn-secondary-border: #d6d3d1;
  --btn-secondary-text: #1c1917;
  --radius: 14px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.03);
  --shadow-md: 0 6px 24px -4px rgba(28, 25, 23, 0.07);
  --header-bg: rgba(252, 251, 249, 0.88);
  --contact-item-bg: #ffffff;
}

[data-theme="dark"] {
  --bg: #090d14;
  --card-bg: #111722;
  --card-border: #1e293b;
  --text-dark: #f8fafc;
  --text-muted: #94a3b8;
  --border: #1e293b;
  --accent: #10b981;
  --accent-light: #34d399;
  --accent-warm: #f59e0b;
  --accent-warm-soft: rgba(245, 158, 11, 0.15);
  --pill-bg: #1e293b;
  --pill-text: #e2e8f0;
  --pill-dev-bg: rgba(16, 185, 129, 0.14);
  --pill-dev-text: #34d399;
  --pill-teach-bg: rgba(245, 158, 11, 0.16);
  --pill-teach-text: #fbbf24;
  --table-stripe: #151d2c;
  --badge-bg: #151d2c;
  --btn-primary-bg: #f8fafc;
  --btn-primary-text: #090d14;
  --btn-secondary-bg: transparent;
  --btn-secondary-border: #334155;
  --btn-secondary-text: #f8fafc;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.35);
  --shadow-md: 0 8px 30px -4px rgba(0, 0, 0, 0.55);
  --header-bg: rgba(9, 13, 20, 0.88);
  --contact-item-bg: #151d2c;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

html, body {
  background-color: var(--bg);
  color: var(--text-dark);
  /* Use clip instead of hidden — clip prevents horizontal scroll without
     creating a scroll container, so position:sticky on <header> still works */
  overflow-x: clip;
  width: 100%;
  -webkit-tap-highlight-color: rgba(16, 185, 129, 0.15);
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 1.75rem;
  width: 100%;
}

/* Reading Scroll Progress Bar */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: var(--accent);
  z-index: 9999;
  pointer-events: none;
  transition: width 0.08s linear;
}

/* Header & Navigation */
header {
  padding: 1.5rem 0 1.25rem 0;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--header-bg);
  z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color 0.25s ease, background-color 0.25s ease;
}

/* On mobile: header scrolls with page (not fixed) */
@media (max-width: 768px) {
  header {
    position: static;
  }
}

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

.name-title h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-dark);
  letter-spacing: -0.02em;
}

.name-title h2 a {
  color: inherit;
  text-decoration: none;
}

.name-title p {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

nav {
  display: flex;
  align-items: center;
  gap: 1.35rem;
}

nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s ease;
  position: relative;
  padding-bottom: 2px;
}

nav a:hover {
  color: var(--text-dark);
}

nav a.active {
  color: var(--accent);
  font-weight: 600;
}

nav a.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}

/* Theme Toggle */
.theme-toggle-wrapper {
  display: flex;
  align-items: center;
}

.theme-toggle-btn {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 9999px;
  padding: 4px 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text-dark);
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
}

.theme-toggle-btn:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.toggle-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-warm);
}

/* Mobile Menu Toggle Button (Desktop: Hidden) */
.mobile-menu-btn {
  display: none;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 9px;
  width: 38px;
  height: 38px;
  padding: 8px 7px;
  cursor: pointer;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
  transition: all 0.25s ease;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
  -webkit-appearance: none;
  appearance: none;
}

.mobile-menu-btn:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.mobile-menu-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.hamburger-line {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--text-dark);
  border-radius: 2px;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease, background-color 0.2s ease;
  pointer-events: none;
}

.mobile-menu-btn.active .hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.mobile-menu-btn.active .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.mobile-menu-btn.active .hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Breadcrumbs */
.breadcrumbs {
  padding: 1rem 0 0.5rem 0;
}

.breadcrumbs ol {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.breadcrumbs li {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.breadcrumbs a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

.breadcrumbs .breadcrumb-sep {
  color: var(--border);
  font-size: 0.75rem;
}

.breadcrumbs .breadcrumb-current {
  color: var(--text-dark);
  font-weight: 600;
}

/* Hero Section */
main {
  flex: 1;
}

.hero {
  padding: 3.5rem 0 2.5rem 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2.5rem;
  align-items: center;
}

/* Live Status Radar Beacon */
.live-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.35rem 0.85rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 1.15rem;
  box-shadow: var(--shadow-sm);
  letter-spacing: 0.02em;
}

.pulse-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  display: inline-block;
  flex-shrink: 0;
}

.pulse-dot::after {
  content: '';
  position: absolute;
  top: -3px;
  left: -3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.45);
  animation: radar-pulse 1.8s infinite ease-out;
}

@keyframes radar-pulse {
  0% { transform: scale(0.6); opacity: 1; }
  100% { transform: scale(2.4); opacity: 0; }
}

.two-track-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.4rem 1rem;
  background: var(--badge-bg);
  border: 1px solid var(--border);
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  position: relative;
}

/* Border Beam Effect */
.border-beam-badge {
  position: relative;
  overflow: hidden;
}

.border-beam-badge::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  padding: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--accent) 50%, transparent 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  background-size: 200% 100%;
  animation: border-beam-travel 4s linear infinite;
  opacity: 0.75;
}

@keyframes border-beam-travel {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.track-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.track-tag.dev { color: var(--accent); }
.track-tag.teach { color: var(--accent-warm); }

.hero h1 {
  font-family: 'Lora', Georgia, serif;
  font-size: 2.5rem;
  font-weight: 500;
  line-height: 1.24;
  color: var(--text-dark);
  margin-bottom: 1.1rem;
  letter-spacing: -0.015em;
}

.hero p.bio {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 650px;
  margin-bottom: 1.75rem;
  line-height: 1.7;
}

.hero-btn-group {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.4rem;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  transition: all 0.2s ease;
  cursor: pointer;
}

.btn-primary {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  border: 1px solid var(--btn-primary-bg);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
}

.btn-secondary {
  background: var(--btn-secondary-bg);
  color: var(--btn-secondary-text);
  border: 1px solid var(--btn-secondary-border);
}

.btn-secondary:hover {
  background: var(--pill-bg);
  border-color: var(--text-muted);
  transform: translateY(-2px);
}

/* Curved Avatar & 3D Tilt Perspective */
.hero-photo-container {
  position: relative;
  width: 220px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  perspective: 800px;
}

.avatar-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 220px;
  height: 220px;
  pointer-events: none;
  z-index: 1;
}

.hero-photo-curved {
  position: relative;
  z-index: 2;
  width: 175px;
  height: 175px;
  border-radius: 45% 55% 62% 38% / 48% 46% 54% 52%;
  overflow: hidden;
  border: 3px solid var(--border);
  box-shadow: var(--shadow-md);
  transition: border-radius 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.15s ease-out, border-color 0.3s ease;
  transform-style: preserve-3d;
  will-change: transform;
}

.hero-photo-curved:hover {
  border-radius: 56% 44% 42% 58% / 54% 56% 44% 46%;
  border-color: var(--accent);
}

.hero-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Two Column Layout */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin: 2.5rem 0;
}

.section-box {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 2.25rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  position: relative;
}

.section-box:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border);
}

/* Spotlight Cards */
.spotlight-card {
  position: relative;
  overflow: hidden;
}

.spotlight-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  background: radial-gradient(450px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(16, 185, 129, 0.08), transparent 45%);
  z-index: 1;
}

[data-theme="light"] .spotlight-card::before {
  background: radial-gradient(450px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(13, 110, 79, 0.06), transparent 45%);
}

.spotlight-card:hover::before {
  opacity: 1;
}

.spotlight-content {
  position: relative;
  z-index: 2;
}

.section-icon {
  font-size: 1.6rem;
  margin-bottom: 0.6rem;
}

.section-box h3 {
  font-family: 'Lora', Georgia, serif;
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
  color: var(--text-dark);
  letter-spacing: -0.01em;
}

.box-sub {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1.6rem;
  line-height: 1.5;
}

.skill-category {
  margin-bottom: 1.35rem;
}

.skill-category:last-child {
  margin-bottom: 0;
}

.skill-cat-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.pill {
  background: var(--pill-bg);
  color: var(--pill-text);
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  font-size: 0.84rem;
  font-weight: 500;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.pill.highlight {
  background: var(--pill-dev-bg);
  color: var(--pill-dev-text);
  font-weight: 600;
  border-color: rgba(13, 110, 79, 0.25);
}

.pill.highlight-warm {
  background: var(--pill-teach-bg);
  color: var(--pill-teach-text);
  font-weight: 600;
  border-color: rgba(180, 83, 9, 0.25);
}

/* Syllabus Accordion */
.curriculum-accordion {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 1rem;
}

.accordion-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.accordion-item.active {
  border-color: var(--accent-warm);
  box-shadow: 0 2px 8px rgba(180, 83, 9, 0.08);
}

.accordion-header {
  width: 100%;
  padding: 0.75rem 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-dark);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  text-align: left;
  transition: background-color 0.2s ease;
}

.accordion-header:hover {
  background: var(--table-stripe);
}

.accordion-title-group {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.accordion-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: var(--pill-teach-bg);
  color: var(--pill-teach-text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.accordion-icon {
  width: 16px;
  height: 16px;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--text-muted);
  flex-shrink: 0;
}

.accordion-item.active .accordion-icon {
  transform: rotate(180deg);
  color: var(--accent-warm);
}

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s ease;
  padding: 0 0.85rem;
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.accordion-item.active .accordion-body {
  max-height: 400px;
  padding: 0.25rem 0.85rem 0.85rem 0.85rem;
  border-top: 1px dashed var(--border);
}

.accordion-meta-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.4rem;
}

.accordion-meta-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
}

.accordion-meta-list li::before {
  content: '>';
  color: var(--accent-warm);
  font-size: 0.85rem;
  font-weight: 700;
}

/* Page Header (for sub-pages) */
.page-header {
  padding: 2.5rem 0 1.5rem 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}

.page-header h1 {
  font-family: 'Lora', Georgia, serif;
  font-size: 2.2rem;
  font-weight: 500;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
  letter-spacing: -0.015em;
}

.page-header p {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 650px;
  line-height: 1.6;
}

/* About Page */
.about-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2.5rem;
  align-items: start;
  margin-bottom: 2.5rem;
}

.about-photo {
  width: 180px;
  height: 180px;
  border-radius: 45% 55% 62% 38% / 48% 46% 54% 52%;
  overflow: hidden;
  border: 3px solid var(--border);
  box-shadow: var(--shadow-md);
  flex-shrink: 0;
}

.about-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.about-text h2 {
  font-family: 'Lora', Georgia, serif;
  font-size: 1.5rem;
  color: var(--text-dark);
  margin-bottom: 0.75rem;
}

.about-text p {
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.about-text p:last-child {
  margin-bottom: 0;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: 2rem;
}

.info-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.info-card h3 {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.info-card p {
  color: var(--text-dark);
  font-weight: 500;
  font-size: 0.95rem;
}

/* Internal Links */
.internal-links {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.internal-links h3 {
  font-family: 'Lora', Georgia, serif;
  font-size: 1.15rem;
  color: var(--text-dark);
  margin-bottom: 1rem;
}

.link-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.link-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text-dark);
  font-weight: 600;
  font-size: 0.92rem;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

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

.link-card .link-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

/* Contact Section */
.contact-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 2.75rem 2.25rem;
  margin-top: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  text-align: center;
}

.contact-header h3 {
  font-family: 'Lora', Georgia, serif;
  font-size: 1.6rem;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
}

.contact-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 620px;
  margin: 0 auto 2rem auto;
  line-height: 1.6;
}

.contact-social-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.25rem;
  margin: 1.5rem 0 1rem 0;
}

.social-icon-btn {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--contact-item-bg);
  border: 1px solid var(--border);
  color: var(--text-dark);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.social-icon-btn:hover {
  transform: translateY(-4px);
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(13, 110, 79, 0.35);
}

.social-icon-btn svg {
  transition: transform 0.2s ease;
}

.social-icon-btn:hover svg {
  transform: scale(1.1);
}

/* Contact Details List */
.contact-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin: 2rem 0;
  text-align: left;
}

.contact-detail-item {
  background: var(--contact-item-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  transition: border-color 0.2s ease;
}

.contact-detail-item:hover {
  border-color: var(--accent);
}

.contact-detail-item h4 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.contact-detail-item p,
.contact-detail-item a {
  color: var(--text-dark);
  font-weight: 500;
  font-size: 0.92rem;
  text-decoration: none;
}

.contact-detail-item a:hover {
  color: var(--accent);
}

/* Footer */
.footer {
  padding: 2.75rem 0 2.25rem 0;
  border-top: 1px solid var(--border);
  margin-top: 3.5rem;
  text-align: center;
  transition: border-color 0.25s ease;
}

.footer-copyright {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0.6rem;
  letter-spacing: 0.02em;
}

.footer-caption {
  font-family: 'Lora', Georgia, serif;
  font-size: 0.92rem;
  font-style: italic;
  color: var(--text-muted);
  max-width: 650px;
  margin: 0 auto;
  line-height: 1.6;
}

.footer-nav {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.footer-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

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

/* Floating Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--card-bg);
  color: var(--text-dark);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 99;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(13, 110, 79, 0.35);
}

.back-to-top svg {
  transition: transform 0.2s ease;
}

.back-to-top:hover svg {
  transform: translateY(-2px);
}

/* Scroll Reveal */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1), transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-on-scroll.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* 404 Page */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 2rem;
  min-height: 60vh;
}

.error-code {
  font-family: 'Lora', Georgia, serif;
  font-size: 6rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.5rem;
  letter-spacing: -0.04em;
}

.error-page h1 {
  font-family: 'Lora', Georgia, serif;
  font-size: 1.8rem;
  color: var(--text-dark);
  margin-bottom: 0.75rem;
}

.error-page p {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 480px;
  margin: 0 auto 2rem auto;
  line-height: 1.6;
}

.error-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* ===================================================
   Mobile Screen Friendly & Responsive Styles
   =================================================== */

@media (max-width: 768px) {
  header {
    padding: 0.85rem 0;
    position: static;
  }

  .header-content {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    position: relative;
    gap: 0.5rem;
  }

  .name-title h2 {
    font-size: 1.15rem;
    line-height: 1.2;
  }

  .name-title p {
    font-size: 0.74rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
  }

  .nav-actions {
    position: static;
    display: flex;
    align-items: center;
    gap: 0.65rem;
  }

  .mobile-menu-btn {
    display: inline-flex;
  }

  nav {
    position: absolute;
    top: calc(100% + 0.85rem);
    left: 0;
    right: 0;
    background: var(--header-bg);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    padding: 1rem 1.25rem 1.25rem 1.25rem;
    flex-direction: column;
    gap: 0.45rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s ease;
    z-index: 999;
    pointer-events: none;
  }

  .nav-actions.is-open nav {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
  }

  nav a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-radius: 9px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark);
    background: var(--card-bg);
    border: 1px solid var(--border);
    width: 100%;
    min-height: 46px;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, color 0.2s ease;
  }

  nav a:hover,
  nav a:active {
    background: var(--pill-bg);
    border-color: var(--accent);
    transform: translateX(3px);
  }

  nav a.active {
    color: var(--accent);
    background: var(--pill-dev-bg);
    border-color: rgba(16, 185, 129, 0.35);
    font-weight: 700;
  }

  nav a.active::after {
    display: none;
  }

  /* Hero on Mobile */
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 1.75rem;
    padding: 2rem 0 1.5rem 0;
  }

  .hero h1 {
    font-size: clamp(1.65rem, 6vw, 2.3rem);
    line-height: 1.25;
  }

  .hero p.bio {
    font-size: 0.96rem;
    line-height: 1.65;
    margin: 0 auto 1.5rem auto;
  }

  .hero-photo-container {
    margin: 0 auto;
    width: 190px;
    height: 190px;
  }

  .hero-photo-curved {
    width: 150px;
    height: 150px;
  }

  .avatar-canvas {
    width: 190px;
    height: 190px;
  }

  .hero-btn-group {
    justify-content: center;
    gap: 0.75rem;
  }

  .live-status-pill {
    margin: 0 auto 1rem auto;
    max-width: 100%;
    white-space: normal;
    text-align: center;
    font-size: 0.76rem;
  }

  .two-track-badge {
    margin: 0 auto 1.25rem auto;
    max-width: 100%;
    flex-wrap: wrap;
    justify-content: center;
    font-size: 0.78rem;
  }

  /* Grids & Boxes */
  .grid-2 {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    margin: 1.75rem 0;
  }

  .section-box {
    padding: 1.4rem 1.15rem;
    border-radius: 12px;
  }

  .section-box h3 {
    font-size: 1.28rem;
  }

  .pill {
    font-size: 0.8rem;
    padding: 0.28rem 0.65rem;
  }

  /* About */
  .about-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 1.5rem;
    margin-bottom: 1.75rem;
  }

  .about-photo {
    margin: 0 auto;
    width: 150px;
    height: 150px;
  }

  .about-text {
    text-align: left;
  }

  .info-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 1.5rem;
  }

  .info-card {
    padding: 1.2rem 1rem;
  }

  /* Teaching */
  .curriculum-accordion {
    gap: 0.5rem;
  }

  .accordion-header {
    padding: 0.85rem;
    min-height: 48px;
    font-size: 0.85rem;
  }

  .accordion-title-group {
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  .accordion-body {
    font-size: 0.82rem;
  }

  /* Contact */
  .contact-card {
    padding: 1.75rem 1.15rem;
  }

  .contact-details {
    grid-template-columns: 1fr;
    gap: 1rem;
    margin: 1.5rem 0;
  }

  .contact-detail-item {
    padding: 1.1rem;
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  .contact-social-row {
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
  }

  .social-icon-btn {
    width: 48px;
    height: 48px;
    border-radius: 12px;
  }

  /* Subpages Header */
  .page-header {
    padding: 1.75rem 0 1.25rem 0;
    margin-bottom: 1.5rem;
  }

  .page-header h1 {
    font-size: clamp(1.6rem, 5.5vw, 2rem);
  }

  .page-header p {
    font-size: 0.95rem;
  }

  .link-cards {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  /* Floating Back to Top Button */
  .back-to-top {
    bottom: 1.15rem;
    right: 1.15rem;
    width: 42px;
    height: 42px;
  }

  /* 404 */
  .error-page {
    padding: 3.5rem 1rem;
    min-height: 50vh;
  }

  .error-code {
    font-size: clamp(4rem, 16vw, 5.5rem);
  }

  .error-page h1 {
    font-size: 1.55rem;
  }

  .error-links {
    flex-direction: column;
    width: 100%;
    max-width: 320px;
    margin: 0 auto 2rem auto;
    gap: 0.75rem;
  }

  .error-links .btn {
    width: 100%;
  }

  /* Footer */
  .footer {
    padding: 2rem 0 1.5rem 0;
    margin-top: 2.5rem;
  }

  .footer-nav {
    gap: 0.85rem;
  }
}

/* Extra Small Mobile Devices (e.g. iPhone SE, 360px - 480px width) */
@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }

  .name-title p {
    display: none;
  }

  .name-title h2 {
    font-size: 1.08rem;
  }

  #theme-text {
    display: none;
  }

  .theme-toggle-btn {
    padding: 6px;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    justify-content: center;
  }

  .hero-btn-group {
    flex-direction: column;
    width: 100%;
  }

  .hero-btn-group .btn {
    width: 100%;
    padding: 0.75rem 1.15rem;
    font-size: 0.92rem;
  }

  .section-box {
    padding: 1.25rem 0.95rem;
  }

  .contact-card {
    padding: 1.5rem 0.95rem;
  }

  .social-icon-btn {
    width: 44px;
    height: 44px;
  }

  .social-icon-btn svg {
    width: 20px;
    height: 20px;
  }

  .breadcrumbs ol {
    font-size: 0.78rem;
  }
}
