/* ============ Tokens ============ */
:root {
  --brand: #F06132;
  --brand-ink: #ffffff;
  --brand-soft: rgba(240, 97, 50, .12);
  --blue: #3152E4;
  --blue-soft: rgba(49, 82, 228, .12);
  --bg: #fbfaf8;
  --bg-alt: #f3f1ee;
  --surface: #ffffff;
  --text: #16181d;
  --muted: #5d6472;
  --line: #e7e4df;
  --shadow: 0 1px 2px rgba(16, 18, 24, .04), 0 8px 24px rgba(16, 18, 24, .06);
  --radius: 16px;
  --radius-sm: 10px;
  --font: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Space Grotesk", Inter, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --header-h: 68px;
  --gh0: #ebedf0; --gh1: #fbd3c3; --gh2: #f7a584; --gh3: #f37c52; --gh4: #d9461a;
  color-scheme: light;
}
[data-theme="dark"] {
  --brand-soft: rgba(240, 97, 50, .18);
  --blue: #7c93ff;
  --blue-soft: rgba(124, 147, 255, .16);
  --bg: #0e1015;
  --bg-alt: #13161d;
  --surface: #181c24;
  --text: #eceef3;
  --muted: #9aa3b2;
  --line: #262b36;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .35);
  --gh0: #1f2430; --gh1: #5a2a1a; --gh2: #8f3a1d; --gh3: #c94e22; --gh4: #F06132;
  color-scheme: dark;
}

/* ============ Base ============ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.65 var(--font); overflow-x: hidden; transition: background .25s, color .25s; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; letter-spacing: -.02em; margin: 0 0 .5em; overflow-wrap: anywhere; }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
button, input, textarea, select { font: inherit; color: inherit; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute !important; 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: 100; background: var(--brand); color: #fff; padding: 10px 14px; border-radius: 8px; text-decoration: none; }
.skip-link:focus { top: 12px; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.center { text-align: center; }
.d-block { display: block; }
.container { width: min(1160px, 100% - 40px); margin-inline: auto; }
.container.narrow { width: min(780px, 100% - 40px); }

/* ============ Buttons ============ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px; border-radius: 999px; border: 1px solid transparent; font-weight: 600; font-size: .95rem; text-decoration: none; cursor: pointer; transition: transform .15s, background .2s, border-color .2s, box-shadow .2s; white-space: nowrap; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: none; }
.btn-primary { background: var(--brand); color: var(--brand-ink); box-shadow: 0 6px 18px rgba(240, 97, 50, .28); }
.btn-primary:hover { background: #e2541f; }
.btn-ghost { background: var(--surface); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--brand); }
.btn-link { background: none; padding-inline: 4px; color: var(--brand); }
.btn-danger { background: transparent; color: #d93a2b; border-color: rgba(217, 58, 43, .35); }
.btn-danger:hover { background: rgba(217, 58, 43, .08); }
.btn-sm { padding: 7px 13px; font-size: .85rem; }
.btn-block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; transition: border-color .2s; }
.icon-btn:hover { border-color: var(--brand); }
.theme-toggle .i-moon { display: none; }
[data-theme="dark"] .theme-toggle .i-sun { display: none; }
[data-theme="dark"] .theme-toggle .i-moon { display: block; }

/* ============ Header / nav ============ */
.site-header { position: sticky; top: 0; z-index: 50; height: var(--header-h); background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px); border-bottom: 1px solid transparent; transition: border-color .2s, box-shadow .2s; }
.site-header.scrolled { border-bottom-color: var(--line); box-shadow: 0 4px 20px rgba(0, 0, 0, .04); }
.nav { height: 100%; display: flex; align-items: center; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 1.15rem; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--brand); color: #fff; font-size: 1rem; }
.nav-links { display: flex; gap: 4px; list-style: none; margin: 0 auto; padding: 0; }
.nav-links a { display: block; padding: 8px 12px; border-radius: 8px; text-decoration: none; color: var(--muted); font-weight: 500; font-size: .95rem; transition: color .2s, background .2s; }
.nav-links a:hover, .nav-links a[aria-current] { color: var(--text); background: var(--bg-alt); }
.nav-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.menu-toggle { display: none; }

