/*
Theme Name: Aman Anand
Theme URI: https://amananand.in
Author: Aman Anand
Description: Portfolio theme for Aman Anand, Certified SAP Integration Consultant. Consultant landing page (services, open-source work, skills, tools, articles), Projects with live search, Blog with categories and code highlighting, contact form with message inbox, and portfolio settings in the Customizer. Mobile-first and responsive.
Version: 1.1.0
Requires at least: 6.0
Requires PHP: 7.4
License: GPLv2 or later
Text Domain: aman
*/

:root {
	--blue: #2563eb;
	--blue-dark: #1d4ed8;
	--blue-soft: #eff6ff;
	--blue-100: #dbeafe;
	--indigo: #4f46e5;
	--teal: #0d9488;
	--navy: #0b1530;
	--navy-2: #111d3d;
	--ink: #0f172a;
	--ink-2: #334155;
	--muted: #475569;
	--soft: #64748b;
	--faint: #94a3b8;
	--line: #e2e8f0;
	--line-soft: #f1f5f9;
	--bg: #f8fafc;
	--white: #fff;
	--red: #ef4444;
	--amber: #f59e0b;
	--green: #22c55e;
	--radius: 16px;
	--shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
	--shadow: 0 10px 15px -3px rgba(15, 23, 42, .08), 0 4px 6px -4px rgba(15, 23, 42, .08);
	--shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, .1), 0 8px 10px -6px rgba(15, 23, 42, .1);
	--font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	--font-head: "Plus Jakarta Sans", var(--font);
	--mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	--nav-h: 76px;
	--gutter: 24px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 12px); }
body {
	margin: 0;
	min-height: 100vh;
	min-height: 100dvh;
	display: flex;
	flex-direction: column;
	font-family: var(--font);
	font-size: 16px;
	color: var(--ink);
	background: var(--white);
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}
body > main { flex: 1 0 auto; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.2; margin: 0; letter-spacing: -.01em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link:focus { position: fixed; top: 8px; left: 8px; z-index: 100; width: auto; height: auto; clip: auto; background: var(--white); padding: 8px 14px; border-radius: 8px; box-shadow: var(--shadow); }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); }
.icon { width: 20px; height: 20px; flex-shrink: 0; }

/* ---------- Buttons & links ---------- */

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 20px; border-radius: 999px; background: linear-gradient(to right, var(--blue), #3b82f6); color: var(--white); font-size: 15px; font-weight: 600; line-height: 1.2; box-shadow: var(--shadow); border: 1px solid transparent; transition: transform .25s, box-shadow .25s, background .25s, color .25s; white-space: nowrap; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 20px -6px rgba(37, 99, 235, .45); }
.btn .icon { width: 18px; height: 18px; transition: transform .25s; }
.btn:hover .icon { transform: translateX(2px); }
.btn-lg { min-height: 52px; padding: 14px 26px; font-size: 16px; }
.btn-ghost { background: var(--white); color: var(--ink-2); border-color: var(--line); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { color: var(--blue); border-color: var(--blue-100); box-shadow: var(--shadow); }
.btn-white { background: var(--white); color: var(--blue-dark); }
.btn-outline-light { background: transparent; color: var(--white); border-color: rgba(255, 255, 255, .35); box-shadow: none; }
.btn-outline-light:hover { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .6); box-shadow: none; }
.text-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--blue); min-height: 44px; }
.text-link .icon { width: 16px; height: 16px; transition: transform .2s; }
.text-link:hover .icon { transform: translateX(3px); }
.text-link.muted { color: var(--soft); }
.text-link.muted:hover { color: var(--blue); }

/* ---------- Header ---------- */

