/* ==========================================================================
   Portfolio · Editorial Brand Style
   Inspired by Nicepage "Doing Branding for Business" tone,
   structured after the Julia free template.
   ========================================================================== */

:root {
    /* Pure monochrome — black & white only. */
    --bg:           #FFFFFF;
    --bg-alt:      #F5F5F5;    /* very light grey for sidebar / alt sections */
    --bg-cream-deep: #ECECEC;  /* light grey for giant numerals */
    --surface:     #FFFFFF;
    --text:        #000000;
    --text-soft:   #1A1A1A;
    --muted:       #666666;
    --border:      #E5E5E5;
    --border-strong: #D9D9D9;
    --accent:      #000000;    /* monochrome: black is the only "accent" */
    --accent-soft: #F5F5F5;
    --accent-dark: #1A1A1A;
    --accent-ink:  #FFFFFF;
    --overlay:     rgba(0, 0, 0, 0.78);  /* caption / overlay backdrop */
    --caption-ink: #FFFFFF;              /* text on dark overlays (both themes) */

    /* Layout tokens */
    --sidebar-w:   280px;
    --header-h:    64px;
    --radius:      0;
    --max-w:       1140px;

    /* Type */
    --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
    --sans:  'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ---------- Dark mode ---------- */
html.dark {
    --bg:           #111111;
    --bg-alt:      #1A1A1A;
    --bg-cream-deep: #2A2A2A;
    --surface:     #1A1A1A;
    --text:        #F5F5F5;
    --text-soft:   #E0E0E0;
    --muted:       #9E9E9E;
    --border:      #333333;
    --border-strong: #444444;
    --accent:      #FFFFFF;    /* inverted accent: white is the accent */
    --accent-soft: #2A2A2A;
    --accent-dark: #CCCCCC;
    --accent-ink:  #111111;
    --overlay:     rgba(0, 0, 0, 0.85);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }

html {
    scroll-behavior: smooth;
    scroll-padding-top: 0;
}
body {
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.65;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: var(--accent-dark); }

/* ---------- Skip link ---------- */
.skip-link {
    position: absolute; left: -9999px; top: 0; z-index: 100;
    padding: 12px 20px; background: var(--text); color: var(--bg);
    font-size: 0.9rem; font-weight: 600;
}
.skip-link:focus { left: 0; color: var(--bg); text-decoration: none; }

/* ---------- Mobile top bar (hidden on desktop) ---------- */
.mobile-bar {
    display: none;
    position: fixed; top: 0; left: 0; right: 0;
    height: var(--header-h);
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    z-index: 30;
    align-items: center;
    padding: 0 20px;
}
.mobile-brand {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--serif);
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--text);
    letter-spacing: -0.01em;
    white-space: nowrap;
    /* Keep the centered brand clear of the hamburger (left) and theme toggle (right). */
    max-width: calc(100% - 120px);
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
}
.hamburger {
    width: 40px; height: 40px;
    background: transparent;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    display: inline-flex; flex-direction: column; justify-content: center; align-items: center;
    gap: 5px;
    flex-shrink: 0;
}
.hamburger span {
    display: block; width: 18px; height: 2px;
    background: var(--text); border-radius: 2px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}
body.menu-open .hamburger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.menu-open .hamburger span:nth-child(2) { opacity: 0; }
body.menu-open .hamburger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
body.menu-open { overflow: hidden; }

/* ---------- Sidebar (fixed left rail) ---------- */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--bg-alt);
    border-right: 1px solid var(--border);
    padding: 32px 28px 28px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    overflow-y: auto;
    z-index: 25;
}

/* (brand-mark removed from sidebar — see nav directly below) */

/* Sidebar nav list */
.nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.nav > a {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 8px 10px;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--text-soft);
    border-left: 2px solid transparent;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.nav > a:hover {
    color: var(--text);
    text-decoration: none;
    background: var(--bg-alt);
}
.nav > a.is-active {
    color: var(--text);
    border-left-color: var(--accent);
    background: var(--bg-alt);
}
.nav-num {
    font-family: var(--serif);
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.04em;
    min-width: 22px;
}

