/*
  Global styles
*/
:root {
  /* Clean, pleasant white theme */
  --bg: #ffffff;       /* Pure white */
  --card: #ffffff;     /* White cards */
  --card-2: #fafafa;   /* Very subtle alternate for depth */
  --text: #111827;     /* Sharp black-grey for contrast */
  --muted: #6b7280;    /* Soft grey for secondary text */
  --brand: #4f46e5;    /* Vibrant Indigo */
  --brand-600: #4338ca;
  --brand-700: #3730a3;
  --accent: #06b6d4;   /* Cyan */
  --border: #e5e7eb;   /* Subtle borders */
  --chip: #f3f4f6;     /* Light backing for tags */
  --success: #10b981;
  --danger: #ef4444;
  --radius: 16px;
  --shadow: 0 4px 20px -2px rgba(0,0,0,0.06); /* Softer, warmer shadow */
  
  /* Map colors */
  --map-land: #e2e8f0;
  --map-stroke: #cbd5e1;
}

/* Light theme overrides removed */


* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  /* Fun, pleasant subtle gradients - warm top right, fresh bottom left */
  background: radial-gradient(1000px 1000px at 100% 0%, rgba(99, 102, 241, 0.04), transparent 70%),
              radial-gradient(900px 900px at 0% 100%, rgba(236, 72, 153, 0.03), transparent 60%),
              var(--bg);
}


.container { width: min(1100px, 92%); margin: 0 auto; }
.muted { color: var(--muted); }

/* Header */
.site-header { 
  position: sticky; 
  top: 0; 
  z-index: 40; 
  background: rgba(255,255,255,0.8); 
  backdrop-filter: blur(12px); 
  border-bottom: 1px solid var(--border); 
}
.header-inner { 
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  height: 72px; 
}
.brand { 
  color: var(--text); 
  font-weight: 700; 
  letter-spacing: -0.5px; 
  text-decoration: none; 
  font-size: 22px; 
  transition: opacity .2s;
}
.brand:hover { opacity: 0.8; }

.nav { 
  display: flex; 
  gap: 8px; 
  background: var(--chip);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--border);
}
.nav-link { 
  color: var(--muted); 
  text-decoration: none; 
  padding: 8px 16px; 
  border-radius: 8px; 
  font-size: 14px;
  font-weight: 500;
  transition: all .2s ease; 
}
.nav-link:hover { 
  color: var(--text); 
  background: rgba(0,0,0,0.04); 
}
.nav-link.active {
  background: var(--card);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  border: 1px solid var(--border);
}

/* Footer */
.site-footer { border-top: 1px solid var(--border); margin-top: 60px; }
.footer-inner { 
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  gap: 24px; 
  padding: 32px 0; 
  color: var(--muted);
  flex-wrap: wrap; 
}
.footer-group { display: flex; align-items: center; gap: 24px; }
.footer-links, .footer-social { display: flex; gap: 16px; }
.footer-links a, .footer-social a { color: var(--muted); text-decoration: none; transition: color 0.2s; font-size: 14px; }
.footer-links a:hover, .footer-social a:hover { color: var(--text); }

