/* ==========================================================
   The Address Investments — bio page
   Black, white and grey. Gotham (Montserrat until uploaded).
   A framed page, a two-column desktop layout, named link rows,
   and one interactive detail: light that follows the cursor
   across an architectural grid.
   ========================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body.tai {
	--pad: clamp(14px, 2.4vw, 28px);
	--ease: cubic-bezier(.22, .61, .36, 1);
	margin: 0;
	min-height: 100vh;
	min-height: 100svh;
	background: var(--b-bg);
	color: var(--b-text);
	font-family: var(--f-body);
	font-size: 15px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	overflow-x: hidden;
}

/* ---------- Background layers ---------- */

.tai__photo {
	position: fixed; inset: 0; z-index: 0;
	background-size: cover; background-position: center;
}
.tai__photo.is-mono { filter: grayscale(1) contrast(1.05); }
.tai__photo::after {
	content: ""; position: absolute; inset: 0;
	background: var(--b-bg); opacity: var(--t-overlay, .78);
}

/* Six-module facade grid. A faint base, plus a brighter copy revealed around the cursor. */
.tai__grid {
	--mx: 50%; --my: 40%;
	position: fixed; z-index: 0; pointer-events: none; display: none;
	/* Same box as the frame, so grid lines and content share one measure. */
	inset: calc(var(--pad) + env(safe-area-inset-top)) calc(var(--pad) + env(safe-area-inset-right)) calc(var(--pad) + env(safe-area-inset-bottom)) calc(var(--pad) + env(safe-area-inset-left));
}
.has-grid .tai__grid { display: block; }
.tai__grid::before,
.tai__grid::after {
	content: ""; position: absolute; inset: 0;
	background-image:
		linear-gradient(to right, var(--b-line) 1px, transparent 1px),
		linear-gradient(to bottom, var(--b-line) 1px, transparent 1px);
	background-size: calc(100% / 6) 100%, 100% calc(100% / 4);
}
.tai__grid::before { opacity: .28; }
.tai__grid::after {
	opacity: 0;
	transition: opacity .6s var(--ease);
	-webkit-mask-image: radial-gradient(260px 260px at var(--mx) var(--my), #000, transparent 70%);
	mask-image: radial-gradient(260px 260px at var(--mx) var(--my), #000, transparent 70%);
	background-image:
		radial-gradient(420px 420px at var(--mx) var(--my), rgba(255,255,255,.06), transparent 70%),
		linear-gradient(to right, var(--b-text) 1px, transparent 1px),
		linear-gradient(to bottom, var(--b-text) 1px, transparent 1px);
	background-size: 100% 100%, calc(100% / 6) 100%, 100% calc(100% / 4);
}
.has-spotlight.is-pointer .tai__grid::after { opacity: .5; }

/* ---------- Frame ---------- */

.tai__frame {
	position: relative; z-index: 1;
	min-height: 100vh; min-height: 100svh;
	display: grid;
	grid-template-rows: auto 1fr auto;
	padding: calc(var(--pad) + env(safe-area-inset-top)) calc(var(--pad) + env(safe-area-inset-right)) calc(var(--pad) + env(safe-area-inset-bottom)) calc(var(--pad) + env(safe-area-inset-left));
}
.has-frame .tai__frame::before {
	content: ""; position: absolute; pointer-events: none;
	inset: calc(var(--pad) + env(safe-area-inset-top)) calc(var(--pad) + env(safe-area-inset-right)) calc(var(--pad) + env(safe-area-inset-bottom)) calc(var(--pad) + env(safe-area-inset-left));
	border: 1px solid var(--b-line);
	animation: tai-frame 1.1s var(--ease) both;
}
@keyframes tai-frame { from { clip-path: inset(0 50% 0 50%); } to { clip-path: inset(0 0 0 0); } }

.tai__corners {
	display: flex; justify-content: space-between; gap: 16px;
	padding: 16px 20px;
	color: var(--b-muted);
	font-size: 11px; letter-spacing: .08em;
	font-variant-numeric: tabular-nums;
}
.tai__corners span:empty { display: none; }
.tai__corners--bottom span:only-child { margin-inline-start: auto; }
.tai__time time { color: var(--b-text); margin-inline-start: 6px; }

/* ---------- Main composition ---------- */

.tai__main {
	width: 100%;
	max-width: 1120px;
	margin: 0 auto;
	display: grid;
	align-content: center;
	gap: 48px;
	padding: 40px 20px;
}

.tai__brand { display: flex; flex-direction: column; align-items: center; text-align: center; }
.tai__logo { margin: 0; font: inherit; line-height: 0; }
.tai__logo img { display: block; width: var(--b-logo); max-width: 70vw; height: auto; }
.tai__wordmark {
	display: block;
	font-family: var(--f-head);
	font-weight: 400;
	font-size: clamp(18px, 4.8vw, 26px);
	line-height: 1.35;
	letter-spacing: .32em;
	text-transform: uppercase;
	margin-inline-end: -.32em;
	max-width: 13em;
}
.tai__tagline {
	margin: 28px 0 0;
	max-width: 30ch;
	color: var(--b-muted);
	font-size: 14px;
	line-height: 1.7;
	text-wrap: balance;
}
.tai__sub { margin: 10px 0 0; max-width: 34ch; color: var(--b-muted); font-size: 13px; }

/* ---------- Links ---------- */

.tai__links ul { margin: 0; padding: 0; list-style: none; }
.tai__links a { color: var(--b-text); text-decoration: none; }
.tai__icon { width: 18px; height: 18px; flex: none; }
.tai__links a:focus-visible { outline: 1px solid var(--b-text); outline-offset: 4px; }

/* Named rows */
.tai__links--list { width: 100%; max-width: 460px; margin-inline: auto; }
.tai__links--list li { border-top: 1px solid var(--b-line); }
.tai__links--list li:last-child { border-bottom: 1px solid var(--b-line); }
.tai__links--list a {
	position: relative;
	display: flex; align-items: center; gap: 16px;
	min-height: 64px;
	padding: 0 18px;
	isolation: isolate;
	transition: color .45s var(--ease);
}
.tai__links--list a::before {
	content: ""; position: absolute; inset: 0; z-index: -1;
	background: var(--b-text);
	transform: scaleY(0); transform-origin: bottom;
	transition: transform .45s var(--ease);
}
.tai__name { font-family: var(--f-head); font-size: 14px; font-weight: 500; letter-spacing: .04em; }
.tai__handle {
	margin-inline-start: auto;
	color: var(--b-muted); font-size: 13px;
	overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 55%;
	transition: color .45s var(--ease);
}
.tai__arrow { flex: none; margin-inline-start: auto; transition: transform .45s var(--ease); }
.tai__handle + .tai__arrow { margin-inline-start: 0; }
[dir="rtl"] .tai__arrow { transform: scaleX(-1); }

@media (hover: hover) {
	.tai__links--list a:hover { color: var(--b-bg); }
	.tai__links--list a:hover::before { transform: scaleY(1); }
	.tai__links--list a:hover .tai__handle { color: var(--b-bg); opacity: .6; }
	.tai__links--list a:hover .tai__arrow { transform: translate(2px, -2px); }
	[dir="rtl"] .tai__links--list a:hover .tai__arrow { transform: scaleX(-1) translate(2px, -2px); }
}
.tai__links--list a:active::before { transform: scaleY(1); }
.tai__links--list a:active { color: var(--b-bg); }

/* Framed icon strip */
.tai__links--segmented ul { display: flex; justify-content: center; border: 1px solid var(--b-line); width: max-content; max-width: 100%; margin-inline: auto; }
.tai__links--segmented li + li { border-inline-start: 1px solid var(--b-line); }
.tai__links--segmented a { display: grid; place-items: center; width: min(var(--b-icon), calc((100vw - 80px) / 6)); aspect-ratio: 1; transition: background .3s, color .3s; }
.tai__links--segmented a:hover { background: var(--b-text); color: var(--b-bg); }

/* Icons only */
.tai__links--plain ul { display: flex; justify-content: center; gap: 22px; }
.tai__links--plain a { opacity: .75; transition: opacity .3s; }
.tai__links--plain a:hover { opacity: 1; }

/* ---------- Desktop: two columns split by a hairline ---------- */

@media (min-width: 960px) {
	/* The main row spans the frame, so the centre divider lands on the
	   grid's middle line and text starts on a module line. */
	.tai__main {
		max-width: none;
		grid-template-columns: 1fr 1fr;
		align-content: stretch;
		gap: 0;
		padding: 0;
	}
	.tai__brand {
		align-self: center;
		align-items: flex-start; text-align: start;
		padding: 48px calc(100% / 6) 48px calc(100% / 3);
	}
	.tai__links {
		display: flex; flex-direction: column; justify-content: center;
		padding: 48px calc(100% / 6) 48px calc(100% / 3 - 18px);
		border-inline-start: 1px solid var(--b-line);
	}
	.tai__links--list { max-width: none; }
	.tai__links--segmented ul, .tai__links--plain ul { margin-inline: 0; justify-content: flex-start; }
	.tai__tagline { margin-top: 36px; font-size: 15px; }
	.tai__wordmark { font-size: 26px; }
}

@media (max-width: 599px) {
	.tai__grid::before, .tai__grid::after { background-size: calc(100% / 4) 100%, 100% calc(100% / 4); }
	.tai__grid::after { background-size: 100% 100%, calc(100% / 4) 100%, 100% calc(100% / 4); }
}

/* ---------- Load sequence: frame opens, then content settles ---------- */

.tai__brand, .tai__links li, .tai__corners {
	animation: tai-in .9s var(--ease) both;
}
.tai__brand { animation-delay: .35s; }
.tai__links li { animation-delay: calc(.5s + var(--i, 0) * .07s); }
.tai__corners { animation-delay: .8s; animation-name: tai-fade; }
@keyframes tai-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes tai-fade { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation: none !important; transition: none !important; }
	.tai__grid::after { display: none; }
}
@media (forced-colors: active) {
	.tai__links--list a::before { display: none; }
}

/* Keep grid lines from crossing the link rows (the photo, when used, stays visible). */
body.tai:not(.has-photo) .tai__links--list li,
body.tai:not(.has-photo) .tai__links--segmented ul { background: var(--b-bg); }

/* ---------- Office groups: Egypt / Dubai ---------- */

.tai__switch {
	position: relative;
	display: flex;
	gap: 32px;
	margin-bottom: 28px;
	border-bottom: 1px solid var(--b-line);
}
.tai__switch button {
	appearance: none; background: none; border: 0; border-radius: 0;
	padding: 0 0 14px; margin: 0;
	color: var(--b-muted);
	font-family: var(--f-head); font-size: 13px; font-weight: 500; letter-spacing: .14em;
	cursor: pointer;
	transition: color .35s var(--ease);
}
.tai__switch button[aria-selected="true"], .tai__switch button:hover { color: var(--b-text); }
.tai__switch button:focus-visible { outline: 1px solid var(--b-text); outline-offset: 6px; }
.tai__switch-bar {
	position: absolute; bottom: -1px; left: 0; height: 1px;
	width: var(--bar-w, 0); transform: translateX(var(--bar-x, 0));
	background: var(--b-text);
	transition: transform .45s var(--ease), width .45s var(--ease);
}
.tai__group[hidden] { display: none; }
.tai__links:not(.is-ready) .tai__group + .tai__group { margin-top: 40px; }
.tai__group-title {
	margin: 0 0 14px;
	color: var(--b-muted);
	font-family: var(--f-head); font-size: 13px; font-weight: 500; letter-spacing: .14em;
}

/* Without JavaScript every group is shown, stacked. */
.tai__links.is-tabs:not(.is-ready) .tai__group[hidden] { display: block; margin-top: 40px; }
.tai__links.is-tabs:not(.is-ready) .tai__switch { display: none; }

@media (max-width: 959px) {
	.tai__links { width: 100%; max-width: 460px; margin-inline: auto; }
	.tai__switch { justify-content: center; }
	.tai__links--segmented .tai__group ul, .tai__links--plain .tai__group ul { justify-content: center; }
}

/* Two clocks side by side in the corner. */
.tai__clocks { display: inline-flex; gap: 20px; }
@media (max-width: 420px) {
	.tai__corners--top { flex-wrap: wrap; }
	.tai__clocks { gap: 14px; }
}
