/* ===== CSS Custom Properties ===== */
:root {
  --primary-orange: #FF6B35;
  --claude-orange: #CC785C;
  --bg-dark: #1a1a1a;
  --bg-card: #252525;
  --bg-card-hover: #2a2a2a;
  --text-primary: #e0e0e0;
  --text-secondary: #a0a0a0;
  --text-muted: #707070;
  --border-color: #333;
  --gradient-start: #1a1a1a;
  --gradient-mid: #1f1a1a;
  --gradient-end: #1a1a1f;
  --transition-fast: 0.2s ease;
  --transition-medium: 0.3s ease;
  --shadow-glow: 0 0 20px rgba(255, 107, 53, 0.3);
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* ===== Reset & Base ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 16px;
}

/* ===== Typography ===== */
h1, h2, h3, h4 {
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 400;
  line-height: 1.3;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: 2rem;
}

h3 {
  font-size: 1.25rem;
}

a {
  color: var(--primary-orange);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--claude-orange);
}

a:focus-visible {
  outline: 2px solid var(--primary-orange);
  outline-offset: 2px;
}

/* ===== Layout ===== */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 5rem 0;
}

/* ===== Navigation ===== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(26, 26, 26, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
}

.nav-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.nav-link {
  color: var(--text-secondary);
  font-size: 0.9rem;
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--primary-orange);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--transition-medium);
}

.nav-link:hover::after,
.nav-link:focus::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav-link:hover,
.nav-link:focus {
  color: var(--text-primary);
}

/* ===== Hero Section ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding-top: 6rem;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    var(--gradient-start) 0%,
    var(--gradient-mid) 50%,
    var(--gradient-end) 100%
  );
  background-size: 400% 400%;
  animation: gradientShift 30s ease infinite;
  z-index: -1;
}

@keyframes gradientShift {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

.hero-content {
  text-align: center;
  max-width: 700px;
}

.profile-photo {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  margin: 0 auto 2rem;
  background: var(--bg-card);
  border: 3px solid var(--primary-orange);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 0 25px rgba(255, 107, 53, 0.4), 0 0 50px rgba(255, 107, 53, 0.2);
}

.profile-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-placeholder {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Typing Animation */
.name {
  margin-bottom: 1rem;
  overflow: hidden;
  white-space: nowrap;
  border-right: 3px solid var(--primary-orange);
  animation:
    typing 3.5s steps(14, end) forwards,
    blink 0.75s step-end infinite;
  animation-delay: 0s, 0s;
  width: 0;
  display: inline-block;
}

@keyframes typing {
  from {
    width: 0;
  }
  to {
    width: 12ch;
  }
}

@keyframes blink {
  from, to {
    border-color: transparent;
  }
  50% {
    border-color: var(--primary-orange);
  }
}

.tagline {
  color: var(--text-secondary);
  font-size: 1.125rem;
  margin-bottom: 2rem;
}

/* Bio */
.bio-container {
  text-align: left;
  max-width: 600px;
  margin: 0 auto;
}

.bio-preview {
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

.bio-expanded {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease, opacity 0.3s ease;
  opacity: 0;
}

.bio-expanded.active {
  max-height: 300px;
  overflow-y: auto;
  opacity: 1;
  margin-bottom: 1rem;
  position: relative;
}

/* Bottom glow bar for bio scroll */
.bio-glow {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--primary-orange);
  border-radius: 2px;
  box-shadow:
    0 0 15px var(--primary-orange),
    0 -20px 40px rgba(255, 107, 53, 0.4);
  pointer-events: none;
  margin-top: 0.5rem;
}

/* Custom scrollbar for bio section */
.bio-expanded::-webkit-scrollbar {
  width: 6px;
}

.bio-expanded::-webkit-scrollbar-track {
  background: var(--bg-card);
  border-radius: 3px;
}

.bio-expanded::-webkit-scrollbar-thumb {
  background: var(--primary-orange);
  border-radius: 3px;
}