@media (max-width: 600px) {
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 20px; }
  .footer-group { flex-direction: column; align-items: flex-start; gap: 16px; }
}

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--card); color: var(--text); text-decoration: none; cursor: pointer; transition: transform .06s ease, background .2s; }
.btn:hover { background: #151826; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(180deg, var(--brand), var(--brand-700)); border: 1px solid rgba(255,255,255,.1); color: white; }
.btn.primary:hover { background: linear-gradient(180deg, var(--brand-600), var(--brand-700)); }
.btn.secondary { background: var(--chip); color: var(--text); border-color: transparent; }
.btn.secondary:hover { background: #e5e7eb; }

/* Intro */
.intro { padding: 80px 0 50px; max-width: 680px; }
.intro h1 { font-size: 56px; letter-spacing: -2px; margin: 0 0 20px; font-weight: 800; color: var(--text); }
.intro .lead { font-size: 20px; color: var(--muted); line-height: 1.6; margin: 0 0 32px; }

.page-intro { padding: 60px 0 40px; max-width: 720px; }
.page-intro h1 { font-size: 42px; letter-spacing: -1.5px; margin: 0 0 16px; font-weight: 800; color: var(--text); }
.page-intro p { font-size: 18px; color: var(--muted); line-height: 1.6; margin: 0; }

.social-links { display: flex; gap: 20px; font-weight: 500; }
.social-links a { color: var(--text); text-decoration: none; opacity: 0.6; transition: opacity 0.2s; font-size: 15px; }
.social-links a:hover { opacity: 1; }

/* Bento Grid (Home) */
.bento-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 20px; }
.bento-card { 
  background: var(--card); 
  border: 1px solid var(--border); 
  border-radius: 24px; 
  padding: 28px; 
  text-decoration: none; 
  color: var(--text); 
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  display: flex; 
  flex-direction: column; 
  justify-content: space-between; 
  min-height: 200px;
  position: relative;
  overflow: hidden;
}
.bento-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: transparent; }
.bento-card.large { grid-column: span 2; background: linear-gradient(135deg, var(--card) 0%, #f8fafc 100%); } 
.bento-icon { font-size: 36px; margin-bottom: auto; display: block; }
.bento-card h3 { margin: 0; font-size: 22px; font-weight: 600; }
.bento-card p { margin: 6px 0 0; color: var(--muted); font-size: 15px; }

/* Now Page Grid (Clean, Content Focused) */
.now-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 24px;
}

.now-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.now-card.large {
  grid-column: span 2;
}

.card-header-text {
  margin: 0;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  margin-bottom: 8px;
}

.now-card p {
  margin: 0;
  line-height: 1.6;
  color: var(--text);
  font-size: 16px;
}

.now-card .muted {
  color: var(--muted);
}

.project-item h4 {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.project-item p {
  color: var(--muted);
  font-size: 15px;
}

.card-content-grid {
  display: grid;
  gap: 24px;
}

.thought-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 16px;
}

.thought-list li {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.thought-list strong {
  color: var(--text);
  font-weight: 600;
}

.thought-list span {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

/* CTA Section */
.cta-section {
  margin-top: 48px;
  padding: 48px;
  background: linear-gradient(135deg, var(--card) 0%, #f0f9ff 100%);
  border-radius: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  text-align: center;
}
.cta-content { max-width: 600px; margin: 0 auto; }
.cta-content h3 { margin-top: 0; font-size: 28px; font-weight: 700; letter-spacing: -0.5px; margin-bottom: 12px; }
.cta-content p { color: var(--muted); font-size: 17px; line-height: 1.6; margin-bottom: 32px; }
.cta-buttons { display: flex; gap: 12px; justify-content: center; }

@media (max-width: 900px) {
  .now-grid { grid-template-columns: 1fr; }
  .now-card.large { grid-column: auto; }
  .cta-buttons { flex-direction: column; }
}

/* Filters */
.filters { 
  position: sticky; 
  top: 72px; 
  z-index: 20; 
  background: rgba(255,255,255,0.9); 
  backdrop-filter: blur(12px); 
  border-bottom: 1px solid var(--border); 
  padding: 16px 0; 
  margin: 8px 0 24px; 
}

/* Library page filters should scroll with content */
body.library-page .filters {
  position: static;
  background: transparent;
  backdrop-filter: none;
  border-bottom: none;
}

.segmented { 
  display: inline-flex; 
  gap: 2px;
  background: var(--chip); 
  padding: 3px; 
  border-radius: 10px; 
  border: 1px solid var(--border); 
  box-shadow: none;
}

.segment { 
  background: transparent; 
  border: 1px solid transparent; 
  color: var(--muted); 
  padding: 5px 14px; 
  border-radius: 7px; 
  cursor: pointer; 
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
}

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

.segment.is-active {
  background: var(--card);
  color: var(--text);
  border-color: var(--border);
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  font-weight: 600;
}

.search-and-tags { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 12px; }
.search input { width: 100%; padding: 12px 14px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; color: var(--text); }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: var(--chip); border: 1px solid var(--border); color: var(--muted); padding: 6px 10px; border-radius: 999px; cursor: pointer; }
.chip img.flag { height: 14px; width: auto; vertical-align: -2px; margin-right: 6px; border-radius: 2px; }
.chip.is-active {
  color: var(--text);
  background: transparent;
  border-color: var(--border);
  box-shadow: none;
  font-weight: 600;
  cursor: default; /* Not clickable if just a label */
}

.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }

/* Grid */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 16px; }
.card { background: var(--card-2); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); cursor: pointer; transition: transform .12s ease, box-shadow .12s ease; }
.card:hover { transform: translateY(-2px); box-shadow: 0 16px 38px rgba(0,0,0,.55); }
.card-media { aspect-ratio: 16 / 9; width: 100%; object-fit: cover; background: #0f0f14; }
.card-body { padding: 12px 14px 14px; display: grid; gap: 6px; }
.card-title { margin: 0; font-size: 16px; }
.card-meta { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; }

/* Library & CV Styles */
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 32px;
  margin-top: 24px;
}