.drawer-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(8, 10, 14, .5); opacity: 0; transition: opacity .25s; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 61; width: min(320px, 86vw); background: var(--surface); border-left: 1px solid var(--line); padding: 16px 20px 24px; display: flex; flex-direction: column; gap: 16px; transform: translateX(100%); transition: transform .3s cubic-bezier(.2, .8, .2, 1); overflow-y: auto; }
.drawer.open { transform: none; }
.drawer-backdrop.open { opacity: 1; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; }
.drawer ul { list-style: none; padding: 0; margin: 0; }
.drawer li a { display: block; padding: 14px 4px; border-bottom: 1px solid var(--line); text-decoration: none; font-weight: 600; font-size: 1.05rem; }
.drawer .btn { margin-top: auto; }

@media (max-width: 900px) {
  .nav-links, .hide-mobile { display: none !important; }
  .menu-toggle { display: inline-grid; }
}

/* ============ Sections ============ */
.section { padding: clamp(64px, 9vw, 110px) 0; }
.section-alt { background: var(--bg-alt); }
.page-top { padding-top: clamp(40px, 6vw, 72px); }
.section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 36px; }
.section-head > :first-child { flex-basis: 100%; margin: 0; }
.section-head h1, .section-head h2 { margin: 0; flex: 1 1 auto; }
.kicker { font-family: var(--mono); font-size: .8rem; text-transform: uppercase; letter-spacing: .14em; color: var(--brand); margin: 0 0 10px; font-weight: 600; }
.lead { font-size: 1.12rem; color: var(--muted); max-width: 62ch; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

/* ============ Hero ============ */
.hero { position: relative; padding: clamp(48px, 8vw, 96px) 0 clamp(40px, 6vw, 72px); overflow: hidden; }
.hero-glow { position: absolute; inset: -20% -10% auto auto; width: 620px; height: 620px; background: radial-gradient(circle, rgba(240, 97, 50, .22), transparent 60%); filter: blur(10px); pointer-events: none; }
.hero-glow::after { content: ""; position: absolute; left: -380px; top: 180px; width: 460px; height: 460px; background: radial-gradient(circle, rgba(49, 82, 228, .16), transparent 60%); }
.hero-inner { position: relative; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .9fr); gap: 48px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: .85rem; color: var(--muted); max-width: 100%; }
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 4px rgba(34, 197, 94, .2); flex-shrink: 0; }
.hero h1 { margin: 22px 0 14px; }
.typed-wrap { display: inline-block; color: var(--brand); min-height: 1.15em; }
.caret { display: inline-block; width: 3px; height: .9em; margin-left: 4px; background: currentColor; vertical-align: -.08em; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero-sub { font-family: var(--display); font-weight: 600; font-size: clamp(1.1rem, 2.2vw, 1.35rem); margin-bottom: 10px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 26px; }
.hero-cta svg { width: 18px; height: 18px; }
.terminal { border-radius: var(--radius); background: #12151c; color: #d6dae3; box-shadow: 0 30px 60px rgba(16, 18, 24, .25); overflow: hidden; border: 1px solid #222734; transform: rotate(1.2deg); }
.terminal-bar { display: flex; gap: 6px; align-items: center; padding: 12px 14px; background: #1a1e27; }
.terminal-bar span { width: 11px; height: 11px; border-radius: 50%; background: #ff5f56; }
.terminal-bar span:nth-child(2) { background: #ffbd2e; }
.terminal-bar span:nth-child(3) { background: #27c93f; }
.terminal-bar em { margin-left: 10px; font: 12px var(--mono); color: #8a93a5; font-style: normal; }
.terminal pre { margin: 0; padding: 18px 20px; font: 13px/1.8 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.t-ok { color: #34d399; } .t-acc { color: #F06132; } .t-mute { color: #6b7385; }
.stats { list-style: none; padding: 0; margin: 56px 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stats li { padding: 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.stats strong { display: block; font: 700 clamp(1.6rem, 3vw, 2.2rem) var(--mono); color: var(--brand); }
.stats span { color: var(--muted); font-size: .9rem; }

/* ============ About ============ */
.about-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 48px; }
.contact-chips { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.contact-chips a { display: inline-block; padding: 8px 14px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); text-decoration: none; font-weight: 600; font-size: .9rem; overflow-wrap: anywhere; }

/* ============ Skills ============ */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 20px; }
.skill-card { padding: 24px; }
.skill-card ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.skill-row { display: flex; justify-content: space-between; gap: 12px; font-size: .95rem; margin-bottom: 6px; }
.skill-row .mono { color: var(--muted); font-size: .8rem; }
.bar { height: 8px; border-radius: 99px; background: var(--bg-alt); overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--brand), #ff9a6b); transition: width 1.1s cubic-bezier(.2, .8, .2, 1); }
.in-view .bar span, .no-js .bar span { width: var(--w); }

/* ============ Timeline ============ */
.segmented, .seg { display: inline-flex; padding: 4px; gap: 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.segmented button, .seg button, .seg a { border: 0; background: none; padding: 7px 14px; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: .88rem; color: var(--muted); text-decoration: none; }
.segmented button[aria-selected="true"], .seg button[aria-pressed="true"], .seg a.active { background: var(--brand); color: #fff; }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; background: var(--line); transform: translateX(-1px); }
.tl-item { position: relative; width: 50%; padding: 0 44px 32px 0; }
.tl-item:nth-child(even) { margin-left: 50%; padding: 0 0 32px 44px; }
.tl-item[hidden] { display: none; }
.tl-dot { position: absolute; top: 18px; right: -20px; z-index: 1; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--surface); border: 2px solid var(--brand); font-size: 18px; }
.tl-item:nth-child(even) .tl-dot { right: auto; left: -20px; }
.tl-card { padding: 22px 24px; }
.tl-card header { margin-bottom: 8px; }
.tl-card h3 { margin: 4px 0 2px; }
.tl-date { color: var(--brand); font-size: .82rem; margin: 0; font-weight: 600; }
.tl-org { color: var(--muted); margin: 0; font-weight: 500; }
.tl-card > p { margin: 0; }
.tl-toggle { margin-top: 12px; display: inline-flex; align-items: center; gap: 6px; padding: 6px 0; border: 0; background: none; color: var(--brand); font-weight: 600; cursor: pointer; font-size: .9rem; }
.tl-toggle svg { width: 16px; height: 16px; transition: transform .25s; }
.tl-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.tl-details { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .3s ease; }
.tl-details > div { overflow: hidden; }
.tl-details.open { grid-template-rows: 1fr; }
.tl-details .prose { padding-top: 10px; font-size: .95rem; }

/* ============ Filters / tags ============ */
.filters { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-bottom: 28px; }
.search { position: relative; flex: 1 1 280px; max-width: 420px; display: flex; align-items: center; }
.search svg { position: absolute; left: 14px; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.search input { width: 100%; padding: 12px 16px 12px 42px !important; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); outline: none; }
.search input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.tag-filter { display: flex; flex-wrap: wrap; gap: 8px; flex: 1 1 100%; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: .86rem; font-weight: 500; cursor: pointer; text-decoration: none; transition: all .15s; }
.chip small { color: var(--muted); }
.chip:hover { border-color: var(--brand); }
.chip.active, .chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip.active small, .chip[aria-pressed="true"] small { color: rgba(255, 255, 255, .8); }
.chip.clear { border-style: dashed; color: var(--muted); }
.filter-meta { margin: 0; color: var(--muted); font-size: .9rem; flex-basis: 100%; }
.tags { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.tags span, .tags a { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--blue-soft); color: var(--blue); font-size: .78rem; font-weight: 600; text-decoration: none; }
.tags.small span { font-size: .72rem; padding: 2px 8px; }

/* ============ Projects ============ */
.project-grid, .post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 22px; }
.post-grid.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.project-card { display: flex; flex-direction: column; overflow: hidden; transition: transform .2s, box-shadow .2s, border-color .2s; cursor: pointer; text-align: left; padding: 0; font: inherit; color: inherit; }
.project-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.project-thumb { aspect-ratio: 16 / 9; background: linear-gradient(135deg, var(--brand-soft), var(--blue-soft)); display: grid; place-items: center; overflow: hidden; }
.project-thumb img { width: 100%; height: 100%; object-fit: cover; }
.project-thumb .initial { font: 700 2.6rem var(--display); color: var(--brand); opacity: .8; }
.project-body { padding: 20px 22px 22px; display: flex; flex-direction: column; flex: 1; }
.project-body h3 { margin-bottom: 8px; }
.project-body p { color: var(--muted); font-size: .95rem; flex: 1; }
.project-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: .85rem; color: var(--muted); }
.project-foot .more { color: var(--brand); font-weight: 600; }
.featured-badge { position: absolute; margin: 12px; padding: 3px 10px; border-radius: 99px; background: var(--brand); color: #fff; font-size: .72rem; font-weight: 700; letter-spacing: .04em; }
.project-card { position: relative; }
.skeleton { height: 340px; background: linear-gradient(90deg, var(--surface), var(--bg-alt), var(--surface)); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.empty { padding: 40px; text-align: center; }

/* Modal */
.modal { width: min(820px, 100% - 24px); max-height: calc(100dvh - 40px); padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); box-shadow: 0 30px 80px rgba(0, 0, 0, .35); overflow: hidden; }
.modal::backdrop { background: rgba(8, 10, 14, .6); backdrop-filter: blur(3px); }
.modal[open] { animation: pop .25s cubic-bezier(.2, .8, .2, 1); }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.98); } }
.modal-inner { position: relative; max-height: calc(100dvh - 40px); overflow-y: auto; padding: 32px clamp(20px, 4vw, 40px); }
.modal-close { position: sticky; top: 0; float: right; margin: -12px -16px 0 12px; z-index: 2; }
.modal img.hero-img { margin: 16px 0; }
.modal .actions, .actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 18px 0 8px; }
.modal h2.sub { font-size: 1.2rem; margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); }

/* ============ GitHub ============ */
.gh-graph { padding: 22px; margin-bottom: 22px; }
.gh-graph-head { margin-bottom: 14px; color: var(--muted); }
.gh-graph-head strong { font: 700 1.3rem var(--mono); color: var(--text); }
.gh-scroll { overflow-x: auto; padding-bottom: 6px; }
.gh-cal { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 11px); gap: 3px; width: max-content; }
.gh-cal i, .gh-legend i { width: 11px; height: 11px; border-radius: 3px; background: var(--gh0); display: inline-block; }
.gh-cal .l1, .gh-legend .l1 { background: var(--gh1); } .gh-cal .l2, .gh-legend .l2 { background: var(--gh2); }
.gh-cal .l3, .gh-legend .l3 { background: var(--gh3); } .gh-cal .l4, .gh-legend .l4 { background: var(--gh4); }
.gh-legend { display: flex; align-items: center; justify-content: flex-end; gap: 4px; font-size: .78rem; color: var(--muted); margin-top: 10px; }
.repo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.repo { padding: 18px 20px; text-decoration: none; display: flex; flex-direction: column; gap: 6px; transition: border-color .2s, transform .2s; }
.repo:hover { border-color: var(--brand); transform: translateY(-2px); }
.repo strong { font-family: var(--mono); font-size: .95rem; overflow-wrap: anywhere; }
.repo p { color: var(--muted); font-size: .9rem; margin: 0; flex: 1; }
.repo-meta { display: flex; gap: 14px; font-size: .8rem; color: var(--muted); }
.lang-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--blue); margin-right: 5px; vertical-align: -1px; }

/* ============ Blog ============ */
.post-card { overflow: hidden; display: flex; flex-direction: column; transition: transform .2s; }
.post-card:hover { transform: translateY(-3px); }
.post-cover img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }
.post-body { padding: 22px; display: flex; flex-direction: column; flex: 1; }
.post-body h3 a { text-decoration: none; }
.post-body h3 a:hover { color: var(--brand); }
.post-body > p { color: var(--muted); font-size: .95rem; flex: 1; }
.meta { color: var(--muted); font-size: .82rem; margin: 0; }
.back { display: inline-block; margin-bottom: 22px; color: var(--muted); text-decoration: none; font-weight: 500; }
.back:hover { color: var(--brand); }
.hero-img { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); margin: 28px 0; }
.related { margin-top: 56px; padding-top: 32px; border-top: 1px solid var(--line); }
.related h2 { font-size: 1.4rem; }
.related-card { padding: 20px; text-decoration: none; display: flex; flex-direction: column; gap: 6px; }
.related-card span { color: var(--muted); font-size: .92rem; }
.related-card:hover { border-color: var(--brand); }

