/* ============================================================
   STYLE.CSS — Notion-inspired minimal personal blog
   ============================================================
   Sections:
   1. Theme Variables (Light + Dark)
   2. Reset & Base
   3. Layout
   4. Header / Navigation
   5. Mobile Navigation
   6. Buttons
   7. Toolbar (Theme + Language)
   8. Reading Progress Bar
   9. Hero Section
   10. Sections & Headings
   11. Grid System
   12. Cards
   13. Portfolio Cards
   14. Blog Post Page
   15. Sort Controls
   16. Tags
   17. Share Bar & Post Navigation
   18. Footer
   19. Back to Top
   20. Loading States
   21. Animations
   22. Utilities
   23. Responsive Breakpoints
   ============================================================ */

/* ------------------------------------------------------------
   1. Theme Variables
   ------------------------------------------------------------ */

:root,
[data-theme="light"] {
  --bg: #FAFAF9;
  --bg-2: #F0EEEB;
  --bg-3: #E8E5E0;
  --text: #1A1A1A;
  --text-2: #5A5A5A;
  --text-3: #8A8A8A;
  --border: #E0DDD8;
  --accent: #2563EB;
  --accent-hover: #1D4FD8;
  --tag-bg: #EDF2FC;
  --tag-text: #2563EB;
  --card-bg: #FFFFFF;
  --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
  --card-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.08);
  --header-bg: rgba(250, 250, 249, 0.85);
}

/* Pure-black dark theme — true #000 surface, layered grays for elevation */
[data-theme="dark"] {
  --bg: #000000;
  --bg-2: #0A0A0A;
  --bg-3: #161616;
  --text: rgba(255, 255, 255, 0.82);
  --text-2: rgba(255, 255, 255, 0.55);
  --text-3: rgba(255, 255, 255, 0.28);
  --border: rgba(255, 255, 255, 0.09);
  --accent: #529CCA;
  --accent-hover: #6BB3DB;
  --tag-bg: rgba(255, 255, 255, 0.08);
  --tag-text: #529CCA;
  --card-bg: #0A0A0A;
  --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  --card-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.65);
  --header-bg: rgba(0, 0, 0, 0.88);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000;
    --bg-2: #0A0A0A;
    --bg-3: #161616;
    --text: rgba(255, 255, 255, 0.82);
    --text-2: rgba(255, 255, 255, 0.55);
    --text-3: rgba(255, 255, 255, 0.28);
    --border: rgba(255, 255, 255, 0.09);
    --accent: #529CCA;
    --accent-hover: #6BB3DB;
    --tag-bg: rgba(255, 255, 255, 0.08);
    --tag-text: #529CCA;
    --card-bg: #0A0A0A;
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    --card-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.65);
    --header-bg: rgba(0, 0, 0, 0.88);
  }
}

/* ------------------------------------------------------------
   2. Reset & Base
   ------------------------------------------------------------ */

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

html {
  font-size: 62.5%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans), 'DM Sans', system-ui, sans-serif;
  font-size: 1.6rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

li { list-style: none; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
button { cursor: pointer; font: inherit; border: none; background: none; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }
html { scrollbar-width: thin; scrollbar-color: var(--border) var(--bg); }

/* ------------------------------------------------------------
   3. Layout
   ------------------------------------------------------------ */

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

.content-narrow {
  max-width: 760px;
  margin: 0 auto;
}

/* ------------------------------------------------------------
   4. Header / Navigation
   ------------------------------------------------------------ */

.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 0 20px;
  height: 56px;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  display: flex;
  align-items: center;
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

.logo img {
  height: 28px;
  width: auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-links a {
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--text-2);
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.menu-btn {
  display: none;
  font-size: 2.4rem;
  color: var(--text);
}

/* ------------------------------------------------------------
   5. Mobile Navigation
   ------------------------------------------------------------ */

.mobile-nav {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg);
  padding: 80px 24px 24px;
  flex-direction: column;
  gap: 8px;
}

.mobile-nav.active {
  display: flex;
}

.mobile-nav a:not(.btn) {
  font-size: 1.8rem;
  padding: 14px 0;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  font-weight: 500;
}

.mobile-nav .btn {
  margin-top: 8px;
  justify-content: center;
  width: 100%;
  padding: 12px;
  font-size: 1.5rem;
}

.mobile-nav-close {
  position: absolute;
  top: 16px;
  right: 20px;
  font-size: 2.4rem;
  color: var(--text);
}

/* ------------------------------------------------------------
   6. Buttons
   ------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 1.4rem;
  font-weight: 500;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--bg-2);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-3);
}


/* ------------------------------------------------------------
   7. Theme Toggle
   ------------------------------------------------------------ */

.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  background: var(--bg-2);
  border: 1px solid var(--border);
  font-size: 1.6rem;
  line-height: 1;
  transition: all 0.2s;
}