.book-card {
  background: transparent;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.book-cover {
  aspect-ratio: 2/3;
  background: var(--chip);
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
  display: grid;
  place-items: center;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.book-cover:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.1);
}

.book-info h3 { margin: 0 0 4px; font-size: 16px; }
.book-info .author { margin: 0 0 4px; font-size: 14px; color: var(--muted); }
.book-info .rating { font-size: 13px; color: #f59e0b; }

/* CV Styles */
.cv-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 40px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

/* Link Styles */
a {
  color: var(--brand);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-thickness: 1px;
}


.cv-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 48px;
}

.cv-section { margin-bottom: 40px; }
.cv-section h2 { font-size: 24px; margin: 0 0 20px; }

.cv-item { margin-bottom: 28px; }
.cv-item-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}
.cv-item-header h3 { margin: 0; font-size: 18px; }
.cv-company { font-weight: 500; color: var(--brand); margin-bottom: 8px; }
.cv-item ul { margin: 8px 0 0 20px; padding: 0; color: var(--text); }
.cv-item li { margin-bottom: 6px; line-height: 1.5; }

.cv-sidebar .cv-section { margin-bottom: 32px; }
.cv-sidebar .tag-cloud { gap: 8px; }

@media (max-width: 768px) {
  .cv-header { flex-direction: column; gap: 16px; }
  .cv-grid { grid-template-columns: 1fr; gap: 32px; }
}

/* Bucket List */
.bucket .add-item { display: flex; gap: 10px; }
.add-item input { flex: 1; padding: 12px 14px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; color: var(--text); }
.bucket-list { margin: 14px 0 0; list-style: none; padding: 0; display: grid; gap: 10px; }
.bucket-item { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 10px 12px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; }
.bucket-item.done { opacity: .7; }
.bucket-item button { background: var(--chip); color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: 6px 10px; cursor: pointer; }

/* Timeline */
.timeline { position: relative; margin-top: 18px; }
.timeline::before { content: ""; position: absolute; left: 18px; top: 0; bottom: 0; width: 2px; background: linear-gradient(180deg, rgba(124,92,255,.6), transparent); }
.timeline-item { position: relative; padding-left: 54px; margin: 18px 0; }
.timeline-dot { position: absolute; left: 12px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 3px rgba(124,92,255,.2); }
.timeline-content { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.timeline-content time { color: var(--muted); font-size: 12px; }

/* Cartoon/Comic Timeline styling */
.cartoon-timeline .timeline::before { background: repeating-linear-gradient(180deg, rgba(124,92,255,.6), rgba(124,92,255,.6) 8px, transparent 8px, transparent 16px); }
.cartoon-card { background: var(--card); border: 2px solid var(--text); border-radius: 16px; padding: 14px; box-shadow: 6px 6px 0 0 var(--text); }
.cartoon-card h3 { margin: 0 0 6px; }
.cartoon-badge { font-size: 24px; }
.cartoon-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }

/* World page */
.globe-wrap { 
  display: grid; 
  grid-template-columns: 1fr 320px; 
  gap: 24px; 
  align-items: start; 
  margin-top: 24px;
}

#mapRoot { 
  width: 100%; 
  height: 600px; 
  display: block; 
  background: var(--card); 
  border: 1px solid var(--border); 
  border-radius: 24px; 
  box-shadow: var(--shadow); 
  overflow: hidden; 
  position: relative;
}

