/* ── Home page (index.html) — editorial sections layered on the shared design system ── */

/* ── Hero: asymmetric split — kinetic copy left, floating photo collage right ── */
body[data-page="home"] .hero-dynamic {
    min-height: calc(100vh - 220px);
    padding-top: clamp(12px, 2vw, 28px);
}
body[data-page="home"] .hero-inner--dynamic {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: clamp(40px, 6vw, 96px);
    align-items: center;
    text-align: left;
}
body[data-page="home"] .hero-inner--dynamic .hero-bio { margin-left: 0; margin-right: 0; }
body[data-page="home"] .hero-inner--dynamic .btn-group { justify-content: flex-start; }
body[data-page="home"] .hero-inner--dynamic .avatar-social { justify-content: flex-start; margin-top: 26px; }

/* Rotating role line under the heading */
body[data-page="home"] .hero-role-cycle {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 1.6em;
    margin-bottom: 26px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.95rem;
    color: var(--text-2);
}
body[data-page="home"] .hero-role-cycle > span:first-child { color: #0891b2; font-weight: 600; }
body[data-page="home"] .hero-role-word {
    position: relative;
    display: none;
    font-style: italic;
    font-family: 'Fraunces', serif;
    color: var(--text);
    font-weight: 500;
}
body[data-page="home"] .hero-role-word.is-active {
    display: inline-block;
    animation: home-role-in 0.5s ease;
}
@keyframes home-role-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
}

/* Photo collage: bigger frame + floating skill chips */
body[data-page="home"] .hero-visual {
    display: flex;
    justify-content: center;
}
body[data-page="home"] .hero-visual-frame {
    position: relative;
    width: 300px;
    height: 300px;
}
body[data-page="home"] .hero-visual-frame .avatar-wrapper,
body[data-page="home"] .hero-visual-frame .avatar-photo,
body[data-page="home"] .hero-visual-frame .avatar-initials {
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
}
body[data-page="home"] .hero-visual-frame .avatar-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
}
body[data-page="home"] .hero-visual-frame .avatar-wrapper::before {
    content: '';
    position: absolute;
    inset: -18px;
    border: 1px dashed rgba(43,63,234,0.3);
    border-radius: 50%;
    animation: home-spin 26s linear infinite;
}
body[data-page="home"] .hero-chip {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--r-full);
    padding: 8px 14px;
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--text);
    box-shadow: var(--shadow-sm);
    white-space: nowrap;
    animation: home-float 5s ease-in-out infinite;
}
body[data-page="home"] .hero-chip-1 { top: -6px; right: -34px; color: #2B3FEA; animation-delay: 0s; }
body[data-page="home"] .hero-chip-2 { bottom: 36px; left: -56px; color: #0891b2; animation-delay: 1.2s; }
body[data-page="home"] .hero-chip-3 { bottom: -14px; right: 6px; color: #e11d48; animation-delay: 2.4s; }
@keyframes home-float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-9px); }
}

/* Scroll cue beneath the hero */
body[data-page="home"] .hero-scrollcue {
    position: absolute;
    z-index: 1;
    left: 0;
    right: 0;
    bottom: 20px;
    margin-inline: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: fit-content;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    opacity: 0;
    animation: home-pop 0.8s ease forwards;
    animation-delay: 0.9s;
}
body[data-page="home"] .hero-scrollcue i {
    width: 1px;
    height: 22px;
    background: linear-gradient(var(--muted), transparent);
    animation: home-scrolldown 1.8s ease-in-out infinite;
}
@keyframes home-scrolldown {
    0%   { transform: scaleY(0); transform-origin: top; opacity: 1; }
    50%  { transform: scaleY(1); transform-origin: top; opacity: 1; }
    50.01% { transform-origin: bottom; }
    100% { transform: scaleY(0); transform-origin: bottom; opacity: 0.4; }
}

/* Availability badge above the hero label */
body[data-page="home"] .home-badge {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--r-full);
    padding: 8px 16px;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-2);
    margin-bottom: 18px;
    box-shadow: var(--shadow-sm);
}
body[data-page="home"] .home-badge .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #37c47a;
    animation: home-pulse 2s infinite;
}
@keyframes home-pulse { 50% { box-shadow: 0 0 0 5px rgba(55,196,122,0.18); } }