/* Tools submenu — native <details> */
.nav-tools {
    margin-top: 8px;
    border-top: 1px solid var(--border);
    padding-top: 8px;
}
.nav-tools > summary {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--text-soft);
    cursor: pointer;
    list-style: none;
    border-left: 2px solid transparent;
    transition: color 0.15s ease, background 0.15s ease;
}
.nav-tools > summary::-webkit-details-marker { display: none; }
.nav-tools > summary::marker { display: none; content: ''; }
.nav-tools > summary:hover {
    color: var(--text);
    background: var(--bg-alt);
}
.nav-tools .chevron {
    margin-left: auto;
    display: inline-block;
    transition: transform 0.2s ease;
    color: var(--muted);
}
.nav-tools[open] > summary {
    color: var(--text);
    background: var(--bg-alt);
}
.nav-tools[open] > summary .chevron {
    transform: rotate(90deg);
    color: var(--accent);
}
.nav-tools > ul {
    list-style: none;
    margin: 4px 0 4px 0;
    padding: 4px 0 4px 34px;
    border-left: 1px solid var(--border);
    margin-left: 18px;
}
.nav-tools > ul li { margin: 0; }
.nav-tools > ul a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    font-size: 0.85rem;
    color: var(--text-soft);
    transition: color 0.15s ease, background 0.15s ease;
}
.nav-tools > ul a:hover {
    color: var(--accent);
    background: var(--bg-alt);
    text-decoration: none;
}
.nav-tools .ext { color: var(--muted); font-size: 0.8rem; }
.nav-tools > ul a:hover .ext { color: var(--accent); }

/* Sidebar footer */
.sidebar-foot {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.foot-email {
    font-size: 0.82rem;
    color: var(--text-soft);
    word-break: break-all;
}
.foot-email:hover { color: var(--accent); }
.foot-social {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 0.82rem;
    color: var(--muted);
}
.foot-social a { color: var(--text-soft); }
.foot-social a:hover { color: var(--accent); }
.dot-sep { color: var(--border-strong); }

/* Theme toggle — sun/moon button */
.theme-toggle {
    width: 40px; height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    color: var(--text);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    flex-shrink: 0;
}
/* Hover fill only on devices that support hover — touch taps would otherwise
   leave a stuck accent-colored background on the toggle. */
@media (hover: hover) {
    .theme-toggle:hover {
        background: var(--accent);
        border-color: var(--accent);
        color: var(--accent-ink);
    }
}
.theme-toggle .icon-moon { display: none; }
html.dark .theme-toggle .icon-sun { display: none; }
html.dark .theme-toggle .icon-moon { display: block; }
.sidebar-foot .theme-toggle { align-self: flex-start; }
.mobile-bar .theme-toggle { margin-left: auto; }
.gallery-bar .theme-toggle { margin-left: auto; }

/* Theme switch — desktop sidebar pill toggle */
.theme-switch-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 4px;
}
.theme-switch-label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    transition: color 0.2s ease;
}
html.dark .theme-switch-label:first-child { color: var(--muted); }
html.dark .theme-switch-label:last-child { color: var(--accent); }
.theme-switch {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    line-height: 0;
}
.theme-switch-track {
    display: flex;
    align-items: center;
    width: 52px;
    height: 28px;
    padding: 3px;
    background: var(--border-strong);
    border: 1px solid var(--border);
    border-radius: 999px;
    transition: background 0.25s ease, border-color 0.25s ease;
}
.theme-switch-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: var(--bg);
    color: var(--text);
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    transition: transform 0.25s cubic-bezier(0.34, 1.4, 0.64, 1), background 0.25s ease, color 0.25s ease;
}
.theme-switch:hover .theme-switch-track,
.theme-switch:focus-visible .theme-switch-track {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-soft);
}
html.dark .theme-switch-track { background: var(--accent); }
html.dark .theme-switch-thumb { transform: translateX(24px); background: var(--accent-ink); color: var(--accent); }
.theme-switch-thumb .icon-moon { display: none; }
html.dark .theme-switch-thumb .icon-sun { display: none; }
html.dark .theme-switch-thumb .icon-moon { display: block; }

