/* ============================================================
   NABIN CHAULAGAIN — PORTFOLIO
   Premium design: Spectral / IBM Plex Sans · Cream + Crimson
   ============================================================ */

/* ── 1. RESET & ROOT VARIABLES ─────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #f6f4ef;
  --bg-tint:     #eeebe3;
  --bg-dark:     #1a1714;
  --text:        #29261b;
  --text-sec:    #5c5848;
  --text-muted:  #8a8474;
  --accent:      #b5372e;
  --accent-soft: #f9ede9;
  --border:      rgba(41,38,27,.12);
  --border-med:  rgba(41,38,27,.2);
  --heading-font:'Spectral', Georgia, serif;
  --body-font:   'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --mono-font:   'IBM Plex Mono', 'Courier New', monospace;
  --radius:      6px;
  --radius-lg:   12px;
  --shadow-sm:   0 1px 3px rgba(41,38,27,.08);
  --shadow-md:   0 4px 16px rgba(41,38,27,.1);
  --shadow-lg:   0 12px 40px rgba(41,38,27,.14);
  --transition:  .2s ease;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--body-font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font-family: inherit; cursor: pointer; }

/* ── 2. LAYOUT ──────────────────────────────────────────────── */
.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── 3. HEADER ──────────────────────────────────────────────── */
.site-head {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.site-head.scrolled {
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.head-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 24px;
}

/* ── 4. BRAND ───────────────────────────────────────────────── */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-mark {
  width: 38px;
  height: 38px;
  background: var(--accent);
  color: #fff;
  font-family: var(--heading-font);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .5px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.brand-role {
  font-size: 11.5px;
  color: var(--text-muted);
}

/* ── 5. NAV ─────────────────────────────────────────────────── */
.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-sec);
  padding: 6px 12px;
  border-radius: var(--radius);
  transition: color var(--transition), background var(--transition);
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--text);
  background: var(--bg-tint);
}

.nav-link.is-active {
  color: var(--accent);
}

/* ── 6. HERO ────────────────────────────────────────────────── */
.hero {
  padding: 88px 0 64px;
  overflow: hidden;
  position: relative;
}

/* subtle diagonal texture behind hero */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    -55deg,
    transparent,
    transparent 40px,
    rgba(181,55,46,.025) 40px,
    rgba(181,55,46,.025) 41px
  );
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 72px;
  align-items: start;
  position: relative;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 5px 14px;
  border-radius: 20px;
  width: fit-content;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.flag-dot {
  width: 7px;
  height: 7px;
  background: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}

.hero-name {
  font-family: var(--heading-font);
  font-size: clamp(44px, 5.5vw, 68px);
  font-weight: 700;
  line-height: 1.05;
  color: var(--text);
  letter-spacing: -.025em;
}

.hero-name-np {
  display: block;
  font-size: clamp(20px, 2.5vw, 28px);
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 6px;
  letter-spacing: 0;
}

.hero-role {
  font-size: 17px;
  color: var(--text-sec);
  font-weight: 500;
  margin-top: -6px;
  line-height: 1.5;
}

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

.hero-tagline {
  font-size: 15.5px;
  color: var(--text-sec);
  max-width: 520px;
  line-height: 1.65;
}

/* Badge groups with label */
.hero-badge-groups {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hero-badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.hero-badge-rowlabel {
  font-family: var(--mono-font);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  min-width: 80px;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.hero-badge {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-sec);
  background: var(--bg-tint);
  border: 1px solid var(--border);
  padding: 4px 11px;
  border-radius: 20px;
  transition: border-color .15s, color .15s;
}

.hero-badge:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
  align-items: center;
}

/* ── 7. BUTTONS ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: var(--radius);
  border: 2px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}

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

.btn-primary:hover {
  background: #9e2e26;
  border-color: #9e2e26;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(181,55,46,.35);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-med);
}

.btn-ghost:hover {
  background: var(--bg-tint);
  border-color: var(--text-muted);
  transform: translateY(-1px);
}

.btn-block { width: 100%; justify-content: center; }

/* ── 8. HERO SOCIALS ────────────────────────────────────────── */
.hero-socials {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.social {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--text-sec);
  padding: 7px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: all var(--transition);
  text-decoration: none;
  background: var(--bg);
}

.social:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(181,55,46,.12);
}

.social-abbr {
  font-family: var(--mono-font);
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 6px;
  border-radius: 3px;
  letter-spacing: .04em;
}

.social-label { font-weight: 500; }

/* ── 9. HERO PORTRAIT ───────────────────────────────────────── */
.hero-portrait {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
}

/* decorative accent corner */
.hero-portrait::before {
  content: '';
  position: absolute;
  top: -12px;
  right: -12px;
  width: 80px;
  height: 80px;
  border-top: 3px solid var(--accent);
  border-right: 3px solid var(--accent);
  border-radius: 0 var(--radius-lg) 0 0;
  opacity: .5;
  pointer-events: none;
}

.hero-portrait::after {
  content: '';
  position: absolute;
  bottom: 28px;
  left: -12px;
  width: 60px;
  height: 60px;
  border-bottom: 3px solid var(--accent);
  border-left: 3px solid var(--accent);
  border-radius: 0 0 0 var(--radius-lg);
  opacity: .3;
  pointer-events: none;
}

.portrait {
  aspect-ratio: 3/4;
  background: linear-gradient(145deg, var(--bg-tint) 0%, #e8e4da 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 20px 60px rgba(41,38,27,.1), 0 4px 16px rgba(41,38,27,.06);
}

.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: var(--radius-lg);
}

