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

:root {
    --bg:     #080808;
    --bg-2:   #0a0a0a;
    --ink:    #e8dfd0;
    --muted:  rgba(232, 223, 208, 0.55);
    --lime:   #c4f52d;
    --lime-deep: #9fcf1f;
    --line:   rgba(255, 255, 255, 0.08);
    --cream:  #e8dfd0;
}

html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--ink);
    overflow: hidden;
    cursor: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
@media (hover: none), (pointer: coarse) { html, body { cursor: auto; } }

.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: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    backdrop-filter: blur(8px);
    cursor: none;
    opacity: 0.85;
    transition: opacity 0.3s, transform 0.3s;
}
.back-link:hover { opacity: 1; transform: translateY(-2px); }

/* =========================================================
   CUSTOM CURSOR
   ========================================================= */
.cursor-dot, .cursor-ring {
    position: fixed;
    top: 0; left: 0;
    pointer-events: none;
    z-index: 10000;
    transform: translate(-50%, -50%);
    will-change: transform;
}
.cursor-dot {
    width: 5px; height: 5px;
    background: var(--lime);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--lime);
}
.cursor-ring {
    width: 32px; height: 32px;
    border: 1px solid rgba(196, 245, 45, 0.5);
    border-radius: 50%;
    transition: width 0.3s, height 0.3s, border-color 0.3s, background 0.3s;
}
.cursor-ring.is-hover {
    width: 56px; height: 56px;
    border-color: var(--lime);
    background: rgba(196, 245, 45, 0.08);
}
@media (hover: none), (pointer: coarse) { .cursor-dot, .cursor-ring { display: none; } }

/* =========================================================
   LOADER — Sparkle + stroke-draw "N"
   ========================================================= */
.loader {
    position: fixed;
    inset: 0;
    z-index: 999;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2.5rem;
    overflow: hidden;
}

.loader__grid {
    position: absolute;
    inset: 0;
    background-image:
        repeating-linear-gradient(0deg, transparent 0, transparent 80px, rgba(196, 245, 45, 0.04) 80px, rgba(196, 245, 45, 0.04) 81px),
        repeating-linear-gradient(90deg, transparent 0, transparent 80px, rgba(196, 245, 45, 0.04) 80px, rgba(196, 245, 45, 0.04) 81px);
    opacity: 0;
}

.loader__stage {
    position: relative;
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}
.loader__mark {
    width: 130px;
    height: 130px;
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 0 12px rgba(196, 245, 45, 0.5));
}
#loader-N {
    stroke-dasharray: 250;
    stroke-dashoffset: 250;
}

.loader__sparkles {
    position: absolute;
    inset: -30px;
    pointer-events: none;
}
.loader__sparkles span {
    position: absolute;
    font-size: 24px;
    color: var(--lime);
    will-change: transform, opacity;
    text-shadow: 0 0 10px rgba(196, 245, 45, 0.6);
}

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

/* =========================================================
   NEXA SECTION
   ========================================================= */
.nexa {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 780px;
    overflow: hidden;
    background: var(--bg);
}

.nexa__grid {
    position: absolute;
    inset: 0;
    background-image:
        repeating-linear-gradient(0deg, transparent 0, transparent 80px, rgba(196, 245, 45, 0.025) 80px, rgba(196, 245, 45, 0.025) 81px),
        repeating-linear-gradient(90deg, transparent 0, transparent 80px, rgba(196, 245, 45, 0.025) 80px, rgba(196, 245, 45, 0.025) 81px);
    z-index: 1;
    pointer-events: none;
}

/* ---------- Top nav ---------- */
.topnav {
    position: relative;
    z-index: 30;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 2rem;
    align-items: center;
    padding: 1.5rem 3rem;
}

.topnav__logo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--ink);
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -0.01em;
    cursor: none;
    will-change: transform;
    justify-self: flex-start;
}
.topnav__logo-mark {
    width: 36px; height: 36px;
    background: rgba(196, 245, 45, 0.06);
    border: 1px solid rgba(196, 245, 45, 0.3);
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 0 6px rgba(196, 245, 45, 0.3));
}
.topnav__logo-mark svg { width: 70%; height: 70%; }