/* ---------- Main content area ---------- */
main {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
}

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

/* ---------- Sections ---------- */
.section {
    position: relative;
    overflow: hidden;
    padding: 72px 0 88px;
}

.section-alt { background: var(--bg-alt); }

/* Giant background numerals — Julia pattern */
.section::after {
    content: attr(data-text);
    position: absolute;
    right: -4%;
    bottom: -3rem;
    font-family: var(--serif);
    font-size: 38rem;
    font-weight: 500;
    color: var(--bg-cream-deep);
    line-height: 1;
    z-index: 0;
    pointer-events: none;
    user-select: none;
}
.section-alt::after {
    color: var(--bg);
    opacity: 0.35;
}
.section > .container { position: relative; z-index: 1; }

/* ---------- Two-column layout ---------- */
.two-col {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 80px;
    align-items: start;
}
.col-label {
    position: sticky;
    top: 24px;
}
.section-num {
    display: block;
    font-family: var(--serif);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--accent);
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}
.section-num.center { text-align: center; }
.section-kicker {
    font-size: 0.92rem;
    color: var(--muted);
    margin-top: 8px;
    max-width: 240px;
    line-height: 1.5;
}
.col-label h2,
.section h2 {
    font-family: var(--serif);
    font-size: 2rem;
    font-weight: 500;
    letter-spacing: -0.02em;
    color: var(--text);
    line-height: 1.1;
}

/* ---------- Hero ---------- */
.section-hero { padding-top: 72px; padding-bottom: 88px; }

.hero {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 64px;
    align-items: start;
}

.hero-photo {
    margin: 0;
    position: relative;
}
.hero-photo img {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--accent);
}
.hero-photo-meta {
    margin-top: 16px;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Featured quote — sits below the hero image, replaces the prior
   "Dhaka, Bangladesh · Open to opportunities" status line. */
.hero-quote {
    margin: 22px 0 0;
    padding: 22px 0 0;
    border-top: 1px solid var(--border-strong);
    position: relative;
    /* Hanging-cap pull-quote feel */
}
.hero-quote-text {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 400;
    font-size: 1.35rem;
    line-height: 1.35;
    letter-spacing: -0.01em;
    color: var(--text);
    margin: 0 0 12px;
    text-indent: -0.4em;
}
.hero-quote-text::before {
    content: "\201C"; /* opening curly quote */
    margin-right: 0.05em;
}
.hero-quote-text::after {
    content: "\201D"; /* closing curly quote */
    margin-left: 0.05em;
}
.hero-quote-attr {
    font-family: var(--sans);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}
.hero-quote-attr cite {
    font-style: normal;
}

/* status-dot rules retained below only because nothing currently renders
   a status-dot element anymore — removed safely in next cleanup pass.
   Keeping the animation block would cause only dead CSS. */
.status-dot { display: none; }
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.14); }
    50%      { box-shadow: 0 0 0 6px rgba(0, 0, 0, 0.06); }
}

.hero-body { padding-top: 8px; }
.eyebrow {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 20px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--accent);
}
.display {
    font-family: var(--serif);
    font-size: clamp(3rem, 6vw, 4.75rem);
    font-weight: 500;
    line-height: 1.0;
    letter-spacing: -0.035em;
    color: var(--text);
    margin: 0 0 16px;
}
.display .accent { color: var(--accent); }

