/* ============================================
   Write — Personal Blog & Digital Garden
   100% recreation of write-blog.framer.website
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Inter:wght@300;400;500;600&display=swap');

:root {
  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: Inter, -apple-system, BlinkMacSystemFont, sans-serif;

  --bg: #fafafa;
  --surface: #ffffff;
  --surface-hover: #f5f5f5;
  --text: #141414;
  --text-secondary: #666;
  --text-tertiary: #999;
  --text-muted: #aaa;
  --accent: #0099ff;
  --accent-hover: #0077cc;
  --border: #e0e0e0;
  --border-light: #ebebeb;

  --width-content: 820px;
  --nav-width: 1100px;
}

html.dark {
  --bg: #1a1a1a;
  --surface: #222;
  --surface-hover: #2a2a2a;
  --text: #e5e5e5;
  --text-secondary: #aaa;
  --text-tertiary: #888;
  --text-muted: #666;
  --accent: #4db8ff;
  --accent-hover: #80ccff;
  --border: #333;
  --border-light: #2a2a2a;
}

@media (prefers-color-scheme: dark) {
  :root:not(.light):not(.dark) {
    --bg: #1a1a1a;
    --surface: #222;
    --surface-hover: #2a2a2a;
    --text: #e5e5e5;
    --text-secondary: #aaa;
    --text-tertiary: #888;
    --text-muted: #666;
    --accent: #4db8ff;
    --accent-hover: #80ccff;
    --border: #333;
    --border-light: #2a2a2a;
  }
}

/* ─── Reset ──────────────────────────────── */
*,*::before,*::after{margin:0;padding:0;box-sizing:border-box}
html { font-size: 16px; -webkit-font-smoothing: antialiased; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  transition: background 0.3s, color 0.3s;
}

/* ─── Layout ─────────────────────────────── */
.page-wrap {
  max-width: var(--nav-width);
  margin: 0 auto;
  padding: 0 2rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.content-wrap {
  max-width: var(--width-content);
  width: 100%;
  margin: 0 auto;
}

/* ─── Utilities ─────────────────────────── */
a { color: var(--text); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent); }
img { max-width: 100%; height: auto; }
::selection { background: var(--accent); color: #fff; }

/* ─── Typography ─────────────────────────── */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.3;
}

/* ─── Navigation ────────────────────────── */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 0;
}
.nav-brand {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.nav-link {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--text-secondary);
  padding: 0.375rem 0.75rem;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
  text-decoration: none;
}
.nav-link:hover {
  color: var(--text);
  background: var(--surface-hover);
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.theme-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--surface-hover);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  transition: background 0.2s, color 0.2s, transform 0.15s;
}
.theme-btn:hover {
  background: var(--border);
  color: var(--text);
  transform: scale(1.05);
}

/* ─── Hero ───────────────────────────────── */
.hero {
  text-align: center;
  padding: 5rem 0 4rem;
}
.hero-title {
  font-family: var(--font-display);
  font-size: 2.75rem;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: 0.06em;
  word-spacing: 0.4em;
  color: var(--text);
  margin-bottom: 1.25rem;
}
.hero-desc {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 480px;
  margin: 0 auto;
}

/* ─── Blog List (pure list, no cards) ───── */
.blog-section {
  padding: 1rem 0;
}
.blog-section-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 1.5rem;
}
.blog-list {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
@media (max-width: 768px) {
  .blog-list {
    grid-template-columns: 1fr;
  }
}
.blog-item {
  border-top: 1px solid var(--border-light);
  padding: 0;
}
.blog-item:last-child {
  border-bottom: 1px solid var(--border-light);
}
.blog-link {
  display: block;
  padding: 1.25rem 0;
  text-decoration: none;
  color: var(--text);
  transition: opacity 0.2s;
}
.blog-link:hover {
  opacity: 0.75;
}
.blog-tags {
  display: flex;
  gap: 0.375rem;
  flex-wrap: wrap;
  margin-bottom: 0.375rem;
}
.blog-tag {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.blog-item-title {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--text);
  margin-bottom: 0.25rem;
  transition: color 0.2s;
}
.blog-item-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 0.25rem;
}
.blog-item-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.blog-item.hidden {
  display: none;
}

/* ─── Load More ─────────────────────────── */
.load-more-wrap {
  display: flex;
  justify-content: center;
  padding: 2rem 0;
}
.load-more-btn {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.5rem 1.25rem;
  cursor: pointer;
  transition: all 0.2s;
}
.load-more-btn:hover {
  color: var(--text);
  border-color: var(--text-tertiary);
  background: var(--surface-hover);
}

