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

/* Root Variables */
:root {
    --font-body: "Inter", system-ui, sans-serif;
    --font-heading: "Poppins", system-ui, sans-serif;
    --color-accent: oklch(65% 50% 0);
    --max-width: 65ch;
}

/* Add font-display: swap to custom fonts */
@font-face {
    font-family: "Inter";
    src: url("path-to-inter-font.woff2") format("woff2");
    font-display: swap;
}

@font-face {
    font-family: "Poppins";
    src: url("path-to-poppins-font.woff2") format("woff2");
    font-display: swap;
}

[data-theme="light"] {
    --color-bg: oklch(98% 0% 0);
    --color-text: oklch(25% 2% 0);
    --color-muted: oklch(70% 4% 0);
    --color-nav-hover: oklch(10% 2% 0);
    --color-article-bg: oklch(95% 2% 0); /* Light theme article background */
}

[data-theme="dark"] {
    --color-bg: oklch(10% 2% 0);
    --color-text: oklch(90% 0% 0);
    --color-muted: oklch(40% 4% 0);
    --color-nav-hover: oklch(98% 0% 0);
    --color-article-bg: oklch(20% 2% 0); /* Dark theme article background */
}

/* Global Styles */
html {
    color-scheme: light dark;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    margin: 0;
    padding: 2rem 1rem 6rem;
    max-width: var(--max-width);
    animation: fadeIn 0.6s ease-in-out forwards;
}

/* Headings */
h1, h2, h3 {
    font-family: var(--font-heading);
    font-weight: 600;
    margin-bottom: 0.5em;
    line-height: 1.3;
}

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.5rem;
}

h1, h2 {
    position: relative;
}

h1::after, h2::after {
    content: "";
    position: absolute;
    bottom: -0.2em;
    left: 0;
    width: 3em;
    height: 0.15em;
    background-color: var(--color-accent);
    border-radius: 0.2em;
}

/* Navigation Bar */
nav {
    display: flex;
    justify-content: center;
    gap: 1em;
    padding: 1em 0;
    background-color: var(--color-bg);
    border-bottom: 1px solid var(--color-muted);
    margin-bottom: 2.5rem;
    transition: background-color 0.3s ease, color 0.3s ease;
}

nav a {
    text-decoration: none;
    color: var(--color-text);
    font-weight: 500;
    position: relative;
    padding: 0.5em;
    transition: background-color 0.3s ease, color 0.3s ease;
}

nav a:hover {
    background-color: var(--color-nav-hover);
    color: var(--color-bg);
}

nav a.current {
    border-bottom: 0.2em solid var(--color-accent);
    font-weight: bold;
}

/* Main Content */
main {
    display: grid;
    gap: 2rem;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 0.75rem;
    margin: 1rem 0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

img:hover {
    transform: translateY(-4px);
    box-shadow: 0 0.5em 1.2em oklch(85% 4% 200 / 0.3);
}

.button {
    display: inline-block;
    text-decoration: none;
    background-color: var(--color-accent);
    color: #ffffff;
    padding: 0.6em 1.2em;
    border-radius: 0.5em;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.button:hover {
    background-color: oklch(60% 50% 0);
    transform: translateY(-2px);
}

.button.accent:hover {
    background-color: oklch(60% 50% 0);
    box-shadow: 0 0.3em 0.8em oklch(65% 40% 0 / 0.3);
}

article {
    background-color: var(--color-article-bg);
    color: var(--color-text);
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: 0 0.2em 0.8em oklch(90% 3% 0 / 0.25);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

article:hover {
    transform: translateY(-4px);
    box-shadow: 0 0.5em 1.2em oklch(85% 4% 200 / 0.3);
}

/* Form Styles */
form {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1em;
    margin-top: 2rem;
}

form label {
    grid-column: 1;
    margin-block: 0.5em;
    font-weight: bold;
}

form input,
form textarea {
    grid-column: 2;
    width: 100%;
    box-sizing: border-box;
    font: inherit;
    padding: 0.5em;
    border: 1px solid var(--color-muted);
    border-radius: 0.3em;
    background-color: var(--color-bg);
    color: var(--color-text);
}

form button {
    grid-column: 1 / -1;
    margin-top: 1em;
    padding: 0.5em 1em;
    background-color: var(--color-accent);
    color: var(--color-bg);
    border: none;
    border-radius: 0.3em;
    cursor: pointer;
    font: inherit;
    font-weight: bold;
    text-transform: uppercase;
}

form button:hover {
    background-color: oklch(55% 50% 0);
}

/* Footer */
footer {
    margin-top: 4rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--color-muted);
}

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

/* Add-on */
article, img, .button {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.button:hover, article:hover, img:hover {
    transform: translateY(-4px);
    box-shadow: 0 0.5em 1.2em oklch(85% 4% 200 / 0.3);
}

.color-scheme {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 80%;
    font-family: inherit;
}

.color-scheme select {
    font: inherit;
}