/* ==========================================================================
   sinjab — main.css · LIGHT-FIRST glassmorphism (DESIGN.md contract)
   Sora + JetBrains Mono (EN) · Cairo (AR) · blue→violet→cyan gradient signature
   Logical properties everywhere; physical values only inside [dir="rtl"] fixes.
   ========================================================================== */

/* border-box everywhere: width:100% form fields were overflowing their card by
   padding+border (34px) under the UA content-box default */
*, *::before, *::after { box-sizing: border-box; }

:root {
	/* light theme (PRIMARY) */
	color-scheme: light;
	--bg: #fafafa;
	--fg: #0a0a0a;
	--text-secondary: #52525b;
	--text-muted: #71717a;
	--text-faint: #a1a1aa;
	--text-dim: #d4d4d8;
	--accent-blue: #2563eb;
	--accent-violet: #7c3aed;
	--accent-cyan: #0891b2;
	--glass-bg: rgba(255, 255, 255, 0.42);
	--glass-bg-2: rgba(255, 255, 255, 0.16);
	--glass-border: rgba(0, 0, 0, 0.08);
	--glass-hover: rgba(255, 255, 255, 0.62);
	--glass-specular: inset 0 1px 0 rgba(255, 255, 255, 0.55);
	--wash: 0.065;
	--nav-blur-bg: rgba(250, 250, 250, 0.8);
	--surface-border: rgba(0, 0, 0, 0.06);
	--grid-line: rgba(37, 99, 235, 0.05);
	--orb-opacity: 0.14;
	--shadow-card: 0 20px 40px rgba(0, 0, 0, 0.08), 0 0 30px rgba(124, 58, 237, 0.06);
	--input-bg: #ffffff;
	--focus-ring: rgba(37, 99, 235, 0.45);

	--gradient: linear-gradient(135deg, var(--accent-blue), var(--accent-violet), var(--accent-cyan));
	--radius-sm: 8px;
	--radius-md: 12px;
	--radius-lg: 16px;
	--radius-full: 9999px;
	--max-w: 1152px;
	--section-pad: 128px;
	--font-en: "Sora", system-ui, -apple-system, sans-serif;
	--font-mono: "JetBrains Mono", ui-monospace, "SF Mono", monospace;
	--font-ar: "Cairo", "Geeza Pro", "Noto Sans Arabic", sans-serif;
	--font-body: var(--font-en);
}

html[data-theme="dark"] {
	color-scheme: dark;
	--bg: #050507;
	--fg: #f0f0f5;
	--text-secondary: #a8a8b3;
	--text-muted: #8e8e99;
	--text-faint: #6d6d78;
	--text-dim: #3f3f46;
	--accent-blue: #3b82f6;
	--accent-violet: #8b5cf6;
	--accent-cyan: #06b6d4;
	--glass-bg: rgba(255, 255, 255, 0.06);
	--glass-bg-2: rgba(255, 255, 255, 0.022);
	--glass-border: rgba(255, 255, 255, 0.14);
	--glass-hover: rgba(255, 255, 255, 0.09);
	--glass-specular: inset 0 1px 0 rgba(255, 255, 255, 0.12);
	--wash: 0.10;
	--nav-blur-bg: rgba(5, 5, 7, 0.8);
	--surface-border: rgba(255, 255, 255, 0.07);
	--grid-line: rgba(255, 255, 255, 0.02);
	--orb-opacity: 0.25;
	--shadow-card: 0 20px 40px rgba(0, 0, 0, 0.15), 0 0 30px rgba(139, 92, 246, 0.05);
	--input-bg: rgba(255, 255, 255, 0.04);
	--focus-ring: rgba(59, 130, 246, 0.55);
}

/* Arabic requests swap the text stack (html[dir=rtl] from the i18n engine). */
html[dir="rtl"] { --font-body: var(--font-ar); --font-mono: var(--font-ar); }

html { overflow-x: hidden; overflow-x: clip; scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--text-secondary);
	font-family: var(--font-body);
	font-size: 16px;
	line-height: 1.625;
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
	max-width: 100vw;
	transition: background-color .3s ease, color .3s ease;
}
/* Arabic needs taller lines (nuqta/ascender clearance) + Cairo 500 body weight. */
html[dir="rtl"] body { line-height: 1.8; font-weight: 500; }
html[data-theme] body, html[data-theme] .glass-card { transition: background-color .3s ease, color .3s ease, border-color .3s ease; }

h1, h2, h3, h4 { color: var(--fg); margin: 0 0 .5em; line-height: 1.2; text-wrap: balance; }
html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3, html[dir="rtl"] h4 { line-height: 1.35; }
p { margin: 0 0 1em; }
a { color: var(--accent-blue); text-decoration: none; }
a:hover { color: var(--accent-violet); }
img { max-width: 100%; height: auto; display: block; }

