/* ── Base ── */
body {
    margin: 0;
    padding: 0;
    font-family: 'Space Grotesk', sans-serif;
    background-color: #07090f;
    color: #e8e8e8;
    overflow-x: hidden;
}

/* ── Scroll animations ── */
[data-scroll="fade-up"] {
    opacity: 0;
    transform: translateY(36px);
    transition: opacity 0.75s ease var(--d, 0s), transform 0.75s ease var(--d, 0s);
}

[data-scroll="fade-up"].visible {
    opacity: 1;
    transform: translateY(0);
}

/* ── Page hero ── */
.page-hero {
    min-height: calc(100vh - 72px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 16px 8vw 30px;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.page-hero-inner {
    max-width: 900px;
}

.eyebrow {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #5599ff;
    margin-bottom: 2rem;
}

.page-hero-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(4rem, 10vw, 9rem);
    font-weight: 700;
    line-height: 0.95;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    margin: 0 0 2.5rem;
    display: flex;
    flex-direction: column;
}

.hero-line {
    display: block;
    opacity: 0;
    transform: translateY(36px);
    transition: opacity 0.8s ease var(--d, 0s), transform 0.8s ease var(--d, 0s);
}

.hero-line.visible {
    opacity: 1;
    transform: translateY(0);
}

.accent-line {
    color: transparent;
    -webkit-text-stroke: 2px rgba(255, 255, 255, 0.3);
}

.page-hero-sub {
    font-size: clamp(0.8rem, 1.5vw, 1rem);
    font-weight: 300;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease var(--d, 0s), transform 0.8s ease var(--d, 0s);
}

.page-hero-sub.visible {
    opacity: 1;
    transform: translateY(0);
}

.scroll-cube-wrapper {
    position: absolute;
    bottom: 36px;
    left: 8vw;
    z-index: 50;
    pointer-events: none;
    will-change: transform;
}

.scroll-cube {
    width: 48px;
    height: 42px;
    display: block;
    filter: drop-shadow(0 0 8px rgba(85, 153, 255, 0.3));
}

.cube-path {
    stroke: #5599ff;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
    animation: drawCube 1.4s ease forwards;
}

.cube-top {
    fill: rgba(85, 153, 255, 0.12);
    animation-delay: 0.4s;
}

.cube-left {
    fill: rgba(85, 153, 255, 0.05);
    animation-delay: 1.6s;
}

.cube-right {
    fill: rgba(85, 153, 255, 0.08);
    animation-delay: 2.8s;
}

@keyframes drawCube {
    to { stroke-dashoffset: 0; }
}

.scroll-cube-wrapper.cube-animated {
    animation: cubeBounceRotate 1.8s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

@keyframes cubeBounceRotate {
    0% {
        transform: translateY(0) rotate(0deg);
        animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
    }
    50% {
        transform: translateY(-22px) rotate(180deg);
        animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
    }
    100% {
        transform: translateY(0) rotate(360deg);
    }
}

/* ── Bio section ── */
.bio-section {
    padding: 100px 8vw 80px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Lead paragraph */
.bio-lead {
    font-size: clamp(1.1rem, 2vw, 1.3rem);
    line-height: 1.85;
    color: rgba(255, 255, 255, 0.7);
    max-width: 860px;
    margin: 0 0 72px;
    font-weight: 300;
    border-left: 2px solid #5599ff;
    padding-left: 28px;
}

.bio-lead strong {
    color: #ffffff;
    font-weight: 600;
}

/* Main grid: entries + skills */
.bio-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 64px;
    align-items: start;
    margin-bottom: 80px;
}

/* Numbered entries */
.bio-entries {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.bio-entry {
    display: flex;
    gap: 32px;
    align-items: flex-start;
    padding: 36px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.bio-entry:last-child {
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.bio-num {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: #5599ff;
    opacity: 0.6;
    flex-shrink: 0;
    padding-top: 4px;
    width: 28px;
}

.bio-entry-body h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 12px;
    letter-spacing: 0.02em;
}

.bio-entry-body p {
    font-size: 0.97rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.55);
    margin: 0;
}

.bio-entry-body p strong {
    color: rgba(255, 255, 255, 0.85);
    font-weight: 600;
}

/* Skills column */
.bio-skills {
    position: sticky;
    top: 100px;
    padding: 28px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.02);
}

.skills-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #5599ff;
    margin-bottom: 20px;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.09);
    padding: 7px 13px;
    transition: color 0.25s ease, border-color 0.25s ease, background 0.25s ease;
    cursor: default;
}

