/* =========================================================
   DESIGN TOKENS
   ========================================================= */

:root {
    /* ---------- Accent seed ---------- */
    --accent: #ea0a2a; 

    /* ---------- Neutrals ---------- */
    --bg-dark: #046648; 
    --bg-light: #f2f2f2;
    --bg-lighter: #b7b7b7;

    --text-primary: #eaeaea;
    --text-secondary: #e0e0e0;
    --text-tertiary: #d0d0d0;
    --text-muted: #aaaaaa;
    --text-strong: #ffffff;
    --text-em: #f0f0f0;
    --text-dark: #1b1b1b;

    --white: #ffffff;

    /* ---------- Typography ---------- */
    --font-body: "Courier New", Courier, monospace;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

    --line-body: 1.6;
    --line-loose: 1.7;

    /* ---------- Spacing ---------- */
    --spacing-list-item: 10px;
}


/* =========================================================
   ACCENT DERIVATIVES (THE MAGIC)
   ========================================================= */

:root {
    /* solid */
    --accent-strong: var(--accent);

    /* lighter / hover */
    --accent-hover: color-mix(in srgb, var(--accent) 85%, white);

    /* transparent layers */
    --accent-10: color-mix(in srgb, var(--accent) 10%, transparent);
    --accent-15: color-mix(in srgb, var(--accent) 15%, transparent);
    --accent-30: color-mix(in srgb, var(--accent) 30%, transparent);
    --accent-80: color-mix(in srgb, var(--accent) 80%, transparent);

    /* borders / soft lines */
    --accent-border-soft: color-mix(in srgb, var(--accent) 35%, transparent);
    --accent-border-strong: color-mix(in srgb, var(--accent) 60%, transparent);
}


/* =========================================================
   RESET & BASE
   ========================================================= */

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-light);
    color: var(--text-primary);
    line-height: var(--line-body);
}


/* =========================================================
   LINKS
   ========================================================= */

a {
    color: var(--text-primary);
    text-decoration: none;
    border-bottom: 1px solid var(--accent-border-soft);
    transition: color 0.2s ease, border-color 0.2s ease;
}

a:hover {
    color: var(--text-primary);
    border-bottom-color: var(--accent-border-strong);
}

/* =========================================================
   NAVIGATION
   ========================================================= */

.nav {
    margin-bottom: 10px;
}

.nav a {
    display: inline-block;
    padding: 0px 2px;
    margin-right: 10px;

    color: var(--text-primary);
    text-decoration: none;
    border-radius: 3px;
}


/* =========================================================
   LAYOUT
   ========================================================= */

.container {
    max-width: 800px;
    margin: 60px auto;
    padding: 40px;
    background-color: var(--bg-dark);
    border-radius: 6px;
    animation: fadeIn 0.6s ease-out;
}


/* =========================================================
   HEADINGS
   ========================================================= */

h1 {
    color: var(--accent-strong);
}

h2, h3 {
    position: relative;
    padding-left: 14px;
    
}

h2::before,
h3::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.2em;
    bottom: 0.2em;
    width: 3px;
    background: linear-gradient(
        to bottom,
        var(--accent-80),
        var(--accent-30)
    );
    border-radius: 2px;
}

.article > h2 {
    margin-top: 40px;
    background: linear-gradient(
        to right,
        color-mix(in srgb, var(--white) 4%, transparent),
        transparent
    );
}


/* =========================================================
   TEXT
   ========================================================= */

p {
    margin-bottom: 1.1em;
    text-align: justify;
}

p + p {
    margin-top: 0.2em;
}

.article p:first-of-type:not(.lead) {
    font-size: 1.05em;
}

.article p + p {
    text-indent: 1.5em;
}

.lead {
    padding: 10px 14px;
    background: color-mix(in srgb, var(--white) 4%, transparent);
    border-radius: 3px;
}

em {
    color: var(--text-em);
    font-style: italic;
}

strong {
    font-weight: normal;
    color: var(--text-strong);
}


/* =========================================================
   QUOTES
   ========================================================= */

.quote {
    border-left: 3px solid var(--accent-strong);
    padding: 20px 40px 20px 50px;
    margin: 25px 0;
    background-color: color-mix(in srgb, var(--white) 5%, transparent);
    position: relative;
    font-style: italic;
    color: var(--text-tertiary);
    transition: all 0.3s ease;
}

.quote:hover {
    background-color: color-mix(in srgb, var(--white) 8%, transparent);
    transform: translateX(3px);
    border-left-color: var(--accent-hover);
}

