@font-face {
    font-family: "Geist Mono Variable";
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url("/static/fonts/geist-mono-latin.woff2") format("woff2-variations");
}

:root {
    color-scheme: light;
    --bg: oklch(98.48% 0 0);
    --surface: oklch(96.7% 0.001 286.375);
    --surface-strong: oklch(92% 0.004 286.32);
    --text: oklch(26.99% 0.0096 235.05);
    --muted: oklch(44.6% 0.03 256.802);
    --faint: oklch(55.1% 0.027 264.364);
    --border: oklch(87.1% 0.006 286.286);
    --accent: #3d799e;
    --accent-strong: #1a4d70;
    --heading: #1a4d70;
    --link: oklch(55.44% 0.0431 185.69);
    --selection: color-mix(in oklab, var(--accent) 25%, transparent);
    --code-bg: oklch(96.7% 0.001 286.375);
    --shadow: 0 10px 30px rgb(0 0 0 / 10%);
    --content-width: 80rem;
    --radius: 0.375rem;
    --font-mono: "Geist Mono Variable", ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: oklch(23.64% 0.0045 248);
    --surface: oklch(27.4% 0.006 286.033);
    --surface-strong: oklch(37% 0.013 285.805);
    --text: oklch(83.54% 0 264);
    --muted: oklch(70.7% 0.022 261.325);
    --faint: oklch(70.7% 0.022 261.325);
    --border: oklch(37% 0.013 285.805);
    --accent: #95c0d0;
    --accent-strong: #6ea3b9;
    --heading: #6ea3b9;
    --link: oklch(70.44% 0.1133 349);
    --selection: color-mix(in oklab, var(--accent) 30%, transparent);
    --code-bg: oklch(27.4% 0.006 286.033);
    --shadow: 0 24px 80px rgb(0 0 0 / 36%);
}

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

html {
    min-width: 20rem;
    scroll-behavior: smooth;
    scrollbar-gutter: stable;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 0.98rem;
    line-height: 1.72;
    -webkit-font-smoothing: antialiased;
    transition: background-color 180ms ease, color 180ms ease;
}

::selection { background: var(--selection); }

a {
    color: inherit;
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.2em;
}

a:hover { text-decoration-color: var(--link); }

button, input { font: inherit; }

button, a { -webkit-tap-highlight-color: transparent; }

img, video { display: block; max-width: 100%; height: auto; }

.skip-link {
    position: fixed;
    z-index: 100;
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.55rem 0.8rem;
    background: var(--text);
    color: var(--bg);
    transform: translateY(-200%);
}

.skip-link:focus { transform: translateY(0); }

.site-shell {
    width: min(calc(100% - 2rem), var(--content-width));
    min-height: 100vh;
    margin-inline: auto;
    display: flex;
    flex-direction: column;
}

