/* ==========================================================================
   malikoglu.az — hand-written CSS, no build step.
   Paper & ink: warm neutrals, one accent colour, hairline rules. No gradients, no glow.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
    --font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --container: 1120px;
    --gutter: clamp(18px, 4vw, 40px);
    --radius: 4px;
    --header-h: 68px;
    --ease: cubic-bezier(.22, 1, .36, 1);

    color-scheme: light;
    --bg: #f4f1ea;
    --bg-alt: #ece8df;
    --surface: #fbfaf6;
    --ink: #151412;
    --ink-2: #3b3934;
    --muted: #69645a;
    --rule: #d9d3c6;
    --rule-strong: #b6ae9f;
    --accent: #b8390e;
    --accent-ink: #fbfaf6;
    --accent-soft: rgba(184, 57, 14, .10);
    --ok: #2f7a45;
    --error: #b42318;
    --header-bg: rgba(244, 241, 234, .95);
    --photo-blend: normal;
    --scan-shadow: 0 1px 0 rgba(0, 0, 0, .04), 0 18px 32px -22px rgba(40, 30, 10, .45);
}
html[data-theme="dark"] {
    color-scheme: dark;
    --bg: #151412; --bg-alt: #1b1a17; --surface: #1e1d1a;
    --ink: #ece8e0; --ink-2: #c8c2b7; --muted: #9b9488;
    --rule: #34312b; --rule-strong: #4c483f;
    --accent: #f0703c; --accent-ink: #151412; --accent-soft: rgba(240, 112, 60, .12);
    --ok: #6cc28a; --error: #ff8a7a;
    --header-bg: rgba(21, 20, 18, .95); --photo-blend: normal;
    --scan-shadow: 0 18px 32px -20px rgba(0, 0, 0, .8);
}
@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) {
        color-scheme: dark;
        --bg: #151412; --bg-alt: #1b1a17; --surface: #1e1d1a;
        --ink: #ece8e0; --ink-2: #c8c2b7; --muted: #9b9488;
        --rule: #34312b; --rule-strong: #4c483f;
        --accent: #f0703c; --accent-ink: #151412; --accent-soft: rgba(240, 112, 60, .12);
        --ok: #6cc28a; --error: #ff8a7a;
        --header-bg: rgba(21, 20, 18, .95); --photo-blend: normal;
        --scan-shadow: 0 18px 32px -20px rgba(0, 0, 0, .8);
    }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
    margin: 0; font-family: var(--font-sans); font-size: 17px; line-height: 1.6;
    color: var(--ink); background: var(--bg);
    -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
    overflow-x: hidden;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4 { font-family: var(--font-sans); font-weight: 600; line-height: 1.12; letter-spacing: -.02em; margin: 0 0 .5em; color: var(--ink); }
h1 { font-size: clamp(2.3rem, 5.2vw, 4rem); letter-spacing: -.035em; }
h2 { font-size: clamp(1.65rem, 3vw, 2.35rem); letter-spacing: -.028em; }
h3 { font-size: 1.15rem; }
strong { font-weight: 600; color: var(--ink); }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--ink); color: var(--bg); }

.mono { font-family: var(--font-mono); font-size: .82em; letter-spacing: 0; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.lead { font-size: clamp(1.08rem, 1.5vw, 1.24rem); line-height: 1.65; color: var(--ink-2); }
.container {
    width: 100%; max-width: var(--container); margin-inline: auto;
    padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right));
}
.pt-0 { padding-top: 0 !important; }
.mt-xl { margin-top: 3.5rem; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 1000; background: var(--ink); color: var(--bg); padding: 10px 16px; font-weight: 500; transition: top .2s; }
.skip-link:focus { top: 12px; }

/* ---------- Links & buttons ---------- */
.link-arrow {
    display: inline-flex; align-items: center; gap: .4rem; font-weight: 500; color: var(--ink);
    border-bottom: 1px solid var(--rule-strong); padding-bottom: 2px; transition: color .15s, border-color .15s;
}
.link-arrow:hover { color: var(--accent); border-color: var(--accent); }
.link-arrow .icon { flex: none; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    padding: .72rem 1.1rem; border-radius: var(--radius); border: 1px solid transparent;
    font-weight: 500; font-size: .95rem; line-height: 1.2; text-align: center;
    transition: background .15s, color .15s, border-color .15s;
}
.btn .icon { flex: none; }
.btn-sm { padding: .48rem .85rem; font-size: .88rem; }
.btn-lg { padding: .85rem 1.35rem; font-size: 1rem; }
.btn-block { width: 100%; flex-wrap: wrap; }
.btn-primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--bg); }
.btn-soft { background: var(--surface); color: var(--ink); border-color: var(--rule-strong); }
.btn-soft:hover { border-color: var(--ink); }
.btn-ghost, .btn-link { background: transparent; color: var(--ink-2); padding-inline: .2rem; }
.btn-ghost:hover, .btn-link:hover { color: var(--accent); }
.btn:disabled { opacity: .6; cursor: progress; }
.muted-on-primary { opacity: .85; font-weight: 400; }
.header-cta, .lang-switch a, .site-nav ul a, .brand-name { white-space: nowrap; }