.topnav__pill {
    display: inline-flex;
    align-items: center;
    gap: 0;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.35rem;
    backdrop-filter: blur(10px);
    justify-self: center;
}
.topnav__pill a {
    position: relative;
    color: var(--muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.65rem 1.4rem;
    cursor: none;
    will-change: transform;
    border-radius: 999px;
    transition: color 0.3s, background 0.3s;
}
.topnav__pill a.is-active { color: var(--ink); background: rgba(255, 255, 255, 0.08); }
.topnav__pill a:hover { color: var(--ink); }

.topnav__actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-self: flex-end;
}
.topnav__signup {
    color: var(--muted);
    text-decoration: none;
    padding: 0.6rem 1.2rem;
    font-weight: 500;
    font-size: 0.95rem;
    cursor: none;
    will-change: transform;
    transition: color 0.3s;
}
.topnav__signup:hover { color: var(--ink); }

.topnav__login {
    background: transparent;
    color: var(--ink);
    text-decoration: none;
    padding: 0.65rem 1.5rem;
    border-radius: 999px;
    font-weight: 500;
    font-size: 0.95rem;
    cursor: none;
    will-change: transform;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: background 0.3s, border-color 0.3s;
}
.topnav__login:hover {
    background: var(--lime);
    color: var(--bg);
    border-color: var(--lime);
}

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

.hero__left {
    position: relative;
    padding-top: 1rem;
}

.hero__title {
    font-family: 'Fraunces', serif;
    font-weight: 500;
    font-size: clamp(2.4rem, 5.8vw, 5.25rem);
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--cream);
    margin-bottom: 2.25rem;
    font-style: italic;
}
.hero__line {
    display: block;
    overflow: hidden;
    padding-bottom: 0.04em;
    white-space: nowrap;
}
.hero__star {
    color: var(--lime);
    font-style: normal;
    margin: 0 0.1em;
    display: inline-block;
    will-change: transform;
    filter: drop-shadow(0 0 10px rgba(196, 245, 45, 0.6));
}
.hero__char {
    display: inline-block;
    will-change: transform, color;
    transition: color 0.3s ease;
}
.hero__char.is-space { width: 0.25em; }

.hero__card {
    position: relative;
    background: rgba(196, 245, 45, 0.025);
    border: 1px solid rgba(196, 245, 45, 0.1);
    border-radius: 24px;
    padding: 1.5rem 2rem;
    max-width: 560px;
    overflow: hidden;
    will-change: transform;
}
.hero__card-glow {
    position: absolute;
    top: -40%;
    left: -20%;
    width: 70%;
    height: 180%;
    background: radial-gradient(ellipse at center, rgba(196, 245, 45, 0.15) 0%, transparent 60%);
    filter: blur(20px);
    pointer-events: none;
}
.hero__desc {
    position: relative;
    z-index: 2;
    font-size: 0.95rem;
    line-height: 1.55;
    color: var(--muted);
}

.hero__sparkle {
    position: absolute;
    top: -5px;
    right: 15%;
    color: var(--lime);
    font-size: 36px;
    filter: drop-shadow(0 0 12px rgba(196, 245, 45, 0.7));
    will-change: transform;
    cursor: none;
}

/* Portrait frame */
.hero__portrait {
    position: relative;
    width: 100%;
    max-width: 340px;
    justify-self: center;
    will-change: transform;
}
.hero__portrait-frame {
    position: relative;
    border-radius: 30px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(196, 245, 45, 0.1) 0%, rgba(0, 0, 0, 0.9) 100%);
    border: 1px solid rgba(196, 245, 45, 0.2);
    aspect-ratio: 3 / 3.8;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6),
                inset 0 0 50px rgba(196, 245, 45, 0.1);
}
.hero__portrait-img {
    position: absolute;
    inset: 0;
}
.hero__portrait-img img {
    width: 100%; height: 100%;
    object-fit: cover;
    object-position: center 28%;
    user-select: none;
    filter: contrast(1.15) saturate(1.2) brightness(0.75) hue-rotate(-5deg) sepia(0.2);
    mix-blend-mode: multiply;
}
.hero__portrait-img::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 30% 40%, rgba(255, 130, 60, 0.4) 0%, transparent 55%),
        radial-gradient(ellipse at 70% 50%, rgba(196, 245, 45, 0.2) 0%, transparent 60%),
        linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, 0.6) 100%);
    mix-blend-mode: screen;
    pointer-events: none;
}
.hero__portrait-grid {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    pointer-events: none;
}
.corner {
    position: absolute;
    width: 14px; height: 14px;
    border: 2px solid var(--lime);
    pointer-events: none;
    filter: drop-shadow(0 0 6px rgba(196, 245, 45, 0.6));
}
.corner--tl { top: 12px; left: 12px; border-right: none; border-bottom: none; }
.corner--tr { top: 12px; right: 12px; border-left: none; border-bottom: none; }
.corner--bl { bottom: 12px; left: 12px; border-right: none; border-top: none; }
.corner--br { bottom: 12px; right: 12px; border-left: none; border-top: none; }

