/* ============================================
   DARK MODE
   ============================================ */

[data-theme="dark"] {
    --base-color: #000000;
    --text-color: #ffffff;
    --text-span: rgba(198, 238, 238, 0.603);
    --color-picker: rgb(121, 113, 113);
    --body-grid-line: rgba(255, 255, 255, 0.015);
    --nav-contrast-color: #000000;
    --theme: dark;
    --clr-warn-1: #2a1f14;
    --clr-warn-2: #6b5646;
    --clr-warn-text: #e8dcc8;
    --navbar-shadow: 0 30px 100px rgba(196, 140, 130, 0.8), 0 30px 100px rgba(215, 190, 185, 0.6);
    --shadow-color-primary: rgba(255, 255, 255, 0.8);
    --shadow-color-secondary: rgba(255, 255, 255, 0.7);
    --shadow-color-tertiary: rgba(255, 255, 255, 0.5);
    --gradient-header: linear-gradient(90deg, rgba(235, 235, 243, 0.431), rgba(118, 166, 200, 0), rgba(80, 146, 163, 0.2), rgb(52, 102, 108));
    --gradient: linear-gradient(90deg, var(--text-span), var(--text-color), var(--text-span));
    --backdrop-blur: blur(10px);
    --blend-mode: screen;
    --transition-duration: 400ms;
    --reveal-duration: 0.8s;
}


/* Dark mode - button default state */

[data-theme="dark"] .large-button svg,
[data-theme="dark"] .large-button .button-text span {
    color: var(--text-color);
    /* White */
    fill: var(--text-color);
}


/* Dark mode - button hover state */

[data-theme="dark"] .large-button:is(:hover, :focus-visible, :active) :is(svg, .button-text span) {
    color: var(--base-color);
    /* Black */
    fill: var(--base-color);
    background-color: transparent;
}


/* ============================================
   LIGHT MODE
   ============================================ */

[data-theme="light"] {
    --base-color: #ffffff;
    --text-color: #000000;
    --text-span: rgb(55, 156, 187);
    --color-picker: rgb(192, 182, 182);
    --body-grid-line: rgba(42, 42, 46, 0.25);
    /* Increase from 0.15 */
    --nav-contrast-color: #ffffff;
    --theme: light;
    --navbar-shadow: 0 30px 100px rgba(196, 140, 130, 0.8), 0 30px 100px rgba(215, 190, 185, 0.6);
    --shadow-color-primary: rgb(48, 48, 48);
    --shadow-color-secondary: rgba(0, 0, 0, 0.7);
    --shadow-color-tertiary: rgba(0, 0, 0, 0.5);
    --gradient-header: linear-gradient(90deg, rgba(214, 218, 230, 0.431), rgba(84, 144, 202, 0.337), rgba(80, 146, 163, 0.2), rgb(52, 102, 108));
    --gradient: linear-gradient(90deg, var(--text-span), var(--text-color), var(--text-span));
    --backdrop-blur: blur(10px);
    --blend-mode: multiply;
    --clr-warn-1: #f9f5f0;
    --clr-warn-2: #9d8b7e;
    --clr-warn-text: #5d4e45;
    --transition-duration: 400ms;
    --reveal-duration: 0.8s;
}


/* Light mode - button default state */

[data-theme="light"] .large-button svg,
[data-theme="light"] .large-button .button-text span {
    color: var(--text-color);
    /* Black */
    fill: var(--text-color);
}


/* Light mode - button hover state */

[data-theme="light"] .large-button:is(:hover, :focus-visible, :active) :is(svg, .button-text span) {
    color: var(--base-color);
    /* Semi-transparent white */
    fill: var(--base-color);
    background-color: transparent;
}


/* ============================================
   MODERN BROWSERS - OKLCH Color Space
   ============================================ */

