/* cassinaresearch.com — Premium Research Design v2 */

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

/* ========== Theme Variables (Warm Light) ========== */
:root {
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: Verdana, Geneva, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', monospace;

  --color-bg: #faf8f5;
  --color-bg-rgb: 250, 248, 245;
  --color-surface: #ffffff;
  --color-surface-hover: #f5f2ee;
  --color-surface-elevated: #ffffff;
  --color-text: #3d3630;
  --color-text-secondary: #6b6258;
  --color-muted: #9e9488;
  --color-accent: #6b6258;
  --color-accent-hover: #3d3630;
  --color-accent-dim: rgba(107, 98, 88, 0.06);
  --color-border: rgba(61, 54, 48, 0.1);
  --color-border-hover: rgba(61, 54, 48, 0.18);
  --color-code-bg: #f5f2ee;
  --color-code-border: rgba(61, 54, 48, 0.08);
  --color-overlay: rgba(0, 0, 0, 0.3);
  --color-scrollbar: rgba(61, 54, 48, 0.08);
  --color-scrollbar-hover: rgba(61, 54, 48, 0.15);

  --max-width: 680px;
  --nav-height: 60px;
  --page-padding: 24px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 0 40px rgba(107, 98, 88, 0.04);
}

/* ========== Dark Theme ========== */
[data-theme="dark"] {
  --color-bg: #1a1714;
  --color-bg-rgb: 26, 23, 20;
  --color-surface: #231f1b;
  --color-surface-hover: #2c2722;
  --color-surface-elevated: #2c2722;
  --color-text: #e8e2da;
  --color-text-secondary: #b5ada3;
  --color-muted: #7d756b;
  --color-accent: #b5ada3;
  --color-accent-hover: #e8e2da;
  --color-accent-dim: rgba(181, 173, 163, 0.08);
  --color-border: rgba(255, 255, 255, 0.07);
  --color-border-hover: rgba(255, 255, 255, 0.14);
  --color-code-bg: #1e1b17;
  --color-code-border: rgba(255, 255, 255, 0.06);
  --color-overlay: rgba(0, 0, 0, 0.6);
  --color-scrollbar: rgba(255, 255, 255, 0.06);
  --color-scrollbar-hover: rgba(255, 255, 255, 0.12);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 40px rgba(181, 173, 163, 0.04);
}

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

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background 0.3s ease, color 0.3s ease;
}

img { max-width: 100%; height: auto; display: block; }

/* Custom scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--color-scrollbar);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-scrollbar-hover);
}

/* ========== Typography ========== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-ui);
  font-weight: 600;
  line-height: 1.25;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

h1 { font-size: 2rem; margin-bottom: 12px; }
h2 { font-size: 1.375rem; margin-top: 2.5rem; margin-bottom: 0.75rem; }
h3 { font-size: 1.125rem; margin-top: 2rem; margin-bottom: 0.5rem; }

p { margin-bottom: 1.25rem; }

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

::selection {
  background: rgba(107, 98, 88, 0.2);
  color: var(--color-text);
}

strong { font-weight: 600; }

ul, ol { margin-bottom: 1.25rem; padding-left: 1.5rem; }
li { margin-bottom: 0.35rem; }

blockquote {
  margin: 1.75rem 0;
  padding: 1.25rem 1.5rem;
  border-left: 3px solid var(--color-accent);
  background: var(--color-accent-dim);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  color: var(--color-text-secondary);
}

blockquote p:last-child { margin-bottom: 0; }

hr {
  border: none;
  height: 1px;
  background: var(--color-border);
  margin: 2.5rem 0;
}

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--color-code-bg);
  border: 1px solid var(--color-code-border);
  padding: 2px 7px;
  border-radius: 5px;
  color: var(--color-accent);
}

pre {
  margin-bottom: 1.5rem;
  padding: 1.25rem;
  background: var(--color-code-bg);
  overflow-x: auto;
  border: 1px solid var(--color-code-border);
  border-radius: var(--radius-sm);
}

pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--color-text-secondary);
}

/* ========== Reading Progress Bar ========== */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent-hover));
  z-index: 1002;
  transition: width 0.1s linear;
  box-shadow: 0 0 8px rgba(107, 98, 88, 0.3);
}