.icon-btn {
    display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: var(--radius);
    background: transparent; border: 1px solid var(--rule); color: var(--ink-2); transition: border-color .15s, color .15s;
}
.icon-btn:hover { border-color: var(--ink); color: var(--ink); }

.badge { display: inline-block; font-family: var(--font-mono); font-size: .75rem; border: 1px solid currentColor; padding: .12rem .45rem; color: var(--accent); }

.eyebrow {
    display: flex; align-items: center; gap: .65rem;
    font-family: var(--font-mono); font-size: .78rem; letter-spacing: .06em; text-transform: uppercase;
    color: var(--muted); margin: 0 0 1rem;
}
.eyebrow-num { color: var(--accent); font-weight: 500; }
.eyebrow-dot { display: inline-block; width: 28px; height: 1px; background: var(--rule-strong); flex: none; }

.tags { display: flex; flex-wrap: wrap; gap: .3rem .55rem; margin-top: 1rem; }
.tags li { font-family: var(--font-mono); font-size: .76rem; color: var(--muted); }
.tags li:not(:last-child)::after { content: "·"; margin-left: .55rem; color: var(--rule-strong); }
.tags-sm li { font-size: .72rem; }

.check-list { display: grid; gap: .45rem; }
.check-list li { display: flex; gap: .6rem; align-items: flex-start; color: var(--ink-2); font-size: .96rem; }
.check-list .icon { color: var(--accent); flex: none; margin-top: .3rem; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--header-bg); border-bottom: 1px solid transparent; transition: border-color .2s; }
.site-header.is-scrolled { border-bottom-color: var(--rule); }
.header-inner { display: flex; align-items: center; gap: 1.5rem; min-height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: .7rem; color: var(--ink); }
.brand-mark {
    display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none;
    border: 1.5px solid var(--ink); font-family: var(--font-mono); font-weight: 500; font-size: .8rem; letter-spacing: .02em;
    transition: background .15s, color .15s;
}
.brand:hover .brand-mark { background: var(--ink); color: var(--bg); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 600; font-size: 1rem; letter-spacing: -.01em; }
.brand-role { font-family: var(--font-mono); font-size: .7rem; color: var(--muted); margin-top: 3px; }

.site-nav { margin-left: auto; }
.site-nav ul { display: flex; gap: .15rem; }
.site-nav ul a {
    display: inline-block; padding: .45rem .7rem; font-size: .95rem; font-weight: 500; color: var(--ink-2);
    border-bottom: 1.5px solid transparent; transition: color .15s, border-color .15s;
}
.site-nav ul a:hover { color: var(--ink); }
.site-nav ul a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.nav-mobile-extras { display: none; }

.header-actions { display: flex; align-items: center; gap: .6rem; }
.lang-switch { display: inline-flex; gap: .1rem; font-family: var(--font-mono); font-size: .78rem; }
.lang-switch a { padding: .35rem .4rem; color: var(--muted); border-bottom: 1px solid transparent; }
.lang-switch a:hover { color: var(--ink); }
.lang-switch a.is-active { color: var(--ink); border-bottom-color: var(--ink); }

.theme-toggle .icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
    html:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

.nav-toggle { display: none; }
.burger { display: grid; gap: 4px; width: 18px; }
.burger i { display: block; height: 1.5px; background: currentColor; transition: transform .2s, opacity .2s; }
.nav-toggle[aria-expanded="true"] .burger i:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .burger i:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .burger i:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

@media (max-width: 1199px) { .header-cta { display: none; } }
@media (max-width: 1023px) {
    .header-actions .lang-switch { display: none; }
    .nav-toggle { display: inline-grid; }
    .site-nav {
        position: fixed; top: var(--header-h); left: 0; right: 0;
        height: calc(100vh - var(--header-h)); height: calc(100dvh - var(--header-h));
        z-index: 49; margin: 0; background: var(--bg); border-top: 1px solid var(--rule);
        padding: .5rem var(--gutter) 2rem; overflow-y: auto;
        opacity: 0; pointer-events: none; visibility: hidden; transition: opacity .2s, visibility 0s linear .2s;
    }
    .site-nav.is-open { opacity: 1; pointer-events: auto; visibility: visible; transition-delay: 0s; }
    .site-nav ul { flex-direction: column; gap: 0; }
    .site-nav ul a { display: block; font-size: 1.3rem; padding: .9rem 0; border-bottom: 1px solid var(--rule); }
    .site-nav ul a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--rule); }
    .nav-mobile-extras { display: flex; flex-direction: column; align-items: flex-start; gap: 1.25rem; margin-top: 1.5rem; }
    .lang-switch-inline { font-size: .95rem; }
    body.nav-open { overflow: hidden; }
}

/* ---------- Sections ---------- */
.section { padding-block: clamp(56px, 8vw, 104px); border-top: 1px solid var(--rule); }
.section-alt { background: var(--bg-alt); }
.page-hero + .section { border-top: 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; margin-bottom: clamp(1.75rem, 4vw, 3rem); }
.section-head-sm { margin-bottom: 1.25rem; }
.section-title { margin-bottom: .35em; max-width: 22ch; }
.section-title-sm { font-size: 1.3rem; }
.section-subtitle { color: var(--muted); max-width: 60ch; margin: 0; font-size: 1.05rem; }
.section-foot { margin-top: 2rem; }
@media (max-width: 640px) { .section-head { flex-direction: column; align-items: flex-start; } }