.hero-tagline {
    font-family: var(--serif);
    font-size: 1.15rem;
    font-style: italic;
    color: var(--muted);
    margin-bottom: 32px;
    letter-spacing: 0.005em;
}

.lead {
    font-size: 1.08rem;
    line-height: 1.7;
    color: var(--text-soft);
    max-width: 620px;
    margin-bottom: 16px;
}
.lead-muted { color: var(--muted); font-size: 0.98rem; }

.cta-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 32px;
    margin-bottom: 56px;
}
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 22px;
    font-size: 0.92rem;
    font-weight: 500;
    letter-spacing: -0.005em;
    border: 1px solid transparent;
    border-radius: var(--radius);
    transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn-primary {
    background: var(--accent);
    color: var(--accent-ink);
}
.btn-primary:hover {
    background: var(--accent-dark);
    color: var(--accent-ink);
    text-decoration: none;
    transform: translateY(-1px);
}
.btn-ghost {
    background: transparent;
    color: var(--text);
    border-color: var(--border-strong);
}
.btn-ghost:hover {
    border-color: var(--text);
    background: var(--bg-alt);
    color: var(--text);
    text-decoration: none;
    transform: translateY(-1px);
}

/* Hero stats row */
.hero-stats {
    list-style: none;
    margin: 0; padding: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.hero-stats li {
    padding: 24px 16px;
    border-right: 1px solid var(--border);
}
.hero-stats li:last-child { border-right: none; }
.hero-stats li:first-child { padding-left: 0; }
.stat-num {
    display: block;
    font-family: var(--serif);
    font-size: 2rem;
    font-weight: 500;
    letter-spacing: -0.02em;
    color: var(--text);
    line-height: 1;
    margin-bottom: 8px;
}
.stat-label {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ---------- About ---------- */
.col-body p {
    color: var(--text-soft);
    font-size: 1.02rem;
    line-height: 1.75;
    margin-bottom: 18px;
    max-width: 640px;
}
.col-body p:last-child { margin-bottom: 0; }
.col-body strong { color: var(--text); font-weight: 600; }
.tech-tags {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin-top: 28px; max-width: 640px;
}
.tag-pill {
    padding: 6px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 0.84rem;
    font-weight: 500;
    color: var(--text-soft);
}

/* ---------- Skills ---------- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}
.card:hover {
    border-color: var(--border-strong);
    transform: translateY(-2px);
}
.skill-card h3 {
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 14px;
}
.skill-card ul {
    list-style: none;
    display: flex; flex-wrap: wrap; gap: 6px;
    padding: 0; margin: 0;
}
.skill-card li {
    font-size: 0.86rem;
    color: var(--text-soft);
    padding: 4px 10px;
    background: var(--bg-alt);
    border-radius: 4px;
    font-weight: 500;
}

/* ---------- Projects ---------- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
.project-card .project-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}
.project-name {
    font-family: var(--serif);
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--text);
    letter-spacing: -0.015em;
}
.project-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px; height: 32px;
    border: 1px solid var(--border);
    color: var(--text-soft);
    flex-shrink: 0;
    border-radius: var(--radius);
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.project-link:hover {
    border-color: var(--text);
    color: var(--text);
    background: var(--bg-alt);
    text-decoration: none;
}
.project-desc {
    font-size: 0.94rem;
    line-height: 1.6;
    color: var(--text-soft);
    margin-bottom: 16px;
}
.project-tags {
    display: flex; flex-wrap: wrap; gap: 8px;
}

/* ---------- Experience ---------- */
.timeline {
    display: flex; flex-direction: column; gap: 56px;
}
.company-block { position: relative; }
.company-head {
    margin-bottom: 28px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.company-name {
    font-family: var(--serif);
    font-size: 1.45rem;
    font-weight: 500;
    color: var(--text);
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}
.company-meta {
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 500;
}
.roles {
    display: flex; flex-direction: column; gap: 28px;
    position: relative;
    padding-left: 24px;
}
.roles::before {
    content: '';
    position: absolute;
    left: 5px; top: 8px; bottom: 8px;
    width: 2px;
    background: var(--border);
}
.job { position: relative; }
.job::before {
    content: '';
    position: absolute;
    left: -24px; top: 8px;
    width: 12px; height: 12px;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--accent);
}
.job-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}
.job h4 {
    font-size: 1.02rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.01em;
}
.period {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    padding: 4px 12px;
    background: var(--bg-alt);
    border-radius: 20px;
    white-space: nowrap;
}
.job ul { list-style: none; padding: 0; margin: 0; }
.job li {
    position: relative;
    padding-left: 18px;
    margin-bottom: 6px;
    color: var(--text-soft);
    font-size: 0.94rem;
    line-height: 1.65;
}
.job li::before {
    content: '–';
    position: absolute; left: 0;
    color: var(--border-strong);
    font-weight: 600;
}
.job li:last-child { margin-bottom: 0; }

/* ---------- Projects ---------- */
.project-head-right {
    display: flex;
    align-items: center;
    gap: 12px;
}
.project-lang {
    font-family: 'SFMono-Regular', Menlo, monospace;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 3px 8px;
    white-space: nowrap;
}

/* ---------- Photography ---------- */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
.photo-thumb {
    position: relative;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-alt);
    display: block;
}
.photo-thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease, filter 0.4s ease;
    filter: saturate(0.92);
}
.photo-thumb:hover img {
    transform: scale(1.04);
    filter: saturate(1.1);
}
.photo-caption {
    position: absolute;
    left: 12px; right: 12px; bottom: 12px;
    padding: 6px 10px;
    background: var(--overlay);
    color: var(--caption-ink);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}