/* ─── Topics ─────────────────────────────── */
.topics-section {
  padding: 3rem 0;
}
.topics-heading {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 1rem;
}
.topics-list {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.topic-link {
  font-size: 0.875rem;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.375rem 1rem;
  transition: all 0.2s;
  text-decoration: none;
}
.topic-link:hover {
  color: var(--text);
  border-color: var(--text-tertiary);
}

/* ─── Timeline ──────────────────────────── */
.timeline {
  position: relative;
  padding-left: 2rem;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
  border-radius: 1px;
}
.timeline-item {
  position: relative;
  padding-bottom: 1.25rem;
}
.timeline-item:last-child {
  padding-bottom: 0;
}
.timeline-dot {
  position: absolute;
  left: -1.65rem;
  top: 0.35rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  z-index: 1;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}
.timeline-line {
  position: absolute;
  left: -1.6rem;
  top: 0.35rem;
  bottom: 0;
  width: 2px;
  background: var(--border-light);
  z-index: 0;
}
.timeline-item:last-child .timeline-line {
  display: none;
}
.timeline-content {
  padding-left: 0.25rem;
}
.timeline-date {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.125rem;
  font-family: var(--font-body);
}
.timeline-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s;
  line-height: 1.4;
}
.timeline-title:hover {
  color: var(--accent);
}

/* ─── Footer ─────────────────────────────── */
.footer {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 0;
  margin-top: auto;
  border-top: 1px solid var(--border-light);
}
.footer-copy {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ─── Blog Post Page (starts here) ────────────── */
.post-page {
  max-width: var(--width-content);
  margin: 0 auto;
  padding: 2rem 0 4rem;
}
.post-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}
.post-breadcrumb a {
  color: var(--text-muted);
  transition: color 0.2s;
}
.post-breadcrumb a:hover {
  color: var(--text);
}
.post-header {
  margin-bottom: 2.5rem;
}
.post-tags {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.post-tag {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-decoration: none;
}
.post-tag:hover {
  color: var(--text);
}
.post-title {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0.04em;
  word-spacing: 0.3em;
  margin-bottom: 0.75rem;
}
.post-meta {
  font-size: 0.8125rem;
  color: var(--text-muted);
  display: flex;
  gap: 0.5rem;
}
.post-content {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text);
}
.post-content p {
  margin-bottom: 1.5em;
}
.post-content em {
  font-family: var(--font-display);
  font-style: italic;
}
.post-content blockquote {
  border-left: 2px solid var(--border);
  padding-left: 1.25rem;
  margin: 1.5em 0;
  color: var(--text-secondary);
  font-style: italic;
  font-size: 1.05rem;
}
.post-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.post-content a:hover {
  color: var(--accent-hover);
}
.post-related {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-light);
}
.post-related-heading {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 400;
  margin-bottom: 1rem;
  color: var(--text);
}
.post-related-list {
  list-style: none;
  padding: 0;
}
.post-related-item {
  border-top: 1px solid var(--border-light);
}
.post-related-item:last-child {
  border-bottom: 1px solid var(--border-light);
}
.post-related-link {
  display: block;
  padding: 1rem 0;
  text-decoration: none;
  color: var(--text);
  transition: opacity 0.2s;
}
.post-related-link:hover {
  opacity: 0.75;
}
.post-related-link h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.125rem;
}
.post-related-link .related-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ─── Animations ────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-up { animation: fadeUp 0.5s ease both; }
.delay-1 { animation-delay: 0.08s; }
.delay-2 { animation-delay: 0.15s; }
.delay-3 { animation-delay: 0.22s; }
.delay-4 { animation-delay: 0.29s; }
.delay-5 { animation-delay: 0.36s; }
.delay-6 { animation-delay: 0.43s; }

/* ─── Responsive ─────────────────────────── */
@media (max-width: 768px) {
  .page-wrap { padding: 0 1.25rem; }
  .hero { padding: 3rem 0 2.5rem; }
  .hero-title { font-size: 1.75rem; letter-spacing: 0.04em; word-spacing: 0.2em; }
  .nav-links { gap: 0; }
  .nav-link { font-size: 0.8125rem; padding: 0.25rem 0.5rem; }
  .newsletter-form { flex-direction: column; }
  .footer { flex-direction: column; gap: 0.75rem; text-align: center; }
  .post-title { font-size: 1.5rem; }
  .blog-link { padding: 1rem 0; }
}
@media (max-width: 480px) {
  .nav-left { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .hero-title { font-size: 1.5rem; }
}