.site-nav { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .92); backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--line-soft); transition: box-shadow .3s; }
.site-nav.is-scrolled { box-shadow: 0 6px 20px -10px rgba(15, 23, 42, .25); }
.nav-row { display: flex; align-items: center; gap: 24px; height: var(--nav-h); }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); margin-right: auto; min-width: 0; }
.brand-mark { width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--blue), var(--indigo)); color: var(--white); font: 800 16px var(--font-head); letter-spacing: .02em; box-shadow: 0 6px 14px -6px rgba(37, 99, 235, .6); }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font: 700 20px/1.15 var(--font-head); letter-spacing: -.02em; white-space: nowrap; }
.brand-name .hl { color: var(--blue); }
.brand-name .gap { margin-left: 5px; }
.brand-role { font-size: 12px; font-weight: 500; color: var(--soft); letter-spacing: .02em; white-space: nowrap; }
.nav-links { display: flex; gap: 6px; align-items: center; }
.nav-links a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px; font-size: 15px; font-weight: 600; color: var(--ink-2); transition: color .2s, background .2s; }
.nav-links a:hover { color: var(--blue); background: var(--blue-soft); }
.nav-links a.is-active { color: var(--blue); }
.nav-cta { min-height: 42px; padding: 8px 20px; font-size: 14px; }
.menu-btn { display: none; align-items: center; justify-content: center; width: 44px; height: 44px; background: none; border: 1px solid var(--line); padding: 0; border-radius: 12px; color: var(--ink-2); }
.menu-btn:hover { color: var(--blue); background: var(--blue-soft); }
.menu-btn .icon { width: 22px; height: 22px; }
.menu-btn .i-close { display: none; }
.menu-open .menu-btn .i-close { display: block; }
.menu-open .menu-btn .i-open { display: none; }
.mobile-menu { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--white); border-top: 1px solid var(--line-soft); box-shadow: 0 20px 30px -12px rgba(15, 23, 42, .25); padding: 12px var(--gutter) 20px; max-height: calc(100dvh - var(--nav-h)); overflow-y: auto; }
.menu-open .mobile-menu { display: block; animation: drop .2s ease; }
.mobile-menu li + li { border-top: 1px solid var(--line-soft); }
.mobile-menu a { display: flex; align-items: center; justify-content: space-between; min-height: 54px; padding: 0 4px; font-size: 17px; font-weight: 600; color: var(--ink-2); }
.mobile-menu a .icon { width: 18px; height: 18px; color: var(--faint); }
.mobile-menu a.is-active, .mobile-menu a:hover { color: var(--blue); }
.mobile-menu a.is-active .icon { color: var(--blue); }
.mobile-social { display: flex; gap: 12px; padding-top: 16px; margin-top: 8px; border-top: 1px solid var(--line-soft); }
.mobile-social a { width: 48px; height: 48px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: var(--bg); color: var(--ink-2); }
.mobile-social a:hover { color: var(--blue); background: var(--blue-soft); }
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ---------- Footer ---------- */

