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

html, body {
    width: 100%; height: 100%;
    overflow: hidden;
    background: #000;
}

/* Aurora WebGL canvas — full background */
#aurora-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* Water warp — GPU-only, runs on compositor thread, zero repaint cost */
@keyframes waterWarp {
    0%   { transform: translateX(-50%) skewX(0deg)    scaleY(1.000); }
    20%  { transform: translateX(-50%) skewX(0.35deg) scaleY(1.002); }
    45%  { transform: translateX(-50%) skewX(-0.25deg) scaleY(0.999); }
    70%  { transform: translateX(-50%) skewX(0.18deg) scaleY(1.001); }
    100% { transform: translateX(-50%) skewX(0deg)    scaleY(1.000); }
}

/* Portrait container */
.portrait-container {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    height: 105vh;
    aspect-ratio: 2750 / 1536;
    z-index: 1;
    overflow: hidden;
    filter: url(#chromaAberration);
    animation: waterWarp 9s ease-in-out infinite;
}

/* Base portrait image */
.portrait-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    filter: grayscale(100%);
    display: block;
    z-index: 0;
}

/* Fractal glass wrapper — 112% wide so displacement edge artifacts are hidden */
.wrapper {
    display: flex;
    width: 112%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%) translateZ(0);
    z-index: 1;
    filter: url(#displacementFilter);
    will-change: filter;
}

.cell {
    background-size: cover;
    position: relative;
    overflow: hidden;
    height: 100%;
    transition: filter 0.3s ease, transform 0.3s ease;
    transform-origin: center center;
    will-change: filter, transform;
    backface-visibility: hidden;
}

.cell .shimmer {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0)    72.63%,
        rgba(255, 255, 255, 0.08)  99%,
        rgba(255, 255, 255, 0.6)  100%
    );
    pointer-events: none;
    transition: opacity 0.4s ease;
}


/* ═══════════════════════════════════════════
   macOS-style Dock
═══════════════════════════════════════════ */
.dock {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    align-items: flex-end;
    gap: 16px;
    padding: 14px 28px 16px;
    height: 102px; /* locks bar height: 14 top + 72 base icon + 16 bottom */
    touch-action: none; /* pass all touch events to JS instantly, no browser delay */
    /* Layered glass: outer glow + inner highlight + backdrop */
    background:
        linear-gradient(180deg,
            rgba(255,255,255,0.07) 0%,
            rgba(255,255,255,0.03) 100%);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-bottom-color: rgba(255, 255, 255, 0.06);
    border-radius: 28px;
    backdrop-filter: blur(10px) saturate(1.8) brightness(1.05);
    -webkit-backdrop-filter: blur(10px) saturate(1.8) brightness(1.05);
    overflow: visible;
    /* Ambient shadow so dock reads against any background */
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.45),
        0 2px 8px  rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

/* Thin top-edge specular line */
.dock::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(180deg,
        rgba(255,255,255,0.12) 0px,
        rgba(255,255,255,0)    2px);
    pointer-events: none;
}

.dock-icon {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.10);
    cursor: pointer;
    overflow: hidden;
    transform-origin: bottom center;
    position: relative;
    color: #fff;
    font-size: 22px;
    text-decoration: none;
    will-change: transform, width, height;
    flex-shrink: 0;
    /* Subtle inner ring on each icon */
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.20),
        inset 0 -1px 0 rgba(0,0,0,0.25),
        0 2px 6px rgba(0,0,0,0.35);
}

/* Sheen overlay on icon face */
.dock-icon::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(160deg,
        rgba(255,255,255,0.18) 0%,
        rgba(255,255,255,0)    55%);
    pointer-events: none;
    z-index: 1;
}

/* Wrapper so the label can sit outside overflow:hidden */
.dock-item {
    position: relative;
    display: flex;
    align-items: flex-end;
    will-change: transform;
}

/* Active dot — persistent presence indicator under each icon */
.dock-item::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    transition: background 0.2s, transform 0.2s;
}

.dock-item:hover::after {
    background: rgba(255, 255, 255, 0.75);
    transform: translateX(-50%) scale(1.25);
}

/* Label */
.dock-label {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%) translateY(6px);
    background: rgba(12, 12, 12, 0.78);
    color: rgba(255, 255, 255, 0.92);
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', sans-serif;
    font-size: 11.5px;
    font-weight: 500;
    letter-spacing: 0.015em;
    padding: 5px 11px;
    border-radius: 7px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.12s ease, transform 0.14s ease;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.11);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

/* Small triangle pointer on label */
.dock-label::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(255, 255, 255, 0.09);
}
.dock-label::before {
    content: '';
    position: absolute;
    top: calc(100% - 1px);
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(12, 12, 12, 0.78);
    z-index: 1;
}