.bio-expanded::-webkit-scrollbar-thumb:hover {
  background: var(--claude-orange);
}

/* Scroll indicator */
.scroll-indicator {
  display: none;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary-orange);
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
  opacity: 0.8;
}

.scroll-indicator.visible {
  display: flex;
}

.scroll-indicator svg {
  width: 16px;
  height: 16px;
  animation: bounceDown 1.5s ease-in-out infinite;
}

@keyframes bounceDown {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}

.bio-expanded p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.bio-toggle {
  background: none;
  border: none;
  color: var(--primary-orange);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0;
  font-family: inherit;
}

.bio-toggle:hover {
  color: var(--claude-orange);
}

.bio-toggle:focus-visible {
  outline: 2px solid var(--primary-orange);
  outline-offset: 2px;
}

/* Highlight Animation */
.highlight {
  color: var(--primary-orange);
  position: relative;
}

.highlight.pulse {
  animation: pulseHighlight 0.6s ease;
}

@keyframes pulseHighlight {
  0%, 100% {
    text-shadow: none;
  }
  50% {
    text-shadow: 0 0 10px var(--primary-orange);
  }
}

/* ===== Section Titles ===== */
.section-title {
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--primary-orange);
}

/* ===== Timeline ===== */
.timeline-hint {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  opacity: 0.7;
}

.timeline-wrapper {
  overflow-x: auto;
  overflow-y: visible;
  cursor: grab;
  padding-bottom: 180px; /* Room for downward popups from rows 0-2 */
  margin: 0 -1.5rem;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.timeline-wrapper:active {
  cursor: grabbing;
}

.timeline-wrapper.dragging {
  cursor: grabbing;
  user-select: none;
}

/* Orange glow scrollbar */
.timeline-wrapper::-webkit-scrollbar {
  height: 12px;
}

.timeline-wrapper::-webkit-scrollbar-track {
  background: var(--bg-card);
  border-radius: 6px;
}

.timeline-wrapper::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, var(--primary-orange), var(--claude-orange));
  border-radius: 6px;
  box-shadow: 0 0 10px var(--primary-orange), 0 0 20px rgba(255, 107, 53, 0.5);
}

.timeline-wrapper::-webkit-scrollbar-thumb:hover {
  background: var(--primary-orange);
  box-shadow: 0 0 15px var(--primary-orange), 0 0 30px rgba(255, 107, 53, 0.7);
}

/* Firefox scrollbar */
.timeline-wrapper {
  scrollbar-width: thin;
  scrollbar-color: var(--primary-orange) var(--bg-card);
}

.timeline {
  position: relative;
  min-width: 1800px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding-top: 10px;
}

/* Timeline track with years - centered */
.timeline-track {
  position: relative;
  height: 340px; /* Fits 4 rows: 45px offset + 290px bars + 5px margin */
  margin: 0;
}

.timeline-years {
  display: flex;
  justify-content: space-between;
  padding: 0 20px;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
}

.year-marker {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  width: 60px;
  text-align: center;
}

.timeline-line {
  position: absolute;
  top: 30px;
  left: 20px;
  right: 20px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-orange), var(--claude-orange));
  border-radius: 2px;
}

/* Duration bars container */
.duration-bars {
  position: absolute;
  top: 45px;
  left: 20px;
  right: 20px;
  height: 290px;
}

