/* =========================================================
   Calvin Andoh — Portfolio Design System
   Single shared stylesheet for all pages.
   ========================================================= */

/* ---------- Design tokens ---------- */
:root {
    --bg: #faf8f5;
    --bg-alt: #f2efe9;
    --surface: #ffffff;
    --surface-2: #ffffff;
    --text: #1b1712;
    --text-muted: #6c655d;
    --border: rgba(20, 16, 12, 0.10);
    --border-strong: rgba(20, 16, 12, 0.16);

    --accent: #f2711c;
    --accent-2: #f5a623;
    --accent-soft: rgba(242, 113, 28, 0.10);
    --accent-ring: rgba(242, 113, 28, 0.28);
    --gradient: linear-gradient(135deg, #f2711c 0%, #f5a623 100%);

    --shadow-sm: 0 1px 2px rgba(20, 16, 12, 0.05), 0 2px 8px rgba(20, 16, 12, 0.05);
    --shadow-md: 0 4px 12px rgba(20, 16, 12, 0.07), 0 12px 32px rgba(20, 16, 12, 0.07);
    --shadow-lg: 0 10px 30px rgba(20, 16, 12, 0.10), 0 24px 60px rgba(20, 16, 12, 0.10);

    --radius: 16px;
    --radius-sm: 10px;
    --radius-lg: 24px;
    --maxw: 1140px;
    --nav-h: 68px;

    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Quicksand', 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
}

[data-theme="dark"] {
    --bg: #0e1013;
    --bg-alt: #14171c;
    --surface: #16191f;
    --surface-2: #1b1f26;
    --text: #ecebe8;
    --text-muted: #9aa1ab;
    --border: rgba(255, 255, 255, 0.09);
    --border-strong: rgba(255, 255, 255, 0.16);

    --accent: #fb8c3c;
    --accent-2: #fbbf47;
    --accent-soft: rgba(251, 140, 60, 0.14);
    --accent-ring: rgba(251, 140, 60, 0.32);
    --gradient: linear-gradient(135deg, #fb8c3c 0%, #fbbf47 100%);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.45), 0 14px 36px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5), 0 28px 64px rgba(0, 0, 0, 0.55);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
    transition: background-color 0.4s ease, color 0.4s ease;
}

h1, h2, h3, h4, h5 { font-family: var(--font-display); font-weight: 700; line-height: 1.15; margin: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
::selection { background: var(--accent-soft); color: var(--accent); }

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

/* soft background glow behind page */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(60% 45% at 85% -5%, var(--accent-soft), transparent 60%),
        radial-gradient(50% 40% at 0% 0%, var(--accent-soft), transparent 55%);
    opacity: 0.9;
}

/* ---------- Header / nav ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--bg); /* fallback for browsers without color-mix */
    background: color-mix(in srgb, var(--bg) 78%, transparent);
    backdrop-filter: saturate(1.6) blur(14px);
    -webkit-backdrop-filter: saturate(1.6) blur(14px);
    border-bottom: 1px solid var(--border);
}

.nav {
    height: var(--nav-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; letter-spacing: 0.2px; }
.brand img { width: 34px; height: 34px; border-radius: 50%; }

.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links .btn-resume { display: none; } /* desktop: use the one in .nav-actions */
.nav-links a.navlink {
    padding: 8px 14px;
    border-radius: 999px;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s ease, background-color 0.2s ease;
}
.nav-links a.navlink:hover { color: var(--text); background: var(--accent-soft); }
.nav-links a.navlink.active { color: var(--accent); background: var(--accent-soft); }

.nav-actions { display: flex; align-items: center; gap: 10px; margin-left: 6px; }

.theme-toggle {
    width: 40px; height: 40px;
    display: grid; place-items: center;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 50%;
    color: var(--text);
    font-size: 1.05rem;
    transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}
.theme-toggle:hover { border-color: var(--accent); transform: rotate(-15deg); }
.theme-toggle .sun { display: none; }
.theme-toggle .moon { display: inline; }
[data-theme="dark"] .theme-toggle .sun { display: inline; }
[data-theme="dark"] .theme-toggle .moon { display: none; }

.nav-toggle { display: none; background: none; border: none; color: var(--text); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.95rem;
    border: 1px solid transparent;
    transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--gradient); color: #fff; box-shadow: 0 6px 18px var(--accent-ring); }
.btn-primary:hover { box-shadow: 0 10px 26px var(--accent-ring); }
.btn-outline { border-color: var(--border-strong); color: var(--text); background: var(--surface); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost { color: var(--text-muted); }
.btn-ghost:hover { color: var(--accent); background: var(--accent-soft); }
.btn-sm { padding: 8px 15px; font-size: 0.88rem; }

/* ---------- Sections ---------- */
.section { padding: 84px 0; }
.section-sm { padding: 56px 0; }

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 14px;
}
.eyebrow::before { content: ""; width: 22px; height: 2px; border-radius: 2px; background: var(--gradient); }

.section-title { font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: -0.02em; }
.section-lead { color: var(--text-muted); max-width: 62ch; margin-top: 14px; font-size: 1.05rem; }
.section-head { margin-bottom: 44px; }

.gradient-text {
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ---------- Hero ---------- */
.hero { padding: clamp(48px, 8vw, 96px) 0 72px; }
.hero-inner {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    align-items: center;
    gap: 56px;
}
.hero h1 { font-size: clamp(2.4rem, 6vw, 4rem); letter-spacing: -0.03em; margin: 10px 0 6px; }
.hero .typed { min-height: 1.4em; margin-top: 18px; color: var(--text-muted); font-family: var(--font-mono); font-size: 1rem; }
.hero .subtitle { font-size: 1.15rem; color: var(--text-muted); max-width: 46ch; margin: 18px 0 28px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

.status-pill {
    display: inline-flex; align-items: center; gap: 9px;
    padding: 7px 14px; border-radius: 999px;
    background: var(--surface); border: 1px solid var(--border);
    font-size: 0.85rem; font-weight: 500; color: var(--text-muted);
    box-shadow: var(--shadow-sm);
}
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 4px rgba(34,197,94,0.18); animation: pulse 2.2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.55; } }

.hero-photo { position: relative; justify-self: center; }
.hero-photo::before {
    content: ""; position: absolute; inset: -18px; border-radius: 32px;
    background: var(--gradient); filter: blur(38px); opacity: 0.35; z-index: 0;
}
.hero-photo img {
    position: relative; z-index: 1;
    width: min(360px, 78vw); aspect-ratio: 4/5; object-fit: cover; object-position: 50% 30%;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
}

.socials { display: flex; gap: 12px; margin-top: 26px; }
.socials a {
    width: 42px; height: 42px; border-radius: 12px;
    display: grid; place-items: center;
    background: var(--surface); border: 1px solid var(--border);
    color: var(--text-muted);
    transition: transform 0.18s ease, color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.socials a:hover { transform: translateY(-3px); color: var(--accent); border-color: var(--accent); }
.socials svg { width: 20px; height: 20px; }

/* ---------- Stats strip ---------- */
.stats {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
}
.stat {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 22px 20px; box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.stat:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.stat .num { font-family: var(--font-display); font-weight: 700; font-size: 1.9rem; line-height: 1; }
.stat .label { color: var(--text-muted); font-size: 0.92rem; margin-top: 8px; }

/* ---------- Generic card grid ---------- */
.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

.card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }

/* ---------- Experience cards ---------- */
.tabs { display: inline-flex; gap: 6px; padding: 6px; background: var(--bg-alt); border: 1px solid var(--border); border-radius: 999px; margin-bottom: 36px; flex-wrap: wrap; }
.tab {
    border: none; background: transparent; color: var(--text-muted);
    padding: 9px 20px; border-radius: 999px; font-weight: 600; font-size: 0.92rem;
    transition: color 0.2s ease, background 0.2s ease;
}
.tab:hover { color: var(--text); }
.tab.active { color: #fff; background: var(--gradient); box-shadow: 0 4px 14px var(--accent-ring); }

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeUp 0.5s ease both; }

.exp-list { display: flex; flex-direction: column; gap: 18px; }
.exp-card {
    display: grid; grid-template-columns: 64px 1fr; gap: 22px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 24px 26px; box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    position: relative;
}
.exp-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.exp-logo {
    width: 64px; height: 64px; border-radius: 14px;
    background: #fff; border: 1px solid var(--border);
    display: grid; place-items: center; padding: 9px; overflow: hidden;
}
.exp-logo img { width: 100%; height: 100%; object-fit: contain; }
.exp-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.exp-role { font-size: 1.2rem; font-weight: 700; }
.exp-org { color: var(--accent); font-weight: 600; font-size: 0.98rem; }
.exp-date { margin-left: auto; color: var(--text-muted); font-size: 0.85rem; font-family: var(--font-mono); white-space: nowrap; }
.exp-body { color: var(--text-muted); font-size: 0.98rem; margin-top: 10px; }
.exp-body ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.exp-link { position: absolute; top: 18px; right: 18px; color: var(--text-muted); opacity: 0.55; transition: opacity 0.2s ease, color 0.2s ease; }
.exp-card:hover .exp-link { opacity: 1; color: var(--accent); }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; vertical-align: middle; }

/* ---------- Chips / tags ---------- */
.chip-group { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
    padding: 7px 14px; border-radius: 999px;
    background: var(--surface); border: 1px solid var(--border);
    font-size: 0.88rem; font-weight: 500; color: var(--text);
    transition: transform 0.15s ease, border-color 0.2s ease, color 0.2s ease;
}
.chip:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.chip b { font-weight: 700; }

.tag {
    font-family: var(--font-mono);
    font-size: 0.74rem; font-weight: 500;
    padding: 4px 10px; border-radius: 6px;
    background: var(--accent-soft); color: var(--accent);
}

/* ---------- Projects ---------- */
.project-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 26px; }
.project-card {
    display: flex; flex-direction: column;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm);
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}
.project-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
.project-thumb { position: relative; aspect-ratio: 16/10; overflow: hidden; background: var(--bg-alt); }
.project-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.project-card:hover .project-thumb img { transform: scale(1.05); }
.project-body { padding: 22px 24px 26px; display: flex; flex-direction: column; flex: 1; }
.project-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.project-name { font-size: 1.35rem; font-weight: 700; }
.project-date { color: var(--text-muted); font-size: 0.82rem; font-family: var(--font-mono); }
.project-desc { color: var(--text-muted); font-size: 0.96rem; margin: 12px 0 18px; }
.project-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.project-links { margin-top: auto; display: flex; gap: 12px; }
.project-links a { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: 0.9rem; color: var(--text); transition: color 0.2s ease; }
.project-links a:hover { color: var(--accent); }
.project-links svg { width: 17px; height: 17px; }

