@font-face {
    font-family: 'Norse Bold';
    src: url(./fonts/Norse-Bold.otf);
}

@font-face {
    font-family: "Inter";
    src: url(./fonts/Inter-VariableFont_opsz\,wght.ttf);
}

:root {
    --primary-color: #0f756d;
    --primary-color-light: #32a39a; 
    --accent-color: #e99e25;
    --error-color: #ff726a;
}

:root.light {
    --text-color: #404040;
    --accent-color: #e99e25;
    --error-color: #ff726a;
    --background-color: #F9FAFB;
    --background-image: url("./img/odin-light.png");
    --button-image: url("./img/moon-svgrepo-com.png");

    --input-background-color: #F9FAFB;
    --input-border-color: lightgray;

    --logo-filter: brightness(0) drop-shadow(0 0 5px rgba(233, 158, 37, 1));
    --light-attribution: visible;
    --dark-attribution: none;
}

:root.dark {
    --text-color: #F9FAFB;
    --accent-color: #e99e25;
    --error-color: #ff726a;
    --background-color: #111827;
    --background-image: url("./img/odin-dark.png");
    --button-image: url("./img/sun-2-svgrepo-com.png");

    --input-background-color: #1D2432;
    --input-border-color: gray;
    
    --logo-filter: drop-shadow(0 0 5px rgba(233, 158, 37, 1));
    --github-icon-filter: contrast(0%);

    --light-attribution: none;
    --dark-attribution: visible;
}


* {
    font-family: "Inter", Helvetica, sans-serif;
}

body {
    position: relative;
    background-color: var(--background-color);
    display: flex;
    height: 100vh;
    padding: 0.5rem;
}

#theme-button {
    width: 50px;
    aspect-ratio: 1;
    border: none;
    background: none;
    background-image: var(--button-image);
    background-size: cover;
    position: absolute;
    width: 2rem;
    top: 1.5rem;
    right: 1.5rem;
    cursor: pointer;
    z-index: 2;
}

@media only screen and (max-width: 800px) {
    body {
        flex-direction: column;
        padding: 0;
        height: auto;
    }
}

/* Hero section */

#hero {
    flex: 4;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    background-image: linear-gradient(180deg, rgba(255,255,255,0) 50%, rgba(0,0,0,.7) 85%), var(--background-image);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    height: 100%;
    border-radius: 0 25px 0 25px;
    filter: brightness(95%) contrast(105%) saturate(150%);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

.logo-hero {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    width: 75px;
    filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.5));
}

.headline, .quote {
    color: white;
    width: 100%;
}

.headline {
    text-wrap: balance;
    font-size: 2.8rem;
    font-family: 'Norse Bold';
    padding: 0 max(2rem, 8%);
}

.quote {
    text-wrap: pretty;
    font-size: 1.2rem;
    padding: 0.5em max(2rem, 8%) 2rem max(2rem, 8%);
}

.attribution {
    width: 100%;
    text-align: right;
    font-size: 0.6rem;
    font-style: italic;
    padding: 0 1rem 8px;
    color: lightgray;
}

#light-attribution {
    display: var(--light-attribution);
}

#dark-attribution {
    display: var(--dark-attribution);
}

@media only screen and (max-width: 800px) {
    #hero {
        flex: none;
        height: 85vh;
        border-radius: 0 0 0 25px;
    }

    .logo-hero {
        display: none;
    }

    .headline {
        text-align: center;
        font-size: 2rem;
    }

    .quote {
        font-size: 1rem;
        text-align: center;
    }
}

/* Form section */

#form-section {
    flex: 5;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    padding: 1rem;
    color: var(--text-color);
    overflow: auto;
}

header {
    width: 100%;
}

.logo-and-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#logo-form {
    filter: var(--logo-filter);
    width: 30px;
}

.logo-name {
    font-family: 'Norse Bold';
    color: inherit;
    font-size: 1.5rem;
}

@media only screen and (max-width: 800px) {
    #form-section {
        gap: 4rem;
    }

    header {
        height: calc(15vh - 2rem);
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .logo-name {
        font-size: 2rem;
    }

    #logo-form {
        width: 50px;
    }

    
}

/* main section within form section */

main {
    color: inherit;
    width: min(80%, 500px);
}

#cta-heading {
    font-size: 2rem;
    font-weight: 700;
}

#cta-text {
    font-size: 1rem;
    font-weight: 500;
}

.two-col {
    display: flex;
    gap: 1.5rem;
}

form {
    margin-top: 2rem;
}

form > div {
    margin-top: 0.8rem;
}

.two-col > div {
    flex: 1;
}

.form-input {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

label {
    font-size: 1rem;
}

input {
    font-size: 1rem;
    padding: 10px;
    height: 2.5rem;
    width: 100%;
    appearance: none;
    background-color: var(--input-background-color);
    border: 2px solid var(--input-border-color);
    border-radius: 5px;
    color: var(--text-color);
    transition: border 0.2s ease;
}

input::placeholder {
    font-style: italic;
    font-size: 0.8rem;
}

input:hover, input:focus{
    outline: none;
    border: 2px solid gray;
}

input:user-valid {
    border: 2px solid var(--primary-color-light);
}

input:user-invalid {
    border: 2px solid var(--error-color);
}

.invalid-message {
    margin: -0.4rem 0;
    display: none;
    font-size: 0.8rem;
    font-style: italic;
    color: var(--error-color);
}

button[type="submit"] {
    background-color: var(--primary-color);
    width: 100%;
    margin-top: 2.5rem;
    height: 3rem;
    border: none;
    border-radius: 5px;
    color: white;
    font-weight: 700;
    transition: all 0.5s ease;
}

button[type="submit"]:hover {
    cursor: pointer;
    filter: brightness(110%);
}

.question {
    font-size: 0.8rem;
    margin-top: 0.5rem;
    text-align: center;
    font-style: italic;
}

@media only screen and (max-width: 800px) {
    .two-col {
        flex-direction: column;
        gap: 0.8rem;
    }
}

/* footer section within form section */

footer {
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.credit {
    display: flex;
    align-items: center;
    font-size: 0.8rem;
}

.disclaimer {
    font-size: 0.7rem;
    text-align: center;
}

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

#github-link {
    display: flex;
    align-items: center;
    color: var(--text-color);
}

#github-icon {
    filter: var(--github-icon-filter);
    width: 1rem;
}