/* import fonts from Google Fonts */
@import url("https://fonts.googleapis.com/css2?family=Nunito:wght@400;600&family=Sen:wght@400;600&family=Fira+Code:wght@400;500&display=swap");

:root {
    /* Colors (from Spearmint theme) */
    --color-background: #171717;
    --color-text: #e0e0e0;
    --color-text-secondary: #c0c0c0;
    --color-accent: #8fdfd4;
    --color-accent-light: #a3e5dc;
    --color-accent-medium: #8dd4cc;
    --color-accent-dark: #7db8b0;

    --color-link: var(--color-accent-light);
    --color-link-underline: color-mix(in srgb, var(--color-accent) 30%, transparent);
    --color-link-underline-hover: var(--color-accent);

    --color-border: rgba(255, 255, 255, 0.15);
    --color-border-light: rgba(255, 255, 255, 0.1);
    --color-table-header-bg: rgba(20, 20, 20, 0.8);

    --color-table-bg: #1f1f1f;
    --color-table-bg-zebra: #1c1c1c;
    --color-table-row-hover: rgba(49,49,49,.5);

    --color-snippet-bg: #1f1f1f;
    --color-button-text: #111;
    --color-focus-outline: var(--color-accent);

    /* Fonts (from Spearmint theme) */
    --font-primary: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI",
        Roboto, Helvetica, Arial, sans-serif;
    --font-secondary: "Sen", sans-serif;
    --font-monospace: "Fira Code", "Fira Mono", monospace;

    /* Borders & Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --shadow-color-dark: rgba(0, 0, 0, 0.2);
    --shadow-color-accent: rgba(143, 223, 212, 0.3);
    --shadow-article: 0 8px 32px var(--shadow-color-dark);
}

/* Base & Typography */
body {
    background-color: var(--color-background);
    font-family: var(--font-primary);
    color: var(--color-text);
    line-height: 1.5;
    font-weight: 400;
    letter-spacing: 0.02rem;
    overflow-x: hidden;
    background-image: radial-gradient(
            circle at 10% 10%,
            rgba(143, 223, 212, 0.1),
            transparent 35%
        ),
        radial-gradient(
            circle at 90% 80%,
            rgba(143, 223, 212, 0.08),
            transparent 40%
        );
}

* {
    overflow-wrap: break-word;
    word-break: break-word;
}


::selection {
    background-color: var(--color-accent);
    color: var(--color-button-text);
}

p {
    margin: 0 0 1.25rem 0;
}

a {
    color: var(--color-link);
    text-decoration: underline;
    text-decoration-color: var(--color-link-underline);
    transition: text-decoration-color 0.2s ease;

    &:hover {
        text-decoration-color: var(--color-link-underline-hover);
    }
}

mark {
    background-color: var(--color-accent);
    color: var(--color-background);
    padding: 0.1em 0.3em;
    border-radius: var(--radius-sm);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-secondary);
    font-weight: 600;
    margin: 2.5rem 0 1rem 0;
    color: var(--color-accent);
}

h1 {
    font-size: 2.5rem;
    letter-spacing: 0.2rem;
    line-height: 1.2;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.6rem;
}
h4 {
    font-size: 1.4rem;
}
h5 {
    font-size: 1.2rem;
}
h6 {
    font-size: 1rem;
}

hr {
    margin: 2rem 0;
    border: 0;
    border-top: 1px solid var(--color-border);
}

/* Block Elements */
blockquote {
    position: relative;
    font-style: italic;
    margin: 1.5rem 0 1.5rem 1.5rem;
    padding: 0.5rem 1rem;
    color: var(--color-text-secondary);
}

blockquote::before {
    content: "";
    position: absolute;
    top: 0;
    left: -1.5rem;
    bottom: 0;
    height: 100%;
    width: 0.25rem;
    background-color: var(--color-accent-dark);
    border-radius: var(--radius-sm);
}

cite {
    display: block;
    padding-left: 2rem;
    position: relative;
    font-style: normal;
    color: var(--color-text-secondary);
}

cite::before {
    content: "—";
    position: absolute;
    left: 0.5rem;
}

pre {
    font-family: var(--font-monospace);
    background-color: var(--color-snippet-bg);
    padding: 1.25rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow-x: auto;
    line-height: 1.4;
    box-shadow: var(--shadow-article);
    margin: 1.5rem 0;

    & code {
        background-color: transparent;
        border: none;
        border-radius: 0;
        padding: 0;
    }
}

code {
    font-family: var(--font-monospace);
    background-color: var(--color-snippet-bg);
    padding: 0.2em 0.4em;
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    font-size: 0.95em;
}