.world-sidebar { 
  background: transparent; 
  border: none; 
  padding: 0; 
  display: flex; 
  flex-direction: column; 
  gap: 20px; 
}

.world-sidebar h3 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.5px;
}

.world-sidebar h4 {
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}

#categoryChips {
  margin-top: 4px;
}

#categoryChips .chip {
  font-size: 13px;
  padding: 6px 12px;
}

#visitedCountries .chip, 
#visitedStates .chip {
  background: var(--card);
  border-color: transparent;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  font-size: 13px;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  cursor: default;
}
#visitedCountries .chip:hover,
#visitedStates .chip:hover {
  transform: none;
  border-color: transparent;
}

.chip img.flag {
  width: 16px;
  height: auto;
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* Side Pane (Sliding) & Centered Modal */
.modal { position: fixed; inset: 0; display: none; z-index: 9999; pointer-events: none; }
.modal[aria-hidden="false"] { display: block; pointer-events: auto; }
.modal-backdrop { 
  position: absolute; 
  inset: 0; 
  background: rgba(0,0,0,0.3); 
  backdrop-filter: blur(2px); 
  opacity: 0; 
  transition: opacity .3s; 
}
.modal[aria-hidden="false"] .modal-backdrop { opacity: 1; }

.modal-dialog { 
  position: fixed; 
  background: var(--card); 
  display: flex; 
  flex-direction: column; 
  overflow-y: auto;
  box-shadow: -10px 0 40px rgba(0,0,0,0.4); 
}

/* Slide Out Variant */
.modal.slide-out .modal-dialog {
  top: 0; 
  right: 0; 
  bottom: 0; 
  width: min(440px, 90vw); 
  border-left: 1px solid var(--border); 
  transform: translateX(100%); 
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal.slide-out[aria-hidden="false"] .modal-dialog { transform: translateX(0); }

/* Centered Variant */
.modal.centered .modal-dialog {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.96);
  width: min(600px, 90vw);
  max-height: 90vh;
  border-radius: 24px;
  border: 1px solid var(--border);
  box-shadow: 0 20px 50px rgba(0,0,0,0.2);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s, width 0.3s;
  opacity: 0;
}
.modal.centered[aria-hidden="false"] .modal-dialog { 
  transform: translate(-50%, -50%) scale(1); 
  opacity: 1;
}

.modal-close { 
  position: absolute; 
  top: 20px; 
  right: 20px; 
  width: 36px; 
  height: 36px; 
  border-radius: 50%; 
  border: 1px solid rgba(255,255,255,0.1); 
  background: rgba(0,0,0,0.6); 
  color: white; 
  cursor: pointer; 
  display: grid; 
  place-items: center; 
  z-index: 10;
  transition: transform 0.2s, background 0.2s;
}
.modal-close:hover { background: rgba(0,0,0,0.8); transform: scale(1.1); }

.modal-image { 
  width: 100%; 
  height: 280px; 
  object-fit: cover; 
  background: #1a1d26; 
  mask-image: linear-gradient(to bottom, black 80%, transparent 100%);
}

.modal-body { padding: 20px 32px 40px; display: flex; flex-direction: column; gap: 12px; }
.modal-body h2 { margin: 0; font-size: 32px; font-weight: 700; letter-spacing: -1px; }

.modal-article-content {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: none;
}

.modal-article-content.active {
  display: block;
}

.modal-article-content p {
  margin: 0 0 20px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
}

.modal-article-content h2 {
  font-size: 24px;
  font-weight: 700;
  margin: 32px 0 16px;
  letter-spacing: -0.5px;
  color: var(--text);
}

.modal-article-content h3 {
  font-size: 20px;
  font-weight: 600;
  margin: 24px 0 12px;
  color: var(--text);
}

.modal-article-content blockquote {
  margin: 24px 0;
  padding: 20px 24px;
  border-left: 4px solid var(--brand);
  background: var(--chip);
  border-radius: 8px;
  font-style: italic;
  color: var(--text);
}

.modal-article-content ul, .modal-article-content ol {
  margin: 20px 0;
  padding-left: 24px;
}

.modal-article-content li {
  margin: 8px 0;
  line-height: 1.6;
}

.modal-article-content strong {
  font-weight: 600;
  color: var(--text);
}

.modal-article-content em {
  font-style: italic;
}

.modal-article-content a {
  color: var(--brand);
  text-decoration: none;
}

.modal-article-content a:hover {
  text-decoration: underline;
}

.modal-actions { margin-top: auto; }

@media (max-width: 900px) {
  .globe-wrap { grid-template-columns: 1fr; }
  #mapRoot { height: 400px; }
  .world-sidebar { order: 2; }
}

/* Tooltip Styles */
.tooltip-trigger {
  position: relative;
  cursor: help;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-color: var(--muted);
}

.tooltip-trigger::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  padding: 8px 12px;
  background: var(--text);
  color: var(--bg);
  font-size: 12px;
  font-weight: 400;
  border-radius: 8px;
  width: 220px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 100;
  text-align: center;
  line-height: 1.4;
  pointer-events: none;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

.tooltip-trigger::after {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  border: 6px solid transparent;
  border-top-color: var(--text);
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 100;
  pointer-events: none;
}

.tooltip-trigger:hover::before,
.tooltip-trigger:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-8px);
}

