/* ================================ */
/* PERSONAL SITE — HERO + SIDE RAIL */
/* ================================ */

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

:root {
    --bg: #0a0a0b;
    --fg: #e8e8e8;
    --fg-dim: #888;
    --accent: #64ffda;
    --accent-dim: rgba(100, 255, 218, 0.15);
    --border: rgba(255, 255, 255, 0.08);
    --mono: 'SF Mono', 'Fira Code', ui-monospace, monospace;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--fg);
    font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: opacity 0.2s;
}

a:hover {
    opacity: 0.7;
}

/* ================================ */
/* HERO (BIG SPINNING MOLECULE)     */
/* ================================ */

.hero {
    position: relative;
    width: 100%;
    height: 100vh;
    height: 100svh;
    overflow: hidden;
    border-bottom: 1px solid var(--border);
    background:
        radial-gradient(ellipse 55% 60% at 50% 45%, rgba(96, 165, 250, 0.10) 0%, rgba(100, 255, 218, 0.03) 40%, transparent 72%);
}

.hero-molecule {
    position: absolute;
    inset: 0;
}

/* Branch blurb popup */
.atom-tip {
    position: absolute;
    top: 0;
    left: 0;
    width: 280px;
    max-width: calc(100vw - 48px);
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(12, 14, 20, 0.9);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
    pointer-events: none;
    opacity: 0;
    transform: scale(0.95);
    transform-origin: center;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 5;
}

.atom-tip.visible {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.atom-tip-img {
    display: none;
    width: 100%;
    height: 150px;
    object-fit: cover;
    object-position: center;
    border-radius: 4px;
    margin-bottom: 4px;
}

.atom-tip-title {
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
}

.atom-tip-text {
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--fg);
}

.atom-tip-link {
    display: none;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--accent);
}

.atom-tip-link::before {
    content: '♪';
    font-size: 0.8rem;
}

.hero-molecule canvas {
    display: block;
    margin: 0 auto;
}

.scroll-cue {
    position: absolute;
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--fg-dim);
    font-family: var(--mono);
    font-size: 0.68rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    animation: scroll-bob 1.8s ease-in-out infinite;
}

.scroll-cue svg {
    color: var(--accent);
}

.scroll-cue:hover {
    opacity: 1;
    color: var(--fg);
}

@keyframes scroll-bob {
    0%, 100% { transform: translate(-50%, 0); }
    50% { transform: translate(-50%, 8px); }
}

@media (prefers-reduced-motion: reduce) {
    .scroll-cue { animation: none; }
}

/* ================================ */
/* GRID LAYOUT (BELOW HERO)         */
/* ================================ */

.grid-layout {
    display: grid;
    grid-template-columns: 340px 1fr;
    max-width: 1200px;
    margin: 0 auto;
}

/* ================================ */
/* IDENTITY (STICKY LEFT RAIL)      */
/* ================================ */

.identity {
    position: sticky;
    top: 0;
    align-self: start;
    height: 100vh;
    min-height: 600px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 64px 48px 40px;
    border-right: 1px solid var(--border);
}

.identity-inner {
    display: flex;
    flex-direction: column;
}

.name {
    font-size: 2.6rem;
    font-weight: 600;
    line-height: 1.05;
    letter-spacing: -0.03em;
    color: var(--fg);
    margin-bottom: 32px;
}

.profile-photo {
    width: 168px;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 4px;
    filter: grayscale(20%);
    transition: filter 0.3s ease;
}

.profile-photo:hover {
    filter: grayscale(0%);
}

.affiliation {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 24px;
}

.dept {
    font-size: 0.85rem;
    color: var(--fg-dim);
}

.school {
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: 500;
}

.origin {
    font-size: 0.75rem;
    color: var(--fg-dim);
    opacity: 0.7;
    margin-top: 4px;
}

/* Links in the rail */
.link-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 32px;
    padding-top: 28px;
    border-top: 1px solid var(--border);
}

.link-list a {
    font-size: 0.9rem;
    color: var(--fg);
    display: flex;
    align-items: center;
    gap: 10px;
}

.link-list a::before {
    content: '→';
    color: var(--accent);
    font-size: 0.85rem;
}

/* Footer meta pinned to bottom of rail */
.identity-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.72rem;
    font-family: var(--mono);
    color: var(--fg-dim);
    padding-top: 32px;
}

.identity-meta .coordinates {
    color: var(--accent);
    opacity: 0.6;
}

/* ================================ */
/* MAIN CONTENT                     */
/* ================================ */

.main-content {
    min-width: 0;
    padding: 56px 64px 96px;
}

.intro {
    margin-bottom: 72px;
}

.lead {
    font-size: 1.5rem;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: -0.01em;
    margin-bottom: 20px;
    color: var(--fg);
    max-width: 40ch;
}

.intro p:not(.lead) {
    color: var(--fg-dim);
    font-size: 0.95rem;
    max-width: 60ch;
}

/* Section headings */
.research-areas h2,
.beliefs h2,
.personal h2,
.photos h2 {
    font-size: 0.72rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--fg-dim);
    margin-bottom: 24px;
}

/* Endeavours */
.research-areas {
    margin-bottom: 72px;
}

.area-list {
    display: flex;
    flex-direction: column;
}

.area {
    display: flex;
    align-items: baseline;
    gap: 24px;
    padding: 18px 0;
    border-bottom: 1px solid var(--border);
    transition: padding-left 0.2s ease;
}

.area:first-child {
    border-top: 1px solid var(--border);
}

.area:hover {
    padding-left: 8px;
}

.area-number {
    font-size: 0.75rem;
    color: var(--accent);
    font-family: var(--mono);
}

.area-name {
    font-size: 1.05rem;
    color: var(--fg);
}

/* Foundations & Otherwise — two columns */
.prose-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    margin-bottom: 72px;
}

.beliefs p,
.personal p {
    color: var(--fg-dim);
    font-size: 0.95rem;
}

/* Photos */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.photo-item {
    margin: 0;
}

.photo-item img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 4px;
    filter: grayscale(100%);
    transition: filter 0.4s ease;
}

.photo-item:hover img {
    filter: grayscale(0%);
}

.photo-item figcaption {
    font-size: 0.72rem;
    color: var(--fg-dim);
    margin-top: 10px;
    font-family: var(--mono);
}

/* ================================ */
/* RESPONSIVE                       */
/* ================================ */

@media (max-width: 900px) {
    .grid-layout {
        grid-template-columns: 1fr;
        max-width: 640px;
    }

    .identity {
        position: relative;
        top: auto;
        height: auto;
        min-height: 0;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 48px 32px 36px;
    }

    .name {
        font-size: 2.2rem;
    }

    .identity-meta {
        flex-direction: row;
        justify-content: space-between;
        margin-top: 36px;
    }

    .main-content {
        padding: 40px 32px 72px;
    }

    .intro,
    .research-areas {
        margin-bottom: 56px;
    }

    .prose-cols {
        grid-template-columns: 1fr;
        gap: 56px;
        margin-bottom: 56px;
    }
}

@media (max-width: 540px) {
    .photo-grid {
        grid-template-columns: 1fr;
    }

    .photo-item img {
        height: 220px;
    }
}

/* Hide default layout elements from default.html */
.container { display: contents; }
.footer { display: none; }
