@import url("https://fonts.googleapis.com/css2?family=Flavors&family=Glass+Antiqua&family=SUSE:wght@100..800&family=Tilt+Neon&family=Dancing+Script:wght@400..700&family=Orbitron&display=swap");

:root {
  --main-bg: #222;
  --insta: hotpink;
  --standard: #296b8b;
  --hipster: #bb4377;
  --cursed: #6ab410;
  --business: #0077cc;
  --techbro: #00bcd4;
}

* {
    box-sizing: border-box;
}

body,
html {
    min-height: 100%;
    align-content: center;
    margin:0;
    padding:0;
}

html {
    background-color: #333;
    background: linear-gradient(#111, var(--main-bg));
}

html[currentmode="standard"] {
    --main-bg: var(--standard);
}
html[currentmode="hipster"] {
    --main-bg: var(--hipster);
}
html[currentmode="cursed"] {
    --main-bg: var(--cursed);
}
html[currentmode="business"] {
    --main-bg: var(--business);
}
html[currentmode="insta"] {
    --main-bg: var(--insta);
}
html[currentmode="techbro"] {
    --main-bg: var(--techbro);
}

body {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: "SUSE", sans-serif;
    font-optical-sizing: auto;
    font-weight: 100;
    font-style: normal;
    font-size: clamp(0.75rem, 1.25vw, 1.0rem);
}

h1 {
    color: white;
    margin-bottom: 0;
}

section {
    --gap: 2rem;
    --gap: clamp(0.6rem, calc(.1rem + 4vw), 2rem);
    --sectionpad: 3rem;
    --sectionpad: calc(var(--gap) * 1.5);
    --cornerrad: 10px;
    --cornerrad: calc(var(--gap) / 3);
    display: grid;
    font-family: "SUSE", sans-serif;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
    gap: var(--gap);
    background-color: #ffffffe6;
    padding: 3rem;
    padding: var(--sectionpad);
    width: clamp(45ch, 90vw, 800px);
    border-radius: var(--cornerrad);
    position:relative;
    margin-block-end: var(--sectionpad);
}

#container {
    display: flex;
    gap: calc(var(--gap) / 2);
    flex-direction: row;
    align-content: center;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    padding-bottom: var(--gap);
    border-bottom: 1px solid #ccc;
}

dfn {
    --dfn-f: black;
    --dfn-c: #666;
    background: white;
    cursor: pointer;
    font-size: 1.75em;
    color: var(--dfn-c);
    font-style: normal;
    display: block;
    border: 1px solid #ccc;
    border-radius: 0.2rem;
    padding-inline: 0.5rem;
}

dfn:first-letter {
    font-size: 1.3em;
    color: var(--dfn-f);
    text-decoration: underline;
}

input {
    font-size: 1.5em;
    padding: 0.5rem;
    max-width: 100%;
}
#inputrow {
    display: flex;
    width: 100%;
}
#input {
    flex-basis:100%;
}


#speak:hover {
    filter: brightness(1.2);
}

#speak:active {
    transform: scale(0.98);
}

::placeholder {
    color: #ccc;
}

#outputrow {
    margin: -2.5rem;
    padding: 2rem;
    margin: calc(0px - var(--sectionpad));
    margin-top: 0rem;
    padding: 3rem;
    padding: var(--sectionpad);
    background: #fff;
    border-radius: 0 0 10px 10px;
    display: flex;
    align-content: center;
    align-items: center;
    gap: var(--gap);
    justify-content: space-between;
}
output {
    font-size: 1.5em;
    em {
        display:none;
        opacity: 0.3;
        font-size: 80%;
        font-style: normal;
    }
}
output:before, output:after {
    content: "\201C ";
    font-size: 2rem;
    opacity:0.2;
    line-height: 1rem;
    vertical-align: bottom;
}
output:after {
    content: "\201D";
}
#speak {
    font-size: 3em;
    cursor: pointer;
    transition: filter 0.2s;
}
output:empty ~ #speak {
    opacity:0.2;
    pointer-events: none;
}
output:empty:before, output:empty:after {
    display:none;
}

#punctrow {
    margin-block: -1em;
    padding: 0;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    font-size: .8rem;
    border: none;
    input {
        margin: 0;
        margin-right: 0.5rem;
    }
}
#punctrow:has(input:checked) ~ #outputrow output em {
    display:inline;
}
/* */
@keyframes bounce {
    0% {
        transform: scale(0.9);
    }

    80% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes flip {
    0% {
        transform: rotateX(0deg);
    }

    50% {
        transform: rotateX(90deg);
    }

    100% {
        transform: rotateX(0deg);
    }
}

dfn.run-animation {
    animation: bounce 0.2s cubic-bezier(0.7, -0.61, 0.39, 1.57);
}

dfn.flip-animation {
    animation: flip 0.2s linear;
}

#modeSelector {
    font-size: 1.2rem;
    font-weight: 400;
    color: white;
    margin: 2rem;
    display: flex;
    gap: 2rem;
    row-gap: 0;
    flex-direction: row;
    flex-wrap: wrap;
    align-content: center;
    justify-content: space-between;
    align-items: center;
}

input[type="radio"] {
    display: none;
}

label {
    padding: 0.2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-width: 0 0 3px 0;
    line-height: 2em;
    cursor: pointer;
}

label:has(input:checked) {
    border-color: white;
}

dfn[currentmode="standard"] {
    --dfn-c: #666;
    --dfn-f: var(--standard);
    background: #fff;
    font-family: "Tilt Neon";
    font-size: 1.75em;
}

dfn[currentmode="hipster"] {
    --dfn-c: #8aa9b3;
    --dfn-f: var(--hipster);
    background: #f4f4f4;
    font-family: "Glass Antiqua";
    font-size: 2.1em;
}

dfn[currentmode="cursed"] {
    --dfn-c: #c0392b;
    --dfn-f: var(--cursed);
    background: #efefef;
    font-family: "Flavors";
    font-size: 1.7em;
}

dfn[currentmode="business"] {
    --dfn-c: #444;
    --dfn-f: var(--business);
    font-family: "SUSE";
    font-size: 1.7em;
}

dfn[currentmode="insta"] {
    font-family: "Dancing Script";
    --dfn-c: #9E9E9E;
    --dfn-f: var(--insta);
}
dfn[currentmode="techbro"] {
    --dfn-c: #00ff9f;
    --dfn-f: var(--techbro);
    background: #0b0f14;
    font-family: "Orbitron";
    font-size: 1.5em;
}




.toast {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    color: white;
    font-weight: bold;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease, transform 0.4s ease;
    z-index: 999;
}

.toast.show {
    opacity: 1;
    pointer-events: auto;
    background: #333;
}

.toast.standard {
    background: #333;
}

.toast.hipster {
    background: #8aa9b3;
}

.toast.cursed {
    background: #c0392b;
    /* Hellfire red */
}

.toast.business {
    background: blue;
}

.toast.insta {
    background: #666;
}