.photo-thumb:hover .photo-caption {
    opacity: 1;
    transform: translateY(0);
}
.photo-note {
    display: block;
    color: var(--text-soft);
    font-size: 0.9rem;
    line-height: 1.55;
    margin-top: 12px;
    padding: 0 12px 12px;
}

/* ---------- Certifications · Learning ---------- */
.cert-list {
    list-style: none; padding: 0; margin: 0;
    display: flex; flex-direction: column; gap: 12px;
}
.cert-item {
    display: flex; align-items: center; gap: 16px;
    padding: 20px 24px;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: var(--radius);
    transition: border-color 0.15s ease, transform 0.15s ease;
}
.cert-item:hover {
    border-color: var(--border-strong);
    transform: translateY(-2px);
}
.cert-icon {
    width: 40px; height: 40px;
    border-radius: var(--radius);
    background: var(--bg-alt);
    color: var(--accent);
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.cert-text { display: flex; flex-direction: column; gap: 2px; }
.cert-name { font-size: 1rem; font-weight: 600; color: var(--text); }
a.cert-name { text-decoration: none; }
a.cert-name:hover { color: var(--accent-dark); text-decoration: underline; }
a.cert-name .ext { color: var(--muted); font-size: 0.8rem; margin-left: 2px; }
.cert-issuer { font-size: 0.85rem; color: var(--muted); }

/* ---------- Contact ---------- */
.section-contact {
    background: #000000;
    color: #FFFFFF;
    padding: 30px 0;
}
.section-contact::after { color: rgba(255, 255, 255, 0.06); }
.section-contact .section-num { color: rgba(255, 255, 255, 0.55); }
.section-contact h2,
.contact-heading {
    font-family: var(--serif);
    color: #FFFFFF;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 500;
    letter-spacing: -0.025em;
    text-align: center;
}
.section-contact .contact-lead { color: rgba(255, 255, 255, 0.75); }
.contact-lead {
    font-size: 1.05rem;
    margin-bottom: 8px;
    text-align: center;
}

/* Two-column split: info on the left, form on the right. */
.contact-split {
    display: grid;
    grid-template-columns: 0.8fr 1.6fr;
    gap: 64px;
    margin-top: 40px;
    align-items: start;
}

/* ---- LEFT: contact info ---- */
.contact-info {
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.contact-list {
    list-style: none;
    margin: 0; padding: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.contact-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.contact-row:last-child { border-bottom: none; padding-bottom: 0; }
.contact-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
}
.contact-value {
    font-family: var(--serif);
    font-size: 1.2rem;
    font-weight: 500;
    color: #FFFFFF;
    line-height: 1.3;
    word-break: break-all;
}
a.contact-value { transition: color 0.15s ease; }
a.contact-value:hover { color: rgba(255, 255, 255, 0.7); }
.contact-socials {
    display: flex;
    align-items: center;
    gap: 16px;
}
.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: var(--radius);
    color: #FFFFFF;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.social-icon:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
    text-decoration: none;
}
.contact-sub {
    display: block;
    margin-top: 4px;
    font-family: var(--sans);
    font-size: 0.82rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.55);
    letter-spacing: 0;
    text-transform: none;
}