/* Staggered pop-in for the hero */
body[data-page="home"] .home-badge,
body[data-page="home"] .hero-label,
body[data-page="home"] .hero-copy h1,
body[data-page="home"] .hero-role-cycle,
body[data-page="home"] .hero-bio,
body[data-page="home"] .hero-copy .btn-group,
body[data-page="home"] .avatar-social,
body[data-page="home"] .hero-visual {
    opacity: 0;
    animation: home-pop 0.8s ease forwards;
}
body[data-page="home"] .home-badge          { animation-delay: 0.05s; }
body[data-page="home"] .hero-label          { animation-delay: 0.15s; }
body[data-page="home"] .hero-copy h1        { animation-delay: 0.25s; }
body[data-page="home"] .hero-role-cycle     { animation-delay: 0.36s; }
body[data-page="home"] .hero-bio            { animation-delay: 0.46s; }
body[data-page="home"] .hero-visual         { animation-delay: 0.5s; }
body[data-page="home"] .hero-copy .btn-group { animation-delay: 0.64s; }
body[data-page="home"] .avatar-social       { animation-delay: 0.76s; }
@keyframes home-pop {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: none; }
}
@keyframes home-spin { to { transform: rotate(360deg); } }

/* Accent mark for emphasised words inside headings */
body[data-page="home"] main h2 .accent {
    color: #2B3FEA;
    position: relative;
    white-space: nowrap;
}
body[data-page="home"] main h2 .accent::after {
    content: '';
    position: absolute;
    left: -3%; right: -3%; bottom: 0.06em;
    height: 0.3em;
    background: rgba(43,63,234,0.12);
    z-index: -1;
    border-radius: 6px;
    transform: scaleX(0);
    transform-origin: left;
    animation: home-mark 0.7s 1.1s forwards;
}
@keyframes home-mark { to { transform: none; } }

/* Scroll reveal (used by js/home.js) */
body[data-page="home"] .reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.8s cubic-bezier(.2,.7,.3,1), transform 0.8s cubic-bezier(.2,.7,.3,1);
}
body[data-page="home"] .reveal.visible { opacity: 1; transform: none; }

/* ── Marquee ribbon ── */
body[data-page="home"] .home-marquee {
    position: relative;
    z-index: 1;
    overflow: hidden;
    padding: 18px 0;
    background: var(--surface-3);
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
}
body[data-page="home"] .home-marquee-track {
    display: flex;
    gap: 48px;
    white-space: nowrap;
    width: max-content;
    animation: home-scrollX 26s linear infinite;
}
body[data-page="home"] .home-marquee-track span {
    font-family: 'Fraunces', serif;
    font-style: italic;
    font-weight: 500;
    font-size: 1.05rem;
    color: #2B3FEA;
}
body[data-page="home"] .home-marquee-track i {
    font-style: normal;
    color: var(--muted);
    margin-left: 48px;
}
@keyframes home-scrollX { to { transform: translateX(-50%); } }

/* ── Bento grid ── */
body[data-page="home"] .home-bento {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 190px;
    gap: 18px;
}
body[data-page="home"] .b-card {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--r-lg);
    padding: 28px;
    position: relative;
    overflow: hidden;
    transition: transform 0.35s, box-shadow 0.35s;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}
