/* ── Font Faces ── */

@font-face {
    font-family: 'SF-Mono-Regular';
    src: url('./fonts/SF-Mono-Regular.otf');
}

@font-face {
    font-family: 'SF-Mono-Bold';
    src: url('./fonts/SF-Mono-Bold.otf');
}

@font-face {
    font-family: 'Roboto-Regular';
    src: url('./fonts/Roboto-Regular.ttf');
}

@font-face {
    font-family: 'Roboto-Thin';
    src: url('./fonts/Roboto-Thin.ttf');
}

@font-face {
    font-family: 'Roboto-Light';
    src: url('./fonts/Roboto-Light.ttf');
}

@font-face {
    font-family: 'Roboto-Medium';
    src: url('./fonts/Roboto-Medium.ttf');
}

@font-face {
    font-family: 'Nabula';
    src: url('./fonts/Nabla-Regular.ttf');
}

@font-face {
    font-family: 'BungeeSpice';
    src: url('./fonts/BungeeSpice-Regular.ttf');
}

@font-face {
    font-family: 'Silkscreen';
    src: url('./fonts/Silkscreen-Regular.ttf');
}

@font-face {
    font-family: 'CM';
    src: url('./fonts/CM.ttf');
}

/* ── Theme Variables ── */

:root {
    --color-bg: #ffffff;
    --color-text: #1a1a1a;
    --color-text-secondary: gray;
    --color-text-muted: #4a4a4a;
    --color-link: dimgray;
    --color-heading: rgb(43, 34, 68);
    --color-code-bg: #f0f0f0;
    --color-pre-bg: rgb(238, 245, 255);
    --color-card-bg: #fbfbfb;
    --color-code-text: black;
    --color-code-ref: darkblue;
    --color-code-ref-hover: #1a73e8;
    --color-separator: lightgray;
    --color-link-ucla: rgb(39, 116, 174);
    --color-link-uw: rgb(51, 0, 111);
    --color-hr: #e0e0e0;
}

[data-theme="dark"] {
    --color-bg: #1a1a2e;
    --color-text: #e0e0e0;
    --color-text-secondary: #aaa;
    --color-text-muted: #b0b0b0;
    --color-link: #a0a0b0;
    --color-heading: #c0b8e0;
    --color-code-bg: #2a2a3e;
    --color-pre-bg: #1e2a3a;
    --color-card-bg: #22223a;
    --color-code-text: #e0e0e0;
    --color-code-ref: #7ba4f7;
    --color-code-ref-hover: #5b8fef;
    --color-separator: #444;
    --color-link-ucla: #5ba3d9;
    --color-link-uw: #9070d0;
    --color-hr: #333;
}

/* ── Base Elements ── */

body {
    max-width: 30%;
    background-color: var(--color-bg);
    color: var(--color-text);
    transition: background-color 0.3s ease, color 0.3s ease;
}

a:link,
a:visited {
    color: var(--color-link);
    text-decoration: underline;
}

code {
    background-color: var(--color-code-bg);
    padding: 2px 4px;
    border-radius: 4px;
    font-family: SF-Mono-Regular;
    font-size: smaller;
    overflow-x: auto;
    white-space: pre-wrap;
}

pre {
    background-color: var(--color-pre-bg);
    padding: 2px 4px;
    border-radius: 4px;
    font-family: SF-Mono-Regular;
    font-size: smaller;
    white-space: pre-wrap;
    word-wrap: break-word;
}

b {
    font-family: Roboto-Regular;
}

hr {
    border-color: var(--color-hr);
}

/* ── Layout Components ── */

.intro {
    text-align: left;
    margin: 10px;
    line-height: 1.6;
    padding: 8px;
    font-size: 12pt;
    font-family: Roboto-Light;
}

@media (min-width: 768px) {
    .intro {
        display: flex;
        align-items: center;
        gap: 20px;
    }
}

.portrait {
    max-width: 50%;
    min-width: 40%;
    height: auto;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 768px) {
    .portrait {
        width: 20%;
        max-width: 200px;
        min-width: 120px;
        margin: 0;
        flex-shrink: 0;
    }
}

.contact {
    text-align: center;
    font-size: larger;
}

.contact a {
    text-decoration: none;
}

.title-pre-block {
    text-align: center;
    font-family: Roboto-Regular;
    padding: 6px 4px 12px 4px;
    font-size: larger;
}

/* ── Content Sections ── */

.quoteBoard {
    line-height: 2;
    font-size: 12pt;
}

.tech-tips,
.fun-tools {
    font-family: Roboto-Light;
    font-size: medium;
    line-height: 1.5;
}

@media (min-width: 768px) {
    .fun-tools {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }
}

.tip,
.tool {
    padding: 5px 10px;
    background-color: var(--color-card-bg);
    border-radius: 8px;
    font-family: Roboto-Light, sans-serif;
    line-height: 1.7;
}

.tip-date {
    text-align: right;
    font-size: 0.8em;
    color: gray;
    margin-top: 0.5em;
}

.tool * {
    font-family: inherit;
}

.tool code {
    font-family: SF-Mono-Regular;
    color: var(--color-code-text);
}

.tool a {
    display: inline-block;
    transition: transform 0.2s ease;
}

.tool a:hover {
    transform: scale(1.05);
}

.code-ref-ext {
    background-color: var(--color-code-bg);
    color: var(--color-code-ref);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover .code-ref-ext {
    color: var(--color-code-ref-hover);
}

.signature {
    font-family: Roboto-Light;
    line-height: 1.5;
    font-style: italic;
    font-size: smaller;
}

/* ── Theme Toggle ── */

#theme-toggle {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 1000;
    background: none;
    border: 1px solid var(--color-separator);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    font-size: 16px;
    color: var(--color-text);
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

#theme-toggle:hover {
    opacity: 0.7;
}