.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1023px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
@media (max-width: 800px) { .two-col { grid-template-columns: 1fr; } }

.card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.4rem; }
.card-title { display: flex; align-items: center; gap: .5rem; font-size: 1rem; margin-bottom: .9rem; }
.card-quote { display: flex; flex-direction: column; justify-content: center; }
.card-quote .lead { margin-bottom: .5rem; }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(40px, 7vw, 88px) clamp(48px, 6vw, 72px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, .6fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: end; }
.hero-kicker { color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-size: .78rem; margin-bottom: 1.5rem; }
.hero-kicker span { color: var(--rule-strong); margin: 0 .3rem; }
.hero-title { max-width: 16ch; margin-bottom: 1.25rem; }
.hero-highlight { color: var(--accent); }
.hero-subtitle { font-size: clamp(1.05rem, 1.4vw, 1.2rem); color: var(--ink-2); max-width: 58ch; margin-bottom: 2rem; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; margin-bottom: 2rem; }
.hero-meta { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; font-family: var(--font-mono); font-size: .8rem; color: var(--muted); }
.hero-meta li { display: inline-flex; align-items: center; gap: .45rem; }
.hero-meta .icon { color: var(--ink-2); }
.status-dot { width: 8px; height: 8px; background: var(--ok); border-radius: 50%; flex: none; }

.hero-photo { margin: 0; justify-self: end; width: 100%; max-width: 330px; }
.hero-photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 25%; border: 1px solid var(--ink); mix-blend-mode: var(--photo-blend); }
.hero-photo figcaption { margin-top: .6rem; color: var(--muted); font-size: .74rem; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); margin: clamp(2.5rem, 5vw, 4rem) 0 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--rule); }
.stat { display: flex; flex-direction: column-reverse; padding: 1.2rem 1.25rem 1.3rem 0; }
.stat + .stat { padding-left: 1.25rem; border-left: 1px solid var(--rule); }
.stat dd { margin: 0; font-weight: 600; font-size: clamp(2rem, 3.4vw, 2.8rem); letter-spacing: -.035em; line-height: 1; }
.stat dt { color: var(--muted); font-family: var(--font-mono); font-size: .76rem; margin: .6rem 0 0; }

.trust { display: flex; flex-wrap: wrap; align-items: baseline; gap: .45rem 1.25rem; margin: 1.25rem 0 0; font-size: .96rem; }
.trust-label { color: var(--muted); text-transform: uppercase; font-size: .72rem; letter-spacing: .06em; }
.trust a { font-weight: 500; border-bottom: 1px solid var(--rule-strong); }
.trust a:hover { color: var(--accent); border-color: var(--accent); }

@media (max-width: 900px) {
    .hero-grid { grid-template-columns: 1fr; align-items: start; }
    .hero-photo { order: -1; justify-self: start; max-width: 170px; }
    .hero-photo figcaption { display: none; }
    .hero-title { max-width: none; }
}
@media (max-width: 640px) {
    .stats { grid-template-columns: repeat(2, 1fr); }
    .stat:nth-child(3) { border-left: 0; padding-left: 0; }
    .stat:nth-child(n+3) { border-top: 1px solid var(--rule); }
}

/* ---------- Recommendation letters ---------- */
.letters { border-top: 1px solid var(--ink); }
.letter {
    margin: 0; display: grid; grid-template-columns: minmax(0, 190px) minmax(0, 1fr);
    gap: clamp(1.25rem, 3.5vw, 3rem); align-items: start;
    padding: clamp(1.75rem, 3.5vw, 2.75rem) 0; border-bottom: 1px solid var(--rule);
}
.letter-featured { grid-template-columns: minmax(0, 250px) minmax(0, 1fr); }
.letter-scan { display: block; background: #fff; border: 1px solid var(--rule-strong); box-shadow: var(--scan-shadow); transform: rotate(-1.4deg); transition: transform .25s var(--ease); }
.letter:nth-child(even) .letter-scan { transform: rotate(1.1deg); }
.letter-scan:hover { transform: rotate(0deg) translateY(-3px); }
.letter-scan img { width: 100%; height: auto; }
.letter-quote { margin: 0 0 1.25rem; }
.letter-quote p { margin: 0; font-size: clamp(1.08rem, 1.55vw, 1.28rem); line-height: 1.55; color: var(--ink); }
.letter-featured .letter-quote p { font-size: clamp(1.25rem, 2.2vw, 1.7rem); line-height: 1.42; letter-spacing: -.012em; }
.letter-quote p::before { content: "“"; color: var(--accent); }
.letter-quote p::after { content: "”"; color: var(--accent); }
.letter-caption { display: flex; flex-direction: column; gap: .1rem; margin-bottom: 1rem; }
.letter-author { font-weight: 600; }
.letter-role { color: var(--ink-2); font-size: .95rem; }
.letter-date { color: var(--muted); font-size: .74rem; margin-top: .3rem; }
.letter-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin: 0; }
@media (max-width: 640px) {
    .letter, .letter-featured { grid-template-columns: 1fr; }
    .letter-scan { max-width: 200px; }
}