.tag:hover {
    color: #ffffff;
    border-color: rgba(85, 153, 255, 0.5);
    background: rgba(85, 153, 255, 0.06);
}

/* Personal section */
.bio-personal {
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    padding-top: 56px;
}

.personal-header {
    display: flex;
    align-items: baseline;
    gap: 20px;
    margin-bottom: 40px;
}

.personal-header .bio-num {
    font-size: 0.7rem;
}

.personal-header h3 {
    font-size: clamp(1.2rem, 2.5vw, 1.6rem);
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: -0.01em;
}

.personal-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
}

.personal-item {
    padding: 28px 28px 28px 0;
    border-right: 1px solid rgba(255, 255, 255, 0.07);
    padding-right: 28px;
}

.personal-item:first-child {
    padding-left: 0;
}

.personal-item:last-child {
    border-right: none;
    padding-right: 0;
}

.personal-item:not(:first-child) {
    padding-left: 28px;
}

.personal-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #5599ff;
    margin-bottom: 12px;
}

.personal-item p {
    font-size: 0.88rem;
    line-height: 1.75;
    color: rgba(255, 255, 255, 0.45);
    margin: 0;
}

/* ── Timeline ── */
.timeline-section {
    padding: 80px 8vw 120px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.section-heading {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 700;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: -0.01em;
    margin: 0 0 70px;
}

.timeline {
    position: relative;
    max-width: 860px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 110px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(255, 255, 255, 0.08);
}

.timeline-item {
    display: flex;
    gap: 0;
    align-items: flex-start;
    margin-bottom: 56px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease var(--d, 0s), transform 0.7s ease var(--d, 0s);
}

.timeline-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.tl-year {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: #5599ff;
    text-transform: uppercase;
    width: 110px;
    flex-shrink: 0;
    padding-top: 4px;
}

.tl-body {
    display: flex;
    align-items: flex-start;
    gap: 28px;
    flex: 1;
}

.tl-dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #5599ff;
    margin-top: 6px;
    box-shadow: 0 0 0 3px rgba(85, 153, 255, 0.15);
    transform: translateX(-4px);
}

.tl-content {
    flex: 1;
    padding-bottom: 8px;
}

.tl-logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 90px;
    height: 90px;
    background: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    overflow: hidden;
    cursor: none;
    transition: border-color 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
}

.tl-logo img {
    width: 68px;
    height: 68px;
    object-fit: contain;
    transition: transform 0.25s ease;
}

.tl-logo:hover {
    border-color: rgba(85, 153, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(85, 153, 255, 0.12);
}

.tl-logo:hover img {
    transform: scale(1.08);
}

.tl-logo:active {
    transform: translateY(0) scale(0.95);
    box-shadow: none;
}

.tl-content h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 0.5rem;
}

.tl-content p {
    font-size: 0.92rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.45);
    margin: 0;
}

/* ── Theme light ── */
body.light {
    background-color: #f4f4f8;
    color: #111;
}

