:root {
    --bg-primary: #ffffff;
    --text-primary: #000000;
    --middle-o: rgb(127, 127, 127);
    --middle: rgba(127, 127, 127, .5);
    --toggle-color: #1a1a1a;

    --scrollbar-bg: rgba(0,0,0,0.04);
    --scrollbar-thumb: rgba(0,0,0,0.18);
    --scrollbar-thumb-hover: rgba(0,0,0,0.28);
    --scrollbar-size: 10px;
    --scrollbar-radius: 999px;

    font-family: "Merriweather", Helvetica, monospace;
    font-size: 110%;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #1a1a1a;
        --text-primary: #f4f3f2;
        --middle-o: rgb(127, 127, 127);
        --middle: rgba(127, 127, 127, .5);
        --toggle-color: #f4f3f2;
        --scrollbar-bg: rgba(255,255,255,0.03);
        --scrollbar-thumb: rgba(255,255,255,0.12);
        --scrollbar-thumb-hover: rgba(255,255,255,0.20);
    }
}

:root[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --text-primary: #f4f3f2;
    --middle-o: rgb(127, 127, 127);
    --middle: rgba(127, 127, 127, .5);
    --toggle-color: #f4f3f2;
    --scrollbar-bg: rgba(255,255,255,0.03);
    --scrollbar-thumb: rgba(255,255,255,0.12);
    --scrollbar-thumb-hover: rgba(255,255,255,0.20);
}

:root[data-theme="light"] {
    --bg-primary: #ffffff;
    --text-primary: #000000;
    --middle-o: rgb(127, 127, 127);
    --middle: rgba(127, 127, 127, .5);
    --toggle-color: #1a1a1a;
    --scrollbar-bg: rgba(0,0,0,0.04);
    --scrollbar-thumb: rgba(0,0,0,0.18);
    --scrollbar-thumb-hover: rgba(0,0,0,0.28);
}

::selection {
    background: var(--text-primary);
    color: var(--bg-primary);
}

body {
    width: 70%;
    margin: 0 auto;
    padding: 4% 2%;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    position: relative;

}

html {
  max-width: 1800px;
  margin: 0 auto;
}

a {
    position: relative;
    text-decoration: none;
    font-style: italic;
    color: var(--text-primary);
}

a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--text-primary);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.3s ease;
}

a:hover {
    color: #33bbff;
}

a:hover::after {
    transform: scaleX(1);
}
a.no-decor {
    text-decoration: none;
    font-style: inherit;
    color: inherit;
    transition: none;
    color: inherit;
    border-bottom: 0;
}

a.no-decor::after {
    display: none;
}

hr:first-of-type {
    opacity: .1;
}

#theme-toggle {
    position: absolute;
    top: 2rem;
    right: 2rem;
    cursor: pointer;
    font-family: inherit;
    z-index: 1000;
    background: color-mix(in srgb, var(--bg-primary) 80%, transparent);
    border-radius: 6px;
}
#theme-toggle:hover {
    text-decoration: underline;
    text-decoration-style: wavy;
    text-decoration-color: indianred;
    color: #33bbff;
}

#back-btn {
    position: absolute;
    top: calc(2rem + 1.6rem);
    right: 2rem;
    cursor: pointer;
    font-family: inherit;
    z-index: 1000;
    background: color-mix(in srgb, var(--bg-primary) 80%, transparent);
    border-radius: 6px;
}
#back-btn:hover {
    text-decoration: underline;
    text-decoration-style: wavy;
    text-decoration-color: indianred;
    color: #33bbff;
}
#back-btn:focus {
    outline: 1px solid Highlight;
    outline-offset: 0px;
}

.current-page {
    border-bottom: 3px solid var(--text-primary);
    transition: border-color 0.5s ease;
}

* {
    scrollbar-width: auto;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-bg);
}

@-moz-document url-prefix() {
    * { scrollbar-width: auto; }
}
::-webkit-scrollbar {
    width: var(--scrollbar-size);
    height: var(--scrollbar-size);
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background-color: var(--scrollbar-thumb);
    border-radius: var(--scrollbar-radius);
    border: 2px solid transparent;
    background-clip: padding-box;
    transition: background-color 120ms;
}
::-webkit-scrollbar-thumb:hover {
    background-color: var(--scrollbar-thumb-hover);
}
::-webkit-scrollbar-corner {
    background: transparent;
}

/* ----MOBILE VIEW---- */
@media only screen and (max-width: 767px) {
    body {
        width: 90%;
    }

    #theme-toggle,
    #back-btn {
      /* font-size: .7rem; */
      right: 0;
    }
}