.letter-dialog { padding: 0; border: 0; background: transparent; color: var(--ink); width: min(92vw, 860px); max-width: none; max-height: 94vh; overflow: auto; }
.letter-dialog::backdrop { background: rgba(21, 20, 18, .8); }
.letter-dialog img { width: 100%; height: auto; background: #fff; }
.dialog-close {
    position: sticky; top: 8px; margin: 8px 8px -48px auto; z-index: 2;
    display: grid; place-items: center; width: 40px; height: 40px;
    border: 1px solid var(--ink); border-radius: var(--radius); background: var(--bg); color: var(--ink);
}
.dialog-close:hover { background: var(--ink); color: var(--bg); }

/* ---------- About teaser ---------- */
.about-teaser { display: grid; grid-template-columns: .85fr 1.15fr; gap: clamp(1.5rem, 5vw, 4rem); align-items: start; }
.about-teaser .lead { margin-bottom: 1.5rem; }
@media (max-width: 860px) { .about-teaser { grid-template-columns: 1fr; } }

/* ---------- Services (numbered list) ---------- */
.services { border-top: 1px solid var(--ink); }
.service { display: grid; grid-template-columns: 3.25rem minmax(0, .9fr) minmax(0, 1.35fr); gap: .75rem 2rem; padding: 1.5rem 0; border-bottom: 1px solid var(--rule); align-items: baseline; }
.service-num { color: var(--accent); font-size: .8rem; }
.service-title { font-size: 1.2rem; margin: 0; }
.service-short { margin: 0; color: var(--ink-2); }
.service-desc { color: var(--ink-2); margin: .8rem 0 1rem; }
.service .tags { margin-top: .75rem; }
.service-detailed { padding: 2.1rem 0; }
.service-detailed .service-title { font-size: clamp(1.3rem, 2vw, 1.6rem); }
.service-detailed .service-short { font-weight: 500; color: var(--ink); }
@media (max-width: 760px) {
    .service { grid-template-columns: 2.4rem minmax(0, 1fr); }
    .service-body { grid-column: 2; }
}

/* ---------- Projects ---------- */
.project-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.5rem 1.5rem 1.4rem; transition: border-color .15s; }
.project-card:hover { border-color: var(--ink); }
.project-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: .9rem; }
.project-period { color: var(--muted); }
.project-link { display: inline-grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--rule); border-radius: var(--radius); color: var(--ink-2); }
.project-link:hover { border-color: var(--ink); color: var(--ink); }
.project-title { font-size: 1.3rem; margin-bottom: .2rem; }
.project-client { color: var(--muted); font-size: .9rem; margin-bottom: .8rem; }
.project-summary { color: var(--ink-2); }
.project-desc { color: var(--ink-2); font-size: .97rem; }
.project-role { font-size: .92rem; color: var(--ink-2); }
.project-role .label { color: var(--muted); }
.project-bullets { display: grid; gap: .4rem; margin: .5rem 0 1rem; }
.project-bullets li { display: flex; gap: .55rem; align-items: flex-start; color: var(--ink-2); font-size: .94rem; }
.project-bullets .icon { color: var(--accent); flex: none; margin-top: .3rem; }
.metrics { display: flex; flex-wrap: wrap; margin: 1rem 0 0; border-top: 1px solid var(--rule); }
.metric { flex: 1 1 110px; display: flex; flex-direction: column-reverse; padding: .85rem 1rem .1rem 0; }
.metric dd { margin: 0; font-weight: 600; font-size: 1.35rem; letter-spacing: -.02em; line-height: 1.1; }
.metric dt { font-family: var(--font-mono); font-size: .72rem; color: var(--muted); margin-top: .3rem; }
.project-card .tags { margin-top: auto; padding-top: 1rem; }
.project-card-large .tags { margin-top: 1rem; }
.project-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.also-list { margin-top: 1rem; border-top: 1px solid var(--rule); }
.also-list li { padding: .95rem 0; border-bottom: 1px solid var(--rule); color: var(--ink-2); }

/* ---------- Award ---------- */
.award { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); padding: clamp(1.75rem, 3vw, 2.75rem) 0; }
.award-place { font-weight: 600; font-size: clamp(4rem, 10vw, 7.5rem); line-height: .85; letter-spacing: -.06em; color: var(--accent); margin: 0; }
.award-title { font-size: clamp(1.3rem, 2.4vw, 1.85rem); max-width: 28ch; }
.award-meta { color: var(--ink-2); font-size: .95rem; }
.award-desc { color: var(--ink-2); max-width: 65ch; }
@media (max-width: 640px) { .award { grid-template-columns: 1fr; } }