@supports (color: oklch(0% 0 0deg)) {
    [data-theme="dark"] {
        --base-color: oklch(0% 0 0deg);
        --text-color: oklch(100% 0.00011 271.152deg);
        --text-span: oklch(47.898% 0.06036 195.377deg / 0.850);
        --focus-ring-color: oklch(100% 0.00011 271.152deg);
        --body-grid-line: oklch(100% 0.00011 271.152deg / 0.085);
        --btn-cell-bg: oklch(100% 0.00011 271.152);
        --btn-cell-gradient-start: oklch(100% 0.00011 271.152 / 0.938);
        --btn-cell-gradient-end: oklch(100% 0.00011 271.152 / 0.781);
    }

    [data-theme="light"] {
        --base-color: oklch(100% 0.00011 271.152 / 0.911);
        --text-color: oklch(0% 0 0);
        --text-span: oklch(53.447% 0.06872 209.921deg / 0.61);
        --focus-ring-color: oklch(22% 0.015 271.152deg);
        --body-grid-line: oklch(22% 0.015 271.152deg / 0.15);
        --btn-cell-bg: oklch(0% 0 0);
        --btn-cell-gradient-start: oklch(0% 0 0 / 0.884);
        --btn-cell-gradient-end: oklch(0% 0 0 / 0.733);
    }
}

[data-theme] body::before {
    --size: clamp(20px, 3vw, 30px);
    opacity: 1;
    pointer-events: none;
    content: "";
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(90deg, var(--body-grid-line) 1px, transparent 1px) 0 0 / var(--size) var(--size), linear-gradient(180deg, var(--body-grid-line) 1px, transparent 1px) 0 0 / var(--size) var(--size), var(--base-color);
    -webkit-mask-image: linear-gradient(-135deg, transparent 0%, var(--base-color) 20%);
    -webkit-mask-size: 400% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-image: linear-gradient(-135deg, transparent 0%, var(--base-color) 20%);
    mask-size: 400% 100%;
    mask-repeat: no-repeat;
    transition: opacity 0.7s ease-in-out;
    isolation: isolate;
    z-index: -1;
}


@supports (height: 100dvh) and (width: 100dvw) {
    [data-theme] body::before {
        width: 100dvw;
        height: 100dvh;
    }
}

@media (prefers-reduced-transparency: reduce),
(prefers-reduced-motion: reduce) {
    [data-theme] body::before {
        background: var(--base-color);
        -webkit-mask-image: none;
        mask-image: none;
        transition: none;
    }
}

[data-theme] body {
    position: relative;
    z-index: 1;
    isolation: isolate;
}

