/* =============================================================
   Claw Destine -- design system
   Tokens -> base -> layout -> chrome (header/footer) -> sections
   ============================================================= */

:root {
	/* Brand */
	--brand: #D4383A;          /* fills, large elements (white text on top) */
	--brand-deep: #B02A2C;     /* hover fills */
	--brand-ink: #A32426;      /* small text on light surfaces (AA contrast) */
	--brand-tint: #FBEBEB;
	--amber: #F9A152;

	/* Neutrals */
	--ink: #0F172A;            /* headings, dark surfaces */
	--ink-soft: #334155;       /* strong body text */
	--muted: #5B6B7F;          /* secondary text (AA on white and --surface) */
	--border: #E2E8F0;
	--border-soft: #EDF1F6;
	--surface: #F6F8FB;        /* page background */
	--card: #FFFFFF;

	/* Shape & depth */
	--radius-sm: 10px;
	--radius: 14px;
	--radius-lg: 20px;
	--shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
	--shadow-md: 0 6px 20px -6px rgba(15, 23, 42, 0.12);
	--shadow-lg: 0 18px 44px -12px rgba(15, 23, 42, 0.22);

	/* Rhythm */
	--container: 1120px;
	--header-h: 68px;
	--section-pad: clamp(72px, 9vw, 120px);

	/* Type */
	--font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
	--font-head: 'Montserrat', var(--font-body);
	--font-mono: ui-monospace, 'SF Mono', 'Cascadia Code', 'JetBrains Mono', Menlo, Consolas, monospace;
}

/* ---------- Reset & base ---------- */

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

html {
	scroll-behavior: smooth;
	scroll-padding-top: calc(var(--header-h) + 16px);
	-webkit-text-size-adjust: 100%;
}

body {
	font-family: var(--font-body);
	font-size: 1rem;
	line-height: 1.65;
	color: var(--ink-soft);
	background: var(--surface);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
	font-family: var(--font-head);
	color: var(--ink);
	font-weight: 700;
	line-height: 1.18;
	letter-spacing: -0.01em;
	text-wrap: balance;
}

p { text-wrap: pretty; }
img, svg, video { max-width: 100%; height: auto; display: block; }
svg { flex: none; }

a { color: var(--brand-ink); text-decoration: none; transition: color 0.18s ease; }
a:hover { color: var(--brand-deep); }

::selection { background: color-mix(in srgb, var(--brand) 22%, white); color: var(--ink); }

:focus-visible {
	outline: 2px solid var(--brand);
	outline-offset: 3px;
	border-radius: 4px;
}

.skip-link {
	position: fixed;
	top: 10px;
	left: 10px;
	z-index: 2000;
	background: var(--ink);
	color: #fff;
	padding: 10px 18px;
	border-radius: 8px;
	font-weight: 600;
	font-size: 0.9rem;
	transform: translateY(-180%);
	transition: transform 0.2s ease;
}
.skip-link:focus-visible { transform: none; color: #fff; }

/* ---------- Layout ---------- */

.container {
	width: 100%;
	max-width: var(--container);
	margin-inline: auto;
	padding-inline: clamp(20px, 4vw, 32px);
}

.section { padding-block: var(--section-pad); }

.section-head { max-width: 680px; margin-bottom: clamp(40px, 5vw, 56px); }
.section-head .section-desc { margin-top: 10px; }

.section-label {
	font-size: 0.78rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.16em;
	color: var(--brand-ink);
	margin-bottom: 14px;
}

.section-title { font-size: clamp(1.9rem, 1.2rem + 2.6vw, 2.7rem); }

.section-desc {
	font-size: 1.08rem;
	color: var(--muted);
	max-width: 60ch;
}

.gradient-text {
	background: linear-gradient(100deg, var(--brand) 20%, var(--amber));
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	color: transparent;
}

/* ---------- Buttons ---------- */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 13px 28px;
	border-radius: var(--radius-sm);
	border: 2px solid transparent;
	font-family: var(--font-body);
	font-weight: 600;
	font-size: 0.98rem;
	line-height: 1.2;
	cursor: pointer;
	white-space: nowrap;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-deep); color: #fff; transform: translateY(-2px); box-shadow: var(--shadow-md); }