/* (contact-socials block removed — GitHub / LinkedIn / Website links dropped from contact section) */

/* ---- RIGHT: contact form ---- */
.contact-form-wrap {
    background: #FFFFFF;
    color: #000000;
    padding: 28px;
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.contact-form-heading {
    font-family: var(--serif);
    font-size: 1.5rem;
    font-weight: 500;
    margin: 0 0 6px;
    color: #000000;
    letter-spacing: -0.015em;
}
.contact-form-kicker {
    font-size: 0.92rem;
    color: #444444;
    margin: 0 0 20px;
}

.form-banner {
    padding: 14px 16px;
    margin-bottom: 20px;
    font-size: 0.92rem;
    border-radius: var(--radius);
    border: 1px solid transparent;
}
.form-banner strong { font-weight: 600; }
.form-banner a { color: inherit; text-decoration: underline; }
.form-banner-success {
    background: #F2F2F2;
    color: #000000;
    border-color: #000000;
}
.form-banner-error {
    background: #000000;
    color: #FFFFFF;
    border-color: #FFFFFF;
}
.form-banner-error a { color: #FFFFFF; }

.contact-form { display: flex; flex-direction: column; gap: 14px; }
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #000000;
}
.form-field input,
.form-field textarea {
    font-family: var(--sans);
    font-size: 0.98rem;
    color: #000000;
    background: #FFFFFF;
    border: 1px solid #000000;
    border-radius: var(--radius);
    padding: 11px 14px;
    width: 100%;
    transition: border-color 0.15s ease, background 0.15s ease;
    line-height: 1.5;
    resize: vertical;
}
.form-field input:focus,
.form-field textarea:focus {
    outline: none;
    background: #F5F5F5;
    border-color: #000000;
    box-shadow: inset 0 0 0 1px #000000;
}
.form-field input[aria-invalid="true"],
.form-field textarea[aria-invalid="true"] {
    border-color: #000000;
    background: #ECECEC;
}
.form-error {
    font-size: 0.78rem;
    color: #000000;
    background: transparent;
    border-left: 2px solid #000000;
    padding: 4px 8px;
    font-weight: 500;
}

/* Honeypot — invisible to humans, visible to naive bots. */
.hp-field {
    position: absolute !important;
    left: -10000px !important;
    width: 1px; height: 1px;
    overflow: hidden;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 6px;
    flex-wrap: wrap;
}
.contact-form .btn-primary {
    background: #000000;
    color: #FFFFFF;
    border-color: #000000;
}
.contact-form .btn-primary:hover {
    background: #1A1A1A;
    color: #FFFFFF;
}
.form-note {
    font-size: 0.78rem;
    color: #444444;
    margin: 0;
    flex: 1;
    min-width: 200px;
}

/* ---------- Contact form — dark mode ---------- */
html.dark .contact-form-wrap {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
}
html.dark .contact-form-heading { color: var(--text); }
html.dark .contact-form-kicker { color: var(--muted); }
html.dark .form-field label { color: var(--text); }
html.dark .form-field input,
html.dark .form-field textarea {
    color: var(--text);
    background: var(--bg);
    border-color: var(--border-strong);
}
html.dark .form-field input:focus,
html.dark .form-field textarea:focus {
    background: var(--bg-alt);
    border-color: var(--accent);
    box-shadow: inset 0 0 0 1px var(--accent);
}
html.dark .form-field input[aria-invalid="true"],
html.dark .form-field textarea[aria-invalid="true"] {
    border-color: var(--accent);
    background: var(--bg-alt);
}
html.dark .form-error {
    color: var(--text);
    border-left-color: var(--accent);
}
html.dark .form-banner-success {
    background: var(--bg-alt);
    color: var(--text);
    border-color: var(--border-strong);
}
html.dark .contact-form .btn-primary {
    background: var(--accent);
    color: var(--accent-ink);
    border-color: var(--accent);
}
html.dark .contact-form .btn-primary:hover {
    background: var(--accent-dark);
    color: var(--accent-ink);
}
html.dark .form-note { color: var(--muted); }

/* ---------- Footer ---------- */
.site-footer {
    background: #000000;
    color: rgba(255, 255, 255, 0.55);
    padding: 28px 0;
    font-size: 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.footer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.footer-row p { margin: 0; }
.site-footer a { color: #FFFFFF; }
.site-footer a:hover { color: rgba(255, 255, 255, 0.7); }

/* ---------- Gallery page ---------- */
.gallery-bar {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 48px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-alt);
}
.gallery-back {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-soft);
}
.gallery-back:hover { color: var(--accent); text-decoration: none; }
.gallery-title {
    font-family: var(--serif);
    font-size: 1.6rem;
    font-weight: 500;
    letter-spacing: -0.02em;
    margin: 0;
}
.gallery-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 28px 48px;
    max-width: var(--max-w);
    margin: 0 auto;
}
.gallery-filters a {
    padding: 8px 18px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-soft);
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.gallery-filters a:hover {
    border-color: var(--accent);
    color: var(--text);
    text-decoration: none;
}
.gallery-filters a.is-active {
    background: var(--accent);
    color: var(--accent-ink);
    border-color: var(--accent);
}
.gallery-empty {
    text-align: center;
    color: var(--muted);
    padding: 48px 0;
    font-size: 0.95rem;
}
.photo-more {
    margin-top: 32px;
    text-align: center;
}