/* ---------- Apps ---------- */
.app-card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); transition: border-color .15s; }
.app-card:hover { border-color: var(--ink); }
.app-card-link { position: relative; display: grid; grid-template-columns: 56px 1fr auto; gap: 1rem; align-items: start; padding: 1.1rem; }
.app-icon { width: 56px; height: 56px; border-radius: 12px; overflow: hidden; border: 1px solid var(--rule); display: grid; place-items: center; background: var(--bg); }
.app-icon img { width: 100%; height: 100%; object-fit: cover; }
.app-icon-fallback { font-weight: 600; font-size: 1.4rem; color: var(--accent); }
.app-body { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.app-name { font-weight: 600; letter-spacing: -.01em; }
.app-tagline { color: var(--accent); font-size: .86rem; }
.app-desc { color: var(--muted); font-size: .9rem; margin-top: .3rem; }
.app-meta { display: flex; flex-wrap: wrap; gap: .3rem 1rem; margin-top: .55rem; font-family: var(--font-mono); font-size: .74rem; color: var(--muted); }
.app-meta > span { display: inline-flex; align-items: center; gap: .3rem; }
.app-rating .icon { color: var(--accent); fill: currentColor; }
.app-arrow { color: var(--muted); transition: color .15s; }
.app-card:hover .app-arrow { color: var(--ink); }
.app-extra { display: flex; gap: 1rem; padding: 0 1.1rem .9rem 5.3rem; font-size: .84rem; }
.app-extra a { display: inline-flex; align-items: center; gap: .3rem; color: var(--muted); min-height: 24px; padding: .2rem 0; }
.app-extra a:hover { color: var(--ink); }
@media (max-width: 480px) { .app-extra { padding-left: 1.1rem; } }

.filter-bar { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.5rem; }
.chip { display: inline-flex; align-items: center; gap: .45rem; padding: .4rem .8rem; border-radius: var(--radius); background: transparent; border: 1px solid var(--rule-strong); color: var(--ink-2); font-size: .9rem; transition: border-color .15s, background .15s, color .15s; }
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.is-active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip-count { font-family: var(--font-mono); font-size: .72rem; opacity: .85; }
.chip.is-active .chip-count { opacity: 1; }
.app-card.is-hidden { display: none; }

/* ---------- Experience ---------- */
.timeline { border-top: 1px solid var(--ink); }
.timeline-item { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: 1.5rem; padding: 1.4rem 0; border-bottom: 1px solid var(--rule); }
.timeline-marker { display: none; }
.timeline-period { color: var(--muted); padding-top: .25rem; white-space: nowrap; }
.timeline-role { font-size: 1.1rem; margin-bottom: .15rem; }
.timeline-company { color: var(--ink-2); font-size: .95rem; margin-bottom: .5rem; }
.timeline-summary { color: var(--ink-2); margin-bottom: .5rem; max-width: 72ch; }
.timeline-bullets { display: grid; gap: .3rem; color: var(--muted); font-size: .93rem; padding-left: 1.1rem; list-style: disc; margin-bottom: .5rem; }
.timeline-compact .timeline-summary { margin-bottom: .25rem; }
@media (max-width: 640px) { .timeline-item { grid-template-columns: 1fr; gap: .35rem; } }

/* ---------- Call to action ---------- */
.cta { max-width: 800px; }
.cta-title { font-size: clamp(2rem, 4.4vw, 3.2rem); letter-spacing: -.035em; margin-bottom: .6rem; }
.cta-text { color: var(--ink-2); font-size: 1.1rem; max-width: 56ch; margin-bottom: 1.75rem; }
.cta-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.75rem; }
.cta-mail { font-family: var(--font-mono); font-size: 1rem; border-bottom: 1px solid var(--rule-strong); }
.cta-mail:hover { color: var(--accent); border-color: var(--accent); }
.cta-band { display: grid; grid-template-columns: minmax(0, 1.2fr) auto; gap: 1.5rem 3rem; align-items: end; }
.cta-band .cta-text { margin-bottom: 0; }
@media (max-width: 800px) { .cta-band { grid-template-columns: 1fr; } }

/* ---------- Page hero (sub-pages) ---------- */
.page-hero { padding: clamp(40px, 6vw, 80px) 0 clamp(28px, 4vw, 48px); }
.page-title { max-width: 20ch; margin-bottom: .6rem; }
.page-subtitle { color: var(--ink-2); font-size: clamp(1.05rem, 1.4vw, 1.2rem); max-width: 60ch; margin: 0; }
.page-actions { margin-top: 1.5rem; }

/* ---------- About page ---------- */
.about-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, .75fr); gap: clamp(1.5rem, 4vw, 4rem); align-items: start; }
.about-main p { color: var(--ink-2); font-size: 1.04rem; max-width: 66ch; }
.about-main .lead { color: var(--ink); }
.about-side { display: grid; gap: 1rem; position: sticky; top: calc(var(--header-h) + 20px); }
.about-photo img { width: 100%; aspect-ratio: 1; object-fit: cover; border: 1px solid var(--ink); mix-blend-mode: var(--photo-blend); }
.edu-school { font-weight: 600; margin-bottom: .1rem; }
.lang-list li { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem 0; border-bottom: 1px solid var(--rule); }
.lang-list li:last-child { border-bottom: 0; }
.pull-quote { margin: 2.25rem 0 0; padding-left: 1.25rem; border-left: 2px solid var(--accent); }
.pull-quote blockquote { margin: 0; }
.pull-quote p { font-size: 1.2rem; font-weight: 500; color: var(--ink); margin-bottom: .5rem; line-height: 1.45; }
.pull-quote figcaption { color: var(--muted); font-size: .8rem; font-family: var(--font-mono); }
.skill-group { border-top: 1px solid var(--ink); padding-top: 1rem; }
.skill-title { font-size: 1rem; margin-bottom: .25rem; }
@media (max-width: 900px) {
    .about-layout { grid-template-columns: 1fr; }
    .about-side { position: static; }
    .about-photo { max-width: 240px; }
}

