:root {
    --fg: #ffffff;
    --dim: #8c8c8c;
    --faint: #333333;
    --bg: #000000;
    --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --gutter: clamp(1.25rem, 6vw, 5rem);
}

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

html {
    background: var(--bg);
    color: var(--fg);
    font-family: var(--mono);
    font-size: 15px;
    scroll-behavior: smooth;
}

body {
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

::selection {
    background: var(--fg);
    color: var(--bg);
}

a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px dashed var(--dim);
    transition: background 0.15s, color 0.15s;
}

a:hover,
a:focus-visible {
    background: var(--fg);
    color: var(--bg);
    border-bottom-color: var(--fg);
    outline: none;
}

.dim { color: var(--dim); }

#stars {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    display: block;
    z-index: 0;
}

main, .nav, .footer { position: relative; z-index: 1; }

/* nav */

.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.1rem var(--gutter);
    font-size: 0.85rem;
    background: linear-gradient(#000 30%, transparent);
}

.nav a { border: none; padding: 0 0.2rem; }
.nav nav { display: flex; gap: 1.4rem; }
.nav nav a::before { content: "./"; color: var(--dim); }
.nav nav a:hover::before { color: var(--bg); }

/* hero */

.hero {
    position: relative;
    min-height: 100vh;
    min-height: 100svh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    align-items: center;
    gap: 2rem;
    padding: 5rem var(--gutter) 4rem;
}

.hero__text { position: relative; z-index: 2; }

.hero h1 {
    font-size: clamp(2.6rem, 7vw, 5.4rem);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.03em;
    margin: 0.6rem 0 1rem;
    white-space: nowrap;
}

.hero__role { font-size: 1.15rem; }

.cursor {
    display: inline-block;
    width: 0.6em;
    height: 1.1em;
    margin-left: 0.25em;
    vertical-align: -0.15em;
    background: var(--fg);
    animation: blink 1s steps(1) infinite;
}

.blink { animation: blink 1.6s steps(1) infinite; }

@keyframes blink {
    50% { opacity: 0; }
}

.hero__tag {
    max-width: 30rem;
    margin: 1.2rem 0 1.6rem;
    color: #cfcfcf;
}

.hero__links {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1rem;
}

.hero__links a { border: none; }

.hero__status {
    margin-top: 2rem;
    font-size: 0.8rem;
}

.hero__planet {
    position: relative;
    height: min(78vh, 680px);
    overflow: hidden;
    user-select: none;
}

.hero__planet .ascii {
    position: absolute;
    inset: 0;
    color: var(--fg);
    pointer-events: none;
}

.hero__planet .ascii table { margin: 0 auto; }

.hero__scroll {
    position: absolute;
    left: 50%;
    bottom: 1.5rem;
    transform: translateX(-50%);
    font-size: 0.75rem;
    border: none;
    animation: bob 2.4s ease-in-out infinite;
}

@keyframes bob {
    50% { transform: translate(-50%, 6px); }
}

/* sections */

.section {
    max-width: 780px;
    margin: 0 auto;
    padding: 9rem var(--gutter) 0;
}

.section p + p { margin-top: 1.1rem; }

.prompt {
    font-size: 0.95rem;
    font-weight: 400;
    margin-bottom: 1.6rem;
}

.prompt::before {
    content: "ayush@zenith:~$ ";
    color: var(--dim);
}

.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.9s ease, transform 0.9s ease;
}

.reveal.in {
    opacity: 1;
    transform: none;
}

/* terrain flyover */

.terrain {
    position: relative;
    height: 72vh;
    min-height: 420px;
    margin-top: 9rem;
    border-top: 1px dashed var(--faint);
    border-bottom: 1px dashed var(--faint);
    background: #000;
}

.terrain canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.hud {
    position: absolute;
    inset: 0;
    padding: 1.2rem var(--gutter);
    font-size: 0.75rem;
    pointer-events: none;
}

.hud i, .hud b { font-style: normal; font-weight: 400; }
.hud b { background: var(--fg); color: var(--bg); padding: 0 0.3em; }

.hud__tl, .hud__tr {
    position: absolute;
    top: 1.2rem;
    display: flex;
    flex-direction: column;
}

.hud__tl { left: var(--gutter); }
.hud__tr { right: var(--gutter); text-align: right; }

.hud__cross {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1rem;
    opacity: 0.85;
}

.hud__bl, .hud__br {
    position: absolute;
    bottom: 1.2rem;
    background: #000;
    padding: 0 0.4em;
}

.hud__bl { left: var(--gutter); }
.hud__br { right: var(--gutter); }

/* research */

.profiles {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 2.4rem;
}

.profiles a {
    border: 1px solid var(--fg);
    padding: 0.35rem 0.8rem;
}

.pubs { list-style: none; }

.pubs li {
    display: grid;
    grid-template-columns: 4rem 1fr;
    gap: 1rem;
    padding: 1.4rem 0;
    border-top: 1px dashed var(--faint);
}

.pubs li:last-child { border-bottom: 1px dashed var(--faint); }

.pubs__year { color: var(--dim); }

.pubs__title {
    font-weight: 700;
    border: none;
    display: inline;
}

.pubs__authors, .pubs__venue {
    font-size: 0.85rem;
    color: var(--dim);
    margin-top: 0.35rem !important;
}

.pubs__authors u {
    color: var(--fg);
    text-decoration-style: dotted;
    text-underline-offset: 3px;
}

.pubs__venue { font-style: italic; margin-top: 0 !important; }

.pubs__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem 0.8rem;
    margin-top: 0.6rem !important;
    font-size: 0.85rem;
}

.pubs__tags a { border: none; }

/* dispatches */

.log {
    list-style: none;
    margin-top: 1.2rem;
}

.log li { padding: 0.35rem 0; }

.log li::before {
    content: "> ";
    color: var(--dim);
}

/* contact */

.contact {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.4rem 2rem;
    margin-top: 1.6rem;
}

.contact dt { color: var(--dim); }

/* footer */

.footer {
    padding: 9rem var(--gutter) 2.5rem;
    text-align: center;
    font-size: 0.8rem;
}

.footer pre {
    display: inline-block;
    text-align: left;
    color: var(--dim);
    line-height: 1.25;
    margin-bottom: 2rem;
    font-family: var(--mono);
}

/* small screens */

@media (max-width: 820px) {
    .nav nav { gap: 0.9rem; }
    .nav nav a::before { content: none; }

    .hero {
        grid-template-columns: 1fr;
        align-content: end;
        padding-bottom: 6rem;
    }

    .hero__planet {
        position: absolute;
        top: 3.5rem;
        left: 0;
        right: 0;
        height: 50%;
        opacity: 0.85;
        z-index: 1;
    }

    .pubs li { grid-template-columns: 1fr; gap: 0.3rem; }

    .footer pre { font-size: 0.6rem; }
}

@media (max-width: 480px) {
    html { font-size: 14px; }
    .nav__home { display: none; }
    .nav { justify-content: center; }
    .hud__tr { display: none; }
}

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