.site-footer { background: var(--navy); color: #cbd5e1; padding: 56px 0 0; margin-top: auto; }
.foot-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.2fr; gap: 40px; padding-bottom: 40px; }
.brand-light { color: var(--white); margin: 0 0 16px; }
.brand-light .brand-role { color: #94a3b8; }
.foot-about p { font-size: 15px; color: #94a3b8; max-width: 360px; }
.foot-social { display: flex; gap: 10px; margin-top: 20px; }
.foot-social a { width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .06); color: #e2e8f0; transition: background .2s, color .2s; }
.foot-social a:hover { background: var(--blue); color: var(--white); }
.foot-col h3 { font: 700 13px var(--font); color: var(--white); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 14px; }
.foot-col li a { display: inline-flex; align-items: center; min-height: 36px; font-size: 15px; color: #94a3b8; transition: color .2s; word-break: break-word; }
.foot-col li a:hover { color: var(--white); }
.foot-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 20px 0 calc(20px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(255, 255, 255, .08); font-size: 13px; color: #64748b; }
.foot-legal { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.foot-legal a { color: #94a3b8; }
.foot-legal a:hover { color: var(--white); }

/* ---------- Home: hero ---------- */

.hero { position: relative; overflow: hidden; background: var(--bg); display: flex; align-items: center; padding: 48px 0; }
.hero-grid { position: absolute; inset: 0; background-image: linear-gradient(to right, #64748b14 1px, transparent 1px), linear-gradient(to bottom, #64748b14 1px, transparent 1px); background-size: 28px 28px; mask-image: radial-gradient(ellipse at center, #000 40%, transparent 80%); -webkit-mask-image: radial-gradient(ellipse at center, #000 40%, transparent 80%); }
.blob { position: absolute; width: 640px; height: 640px; border-radius: 50%; filter: blur(100px); pointer-events: none; }
.blob-a { top: -200px; right: -160px; background: rgba(191, 219, 254, .55); }
.blob-b { bottom: -260px; left: -200px; background: rgba(199, 210, 254, .5); }
.hero-inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px 6px 10px; border-radius: 999px; background: var(--white); border: 1px solid var(--line); box-shadow: var(--shadow-sm); font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 22px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(34, 197, 94, .18); animation: pulse 2s infinite; }
.hello { font-size: 15px; color: var(--soft); font-weight: 600; text-transform: uppercase; letter-spacing: .12em; }
.hero h1 { font-size: clamp(44px, 6.4vw, 76px); font-weight: 800; line-height: 1.05; letter-spacing: -.03em; margin: 8px 0 14px; background: linear-gradient(to right, var(--ink), #475569); -webkit-background-clip: text; background-clip: text; color: transparent; padding-bottom: 4px; }
.tagline { font-size: clamp(19px, 2.2vw, 25px); font-weight: 400; color: var(--ink-2); line-height: 1.45; }
.tagline strong { color: var(--blue); font-weight: 700; }
.intro { font-size: 17px; color: var(--muted); max-width: 560px; margin-top: 16px; }
.typing-row { display: flex; align-items: center; gap: 8px; min-height: 30px; margin-top: 18px; font-family: var(--mono); font-size: 16px; color: var(--muted); }
.typing-row .icon { color: var(--blue); }
.typing { color: var(--blue); font-weight: 700; }
.cursor { animation: blink 1s steps(2) infinite; color: var(--faint); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-visual { position: relative; justify-self: center; width: 100%; max-width: 420px; padding: 16px; }
.hero-photo { position: relative; z-index: 2; width: min(360px, 52vh, 100%); aspect-ratio: 1; margin: 0 auto; }
.hero-photo::before { content: ""; position: absolute; inset: -10px; border-radius: 32px; background: linear-gradient(135deg, var(--blue), var(--indigo) 60%, var(--teal)); opacity: .9; transform: rotate(-4deg); z-index: 0; }
/* White frame is a padded wrapper (not a border on the image): avoids Safari's light hairline at rounded image borders. */
.hero-photo .photo-frame { position: relative; z-index: 1; display: block; width: 100%; height: 100%; padding: 5px; background: var(--white); border-radius: 28px; box-shadow: 0 25px 50px -12px rgba(15, 23, 42, .35); }
.hero-photo img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 23px; }

@keyframes blink { 50% { opacity: 0; } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 4px rgba(34, 197, 94, .18); } 50% { box-shadow: 0 0 0 7px rgba(34, 197, 94, .06); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes flow { to { left: 100%; } }

/* ---------- Listing pages (Projects, Blog, archives) ---------- */

.list-head { background: var(--bg); padding: 36px 0; margin-bottom: 36px; border-bottom: 1px solid var(--line-soft); }
.list-head .container { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.list-head h1 { font-size: clamp(26px, 3vw, 34px); font-weight: 800; letter-spacing: -.02em; }
.list-head p { margin-top: 4px; color: var(--soft); font-size: 15px; }
.search { position: relative; width: 400px; max-width: 100%; flex-shrink: 0; }
.search input { width: 100%; min-height: 52px; padding: 12px 104px 12px 48px; background: var(--white); border-radius: 16px; border: 1px solid var(--line); box-shadow: var(--shadow-sm); font: 500 16px var(--font); color: var(--ink-2); -webkit-appearance: none; appearance: none; transition: box-shadow .3s, border-color .3s; }
.search input::placeholder { color: var(--faint); }
.search input:focus { outline: 0; border-color: transparent; box-shadow: 0 0 0 2px #3b82f6; }
.search .icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search button { position: absolute; top: 6px; bottom: 6px; right: 6px; padding: 0 18px; background: var(--blue); color: var(--white); border: 0; border-radius: 12px; font-size: 14px; font-weight: 600; transition: background .2s; }
.search button:hover { background: var(--blue-dark); }
.list-body { padding-bottom: 80px; }
.empty { text-align: center; padding: 60px 20px; color: var(--soft); }
.empty[hidden] { display: none; }

.project-list { display: grid; gap: 28px; }
.project-card { display: flex; background: var(--white); border-radius: 20px; border: 1px solid var(--line); box-shadow: var(--shadow-sm); overflow: hidden; transition: box-shadow .3s; }
.project-card:hover { box-shadow: var(--shadow-xl); }
.project-thumb { position: relative; width: 36%; min-height: 220px; flex-shrink: 0; overflow: hidden; background: var(--line-soft); }
.project-thumb img, .post-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.project-card:hover .project-thumb img, .post-card:hover .post-thumb img { transform: scale(1.05); }
.project-body { display: flex; flex-direction: column; justify-content: center; flex: 1; padding: 24px 28px; min-width: 0; }
.meta { display: flex; align-items: center; flex-wrap: wrap; row-gap: 4px; font-size: 13px; color: var(--soft); font-weight: 500; margin-bottom: 12px; }
.meta .dot { margin: 0 8px; color: #cbd5e1; }
.card-title { font-size: 20px; font-weight: 700; margin-bottom: 10px; line-height: 1.3; }
.card-title a { transition: color .2s; }
.card-title a:hover, .project-card:hover .card-title a { color: var(--blue); }
.excerpt { color: var(--muted); font-size: 15px; line-height: 1.65; margin: 0 0 16px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; flex-grow: 1; }
.excerpt p { margin: 0; }
.card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.author { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.author img { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--white); box-shadow: var(--shadow-sm); object-fit: cover; }
.arrow-link { width: 44px; height: 44px; border-radius: 50%; color: var(--faint); transition: color .2s, background .2s; display: inline-flex; align-items: center; justify-content: center; }
.arrow-link:hover { color: var(--blue); background: var(--blue-soft); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tag { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--blue); background: var(--blue-soft); padding: 4px 10px; border-radius: 999px; }

.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.post-card { display: flex; flex-direction: column; background: var(--white); border-radius: 20px; border: 1px solid var(--line); box-shadow: var(--shadow-sm); overflow: hidden; transition: box-shadow .3s, transform .3s; }
.post-card:hover { box-shadow: var(--shadow-xl); transform: translateY(-3px); }
.post-thumb { position: relative; display: block; aspect-ratio: 1200 / 628; overflow: hidden; background: var(--line-soft); flex-shrink: 0; }
.post-card .project-body { justify-content: flex-start; padding: 22px 24px; }
.post-card .card-title { font-size: 19px; }

.pagination { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 40px; }
.pagination:empty { display: none; }
.pagination .page-numbers { min-width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); font-size: 15px; font-weight: 600; color: var(--ink-2); }
.pagination .page-numbers.current, .pagination a.page-numbers:hover { background: var(--blue); border-color: var(--blue); color: var(--white); }

/* ---------- Single post / project ---------- */

.single-main { padding: 40px 0 80px; }
.single-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; align-items: start; }
.single-article { border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-sm); padding: 40px 48px; min-width: 0; background: var(--white); }
.single-article h1 { font-size: clamp(26px, 3.4vw, 38px); font-weight: 800; letter-spacing: -.02em; margin-bottom: 14px; }
.single-article .meta { margin-bottom: 28px; }
.single-article .meta a:hover { color: var(--blue); }
.single-hero { border-radius: 14px; overflow: hidden; margin-bottom: 32px; border: 1px solid var(--line-soft); }
.single-hero img { width: 100%; }
.sidebar { position: sticky; top: calc(var(--nav-h) + 24px); display: grid; gap: 24px; }
.widget { background: var(--white); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-sm); padding: 24px; }
.widget h3 { display: flex; align-items: center; font-size: 17px; font-weight: 700; margin-bottom: 18px; }
.widget h3::before { content: ""; width: 4px; height: 22px; background: var(--blue); border-radius: 999px; margin-right: 12px; }
.cat-list li + li { margin-top: 4px; }
.cat-list a { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 8px 10px; border-radius: 10px; transition: background .2s; }
.cat-list a:hover { background: var(--bg); }
.cat-list span:first-child { color: var(--muted); font-weight: 500; transition: color .2s; }
.cat-list .count { background: var(--line-soft); color: var(--soft); font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 999px; line-height: 1; transition: all .2s; }
.cat-list a:hover span:first-child { color: var(--blue); }
.cat-list a:hover .count { background: var(--blue-100); color: var(--blue); }
.recent { display: flex; gap: 14px; }
.recent + .recent { margin-top: 18px; }
.recent-thumb { width: 72px; height: 72px; flex-shrink: 0; border-radius: 10px; overflow: hidden; background: var(--line-soft); }
.recent-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.recent:hover .recent-thumb img { transform: scale(1.1); }
.recent h4 { font-size: 14px; font-weight: 700; line-height: 1.4; transition: color .2s; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.recent:hover h4 { color: var(--blue); }
.recent time { display: block; font-size: 12px; color: var(--faint); margin-top: 4px; }
.recent-text { display: flex; flex-direction: column; justify-content: center; min-width: 0; }

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 44px; padding-top: 24px; border-top: 1px solid var(--line-soft); font-size: 15px; }
.post-nav a { display: block; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink-2); font-weight: 600; line-height: 1.4; transition: border-color .2s, color .2s; }
.post-nav a:hover { color: var(--blue); border-color: var(--blue-100); }
.post-nav small { display: block; color: var(--faint); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; font-size: 11px; margin-bottom: 4px; }
.post-nav .next { text-align: right; grid-column: 2; }

/* ---------- Article typography ---------- */

.entry-content { color: var(--ink-2); font-size: 17px; line-height: 1.8; overflow-wrap: break-word; }
.entry-content > * { margin: 0; }
.entry-content > * + * { margin-top: 22px; }
.entry-content h2 { font-size: 26px; color: var(--ink); font-weight: 800; margin-top: 40px; }
.entry-content h3 { font-size: 21px; color: var(--ink); font-weight: 700; margin-top: 34px; }
.entry-content h4 { font-size: 19px; color: var(--ink); font-weight: 700; margin-top: 30px; }
.entry-content strong { color: var(--ink); }
.entry-content a { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.entry-content a:hover { color: var(--blue-dark); }
.entry-content ul, .entry-content ol { padding-left: 24px; }
.entry-content ul { list-style: disc; }
.entry-content ol { list-style: decimal; }
.entry-content li + li { margin-top: 8px; }
.entry-content li::marker { color: var(--blue); }
.entry-content hr { border: 0; border-top: 1px solid var(--line); margin: 36px 0; }
.entry-content blockquote { border-left: 4px solid var(--blue); background: var(--blue-soft); padding: 14px 20px; border-radius: 0 12px 12px 0; color: var(--ink-2); }
.entry-content img { border-radius: 12px; }
.entry-content figure { max-width: 100%; }
.entry-content figcaption { text-align: center; font-size: 13px; color: var(--soft); margin-top: 8px; }
.entry-content mark { background: none; color: inherit; }
.entry-content :not(pre) > code { font-family: var(--mono); font-size: .85em; background: var(--line-soft); color: #be185d; padding: 2px 6px; border-radius: 6px; word-break: break-word; }
.entry-content .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.entry-content table { width: 100%; border-collapse: collapse; font-size: 15px; }
.entry-content th, .entry-content td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; }
.entry-content th { background: var(--bg); }
.entry-content iframe, .entry-content video { max-width: 100%; }

.code-wrap { position: relative; border-radius: 14px; overflow: hidden; background: #263238; box-shadow: var(--shadow); max-width: 100%; }
.code-bar { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px 8px 14px; background: #1e282d; color: #b0bec5; font: 600 12px var(--font); letter-spacing: .05em; text-transform: uppercase; }
.code-bar .dots { display: flex; gap: 6px; margin-right: 12px; }
.code-bar .dots i { width: 10px; height: 10px; border-radius: 50%; background: #ff5f57; }
.code-bar .dots i:nth-child(2) { background: #febc2e; }
.code-bar .dots i:nth-child(3) { background: #28c840; }
.code-bar .lang { display: flex; align-items: center; }
.copy-btn { background: rgba(255, 255, 255, .08); color: #cfd8dc; border: 0; border-radius: 8px; min-height: 32px; padding: 4px 12px; font: 600 12px var(--font); transition: background .2s; }
.copy-btn:hover { background: rgba(255, 255, 255, .16); }
.entry-content pre { margin: 0; padding: 16px 18px; max-height: 520px; overflow: auto; -webkit-overflow-scrolling: touch; background: #263238; color: #eeffff; font: 14px/1.65 var(--mono); tab-size: 4; }
.entry-content pre code { font: inherit; background: none !important; padding: 0 !important; white-space: pre; }

/* ---------- Plain pages (Terms, etc.) ---------- */

.page-plain { max-width: 860px; margin: 0 auto; padding: 0 var(--gutter) 80px; }
.page-plain .entry-content { text-align: justify; hyphens: auto; }

/* ---------- Contact ---------- */

.contact-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 28px; align-items: start; }
.contact-card { background: var(--white); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: 32px; min-width: 0; }
.contact-card h2 { font-size: 22px; font-weight: 800; margin-bottom: 8px; }
.contact-card > p { color: var(--muted); margin: 0 0 22px; font-size: 15px; }
.contact-ways li + li { margin-top: 12px; }
.contact-ways a { display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); transition: border-color .2s, background .2s; }
.contact-ways a:hover { border-color: var(--blue-100); background: var(--blue-soft); }
.contact-ways .ico { width: 42px; height: 42px; flex-shrink: 0; border-radius: 12px; background: var(--blue-soft); color: var(--blue); display: inline-flex; align-items: center; justify-content: center; }
.contact-ways small { display: block; color: var(--soft); font-size: 12px; }
.contact-ways b { font-size: 15px; font-weight: 600; color: var(--ink); word-break: break-word; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 14px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.field input, .field textarea, .field select { width: 100%; min-height: 50px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; font: 16px var(--font); color: var(--ink); background: var(--white); transition: box-shadow .2s, border-color .2s; }
.field textarea { min-height: 160px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { outline: 0; border-color: transparent; box-shadow: 0 0 0 2px #3b82f6; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.hp { position: absolute; left: -9999px; }
.form-note { margin-top: 14px; font-size: 13px; color: var(--soft); }
.form-note a { color: var(--blue); text-decoration: underline; text-underline-offset: 2px; }
.notice { padding: 12px 16px; border-radius: 12px; margin-bottom: 20px; font-size: 15px; font-weight: 500; }
.notice-ok { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.notice-err { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }

/* ---------- 404 ---------- */

.not-found { text-align: center; padding: 100px var(--gutter); }
.not-found b { display: block; font: 800 96px/1 var(--font-head); background: linear-gradient(to right, var(--blue), var(--indigo)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.not-found h1 { font-size: 28px; margin-top: 12px; }
.not-found p { color: var(--soft); margin: 14px 0 6px; }
.not-found .hero-cta { justify-content: center; }

/* ---------- Responsive: tablet ---------- */

@media (max-width: 1100px) {
	.nav-links a { padding: 0 10px; }
	.hero-inner { gap: 32px; }
	.foot-grid { grid-template-columns: 1fr 1fr; }
	.single-wrap { grid-template-columns: 1fr; }
	.sidebar { position: static; grid-template-columns: 1fr 1fr; }
	.post-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
	:root { --nav-h: 68px; }
	.nav-links, .nav-cta { display: none; }
	.menu-btn { display: inline-flex; }
	.contact-grid { grid-template-columns: 1fr; }
}

/* ---------- Responsive: phone ---------- */

@media (max-width: 640px) {
	:root { --gutter: 16px; }
	body { font-size: 16px; }
	.brand-mark { width: 38px; height: 38px; font-size: 14px; border-radius: 10px; }
	.brand-name { font-size: 18px; }
	.brand-role { font-size: 11px; }

	.list-head { padding: 24px 0; margin-bottom: 24px; }
	.list-head .container { flex-direction: column; align-items: stretch; }
	.search { width: 100%; }
	.project-card { flex-direction: column; }
	.project-thumb { width: 100%; min-height: 0; aspect-ratio: 16 / 9; }
	.project-body, .post-card .project-body { padding: 18px 18px 14px; }
	.card-title { font-size: 18px; }
	.post-grid { grid-template-columns: 1fr; gap: 20px; }

	.single-main { padding: 20px 0 56px; }
	.single-article { padding: 22px 18px; border-radius: 16px; border-left: 0; border-right: 0; box-shadow: none; margin: 0 calc(var(--gutter) * -1); border-radius: 0; }
	.single-hero { margin-left: -18px; margin-right: -18px; border-radius: 0; border-left: 0; border-right: 0; }
	.entry-content { font-size: 16px; line-height: 1.75; }
	.entry-content h2 { font-size: 22px; }
	.entry-content h3 { font-size: 19px; }
	.entry-content h4 { font-size: 17px; }
	.entry-content ul, .entry-content ol { padding-left: 20px; }
	.entry-content pre { font-size: 13px; padding: 14px 16px; max-height: 420px; }
	.sidebar { grid-template-columns: 1fr; }
	.post-nav { grid-template-columns: 1fr; }
	.post-nav .next { grid-column: 1; }

	.page-plain .entry-content { text-align: left; }
	.contact-card { padding: 22px 18px; }
	.field-row { grid-template-columns: 1fr; gap: 0; }
	.contact-card .btn { width: 100%; }

	.site-footer { padding-top: 44px; }
	.foot-grid { grid-template-columns: 1fr 1fr; gap: 28px 20px; }
	.foot-about { grid-column: 1 / -1; }
	.foot-col:last-child { grid-column: 1 / -1; }
	.foot-bottom { flex-direction: column; gap: 6px; }
}

@media (max-width: 360px) {
	.brand-role { display: none; }
}

/* ---------- Home: exactly one screen, no scrolling ---------- */

body.home { height: 100vh; height: 100dvh; overflow: hidden; }
body.home > main { flex: 1 1 auto; min-height: 0; display: flex; }
body.home .hero { flex: 1; min-height: 0; padding: clamp(12px, 3vh, 40px) 0; }
body.home .hero h1 { font-size: clamp(40px, min(6.4vw, 10vh), 76px); }

.foot-slim { flex-shrink: 0; background: var(--white); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.foot-slim .container { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; font-size: 14px; color: var(--soft); white-space: nowrap; }
.foot-slim-links { display: flex; align-items: center; gap: 4px; }
.foot-slim-links a { min-width: 40px; height: 40px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); transition: color .2s, background .2s; }
.foot-slim-links a:hover { color: var(--blue); background: var(--blue-soft); }
.foot-slim-links .icon { width: 19px; height: 19px; }
.foot-slim-terms { padding: 0 8px; font-size: 14px; font-weight: 600; }

@media (min-width: 901px) and (max-height: 720px) {
	body.home .intro { display: none; }
	body.home .eyebrow { margin-bottom: 12px; }
	body.home .hero-cta { margin-top: 20px; }
}

@media (max-width: 900px) {
	body.home .hero-inner { grid-template-columns: 1fr; gap: clamp(10px, 2.2vh, 24px); text-align: center; }
	body.home .hero-text { order: 2; }
	body.home .hero-visual { order: 1; max-width: none; padding: 8px; }
	body.home .hero-photo { width: min(220px, 25vh); }
	body.home .hero-photo::before { inset: -6px; border-radius: 26px; }
	body.home .hero-photo .photo-frame { border-radius: 22px; padding: 4px; }
	body.home .hero-photo img { border-radius: 18px; }
	body.home .intro { margin: 10px auto 0; font-size: 15px; max-width: 520px; }
	body.home .typing-row, body.home .hero-cta { justify-content: center; }
	body.home .typing-row { margin-top: 10px; font-size: 14px; }
	body.home .typing-row .icon { display: none; }
	body.home .eyebrow { margin-bottom: 10px; font-size: 12px; }
	body.home .hello { font-size: 13px; }
	body.home .hero h1 { font-size: clamp(34px, 5.6vh, 52px); margin: 4px 0 8px; }
	body.home .tagline { font-size: clamp(16px, 2.3vh, 20px); }
	body.home .hero-cta { flex-wrap: nowrap; gap: 10px; margin-top: clamp(14px, 2.4vh, 24px); }
	body.home .hero-cta .btn { flex: 0 1 260px; min-height: 48px; padding: 10px 14px; font-size: 15px; }
}

@media (max-width: 900px) and (max-height: 780px) {
	body.home .intro { display: none; }
}

@media (max-width: 900px) and (max-height: 700px) {
	/* Short phone screens (address bar + navigation bar visible): smaller hub, everything still shown. */
	body.home .hub.hero-visual { width: min(100%, 300px, 41vh); margin: 14px 0 34px; }
	body.home .hub.hero-visual .hero-photo { width: 33%; }
	body.home .hub .hub-caption { font-size: 11px; top: calc(100% + 8px); }
	body.home .hub .hub-chip { font-size: 11px; padding: 3px 8px 3px 4px; gap: 4px; }
	body.home .hub .hub-chip .icon { width: 18px; height: 18px; padding: 2px; }
	body.home .hero h1 { font-size: clamp(30px, 5.4vh, 44px); }
}

@media (max-width: 900px) and (max-height: 620px) {
	body.home .eyebrow, body.home .typing-row { display: none; }
	body.home .hero-photo { width: min(160px, 24vh); }
}

@media (max-width: 380px) {
	body.home .hero-cta .btn { font-size: 14px; padding: 10px; }
	body.home .hero-cta .btn .icon { display: none; }
	.foot-slim .container { font-size: 13px; }
}

@media (max-height: 500px) and (orientation: landscape) {
	body.home .hero-inner { grid-template-columns: 1fr auto; text-align: left; gap: 24px; }
	body.home .hero-text { order: 1; }
	body.home .hero-visual { order: 2; padding: 6px; }
	body.home .hero-photo { width: min(200px, 52vh); }
	body.home .eyebrow, body.home .intro, body.home .typing-row { display: none; }
	body.home .hero h1 { font-size: clamp(28px, 9vh, 44px); }
	body.home .tagline { font-size: 16px; }
	body.home .hero-cta { justify-content: flex-start; margin-top: 14px; }
	body.home .hero-cta .btn { flex: 0 1 auto; min-height: 44px; }
	.foot-slim .container { min-height: 44px; }
}

/* ---------- Home: integration hub visual ---------- */

body.home .hero-grid { background-image: radial-gradient(circle, #94a3b8 1px, transparent 1.3px); background-size: 22px 22px; opacity: .55; }
.hub { position: relative; justify-self: center; width: min(540px, 100%, 76vh); max-width: none; aspect-ratio: 1.3; padding: 0; margin: 22px 0 52px; }
/* Photo centred with grid (no translate(-50%,-50%)), so Safari draws it on whole pixels with crisp edges. */
.hub { display: grid; place-items: center; }
.hub .hero-photo { position: relative; grid-area: 1 / 1; width: 42%; margin: 0; z-index: 2; }
.hub-links { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; z-index: 1; }
.hub-line { fill: none; stroke: #93c5fd; stroke-width: 2; stroke-dasharray: 3 3; }
.hub-flow { fill: none; stroke: var(--blue); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 10 90; stroke-dashoffset: 100; animation: hubflow 2.8s linear infinite; }
.hub-chip { position: absolute; z-index: 3; transform: translate(-50%, -50%); display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px 7px 8px; background: var(--white); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); font: 600 13px var(--font); color: var(--ink); white-space: nowrap; }
.hub-chip .icon { width: 24px; height: 24px; padding: 4px; border-radius: 7px; background: var(--blue-soft); color: var(--blue); }
.hub-chip .short { display: none; }
.hub-chip:nth-of-type(2) .icon { color: var(--indigo); background: color-mix(in srgb, var(--indigo) 12%, #fff); }
.hub-chip:nth-of-type(3) .icon { color: var(--teal); background: color-mix(in srgb, var(--teal) 12%, #fff); }
.hub-chip:nth-of-type(4) .icon { color: #0ea5e9; background: color-mix(in srgb, #0ea5e9 12%, #fff); }
.hub-chip:nth-of-type(5) .icon { color: var(--amber); background: color-mix(in srgb, var(--amber) 12%, #fff); }
.hub-chip:nth-of-type(6) .icon { color: var(--green); background: color-mix(in srgb, var(--green) 12%, #fff); }
.hub-caption { position: absolute; left: 0; right: 0; top: calc(100% + 22px); margin: 0; text-align: center; font-size: 13px; font-weight: 500; color: var(--soft); letter-spacing: .01em; }
.btn-oss .icon { width: 18px; height: 18px; }
.btn-oss:hover .icon { transform: none; }
@keyframes hubflow { to { stroke-dashoffset: 0; } }

@media (max-width: 1180px) {
	.hub-chip .full { display: none; }
	.hub-chip .short { display: inline; }
}

@media (max-width: 900px) {
	body.home .hub { width: min(100%, 360px, 36vh); margin: 14px 0 42px; }
	.hub-caption { font-size: 12px; top: calc(100% + 12px); }
	body.home .hub .hero-photo { width: 42%; }
	.hub-chip { font-size: 12px; padding: 4px 9px 4px 5px; gap: 5px; border-radius: 9px; }
	.hub-chip .icon { width: 20px; height: 20px; padding: 3px; border-radius: 6px; }
}

@media (max-width: 900px) and (max-height: 620px) {
	body.home .hub { width: min(100%, 300px, 40vh); margin: 4px 0; }
}

@media (max-height: 500px) and (orientation: landscape) {
	body.home .hub.hero-visual { width: min(340px, 82vh); margin: 8px 0; }
	body.home .hub-caption { display: none; }
}

@media (max-width: 420px) {
	body.home .hero-cta { flex-direction: column; align-items: center; gap: 8px; }
	body.home .hero-cta .btn { width: min(100%, 300px); flex: none; min-height: 44px; }
}

/* ---------- Phone fixes ---------- */

/* Phones get one direct "Contact me" button instead of the two desktop buttons. */
.btn-phone-contact { display: none; }

html, body { max-width: 100%; overflow-x: hidden; }

@media (max-width: 640px) {
	body.home .hero-cta .btn { display: none; }
	body.home .hero-cta .btn.btn-phone-contact { display: inline-flex; width: min(100%, 300px); flex: none; }

	/* Home footer: icons left, legal links right, no copyright line (keeps it to one row). */
	.foot-slim .container > span:first-child { display: none; }
	.foot-slim .container { justify-content: space-between; }
	.foot-slim-terms, .foot-slim-terms:last-child { display: inline-flex; padding: 0 6px; font-size: 13px; }

	/* Code blocks line up with the article text instead of bleeding past the edges. */
	.code-wrap { margin-left: 0; margin-right: 0; border-radius: 10px; }
	.entry-content pre { font-size: 12.5px; padding: 12px 14px; }
	/* Wrap long lines so the whole command is visible without swiping inside the box. */
	.entry-content pre code { white-space: pre-wrap; overflow-wrap: anywhere; }
}

@media (prefers-reduced-motion: reduce) {
	/* Turn off movement (floating, sliding, zooming) but keep the gentle typing,
	   cursor blink and data-flow dots, which don't move content around. */
	html { scroll-behavior: auto; }
	*, *::before, *::after { transition-duration: .01ms !important; }
	.hello, .menu-open .mobile-menu, .live-dot { animation: none !important; }
	.btn:hover, .service-card:hover, .tool-card:hover, .post-card:hover, .tl-window:hover,
	.project-card:hover .project-thumb img, .post-card:hover .post-thumb img,
	.recent:hover .recent-thumb img, .tool-card:hover .tool-thumb img { transform: none !important; }
	.hub-flow { animation-duration: 4s; }
}

