/* ==========================================================================
   mshamia.com — site styles
   Palette drawn from the portrait: espresso dark, warm paper light, lamp amber.
   ========================================================================== */

:root {
    --bg: #f6f2ec;
    --bg-alt: #efe9e0;
    --surface: #fffdf9;
    --border: #e2d9cc;
    --text: #1f1a16;
    --text-2: #5a5048;
    --text-3: #857a70;
    --accent: #b5651d;
    --accent-2: #8f4d12;
    --accent-soft: rgba(181, 101, 29, .10);
    --chip-bg: #f3ece2;
    --shadow: 0 1px 2px rgba(40, 28, 16, .04), 0 8px 24px rgba(40, 28, 16, .06);
    --topbar-bg: rgba(246, 242, 236, .82);

    --font-display: "Fraunces", Georgia, "Times New Roman", serif;
    --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;

    --radius: 14px;
    --wrap: 1120px;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #14110f;
        --bg-alt: #1a1613;
        --surface: #201b17;
        --border: #342c25;
        --text: #f1e9df;
        --text-2: #c2b6a8;
        --text-3: #8f8377;
        --accent: #f0a04b;
        --accent-2: #ffbe73;
        --accent-soft: rgba(240, 160, 75, .12);
        --chip-bg: #2a231d;
        --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .25);
        --topbar-bg: rgba(20, 17, 15, .78);
        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --bg: #14110f;
    --bg-alt: #1a1613;
    --surface: #201b17;
    --border: #342c25;
    --text: #f1e9df;
    --text-2: #c2b6a8;
    --text-3: #8f8377;
    --accent: #f0a04b;
    --accent-2: #ffbe73;
    --accent-soft: rgba(240, 160, 75, .12);
    --chip-bg: #2a231d;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .25);
    --topbar-bg: rgba(20, 17, 15, .78);
    color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

h1, h2, h3, h4 { margin: 0; color: var(--text); line-height: 1.2; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
svg { width: 1em; height: 1em; flex: none; }
strong { font-weight: 600; color: var(--text); }
time { font-family: var(--font-mono); font-size: .8rem; color: var(--text-3); letter-spacing: .02em; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
@media (min-width: 640px) { .wrap { padding: 0 32px; } }

.muted { color: var(--text-3); font-weight: 400; }

.skip {
    position: absolute; left: 16px; top: -60px; z-index: 100;
    background: var(--accent); color: #fff; padding: 8px 14px; border-radius: 8px;
}
.skip:focus { top: 12px; }

/* ---------- Top bar ---------- */
.topbar {
    position: sticky; top: 0; z-index: 50;
    background: var(--topbar-bg);
    backdrop-filter: saturate(160%) blur(14px);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    border-bottom: 1px solid transparent;
    transition: border-color .2s;
}
.topbar.scrolled { border-bottom-color: var(--border); }
.topbar-inner { display: flex; align-items: center; gap: 24px; height: 64px; }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.brand-mark {
    display: grid; place-items: center;
    width: 34px; height: 34px; border-radius: 9px;
    background: var(--text); color: var(--bg);
    font-family: var(--font-display); font-size: .95rem; letter-spacing: .02em;
}
.brand-name { font-size: .95rem; }

.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a {
    padding: 8px 12px; border-radius: 8px;
    font-size: .9rem; color: var(--text-2);
    transition: color .15s, background .15s;
}
.nav a:hover { color: var(--text); background: var(--accent-soft); }
.nav a.active { color: var(--accent); }

.topbar-actions { display: flex; gap: 6px; }
.icon-btn {
    display: grid; place-items: center;
    width: 38px; height: 38px; border-radius: 10px;
    border: 1px solid var(--border); background: var(--surface);
    color: var(--text-2); cursor: pointer; font-size: 18px;
    transition: color .15s, border-color .15s;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }
.icon-moon { display: none; }
:root[data-theme="dark"] .icon-sun { display: none; }
:root[data-theme="dark"] .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .icon-sun { display: none; }
    :root:not([data-theme="light"]) .icon-moon { display: block; }
}
.menu-btn { display: none; }

@media (max-width: 760px) {
    .brand-name { display: none; }
    .menu-btn { display: grid; }
    .topbar-actions { margin-left: auto; }
    .nav {
        position: absolute; top: 64px; left: 0; right: 0;
        flex-direction: column; gap: 0; margin: 0;
        padding: 8px 16px 16px;
        background: var(--bg); border-bottom: 1px solid var(--border);
        display: none;
    }
    .nav.open { display: flex; }
    .nav a { padding: 12px; font-size: 1rem; }
}

/* ---------- Hero ---------- */
.hero { padding: 56px 0 24px; position: relative; }
.hero::before {
    content: ""; position: absolute; inset: 0 0 auto auto;
    width: min(720px, 90vw); height: 520px; pointer-events: none;
    background: radial-gradient(closest-side, var(--accent-soft), transparent 70%);
    transform: translate(15%, -20%);
}
.hero-grid { display: grid; gap: 40px; align-items: center; position: relative; }
@media (min-width: 900px) {
    .hero { padding: 88px 0 32px; }
    .hero-grid { grid-template-columns: 1.35fr 1fr; gap: 64px; }
}

.eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--font-mono); font-size: .8rem; color: var(--text-3);
    text-transform: uppercase; letter-spacing: .08em; margin-bottom: 20px;
}
.eyebrow svg { color: var(--accent); }

