:root {
    --bg-top: #fffafc;
    --bg-bottom: #f9e1ea;
    --surface: rgba(255, 255, 255, 0.9);
    --text: #21161d;
    --muted: #876b78;
    --accent: #c2386c;
    --accent-deep: #701b39;
    --accent-warm: #d98a78;
    --magic-gold: #e8b96d;
    --icon-accent: #b73267;
    --icon-accent-deep: #8d244d;
    --accent-soft: #f8dfe8;
    --accent-soft-2: #f3cfdc;
    --glass-stroke: rgba(255, 255, 255, 0.82);
    --shadow-card: 0 18px 38px rgba(151, 64, 101, 0.12);
    --shadow-soft: 0 20px 55px rgba(196, 103, 136, 0.1);
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    font-family: 'Manrope', sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 15% 8%, rgba(255, 255, 255, 0.98), transparent 34%),
        radial-gradient(circle at 88% 18%, rgba(255, 241, 218, 0.72), transparent 30%),
        radial-gradient(circle at bottom right, rgba(250, 211, 226, 0.84), transparent 36%),
        linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
    overflow-x: hidden;
    position: relative;
    isolation: isolate;
    text-rendering: optimizeLegibility;
}

body::before,
body::after {
    content: "";
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(18px);
    z-index: 0;
}

body::before {
    width: 220px;
    height: 220px;
    top: -70px;
    right: -60px;
    background: rgba(255, 255, 255, 0.8);
    animation: ambientGlow 12s ease-in-out infinite alternate;
}

body::after {
    width: 260px;
    height: 260px;
    left: -120px;
    bottom: -130px;
    background: rgba(247, 214, 226, 0.72);
    animation: ambientGlow 15s ease-in-out infinite alternate-reverse;
}

#petalCanvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 0.78;
    contain: strict;
}

.magic-background,
.magic-background span {
    pointer-events: none;
}

.magic-background {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    contain: layout paint style;
}

.magic-background::before {
    content: "";
    position: absolute;
    inset: -22%;
    background:
        conic-gradient(from 130deg at 50% 50%, rgba(255, 255, 255, 0), rgba(232, 185, 109, 0.2), rgba(226, 116, 156, 0.16), rgba(255, 255, 255, 0), rgba(255, 238, 209, 0.22), rgba(255, 255, 255, 0));
    filter: blur(44px);
    opacity: 0.48;
    transform-origin: 52% 48%;
    animation: auroraBreath 18s ease-in-out infinite alternate;
    will-change: transform, opacity;
}

.magic-background::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 18% 22%, rgba(255, 255, 255, 0.78) 0, rgba(255, 255, 255, 0.78) 1px, transparent 2px),
        radial-gradient(circle at 78% 28%, rgba(255, 237, 199, 0.7) 0, rgba(255, 237, 199, 0.7) 1px, transparent 2px),
        radial-gradient(circle at 64% 72%, rgba(255, 255, 255, 0.62) 0, rgba(255, 255, 255, 0.62) 1px, transparent 2px),
        radial-gradient(circle at 32% 64%, rgba(246, 176, 203, 0.56) 0, rgba(246, 176, 203, 0.56) 1px, transparent 2px);
    opacity: 0.56;
    animation: stardustPulse 7s ease-in-out infinite;
    will-change: transform, opacity;
}

.magic-orb,
.magic-ring,
.magic-spark {
    position: absolute;
    display: block;
}

.magic-orb {
    border-radius: 50%;
    filter: blur(2px);
    opacity: 0.5;
    mix-blend-mode: screen;
    background: radial-gradient(circle at 32% 30%, rgba(255, 255, 255, 0.96), rgba(255, 232, 191, 0.72) 28%, rgba(230, 109, 152, 0.18) 66%, rgba(230, 109, 152, 0) 100%);
    will-change: transform;
}

.magic-orb-1 {
    width: 170px;
    height: 170px;
    left: 6%;
    top: 14%;
    animation: orbFloat 17s ease-in-out infinite;
}