.portrait-has-photo {
  background: var(--bg-tint);
}

.portrait-stripes {
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 8px,
    rgba(41,38,27,.03) 8px,
    rgba(41,38,27,.03) 16px
  );
}

.portrait-note {
  position: relative;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: .1em;
  text-transform: uppercase;
}

.hero-portrait-caption {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-muted);
  padding: 0 4px;
}

.hero-portrait-np {
  font-size: 13px;
  color: var(--text-sec);
  font-weight: 500;
}

.hero-portrait-location {
  display: flex;
  align-items: center;
  gap: 4px;
}

.hero-portrait-location::before {
  content: '📍';
  font-size: 12px;
}

/* ── 10. HERO STATS ─────────────────────────────────────────── */
.hero-stats {
  display: flex;
  gap: 0;
  margin-top: 56px;
  border-top: 1px solid var(--border);
  padding-top: 32px;
}

.stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-right: 32px;
  border-right: 1px solid var(--border);
}

.stat:last-child {
  border-right: none;
  padding-right: 0;
  padding-left: 32px;
}

.stat:not(:first-child):not(:last-child) {
  padding-left: 32px;
}

.stat-value {
  font-family: var(--heading-font);
  font-size: 40px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  letter-spacing: -.02em;
}

.stat-label {
  font-size: 13px;
  color: var(--text-muted);
}

/* ── 11. SECTION LABELS ─────────────────────────────────────── */
.sec-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}

.sec-label-no {
  font-family: var(--mono-font);
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: .08em;
}

.sec-label-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .12em;
}

/* ── 12. SECTIONS ───────────────────────────────────────────── */
.section {
  padding: 96px 0;
}

.section-tint {
  background: var(--bg-tint);
}

.section-dark {
  background: var(--bg-dark);
  color: #e8e4d8;
}

.section-dark .sec-label-no {
  background: rgba(181,55,46,.3);
  color: #e8a09b;
}

.section-dark .sec-label-text {
  color: rgba(232,228,216,.5);
}

.section-dark .section-title {
  color: #f0ede4;
}

.section-dark .prose {
  color: rgba(232,228,216,.75);
}

.section-title {
  font-family: var(--heading-font);
  font-size: clamp(28px, 3.5vw, 42px);
  font-weight: 600;
  line-height: 1.15;
  color: var(--text);
  letter-spacing: -.01em;
  margin-bottom: 24px;
}

/* ── 13. PROSE ──────────────────────────────────────────────── */
.prose {
  font-size: 16px;
  line-height: 1.75;
  color: var(--text-sec);
  max-width: 68ch;
  margin-bottom: 16px;
}

.prose:last-child { margin-bottom: 0; }

.prose-lead {
  font-size: 18px;
  color: var(--text-sec);
  font-weight: 400;
}

/* ── 14. CHIPS ──────────────────────────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-sec);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 20px;
  margin: 3px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 20px;
}

/* ── 15. ABOUT ──────────────────────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 64px;
  align-items: start;
}

.about-bio { }

.about-side { }

.side-title {
  font-family: var(--heading-font);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

/* ── 16. TIMELINE ───────────────────────────────────────────── */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.timeline-item {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 12px;
  align-items: baseline;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

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

.timeline-year {
  font-family: var(--mono-font);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}

.timeline-text {
  font-size: 14px;
  color: var(--text-sec);
  line-height: 1.5;
}

/* ── 17. VISION ─────────────────────────────────────────────── */
.vision-head {
  max-width: 640px;
  margin-bottom: 48px;
}

.pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.pillar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 28px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: box-shadow var(--transition), transform var(--transition);
}

.pillar:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.pillar-no {
  font-family: var(--heading-font);
  font-size: 48px;
  font-weight: 700;
  color: var(--accent);
  opacity: .25;
  line-height: 1;
}

.pillar-title {
  font-family: var(--heading-font);
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.pillar-body {
  font-size: 14px;
  color: var(--text-sec);
  line-height: 1.65;
}

/* ── 18. INITIATIVES ────────────────────────────────────────── */
.init-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.init-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow .2s, border-color .2s, transform .2s;
  position: relative;
  overflow: hidden;
}

.init-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s ease;
}

.init-card:hover {
  box-shadow: 0 8px 32px rgba(0,0,0,.08);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.init-card:hover::before {
  transform: scaleX(1);
}

.init-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.init-tag {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .1em;
}

.init-period {
  font-family: var(--mono-font);
  font-size: 12px;
  color: var(--text-muted);
}

.init-title {
  font-family: var(--heading-font);
  font-size: 19px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  margin: 0;
}

.init-body {
  font-size: 14px;
  color: var(--text-sec);
  line-height: 1.65;
  flex: 1;
}

.init-impact {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.init-impact-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .init-grid { grid-template-columns: 1fr; }
}

/* ── 19. SKILLS ─────────────────────────────────────────────── */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}

.skill-col { }

.skill-group {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.skill-row {
  margin-bottom: 14px;
}

.skill-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 5px;
}

.skill-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.skill-pct {
  font-family: var(--mono-font);
  font-size: 11px;
  color: var(--text-muted);
}

.skill-track {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.skill-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width .8s cubic-bezier(.4,0,.2,1);
}

/* ── 20. EXPERIENCE ─────────────────────────────────────────── */
.xp-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.xp {
  display: flex;
  gap: 0;
}

