@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:wght@500;600&display=swap');

:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --text: #111111;
  --text-secondary: #3f3f3f;
  --muted: #737373;
  --nav: #666666;
  --nav-hover: #000000;
  --border: #e6e6e6;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.06);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0d0d0d;
    --surface: #151515;
    --text: #f2f2f2;
    --text-secondary: #d4d4d4;
    --muted: #a3a3a3;
    --nav: #b0b0b0;
    --nav-hover: #ffffff;
    --border: #303030;
    --shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
  }
}

:root[data-theme='dark'] {
  --bg: #0d0d0d;
  --surface: #151515;
  --text: #f2f2f2;
  --text-secondary: #d4d4d4;
  --muted: #a3a3a3;
  --nav: #b0b0b0;
  --nav-hover: #ffffff;
  --border: #303030;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
}

:root[data-theme='light'] {
  --bg: #fafafa;
  --surface: #ffffff;
  --text: #111111;
  --text-secondary: #3f3f3f;
  --muted: #737373;
  --nav: #666666;
  --nav-hover: #000000;
  --border: #e6e6e6;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  transition: background 0.2s ease, color 0.2s ease;
}

.container {
  max-width: 760px;
  margin: 88px auto;
  padding: 0 24px;
}

.site-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  margin-bottom: 64px;
}

.site-title {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  letter-spacing: -0.01em;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 0.95rem;
}

.site-nav a,
nav a {
  text-decoration: none;
  color: var(--nav);
  position: relative;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.site-nav a:hover,
.site-nav a.active,
nav a:hover {
  color: var(--nav-hover);
}

.site-nav a::after,
nav a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 1px;
  left: 0;
  bottom: -4px;
  background: var(--nav-hover);
  transition: width 0.25s ease;
}

.site-nav a:hover::after,
.site-nav a.active::after,
nav a:hover::after {
  width: 100%;
}

.hero {
  margin-bottom: 72px;
}

.eyebrow {
  color: var(--muted);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.55rem, 8vw, 4.7rem);
  line-height: 1.02;
  font-weight: 600;
  letter-spacing: -0.045em;
  margin: 0 0 24px;
}

h2 {
  font-size: 1.25rem;
  margin: 3em 0 0.7em;
  font-weight: 600;
  letter-spacing: -0.015em;
}

h3 {
  font-size: 1.02rem;
  margin: 0 0 8px;
  font-weight: 600;
}

p {
  font-size: 1.05rem;
  line-height: 1.85;
  max-width: 68ch;
  color: var(--text-secondary);
}

.lede {
  font-size: 1.25rem;
  line-height: 1.75;
  color: var(--text-secondary);
}

nav {
  margin: 30px 0 50px;
  font-size: 0.95rem;
}

section {
  margin-bottom: 68px;
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 52px 0;
}

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

a:hover {
  opacity: 0.72;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.card {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--muted);
}

.card p {
  font-size: 0.98rem;
  line-height: 1.7;
  margin-bottom: 0;
}

.meta {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.7;
}

.list-clean {
  padding-left: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.9;
}

.back-link {
  display: inline-flex;
  margin-top: 32px;
  color: var(--nav);
  text-decoration: none;
}

.back-link:hover {
  color: var(--nav-hover);
}

#theme-toggle {
  position: fixed;
  right: 24px;
  bottom: 24px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
  box-shadow: var(--shadow);
  opacity: 0.9;
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease;
  z-index: 100;
}

#theme-toggle:hover {
  opacity: 1;
  transform: translateY(-1px);
}

