:root {
    --bg-gradient: linear-gradient(135deg, #FBCFE8 0%, #FFEDD5 50%, #FFFBFB 100%);
    --accent-color: #6B4F5B;
    --text-color: #4A3740;
    --container-bg: rgba(255, 255, 255, 0.7);

    /* soft tints used behind the glass so it has something to bend */
    --rose: #F5A9CB;
    --peach: #FDBA8C;
    --mauve: #C9A0B4;

    /* size of the venn stage: square, fits the viewport */
    --s: min(94vw, calc(100vh - 9rem), 880px);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Raleway', sans-serif;
    background: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

a { color: var(--accent-color); }

:focus-visible { outline: 3px solid var(--accent-color); outline-offset: 3px; }

/* ==========================================================
   LANDING PAGE
   ========================================================== */

.home { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; padding: 1.25rem 0 1.5rem; }

.home-head { text-align: center; padding: 0 1rem; }

.home-head h1 {
    font-family: 'Sacramento', cursive;
    font-weight: 400;
    font-size: clamp(2.8rem, 8vw, 4.4rem);
    line-height: 1.05;
    color: var(--accent-color);
}

.home-head p { font-weight: 300; font-size: 0.95rem; opacity: 0.85; margin-top: 0.15rem; }

.stage {
    position: relative;
    width: var(--s);
    aspect-ratio: 1;
    margin-top: 0.5rem;
}

/* colour pools behind the glass */
.blob {
    position: absolute;
    width: 46%;
    aspect-ratio: 1;
    border-radius: 50%;
    filter: blur(38px);
    opacity: 0.75;
    transform: translate(-50%, -50%);
    pointer-events: none;
}
.blob.rose  { left: 30%; top: 30%; background: var(--rose); }
.blob.peach { left: 76%; top: 46%; background: var(--peach); opacity: 0.6; }
.blob.mauve { left: 46%; top: 80%; background: var(--mauve); opacity: 0.6; }

/* ---------- the circles ---------- */

.orb {
    position: absolute;
    left: calc(var(--x) * 1%);
    top: calc(var(--y) * 1%);
    width: calc(var(--d) * 1%);
    aspect-ratio: 1;
    transform: translate(-50%, -50%);
    z-index: var(--z, 1);
    border-radius: 50%;
    text-decoration: none;
    color: var(--accent-color);
    -webkit-tap-highlight-color: transparent;
    animation: pop 0.8s cubic-bezier(0.2, 0.9, 0.3, 1) both;
    animation-delay: calc(var(--i, 0) * 80ms);
}

.glass {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background:
        radial-gradient(circle at var(--mx, 28%) var(--my, 20%),
            rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0) 42%),
        linear-gradient(150deg, rgba(255, 255, 255, 0.36) 0%, rgba(255, 255, 255, 0.1) 60%, rgba(255, 255, 255, 0.2) 100%);
    -webkit-backdrop-filter: blur(12px) saturate(170%);
    backdrop-filter: blur(12px) saturate(170%);
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow:
        inset 0 2px 1px rgba(255, 255, 255, 0.85),
        inset 0 -14px 28px rgba(255, 255, 255, 0.22),
        inset 0 0 0 6px rgba(255, 255, 255, 0.06),
        0 22px 48px rgba(107, 79, 91, 0.14),
        0 4px 10px rgba(107, 79, 91, 0.06);
    transition: scale 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.4s ease, background-color 0.4s ease;
    animation: float var(--dur, 9s) ease-in-out infinite alternate;
    animation-delay: var(--delay, 0s);
}

/* thin bright rim, brighter at the top like a lit edge */
.glass::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    padding: 1.5px;
    background: linear-gradient(160deg, rgba(255,255,255,0.95), rgba(255,255,255,0) 40%, rgba(255,255,255,0) 65%, rgba(255,255,255,0.55));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
    pointer-events: none;
}

.orb:hover .glass,
.orb:focus-visible .glass {
    scale: 1.045;
    background-color: rgba(255, 255, 255, 0.16);
    box-shadow:
        inset 0 2px 1px rgba(255, 255, 255, 0.95),
        inset 0 -14px 28px rgba(255, 255, 255, 0.3),
        0 28px 60px rgba(107, 79, 91, 0.2),
        0 4px 10px rgba(107, 79, 91, 0.08);
}

.orb:focus-visible { outline: none; }
.orb:focus-visible .glass { box-shadow: 0 0 0 3px var(--accent-color), 0 22px 48px rgba(107, 79, 91, 0.2); }

.label {
    position: absolute;
    left: var(--lx, 50%);
    top: var(--ly, 50%);
    transform: translate(-50%, -50%);
    text-align: center;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: 0.01em;
    pointer-events: none;
    white-space: nowrap;
    font-size: clamp(0.62rem, calc(var(--s) * 0.026), 1.05rem);
}

.orb.big .label { font-size: clamp(0.95rem, calc(var(--s) * 0.042), 1.7rem); }
.orb.hub .label { font-size: clamp(0.62rem, calc(var(--s) * 0.027), 1.1rem); }

@keyframes pop {
    from { opacity: 0; scale: 0.82; }
}

@keyframes float {
    from { translate: 0 0; }
    to   { translate: var(--fx, 1.5%) var(--fy, -2%); }
}