/* Duration bars - clickable with embedded content */
.duration-bar {
  position: absolute;
  height: 65px;
  background: linear-gradient(90deg, var(--primary-orange), var(--claude-orange));
  border-radius: 8px;
  opacity: 0.9;
  cursor: pointer;
  transition: opacity var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
  /* Calculate position: each year = ~14.28% of width (100% / 7 years) */
  left: calc(var(--start) * 14.28%);
  width: calc((var(--end) - var(--start)) * 14.28%);
  min-width: 80px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.duration-bar[data-row="0"] { top: 0; }
.duration-bar[data-row="1"] { top: 75px; }
.duration-bar[data-row="2"] { top: 150px; }
.duration-bar[data-row="3"] { top: 225px; }

.duration-bar:hover,
.duration-bar:focus {
  opacity: 1;
  transform: scale(1.02);
  box-shadow: 0 0 15px var(--primary-orange);
  outline: none;
}

.duration-bar.active {
  opacity: 1;
  box-shadow: 0 0 20px var(--primary-orange);
  z-index: 100;
}

/* Bar title - inline content */
.bar-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--bg-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

/* Bar tags - inline content */
.bar-tags {
  display: flex;
  gap: 4px;
  flex-wrap: nowrap;
  overflow: hidden;
}

.bar-tags .tag {
  font-size: 0.65rem;
  padding: 2px 6px;
  background: rgba(26, 26, 26, 0.3);
  color: var(--bg-dark);
  border-radius: 10px;
  white-space: nowrap;
}

.duration-bar.ongoing {
  background: linear-gradient(90deg, var(--primary-orange), var(--claude-orange) 80%, rgba(204, 120, 92, 0.5));
}

.duration-bar.ongoing::after {
  content: '';
  position: absolute;
  right: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 12px solid var(--claude-orange);
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
}

.duration-bar.short {
  min-width: 180px;
}

/* Popup card that appears on click */
.timeline-popup {
  display: none;
  position: absolute;
  top: calc(100% + 15px);
  left: 50%;
  transform: translateX(-50%);
  width: 280px;
  background: var(--bg-card);
  padding: 1.25rem;
  border-radius: 8px;
  border: 1px solid var(--primary-orange);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 20px rgba(255, 107, 53, 0.2);
  z-index: 200;
  animation: popupFadeIn 0.2s ease;
}

.duration-bar.active .timeline-popup {
  display: block;
}

@keyframes popupFadeIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* Popup alignment classes for edge cases */
.timeline-popup.align-left {
  left: 0;
  transform: translateX(0);
  animation: popupFadeInLeft 0.2s ease;
}

.timeline-popup.align-right {
  left: auto;
  right: 0;
  transform: translateX(0);
  animation: popupFadeInRight 0.2s ease;
}

@keyframes popupFadeInLeft {
  from {
    opacity: 0;
    transform: translateX(0) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0) translateY(0);
  }
}

@keyframes popupFadeInRight {
  from {
    opacity: 0;
    transform: translateX(0) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0) translateY(0);
  }
}

/* Popup arrow */
.timeline-popup::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid var(--primary-orange);
}

.timeline-popup::after {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 7px solid var(--bg-card);
}

/* Arrow positioning for aligned popups */
.timeline-popup.align-left::before,
.timeline-popup.align-left::after {
  left: 30px;
  transform: translateX(0);
}

.timeline-popup.align-right::before,
.timeline-popup.align-right::after {
  left: auto;
  right: 30px;
  transform: translateX(0);
}

/* Upward-opening popup for items near bottom */
.timeline-popup.align-top {
  top: auto;
  bottom: calc(100% + 15px);
  animation: popupFadeInTop 0.2s ease;
}

@keyframes popupFadeInTop {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* Flip arrow to point downward */
.timeline-popup.align-top::before {
  top: auto;
  bottom: -8px;
  border-bottom: none;
  border-top: 8px solid var(--primary-orange);
}

.timeline-popup.align-top::after {
  top: auto;
  bottom: -6px;
  border-bottom: none;
  border-top: 7px solid var(--bg-card);
}

/* Handle combined alignment classes */
.timeline-popup.align-top.align-left {
  transform: translateX(0);
  animation: popupFadeInTopLeft 0.2s ease;
}

.timeline-popup.align-top.align-right {
  transform: translateX(0);
  animation: popupFadeInTopRight 0.2s ease;
}

@keyframes popupFadeInTopLeft {
  from { opacity: 0; transform: translateX(0) translateY(10px); }
  to { opacity: 1; transform: translateX(0) translateY(0); }
}

@keyframes popupFadeInTopRight {
  from { opacity: 0; transform: translateX(0) translateY(10px); }
  to { opacity: 1; transform: translateX(0) translateY(0); }
}

/* Close button */
.popup-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color var(--transition-fast);
}