/* ---------- Process ---------- */
.process { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--ink); }
.process-step { padding: 1.5rem 1.5rem 1.5rem 0; }
.process-step + .process-step { padding-left: 1.5rem; border-left: 1px solid var(--rule); }
.process-num { display: block; color: var(--accent); margin-bottom: .6rem; font-size: .85rem; }
.process-step h3 { font-size: 1.05rem; margin-bottom: .35rem; }
.process-step p { color: var(--muted); font-size: .94rem; margin: 0; }
@media (max-width: 1000px) {
    .process { grid-template-columns: repeat(2, 1fr); }
    .process-step:nth-child(3) { border-left: 0; padding-left: 0; }
    .process-step:nth-child(n+3) { border-top: 1px solid var(--rule); }
}
@media (max-width: 560px) {
    .process { grid-template-columns: 1fr; }
    .process-step, .process-step + .process-step { padding-left: 0; border-left: 0; }
    .process-step + .process-step { border-top: 1px solid var(--rule); }
}

/* ---------- Contact ---------- */
.contact-layout { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; }
.contact-info { border-top: 1px solid var(--ink); padding-top: 1.25rem; position: sticky; top: calc(var(--header-h) + 20px); }
.contact-list { display: grid; gap: 1.1rem; margin-bottom: 1.5rem; }
.contact-list li { display: grid; grid-template-columns: auto 1fr; gap: .85rem; align-items: start; color: var(--ink-2); font-size: .97rem; }
.contact-icon { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--rule); border-radius: var(--radius); color: var(--ink-2); }
.contact-label { display: block; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; font-family: var(--font-mono); margin-bottom: .1rem; }
.contact-list a { color: var(--ink); border-bottom: 1px solid var(--rule-strong); }
.contact-list a:hover { color: var(--accent); border-color: var(--accent); }
.contact-form-wrap { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: clamp(1.25rem, 3vw, 2rem); }
.contact-form { display: grid; gap: 1.1rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field { display: grid; gap: .4rem; }
.field label { font-weight: 500; font-size: .92rem; }
.req { color: var(--error); }
.field input, .field textarea { width: 100%; background: var(--bg); border: 1px solid var(--muted); border-radius: var(--radius); padding: .75rem .9rem; resize: vertical; transition: border-color .15s, box-shadow .15s; }
.field input::placeholder, .field textarea::placeholder { color: var(--muted); opacity: 1; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--accent-soft); }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: var(--error); }
.field-error { color: var(--error); font-size: .86rem; margin: 0; }
.field-hint { color: var(--muted); font-size: .82rem; margin: 0; }
.captcha-row { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.captcha-img { width: 200px; height: 64px; border: 1px solid var(--rule-strong); border-radius: var(--radius); background: #f6f3ec; }
.field-captcha input { max-width: 260px; font-family: var(--font-mono); letter-spacing: .25em; text-transform: uppercase; }
.field-captcha input::placeholder { font-family: var(--font-sans); letter-spacing: 0; text-transform: none; }
.form-foot { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.form-foot p { margin: 0; max-width: 42ch; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.alert { display: flex; gap: .8rem; align-items: flex-start; border-radius: var(--radius); padding: 1rem 1.1rem; margin-bottom: 1.25rem; border: 1px solid; background: var(--bg); }
.alert p, .alert ul { margin: .25rem 0 0; font-size: .93rem; }
.alert ul { list-style: disc; padding-left: 1.1rem; }
.alert-success { border-color: var(--ok); }
.alert-success .icon { color: var(--ok); }
.alert-error { border-color: var(--error); }
.alert-error .icon { color: var(--error); }
@media (max-width: 900px) { .contact-layout { grid-template-columns: 1fr; } .contact-info { position: static; } }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--ink); padding: clamp(40px, 6vw, 64px) 0 28px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1.3fr 1fr; gap: 2rem; }
.footer-tagline { color: var(--muted); max-width: 36ch; margin: 1rem 0; font-size: .95rem; }
.footer-social { display: flex; gap: .5rem; }
.footer-social a { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--rule); border-radius: var(--radius); color: var(--ink-2); }
.footer-social a:hover { border-color: var(--ink); color: var(--ink); }
.footer-title { font-family: var(--font-mono); font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 500; margin-bottom: 1rem; }
.footer-links { display: grid; gap: .45rem; }
.footer-links a, .footer-links span { color: var(--ink-2); font-size: .95rem; }
.footer-links a:hover { color: var(--accent); }
.lang-switch-footer { margin-top: 1.2rem; flex-wrap: wrap; font-family: var(--font-sans); font-size: .9rem; }
.footer-bottom { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--rule); font-size: .85rem; color: var(--muted); }
.footer-bottom p { margin: 0; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- Back to top ---------- */
.to-top {
    position: fixed; right: max(18px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom)); z-index: 40;
    width: 42px; height: 42px; border-radius: var(--radius); background: var(--bg); border: 1px solid var(--ink); color: var(--ink);
    display: grid; place-items: center; opacity: 0; transform: translateY(8px); pointer-events: none; visibility: hidden;
    transition: opacity .2s, transform .25s var(--ease), visibility 0s linear .2s;
}
.to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; visibility: visible; transition-delay: 0s; }
.to-top:hover { background: var(--ink); color: var(--bg); }

