/* ==========================================================================
   basemsayej.com — 2026 redesign
   ========================================================================== */

:root {
	--ink: #0c0b0b;
	--ink-2: #151313;
	--paper: #f1ece4;
	--muted: #8a8580;
	--line: rgba(241, 236, 228, .14);
	--accent: #c8243f;      /* evolved from the original #b12d45 */
	--display: "Anton", "Impact", sans-serif;
	--sans: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
	--arabic: "Mirza", "Geeza Pro", serif;
	--pad: clamp(1.25rem, 4vw, 3.5rem);
	--ease: cubic-bezier(.7, 0, .2, 1);
}

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

html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
	margin: 0;
	background: var(--ink);
	color: var(--paper);
	font-family: var(--sans);
	font-weight: 400;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}

body.is-loading { overflow: hidden; }

/* film grain */
body::after {
	content: "";
	position: fixed;
	inset: -50%;
	z-index: 90;
	pointer-events: none;
	opacity: .07;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
	animation: grain 1s steps(6) infinite;
}

@keyframes grain {
	0% { transform: translate(0, 0); }
	20% { transform: translate(-3%, 2%); }
	40% { transform: translate(2%, -4%); }
	60% { transform: translate(-4%, -2%); }
	80% { transform: translate(3%, 3%); }
	100% { transform: translate(0, 0); }
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
img { display: block; max-width: 100%; }
::selection { background: var(--accent); color: var(--paper); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.eyebrow {
	margin: 0 0 clamp(2rem, 5vw, 4rem);
	font-size: .8rem;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--muted);
}

/* ---------- Curtain (intro) ---------- */
.curtain {
	position: fixed;
	inset: 0;
	z-index: 100;
	display: grid;
	place-items: end start;
	padding: var(--pad);
	background: var(--accent);
	color: var(--ink);
}

.curtain__count {
	font-family: var(--display);
	font-size: clamp(5rem, 18vw, 16rem);
	line-height: .8;
}

/* ---------- Cursor ---------- */
.cursor {
	position: fixed;
	top: 0;
	left: 0;
	z-index: 95;
	width: 14px;
	height: 14px;
	translate: -50% -50%; /* centred on the pointer whatever its size */
	border-radius: 50%;
	background: var(--paper);
	pointer-events: none;
	mix-blend-mode: difference;
	display: grid;
	place-items: center;
	transition: width .35s var(--ease), height .35s var(--ease), padding .35s var(--ease), background-color .35s;
	will-change: transform;
}

.cursor__label {
	font-size: .7rem;
	font-weight: 600;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--ink);
	opacity: 0;
	transition: opacity .2s;
}

.cursor.is-hover { width: 64px; height: 64px; }
.cursor.is-label { width: auto; min-width: 84px; height: 84px; padding: 0 18px; border-radius: 999px; mix-blend-mode: normal; background: var(--accent); }
.cursor__label { white-space: nowrap; }
.cursor.is-label .cursor__label { opacity: 1; color: var(--paper); }

@media (hover: none), (pointer: coarse) {
	.cursor { display: none; }
}

@media (hover: hover) and (pointer: fine) {
	html, a, button { cursor: none; }
}

/* ---------- Nav ---------- */
.nav {
	position: fixed;
	inset: 0 0 auto 0;
	z-index: 50;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 1.25rem var(--pad);
	mix-blend-mode: difference;
	color: var(--paper);
}

.nav__mark span {
	display: grid;
	place-items: center;
	width: 2.75rem;
	height: 2.75rem;
	border: 1px solid currentColor;
	border-radius: 50%;
	font-family: var(--display);
	font-size: 1rem;
	letter-spacing: .04em;
}

.nav__links { display: flex; gap: clamp(1rem, 3vw, 2.5rem); font-size: .9rem; }

.nav__links a { position: relative; }
.nav__links a::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: -2px;
	height: 1px;
	background: currentColor;
	transform: scaleX(0);
	transform-origin: right;
	transition: transform .5s var(--ease);
}
.nav__links a:hover::after { transform: scaleX(1); transform-origin: left; }

.nav__sound {
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	border: 1px solid rgba(241, 236, 228, .3);
	border-radius: 50%;
	font-size: .85rem;
	transition: background-color .3s, color .3s;
}

.nav__sound:hover { background: var(--paper); color: var(--ink); }

.nav__tools { display: flex; align-items: center; gap: .75rem; }

.nav__lang {
	display: grid;
	place-items: center;
	min-width: 38px;
	height: 38px;
	padding: 0 .7rem;
	border: 1px solid rgba(241, 236, 228, .3);
	border-radius: 999px;
	font-size: .85rem;
	font-weight: 500;
	transition: background-color .3s, color .3s;
}

.nav__lang:hover { background: var(--paper); color: var(--ink); }
.nav__lang[lang="ar"] { font-family: "Mirza", var(--sans); }

@media (max-width: 720px) {
	.nav__links { display: none; }
}