/* ---------- Writing / posts ---------- */
.post-card {
    display: flex; flex-direction: column; height: 100%;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }

/* Cover image sits full-bleed above the body, so the padding lives on
   .post-body rather than the card itself. */
.post-cover { position: relative; aspect-ratio: 4/3; overflow: hidden; background: var(--bg-alt); flex: none; }
/* Portrait sources are common here, so bias the crop below centre — it keeps
   faces and any burned-in caption in frame. Override per card if needed. */
.post-cover img { width: 100%; height: 100%; object-fit: cover; object-position: center 66%; transition: transform 0.5s ease; }
.post-card:hover .post-cover img { transform: scale(1.05); }

/* Fallback until a photo exists for a given post. */
.post-cover.is-placeholder { display: grid; place-items: center; background: var(--gradient); }
.post-cover.is-placeholder::after {
    content: "\201C";
    font-family: var(--font-display);
    font-size: 8rem;
    line-height: 1;
    color: #fff;
    opacity: 0.32;
    transform: translateY(0.16em);
}

.post-body { display: flex; flex-direction: column; flex: 1; padding: 20px 24px 24px; }
.post-date { font-family: var(--font-mono); font-size: 0.82rem; color: var(--text-muted); }
.post-title { font-size: 1.25rem; letter-spacing: -0.01em; margin: 10px 0 18px; }
.post-more { margin-top: auto; display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-weight: 600; font-size: 0.9rem; transition: gap 0.2s ease; }
.post-card:hover .post-more { gap: 10px; }
.post-more svg { width: 15px; height: 15px; }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 56px; align-items: start; }
.about-photo { position: relative; }
.about-photo img { width: 100%; border-radius: var(--radius-lg); border: 1px solid var(--border); box-shadow: var(--shadow-lg); aspect-ratio: 3/4; object-fit: cover; object-position: 50% 25%; }
.about-photo::before { content: ""; position: absolute; inset: -16px -16px 24px 24px; border-radius: 32px; background: var(--gradient); filter: blur(40px); opacity: 0.28; z-index: -1; }
.prose p { color: var(--text); margin: 0 0 18px; }
.prose p.lead { font-size: 1.15rem; }
.flag-gh { height: 0.95em; width: auto; margin-left: 0.4em; vertical-align: -0.12em; border-radius: 3px; box-shadow: 0 1px 2px rgba(0,0,0,0.18); }
.interests { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin-top: 12px; }
.interest {
    display: flex; align-items: center; gap: 12px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 14px 16px; box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, border-color 0.2s ease;
}
.interest:hover { transform: translateY(-3px); border-color: var(--accent); }
.interest .emoji { font-size: 1.5rem; line-height: 1; }
.interest span.txt { font-weight: 600; font-size: 0.94rem; }

