/* ==========================================================================
   Design Tokens & CSS Variables
   ========================================================================== */
:root {
  /* Light Editorial Theme (Paper & Ink) */
  --bg-color: #FAF8F5;          /* Warm off-white paper */
  --text-primary: #1C201E;       /* Deep charcoal ink */
  --text-secondary: #484E4A;     /* Muted ink for paragraphs */
  --text-muted: #727A75;         /* Muted sage-gray for metadata */
  
  --accent-sage: #566D60;        /* Restrained editorial sage */
  --accent-copper: #A35A3D;      /* Burnt copper accent */
  --border-color: #E2DDD5;       /* Delicate paper-line border */
  
  --code-bg: #F3ECE2;            /* Light parchment for code blocks */
  --input-bg: #FAF9F6;           /* Slightly lighter paper for inputs */
  
  /* Typography Stacks (No remote fonts) */
  --font-serif: Georgia, Cambria, "Times New Roman", Times, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
  
  --max-width: 800px;
  --max-width-wide: 1000px;
  --transition-smooth: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Ink-on-Dark-Paper Fallback for System Dark Mode */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: #171816;
    --text-primary: #ECEAE4;
    --text-secondary: #AEB2AA;
    --text-muted: #7C8279;
    
    --accent-sage: #8AA495;
    --accent-copper: #D58461;
    --border-color: #2D302A;
    
    --code-bg: #21221F;
    --input-bg: #1B1C1A;
  }
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.625;
  color: var(--text-primary);
  position: relative;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  background: var(--text-primary);
  color: var(--bg-color);
  padding: 0.75rem 1rem;
  text-decoration: none;
  z-index: 1000;
}

.skip-link:focus {
  top: 1rem;
}

/* Custom Scrollbar (Subtle & Themed) */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-sage);
}

/* ==========================================================================
   Layout Containers
   ========================================================================== */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

main {
  flex-grow: 1;
  padding-top: 6rem;
  padding-bottom: 6rem;
}

hr.section-divider {
  border: 0;
  border-top: 1px dashed var(--border-color);
  margin: 4rem 0;
}

/* ==========================================================================
   Typography
   ========================================================================== */
h1, h2, h3, h4 {
  color: var(--text-primary);
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.2;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.25rem, 1.8rem + 2.25vw, 3.25rem);
  letter-spacing: -0.01em;
  margin-bottom: 1.5rem;
}

h2 {
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
}

h3 {
  font-size: 1.35rem;
  margin-bottom: 1rem;
}

p {
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
  font-family: var(--font-serif);
  font-size: 1.125rem;
  text-wrap: pretty;
}

/* Standard inline styling adjustments */
a {
  color: var(--accent-copper);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: var(--transition-smooth);
}

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

/* Focus Management for Accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent-copper);
  outline-offset: 4px;
}

/* ==========================================================================
   Header & Masthead Navigation
   ========================================================================== */
header {
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-color);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: var(--transition-smooth);
}

.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4.5rem;
}

.brand {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  border-bottom: none;
}

.brand span {
  font-weight: 400;
  color: var(--accent-sage);
  margin-left: 0.15rem;
}

.brand:hover {
  color: var(--accent-copper);
}

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

.nav-link {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  padding: 0.25rem 0;
  border-bottom: 1px solid transparent;
}

.nav-link:hover {
  color: var(--text-primary);
  border-bottom-color: var(--accent-sage);
}

.nav-link.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent-copper);
  font-weight: 600;
}

/* ==========================================================================
   Footer
   ========================================================================== */
footer {
  border-top: 1px solid var(--border-color);
  padding: 4rem 0;
  background: var(--bg-color);
  font-size: 0.875rem;
}

.footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer-info p {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0;
}

.footer-nav {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.footer-nav a {
  font-family: var(--font-sans);
  color: var(--text-muted);
  border-bottom: none;
}

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

/* ==========================================================================
   Home Hero Section
   ========================================================================== */
.hero {
  padding: 2rem 0;
}

.hero-meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--accent-sage);
  margin-bottom: 1rem;
}

.hero-title {
  margin-bottom: 0.5rem;
}

.hero-subtitle {
  font-family: var(--font-sans);
  font-size: 1.125rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  margin-bottom: 2.5rem;
}

.hero-intro {
  margin-bottom: 2.5rem;
}

.hero-intro p {
  font-size: 1.25rem;
  line-height: 1.68;
}

.hero-actions {
  display: flex;
  gap: 1.5rem;
}

/* ==========================================================================
   Disciplines Section (Structured Grid)
   ========================================================================== */
.disciplines {
  padding: 1rem 0;
}

.section-header {
  margin-bottom: 3rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.section-meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.section-link {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
  align-self: flex-start;
  margin-top: 0.5rem;
}

.disciplines-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
}

.discipline-col {
  position: relative;
  padding-top: 1.5rem;
}