.xp-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 40px;
  flex-shrink: 0;
  padding-top: 6px;
}

.xp-dot {
  width: 12px;
  height: 12px;
  background: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
  z-index: 1;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.xp-line {
  flex: 1;
  width: 1px;
  background: var(--border-med);
  margin-top: 4px;
}

.xp:last-child .xp-line { display: none; }

.xp-card {
  flex: 1;
  padding: 0 0 40px 16px;
}

.xp-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.xp-role {
  font-family: var(--heading-font);
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
}

.xp-period {
  font-family: var(--mono-font);
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.xp-org {
  font-size: 15px;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 4px;
}

.xp-loc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.xp-points {
  margin-top: 12px;
  padding-left: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.xp-points li {
  font-size: 14px;
  color: var(--text-sec);
  line-height: 1.6;
  padding-left: 16px;
  position: relative;
}

.xp-points li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 12px;
}

/* ── 21. PROJECTS ───────────────────────────────────────────── */
.proj-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.proj {
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow var(--transition), transform var(--transition);
}

.proj:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.proj-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.proj-title {
  font-family: var(--heading-font);
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.25;
}

.proj-year {
  font-family: var(--mono-font);
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  padding-top: 4px;
}

.proj-role {
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 9px;
  border-radius: 20px;
  width: fit-content;
}

.proj-body {
  font-size: 14px;
  color: var(--text-sec);
  line-height: 1.6;
  flex: 1;
}

.proj-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.tag-dot {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-sec);
  background: var(--bg-tint);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.tag-dot::before {
  content: '';
  width: 5px;
  height: 5px;
  background: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
}

.proj-link {
  font-size: 13px;
  color: var(--text-muted);
  font-family: var(--mono-font);
  margin-top: 4px;
  word-break: break-all;
}

/* ── 22. GITHUB ─────────────────────────────────────────────── */
.gh-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-bottom: 40px;
}

.gh-stat {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
}

.gh-stat-val {
  font-family: var(--heading-font);
  font-size: 36px;
  font-weight: 700;
  color: var(--text);
  display: block;
  line-height: 1;
  letter-spacing: -.02em;
}

.gh-stat-lbl {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
  display: block;
}

.gh-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 24px;
}

.gh-panel-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gh-panel-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.gh-panel-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.gh-graph-wrap {
  padding: 16px 20px;
  overflow-x: auto;
}

.gh-months {
  display: flex;
  gap: 4px;
  padding-left: 16px;
  margin-bottom: 6px;
}

.gh-months span {
  flex: 1;
  font-family: var(--mono-font);
  font-size: 10px;
  color: var(--text-muted);
}

.gh-grid {
  display: flex;
  gap: 3px;
}

.gh-week {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.gh-cell {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--border);
}

