/*
lumin-min-css
basic css styling for a web project to minimize design pain and get to just JS pain

(C) Luminoso '23 
DICLAIMER: Any mental injury caused by the code below is your own liability!

Random improvements and changes:
- Automatic dark mode
- Button
- Made responsive
- Card
- Et cetera
(C) Nobody6502 '24
*/

@import url('https://fonts.googleapis.com/css2?family=Inconsolata:wght@200..900&display=swap');

*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    /* The colors (Dark Default) */
    --primary: #c9c9c9;
    --secondary: #a5a5a5;
    --tertiary: #474444;
    --quaternary: #2e2e2e;
    --cinquinary: #1a1a1a;
    --green: #43b581;
    --blue: #549ac5;
    --red: #ff0101;
    --orange: #885d1c;
    --background-regular: #111;
    --background-oled: black;
    --text: rgb(201, 201, 201);

    /* Choose your fighter */
    --accent: var(--green);
    --background: var(--background-regular);
    --enable-background: 1;
    --frost-surface-bg: color-mix(in srgb, var(--cinquinary) 45%, transparent);
    --dot-grid-color: color-mix(in srgb, var(--primary) 28%, transparent);
    --dot-grid-spacing: 20px;
    --dot-grid-size: 1px;
}

[data-theme="light"] {
    --primary: #1a1a1a;
    --secondary: #2e2e2e;
    --tertiary: #474444;
    --quaternary: #a5a5a5;
    --cinquinary: #c9c9c9;
    --green: #15703e;
    --blue: #378bc0;
    --red: #ff0101;
    --orange: #885d1c;
    --background: #eee;
    --text: rgb(26, 26, 26);

    /* Choose your fighter */
    --accent: var(--green);
    --frost-surface-bg: rgba(255, 255, 255, 0.55);
    --dot-grid-color: color-mix(in srgb, var(--primary) 20%, transparent);
}

/* Global transition for smooth theme switching, suppressed on initial load */
html:not(.no-transition) *,
html:not(.no-transition) *::before,
html:not(.no-transition) *::after {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, filter 0.3s ease, opacity 0.3s ease;
}

html {
    overflow-x: hidden;
}

[data-theme="light"] body::before {
    opacity: calc(var(--enable-background) * 0.55);
}


body {
    margin: 2rem auto;
    padding: 0 2rem;
    font-family: "Inconsolata", monospace;
    background-color: var(--background);
    color: var(--primary);
    padding-bottom: 4rem;
    overflow-x: hidden;
    overflow-wrap: break-word;
    isolation: isolate;
}

header,
main,
.spacer {
    position: relative;
    z-index: 1;
}

header {
    z-index: 10000;
}

body::before {
    background-image: radial-gradient(
        circle,
        var(--dot-grid-color) var(--dot-grid-size),
        transparent calc(var(--dot-grid-size) + 0.5px)
    );
    background-repeat: repeat;
    background-size: var(--dot-grid-spacing) var(--dot-grid-spacing);
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: calc(var(--enable-background) * 0.6);
    pointer-events: none;
}

@view-transition {
    navigation: auto;
}

html.instant-nav-view-transition::view-transition-old(root) {
    animation: page-fade-out 160ms ease-out both;
}

html.instant-nav-view-transition::view-transition-new(root) {
    animation: page-fade-in 220ms ease-out both;
}

@keyframes page-fade-out {
    to {
        opacity: 0;
    }
}

@keyframes page-fade-in {
    from {
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    html.instant-nav-view-transition::view-transition-old(root),
    html.instant-nav-view-transition::view-transition-new(root) {
        animation: none;
    }

}

footer,
.footer {
    padding: 0 1rem;
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    color: var(--secondary);
    background-color: var(--cinquinary);
    border-top: 0.1rem solid var(--quaternary);
    z-index: 999;
}

.footer p {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin: 0.6rem 0;
    flex-wrap: wrap;
    text-align: center;
}

.footer img {
    height: 1.4rem;
    width: auto;
    display: block;
}

header {
    color: var(--secondary);
    margin-top: 2rem;
}

a {
    color: var(--accent);
    text-decoration: none;
}

span {
    color: var(--secondary);
}

h4 {
    margin: 0.2rem;
    margin-top: 2rem;
}

h6 {
    margin: 0.2rem;
    margin-top: 2rem;
}

h2 {
    font-size: 2rem;
}

table {
    font-family: arial, sans-serif;
    border-collapse: collapse;
    color: var(--primary);
}

td,
th {
    border: 0.1rem solid var(--quaternary);
    text-align: left;
    padding: 0.5rem;
}

tr:nth-child(even) {
    background-color: var(--cinquinary);
    color: var(--text);
}

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

blockquote {
    background: var(--cinquinary);
    border-left: 0.6rem solid var(--quaternary);
    color: var(--text);
    margin: 1.5em 0;
    padding: 0.5em 2rem;
    quotes: none;
    border-radius: 0 0.4rem 0.4rem 0;
}

blockquote p {
    display: inline;
}

blockquote h4 {
    margin-top: auto;
    padding: 0.4rem;
}

.text-accent {
    color: var(--accent);
}

.text-red {
    color: var(--red);
}

.text-green {
    color: var(--green);
}

.text-blue {
    color: var(--blue);
}

code {
    background-color: var(--cinquinary);
    border-radius: 0.4rem;
    padding: 0.2rem 0.4rem;
    white-space: normal;
}

pre,
table {
    max-width: 100%;
    overflow-x: auto;
}

button:not(.button):not(.toggle-btn):not(.theme-btn) {
    border-radius: 0.4rem;
    background-color: var(--background);
    border: 0.15rem solid var(--quaternary);
    padding: 1rem 1.5rem;
    color: var(--primary);
    transition: all 0.2s ease;
}

button:not(.button):not(.toggle-btn):not(.theme-btn):hover {
    border-color: var(--accent);
    background-color: color-mix(in srgb, var(--accent) 18%, transparent);
}

button:not(.button):not(.toggle-btn):not(.theme-btn):active {
    box-shadow: 0px 0px 0px var(--quaternary);
}

a:hover {
    font-weight: 900;
}

.card {
    border-radius: 0.2rem;
    padding: 1.5rem;
    transition: all 0.5s ease;
    width: 20rem;
    height: 30rem;

    border: 0.15rem solid var(--quaternary);
}

.cardgrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr));
    gap: 2rem;
    justify-content: center;
}

