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

:root {
  --bg: #faf9f6;
  --bg-alt: #f0eeea;
  --text: #1a1a1a;
  --text-muted: #555;
  --accent: #8b4513;
  --accent-light: #a0522d;
  --border: #d4cfc7;
  --serif: 'EB Garamond', 'Georgia', serif;
  --sans: 'Inter', -apple-system, sans-serif;
  --max-width: 780px;
  --max-width-wide: 1100px;
}

html {
  scroll-behavior: smooth;
  font-size: 18px;
}

body {
  font-family: var(--serif);
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--accent);
  color: #fff;
}

/* === Navigation === */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(250, 249, 246, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: 0.8rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-logo-img {
  height: 28px;
  width: auto;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: color 0.2s;
}

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

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  flex-direction: column;
  gap: 5px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  transition: 0.2s;
}

/* === Hero === */
.hero {
  min-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 2rem 4rem;
  background: var(--bg);
  position: relative;
}

.hero-inner {
  max-width: 700px;
}

.hero-etymology {
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  margin-bottom: 1.5rem;
}

.hero-etymology em {
  color: var(--accent);
  font-style: italic;
}

.hero-logo {
  width: 120px;
  height: auto;
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-family: var(--serif);
  font-size: 4.5rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 1rem;
}

.hero-subtitle {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
}

.hero-line {
  width: 60px;
  height: 1px;
  background: var(--accent);
  margin: 0 auto;
}

/* === Sections === */
.section {
  padding: 5rem 2rem;
}

.section-alt {
  background: var(--bg-alt);
}

.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  position: relative;
}