kbd {
    background: var(--color-snippet-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 0.1em 0.3em;
    font-family: var(--font-monospace);
    font-size: 0.9em;
    box-shadow: inset 0 -1px 0 rgba(255,255,255,0.1);
}


/* Tables */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 2rem 0;
    border-radius: var(--radius-lg);
    background: var(--color-table-bg-zebra);
    box-shadow: var(--shadow-article);
    border: 1px solid var(--color-border);
    overflow: hidden;
}

th {
    font-family: var(--font-secondary);
    font-weight: 600;
    text-align: left;
    padding: 1rem;
    color: var(--color-accent);
    text-transform: uppercase;
    font-size: 0.9rem;
    background: var(--color-table-header-bg);
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--color-border-light);
    transition: background-color 0.2s ease;
}

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

tbody tr:nth-child(even) td {
    background-color: var(--color-table-bg);
}

tbody tr:hover td {
    background-color: var(--color-table-row-hover);
}

/* Figures and Media */
figure {
    display: flex;
    flex-direction: column;
    margin: 1.5rem 0;
    background-color: var(--color-snippet-bg);
    border: 1px solid var(--color-border);
    padding: 1rem;
    border-radius: var(--radius-lg);
}

figure > :not(figcaption) {
    margin: 0.5rem;
    border-radius: var(--radius-md);
}

figure > figcaption {
    order: -1; /* Place caption on top */
    margin: -1rem;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-style: italic;
    background-color: var(--color-accent-dark);
    color: var(--color-background);
}

iframe {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    width: 100%;
}

/* Forms */
fieldset {
    padding: 1.5rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
}

legend {
    padding: 0 0.5rem;
    font-family: var(--font-secondary);
    font-weight: 600;
    color: var(--color-accent);
}

label {
    display: inline-block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

input[type="text"],
input[type="password"],
input[type="url"],
input[type="email"],
input[type="tel"],
input[type="search"],
input[type="number"],
input[type="color"],
input[type="date"],
input[type="month"],
input[type="week"],
input[type="datetime"],
input[type="datetime-local"],
textarea,
select {
    box-sizing: border-box;
    font-size: 1em;
    border: 1px solid var(--color-border);
    outline: none;
    appearance: none;
    border-radius: var(--radius-md);
    background-color: var(--color-snippet-bg);
    color: var(--color-text);
    font-family: var(--font-primary);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

textarea,
select,
input[type="text"],
input[type="password"],
input[type="url"],
input[type="email"],
input[type="tel"],
input[type="search"],
input[type="number"] {
    width: 100%;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--color-focus-outline);
    box-shadow: 0 0 0 2px var(--color-accent-dark);
}

select {
    background-image: url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IiB2aWV3Qm94PSIwIDAgNC45IDEwIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA0LjkgMTA7IiB4bWw6c3BhY2U9InByZXNlcnZlIj48c3R5bGUgdHlwZT0idGV4dC9jc3MiPi5zdDB7ZmlsbDojYzBjMGMwO308L3N0eWxlPjx0aXRsZT5hcnJvd3M8L3RpdGxlPjxwb2x5Z29uIGNsYXNzPSJzdDAiIHBvaW50cz0iMS40LDQuNyAyLjUsMy4yIDMuNSw0LjciLz48cG9seWdvbiBjbGFzcz0ic3QwIiBwb2ludHM9IjMuNSw1LjMgMi41LDYuOCAxLjQsNS4zIi8+PC9zdmc+");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

button,
input[type="submit"],
input[type="button"],
input[type="reset"] {
    padding: 0.75rem 1.5rem;
    font-size: 1em;
    border: none;
    outline: none;
    appearance: none;
    border-radius: var(--radius-md);
    background-color: var(--color-accent);
    color: var(--color-button-text);
    font-family: var(--font-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease-out;
    position: relative;
    z-index: 1;
}

button:hover:not(:disabled),
input[type="submit"]:hover:not(:disabled),
input[type="button"]:hover:not(:disabled),
input[type="reset"]:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-color-accent);
    background-color: var(--color-accent-medium);
}

button:active:not(:disabled),
input[type="submit"]:active:not(:disabled),
input[type="button"]:active:not(:disabled),
input[type="reset"]:active:not(:disabled) {
    transform: translateY(0);
    background-color: var(--color-accent-dark);
    box-shadow: none;
}

button:disabled,
input:disabled {
    background-color: var(--color-snippet-bg);
    color: var(--color-text-secondary);
    opacity: 0.6;
    cursor: not-allowed;
}

::-webkit-input-placeholder {
    color: var(--color-text-secondary);
    opacity: 0.7;
}
::-moz-placeholder {
    color: var(--color-text-secondary);
    opacity: 0.7;
}
::-ms-input-placeholder {
    color: var(--color-text-secondary);
    opacity: 0.7;
}
::placeholder {
    color: var(--color-text-secondary);
    opacity: 0.7;
}
