/* ============================================================
   Algo-ML — 2026 redesign
   Display: Space Grotesk · Body: Inter
   ============================================================ */

:root {
    --bg: #06070d;
    --bg-soft: #0b0e1a;
    --ink: #f3f6ff;
    --muted: #9aa6c4;
    --line: rgba(255, 255, 255, 0.09);
    --glass: rgba(255, 255, 255, 0.04);
    --glass-strong: rgba(255, 255, 255, 0.07);

    --blue: #4f8bff;
    --cyan: #22d3ee;
    --violet: #a855f7;
    --accent: linear-gradient(120deg, var(--blue), var(--cyan) 55%, var(--violet));

    --radius: 22px;
    --shadow: 0 30px 80px -40px rgba(0, 0, 0, 0.9);
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: 'Inter', system-ui, sans-serif;
    background-color: var(--bg);
    color: var(--ink);
    font-size: 15px;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

*::-webkit-scrollbar {
    width: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ---------- scroll progress ---------- */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 100%;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    z-index: 200;
    box-shadow: 0 0 16px rgba(79, 139, 255, 0.6);
}

/* ---------- animated aurora backdrop ---------- */
.aurora {
    position: fixed;
    inset: 0;
    z-index: -2;
    overflow: hidden;
    background:
        radial-gradient(1200px 800px at 80% -10%, rgba(79, 139, 255, 0.12), transparent 60%),
        radial-gradient(1000px 700px at 0% 110%, rgba(168, 85, 247, 0.12), transparent 60%),
        var(--bg);
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.55;
    will-change: transform;
}

.blob-1 {
    width: 46vw;
    height: 46vw;
    top: -10%;
    left: -8%;
    background: radial-gradient(circle, var(--blue), transparent 70%);
    animation: drift1 22s var(--ease) infinite alternate;
}

.blob-2 {
    width: 40vw;
    height: 40vw;
    top: 30%;
    right: -10%;
    background: radial-gradient(circle, var(--violet), transparent 70%);
    animation: drift2 26s var(--ease) infinite alternate;
}

.blob-3 {
    width: 34vw;
    height: 34vw;
    bottom: -12%;
    left: 28%;
    background: radial-gradient(circle, var(--cyan), transparent 70%);
    animation: drift3 30s var(--ease) infinite alternate;
}

@keyframes drift1 { to { transform: translate(12%, 14%) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-14%, -8%) scale(1.1); } }
@keyframes drift3 { to { transform: translate(8%, -12%) scale(1.2); } }

.grid-overlay {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--line) 1px, transparent 1px),
        linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(circle at 50% 40%, #000 0%, transparent 75%);
    opacity: 0.5;
}

.grain {
    position: absolute;
    inset: 0;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- layout ---------- */
.section {
    width: 100%;
    min-height: 100vh;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.content-fit {
    width: min(1180px, 90vw);
    margin: auto;
    position: relative;
    padding-block: 9em;
}

.decorate {
    position: absolute;
    opacity: 0.55;
    filter: saturate(0.8) brightness(0.9);
    pointer-events: none;
}

/* ---------- floating glass nav ---------- */
header {
    position: fixed;
    top: 18px;
    left: 0;
    width: 100%;
    z-index: 100;
    display: flex;
    justify-content: center;
    pointer-events: none;
}

.nav-pill {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 28px;
    width: min(1100px, 92vw);
    padding: 10px 14px 10px 18px;
    border: 1px solid var(--line);
    background: rgba(11, 14, 26, 0.55);
    backdrop-filter: blur(18px) saturate(140%);
    border-radius: 100px;
    box-shadow: var(--shadow);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    letter-spacing: 0.2px;
    font-size: 1.05rem;
}

.brand .logo {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.nav-bar {
    margin-left: auto;
}

.nav-bar ul {
    display: flex;
    gap: 8px;
}

.nav-link {
    position: relative;
    padding: 8px 14px;
    border-radius: 100px;
    color: var(--muted);
    font-weight: 500;
    font-size: 0.92rem;
    transition: color 0.25s var(--ease), background 0.25s var(--ease);
}

.nav-link:hover {
    color: var(--ink);
    background: var(--glass);
}

.nav-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 100px;
    font-weight: 600;
    font-size: 0.9rem;
    color: #061026;
    background: var(--accent);
    box-shadow: 0 10px 30px -10px rgba(79, 139, 255, 0.7);
    transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.nav-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 40px -12px rgba(79, 139, 255, 0.9);
}

.nav-cta .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #061026;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

/* ---------- hero ---------- */
.hero {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 8px 16px;
    border-radius: 100px;
    border: 1px solid var(--line);
    background: var(--glass);
    color: var(--muted);
    font-size: 0.82rem;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    backdrop-filter: blur(10px);
}

.badge .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--cyan);
    box-shadow: 0 0 12px var(--cyan);
}