/* ---------- Terrain + Tags ---------- */
.terrain {
    position: absolute;
    left: 0; right: 0;
    bottom: 0;
    height: 260px;
    z-index: 8;
}
.terrain__mountains {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    pointer-events: none;
}

.tag {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    will-change: transform;
    cursor: none;
    pointer-events: auto;
}
.tag__line {
    display: block;
    width: 1px;
    height: 40px;
    background: linear-gradient(180deg, rgba(196, 245, 45, 0.1), rgba(196, 245, 45, 0.8));
    order: 2;
    transform-origin: top;
}
.tag__pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: rgba(196, 245, 45, 0.06);
    border: 1px solid rgba(196, 245, 45, 0.25);
    color: var(--lime);
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    backdrop-filter: blur(8px);
    order: 1;
    margin-bottom: 4px;
    transition: background 0.3s, border-color 0.3s;
}
.tag__pill b { color: var(--lime); font-weight: 400; }
.tag:hover .tag__pill { background: rgba(196, 245, 45, 0.15); border-color: var(--lime); }

.tag--1 { bottom: 110px; left: 11%; }
.tag--2 { bottom: 70px;  left: 26%; }
.tag--3 { bottom: 45px;  left: 62%; }
.tag--4 { bottom: 65px;  left: 80%; }

.cta-big {
    position: absolute;
    bottom: 55px;
    left: 50%;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--lime);
    color: var(--bg);
    text-decoration: none;
    padding: 1rem 2rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 1.05rem;
    cursor: none;
    will-change: transform;
    box-shadow: 0 0 40px rgba(196, 245, 45, 0.5),
                0 10px 24px rgba(0, 0, 0, 0.4);
    z-index: 3;
    overflow: hidden;
}
.cta-big::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 60%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    transform: skewX(-20deg);
    transition: left 0.7s;
}
.cta-big:hover::before { left: 200%; }
.cta-big__arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s;
}
.cta-big__arrow svg { width: 18px; height: 18px; }
.cta-big:hover .cta-big__arrow { transform: translate(3px, -3px); }

/* ---------- Initial hidden states ---------- */
[data-magnetic], [data-link], [data-fade], [data-title-line] .hero__char,
[data-title-line] .hero__star, [data-card], [data-portrait], [data-tag],
[data-cta], [data-sparkle] {
    opacity: 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .topnav { grid-template-columns: auto 1fr auto; padding: 1rem 1.5rem; }
    .topnav__pill { display: none; }
    .hero { grid-template-columns: 1fr; gap: 2rem; padding: 1.5rem; }
    .hero__portrait { max-width: 280px; }
    .tag__pill { font-size: 0.55rem; padding: 0.25rem 0.5rem; }
}
@media (max-width: 768px) {
    .topnav__signup { display: none; }
    .hero__title { font-size: clamp(1.8rem, 10vw, 3.2rem); white-space: normal; }
    .hero__line { white-space: normal; }
    .hero__card { padding: 1rem 1.25rem; }
    .hero__desc { font-size: 0.85rem; }
    .hero__portrait { max-width: 220px; }
    .terrain { height: 200px; }
    .tag--2, .tag--4 { display: none; }
    .tag--1 { bottom: 90px; left: 3%; }
    .tag--3 { bottom: 50px; left: 75%; }
    .cta-big { padding: 0.75rem 1.5rem; font-size: 0.9rem; }
}
@media (max-width: 480px) {
    .tag--1, .tag--3 { display: none; }
    .hero__sparkle { display: none; }
    .topnav__logo-text { display: none; }
}