:root {
    --step-0: clamp(1rem, 0.9322rem + 0.339vw, 1.25rem);
    --step-1: clamp(1.2rem, 1.0736rem + 0.6322vw, 1.6663rem);
    --step-2: clamp(1.44rem, 1.2282rem + 1.0591vw, 2.2211rem);
    --step-3: clamp(1.728rem, 1.3937rem + 1.6715vw, 2.9607rem);
    --step-4: clamp(2.0736rem, 1.5656rem + 2.5398vw, 3.9467rem);
    --step-5: clamp(2.4883rem, 1.7364rem + 3.7594vw, 5.2609rem);
    --step-6: clamp(2.986rem, 1.894rem + 5.4601vw, 7.0128rem);
    --space-5xs: clamp(0.125rem, 0.1081rem + 0.0847vw, 0.1875rem);
    --space-4xs: clamp(0.1875rem, 0.1706rem + 0.0847vw, 0.25rem);
    --space-3xs: clamp(0.25rem, 0.2331rem + 0.0847vw, 0.3125rem);
    --space-2xs: clamp(0.5rem, 0.4661rem + 0.1695vw, 0.625rem);
    --space-xs: clamp(0.75rem, 0.6992rem + 0.2542vw, 0.9375rem);
    --space-s: clamp(1rem, 0.9322rem + 0.339vw, 1.25rem);
    --space-m: clamp(1.5rem, 1.3983rem + 0.5085vw, 1.875rem);
    --space-l: clamp(2rem, 1.8644rem + 0.678vw, 2.5rem);
    --space-xl: clamp(3rem, 2.7966rem + 1.0169vw, 3.75rem);
    --space-2xl: clamp(4rem, 3.7288rem + 1.3559vw, 5rem);
    --space-3xl: clamp(6rem, 5.5932rem + 2.0339vw, 7.5rem);
    --space-4xl: clamp(7rem, 6.5254rem + 2.3729vw, 8.75rem);
    --space-5xl: clamp(8rem, 7.4576rem + 2.7119vw, 10rem);
    --space-6xl: clamp(9rem, 8.3898rem + 3.0508vw, 11.25rem);
    --space-7xl: clamp(10rem, 9.322rem + 3.3898vw, 12.5rem);
    --space-8xl: clamp(11rem, 10.2542rem + 3.7288vw, 13.75rem);
    --space-9xl: clamp(12rem, 11.1864rem + 4.0678vw, 15rem);
    --space-10xl: clamp(13rem, 12.1186rem + 4.4068vw, 16.25rem);
    --space-11xl: clamp(14rem, 13.0508rem + 4.7458vw, 17.5rem);
    --space-12xl: clamp(15rem, 13.983rem + 5.0847vw, 18.75rem);
    --space-13xl: clamp(16rem, 14.9152rem + 5.4237vw, 20rem);
    --padding-inline: var(--space-3xs);
    --letter-spacing: var(--space-4xs);
    --word-spacing: var(--space-5xs);
    --curve-animation-duration: 6s;
    --curve-char-width: clamp(3rem, 6vw, 5rem);
    --curve-blur: var(--space-l);
    --curve-rise-outer-near: 25vmin;
    --curve-rise-mid: 15vmin;
    --curve-rise-center: 25vmin;
    --curve-height: 145px;
    --curve-height-mobile: 85px;
    --glow-up-width: 100%;
    --glow-up-height: clamp(0.04vmin, 0.07vmin, 0.13vmin);
    --glow-down-width: clamp(0.8vmin, 1vmin, 1.5vmin);
    --glow-down-height: clamp(0.1vmin, 0.30vmin, 0.42vmin);
    --transition-duration: 2s;
    --reveal-duration: 2s;
    --primary-font: 'alumni_sans_pinstriperegular', sans-serif;
    --primary-font-secondary: 'cormorant_uprightlight', sans-serif;
    --font-weight: normal;
    --font-style: normal;
    --content-width: 95vw;
    --content-footer-width: 100vw;
    --transition-icon: fill 0.3s, transform 0.3s;
    --transition-label: opacity 0.5s ease-in-out;
    --transition-theme: 0.35s;
}

@supports (selector(::view-transition)) {
    .support.view-transition {
        display: none;
    }
}

@container not style(--theme: yellow) {
    .support.style-query {
        display: none;
    }
}

.support {
    background-color: var(--clr-warn-1);
    border-inline-start: 0.5rem solid var(--clr-warn-2);
    color: var(--clr-warn-text);
    border-radius: 0.5rem;
    padding: 1em 2em;
}

::view-transition {
    background: var(--text-color);
}

::view-transition-image-pair(root) {
    perspective: 2500px;
    perspective-origin: center;
    transform-style: preserve-3d;
    transform-origin: 50% 50% 100vw;
    filter: drop-shadow(0px 0px 6px hsla(0, 0%, 100%, 0)) drop-shadow(0px 0px 25px hsla(0, 0%, 100%, 0));
}

::view-transition-old(root),
::view-transition-new(root) {
    animation: 2.5s linear(0, 0.324 9.1%, 0.584 18.6%, 0.782 28.6%, 0.858 33.8%, 0.92 39.2%, 0.997 49.5%, 1.021 55.1%, 1.033 61%, 1.035 71.7%, 1);
    transform-style: preserve-3d;
    transform-origin: 50% 50% 0;
    perspective: 500px;
    transform: translateZ(-50vw) scale(var(--scale)) rotatey(var(--rotation)) translatez(50vw);
    backface-visibility: hidden;
}