.quote::before,
.quote::after {
    font-size: 2.5em;
    color: var(--accent-strong);
    opacity: 0.3;
    position: absolute;
}

.quote::before {
    content: "❝";
    left: 15px;
    top: 8px;
}

.quote::after {
    content: "❞";
    right: 20px;
    bottom: -10px;
}

.quote p {
    margin-bottom: 10px;
    line-height: var(--line-loose);
    text-indent: -0.4em;
    padding-left: 0.4em;
}

.quote p:first-child {
    text-indent: 0.5em;
}

.quote .quote-author {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid color-mix(in srgb, var(--white) 10%, transparent);
    text-align: right;
    font-size: 0.9em;
    color: var(--accent-strong);
}

.quote .quote-author::before {
    content: "— ";
}


/* =========================================================
   ARTICLE LIST
   ========================================================= */

.article-list {
    list-style: none;
    margin: 15px 0;
    padding: 0;
}

.article-list-item {
    display: flex;
    align-items: baseline;
    padding: var(--spacing-list-item);
    border-bottom: 1px solid color-mix(in srgb, var(--white) 8%, transparent);
    position: relative;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.article-list-item:hover {
    background-color: var(--accent-10);
    transform: translateX(3px);
}

.article-list-link {
    flex: 1;
    color: var(--accent-strong);
    white-space: nowrap;
    overflow: hidden;
    border-bottom: none;
    text-overflow: ellipsis;
}

.article-list-link:hover {
    color: var(--accent-hover);
}

.article-list-date {
    font-size: 0.85em;
    color: var(--text-muted);
    min-width: 85px;
    text-align: right;
    padding: 2px 10px;
    background-color: var(--bg-dark);
    transition: all 0.2s ease;
}

.article-list-item:hover .article-list-date {
    color: var(--accent-hover);
    background-color: var(--accent-10);
}

.article-list-languages {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-right: 20px;
}

.article-list-language-link {
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.75em;
    text-transform: uppercase;

    color: var(--text-muted);
    background-color: color-mix(in srgb, var(--white) 5%, transparent);
    border: 1px solid color-mix(in srgb, var(--white) 10%, transparent);
    border-radius: 3px;

    text-decoration: none;
    border-bottom: none;
    letter-spacing: 0.03em;
    transition: all 0.2s ease;
}

.article-list-language-link:hover {
    color: var(--accent-hover);
    background-color: var(--accent-10);
    border-color: var(--accent-30);
}

.article-list-language-link.active {
    color: var(--accent-strong);
    background-color: var(--accent-15);
    border-color: var(--accent-30);
}



/* =========================================================
   CODE
   ========================================================= */

.code-block {
    margin: 16px 0;
    border-radius: 6px;
    overflow: hidden;
    background: color-mix(in srgb, var(--white) 94%, transparent);
    font-family: var(--font-mono);
    border-left: 3px solid var(--accent-border-soft);
}

.code-header {
    background: var(--bg-lighter);
    color: var(--bg-dark);
    font-size: 0.85rem;
    padding: 6px 14px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.15);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.code-block code {
    display: block;
    padding: 10px 14px;
    color: var(--text-dark);
    font-size: 0.9rem;
    line-height: 1.5;
}


/* =========================================================
   FIGURES
   ========================================================= */

figure {
    margin: 20px 0;
    padding: 10px 14px;
    background: color-mix(in srgb, var(--white) 4%, transparent);
    border-left: 3px solid var(--accent-border-soft);
    border-radius: 4px;
    overflow: hidden
}

figure img {
    max-width: 100%;
    height: auto;
    display: block;
}


figcaption {
    margin-top: 8px;
    font-size: 0.85em;
    color: var(--text-muted);
    text-align: center;
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 600px) {
    .article-list-item {
        flex-direction: column;
        gap: 6px;
    }

    .article-list-date {
        min-width: auto;
        text-align: left;
        opacity: 0.8;
    }
}


/* =========================================================
   ANIMATION
   ========================================================= */

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

/* =========================================================
   ARTICLE SIGNATURE
   ========================================================= */

.article-signature {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid color-mix(in srgb, var(--white) 10%, transparent);

    color: var(--text-muted);
    font-size: 0.9em;
    font-style: italic;
    text-align: right;
}

.accent-letter {
    color: var(--accent-strong);
}

/* =========================================================
   LISTS
   ========================================================= */
ul {
    list-style: none; /* This removes the default browser bullet */
}
ul li {
    position: relative;
    padding-left: 1.5em;
}

ul li::before {
    content: "■";
    color: var(--accent);
    display: inline-block;
    width: 1em;
    margin-left: -1em;
    font-size: 0.7em;
    vertical-align: middle; /* align with the middle of text */
}

/* =========================================================
   TABLES
   ========================================================= */
/* =========================================================
   TABLES
   ========================================================= */

.table {
    width: 100%;
    margin: 25px 0;
    border-collapse: separate;
    border-spacing: 0;
    font-family: var(--font-body);
    font-size: 0.95em;
    background-color: color-mix(in srgb, var(--white) 3%, transparent);
    border-radius: 4px;
    overflow: hidden;
    animation: fadeIn 0.4s ease-out;
}

.table-bordered {
    border: 1px solid color-mix(in srgb, var(--white) 15%, transparent);
}

.table-bordered th,
.table-bordered td {
    border: 1px solid color-mix(in srgb, var(--white) 12%, transparent);
}

.table-condensed th,
.table-condensed td {
    padding: 8px 12px;
}

.table th {
    background-color: color-mix(in srgb, var(--white) 8%, transparent);
    color: var(--text-strong);
    font-weight: normal;
    text-align: left;
    padding: 12px 15px;
    border-bottom: 2px solid var(--accent-30);
    position: relative;
    transition: all 0.2s ease;
}

.table th:hover {
    background-color: color-mix(in srgb, var(--white) 12%, transparent);
}

.table th::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 0;
    height: 2px;
    background: linear-gradient(
        to right,
        var(--accent-strong),
        var(--accent-30)
    );
    transition: width 0.3s ease;
}