.btn-outline { background: transparent; border-color: color-mix(in srgb, var(--brand) 45%, transparent); color: var(--brand-ink); }
.btn-outline:hover { background: var(--brand); border-color: var(--brand); color: #fff; transform: translateY(-2px); }

.btn-white { background: #fff; color: var(--ink); }
.btn-white:hover { color: var(--brand-ink); transform: translateY(-2px); box-shadow: var(--shadow-lg); }

/* ---------- Chips ---------- */

.chip {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 4px 11px;
	border: 1px solid var(--border);
	border-radius: 999px;
	background: var(--surface);
	font-size: 0.76rem;
	font-weight: 600;
	color: var(--muted);
	white-space: nowrap;
}

.lang-dot {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	display: inline-block;
	box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.15);
}

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

.site-header {
	position: sticky;
	top: 0;
	z-index: 1000;
	background: color-mix(in srgb, var(--surface) 82%, transparent);
	-webkit-backdrop-filter: blur(14px);
	backdrop-filter: blur(14px);
	border-bottom: 1px solid transparent;
	transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.site-header.is-scrolled {
	border-bottom-color: var(--border);
	box-shadow: 0 1px 12px rgba(15, 23, 42, 0.06);
	background: color-mix(in srgb, var(--surface) 92%, transparent);
}

.site-header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	height: var(--header-h);
}

.site-header-logo {
	display: inline-flex;
	align-items: center;
	gap: 11px;
	color: var(--ink);
}
.site-header-logo:hover { color: var(--ink); }

.site-header-logo img { height: 34px; width: auto; }

.site-header-brand {
	font-family: var(--font-head);
	font-weight: 800;
	font-size: 1.08rem;
	letter-spacing: -0.01em;
	white-space: nowrap;
}

.site-header-nav {
	display: flex;
	align-items: center;
	gap: clamp(18px, 2.6vw, 32px);
}

.site-header-nav a {
	position: relative;
	color: var(--ink-soft);
	font-weight: 500;
	font-size: 0.95rem;
	padding-block: 6px;
}

.site-header-nav a:not(.nav-github)::after {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 2px;
	border-radius: 2px;
	background: var(--brand);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform 0.22s ease;
}

.site-header-nav a:not(.nav-github):hover::after,
.site-header-nav a[aria-current="page"]::after { transform: scaleX(1); }

.site-header-nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }

.nav-github {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 7px 14px;
	border: 1px solid var(--border);
	border-radius: 999px;
	background: var(--card);
	color: var(--ink-soft);
	font-weight: 600;
	font-size: 0.86rem;
	box-shadow: var(--shadow-sm);
}
.nav-github:hover { border-color: var(--ink); color: var(--ink); }

.site-header-toggle {
	display: none;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	width: 42px;
	height: 42px;
	padding: 9px;
	background: none;
	border: 1px solid var(--border);
	border-radius: 10px;
	cursor: pointer;
}

.site-header-toggle span {
	display: block;
	width: 100%;
	height: 2px;
	border-radius: 2px;
	background: var(--ink);
	transition: transform 0.25s ease, opacity 0.2s ease;
}

.site-header-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.site-header-toggle.is-open span:nth-child(2) { opacity: 0; }
.site-header-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */

.hero {
	position: relative;
	overflow: hidden;
	background: #0B1120;
	color: #fff;
	padding-block: clamp(96px, 13vw, 160px) clamp(80px, 11vw, 130px);
	min-height: min(84svh, 780px);
	display: flex;
	align-items: center;
}