/* ---------- Lightbox ---------- */
.lightbox {
    position: fixed; inset: 0;
    background: rgba(51, 49, 41, 0.94);
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 40px;
}
.lightbox.is-open { display: flex; }
.lightbox-img {
    max-width: 90vw;
    max-height: 82vh;
    object-fit: contain;
    border: 1px solid rgba(245, 240, 232, 0.1);
}
.lightbox-caption {
    position: absolute;
    bottom: 24px;
    left: 0; right: 0;
    text-align: center;
    color: var(--caption-ink);
    font-size: 0.9rem;
    letter-spacing: 0.01em;
}
.lightbox-close {
    position: absolute;
    top: 24px; right: 24px;
    width: 44px; height: 44px;
    background: transparent;
    border: 1px solid rgba(245, 240, 232, 0.3);
    color: var(--bg);
    font-size: 1.5rem;
    line-height: 1;
    border-radius: var(--radius);
    transition: background 0.15s ease, border-color 0.15s ease;
}
.lightbox-close:hover {
    background: var(--accent);
    border-color: var(--accent);
}
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px; height: 48px;
    background: transparent;
    border: 1px solid rgba(245, 240, 232, 0.3);
    color: var(--bg);
    font-size: 1.8rem;
    line-height: 1;
    border-radius: var(--radius);
    transition: background 0.15s ease, border-color 0.15s ease;
    z-index: 1;
}
.lightbox-nav:hover {
    background: var(--accent);
    border-color: var(--accent);
}
.lightbox-prev { left: 24px; }
.lightbox-next { right: 24px; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1200px) {
    .section::after { font-size: 30rem; }
}