.dock-item:hover .dock-label {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    transition: opacity 0.15s ease,
                transform 0.18s cubic-bezier(0.34, 1.5, 0.64, 1);
}

/* ═══════════════════════════════════════════
   Mobile & iPhone — dock sizing only
   (portrait + glass effect identical to desktop)
═══════════════════════════════════════════ */

/* Show touch labels on mobile */
.dock-item.label-visible .dock-label {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    transition: opacity 0.15s ease,
                transform 0.18s cubic-bezier(0.34, 1.5, 0.64, 1);
}

/* Portrait on mobile — container full-screen, image zoomed out independently */
@keyframes waterWarpMobile {
    0%   { transform: translateX(-50%) scaleY(1.000); }
    25%  { transform: translateX(-50%) scaleY(1.002); }
    50%  { transform: translateX(-50%) scaleY(0.999); }
    75%  { transform: translateX(-50%) scaleY(1.001); }
    100% { transform: translateX(-50%) scaleY(1.000); }
}

@media (max-width: 520px) {
    /* Container stays full viewport — aurora fills any transparent gaps */
    .portrait-container {
        height: 105vh;
        filter: none;
        animation: waterWarpMobile 9s ease-in-out infinite;
    }

    /* Scale only the image, anchored to the bottom */
    .portrait-img {
        transform: scale(0.68);
        transform-origin: bottom center;
    }

    /* Hide glass cells — they use container-relative background-size so
       they'd misalign with the scaled img; displacement filter is off anyway */
    .wrapper {
        display: none;
    }
}

/* Scale dock down just enough to fit narrow screens */
@media (max-width: 520px) {
    .dock {
        gap: 10px;
        padding: 10px 18px 12px;
        border-radius: 24px;
        bottom: calc(28px + env(safe-area-inset-bottom));
        height: 84px;
    }

    .dock-icon {
        width: 60px;
        height: 60px;
        border-radius: 15px;
    }

    .dock-icon svg {
        width: 30px !important;
        height: 30px !important;
    }

    .dock-label {
        font-size: 11px;
    }
}


/* ═══════════════════════════════════════════
   Career Pull-Up Sheet
═══════════════════════════════════════════ */

/* Backdrop */
#careerBackdrop {
    position: fixed;
    inset: 0;
    z-index: 199;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

#careerBackdrop.open {
    opacity: 1;
    pointer-events: all;
}

/* Mobile peek handle — sits above dock */
#careerPeek {
    display: none;
    position: fixed;
    bottom: calc(28px + 84px + env(safe-area-inset-bottom) + 10px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 150;
    width: 72px;
    height: 24px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

#careerPeekBar {
    width: 48px;
    height: 4px;
    background: rgba(255, 255, 255, 0.32);
    border-radius: 2px;
    transition: background 0.2s, transform 0.2s;
}

#careerPeek:active #careerPeekBar {
    background: rgba(255, 255, 255, 0.6);
    transform: scaleX(1.1);
}

/* Sheet */
#careerSheet {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    width: min(580px, 92vw);
    height: min(88vh, 740px);
    z-index: 200;
    background: rgba(242, 242, 247, 0.72);
    backdrop-filter: blur(52px) saturate(1.8) brightness(1.08);
    -webkit-backdrop-filter: blur(52px) saturate(1.8) brightness(1.08);
    border-top: 1px solid rgba(255, 255, 255, 0.55);
    border-left: 1px solid rgba(255, 255, 255, 0.35);
    border-right: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 28px 28px 0 0;
    transition: transform 0.52s cubic-bezier(0.32, 0.72, 0, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow:
        0 -2px 32px rgba(0, 0, 0, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.70);
}

#careerSheet.open {
    transform: translateX(-50%) translateY(0);
}

/* Drag handle pill — iOS sheet indicator */
#careerDragHandle {
    width: 36px;
    height: 5px;
    background: rgba(60, 60, 67, 0.22);
    border-radius: 2.5px;
    margin: 10px auto 0;
    flex-shrink: 0;
    cursor: grab;
    transition: background 0.2s;
}

#careerDragHandle:active {
    cursor: grabbing;
    background: rgba(60, 60, 67, 0.36);
}

/* Close button — circular, SF-style */
#careerClose {
    position: absolute;
    top: 14px;
    right: 18px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(116, 116, 128, 0.18);
    color: rgba(60, 60, 67, 0.72);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s;
    -webkit-tap-highlight-color: transparent;
}

#careerClose:hover {
    background: rgba(116, 116, 128, 0.28);
    color: rgba(60, 60, 67, 0.92);
}