/* Radial brand glows + faint dot grid. */
.hero::before {
	content: '';
	position: absolute;
	inset: 0;
	background:
		radial-gradient(ellipse 60% 55% at 12% 30%, rgba(212, 56, 58, 0.28), transparent 65%),
		radial-gradient(ellipse 45% 50% at 85% 90%, rgba(249, 161, 82, 0.14), transparent 60%),
		radial-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1.4px);
	background-size: auto, auto, 26px 26px;
	pointer-events: none;
}

.hero-bg {
	position: absolute;
	inset: 0;
	overflow: hidden;
	pointer-events: none;
}

.hero-bg picture { position: absolute; inset: 0; }

.hero-bg img {
	position: absolute;
	right: -2%;
	bottom: 0;
	width: min(55%, 700px);
	height: auto;
	object-fit: cover;
	/* The art ships on the same flat navy as the hero background, so full
	   opacity seams cleanly; the mask only eases the left edge. */
	-webkit-mask-image: linear-gradient(to left, #000 40%, transparent 92%);
	mask-image: linear-gradient(to left, #000 40%, transparent 92%);
}

/* Bottom edge blend into the page. */
.hero::after {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 90px;
	background: linear-gradient(to top, var(--surface), transparent);
	pointer-events: none;
}

.hero-content {
	position: relative;
	max-width: 660px;
	animation: fadeInUp 0.7s ease-out both;
}

.hero-kicker {
	font-size: 0.82rem;
	font-weight: 600;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--amber);
	margin-bottom: 22px;
}

.hero-h {
	color: #fff;
	font-size: clamp(2.4rem, 1.4rem + 4.4vw, 4.1rem);
	font-weight: 800;
	margin-bottom: 24px;
}

.hero-h em {
	font-style: normal;
	background: linear-gradient(105deg, var(--amber), var(--brand) 75%);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	color: transparent;
}

.hero-desc {
	font-size: clamp(1.05rem, 1rem + 0.4vw, 1.22rem);
	color: rgba(255, 255, 255, 0.78);
	max-width: 56ch;
	margin-bottom: 40px;
}

.hero-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
}