#banner .title {
    margin-top: 0.35em;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(4rem, 16vw, 14rem);
    line-height: 0.9;
    letter-spacing: -0.04em;
    position: relative;
    background: linear-gradient(180deg, #ffffff 30%, #b9c6ff 75%, #6e7fd6);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

#banner .title::before {
    content: attr(data-before);
    position: absolute;
    inset: 0.5em 0 0 0;
    z-index: -1;
    background: var(--accent);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: blur(38px);
    opacity: 0.7;
}

.hero-sub {
    max-width: 620px;
    margin-top: 1.6em;
    color: var(--muted);
    font-size: clamp(1rem, 2.2vw, 1.3rem);
    line-height: 1.55;
}

.hero-cta {
    display: flex;
    gap: 14px;
    margin-top: 2.2em;
    flex-wrap: wrap;
    justify-content: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 26px;
    border-radius: 100px;
    font-weight: 600;
    font-size: 0.98rem;
    transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s var(--ease);
}

.btn-primary {
    color: #061026;
    background: var(--accent);
    box-shadow: 0 14px 40px -14px rgba(79, 139, 255, 0.8);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 22px 50px -16px rgba(79, 139, 255, 1);
}

.btn-ghost {
    color: var(--ink);
    border: 1px solid var(--line);
    background: var(--glass);
    backdrop-filter: blur(10px);
}

.btn-ghost:hover {
    transform: translateY(-3px);
    background: var(--glass-strong);
}

.hero-stats {
    display: flex;
    gap: 14px;
    margin-top: 3.2em;
    flex-wrap: wrap;
    justify-content: center;
}

.hero-stats div {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 14px 22px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--glass);
    backdrop-filter: blur(10px);
    min-width: 150px;
}

.hero-stats strong {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.15rem;
    background: var(--accent);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-stats span {
    color: var(--muted);
    font-size: 0.85rem;
}

/* ---------- content panels (bento glass) ---------- */
.panel {
    position: relative;
    padding: clamp(2em, 5vw, 4em);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(160deg, var(--glass-strong), rgba(255, 255, 255, 0.015));
    backdrop-filter: blur(14px);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.panel::after {
    /* top sheen */
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
}

.number {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(3rem, 9vw, 7rem);
    line-height: 1;
    letter-spacing: -0.04em;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.02));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 0.2em;
}

.eyebrow {
    display: inline-block;
    font-size: 0.8rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--cyan);
    margin-bottom: 0.8em;
}

.panel .title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: clamp(1.8rem, 4.5vw, 3.2rem);
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: var(--ink);
    max-width: 16ch;
}

.panel p {
    margin-top: 1.1em;
    max-width: 60ch;
    color: var(--muted);
    font-size: 1.02rem;
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 1.8em;
}

.tag-row li {
    padding: 7px 15px;
    border-radius: 100px;
    border: 1px solid var(--line);
    background: var(--glass);
    color: var(--ink);
    font-size: 0.85rem;
    font-weight: 500;
    transition: transform 0.2s var(--ease), border-color 0.2s var(--ease);
}

