/* Post meta row: reading time left, tags right */

.post-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1em;
  margin-bottom: 1.2em;
  flex-wrap: nowrap;
  width: 100%;
}

.post-meta-row > .reading-time {
  min-width: auto;
  flex-shrink: 0;
}
.post-meta-row > .tag-container {
  min-width: 0;
  flex-shrink: 1;
}

.post-meta-row .reading-time {
  margin: 0;
  padding: 0.1em 0.75em 0.1em 0;
  font-size: 1.05rem;
  font-weight: 600;
  width: auto;
  box-shadow: none;
}

.post-meta-row .tag-container {
  margin: 0;
  gap: 0.4rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

@media (max-width: 768px) {
  .post-meta-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    margin-bottom: 1em;
  }
  .post-meta-row .reading-time {
    padding: 0.1em 0 0.1em 0;
    font-size: 1rem;
    text-align: right;
    margin-left: 0;
    margin-right: 0;
    display: block;
  }
  .post-meta-row .tag-container {
    justify-content: flex-start;
    gap: 0.3rem;
  }
}
/* Blockquote quote mark and cite opacity/color for desktop only */
@media (min-width: 769px) {
  .post-page blockquote::after,
  .post-page blockquote cite {
    opacity: 0.5;
    color: var(--muted-text);
    transition: opacity 0.3s ease;
  }

  .post-page blockquote:hover::after,
  .post-page blockquote:hover cite {
    opacity: 1;
  }
}

/* --- Reading Time Estimate Styling --- */