.theme-toggle:hover {
  background: var(--bg-3);
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
}

.theme-toggle ion-icon {
  font-size: 1.8rem;
}

/* Hide old toolbar if still in DOM */
.toolbar { display: none; }

/* ------------------------------------------------------------
   8. Reading Progress Bar
   ------------------------------------------------------------ */

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background: var(--accent);
  z-index: 9999;
  transition: width 0.1s linear;
}

/* ------------------------------------------------------------
   9. Hero Section
   ------------------------------------------------------------ */

.hero {
  padding: 120px 0 60px;
  text-align: center;
}

.hero-greeting {
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 12px;
}

.hero-title {
  font-family: 'New York', var(--font-serif), 'Source Serif 4', Georgia, ui-serif, serif;
  font-size: clamp(3.2rem, 5vw, 5rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
  margin-bottom: 20px;
}

.hero-title .accent {
  color: var(--accent);
}

.hero-bio {
  font-size: 1.7rem;
  line-height: 1.7;
  color: var(--text);
  max-width: 600px;
  margin: 0 auto 32px;
}

.hero-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.social-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 1.8rem;
  transition: all 0.2s;
}

.social-icon:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
}

/* ------------------------------------------------------------
   10. Sections & Headings
   ------------------------------------------------------------ */

.section {
  padding: 60px 0;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.section-title {
  font-family: 'New York', var(--font-serif), 'Source Serif 4', Georgia, ui-serif, serif;
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--text);
}

.section-subtitle {
  font-size: 1.5rem;
  color: var(--text-2);
  margin-top: 4px;
}

.section-link {
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ------------------------------------------------------------
   10b. Profile Section
   ------------------------------------------------------------ */

.profile-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 40px;
  margin-top: 32px;
}

.profile-card-info {
  text-align: center;
}

.profile-avatar {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 16px;
  border: 3px solid var(--border);
}

