@font-face {
  font-family: 'Ramabhadra';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/Ramabhadra.ttf') format('truetype');
}

/* ============================================
   CSS Variables
   ============================================ */
:root {
  /* Colors - Dark theme */
  --bg: #1f1e20;
  --surface: #363438;
  --text: #e8e4df;
  --text-muted: #888;
  --accent: #C49A6C;
  --accent-soft: #d4a87a;
  --border: #4a4749;
  --code-bg: #2a292b;

  /* Typography */
  --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-heading: 'Ramabhadra', sans-serif;
  --line-height: 1.6;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
}

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

html {
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  color: var(--text);
  line-height: var(--line-height);
  min-height: 100vh;
}

/* ============================================
   Homepage Styles
   ============================================ */
.home-layout {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: var(--space-md);
}

.home-card {
  max-width: 700px;
  padding: 0 25px;
  border-right: 4px solid var(--accent);
}

.home-card h1 {
  font-family: var(--font-heading);
  font-size: 4rem;
  line-height: 0.85;
  padding-bottom: var(--space-lg);
  color: var(--accent);
}

.home-card h2 {
  font-size: 2rem;
  font-weight: normal;
  color: var(--accent);
}

.home-current {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: var(--space-sm);
}

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

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

.home-social {
  padding-top: var(--space-md);
}

.home-social a {
  color: var(--text-muted);
  text-decoration: none;
  text-transform: uppercase;
  line-height: 2em;
  padding-right: 20px;
  transition: color 0.2s ease;
}

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

.home-notes {
  padding-top: var(--space-lg);
}

.home-notes-label {
  display: block;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-xs);
}

.home-notes a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

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

/* ============================================
   Essay Page Styles
   ============================================ */
.essay-layout {
  min-height: 100vh;
  padding: var(--space-lg) var(--space-md);
}

.essay-container {
  max-width: 72ch;
  margin: 0 auto;
  background-color: var(--surface);
  border-radius: 10px;
  padding: var(--space-xl) var(--space-lg);
}

.essay-header {
  margin-bottom: var(--space-xl);
}

.essay-header h1 {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: var(--space-sm);
}

.essay-nav {
  margin-bottom: var(--space-md);
}

.essay-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.5rem 0.75rem;
  margin: -0.5rem -0.75rem;
  transition: color 0.2s ease;
}

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

/* Essay content */
.essay-content {
  color: var(--text);
}

.essay-content p {
  margin-bottom: 1em;
}

.essay-content h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  margin-top: var(--space-xl);
  margin-bottom: var(--space-sm);
  color: var(--text);
}

.essay-content h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  margin-top: var(--space-lg);
  margin-bottom: var(--space-sm);
  color: var(--text);
}

.essay-content a {
  color: var(--accent-soft);
  text-decoration: underline;
  text-decoration-color: rgba(212, 168, 122, 0.4);
  text-underline-offset: 2px;
  transition: text-decoration-color 0.2s ease;
}

.essay-content a:hover {
  text-decoration-color: var(--accent-soft);
}

/* Lists with accent bullets */
.essay-content ul {
  list-style: none;
  margin-bottom: 1em;
  padding-left: 1.5em;
}

.essay-content ul li {
  position: relative;
  margin-bottom: 0.5em;
}

.essay-content ul li::before {
  content: '•';
  color: var(--accent-soft);
  position: absolute;
  left: -1.2em;
  font-weight: bold;
}

.essay-content ol {
  margin-bottom: 1em;
  padding-left: 1.5em;
}

.essay-content ol li {
  margin-bottom: 0.5em;
}

/* Blockquotes with accent border */
.essay-content blockquote {
  border-left: 3px solid var(--accent);
  padding-left: var(--space-md);
  margin: var(--space-md) 0;
  color: var(--text);
  font-style: italic;
}

/* Code */
.essay-content code {
  font-family: 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.9em;
  background-color: var(--code-bg);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

.essay-content pre {
  background-color: var(--code-bg);
  padding: var(--space-md);
  border-radius: 6px;
  overflow-x: auto;
  margin: var(--space-md) 0;
}

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

/* Essay footer */
.essay-footer {
  margin-top: var(--space-xl);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.9rem;
}

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

.essay-footer a:hover {
  color: var(--accent-soft);
}

/* ============================================
   Responsive
   ============================================ */
@media screen and (max-width: 449px) {
  html {
    font-size: 16px;
  }

  .home-card {
    max-width: 300px;
  }

  .home-card h1 {
    font-size: 2.7rem;
  }

  .home-card h2 {
    font-size: 1.4rem;
  }

  .home-social a {
    font-size: 0.75rem;
    padding-right: 8px;
  }

  .essay-container {
    padding: var(--space-md);
    border-radius: 0;
  }

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

@media screen and (min-width: 450px) and (max-width: 549px) {
  .home-card {
    max-width: 400px;
  }

  .home-card h1 {
    font-size: 3.5rem;
  }

  .home-card h2 {
    font-size: 1.8rem;
  }

  .home-social a {
    font-size: 1rem;
    padding-right: 10px;
  }
}

@media screen and (min-width: 550px) and (max-width: 749px) {
  .home-card {
    max-width: 500px;
  }

  .home-card h1 {
    font-size: 4rem;
  }

  .home-card h2 {
    font-size: 2rem;
  }
}

@media screen and (min-width: 750px) {
  html {
    font-size: 17px;
  }

  .home-card {
    max-width: 700px;
  }

  .essay-container {
    padding: var(--space-xl) 3rem;
  }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
  :root {
    --bg: #fff;
    --surface: #fff;
    --text: #000;
    --text-muted: #555;
  }

  body {
    background: #fff;
    color: #000;
  }

  .essay-layout {
    padding: 0;
  }

  .essay-container {
    background: none;
    padding: 0;
    max-width: none;
  }

  .essay-nav,
  .essay-footer {
    display: none;
  }

  .essay-content a {
    color: #000;
    text-decoration: underline;
  }

  .essay-content a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #555;
  }
}
