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

:root {
    --bg:     #ffffff;
    --bg-2:   #f7f7fb;
    --ink:    #1a1b4e;
    --muted:  rgba(26, 27, 78, 0.55);
    --line:   rgba(26, 27, 78, 0.12);
    --purple: #6c5ce7;
    --purple-deep: #5444c7;
    --coral:  #f47a76;
    --coral-deep: #e0625e;
    --yellow: #ffcd40;
    --navy:   #1a1b4e;
}

html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--ink);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.back-link {
    position: fixed;
    bottom: 0.75rem;
    left: 0.75rem;
    z-index: 1000;
    color: var(--ink);
    text-decoration: none;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    padding: 0.45rem 0.9rem;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 999px;
    box-shadow: 0 4px 12px rgba(26, 27, 78, 0.1);
    opacity: 0.85;
    transition: opacity 0.3s, transform 0.3s;
}
.back-link:hover { opacity: 1; transform: translateY(-2px); }

/* =========================================================
   LOADER — Rotating discount badge
   ========================================================= */
.loader {
    position: fixed;
    inset: 0;
    z-index: 999;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
}

.loader__stage {
    position: relative;
    width: 220px;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loader__dashed {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    will-change: transform;
}
#loader-dashed {
    stroke-dasharray: 8 8;
    transform-origin: center;
}

.loader__badge {
    position: relative;
    width: 120px; height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f47a76 0%, #e0625e 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.1rem;
    box-shadow: 0 20px 40px rgba(244, 122, 118, 0.4);
    z-index: 2;
    will-change: transform;
    line-height: 1;
}
.loader__badge-pct {
    font-weight: 800;
    font-size: 2rem;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}
.loader__badge-symbol {
    font-weight: 700;
    font-size: 1.4rem;
    margin-top: -0.5rem;
}
.loader__badge-off {
    font-weight: 800;
    font-size: 0.85rem;
    letter-spacing: 0.15em;
    margin-top: 0.2rem;
}

.loader__sparkles {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.loader__sparkles span {
    position: absolute;
    color: var(--yellow);
    font-size: 18px;
    will-change: transform, opacity;
    filter: drop-shadow(0 0 6px rgba(255, 205, 64, 0.6));
}

.loader__meta {
    display: flex;
    gap: 1.25rem;
    align-items: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.3em;
    color: var(--muted);
    text-transform: uppercase;
}
.loader__counter {
    color: var(--coral);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    min-width: 3ch;
}

/* =========================================================
   CARTLY SECTION
   ========================================================= */
.cartly {
    position: relative;
    width: 100%;
    min-height: 100vh;
    overflow: hidden;
    background: var(--bg);
    padding-bottom: 3rem;
}

/* ---------- Top nav ---------- */
.topnav {
    position: relative;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 1.5rem 3rem;
}

.topnav__logo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--ink);
    font-weight: 800;
    font-size: 1.3rem;
    letter-spacing: -0.01em;
    will-change: transform;
}
.topnav__logo-mark { width: 32px; height: 28px; }
.topnav__logo-mark svg { width: 100%; height: 100%; display: block; }

.topnav__links {
    display: flex;
    gap: 2rem;
    margin-left: 1.5rem;
}
.topnav__links a {
    position: relative;
    color: var(--ink);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.3rem 0;
    will-change: transform;
}
.topnav__links a::after {
    content: '';
    position: absolute;
    left: 0; bottom: 0;
    width: 100%; height: 2px;
    background: var(--purple);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s cubic-bezier(0.65, 0, 0.35, 1);
    border-radius: 2px;
}
.topnav__links a:hover::after { transform: scaleX(1); transform-origin: left; }

.topnav__actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.topnav__search {
    display: flex;
    align-items: center;
    background: var(--bg-2);
    border-radius: 8px;
    padding: 0.25rem;
    transition: box-shadow 0.3s;
    width: 280px;
}
.topnav__search:focus-within {
    box-shadow: 0 0 0 2px rgba(108, 92, 231, 0.3);
}
.topnav__search-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    color: var(--ink);
    font-family: inherit;
    outline: none;
    min-width: 0;
}
.topnav__search-input::placeholder { color: var(--muted); }
.topnav__search-btn {
    width: 38px; height: 38px;
    background: var(--purple);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    will-change: transform;
    transition: background 0.3s;
}
.topnav__search-btn svg { width: 16px; height: 16px; }
.topnav__search-btn:hover { background: var(--purple-deep); }

.topnav__login {
    color: var(--ink);
    text-decoration: none;
    padding: 0.65rem 1.5rem;
    border: 1.5px solid var(--line);
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    will-change: transform;
    transition: background 0.3s, color 0.3s, border-color 0.3s;
}
.topnav__login:hover {
    background: var(--ink);
    color: var(--bg);
    border-color: var(--ink);
}

/* ---------- Side arrows ---------- */
.side-arrow {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 40;
    width: 48px; height: 48px;
    background: var(--bg);
    border: 1.5px solid var(--line);
    color: var(--ink);
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 16px rgba(26, 27, 78, 0.08);
    will-change: transform;
    transition: background 0.3s, color 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.side-arrow svg { width: 18px; height: 18px; transition: transform 0.3s; }
.side-arrow--left  { left: 1.25rem; }
.side-arrow--right { right: 1.25rem; }
.side-arrow:hover {
    background: var(--purple);
    color: #fff;
    border-color: var(--purple);
    box-shadow: 0 10px 22px rgba(108, 92, 231, 0.35);
}
.side-arrow--left:hover svg  { transform: translateX(-3px); }
.side-arrow--right:hover svg { transform: translateX(3px); }

/* ---------- Hero ---------- */
.hero {
    position: relative;
    z-index: 10;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    padding: 3rem 5rem 2rem;
    align-items: center;
}

.hero__left { max-width: 560px; padding-left: 2rem; }

.hero__title {
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    font-size: clamp(2rem, 4vw, 3.25rem);
    line-height: 1.15;
    letter-spacing: -0.015em;
    color: var(--navy);
    margin-bottom: 1.75rem;
}
.hero__title .hl-coral {
    color: var(--coral);
    display: inline;
    will-change: transform;
}
.hero__word {
    display: inline-block;
    white-space: nowrap;
    margin-right: 0.25em;
}
.hero__char {
    display: inline-block;
    will-change: transform, color;
    transition: color 0.3s ease;
}

.hero__desc {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--muted);
    margin-bottom: 2rem;
    max-width: 420px;
}