/* ---- focus system (keyboard-visible only; mouse clicks keep clean UI) ---- */
:focus { outline: none; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, [tabindex]:focus-visible {
	outline: 2px solid var(--focus-ring);
	outline-offset: 3px;
	border-radius: 2px;
}
::selection { background: rgba(124, 58, 237, 0.16); color: var(--fg); }
html[data-theme="dark"] ::selection { background: rgba(139, 92, 246, 0.32); }
.mono { font-variant-numeric: tabular-nums; }

.wrap { max-width: var(--max-w); margin-inline: auto; padding-inline: 24px; }
.mono { font-family: var(--font-mono); }
.caption { font-size: 12px; color: var(--text-muted); }

a, button, .chip, .icon-btn, .social-btn { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }

/* skip-link — CLIP method (never left:-9999px — family RTL rule) */
.skip-link {
	position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0, 0, 0, 0); clip-path: inset(50%); border: 0; white-space: nowrap;
}
.skip-link:focus {
	width: auto; height: auto; margin: 0; clip: auto; clip-path: none;
	z-index: 200; position: fixed; inset-inline-start: 16px; top: 16px;
	padding: 10px 18px; background: var(--fg); color: var(--bg); border-radius: var(--radius-full);
}

/* honeypot — same clip method */
.hp-field {
	position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0, 0, 0, 0); clip-path: inset(50%); border: 0; white-space: nowrap;
}

/* ---------------------------------------------------------------- header */
.site-header {
	position: fixed; inset-inline: 0; top: 0; z-index: 100;
	padding-block: 20px;
	transition: padding .3s ease, background-color .3s ease, border-color .3s ease;
	border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
	padding-block: 12px;
	background: var(--nav-blur-bg);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	border-bottom-color: var(--surface-border);
}
.header-inner { display: flex; align-items: center; gap: 28px; }
.logo { flex-shrink: 0; }
.logo-mark {
	display: inline-flex; align-items: center; justify-content: center;
	width: 36px; height: 36px; border-radius: 10px;
	background: var(--gradient); color: #fff;
	font-weight: 700; font-size: 16px; letter-spacing: .02em;
}
@media (max-width: 640px) {
	.logo-mark { width: 44px; height: 44px; font-size: 19px; }
}
.site-nav { display: flex; gap: 20px; flex-wrap: wrap; }
.site-nav .nav-link, .mobile-nav .nav-link {
	color: var(--text-secondary); font-size: 14px; letter-spacing: .025em; padding-block: 6px;
	border-bottom: 2px solid transparent; transition: color .2s, border-color .2s;
}
html[dir="rtl"] .site-nav .nav-link, html[dir="rtl"] .mobile-nav .nav-link { letter-spacing: 0; }
.site-nav .nav-link:hover, .mobile-nav .nav-link:hover { color: var(--fg); }
.site-nav .nav-link.active { color: var(--fg); border-bottom-color: transparent; background: var(--gradient); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

.header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; margin-inline-start: auto; }
.header-cta { flex-shrink: 0; white-space: nowrap; }
.icon-btn {
	display: inline-flex; align-items: center; justify-content: center;
	width: 36px; height: 36px; border-radius: var(--radius-full);
	background: var(--glass-bg); border: 1px solid var(--glass-border);
	color: var(--text-secondary); cursor: pointer; font: inherit;
	transition: color .2s, border-color .2s, background-color .2s;
}
.icon-btn:hover { color: var(--fg); border-color: rgba(124, 58, 237, .35); background: var(--glass-hover); }
.icon-btn:active { transform: scale(.94); }
.icon-btn .icon { width: 18px; height: 18px; }
@media (max-width: 640px) {
	.icon-btn { width: 44px; height: 44px; } /* tap-target floor (44px) */
}
.lang-toggle { font-weight: 600; font-size: 14px; font-family: var(--font-en); }