.magic-orb-2 {
    width: 230px;
    height: 230px;
    right: -70px;
    top: 30%;
    opacity: 0.34;
    animation: orbFloat 22s ease-in-out infinite reverse;
}

.magic-orb-3 {
    width: 150px;
    height: 150px;
    left: 58%;
    bottom: 4%;
    opacity: 0.4;
    animation: orbFloatSmall 19s ease-in-out infinite;
}

.magic-ring {
    border-radius: 50%;
    border: 1px solid rgba(232, 185, 109, 0.22);
    box-shadow:
        inset 0 0 26px rgba(255, 255, 255, 0.36),
        0 0 34px rgba(232, 185, 109, 0.12);
    opacity: 0.5;
    transform-origin: center;
    will-change: transform;
}

.magic-ring::before {
    content: "";
    position: absolute;
    inset: 18%;
    border-radius: inherit;
    border: 1px solid rgba(194, 56, 108, 0.12);
}

.magic-ring-1 {
    width: 360px;
    height: 360px;
    right: -150px;
    top: -90px;
    animation: ringDrift 28s linear infinite;
}

.magic-ring-2 {
    width: 280px;
    height: 280px;
    left: -120px;
    bottom: 2%;
    animation: ringDrift 34s linear infinite reverse;
}

.magic-spark {
    left: var(--x);
    top: var(--y);
    width: 16px;
    height: 16px;
    opacity: 0;
    transform: translate(-50%, -50%) scale(var(--s));
    animation: sparkTwinkle 5.8s ease-in-out var(--d) infinite;
    will-change: transform, opacity;
}

.magic-spark::before,
.magic-spark::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(232, 185, 109, 0.64));
    box-shadow: 0 0 14px rgba(232, 185, 109, 0.34);
    transform: translate(-50%, -50%);
}

.magic-spark::before {
    width: 2px;
    height: 16px;
}

.magic-spark::after {
    width: 16px;
    height: 2px;
}

.icon-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

svg {
    width: 100%;
    height: 100%;
}

svg path,
svg circle,
svg rect,
svg ellipse {
    vector-effect: non-scaling-stroke;
}

.intro-overlay {
    position: fixed;
    inset: 0;
    z-index: 10;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at center, rgba(255, 255, 255, 0.96), rgba(254, 242, 247, 0.95) 45%, rgba(249, 224, 234, 0.94) 100%);
    transition: opacity 0.8s ease, transform 0.8s ease;
    will-change: opacity, transform;
}

.intro-overlay.fade-out {
    opacity: 0;
    transform: scale(1.02);
    pointer-events: none;
}

.intro-scene {
    width: min(84vw, 360px);
    min-height: 220px;
    display: grid;
    place-items: center;
    position: relative;
}

.intro-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(10px);
    opacity: 0;
    animation: introGlowIn 1.1s ease forwards;
}

.intro-glow-1 {
    width: 250px;
    height: 140px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.96) 0%, rgba(249, 227, 236, 0.82) 52%, rgba(249, 227, 236, 0) 100%);
    animation-delay: 0.06s;
}

.intro-glow-2 {
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.88) 0%, rgba(251, 236, 242, 0.58) 58%, rgba(251, 236, 242, 0) 100%);
    animation-delay: 0.22s;
}

.intro-wordmark {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
    animation: introWordmarkBloom 1.15s var(--ease-out) forwards;
    will-change: transform, opacity, filter;
}

.intro-kicker {
    font-size: 0.7rem;
    letter-spacing: 0.34em;
    text-transform: uppercase;
    color: rgba(194, 56, 108, 0.56);
    margin-bottom: 10px;
    opacity: 0;
    transform: translateY(8px);
    animation: introKickerIn 0.65s var(--ease-out) forwards 0.1s;
}

.intro-title {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.16em;
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(3.8rem, 15vw, 6.2rem);
    line-height: 0.9;
    letter-spacing: 0;
    color: #5b182a;
    text-shadow:
        0 12px 28px rgba(152, 63, 98, 0.12),
        0 0 24px rgba(232, 185, 109, 0.12);
    white-space: nowrap;
}

