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

:root {
  --bg: #f7f5f0;
  --text: #1a1a2e;
  --secondary: #555;
  --accent: #6b2d5b;
  --emerald: #1e6f5c;
  --ruby: #8b1a1a;
  --sapphire: #2d4a7a;
  --amber: #9a6c2e;
  --border: #e0ddd5;
}

body {
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.7;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--ruby);
  text-decoration: underline;
}

/* === Page Layout === */
.page {
  max-width: 1000px;
  margin: 0 auto;
  padding: 5rem 2rem 2rem;
}

.content-row {
  display: flex;
  align-items: flex-start;
  gap: 2.5rem;
}

.content {
  flex: 1;
  min-width: 0;
  max-width: 720px;
}

.side-imgs {
  width: 240px;
  flex-shrink: 0;
  position: relative;
}

.side-img {
  width: 100%;
  border-radius: 6px;
  opacity: 0;
  position: absolute;
  top: 0;
  left: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.side-img.visible {
  opacity: 1;
  position: relative;
  pointer-events: auto;
}

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

.header-top {
  margin-bottom: 1.5rem;
}

/* === Nav (prominent, tab-like) === */
.nav {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.75rem;
}

.nav-link {
  color: var(--secondary);
  font-size: 1rem;
  font-family: Georgia, "Times New Roman", serif;
  padding-bottom: 0.75rem;
  margin-bottom: -0.75rem;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.nav-link:hover {
  color: var(--text);
  text-decoration: none;
}

.nav-link.active {
  color: var(--emerald);
  border-bottom-color: var(--emerald);
  font-weight: 600;
}

.nav-spacer {
  flex: 1;
}

.nav-ext {
  color: var(--secondary);
  font-size: 0.8rem;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.nav-ext:hover {
  opacity: 1;
  color: var(--accent);
  text-decoration: none;
}

/* === Content Panels === */
.panel {
  display: none;
  animation: fadeIn 0.3s ease;
}

.panel.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === Typography === */
h1, h2, h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
}

h1 {
  font-size: 2.2rem;
  margin-bottom: 0.3rem;
  color: var(--accent);
}

h2 {
  font-size: 1.4rem;
  margin-bottom: 1.5rem;
  color: var(--accent);
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

h3 {
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

p {
  margin-bottom: 1rem;
  color: var(--text);
}

.subtitle {
  color: var(--sapphire);
  font-size: 0.95rem;
  font-style: italic;
}

/* === Projects === */
.project-list {
  list-style: none;
}

.project-item {
  padding: 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
  border-radius: 4px;
  margin: 0 -1rem;
  transition: background 0.25s ease;
}

.project-item:hover {
  background: rgba(107, 45, 91, 0.04);
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.3rem;
}

.project-tag {
  font-size: 0.72rem;
  color: var(--emerald);
  letter-spacing: 0.03em;
  white-space: nowrap;
  opacity: 0.6;
  transition: opacity 0.25s;
}

.project-item:hover .project-tag {
  opacity: 1;
}

.project-item h3 {
  font-size: 1.05rem;
}

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

.project-item h3 a:hover {
  color: var(--accent);
  text-decoration: none;
}

.project-desc {
  color: var(--secondary);
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
  line-height: 1.55;
}

.project-links {
  font-size: 0.8rem;
  margin-top: 0.4rem;
}

.project-links a {
  color: var(--emerald);
  margin-right: 1rem;
}

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

/* === Writing === */
.writing-empty {
  color: var(--secondary);
  font-style: italic;
}

.writing-list {
  list-style: none;
}

.writing-item {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

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

.writing-item a {
  color: var(--sapphire);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
}

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

.writing-date {
  color: var(--amber);
  font-size: 0.85rem;
  white-space: nowrap;
}

/* === Contact / Footer === */
.contact-links {
  display: flex;
  gap: 1.5rem;
  font-size: 0.95rem;
}

footer {
  text-align: center;
  padding: 2rem;
  color: var(--secondary);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
  max-width: 1000px;
  margin: 0 auto;
}

/* === Blog Post Page === */
.post-header {
  margin-bottom: 2rem;
}

.post-header h1 {
  margin-bottom: 0.25rem;
}

.post-date {
  color: var(--secondary);
  font-size: 0.9rem;
}

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

.back-link {
  display: inline-block;
  margin-bottom: 2rem;
  color: var(--secondary);
  font-size: 0.9rem;
}

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

/* === Responsive === */
@media (max-width: 900px) {
  .content-row {
    flex-direction: column;
  }

  .side-imgs {
    width: 100%;
    max-width: 300px;
  }

  .side-img {
    width: 100%;
  }
}

@media (max-width: 720px) {
  .page {
    padding: 2.5rem 1.5rem 1.5rem;
  }

  .nav {
    gap: 1rem;
    flex-wrap: wrap;
  }

  .nav-link {
    font-size: 0.9rem;
  }

  .nav-spacer {
    display: none;
  }

  .nav-ext {
    font-size: 0.75rem;
  }

  h1 {
    font-size: 1.8rem;
  }

  .writing-item {
    flex-direction: column;
    gap: 0.25rem;
  }
}
