:root {
    --background-color: #f4f7f6;
    --text-color: #212121;
    --primary-color: #005DFF;
    --primary-color-contrast: #ffffff;
    --secondary-background-color: #ffffff;
    --secondary-text-color: #575757;
    --subtle-text-color: #8B8B8B;
    --link-color: #888;
    --link-hover-color: #005DFF;
    --border-color: #e0e0e0;
    --gradient-start: #fdfbfb;
    --gradient-mid: #fef0ff;
    --gradient-end: #f7f8ff;
    --accent-one: #8c6ff7;
    --accent-two: #4d9dfd;
    --accent-three: #ff9a8b;
    --card-shadow: 0 30px 60px rgba(31, 38, 135, 0.15);
    --glass-background: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(255, 255, 255, 0.6);
}

[data-theme="dark"] {
    --background-color: #121212;
    --text-color: #ffffff;
    --primary-color: #3f8eff;
    --primary-color-contrast: #ffffff;
    --secondary-background-color: #181924;
    --secondary-text-color: #d7d7d7;
    --subtle-text-color: #b0b0b0;
    --link-color: #a0c6ff;
    --link-hover-color: #72b5ff;
    --border-color: #2a2e39;
    --gradient-start: #0f0c29;
    --gradient-mid: #1f1b4b;
    --gradient-end: #302b63;
    --accent-one: #7f6bff;
    --accent-two: #54a9ff;
    --accent-three: #ff8da1;
    --card-shadow: 0 25px 55px rgba(5, 0, 45, 0.55);
    --glass-background: rgba(24, 25, 36, 0.75);
    --glass-border: rgba(255, 255, 255, 0.08);
}

html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    font: inherit;
    vertical-align: baseline;
}

html {
    font-size: 62.5%;
}

body {
    font-size:1.6em;
    line-height:1.6;
    font-family: 'Source Sans Pro', sans-serif;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-mid), var(--gradient-end));
    background-size: 240% 240%;
    animation: shiftGradient 22s ease infinite;
    color: var(--text-color);
    transition: background 0.6s ease, color 0.3s;
    padding: 4rem 1.5rem 6rem;
    overflow-x: hidden;
}

#typeripvue {
    position: relative;
    z-index: 1;
    width: 100%;
}

.app-shell {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 clamp(1.2rem, 4vw, 2.8rem);
    width: 100%;
    box-sizing: border-box;
}

.background-accents {
    position: fixed;
    inset: 0;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.orb {
    position: absolute;
    display: block;
    width: 380px;
    height: 380px;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.35;
    animation: pulseGlow 14s ease-in-out infinite alternate;
}

.orb-one {
    top: -120px;
    right: -60px;
    background: radial-gradient(circle, var(--accent-two), transparent 70%);
}

.orb-two {
    bottom: -140px;
    left: -80px;
    background: radial-gradient(circle, var(--accent-three), transparent 70%);
    animation-duration: 18s;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
}
h1 { font-size: 4.5rem; }
h2 { font-size: 4rem; }
h3 { font-size: 3.5rem; }
h4 { font-size: 3rem; }
h5 { font-size: 2.5rem; }
h6 { font-size: 2rem; }
.subtext { 
    font-size:1.8rem;
    font-weight: 300; 
}
.subtext strong {
    font-weight: 500;
}

header, .alertBox, footer {
    margin-bottom: 3rem;
}

em{
    font-style: italic;
}

header {
    width:100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1.2rem;
    padding: 1rem;
    margin-bottom: 4rem;
    background: var(--glass-background);
    border-radius: 1.6rem;
    border: 1px solid var(--glass-border);
    box-shadow: var(--card-shadow);
    backdrop-filter: blur(18px);
}

.alertBox {
    flex-direction: column;
    display: flex;
    align-items: flex-start;
    text-align: left;
    background-color: var(--secondary-background-color);
    border-radius: 1.8rem;
    padding: 3.5rem;
    border: 1px solid transparent;
    background-image: linear-gradient(var(--secondary-background-color), var(--secondary-background-color)), linear-gradient(135deg, rgba(140,111,247,0.35), rgba(84,169,255,0.25));
    background-origin: border-box;
    background-clip: padding-box, border-box;
    box-shadow: var(--card-shadow);
    position: relative;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
    gap: 1.5rem;
    overflow-wrap: break-word;
    word-break: break-word;
}

.alertBox {
    color: var(--secondary-text-color);
}
.alertBox .subtext {
    color: var(--subtle-text-color);
}
.alertBox .subtext a, .font-row__info a{
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.2s;
}
.alertbox a[href]:hover, .font-row__info a:hover {
    color: var(--link-hover-color);
}
header #icon, header #url_submit_button {
    box-sizing: border-box;
    min-width: 6.5rem;
    min-height: 6.5rem;
    display:flex;
    align-items: center;
    justify-content: center;
    font-size: 3.6rem;
}

