/* =========================================
   THEMES
   One theme is picked at random per visit (see index.html).
   All share the same layout; only tokens change.
   ========================================= */

:root,
.theme-slate {
    --bg: #1d1f22;
    --surface: #26292d;
    --text: #ecebe8;
    --muted: #a3a6ab;
    --line: #363a3f;
    --accent: #5ab4e5;
    --accent-soft: #233340;
    --accent-ink: #10181f;
    --font-display: 'Inter', 'Heebo', sans-serif;
    --display-weight: 700;
}

.theme-navy {
    --bg: #0f1b2d;
    --surface: #15243a;
    --text: #e9edf3;
    --muted: #9ba8ba;
    --line: #22334d;
    --accent: #c8a96a;
    --accent-soft: #1c2d47;
    --accent-ink: #111b29;
    --font-display: 'Source Serif 4', 'Frank Ruhl Libre', Georgia, serif;
    --display-weight: 600;
}

:root {
    --font-body: 'Inter', 'Heebo', system-ui, sans-serif;
    --radius: 10px;
    --max: 1120px;
}

/* =========================================
   BASE
   ========================================= */

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    font-size: 17px;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
}

ul {
    list-style: none;
}

h1,
h2,
h3 {
    font-family: var(--font-display);
    font-weight: var(--display-weight);
    line-height: 1.15;
    letter-spacing: -0.01em;
}

.container {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 24px;
}

.eyebrow {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 14px;
}

section {
    padding: 88px 0;
    border-top: 1px solid var(--line);
}

.section-head {
    margin-bottom: 44px;
    max-width: 720px;
}

.section-head h2 {
    font-size: clamp(1.8rem, 3vw, 2.4rem);
}

.section-head p {
    color: var(--muted);
    margin-top: 12px;
}

/* =========================================
   HEADER
   ========================================= */

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    gap: 16px;
}

.wordmark {
    font-family: var(--font-display);
    font-weight: var(--display-weight);
    font-size: 1.15rem;
    text-decoration: none;
    white-space: nowrap;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 26px;
    font-size: 0.93rem;
}

.site-nav a {
    text-decoration: none;
    color: var(--muted);
    transition: color 0.2s;
}

.site-nav a:hover {
    color: var(--text);
}

/* =========================================
   HERO
   ========================================= */

.hero {
    border-top: none;
    padding: 72px 0 80px;
}

.hero .container {
    display: grid;
    grid-template-columns: 1.25fr 1fr;
    gap: 64px;
    align-items: center;
}

.hero h1 {
    font-size: clamp(2.6rem, 5.5vw, 4rem);
    margin-bottom: 22px;
}

.hero .lede {
    font-size: 1.2rem;
    color: var(--muted);
    max-width: 34em;
    margin-bottom: 28px;
}

.roles {
    display: grid;
    gap: 8px;
    margin-bottom: 34px;
}

.roles li {
    display: flex;
    align-items: baseline;
    gap: 12px;
    font-weight: 500;
}

.roles li::before {
    content: '';
    flex: none;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    transform: translateY(-2px);
}

.roles a {
    text-decoration: none;
    border-bottom: 1px solid var(--line);
}

.roles a:hover {
    border-color: var(--accent);
}

.actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 11px 20px;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.95rem;
    text-decoration: none;
    border: 1px solid var(--line);
    transition: border-color 0.2s, background 0.2s, opacity 0.2s;
}

.btn:hover {
    border-color: var(--accent);
}

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
}

.btn-primary:hover {
    opacity: 0.9;
}

.icon-links {
    display: flex;
    gap: 6px;
    margin-inline-start: 6px;
}

.icon-links a {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: var(--muted);
    text-decoration: none;
    font-size: 1.15rem;
    transition: color 0.2s, background 0.2s;
}

.icon-links a:hover {
    color: var(--text);
    background: var(--accent-soft);
}

.portrait {
    position: relative;
}

.portrait img {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    object-position: 50% 30%;
    border-radius: 14px;
    box-shadow: 0 24px 48px -24px rgba(0, 0, 0, 0.45);
}

/* =========================================
   STATS
   ========================================= */

.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.stat {
    padding: 28px 24px;
}

.stat + .stat {
    border-inline-start: 1px solid var(--line);
}

.stat strong {
    display: block;
    font-family: var(--font-display);
    font-weight: var(--display-weight);
    font-size: 2.2rem;
    line-height: 1.1;
    color: var(--accent);
    margin-bottom: 6px;
}

.stat span {
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.45;
    display: block;
}

.stats-wrap {
    padding: 0 0 8px;
    border-top: none;
}

/* =========================================
   ABOUT + PILLARS
   ========================================= */

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 64px;
}

.about-text p {
    margin-bottom: 18px;
    font-size: 1.08rem;
}

.about-text p:first-child {
    font-family: var(--font-display);
    font-size: 1.4rem;
    line-height: 1.45;
}

.pillars {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 56px;
}

.pillar {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 28px;
}

.pillar i {
    color: var(--accent);
    font-size: 1.2rem;
    margin-bottom: 16px;
    display: block;
}

.pillar h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.pillar p {
    color: var(--muted);
    font-size: 0.97rem;
}

/* =========================================
   EXPERIENCE
   ========================================= */