.hero-buttons .btn-outline { border-color: rgba(255, 255, 255, 0.45); color: #fff; }
.hero-buttons .btn-outline:hover { background: #fff; border-color: #fff; color: var(--ink); }

/* ---------- Services ---------- */

.services-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
	gap: 22px;
}

.service-card {
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 32px 26px;
	box-shadow: var(--shadow-sm);
	transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.service-card:hover {
	transform: translateY(-5px);
	box-shadow: var(--shadow-lg);
	border-color: color-mix(in srgb, var(--brand) 40%, var(--border));
}

.service-card-icon {
	width: 48px;
	height: 48px;
	display: grid;
	place-items: center;
	border-radius: 12px;
	background: var(--brand-tint);
	color: var(--brand-ink);
	margin-bottom: 22px;
}
.service-card-icon svg { width: 24px; height: 24px; }

.service-card h3 { font-size: 1.14rem; margin-bottom: 10px; }
.service-card p { color: var(--muted); font-size: 0.95rem; }

/* ---------- Open source (home cards) ---------- */

.oss-home { background: #fff; }

.oss-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
	gap: 22px;
}

.oss-card {
	position: relative;
	display: flex;
	flex-direction: column;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	overflow: hidden;
	color: var(--muted);
	transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.oss-card:hover {
	transform: translateY(-5px);
	box-shadow: var(--shadow-lg);
	border-color: color-mix(in srgb, var(--brand) 45%, var(--border));
	color: var(--muted);
}

/* Project artwork strip (2:1 sources cover a 2.05:1 slot either way -- close enough). */
.oss-card-banner {
	position: relative;
	aspect-ratio: 41 / 20;
	background: var(--ink);
}
.oss-card-banner picture { position: absolute; inset: 0; }
.oss-card-banner img { width: 100%; height: 100%; object-fit: cover; }

.oss-card-body {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 22px 24px 24px;
}

.oss-card h3 { font-size: 1.22rem; color: var(--ink); }
.oss-card p { font-size: 0.95rem; flex: 1; }

.oss-card-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-top: 2px;
}

.oss-card-cta {
	margin-left: auto;
	font-size: 0.82rem;
	font-weight: 700;
	color: var(--brand-ink);
}
.oss-card:hover .oss-card-cta { color: var(--brand-deep); }

.oss-home-foot { margin-top: 44px; }

/* ---------- Open source (full page) ---------- */

.oss-detail {
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	padding: clamp(28px, 4vw, 44px);
	box-shadow: var(--shadow-sm);
	margin-bottom: 28px;
}

.oss-detail-head {
	display: flex;
	align-items: flex-start;
	flex-wrap: wrap;
	gap: 18px 22px;
	margin-bottom: 22px;
}

.oss-detail-icon {
	width: 56px;
	height: 56px;
	display: grid;
	place-items: center;
	border-radius: 15px;
	background: linear-gradient(135deg, var(--ink), #1E293B);
	color: #fff;
	flex: none;
}
.oss-detail-icon svg { width: 27px; height: 27px; }

.oss-detail-head > div { min-width: 240px; flex: 1; }
.oss-detail-head h2 { font-size: 1.5rem; margin-bottom: 4px; }
.oss-detail-tagline { color: var(--brand-ink); font-weight: 600; font-size: 0.95rem; margin-bottom: 12px; }
.oss-detail .oss-card-meta { margin-top: 0; }

.oss-detail-cta { align-self: center; }

/* Project artwork banner on the full page. */
.oss-detail-banner {
	aspect-ratio: 41 / 20;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	overflow: hidden;
	background: var(--ink);
	margin-bottom: 26px;
}
.oss-detail-banner picture,
.oss-detail-banner img { width: 100%; height: 100%; display: block; }
.oss-detail-banner img { object-fit: cover; }

.oss-detail > p { max-width: 72ch; margin-bottom: 18px; }

.oss-features {
	list-style: none;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
	gap: 10px 32px;
	margin: 0 0 8px;
	padding: 0;
}

.oss-features li {
	position: relative;
	padding-left: 26px;
	font-size: 0.95rem;
	color: var(--ink-soft);
}

.oss-features li::before {
	content: '✓';
	position: absolute;
	left: 2px;
	font-weight: 800;
	color: var(--brand-ink);
}

.oss-figure {
	margin-top: 26px;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	overflow: hidden;
	background: var(--surface);
}
.oss-figure img { width: 100%; }
.oss-figure figcaption {
	padding: 12px 18px;
	font-size: 0.85rem;
	color: var(--muted);
	text-align: center;
	background: var(--card);
	border-top: 1px solid var(--border-soft);
}

.oss-banner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 22px;
	margin-top: 44px;
	padding: clamp(26px, 4vw, 40px);
	border-radius: var(--radius-lg);
	background:
		radial-gradient(ellipse 70% 120% at 90% 10%, rgba(212, 56, 58, 0.35), transparent 60%),
		linear-gradient(120deg, var(--ink), #1E293B);
	color: rgba(255, 255, 255, 0.8);
}
.oss-banner h3 { color: #fff; font-size: 1.35rem; margin-bottom: 8px; }
.oss-banner p { max-width: 55ch; font-size: 0.98rem; }

/* ---------- Team ---------- */

.team-section { background: #fff; }

.team-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
	gap: 32px;
	max-width: 560px;
}

.team-card { text-align: center; padding: 28px 20px; border-radius: var(--radius); transition: background-color 0.25s ease; }
.team-card:hover { background: var(--surface); }

.team-card-avatar {
	width: 112px;
	height: 112px;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--brand), var(--brand-deep));
	box-shadow: 0 0 0 6px var(--brand-tint);
	display: grid;
	place-items: center;
	overflow: hidden;
	margin: 0 auto 20px;
}

/* The build wraps this img in <picture> and adds intrinsic size + lazy loading. */
.team-card-avatar picture { width: 100%; height: 100%; }

.team-card-avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 50%;
	transition: transform 0.35s ease;
}
.team-card:hover .team-card-avatar img { transform: scale(1.06); }

.team-card h3 { font-size: 1.18rem; margin-bottom: 4px; }

.team-card-role { color: var(--brand-ink); font-weight: 600; font-size: 0.9rem; margin-bottom: 10px; }
.team-card-bio { color: var(--muted); font-size: 0.93rem; margin-bottom: 16px; }

.team-card-links { display: flex; justify-content: center; gap: 18px; }

.team-card-link {
	font-weight: 600;
	font-size: 0.9rem;
	border-bottom: 1.5px solid transparent;
	transition: border-color 0.2s ease;
}
.team-card-link:hover { border-color: currentColor; }

/* ---------- CTA ---------- */

.cta {
	position: relative;
	overflow: hidden;
	background:
		radial-gradient(ellipse 60% 90% at 85% 20%, rgba(212, 56, 58, 0.3), transparent 60%),
		linear-gradient(120deg, var(--ink) 0%, #1E293B 100%);
	color: #fff;
	text-align: center;
	padding-block-start: 0;
}

/* The crab-at-work diorama, emerging from and dissolving back into the gradient. */
.cta-art {
	position: relative;
	height: clamp(200px, 32vw, 480px);
	background: #0B1120;
	-webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 18%, #000 58%, transparent 96%);
	mask-image: linear-gradient(to bottom, transparent 0%, #000 18%, #000 58%, transparent 96%);
}
.cta-art picture { position: absolute; inset: 0; }
.cta-art img { width: 100%; height: 100%; object-fit: cover; }

.cta > .container { padding-top: clamp(10px, 2vw, 28px); }

.cta h2 { color: #fff; font-size: clamp(1.8rem, 1.2rem + 2.4vw, 2.6rem); margin-bottom: 16px; }

.cta-desc {
	color: rgba(255, 255, 255, 0.75);
	font-size: 1.08rem;
	max-width: 58ch;
	margin: 0 auto 36px;
}

/* ---------- Blog listing ---------- */

.blog-listing {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.blog-card {
	position: relative;
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 30px 32px;
	transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.blog-card:hover {
	transform: translateY(-3px);
	box-shadow: var(--shadow-lg);
	border-color: color-mix(in srgb, var(--brand) 35%, var(--border));
}

.blog-card-meta {
	font-size: 0.83rem;
	font-weight: 500;
	color: var(--muted);
	margin-bottom: 8px;
}

.blog-card-title { font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem); margin-bottom: 10px; }

/* Whole card is clickable through the title link. */
.blog-card-title a { color: var(--ink); }
.blog-card-title a:hover { color: var(--brand-ink); }
.blog-card-title a::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }

.blog-card-author { font-size: 0.88rem; color: var(--muted); margin-bottom: 10px; }
.blog-card-excerpt { font-size: 0.96rem; color: var(--muted); max-width: 78ch; margin-bottom: 0; }

/* ---------- Blog pagination ---------- */

.blog-pagination {
	margin-top: 48px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 16px;
}

.blog-pagination .page-link {
	display: inline-flex;
	align-items: center;
	padding: 10px 20px;
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	font-weight: 600;
	font-size: 0.93rem;
	color: var(--ink-soft);
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.blog-pagination .page-link:hover {
	background: var(--brand);
	border-color: var(--brand);
	color: #fff;
}

.blog-pagination .page-numbers { font-size: 0.93rem; color: var(--muted); }

/* ---------- Blog post ---------- */

.blog-post { background: #fff; border-top: 1px solid var(--border-soft); }

.blog-post-container {
	max-width: 760px;
	padding-block: clamp(56px, 7vw, 84px) clamp(56px, 7vw, 88px);
}

.blog-post-back {
	display: inline-block;
	color: var(--muted);
	font-size: 0.92rem;
	font-weight: 500;
	margin-bottom: 28px;
}
.blog-post-back:hover { color: var(--brand-ink); }

.blog-post-meta { font-size: 0.93rem; color: var(--muted); margin-bottom: 12px; }

.blog-post-title {
	font-size: clamp(1.8rem, 1.2rem + 2.8vw, 2.7rem);
	margin-bottom: 36px;
}

.blog-post-content { font-size: 1.05rem; line-height: 1.85; color: #2B3A4E; overflow-wrap: anywhere; }

.blog-post-content h2 { font-size: 1.55rem; margin: 52px 0 18px; }
.blog-post-content h3 { font-size: 1.28rem; margin: 36px 0 12px; }
.blog-post-content h4 { font-size: 1.1rem; margin: 28px 0 10px; }

.blog-post-content > * + * { margin-top: 0; }
.blog-post-content p { margin-block: 1.2em; }

.blog-post-content ul,
.blog-post-content ol { margin: 1.2em 0; padding-left: 1.5em; }
.blog-post-content li { margin-bottom: 0.5em; padding-left: 0.15em; }
.blog-post-content li::marker { color: var(--brand-ink); }

.blog-post-content hr {
	border: none;
	border-top: 1px solid var(--border);
	margin: 40px 0;
}

/* Images get the vertical rhythm through <picture> (injected at build time). */
.blog-post-content picture { display: block; margin: 32px 0; }
.blog-post-content picture img { margin: 0; }

.blog-post-content img {
	max-width: 100%;
	height: auto;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	background: var(--surface);
	box-shadow: var(--shadow-md);
	cursor: zoom-in;
}

.blog-post-content blockquote {
	border-left: 3px solid var(--brand);
	padding: 16px 22px;
	margin: 28px 0;
	color: var(--ink-soft);
	background: var(--surface);
	border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.blog-post-content blockquote p { margin: 0.4em 0; }

.blog-post-content code {
	font-family: var(--font-mono);
	font-size: 0.88em;
	background: var(--surface);
	border: 1px solid var(--border-soft);
	color: #9F2A2C;
	padding: 0.12em 0.4em;
	border-radius: 6px;
}

.blog-post-content pre {
	background: var(--ink);
	border-radius: var(--radius-sm);
	padding: 18px 22px;
	margin: 28px 0;
	overflow-x: auto;
	box-shadow: var(--shadow-md);
}

.blog-post-content pre code {
	background: none;
	border: none;
	color: #E2E8F0;
	padding: 0;
	font-size: 0.87em;
	line-height: 1.7;
	white-space: pre;
}

/* Wide markdown tables scroll instead of breaking the column. */
.blog-post-content table {
	display: block;
	max-width: 100%;
	overflow-x: auto;
	border-collapse: collapse;
	margin: 28px 0;
	font-size: 0.9rem;
}

.blog-post-content th,
.blog-post-content td {
	border: 1px solid var(--border);
	padding: 9px 13px;
	text-align: left;
	vertical-align: top;
}

.blog-post-content th { background: #F1F5F9; font-family: var(--font-head); font-size: 0.82rem; letter-spacing: 0.01em; }
.blog-post-content tbody tr:nth-child(even) td { background: #FAFCFE; }

/* ---------- Lightbox ---------- */

.lightbox {
	position: fixed;
	inset: 0;
	z-index: 2000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 4vmin;
	background: rgba(11, 17, 32, 0.9);
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
	cursor: zoom-out;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease, visibility 0.2s;
}

.lightbox.is-open { opacity: 1; visibility: visible; }

.lightbox img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	margin: 0;
	border-radius: var(--radius-sm);
	background: #fff;
	box-shadow: var(--shadow-lg);
	cursor: zoom-out;
	transform: scale(0.96);
	transition: transform 0.2s ease;
}

.lightbox.is-open img { transform: scale(1); }

body.lightbox-open { overflow: hidden; }

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

.contact-section {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
	gap: 22px;
}

.contact-box {
	padding: 30px 28px;
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.contact-box:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.contact-box h3 {
	font-size: 0.8rem;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	color: var(--muted);
	font-weight: 700;
	margin-bottom: 10px;
}

.contact-box a { font-weight: 600; font-size: 1.02rem; overflow-wrap: anywhere; }
.contact-box p { font-size: 0.88rem; color: var(--muted); margin-top: 8px; margin-bottom: 0; }

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

.site-footer {
	background: var(--ink);
	color: rgba(255, 255, 255, 0.72);
	padding-block: 56px 28px;
}

.site-footer-top {
	display: grid;
	grid-template-columns: 1.6fr repeat(3, minmax(120px, 1fr));
	gap: 36px 24px;
	padding-bottom: 36px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.site-footer-brand-logo img { height: 34px; width: auto; margin-bottom: 14px; filter: brightness(0) invert(1); }

.site-footer-brand p {
	color: rgba(255, 255, 255, 0.5);
	font-size: 0.92rem;
	max-width: 34ch;
}

.site-footer-col {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.site-footer-col h3 {
	color: rgba(255, 255, 255, 0.45);
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.14em;
	margin-bottom: 4px;
}

.site-footer-col a { color: rgba(255, 255, 255, 0.72); font-size: 0.93rem; width: fit-content; }
.site-footer-col a:hover { color: #fff; }

.site-footer-bottom { padding-top: 24px; text-align: center; }
.site-footer-bottom p { color: rgba(255, 255, 255, 0.35); font-size: 0.82rem; }

/* ---------- Animation ---------- */

@keyframes fadeInUp {
	from { opacity: 0; transform: translateY(22px); }
	to { opacity: 1; transform: translateY(0); }
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
	.hero { min-height: 0; text-align: left; }

	.hero-bg img {
		width: 100%;
		right: 0;
		top: 0;
		bottom: auto;
		height: 100%;
		object-fit: cover;
		opacity: 0.3;
		-webkit-mask-image: linear-gradient(to bottom, transparent 4%, #000 60%);
		mask-image: linear-gradient(to bottom, transparent 4%, #000 60%);
	}

	.hero::before {
		background:
			radial-gradient(ellipse 90% 60% at 50% 0%, rgba(212, 56, 58, 0.22), transparent 70%),
			radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1.4px);
		background-size: auto, 26px 26px;
	}

	.oss-detail-cta { width: 100%; }
}

@media (max-width: 768px) {
	.site-header-toggle { display: flex; }

	.site-header-nav {
		position: absolute;
		top: var(--header-h);
		left: 0;
		right: 0;
		display: none;
		flex-direction: column;
		align-items: stretch;
		gap: 4px;
		padding: 14px clamp(20px, 4vw, 32px) 22px;
		background: color-mix(in srgb, var(--surface) 96%, transparent);
		-webkit-backdrop-filter: blur(16px);
		backdrop-filter: blur(16px);
		border-bottom: 1px solid var(--border);
		box-shadow: var(--shadow-md);
	}

	.site-header-nav.is-open { display: flex; }

	.site-header-nav a:not(.nav-github) { padding: 10px 2px; font-size: 1.02rem; }
	.site-header-nav a:not(.nav-github)::after { display: none; }

	.nav-github {
		justify-content: center;
		margin-top: 10px;
		padding: 11px 14px;
	}

	.blog-card { padding: 24px 22px; }

	.site-footer-top { grid-template-columns: 1fr 1fr; }
	.site-footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 480px) {
	.hero-buttons { flex-direction: column; align-items: stretch; }
	.hero-buttons .btn { width: 100%; }
}

/* ---------- Motion & contrast preferences ---------- */

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