.popup-close:hover {
  color: var(--primary-orange);
}

/* Timeline popup content styles */
.timeline-popup .timeline-date {
  color: var(--primary-orange);
  font-size: 0.875rem;
  font-weight: 500;
  display: block;
}

.timeline-popup .timeline-title {
  margin: 0.5rem 0;
  font-size: 1.1rem;
}

.timeline-popup .timeline-distinction {
  color: var(--claude-orange);
  font-size: 0.8rem;
  font-style: italic;
  margin-bottom: 0.25rem;
}

.timeline-popup .timeline-institution {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

.timeline-popup .timeline-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.timeline-popup .tag {
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
}

.timeline-date {
  color: var(--primary-orange);
  font-size: 0.875rem;
  font-weight: 500;
}

.timeline-title {
  margin: 0.5rem 0;
}

.timeline-distinction {
  color: var(--claude-orange);
  font-size: 0.8rem;
  font-style: italic;
  margin-bottom: 0.25rem;
}

.timeline-institution {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.timeline-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  background: rgba(255, 107, 53, 0.15);
  color: var(--primary-orange);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
}

.overlap-indicator {
  display: inline-block;
  background: var(--claude-orange);
  color: var(--bg-dark);
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  margin-left: 0.5rem;
  vertical-align: middle;
}

/* Mobile: Scrollable Timeline */
@media (max-width: 768px) {
  .timeline-wrapper {
    margin: 0 -1rem;
    padding-left: 1rem;
    padding-right: 1rem;
    padding-bottom: 180px; /* Room for downward popups from rows 0-2 */
  }

  .timeline {
    min-width: 900px;
  }

  .timeline-track {
    height: 340px;
  }

  .duration-bars {
    height: 290px;
  }

  .bar-title {
    font-size: 0.7rem;
  }

  .bar-tags .tag {
    font-size: 0.6rem;
    padding: 1px 4px;
  }

  .timeline-popup {
    width: 220px;
    padding: 1rem;
  }

  .timeline-popup .timeline-title {
    font-size: 0.95rem;
  }
}

/* ===== Card Grid ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

/* ===== Research Cards ===== */
.research-card {
  background: var(--bg-card);
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  transition: transform var(--transition-medium), box-shadow var(--transition-medium);
  display: flex;
  flex-direction: column;
}

.research-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
}

.badge {
  display: inline-block;
  background: var(--primary-orange);
  color: var(--bg-dark);
  align-self: flex-start;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.badge-preprint {
  background: var(--claude-orange);
}

.badge-thesis {
  background: #5a8f7b;
}

.card-title {
  margin-bottom: 0.5rem;
}

.card-meta {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.card-description {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.card-link {
  font-size: 0.9rem;
  font-weight: 500;
  position: relative;
  display: inline-block;
  margin-top: auto;
  padding-top: 1rem;
}

.card-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--primary-orange);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--transition-medium);
}

.card-link:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* ===== Experience Section ===== */
.experience-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.experience-card {
  background: var(--bg-card);
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  transition: border-color var(--transition-medium);
}

.experience-card:hover {
  border-color: var(--primary-orange);
}

.experience-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.experience-title {
  position: relative;
}

.experience-title::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-orange);
  transition: width var(--transition-medium);
}

.experience-card:hover .experience-title::after {
  width: 100%;
}

.experience-company {
  color: var(--primary-orange);
  font-weight: 500;
}

.experience-date {
  color: var(--text-muted);
  font-size: 0.875rem;
  display: block;
  margin-bottom: 1rem;
}

.experience-points {
  color: var(--text-secondary);
  padding-left: 1.25rem;
}