.intro-subtitle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.52em;
    margin-top: 8px;
    font-size: 1rem;
    letter-spacing: 0;
    color: rgba(194, 56, 108, 0.8);
    text-transform: lowercase;
    white-space: nowrap;
}

.intro-title span,
.intro-subtitle span {
    display: inline-block;
    opacity: 0;
    transform: translateY(22px) scale(0.88);
    filter: blur(8px);
}

.intro-title span {
    animation: introLetterIn 0.78s var(--ease-out) forwards;
    animation-delay: calc(0.16s + var(--i) * 0.11s);
}

.intro-subtitle span {
    animation: introLetterInSoft 0.7s var(--ease-out) forwards;
    animation-delay: calc(0.62s + var(--i) * 0.06s);
}

.intro-line {
    width: 0;
    height: 1px;
    margin-top: 16px;
    background: linear-gradient(90deg, rgba(194, 56, 108, 0), rgba(194, 56, 108, 0.58), rgba(194, 56, 108, 0));
    opacity: 0;
    animation: introLineIn 0.72s var(--ease-out) forwards 0.8s;
}

.main-content {
    position: relative;
    z-index: 2;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.7s ease, transform 0.7s var(--ease-out);
    will-change: opacity, transform;
}

.main-content.visible {
    opacity: 1;
    transform: translateY(0);
}

.taplink-shell {
    width: min(100%, 520px);
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0 auto;
    padding: 36px 18px 42px;
}

.profile {
    text-align: center;
    padding-top: 18px;
}

.brand-title {
    display: flex;
    justify-content: center;
    gap: 0.12em;
    margin: 0;
    font-family: 'Cormorant Garamond', serif;
    font-size: 3.85rem;
    line-height: 0.9;
    letter-spacing: 0;
    color: #5d172a;
    text-shadow:
        0 14px 28px rgba(152, 63, 98, 0.1),
        0 0 22px rgba(232, 185, 109, 0.1);
}

.brand-subtitle {
    display: flex;
    justify-content: center;
    gap: 0.42em;
    margin: -2px 0 0;
    font-size: 0.98rem;
    letter-spacing: 0;
    color: var(--accent);
}

.brand-title span,
.brand-subtitle span {
    display: inline-block;
    opacity: 0;
    transform: translateY(18px) scale(0.9);
    filter: blur(8px);
    will-change: transform, opacity, filter;
}

.brand-title span {
    animation-delay: calc(0.08s + var(--i) * 0.08s);
}

.brand-subtitle span {
    animation-delay: calc(0.34s + var(--i) * 0.045s);
}

.brand-copy {
    margin: 16px auto 0;
    max-width: 320px;
    color: var(--muted);
    font-size: 0.97rem;
    line-height: 1.55;
    opacity: 0;
    transform: translateY(10px);
    filter: blur(5px);
    will-change: transform, opacity, filter;
}

.main-content.visible .brand-title span {
    animation-name: brandLetterIn;
    animation-duration: 0.72s;
    animation-timing-function: var(--ease-out);
    animation-fill-mode: forwards;
}

.main-content.visible .brand-subtitle span {
    animation-name: brandLetterInSoft;
    animation-duration: 0.62s;
    animation-timing-function: var(--ease-out);
    animation-fill-mode: forwards;
}

.main-content.visible .brand-copy {
    animation: brandCopyIn 0.68s var(--ease-out) forwards 0.56s;
}

.main-content.settled,
.main-content.settled .brand-title span,
.main-content.settled .brand-subtitle span,
.main-content.settled .brand-copy,
.main-content.settled .link-card {
    will-change: auto;
}