/* ---------- CTA band ---------- */
.cta-band {
    position: relative; overflow: hidden;
    background: var(--gradient); color: #fff;
    border-radius: var(--radius-lg); padding: 56px 48px;
    text-align: center; box-shadow: var(--shadow-lg);
}
.cta-band h2 { font-size: clamp(1.6rem, 4vw, 2.4rem); color: #fff; }
.cta-band p { color: rgba(255,255,255,0.9); max-width: 52ch; margin: 14px auto 26px; }
.cta-band .btn-primary { background: #fff; color: #1b1712; box-shadow: 0 8px 22px rgba(0,0,0,0.18); }
.cta-band .btn-outline { background: transparent; border-color: rgba(255,255,255,0.6); color: #fff; }
.cta-band .btn-outline:hover { border-color: #fff; color: #fff; background: rgba(255,255,255,0.12); }
.cta-band .btn:hover { transform: translateY(-2px); }

/* ---------- Section featured header (title + link) ---------- */
.head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 36px; }
.link-more { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--accent); }
.link-more:hover { gap: 10px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 40px 0; margin-top: 40px; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.footer-inner .muted { color: var(--text-muted); font-size: 0.9rem; }
.footer-socials { display: flex; gap: 10px; }
.footer-socials a { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--border); color: var(--text-muted); transition: color 0.2s ease, border-color 0.2s ease, transform 0.18s ease; }
.footer-socials a:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-2px); }
.footer-socials svg { width: 18px; height: 18px; }