::view-transition-old(root) {
    animation-name: reveal-out;
}

::view-transition-new(root) {
    animation-name: reveal-in;
}

::view-transition-old(header-text),
::view-transition-new(header-text),
::view-transition-old(header-break),
::view-transition-new(header-break),
::view-transition-old(theme-toggle-light),
::view-transition-new(theme-toggle-dark),
::view-transition-old(site-title),
::view-transition-new(site-title),
::view-transition-old(site-title-break),
::view-transition-new(site-title-break),
::view-transition-old(footer-text),
::view-transition-new(footer-text),
::view-transition-old(footer-break),
::view-transition-new(footer-break),
::view-transition-old(footer-break-1),
::view-transition-new(footer-break-1) {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

@property --rotation {
    syntax: "<angle>";
    inherits: false;
    initial-value: 0deg;
}

@property --scale {
    syntax: "<number>";
    inherits: false;
    initial-value: 1;
}

@keyframes reveal-in {
    from {
        --rotation: -90deg;
        animation-timing-function: ease-in-out;
    }

    15% {
        --scale: 0.8;
        --rotation: -90deg;
    }

    85% {
        --scale: 0.8;
        --rotation: 0deg;
        animation-timing-function: ease-in-out;
    }

    to {
        --rotation: 0deg;
    }
}

@keyframes reveal-out {
    from {
        --rotation: 0deg;
        animation-timing-function: ease-in-out;
    }

    15% {
        --scale: 0.8;
        --rotation: 0deg;
    }

    85% {
        --scale: 0.8;
        --rotation: 90deg;
        animation-timing-function: ease-in-out;
    }

    to {
        --rotation: 90deg;
    }
}

h1,
h2,
h3 {
    letter-spacing: var(--letter-spacing);
}

html,
body {
    color: var(--text-color);
    font-family: var(--primary-font);
    font-weight: normal;
    font-style: normal;
    font-display: swap;
    font-size: var(--step-0);
    letter-spacing: var(--letter-spacing);
    word-spacing: var(--word-spacing);
}

body {
    background: var(--base-color);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    min-height: 100dvh;
    overflow: clip;
}

header,
main,
footer {
    width: 100%;
    max-width: var(--content-width);
    margin-inline: auto;
}

header {
    display: flex;
    flex-direction: column;
    align-items: center;
    view-transition-name: header;
}

.header-text {
    padding-block-start: var(--space-2xs);
    white-space: normal;
    word-break: normal;
    overflow-wrap: normal;
    hyphens: none;
    text-align: center;
    view-transition-name: header-text;
}

.header-break {
    padding: 0;
    view-transition-name: header-break;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    /* Start from top */
    margin-block-start: var(--space-l);
    view-transition-name: main;
}

.site-title {
    white-space: normal;
    word-break: normal;
    overflow-wrap: normal;
    hyphens: none;
    text-align: center;
    view-transition-name: site-title;
}

.site-title-break {
    padding: 0;
    view-transition-name: site-title-break;
}

.curve-container {
    font-family: var(--primary-font-secondary);
    margin-block: var(--space-s);
    font-size: var(--step-3);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: var(--content-width);
    margin-inline: auto;
    view-transition-name: curve-container;
}

.content,
.content-1 {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    min-height: var(--curve-height);
    width: 100%;
}

.curve-row div {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
}

.curve-row div span {
    width: var(--curve-char-width);
    position: relative;
    text-align: center;
    color: var(--text-color);
}

.up::before,
.down::before {
    content: "";
    position: absolute;
    display: block;
    background: var(--glow-background);
    box-shadow: var(--glow-box-shadow);
    transform-origin: center;
    animation: shadow var(--curve-animation-duration) ease-in-out infinite;
    contain: layout style;
}

.up::before {
    width: var(--glow-up-width);
    height: var(--glow-up-height);
    will-change: opacity, transform;
    top: 50%;
}

.down::before {
    width: var(--glow-down-width);
    height: var(--glow-down-height);
    filter: blur(var(--curve-blur));
    left: 50%;
    top: 50%;
    transform: translateX(-50%);
}

.up,
.down {
    position: relative;
}

.up {
    --curve-direction: -1;
}

.down {
    --curve-direction: 1;
}

.up span,
.down span {
    animation-duration: var(--curve-animation-duration);
    animation-iteration-count: infinite;
    animation-name: curve-wave;
    animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    /* Material Design easing */
    --curve-move: calc(var(--curve-direction) * var(--curve-rise, 0vmin));
}

@keyframes shadow {
    0% {
        opacity: 0;
        transform: scaleY(0);
    }

    25% {
        opacity: var(--glow-opacity-low);
        transform: scaleY(0.7);
    }

    45%,
    55% {
        opacity: var(--glow-opacity-mid);
        transform: scaleY(1);
    }

    75% {
        opacity: var(--glow-opacity-low);
        transform: scaleY(0.7);
    }

    100% {
        opacity: 0;
        transform: scaleY(0);
    }
}

@keyframes curve-wave {

    0%,
    100% {
        transform: translateY(0);
    }

    25% {
        transform: translateY(calc(var(--curve-move) * 0.7));
    }

    50% {
        transform: translateY(var(--curve-move));
    }

    75% {
        transform: translateY(calc(var(--curve-move) * 0.7));
    }
}

.large-button {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--space-s);
    width: var(--space-13xl);
    height: var(--space-7xl);
    margin-inline: auto;
    box-shadow: 0 20px 10px 0 var(--text-color);
    overflow: clip;
    isolation: isolate;
    z-index: 10;
    border-radius: 50%;
    color: var(--text-color);
    text-decoration: none;
    cursor: pointer;
    user-select: none;
    pointer-events: all;
    transition: box-shadow 0.3s, outline 0.3s, opacity 0.3s;
    view-transition-name: large-button;
}