.experience-points li {
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.experience-points li:last-child {
  margin-bottom: 0;
}

/* ===== Blog Section ===== */
.blog-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 600px) {
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .blog-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.blog-card {
  background: var(--bg-card);
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  transition: transform var(--transition-medium), box-shadow var(--transition-medium);
}

.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
}

.blog-date {
  color: var(--text-muted);
  font-size: 0.8rem;
  display: block;
  margin-bottom: 0.5rem;
}

.blog-title {
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
}

.blog-excerpt {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== Books Section ===== */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
}

.book-card {
  text-align: center;
  transition: transform var(--transition-medium);
}

.book-card:hover {
  transform: translateY(-4px);
}

.book-cover {
  width: 120px;
  height: 180px;
  margin: 0 auto 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.875rem;
  transition: box-shadow var(--transition-medium);
}

.book-card:hover .book-cover {
  box-shadow: var(--shadow-glow);
}

img.book-cover {
  width: 120px;
  height: 180px;
  margin: 0 auto 1rem;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  display: block;
}

.book-title {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.book-author {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
}

.book-note {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-style: italic;
}

/* ===== Contact Section ===== */
.contact-container {
  text-align: center;
  max-width: 600px;
}

.contact-intro {
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.contact-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2rem;
  margin-bottom: 2rem;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-primary);
  transition: color var(--transition-fast);
}

.contact-link:hover {
  color: var(--primary-orange);
}

.contact-icon {
  width: 20px;
  height: 20px;
}

.cv-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--primary-orange);
  color: var(--bg-dark);
  padding: 0.875rem 2rem;
  border-radius: 8px;
  font-weight: 600;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.cv-button:hover {
  background: var(--claude-orange);
  color: var(--bg-dark);
  transform: translateY(-2px);
}

.cv-button:focus-visible {
  outline: 2px solid var(--text-primary);
  outline-offset: 2px;
}

/* ===== Footer ===== */
.footer {
  text-align: center;
  padding: 2rem 0;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.875rem;
}

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

/* ===== Scrollbar Styling ===== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ===== CV Modal ===== */
.cv-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.cv-modal.active {
  display: flex;
}

.cv-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
}

.cv-modal-content {
  position: relative;
  margin: auto;
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  background: var(--bg-card);
  border: 1px solid var(--primary-orange);
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 0 30px rgba(255, 107, 53, 0.3);
  animation: modalFadeIn 0.3s ease;
  display: flex;
  flex-direction: column;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.cv-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  transition: color var(--transition-fast);
}

.cv-modal-close:hover {
  color: var(--primary-orange);
}

.cv-modal-close:focus-visible {
  outline: 2px solid var(--primary-orange);
  outline-offset: 2px;
}

.cv-modal-title {
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.cv-embed {
  width: 100%;
  height: calc(80vh - 100px);
  min-height: 500px;
  overflow: hidden;
}

.cv-embed iframe,
.cv-embed object {
  width: 100%;
  height: 100%;
  border: 2px solid var(--primary-orange);
  border-radius: 4px;
  background: #fff;
}

.cv-download-link {
  text-align: center;
  margin-top: 1rem;
}

.cv-download-button {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: var(--primary-orange);
  color: var(--dark-gray);
  text-decoration: none;
  border-radius: 4px;
  font-weight: 600;
  transition: background 0.3s ease;
}

.cv-download-button:hover {
  background: #ff8533;
}

@media (max-width: 768px) {
  .cv-modal-content {
    width: 95%;
    padding: 1.5rem;
    max-height: 95vh;
  }

  .cv-embed {
    height: calc(85vh - 100px);
    min-height: 400px;
  }

  .cv-modal-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
  }
}

/* ===== Blog Instant View Modal ===== */
.blog-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.blog-modal.active {
  display: flex;
}

.blog-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
}

.blog-modal-content {
  position: relative;
  margin: auto;
  width: 95%;
  max-width: 700px;
  max-height: 95vh;
  background: var(--bg-dark);
  border-radius: 12px;
  overflow: hidden;
  animation: modalFadeIn 0.3s ease;
  display: flex;
  flex-direction: column;
}