header #icon {
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-one), var(--accent-two));
    color: var(--primary-color-contrast);
    border: none;
    border-radius: 1.2rem;
    box-shadow: 0 20px 30px rgba(76, 121, 255, 0.3);
}


header #url_submit_button {
    color: var(--primary-color-contrast);
    font-size: 1.6rem;
    border-radius: 1.2rem;
    background: linear-gradient(120deg, var(--accent-two), var(--accent-one));
    box-shadow: 0 20px 30px rgba(36, 99, 235, 0.35);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: none;
    appearance: none;
    padding: 0 2.4rem;
    gap: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

header #url_submit_button:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 25px 35px rgba(36, 99, 235, 0.45);
}

header #url_submit_button i {
    font-size: 2.4rem;
}

header .button_container {
    padding: 0;
}

header .button_container .button {
    width: 6.5rem;
    height: 6.5rem;
    border-radius: 1.2rem;
    background: linear-gradient(120deg, var(--accent-two), var(--accent-one));
    color: var(--primary-color-contrast);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 20px 30px rgba(36, 99, 235, 0.35);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

header .button_container .button i {
    font-size: 2.4rem;
}

header .button_container .button:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 25px 35px rgba(36, 99, 235, 0.45);
}

header #url_input {
    line-height: 6rem;
    padding: 0 2rem;
    flex: 1 1 220px;
    min-width: 220px;
    width: 100%;
    max-width: 100%;
    border:0;
    font-size: 1.8rem;
    font-family: 'Source Code Pro', monospace;
    background-color: rgba(255,255,255,0.6);
    color: var(--text-color);
    border-radius: 1.2rem;
    border: 1px solid rgba(255,255,255,0.4);
    transition: border 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

[data-theme="dark"] header #url_input {
    background-color: rgba(24,25,36,0.85);
    border-color: rgba(255,255,255,0.06);
}

header #url_input:focus {
    outline: none;
    border-color: rgba(77,157,253,0.8);
    box-shadow: 0 10px 25px rgba(77,157,253,0.2);
}

header #url_input::placeholder {
    color: var(--subtle-text-color);
}

.font-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.font-row {
    background-color: var(--secondary-background-color);
    border-radius: 2rem;
    border: 1px solid transparent;
    background-image: linear-gradient(var(--secondary-background-color), var(--secondary-background-color)), linear-gradient(145deg, rgba(255,255,255,0.4), rgba(140,111,247,0.35));
    background-origin: border-box;
    background-clip: padding-box, border-box;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    box-shadow: var(--card-shadow);
    overflow: hidden;
    position: relative;
    z-index: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding: 2rem 2.5rem;
}

.font-row::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0;
    background: linear-gradient(120deg, rgba(77,157,253,0.15), rgba(255,154,139,0.25));
    transition: opacity 0.4s ease;
    z-index: 0;
    pointer-events: none;
}

.font-row:hover {
    transform: translateY(-4px);
    box-shadow: 0 30px 50px rgba(41, 53, 108, 0.25);
}

.font-row:hover::after {
    opacity: 1;
}

.font-row__info {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex: 1;
    min-width: 200px;
    position: relative;
    z-index: 1;
}

.font-row__name {
    font-size: 2.1rem;
    font-weight: 600;
    margin: 0;
}

.font-row__style {
    margin: 0;
    font-size: 1.6rem;
    color: var(--subtle-text-color);
}

.font-row__actions {
    margin-left: auto;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
}

.info_container {
    flex-grow: 1;
    padding:1rem;
    width: 100%;
}
.info_container--active {
    padding-top: 0;
}
.info_container p {
    font-weight: 500;
}
.info_container .small {
    font-size: 1.4rem;
    color: var(--subtle-text-color);
}
.button_container {
    padding:1rem;
}