.discipline-col::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 2rem;
  height: 1px;
  background: var(--accent-copper);
}

.discipline-num {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--accent-sage);
  margin-bottom: 0.75rem;
}

.discipline-title {
  font-size: 1.25rem;
  font-family: var(--font-serif);
  line-height: 1.3;
  margin-bottom: 0.75rem;
}

.discipline-desc {
  font-size: 0.95rem;
  line-height: 1.58;
  color: var(--text-secondary);
}

/* ==========================================================================
   Writing / Publication List
   ========================================================================== */
.recent-writing {
  padding: 1rem 0;
}

.writing-list {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.writing-item {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 2.5rem;
}

.writing-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.writing-meta {
  display: flex;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.writing-category {
  color: var(--accent-sage);
}

.writing-title {
  font-size: 1.45rem;
  margin-bottom: 0.5rem;
}

.writing-title a {
  color: var(--text-primary);
  border-bottom: none;
}

.writing-title a:hover {
  color: var(--accent-copper);
}

.writing-summary {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 0;
}

/* ==========================================================================
   Single Pages & Blog Posts
   ========================================================================== */
.article-container {
  max-width: 720px;
}

.article-header {
  text-align: left;
  margin-bottom: 2.5rem;
}

.article-meta-label {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--accent-sage);
  margin-bottom: 0.75rem;
}

.article-meta {
  display: flex;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.meta-divider {
  color: var(--border-color);
}

.article-subtitle-desc {
  font-size: 1.25rem;
  line-height: 1.5;
  color: var(--text-secondary);
  font-family: var(--font-serif);
  margin-top: 0.5rem;
  margin-bottom: 0;
}

.featured-img-container {
  width: 100%;
  max-height: 350px;
  overflow: hidden;
  margin-bottom: 3rem;
  border: 1px solid var(--border-color);
}

.featured-img {
  width: 100%;
  height: auto;
  object-fit: cover;
  display: block;
}

.post-content {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  line-height: 1.75;
  color: var(--text-primary);
}

.post-content h2, 
.post-content h3, 
.post-content h4 {
  font-family: var(--font-serif);
  font-weight: 400;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

.post-content h2 {
  font-size: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.25rem;
}

.post-content h3 {
  font-size: 1.25rem;
}

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

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

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

.post-content li {
  margin-bottom: 0.5rem;
  font-family: var(--font-serif);
  color: var(--text-secondary);
}

.post-content pre {
  background: var(--code-bg);
  border: 1px solid var(--border-color);
  padding: 1.25rem;
  overflow-x: auto;
  margin: 2rem 0;
}

.post-content code {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  background: var(--code-bg);
  padding: 0.15rem 0.35rem;
  border-radius: 2px;
  color: var(--text-primary);
}

.post-content pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: 0.8125rem;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-block;
  background: var(--text-primary);
  color: var(--bg-color);
  padding: 0.75rem 1.5rem;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  border: 1px solid var(--text-primary);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn:hover {
  background: var(--accent-copper);
  border-color: var(--accent-copper);
  color: #FFFFFF;
}

.btn:active {
  transform: translateY(1px);
}

/* ==========================================================================
   Contact Form & Simulated Success
   ========================================================================== */
.contact-form {
  max-width: 100%;
  margin: 2.5rem 0;
  background: var(--bg-color);
  border-top: 1px dashed var(--border-color);
  border-bottom: 1px dashed var(--border-color);
  padding: 2.5rem 0;
}

.form-group {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-sage);
  margin-bottom: 0.5rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.75rem 1rem;
  border-radius: 0;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: var(--transition-smooth);
  width: 100%;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent-copper);
}

.form-group select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23727A75' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1.125rem;
  padding-right: 2.5rem;
}

.form-group textarea {
  resize: vertical;
}

/* Success block simulation styling */
.contact-success-message {
  margin: 2.5rem 0;
  border: 1px solid var(--accent-sage);
  padding: 2.5rem;
  background: var(--input-bg);
  transition: opacity 0.4s ease;
}

.success-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  color: var(--accent-sage);
}

.success-icon {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: bold;
}

.success-header h3 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1.25rem;
  margin-bottom: 0;
}

.contact-success-message p {
  font-size: 1rem;
  margin-bottom: 1rem;
}

.success-meta {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
  margin-top: 1.5rem;
  line-height: 1.5;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 860px) {
  .disciplines-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .discipline-col {
    padding-top: 1rem;
  }
}

@media (max-width: 768px) {
  main {
    padding-top: 4rem;
    padding-bottom: 4rem;
  }
  
  .nav-wrapper {
    flex-direction: column;
    height: auto;
    padding: 1rem 0;
    gap: 0.75rem;
  }
  
  nav ul {
    gap: 1.25rem;
  }
  
  .hero-actions {
    flex-direction: column;
    gap: 1rem;
  }
  
  .btn {
    text-align: center;
    width: 100%;
  }

  .footer-grid {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }
}