.links-list {
    margin-top: 28px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.link-card {
    display: grid;
    grid-template-columns: 68px 1fr;
    align-items: center;
    gap: 8px;
    min-height: 88px;
    padding: 12px 18px 12px 12px;
    border-radius: 999px;
    position: relative;
    overflow: hidden;
    isolation: isolate;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 248, 251, 0.94)),
        rgba(255, 255, 255, 0.97);
    border: 1px solid var(--glass-stroke);
    box-shadow: var(--shadow-card);
    text-decoration: none;
    color: inherit;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    opacity: 0;
    transform: translateY(20px);
    transition: transform 0.32s var(--ease-out), box-shadow 0.32s ease, border-color 0.32s ease;
    backface-visibility: hidden;
    will-change: transform, opacity, filter;
}

.link-card::before {
    content: "";
    position: absolute;
    inset: 1px;
    z-index: 0;
    border-radius: inherit;
    background:
        linear-gradient(105deg, transparent 0 30%, rgba(255, 255, 255, 0.78) 45%, transparent 62%),
        radial-gradient(circle at 12% 50%, rgba(232, 185, 109, 0.15), transparent 34%);
    opacity: 0.42;
    transform: translateX(-22%);
    transition: opacity 0.32s ease, transform 0.45s var(--ease-out);
}

.link-icon,
.link-body {
    position: relative;
    z-index: 1;
}

.link-card:active {
    transform: scale(0.985);
}

.main-content.visible .link-card {
    animation: linkReveal 0.68s var(--ease-out) forwards;
    animation-delay: calc(0.68s + var(--i) * 0.11s);
}

.link-icon {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    position: relative;
    overflow: hidden;
    isolation: isolate;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at 34% 25%, rgba(255, 255, 255, 0.98), rgba(255, 243, 247, 0.72) 38%, rgba(247, 217, 228, 0.78) 100%),
        linear-gradient(145deg, #fbedf2 0%, #f5d8e3 100%);
    color: var(--icon-accent);
    border: 1px solid rgba(194, 56, 108, 0.08);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.86),
        inset 0 -10px 24px rgba(194, 56, 108, 0.06),
        0 12px 26px rgba(151, 64, 101, 0.1);
    transition: transform 0.32s var(--ease-out), color 0.32s ease, box-shadow 0.32s ease;
}

.link-icon::before {
    content: "";
    position: absolute;
    inset: -20%;
    z-index: 0;
    background: conic-gradient(from 20deg, rgba(255, 255, 255, 0), rgba(232, 185, 109, 0.34), rgba(255, 255, 255, 0), rgba(194, 56, 108, 0.18), rgba(255, 255, 255, 0));
    opacity: 0.72;
    animation: iconHalo 8s linear infinite;
    will-change: transform;
}

.link-icon::after {
    content: "";
    position: absolute;
    inset: 7px;
    z-index: 1;
    border-radius: inherit;
    border: 1px solid rgba(255, 255, 255, 0.58);
    box-shadow: inset 0 0 14px rgba(255, 255, 255, 0.34);
}

.link-icon svg {
    width: 28px;
    height: 28px;
    display: block;
    position: relative;
    z-index: 2;
    stroke: currentColor;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 4px 8px rgba(141, 36, 77, 0.1));
}

.link-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.link-label {
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #c17a96;
}

.link-value {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #2a1a21;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (hover: hover) {
    .link-card:hover {
        transform: translateY(-3px);
        border-color: rgba(255, 255, 255, 0.96);
        box-shadow: 0 24px 46px rgba(151, 64, 101, 0.16);
    }

    .link-card:hover::before {
        opacity: 0.88;
        transform: translateX(8%);
    }

    .link-card:hover .link-icon {
        color: var(--icon-accent-deep);
        transform: translateY(-1px) rotate(-2deg);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.92),
            inset 0 -10px 24px rgba(194, 56, 108, 0.08),
            0 16px 30px rgba(151, 64, 101, 0.15);
    }
}

@keyframes ambientGlow {
    from {
        transform: translate3d(0, 0, 0) scale(1);
        opacity: 0.72;
    }
    to {
        transform: translate3d(16px, 12px, 0) scale(1.08);
        opacity: 0.95;
    }
}