body.light .page-hero { border-bottom-color: rgba(0, 0, 0, 0.07); }
body.light .page-hero-title { color: #0a0a0f; }
body.light .accent-line { -webkit-text-stroke-color: rgba(0, 0, 0, 0.18); }
body.light .page-hero-sub { color: rgba(0, 0, 0, 0.4); }
body.light .eyebrow { color: #2266dd; }

body.light .bio-lead { color: rgba(0, 0, 0, 0.65); border-left-color: #2266dd; }
body.light .bio-lead strong { color: #0a0a0f; }
body.light .bio-entry { border-top-color: rgba(0, 0, 0, 0.07); }
body.light .bio-entry:last-child { border-bottom-color: rgba(0, 0, 0, 0.07); }
body.light .bio-num { color: #2266dd; }
body.light .bio-entry-body h3 { color: #0a0a0f; }
body.light .bio-entry-body p { color: rgba(0, 0, 0, 0.55); }
body.light .bio-entry-body p strong { color: #0a0a0f; }

body.light .bio-skills { border-color: rgba(0, 0, 0, 0.07); background: rgba(0, 0, 0, 0.02); }
body.light .skills-label { color: #2266dd; }
body.light .tag { color: rgba(0, 0, 0, 0.55); border-color: rgba(0, 0, 0, 0.1); }
body.light .tag:hover { color: #0a0a0f; border-color: rgba(34, 102, 221, 0.4); background: rgba(34, 102, 221, 0.05); }

body.light .bio-personal { border-top-color: rgba(0, 0, 0, 0.07); }
body.light .personal-header h3 { color: #0a0a0f; }
body.light .personal-header .bio-num { color: #2266dd; }
body.light .personal-item { border-right-color: rgba(0, 0, 0, 0.07); }
body.light .personal-label { color: #2266dd; }
body.light .personal-item p { color: rgba(0, 0, 0, 0.45); }

body.light .timeline-section { border-top-color: rgba(0, 0, 0, 0.07); }
body.light .timeline::before { background: rgba(0, 0, 0, 0.08); }
body.light .section-heading { color: #0a0a0f; }
body.light .tl-year { color: #2266dd; }
body.light .tl-dot { background: #2266dd; box-shadow: 0 0 0 3px rgba(34, 102, 221, 0.12); }
body.light .tl-content h3 { color: #0a0a0f; }
body.light .tl-content p { color: rgba(0, 0, 0, 0.45); }

/* ── Responsive ── */
@media (max-width: 1000px) {
    .bio-grid {
        grid-template-columns: 1fr;
        gap: 48px;
    }
    .bio-skills {
        position: static;
    }
    .personal-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0;
    }
    .personal-item:nth-child(2) {
        border-right: none;
        padding-right: 0;
    }
    .personal-item:nth-child(3) {
        padding-left: 0;
        border-right: 1px solid rgba(255, 255, 255, 0.07);
        border-top: 1px solid rgba(255, 255, 255, 0.07);
    }
    body.light .personal-item:nth-child(3) {
        border-right-color: rgba(0, 0, 0, 0.07);
        border-top-color: rgba(0, 0, 0, 0.07);
    }
    .personal-item:nth-child(4) {
        border-right: none;
        padding-right: 0;
        border-top: 1px solid rgba(255, 255, 255, 0.07);
    }
    body.light .personal-item:nth-child(4) {
        border-top-color: rgba(0, 0, 0, 0.07);
    }
}

@media (max-width: 700px) {
    .page-hero { padding: 60px 6vw 50px; }
    .bio-section { padding: 70px 6vw 60px; }
    .timeline-section { padding: 60px 6vw 80px; }

    .bio-lead { padding-left: 20px; }

    .personal-grid {
        grid-template-columns: 1fr;
    }
    .personal-item {
        border-right: none !important;
        padding-right: 0 !important;
        padding-left: 0 !important;
        border-top: 1px solid rgba(255, 255, 255, 0.07);
    }
    body.light .personal-item { border-top-color: rgba(0, 0, 0, 0.07); }
    .personal-item:first-child { border-top: none; }

    .timeline::before { display: none; }
    .timeline-item { flex-direction: column; gap: 8px; }
    .tl-year { width: auto; }
    .tl-dot { display: none; }
}