.tag-row li:hover {
    transform: translateY(-2px);
    border-color: rgba(79, 139, 255, 0.6);
}

/* ---------- contact ---------- */
.panel-contact {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.panel-contact .title {
    max-width: none;
}

#contact table {
    width: min(640px, 100%);
    margin: 2.4em auto 0;
    font-size: 1.05rem;
    border-collapse: collapse;
}

#contact table td {
    padding: 1em 0.2em;
    border-bottom: 1px solid var(--line);
}

#contact table td:nth-child(1) {
    text-align: left;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.85rem;
}

#contact table td:nth-child(2) {
    text-align: right;
    color: var(--ink);
}

#contact table td a:hover {
    color: var(--cyan);
}

.sign {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(3rem, 12vw, 8rem);
    letter-spacing: -0.04em;
    margin-top: 0.4em;
    background: var(--accent);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ---------- footer ---------- */
.site-footer {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    width: min(1180px, 90vw);
    margin: 0 auto;
    padding: 2.5em 0 3em;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.85rem;
}

/* ---------- reveal on scroll ---------- */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.reveal.is-visible {
    opacity: 1;
    transform: none;
}

/* stagger hero children */
.hero .reveal:nth-child(2) { transition-delay: 0.05s; }
.hero .reveal:nth-child(3) { transition-delay: 0.12s; }
.hero .reveal:nth-child(4) { transition-delay: 0.19s; }
.hero .reveal:nth-child(5) { transition-delay: 0.26s; }

@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
    .blob { animation: none; }
    html { scroll-behavior: auto; }
}

/* ---------- projects ---------- */
.section-head {
    text-align: center;
    max-width: 640px;
    margin: 0 auto 3em;
}

.section-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: clamp(2rem, 5vw, 3.4rem);
    line-height: 1.05;
    letter-spacing: -0.02em;
}

.section-lead {
    margin-top: 0.9em;
    color: var(--muted);
    font-size: 1.05rem;
}

.projects {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.project-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(160deg, var(--glass-strong), rgba(255, 255, 255, 0.015));
    backdrop-filter: blur(14px);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.project-card::before {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: var(--accent);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s var(--ease);
    pointer-events: none;
}

a.project-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 40px 90px -44px rgba(79, 139, 255, 0.6), var(--shadow);
}

a.project-card:hover::before {
    opacity: 1;
}

.project-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: var(--muted);
}

.status .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-live .dot {
    background: #34d399;
    box-shadow: 0 0 10px #34d399;
    animation: pulse 2s infinite;
}

.status-research .dot {
    background: var(--violet);
    box-shadow: 0 0 10px var(--violet);
}

.project-tag {
    font-size: 0.76rem;
    color: var(--muted);
    padding: 4px 11px;
    border: 1px solid var(--line);
    border-radius: 100px;
    background: var(--glass);
}

.project-card h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 1.5rem;
    letter-spacing: -0.01em;
}

.project-card p {
    color: var(--muted);
    font-size: 0.97rem;
    flex: 1;
}

.project-link {
    margin-top: 4px;
    font-weight: 600;
    font-size: 0.92rem;
    background: var(--accent);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.project-card.is-research {
    cursor: default;
}

.project-card.is-research .project-link {
    background: none;
    -webkit-text-fill-color: var(--muted);
    color: var(--muted);
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
    .content-fit { padding-block: 8em; }
    .nav-bar { display: none; }
    .nav-pill { gap: 12px; }
    .brand { margin-right: auto; }
}

@media (max-width: 600px) {
    body { font-size: 14px; }
    .content-fit { padding-block: 7em; width: 92vw; }
    .hero-stats div { min-width: 130px; flex: 1; }
    .decorate { opacity: 0.4; }
    #contact table { font-size: 0.95rem; }
    .panel { padding: 1.6em; }
    .projects { grid-template-columns: 1fr; }
}