/* ---------- Hero ---------- */
.hero {
	position: relative;
	height: 100vh;
	height: 100svh;
	min-height: 560px;
	overflow: hidden;
	isolation: isolate;
	background: var(--ink);
}

.hero__base {
	position: absolute;
	inset: 0;
	display: grid;
	grid-template-rows: auto 1fr auto;
	padding: calc(5.5rem + 1vh) var(--pad) var(--pad);
}

.hero__liquid {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	z-index: 2;
	pointer-events: none;
}

.hero__kicker {
	margin: 0;
	font-size: .85rem;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--muted);
	justify-self: start;
}

.hero__title {
	align-self: center;
	margin: 0;
	font-family: var(--display);
	font-weight: 400;
	font-size: clamp(5.5rem, 24vw, 26rem);
	line-height: .82;
	letter-spacing: -.01em;
	text-transform: uppercase;
	position: relative;
	z-index: 1;
}

.hero__line { display: block; overflow: hidden; padding-bottom: .02em; }
.hero__line--r { text-align: right; }
.hero__word { display: inline-block; }

.hero__portrait {
	position: absolute;
	left: 50%;
	top: 52%;
	z-index: 0;
	--pw: min(46vh, 42vw);
	width: var(--pw);
	margin: calc(var(--pw) / -2) 0 0 calc(var(--pw) / -2);
	pointer-events: none;
	mix-blend-mode: screen;
}

.hero__portrait img {
	width: 100%;
	height: auto;
	/* black-on-white stencil → light-on-dark, white disappears */
	filter: invert(1) contrast(1.2);
	opacity: .9;
}

.hero__foot {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: end;
	gap: 1rem;
	font-size: clamp(1rem, 1.6vw, 1.35rem);
	position: relative;
	z-index: 1;
}

.hero__foot p { margin: 0; justify-self: start; }
.hero__foot p:last-child { justify-self: end; text-align: right; }

.hero__hint {
	display: inline-flex;
	align-items: center;
	gap: .5rem;
	font-size: .75rem;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--muted);
	justify-self: center !important;
}

.hero__hint .dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--accent);
	animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
	0%, 100% { transform: scale(1); opacity: 1; }
	50% { transform: scale(1.8); opacity: .4; }
}

@media (max-width: 720px) {
	.hero__portrait { --pw: 70vw; top: 50%; }
	.hero__foot { grid-template-columns: 1fr; }
	.hero__foot p { white-space: nowrap; }
	.hero__hint { display: none; }
}

/* ---------- Marquee ---------- */
.marquee {
	overflow: hidden;
	border-block: 1px solid var(--line);
	padding: 1.1rem 0;
	background: var(--ink-2);
}

.marquee__track {
	display: flex;
	width: max-content;
	align-items: center;
	gap: 2.5rem;
	font-family: var(--display);
	font-size: clamp(2rem, 5vw, 4rem);
	text-transform: uppercase;
	line-height: 1;
	animation: marquee 28s linear infinite;
}

/* separators: red triangles, alternating up / down */
.marquee__track i {
	display: block;
	flex: none;
	width: .56em;
	height: .48em;
	background: var(--accent);
	clip-path: polygon(50% 0, 100% 100%, 0 100%);
}
.marquee__track i:nth-of-type(even) { transform: rotate(180deg); }
.marquee__track [lang="ar"] { font-family: var(--arabic); direction: rtl; unicode-bidi: isolate; }

@keyframes marquee { to { transform: translateX(-50%); } }

/* While Mesh Fann plays, the marquee swaps to the recording note */
.marquee { position: relative; }
.marquee__track { transition: opacity .6s var(--ease), transform .6s var(--ease); }
.marquee__track--tune {
	position: absolute;
	inset: 50% auto auto 0;
	margin-top: -.5em;
	opacity: 0;
	color: var(--accent);
	animation-duration: 40s;
	pointer-events: none;
}
.tune-on .marquee__track:not(.marquee__track--tune) { opacity: 0; }
.tune-on .marquee__track--tune { opacity: 1; }

/* ---------- About ---------- */
.about, .work, .contact { padding: clamp(5rem, 14vw, 11rem) var(--pad); }

.about__lead {
	max-width: 22ch;
	margin: 0;
	font-size: clamp(2rem, 5.2vw, 4.75rem);
	line-height: 1.04;
	font-weight: 300;
	letter-spacing: -.025em;
}

.about__lead em { font-style: italic; color: var(--accent); }

.about__lead .line { overflow: hidden; }

.about__grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1.5rem;
	margin-top: clamp(4rem, 9vw, 8rem);
	border-top: 1px solid var(--line);
	padding-top: 2rem;
}

.stat__num, .stat__plus {
	font-family: var(--display);
	font-size: clamp(3.5rem, 9vw, 8rem);
	line-height: .9;
}

.stat__plus { color: var(--accent); }
.stat__label { display: block; margin-top: .75rem; color: var(--muted); font-size: .95rem; }

@media (max-width: 720px) {
	.about__grid { grid-template-columns: 1fr; }
}