.reading-time {
  display: block;
  font-size: 1.1rem;
  margin: 0 0 1.5rem 0;
  font-weight: 600;
  letter-spacing: 0.01em;
  background: var(--primary-bg);
  border-radius: 0.5em;
  padding: 0.25em 0.75em;
  width: fit-content;
  box-shadow: none;
  z-index: 10;
  position: relative;
  transition: background 0.3s;
  color: var(--genre-color, var(--accent-color, #444));
}


body.dark-theme .reading-time {
  background: rgba(24,26,27,0.92);
  color: var(--genre-color, var(--accent-color, #eee));
}

/* Gradient text for reading time if multiple tags (when --genre-gradient is set) */
.reading-time {
  background-clip: padding-box;
}

/* Gradient reading time for multiple tags (now inside .post-meta-row) */
.post-meta-row:has(.genre-tag ~ .genre-tag) > .reading-time {
  background: rgba(255,255,255,0.85);
  background-clip: padding-box;
  color: transparent;
  background-image: var(--genre-gradient, var(--genre-color));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  /* text-fill-color: transparent; */
  box-shadow: none;
}
body.dark-theme .post-meta-row:has(.genre-tag ~ .genre-tag) > .reading-time {
  background: rgba(24,26,27,0.92);
  background-clip: padding-box;
  color: transparent;
  background-image: var(--genre-gradient, var(--genre-color));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  /* text-fill-color: transparent; */
  box-shadow: none;
}

/* Fallback for single-tag posts in dark mode: ensure text is visible */
body.dark-theme .reading-time {
  color: var(--genre-color, var(--accent-color, #eee));
}

/* Fallback for single-tag posts in dark mode: ensure text is visible */
body.dark-theme .post-page:not(:has(.genre-tag ~ .genre-tag)) > .reading-time {
  background: rgba(24,26,27,0.92);
  color: var(--genre-color, var(--accent-color, #eee));
}

/* Ensure .reading-time is not overlapped by sticky headers or progress bar */
.reading-time {
  margin-top: 1.2em;
}

/* If inside .post-page, add extra spacing below title */
.post-page > .reading-time {
  margin-top: 0.5em;
  margin-bottom: 1.5em;
}
.reading-progress-bar__inner {
  height: 100%;
  width: 0%;
  background: var(--genre-gradient, var(--genre-color));
  border-radius: 0 2px 2px 0;
  box-shadow: none;
  will-change: width;
}

/* Reading Progress Bar */
.reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 4px;
  background: transparent;
  z-index: 9999;
}
.reading-progress-bar__inner {
  height: 100%;
  width: 0%;
  background: var(--genre-gradient, var(--accent-color));
  transition: width 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 0 2px 2px 0;
}


body.dark-theme {
    --primary-bg: #181a1b;
    --secondary-bg: #232526;
    --text-color: #e3e6eb;
    --accent-color: #e3e6eb;
    --border-color: #232526;
    --muted-text: #a0a4ab;
    --hover-bg: #232526;
    --subtle-shadow: rgba(0,0,0,0.25);


    --card-gradient: linear-gradient(135deg, #232526 0%, #23272a 60%, #181a1b 100%);
}
/* --- DARK THEME --- */
body.dark-theme {
    --primary-bg: #181a1b;
    --secondary-bg: #232526;
    --text-color: #e3e6eb;
    --accent-color: #e3e6eb;
    --border-color: #232526;
    --muted-text: #a0a4ab;
    --hover-bg: #232526;
    --subtle-shadow: rgba(0,0,0,0.25);
}

@media (max-width: 768px) {
  .definition-tooltip .tooltip-arrow {
    display: block;
    position: absolute;
    top: -7px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-bottom: 7px solid var(--secondary-bg);
    border-top: none;
    z-index: 2;
    margin: 0;
    content: '';
    background: none;
    /* Remove any text content */
    font-size: 0;
  }

  /* Hide the ::after arrow if .tooltip-arrow is present */
  .definition-tooltip .tooltip-arrow ~ ::after,
  .definition-tooltip.tooltip-below .tooltip-arrow ~ ::after {
    display: none !important;
  }

}
/* Fade-out only for back-to-home */
.post-page.page-animate-out {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1.3s cubic-bezier(0.4, 0, 0.2, 1), transform 1.3s cubic-bezier(0.4, 0, 0.2, 1);
}
/* Journal post page load animation */
.post-page {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1), transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}
.post-page.page-animate-in {
    opacity: 1;
    transform: translateY(0);
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Work+Sans:wght@300;400;500;600&display=swap');


/* Light and Dark Theme Variables */

html {
  transition: background-color 0.3s ease, color 0.3s ease;
}



:root {
    --primary-bg: #f8f9fa;
    --secondary-bg: #fdfdfd;
    --text-color: #5a6169;
    --accent-color: #3c4043;
    --border-color: #e8eaed;
    --muted-text: #7a8087;
    --hover-bg: #f5f7fa;
    --subtle-shadow: rgba(60, 64, 67, 0.05);

    --font-headline: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --font-body: 'Work Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
}


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



body {
    font-family: var(--font-body);
    line-height: 1.6;
    background-color: var(--primary-bg);
    color: var(--text-color);
    font-size: 18px;
    font-weight: 400;
    font-feature-settings: 'kern' 1, 'liga' 1, 'calt' 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}


.container {
    max-width: 900px;
    width: 80%;
    margin: 0 auto;
    padding: 1rem 2rem 4rem 2rem;
}


header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem 1rem 2rem;
    background-color: var(--primary-bg);
}


header h1 {
    font-family: var(--font-headline);
    color: var(--accent-color);
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    font-feature-settings: 'kern' 1, 'ss01' 1;
}

.name-short {
    display: none;
}

.header-links {
    display: flex;
    gap: 1.5rem;
}


.header-links a {
    font-family: var(--font-ui);
    color: var(--muted-text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    transition: color 0.2s ease;
}

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

/* mobile Footer */
.mobile-footer {
    display: none;
    text-align: center;
    padding: 1.5rem 2rem 1rem 2rem;
    background-color: var(--primary-bg);
    margin-top: 1.5rem;
}

.mobile-footer h3 {
    color: var(--accent-color);
    font-size: 1.1rem;
    font-weight: 300;
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

.mobile-footer-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.mobile-footer-links a {
    color: var(--muted-text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 400;
    letter-spacing: 0.5px;
    transition: color 0.2s ease;
}

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


.nav-tabs {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
    justify-content: center;
}

.nav-tab {
    font-family: var(--font-ui);
    color: var(--muted-text);
    text-decoration: none;
    padding: 0.5rem 0;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    transition: color 0.2s ease;
    border-bottom: 2px solid transparent;
}

.nav-tab.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

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


.project-card {
    background: var(--card-gradient, var(--secondary-bg));
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.project-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px var(--subtle-shadow);
.post-meta-row > .reading-time,
.post-meta-row > .tag-container {
  min-width: 0;
  flex-shrink: 1;
}
    border-color: var(--muted-text);
}

.project-icon {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--accent-color), var(--muted-text));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    font-weight: 300;
}

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


.project-card h3 {
    font-family: var(--font-headline);
    color: var(--accent-color);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.project-card p {
    color: var(--muted-text);
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.project-tag {
    background-color: var(--hover-bg);
    color: var(--accent-color);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    border: 1px solid var(--border-color);
}

.project-links {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.project-link {
    color: var(--accent-color);
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: color 0.2s ease;
}

.project-link:hover {
    color: var(--text-color);
}

.project-status {
    font-size: 11px;
    color: var(--muted-text);
    font-weight: 400;
}


.post {
    background: var(--card-gradient, linear-gradient(135deg, var(--secondary-bg) 0%, #ffffff 100%));
    padding: 1.5rem 1.5rem 0.75rem 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 6px rgba(60, 64, 67, 0.02);
}


.post:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(60, 64, 67, 0.04);
    border-color: rgba(60, 64, 67, 0.12);
}


.post h2 {
    font-family: var(--font-headline);
    color: var(--accent-color);
    margin-top: -0.5rem;
    margin-bottom: 1rem;
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.03em;
    font-feature-settings: 'kern' 1, 'ss01' 1;
    position: relative;
}

.post h2::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 0;
    width: 24px;
    height: 2px;
    background: var(--genre-gradient, var(--accent-color));
    opacity: 0.3;
    transition: all 1.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.post:hover h2::after {
    width: 100%;
    opacity: 0.5;
}

.post h2 a {
    color: inherit;
    text-decoration: none;
}

.post h2 a:hover {
    color: var(--text-color);
}

.post-caption {
    color: var(--muted-text);
    font-size: 13px;
    font-style: italic;
    line-height: 1.5;
    margin-bottom: 1.5rem;
    opacity: 0.75;
    position: relative;
    padding-left: 1rem;
}

.post-caption::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.5rem;
    width: 3px;
    height: 3px;
    background: var(--muted-text);
    border-radius: 50%;
    opacity: 0.4;
}

.post p {
    color: var(--text-color);
    font-size: 16px;
    line-height: 1.7;
    margin-bottom: 0.6rem;
    font-weight: 400;
}

.post p:first-of-type {
    margin-top: 0.6rem;
}

.read-more {
    font-family: var(--font-ui);
    color: var(--accent-color);
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: color 0.2s ease;
    display: block;
    width: fit-content;
    margin-top: 0.25rem;
    font-feature-settings: 'kern' 1;
}

.read-more .arrow {
    margin-left: 0.5rem;
    transition: transform 0.3s ease;
    display: inline-block;
    font-size: 12px;
    position: relative;
}

.read-more .arrow::after {
    content: '→';
    margin-left: 0.4rem;
    transition: transform 0.3s ease;
    display: inline-block;
}

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

.read-more:hover .arrow::after {
    transform: translateX(5px);
}


.post-footer {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-top: 0.75rem;
    gap: 0.75rem;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    justify-content: flex-end;
}

.post-footer .read-more {
    align-self: flex-end;
    margin-top: 0;
}


.post .genre-tag {
    margin-top: 0;
    margin-bottom: 0;
}


code, pre {
    font-family: var(--font-mono);
    font-feature-settings: 'kern' 1, 'liga' 1;
}

code {
    background-color: var(--hover-bg);
    padding: 0.125rem 0.25rem;
    border-radius: 3px;
    font-size: 0.875em;
    color: var(--accent-color);
    border: 1px solid var(--border-color);
}

pre {
    background-color: var(--hover-bg);
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    border: 1px solid var(--border-color);
    line-height: 1.5;
}

pre code {
    background: none;
    padding: 0;
    border: none;
    font-size: 0.875rem;
}


h1, h2, h3, h4, h5, h6 {
    font-feature-settings: 'kern' 1, 'liga' 1, 'calt' 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}


.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}


.back-to-home {
    display: inline-flex;
    align-items: center;
    margin-top: 1rem;
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.back-to-home:hover {
    color: var(--text-color);
}

.back-to-home::before {
    content: '←';
    margin-right: 0.5rem;
    transition: transform 0.2s ease;
}

.back-to-home:hover::before {
    transform: translateX(-3px);
}

/* Post Page Styles */
.post-page {
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
    margin: 0;
    max-width: 900px;
    margin: 0 auto;
}

.post-page h1 {
    font-family: var(--font-headline);
    color: var(--accent-color);
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.04em;
    text-align: left;
    font-feature-settings: 'kern' 1, 'ss01' 1;
    display: block;
    width: 100%;
}

/* Tag container positioned below the title */
.post-page .tag-container {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    justify-content: flex-end;
    margin-top: 1rem;
    margin-bottom: 1rem;
    width: 100%;
}

.post-page .tag-container .genre-tag {
    margin-top: 0;
    margin-bottom: 0;
    margin-right: 0;
    margin-left: 0;
    flex-shrink: 0;
    font-size: 12px;
    padding: 0.3rem 0.6rem;
    display: inline-block;
}

.post-page .tag-container .genre-tag:first-of-type {
    margin-left: 0;
}

.post-page .tag-container .genre-tag:last-of-type {
    margin-right: 0;
}

.post-page h2 {
    font-family: var(--font-headline);
    color: var(--accent-color);
    font-size: 1.8rem;
    margin: 2rem 0 1rem 0;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.02em;
    text-align: left;
}

.post-page p {
    color: var(--text-color);
    font-size: 18px;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.post-page ol,
.post-page ul {
    color: var(--text-color);
    font-size: 16px;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.post-page li {
    margin-bottom: 0.5rem;
}

.post-page blockquote {
    position: relative;
    margin: 2rem 0;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--secondary-bg) 0%, var(--hover-bg) 100%);
    border: none;
    border-radius: 12px;
    font-style: normal;
    color: var(--text-color);
    font-size: 1.1rem;
    line-height: 1.6;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    min-height: 4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.post-page blockquote::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--genre-gradient, var(--accent-color));
    opacity: 0.8;
}


/* Blockquote quote mark: half opacity on desktop, full on hover, always full on mobile */
.post-page blockquote::after {
    content: '\201D';
    position: absolute;
    top: 50%;
    right: 4rem;
    font-size: 4rem;
    font-weight: 300;
    background: var(--genre-gradient, var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    opacity: 0.7 !important;
    font-family: 'Times New Roman', Times, serif;
    line-height: 1;
    pointer-events: none;
    transition: opacity 0.3s ease;
    transform: translateY(-50%);
}

/* On hover, full opacity and gradient text */

.post-page blockquote:hover::after {
    opacity: 1 !important;
}

.post-page blockquote p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.5;
    padding-right: 6rem;
    padding-bottom: 1.2em;
@media (max-width: 768px) {
  .post-page blockquote p {
    padding-bottom: 0 !important;
  }
}
    flex: 1;
    display: flex;
    align-items: center;
}

.post-page blockquote cite {
    position: absolute;
    bottom: 0.5rem;
    right: 1.5rem;
    margin-top: 2em;
    font-size: 0.9rem;
    font-style: normal;
    background: var(--genre-gradient, var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    opacity: 0.7 !important;
    text-align: right;
    transition: opacity 0.3s ease;
}

@media (max-width: 768px) {
  .post-page blockquote::after {
    font-size: 7rem;
    right: 2rem;
  }
  .post-page blockquote cite {
    margin-top: 0em;
  }
}


/* On hover, full opacity and gradient text */
.post-page blockquote:hover cite {
    opacity: 1 !important;
}
@media (max-width: 768px) {
  .post-page blockquote::after,
  .post-page blockquote cite {
    opacity: 1 !important;
  }
}

/* Genre Tag Styles */
.genre-tag {
    font-family: var(--font-ui);
    display: block;
    width: fit-content;
    padding: 0.4rem 0.6rem;
    margin-top: 0.9rem;
    margin-bottom: 0.9rem;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.2s ease;
}

.genre-tag.economics {
    background-color: var(--hover-bg);
    color: #4caf50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.post:has(.genre-tag.economics) {
    --genre-color: #4caf50;
}

.genre-tag.neuroscience {
    background-color: var(--hover-bg);
    color: #ba68c8;
    border: 1px solid rgba(186, 104, 200, 0.3);
}

.post:has(.genre-tag.neuroscience) {
    --genre-color: #ba68c8;
}

.genre-tag.technology {
    background-color: var(--hover-bg);
    color: #64b5f6;
    border: 1px solid rgba(100, 181, 246, 0.3);
}

.post:has(.genre-tag.technology) {
    --genre-color: #64b5f6;
}

.genre-tag.other {
    background-color: var(--hover-bg);
    color: #ffb74d;
    border: 1px solid rgba(255, 183, 77, 0.3);
}

.post:has(.genre-tag.other) {
    --genre-color: #ffb74d;
}

/* Post page genre color variables */
.post-page:has(.genre-tag.economics) {
    --genre-color: #4caf50;
}

.post-page:has(.genre-tag.neuroscience) {
    --genre-color: #ba68c8;
}

.post-page:has(.genre-tag.technology) {
    --genre-color: #64b5f6;
}

.post-page:has(.genre-tag.other) {
    --genre-color: #ffb74d;
}


.post-page a {
    background: var(--genre-gradient, var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    position: relative;
    font-weight: 500;
    transition: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding-bottom: 1px;
}

.post-page a:hover {
    background: none;
    color: var(--text-color);
    -webkit-text-fill-color: var(--text-color);
    border-bottom-color: var(--text-color);
}

.post-page a:active {
    transform: translateY(1px);
}


.post-page a[href^="http"]::after {
    content: "↗";
    font-size: 0.8em;
    margin-left: 0.2em;
    opacity: 0.6;
    transition: opacity 0.2s ease;
    background: var(--genre-gradient, var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.post-page a[href^="http"]:hover::after {
    opacity: 1;
    background: none;
    color: var(--text-color);
    -webkit-text-fill-color: var(--text-color);
}


.definition-term {
    position: relative;
    background: var(--genre-gradient, var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 500;
    padding: 0.1em 0.3em;
    margin: 0 0.1em;
    border-radius: 4px;
    transition: -webkit-text-fill-color 0.3s cubic-bezier(0.4,0,0.2,1), color 0.3s cubic-bezier(0.4,0,0.2,1), background 0.3s cubic-bezier(0.4,0,0.2,1);
    display: inline;
    text-decoration: none;
    white-space: nowrap;
    max-width: none;
    width: auto;
}

.definition-term::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--genre-gradient, var(--accent-color));
    border-radius: 4px;
    pointer-events: none;
    z-index: -1;
    mask: url("data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' stroke='black' stroke-width='1' stroke-dasharray='3,3' stroke-dashoffset='0' stroke-linecap='square'/%3e%3c/svg%3e");
    -webkit-mask: url("data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' stroke='black' stroke-width='1' stroke-dasharray='3,3' stroke-dashoffset='0' stroke-linecap='square'/%3e%3c/svg%3e");
    transition: background 0.3s cubic-bezier(0.4,0,0.2,1);
}

.definition-term:hover {
    -webkit-text-fill-color: var(--text-color);
    color: var(--text-color);
}

.definition-term:hover::before {
    background: var(--text-color);
}

.definition-tooltip {
    position: absolute;
    top: 50%;
    left: 100%;
    transform: translateY(-50%);
    margin-left: 0.5rem;
    background: var(--secondary-bg);
    color: var(--text-color);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.8rem;
    line-height: 1.4;
    font-weight: 400;
    font-family: var(--font-body);
    max-width: 400px;
    min-width: 280px;
    width: max-content;
    text-align: left;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 1000;
    pointer-events: none;
    border: 1px solid var(--border-color);
    overflow: hidden;
    white-space: normal;
}

.definition-tooltip::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 2px;
    height: 100%;
    background: var(--genre-gradient, #4caf50);
    border-radius: 8px 0 0 8px;
    opacity: 0.8;
    z-index: 1;
}

.definition-tooltip::after {
    content: '';
    position: absolute;
    top: 50%;
    left: -6px;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-right: 6px solid var(--secondary-bg);
    filter: drop-shadow(-1px 0 2px rgba(0, 0, 0, 0.04));
    z-index: 1;
}

/* invisible bridge to prevent tooltip from disappearing */
.definition-term::after {
    content: '';
    position: absolute;
    top: 0;
    left: 100%;
    width: 0.5rem;
    height: 100%;
    background: transparent;
    z-index: 999;
}

.definition-term:hover .definition-tooltip,
.definition-tooltip:hover {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%);
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: auto;
}

/* ensre tooltips work in post pages with genre colors */
.post-page .definition-tooltip {
    background: var(--secondary-bg);
    color: var(--text-color);
    border-color: var(--border-color);
}

.post-page .definition-tooltip::before {
    background: var(--genre-gradient, #4caf50);
}

.post-page .definition-tooltip::after {
    border-top-color: var(--secondary-bg);
}


.economics .definition-term {
    --genre-color-rgb: 34, 139, 34;
}

.technology .definition-term {
    --genre-color-rgb: 79, 172, 254;
}

.philosophy .definition-term {
    --genre-color-rgb: 138, 43, 226;
}

.personal .definition-term {
    --genre-color-rgb: 255, 140, 0;
}

.other .definition-term {
    --genre-color-rgb: 108, 117, 125;
}

/*  positioning tooltip below term when at edge of screen */
.definition-tooltip.tooltip-below {
    left: 0 !important;
    top: 100% !important;
    transform: translateY(0.5rem) !important;
    margin-left: 0 !important;
    margin-top: 0 !important;
}

.definition-tooltip.tooltip-below::after {
    /* arrow pointing up when tooltip is below */
    top: -5px !important;
    left: 20px !important;
    transform: none !important;
    border-left: 5px solid transparent !important;
    border-right: 5px solid transparent !important;
    border-bottom: 5px solid var(--secondary-bg) !important;
    border-top: none !important;
}

.definition-tooltip.tooltip-below::before {
    /* Keep the left accent line for below positioning */
    top: 0 !important;
    left: 0 !important;
    width: 2px !important;
    height: 100% !important;
    background: var(--genre-gradient, #4caf50) !important;
    border-radius: 8px 0 0 8px !important;
    opacity: 0.8 !important;
}

/* Desktop Styles */
@media (min-width: 769px) {
    .definition-term {
        transition: -webkit-text-fill-color 0.3s cubic-bezier(0.4,0,0.2,1), color 0.3s cubic-bezier(0.4,0,0.2,1), background 0.3s cubic-bezier(0.4,0,0.2,1);
    }
    .definition-term::before {
        transition: background 0.3s cubic-bezier(0.4,0,0.2,1);
    }
    .definition-tooltip {
        transition: opacity 0.6s cubic-bezier(0.4,0,0.2,1), visibility 0.6s cubic-bezier(0.4,0,0.2,1);
        opacity: 0;
        visibility: hidden;
    }
    .definition-term.tooltip-active .definition-tooltip {
        opacity: 1;
        visibility: visible;
        transition: opacity 0.2s cubic-bezier(0.4,0,0.2,1), visibility 0.2s cubic-bezier(0.4,0,0.2,1);
    }
    .container {
        max-width: 1200px;
        width: 85%;
        padding: 1rem 4rem 4rem 4rem;
    }
    
    header {
        padding: 2rem 4rem 1.5rem 4rem;
    }
    
    header h1 {
        font-size: 1.5rem;
        letter-spacing: -0.02em;
        font-weight: 600;
    }
    
    .header-links {
        gap: 2rem;
    }
    
    .header-links a {
        font-size: 1rem;
        font-weight: 500;
    }
    
    .nav-tabs {
        gap: 3rem;
        margin-bottom: 3rem;
    }
    
    .nav-tab {
        font-size: 1rem;
    }
    
    .post {
        padding: 2.5rem;
        margin-bottom: 2.5rem;
    }
    
    .post h2 {
        font-size: 1.5rem;
        margin-bottom: 1.2rem;
    }
    
    .post p {
        font-size: 17px;
    }
    
    .project-card {
        padding: 1.5rem 3rem;
        gap: 2.5rem;
        margin-bottom: 2.5rem;
    }
    
    .project-icon {
        width: 70px;
        height: 70px;
        font-size: 28px;
    }
    
    .project-card h3 {
        font-size: 1.2rem;
    }
    
    .project-card p {
        font-size: 14px;
    }
    
    .post-page h1 {
        font-size: 3rem;
        line-height: 1.05;
    }
    
    .post-page h2 {
        font-size: 2.2rem;
    }
    
    /* desktop-only: tooltip transitions */
    .definition-tooltip {
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.2s ease, visibility 0.2s ease;
        pointer-events: none;
    }
    
    .definition-term.tooltip-active .definition-tooltip {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    /* Fix tooltip arrow for mobile: center at top of tooltip */
    .definition-tooltip::after,
    .definition-tooltip.tooltip-below::after {
        left: 50% !important;
        top: -7px !important;
        transform: translateX(-50%) !important;
        border-left: 7px solid transparent !important;
        border-right: 7px solid transparent !important;
        border-bottom: 7px solid var(--secondary-bg) !important;
        border-top: none !important;
        width: 0 !important;
        height: 0 !important;
        position: absolute !important;
        margin: 0 !important;
        filter: none !important;
        content: '' !important;
        z-index: 2;
    }
    header {
        display: none;
    }

    
    .mobile-footer {
        display: block;
    }
    
    .container {
        width: 95%;
        padding: 1rem;
    }
    
    .nav-tabs {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        background: var(--primary-bg);
        border-bottom: 1px solid var(--border-color);
        padding: 1rem 1.5rem;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        gap: 1.5rem;
        justify-content: flex-start;
    }
    
    #journal, #projects {
        padding-top: 80px;
    }
    
    /* Simple scroll animations for mobile */
    .post, .project-card {
        margin-bottom: 2rem;
        padding: 1.5rem;
        transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .post.animate-ready, .project-card.animate-ready {
        opacity: 0;
        transform: translateY(30px);
    }
    
    .post.animate-in, .project-card.animate-in {
        opacity: 1;
        transform: translateY(0);
    }
    
    .post {
        border-radius: 16px;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    }
    
    .post.animate-in {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    }
    
    .post h2 {
        font-size: 1.3rem;
        margin-bottom: 1rem;
    }
    
    .post p {
        font-size: 0.9rem;
        line-height: 1.6;
    }
    
    .project-card {
        padding: 1.5rem;
        margin-bottom: 2rem;
        flex-direction: column;
        text-align: center;
        border-radius: 12px;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    }
    
    .project-card.animate-in {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    }
    
    .project-icon {
        width: 50px;
        height: 50px;
        font-size: 20px;
        margin-bottom: 1rem;
        transition: transform 0.3s ease;
    }
    
    .project-card.animate-in .project-icon {
        transform: scale(1.05);
    }
    
    .project-card h3 {
        font-size: 1.2rem;
        margin-bottom: 0.75rem;
    }
    
    .project-card p {
        font-size: 0.85rem;
        margin-bottom: 1rem;
    }
    
    .project-tags {
        justify-content: center;
        margin-bottom: 1rem;
    }
    
    .project-links {
        justify-content: center;
        gap: 1rem;
    }
    
    /* Staggered animation delay for multiple cards */
    .post:nth-child(1) { transition-delay: 0s; }
    .post:nth-child(2) { transition-delay: 0.1s; }
    .post:nth-child(3) { transition-delay: 0.2s; }
    .post:nth-child(4) { transition-delay: 0.3s; }
    .post:nth-child(5) { transition-delay: 0.4s; }
    
    .project-card:nth-child(1) { transition-delay: 0s; }
    .project-card:nth-child(2) { transition-delay: 0.1s; }
    .project-card:nth-child(3) { transition-delay: 0.2s; }
}

@media (max-width: 480px) {
    .post-page h1 {
        font-size: 2.2rem;
        text-align: left;
        padding-top: 2.5rem;
        padding-bottom: 0rem;
        margin-bottom: 1.1rem;
    }
    
    .definition-tooltip {
        /* JS will set width to match .definition-term on mobile */
        width: auto;
        min-width: 140px;
        min-height: 3.2em;
        padding: 0.7rem 0.9rem;
        font-size: 0.75rem;
        line-height: 1.5;
        border-radius: 4px;
    }
    
    .definition-tooltip::after {
        left: 50% !important;
        top: -7px !important;
        transform: translateX(-50%) !important;
        border-left: 7px solid transparent !important;
        border-right: 7px solid transparent !important;
        border-bottom: 7px solid var(--secondary-bg) !important;
        border-top: none !important;
        width: 0 !important;
        height: 0 !important;
        position: absolute !important;
        margin: 0 !important;
        filter: none !important;
        content: '' !important;
        z-index: 2;
    }
    .name-full {
        display: none;
    }
    
    .name-short {
        display: inline;
    }
    
    .container {
        padding: 0.5rem 1rem 1.5rem 1rem;
    }
    
    .nav-tabs {
        gap: 1rem;
        margin-bottom: 1.5rem;
        justify-content: flex-start;
    }
    
    .post {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .post h2 {
        font-size: 1.2rem;
        margin-bottom: 0.75rem;
    }
    
    .post p {
        font-size: 12px;
        margin-bottom: 1rem;
    }
    
    .read-more {
        font-size: 11px;
    }
    
    .project-card {
        padding: 1rem;
        gap: 0.75rem;
        flex-direction: column;
        text-align: center;
    }
    
    .project-icon {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
    
    .project-card h3 {
        font-size: 0.9rem;
    }
    
    .project-card p {
        font-size: 11px;
    }
    
    .project-links {
        justify-content: center;
    }
    
    /* Removed duplicate .post-page h1 and h2 rules that override the above */
}