/* Prose (rendered markdown) */
.prose { overflow-wrap: anywhere; }
.prose > :first-child { margin-top: 0; }
.prose h2 { font-size: 1.55rem; margin: 1.8em 0 .6em; }
.prose h3 { font-size: 1.2rem; margin: 1.5em 0 .5em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin: .3em 0; }
.prose a { color: var(--brand); }
.prose blockquote { margin: 1.4em 0; padding: 12px 18px; border-left: 4px solid var(--brand); background: var(--brand-soft); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.prose blockquote p:last-child { margin: 0; }
.prose code { font: .88em var(--mono); background: var(--bg-alt); padding: .15em .4em; border-radius: 6px; border: 1px solid var(--line); }
.prose pre { margin: 1.3em 0; border-radius: var(--radius-sm); border: 1px solid var(--line); overflow-x: auto; background: var(--bg-alt); max-width: 100%; }
.prose pre code { display: block; padding: 16px 18px; border: 0; background: transparent; font-size: .86rem; line-height: 1.65; white-space: pre; overflow-wrap: normal; }
.prose pre code.hljs { background: transparent; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.3em 0; font-size: .93rem; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
.prose th { background: var(--bg-alt); }
.prose img { border-radius: var(--radius-sm); margin: 1em 0; }
.article { font-size: 1.07rem; }

/* ============ Contact ============ */
.contact-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 48px; align-items: start; }
.contact-list { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 14px; }
.contact-list li { display: flex; flex-direction: column; gap: 2px; overflow-wrap: anywhere; }
.contact-list span { font-family: var(--mono); font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.contact-list a { font-weight: 600; text-decoration: none; }
.contact-list a:hover { color: var(--brand); }
.contact-form { padding: clamp(20px, 4vw, 32px); display: grid; gap: 16px; }
label { display: grid; gap: 6px; font-weight: 500; font-size: .92rem; }
label small { color: var(--muted); font-weight: 400; }
input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]), textarea, select { width: 100%; padding: 11px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--bg); outline: none; transition: border-color .2s, box-shadow .2s; min-width: 0; }
input:focus, textarea:focus, select:focus { border-color: var(--brand) !important; box-shadow: 0 0 0 4px var(--brand-soft); }
textarea { resize: vertical; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 16px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { margin: 0; font-weight: 500; min-height: 1.4em; }
.form-status.ok { color: #16a34a; }
.form-status.err { color: #d93a2b; }
.field-error { color: #d93a2b; font-size: .82rem; font-weight: 500; }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: #d93a2b !important; }

/* ============ Footer ============ */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0; color: var(--muted); font-size: .9rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.footer-inner p { margin: 0; }
.socials { list-style: none; display: flex; flex-wrap: wrap; gap: 18px; padding: 0; margin: 0; }
.socials a { text-decoration: none; }
.socials a:hover { color: var(--brand); }

/* ============ Reveal motion ============ */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s cubic-bezier(.2, .8, .2, 1); }
.reveal.in-view { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
  .bar span { width: var(--w); }
}

/* ============ Responsive ============ */
@media (max-width: 960px) {
  .hero-inner, .about-grid, .contact-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .hero-card { max-width: 520px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .timeline::before { left: 19px; }
  .tl-item, .tl-item:nth-child(even) { width: 100%; margin-left: 0; padding: 0 0 24px 56px; }
  .tl-dot, .tl-item:nth-child(even) .tl-dot { left: 0; right: auto; top: 16px; }
}
@media (max-width: 520px) {
  body { font-size: 15.5px; }
  .container, .container.narrow { width: calc(100% - 32px); }
  .stats { gap: 10px; margin-top: 36px; }
  .stats li { padding: 14px; }
  .hero-cta .btn { flex: 1 1 auto; }
  .tl-card { padding: 18px; }
  .section-head { margin-bottom: 26px; }
  .terminal pre { font-size: 11.5px; padding: 14px; }
}
@media print {
  .site-header, .site-footer, .drawer, .hero-card, #contact, .filters { display: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
}