/* ---------- Work ---------- */
.work { padding-top: 0; }
.marquee + .work { padding-top: clamp(5rem, 14vw, 11rem); }

.work__list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }

.work__item { border-bottom: 1px solid var(--line); }

.work__item > a,
.work__item > button {
	position: relative;
	display: grid;
	grid-template-columns: 4rem 1.2fr 1fr 3rem;
	align-items: center;
	gap: 1.5rem;
	width: 100%;
	padding: clamp(1.75rem, 3.5vw, 2.75rem) 0;
	overflow: hidden;
	isolation: isolate;
	transition: color .5s var(--ease), padding .5s var(--ease);
}

/* liquid fill on hover */
.work__item > a::before,
.work__item > button::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: var(--accent);
	clip-path: inset(100% 0 0 0);
	transition: clip-path .6s var(--ease);
}

.work__item > a:hover::before,
.work__item > button:hover::before,
.work__item > button.is-playing::before { clip-path: inset(0 0 0 0); }

.work__item > a:hover,
.work__item > button:hover,
.work__item > button.is-playing { padding-inline: 1.5rem; }

.work__no { font-size: .85rem; color: var(--muted); transition: color .5s; }
.work__item :hover .work__no, .work__item > :hover .work__no, .is-playing .work__no { color: var(--paper); }

.work__title {
	font-family: var(--display);
	font-size: clamp(2.25rem, 5.5vw, 5rem);
	line-height: .95;
	text-transform: uppercase;
}

.work__ar {
	display: inline-block;
	margin-inline-start: .35em;
	font-family: var(--arabic);
	font-size: .55em;
	vertical-align: middle;
	color: var(--accent);
	transition: color .5s;
}

.work__item > a:hover .work__ar { color: var(--ink); }

.work__desc { color: var(--muted); font-size: 1.05rem; max-width: 36ch; transition: color .5s; }
.work__item > :hover .work__desc, .is-playing .work__desc { color: var(--paper); }

.work__note { display: block; margin-top: .5rem; font-style: italic; font-size: .9rem; max-height: 0; opacity: 0; overflow: hidden; transition: max-height .6s var(--ease), opacity .4s; }
.work__note a { text-decoration: underline; text-underline-offset: 3px; }
.is-playing .work__note { max-height: 4rem; opacity: 1; }

.work__arrow {
	grid-column: -2; /* always the last column, even in a row without a description */
	justify-self: end;
	font-size: 2rem;
	line-height: 1;
	transition: transform .5s var(--ease);
}

.work__item > a:hover .work__arrow { transform: rotate(45deg); }

/* broken heart = sound off, whole heart = sound on (as on akherzapheer.com) */
.heart .on { display: none; }
.is-playing.heart .off, .is-playing .heart .off { display: none; }
.is-playing.heart .on, .is-playing .heart .on { display: block; animation: beat 1s ease-in-out infinite; }
.work__arrow.heart { font-size: 1.75rem; }

@keyframes beat {
	0%, 100% { transform: scale(1); }
	15% { transform: scale(1.18); }
	30% { transform: scale(1); }
	45% { transform: scale(1.12); }
}

@media (max-width: 720px) {
	.work__item > a,
	.work__item > button { grid-template-columns: 2rem minmax(0, 1fr) 2rem; gap: .5rem 1rem; }
	.work__title { font-size: clamp(1.75rem, 9vw, 2.25rem); overflow-wrap: anywhere; }
	.work__desc { grid-column: 2 / 3; grid-row: 2; }
	.work__arrow { grid-column: 3; grid-row: 1; }
}

/* ---------- Contact ---------- */
.contact { border-top: 1px solid var(--line); overflow: hidden; } /* title slides in from off-screen */

.contact__title {
	margin: 0;
	font-family: var(--display);
	font-weight: 400;
	font-size: clamp(6rem, 25vw, 24rem);
	line-height: .82;
	text-transform: uppercase;
}

.contact__title span { display: block; }
.contact__title-r { text-align: right; }
.contact__title em { font-style: normal; color: var(--accent); }

.contact__sub { max-width: 32ch; margin: 3rem 0 2rem; font-size: clamp(1.15rem, 2vw, 1.6rem); color: var(--muted); }

.contact__links { display: flex; flex-wrap: wrap; gap: .75rem; }

.pill {
	display: inline-flex;
	align-items: center;
	gap: .75rem;
	padding: 1rem 1.75rem;
	border: 1px solid var(--line);
	border-radius: 999px;
	font-size: 1.05rem;
	transition: background-color .4s var(--ease), color .4s var(--ease), border-color .4s;
}

.pill:hover { background: var(--paper); color: var(--ink); border-color: var(--paper); }

/* ---------- Footer ---------- */
.foot {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	padding: 1.75rem var(--pad);
	border-top: 1px solid var(--line);
	font-size: .85rem;
	color: var(--muted);
}

.foot p { margin: 0; }
.foot a:hover { color: var(--paper); }

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
	.curtain { display: none; }
	body.is-loading { overflow: auto; }
}