/* browsers without backdrop-filter get a frosted fallback */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .glass { background-color: rgba(255, 255, 255, 0.5); }
}

/* ==========================================================
   SUB-PAGES
   ========================================================== */

.topbar {
    position: sticky;
    top: 0.75rem;
    z-index: 50;
    width: fit-content;
    max-width: calc(100% - 1.5rem);
    margin: 0.75rem auto 0;
    padding: 0.55rem 1.1rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.55);
    -webkit-backdrop-filter: blur(14px) saturate(170%);
    backdrop-filter: blur(14px) saturate(170%);
    border: 1px solid rgba(255, 255, 255, 0.75);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.9), 0 10px 30px rgba(107, 79, 91, 0.1);
}

.topbar ul { display: flex; gap: 0.4rem 1.3rem; list-style: none; flex-wrap: wrap; justify-content: center; }
.topbar a { text-decoration: none; font-weight: 600; font-size: 0.88rem; color: var(--accent-color); opacity: 0.75; }
.topbar a:hover, .topbar a[aria-current="page"] { opacity: 1; }
.topbar a[aria-current="page"] { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 2px; }

.page { max-width: 1050px; margin: 0 auto; padding: 2.5rem 1rem 4rem; }

.panel {
    background: var(--container-bg);
    border-radius: 40px;
    padding: clamp(1.5rem, 5vw, 3.2rem);
    box-shadow: 0 15px 35px rgba(107, 79, 91, 0.06);
}

.panel h1 {
    font-family: 'Sacramento', cursive;
    font-weight: 400;
    font-size: clamp(3.2rem, 9vw, 5rem);
    line-height: 1.05;
    color: var(--accent-color);
    text-align: center;
}

.lead { text-align: center; max-width: 36rem; margin: 0.4rem auto 2rem; font-size: 1.05rem; }

.panel h2 { color: var(--accent-color); font-size: 1.5rem; margin: 2.2rem 0 1rem; text-align: center; }

/* about */
.about-content { display: flex; align-items: center; gap: 3rem; margin-top: 2rem; }
.profile-pic {
    flex: 0 0 200px; width: 200px; height: 200px;
    border-radius: 50%; overflow: hidden;
    border: 5px solid white;
    box-shadow: 0 10px 20px rgba(107, 79, 91, 0.1);
}
.profile-pic img { width: 100%; height: 100%; object-fit: cover; }
.about-text p + p { margin-top: 0.7rem; }
.resume-frame { width: 100%; height: 640px; border: none; border-radius: 20px; background: white; }

/* cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 1.25rem; }

.card {
    font: inherit;
    color: inherit;
    text-align: center;
    background: white;
    border: none;
    border-radius: 20px;
    padding: 1.5rem;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
    display: flex; flex-direction: column; justify-content: center; gap: 0.4rem;
}
.card:hover { transform: translateY(-8px); }
.card h3 { color: var(--accent-color); font-size: 1.15rem; }
.card.photo { padding: 0.9rem 0.9rem 1.1rem; }
.card.photo img, .card.photo video { width: 100%; height: 210px; object-fit: cover; border-radius: 12px; display: block; }
.card.photo p { font-weight: 600; font-size: 0.9rem; margin-top: 0.5rem; }

.note {
    background: white;
    border-radius: 20px;
    padding: 1.4rem 1.6rem;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.04);
    max-width: 34rem;
    margin: 0 auto;
}

.btn-row { display: flex; gap: 0.8rem; justify-content: center; flex-wrap: wrap; margin-top: 1.5rem; }
.btn {
    display: inline-block;
    padding: 0.65rem 1.5rem;
    border-radius: 999px;
    background: var(--accent-color);
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: transform 0.2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn.ghost { background: rgba(255, 255, 255, 0.8); color: var(--accent-color); }

footer { padding: 2rem 1rem 3rem; text-align: center; font-weight: 600; color: var(--accent-color); }

/* lightbox */
#lightbox {
    display: none; position: fixed; inset: 0;
    background: rgba(74, 55, 64, 0.96); z-index: 2000;
    justify-content: center; align-items: center;
}
#lightbox-container { width: 90%; height: 82%; display: flex; justify-content: center; align-items: center; }
#lightbox-container img, #lightbox-container video { max-width: 100%; max-height: 100%; border-radius: 10px; }
.pdf-viewer { width: 100%; height: 100%; border-radius: 10px; border: none; background: white; }
.close-btn { position: absolute; top: 14px; right: 22px; color: white; background: none; border: none; font-size: 2.6rem; cursor: pointer; line-height: 1; }

/* research / course entries */
.entries { max-width: 760px; margin: 0 auto; }

.entry {
    background: white;
    border-radius: 20px;
    padding: 1.4rem 1.8rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.25rem;
}
.entry h3 { color: var(--accent-color); font-size: 1.1rem; margin-bottom: 0.5rem; }
.entry ul { padding-left: 1.2rem; }
.entry li + li { margin-top: 0.5rem; }

@media (max-width: 768px) {
    .about-content { flex-direction: column; text-align: center; gap: 1.5rem; }
    .panel { border-radius: 28px; }
    .resume-frame { height: 480px; }
    .topbar a { font-size: 0.8rem; }
}

@media (prefers-reduced-motion: reduce) {
    .orb, .glass { animation: none; }
    .glass, .card, .btn { transition: none; }
    html { scroll-behavior: auto; }
}