.profile-name {
  font-family: var(--font-serif), 'Source Serif 4', serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.profile-role {
  font-size: 1.4rem;
  color: var(--text-2);
  margin-bottom: 24px;
}

.profile-details {
  text-align: left;
}

.profile-detail {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 1.35rem;
  color: var(--text);
}

.profile-detail-label {
  font-weight: 600;
  color: var(--text-2);
  flex-shrink: 0;
  min-width: 70px;
}

.profile-experience {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.experience-block {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}

.experience-heading {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.experience-item {
  padding: 12px 0;
}

.experience-item + .experience-item {
  border-top: 1px solid var(--border);
}

.experience-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 4px;
}

.experience-org {
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--text);
}

.experience-date {
  font-size: 1.2rem;
  color: var(--text-3);
  white-space: nowrap;
  background: var(--bg-2);
  padding: 2px 8px;
  border-radius: 4px;
  flex-shrink: 0;
}

.experience-role {
  font-size: 1.35rem;
  color: var(--text-2);
  margin-bottom: 2px;
}

.experience-desc {
  font-size: 1.25rem;
  color: var(--text-3);
}

@media (max-width: 768px) {
  .profile-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

/* ------------------------------------------------------------
   11. Grid System
   ------------------------------------------------------------ */

.grid {
  display: grid;
  gap: 24px;
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-auto {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

/* ------------------------------------------------------------
   12. Cards
   ------------------------------------------------------------ */

a.card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  height: 100%;
}

.card:hover {
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
}

.card-banner {
  overflow: hidden;
  position: relative;
}

.card-banner img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.card:hover .card-banner img {
  transform: scale(1.05);
}

.card-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.card-tag {
  font-family: var(--font-sans), 'DM Sans', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: var(--tag-bg);
  padding: 3px 8px;
  border-radius: 4px;
}

.card-title {
  font-family: var(--font-sans), 'DM Sans', sans-serif;
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 0;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.card-author {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-author img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.card-author-name {
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--text-2);
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 1.2rem;
  color: var(--text-3);
  white-space: nowrap;
}

.card-meta-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-3);
  flex-shrink: 0;
}

/* ------------------------------------------------------------
   13. Portfolio Cards
   ------------------------------------------------------------ */

.portfolio-card {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.portfolio-card .card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.portfolio-card .card-desc {
  font-size: 1.4rem;
  color: var(--text-2);
  line-height: 1.6;
  margin-bottom: 0;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.portfolio-card .card-footer {
  justify-content: center;
}

.portfolio-link {
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: gap 0.2s;
}

.portfolio-link:hover {
  gap: 8px;
}

/* ------------------------------------------------------------
   14. Blog Post Page
   ------------------------------------------------------------ */

/* Breadcrumbs */
.breadcrumbs {
  padding: 12px 0;
  font-size: 1.3rem;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 8px;
}

.breadcrumbs a {
  color: var(--text-2);
}

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

.breadcrumbs-sep {
  color: var(--border);
}

.breadcrumbs-current {
  color: var(--text);
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Post Header */
.post-header {
  padding: 40px 0 32px;
}

.post-tags {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.post-tag {
  padding: 4px 10px;
  font-size: 1.2rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--tag-bg);
  color: var(--tag-text);
  border-radius: 4px;
}

.post-title {
  font-family: 'New York', var(--font-serif), 'Source Serif 4', Georgia, ui-serif, serif;
  font-size: clamp(2.8rem, 4vw, 4rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 24px;
  letter-spacing: -0.02em;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.post-meta-author {
  display: flex;
  align-items: center;
  gap: 10px;
}

.post-meta-author img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.post-meta-name {
  font-weight: 600;
  color: var(--text);
  font-size: 1.5rem;
}

.post-meta-date {
  font-size: 1.35rem;
  color: var(--text-3);
}

.post-meta-sep {
  width: 1px;
  height: 24px;
  background: var(--border);
}

.post-meta-read {
  font-size: 1.35rem;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 5px;
}

.post-meta-read ion-icon {
  font-size: 1.5rem;
  color: var(--accent);
}

/* Featured Image */
.post-image {
  margin: 0 0 40px;
  border-radius: 10px;
  overflow: hidden;
}

.post-image img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

/* Article Content — New York serif, airy line-height for long-form readability */
.post-content {
  font-family: 'New York', var(--font-serif), 'Source Serif 4', Georgia, ui-serif, serif;
  font-size: 1.8rem;
  line-height: 1.9;
  color: var(--text);
}

.post-content p {
  margin-bottom: 1.25em;
  color: var(--text);
}

.post-content h2 {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.3;
  margin: 2em 0 0.6em;
  letter-spacing: -0.01em;
}

.post-content h3 {
  font-size: 1.9rem;
  font-weight: 600;
  line-height: 1.35;
  margin: 1.6em 0 0.5em;
  letter-spacing: -0.005em;
}

.post-content h4 {
  font-size: 1.7rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 1.4em 0 0.5em;
}

.post-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: transparent;
  transition: text-decoration-color 0.2s;
}

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

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

.post-content li {
  margin-bottom: 8px;
  list-style: disc;
}

.post-content ol li {
  list-style: decimal;
}

.post-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 12px 20px;
  margin: 1.5em 0;
  background: var(--bg-2);
  border-radius: 0 6px 6px 0;
  font-style: italic;
  color: var(--text-2);
}

.post-content img {
  border-radius: 8px;
  margin: 2em 0;
}

.post-content pre {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
  overflow-x: auto;
  margin: 1.5em 0;
  font-size: 1.4rem;
  line-height: 1.6;
}

.post-content code {
  font-family: var(--font-mono), 'JetBrains Mono', monospace;
  font-size: 0.88em;
  background: var(--bg-2);
  padding: 2px 5px;
  border-radius: 3px;
}

.post-content pre code {
  background: none;
  padding: 0;
}

/* --- Notion content blocks --- */

.post-content figure {
  margin: 1.5em 0;
}

.post-content figure img {
  display: block;
  max-width: 100%;
  border-radius: 8px;
  margin: 0;
}

.post-content figcaption {
  text-align: center;
  font-size: 1.4rem;
  color: var(--text-3);
  margin-top: 8px;
}

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

.post-content .callout {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--bg-2);
  border-radius: 8px;
  padding: 16px;
  margin: 1.5em 0;
}

.post-content .callout-icon {
  font-size: 2rem;
  line-height: 1;
  flex-shrink: 0;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 1.6rem;
}

.post-content th,
.post-content td {
  border: 1px solid var(--border);
  padding: 8px 12px;
  text-align: left;
}

.post-content th {
  background: var(--bg-2);
  font-weight: 600;
}

.post-content details {
  background: var(--bg-2);
  border-radius: 8px;
  margin: 1.5em 0;
  border: 1px solid var(--border);
}

.post-content details summary {
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 500;
  list-style: none;
}

.post-content details summary::before {
  content: "▶";
  display: inline-block;
  margin-right: 8px;
  font-size: 0.8em;
  transition: transform 0.2s;
}

.post-content details[open] summary::before {
  transform: rotate(90deg);
}

.post-content details > :not(summary) {
  padding: 0 16px 12px;
}

.post-content .todo-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
}

.post-content .todo-item input[type="checkbox"] {
  margin-top: 5px;
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.post-content .bookmark,
.post-content .link-preview {
  display: block;
  padding: 12px 16px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 1.5em 0;
  color: var(--accent);
  text-decoration: none;
  word-break: break-all;
  font-size: 1.5rem;
}

.post-content .bookmark:hover,
.post-content .link-preview:hover {
  border-color: var(--accent);
}

.post-content .video-embed,
.post-content .embed {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  margin: 1.5em 0;
  border-radius: 8px;
  overflow: hidden;
}

.post-content .video-embed iframe,
.post-content .embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.post-content .columns {
  display: flex;
  gap: 1.5rem;
  margin: 1.5em 0;
}

.post-content .column {
  flex: 1;
  min-width: 0;
}

.post-content audio {
  width: 100%;
  margin: 1.5em 0;
}

.post-content .file-block {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 1.5em 0;
}

.post-content .file-block a {
  font-weight: 500;
}

.post-content .equation {
  text-align: center;
  font-family: var(--font-mono), 'JetBrains Mono', monospace;
  font-size: 1.6rem;
  padding: 16px;
  margin: 1.5em 0;
  background: var(--bg-2);
  border-radius: 8px;
  overflow-x: auto;
}

/* Notion inline elements */
.post-content .mention {
  background: var(--bg-2);
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 500;
}

.post-content .mention-date {
  background: var(--bg-2);
  padding: 2px 6px;
  border-radius: 3px;
}

.post-content .equation-inline {
  font-family: var(--font-mono), 'JetBrains Mono', monospace;
  font-size: 0.9em;
  background: var(--bg-2);
  padding: 2px 6px;
  border-radius: 3px;
}

/* Notion text colors */
.notion-gray { color: #9B9A97; }
.notion-brown { color: #64473A; }
.notion-orange { color: #D9730D; }
.notion-yellow { color: #DFAB01; }
.notion-green { color: #0F7B6C; }
.notion-blue { color: #0B6E99; }
.notion-purple { color: #6940A5; }
.notion-pink { color: #AD1A72; }
.notion-red { color: #E03E3E; }

.notion-gray-bg { background: rgba(155, 154, 151, 0.15); padding: 2px 4px; border-radius: 3px; }
.notion-brown-bg { background: rgba(100, 71, 58, 0.15); padding: 2px 4px; border-radius: 3px; }
.notion-orange-bg { background: rgba(217, 115, 13, 0.15); padding: 2px 4px; border-radius: 3px; }
.notion-yellow-bg { background: rgba(223, 171, 1, 0.15); padding: 2px 4px; border-radius: 3px; }
.notion-green-bg { background: rgba(15, 123, 108, 0.15); padding: 2px 4px; border-radius: 3px; }
.notion-blue-bg { background: rgba(11, 110, 153, 0.15); padding: 2px 4px; border-radius: 3px; }
.notion-purple-bg { background: rgba(105, 64, 165, 0.15); padding: 2px 4px; border-radius: 3px; }
.notion-pink-bg { background: rgba(173, 26, 114, 0.15); padding: 2px 4px; border-radius: 3px; }
.notion-red-bg { background: rgba(224, 62, 62, 0.15); padding: 2px 4px; border-radius: 3px; }

[data-theme="dark"] .notion-gray { color: #979A9B; }
[data-theme="dark"] .notion-brown { color: #937264; }
[data-theme="dark"] .notion-orange { color: #FFA344; }
[data-theme="dark"] .notion-yellow { color: #FFD93D; }
[data-theme="dark"] .notion-green { color: #4DAB9A; }
[data-theme="dark"] .notion-blue { color: #529CCA; }
[data-theme="dark"] .notion-purple { color: #9A6DD7; }
[data-theme="dark"] .notion-pink { color: #D44C91; }
[data-theme="dark"] .notion-red { color: #FF7369; }

@media (max-width: 580px) {
  .post-content .columns {
    flex-direction: column;
  }
}

/* ------------------------------------------------------------
   15. Sort Controls
   ------------------------------------------------------------ */

.sort-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}

.sort-btn {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 1.35rem;
  font-weight: 500;
  background: var(--bg-2);
  color: var(--text-2);
  border: 1px solid transparent;
  transition: all 0.2s;
}

.sort-btn:hover {
  color: var(--text);
}

.sort-btn.active {
  background: var(--accent);
  color: #fff;
}

/* ------------------------------------------------------------
   16. Tags
   ------------------------------------------------------------ */

.tag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.tag-btn {
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--text-2);
  text-align: center;
  transition: all 0.2s;
}

.tag-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ------------------------------------------------------------
   17. Share Bar & Post Navigation
   ------------------------------------------------------------ */

/* Listen Bar (Text-to-Speech) */
.listen-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin-top: 24px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: all 0.2s;
}

.listen-bar:hover {
  border-color: var(--accent);
}

.listen-play-btn {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.listen-play-btn:hover {
  background: var(--accent-hover);
  transform: scale(1.05);
}

.listen-info {
  flex: 1;
  min-width: 0;
}

.listen-label {
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--text-2);
  display: block;
  margin-bottom: 6px;
}

.listen-progress-track {
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  cursor: pointer;
}

.listen-progress-fill {
  width: 0%;
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.3s linear;
}

.listen-speed {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-2);
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  cursor: pointer;
  font-family: inherit;
}

.listen-speed:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.listen-stop-btn {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-3);
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  cursor: pointer;
  transition: all 0.2s;
}

.listen-stop-btn:hover {
  color: #e74c3c;
  border-color: #e74c3c;
}

.listen-bar.playing .listen-label {
  color: var(--accent);
}

.listen-bar.unavailable {
  opacity: 0.5;
  pointer-events: none;
}

.share-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 0;
  margin-top: 32px;
  border-top: 1px solid var(--border);
}

.share-label {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.share-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  transition: all 0.2s;
}

.share-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 32px 0;
  border-top: 1px solid var(--border);
}

.post-nav-item {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: all 0.2s;
}

.post-nav-item:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.post-nav-item.next {
  text-align: right;
}

.post-nav-label {
  font-size: 1.15rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 4px;
}

.post-nav-title {
  font-size: 1.45rem;
  font-weight: 500;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ------------------------------------------------------------
   18. Footer
   ------------------------------------------------------------ */

.footer {
  padding: 32px 0;
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer-text {
  font-size: 1.3rem;
  color: var(--text-3);
}

/* ------------------------------------------------------------
   19. Back to Top
   ------------------------------------------------------------ */

.back-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

.back-top.active {
  opacity: 1;
  visibility: visible;
}

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

/* ------------------------------------------------------------
   20. Loading States
   ------------------------------------------------------------ */

.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 0;
  gap: 16px;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-size: 1.4rem;
  color: var(--text-3);
}

/* ------------------------------------------------------------
   21. Animations
   ------------------------------------------------------------ */

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

.fade-up {
  animation: fadeUp 0.5s ease both;
}

/* ------------------------------------------------------------
   22. Utilities
   ------------------------------------------------------------ */

.text-center { text-align: center; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.hidden { display: none !important; }

/* Load more */
.load-more {
  display: flex;
  justify-content: center;
  margin-top: 48px;
}

.load-more .btn {
  padding: 12px 28px;
  font-size: 1.4rem;
  cursor: pointer;
}

/* ------------------------------------------------------------
   23. Responsive Breakpoints
   ------------------------------------------------------------ */

/* Tablet and below */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .menu-btn { display: flex; }

  .header-actions .btn { display: none; }
  .header-actions .theme-toggle { display: flex; }

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .toolbar {
    top: auto;
    bottom: 16px;
    right: 50%;
    transform: translateX(50%);
  }

  .hero {
    padding: 100px 0 40px;
  }

  .hero-title {
    font-size: clamp(2.8rem, 6vw, 4rem);
  }

  .section {
    padding: 40px 0;
  }

  .post-nav {
    grid-template-columns: 1fr;
  }

  .post-nav-item.next {
    text-align: left;
  }

  .listen-bar {
    padding: 10px 12px;
    gap: 10px;
  }

  .listen-play-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    font-size: 1.6rem;
  }

  .listen-label {
    font-size: 1.2rem;
  }
}

/* Tablet landscape */
@media (min-width: 769px) and (max-width: 1024px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Desktop */
@media (min-width: 1025px) {
  .header-actions .register-btn,
  .header-actions .resume-btn {
    display: inline-flex;
  }
}

/* ============================================================
   Motion tokens & accessibility
   ============================================================ */
:root {
  --motion-fast: 120ms;
  --motion-base: 200ms;
  --motion-slow: 320ms;
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --ease-emphasized: cubic-bezier(0.3, 0, 0, 1);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
   Loading skeletons
   ============================================================ */
.skeleton-block,
.skeleton-line {
  background: linear-gradient(
    90deg,
    var(--bg-2) 0%,
    var(--bg-3) 50%,
    var(--bg-2) 100%
  );
  background-size: 200% 100%;
  animation: skeletonShimmer 1.4s ease-in-out infinite;
  border-radius: 4px;
}

.skeleton-card {
  pointer-events: none;
}

.skeleton-card .skeleton-block {
  aspect-ratio: 16/9;
  border-radius: 12px 12px 0 0;
}

.skeleton-line {
  height: 14px;
  margin-bottom: 12px;
}

.skeleton-line-sm { width: 30%; }
.skeleton-line-md { width: 60%; }
.skeleton-line-lg { width: 90%; }

.skeleton-heading {
  height: 36px;
  margin-bottom: 16px;
  width: 90%;
}

@keyframes skeletonShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================================
   View Transitions (progressive enhancement)
   Chrome/Edge: smooth cross-page morphs. Other browsers: ignored.
   ============================================================ */
@view-transition {
  navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: var(--motion-base);
  animation-timing-function: var(--ease-standard);
}

/* ============================================================
   24. Portfolio Index
   ------------------------------------------------------------
   The /portfolio page is a typographic launchpad. Each row links
   to a fully bespoke detail page with its own CSS file — those
   live under public/css/portfolio-*.css and are scoped to a
   .page-* class, so nothing here leaks into them.
   ============================================================ */

.portfolio-section {
  padding-top: 96px;
  padding-bottom: 96px;
}

.portfolio-intro {
  max-width: 720px;
  margin: 0 auto 72px;
}

.portfolio-intro-eyebrow {
  font-family: var(--font-mono), 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 16px;
}

.portfolio-intro-title {
  font-family: 'New York', var(--font-serif), 'Source Serif 4', Georgia, ui-serif, serif;
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 20px;
  font-weight: 500;
}

.portfolio-intro-lede {
  font-family: 'New York', var(--font-serif), 'Source Serif 4', Georgia, ui-serif, serif;
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--text-2);
  max-width: 56ch;
}

.portfolio-index {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--border);
}

.portfolio-index-row {
  border-bottom: 1px solid var(--border);
}

.portfolio-index-link {
  --row-accent: var(--accent);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 32px;
  align-items: center;
  padding: 36px 0;
  text-decoration: none;
  color: inherit;
  position: relative;
  transition: padding 240ms cubic-bezier(0.4, 0, 0.2, 1);
}

.portfolio-index-link::before {
  content: "";
  position: absolute;
  inset: 0 0 -1px 0;
  background: var(--row-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 320ms cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0.06;
  pointer-events: none;
}

.portfolio-index-link:hover,
.portfolio-index-link:focus-visible {
  padding-left: 24px;
  padding-right: 24px;
  outline: none;
}

.portfolio-index-link:hover::before,
.portfolio-index-link:focus-visible::before {
  transform: scaleX(1);
}

.portfolio-index-number {
  font-family: var(--font-mono), 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  color: var(--text-3);
  align-self: start;
  padding-top: 12px;
  position: relative;
  z-index: 1;
}

.portfolio-index-body {
  min-width: 0;
  position: relative;
  z-index: 1;
}

.portfolio-index-title {
  font-family: 'New York', var(--font-serif), 'Source Serif 4', Georgia, ui-serif, serif;
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
  font-weight: 500;
  color: var(--text);
  margin: 0 0 10px;
  transition: color 200ms ease;
}

.portfolio-index-link:hover .portfolio-index-title {
  color: var(--row-accent);
}

.portfolio-index-outcome {
  font-family: 'New York', var(--font-serif), 'Source Serif 4', Georgia, ui-serif, serif;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text-2);
  margin: 0 0 14px;
  max-width: 60ch;
}

.portfolio-index-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  font-family: var(--font-mono), 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--text-3);
}

.portfolio-index-live {
  color: var(--row-accent);
  font-weight: 500;
}

.portfolio-index-arrow {
  font-family: var(--font-mono), 'JetBrains Mono', monospace;
  font-size: 1.25rem;
  color: var(--text-3);
  position: relative;
  z-index: 1;
  transition: color 200ms ease, transform 240ms cubic-bezier(0.4, 0, 0.2, 1);
}

.portfolio-index-link:hover .portfolio-index-arrow {
  color: var(--row-accent);
  transform: translateX(8px);
}

.skeleton-line {
  height: 20px;
  background: linear-gradient(90deg, var(--bg-2) 0%, var(--bg-3) 50%, var(--bg-2) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite;
  border-radius: 4px;
  margin-bottom: 12px;
}

.skeleton-line-title { width: 60%; height: 32px; }
.skeleton-line-text  { width: 40%; height: 16px; }

@media (max-width: 768px) {
  .portfolio-section { padding-top: 64px; padding-bottom: 64px; }
  .portfolio-intro { margin-bottom: 48px; }
  .portfolio-index-link {
    gap: 16px;
    padding: 24px 0;
  }
  .portfolio-index-link:hover,
  .portfolio-index-link:focus-visible {
    padding-left: 12px;
    padding-right: 12px;
  }
  .portfolio-index-number { padding-top: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .portfolio-index-link,
  .portfolio-index-link::before,
  .portfolio-index-title,
  .portfolio-index-arrow {
    transition: none !important;
  }
}

/* Share buttons */
.share {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 40px 0 24px;
  padding: 20px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.share-label {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.share-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
  padding: 0;
}

.share-btn:hover {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  transform: translateY(-1px);
}

.share-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

