/* =========================================================
   BASE & CSS VARIABLES
   ========================================================= */
@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Inter:wght@400;500;600&display=swap');

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

:root {
  --bg: #161513;
  --bg-card: #2c2926;
  --text: #e3e1de;
  --text-muted: #979087;
  --accent: #c19233;
  --accent-light: #d4ad5f;
  --border: #413e38;
  --font-serif: 'Lora', Georgia, 'Times New Roman', serif;
  --font-sans: 'Inter', system-ui, sans-serif;
  --max-w: 768px;
  --radius: 6px;
  --transition: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-serif);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  transition: background-color var(--transition), color var(--transition);
}

a {
  color: inherit;
  text-decoration: none;
}

/* =========================================================
   PAGE WRAPPER
   ========================================================= */
.page-wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 1.5rem 1.25rem;
}

/* =========================================================
   TOP NAV (name + links + dark toggle)
   ========================================================= */
.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}

.site-name {
  font-family: var(--font-serif);
  font-size: clamp(2.4rem, 8vw, 4.5rem);
  font-weight: 600;
  color: var(--accent);
  letter-spacing: -0.02em;
  line-height: 1;
}

.site-name .dot {
  opacity: 0.55;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  color: var(--text-muted);
}

.nav-links a {
  color: var(--text-muted);
  transition: color var(--transition);
}

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

.nav-links .sep {
  color: var(--accent-light);
  opacity: 0.7;
  font-size: 0.8rem;
  margin: 0 0.1rem;
}



/* =========================================================
   HERO SECTION (two-column)
   ========================================================= */
.hero {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 3rem;
  margin-bottom: 2rem;
}

/* Photo column */
.hero-photo-wrap {
  position: relative;
  width: 220px;
  flex-shrink: 0;
  cursor: pointer;
}

.hero-photo-wrap img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
  transition: opacity 0.2s ease;
}

.hero-photo-wrap .photo-normal {
  opacity: 1;
}

.hero-photo-wrap .photo-pixel {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: var(--radius);
  image-rendering: pixelated;
  opacity: 0;
  object-fit: cover;
}

.hero-photo-wrap:hover .photo-normal {
  opacity: 0;
}

.hero-photo-wrap:hover .photo-pixel {
  opacity: 1;
}

/* Bio column */
.hero-bio {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Social icons row */
.social-icons {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  padding-bottom: 0.5rem;
}

.social-icon-wrap {
  position: relative;
  display: inline-flex;
}

.social-icon-wrap a {
  color: var(--accent);
  display: flex;
  align-items: center;
  transition: color var(--transition);
}

.social-icon-wrap a:hover {
  color: var(--accent-light);
}

.social-icon-wrap svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.social-icon-wrap .icon-tooltip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(193, 146, 51, 0.25);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: var(--font-sans);
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.social-icon-wrap:hover .icon-tooltip {
  opacity: 1;
}

/* Bio paragraphs */
.hero-bio p {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--text);
}

.hero-bio a {
  color: var(--accent);
  transition: color var(--transition);
}

.hero-bio a:hover {
  color: var(--accent-light);
}

/* =========================================================
   GAME OF LIFE CANVAS
   ========================================================= */
.life-canvas-wrap {
  width: 100%;
  height: 48px;
  margin: 1.5rem 0 2.5rem;
  overflow: hidden;
}

.life-canvas-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* =========================================================
   VIDEO SECTION
   ========================================================= */
.video-section {
  margin-bottom: 3rem;
}

.video-embed-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(193, 146, 51, 0.15);
  transition: transform var(--transition);
}

.video-embed-wrap:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(193, 146, 51, 0.25);
}

.video-embed-wrap iframe {
  width: 100%;
  height: 100%;
  display: block;
}

/* =========================================================
   SECTION HEADINGS
   ========================================================= */
.section-heading {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin-bottom: 1rem;
  color: var(--text);
}

/* =========================================================
   POSTS LIST  
   ========================================================= */
.posts-section {
  margin-bottom: 3rem;
}

.post-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.post-list-item {
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid transparent;
  transition: background-color var(--transition);
}

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

.post-list-item a {
  font-size: 0.9375rem;
  color: var(--text);
  transition: color var(--transition);
  flex: 1;
}

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

.post-list-item .post-date {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* =========================================================
   UPDATES / TIMELINE SECTION
   ========================================================= */
.updates-section {
  margin-bottom: 3rem;
}

.update-row {
  display: flex;
  gap: 1rem;
  padding: 0.3rem 0;
  font-size: 0.9rem;
  line-height: 1.6;
}

.update-row .update-date {
  font-family: var(--font-sans);
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text);
  min-width: 9rem;
  flex-shrink: 0;
}

