/* ==========================================================================
   Karname — bilingual résumé theme
   ========================================================================== */

/* Fonts (self-hosted, SIL OFL) ------------------------------------------ */
@font-face { font-family: "Vazirmatn"; src: url("../fonts/Vazirmatn-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/inter-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/inter-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/inter-latin-600-normal.woff2") format("woff2"); font-weight: 600 700; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("../fonts/instrument-serif-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("../fonts/instrument-serif-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/jetbrains-mono-latin-500-normal.woff2") format("woff2"); font-weight: 500 700; font-display: swap; }

/* Tokens --------------------------------------------------------------- */
:root {
	--accent: #C9A86A;
	--bg: #0A0A0C;
	--bg-soft: #0F0F12;
	--surface: #131317;
	--surface-2: #18181D;
	--line: rgba(236, 232, 225, 0.08);
	--line-strong: rgba(236, 232, 225, 0.16);
	--text: #ECE8E1;
	--muted: #A6A199;
	--accent-ink: var(--accent);
	--on-accent: #15120B;
	--glow: color-mix(in srgb, var(--accent) 14%, transparent);
	--shadow: 0 40px 80px -48px rgba(0, 0, 0, 0.8);

	--font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
	--font-display: "Instrument Serif", "Iowan Old Style", Georgia, serif;
	--font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

	--maxw: 1180px;
	--gutter: clamp(20px, 4vw, 40px);
	--radius: 20px;
	--ease: cubic-bezier(0.2, 0.7, 0.2, 1);
	color-scheme: dark;
}

html[lang^="fa"] {
	--font-body: "Vazirmatn", Tahoma, sans-serif;
	--font-display: "Vazirmatn", Tahoma, sans-serif;
}

html[data-theme="light"] {
	--bg: #F6F4EF;
	--bg-soft: #EFECE5;
	--surface: #FFFFFF;
	--surface-2: #FAF8F4;
	--line: rgba(23, 22, 20, 0.09);
	--line-strong: rgba(23, 22, 20, 0.18);
	--text: #17161A;
	--muted: #5C5852;
	--accent-ink: color-mix(in srgb, var(--accent) 52%, #000);
	--glow: color-mix(in srgb, var(--accent) 18%, transparent);
	--shadow: 0 40px 80px -50px rgba(40, 30, 10, 0.35);
	color-scheme: light;
}

@media (prefers-color-scheme: light) {
	html:not([data-theme]) {
		--bg: #F6F4EF;
		--bg-soft: #EFECE5;
		--surface: #FFFFFF;
		--surface-2: #FAF8F4;
		--line: rgba(23, 22, 20, 0.09);
		--line-strong: rgba(23, 22, 20, 0.18);
		--text: #17161A;
		--muted: #5C5852;
		--accent-ink: color-mix(in srgb, var(--accent) 52%, #000);
		--glow: color-mix(in srgb, var(--accent) 18%, transparent);
		--shadow: 0 40px 80px -50px rgba(40, 30, 10, 0.35);
		color-scheme: light;
	}
}

/* Base ----------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font-body);
	font-size: 17px;
	line-height: 1.7;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}
html[lang^="fa"] body { line-height: 1.95; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent-ink); }
::selection { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { margin: 0; font-weight: 400; color: var(--text); }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
.icon { flex: none; }
[dir="rtl"] .icon--flip, html[dir="rtl"] .btn .icon, html[dir="rtl"] .project__links .icon { transform: scaleX(-1); }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.container--narrow { max-width: 760px; }

.skip-link {
	position: absolute; inset-inline-start: 16px; top: -60px; z-index: 100;
	padding: 10px 16px; background: var(--accent); color: var(--on-accent); border-radius: 10px; font-weight: 600;
}
.skip-link:focus { top: 16px; color: var(--on-accent); }

/* Buttons --------------------------------------------------------------- */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 10px;
	min-height: 52px; padding: 0 26px; border-radius: 999px;
	font: 500 15px/1 var(--font-body); letter-spacing: 0.01em;
	border: 1px solid transparent; cursor: pointer;
	transition: transform 0.35s var(--ease), background-color 0.25s, border-color 0.25s, color 0.25s;
}
.btn .icon { width: 18px; height: 18px; transition: transform 0.35s var(--ease); }
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { color: var(--on-accent); transform: translateY(-2px); }
.btn--primary:hover .icon { transform: translate(2px, -2px); }
html[dir="rtl"] .btn--primary:hover .icon { transform: scaleX(-1) translate(2px, -2px); }
.btn--ghost { border-color: var(--line-strong); color: var(--text); }
.btn--ghost:hover { border-color: var(--accent); color: var(--text); }
.btn--sm { min-height: 40px; padding: 0 16px; font-size: 14px; }
.btn--block { width: 100%; }

/* Header --------------------------------------------------------------- */
.site-header {
	position: fixed; inset-inline: 0; top: 0; z-index: 50;
	border-bottom: 1px solid transparent;
	transition: background-color 0.3s, border-color 0.3s, backdrop-filter 0.3s;
}
.site-header.is-scrolled, .site-header.is-open {
	background: color-mix(in srgb, var(--bg) 78%, transparent);
	-webkit-backdrop-filter: saturate(140%) blur(16px);
	backdrop-filter: saturate(140%) blur(16px);
	border-bottom-color: var(--line);
}
.site-header__inner { display: flex; align-items: center; gap: 24px; min-height: 76px; }
.brand { display: inline-flex; align-items: center; gap: 12px; margin-inline-end: auto; }
.brand:hover { color: var(--text); }
.brand__mark {
	display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
	border: 1px solid var(--line-strong); color: var(--accent-ink);
	font: 400 20px/1 var(--font-display);
}
html[lang^="fa"] .brand__mark { font-weight: 700; font-size: 17px; }
.brand__name { font-weight: 500; font-size: 15px; letter-spacing: 0.01em; }

.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav ul { display: flex; gap: 26px; }
.site-nav ul a { position: relative; font-size: 14.5px; color: var(--muted); padding-block: 8px; transition: color 0.2s; }
.site-nav ul a::after {
	content: ""; position: absolute; inset-inline: 0; bottom: 2px; height: 1px;
	background: var(--accent); transform: scaleX(0); transition: transform 0.4s var(--ease);
}
.site-nav ul a:hover, .site-nav ul a.is-active { color: var(--text); }
.site-nav ul a.is-active::after, .site-nav ul a:hover::after { transform: scaleX(1); }

.site-header__tools { display: flex; align-items: center; gap: 6px; }
.tool {
	display: inline-grid; place-items: center; min-width: 44px; height: 44px; padding: 0 10px;
	border-radius: 999px; border: 1px solid transparent; background: none; color: var(--muted);
	font: 500 13px/1 var(--font-mono); cursor: pointer; transition: color 0.2s, border-color 0.2s;
}
.tool:hover { color: var(--text); border-color: var(--line-strong); }
.tool--lang { letter-spacing: 0.06em; }
.tool--lang:lang(fa) { font-family: "Vazirmatn", sans-serif; font-size: 16px; font-weight: 600; }
.tool .icon { width: 19px; height: 19px; }
.tool__moon, .tool__close { display: none; }
html[data-theme="light"] .tool__sun { display: none; }
html[data-theme="light"] .tool__moon { display: block; }
@media (prefers-color-scheme: light) {
	html:not([data-theme]) .tool__sun { display: none; }
	html:not([data-theme]) .tool__moon { display: block; }
}
.tool--menu { display: none; }

@media (max-width: 960px) {
	.tool--menu { display: inline-grid; }
	.site-nav {
		position: absolute; inset-inline: 0; top: 100%;
		flex-direction: column; align-items: stretch; gap: 16px;
		padding: 12px var(--gutter) 28px;
		background: color-mix(in srgb, var(--bg) 96%, transparent);
		border-bottom: 1px solid var(--line);
		opacity: 0; visibility: hidden; transform: translateY(-8px);
		transition: opacity 0.3s, transform 0.3s var(--ease), visibility 0.3s;
	}
	.site-header.is-open .site-nav { opacity: 1; visibility: visible; transform: none; }
	.site-header.is-open .tool__open { display: none; }
	.site-header.is-open .tool__close { display: block; }
	.site-nav ul { flex-direction: column; gap: 0; }
	.site-nav ul a { display: block; padding: 14px 0; font-size: 18px; border-bottom: 1px solid var(--line); }
	.site-nav ul a::after { display: none; }
}

/* Hero ----------------------------------------------------------------- */
.hero {
	position: relative; overflow: hidden;
	padding: clamp(140px, 18vh, 200px) 0 clamp(80px, 12vh, 140px);
	min-height: min(100svh, 980px); display: flex; align-items: center;
}
.hero::before {
	/* dot grid, fading out */
	content: ""; position: absolute; inset: 0; pointer-events: none;
	background-image: radial-gradient(var(--line-strong) 1px, transparent 1px);
	background-size: 28px 28px;
	-webkit-mask-image: radial-gradient(ellipse 70% 60% at 70% 40%, #000 20%, transparent 75%);
	mask-image: radial-gradient(ellipse 70% 60% at 70% 40%, #000 20%, transparent 75%);
	opacity: 0.55;
}
html[dir="rtl"] .hero::before {
	-webkit-mask-image: radial-gradient(ellipse 70% 60% at 30% 40%, #000 20%, transparent 75%);
	mask-image: radial-gradient(ellipse 70% 60% at 30% 40%, #000 20%, transparent 75%);
}
.hero__grid {
	position: relative; display: grid; align-items: center;
	grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.8fr); gap: clamp(40px, 6vw, 96px);
}
.eyebrow {
	display: flex; align-items: center; gap: 14px; margin-bottom: 28px;
	font: 500 13px/1.4 var(--font-mono); letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent-ink);
}
html[lang^="fa"] .eyebrow { font-family: var(--font-body); font-size: 16px; letter-spacing: 0; text-transform: none; font-weight: 500; }
.eyebrow__line { width: 40px; height: 1px; background: currentColor; }
.hero__name {
	font-family: var(--font-display); font-weight: 400;
	font-size: clamp(3.4rem, 8.4vw, 7.4rem); line-height: 0.98; letter-spacing: -0.025em;
	margin-bottom: 30px;
}
html[lang^="fa"] .hero__name { font-weight: 800; font-size: clamp(3rem, 7.2vw, 6.2rem); line-height: 1.15; letter-spacing: -0.01em; }
.hero__tagline { max-width: 34em; font-size: clamp(1.05rem, 1.5vw, 1.22rem); color: var(--muted); margin-bottom: 40px; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 48px; }
.hero__meta { display: flex; flex-wrap: wrap; gap: 14px 28px; font-size: 14.5px; color: var(--muted); }
.hero__meta li { display: inline-flex; align-items: center; gap: 8px; }
.hero__meta .icon { width: 17px; height: 17px; color: var(--accent-ink); }
.status { color: var(--text); }
.status__dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: #4ADE80; }
.status__dot::after {
	content: ""; position: absolute; inset: -4px; border-radius: 50%;
	border: 1px solid #4ADE80; opacity: 0; animation: krn-ping 2.4s var(--ease) infinite;
}
@keyframes krn-ping { 0% { transform: scale(0.6); opacity: 0.8; } 100% { transform: scale(1.8); opacity: 0; } }

.hero__visual { position: relative; justify-self: end; width: 100%; max-width: 420px; }
html[dir="rtl"] .hero__visual { justify-self: start; }
.portrait {
	position: relative; margin: 0; aspect-ratio: 4 / 5;
	border-radius: 999px 999px 28px 28px; isolation: isolate;
}
.portrait::before {
	/* offset outline */
	content: ""; position: absolute; inset: 0; z-index: -1;
	border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
	border-radius: inherit; transform: translate(18px, 18px);
	transition: transform 0.8s var(--ease);
}
html[dir="rtl"] .portrait::before { transform: translate(-18px, 18px); }
.portrait:hover::before { transform: translate(0, 0); }
.portrait__img, .portrait__mono {
	width: 100%; height: 100%; border-radius: inherit; object-fit: cover;
	border: 1px solid var(--line-strong); box-shadow: var(--shadow);
}
.portrait__img { filter: saturate(0.9) contrast(1.02); }
.portrait__mono {
	display: grid; place-items: center; background:
		radial-gradient(circle at 50% 35%, var(--glow), transparent 65%), var(--surface);
	font: 400 clamp(7rem, 14vw, 11rem)/1 var(--font-display); color: var(--accent-ink);
}
html[lang^="fa"] .portrait__mono { font-weight: 800; }
.socials { position: absolute; inset-inline-start: -22px; bottom: 32px; display: flex; flex-direction: column; gap: 10px; }
.socials a {
	display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
	background: var(--surface); border: 1px solid var(--line-strong); color: var(--muted);
	transition: color 0.2s, border-color 0.2s, transform 0.3s var(--ease);
}
.socials a:hover { color: var(--accent-ink); border-color: var(--accent); transform: translateY(-2px); }
.socials .icon { width: 18px; height: 18px; }

/* Stack strip ------------------------------------------------------------ */
.stack { border-block: 1px solid var(--line); background: var(--bg-soft); }
.stack__list {
	display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 0;
	padding-block: 26px; font: 500 13px/1 var(--font-mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted);
}
.stack__list li { display: inline-flex; align-items: center; }
.stack__list li + li::before { content: ""; width: 4px; height: 4px; margin-inline: 22px; border-radius: 50%; background: var(--accent); opacity: 0.7; }

/* Sections ---------------------------------------------------------------- */
.section { padding-block: clamp(88px, 11vw, 150px); }
.section + .section { border-top: 1px solid var(--line); }
.section-head {
	display: grid; grid-template-columns: auto 1fr; align-items: baseline; column-gap: 18px; row-gap: 10px;
	margin-bottom: clamp(40px, 5vw, 64px);
}
.section-head__num { font: 400 13px/1 var(--font-mono); color: var(--accent-ink); }
.section-head__kicker { font: 400 13px/1 var(--font-mono); letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.section-head__title {
	grid-column: 1 / -1;
	font-family: var(--font-display); font-size: clamp(2.4rem, 5vw, 4rem); line-height: 1.05; letter-spacing: -0.02em;
}
html[lang^="fa"] .section-head__title { font-weight: 700; font-size: clamp(2rem, 4.2vw, 3.2rem); line-height: 1.3; letter-spacing: 0; }

.card {
	background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
	transition: border-color 0.35s, transform 0.5s var(--ease), background-color 0.35s;
}

/* About */
.about { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: clamp(40px, 6vw, 96px); }
.about__text p { font-size: clamp(1.15rem, 1.7vw, 1.4rem); line-height: 1.7; color: var(--text); }
html[lang^="fa"] .about__text p { line-height: 2; }
.about__text p + p { margin-top: 1.1em; color: var(--muted); font-size: 1.05rem; }
.facts { margin: 0; border-top: 1px solid var(--line); }
.facts > div { display: flex; justify-content: space-between; gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; text-align: end; }

/* Skills */
.skills { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 18px; }
.skill { padding: 30px; }
.skill:hover { border-color: var(--line-strong); }
.skill__title { font-size: 1.15rem; font-weight: 600; margin-bottom: 20px; }
html[lang^="en"] .skill__title { font-family: var(--font-display); font-weight: 400; font-size: 1.6rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips li {
	padding: 7px 14px; border: 1px solid var(--line-strong); border-radius: 999px;
	font: 400 13px/1.2 var(--font-mono); color: var(--text); transition: border-color 0.2s, color 0.2s;
}
.chips li:hover { border-color: var(--accent); color: var(--accent-ink); }

/* Experience */
.timeline { border-top: 1px solid var(--line); }
.timeline__item {
	display: grid; grid-template-columns: minmax(160px, 0.32fr) minmax(0, 1fr); gap: 16px 48px;
	padding-block: 36px; border-bottom: 1px solid var(--line);
}
.timeline__period { font: 400 14px/1.6 var(--font-mono); color: var(--muted); padding-top: 6px; }
html[lang^="fa"] .timeline__period { font-family: var(--font-body); font-size: 15px; }
.timeline__role { font-size: 1.45rem; font-weight: 600; margin-bottom: 4px; }
html[lang^="en"] .timeline__role { font-family: var(--font-display); font-weight: 400; font-size: 2rem; line-height: 1.15; }
.timeline__org { color: var(--accent-ink); font-weight: 500; margin-bottom: 16px; }
.timeline__loc { color: var(--muted); font-weight: 400; }
.timeline__list { display: grid; gap: 8px; color: var(--muted); }
.timeline__list li { position: relative; padding-inline-start: 22px; }
.timeline__list li::before { content: ""; position: absolute; inset-inline-start: 0; top: 0.85em; width: 10px; height: 1px; background: var(--accent); }

/* Projects */
.projects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.project { position: relative; display: flex; flex-direction: column; padding: clamp(28px, 3.4vw, 44px); min-height: 300px; overflow: hidden; }
.project:hover { border-color: color-mix(in srgb, var(--accent) 45%, transparent); transform: translateY(-4px); }
.project__index { font: 400 3.4rem/1 var(--font-display); color: color-mix(in srgb, var(--accent) 70%, var(--muted)); margin-bottom: auto; padding-bottom: 36px; opacity: 0.9; }
.project__title { font-size: 1.4rem; font-weight: 600; margin-bottom: 12px; }
html[lang^="en"] .project__title { font-family: var(--font-display); font-weight: 400; font-size: 2rem; line-height: 1.15; }
.project__desc { color: var(--muted); margin-bottom: 22px; }
.project__tags { display: flex; flex-wrap: wrap; gap: 6px 18px; font: 400 12.5px/1.4 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-ink); }
.project__links { display: flex; gap: 22px; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 14.5px; }
.project__links a { display: inline-flex; align-items: center; gap: 6px; }
.project__links .icon { width: 16px; height: 16px; }

/* Certifications */
.certs { border-top: 1px solid var(--line); }
.cert { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 26px 0; border-bottom: 1px solid var(--line); }
.cert__name { font-size: 1.2rem; font-weight: 600; }
html[lang^="en"] .cert__name { font-family: var(--font-display); font-weight: 400; font-size: 1.7rem; }
.cert__issuer { color: var(--muted); font-size: 14.5px; margin-top: 4px; }
.cert__year {
	flex: none; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line-strong);
	font-size: 13.5px; color: var(--accent-ink);
}

/* Contact */
.section--contact { background: var(--bg-soft); }
.contact { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(40px, 6vw, 96px); align-items: start; }
.contact .section-head { margin-bottom: 28px; }
.contact__text { color: var(--muted); font-size: 1.1rem; max-width: 30em; margin-bottom: 36px; }
.contact__links { border-top: 1px solid var(--line); }
.contact__links a {
	display: flex; align-items: center; gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--line);
	font-size: 1.05rem; transition: color 0.2s, padding 0.4s var(--ease);
}
.contact__links a:hover { padding-inline-start: 8px; }
.contact__links .icon { color: var(--accent-ink); }
html[dir="rtl"] .contact__links a[dir="ltr"] { flex-direction: row-reverse; justify-content: flex-end; }

.form { padding: clamp(28px, 3.4vw, 44px); display: grid; gap: 20px; }
.field { display: grid; gap: 8px; }
.field label { font-size: 14px; color: var(--muted); }
.field input, .field textarea {
	width: 100%; padding: 14px 16px; border-radius: 12px;
	background: var(--bg); border: 1px solid var(--line-strong); color: var(--text);
	font: 400 16px/1.5 var(--font-body); transition: border-color 0.2s, box-shadow 0.2s;
}
.field textarea { resize: vertical; min-height: 140px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--glow); }
.field--hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.form__status { padding: 14px 16px; border-radius: 12px; font-size: 15px; border: 1px solid; }
.form__status--ok { color: #4ADE80; border-color: rgba(74, 222, 128, 0.35); background: rgba(74, 222, 128, 0.07); }
.form__status--error { color: #F59E8B; border-color: rgba(245, 158, 139, 0.35); background: rgba(245, 158, 139, 0.07); }
html[data-theme="light"] .form__status--ok { color: #166534; }
html[data-theme="light"] .form__status--error { color: #9A3412; }
.btn.is-busy { opacity: 0.7; pointer-events: none; }

/* Footer --------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--line); }
.site-footer__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; padding-block: 32px; font-size: 14px; }
.site-footer__muted { color: var(--muted); }
.site-footer__top { display: inline-flex; align-items: center; gap: 8px; margin-inline-start: auto; color: var(--muted); }
.site-footer__top .icon { width: 16px; height: 16px; }

/* Generic pages ---------------------------------------------------------- */
.page { padding-block: 160px 120px; min-height: 70vh; }
.page__title { font-family: var(--font-display); font-size: clamp(2.4rem, 5vw, 3.6rem); line-height: 1.15; margin: 12px 0 24px; }
html[lang^="fa"] .page__title { font-weight: 700; }
.page__empty p { color: var(--muted); margin-bottom: 28px; }
.entry + .entry { margin-top: 56px; padding-top: 56px; border-top: 1px solid var(--line); }
.entry__title { font-size: 1.8rem; margin-bottom: 12px; }
.entry__content { color: var(--muted); }
.entry__content a { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }

/* Reveal on scroll ------------------------------------------------------- */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { animation: none !important; transition: none !important; }
	.js .reveal { opacity: 1; transform: none; }
}

/* Responsive ------------------------------------------------------------- */
@media (max-width: 960px) {
	.hero { min-height: 0; }
	.hero__grid, .about, .contact { grid-template-columns: minmax(0, 1fr); }
	.hero__visual, html[dir="rtl"] .hero__visual { justify-self: center; max-width: 340px; order: -1; }
	.projects { grid-template-columns: minmax(0, 1fr); }
	.timeline__item { grid-template-columns: minmax(0, 1fr); gap: 6px; }
}
@media (max-width: 560px) {
	body { font-size: 16px; }
	.brand__name { display: none; }
	.hero { padding-top: 112px; }
	.hero__visual, html[dir="rtl"] .hero__visual { max-width: 230px; }
	.portrait::before { transform: translate(10px, 10px); }
	html[dir="rtl"] .portrait::before { transform: translate(-10px, 10px); }
	.socials { inset-inline-start: -14px; }
	.stack__list li + li::before { margin-inline: 14px; }
	.cert { flex-direction: column; align-items: flex-start; gap: 12px; }
	.btn { width: 100%; }
	.hero__cta .btn { flex: 1 1 100%; }
}
@media print {
	.site-header, .site-footer, .hero::before, .socials, .form, .hero__cta { display: none !important; }
	body { background: #fff; color: #000; }
	.js .reveal { opacity: 1; transform: none; }
}
