@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;700&display=swap");

:root {
    color-scheme: dark;
    --bg-start: rgb(13, 13, 13);
    --bg-end: rgb(64, 64, 67);
    --text: white;
    --heading: rgb(119, 211, 247);
    --underline: orange;
    --link-visited: rgb(10, 176, 241);
    --scroll-thumb: grey;
    --scroll-thumb-hover: lightslategray;
    --scroll-track: rgb(82, 81, 81);
    --divider: #f0f0f0;
    --section-line: rgba(119, 211, 247, 0.2);
}

:root[data-theme="light"] {
    color-scheme: light;
    --bg-start: #f5f7fa;
    --bg-end: #dfe6ee;
    --text: #1a1a1a;
    --heading: #0a6a9a;
    --underline: #e07b00;
    --link-visited: #0a6a9a;
    --scroll-thumb: #8a949e;
    --scroll-thumb-hover: #5f6b76;
    --scroll-track: #d5d9de;
    --divider: #d0d7de;
    --section-line: rgba(10, 106, 154, 0.3);
}

* {
    box-sizing: border-box;
}

body {
    background-image: linear-gradient(to right, var(--bg-start), var(--bg-end));
    background-attachment: fixed;
    font-weight: bold;
    font-family: "Poppins", sans-serif;
    font-size: 20px;
    color: var(--text);
}

::-webkit-scrollbar { width: 15px; height: 10px; }
::-webkit-scrollbar-thumb { background-color: var(--scroll-thumb); border-radius: 10px; }
::-webkit-scrollbar-track { background-color: var(--scroll-track); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background-color: var(--scroll-thumb-hover); }

h1, h2, h3 {
    color: var(--heading);
    display: flex;
    justify-content: center;
    text-decoration: underline 2.5px solid var(--underline);
    padding-bottom: 1px;
}

h4 {
    color: var(--heading);
    font-size: 26px;
    display: flex;
    justify-content: center;
    text-decoration: underline 2.5px solid var(--underline);
}

.body h4 {
    color: var(--heading);
    font-size: 32px;
    display: flex;
    justify-content: left;
    text-decoration: underline 2.5px solid var(--underline);
    padding-bottom: 2px;
}

p { font-size: 20px; }

a:visited { color: var(--link-visited); }

.page-wrap {
    padding: 0 1.5rem;
    max-width: 960px;
    margin: 0 auto;
}

/* Theme toggle: floats bottom-right so it doesn't depend on the nav layout */
.theme-switch {
    position: relative;
    flex-shrink: 0;
    align-self: flex-end;
    width: 64px;
    height: 32px;
    padding: 0;
    border-radius: 999px;
    border: 2px solid var(--underline);
    cursor: pointer;
    transition: background 0.25s;
}

/* sun and moon at either end of the track */
.theme-switch::before,
.theme-switch::after {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 13px;
    line-height: 1;
    pointer-events: none;
}

.theme-switch::before {
    content: "☀️";
    left: 7px;
}

.theme-switch::after {
    content: "🌙";
    right: 7px;
}

.theme-switch__knob {
    position: absolute;
    z-index: 1; /* keeps the knob above the icons */
    top: 2px;
    left: 2px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--heading);
    transition: transform 0.25s ease;
}

.theme-switch[aria-checked="true"] .theme-switch__knob {
    transform: translateX(32px);
}

.theme-switch:focus-visible {
    outline: 3px solid var(--heading);
    outline-offset: 3px;
}