/* Scrollable content */
#careerScroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 24px 20px 48px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

#careerScroll::-webkit-scrollbar { display: none; }

/* ── Header — iOS large title style ─────── */
.cr-header {
    padding: 0 4px 24px;
    margin-bottom: 8px;
}

.cr-name {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;
    font-size: 34px;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: rgba(0, 0, 0, 0.85);
    line-height: 1.05;
    margin-bottom: 4px;
}

.cr-role {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', sans-serif;
    font-size: 17px;
    font-weight: 400;
    color: rgba(60, 60, 67, 0.58);
    margin-bottom: 14px;
    letter-spacing: -0.01em;
}

.cr-bio {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: rgba(60, 60, 67, 0.72);
}

/* ── Sections — iOS grouped inset style ──── */
.cr-section {
    margin-bottom: 28px;
}

.cr-section--last {
    margin-bottom: 0;
}

/* iOS grouped section header */
.cr-section-title {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', sans-serif;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: -0.005em;
    text-transform: uppercase;
    color: rgba(60, 60, 67, 0.48);
    margin-bottom: 8px;
    padding: 0 16px;
}

/* ── Grouped list card ───────────────────── */
.cr-items {
    background: rgba(255, 255, 255, 0.62);
    border-radius: 12px;
    overflow: hidden;
    border: 0.5px solid rgba(0, 0, 0, 0.08);
}

.cr-item {
    padding: 12px 16px;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

/* Inset separator — starts at 16px, iOS style */
.cr-item + .cr-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 16px;
    right: 0;
    height: 0.5px;
    background: rgba(60, 60, 67, 0.14);
}

.cr-item-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
}

.cr-item-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.cr-item-role {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', sans-serif;
    font-size: 17px;
    font-weight: 400;
    color: rgba(0, 0, 0, 0.85);
    letter-spacing: -0.022em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cr-item-company {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', sans-serif;
    font-size: 13px;
    font-weight: 400;
    color: #007AFF;
    letter-spacing: -0.008em;
}

.cr-item-date {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', sans-serif;
    font-size: 15px;
    font-weight: 400;
    color: rgba(60, 60, 67, 0.48);
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: -0.01em;
}

.cr-item-desc {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', sans-serif;
    font-size: 13px;
    line-height: 1.55;
    color: rgba(60, 60, 67, 0.58);
    margin-top: 2px;
}

/* ── Skills — iOS token chips ────────────── */
.cr-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 4px;
}

.cr-skill {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', sans-serif;
    font-size: 15px;
    font-weight: 400;
    color: #007AFF;
    background: rgba(0, 122, 255, 0.10);
    border-radius: 8px;
    padding: 6px 12px;
    letter-spacing: -0.01em;
    transition: background 0.15s;
    cursor: default;
    -webkit-tap-highlight-color: transparent;
}

.cr-skill:hover {
    background: rgba(0, 122, 255, 0.17);
}

/* ── Mobile adjustments ─────────────────── */
@media (max-width: 520px) {
    #careerPeek {
        display: flex;
    }

    #careerSheet {
        width: 100%;
        height: 88vh;
        border-radius: 20px 20px 0 0;
        background: rgba(242, 242, 247, 0.82);
    }

    #careerScroll {
        padding: 14px 14px 36px;
    }

    /* Header */
    .cr-header {
        padding: 0 2px 18px;
        margin-bottom: 6px;
    }

    .cr-name {
        font-size: 26px;
        letter-spacing: -0.02em;
    }

    .cr-role {
        font-size: 14px;
        margin-bottom: 10px;
    }

    .cr-bio {
        font-size: 14px;
    }

    /* Sections */
    .cr-section {
        margin-bottom: 22px;
    }

    .cr-section-title {
        font-size: 12px;
        padding: 0 12px;
        margin-bottom: 6px;
    }

    /* List rows */
    .cr-items {
        border-radius: 10px;
    }

    .cr-item {
        padding: 11px 14px;
    }

    /* Stack role/date vertically on mobile */
    .cr-item-top {
        flex-direction: column;
        gap: 1px;
    }

    .cr-item-role {
        font-size: 15px;
    }

    .cr-item-company {
        font-size: 13px;
    }

    .cr-item-date {
        font-size: 12px;
        color: rgba(60, 60, 67, 0.40);
        margin-top: 2px;
    }

    .cr-item-desc {
        font-size: 12.5px;
        margin-top: 4px;
    }

    /* Skills */
    .cr-skills {
        gap: 7px;
        padding: 0 2px;
    }

    .cr-skill {
        font-size: 13.5px;
        padding: 5px 11px;
        border-radius: 7px;
    }
}
