@charset "UTF-8";

* {
    margin: 0;
    box-sizing: border-box;
}

html {
    font-size: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background-color: #0f0f0f;
    color: #e8e8e8;
    min-height: 100vh;
}

/* -------------- */
/* Nav */
/* -------------- */

nav {
    padding: 1rem 2rem;
    border-bottom: 1px solid #222;
}

nav a {
    color: #888;
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.3s ease;
}

nav a:hover {
    color: #e8e8e8;
}

/* -------------- */
/* Main */
/* -------------- */

main {
    max-width: 700px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

main h1 {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    margin-bottom: 3rem;
    background: linear-gradient(135deg, #cd6f9e, #553fa6);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.demo {
    margin-bottom: 3rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid #1a1a1a;
}

.demo h2 {
    font-size: 1rem;
    color: #888;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.demo p {
    font-size: 0.875rem;
    color: #555;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.demo p code {
    background: #1a1a1a;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.8rem;
    color: #cd6f9e;
}

/* -------------- */
/* Farbslider */
/* -------------- */

.farbslider {
    box-shadow: inset 0 0 0 0 #83187d;
    color: #cd6f9e;
    margin: 0 -0.25rem;
    padding: 0 0.25rem;
    text-decoration: none;
    font-weight: 700;
    transition: color 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

.farbslider:hover {
    box-shadow: inset 200px 0 0 0 #471e94;
    color: white;
}

/* -------------- */
/* Textflip */
/* -------------- */

.textflip {
    overflow: hidden;
    position: relative;
    display: inline-block;
    text-decoration: none;
    font-weight: 700;
    color: #e8e8e8;
}

/* FIX: war textflip::before ohne Punkt */
.textflip::before,
.textflip::after {
    content: '';
    position: absolute;
    width: 100%;
    left: 0;
}

.textflip::before {
    background-color: rgb(4, 107, 114);
    height: 2px;
    bottom: 0;
    transform-origin: 100% 50%;
    transform: scaleX(0);
    transition: transform 0.3s cubic-bezier(0.76, 0, 0.24, 1);
}

.textflip::after {
    content: attr(data-replace);
    height: 100%;
    top: 0;
    transform-origin: 100% 50%;
    transform: translate3d(200%, 0, 0);
    transition: transform 0.3s cubic-bezier(0.76, 0, 0.24, 1);
    color: rgb(4, 245, 4);
}

.textflip:hover::before {
    transform-origin: 0% 50%;
    transform: scaleX(1);
}

.textflip:hover::after {
    transform: translate3d(0, 0, 0);
}

.textflip span {
    display: inline-block;
    transition: transform 0.3s cubic-bezier(0.76, 0, 0.24, 1);
}

.textflip:hover span {
    transform: translate3d(-200%, 0, 0);
}

/* -------------- */
/* Textmarker */
/* -------------- */

.textmarker {
    text-decoration: none;
    color: #e006b1;
    font-weight: 700;
    position: relative;
}

.textmarker::before {
    content: '';
    background-color: hsla(266, 92%, 45%, 0.75);
    position: absolute;
    left: 0;
    bottom: 3px;
    width: 100%;
    height: 0;
    z-index: -1;
    transition: all 0.3s ease-in-out;
}

.textmarker:hover::before {
    bottom: 0;
    height: 100%;
}

/* -------------- */
/* Right–Left Color Swap */
/* -------------- */

.rightleft_swap {
    color: #54b3d6;
    text-decoration: none;
    display: inline-block;
    padding: 5px 0;
    position: relative;
    background-image: linear-gradient(
        to right,
        #54b3d6,
        #54b3d6 50%,
        #e8e8e8 50%
    );
    background-size: 200% 100%;
    background-position: -100%;
    transition: background-position 0.3s ease-in-out;
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
    a.rightleft_swap {
        background-clip: text;
        -webkit-background-clip: text;
        color: transparent;
        -webkit-text-fill-color: transparent;
    }
}

.rightleft_swap::before {
    content: '';
    background: #54b3d6;
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 0;
    height: 3px;
    transition: width 0.3s ease-in-out;
}

.rightleft_swap:hover {
    background-position: 0;
}

.rightleft_swap:hover::before {
    width: 100%;
}

/* -------------- */
/* Rainbow Underline */
/* -------------- */

.rainbow {
    position: relative;
    text-decoration: none;
    color: #e8e8e8;
    padding: 5px 0;
    font-weight: 700;
}

.rainbow::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(
        to right,
        #ff0000, #ff7a00, #ffd000,
        #00c853, #00b0ff, #3d5afe,
        #9500f9, #e006e0
    );
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 400ms ease;
}

.rainbow:hover::after {
    transform: scaleX(1);
}

/* -------------- */
/* Passing Underline */
/* -------------- */

.passing_underline {
    position: relative;
    text-decoration: none;
    color: #e8e8e8;
    font-weight: 700;
}

.passing_underline::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 4px;
    border-radius: 4px;
    background-color: #cd6f9e;
    bottom: 0;
    left: 0;
    transform-origin: right;
    transform: scaleX(0);
    transition: transform 0.3s ease-in-out;
}

.passing_underline:hover::before {
    transform-origin: left;
    transform: scaleX(1);
}