/* ---------- Reveal on scroll (only hide when JS is available) ---------- */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s cubic-bezier(0.16,1,0.3,1), transform 0.6s cubic-bezier(0.16,1,0.3,1); }
.js .reveal.in-view { opacity: 1; transform: none; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- Page intro ---------- */
.page-hero { padding: clamp(46px, 7vw, 80px) 0 8px; }
.page-hero h1 { font-size: clamp(2.1rem, 5vw, 3.2rem); letter-spacing: -0.02em; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
    .hero-inner { grid-template-columns: 1fr; gap: 40px; }
    .hero-photo { order: -1; }
    .about-grid { grid-template-columns: 1fr; gap: 36px; }
    .about-photo { max-width: 420px; }
    .stats { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
    body { font-size: 16px; }
    .nav-links {
        position: fixed; inset: var(--nav-h) 0 auto 0;
        flex-direction: column; align-items: stretch; gap: 4px;
        background: var(--bg); border-bottom: 1px solid var(--border);
        padding: 14px 20px 22px;
        transform: translateY(-120%); opacity: 0; pointer-events: none;
        transition: transform 0.35s ease, opacity 0.3s ease;
        box-shadow: var(--shadow-md);
    }
    .nav-links.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
    .nav-links a.navlink { padding: 12px 14px; font-size: 1rem; }
    .nav-actions { margin-left: auto; }
    .nav-toggle { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; }
    .nav-actions .btn-resume { display: none; }
    .nav-links .btn-resume { display: inline-flex; margin-top: 8px; justify-content: center; }
    .section { padding: 62px 0; }
    .grid-2, .grid-3, .project-grid { grid-template-columns: 1fr; }
    .exp-card { grid-template-columns: 1fr; gap: 14px; }
    .exp-logo { width: 54px; height: 54px; }
    .exp-date { margin-left: 0; }
    .cta-band { padding: 44px 26px; }
    .hero-cta { gap: 10px; }
}

@media (max-width: 420px) {
    .stats { grid-template-columns: 1fr; }
    .container { padding: 0 18px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
    .reveal { opacity: 1; transform: none; }
}



/* ---------- Demo video: play badge + modal player ---------- */
/* The video thumb is a <button>, so strip the UA button styling and let it
   inherit the same box as the <a class="project-thumb"> cards around it. */
button.project-thumb {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    font: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.play-badge {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: linear-gradient(180deg, rgba(10, 8, 6, 0.05), rgba(10, 8, 6, 0.42));
    transition: background 0.25s ease;
}

.play-badge span {
    display: grid;
    place-items: center;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 6px 22px rgba(20, 16, 12, 0.28);
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.play-badge svg { width: 22px; height: 22px; margin-left: 3px; fill: #1b1712; }
.project-card:hover .play-badge { background: linear-gradient(180deg, rgba(10, 8, 6, 0.02), rgba(10, 8, 6, 0.3)); }
.project-card:hover .play-badge span { transform: scale(1.09); }

.play-duration {
    position: absolute;
    right: 12px;
    bottom: 12px;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(10, 8, 6, 0.72);
    color: #fff;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.02em;
}

.vid-modal {
    position: fixed;
    inset: 0;
    z-index: 9990;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(8, 6, 5, 0.78);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.vid-modal.open { display: flex; }

.vid-modal-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: vid-in 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes vid-in {
    from { transform: scale(0.97); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

/* Portrait source: bound by viewport height, not width. */
.vid-modal video {
    display: block;
    max-height: 82vh;
    max-width: 100%;
    width: auto;
    border-radius: var(--radius);
    background: #000;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
}

.vid-modal-cap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.86rem;
}

.vid-modal-cap b { color: #fff; font-weight: 600; }

.vid-modal-close {
    background: none;
    border: 0;
    color: rgba(255, 255, 255, 0.72);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    flex: none;
}

.vid-modal-close:hover { color: #fff; background: rgba(255, 255, 255, 0.12); }

@media (prefers-reduced-motion: reduce) {
    .vid-modal-panel { animation: none; }
    .play-badge span, .project-card:hover .play-badge span { transition: none; transform: none; }
}

@media (max-width: 620px) {
    .vid-modal { padding: 14px; }
    .vid-modal video { max-height: 74vh; }
}