.site-header {
    min-height: 6.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand {
    color: var(--text);
    font-size: 1.02rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    text-decoration: none;
}

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

.header-actions { display: flex; align-items: center; gap: 0.1rem; }

.icon-button {
    width: 2.55rem;
    height: 2.55rem;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.icon-button:hover { background: var(--surface); color: var(--text); }
.icon-button:focus-visible, input:focus-visible, a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.icon-button svg {
    width: 1.25rem;
    height: 1.25rem;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
}

.moon-icon { display: none; }
:root[data-theme="dark"] .sun-icon { display: none; }
:root[data-theme="dark"] .moon-icon { display: block; }

.site-main { flex: 1; padding: 3.5rem 0 6rem; }
.site-main:focus { outline: 0; }

h1, h2, h3 {
    color: var(--text);
    font-weight: 700;
    line-height: 1.28;
    letter-spacing: -0.045em;
}

h1 { margin: 0 0 1.8rem; font-size: clamp(1.85rem, 5vw, 2.5rem); }
h2 { margin: 3.75rem 0 1.35rem; font-size: clamp(1.35rem, 3vw, 1.65rem); }
h3 { margin: 2.25rem 0 0.6rem; font-size: 1.07rem; letter-spacing: -0.025em; }

.intro-section { max-width: 45rem; }
.intro-copy { font-size: 1.03rem; }
.intro-copy p:first-child { margin-top: 0; }

.prose p { margin: 1.15rem 0; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li { margin: 0.5rem 0; padding-left: 0.25rem; }
.prose hr { margin: 3rem 0; border: 0; border-top: 1px solid var(--border); }
.prose blockquote {
    margin: 2rem 0;
    padding: 0.15rem 0 0.15rem 1.25rem;
    border-left: 3px solid var(--accent);
    color: var(--muted);
}

.prose code {
    padding: 0.15em 0.35em;
    border: 1px solid var(--border);
    border-radius: 0.25rem;
    background: var(--code-bg);
    font-size: 0.9em;
}

.prose pre {
    position: relative;
    overflow-x: auto;
    margin: 1.8rem 0;
    padding: 1.15rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--code-bg);
    line-height: 1.55;
}

.prose pre code { padding: 0; border: 0; background: none; }

.copy-code {
    position: absolute;
    top: 0.55rem;
    right: 0.55rem;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 0.25rem;
    background: var(--surface);
    color: var(--muted);
    font-size: 0.73rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity 120ms ease;
}

pre:hover .copy-code, .copy-code:focus { opacity: 1; }

.social-block { margin-top: 2rem; }
.social-block > p { color: var(--muted); }
.inline-links, .tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem 1.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.listing-section { margin-top: 5.25rem; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.section-heading h2 { margin-top: 0; }
.quiet-link { color: var(--muted); font-size: 0.85rem; }

.post-list { margin: 0; padding: 0; list-style: none; }
.post-list > li {
    display: grid;
    grid-template-columns: 8.3rem minmax(0, 1fr);
    gap: 1.25rem;
    align-items: baseline;
    margin: 1.15rem 0;
}

.post-list time { color: var(--faint); font-size: 0.82rem; white-space: nowrap; }
.post-list a { font-weight: 600; }

.post-list-detailed > li {
    padding: 1.2rem 0;
    border-bottom: 1px solid var(--border);
    align-items: start;
}

.post-list-detailed > li:first-child { border-top: 1px solid var(--border); }
.post-list-detailed p { margin: 0.45rem 0 0; color: var(--muted); font-size: 0.9rem; }
.post-list-detailed .tag-list { margin-top: 0.6rem; gap: 0.25rem 0.75rem; }
.tag-list a { color: var(--muted); font-size: 0.78rem; font-weight: 400; text-decoration: none; }
.tag-list a:hover { color: var(--accent); }

.empty-state { padding: 1rem 0; color: var(--muted); font-style: italic; }

.page-header { margin-bottom: 3.25rem; }
.page-header h1 { margin-bottom: 1.1rem; }
.eyebrow {
    margin: 0 0 0.75rem;
    color: var(--faint);
    font-size: 0.76rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.page-summary { max-width: 41rem; margin: 0; color: var(--muted); font-size: 1.02rem; }

.list-filter { margin: 0 0 2rem; }
.list-filter label { display: block; margin-bottom: 0.55rem; color: var(--muted); font-size: 0.8rem; }
.list-filter input {
    width: 100%;
    padding: 0.75rem 0;
    border: 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    background: transparent;
    color: var(--text);
    outline: 0;
}
.list-filter input:focus { border-color: var(--accent); }

.back-link { display: inline-block; margin-bottom: 2rem; color: var(--muted); font-size: 0.83rem; }
.post-header h1 { margin-bottom: 1rem; }
.post-meta { display: flex; flex-wrap: wrap; gap: 0.55rem; color: var(--faint); font-size: 0.82rem; }
.post-header .tag-list { margin-top: 0.8rem; }
.post-summary {
    margin: 2.5rem 0;
    padding: 1.15rem 1.3rem;
    border-left: 3px solid var(--accent);
    background: var(--surface);
    color: var(--muted);
}
.post-content { margin-top: 3.5rem; }
.post-content h2, .post-content h3 { scroll-margin-top: 2rem; }
.post-footer { margin-top: 5rem; padding-top: 1.4rem; border-top: 1px solid var(--border); text-align: right; }
.post-footer a { color: var(--muted); font-size: 0.83rem; }

.resume-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 2rem; }
.button-link {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    padding: 0.58rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.8rem;
    text-decoration: none;
}
.button-link:hover { border-color: var(--accent); color: var(--accent); }

.resume-section { margin-top: 4.5rem; }
.resume-section > h2 { margin: 0 0 2rem; padding-bottom: 0.7rem; border-bottom: 1px solid var(--border); }
.timeline { display: grid; gap: 2.6rem; }
.timeline-item { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: 1.5rem; }
.timeline-date { color: var(--faint); font-size: 0.8rem; }
.timeline-item h3 { margin: 0; }
.timeline-place { margin: 0.25rem 0 0.8rem; color: var(--muted); font-size: 0.88rem; }
.timeline-item ul { margin: 0.8rem 0 0; padding-left: 1.2rem; color: var(--muted); font-size: 0.9rem; }
.timeline.compact { gap: 1.5rem; }
.skills-list { margin: 0; }
.skills-list > div { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: 1.5rem; padding: 0.75rem 0; }
.skills-list dt { color: var(--text); font-weight: 700; }
.skills-list dd { margin: 0; color: var(--muted); }

.error-page { padding: 7vh 0; }
.error-code { margin: 0; color: var(--accent); font-size: 0.85rem; }
.error-page h1 { margin: 0.8rem 0; }
.error-page > p:not(.error-code) { margin-bottom: 2rem; color: var(--muted); }

.site-footer {
    padding: 2.25rem 0 3rem;
    border-top: 1px solid var(--border);
    color: var(--faint);
    font-size: 0.76rem;
}
.site-footer p { margin: 0 0 1.25rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0.45rem 1rem; }
.site-footer nav span { flex-basis: 100%; }
.site-footer a { color: var(--muted); }

.overlay-dialog {
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: color-mix(in srgb, var(--bg) 94%, transparent);
    color: var(--text);
}
.overlay-dialog::backdrop { background: rgb(0 0 0 / 42%); backdrop-filter: blur(3px); }
.overlay-dialog[open] { animation: dialog-in 150ms ease-out; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(-0.35rem); } }

.dialog-panel { width: min(calc(100% - 2rem), var(--content-width)); margin: 0 auto; padding: 2rem 0 5rem; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; min-height: 2.6rem; }
.dialog-title { margin: 0; color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; }
.menu-nav { display: grid; margin-top: 10vh; }
.menu-nav a {
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-size: clamp(1.55rem, 5vw, 2.2rem);
    font-weight: 700;
    text-decoration: none;
}
.menu-nav a:first-child { border-top: 1px solid var(--border); }
.menu-nav a:hover, .menu-nav a[aria-current="page"] { color: var(--accent); padding-left: 0.5rem; }
.menu-socials { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; margin-top: 3rem; }
.menu-socials .eyebrow { flex-basis: 100%; }

.search-panel { padding-top: 2rem; }
.search-field {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.75rem;
    align-items: center;
    margin-top: 12vh;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--border);
}
.search-field:focus-within { border-color: var(--accent); }
.search-field svg { width: 1.25rem; fill: none; stroke: var(--muted); stroke-width: 1.7; }
.search-field input { min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 1.1rem; }
.search-field kbd { color: var(--faint); font-size: 0.7rem; }
.search-status { margin: 1rem 0; color: var(--faint); font-size: 0.8rem; }
.search-results { margin: 2rem 0 0; padding: 0; list-style: none; }
.search-results li { padding: 1rem 0; border-bottom: 1px solid var(--border); }
.search-results a { display: block; font-weight: 700; }
.search-results p { margin: 0.35rem 0 0; color: var(--muted); font-size: 0.85rem; }
.search-results time { display: block; margin-top: 0.35rem; color: var(--faint); font-size: 0.74rem; }

/* Refaat/Cactus layout, adapted to this site's semantic templates. */
body {
    min-height: 100vh;
    padding: 4rem 1rem 0;
    border: 0;
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.4286;
}

.site-shell {
    width: 100%;
    max-width: 80rem;
    min-height: calc(100vh - 4rem);
}

.site-header {
    position: sticky;
    z-index: 40;
    top: 0;
    min-height: 0;
    margin-bottom: 5rem;
    background: color-mix(in oklab, var(--bg) 95%, transparent);
}

.site-identity {
    position: relative;
    display: flex;
    align-items: center;
}

.avatar-link,
.avatar {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
}

.avatar-link {
    display: block;
    flex: none;
    margin-right: 0.75rem;
}

.avatar { filter: grayscale(1); }
.avatar-link:hover .avatar { filter: none; }

.brand-stack { display: flex; }

.brand {
    color: var(--text);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.75rem;
}

.primary-nav { display: none; }

.primary-nav a {
    color: var(--accent);
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.25rem;
    text-decoration: none;
}

.primary-nav a:hover,
.primary-nav a[aria-current="page"] {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.header-actions { gap: 0.5rem; margin-left: auto; }
.icon-button { width: 2.25rem; height: 2.25rem; border-radius: var(--radius); }
.icon-button svg { width: 1.75rem; height: 1.75rem; stroke-width: 1.5; }
.mobile-menu-button { display: inline-grid; width: 1.75rem; height: 1.75rem; margin-left: 0.5rem; }

.site-main { flex: 1; padding: 0; }

h1, h2, h3 {
    color: var(--heading);
    letter-spacing: 0;
}

h1 {
    margin: 0 0 1.5rem;
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 2rem;
}

h2 {
    margin: 4rem 0 1.5rem;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.75rem;
}

h3 {
    margin-top: 2rem;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.5rem;
}

.intro-section { max-width: none; }
.intro-copy { max-width: none; font-size: inherit; line-height: inherit; }
.intro-copy p { margin: 0 0 1rem; }

.social-block {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    column-gap: 0.5rem;
    margin-top: 0;
}

.social-block > p { margin: 0; color: var(--text); }
.social-icon-list { align-items: center; gap: 0.5rem; }
.social-icon-link {
    display: grid;
    width: 2rem;
    height: 2rem;
    place-items: center;
    color: var(--text);
    text-decoration: none;
}
.social-icon-link:hover { color: var(--link); }
.social-icon-link svg { width: 100%; height: 100%; fill: currentColor; }
.social-icon-link span { font-size: 0.75rem; }

.listing-section { margin-top: 4rem; }
.section-heading h2 { margin: 0 0 1.5rem; }
.quiet-link { display: none; }

.post-list {
    display: grid;
    gap: 1rem;
}

.post-list > li {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    margin: 0;
}

.post-list time {
    min-width: 7.5rem;
    color: var(--muted);
    font-size: inherit;
    font-weight: 600;
}

.post-list a {
    color: var(--text);
    font-size: inherit;
    font-weight: 400;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.post-list a:hover {
    color: var(--text);
    text-decoration-color: var(--link);
    text-decoration-thickness: 2px;
}

.post-list-detailed > li {
    padding: 0;
    border: 0;
}
.post-list-detailed > li:first-child { border: 0; }
.post-list-detailed p { font-size: inherit; }

.site-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 5rem 0 1rem;
    border: 0;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
}
.site-footer p { margin: 0; }
.site-footer nav { justify-content: center; gap: 0; }
.site-footer a { padding: 0.5rem 1rem; color: var(--muted); }
.site-footer a:hover { color: var(--text); }

.page-header { margin-bottom: 3rem; }
.page-summary { font-size: inherit; line-height: inherit; }
.prose { max-width: 65ch; font-size: inherit; line-height: inherit; }
.prose.intro-copy { max-width: none; }
.eyebrow { color: var(--muted); font-size: 0.75rem; }

.dialog-panel { width: min(calc(100% - 2rem), 48rem); }

@media (min-width: 640px) {
    body { padding-inline: 0; }

    .site-shell { padding-inline: 2rem; }

    .site-header { padding-left: 4.5rem; }

    .avatar-link {
        position: absolute;
        top: 0;
        left: -4.5rem;
        width: 3.75rem;
        height: 3.75rem;
        margin-right: 0;
    }

    .avatar { width: 3.75rem; height: 3.75rem; }
    .brand-stack { display: block; }
    .brand { font-size: 1.5rem; line-height: 2rem; }

    .primary-nav {
        display: flex;
        align-items: center;
        margin-top: 0.25rem;
        margin-left: -1rem;
    }

    .primary-nav a { padding-inline: 1rem; }
    .primary-nav a + a {
        margin-left: 0;
        padding-left: 1rem;
        border-left: 1px solid var(--accent);
    }

    .header-actions { gap: 1rem; }
    .mobile-menu-button { display: none; }

    .post-list > li { grid-template-columns: auto minmax(0, 1fr); }

    .site-footer {
        flex-direction: row;
        justify-content: space-between;
        gap: 1rem;
        text-align: left;
    }
    .site-footer nav { justify-content: flex-end; }
    .site-footer a + a { border-left: 1px solid var(--faint); }

    .resume-header { display: flex; }
    .timeline-item,
    .skills-list > div { grid-template-columns: 9.5rem minmax(0, 1fr); }
}

@media (max-width: 639px) {
    .resume-header { display: block; }
    .resume-header .button-link { margin-top: 1.5rem; }
    .timeline-item,
    .skills-list > div { grid-template-columns: 1fr; gap: 0.35rem; }
    pre:hover .copy-code,
    .copy-code { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

@media print {
    .site-header, .site-footer, .back-link, .post-footer, .button-link { display: none !important; }
    body { background: #fff; color: #000; font-size: 11pt; }
    .site-main { padding: 0; }
    a { color: inherit; }
}