/* Fun View / PDF View Toggle */
.view-toggle-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toggle-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 24px;
}

.toggle-switch input { 
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border);
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
}

input:checked + .slider {
  background-color: var(--brand);
}

input:focus + .slider {
  box-shadow: 0 0 1px var(--brand);
}

input:checked + .slider:before {
  transform: translateX(24px);
}

/* Disabled Toggle */
input:disabled + .slider {
  background-color: #e5e7eb;
  cursor: not-allowed;
  opacity: 0.6;
}
input:disabled + .slider:before {
  background-color: #f3f4f6;
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

/* Fun View Layout */
.fun-container {
  display: flex;
  flex-direction: column;
  gap: 48px;
  padding-bottom: 60px;
  max-width: 900px;
  margin: 0 auto;
}

/* Fun Role Row */
.fun-role-row {
  position: relative;
  padding-left: 24px;
  border-left: 2px solid var(--border);
}

.fun-role-dot {
  position: absolute;
  left: -7px;
  top: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 4px white;
}

.fun-role-header {
  margin-bottom: 20px;
}

.fun-role-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 4px;
}

.fun-role-meta {
  display: flex;
  gap: 12px;
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 8px;
}

.fun-role-company {
  color: var(--brand);
  font-weight: 600;
}

.fun-role-desc {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  margin: 0;
  max-width: 700px;
}

/* Project Cards Horizontal Scroll */
.fun-projects-scroll {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding: 4px 4px 24px 4px;
  margin: 0 -4px; /* Counteract padding */
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.fun-projects-scroll::-webkit-scrollbar {
  height: 8px;
}

.fun-projects-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.fun-projects-scroll::-webkit-scrollbar-thumb {
  background-color: var(--border);
  border-radius: 20px;
}

.fun-project-card {
  min-width: 280px;
  width: 280px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.fun-project-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.08);
  border-color: var(--brand);
}

.fun-project-img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  background: #f0f0f0;
}

.fun-project-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.fun-project-title {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 6px;
  line-height: 1.4;
}

.fun-project-subtitle {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.fun-project-footer {
  margin-top: 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--brand);
}

/* Fun Modal Overrides (Slide-out specific) */
#funModal {
  pointer-events: none; /* Allow clicks to pass through container */
  z-index: 10000;
}

#funModal[aria-hidden="false"] {
  pointer-events: none;
}

#funModal .modal-backdrop {
  display: none; /* Hide backdrop to allow interaction with page */
}

#funModal .modal-dialog {
  pointer-events: auto; /* Re-enable clicks on the panel */
  width: min(600px, 90vw); /* Wider than standard side modal for content */
  max-height: none;
  height: 100%;
  background: var(--card);
  box-shadow: -10px 0 40px rgba(0,0,0,0.15);
  /* The slide-out transition is handled by .modal.slide-out in global styles */
}

