@property --angle-1 {
    syntax: "<angle>";
    inherits: false;
    initial-value: -75deg;
}
@property --angle-2 {
    syntax: "<angle>";
    inherits: false;
    initial-value: -45deg;
}

:root {
    --global-sz: clamp(1rem, 2vw, 1.5rem);
    --hover-t: 400ms;
    --hover-e: cubic-bezier(0.25, 1, 0.5, 1);
    --w-ty: 225px;
    --h-ty: 175px;
    --w-sm: 300px;
    --h-sm: 200px;
    --w-md: 400px;
    --h-md: 300px;
    --w-lg: 500px;
    --h-lg: 400px;

    --bg-body: #d7d7d7;
    --bg-gradient-start: #ffd1e8;
    --bg-gradient-end: #ffffff;
    --bg-popup: #ffffff;
    --popup-backdrop: rgba(0,0,0,0.4);
    --btn-switch-bg: #00ab06;
    --btn-switch-bg-hover: #008907;
    --btn-switch-color: rgb(251, 245, 255);
    --btn-close-bg: #f0f0f0;
    --btn-close-bg-hover: #ddd;
    --text-heading: #1e1e1e;
    --text-body: #323232;
    --glass-gradient: linear-gradient(-75deg, rgba(255,255,255,0.05), rgba(255,255,255,0.2), rgba(255,255,255,0.05));
    --glass-box-shadow: 
        inset 0 0.125em 0.125em rgba(0,0,0,0.05),
        inset 0 -0.125em 0.125em rgba(255,255,255,0.5),
        0 0.25em 0.125em -0.125em rgba(0,0,0,0.2);
    --glass-box-shadow-hover: 
        inset 0 0.125em 0.125em rgba(0,0,0,0.05),
        inset 0 -0.125em 0.125em rgba(255,255,255,0.5),
        0 0.15em 0.05em -0.1em rgba(0,0,0,0.25);
    --card-shadow-gradient: linear-gradient(180deg, rgba(0,0,0,0.2), rgba(0,0,0,0.1));
    --shadow-blur: 8px;
}
.darkmode {
    --bg-body: #121212;
    --bg-gradient-start: #1e1e1e;
    --bg-gradient-end: #2c2c2c;
    --bg-popup: #1a1a1a;
    --popup-backdrop: rgba(0,0,0,0.7);
    --btn-switch-bg: #00d466;
    --btn-switch-bg-hover: #00a84f;
    --btn-switch-color: #f5f5f5;
    --btn-close-bg: #2a2a2a;
    --btn-close-bg-hover: #3c3c3c;
    --text-heading: #ffffff;
    --text-body: #cccccc;
    --glass-gradient: linear-gradient(-75deg, rgba(255,255,255,0.05), rgba(255,255,255,0.1), rgba(255,255,255,0.05));
    --glass-box-shadow: 
        inset 0 0.125em 0.125em rgba(0,0,0,0.5),
        inset 0 -0.125em 0.125em rgba(255,255,255,0.05),
        0 0.25em 0.125em -0.125em rgba(0,0,0,0.8);
    --glass-box-shadow-hover: 
        inset 0 0.125em 0.125em rgba(0,0,0,0.5),
        inset 0 -0.125em 0.125em rgba(255,255,255,0.05),
        0 0.15em 0.05em -0.1em rgba(0,0,0,0.85);
    --card-shadow-gradient: linear-gradient(180deg, rgba(0,0,0,0.8), rgba(0,0,0,0.6));
    --shadow-blur: 8px;
}

body {
    width: 100%;
    height: 100vh;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background-color: var(--bg-body);
    font-family: "Sometype Mono", monospace;
    -webkit-font-smoothing: antialiased;
    background-image:
        url("data:image/svg+xml,%3Csvg width='30' height='30' viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='2' cy='2' r='1.5' fill='rgba(0,0,0,0.15)'/%3E%3C/svg%3E"),
        linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 75%);
}

#language-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(4px);
    background: var(--popup-backdrop);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

#language-popup .popup-content {
    background: var(--bg-popup);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 5px 25px rgba(0,0,0,0.3);
    max-width: 400px;
    font-family: "Sometype Mono", monospace;
}

#language-popup button {
    margin: 0.5rem;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s ease;
    font-family: "Sometype Mono", monospace;
}

#switch-btn {
    background: var(--btn-switch-bg);
    color: var(--btn-switch-color);
}

#switch-btn:hover {
    background: var(--btn-switch-bg-hover);
}

#close-btn {
    background: var(--btn-close-bg);
}

#close-btn:hover {
    background: var(--btn-close-bg-hover);
}

#theme-switch {
    height: 50px;
    width: 50px;
    padding: 0;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: var(--bg-body);   
    outline: none;
}
#theme-switch svg {
    fill: var(--text-heading)
}
#theme-switch svg:last-child {
    display: none;
}

.darkmode #theme-switch svg:first-child {
    display: none;
}
.darkmode #theme-switch svg:last-child {
    display: block;
}

li {
    color: var(--text-heading);
}
.draggable-item {
    position: absolute;
    z-index: 2;
    border-radius: 20px;
    background: transparent;
    transition: transform var(--hover-t) var(--hover-e), z-index 0s;
    user-select: none;
    touch-action: none;
}

.card-shadow {
    --shadow-fix: 2em;
    position: absolute;
    width: calc(100% + var(--shadow-fix));
    height: calc(100% + var(--shadow-fix));
    top: calc(0% - var(--shadow-fix)/2);
    left: calc(0% - var(--shadow-fix)/2);
    filter: blur(var(--shadow-blur));
    pointer-events: none;
}

.card-shadow::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 20px;
    background: var(--card-shadow-gradient);
    width: calc(100% - var(--shadow-fix) - 0.25em);
    height: calc(100% - var(--shadow-fix) - 0.25em);
    top: calc(var(--shadow-fix) - 0.5em);
    left: calc(var(--shadow-fix) - 0.875em);
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
    transition: all var(--hover-t) var(--hover-e);
}

.glass-surface {
    --border-w: clamp(1px, 0.0625em, 4px);
    all: unset;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    cursor: grab;
    position: relative;
    z-index: 3;
    width: 100%;
    height: 100%;
    background: var(--glass-gradient);
    border-radius: 20px;
    box-shadow: var(--glass-box-shadow);
    backdrop-filter: blur(4px);
    transition: transform var(--hover-t) var(--hover-e), box-shadow var(--hover-t) var(--hover-e);
}

.draggable-item:hover .glass-surface {
    transform: scale(0.99);
    box-shadow: var(--glass-box-shadow-hover);
}

.glass-surface::before {
    content: "";
    position: absolute;
    z-index: 3;
    inset: var(--border-w);
    border-radius: 20px;
    background-size: 200% 200%;
    background-position: 0% 50%;
    mix-blend-mode: screen;
    transition: background-position 500ms var(--hover-e);
}

.draggable-item:hover .glass-surface::before {
    background-position: 25% 50%;
}

.content-wrap {
    position: relative;
    z-index: 4;
    padding: 2rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    pointer-events: none;
}

h2 {
    margin: 0 0 1rem 0;
    font-size: 1.25rem;
    color: var(--text-heading);
}

p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-body);
}

iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.size-ty { width: var(--w-ty); height: var(--h-ty); }
.size-sm { width: var(--w-sm); height: var(--h-sm); }
.size-md { width: var(--w-md); height: var(--h-md); }
.size-lg { width: var(--w-lg); height: var(--h-lg); }