.gh-l0 { background: var(--bg-tint); }
.gh-l1 { background: #f7c5c2; }
.gh-l2 { background: #e8837c; }
.gh-l3 { background: #cc4c45; }
.gh-l4 { background: var(--accent); }

.gh-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 11px;
  color: var(--text-muted);
  justify-content: flex-end;
}

.gh-lang-bar {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 12px;
}

.gh-lang-seg {
  height: 100%;
  transition: flex var(--transition);
}

.gh-lang-seg-0 { background: var(--accent); }
.gh-lang-seg-1 { background: #e8837c; }
.gh-lang-seg-2 { background: #6d9eeb; }
.gh-lang-seg-3 { background: #f6b26b; }
.gh-lang-seg-4 { background: #93c47d; }

.gh-lang-keys {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.gh-lang-key {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-sec);
}

.gh-lang-chip {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* ── 23. SERVICES ───────────────────────────────────────────── */
.svc-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}

.svc {
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-tint);
  transition: box-shadow var(--transition);
}

.svc:hover {
  box-shadow: var(--shadow-md);
}

.svc-no {
  font-family: var(--heading-font);
  font-size: 56px;
  font-weight: 700;
  color: var(--accent);
  opacity: .18;
  line-height: 1;
  display: block;
  margin-bottom: 16px;
}

.svc-title {
  font-family: var(--heading-font);
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
}

.svc-body {
  font-size: 15px;
  color: var(--text-sec);
  line-height: 1.65;
}

/* ── 24. WRITING / BLOG ─────────────────────────────────────── */
.writing-head {
  max-width: 640px;
  margin-bottom: 40px;
}

.post-feat {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  margin-bottom: 36px;
  transition: box-shadow var(--transition);
}

.post-feat:hover {
  box-shadow: var(--shadow-lg);
}

.post-feat-media {
  background: var(--bg-tint);
  position: relative;
  overflow: hidden;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
}

.post-stripes {
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    135deg,
    transparent,
    transparent 8px,
    rgba(41,38,27,.05) 8px,
    rgba(41,38,27,.05) 16px
  );
}

.post-cat {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .08em;
  width: fit-content;
}

.post-cat-onmedia {
  position: relative;
  z-index: 1;
  background: rgba(255,255,255,.9);
}

.post-feat-body {
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.post-meta {
  font-family: var(--mono-font);
  font-size: 12px;
  color: var(--text-muted);
}

.post-feat-title {
  font-family: var(--heading-font);
  font-size: 26px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.25;
}

.post-excerpt {
  font-size: 15px;
  color: var(--text-sec);
  line-height: 1.6;
  flex: 1;
}

.post-more {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}

/* Post slider */
.slider-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.slider-title {
  font-family: var(--heading-font);
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
}

.slider-nav {
  display: flex;
  gap: 8px;
}

.slider-arrow {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 16px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all var(--transition);
}

.slider-arrow:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.post-slider {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 12px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.post-slider::-webkit-scrollbar { height: 4px; }
.post-slider::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.post-card {
  flex-shrink: 0;
  width: 280px;
  scroll-snap-align: start;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-decoration: none;
  transition: box-shadow var(--transition), transform var(--transition);
}

.post-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.post-card-title {
  font-family: var(--heading-font);
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  flex: 1;
}

.post-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}

/* ── 25. READER OVERLAY ─────────────────────────────────────── */
.reader-scrim {
  position: fixed;
  inset: 0;
  background: rgba(26,23,20,.7);
  z-index: 70;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(4px);
}

.reader-scrim.open { display: flex; }

.reader {
  background: var(--bg);
  border-radius: var(--radius-lg);
  max-width: 680px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 40px;
  position: relative;
  box-shadow: var(--shadow-lg);
}

.reader-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 16px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.reader-inner { }

.reader-title {
  font-family: var(--heading-font);
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}

.reader-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.reader-byline {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-sec);
  margin-bottom: 20px;
}

.reader-rule {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

.reader-para {
  font-size: 16px;
  color: var(--text-sec);
  line-height: 1.75;
  margin-bottom: 16px;
}

.reader-foot {
  font-size: 13px;
  color: var(--text-muted);
  padding-top: 20px;
  border-top: 1px solid var(--border);
  margin-top: 20px;
}

/* ── 26. PUBLICATIONS ───────────────────────────────────────── */
.res-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  counter-reset: pub-counter;
}

.res-item {
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
  position: relative;
  padding-left: 48px;
}

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

.res-item::before {
  counter-increment: pub-counter;
  content: counter(pub-counter, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 28px;
  font-family: var(--mono-font);
  font-size: 11px;
  color: var(--accent);
}

.res-meta {
  margin-bottom: 6px;
}

.res-venue {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 9px;
  border-radius: 20px;
}

.res-title {
  font-family: var(--heading-font);
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.3;
}

.res-authors {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.res-abstract {
  font-size: 14px;
  color: var(--text-sec);
  line-height: 1.6;
  max-width: 72ch;
}

/* ── 27. LIBRARY ────────────────────────────────────────────── */
.lib-sub {
  font-family: var(--heading-font);
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin: 40px 0 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.lib-sub:first-of-type { margin-top: 0; }

.lib-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.lib-tab {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 10px 16px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}

.lib-tab.active,
.lib-tab:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.books-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.book-item {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}

.book-title {
  font-family: var(--heading-font);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.book-author {
  font-size: 12px;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 8px;
}

.book-note {
  font-size: 13px;
  color: var(--text-sec);
  line-height: 1.55;
}

.bm-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.bm-item {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-decoration: none;
  transition: all var(--transition);
}

.bm-item:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.bm-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.3;
}

.bm-host {
  font-family: var(--mono-font);
  font-size: 11px;
  color: var(--text-muted);
}

.bm-cat {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 8px;
  border-radius: 10px;
  width: fit-content;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.tool-item {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}

.tool-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.tool-use {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ── 28. GALLERY ────────────────────────────────────────────── */
/* Service card video link */
.svc-video-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}
.svc-video-link:hover { color: #9e2e26; text-decoration: underline; }
.svc-video-icon {
  width: 22px; height: 22px;
  background: var(--accent); color: #fff;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; padding-left: 2px;
}

/* ── FEATURED VIDEO (hero area) ──────────────────────────────── */
.featured-video {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 32px;
  align-items: center;
}

.featured-video-label {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.featured-video-tag {
  font-family: var(--mono-font);
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .1em;
  width: fit-content;
}

.featured-video-title {
  font-family: var(--heading-font);
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
}

.featured-video-more {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  margin-top: 4px;
}

.featured-video-more:hover { text-decoration: underline; }

.featured-video-frame {
  aspect-ratio: 16/9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: #000;
}

.featured-video-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

@media (max-width: 768px) {
  .featured-video { grid-template-columns: 1fr; gap: 16px; padding-top: 24px; margin-top: 32px; }
}

/* filter tabs */
.gal-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.gal-tab {
  background: none;
  border: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 10px 16px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .15s, border-color .15s;
}

.gal-tab:hover { color: var(--text); }

.gal-tab.is-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.gal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

/* video badge (top-left, distinguishes videos from photos) */
.gal-type-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(181,55,46,.95);
  padding: 3px 8px;
  border-radius: 4px;
  pointer-events: none;
}

/* Play-button overlay shown on top of YouTube thumbnail */
.gal-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.25);
  z-index: 2;
  pointer-events: none;
  transition: background .2s;
}

.gal-video-wrap:hover .gal-play-overlay {
  background: rgba(0,0,0,.45);
}

/* Video card poster — used when no thumbnail image is provided */
.gal-video-poster {
  width: 100%;
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, #2a2419 0%, #1a1714 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.gal-video-poster::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 20%, rgba(181,55,46,.2) 0%, transparent 50%),
    radial-gradient(circle at 70% 80%, rgba(181,55,46,.15) 0%, transparent 50%);
}

.gal-video-play {
  width: 64px;
  height: 64px;
  background: rgba(181,55,46,.95);
  border: 3px solid rgba(255,255,255,.9);
  border-radius: 50%;
  color: #fff;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 6px;
  z-index: 1;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  transition: transform .2s;
}

.gal-video-wrap:hover .gal-video-play {
  transform: scale(1.1);
}

/* lightbox video container */
.lb-media { width: 100%; }
.lb-video { display: none; width: 100%; aspect-ratio: 16/9; }
.lb-video iframe {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: var(--radius-lg);
  background: #000;
}

.gal-item {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg);
  transition: box-shadow .2s, transform .2s;
}

.gal-item:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* image wrapper */
.gal-img-wrap {
  position: relative;
  cursor: zoom-in;
  overflow: hidden;
  display: block;
}

.gal-img-wrap img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
  transition: transform .4s ease;
}

.gal-img-wrap:hover img {
  transform: scale(1.06);
}

/* small zoom badge in corner — always visible */
.gal-overlay {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 6px;
  z-index: 2;
  pointer-events: none;
}

.gal-zoom, .gal-link-icon {
  width: 32px;
  height: 32px;
  background: rgba(0,0,0,.55);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 50%;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  transition: background .2s, transform .2s;
}

.gal-img-wrap:hover .gal-zoom,
.gal-img-wrap:hover .gal-link-icon {
  background: var(--accent);
  transform: scale(1.05);
}

.gal-video .video-embed {
  aspect-ratio: 16/9;
  position: relative;
}

.gal-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* caption bar */
.gal-cap {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gal-cap-title {
  font-family: var(--heading-font);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.gal-cap-text {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.gal-cap-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  margin-top: 4px;
  width: fit-content;
  transition: color .15s;
}

.gal-cap-link:hover { color: #9e2e26; text-decoration: underline; }

/* ── LIGHTBOX ────────────────────────────────────────────────── */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(14,12,10,.94);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.lightbox.lb-open { display: flex; }

.lb-inner {
  max-width: 900px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
}

.lb-img {
  width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 80px rgba(0,0,0,.6);
  display: block;
}

.lb-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.lb-title {
  font-family: var(--heading-font);
  font-size: 16px;
  font-weight: 600;
  color: rgba(255,255,255,.9);
}

.lb-caption {
  font-size: 13px;
  color: rgba(255,255,255,.55);
  flex: 1;
}

.lb-link {
  display: none;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  padding: 7px 16px;
  border-radius: 20px;
  text-decoration: none;
  transition: background .15s;
  white-space: nowrap;
}

.lb-link:hover { background: #9e2e26; }

/* nav buttons — only visible when lightbox is open */
.lb-close, .lb-prev, .lb-next {
  display: none;
  position: fixed;
  background: rgba(255,255,255,.12);
  border: 1.5px solid rgba(255,255,255,.25);
  color: #fff;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .2s;
  font-size: 22px;
  line-height: 1;
  padding: 0;
  font-family: inherit;
  backdrop-filter: blur(4px);
}

.lightbox.lb-open .lb-close,
.lightbox.lb-open .lb-prev,
.lightbox.lb-open .lb-next {
  display: flex;
}

.lb-close:hover, .lb-prev:hover, .lb-next:hover {
  background: rgba(181,55,46,.85);
}

.lb-close { top: 20px; right: 20px; font-size: 26px; }
.lb-prev  { left: 16px;  top: 50%; margin-top: -24px; }
.lb-next  { right: 16px; top: 50%; margin-top: -24px; }

@media (max-width: 768px) {
  .lb-prev { left: 8px; width: 40px; height: 40px; margin-top: -20px; }
  .lb-next { right: 8px; width: 40px; height: 40px; margin-top: -20px; }
  .lb-close { top: 12px; right: 12px; width: 40px; height: 40px; }
  .lb-img { max-height: 60vh; }
  .lightbox { padding: 12px; }

  /* shrink badge icons on mobile */
  .gal-overlay { top: 8px; right: 8px; }
  .gal-zoom, .gal-link-icon { width: 28px; height: 28px; font-size: 12px; }
}

/* ── 29. TESTIMONIALS ───────────────────────────────────────── */
.tm-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.tm {
  padding: 28px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tm-quote-mark {
  font-family: var(--heading-font);
  font-size: 48px;
  font-weight: 700;
  color: var(--accent);
  opacity: .3;
  line-height: .8;
  display: block;
}

.tm-quote {
  font-family: var(--heading-font);
  font-size: 15px;
  color: var(--text);
  line-height: 1.65;
  font-style: italic;
  quotes: none;
  flex: 1;
}

.tm-cap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.tm-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  display: block;
}

.tm-role {
  font-size: 12px;
  color: var(--text-muted);
  display: block;
}

/* ── 30. EDUCATION ──────────────────────────────────────────── */
.edu-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 64px;
}

.edu-sub {
  font-family: var(--heading-font);
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.edu-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.edu-item {
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}

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

.edu-degree {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.edu-school {
  font-size: 14px;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 3px;
}

.edu-period {
  font-family: var(--mono-font);
  font-size: 12px;
  color: var(--text-muted);
}

.cert-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cert-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--text-sec);
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  line-height: 1.5;
}

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

.cert-tick {
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── 31. PRESS ──────────────────────────────────────────────── */
.press-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.press-item {
  display: grid;
  grid-template-columns: 180px 1fr 100px;
  gap: 16px;
  align-items: baseline;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}

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

.press-outlet {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 10px;
  border-radius: 20px;
  width: fit-content;
}

.press-title {
  font-size: 15px;
  color: var(--text);
  line-height: 1.4;
}

.press-date {
  font-family: var(--mono-font);
  font-size: 12px;
  color: var(--text-muted);
  text-align: right;
}

/* ── 32. CONTACT ────────────────────────────────────────────── */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
}

.contact-copy { }

.contact-details {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.contact-details li {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cd-label {
  font-size: 11px;
  font-weight: 600;
  color: rgba(232,228,216,.4);
  text-transform: uppercase;
  letter-spacing: .1em;
  display: block;
}

.contact-details li > :not(.cd-label) {
  font-size: 15px;
  color: rgba(232,228,216,.8);
  word-break: break-word;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field span {
  font-size: 13px;
  font-weight: 500;
  color: rgba(232,228,216,.65);
}

.field input,
.field textarea {
  font-family: var(--body-font);
  font-size: 15px;
  color: #f0ede4;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: var(--radius);
  padding: 12px 16px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
  color: rgba(232,228,216,.3);
}

.field input:focus,
.field textarea:focus {
  border-color: rgba(181,55,46,.6);
  box-shadow: 0 0 0 3px rgba(181,55,46,.15);
}

.form-sent {
  text-align: center;
  padding: 40px;
  color: rgba(232,228,216,.8);
  font-size: 16px;
}

/* ── 33. FOOTER ─────────────────────────────────────────────── */
.site-foot {
  background: var(--bg-dark);
  color: rgba(232,228,216,.6);
  padding: 40px 0 32px;
  border-top: 1px solid rgba(255,255,255,.06);
}

.foot-tagline {
  font-size: 14px;
  font-weight: 500;
  color: rgba(232,228,216,.55);
  letter-spacing: .01em;
  padding-bottom: 20px;
}

.foot-rule {
  height: 1px;
  background: rgba(255,255,255,.08);
  margin-bottom: 20px;
}

.foot-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.foot-socials {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.foot-social {
  font-size: 12.5px;
  font-weight: 500;
  color: rgba(232,228,216,.45);
  padding: 5px 11px;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,.08);
  transition: all var(--transition);
  text-decoration: none;
}

.foot-social:hover {
  color: rgba(232,228,216,.9);
  border-color: rgba(255,255,255,.25);
  background: rgba(255,255,255,.04);
}

.foot-note {
  font-size: 12px;
  color: rgba(232,228,216,.28);
}

/* ── 34. CHAT WIDGET ────────────────────────────────────────── */
@keyframes fabPulse {
  0% { box-shadow: 0 0 0 0 rgba(181,55,46,.45); }
  70% { box-shadow: 0 0 0 14px rgba(181,55,46,0); }
  100% { box-shadow: 0 0 0 0 rgba(181,55,46,0); }
}

@keyframes panelIn {
  from { opacity: 0; transform: scale(.92) translateY(12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes panelOut {
  from { opacity: 1; transform: scale(1) translateY(0); }
  to   { opacity: 0; transform: scale(.92) translateY(12px); }
}

@keyframes msgIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes dot {
  0%, 80%, 100% { transform: scale(.7); opacity: .4; }
  40% { transform: scale(1); opacity: 1; }
}

.chat-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 60;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), #8b2820);
  box-shadow: 0 12px 30px -8px rgba(181,55,46,.5);
  transition: transform .18s;
}

.chat-fab:hover { transform: translateY(-2px) scale(1.05); }
.chat-fab.fab-active { display: none; }

.fab-icon { font-size: 25px; line-height: 1; }

.fab-pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  animation: fabPulse 2.4s infinite;
}

.chat-panel {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 61;
  width: 390px;
  max-width: calc(100vw - 32px);
  height: 580px;
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 30px 70px -18px rgba(26,23,20,.35);
  transform-origin: bottom right;
}

.chat-panel[hidden] { display: none !important; }
.chat-panel.opening { animation: panelIn .22s cubic-bezier(.4,0,.2,1) both; }
.chat-panel.closing { animation: panelOut .2s cubic-bezier(.4,0,.2,1) forwards; }

.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #8b2820);
}

.chat-head-id { display: flex; align-items: center; gap: 11px; }

.chat-head .avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,.22);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: .5px;
}

.chat-head strong { display: block; font-size: 15px; }

.chat-head .status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  opacity: .9;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 3px rgba(74,222,128,.3);
}

.chat-head-actions { display: flex; align-items: center; gap: 7px; }

.chat-min, .chat-close {
  background: rgba(255,255,255,.18);
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  line-height: 1;
  display: grid;
  place-items: center;
}

.chat-min:hover, .chat-close:hover { background: rgba(255,255,255,.34); }
.chat-min { font-size: 18px; font-weight: 700; }

.chat-panel.minimized { height: auto; }
.chat-panel.minimized .chat-head { cursor: pointer; }
.chat-panel.minimized .chat-log,
.chat-panel.minimized .chat-suggest,
.chat-panel.minimized .chat-input,
.chat-panel.minimized .chat-foot { display: none; }
.chat-panel.minimized .chat-min { transform: rotate(90deg); }

.chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg-tint);
}

.msg {
  padding: 11px 14px;
  border-radius: 14px;
  font-size: 14.5px;
  line-height: 1.55;
  max-width: 86%;
  white-space: pre-line;
  animation: msgIn .25s ease;
  box-shadow: 0 1px 2px rgba(41,38,27,.06);
}

.msg.bot {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.msg.user {
  background: linear-gradient(135deg, var(--accent), #8b2820);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.msg strong { font-weight: 700; }

.msg.typing { display: flex; gap: 4px; align-items: center; padding: 14px; }
.msg.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--text-muted); animation: dot 1.2s infinite; }
.msg.typing i:nth-child(2) { animation-delay: .2s; }
.msg.typing i:nth-child(3) { animation-delay: .4s; }

.chat-suggest {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.sugg {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--accent);
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  padding: 7px 12px;
  border-radius: 16px;
  cursor: pointer;
  transition: .15s;
}

.sugg:hover { border-color: var(--accent); background: var(--accent); color: #fff; }

.chat-input {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.chat-input input {
  flex: 1;
  background: var(--bg-tint);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 11px 15px;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  outline: none;
}

.chat-input input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(181,55,46,.12);
}

.chat-send {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent), #8b2820);
  color: #fff;
  font-size: 15px;
  flex-shrink: 0;
  transition: transform .15s;
}

.chat-send:hover { transform: scale(1.07); }

.chat-foot {
  text-align: center;
  font-size: 10.5px;
  color: var(--text-muted);
  padding: 7px;
  background: var(--bg);
  border-top: 1px solid var(--border);
}

/* ── 35. SCROLLBAR ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-med); border-radius: 3px; }

/* ── 36. UTILITY ────────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border-width: 0;
}

/* ── 37. HAMBURGER NAV ──────────────────────────────────────── */

/* hamburger button — hidden on desktop, shown on mobile via media query */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 8px;
  background: none;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  border-radius: var(--radius);
  transition: background var(--transition);
}

.nav-toggle:hover { background: var(--bg-tint); }

.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .25s ease, opacity .25s ease, width .25s ease;
  transform-origin: center;
  width: 22px;
}

.nav-toggle span:nth-child(3) { width: 14px; }

/* open state — animate to X */
.site-head.nav-open .nav-toggle span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
  width: 22px;
}
.site-head.nav-open .nav-toggle span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.site-head.nav-open .nav-toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
  width: 22px;
}

/* Mobile nav drawer — hidden everywhere by default */
.site-nav-drawer {
  display: none;
}

.site-nav-drawer .nav-link {
  font-size: 15px;
  font-weight: 500;
  padding: 14px 20px;
  border-radius: 0;
  border-bottom: 1px solid var(--border);
  min-height: 48px;
  display: flex;
  align-items: center;
  color: var(--text-sec);
  transition: background var(--transition), color var(--transition);
}

.site-nav-drawer .nav-link:hover {
  background: var(--bg-tint);
  color: var(--accent);
}

.site-nav-drawer .nav-link:last-child { border-bottom: none; }

/* ── 38. TABLET BREAKPOINT (≤ 1024px) ───────────────────────── */
@media (max-width: 1024px) {
  /* Skills: 4-col → 2-col on tablet */
  .skills-grid { grid-template-columns: repeat(2, 1fr); gap: 28px; }

  /* GitHub stats: 4-col → 2-col on tablet */
  .gh-stats { grid-template-columns: repeat(2, 1fr); }

  /* Gallery: 3-col → 2-col on tablet */
  .gal-grid { grid-template-columns: repeat(2, 1fr); }

  /* Testimonials: 3-col → 2-col on tablet */
  .tm-grid { grid-template-columns: repeat(2, 1fr); }

  /* Books: 3-col → 2-col on tablet */
  .books-grid { grid-template-columns: repeat(2, 1fr); }

  /* Bookmarks: 3-col → 2-col on tablet */
  .bm-grid { grid-template-columns: repeat(2, 1fr); }

  /* Tools: 4-col → 2-col on tablet */
  .tools-grid { grid-template-columns: repeat(2, 1fr); }

  /* Hero: tighten gap */
  .hero-grid { gap: 48px; }

  /* Featured post: narrow the image col */
  .post-feat { grid-template-columns: 300px 1fr; }
}

/* ── 39. MOBILE RESPONSIVE (≤ 768px) ────────────────────────── */
@media (max-width: 768px) {
  /* Prevent horizontal scroll */
  body { overflow-x: hidden; }
  .wrap { padding: 0 16px; }
  .section { padding: 48px 0; }

  /* ── Header / Nav ── */
  .site-nav { display: none !important; }   /* hide desktop inline nav */
  .nav-toggle { display: flex; }            /* show hamburger */
  .head-inner { height: 56px; gap: 0; justify-content: space-between; }
  .brand-role { display: none; }            /* hide subtitle in header on mobile */

  /* Mobile drawer — shown when nav-open toggled via JS */
  .site-head.nav-open .site-nav-drawer {
    display: flex;
    flex-direction: column;
    background: var(--bg);
    border-top: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(41,38,27,.1);
  }

  .site-nav-drawer .nav-link {
    font-size: 15px;
    font-weight: 500;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    min-height: 48px;
    display: flex;
    align-items: center;
    color: var(--text-sec);
    border-radius: 0;
  }

  .site-nav-drawer .nav-link:hover,
  .site-nav-drawer .nav-link:active {
    background: var(--bg-tint);
    color: var(--accent);
  }

  .site-nav-drawer .nav-link:last-child { border-bottom: none; }

  /* ── Hero — remove top white space ── */
  .hero { padding: 24px 0 32px; }
  .hero-grid { grid-template-columns: 1fr; gap: 28px; }
  .hero-portrait { order: -1; }
  .portrait { aspect-ratio: 16/9; max-height: 240px; }

  /* Tone down portrait decorative corners on mobile */
  .hero-portrait::before { top: -8px; right: -8px; width: 48px; height: 48px; }
  .hero-portrait::after { bottom: 20px; left: -8px; width: 36px; height: 36px; }

  /* Hero text */
  .hero-name { font-size: clamp(28px, 8vw, 38px); }
  .hero-name-np { font-size: clamp(14px, 4vw, 18px); }
  .hero-role { font-size: 15px; }
  .hero-tagline { font-size: 14px; }

  /* Badge rows: allow label to wrap above badges */
  .hero-badge-row { flex-direction: column; align-items: flex-start; gap: 6px; }
  .hero-badge-rowlabel { min-width: unset; }

  /* Social links: tighter, allow wrap */
  .hero-socials { gap: 8px; }
  .social { font-size: 12px; padding: 6px 10px; }
  .social-label { display: none; }   /* show only abbr tag on very small screens */

  /* Stats */
  .hero-stats { flex-direction: column; gap: 0; border-top: 1px solid var(--border); margin-top: 32px; padding-top: 0; }
  .stat { padding: 14px 0; border-right: none; border-bottom: 1px solid var(--border); }
  .stat:last-child { padding-left: 0; border-bottom: none; }
  .stat:not(:first-child):not(:last-child) { padding-left: 0; }
  .stat-value { font-size: 30px; }

  /* ── Section headings ── */
  .section-title { font-size: clamp(22px, 6vw, 32px); margin-bottom: 18px; }
  .prose { font-size: 15px; }
  .prose-lead { font-size: 16px; }

  /* ── About ── */
  .about-grid { grid-template-columns: 1fr; gap: 36px; }

  /* ── Vision ── */
  .pillars { grid-template-columns: 1fr; gap: 16px; }

  /* ── Skills ── */
  .skills-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }

  /* ── Experience ── */
  .xp-role { font-size: 17px; }
  .xp-head { flex-direction: column; gap: 2px; }

  /* ── Projects ── */
  .proj-grid { grid-template-columns: 1fr; }
  .proj { padding: 20px; }

  /* ── GitHub ── */
  .gh-stats { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .gh-stat-val { font-size: 28px; }

  /* ── Services ── */
  .svc-grid { grid-template-columns: 1fr; gap: 20px; }
  .svc { padding: 24px; }
  .svc-no { font-size: 40px; }

  /* ── Writing / Blog ── */
  .post-feat { grid-template-columns: 1fr; }
  .post-feat-media { min-height: 160px; }
  .post-feat-body { padding: 20px; }
  .post-feat-title { font-size: 20px; }
  .slider-head { flex-direction: column; align-items: flex-start; gap: 12px; }

  /* ── Publications ── */
  .res-item { padding-left: 0; }
  .res-item::before { display: none; }

  /* ── Library ── */
  .books-grid { grid-template-columns: 1fr; }
  .bm-grid { grid-template-columns: 1fr; }
  .tools-grid { grid-template-columns: repeat(2, 1fr); }
  .lib-tabs { overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .lib-tabs::-webkit-scrollbar { display: none; }

  /* ── Gallery ── */
  .gal-grid { grid-template-columns: 1fr; }

  /* ── Testimonials ── */
  .tm-grid { grid-template-columns: 1fr; }

  /* ── Education ── */
  .edu-grid { grid-template-columns: 1fr; gap: 36px; }

  /* ── Press ── */
  .press-item { grid-template-columns: 1fr; gap: 4px; }
  .press-date { text-align: left; }

  /* ── Contact ── */
  .contact-grid { grid-template-columns: 1fr; gap: 40px; }

  /* ── Footer ── */
  .foot-bottom { flex-direction: column; align-items: flex-start; gap: 12px; }
  .foot-note { text-align: left; }
  .foot-socials { flex-wrap: wrap; gap: 6px; }

  /* ── Chat widget ── */
  .chat-fab { bottom: 16px; right: 16px; width: 52px; height: 52px; }
  .chat-panel {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    bottom: 0;
    right: 0;
    border-radius: 0;
    border: none;
  }

  /* ── Reader overlay ── */
  .reader { padding: 24px; }
  .reader-title { font-size: 22px; }
}

/* ── 40. SMALL MOBILE (≤ 480px) ─────────────────────────────── */
@media (max-width: 480px) {
  .wrap { padding: 0 14px; }
  .section { padding: 48px 0; }

  /* Hero */
  .hero-name { font-size: clamp(26px, 9vw, 34px); }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; justify-content: center; }
  .hero-socials { gap: 6px; }

  /* Skills */
  .skills-grid { grid-template-columns: 1fr; }

  /* GitHub */
  .gh-stats { grid-template-columns: 1fr 1fr; gap: 10px; }

  /* Tools */
  .tools-grid { grid-template-columns: 1fr 1fr; }

  /* Bookmarks: 1-col on very small */
  .bm-grid { grid-template-columns: 1fr; }

  /* Gallery: tighten */
  .gal-grid { gap: 12px; }

  /* Testimonials */
  .tm { padding: 20px; }
  .tm-quote { font-size: 14px; }

  /* Press */
  .press-outlet { font-size: 11px; }

  /* Pillar cards */
  .pillar { padding: 20px; }

  /* Section title smaller */
  .section-title { font-size: clamp(20px, 7vw, 28px); }

  /* Stat value smaller */
  .stat-value { font-size: 26px; }

  /* Init cards */
  .init-card { padding: 20px 16px; }

  /* Experience */
  .xp-role { font-size: 16px; }
  .xp-card { padding-bottom: 28px; }
}
