@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600;700&family=Source+Sans+3:wght@300;400;500;600&display=swap');

:root {
  --ink: #0b1020;
  --ink-soft: #28304a;
  --paper: rgba(248, 250, 252, 0.94);
  --paper-strong: rgba(248, 250, 252, 0.98);
  --accent: #3b4dd8;
  --accent-dark: #2b3fb8;
  --accent-soft: rgba(59, 77, 216, 0.14);
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.2);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Source Sans 3', 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.7;
  color: var(--ink);
  background-color: #f8fafc;
}

body.landing {
  background-color: #0b1220;
  background-image:
    linear-gradient(180deg, rgba(7, 14, 26, 0.75), rgba(7, 14, 26, 0.9)),
    url('background_2.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

body.reads {
  background-color: #f3f4f6;
  background-image:
    linear-gradient(180deg, rgba(248, 250, 252, 0.35), rgba(248, 250, 252, 0.55)),
    url('library_background.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

body.research {
  background-color: #101527;
  background-image:
    radial-gradient(circle at top left, rgba(59, 77, 216, 0.08), transparent 55%),
    radial-gradient(circle at 20% 40%, rgba(129, 140, 248, 0.1), transparent 60%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(15, 23, 42, 0.98));
}

.layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr;
  min-height: 100vh;
}

.sidebar {
  padding: 2.5rem 1.8rem;
  background: #eef1f7;
  border-right: 1px solid rgba(148, 163, 184, 0.3);
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.brand {
  font-family: 'Cormorant Garamond', 'Times New Roman', serif;
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--ink);
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.nav-link {
  text-decoration: none;
  color: var(--ink-soft);
  font-weight: 600;
  padding: 0.4rem 0;
  border-bottom: 1px solid transparent;
}

.nav-link.active {
  color: var(--accent-dark);
  border-color: rgba(59, 77, 216, 0.35);
}

.sidebar-footer {
  margin-top: auto;
  font-size: 0.85rem;
  color: #94a3b8;
}

.content {
  padding: 3rem 4vw 4rem;
}

.landing-hero {
  display: flex;
  align-items: center;
  min-height: calc(100vh - 6rem);
}

.landing-card {
  background: transparent;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  display: flex;
  flex-wrap: wrap;
  gap: 3.5rem;
  align-items: center;
  justify-content: space-between;
}

.landing-text h1 {
  margin: 0 0 0.5rem 0;
  font-family: 'Cormorant Garamond', 'Times New Roman', serif;
  font-size: 2.8rem;
  color: #f8fafc;
}

.tagline {
  margin: 0 0 1rem 0;
  color: #dbe3ff;
}

.email-line {
  margin: 0 0 1.4rem 0;
  font-weight: 600;
  color: #dbe3ff;
}

.email-line a {
  color: #c7d2fe;
}

.landing-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.landing-photo img {
  width: 230px;
  height: 230px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid rgba(199, 210, 254, 0.6);
  box-shadow: 0 18px 40px rgba(3, 7, 18, 0.4);
}

.btn {
  display: inline-block;
  padding: 0.6rem 1.4rem;
  border-radius: 999px;
  border: 1px solid rgba(199, 210, 254, 0.6);
  text-decoration: none;
  color: #0f172a;
  background: rgba(248, 250, 252, 0.85);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.audio-line {
  border: none;
  background: transparent;
  padding: 0;
  margin-bottom: 1.4rem;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: #dbe3ff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

.audio-line:hover {
  color: #f8fafc;
}

.waveform {
  display: inline-flex;
  gap: 0.2rem;
  align-items: flex-end;
  height: 16px;
}

.waveform span {
  display: block;
  width: 3px;
  height: 6px;
  background: rgba(199, 210, 254, 0.9);
  border-radius: 2px;
  animation: wave 1.2s ease-in-out infinite;
  animation-play-state: paused;
}

.waveform span:nth-child(2) { animation-delay: 0.1s; }
.waveform span:nth-child(3) { animation-delay: 0.2s; }
.waveform span:nth-child(4) { animation-delay: 0.3s; }
.waveform span:nth-child(5) { animation-delay: 0.4s; }
.waveform span:nth-child(6) { animation-delay: 0.5s; }
.waveform span:nth-child(7) { animation-delay: 0.6s; }
.waveform span:nth-child(8) { animation-delay: 0.7s; }
.waveform span:nth-child(9) { animation-delay: 0.8s; }
.waveform span:nth-child(10) { animation-delay: 0.9s; }

.audio-line.playing .waveform span {
  animation-play-state: running;
}

@keyframes wave {
  0%, 100% { height: 6px; opacity: 0.6; }
  50% { height: 16px; opacity: 1; }
}

.btn.primary {
  background: linear-gradient(120deg, rgba(59, 77, 216, 0.95), rgba(111, 66, 193, 0.95));
  color: #f8fafc;
  border-color: transparent;
  box-shadow: 0 12px 30px rgba(59, 77, 216, 0.3);
}

.page-card {
  background: rgba(248, 250, 252, 0.92);
  border-radius: 1.5rem;
  padding: 2rem 2.4rem;
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
}

body.research .page-card {
  background: rgba(248, 250, 252, 0.88);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.35);
}

body.reads .page-card {
  background: rgba(15, 23, 42, 0.78);
  color: #eef2ff;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.25);
}

body.reads .page-card h1,
body.reads .page-card h2 {
  color: #f8fafc;
}

body.reads .page-card a {
  color: #a5b4fc;
}

body.reads .list-plain li {
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

.name-audio {
  margin-bottom: 1.4rem;
}

.reading-link {
  font-size: 1.35rem;
  font-weight: 600;
}

.reading-tags {
  margin-top: 0.6rem;
  font-size: 0.9rem;
  color: #dbe3ff;
}

.quote-card p {
  font-size: 1.1rem;
  font-style: italic;
}

.reads-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

section h1,
section h2 {
  font-family: 'Cormorant Garamond', 'Times New Roman', serif;
  margin-top: 0;
}

.item {
  margin-bottom: 1.4rem;
}

.item h3 {
  margin: 0 0 0.4rem 0;
  font-size: 1.05rem;
}

.location {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink-soft);
  margin-left: 0.4rem;
}

.vault-intro {
  color: var(--ink-soft);
}

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

.vault-card {
  border-radius: 1rem;
  background: var(--paper);
  border: 1px solid rgba(15, 118, 110, 0.15);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.15);
  overflow: hidden;
}

.vault-card[open] {
  grid-column: 1 / -1;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.2);
}

.vault-card summary {
  cursor: pointer;
  list-style: none;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background: var(--accent-soft);
}

.vault-card summary::-webkit-details-marker {
  display: none;
}

.vault-title {
  font-weight: 600;
}

.vault-meta {
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.vault-body {
  padding: 1rem;
  max-height: 70vh;
  overflow: auto;
}

.vault-body img,
.vault-body video {
  width: 100%;
  margin-top: 0.75rem;
  border-radius: 0.75rem;
}

.list-plain {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.list-plain li {
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(15, 118, 110, 0.15);
}

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

.hint {
  color: var(--ink-soft);
}

.reading-photo {
  width: 170px;
  height: 170px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin: 0;
  border: 3px solid rgba(59, 77, 216, 0.2);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.15);
}

/* Research Vault hero */
.vault-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.vault-headshot {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 3px solid rgba(59, 77, 216, 0.25);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.2);
}

/* Blog entries */
.blog-entry-date {
  font-family: 'Cormorant Garamond', 'Times New Roman', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-dark);
  margin-top: 0;
  margin-bottom: 0.75rem;
}

.blog-img-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.blog-img-grid img {
  width: 100%;
  height: 220px;
  border-radius: 0.75rem;
  object-fit: cover;
  display: block;
}

.blog-img-single img {
  width: 100%;
  max-width: 640px;
  border-radius: 0.75rem;
  margin-top: 1rem;
  object-fit: cover;
  display: block;
}

.blog-video {
  margin-top: 1rem;
}

.blog-video video {
  width: 100%;
  border-radius: 0.75rem;
  display: block;
}

.blog-caption {
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin-top: 0.5rem;
  font-style: italic;
}

/* CV PDF Viewer */
.cv-viewer-card {
  padding: 0;
  overflow: hidden;
}

.cv-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background: #eef1f7;
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
}

.cv-toolbar-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.cv-pdf-icon {
  width: 20px;
  height: 20px;
  color: #e53e3e;
  flex-shrink: 0;
}

.cv-filename {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
}

.cv-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 1.1rem;
  background: linear-gradient(120deg, rgba(59, 77, 216, 0.95), rgba(111, 66, 193, 0.95));
  color: #f8fafc;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: opacity 0.15s ease, transform 0.15s ease;
  box-shadow: 0 4px 14px rgba(59, 77, 216, 0.3);
}

.cv-download-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.cv-frame-wrap {
  width: 100%;
  height: calc(100vh - 220px);
  min-height: 500px;
}

.cv-frame-wrap iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

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

  .sidebar {
    border-right: none;
    border-bottom: 1px solid rgba(148, 163, 184, 0.3);
  }

  .content {
    padding: 2rem 6vw 3rem;
  }
}

@media (max-width: 640px) {
  .landing-card {
    padding: 2rem;
  }

  .landing-photo img {
    width: 170px;
    height: 170px;
  }

  .reads-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .reading-photo {
    width: 140px;
    height: 140px;
  }
}