.hero h1 {
    font-family: var(--font-display); font-weight: 500;
    font-size: clamp(2.6rem, 7vw, 4.6rem); letter-spacing: -.02em; line-height: 1.02;
}
.hero h1 em { font-style: italic; color: var(--accent); }

.role { margin-top: 16px; font-size: clamp(1.05rem, 2.2vw, 1.25rem); font-weight: 500; color: var(--text-2); }
.role span { color: var(--accent); margin: 0 4px; }

.lede { margin-top: 20px; max-width: 60ch; color: var(--text-2); font-size: 1.04rem; }

.platforms { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.platforms li {
    font-family: var(--font-mono); font-size: .78rem;
    padding: 5px 10px; border-radius: 999px;
    border: 1px solid var(--border); color: var(--text-2);
}

.cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    height: 46px; padding: 0 20px; border-radius: 12px;
    font-weight: 500; font-size: .95rem;
    transition: transform .15s, background .15s, border-color .15s, color .15s;
}
.btn svg { font-size: 1.1rem; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #fff; }
:root[data-theme="dark"] .btn-primary { color: #1a120a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-primary { color: #1a120a; } }
.btn-primary:hover { background: var(--accent-2); }
.btn-ghost { border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.portrait { margin: 0; position: relative; max-width: 420px; justify-self: center; width: 100%; }
.portrait::after {
    content: ""; position: absolute; inset: 14px -14px -14px 14px;
    border: 1px solid var(--accent); border-radius: 22px; opacity: .45; z-index: -1;
}
.portrait img {
    width: 100%; height: auto; aspect-ratio: 1; object-fit: cover;
    border-radius: 22px; box-shadow: var(--shadow);
}
@media (max-width: 899px) { .portrait { max-width: 300px; order: -1; justify-self: start; } }

.stats {
    display: grid; grid-template-columns: repeat(2, 1fr);
    margin: 56px 0 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.stats > div { padding: 22px 0; }
.stats > div:nth-child(odd) { padding-right: 16px; }
.stats > div:nth-child(n+3) { border-top: 1px solid var(--border); }
@media (min-width: 760px) {
    .stats { grid-template-columns: repeat(4, 1fr); }
    .stats > div { padding: 26px 24px; border-left: 1px solid var(--border); }
    .stats > div:first-child { border-left: 0; padding-left: 0; }
    .stats > div:nth-child(n+3) { border-top: 0; }
}
.stats dd {
    margin: 0; order: -1;
    font-family: var(--font-display); font-size: clamp(2.2rem, 5vw, 3rem); font-weight: 500; line-height: 1;
}
.stats dd span { color: var(--accent); }
.stats > div { display: flex; flex-direction: column; gap: 8px; }
.stats dt { font-size: .85rem; color: var(--text-3); }

/* ---------- Sections ---------- */
.section { padding: 88px 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.section-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 48px; }
.section-num { font-family: var(--font-mono); font-size: .85rem; color: var(--accent); }
.section-head h2 {
    font-family: var(--font-display); font-weight: 500;
    font-size: clamp(2rem, 4.5vw, 2.8rem); letter-spacing: -.015em;
}

.subhead {
    font-family: var(--font-mono); font-weight: 500; font-size: .8rem;
    text-transform: uppercase; letter-spacing: .1em; color: var(--text-3);
    margin: 64px 0 20px;
}

/* ---------- Experience ---------- */
.org {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 28px 22px; box-shadow: var(--shadow);
}
.org + .org { margin-top: 20px; }
@media (min-width: 760px) { .org { padding: 36px 40px; } }

.org-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.org-head h3 { font-family: var(--font-display); font-weight: 500; font-size: 1.6rem; }
.org-meta { margin-top: 4px; color: var(--text-3); font-size: .92rem; }
.tenure {
    font-family: var(--font-mono); font-size: .75rem; color: var(--accent);
    background: var(--accent-soft); padding: 5px 10px; border-radius: 999px; white-space: nowrap;
}

.timeline { margin-top: 32px; position: relative; }
.timeline > li { position: relative; padding: 0 0 32px 30px; }
.timeline > li:last-child { padding-bottom: 0; }
.timeline > li::before {
    content: ""; position: absolute; left: 5px; top: 22px; bottom: -6px;
    width: 1px; background: var(--border);
}
.timeline > li:last-child::before { display: none; }
.timeline > li::after {
    content: ""; position: absolute; left: 0; top: 8px;
    width: 11px; height: 11px; border-radius: 50%;
    background: var(--surface); border: 2px solid var(--text-3);
}
.timeline > li.current::after { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); }

.tl-head { display: flex; justify-content: space-between; align-items: baseline; gap: 4px 16px; flex-wrap: wrap; margin-bottom: 10px; }
.tl-head h4 { font-size: 1.08rem; font-weight: 600; }
.timeline > li.current .tl-head h4 { color: var(--accent); }

.timeline ul li, .plain li {
    position: relative; padding-left: 18px; margin-top: 8px;
    color: var(--text-2); font-size: .96rem;
}
.timeline ul li::before, .plain li::before {
    content: ""; position: absolute; left: 0; top: .72em;
    width: 7px; height: 1px; background: var(--accent);
}
.plain { margin-top: 18px; }

.stack {
    margin-top: 14px; font-size: .85rem; color: var(--text-3);
    font-family: var(--font-mono); line-height: 1.7;
}
.stack span { color: var(--accent); margin-right: 6px; }

.earlier { display: grid; gap: 16px; }
@media (min-width: 760px) { .earlier { grid-template-columns: repeat(3, 1fr); } }
.card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 24px;
    transition: border-color .2s, transform .2s;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card h4 { margin-top: 10px; font-size: 1.05rem; font-weight: 600; }
.card-org { color: var(--accent); font-size: .88rem; margin: 2px 0 12px; }
.card p:last-child { color: var(--text-2); font-size: .92rem; }

/* ---------- Expertise ---------- */
.skills { display: grid; gap: 16px; }
@media (min-width: 640px) { .skills { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .skills { grid-template-columns: repeat(3, 1fr); } }

.skill-group {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 22px;
}
.skill-group h3 { font-size: 1rem; font-weight: 600; margin-bottom: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips li {
    font-size: .84rem; padding: 5px 11px; border-radius: 8px;
    background: var(--chip-bg); color: var(--text-2);
    border: 1px solid transparent; transition: border-color .15s, color .15s;
}
.chips li:hover { border-color: var(--accent); color: var(--text); }

.strengths { display: grid; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; counter-reset: s; }
@media (min-width: 640px) { .strengths { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .strengths { grid-template-columns: repeat(5, 1fr); } }
.strengths li { background: var(--surface); padding: 24px 22px; counter-increment: s; }
.strengths li::before {
    content: counter(s, decimal-leading-zero);
    display: block; font-family: var(--font-mono); font-size: .8rem; color: var(--accent); margin-bottom: 14px;
}
.strengths h4 { font-size: 1rem; font-weight: 600; margin-bottom: 6px; }
.strengths p { font-size: .9rem; color: var(--text-2); }

/* ---------- Credentials ---------- */
.cred-grid { display: grid; gap: 48px; }
@media (min-width: 900px) { .cred-grid { grid-template-columns: 1.3fr 1fr; gap: 64px; } }
.cred-col > div + div { margin-top: 48px; }

.col-title {
    font-family: var(--font-mono); font-weight: 500; font-size: .8rem;
    text-transform: uppercase; letter-spacing: .1em; color: var(--text-3);
    padding-bottom: 14px; border-bottom: 1px solid var(--border);
}

.certs li {
    display: grid; grid-template-columns: 96px 1fr; gap: 16px; align-items: baseline;
    padding: 16px 0; border-bottom: 1px solid var(--border);
}
.certs li > div { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.certs strong { font-weight: 500; font-size: .98rem; }
.issuer {
    font-family: var(--font-mono); font-size: .72rem; color: var(--text-3);
    text-transform: uppercase; letter-spacing: .06em;
}
.issuer-google, .issuer-ms { color: var(--accent); }
@media (max-width: 520px) {
    .certs li { grid-template-columns: 1fr; gap: 4px; }
    .certs li > div { flex-direction: column; gap: 2px; }
}

.edu li { display: grid; gap: 2px; padding: 18px 0; border-bottom: 1px solid var(--border); }
.edu strong { font-family: var(--font-display); font-weight: 500; font-size: 1.25rem; }
.edu span { color: var(--text-2); font-size: .92rem; }

.hacks { display: grid; gap: 12px; margin-top: 18px; }
.hacks a {
    display: block; padding: 18px 20px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    transition: border-color .2s, transform .2s;
}
.hacks a:hover { border-color: var(--accent); transform: translateY(-2px); }
.hack-head { display: flex; justify-content: space-between; align-items: center; }
.hack-head strong { font-size: 1.05rem; }
.hack-head svg { color: var(--text-3); transition: color .2s, transform .2s; }
.hacks a:hover .hack-head svg { color: var(--accent); transform: translate(2px, -2px); }
.hack-meta { display: block; font-family: var(--font-mono); font-size: .75rem; color: var(--accent); margin: 2px 0 8px; }
.hacks p { font-size: .9rem; color: var(--text-2); }

/* ---------- Contact ---------- */
.contact { background: var(--bg-alt); border-top: 1px solid var(--border); }
.contact-lede { margin: -28px 0 32px; color: var(--text-2); font-size: 1.1rem; }
.contact-grid { display: grid; gap: 16px; }
@media (min-width: 760px) { .contact-grid { grid-template-columns: repeat(3, 1fr); } }
.contact-card {
    display: flex; flex-direction: column; gap: 4px;
    padding: 24px; border-radius: var(--radius);
    background: var(--surface); border: 1px solid var(--border);
    transition: border-color .2s, transform .2s;
    min-width: 0;
}
.contact-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.contact-card svg { font-size: 1.4rem; color: var(--accent); margin-bottom: 14px; }
.contact-label { font-family: var(--font-mono); font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); }
.contact-value { font-weight: 500; overflow-wrap: anywhere; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 28px 0; font-size: .88rem; color: var(--text-3); }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer a:hover { color: var(--accent); }

/* ---------- Reveal on scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .js .reveal { opacity: 1; transform: none; transition: none; }
    *, *::before, *::after { transition: none !important; }
}

@media print {
    .topbar, .cta, .footer, .hero::before { display: none; }
    .section { padding: 32px 0; }
    .js .reveal { opacity: 1; transform: none; }
}
