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

:root {
  --bg: #faf9f7;
  --text: #1a1a1a;
  --text-secondary: #5a5a5a;
  --text-muted: #8a8a8a;
  --accent: #2a2a2a;
  --border: #e5e3df;
  --serif: 'EB Garamond', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #141312;
  --text: #e8e6e1;
  --text-secondary: #a8a5a0;
  --text-muted: #6b6865;
  --accent: #d0cdc8;
  --border: #2a2825;
  color-scheme: dark;
}

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

body {
  font-family: var(--sans);
  font-weight: 300;
  color: var(--text);
  background-color: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* === Layout === */
main {
  max-width: 640px;
  margin: 0 auto;
  padding: 4rem 1.5rem 3rem;
}

/* === Header === */
.site-header {
  margin-bottom: 4rem;
}

.wordmark {
  font-family: var(--serif);
  font-size: 3.2rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text);
}

.tagline {
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 300;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 0.6rem;
}

/* === Dictionary Entry === */
.dictionary-entry {
  margin-top: 0.8rem;
  padding-top: 0.4rem;
}

.pronunciation {
  font-family: var(--sans);
  font-size: 0.88rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.part-of-speech {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-left: 0.8rem;
}

.definition {
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-top: 0.4rem;
  line-height: 1.6;
}

.usage {
  font-family: var(--serif);
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
  line-height: 1.6;
}

/* === Manifesto === */
.manifesto {
  margin-bottom: 4rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--border);
}

.manifesto p {
  font-family: var(--serif);
  font-size: 1.25rem;
  line-height: 1.75;
  color: var(--text);
  margin-bottom: 1.2rem;
}

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

/* === Sections === */
.section {
  margin-bottom: 3.5rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--border);
}

.section:last-of-type {
  border-bottom: none;
}

.section h2 {
  font-family: var(--serif);
  font-size: 1.8rem;
  font-weight: 400;
  margin-bottom: 0.8rem;
  color: var(--text);
}

.section-intro {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

/* === Coming Soon === */
.coming-soon {
  padding: 1.5rem 0;
}

.coming-soon p {
  font-family: var(--serif);
  font-style: italic;
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* === Projects === */
.project-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.project {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 1.4rem 1.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.project:hover {
  border-color: var(--text-muted);
  background-color: rgba(128, 128, 128, 0.06);
}

.project h3 {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
  color: var(--text);
}

.project p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.project--featured {
  border-color: var(--text-muted);
}

.project-links {
  margin-top: 0.6rem;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

.project-links a {
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  transition: border-color 0.2s ease, color 0.2s ease;
}

.project-links a:hover {
  color: var(--text-secondary);
  border-color: var(--text-secondary);
}

/* === Writing === */
.writing-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.writing-item {
  display: block;
  text-decoration: none;
  color: inherit;
  padding-left: 1rem;
  border-left: 2px solid var(--border);
  transition: border-color 0.2s ease;
}

.writing-item:hover {
  border-color: var(--text-muted);
}

.writing-item h3 {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 0.3rem;
  color: var(--text);
}

.writing-item--placeholder {
  opacity: 0.6;
  cursor: default;
}

.writing-item--placeholder:hover {
  border-color: var(--border);
}

.writing-item p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.project-tag {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

/* === Workbench === */
.workbench-list {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.workbench-item {
  padding-left: 1rem;
  border-left: 2px solid var(--border);
}

.workbench-item h3 {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 0.3rem;
  color: var(--text);
}

.workbench-item p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* === Footer === */
.site-footer {
  margin-top: 2rem;
  padding-top: 2rem;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.site-footer .contact {
  margin-top: 0.3rem;
}

.site-footer a {
  color: var(--text-secondary);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  transition: border-color 0.2s ease;
}

.site-footer a:hover {
  border-color: var(--text-secondary);
}

/* === Article === */
.article-nav {
  margin-bottom: 3rem;
}

.article-nav a {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

.article-header {
  margin-bottom: 3rem;
}

.article-title {
  font-family: var(--serif);
  font-size: 2.6rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 0.6rem;
}

.article-subtitle {
  font-family: var(--serif);
  font-size: 1.2rem;
  color: var(--text-secondary);
  line-height: 1.5;
  font-style: italic;
}

.article-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 1rem;
}

.article-body p {
  font-family: var(--serif);
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text);
  margin-bottom: 1.4rem;
}

.article-body h2 {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--text);
  margin-top: 2.8rem;
  margin-bottom: 1rem;
}

.article-body strong {
  font-weight: 500;
}

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

.formula {
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 0.03em;
  color: var(--text);
  padding: 1rem 1.4rem;
  background-color: rgba(128, 128, 128, 0.06);
  border-left: 3px solid var(--border);
  margin: 1.2rem 0 1.6rem;
}

/* === Progressive Disclosure === */
.article-body details {
  margin: 0.4rem 0 1.8rem;
  padding: 0.8rem 1.2rem;
  background-color: rgba(128, 128, 128, 0.06);
  border-left: 3px solid var(--border);
  border-radius: 0 4px 4px 0;
}

.article-body details summary {
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--text-muted);
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: color 0.2s ease;
  list-style: none;
}

.article-body details summary::-webkit-details-marker {
  display: none;
}

.article-body details summary::before {
  content: '→ ';
}

.article-body details[open] summary::before {
  content: '↓ ';
}

.article-body details summary:hover {
  color: var(--text-secondary);
}

.article-body details[open] summary {
  margin-bottom: 0.8rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
}

.article-body details p {
  font-size: 0.95rem !important;
  line-height: 1.7;
  color: var(--text-secondary) !important;
  margin-bottom: 0.8rem !important;
}

.article-body details p:last-child {
  margin-bottom: 0 !important;
}

/* === Theme Toggle === */
.theme-toggle {
  position: fixed;
  top: 1.2rem;
  right: 1.2rem;
  background: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 2.2rem;
  height: 2.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: border-color 0.2s ease, color 0.2s ease;
  z-index: 100;
  padding: 0;
}

.theme-toggle:hover {
  border-color: var(--text-secondary);
  color: var(--text-secondary);
}

.theme-toggle .icon-moon { display: block; }
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }

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

  main {
    padding: 2.5rem 1.2rem 2rem;
  }

  .wordmark {
    font-size: 2.6rem;
  }

  .site-header {
    margin-bottom: 3rem;
  }

  .manifesto {
    margin-bottom: 3rem;
    padding-bottom: 2.5rem;
  }

  .manifesto p {
    font-size: 1.15rem;
  }

  .section {
    margin-bottom: 2.5rem;
    padding-bottom: 2.5rem;
  }

  .project {
    padding: 1.2rem 1.3rem;
  }

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

  .article-body h2 {
    font-size: 1.4rem;
  }

  .article-body p {
    font-size: 1.05rem;
  }
}
