/* ==========================================================================
   MINIMALIST TYPOGRAPHY & LAYOUT STYLESHEET (darioamodei.com inspired)
   ========================================================================== */

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.7;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* Centered single-column container */
.container {
  max-width: var(--max-width, 680px);
  width: 100%;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

/* Header typography */
.site-header {
  margin-bottom: 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.site-title {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 600;
  color: var(--heading-color);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.site-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Lucide Sun-Moon Custom Icon Theme Toggle Button */
.theme-toggle-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.45rem;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.theme-toggle-btn:hover {
  border-color: var(--link-color);
  background: rgba(0, 0, 0, 0.04);
  transform: scale(1.05);
}

[data-theme="dark"] .theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.06);
}

.sun-moon-icon {
  width: 22px;
  height: 22px;
  transition: transform 0.3s ease;
}

/* LIGHT MODE STATE: Sun is active -> Red (#ef4444) */
.sun-moon-icon .moon-path {
  fill: none;
  stroke: var(--text-muted);
  transition: fill 0.25s ease, stroke 0.25s ease;
}

.sun-moon-icon .sun-core-path {
  fill: #ef4444;
  stroke: #ef4444;
  transition: fill 0.25s ease, stroke 0.25s ease;
}

.sun-moon-icon .sun-ray-path {
  stroke: #ef4444;
  transition: stroke 0.25s ease;
}

/* DARK MODE STATE: Moon is active -> Gold (#fbbf24) */
[data-theme="dark"] .sun-moon-icon .moon-path {
  fill: #fbbf24;
  stroke: #fbbf24;
}

[data-theme="dark"] .sun-moon-icon .sun-core-path {
  fill: none;
  stroke: var(--text-muted);
}

[data-theme="dark"] .sun-moon-icon .sun-ray-path {
  stroke: var(--text-muted);
}

/* Section styling */
.section {
  margin-bottom: 2.5rem;
}

.section-heading {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--heading-color);
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.4rem;
}

/* Bio / Intro section */
.bio-section {
  margin-bottom: 2.5rem;
  font-size: 1.05rem;
}

.bio-paragraph {
  margin-bottom: 0.75rem;
}

.bio-expand-link {
  color: var(--link-color);
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
}

.bio-expand-link:hover {
  text-decoration: underline;
}

.bio-expand-content {
  display: none;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border-color);
}

.bio-expand-content.expanded {
  display: block;
  animation: fadeIn 0.2s ease-in-out;
}

/* Minimalist Bulleted Lists */
.bullet-list {
  list-style: disc;
  padding-left: 1.25rem;
}

.bullet-item {
  margin-bottom: 0.75rem;
}

.bullet-link {
  color: var(--link-color);
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
}

.bullet-link:hover {
  text-decoration: underline;
}

.bullet-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-left: 0.35rem;
}

.bullet-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 0.15rem;
  display: block;
}

/* Essay / Article Reading Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(3px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 1.5rem;
}

.modal-overlay.active {
  display: flex;
  animation: fadeIn 0.2s ease-out;
}

.modal-content {
  background: var(--modal-bg);
  color: var(--text-primary);
  width: 100%;
  max-width: 680px;
  max-height: 85vh;
  border-radius: 8px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.modal-header {
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--heading-color);
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.2rem 0.5rem;
}

.modal-close-btn:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 1.75rem;
  overflow-y: auto;
  line-height: 1.8;
}

.modal-body h2 {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  margin: 1.5rem 0 0.75rem 0;
}

.modal-body p {
  margin-bottom: 1.2rem;
}

.modal-body img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 1.2rem 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  display: block;
}

.modal-body ul, .modal-body ol {
  margin: 1rem 0 1.2rem 1.5rem;
}

.modal-body code {
  font-family: var(--font-mono);
  background: rgba(0, 0, 0, 0.05);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-size: 0.9em;
}

[data-theme="dark"] .modal-body code {
  background: rgba(255, 255, 255, 0.1);
}

.modal-body pre {
  background: #1e1e24;
  color: #f8f8f2;
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  margin: 1rem 0 1.5rem 0;
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.modal-body blockquote {
  border-left: 3px solid var(--link-color);
  padding-left: 1rem;
  margin: 1rem 0 1.5rem 0;
  color: var(--text-muted);
  font-style: italic;
}

/* Footer */
.site-footer {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}
