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

:root {
    --bg:    #06080b;
    --ink:   #ffffff;
    --muted: rgba(255, 255, 255, 0.55);
    --dim:   rgba(255, 255, 255, 0.12);
    --line:  rgba(255, 255, 255, 0.08);
}

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.06);
    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%);
    mix-blend-mode: difference;
    will-change: transform;
}
.cursor-dot {
    width: 5px; height: 5px;
    background: #ffffff;
    border-radius: 50%;
}
.cursor-ring {
    width: 32px; height: 32px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    transition: width 0.3s, height 0.3s, border-color 0.3s;
}
.cursor-ring.is-hover {
    width: 60px; height: 60px;
    border-color: #fff;
}
@media (hover: none), (pointer: coarse) { .cursor-dot, .cursor-ring { display: none; } }

/* =========================================================
   LOADER — Scramble text + grid draw
   ========================================================= */
.loader {
    position: fixed;
    inset: 0;
    z-index: 999;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.loader__grid {
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(
        90deg,
        transparent 0,
        transparent calc(100% / 16 - 1px),
        rgba(255, 255, 255, 0.08) calc(100% / 16 - 1px),
        rgba(255, 255, 255, 0.08) calc(100% / 16)
    );
    opacity: 0;
}

.loader__content {
    position: relative;
    z-index: 2;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.loader__diamond {
    width: 48px;
    height: 48px;
    will-change: transform;
}
.loader__diamond svg { width: 100%; height: 100%; }

.loader__title {
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    font-size: clamp(3rem, 10vw, 8rem);
    line-height: 1;
    letter-spacing: -0.04em;
    color: var(--ink);
    display: inline-flex;
    gap: 2px;
}
.loader__title span {
    display: inline-block;
    font-variant-numeric: tabular-nums;
    will-change: transform;
}

.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;
}
.loader__counter {
    color: var(--ink);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    min-width: 3ch;
}

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

.evolve__video {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    z-index: 1;
    filter: brightness(0.4) contrast(1.1) saturate(0.9);
    will-change: transform;
}
.evolve__overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    background:
        radial-gradient(ellipse at center, rgba(6, 8, 11, 0.3) 0%, rgba(6, 8, 11, 0.85) 100%),
        linear-gradient(180deg, rgba(6, 8, 11, 0.7) 0%, rgba(6, 8, 11, 0.1) 30%, rgba(6, 8, 11, 0.5) 70%, rgba(6, 8, 11, 0.9) 100%);
    pointer-events: none;
}

.evolve__grid {
    position: absolute;
    inset: 0;
    z-index: 3;
    background-image: repeating-linear-gradient(
        90deg,
        transparent 0,
        transparent calc(100% / 16 - 1px),
        rgba(255, 255, 255, 0.05) calc(100% / 16 - 1px),
        rgba(255, 255, 255, 0.05) calc(100% / 16)
    );
    pointer-events: none;
}

/* ---------- Top nav ---------- */
.topnav {
    position: relative;
    z-index: 20;
    display: grid;
    grid-template-columns: 1fr 2fr 2fr auto;
    gap: 2rem;
    padding: 1.25rem 2rem;
    align-items: flex-start;
}

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

.topnav__desc {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--ink);
    line-height: 1.45;
}

.topnav__contact {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.45;
}
.topnav__email {
    color: var(--ink);
    text-decoration: none;
    position: relative;
    cursor: none;
    will-change: transform;
}
.topnav__email::after {
    content: '';
    position: absolute;
    left: 0; bottom: -2px;
    width: 100%; height: 1px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s cubic-bezier(0.65, 0, 0.35, 1);
}
.topnav__email:hover::after { transform: scaleX(1); transform-origin: left; }
.topnav__loc { color: var(--ink); }

.topnav__actions {
    display: flex;
    gap: 0.6rem;
    align-items: center;
}
.topnav__lang {
    background: transparent;
    border: none;
    color: var(--ink);
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    cursor: none;
    padding: 0.3rem 0.6rem;
    will-change: transform;
    font-family: inherit;
}
.topnav__menu {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--ink);
    color: #000;
    border: none;
    padding: 0.5rem 1.1rem;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    letter-spacing: 0.05em;
    cursor: none;
    will-change: transform;
    transition: background 0.3s ease, color 0.3s ease;
}
.topnav__menu svg { width: 11px; height: 11px; transition: transform 0.3s; }
.topnav__menu:hover { background: #dcdcdc; }
.topnav__menu:hover svg { transform: rotate(180deg); }

/* ---------- Side labels ---------- */
.side-label {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 15;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--ink);
    pointer-events: auto;
    will-change: transform;
}
.side-label--left  { left: 2rem; }
.side-label--right { right: 2rem; }
.side-label__bar {
    display: inline-block;
    width: 40px;
    height: 1px;
    background: var(--ink);
    transition: width 0.5s cubic-bezier(0.65, 0, 0.35, 1);
}
.side-label:hover .side-label__bar { width: 80px; }

/* ---------- Center caption ---------- */
.center-caption {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--ink);
    padding: 0.4rem 1rem;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    will-change: transform;
    cursor: none;
}
.center-caption__dot {
    width: 5px; height: 5px;
    border-radius: 50%;
    background: #ffffff;
}

/* ---------- Huge title ---------- */
.title {
    position: absolute;
    left: 0; right: 0;
    bottom: 0;
    z-index: 10;
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    font-size: clamp(3.5rem, 13vw, 16rem);
    line-height: 0.9;
    letter-spacing: -0.04em;
    color: #ffffff;
    text-align: center;
    padding: 0 1rem;
    pointer-events: none;
}
.title__line {
    display: block;
    overflow: hidden;
    padding-bottom: 0.04em;
    white-space: nowrap;
    pointer-events: auto;
}
.title__char {
    display: inline-block;
    will-change: transform, color;
    transition: color 0.3s ease;
}
.title__char.is-space { width: 0.2em; }

/* ---------- Footer meta ---------- */
.footer-meta {
    position: absolute;
    bottom: 1rem;
    left: 0; right: 0;
    z-index: 15;
    display: flex;
    justify-content: space-between;
    padding: 0 2rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    color: var(--muted);
    text-transform: uppercase;
    pointer-events: none;
}
.footer-meta__cell { display: inline-flex; align-items: center; gap: 0.4rem; }
.footer-meta__cell b { color: var(--ink); font-weight: 500; }

/* ---------- Initial hidden states ---------- */
[data-magnetic], [data-link], [data-fade], [data-title-line] .title__char,
[data-side], [data-caption], [data-footer] { opacity: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .topnav { grid-template-columns: 1fr auto; gap: 1rem; }
    .topnav__desc, .topnav__contact { display: none; }
    .side-label { display: none; }
}
@media (max-width: 768px) {
    .topnav { padding: 1rem 1.25rem; }
    .topnav__logo-text { font-size: 1rem; }
    .center-caption { font-size: 0.65rem; padding: 0.3rem 0.75rem; }
    .footer-meta { font-size: 0.6rem; padding: 0 1rem; gap: 0.5rem; flex-wrap: wrap; justify-content: center; }
    .title { bottom: 3rem; }
    .loader__title { font-size: clamp(2.5rem, 14vw, 6rem); }
}
@media (max-width: 480px) {
    .topnav__lang { padding: 0.3rem 0.4rem; font-size: 0.75rem; }
    .topnav__menu { padding: 0.4rem 0.8rem; font-size: 0.75rem; }
    .center-caption { display: none; }
    .footer-meta__cell:last-child { display: none; }
}