.button_container .button{
    min-width: 5.2rem;
    min-height: 5.2rem;
    background: linear-gradient(120deg, var(--accent-two), var(--accent-three));
    border-radius: 1.2rem;
    border: none;
    padding: 1.2rem 2rem;
    color: var(--primary-color-contrast);
    display:flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    text-align: center;
    font-size: 1.8rem;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    box-shadow: 0 15px 30px rgba(255, 154, 139, 0.35);
    box-sizing: border-box;
}

.button-label {
    display: none;
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.button--download {
    gap: 0.8rem;
    padding: 1.2rem 2.4rem;
}

.button--download span {
    font-size: 1.6rem;
    font-weight: 600;
}

.button_container .button:hover{
    transform: translateY(-3px);
    box-shadow: 0 25px 40px rgba(255, 154, 139, 0.45);
    cursor: pointer;
}

.button_container .button:focus-visible{
    outline: 3px solid rgba(77,157,253,0.65);
    outline-offset: 3px;
}

header #url_submit_button:focus-visible {
    outline: 3px solid rgba(77,157,253,0.65);
    outline-offset: 3px;
}

footer p, footer a, footer a:active{
    color: var(--subtle-text-color);
    text-align: center;
    margin-top: 2.5rem;
    line-height: 1.5;
}

#theme-switcher {
    margin-left: auto;
    padding: 0;
}

@keyframes shiftGradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes pulseGlow {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
    }
    100% {
        transform: translate3d(20px, -20px, 0) scale(1.1);
    }
}

@media (max-width: 1024px) {
    body {
        padding: 3rem 1.5rem 4rem;
    }

    .app-shell {
        padding: 0 clamp(1rem, 4vw, 2rem);
    }

    header {
        padding: 1.25rem;
    }

    .alertBox {
        padding: 2.5rem;
    }

    .font-row {
        padding: 1.8rem 2rem;
    }
}

@media (max-width: 900px) {
    body {
        padding: 2.5rem 1.25rem 3.5rem;
    }

    header {
        padding: 1.25rem;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-areas:
            "icon icon"
            "input input"
            "submit submit"
            "theme clear";
        gap: 1rem;
    }

    header #icon {
        min-width: 0;
        min-height: 5.5rem;
        grid-area: icon;
    }

    header #url_input {
        width: 100%;
        grid-area: input;
    }

    header #url_submit_button {
        font-size: 1.5rem;
        padding: 1rem 2rem;
        grid-area: submit;
        width: 100%;
        min-height: 5.5rem;
    }

    #theme-switcher {
        margin-left: 0;
        grid-area: theme;
    }

    #clear-data {
        grid-area: clear;
    }

    header .button_container {
        width: 100%;
        padding: 0;
    }

    header .button_container .button {
        width: 100%;
        min-height: 5rem;
        font-size: 1.6rem;
    }

    header #url_submit_button .button-label,
    header .button_container .button .button-label {
        display: inline;
    }
}

@media (max-width: 540px) {
    body {
        padding: 2.2rem 1rem 3rem;
    }

    header {
        grid-template-columns: 1fr;
        grid-template-areas:
            "icon"
            "input"
            "submit"
            "theme"
            "clear";
    }

    header #icon {
        width: 100%;
        justify-content: flex-start;
        padding: 0 1rem;
        font-size: 3rem;
        min-height: 5.6rem;
    }

    header #url_input {
        line-height: 4.8rem;
        padding: 0 1.4rem;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    header #url_submit_button {
        width: 100%;
        max-width: 100%;
        min-height: 5.6rem;
        padding: 1.2rem 2rem;
    }

    #theme-switcher,
    #clear-data {
        width: 100%;
        max-width: 100%;
    }

    header .button_container {
        width: 100%;
        padding: 0;
        margin: 0;
        max-width: 100%;
    }

    header .button_container .button {
        width: 100%;
        max-width: 100%;
        min-height: 5.6rem;
        justify-content: center;
        font-size: 1.5rem;
        min-width: 0;
    }

    .alertBox .button_container,
    .alertBox .button {
        width: 100%;
        max-width: 100%;
    }

    .alertBox .button {
        min-width: 0;
        justify-content: center;
    }

    .font-row__actions {
        width: 100%;
        margin-left: 0;
    }

    .font-row__actions .button {
        width: 100%;
        max-width: 100%;
    }

    .alertBox {
        padding: 1.8rem;
    }

    .info_container {
        padding: 0;
    }

    .font-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .button--download {
        width: 100%;
        justify-content: center;
    }

    .font-row__name {
        font-size: 1.9rem;
    }

    .font-row__style {
        font-size: 1.4rem;
    }
}