.cta-pill {
    display: inline-block;
    background: var(--purple);
    color: #fff;
    text-decoration: none;
    padding: 1rem 2.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 10px 22px rgba(108, 92, 231, 0.35);
    will-change: transform;
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.3s;
}
.cta-pill span { position: relative; z-index: 2; }
.cta-pill::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--purple-deep);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.5s cubic-bezier(0.65, 0, 0.35, 1);
    z-index: 1;
}
.cta-pill:hover::before { transform: scaleX(1); transform-origin: left; }
.cta-pill:hover { box-shadow: 0 15px 30px rgba(108, 92, 231, 0.45); }

/* ---------- Right stage ---------- */
.hero__right {
    position: relative;
    min-height: 520px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.deco-ring {
    position: absolute;
    top: 0; left: 10%;
    right: 0;
    width: 90%;
    height: 90%;
    will-change: transform;
    z-index: 1;
}
#deco-ring {
    transform-origin: 250px 250px;
}

.deco-curve {
    position: absolute;
    left: -4%;
    top: 25%;
    width: 120px;
    height: 280px;
    z-index: 2;
    will-change: transform;
}
#deco-curve { stroke-dasharray: 8 8; }

.portrait {
    position: relative;
    z-index: 3;
    width: 100%;
    max-width: 440px;
    height: 500px;
    overflow: hidden;
    will-change: transform;
    mask-image: radial-gradient(ellipse at center top, #000 55%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse at center top, #000 55%, transparent 100%);
}
.portrait img {
    width: 100%; height: 100%;
    object-fit: cover;
    object-position: center 25%;
    user-select: none;
    transition: transform 0.8s ease;
}

.discount-badge {
    position: absolute;
    top: 12%;
    right: 5%;
    z-index: 5;
    width: 110px; height: 110px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--coral) 0%, var(--coral-deep) 100%);
    color: #fff;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.5rem;
    line-height: 1;
    letter-spacing: -0.01em;
    box-shadow: 0 15px 30px rgba(244, 122, 118, 0.45);
    will-change: transform;
}
.discount-badge em {
    font-style: normal;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.15em;
    margin-top: 0.2rem;
}

/* ---------- Stats card ---------- */
.stats-card {
    position: absolute;
    bottom: 5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem 2rem;
    box-shadow: 0 20px 50px rgba(26, 27, 78, 0.12);
    gap: 2rem;
    min-width: 460px;
    will-change: transform;
}
.stats-card__cell {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 90px;
}
.stats-card__label {
    font-size: 0.75rem;
    color: var(--muted);
    font-weight: 500;
}
.stats-card__num {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}
.stats-card__num--coral { color: var(--coral); }
.stats-card__divider {
    width: 1px;
    height: 34px;
    background: var(--line);
}

/* ---------- Dots ---------- */
.dots {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    display: flex;
    gap: 0.4rem;
}
.dots span {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: rgba(26, 27, 78, 0.2);
    cursor: pointer;
    transition: background 0.3s, width 0.3s;
}
.dots span.is-active {
    background: var(--purple);
    width: 30px;
    border-radius: 4px;
}

/* ---------- Initial states ---------- */
[data-magnetic], [data-link], [data-desc], [data-cta], [data-portrait], [data-badge],
[data-stats], [data-dots], [data-stage] > svg {
    opacity: 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .topnav { padding: 1.25rem 1.5rem; gap: 1rem; flex-wrap: wrap; }
    .topnav__links { display: none; }
    .topnav__search { width: 200px; }
    .hero { grid-template-columns: 1fr; padding: 2rem 1.5rem; gap: 2rem; }
    .hero__left { padding-left: 0; max-width: 100%; }
    .hero__right { min-height: 400px; }
    .portrait { max-width: 320px; height: 380px; }
    .stats-card { bottom: 4rem; min-width: 360px; padding: 1rem 1.5rem; gap: 1rem; }
}
@media (max-width: 760px) {
    .topnav__search { width: 100%; order: 3; }
    .topnav__login { order: 4; }
    .hero__title { font-size: clamp(1.6rem, 7vw, 2.5rem); }
    .portrait { max-width: 240px; height: 300px; }
    .discount-badge { width: 80px; height: 80px; font-size: 1.1rem; top: 5%; right: 0; }
    .stats-card { min-width: calc(100% - 3rem); padding: 0.85rem 1rem; gap: 0.75rem; }
    .stats-card__num { font-size: 1rem; }
    .stats-card__label { font-size: 0.65rem; }
    .stats-card__cell { min-width: 70px; }
    .deco-curve { display: none; }
}
@media (max-width: 480px) {
    .side-arrow { width: 40px; height: 40px; }
    .stats-card { gap: 0.4rem; padding: 0.65rem 0.75rem; }
    .stats-card__divider { height: 24px; }
    .stats-card__num { font-size: 0.85rem; }
    .stats-card__cell { min-width: 56px; }
}