.fun-modal-content {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: var(--card);
}

.fun-carousel {
  position: relative;
  width: 100%;
  flex-shrink: 0;
  /* Adjust aspect ratio or height as needed */
  height: 300px; 
  background: #000;
}

.fun-slides {
  width: 100%;
  height: 100%;
  position: relative;
}

.fun-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.4s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.fun-slide.active {
  opacity: 1;
  z-index: 1;
}

.slide-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.6;
}

.slide-content {
  position: relative;
  padding: 32px;
  background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.5) 60%, transparent 100%);
  color: white;
  z-index: 2;
}

.slide-title {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 8px;
  color: white;
}

.slide-subtitle {
  font-size: 15px;
  opacity: 0.9;
  line-height: 1.5;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  z-index: 10;
  display: grid;
  place-items: center;
  transition: background 0.2s;
  backdrop-filter: blur(4px);
}

.carousel-btn:hover {
  background: rgba(255,255,255,0.2);
}

.carousel-btn.prev { left: 16px; }
.carousel-btn.next { right: 16px; }

.carousel-dots {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  cursor: pointer;
  transition: background 0.2s;
}

.dot.active {
  background: white;
  transform: scale(1.2);
}

/* Tags Styling */
.fun-role-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.fun-tag {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.role-tag {
  background: var(--chip);
  color: var(--muted);
  border: 1px solid var(--border);
}

.fun-project-img-wrapper {
  position: relative;
  width: 100%;
  height: 140px;
}

.fun-project-tags-overlay {
  position: absolute;
  bottom: 8px;
  left: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  z-index: 2;
}

.card-tag {
  background: rgba(0, 0, 0, 0.6);
  color: white;
  backdrop-filter: blur(4px);
  font-size: 10px;
  padding: 3px 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Filter Tags in Header */
.fun-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: 24px;
  align-items: center;
}

.filter-tag {
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: capitalize;
}

.filter-tag:hover {
  background: var(--chip);
  color: var(--text);
}

.filter-tag.active {
  background: var(--brand);
  color: white;
  border-color: var(--brand);
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
}

@media (max-width: 768px) {
  .fun-filters {
    margin-left: 0;
    margin-top: 12px;
    width: 100%;
  }
  .header-inner + div { /* Targeting the container in CV header */
    flex-wrap: wrap;
  }
  .fun-carousel { aspect-ratio: 3/4; }
  .slide-title { font-size: 22px; }
  .slide-content { padding: 24px; }
  .carousel-btn { width: 36px; height: 36px; font-size: 20px; }
  
  /* Mobile Navigation and Layout Fixes */
  .header-inner {
    flex-direction: column;
    height: auto;
    padding: 16px 0;
    gap: 12px;
    align-items: center;
  }
  
  .brand {
    margin-left: 0;
    font-size: 26px;
  }

  .nav {
    width: 100%;
    flex-wrap: wrap;
    justify-content: center;
    padding: 6px;
    gap: 6px;
    height: auto;
    overflow-x: visible;
  }
  
  .nav::-webkit-scrollbar {
    display: auto;
  }

  .nav-link {
    white-space: nowrap;
    flex-grow: 1;
    text-align: center;
    padding: 10px 14px;
    font-size: 14px;
  }

  /* About Me / Bento Grid */
  .bento-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .bento-card.large {
    grid-column: auto;
  }
  .intro {
    padding: 40px 0 30px;
  }
  .intro h1 {
    font-size: 36px;
    margin-bottom: 16px;
  }
  .intro .lead {
    font-size: 17px;
    margin-bottom: 24px;
  }

  .page-intro { padding: 32px 0 24px; }
  .page-intro h1 { font-size: 32px; }
  .page-intro p { font-size: 16px; }
  
  .social-links {
    flex-wrap: wrap;
  }

  /* Projects & Posts Grid */
  .grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  /* Filters Mobile */
  .filters {
    position: static;
    margin-top: 0;
    background: transparent;
    backdrop-filter: none;
    border-bottom: none;
    padding-bottom: 0;
  }

  .segmented {
    width: 100%;
    display: flex;
  }
  
  .segment {
    flex: 1;
    text-align: center;
  }
}