@media (max-width: 991px) {
    :root { --sidebar-w: 0px; }
    html { scroll-padding-top: var(--header-h); }
    .mobile-bar { display: flex; }
    /* Mobile bar must stay above the backdrop so the hamburger/toggle
       remain tappable while the drawer is open. */
    .mobile-bar { z-index: 45; }
    /* Theme toggle + contact links already live in the mobile header /
       contact section — hide them from the drawer footer on mobile. */
    .sidebar-foot .theme-toggle,
    .sidebar-foot .theme-switch,
    .sidebar-foot .theme-switch-wrap,
    .sidebar-foot .foot-email,
    .sidebar-foot .foot-social { display: none; }
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: 300px;
        box-shadow: 8px 0 32px rgba(0, 0, 0, 0.08);
        z-index: 40;
        top: var(--header-h);
        height: calc(100vh - var(--header-h));
    }
    .sidebar.is-open { transform: translateX(0); }
    /* Backdrop behind the open drawer — closes the menu when tapped. */
    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease;
        z-index: 35;
    }
    .sidebar-backdrop.is-open {
        opacity: 1;
        visibility: visible;
    }
    main { margin-left: 0; padding-top: var(--header-h); }
    /* main clears the fixed header; a small gap keeps the hero from looking cropped. */
    .section-hero { padding-top: 24px; }
    .container { padding: 0 24px; }
    .section { padding: 48px 0 72px; }
    .section::after { font-size: 22rem; right: -8%; bottom: -2rem; }
    .two-col { grid-template-columns: 1fr; gap: 32px; }
    .col-label { position: static; }
    .hero { grid-template-columns: 1fr; gap: 36px; }
    .hero-photo { max-width: 320px; }
    .hero-stats { grid-template-columns: repeat(2, 1fr); }
    .hero-stats li { border-right: none; border-bottom: 1px solid var(--border); padding: 20px 0; }
    .hero-stats li:nth-child(odd) { border-right: 1px solid var(--border); padding-right: 20px; }
    .hero-stats li:nth-child(even) { padding-left: 20px; }
    .hero-stats li:nth-last-child(-n+2) { border-bottom: none; }
    .skills-grid,
    .projects-grid { grid-template-columns: 1fr; }
    .photo-grid { grid-template-columns: repeat(2, 1fr); }
    .contact-split { grid-template-columns: 1fr; gap: 40px; }
}

@media (max-width: 640px) {
    .container { padding: 0 20px; }
    .gallery-bar { padding: 16px 20px; }
    .gallery-filters { padding: 20px 20px; }
    .lightbox { padding: 16px; }
    .lightbox-prev { left: 8px; }
    .lightbox-next { right: 8px; }
    .section { padding: 40px 0 56px; }
    .section-hero { padding-top: 16px; }
    .section::after { display: none; }
    .display { font-size: 2.5rem; }
    .hero { gap: 28px; }
    .hero-photo { max-width: 100%; }
    .hero-photo img { aspect-ratio: 4 / 5; max-height: 70vh; }
    .hero-stats li { padding: 14px 0; }
    .hero-stats li:nth-child(odd) { padding-right: 16px; }
    .hero-stats li:nth-child(even) { padding-left: 16px; }
    .cta-row { flex-direction: column; align-items: stretch; }
    .btn { justify-content: center; }
    .photo-grid { grid-template-columns: 1fr; }
    .contact-split { gap: 28px; }
    .contact-form-wrap { padding: 24px; }
    .form-row { grid-template-columns: 1fr; gap: 14px; }
    .job-head { flex-direction: column; align-items: flex-start; }
}