.exp-grid {
    display: grid;
    grid-template-columns: 1.55fr 1fr;
    gap: 56px;
    align-items: start;
}

/* Career timeline */
.timeline {
    list-style: none;
    position: relative;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 40px;
    bottom: 24px;
    left: 21px;
    width: 1px;
    background: var(--line);
}

.tl-label {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    padding-left: 64px;
    margin: 8px 0 14px;
}

.tl-label + .tl-item {
    padding-top: 0;
}

.tl-item + .tl-label {
    margin-top: 28px;
}

.tl-item {
    position: relative;
    display: grid;
    grid-template-columns: 44px 1fr;
    gap: 20px;
    padding: 14px 0 22px;
}

.tl-mark {
    position: relative;
    z-index: 1;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--muted);
    font-family: var(--font-display);
    font-weight: var(--display-weight);
    font-size: 1.05rem;
}

.tl-item.is-current .tl-mark {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
}

.tl-item h3 {
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 2px;
}

.tl-org {
    color: var(--accent);
    font-weight: 500;
    margin-top: 2px;
}

.tl-org span {
    color: var(--muted);
    font-weight: 400;
}

.tl-org a,
.tl-note a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid currentColor;
}

.tl-note {
    color: var(--muted);
    font-size: 0.95rem;
    margin-top: 8px;
    max-width: 52ch;
}

.tag {
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-soft);
    border-radius: 999px;
    padding: 3px 10px;
}

/* Side cards */
.exp-side {
    display: grid;
    gap: 20px;
}

.side-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 26px 28px;
}

.side-card h3 {
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.side-card h3 i {
    color: var(--accent);
    font-size: 0.95rem;
}

.side-card li + li {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.side-card li strong {
    display: block;
    font-weight: 600;
    line-height: 1.4;
}

.side-card li span {
    color: var(--muted);
    font-size: 0.92rem;
}

/* =========================================
   FEATURE (mashlom.me)
   ========================================= */

.feature {
    background: var(--surface);
}

.feature-grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 64px;
    align-items: center;
}

.feature-title {
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    margin-bottom: 20px;
}

.feature-text p {
    margin-bottom: 18px;
}

.feature-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin: 30px 0;
}

.feature-stats div {
    background: var(--accent-soft);
    border-radius: var(--radius);
    padding: 18px 20px;
}

.feature-stats strong {
    display: block;
    font-family: var(--font-display);
    font-weight: var(--display-weight);
    font-size: 1.8rem;
    line-height: 1.1;
    color: var(--accent);
}

.feature-stats span {
    font-size: 0.88rem;
    color: var(--muted);
}

figure img {
    width: 100%;
    border-radius: 14px;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

figcaption {
    margin-top: 12px;
    font-size: 0.88rem;
    color: var(--muted);
}

.text-link {
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
}

.text-link:hover {
    text-decoration: underline;
}

/* =========================================
   TEACHING & RESEARCH
   ========================================= */

.share-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}

.video {
    text-decoration: none;
    display: block;
}

.video .thumb {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: var(--line);
}

.video .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}

.video .thumb::after {
    content: '\f04b';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    inset: auto auto 12px 12px;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 0.8rem;
}

.video:hover .thumb img {
    transform: scale(1.03);
}

.video h3 {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1rem;
    margin-top: 12px;
}

.video p {
    color: var(--muted);
    font-size: 0.9rem;
}

.resources {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 22px;
    margin-top: 44px;
}

.resource {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
    background: var(--surface);
}

.resource .eyebrow {
    margin-bottom: 8px;
}

.resource h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.resource p {
    color: var(--muted);
    font-size: 0.93rem;
    margin-bottom: 12px;
}

.resource ul li + li {
    margin-top: 6px;
}

/* =========================================
   BEYOND WORK
   ========================================= */

.moments {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}

.moments img {
    aspect-ratio: 1 / 1;
}

/* =========================================
   CONTACT + FOOTER
   ========================================= */

.contact {
    text-align: center;
}

.contact .section-head {
    margin: 0 auto 32px;
}

.contact .actions {
    justify-content: center;
}

.site-footer {
    border-top: 1px solid var(--line);
    padding: 28px 0;
    color: var(--muted);
    font-size: 0.85rem;
    text-align: center;
}

/* =========================================
   RESPONSIVE
   ========================================= */

@media (max-width: 900px) {
    .site-nav a {
        display: none;
    }

    .hero .container,
    .about-grid,
    .exp-grid,
    .feature-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .hero {
        padding-top: 40px;
    }

    .portrait {
        order: -1;
        max-width: 280px;
    }

    .portrait img {
        aspect-ratio: 1 / 1;
    }

    .about-grid .section-head {
        margin-bottom: 0;
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat:nth-child(3) {
        border-inline-start: none;
    }

    .stat:nth-child(n + 3) {
        border-top: 1px solid var(--line);
    }

    .share-grid,
    .resources,
    .moments {
        grid-template-columns: 1fr;
    }

    section {
        padding: 64px 0;
    }
}

@media (max-width: 560px) {
    body {
        font-size: 16px;
    }

    .container {
        padding: 0 16px;
    }

    .pillars,
    .feature-stats {
        grid-template-columns: 1fr;
    }

    .stat {
        padding: 20px 14px;
    }

    .stat strong {
        font-size: 1.7rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    * {
        transition: none !important;
    }
}