.large-button svg {
    width: var(--space-l);
    height: var(--space-l);
    fill: var(--text-color);
    transition: fill 0.3s, transform 0.3s;
    margin-inline: auto;
}

.large-button:is(:hover, :focus-visible, :focus, :active, :focus-within) svg,
.large-button:has(:is(:hover, :focus-visible, :focus, :active, :focus-within)) svg {
    fill: var(--base-color);
    transform: scale(1.5) rotate(90deg);
    z-index: 11;
}

.button-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    pointer-events: none;
    position: relative;
    margin-inline: auto;
    z-index: 12;
}

.btn-cells {
    position: absolute;
    z-index: 2;
    inset: 0;
    display: grid;
    grid-template-columns: repeat(6, 1fr);

    &::before {
        content: "";
        position: absolute;
        position-anchor: --hovered-cell;
        left: calc(anchor(left) - 20px);
        right: calc(anchor(right) - 20px);
        top: calc(anchor(top) - 20px);
        bottom: calc(anchor(bottom) - 20px);
        margin: 0 auto auto;
        width: 10px;
        aspect-ratio: 1;
        background: var(--btn-cell-bg);
        background-image: linear-gradient(to right, var(--btn-cell-gradient-start), color-mix(in srgb, var(--btn-cell-gradient-end), white 50%));
        border-radius: 100vw;
        /* Slower transitions */
        transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), margin 0ms 0.6s, left 0.2s ease-out, right 0.2s ease-out, top 0.2s ease-out, bottom 0.2s ease-out;
        transition-behavior: allow-discrete;
        transform: scale(0);
        will-change: transform;
    }

    &:has(> :nth-child(n + 19):hover)::before {
        margin: auto auto 0;
    }

    &:hover::before {
        transform: scale(75);
        transition: transform 1s cubic-bezier(0.34, 1.56, 0.64, 1),
            /* Very slow */
            margin 0ms 0ms, left 0.2s ease-out, right 0.2s ease-out, top 0.2s ease-out, bottom 0.2s ease-out;
    }

    & span {
        position: relative;
        transition: anchor-name 0ms;
    }

    &:not(:hover) span {
        transition: anchor-name 0ms 0.3s;
        transition-behavior: allow-discrete;
    }

    & span:hover {
        anchor-name: --hovered-cell;
        transition: anchor-name 0ms;
    }
}

footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    view-transition-name: footer;
}

.footer-text {
    white-space: normal;
    word-break: normal;
    hyphens: none;
    view-transition-name: footer-text;
}

.footer-break {
    display: inline;
    padding-inline-start: var(--space-xs);
    view-transition-name: footer-break;
}

.footer-break-1 {
    display: inline;
    padding-inline-start: var(--space-xs);
    view-transition-name: footer-break-1;
}


/* ============================================
   COLOR PICKER - REFACTORED CSS
   ============================================
   
   This refactored version improves:
   - Logic: Removes redundant @supports fallback
   - Performance: Consolidates transitions, removes unused animations
   - Semantics: Better organized with clear section comments
   - Accessibility: Enhanced focus states and reduced-motion support
*/


/* ============================================
   VISUALLY HIDDEN UTILITY
   ============================================ */

.visually-hidden,
.color-picker input[type="radio"],
.color-picker .theme-input {
    border: 0;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}


/* ============================================
   COLOR PICKER - VIEW TRANSITIONS
   ============================================ */


/* View transition names */

.color-picker input[type="radio"],
.color-picker svg {
    view-transition-name: none;
}

.color-picker .theme-label--light svg {
    view-transition-name: theme-toggle-light;
}

.color-picker .theme-label--dark svg {
    view-transition-name: theme-toggle-dark;
}


/* ============================================
   COLOR PICKER - LAYOUT & STRUCTURE
   ============================================ */

.color-picker {
    display: grid;
    place-items: center;
    width: var(--space-xl);
    height: var(--space-xl);
    cursor: pointer;
    position: relative;
    border-radius: 50%;
}

.color-picker>fieldset {
    width: 100%;
    height: 100%;
    border: 0;
    background: transparent;
    display: grid;
    place-items: center;
    position: relative;
}


/* ============================================
   COLOR PICKER - STATE MANAGEMENT
   ============================================ */


/* Hide checked labels - single rule with fallback class */

.color-picker label:has(> input:checked),
.color-picker label.checked,
.color-picker .theme-label:has(> .theme-input:checked),
.color-picker .theme-label.checked {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease-in-out;
}


/* ============================================
   COLOR PICKER - SVG STYLING
   ============================================ */

.color-picker label svg,
.color-picker .theme-label svg {
    width: var(--space-m);
    height: var(--space-m);
    display: block;
    fill: var(--text-color);
    transition: var(--transition-icon);
}

.color-picker svg path {
    fill: currentColor;
}


/* ============================================
   COLOR PICKER - INTERACTIVE STATES
   ============================================ */

.color-picker label,
.color-picker .theme-label {
    position: absolute;
    inset: 0;
    pointer-events: all;
    isolation: isolate;
    display: grid;
    place-items: center;
    cursor: pointer;
    border-radius: 50%;
    transition: opacity 0.5s ease-in-out;
}


/* Hover and focus states */

.color-picker label:is(:hover, :focus-within) svg,
.color-picker .theme-label:is(:hover, :focus-within) svg {
    fill: var(--base-color);
    transform: scale(0.8) rotate(90deg);
    background-color: var(--color-picker);
    padding: var(--space-5xs);
    border-radius: 50%;
    animation: icon-fade 0.3s ease-in-out;
}


/* Focus visible for keyboard navigation */

.color-picker label:focus-visible svg,
.color-picker .theme-label:focus-visible svg {
    outline: 2px solid var(--text-color);
    outline-offset: 2px;
}


/* ============================================
   COLOR PICKER - ANIMATIONS
   ============================================ */

@keyframes icon-fade {
    from {
        background-color: transparent;
    }

    to {
        background-color: var(--color-picker);
    }
}