.section-label {
  font-family: var(--serif);
  font-size: 0.9rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.section h2 {
  font-family: var(--serif);
  font-size: 2.2rem;
  font-weight: 400;
  margin-bottom: 2rem;
  letter-spacing: -0.01em;
}

.section-intro {
  font-family: var(--sans);
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
}

/* === Prose === */
.prose p {
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
}

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

.prose em {
  font-style: italic;
}

.prose strong {
  font-weight: 600;
}

/* === Domains Grid === */
.section-domains {
  background: var(--bg);
  padding: 5rem 2rem;
}

.section-domains .section-inner {
  max-width: var(--max-width-wide);
}

.section-domains h2 {
  text-align: center;
  margin-bottom: 3rem;
}

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

.domain-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2rem 1.8rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.domain-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.domain-icon {
  font-size: 1.6rem;
  color: var(--accent);
  margin-bottom: 0.8rem;
}

.domain-card h3 {
  font-family: var(--sans);
  font-size: 0.88rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.6rem;
}

.domain-card p {
  font-family: var(--serif);
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* === Media Grid === */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.media-placeholder {
  background: var(--bg-alt);
  border: 2px dashed var(--border);
  border-radius: 4px;
  padding: 4rem 2rem;
  text-align: center;
  color: var(--text-muted);
}

.media-placeholder-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  opacity: 0.4;
}

.media-placeholder p {
  font-family: var(--sans);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Media card (for when content is added) */
.media-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.media-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.media-card-embed {
  position: relative;
  padding-bottom: 56.25%;
  background: #000;
}

.media-card-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.media-card-body {
  padding: 1.2rem 1.5rem;
}

.media-card-tag {
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

.media-card-title {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
}

.media-card-desc {
  font-family: var(--serif);
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* === Contact === */
.contact-prose {
  text-align: center;
}

.contact-email {
  margin-top: 1.5rem;
}

.contact-email a {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 2px;
  transition: opacity 0.2s;
}

.contact-email a:hover {
  opacity: 0.7;
}

/* === Footer === */
.footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
}

.footer p {
  font-family: var(--sans);
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

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

  .nav-links {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  .nav.open .nav-links {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(250, 249, 246, 0.98);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem 1.5rem;
    gap: 1rem;
  }

  .hero {
    min-height: 70vh;
    padding: 5rem 1.5rem 3rem;
  }

  .hero h1 {
    font-size: 3rem;
  }

  .section {
    padding: 3.5rem 1.5rem;
  }

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

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

@media (max-width: 480px) {
  .hero h1 {
    font-size: 2.4rem;
  }

  .hero-etymology {
    font-size: 0.75rem;
  }

  .section h2 {
    font-size: 1.8rem;
  }

  .prose p {
    font-size: 1rem;
  }
}

/* === Page Hero (inner pages) === */
.page-hero {
  padding: 8rem 2rem 3rem;
  text-align: center;
  background: var(--bg);
}

.page-hero-inner {
  max-width: 700px;
  margin: 0 auto;
}

.page-label {
  font-family: var(--serif);
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.page-hero h1 {
  font-family: var(--serif);
  font-size: 3.2rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 1rem;
}

.page-subtitle {
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* === Taxonomy === */
.section-inner-wide {
  max-width: var(--max-width-wide);
  margin: 0 auto;
}

.taxonomy-domain {
  padding: 3.5rem 2rem 4rem;
  border-bottom: 1px solid var(--border);
}

.taxonomy-domain:nth-child(even) {
  background: var(--bg-alt);
}

.taxonomy-header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.taxonomy-number {
  font-family: var(--serif);
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 500;
}

.taxonomy-domain h2 {
  font-family: var(--serif);
  font-size: 1.8rem;
  font-weight: 400;
  margin-bottom: 0;
}

.taxonomy-mechanism {
  font-family: var(--serif);
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: var(--max-width);
  margin-bottom: 2rem;
}

.taxonomy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.2rem;
}

.taxonomy-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.5rem;
  transition: border-color 0.2s;
}

.taxonomy-domain:nth-child(even) .taxonomy-card {
  background: #fff;
}

.taxonomy-card:hover {
  border-color: var(--accent);
}

.taxonomy-card h3 {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.taxonomy-field {
  font-family: var(--sans);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  display: block;
  margin-bottom: 0.6rem;
  font-weight: 500;
}

.taxonomy-card p {
  font-family: var(--serif);
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.framework-link {
  font-family: var(--sans);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 2px;
  transition: opacity 0.2s;
}

.framework-link:hover {
  opacity: 0.7;
}

/* === Essay List === */
.essay-list {
  list-style: none;
}

.essay-item {
  padding: 2rem 0;
  border-bottom: 1px solid var(--border);
}

.essay-item:first-child {
  padding-top: 0;
}

.essay-item:last-child {
  border-bottom: none;
}

.essay-date {
  font-family: var(--sans);
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.4rem;
}

.essay-item h3 {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.essay-item h3 a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s;
}

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

.essay-excerpt {
  font-family: var(--serif);
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* === Essay Page === */
.essay-header {
  padding: 7rem 2rem 2rem;
  text-align: center;
  background: var(--bg);
}

.essay-back {
  margin-bottom: 2rem;
}

.essay-back a {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: color 0.2s;
}

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

.essay-header h1 {
  font-family: var(--serif);
  font-size: 2.8rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  max-width: 700px;
  margin: 0 auto 1rem;
  line-height: 1.15;
}

.essay-subtitle {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.essay-meta {
  font-family: var(--sans);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.essay-body {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 2rem 5rem;
}

.essay-body h2 {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 500;
  margin: 3rem 0 1rem;
}

.essay-body p {
  font-family: var(--serif);
  font-size: 1.1rem;
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

.essay-body em {
  font-style: italic;
}

.essay-body strong {
  font-weight: 600;
}

.essay-body blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1.5rem;
  margin: 2rem 0;
}

.essay-body blockquote p {
  font-style: italic;
  color: var(--text-muted);
}

.essay-body a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 1px;
  transition: opacity 0.2s;
}

.essay-body a:hover {
  opacity: 0.7;
}

/* === Responsive (inner pages) === */
@media (max-width: 768px) {
  .page-hero {
    padding: 6rem 1.5rem 2rem;
  }

  .page-hero h1 {
    font-size: 2.4rem;
  }

  .taxonomy-domain {
    padding: 2.5rem 1.5rem 3rem;
  }

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

  .essay-header {
    padding: 6rem 1.5rem 1.5rem;
  }

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

  .essay-body {
    padding: 2rem 1.5rem 4rem;
  }
}

@media (max-width: 480px) {
  .page-hero h1 {
    font-size: 2rem;
  }

  .taxonomy-domain h2 {
    font-size: 1.5rem;
  }

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

/* === Method Page === */
.method-phase {
  padding: 3.5rem 2rem 4rem;
  border-bottom: 1px solid var(--border);
}

.method-phase-alt {
  background: var(--bg-alt);
}

.method-phase-header {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.method-phase-number {
  font-family: var(--serif);
  font-size: 3rem;
  font-weight: 400;
  color: var(--accent);
  line-height: 1;
  min-width: 2.5rem;
}

.method-phase-header h2 {
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 400;
  margin-bottom: 0;
}

.method-phase-subtitle {
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 0.3rem;
}

.method-content {
  max-width: var(--max-width);
}

.method-lead {
  font-family: var(--serif);
  font-size: 1.15rem;
  line-height: 1.8;
  margin-bottom: 2rem;
  color: var(--text);
}

.method-content h3 {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 500;
  margin: 2.5rem 0 0.8rem;
}

.method-content h3:first-of-type {
  margin-top: 0;
}

.method-content p {
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1.8;
  margin-bottom: 1.2rem;
}

.method-content ul,
.method-content ol {
  margin: 1rem 0 1.5rem 1.5rem;
}

.method-content li {
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 0.8rem;
}

.method-content li strong {
  font-weight: 600;
}

.method-content a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 1px;
  transition: opacity 0.2s;
}

.method-content a:hover {
  opacity: 0.7;
}

.method-rules {
  list-style: none;
  counter-reset: rule;
  margin-left: 0;
}

.method-rules li {
  counter-increment: rule;
  padding-left: 2.5rem;
  position: relative;
  margin-bottom: 1.2rem;
}

.method-rules li::before {
  content: counter(rule) ".";
  position: absolute;
  left: 0;
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  top: 0.15rem;
}

@media (max-width: 768px) {
  .method-phase {
    padding: 2.5rem 1.5rem 3rem;
  }

  .method-phase-number {
    font-size: 2.2rem;
  }

  .method-phase-header h2 {
    font-size: 1.6rem;
  }

  .method-rules li {
    padding-left: 2rem;
  }
}

@media (max-width: 480px) {
  .method-phase-header {
    gap: 1rem;
  }

  .method-phase-number {
    font-size: 1.8rem;
    min-width: 2rem;
  }

  .method-phase-header h2 {
    font-size: 1.4rem;
  }
}

/* === Fade-in animation === */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}