.blog-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: sticky;
  top: 0;
  z-index: 10;
}

.blog-modal-badge {
  color: var(--primary-orange);
  font-size: 0.875rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.blog-modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.75rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem;
  transition: color var(--transition-fast);
  order: -1;
}

.blog-modal-close:hover {
  color: var(--text-primary);
}

.blog-modal-article {
  overflow-y: auto;
  flex: 1;
}

.blog-header-image {
  width: 100%;
  height: auto;
  display: block;
}

.blog-body-image {
  width: 100%;
  height: auto;
  display: block;
  margin: 1.5rem 0;
  border-radius: 8px;
}

.blog-image-gallery {
  display: flex;
  gap: 1rem;
  margin: 1.5rem 0;
}

.blog-gallery-image {
  flex: 1;
  width: 50%;
  height: auto;
  object-fit: cover;
  border-radius: 8px;
}

@media (max-width: 500px) {
  .blog-image-gallery {
    flex-direction: column;
  }

  .blog-gallery-image {
    width: 100%;
  }
}

.blog-modal-title {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.75rem;
  color: var(--text-primary);
  margin: 1.5rem 1.5rem 0.5rem;
  line-height: 1.3;
}

.blog-modal-meta {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin: 0 1.5rem 1.5rem;
}

.blog-modal-body {
  padding: 0 1.5rem 2rem;
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.8;
}

.blog-modal-body p {
  margin-bottom: 1.25rem;
}

.blog-modal-body a {
  color: var(--primary-orange);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.blog-modal-body a:hover {
  color: var(--claude-orange);
}

.blog-modal-body strong {
  color: var(--primary-orange);
  font-weight: 600;
}

.blog-section-title {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.25rem;
  color: var(--primary-orange);
  margin: 2rem 0 1rem;
}

.blog-section-title:first-child {
  margin-top: 0;
}

.blog-quote {
  background: var(--bg-card);
  border-left: 3px solid var(--primary-orange);
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  font-style: italic;
  color: var(--text-primary);
  border-radius: 0 8px 8px 0;
}

.blog-divider {
  border: none;
  height: 2px;
  background: var(--primary-orange);
  margin: 2rem 0;
  opacity: 0.5;
}

.blog-footer-note {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.blog-footer-note em {
  font-style: italic;
}

/* Blog card button styling */
.blog-instant-view {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  padding: 0;
  color: var(--primary-orange);
  transition: color var(--transition-fast);
}

.blog-instant-view:hover {
  color: var(--claude-orange);
}

@media (max-width: 768px) {
  .blog-modal-content {
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }

  .blog-modal-title {
    font-size: 1.5rem;
    margin: 1rem 1rem 0.5rem;
  }

  .blog-modal-meta {
    margin: 0 1rem 1rem;
  }

  .blog-modal-body {
    padding: 0 1rem 1.5rem;
  }

  .blog-section-title {
    font-size: 1.125rem;
  }
}

/* ===== Mobile Hero & Navigation Fixes ===== */
@media (max-width: 600px) {
  .nav-container {
    padding: 0.75rem 1rem;
    gap: 1rem;
  }
  
  .nav-link {
    font-size: 0.85rem;
  }
  
  .hero {
    padding-top: 10rem;
  }
  
  .profile-photo {
    width: 150px;
    height: 150px;
    margin-bottom: 1.5rem;
  }
  
  .name {
    font-size: 2rem;
  }
  
  .tagline {
    font-size: 1rem;
  }
  
  .hero-content {
    padding: 0 1rem;
  }
}

@media (max-width: 480px) {
  .hero {
    padding-top: 11rem;
  }
  
  .profile-photo {
    width: 140px;
    height: 140px;
  }
  
  .nav-container {
    gap: 0.75rem;
  }
  
  .nav-link {
    font-size: 0.8rem;
  }
}
