/* ==========================================================================
   Fawnoos — profile page (/misagh)
   Extends css/site.css. Only the pieces this page adds live here.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Profile opener
   -------------------------------------------------------------------------- */
.profile {
    display: grid;
    grid-template-columns: minmax(0, 330px) minmax(0, 1fr);
    gap: clamp(34px, 5vw, 72px);
    align-items: start;
}

.profile__aside {
    position: sticky;
    align-self: start;
    top: calc(var(--header-h) + 24px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 26px;
}

.profile__portrait {
    position: relative;
    width: 100%;
    /* Narrower than the source file (314x347) so the crop can centre the
       face: the head sits ~6% right of the image's own centre. */
    aspect-ratio: 39 / 50;
    border-radius: 190px 190px 26px 26px;
    overflow: hidden;
    background: #f3f1ee;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, .12),
        0 40px 90px -36px rgba(0, 0, 0, .95),
        0 0 70px -22px rgba(232, 137, 12, .68);
    transition: transform .7s var(--ease-out), box-shadow .7s var(--ease-out);
}

.profile__portrait::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(232, 137, 12, .12), transparent 42%, rgba(5, 6, 10, .18));
    pointer-events: none;
}

.profile__portrait:hover {
    transform: translateY(-5px);
    box-shadow:
        0 0 0 1px rgba(232, 137, 12, .42),
        0 46px 100px -36px rgba(0, 0, 0, .95),
        0 0 92px -20px rgba(232, 137, 12, .85);
}

.profile__portrait img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Favour the right edge so the head lands in the middle of the arch. */
    object-position: 93% center;
}

.profile__title {
    font-size: clamp(2.4rem, 5.4vw, 4.1rem);
    letter-spacing: -.026em;
    font-variation-settings: "opsz" 144;
    text-wrap: balance;
}

/* Long-form biography */
.bio {
    font-size: clamp(1.02rem, 1.35vw, 1.14rem);
    line-height: 1.82;
    color: var(--muted);
    max-width: 66ch;
}

.bio p {
    margin: 0 0 1.35em;
}

.bio p:first-of-type {
    font-size: 1.16em;
    line-height: 1.62;
    color: var(--text);
}

.bio a {
    color: var(--ember-300);
    box-shadow: inset 0 -1px 0 0 rgba(232, 137, 12, .38);
    transition: box-shadow .3s var(--ease), color .3s;
}

.bio a:hover {
    color: var(--ember-200);
    box-shadow: inset 0 -2px 0 0 var(--ember);
}

/* The Persian spelling gets its own voice. */
.bio .persian {
    font-size: 1.12em;
    letter-spacing: 0;
    color: var(--ember-200);
    box-shadow: none;
    border-bottom: 1px dotted rgba(232, 137, 12, .55);
    padding-bottom: 1px;
}

.bio .persian:hover {
    box-shadow: none;
    border-bottom-color: var(--ember);
}

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

    .profile__aside {
        position: static;
        max-width: 280px;
        margin-inline: auto;
    }
}

/* --------------------------------------------------------------------------
   2. Open-source projects
   -------------------------------------------------------------------------- */
.projects {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(14px, 1.8vw, 20px);
}

.project {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: clamp(22px, 2.4vw, 30px) 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--glass);
    text-align: center;
    transition: transform .55s var(--ease-out), border-color .45s var(--ease), background .45s var(--ease), box-shadow .55s var(--ease-out);
}

.project:hover {
    transform: translateY(-6px);
    border-color: rgba(232, 137, 12, .34);
    background: var(--glass-hover);
    box-shadow: 0 28px 60px -32px rgba(0, 0, 0, .95), 0 0 40px -22px rgba(232, 137, 12, .55);
}

.project__chip {
    width: 68px;
    height: 68px;
    display: grid;
    place-items: center;
    border-radius: 17px;
    background: linear-gradient(180deg, #fff, #eee8dd);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, .12),
        0 16px 32px -18px rgba(0, 0, 0, .95);
    transition: transform .55s var(--ease-out), box-shadow .55s var(--ease-out);
}

.project__chip img {
    max-width: 42px;
    max-height: 38px;
    width: auto;
    object-fit: contain;
}

.project:hover .project__chip {
    transform: translateY(-3px) scale(1.05);
    box-shadow:
        0 0 0 1px rgba(232, 137, 12, .45),
        0 20px 38px -18px rgba(232, 137, 12, .55);
}

.project__name {
    font-family: var(--font-display);
    font-size: 1.1rem;
    letter-spacing: -.012em;
    font-variation-settings: "opsz" 32;
    transition: color .35s var(--ease);
}

.project:hover .project__name {
    color: var(--ember-200);
}

/* Sits directly under the biography that introduces it. */
.projects--inline {
    margin-top: clamp(46px, 5.5vw, 74px);
}

@media (max-width: 760px) {
    .projects {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* --------------------------------------------------------------------------
   3. Topic cloud
   -------------------------------------------------------------------------- */
.topics {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.topics li {
    display: inline-flex;
    align-items: center;
    padding: 9px 17px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, .028);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--faint);
    transition: color .4s var(--ease), border-color .4s var(--ease), background .4s var(--ease), transform .4s var(--ease-out);
}

/* Every fourth chip carries the ember, so the cloud reads as a cloud
   rather than a uniform grid of pills. */
.topics li:nth-child(4n+1) {
    color: rgba(236, 232, 225, .78);
    border-color: rgba(255, 255, 255, .14);
}

.topics li:nth-child(6n+3) {
    color: var(--ember-300);
    border-color: rgba(232, 137, 12, .3);
    background: rgba(232, 137, 12, .06);
}

.topics li:hover {
    transform: translateY(-2px);
    color: var(--ember-200);
    border-color: rgba(232, 137, 12, .5);
    background: rgba(232, 137, 12, .1);
}

/* --------------------------------------------------------------------------
   4. Presentations
   -------------------------------------------------------------------------- */
.talks {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: clamp(18px, 2.2vw, 26px);
}

.talk {
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}

.talk__frame {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    background:
        linear-gradient(120deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .015)),
        var(--ink-800);
    border-bottom: 1px solid var(--line);
    overflow: hidden;
}

/* Placeholder shimmer while the frame is still deferred. */
.talk__frame::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(60% 60% at 50% 50%, rgba(232, 137, 12, .12), transparent 70%);
    opacity: .9;
}

.talk__frame[data-loaded]::before {
    display: none;
}

.talk__frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.talk__body {
    display: flex;
    flex-direction: column;
    gap: 11px;
    padding: clamp(20px, 2.2vw, 26px);
}

.talk__title {
    font-size: 1.14rem;
    line-height: 1.3;
    letter-spacing: -.012em;
    font-variation-settings: "opsz" 36;
}

.talk__meta {
    align-self: flex-start;
    font-family: var(--font-mono);
    font-size: 9.5px;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--ember);
    padding: 6px 11px;
    border: 1px solid rgba(232, 137, 12, .26);
    border-radius: 999px;
    background: rgba(232, 137, 12, .06);
}

.talk__text {
    margin: 0;
    font-size: .92rem;
    line-height: 1.72;
    color: var(--muted);
}

.talks__note {
    margin: 18px 0 0;
    font-size: .95rem;
    color: var(--muted);
}

.talks__note a {
    color: var(--ember-300);
    box-shadow: inset 0 -1px 0 0 rgba(232, 137, 12, .38);
}

.talks__note a:hover {
    box-shadow: inset 0 -2px 0 0 var(--ember);
}
