:root {
    --sai-left: env(safe-area-inset-left, 0px);
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.social-link, .social-link * {
    user-select: text;
    -webkit-user-select: text;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #0a0a0a;
    font-family: 'Inter', system-ui, sans-serif;
}

/* ── Top UI ───────────────────────────────────────────────────────────────── */
.ui-top {
    position: fixed;
    top: max(clamp(10px, 2.5vw, calc(1.2rem + 4px)), env(safe-area-inset-top, 0px));
    left: 0;
    width: 100vw;
    padding: 0 1.5rem;
    z-index: 20;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    white-space: nowrap;
    box-sizing: border-box;
}

.name {
    font-family: 'Clash Display', system-ui, sans-serif;
    font-size: clamp(0.8rem, 2.2vw, 1.25rem);
    font-weight: 340;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.95);
    text-shadow:
        0 2px 8px rgba(0, 0, 0, 0.2),
        0 4px 24px rgba(0, 0, 0, 0.12);
    margin-right: -0.32em;
    filter: blur(0.4px);
}


/* ── Social links ─────────────────────────────────────────────────────────── */
.social {
    position: fixed;
    bottom: max(clamp(10px, 2.5vw, calc(1.2rem + 4px)), env(safe-area-inset-bottom, 0px));
    left: 0;
    width: 100vw;
    padding: 0 1.5rem;
    z-index: 10;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
    white-space: nowrap;
    pointer-events: none;
    box-sizing: border-box;
}

.social-link {
    font-family: 'Clash Display', system-ui, sans-serif;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: clamp(0.75rem, 1.7vw, 0.95rem);
    font-weight: 300;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    transition: color 0.2s ease;
    pointer-events: auto;
}

.social-link:hover { color: #fff; }

.social-link svg {
    width: 1.3em;
    height: 1.3em;
    flex-shrink: 0;
    filter: blur(0.6px) drop-shadow(0 1px 3px rgba(0, 0, 0, 0.4));
}

.social-left {
    justify-self: end;
    justify-content: flex-end;
}

.social-right {
    justify-self: start;
}


#stack {
    position: fixed;
    inset: 0;
    overflow: hidden;
}

.card {
    position: absolute;
    left: var(--card-center-x, 50%);
    top: var(--card-center-y, 50%);
    overflow: visible;
    will-change: transform, opacity;
    touch-action: none;
}

.card-inner {
    width: 100%;
    height: 100%;
    overflow: visible;
    background: #000;
}

.card video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

.card-thumb {
    background: #000;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

.card-label {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    mix-blend-mode: difference;
    font-family: 'Satoshi', system-ui, sans-serif;
    font-size: clamp(2.5rem, 13vw, 6rem);
    font-weight: 750;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
    pointer-events: none;
    user-select: none;
    opacity: 0;
    filter: blur(1.2px);
    animation: label-hue 11s ease-in-out infinite;
}

.card-overlay {
    position: absolute;
    inset: 0;
    background: #000;
    pointer-events: none;
    opacity: 0;
}

.card-label.card-label-info {
    filter: blur(0.8px);
    white-space: normal;
    text-align: center;
}

.card-label.card-label-info.card-label-info-portrait {
    filter: blur(clamp(0.3px, calc(0.15vw - 0.22px), 0.8px));
}


.blush-svg {
    height: clamp(9rem, 38vh, 19rem);
    width: auto;
    display: block;
}

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

@keyframes label-hue {
    0%   { color: rgb(228, 218, 255); }  /* lavender  */
    33%  { color: rgb(212, 255, 228); }  /* mint      */
    66%  { color: rgb(255, 215, 225); }  /* rose      */
    100% { color: rgb(228, 218, 255); }  /* lavender  */
}


/* ── Portrait phone — tighter padding ────────────────────────────────────── */
body.mode-phone-portrait .ui-top {
    top: max(0.75rem, env(safe-area-inset-top, 0px));
    padding: 0 max(1rem, env(safe-area-inset-right, 0px)) 0 max(1rem, env(safe-area-inset-left, 0px));
}
body.mode-phone-portrait .social {
    bottom: max(0.75rem, env(safe-area-inset-bottom, 0px));
    padding: 0 max(1rem, env(safe-area-inset-right, 0px)) 0 max(1rem, env(safe-area-inset-left, 0px));
}


/* ── Landscape phone sidebar ──────────────────────────────────────────────── */
.sidebar {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 52px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.8rem;
    z-index: 20;
    padding-top: env(safe-area-inset-top, 0px);
    padding-right: env(safe-area-inset-right, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    pointer-events: none;
}

.sidebar-name {
    font-family: 'Clash Display', system-ui, sans-serif;
    font-size: clamp(0.65rem, 1.4vw, 0.85rem);
    font-weight: 340;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.95);
    filter: blur(0.4px);
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    white-space: nowrap;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.sidebar-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.9rem;
    pointer-events: auto;
}

.sidebar-link {
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    transition: color 0.2s ease;
    display: flex;
}

.sidebar-link:hover { color: #fff; }

.sidebar-link svg {
    width: 1.15rem;
    height: 1.15rem;
    filter: blur(0.4px) drop-shadow(0 1px 3px rgba(0, 0, 0, 0.4));
}

body.mode-landscape-phone .ui-top,
body.mode-landscape-phone .social {
    display: none;
}

body.mode-landscape-phone .sidebar {
    display: flex;
}


/* ── Squished mode ────────────────────────────────────────────────────────── */
.squished-name {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Clash Display', system-ui, sans-serif;
    font-size: clamp(0.9rem, 4vw, 1.3rem);
    font-weight: 340;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), 0 4px 24px rgba(0, 0, 0, 0.12);
    filter: blur(0.4px);
    white-space: nowrap;
    z-index: 30;
    pointer-events: none;
}

body.mode-squished .ui-top,
body.mode-squished .social,
body.mode-squished .sidebar {
    display: none;
}

body.mode-squished .squished-name {
    display: block;
}

body.mode-squished #stack {
    pointer-events: none;
}

body.mode-squished .card-label {
    display: none;
}

body.mode-squished [data-stack-idx="0"] {
    opacity: 0 !important;
}