.update-row .update-text {
  color: var(--text-muted);
}

.update-row .update-text a:hover {
  color: var(--accent-light);
}

/* =========================================================
   QUOTE SECTION
   ========================================================= */
.quote-section {
  margin: 4rem 0 5rem;
  padding: 0 1rem;
  text-align: center;
}

.rdj-quote {
  font-family: var(--font-serif);
  font-size: clamp(1.25rem, 4vw, 1.75rem);
  font-style: italic;
  color: var(--text);
  line-height: 1.5;
  position: relative;
  display: inline-block;
  max-width: 90%;
}

.rdj-quote::before {
  content: '“';
  position: absolute;
  top: -1.5rem;
  left: -2rem;
  font-size: 5rem;
  color: var(--accent);
  opacity: 0.15;
  font-family: serif;
}

.rdj-quote cite {
  display: block;
  font-family: var(--font-sans);
  font-style: normal;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
  margin-top: 1.5rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0.8;
}

/* =========================================================
   IMAGE OVERLAY (keep existing functionality)
   ========================================================= */
#image-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 9999;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

#image-overlay.active {
  display: flex;
}

#image-overlay img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  border-radius: var(--radius);
}

/* =========================================================
   FOOTER
   ========================================================= */
footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0 2rem;
  text-align: center;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 640px) {
  .hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
  }

  .hero-photo-wrap {
    width: 160px;
  }

  .top-nav {
    flex-direction: column;
    align-items: flex-start;
  }

  .social-icons {
    gap: 1.75rem;
  }

  .update-row {
    flex-direction: column;
    gap: 0.1rem;
  }

  .update-row .update-date {
    min-width: unset;
  }
}

@media (max-width: 400px) {
  .site-name {
    font-size: 2rem;
  }
}

/* =========================================================
   ARTICLE / POST PAGES
   (used by billgates.html, should-we-make-art.html, etc.)
   ========================================================= */

/* Post page header — slim navbar with just the name */
header {
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 0;
  background-color: var(--bg);
  transition: background-color var(--transition), border-color var(--transition);
}

.header-content {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Name link in post headers */
.header-content h1 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: -0.01em;
}

/* Hide profile image & tagline on article pages */
.header-content .profile-image,
.header-content .tagline {
  display: none;
}

/* Post page content container */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

/* ← Back link */
a.read-more {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 2rem;
  transition: color var(--transition);
}

a.read-more:hover {
  color: var(--accent);
}

/* Article wrapper */
.post {
  margin-top: 0.5rem;
}

/* Post title */
.post h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

/* Post date */
.post-date {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

/* Post body */
.post-content {
  font-family: var(--font-serif);
  font-size: 1.0625rem;
  line-height: 1.78;
  color: var(--text);
}

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

.post-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 2rem 0 0.6rem;
  color: var(--text);
}

.post-content a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(193, 146, 51, 0.4);
  transition: text-decoration-color var(--transition), color var(--transition);
}

.post-content a:hover {
  color: var(--accent-light);
  text-decoration-color: var(--accent-light);
}

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

.post-content li {
  margin-bottom: 0.4rem;
}

.post-content strong {
  font-weight: 700;
}

.post-content em {
  font-style: italic;
}

.post-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* Images inside post content */
.post-content img {
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 1.75rem 0;
  border-radius: var(--radius);
  cursor: pointer;
  display: block;
}

/* Post image grid */
.post-images {
  display: flex;
  gap: 1.25rem;
  margin: 1.75rem 0;
  flex-wrap: wrap;
}

.post-images figure {
  flex: 1;
  min-width: 240px;
}

.post-images img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  cursor: pointer;
  display: block;
  margin: 0;
}

.post-images figcaption {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.4rem;
  font-style: italic;
}

/* Video embeds */
.video-container {
  display: flex;
  gap: 1rem;
  margin: 1.75rem 0;
  flex-wrap: wrap;
}

.video-container video {
  flex: 1;
  min-width: 260px;
  border-radius: var(--radius);
}

/* Article page footer */
footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0 2rem;
  text-align: center;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--text-muted);
  background-color: var(--bg);
  transition: background-color var(--transition), border-color var(--transition);
}

footer p {
  margin-bottom: 0.25rem;
}

footer a {
  color: var(--text-muted);
  text-decoration: underline;
  text-decoration-color: var(--border);
  transition: color var(--transition), text-decoration-color var(--transition);
}

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

/* Post page responsive */
@media (max-width: 640px) {
  .post-images {
    flex-direction: column;
  }

  .video-container {
    flex-direction: column;
  }

  .video-container video {
    width: 100%;
  }
}