/* ========== Layout ========== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: calc(var(--nav-height) + 48px) var(--page-padding) 48px;
  flex: 1;
}

.container.prose {
  max-width: var(--max-width);
  padding: calc(var(--nav-height) + 48px) var(--page-padding) 48px;
}

/* ========== Navigation — Premium Top Bar ========== */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-height);
  background: rgba(var(--color-bg-rgb), 0.8);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--color-border);
}

.nav-container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 var(--page-padding);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.site-name {
  font-family: var(--font-ui);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--color-text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: opacity 0.2s ease;
}

.site-name:hover {
  color: var(--color-text);
  opacity: 0.8;
}

.logo-mark {
  width: auto;
  height: 24px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-mark img {
  height: 100%;
  width: auto;
  display: block;
}

/* Hamburger — hidden */
.hamburger { display: none; }

/* Nav links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-links li { margin: 0; }

.nav-links a {
  display: block;
  padding: 6px 14px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-muted);
  text-decoration: none;
  border-radius: var(--radius-xs);
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-links a:hover {
  color: var(--color-text);
  background: var(--color-surface);
}

.nav-links a[aria-current="page"] {
  color: var(--color-text);
  background: var(--color-surface);
}

/* Nav right actions */
.nav-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-muted);
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
  font-size: 18px;
}

.nav-btn:hover {
  color: var(--color-text);
  background: var(--color-surface);
}

.nav-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-link-partners {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-muted);
  text-decoration: none;
  padding: 6px 14px;
  border: 1px solid var(--color-border);
  border-radius: 100px;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  white-space: nowrap;
}

.nav-link-partners:hover {
  color: var(--color-text);
  border-color: var(--color-border-hover);
  background: var(--color-surface);
}

/* ========== Search Modal ========== */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: var(--color-overlay);
  backdrop-filter: blur(4px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: min(20vh, 180px);
}

.search-overlay.open {
  display: flex;
}

.search-modal {
  width: 100%;
  max-width: 560px;
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border-hover);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: searchIn 0.15s ease-out;
}