/* theme toggle crossfade */
.theme-toggle { position: relative; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* burger */
.nav-burger { display: none; }
.nav-burger .icon-close { display: none; }
.nav-burger[aria-expanded="true"] .icon-menu { display: none; }
.nav-burger[aria-expanded="true"] .icon-close { display: block; }

/* mobile nav overlay */
.mobile-nav {
	position: fixed; inset: 0; z-index: 90; padding: 110px 24px 40px;
	background: var(--nav-blur-bg);
	backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
	display: flex; flex-direction: column; gap: 32px; overflow-y: auto;
	overscroll-behavior: contain;
}
.mobile-nav nav { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.mobile-nav[hidden] { display: none; } /* author display:flex would override the UA [hidden] rule */
.mobile-nav .nav-link { font-size: 22px; font-weight: 600; padding-block: 10px; border-bottom: 1px solid var(--surface-border); text-align: center; }
.mobile-nav__actions { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: auto; }

/* ---------------------------------------------------------------- hero */
.hero { position: relative; min-height: 100svh; display: flex; align-items: center; padding-block: 140px 72px; overflow: hidden; }
/* ---------------------------------------------------------------- page backdrop
   Fixed layer behind ALL content (header.php): living canvas + 60px grid + drifting orbs.
   Sections are transparent by design — this shows through everywhere outside cards.
   z-index:-1 sits above the body base paint, below content; fixed = no scroll repaint. */
.page-backdrop { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
#pageCanvasHost { position: absolute; inset: 0; }
#pageCanvasHost canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.page-grid {
	position: absolute; inset: 0;
	background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
	background-size: 60px 60px;
	-webkit-mask-image: radial-gradient(75% 70% at 50% 45%, #000 30%, transparent 100%);
	mask-image: radial-gradient(75% 70% at 50% 45%, #000 30%, transparent 100%);
}
.orb { position: absolute; border-radius: 50%; filter: blur(110px); opacity: var(--orb-opacity); animation: orb-drift 14s ease-in-out infinite alternate; }
.orb--blue { width: 420px; height: 420px; background: var(--accent-blue); top: -80px; inset-inline-start: -120px; }
.orb--violet { width: 600px; height: 600px; background: var(--accent-violet); bottom: -200px; inset-inline-end: -160px; animation-duration: 18s; }
.orb--cyan { width: 180px; height: 180px; background: var(--accent-cyan); top: 30%; inset-inline-end: 20%; animation-duration: 11s; }
@keyframes orb-drift {
	from { transform: translate3d(0, 0, 0) scale(1); }
	to { transform: translate3d(40px, 26px, 0) scale(1.06); }
}

/* centered single-column hero (2026-09-02 operator revert; refresh craft kept) */
.hero-inner {
	position: relative; text-align: center; display: flex; flex-direction: column; align-items: center;
	width: 100%;
}
.hero-name { font-size: clamp(44px, 7.5vw, 88px); font-weight: 700; letter-spacing: -0.04em; line-height: 1.05; margin: 0 0 16px; }
html[dir="rtl"] .hero-name { letter-spacing: 0; line-height: 1.25; font-size: clamp(38px, 7vw, 78px); }
.hero-subtitle { font-size: clamp(13px, 1.6vw, 17px); letter-spacing: .12em; text-transform: uppercase; color: var(--accent-violet); margin-bottom: 22px; }
html[dir="rtl"] .hero-subtitle { letter-spacing: 0; text-transform: none; font-family: var(--font-ar); font-weight: 600; }
.hero-bio { max-width: 620px; font-size: 18px; line-height: 1.7; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin: 30px 0 24px; }
.hero-meta { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; font-size: 12px; color: var(--text-muted); letter-spacing: .08em; }
html[dir="rtl"] .hero-meta { letter-spacing: 0; font-size: 13px; }

/* figure: annular shamsa ring — hollow-center ring band encircling the avatar.
   Width CALIBRATED to the asset's measured radii: hollow = 60% of canvas diameter
   → at 168% of the 248px photo (D=417), the band's inner edge (250px) meets the
   avatar edge — the ring hugs/emerges from behind the head, no dead zone;
   clearance above = (417-248)/2 = 84px < 140px budget. */
.hero-fig { position: relative; display: flex; justify-content: center; margin-bottom: 92px; }
.hero-fig__art {
	/* left:50% + translateX(-50%) is direction-invariant (same math in RTL) —
	   inset-inline:0 + margin:auto FAILS here: width > container over-constrains the
	   abs box and collapses the auto margins to 0 (flush-start, off-center).
	   Centering lives in the `translate` PROPERTY, not `transform`: individual transform
	   properties apply translate→rotate→scale→transform, so a rotate in `transform`-last
	   position ORBITS the centering vector (190px wobble); translate-first spins in place. */
	position: absolute; inset-block-start: 50%; left: 50%;
	translate: -50% -50%;
	/* CALIBRATED from the asset's measured radial ink profile (DESIGN.md): tl-era-2 v5
	   girih/shamsa annulus 800×800, hollow = 65% of canvas → width 154% lands the band's
	   inner edge at the 248px avatar edge; art 381px → below-extension 67px (margin 92/78 clears). */
	width: 154%; aspect-ratio: 1;
	background: url('../img/art/tl-era-2.webp') center / contain no-repeat;
	opacity: .36; filter: saturate(1.1); pointer-events: none;
}
html[data-theme="dark"] .hero-fig__art { opacity: .24; }
.hero-photo { position: relative; }
.hero-photo img {
	width: 240px; height: 240px; border-radius: 50%; object-fit: cover;
	padding: 4px; background: var(--gradient);
	box-shadow: 0 0 30px rgba(37, 99, 235, .25), 0 0 60px rgba(124, 58, 237, .12);
}

.scroll-hint { position: absolute; bottom: 26px; inset-inline-start: 50%; transform: translateX(-50%); color: var(--text-faint); animation: scroll-bounce 2s ease-in-out infinite; }
html[dir="rtl"] .scroll-hint { transform: translateX(50%); }
@keyframes scroll-bounce { 0%, 100% { translate: 0 0; } 50% { translate: 0 8px; } }

/* ---------------------------------------------------------------- type */
.grad-text { background: var(--gradient); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
.section-label { font-family: var(--font-mono); font-size: 14px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-violet); margin: 0 0 12px; }
html[dir="rtl"] .section-label { letter-spacing: 0; text-transform: none; font-size: 15px; font-weight: 600; }
.section-title { font-size: clamp(26px, 4vw, 36px); font-weight: 700; letter-spacing: -0.02em; margin: 0 0 40px; }
html[dir="rtl"] .section-title { letter-spacing: 0; font-size: clamp(30px, 5vw, 42px); }

/* ---------------------------------------------------------------- cards — true glass */
.grid { display: grid; gap: 24px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.glass-card {
	background: linear-gradient(180deg, var(--glass-bg), var(--glass-bg-2));
	border: 1px solid var(--glass-border);
	border-radius: var(--radius-md); padding: 24px;
	box-shadow: var(--glass-specular);
	backdrop-filter: blur(14px) saturate(1.35);
	-webkit-backdrop-filter: blur(14px) saturate(1.35);
	transition: background-color .2s, border-color .2s, transform .2s, box-shadow .2s;
	position: relative; display: block; color: inherit;
}
a.glass-card:hover {
	border-color: rgba(124, 58, 237, .38); transform: translateY(-4px);
	box-shadow: var(--glass-specular), 0 18px 36px rgba(0, 0, 0, .1), 0 0 26px rgba(124, 58, 237, .09);
	color: inherit;
}
html[data-theme="dark"] a.glass-card:hover { box-shadow: var(--glass-specular), 0 18px 36px rgba(0, 0, 0, .4), 0 0 26px rgba(139, 92, 246, .12); }
a.glass-card:active { transform: translateY(-1px) scale(.99); }

/* ---------------------------------------------------------------- buttons */
.btn {
	display: inline-flex; align-items: center; gap: 8px; justify-content: center;
	border-radius: var(--radius-full); padding: 12px 24px; font-size: 14px; font-weight: 500;
	font-family: inherit; cursor: pointer; border: 1px solid transparent;
	transition: color .2s ease, background-color .2s ease, border-color .2s ease, transform .15s ease, box-shadow .2s ease, opacity .2s ease;
}
.btn .icon { width: 16px; height: 16px; }
.btn--sm { padding: 8px 16px; font-size: 13px; }
.btn--primary { background: var(--gradient); color: #fff; background-size: 160% 160%; }
.btn--primary .icon { transition: transform .2s ease; }
.btn--primary:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 10px 26px rgba(37, 99, 235, .28), 0 4px 14px rgba(124, 58, 237, .2); }
.btn--primary:hover .icon { transform: translateX(3px); }
html[dir="rtl"] .btn--primary .icon { transform: scaleX(-1); }
html[dir="rtl"] .btn--primary:hover .icon { transform: scaleX(-1) translateX(3px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn--glass { background: var(--glass-bg); border-color: var(--glass-border); color: var(--text-secondary); }
.btn--glass:hover { color: var(--fg); border-color: rgba(124, 58, 237, .35); background: var(--glass-hover); }

/* ---------------------------------------------------------------- sections — ambient wash system */
/* Each section carries its own low-opacity radial accent wash: gives the glass
   something to refract and keeps sections distinguishable in dark mode. */
/* Geometry rule: every wash center ± fade·radius stays INSIDE the box (center_x ± F·rx ∈ [0,100],
   center_y ± F·ry ∈ [0,100]) so the tint decays to ZERO before each edge — background-image
   clips at the box and a non-zero value at the boundary reads as a hard cut between sections. */
.section {
	padding-block: var(--section-pad); position: relative;
	background-image:
		radial-gradient(48% 38% at 62% 30%, rgba(124, 58, 237, var(--wash)), transparent 68%),
		radial-gradient(44% 36% at 36% 70%, rgba(37, 99, 235, var(--wash)), transparent 70%);
}
.section.timeline {
	background-image:
		radial-gradient(48% 36% at 50% 32%, rgba(37, 99, 235, var(--wash)), transparent 70%),
		radial-gradient(40% 36% at 64% 68%, rgba(8, 145, 178, var(--wash)), transparent 72%);
}
.section.expertise {
	background-image:
		radial-gradient(48% 42% at 62% 34%, rgba(8, 145, 178, var(--wash)), transparent 70%),
		radial-gradient(40% 34% at 66% 72%, rgba(124, 58, 237, calc(var(--wash) * 0.8)), transparent 72%);
}
.section.portfolio {
	background-image: radial-gradient(46% 40% at 64% 70%, rgba(37, 99, 235, var(--wash)), transparent 70%);
}
.section.inspiration {
	background-image: radial-gradient(44% 38% at 38% 70%, rgba(124, 58, 237, var(--wash)), transparent 70%);
}
.section.contact { background-image: radial-gradient(50% 46% at 50% 64%, rgba(124, 58, 237, var(--wash)), transparent 72%); }
.section + .section::before {
	content: ""; position: absolute; top: 0; inset-inline: 0; height: 1px;
	background: linear-gradient(to right, transparent, rgba(124, 58, 237, .28), transparent);
}
html[data-theme="dark"] .section + .section::before {
	background: linear-gradient(to right, transparent, rgba(139, 92, 246, .4), transparent);
}
.section--tight { padding-block: 64px; }
.section-more { margin-top: 34px; }
.link-more { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; }
.link-more .icon { width: 18px; height: 18px; transition: transform .2s ease; }
.link-more:hover .icon { transform: translateX(4px); }
html[dir="rtl"] .link-more .icon { transform: scaleX(-1); }
html[dir="rtl"] .link-more:hover .icon { transform: scaleX(-1) translateX(4px); }

.x-icon { color: var(--text-secondary); margin-bottom: 10px; display: inline-flex; }
.x-icon svg { width: 30px; height: 30px; }
.x-card:hover .x-icon { color: var(--accent-violet); }
.x-title, .proj-title { font-size: 18px; font-weight: 600; }
html[dir="rtl"] .x-title, html[dir="rtl"] .proj-title { font-size: 19px; }
.x-desc, .proj-desc { font-size: 14px; color: var(--text-muted); }
/* equal-height cards: stack content, pin the last row to the bottom */
.x-card, .proj-card, .post-card { display: flex; flex-direction: column; }
.x-card > :last-child, .proj-card > :last-child, .post-card > :last-child { margin-top: auto; padding-top: 12px; }

.card-cover-wrap { margin: -24px -24px 18px; border-radius: var(--radius-md) var(--radius-md) 0 0; overflow: hidden; }
.pub-art { display: block; height: 120px; margin: -24px -24px 18px; border-radius: var(--radius-md) var(--radius-md) 0 0; background: center/contain no-repeat; }
.pub-art--a { background-image: url('../img/art/pub-a.webp'); }
.pub-art--b { background-image: url('../img/art/pub-b.webp'); }
.card-cover { aspect-ratio: 8 / 5; width: 100%; }
.card-cover__img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 8 / 5; }
.card-cover--art { height: 100%; min-height: 160px; background: center/contain no-repeat; }
.card-cover--art.art-a { background-image: url('../img/art/proj-a.webp'); }
.card-cover--art.art-b { background-image: url('../img/art/proj-b.webp'); }

/* pub card (archive) */
.pub-year {
	display: inline-block; color: #fff;
	background: linear-gradient(135deg, #2563eb, #7c3aed); /* no cyan end: keeps white-on-fill ≥5.2:1 at 12px */
	border-radius: var(--radius-full); padding: 4px 12px; font-size: 12px; margin: 0 0 10px;
}
.pub-year .icon { width: 13px; height: 13px; vertical-align: -2px; margin-inline-end: 5px; opacity: .9; }
[dir="rtl"] .pub-year .icon { margin-inline-end: 0; margin-inline-start: 5px; }
.post-card__foot .icon { width: 13px; height: 13px; vertical-align: -2px; margin-inline-end: 5px; color: var(--accent-cyan); }
.pub-journal { margin-bottom: 8px; }
.pub-title { font-size: 18px; font-weight: 600; }
html[dir="rtl"] .pub-title { font-size: 19px; }
.pub-insight { font-size: 14px; color: var(--text-muted); }
.pub-authors { margin-bottom: 6px; }
.pub-link { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; margin-top: 10px; }
.pub-link .icon { width: 16px; height: 16px; transition: transform .2s; }
a.glass-card:hover .pub-link .icon { transform: translateX(4px); }
html[dir="rtl"] .pub-link .icon { transform: scaleX(-1); }
html[dir="rtl"] a.glass-card:hover .pub-link .icon { transform: scaleX(-1) translateX(4px); }

/* pub ledger (home) — academic manuscript rows */
.pub-ledger { border-top: 1px solid var(--surface-border); }
.pub-row {
	display: grid; grid-template-columns: 84px minmax(0, 1fr) 32px; gap: 22px; align-items: center;
	padding: 22px 10px; border-bottom: 1px solid var(--surface-border); color: inherit; position: relative;
	transition: background-color .2s ease, padding .2s ease;
}
.pub-row::before {
	content: ""; position: absolute; inset-inline-start: 0; bottom: -1px; height: 2px; width: 0;
	background: var(--gradient); transition: width .35s ease;
}
.pub-row:hover { background: linear-gradient(90deg, var(--glass-bg), transparent 75%); padding-inline-start: 22px; padding-inline-end: 0; }
html[dir="rtl"] .pub-row:hover { background: linear-gradient(-90deg, var(--glass-bg), transparent 75%); }
.pub-row:hover::before { width: 100%; }
.pub-row__year { font-size: 15px; font-weight: 500; color: var(--text-faint); align-self: start; padding-top: 4px; transition: color .2s ease; }
.pub-row:hover .pub-row__year { color: var(--accent-violet); }
.pub-row__body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pub-row__journal { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
html[dir="rtl"] .pub-row__journal { letter-spacing: 0; text-transform: none; font-size: 13px; }
.pub-row__title { font-size: 19px; font-weight: 600; color: var(--fg); line-height: 1.35; }
html[dir="rtl"] .pub-row__title { font-size: 20px; }
.pub-row__insight { font-size: 14px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pub-row__go { color: var(--text-faint); transition: color .2s ease, transform .2s ease; }
.pub-row__go .icon { width: 18px; height: 18px; }
html[dir="rtl"] .pub-row__go .icon { transform: scaleX(-1); }
.pub-row:hover .pub-row__go { color: var(--accent-blue); transform: translateX(4px); }
html[dir="rtl"] .pub-row:hover .pub-row__go { transform: none; }
html[dir="rtl"] .pub-row:hover .pub-row__go .icon { transform: scaleX(-1) translateX(4px); }

/* post card */
.post-card__meta { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.badge {
	display: inline-flex; align-items: center; gap: 4px;
	font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
	padding: 3px 10px; border-radius: var(--radius-full);
	background: var(--glass-hover); border: 1px solid var(--glass-border); color: var(--text-secondary);
}
html[dir="rtl"] .badge { letter-spacing: 0; text-transform: none; font-size: 12px; }
.badge--insp { background: var(--gradient); border: 0; color: #fff; }
.badge--insp .icon { width: 12px; height: 12px; }
.badge--grad { background: var(--gradient); border: 0; color: #fff; }
.post-card__title { font-size: 18px; font-weight: 600; }
html[dir="rtl"] .post-card__title { font-size: 19px; }
.post-card__excerpt { font-size: 14px; color: var(--text-muted); }
.post-card__foot { margin: 12px 0 0; }

/* ---------------------------------------------------------------- timeline */
.timeline-track { position: relative; max-width: 900px; margin-inline: auto; padding-block: 8px; }
.timeline-track::before {
	content: ""; position: absolute; inset-inline-start: 50%; top: 0; bottom: 0; width: 2px;
	background: var(--gradient); transform: translateX(-50%);
}
.t-card {
	position: relative; width: calc(50% - 40px); margin-bottom: 40px;
	background: linear-gradient(180deg, var(--glass-bg), var(--glass-bg-2));
	border: 1px solid var(--glass-border);
	border-radius: var(--radius-md); padding: 22px 24px;
	box-shadow: var(--glass-specular);
	backdrop-filter: blur(14px) saturate(1.35);
	-webkit-backdrop-filter: blur(14px) saturate(1.35);
}
.t-tile { display: block; height: 120px; margin-bottom: 14px; border-radius: calc(var(--radius-md) - 6px); background: center/contain no-repeat; border: 1px solid var(--surface-border); }
.t-tile--e1 { background-image: url('../img/art/tl-era-1.webp'); }
.t-tile--e2 { background-image: url('../img/art/tl-era-2.webp'); }
.t-tile--e3 { background-image: url('../img/art/tl-era-3.webp'); }
.about-band { position: relative; }
.about-band::before { content: ''; position: absolute; inset: auto 0 -40px 0; height: 320px; background: url('../img/art/band-about.webp') center/cover no-repeat; opacity: .16; pointer-events: none; }
/* RTL: mirror the DIRECTIONAL decorative art (measured 53-97% asymmetric ink).
   Photos (portrait, covers) are NEVER mirrored. These elements carry no other transform. */
html[dir="rtl"] .about-band::before,
html[dir="rtl"] .pub-art--a, html[dir="rtl"] .pub-art--b,
html[dir="rtl"] .card-cover--art.art-a, html[dir="rtl"] .card-cover--art.art-b,
html[dir="rtl"] .t-tile--e1, html[dir="rtl"] .t-tile--e2, html[dir="rtl"] .t-tile--e3 { transform: scaleX(-1); }
/* hero ring: compose the centering translate — never replace it (over-constraint collapse) */
html[dir="rtl"] .hero-fig__art { transform: scaleX(-1); }
html[data-theme="dark"] .about-band::before { opacity: .12; }
.t-card--left { margin-inline-end: auto; text-align: end; }
.t-card--right { margin-inline-start: auto; }
.t-node {
	position: absolute; top: 26px; width: 16px; height: 16px; border-radius: 50%;
	background: var(--gradient); border: 4px solid var(--bg);
	box-shadow: 0 8px 16px rgba(37, 99, 235, .25);
}
.t-card--left .t-node { inset-inline-end: -49px; }
.t-card--right .t-node { inset-inline-start: -49px; }
.t-year {
	display: inline-block; background: var(--gradient); color: #fff;
	border-radius: var(--radius-full); padding: 4px 12px; font-size: 12px; margin-bottom: 10px;
}
.t-title { font-size: 17px; font-weight: 600; margin-bottom: 6px; }
html[dir="rtl"] .t-title { font-size: 18px; }
.t-desc { font-size: 14px; color: var(--text-muted); margin: 0; }

/* ---------------------------------------------------------------- about */
.about-grid { display: grid; grid-template-columns: 360px 1fr; gap: 56px; align-items: center; }
.about-photo img {
	width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: var(--radius-lg);
	padding: 3px; background: var(--gradient);
	box-shadow: 0 0 30px rgba(37, 99, 235, .2), 0 0 60px rgba(124, 58, 237, .1);
}
.about-band .about-photo img { aspect-ratio: 1 / 1; }
.about-lead { font-size: 18px; }
.about-meta { font-size: 12px; color: var(--text-muted); letter-spacing: .05em; }
html[dir="rtl"] .about-meta { letter-spacing: 0; }
.about-name { font-size: 30px; }

/* ---------------------------------------------------------------- contact band */
.contact-band { display: flex; gap: 32px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.contact-lead { font-size: 17px; max-width: 520px; margin: 0; }
.contact-band__actions { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.contact-band__social { display: flex; gap: 10px; }
.social-btn {
	display: inline-flex; align-items: center; justify-content: center;
	width: 40px; height: 40px; border-radius: var(--radius-full);
	background: var(--glass-bg); border: 1px solid var(--glass-border); color: var(--text-secondary);
	transition: color .2s, border-color .2s, transform .2s;
}
.social-btn:hover { color: var(--fg); border-color: rgba(124, 58, 237, .35); transform: translateY(-2px); }
.social-btn .icon { width: 18px; height: 18px; }

.contact-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 32px; align-items: start; }

/* ---------------------------------------------------------------- forms */
.contact-form .form-row { margin: 0 0 18px; }
.contact-form label { display: block; font-size: 14px; font-weight: 600; color: var(--fg); margin-bottom: 8px; }
.contact-form input, .contact-form textarea {
	width: 100%; padding: 12px 16px; border-radius: var(--radius-sm);
	border: 1px solid var(--glass-border); background: var(--input-bg);
	color: var(--fg); font: inherit; transition: border-color .2s, box-shadow .2s;
}
.contact-form input:focus, .contact-form textarea:focus {
	outline: none; border-color: var(--accent-blue);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}
.form-row--submit { margin-bottom: 0; }
.form-success h2 { font-size: 22px; }
.form-error { display: flex; align-items: center; gap: 8px; margin: 0 0 18px; padding: 12px 16px; border: 1px solid rgb(220 38 38 / .35); border-radius: 10px; background: rgb(220 38 38 / .07); color: #b91c1c; font-size: 14px; }
.form-error svg { width: 16px; height: 16px; flex-shrink: 0; stroke: #dc2626; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
html[data-theme="dark"] .form-error { border-color: rgb(248 113 113 / .35); background: rgb(248 113 113 / .1); color: #f87171; }
html[data-theme="dark"] .form-error svg { stroke: #f87171; }
.contact-form .is-invalid { border-color: #dc2626 !important; }
html[data-theme="dark"] .contact-form .is-invalid { border-color: #f87171 !important; }
.contact-form .is-invalid:focus { outline: 2px solid rgb(220 38 38 / .45); outline-offset: 1px; }
.field-error { margin: 6px 0 0; color: #dc2626; font-size: 13px; line-height: 1.4; }
html[data-theme="dark"] .field-error { color: #f87171; }

.filter-bar { display: flex; gap: 10px; margin-bottom: 22px; }
.filter-bar--big { max-width: 560px; }
.filter-search {
	flex: 1; padding: 12px 18px; border-radius: var(--radius-full);
	border: 1px solid var(--glass-border); background: var(--input-bg); color: var(--fg); font: inherit;
}
.filter-search:focus { outline: none; border-color: var(--accent-blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 34px; }
.chip {
	display: inline-flex; align-items: center; gap: 4px;
	padding: 7px 16px; border-radius: var(--radius-full); font-size: 13px; font-weight: 500;
	background: var(--glass-bg); border: 1px solid var(--glass-border); color: var(--text-secondary);
	transition: color .2s ease, border-color .2s ease, background-color .2s ease, transform .15s ease;
}
.chip:hover { color: var(--fg); border-color: rgba(124, 58, 237, .35); }
.chip:active { transform: scale(.96); }
.chip--active { background: var(--gradient); border-color: transparent; color: #fff; }
.chip--sm { padding: 4px 12px; font-size: 12px; }

/* ---------------------------------------------------------------- page hero / prose */
.page-hero { padding: 150px 0 26px; }
.page-hero--post { padding-bottom: 34px; }
.breadcrumb { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-muted); margin-bottom: 18px; flex-wrap: wrap; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent-blue); }
.crumb-current { overflow-wrap: anywhere; }
.page-hero .section-title { margin-bottom: 10px; }
.post-meta { color: var(--text-muted); font-size: 12px; letter-spacing: .05em; margin: 0; }
html[dir="rtl"] .post-meta { letter-spacing: 0; }
.post-badges { display: flex; gap: 8px; margin-bottom: 16px; }
.pub-badges { display: flex; gap: 8px; margin-bottom: 16px; }
.post-cover { border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 40px; }
.post-cover img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }

.prose { max-width: 760px; }
.prose p { text-wrap: pretty; }
.prose--post { margin-inline: auto; font-size: 17px; }
html[dir="rtl"] .prose--post { font-size: 18px; }
.prose h2 { font-size: 26px; margin-top: 1.6em; }
.prose h3 { font-size: 20px; margin-top: 1.4em; }
.prose a { text-decoration: underline; text-underline-offset: 3px; }
.prose blockquote {
	margin: 1.4em 0; padding: 4px 22px; border-inline-start: 3px solid var(--accent-violet);
	background: var(--glass-bg); border-radius: var(--radius-sm); color: var(--text-muted);
}
.prose img { border-radius: var(--radius-md); }
.prose pre { background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: var(--radius-md); padding: 18px; overflow-x: auto; }

.post-foot { margin-top: 44px; display: flex; flex-direction: column; gap: 26px; }
.post-tags { display: flex; gap: 8px; flex-wrap: wrap; margin: 0; }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.post-nav__col { min-width: 0; }
.post-nav__tag { display: flex; align-items: center; gap: 6px; margin: 0 0 10px; color: var(--text-faint); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
html[dir="rtl"] .post-nav__tag { letter-spacing: 0; }
.post-nav__tag svg { width: 14px; height: 14px; flex-shrink: 0; }
html[dir="rtl"] .post-nav__tag svg { transform: scaleX(-1); }
.post-nav__col--next .post-nav__tag { justify-content: flex-end; }
@media (max-width: 640px) { .post-nav { grid-template-columns: 1fr; } }

/* search page */
.search-summary { font-size: 15px; color: var(--text-muted); }
.search-group { margin-bottom: 56px; }
.search-group__title { font-size: 20px; }
.empty-state { color: var(--text-muted); font-size: 16px; padding: 40px 0; }

/* pagination */
.nav-links { display: flex; gap: 8px; margin-top: 44px; flex-wrap: wrap; }
.page-numbers {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 38px; height: 38px; padding: 0 12px; border-radius: var(--radius-full);
	border: 1px solid var(--glass-border); background: var(--glass-bg); color: var(--text-secondary); font-size: 14px;
}
.page-numbers.current { background: var(--gradient); border-color: transparent; color: #fff; }
a.page-numbers:hover { color: var(--fg); border-color: rgba(124, 58, 237, .35); }

/* pub detail */
.pub-details { margin-top: 40px; display: flex; flex-direction: column; gap: 10px; }
.pub-detail { margin: 0; color: var(--text-secondary); }
.pub-detail__label { font-weight: 600; color: var(--fg); margin-inline-end: 8px; }
.proj-chips { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- footer */
.site-footer { border-top: 1px solid var(--surface-border); padding: 56px 0 32px; position: relative; }
.site-footer::before {
	content: ""; position: absolute; top: -1px; inset-inline: 24%; height: 1px;
	background: linear-gradient(to right, transparent, rgba(124, 58, 237, .35), transparent);
}
.footer-top { display: flex; justify-content: space-between; align-items: center; gap: 30px; flex-wrap: wrap; }
.footer-name { font-weight: 600; color: var(--fg); margin: 8px 0 2px; }
.footer-affiliation { color: var(--text-muted); font-size: 14px; margin: 0; }
.footer-social { display: flex; gap: 10px; }
.footer-bottom {
	display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
	margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--surface-border);
	color: var(--text-muted); font-size: 13px;
}
.footer-bottom p { margin: 0; }
.footer-locale a { color: var(--text-muted); }
.footer-locale a:hover { color: var(--accent-blue); }

/* ---------------------------------------------------------------- reveal */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal, html.no-js .reveal { opacity: 1; transform: none; }
/* card grids: gentle stagger */
.grid > .reveal:nth-child(2) { transition-delay: .09s; }
.grid > .reveal:nth-child(3) { transition-delay: .18s; }
.grid > .reveal:nth-child(4) { transition-delay: .27s; }
/* timeline cards: alternate stagger */
.t-card.reveal.t-card--right { transition-delay: .08s; }

/* hero entrance cascade (subtle; disabled for reduced-motion below) */
@keyframes hero-rise { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes hero-fig-in { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
/* ring settles with a partial spin on load — the standalone `rotate` property composes
   with the translate/scaleX(-1) transform (never replaced); opacity untouched so the
   dark-mode .24 override keeps winning. */
@keyframes hero-ring-in { from { rotate: -40deg; } to { rotate: 0deg; } }
/* `backwards` (not `both`): the entrance's end state equals the cascade state, and a
   persistent fill would animation-override the hover `rotate` below forever. */
.hero-fig__art { animation: hero-ring-in 1.1s cubic-bezier(.22, .61, .36, 1) .15s backwards; transition: rotate .9s cubic-bezier(.22, .61, .36, 1); }
.hero-fig:hover .hero-fig__art { rotate: 40deg; }
.hero-fig { animation: hero-fig-in .8s ease .04s both; }
.hero-name { animation: hero-rise .65s ease .16s both; }
.hero-subtitle { animation: hero-rise .65s ease .24s both; }
.hero-bio { animation: hero-rise .65s ease .32s both; }
.hero-cta { animation: hero-rise .65s ease .4s both; }
.hero-meta { animation: hero-rise .65s ease .48s both; }
.scroll-hint { animation: hero-rise .65s ease .6s both; }

/* timeline spine progress fill (driven by --tl-progress from main.js) */
.timeline-track::after {
	content: ""; position: absolute; inset-inline-start: 50%; top: 0; width: 2px;
	height: calc(var(--tl-progress, 0) * 100%); transform: translateX(-50%);
	background: var(--fg); opacity: .35; border-radius: 2px;
}
@media (prefers-reduced-motion: reduce) {
	.reveal { opacity: 1; transform: none; transition: none; }
	.orb, .scroll-hint { animation: none; }
	.hero-name, .hero-subtitle, .hero-bio, .hero-cta, .hero-meta, .hero-fig, .hero-fig__art { animation: none; }
	.hero-fig__art { transition: none; }
	html { scroll-behavior: auto; }
}

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1024px) {
	.grid--3 { grid-template-columns: repeat(2, 1fr); }
	.about-grid { grid-template-columns: 300px 1fr; gap: 36px; }
}
@media (max-width: 900px) {
	.site-nav { display: none; }
	.nav-burger { display: inline-flex; }
}
@media (max-width: 768px) {
	:root { --section-pad: 72px; }
	.grid--2, .grid--3 { grid-template-columns: 1fr; }
	.about-grid { grid-template-columns: 1fr; }
	.about-photo { max-width: 340px; }
	.contact-grid { grid-template-columns: 1fr; }
	.contact-band { flex-direction: column; align-items: flex-start; }
	/* timeline stacks */
	.timeline-track::before { inset-inline-start: 10px; }
	.t-card, .t-card--left, .t-card--right { width: 100%; margin-inline: 0; text-align: start; }
	.t-card--left .t-node, .t-card--right .t-node { inset-inline-start: 2px; inset-inline-end: auto; }
	.page-hero { padding-top: 120px; }
	/* pub ledger compresses */
	.pub-row { grid-template-columns: 56px minmax(0, 1fr) 24px; gap: 14px; padding: 18px 4px; }
	.pub-row__year { font-size: 13px; }
	.pub-row__title { font-size: 17px; }
	.pub-row__insight { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
	.pub-row:hover { padding-inline-start: 12px; }
}
@media (max-width: 560px) {
	.hero { padding-top: 120px; }
	.hero-fig { margin-bottom: 78px; }
	.hero-fig img { width: 170px; height: 170px; }
	.header-inner { gap: 12px; }
}
@media (max-width: 360px) {
	.header-actions .header-cta { display: none; } /* overlay CTA covers it; .header-actions prefix out-specifies .btn; floor=360 = logo+CTA+3×44 icons+gaps */
}