@keyframes auroraBreath {
    from {
        transform: rotate(-8deg) scale(1);
        opacity: 0.34;
    }
    50% {
        transform: rotate(7deg) scale(1.05);
        opacity: 0.52;
    }
    to {
        transform: rotate(14deg) scale(1.1);
        opacity: 0.42;
    }
}

@keyframes stardustPulse {
    0%, 100% {
        transform: translateY(0);
        opacity: 0.36;
    }
    50% {
        transform: translateY(-10px);
        opacity: 0.68;
    }
}

@keyframes orbFloat {
    0%, 100% {
        transform: translate3d(0, 0, 0) scale(1);
    }
    50% {
        transform: translate3d(28px, -18px, 0) scale(1.08);
    }
}

@keyframes orbFloatSmall {
    0%, 100% {
        transform: translate3d(0, 0, 0) scale(0.96);
    }
    50% {
        transform: translate3d(-22px, -30px, 0) scale(1.08);
    }
}

@keyframes ringDrift {
    from {
        transform: rotate(0deg) translate3d(0, 0, 0);
    }
    to {
        transform: rotate(360deg) translate3d(18px, -12px, 0);
    }
}

@keyframes sparkTwinkle {
    0%, 100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(calc(var(--s) * 0.7)) rotate(0deg);
    }
    28% {
        opacity: 0.78;
    }
    50% {
        opacity: 0.34;
        transform: translate(-50%, calc(-50% - 12px)) scale(var(--s)) rotate(45deg);
    }
    72% {
        opacity: 0.9;
    }
}

@keyframes iconHalo {
    to {
        transform: rotate(360deg);
    }
}

@keyframes introWordmarkBloom {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.92);
        filter: blur(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

@keyframes introGlowIn {
    from {
        opacity: 0;
        transform: scale(0.88);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes introKickerIn {
    from {
        opacity: 0;
        transform: translateY(8px);
        filter: blur(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

@keyframes introLetterIn {
    from {
        opacity: 0;
        transform: translateY(22px) scale(0.88);
        filter: blur(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

@keyframes introLetterInSoft {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.94);
        filter: blur(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

@keyframes introLineIn {
    from {
        width: 0;
        opacity: 0;
    }
    to {
        width: 132px;
        opacity: 1;
    }
}

@keyframes linkReveal {
    from {
        opacity: 0;
        transform: translateY(22px) scale(0.985);
        filter: blur(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

@keyframes brandLetterIn {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.9);
        filter: blur(9px);
    }
    68% {
        opacity: 1;
        transform: translateY(-3px) scale(1.04);
        filter: blur(0);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

@keyframes brandLetterInSoft {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.92);
        filter: blur(7px);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

@keyframes brandCopyIn {
    from {
        opacity: 0;
        transform: translateY(10px);
        filter: blur(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

@media (min-width: 720px) {
    body {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 24px;
    }

    .taplink-shell {
        min-height: auto;
        border-radius: 34px;
        background: linear-gradient(180deg, rgba(255, 250, 252, 0.72) 0%, rgba(250, 231, 239, 0.66) 100%);
        border: 1px solid rgba(255, 255, 255, 0.75);
        box-shadow: 0 28px 80px rgba(194, 103, 136, 0.14);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }
}

@media (max-width: 440px) {
    .taplink-shell {
        padding-inline: 14px;
        padding-top: 28px;
    }

    .brand-title {
        font-size: 3.3rem;
    }

    .link-card {
        grid-template-columns: 62px 1fr;
        gap: 8px;
        min-height: 80px;
        padding: 10px 16px 10px 10px;
    }

    .link-icon {
        width: 54px;
        height: 54px;
    }

    .link-icon svg {
        width: 26px;
        height: 26px;
    }

    .link-value {
        font-size: 0.95rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .intro-overlay {
        display: none;
    }

    .main-content,
    .link-card,
    .brand-copy {
        opacity: 1;
        transform: none;
        filter: none;
    }

    .intro-title span,
    .intro-subtitle span,
    .brand-title span,
    .brand-subtitle span,
    .intro-kicker,
    .intro-line {
        opacity: 1;
        transform: none;
        filter: none;
    }
}
