/* Reset and base styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --color-bg: #faf8f5;
  --color-bg-warm: #f5f0e8;
  --color-text: #2d2a26;
  --color-text-light: #6b635a;
  --color-accent: #c45d3a;
  --color-accent-hover: #a84d2f;
  --color-border: #e8e2d9;
  --color-card: #fffdfb;
  --max-width: 800px;
  --spacing: 2rem;
  --radius: 12px;
}

html {
  font-size: 18px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Georgia', 'Times New Roman', serif;
  line-height: 1.7;
  color: var(--color-text);
  background-color: var(--color-bg);
}

/* Layout */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--spacing);
}

/* Navigation */
nav {
  padding: 1.5rem 0;
  background: var(--color-bg);
}

nav .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

nav .logo {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--color-text);
  text-decoration: none;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  letter-spacing: -0.02em;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 2rem;
}

nav a {
  color: var(--color-text-light);
  text-decoration: none;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.95rem;
  transition: color 0.2s;
}

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

/* Hero section */
.hero {
  padding: 5rem 0 4rem;
  background: linear-gradient(180deg, var(--color-bg-warm) 0%, var(--color-bg) 100%);
  border-radius: 0 0 2rem 2rem;
  margin-bottom: 1rem;
}

.hero h1 {
  font-size: 2.8rem;
  font-weight: 400;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.hero .tagline {
  font-size: 1.2rem;
  color: var(--color-text-light);
  font-style: italic;
}

/* Sections */
section {
  padding: 4rem 0;
}

section h2 {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  letter-spacing: -0.01em;
  color: var(--color-text);
}

/* About section */
.about {
  background: var(--color-bg-warm);
  border-radius: var(--radius);
  margin: 0 1rem 2rem;
  padding: 3rem 2rem;
}

.about .container {
  padding: 0;
}

.about p {
  margin-bottom: 1rem;
}

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

/* Projects section */
.project-grid {
  display: grid;
  gap: 1.5rem;
}

.project {
  padding: 1.75rem;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  transition: transform 0.2s, box-shadow 0.2s;
}

.project:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(45, 42, 38, 0.08);
}

.project h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.project p {
  color: var(--color-text-light);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.project-link {
  color: var(--color-accent);
  text-decoration: none;
  font-size: 0.9rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 500;
}

.project-link:hover {
  color: var(--color-accent-hover);
  text-decoration: underline;
}

/* Blog section */
.post-list {
  list-style: none;
}

.post-list li {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--color-border);
}

.post-list li:first-child {
  padding-top: 0;
}

.post-list li:last-child {
  border-bottom: none;
}

.post-list a {
  color: var(--color-text);
  text-decoration: none;
  font-weight: 400;
  font-size: 1.05rem;
  transition: color 0.2s;
}

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