.color-picker.is-animating .theme-label {
    transition-duration: var(--transition-theme);
}

.color-picker .theme-label.is-outgoing svg {
    animation: theme-picker-out var(--transition-theme) ease-in-out both;
}

.color-picker .theme-label.is-incoming svg {
    animation: theme-picker-in var(--transition-theme) ease-in-out both;
}

@keyframes theme-picker-out {
    from {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }

    to {
        opacity: 0;
        transform: scale(0.75) rotate(-80deg);
    }
}

@keyframes theme-picker-in {
    from {
        opacity: 0;
        transform: scale(0.75) rotate(80deg);
    }

    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}


/* ============================================
   COLOR PICKER - TOUCH DEVICE ADJUSTMENTS
   ============================================ */

@media (hover: none) and (pointer: coarse) {
    .color-picker .theme-label:focus-visible {
        outline: 2px solid var(--text-color);
        outline-offset: 2px;
    }

    .color-picker label:is(:hover, :focus-within) svg,
    .color-picker .theme-label:is(:hover, :focus-within) svg {
        fill: var(--text-color);
        transform: scale(1) rotate(0deg);
        background-color: transparent;
        padding: 0;
        border-radius: 0;
        animation: none;
    }
}


/* ============================================
   COLOR PICKER - REDUCED MOTION SUPPORT
   ============================================ */

@media (prefers-reduced-motion: reduce) {

    .color-picker label svg,
    .color-picker .theme-label svg {
        transition: none;
    }

    .color-picker label:is(:hover, :focus-within) svg,
    .color-picker .theme-label:is(:hover, :focus-within) svg {
        animation: none;
    }

    .color-picker .theme-label.is-outgoing svg,
    .color-picker .theme-label.is-incoming svg {
        animation: none;
    }
}


/* Touch device adjustments */

@media (hover: none) and (pointer: coarse) {
    .color-picker .theme-label:focus-visible {
        outline: 2px solid var(--text-color);
        outline-offset: 2px;
    }

    .color-picker label:is(:hover, :focus-within) svg,
    .color-picker .theme-label:is(:hover, :focus-within) svg {
        fill: var(--text-color);
        transform: scale(1) rotate(0deg);
        background-color: transparent;
        padding: 0;
        border-radius: 0;
        animation: none;
    }
}

@media (max-width: 640px) {
    :root {
        --curve-char-width: clamp(2.5rem, 7.2vw, 4rem);
    }

    .header-break {
        padding-inline: 0;
    }

    main {
        flex: 1;
    }

    .site-title {
        white-space: normal;
        word-break: normal;
        hyphens: none;
        margin-inline: auto;
        view-transition-name: site-title;
        text-align: center;
    }

    .site-title-break {
        display: block;
        margin-inline: auto;
        width: fit-content;
        padding-inline-end: 0;
    }

    .curve-container {
        margin-block-start: var(--space-m);
    }

    .content,
    .content-1 {
        min-height: var(--curve-height-mobile);
    }

    .large-button {
        margin-block-start: 0;
    }

    footer {
        width: 100%;
        max-width: var(--content-footer-width);
        margin-inline: auto;
    }

    .footer-text {
        margin: var(--space-s);
        padding-inline-start: 0;
    }

    .footer-break {
        display: inline;
        padding-inline-start: var(--space-4xs);
    }

    .footer-break-1 {
        display: block;
        padding-inline-start: 0;
    }

    .color-picker {
        margin: var(--space-4xs);
    }

    .color-picker label svg {
        width: var(--space-m);
        height: var(--space-m);
    }
}


/* ============================================
   COLOR PICKER - TOUCH DEVICE ENHANCEMENTS
   ============================================ */