/* ---------- Error pages ---------- */
.error-page { min-height: 60vh; display: grid; place-items: center; text-align: center; border-top: 0; }
.error-inner { display: grid; justify-items: center; gap: .5rem; }
.error-code { font-size: clamp(3.5rem, 12vw, 7rem); font-weight: 500; color: var(--accent); line-height: 1; margin: 0; }
.error-page .btn { margin-top: 1rem; }

/* ---------- Reveal on scroll (applies only once site.js has run) ---------- */
html:not(.no-js) [data-reveal] { opacity: 0; transform: translateY(10px); transition: opacity .45s var(--ease), transform .5s var(--ease); }
html:not(.no-js) [data-reveal].is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
    [data-reveal], html:not(.no-js) [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }
    .letter-scan { transform: none !important; transition: none !important; }
}

/* ---------- Print ---------- */
@media print {
    :root, html[data-theme="dark"], html[data-theme="light"] {
        --bg: #fff; --bg-alt: #fff; --surface: #fff; --ink: #000; --ink-2: #111; --muted: #444;
        --rule: #ccc; --rule-strong: #999; --accent: #9a2f0b; --photo-blend: normal; --scan-shadow: none;
    }
    .site-header, .site-footer, .to-top, .cta, .cta-band, .nav-toggle, .skip-link, .letter-dialog { display: none !important; }
    [data-reveal], html:not(.no-js) [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }
    .letter-scan { transform: none !important; }
    main a[href^="http"]:not(.btn):not(.app-card-link):not(.project-link)::after { content: " (" attr(href) ")"; font-size: .8em; color: #555; }
}

/* ---------- Blog: list ---------- */
.post-list { border-top: 1px solid var(--ink); }
.post-item { border-bottom: 1px solid var(--rule); }
.post-card { display: grid; gap: .45rem; padding: 1.6rem 0; }
.post-meta { display: flex; align-items: center; gap: .75rem; color: var(--muted); margin: 0; }
.post-title { font-size: clamp(1.25rem, 2.2vw, 1.6rem); margin: 0; max-width: 42ch; }
.post-title a { border-bottom: 1px solid transparent; transition: color .15s, border-color .15s; }
.post-title a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.post-desc { color: var(--ink-2); margin: 0; max-width: 72ch; }
.post-card .tags { margin-top: .35rem; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: 2rem; }

/* ---------- Blog: article ---------- */
.article-hero { padding: clamp(40px, 6vw, 80px) 0 clamp(24px, 3vw, 40px); }
.eyebrow-link { color: var(--accent); }
.eyebrow-link:hover { text-decoration: underline; }
.article-title { font-size: clamp(2rem, 4.6vw, 3.3rem); max-width: 24ch; margin-bottom: 1rem; }
.article-meta { display: flex; flex-wrap: wrap; gap: .35rem 1.25rem; color: var(--muted); margin: 0; }
.article-langs { display: flex; flex-wrap: wrap; gap: .4rem .9rem; margin: 1rem 0 0; font-size: .95rem; }
.article-langs a { border-bottom: 1px solid var(--rule-strong); }
.article-langs a:hover { color: var(--accent); border-color: var(--accent); }
.article-layout {
    display: grid; grid-template-columns: minmax(0, 1fr) 15rem; gap: clamp(2rem, 5vw, 4.5rem); align-items: start;
    border-top: 1px solid var(--ink); padding-top: clamp(28px, 4vw, 44px); padding-bottom: clamp(40px, 6vw, 72px);
}
.article-layout:has(> .prose:only-child) { grid-template-columns: minmax(0, 1fr); }
.article-toc { position: sticky; top: calc(var(--header-h) + 24px); font-size: .9rem; }
.toc-title { color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-size: .72rem; margin: 0 0 .75rem; }
.article-toc ol { display: grid; gap: .45rem; border-left: 1px solid var(--rule); }
.article-toc li { padding-left: .9rem; }
.article-toc .toc-l3 { padding-left: 1.7rem; font-size: .85rem; }
.article-toc a { color: var(--ink-2); }
.article-toc a:hover { color: var(--accent); }
@media (max-width: 1000px) {
    .article-layout { grid-template-columns: minmax(0, 1fr); }
    .article-toc { position: static; order: -1; border: 1px solid var(--rule); padding: 1rem 1.1rem; }
}

/* Rendered Markdown */
.prose { max-width: 70ch; min-width: 0; font-size: 1.06rem; line-height: 1.72; color: var(--ink); }
.prose > * { margin: 0; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-size: clamp(1.4rem, 2.4vw, 1.75rem); margin: 2.2em 0 .6em; }
.prose h3 { font-size: 1.2rem; margin: 1.8em 0 .5em; }
.prose h2 + *, .prose h3 + * { margin-top: 0; }
.prose > h2:first-child, .prose > h3:first-child { margin-top: 0; }
.prose a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose a:hover { text-decoration-thickness: 2px; }
.prose .heading-anchor { margin-left: .4rem; color: var(--rule-strong); font-weight: 400; text-decoration: none; opacity: 0; transition: opacity .15s; }
.prose h2:hover .heading-anchor, .prose h3:hover .heading-anchor, .prose .heading-anchor:focus { opacity: 1; color: var(--accent); }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li + li { margin-top: .35em; }
.prose li::marker { color: var(--muted); }
.prose blockquote { margin: 1.4em 0; padding: .2em 0 .2em 1.2em; border-left: 2px solid var(--accent); color: var(--ink-2); }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5em 0; }
.prose img { border: 1px solid var(--rule); margin-inline: auto; }
.prose code { font-family: var(--font-mono); font-size: .88em; background: var(--bg-alt); border: 1px solid var(--rule); border-radius: 3px; padding: .08em .35em; overflow-wrap: anywhere; }
.prose pre {
    font-family: var(--font-mono); font-size: .86rem; line-height: 1.6; tab-size: 4;
    background: var(--surface); border: 1px solid var(--rule-strong); border-radius: var(--radius);
    padding: 1rem 1.1rem; overflow-x: auto;
}
.prose pre code { background: none; border: 0; padding: 0; font-size: inherit; overflow-wrap: normal; }
.table-wrap { overflow-x: auto; }
.prose table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: .55rem .75rem; border-bottom: 1px solid var(--rule); }
.prose th { font-weight: 600; border-bottom-color: var(--ink); }