.hero-subtitle {
    margin: 0.85rem auto 0;
    max-width: 48rem;
    text-align: center;
    color: var(--secondary);
    font-size: 1.08rem;
    line-height: 1.5;
}

.section-intro {
    margin: 0.3rem 0 1rem;
    color: var(--secondary);
    max-width: 62ch;
}



/* Theme Toggle Button */
.theme-btn {
    position: fixed;
    top: 1rem;
    right: 1.5rem;
    z-index: 9999;
    background: color-mix(in srgb, var(--cinquinary) 20%, transparent);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    border: 0.15rem solid color-mix(in srgb, currentColor 40%, transparent);
    color: var(--secondary);
    padding: 0.5rem;
    border-radius: 0.38rem;
    cursor: pointer;
    font-family: "Inconsolata", monospace;
    font-size: 1.1rem;
    width: 2.75rem;
    height: 2.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    line-height: 1;
}

.theme-btn:hover {
    color: var(--primary);
    border-color: var(--accent);
    background-color: color-mix(in srgb, var(--accent) 15%, transparent);
    box-shadow: 0 0 0.5rem color-mix(in srgb, var(--accent) 25%, transparent);
}




.card img {
    max-width: 100%;
    height: auto;
    max-height: 320px;
    margin: 0 auto;
    display: block;

    border-radius: 0.8rem;
}

img,
iframe,
canvas {
    max-width: 100%;
}

iframe,
video {
    max-width: 100%;
}





.card,
.surface-frosted {
    background-color: var(--frost-surface-bg);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}


.form-card form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="password"],
textarea {
    padding: 1rem;
    margin: 0;
    border-radius: 0.38rem;
    border: 0.15rem solid var(--quaternary);
    background-color: color-mix(in srgb, var(--cinquinary) 78%, transparent);
    color: var(--primary);
    font-size: 1rem;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.2s ease, background-color 0.2s ease;
    width: 100%;
}

input[type="text"]:hover,
input[type="email"]:hover,
input[type="tel"]:hover,
input[type="number"]:hover,
input[type="password"]:hover,
textarea:hover {
    border-color: color-mix(in srgb, var(--accent) 55%, var(--quaternary));
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
textarea:focus {
    border-color: var(--accent);
    background-color: color-mix(in srgb, var(--cinquinary) 88%, transparent);
    outline: none;
}

textarea {
    resize: vertical;
    min-height: 8rem;
}

.profile-card .text {
    flex: 2;
    padding: 1rem 2rem;
}

.hero {
    margin: 0;
    padding-top: 0;
    margin-bottom: 2rem;
}

.core {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.coresub {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    text-align: left;
}

.core>.title {
    font-size: clamp(3rem, 5vw, 4rem);
    white-space: nowrap;
}

.articlebox {
    margin-top: 2%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    text-align: left;
}

/* Center items inside, max width of 600px */
.container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    max-width: 60%;
    margin: 0 auto;
    margin-bottom: 2rem;
}

.spacer {
    margin: 3rem 0;
}

@media screen and (max-width: 600px) {
    body {
        margin: 1rem auto;
        padding: 0 1rem;
        padding-bottom: 6rem;
    }

    footer,
    .footer {
        padding: 0 0.75rem;
        font-size: 0.9rem;
    }

    .hero h1 {
        word-break: break-word;
        text-align: center;
    }

    .coresub {
        flex-direction: column;
    }

    .core h1 {
        font-size: 3rem;
    }
}

@media screen and (max-width: 420px) {
    body {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
        padding-bottom: 4rem;
    }

    footer,
    .footer {
        position: fixed;
        left: 0;
        bottom: 0;
        width: 100%;
        padding: 0 0.5rem;
        font-size: 0.75rem;
    }

    .footer p {
        flex-direction: row;
        gap: 0.2rem;
        font-size: 0.8rem;
        margin: 0.4rem 0;
    }

    .footer img {
        height: 1rem;
        width: auto;
    }
}