@media (hover: none) and (pointer: coarse) {

    /* Reset all interactive states for touch devices */
    .color-picker .theme-label,
    .color-picker .theme-label:active,
    .color-picker .theme-label:focus,
    .color-picker .theme-label:hover {
        background: none;
        box-shadow: none;
        color: inherit;
        transform: none;
        padding: 0;
        transition: none;
        outline: none;
    }

    .color-picker .theme-label svg {
        filter: none;
        fill: currentColor;
        transition: none;
    }
}


/* ============================================
   COLOR PICKER - SMALL SCREENS (400px)
   ============================================ */

@media (max-width: 400px) {
    .color-picker {
        padding-inline-end: var(--space-3xs);
    }
}


/* ============================================
   COLOR PICKER - TOUCH FEEDBACK
   ============================================ */

@media (hover: none) and (pointer: coarse) {

    .large-button:focus,
    .large-button:active {
        box-shadow: 0 0 20px 5px var(--text-color);
    }

    .large-button:focus svg,
    .large-button:active svg {
        fill: var(--base-color);
        transform: scale(1.2) rotate(90deg);
    }

    .btn-cells span {
        -webkit-tap-highlight-color: transparent;
    }

    .btn-cells span:focus {
        anchor-name: --hovered-cell;
    }

    .color-picker label:active svg,
    .color-picker .theme-label:active svg {
        animation: tapFeedback 0.6s ease-in-out;
    }

    @keyframes tapFeedback {
        0% {
            transform: scale(1) rotate(0deg);
        }

        50% {
            transform: scale(0.8) rotate(180deg);
        }

        100% {
            transform: scale(1) rotate(0deg);
        }
    }
}


/* ============================================
   COLOR PICKER - REDUCED MOTION (MOBILE)
   ============================================ */

@media (prefers-reduced-motion: reduce) {

    .color-picker label:active svg,
    .color-picker .theme-label:active svg {
        animation: none;
    }

    .color-picker .theme-label svg {
        transition: none;
    }

    .color-picker label:is(:hover, :focus-within) svg,
    .color-picker .theme-label:is(:hover, :focus-within) svg {
        animation: none;
        background-color: transparent;
        fill: var(--text-color);
        transform: none;
        padding: 0;
        border-radius: 0;
    }
}

@media (max-width: 400px) {
    .footer-text {
        margin: var(--space-s);
        padding-inline-start: 0;
    }

    .footer-break {
        display: block;
        padding-inline-start: 0;
    }

    .color-picker {
        padding-inline-end: var(--space-3xs);
    }
}

@media (prefers-reduced-motion: reduce) {

    ::view-transition-group(*),
    ::view-transition-old(*),
    ::view-transition-new(*) {
        animation: none;
    }

    ::view-transition-old(root),
    ::view-transition-new(root) {
        transform: none;
        perspective: none;
        transform-style: flat;
        backface-visibility: visible;
    }

    .up span,
    .down span {
        animation: none;
        transition: none;
    }

    .down::before,
    .up::before {
        animation: none;
        filter: none;
        box-shadow: none;
    }

    .text-with-animation span:first-child,
    .text-with-animation span:last-child {
        animation: none;
    }

    .large-button {
        transition: none;
    }

    .large-button:hover {
        box-shadow: 0 20px 10px 0 var(--text-color);
        transform: none;
    }

    .large-button:focus-visible {
        outline: 6px solid var(--focus-ring-color);
        background-color: var(--text-color);
        color: var(--base-color);
        box-shadow: 0 0 50px 10px var(--text-color);
        transform: none;
    }

    .large-button svg {
        transition: none;
    }

    .large-button:hover svg,
    .large-button:focus-visible svg {
        transform: none;
    }

    .color-picker label svg {
        transition: none;
    }

    .color-picker .theme-label.is-outgoing svg,
    .color-picker .theme-label.is-incoming svg {
        animation: none;
    }

    .color-picker label:focus-within svg,
    .color-picker .theme-label:hover svg,
    .color-picker .theme-label:focus-within svg,
    .color-picker label:hover svg {
        background-color: transparent;
        fill: var(--text-color);
        transform: none;
        padding: 0;
        border-radius: 0;
    }
}