@keyframes searchIn {
  from { opacity: 0; transform: scale(0.98) translateY(-8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.search-input-wrapper {
  display: flex;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid var(--color-border);
}

.search-input-wrapper svg {
  width: 18px;
  height: 18px;
  stroke: var(--color-muted);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  padding: 16px 14px;
  background: none;
  border: none;
  color: var(--color-text);
  font-family: var(--font-ui);
  font-size: 1rem;
  outline: none;
}

.search-input::placeholder {
  color: var(--color-muted);
}

.search-kbd {
  font-family: var(--font-ui);
  font-size: 0.6875rem;
  color: var(--color-muted);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}

.search-results {
  max-height: 360px;
  overflow-y: auto;
  padding: 8px;
}

.search-result-item {
  display: block;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background 0.15s ease;
}

.search-result-item:hover {
  background: var(--color-surface-hover);
}

.search-result-title {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 2px;
}

.search-result-desc {
  font-size: 0.8125rem;
  color: var(--color-muted);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-empty {
  padding: 24px;
  text-align: center;
  color: var(--color-muted);
  font-size: 0.875rem;
}

.search-footer {
  padding: 10px 20px;
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.75rem;
  color: var(--color-muted);
}

/* ========== Homepage ========== */
.site-header {
  margin-bottom: 3.5rem;
  padding-top: 1.5rem;
  position: relative;
}

/* Subtle gradient orb behind hero */
.site-header::before {
  content: '';
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 500px;
  height: 300px;
  background: radial-gradient(ellipse at center, rgba(107, 98, 88, 0.04) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}

.site-title {
  font-family: var(--font-ui);
  font-size: 2.75rem;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.1;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, var(--color-text) 0%, var(--color-text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.site-title a {
  background: linear-gradient(135deg, var(--color-text) 0%, var(--color-text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
}

.site-tagline {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--color-muted);
  font-weight: 400;
  letter-spacing: 0.01em;
}

/* Essay List */
.essays-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.essay-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.125rem 1.25rem;
  margin: 0 -1.25rem;
  border-radius: var(--radius-sm);
  transition: background 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
  cursor: pointer;
  color: inherit;
}

.essay-item:hover {
  background: var(--color-surface);
  box-shadow: var(--shadow-glow);
}

.essay-item::before { display: none; }

.essay-item-content {
  flex: 1;
  min-width: 0;
}

.essay-item-title {
  font-family: var(--font-ui);
  font-size: 1.0625rem;
  font-weight: 500;
  color: var(--color-text);
  text-decoration: none;
  letter-spacing: -0.01em;
  transition: color 0.2s ease;
  display: block;
}

.essay-item:hover .essay-item-title {
  color: var(--color-accent);
}

.essay-item-description {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--color-muted);
  margin-top: 0.25rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.essay-item-meta {
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  color: var(--color-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.essay-item-arrow {
  color: var(--color-muted);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  flex-shrink: 0;
  font-size: 1rem;
}

.essay-item:hover .essay-item-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* Staggered fade-in for essay items */
.essay-item {
  animation: fadeInUp 0.5s ease-out both;
}
.essay-item:nth-child(1) { animation-delay: 0.05s; }
.essay-item:nth-child(2) { animation-delay: 0.1s; }
.essay-item:nth-child(3) { animation-delay: 0.15s; }
.essay-item:nth-child(4) { animation-delay: 0.2s; }
.essay-item:nth-child(5) { animation-delay: 0.25s; }
.essay-item:nth-child(6) { animation-delay: 0.3s; }
.essay-item:nth-child(7) { animation-delay: 0.35s; }
.essay-item:nth-child(8) { animation-delay: 0.4s; }
.essay-item:nth-child(9) { animation-delay: 0.45s; }
.essay-item:nth-child(10) { animation-delay: 0.5s; }

/* ========== Breadcrumb ========== */
.breadcrumb {
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  color: var(--color-muted);
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
}

.breadcrumb a {
  color: var(--color-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

.breadcrumb .sep {
  margin: 0 8px;
  color: var(--color-border-hover);
}

/* ========== Essay Page ========== */
.essay-header {
  margin-bottom: 2.5rem;
}

.essay-header h1 {
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--color-text);
}

.essay-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.essay-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.3rem 0.875rem;
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  color: var(--color-muted);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 100px;
}

.essay-date {
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  color: var(--color-muted);
  display: block;
}

.essay-content {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.75;
  color: var(--color-text-secondary);
  margin-bottom: 2.5rem;
}

.essay-content h2 {
  font-family: var(--font-ui);
  color: var(--color-text);
  margin-top: 2.75rem;
  margin-bottom: 0.75rem;
}

.essay-content h3 {
  font-family: var(--font-ui);
  color: var(--color-text);
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

.essay-content p {
  margin-bottom: 1.375rem;
}

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

.essay-content li {
  margin-bottom: 0.4rem;
  color: var(--color-text-secondary);
}

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

.essay-content a {
  color: var(--color-accent);
  text-decoration: none;
  background-image: linear-gradient(var(--color-accent), var(--color-accent));
  background-size: 0% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.3s ease, color 0.2s ease;
}

.essay-content a:hover {
  color: var(--color-accent-hover);
  background-size: 100% 1px;
}

.essay-content img {
  margin: 2rem 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
}

.essay-content figure {
  margin: 2rem 0;
  text-align: center;
}

.essay-content figure img {
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  max-width: 100%;
  margin: 0;
}

.essay-content figure figcaption {
  font-size: 0.8125rem;
  color: var(--color-muted);
  margin-top: 0.625rem;
  font-style: italic;
  line-height: 1.5;
}

.essay-content hr {
  border: none;
  height: 1px;
  background: var(--color-border);
  margin: 2.5rem 0;
}

.essay-content blockquote {
  margin: 2rem 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.75;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-ui);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-muted);
  padding: 0.5rem 1.125rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  margin-top: 2.5rem;
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.back-link:hover {
  color: var(--color-text);
  border-color: var(--color-border-hover);
  background: var(--color-surface);
}

/* ========== FAQ / RAQ Pages ========== */
.page-header {
  margin-bottom: 2.5rem;
}

.page-header h1 {
  margin-bottom: 0.5rem;
}

.page-header .subtitle {
  font-family: var(--font-body);
  color: var(--color-muted);
  font-size: 0.9375rem;
}

.qa-list {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.qa-item {
  padding: 1.375rem 1.5rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.qa-item:hover {
  border-color: var(--color-border-hover);
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}

.qa-item h3 {
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 600;
  margin-top: 0;
  margin-bottom: 0.5rem;
  color: var(--color-text);
}

.qa-item p {
  font-family: var(--font-body);
  color: var(--color-text-secondary);
  font-size: 0.9375rem;
  line-height: 1.7;
}

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

/* Staggered fade for QA items */
.qa-item {
  animation: fadeInUp 0.5s ease-out both;
}
.qa-item:nth-child(1) { animation-delay: 0.05s; }
.qa-item:nth-child(2) { animation-delay: 0.1s; }
.qa-item:nth-child(3) { animation-delay: 0.15s; }
.qa-item:nth-child(4) { animation-delay: 0.2s; }
.qa-item:nth-child(5) { animation-delay: 0.25s; }

/* ========== Footer ========== */
footer {
  margin-top: auto;
  padding: 2rem 0;
  border-top: 1px solid var(--color-border);
}

.footer-container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 var(--page-padding);
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  color: var(--color-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.footer-right a {
  color: var(--color-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-right a:hover {
  color: var(--color-text);
}

/* ========== Scroll to Top ========== */
.scroll-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 900;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-muted);
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease, color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  pointer-events: none;
  box-shadow: var(--shadow-md);
}

.scroll-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.scroll-top:hover {
  color: var(--color-text);
  border-color: var(--color-border-hover);
  background: var(--color-surface-hover);
}

.scroll-top svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ========== Empty State ========== */
.empty-state {
  text-align: center;
  padding: 5rem 0;
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1.5rem;
  opacity: 0.2;
}

.empty-state h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--color-text), var(--color-muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.empty-state p {
  font-family: var(--font-body);
  color: var(--color-muted);
  font-size: 0.9375rem;
}

/* ========== 404 ========== */
.not-found {
  text-align: center;
  padding: 6rem var(--page-padding);
}

.not-found h1 {
  font-size: 8rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--color-accent), var(--color-muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.04em;
}

.not-found p {
  font-family: var(--font-body);
  color: var(--color-muted);
  margin-bottom: 2rem;
  font-size: 0.9375rem;
}

.not-found a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-ui);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  text-decoration: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.not-found a:hover {
  border-color: var(--color-border-hover);
  background: var(--color-surface);
}

/* ========== Responsive ========== */
@media (max-width: 640px) {
  :root {
    --page-padding: 20px;
    --nav-height: 52px;
  }

  .site-title {
    font-size: 2rem;
  }

  .essay-header h1 {
    font-size: 1.75rem;
  }

  .essay-content {
    font-size: 1.0625rem;
  }

  .essay-item {
    padding: 0.875rem 1rem;
    margin: 0 -1rem;
  }

  .not-found h1 {
    font-size: 5rem;
  }

  .nav-left {
    gap: 0.75rem;
  }

  .site-name-text {
    display: none;
  }

  .nav-links a {
    padding: 6px 10px;
    font-size: 0.8125rem;
  }

  .nav-link-partners {
    display: none;
  }

  .footer-container {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }

  .search-modal {
    margin: 0 16px;
  }

  .scroll-top {
    bottom: 20px;
    right: 20px;
  }

  .site-header::before {
    width: 300px;
    height: 200px;
  }
}

/* ========== Print ========== */
@media print {
  nav, footer, .back-link, .scroll-top, .search-overlay, .reading-progress { display: none; }
  body { background: white; color: black; font-size: 11pt; }
  body::before { display: none; }
  .container { max-width: 100%; padding: 0; }
  h1, h2, h3, h4, h5, h6, .essay-content strong { color: black; }
  .essay-content { color: #333; }
  a { color: black; text-decoration: underline; }
}

/* ========== Accessibility ========== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* ========== Animations ========== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.container {
  animation: fadeIn 0.4s ease-out;
}