body[data-page="home"] .b-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}
body[data-page="home"] .b-card h3 {
    font-size: 1.05rem;
    margin-bottom: 6px;
}
body[data-page="home"] .b-card p {
    font-size: 0.87rem;
    color: var(--text-2);
}
body[data-page="home"] .b-1 {
    grid-column: span 2;
    grid-row: span 2;
    background: linear-gradient(160deg, rgba(20, 24, 38, 0.72), rgba(20, 24, 38, 0.55)), url('../assets/Office.webp');
    background-size: cover;
    background-position: center;
    color: #fff;
    justify-content: space-between;
}
body[data-page="home"] .b-1 h3 { color: #fff; }
body[data-page="home"] .b-1 p  { color: rgba(255,255,255,0.78); }
body[data-page="home"] .b-1 .b-glyph {
    font-size: 2.2rem;
    color: rgba(255,255,255,0.55);
}
body[data-page="home"] .b-2 { grid-column: span 2; }
body[data-page="home"] .b-3 { background: var(--surface-3); }
body[data-page="home"] .b-4 { background: var(--surface-2); }
body[data-page="home"] .b-5 { margin-top: 18px; justify-content: flex-start; }
body[data-page="home"] .b-big {
    font-family: 'Fraunces', serif;
    font-weight: 500;
    font-size: 2.8rem;
    color: #2B3FEA;
    line-height: 1;
    margin-bottom: 6px;
}
body[data-page="home"] .b-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}
body[data-page="home"] .b-tag {
    background: var(--bg);
    border: 1px solid var(--border-light);
    border-radius: var(--r-full);
    padding: 5px 13px;
    font-size: 0.76rem;
    font-weight: 500;
    color: var(--text-2);
    transition: background 0.25s, border-color 0.25s, color 0.25s;
}
body[data-page="home"] .b-tag:hover {
    background: rgba(43,63,234,0.12);
    border-color: rgba(43,63,234,0.3);
    color: var(--violet);
}

/* ── Experience rows ── */
body[data-page="home"] .home-exp-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 880px;
    margin-bottom: 28px;
}
body[data-page="home"] .home-exp-row {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--r-lg);
    padding: 22px 26px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 22px;
    align-items: center;
    transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}
body[data-page="home"] .home-exp-row:hover {
    border-color: rgba(43,63,234,0.35);
    transform: translateX(8px);
    box-shadow: -10px 14px 36px -20px rgba(43,63,234,0.35);
}
body[data-page="home"] .exp-yr {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    color: #2B3FEA;
    background: var(--surface-3);
    border-radius: 14px;
    padding: 9px 13px;
    white-space: nowrap;
}
body[data-page="home"] .home-exp-row h3 { font-size: 1.05rem; }
body[data-page="home"] .home-exp-row-current { border-color: rgba(43,63,234,0.35); }
body[data-page="home"] .exp-current-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: 8px;
    padding: 3px 10px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #37c47a;
    background: rgba(55,196,122,0.12);
    border-radius: var(--r-full);
    vertical-align: middle;
}
body[data-page="home"] .exp-current-badge::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #37c47a;
}
body[data-page="home"] .home-exp-row .exp-org { color: var(--text-2); font-size: 0.85rem; margin-top: 2px; }
body[data-page="home"] .exp-arrow {
    color: #2B3FEA;
    opacity: 0;
    transform: translateX(-8px);
    transition: 0.3s;
    font-size: 1.15rem;
}
body[data-page="home"] .home-exp-row:hover .exp-arrow { opacity: 1; transform: none; }

/* ── Project cards (home teaser) ── */
body[data-page="home"] #projects .project-visual {
    background-size: cover;
    background-position: center;
}