.post-date {
  display: block;
  font-size: 0.85rem;
  color: var(--color-text-light);
  margin-top: 0.25rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.view-all {
  display: inline-block;
  margin-top: 1.5rem;
  color: var(--color-accent);
  text-decoration: none;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 500;
}

.view-all:hover {
  text-decoration: underline;
}

/* Footer */
footer {
  padding: 4rem 0 3rem;
  margin-top: 2rem;
  background: var(--color-bg-warm);
  border-radius: 2rem 2rem 0 0;
}

footer .container {
  text-align: center;
}

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

.social-links a {
  color: var(--color-text-light);
  text-decoration: none;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.95rem;
  transition: color 0.2s;
}

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

footer p {
  font-size: 0.85rem;
  color: var(--color-text-light);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Blog page styles */
.page-header {
  padding: 4rem 0 2rem;
  background: linear-gradient(180deg, var(--color-bg-warm) 0%, var(--color-bg) 100%);
  border-radius: 0 0 2rem 2rem;
  margin-bottom: 1rem;
}

.page-header h1 {
  font-size: 2.2rem;
  font-weight: 400;
}

/* Blog post styles */
.post-header {
  padding: 4rem 0 2rem;
  background: linear-gradient(180deg, var(--color-bg-warm) 0%, var(--color-bg) 100%);
  border-radius: 0 0 2rem 2rem;
  margin-bottom: 0;
}

.post-header h1 {
  font-size: 2.2rem;
  font-weight: 400;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.post-meta {
  color: var(--color-text-light);
  font-size: 0.9rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.post-content {
  padding: 1.5rem 0 3rem;
}

.post-content p {
  margin-bottom: 1.5rem;
}

.post-content h2 {
  font-size: 1.4rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

.post-content h3 {
  font-size: 1.2rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.post-content ul, .post-content ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.post-content li {
  margin-bottom: 0.5rem;
}

.post-content code {
  background: var(--color-bg-warm);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
}

.post-content pre {
  background: var(--color-bg-warm);
  padding: 1.25rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

.post-content pre code {
  background: none;
  padding: 0;
}

.post-content blockquote {
  border-left: 3px solid var(--color-accent);
  padding-left: 1.5rem;
  margin: 1.5rem 0;
  color: var(--color-text-light);
  font-style: italic;
}

.ai-callout {
  background: var(--color-bg-warm);
  border-left: 3px solid var(--color-accent);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: 2rem;
  font-size: 0.95rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.ai-callout a {
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 500;
}

.ai-callout a:hover {
  text-decoration: underline;
}

.schedule {
  background: var(--color-bg-warm);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.9rem;
}

.schedule-row {
  display: flex;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--color-border);
}

.schedule-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.schedule-row:first-child {
  padding-top: 0;
}

.schedule-time {
  flex-shrink: 0;
  width: 7.5rem;
  font-weight: 600;
  color: var(--color-accent);
  font-variant-numeric: tabular-nums;
}

.schedule-activity {
  color: var(--color-text);
}

.post-subtitle {
  font-size: 1.15rem;
  color: var(--color-text-light);
  font-style: italic;
  margin-bottom: 0.5rem;
}

/* Notes card deck — accordion style */
.notes-deck-wrapper {
  /* Break out of the 800px container to center at viewport width */
  width: 100vw;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  margin: 2rem 0 2.5rem;
}

.notes-deck {
  display: flex;
  align-items: stretch;
  height: 340px;
  max-width: 1060px;
  margin: 0 auto;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.note-card {
  flex: 1 1 0%;
  min-width: 0;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  transition: flex-grow 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              flex-shrink 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              flex-basis 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              box-shadow 0.3s ease;
  border-right: 1px solid var(--color-border);
  background: var(--color-card);
}

.note-card:last-child,
.note-card:has(+ .week-divider) {
  border-right: none;
}

.note-card:hover,
.note-card.active {
  flex: 0 0 260px;
  box-shadow: 0 0 32px rgba(45, 42, 38, 0.15);
  z-index: 10;
}

.note-card img {
  width: 260px;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
  pointer-events: none;
}

.note-card figcaption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2.5rem 0.75rem 0.6rem;
  background: linear-gradient(to top, rgba(45, 42, 38, 0.7) 0%, transparent 100%);
  font-size: 0.75rem;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  text-align: left;
  line-height: 1.3;
  opacity: 0;
  transition: opacity 0.3s ease 0.1s;
  pointer-events: none;
}

.note-card:hover figcaption,
.note-card.active figcaption {
  opacity: 1;
}

/* Week dividers */
.week-divider {
  flex-shrink: 0;
  width: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-warm);
  border-left: 1px solid var(--color-border);
  border-right: 1px solid var(--color-border);
}

.week-divider span {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: 0.6rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--color-text-light);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
}


/* Rolling photo marquee */
.photo-marquee {
  /* Break out of the 800px container to span the full viewport */
  width: 100vw;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  margin: 2rem 0 2.5rem;
  overflow-x: auto;
  overflow-y: hidden;
  cursor: grab;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.photo-marquee::-webkit-scrollbar {
  display: none;
}

.photo-marquee.dragging {
  cursor: grabbing;
}

.marquee-track {
  display: flex;
  width: max-content;
}

.marquee-track img {
  height: 240px;
  width: auto;
  display: block;
  margin-right: 4px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.marquee-track img:hover {
  opacity: 0.85;
}

@media (max-width: 600px) {
  .marquee-track img {
    height: 170px;
  }
}

/* Inline photo pairs in post body */
.photo-row {
  display: flex;
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.photo-row img {
  width: 50%;
  min-width: 0;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  cursor: pointer;
  transition: opacity 0.2s;
}

.photo-row img:hover {
  opacity: 0.9;
}

/* Post action buttons (thesis / presentation downloads) */
.post-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem 0 2rem;
}

.post-actions a {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  background: var(--color-accent);
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.2s;
}

.post-actions a:hover {
  background: var(--color-accent-hover);
}

.post-actions a.secondary {
  background: transparent;
  color: var(--color-accent);
  border: 1px solid var(--color-accent);
}

.post-actions a.secondary:hover {
  background: var(--color-bg-warm);
}

/* Lightbox */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox-overlay.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-overlay img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius);
  cursor: default;
}

.lightbox-caption {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  text-align: center;
  max-width: 80vw;
}

.lightbox-close {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  color: rgba(255, 255, 255, 0.7);
  font-size: 2rem;
  cursor: pointer;
  background: none;
  border: none;
  line-height: 1;
  transition: color 0.2s;
  z-index: 1001;
}

.lightbox-close:hover {
  color: #fff;
}

.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.7);
  font-size: 2.5rem;
  cursor: pointer;
  background: none;
  border: none;
  padding: 1rem;
  transition: color 0.2s;
  z-index: 1001;
}

.lightbox-nav:hover {
  color: #fff;
}

.lightbox-prev {
  left: 0.5rem;
}

.lightbox-next {
  right: 0.5rem;
}

.back-link {
  display: inline-block;
  margin-top: 2rem;
  color: var(--color-accent);
  text-decoration: none;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 500;
}

.back-link:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 600px) {
  html {
    font-size: 16px;
  }

  :root {
    --spacing: 1.25rem;
  }

  nav ul {
    gap: 1.25rem;
  }

  .hero {
    padding: 4rem 0 3rem;
  }

  .hero h1 {
    font-size: 2.2rem;
  }

  .about {
    margin: 0 0.5rem 2rem;
    padding: 2rem 1.5rem;
  }

  .notes-deck {
    height: 260px;
  }

  .notes-deck-wrapper {
    padding: 0 0.5rem;
  }

  .note-card:hover,
  .note-card.active {
    flex: 0 0 200px;
  }

  .note-card img {
    width: 200px;
  }

  .lightbox-nav {
    font-size: 1.8rem;
    padding: 0.5rem;
  }

  footer {
    border-radius: 1.5rem 1.5rem 0 0;
  }
}