.table th:hover::after {
    width: 100%;
}

.table td {
    padding: 10px 15px;
    color: var(--text-secondary);
    border-bottom: 1px solid color-mix(in srgb, var(--white) 8%, transparent);
    transition: all 0.2s ease;
}

.table tbody tr {
    transition: all 0.2s ease;
}

.table-hover tbody tr:hover {
    background-color: var(--accent-10);
    transform: translateX(3px);
}

.table-hover tbody tr:hover td {
    color: var(--text-strong);
}

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

.table td[align="right"] {
    text-align: right;
    font-family: var(--font-mono);
    letter-spacing: -0.5px;
}

.table td[align="center"] {
    text-align: center;
}

.table thead tr {
    background-color: color-mix(in srgb, var(--accent) 5%, transparent);
}

/* Zebra striping for better readability */
.table tbody tr:nth-child(even) {
    background-color: color-mix(in srgb, var(--white) 2%, transparent);
}

.table-hover tbody tr:nth-child(even):hover {
    background-color: var(--accent-10);
}

/* Mobile responsiveness for tables */
@media (max-width: 600px) {
    .table {
        font-size: 0.85em;
    }
    
    .table-condensed th,
    .table-condensed td {
        padding: 6px 8px;
    }
    
    .table th,
    .table td {
        padding: 8px 10px;
    }
}

/* =========================================================
   RADAR CHART (Plotly version)
   ========================================================= */

.radar-container {
    margin: 30px 0;
    padding: 25px;
    background: color-mix(in srgb, var(--white) 4%, transparent);
    border-radius: 6px;
    border-left: 3px solid var(--accent-border-soft);
    display: none;
    animation: fadeIn 0.5s ease-out;
}

.radar-container.active {
    display: block;
}

.radar-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    gap: 20px;
}

.radar-title {
    flex: 1;
}

.radar-title #blendName {
    font-size: 1.2em;
    color: var(--accent-strong);
    font-weight: bold;
    display: block;
    margin-bottom: 10px;
}

.radar-legend {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85em;
    color: var(--text-secondary);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.close-radar {
    background: none;
    border: 1px solid var(--accent-border-soft);
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.close-radar:hover {
    color: var(--accent-strong);
    border-color: var(--accent-strong);
    background: var(--accent-10);
    transform: rotate(90deg);
}

.radar-chart {
    width: 100%;
    height: 400px;
    min-height: 400px;
}

/* =========================================================
   EQUATIONS
   ========================================================= */

.equation {
    margin: 24px auto;
    padding: 14px 18px;
    max-width: 100%;

    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 4px;

    overflow-x: auto;
}


/* SVG / Math inside equation */
.equation svg,
.equation img {
    max-width: 100%;
    height: auto;
}

/* Typographic math (if text-based) */
.equation {
    font-family: var(--font-mono);
    font-size: 0.95em;
    color: var(--text-secondary);
    line-height: 1.4;
}