/* ── AI band ── */
body[data-page="home"] .home-ai-band {
    background: linear-gradient(120deg, #14132b, #241f52);
    color: var(--bg);
    border-radius: var(--r-xl);
    padding: clamp(44px, 6vw, 72px) clamp(28px, 6vw, 64px);
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 48px;
    align-items: center;
    position: relative;
    overflow: hidden;
}
body[data-page="home"] .home-ai-band::before {
    content: '';
    position: absolute;
    width: 420px; height: 420px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(129,140,248,0.32), transparent 70%);
    top: -160px; right: -110px;
}
body[data-page="home"] .home-ai-band .eyebrow-dark {
    background: rgba(129,140,248,0.18);
    color: #c7d2fe;
    border-color: transparent;
}
body[data-page="home"] .home-ai-band h2 {
    color: #fff;
    font-size: clamp(1.7rem, 3.4vw, 2.6rem);
    margin: 16px 0 16px;
}
body[data-page="home"] .home-ai-band .accent-light { color: #c7d2fe; }
body[data-page="home"] .home-ai-band p {
    color: #b8b4d9;
    margin-bottom: 28px;
    max-width: 460px;
}
body[data-page="home"] .home-chat {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(129,140,248,0.25);
    border-radius: var(--r-lg);
    padding: 22px;
    position: relative;
    z-index: 1;
    font-size: 0.87rem;
}
body[data-page="home"] .chat-msg { display: flex; gap: 12px; margin-bottom: 15px; }
body[data-page="home"] .chat-msg:last-child { margin-bottom: 0; }
body[data-page="home"] .chat-av {
    width: 32px; height: 32px;
    border-radius: 10px;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.58rem;
    font-weight: 700;
}
body[data-page="home"] .chat-av-ai { background: linear-gradient(135deg,#a5b4fc,#2B3FEA); color: #14132b; }
body[data-page="home"] .chat-av-u  { background: rgba(255,255,255,0.12); color: #b8b4d9; }
body[data-page="home"] .chat-txt {
    background: rgba(255,255,255,0.07);
    border-radius: 6px 16px 16px 16px;
    padding: 11px 15px;
    color: #ece9fb;
    line-height: 1.55;
}
body[data-page="home"] .chat-typing span {
    display: inline-block;
    width: 5px; height: 5px;
    border-radius: 50%;
    background: #c7d2fe;
    margin-right: 4px;
    animation: home-bounce 1.2s infinite;
}
body[data-page="home"] .chat-typing span:nth-child(2) { animation-delay: 0.15s; }
body[data-page="home"] .chat-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes home-bounce {
    0%, 60%, 100% { transform: none; opacity: 0.4; }
    30%            { transform: translateY(-5px); opacity: 1; }
}

/* ── Contact ── */
body[data-page="home"] .home-contact {
    text-align: center;
    max-width: 640px;
    margin: 0 auto;
}
body[data-page="home"] .home-contact h2 { margin: 16px 0 14px; }
body[data-page="home"] .home-contact p  { color: var(--text-2); margin-bottom: 34px; }
body[data-page="home"] .home-contact-btns { justify-content: center; }

@media (max-width: 960px) {
    body[data-page="home"] .hero-inner--dynamic {
        grid-template-columns: 1fr;
        text-align: center;
    }
    body[data-page="home"] .hero-inner--dynamic .hero-role-cycle,
    body[data-page="home"] .hero-inner--dynamic .btn-group,
    body[data-page="home"] .hero-inner--dynamic .avatar-social {
        justify-content: center;
    }
    body[data-page="home"] .hero-visual { order: -1; margin-bottom: 12px; }
}
@media (max-width: 640px) {
    body[data-page="home"] .hero-visual-frame { width: 190px; height: 190px; }
    body[data-page="home"] .hero-chip { font-size: 0.68rem; padding: 6px 11px; }
    body[data-page="home"] .hero-chip-1 { right: -14px; }
    body[data-page="home"] .hero-chip-2 { left: -26px; }
    body[data-page="home"] .hero-chip-3 { right: -8px; }
}

@media (max-width: 920px) {
    body[data-page="home"] .home-bento { grid-template-columns: repeat(2, 1fr); }
    body[data-page="home"] .b-1, body[data-page="home"] .b-2 { grid-column: span 2; }
    body[data-page="home"] .home-ai-band { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
    body[data-page="home"] .home-bento { grid-template-columns: 1fr; }
    body[data-page="home"] .b-1, body[data-page="home"] .b-2 { grid-column: span 1; }
    body[data-page="home"] .home-exp-row { grid-template-columns: auto 1fr; }
    body[data-page="home"] .exp-arrow { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    body[data-page="home"] .home-badge,
    body[data-page="home"] .hero-label,
    body[data-page="home"] .hero-copy h1,
    body[data-page="home"] .hero-role-cycle,
    body[data-page="home"] .hero-bio,
    body[data-page="home"] .hero-copy .btn-group,
    body[data-page="home"] .avatar-social,
    body[data-page="home"] .hero-visual,
    body[data-page="home"] .hero-scrollcue,
    body[data-page="home"] .reveal {
        opacity: 1;
        transform: none;
        animation: none;
    }
    body[data-page="home"] main h2 .accent::after { transform: none; animation: none; }
    body[data-page="home"] .home-marquee-track,
    body[data-page="home"] .home-badge .dot,
    body[data-page="home"] .avatar-wrapper::before,
    body[data-page="home"] .hero-chip,
    body[data-page="home"] .hero-scrollcue i,
    body[data-page="home"] .hero-role-word,
    body[data-page="home"] .chat-typing span {
        animation: none;
    }
    body[data-page="home"] .hero-role-word { display: none; }
    body[data-page="home"] .hero-role-word.is-active { display: inline-block; }
}