/* Code highlighting (tempest/highlight classes) */
.hl-keyword { color: #9a2f0b; }
.hl-property, .hl-attribute { color: #1f4e79; }
.hl-type, .hl-generic { color: #6b3fa0; }
.hl-value, .hl-literal { color: #2f6b3f; }
.hl-number { color: #8a4b08; }
.hl-variable { color: #7a2e5a; }
.hl-comment { color: var(--muted); font-style: italic; }
.hl-operator { color: var(--ink-2); }
html[data-theme="dark"] .hl-keyword { color: #ff8f5e; }
html[data-theme="dark"] .hl-property, html[data-theme="dark"] .hl-attribute { color: #8cc4ff; }
html[data-theme="dark"] .hl-type, html[data-theme="dark"] .hl-generic { color: #c9a7ff; }
html[data-theme="dark"] .hl-value, html[data-theme="dark"] .hl-literal { color: #9fd6a8; }
html[data-theme="dark"] .hl-number { color: #f2c177; }
html[data-theme="dark"] .hl-variable { color: #f3a7cf; }
@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) .hl-keyword { color: #ff8f5e; }
    html:not([data-theme="light"]) .hl-property, html:not([data-theme="light"]) .hl-attribute { color: #8cc4ff; }
    html:not([data-theme="light"]) .hl-type, html:not([data-theme="light"]) .hl-generic { color: #c9a7ff; }
    html:not([data-theme="light"]) .hl-value, html:not([data-theme="light"]) .hl-literal { color: #9fd6a8; }
    html:not([data-theme="light"]) .hl-number { color: #f2c177; }
    html:not([data-theme="light"]) .hl-variable { color: #f3a7cf; }
}

/* Author & share */
.article-foot {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2rem; align-items: start;
    border-top: 1px solid var(--rule); padding-top: 2rem; padding-bottom: clamp(48px, 6vw, 80px);
}
.author { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 1.1rem; max-width: 62ch; }
.author img { width: 72px; height: 72px; object-fit: cover; border: 1px solid var(--ink); }
.author-label { color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-size: .72rem; margin: 0 0 .3rem; }
.author-name { font-weight: 600; margin: 0 0 .25rem; }
.author-name a { border-bottom: 1px solid var(--rule-strong); }
.author-name a:hover { color: var(--accent); border-color: var(--accent); }
.author-bio { color: var(--ink-2); margin: 0; font-size: .95rem; }
.share-links { display: flex; flex-wrap: wrap; gap: 1rem; margin: 0; }
.share-links a { font-weight: 500; border-bottom: 1px solid var(--rule-strong); }
.share-links a:hover { color: var(--accent); border-color: var(--accent); }
@media (max-width: 700px) { .article-foot { grid-template-columns: minmax(0, 1fr); } }

.article-cover { margin: 0 auto clamp(24px, 3vw, 40px); }
.article-cover img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border: 1px solid var(--ink); background: var(--bg-alt); }
.prose img[src$=".svg"] { width: 100%; height: auto; border: 0; }

.award-has-scan { grid-template-columns: auto minmax(0, 1fr) minmax(0, 300px); }
.award-links { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }
.award-date { color: var(--muted); }
.award-scan { align-self: center; transform: rotate(1.2deg); }
@media (max-width: 900px) { .award-has-scan { grid-template-columns: auto minmax(0, 1fr); } .award-scan { grid-column: 1 / -1; max-width: 360px; } }
@media (max-width: 640px) { .award-has-scan { grid-template-columns: 1fr; } }
