@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Roboto:ital,wght@0,100..900;1,100..900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Big+Shoulders+Display:wght@100..900&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');

:root {
    --background: #FCFCFC;
    --background-grey: #F3F5F7;
    --border-light: #cccccc;
    --text-primary: #262628; 
    --text-secondary: #737373; 
    --text-normal: #262628;
    --text-bold: #0a0a0a;
    --primary: #0070EA; 
    --red:#db4f4f;
}

@media (prefers-color-scheme: dark) {
    :root {
        --background: #040404;
        --background-grey: #2B2C2E;
        --border-light: #333435;
        --text-primary: #F0F0F0; 
        --text-secondary: #adabab; 
        --text-normal: #e4e4e4;
        --text-bold: #ffffff;
        --primary: #0A84FF; 
        --red:#db4f4f;
    }

    hr {
        margin-top: 4rem;
        margin-bottom: 2rem;
        border: 0;
        border-top: 1px solid var(--background-grey);
    }
}

html.force-light {
    --background: #FCFCFC;
    --background-grey: #F3F5F7;
    --border-light: #cccccc;
    --text-primary: #262628;
    --text-secondary: #737373;
    --text-normal: #262628;
    --text-bold: #0a0a0a;
    --primary: #0070EA;
    --red: #db4f4f;
    color-scheme: light;
}

html.force-dark {
    --background: #040404;
    --background-grey: #2B2C2E;
    --border-light: #333435;
    --text-primary: #F0F0F0;
    --text-secondary: #adabab;
    --text-normal: #e4e4e4;
    --text-bold: #ffffff;
    --primary: #0A84FF;
    --red: #db4f4f;
    color-scheme: dark;
}



html {
    background-color: var(--background);
} 

body {
    font-family: "Inter", serif;
    font-size: 16px;
    color: var(--text-primary);
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

h1 {
    font-family: "Big Shoulders Display", serif;
    font-size: 3rem !important;
    margin-top: 1rem;
    margin-bottom: 1rem;
    letter-spacing: -0.3px;
}

h2, h3, h4, h5, h6, p{
    font-family: 'Inter', sans-serif;
}   


h2 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1rem;
    letter-spacing: -0.3px;
    color: var(--text-bold);
}

h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    line-height: 1.6rem;
    color: var(--text-bold);
}

li {
    line-height: 1.5;
    margin-top: 0.5rem;
}


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

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

p a:hover {
    text-decoration: underline;
}

p {
    line-height: 1.5;
    margin-top: 0rem;
}

.headtag {
    display: inline-flex;
    height: 20px;
    text-decoration: none !important;
  }
  
  .arr {
    display: none;
    color: var(--red);
  }
  
  .headtag:hover .arr {
    display: flex;
    margin-left: 10px;
  }
  
  .headtag:hover {
    color: var(--red);
    text-decoration: none !important;
  }

#intro-tags1 {
    margin-top: 3rem;
    color: var(--text-secondary) !important;
}

.intro-hr {
    margin-top: 4rem;
    margin-bottom: 2rem;
    border: 0;
    border-top: 1px solid var(--background-grey);
}

pre {
    font-size: 0.8rem;
    line-height: 1.6rem;
    margin: 0;
    padding: 0;
    background-color: #1E1E1E;
    border-radius: 8px;
    width: 100%;
    margin: 1.5rem 0;
}

code {
    padding: 1.5rem;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-x: visible;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    color: #D4D4D4;
    display: block;
    border-radius: 8px;
}

pre > code {
    margin: 0;
}

.container {
    width: 90%;
    margin-left: auto;
    margin-right: auto;
}

@media only screen and (max-width: 768px) and (min-width: 481px) {
    .container {
        width: 90%;
    }
}

@media only screen and (max-width: 480px) {
    .container {
        width: 95%;
    }
}

.article-container {
    margin: auto;
    display: flex;
    justify-content: center;
    padding: 100px 20px;
    width: 100%;
    box-sizing: border-box;
}
.article-body {
    max-width: 700px;
    width: 100%;
    padding: 0 1rem;
    box-sizing: border-box;
}

.article-figure {
    margin: 2rem 0;
}

