/* css reset */
* {
    margin: 0;
    font-family: inherit;
    font-size: inherit;
    box-sizing: border-box;
    background-color: inherit;
    color: inherit;
    border: none;
}

/* typography */
@font-face {
    font-family: Pacifico;
    src: url(Pacifico/Pacifico-Regular.ttf);
}

@font-face {
    font-family: Zain;
    src: url(Zain/Zain-Light.ttf);
    font-weight: regular;
}

@font-face {
    font-family: Zain;
    src: url(Zain/Zain-Bold.ttf);
    font-weight: bold;
}

html {
    font-family: Zain, sans-serif;
}

h1 {
    font-family: Pacifico, cursive;
    font-size: 2.5rem;
}

h2 {
    font-family: Pacifico, cursive;
    font-size: 1.5rem;
    margin-top: 1.5rem;
}

h3 {
    margin-top: 1.5rem;
}

/* colors */
html {
    --green: oklch(0.2926 0.0715 141.62);
    --red: oklch(0.5081 0.1751 21.1);
    --red-border: oklch(0.3191 0.1081 21.1);
    --white: white;
    background-color: var(--green);
    color: white;
}

/* overall page layout */
body {
    display: grid;
    grid-template-columns: minmax(2ch, 1fr) minmax(auto, 80ch) minmax(2ch, 1fr);
    grid-template-rows: min-content 1fr min-content;
    row-gap: 2rem;

    max-width: 100vw;
    min-height: 100vh;

    padding-block: 2rem;
}

body > *,
form > *,
main > * {
    grid-column: 2;
}

form,
main {
    grid-column: 1 / -1;
    grid-row: 2;

    display: grid;
    grid-template-columns: subgrid;
    align-self: start;
}

footer {
    grid-row: -1;
}

/* piece of paper that animates in */
main {
    view-transition-name: main;
    background-color: var(--white);
    color: var(--green);
    border-radius: 2ch;
}

::view-transition-group(main) {
    z-index: 1;
}

::view-transition-image-pair(main) {
    perspective: 200vh;
    overflow: hidden;
    z-index: 1;
}
::view-transition-new(main) {
    animation: fold-in 0.8s cubic-bezier(.3,1.15,.4,1);
    animation-fill-mode: forwards;
    transform-origin: top;
    height: 100%;
}
::view-transition-old(main) {
    animation: fold-in 0.8s cubic-bezier(.3,1.15,.4,1) reverse;
    animation-fill-mode: forwards;
    transform-origin: top;
    height: 100%;
}
@keyframes fold-in {
    from {
        transform: translateZ(-100vh)  rotateX(-90deg);
    }

    to {
        transform: translateZ(0) rotateX(0);
    }
}

form {
    view-transition-name: form;
}

::view-transition-old(form) {
    animation: none 0.8s;
}

/* input styling for home page */
label {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

input {
    padding: 0.5rem 1ch;
    border-radius: 1ch;
    outline: 2px dashed grey;
}

input:focus {
    outline: 2px dashed var(--red);
}

button {
    justify-self: end;
    padding-inline: 2ch;
    border-radius: 1ch;
    background-color: var(--red);
    border: 0.5ch solid var(--red-border);
    color: var(--white);
    margin-top: 2rem;
    margin-bottom: 1rem;
}