a:focus,
button:focus {
  outline: 2px solid var(--muted);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

@media (max-width: 640px) {
  .container {
    margin: 44px auto 80px;
    padding: 0 20px;
  }

  .site-header {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 48px;
  }

  .site-nav {
    gap: 14px;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  #theme-toggle {
    right: 18px;
    bottom: 18px;
  }

  .page-intro {
  margin-bottom: 72px;
}

.writing-list {
  display: grid;
  gap: 22px;
  margin-top: 28px;
}

.writing-card {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  align-items: flex-end;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.writing-card h3 {
  font-size: 1.35rem;
  margin-bottom: 10px;
}

.writing-card h3 a {
  text-decoration: none;
  color: var(--text);
}

.writing-card p {
  margin-bottom: 0;
}

.read-link {
  white-space: nowrap;
  color: var(--nav);
  text-decoration: none;
  font-size: 0.95rem;
}

.read-link:hover {
  color: var(--nav-hover);
}

.article-container {
  max-width: 880px;
}

.article {
  padding-bottom: 80px;
}

.article-header {
  margin-bottom: 56px;
}

.article-header .eyebrow {
  margin-bottom: 24px;
}

.article-header h1 {
  max-width: 760px;
  margin-bottom: 28px;
}

.article-subtitle {
  max-width: 760px;
  margin-top: 0;
  margin-bottom: 30px;
  font-size: 1.25rem;
  line-height: 1.75;
  color: var(--text-secondary);
}

.article-meta-row {
  max-width: 760px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 20px;
  margin: 34px 0 0;
  padding: 14px 0 14px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.article-meta-topics,
.article-meta-readtime {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.article-meta-topics {
  max-width: 560px;
}

.article-meta-readtime {
  white-space: nowrap;
  text-align: right;
}

.key-idea {
  max-width: 760px;
  margin: 28px 0 64px;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.key-label {
  margin: 0 0 10px;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.key-text {
  margin: 0;
  padding-left: 18px;
  border-left: 3px solid var(--text);
  font-size: 1.08rem;
  line-height: 1.8;
  color: var(--text);
  max-width: 700px;
}

.article-body {
  max-width: 700px;
}

.article-body p {
  margin: 0 0 1.8em;
  font-size: 1.08rem;
  line-height: 1.95;
  color: var(--text-secondary);
}

.article-body p:first-child::first-letter {
  float: left;
  padding-right: 10px;
  font-family: 'Playfair Display', serif;
  font-size: 4.5rem;
  line-height: 0.86;
  color: var(--text);
}

blockquote {
  max-width: 720px;
  margin: 52px 0;
  padding-left: 26px;
  border-left: 3px solid var(--muted);
  font-family: 'Playfair Display', serif;
  font-size: 1.55rem;
  line-height: 1.5;
  color: var(--text);
}

.article-footer {
  margin-top: 64px;
}

@media (max-width: 640px) {
  .article-header {
    margin-bottom: 42px;
  }

  .article-header .eyebrow {
    margin-bottom: 22px;
  }

  .article-subtitle {
    font-size: 1.08rem;
    line-height: 1.7;
    margin-bottom: 24px;
  }

  .article-meta-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-top: 26px;
    padding: 12px 0;
  }

  .article-meta-topics,
  .article-meta-readtime {
    font-size: 0.76rem;
  }

  .key-idea {
    margin: 24px 0 48px;
  }

  .key-text {
    padding-left: 14px;
    font-size: 1rem;
    line-height: 1.75;
  }

  .article-body p {
    font-size: 1rem;
    line-height: 1.85;
  }

  .article-body p:first-child::first-letter {
    float: none;
    padding-right: 0;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
  }

  blockquote {
    font-size: 1.3rem;
    margin: 42px 0;
  }
}

.research-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 0 0 64px;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.95rem;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.primary-button {
  background: var(--text);
  color: var(--bg);
  border: 1px solid var(--text);
}

.secondary-button {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.primary-button:hover,
.secondary-button:hover {
  opacity: 0.82;
  transform: translateY(-1px);
}

.research-question {
  padding: 22px 26px;
  border-left: 3px solid var(--text);
  background: var(--surface);
  color: var(--text);
  font-size: 1.18rem;
  line-height: 1.75;
}

.finding-list {
  display: grid;
  gap: 18px;
  margin: 28px 0 48px;
}

.finding-item {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 18px;
  padding: 22px 0;
  border-top: 1px solid var(--border);
}

.finding-item:last-child {
  border-bottom: 1px solid var(--border);
}

.finding-item span {
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
}

.finding-item p {
  margin: 0;
  color: var(--text-secondary);
}

.pdf-preview-section {
  width: min(1100px, calc(100vw - 48px));
  max-width: none;
  margin-top: 80px;
  margin-left: 50%;
  transform: translateX(-50%);
}

.pdf-preview-section summary {
  cursor: pointer;
  list-style: none;
  padding: 18px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.pdf-preview-section summary::-webkit-details-marker {
  display: none;
}

.pdf-preview-section summary::before {
  content: "▾";
  display: inline-block;
  margin-right: 8px;
  transition: transform 0.2s ease;
}

.pdf-preview-section details:not([open]) summary::before {
  transform: rotate(-90deg);
}

.pdf-frame-wrapper {
  margin-top: 24px;
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.pdf-frame {
  width: 100%;
  height: 900px;
  border: 0;
  display: block;
}

@media (max-width: 640px) {
  .pdf-preview-section {
    width: calc(100vw - 32px);
    margin-top: 56px;
  }

  .pdf-frame {
    height: 620px;
  }
}

@media (max-width: 640px) {
  .research-actions {
    flex-direction: column;
  }

  .primary-button,
  .secondary-button {
    width: 100%;
  }

  .finding-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .pdf-frame {
    height: 520px;
  }
}