.article-figure img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.article-figure figcaption {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

ol {
    padding-left: 1.5rem;
    margin: 1rem 0;
}

ol li {
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.article-video {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
}

.article-h1{
    font-size: 2rem;
    letter-spacing: -0.05rem;
    margin-bottom: 2rem;
    margin-top: 1rem;
}

.article-h2{
    margin-top: 4rem;
}

.grey-background-article {
    background-color: var(--background-grey);
    border-radius: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 100%;
    min-width: 180px;
    height: 280px;
    position: relative;
    overflow: hidden;
}

.project-image {
    max-width: 100%;
    object-fit: contain;
}

@media only screen and (max-width: 480px) {
    .grey-background-article {
        height: 200px;
    }
}

@media only screen and (max-width: 768px) {
    .article-container {
        padding: 50px 10px;
    }
    
    .article-body {
        padding: 0;
    }
}

/* Make code blocks in list items full width */
li pre {
    margin-left: -1.5rem; /* Counter the list item padding */
    margin-right: 0;
    width: calc(100% + 1.5rem); /* Expand width to compensate for negative margin */
}

@media only screen and (max-width: 768px) {
    li pre {
        margin-left: -1.5rem;
        width: calc(100% + 1.5rem);
    }
}

.back-button {
    position: fixed;
    top: 2rem;
    left: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    color: var(--text-primary) !important;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    z-index: 100;
    white-space: nowrap;
}

.back-button:hover {
    transform: translateY(-1px);
    color: var(--primary) !important;
}

@media only screen and (max-width: 768px) {
    .back-button {
        position: relative;
        display: inline-flex;
    }
}

@media only screen and (max-width: 768px) {
    .back-button {
        top: 1rem;
        left: 1rem;
    }
}

@media only screen and (max-width: 1200px) {
    .project-preview {
        right: 0;
        width: 45%;
    }
}

@media only screen and (max-width: 768px) {
    .project-preview {
        display: none;
    }
}

@media only screen and (max-width: 1400px) {
    .project-preview {
        width: 500px;
    }
}

@media only screen and (max-width: 1200px) {
    .project-preview {
        width: 400px;
    }
}

.footer-container {
    display: flex;
    justify-content: space-between;
    color: var(--text-secondary);
}

.hyp-p {
    color: var(--primary) !important;
}

.hyp-p:hover {
    color: var(--red) !important;
}

.references {
    margin-top: 1rem;
}

.references p {
    line-height: 1.5;
    margin-top: 0.5rem;
    margin-bottom: 0;
}

/* Table of Contents */
.toc-sticky {
    position: fixed;
    top: 2rem;
    right: 24px;
    width: 220px;
    z-index: 110;
}

.toc-wrapper {
    position: relative;
    padding-left: 22px;
    background: var(--background);
    border: none;
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: none;
    transition: transform 0.2s ease;
}

.toc-wrapper:hover {
    transform: translateY(-1px);
}

.toc-title {
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin: 0 0 8px 0;
    color: var(--text-secondary);
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-list li {
    margin: 6px 0;
}

.toc-list a {
    display: block;
    padding: 4px 0 4px 8px;
    border-left: 2px solid transparent;
    color: rgba(128, 128, 128, 0.6);
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.toc-list a:hover {
    color: var(--primary);
    border-left: 2px solid transparent;
}

.toc-list a.active {
    color: var(--text-primary);
    border-left: 2px solid transparent;
}

.toc-top {
    display: inline-block;
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--primary);
}

.reading-progress {
    position: absolute;
    left: 0;
    width: 2px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 999px;
    overflow: hidden;
    pointer-events: none;
}

.reading-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0;
    background: var(--text-secondary);
    border-radius: inherit;
    transition: height 0.1s linear;
}

/* Theme toggle */
.theme-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.12);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.86rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
    cursor: pointer;
    box-shadow: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    z-index: 195;
    transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}

.theme-toggle:hover {
    transform: translateY(-1px);
    background: rgba(0, 0, 0, 0.16);
    border-color: rgba(0, 0, 0, 0.12);
}

.theme-toggle:active {
    transform: translateY(0);
}

/* Toast notifications */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    max-width: 320px;
    padding: 14px 16px;
    border-radius: 12px;
    background: rgba(20, 20, 20, 0.92);
    color: #f7f7f7;
    box-shadow: 0 12px 30px rgba(0,0,0,0.18);
    display: none;
    gap: 12px;
    z-index: 200;
}

.toast.show {
    display: grid;
    grid-template-columns: 1fr;
    row-gap: 10px;
}

.toast-title {
    font-size: 0.95rem;
    font-weight: 700;
}

.toast-text {
    font-size: 0.9rem;
    color: #e0e0e0;
    line-height: 1.4;
}

.toast-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.toast button {
    cursor: pointer;
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.toast .btn-primary {
    background: #f7f7f7;
    color: #141414;
    box-shadow: 0 6px 14px rgba(0,0,0,0.22);
}

.toast .btn-ghost {
    background: transparent;
    color: #f7f7f7;
    border: 1px solid rgba(255,255,255,0.35);
}

.toast button:hover {
    transform: translateY(-1px);
}

.toast button:active {
    transform: translateY(0);
}

/* Table Styling */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    border: 1px solid var(--background-grey);
    border-radius: 8px;
    overflow: hidden;
}

/* Table header styling */
table th {
    text-align: left;
    font-weight: 600;
    font-size: 0.95rem;
}

/* Table data cell styling */
table td {
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Cell padding and borders */
table th, table td {
    padding: 0.75rem 1rem;
    vertical-align: top;
    border-bottom: 1px solid var(--background-grey);
}

table tr:last-child td {
    border-bottom: none;
}

/* Table header row background */
.table-header {
    background-color: #D1D5DB;
}

/* First column highlight */
.table-first-col {
    background-color: rgba(209, 213, 219, 0.4);
}

/* Dark mode table colors */
@media (prefers-color-scheme: dark) {
    .table-header {
        background-color: var(--background-grey);
    }
    .table-first-col {
        background-color: rgba(43, 44, 46, 0.3);
    }
}
