/*
 * Team bio modal
 * ==================================================
 * Native <dialog> profile card for the "Gryphon Team" grid.
 * Everything is scoped to .gw-bio-* so it can't leak into other UI.
 */

/* Trigger
   ------------------------------------------------- */
.gw-bio-trigger {
	background: none;
	border: 0;
	cursor: pointer;
}

/* Lock the page behind an open card. --gw-scrollbar-width is measured in
   JS and padded back in so the layout doesn't jump when scrolling stops. */
html:has(.gw-bio-modal[open]) {
	box-sizing: border-box;
	overflow: hidden;
	padding-right: var(--gw-scrollbar-width, 0px);
}

/* Dialog shell
   ------------------------------------------------- */
/* The dialog itself is the full-viewport centring frame. Engines disagree on
   what the <dialog> UA rule sets in the block axis, so nothing here leans on
   the `margin: auto` centring that only some of them provide. */
.gw-bio-modal {
	position: fixed;
	inset: 0;
	box-sizing: border-box;
	display: grid;
	align-items: center;
	justify-items: center;
	width: 100%;
	max-width: 100%;
	height: 100%;
	max-height: 100%;
	margin: 0;
	padding: 20px;
	border: 0;
	background: transparent;
	color: var(--white, #ffffff);
	overflow: hidden;
	opacity: 0;
	transition:
		opacity 0.3s ease,
		display 0.45s allow-discrete,
		overlay 0.45s allow-discrete;
}

.gw-bio-modal[open] {
	opacity: 1;
}

@starting-style {
	.gw-bio-modal[open] {
		opacity: 0;
	}
}

/* Belt and braces for engines without a <dialog> UA rule. */
.gw-bio-modal:not([open]) {
	display: none;
}

.gw-bio-modal::backdrop {
	background: rgba(0, 0, 0, 0.7);
	backdrop-filter: blur(10px) saturate(115%);
	-webkit-backdrop-filter: blur(10px) saturate(115%);
	opacity: 0;
	transition:
		opacity 0.35s ease,
		display 0.35s allow-discrete,
		overlay 0.35s allow-discrete;
}

.gw-bio-modal[open]::backdrop {
	opacity: 1;
}

@starting-style {
	.gw-bio-modal[open]::backdrop {
		opacity: 0;
	}
}

/* Card
   ------------------------------------------------- */
.gw-bio-modal__card {
	position: relative;
	display: flex;
	flex-direction: column;
	width: min(940px, 100%);
	max-height: 100%;
	scale: 1;
	translate: 0 0;
	transition:
		scale 0.45s cubic-bezier(0.16, 1, 0.3, 1),
		translate 0.45s cubic-bezier(0.16, 1, 0.3, 1);
	border: 1px solid rgba(189, 133, 101, 0.5);
	border-radius: 10px;
	background:
		linear-gradient(160deg, #131313 0%, #050505 55%, #000000 100%);
	box-shadow:
		0 1px 0 rgba(255, 255, 255, 0.06) inset,
		0 40px 90px rgba(0, 0, 0, 0.65);
	overflow: hidden;
}

/* Card rises in and settles back out; the dialog only fades. */
.gw-bio-modal:not([open]) .gw-bio-modal__card {
	scale: 0.97;
	translate: 0 24px;
}

@starting-style {
	.gw-bio-modal[open] .gw-bio-modal__card {
		scale: 0.97;
		translate: 0 24px;
	}
}

/* Faint house watermark behind the content. */
.gw-bio-modal__card::before {
	content: '';
	position: absolute;
	inset: 0;
	background: url('../images/markings.svg') center center no-repeat;
	background-size: 115%;
	opacity: 0.16;
	pointer-events: none;
}

/* Close
   ------------------------------------------------- */
.gw-bio-modal__close {
	position: absolute;
	top: 16px;
	right: 16px;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 1px solid rgba(189, 133, 101, 0.45);
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.35);
	color: var(--white, #ffffff);
	cursor: pointer;
	transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease, rotate 0.35s ease;
}

.gw-bio-modal__close:hover,
.gw-bio-modal__close:focus-visible {
	border-color: var(--primary, #BD8565);
	background: var(--primary, #BD8565);
	color: var(--dark, #000000);
	rotate: 90deg;
}

.gw-bio-modal__close:focus-visible {
	outline: 2px solid var(--secondary, #8CD1CB);
	outline-offset: 3px;
}

/* Header
   ------------------------------------------------- */
.gw-bio-modal__header {
	position: relative;
	display: flex;
	align-items: center;
	gap: 28px;
	padding: 40px 72px 26px 44px;
}

.gw-bio-modal__photo {
	flex: 0 0 auto;
	position: relative;
	width: 150px;
	margin: 0;
}

.gw-bio-modal__photo .mask {
	display: block;
}

.gw-bio-modal__photo img {
	display: block;
	width: 100%;
	height: auto;
}

.gw-bio-modal__photo-frame {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	margin: 0 auto;
	height: 100%;
	width: auto;
}

.gw-bio-modal__ident {
	min-width: 0;
}

.gw-bio-modal__name {
	margin: 0;
	font-family: var(--secondary-font, 'Playfair Display', serif);
	font-size: 2rem;
	font-style: italic;
	font-weight: 400;
	line-height: 1.15;
	color: var(--primary, #BD8565);
}

.gw-bio-modal__role {
	margin: 8px 0 0;
	font-size: 0.8125rem;
	line-height: 1.4;
	font-weight: 300;
	letter-spacing: 2px;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.8);
}

.gw-bio-modal__links {
	display: flex;
	gap: 14px;
	margin: 14px 0 0;
	line-height: 1;
}

.gw-bio-modal__links a {
	color: var(--secondary, #8CD1CB);
	transition: color 0.2s ease, translate 0.2s ease;
}

.gw-bio-modal__links a:hover {
	color: var(--primary, #BD8565);
	translate: 0 -2px;
}

/* Divider — the same chevron rule used under section headings. */
.gw-bio-modal__divider {
	height: 16px;
	margin: 0 44px;
	background: url('../images/border-bottom02.svg') top left no-repeat;
	background-size: contain;
	opacity: 0.9;
}

/* Body
   ------------------------------------------------- */
.gw-bio-modal__body {
	position: relative;
	padding: 26px 44px 42px;
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-width: thin;
	scrollbar-color: rgba(189, 133, 101, 0.6) transparent;
}

.gw-bio-modal__body::-webkit-scrollbar {
	width: 8px;
}

.gw-bio-modal__body::-webkit-scrollbar-thumb {
	background: rgba(189, 133, 101, 0.55);
	border-radius: 4px;
}

.gw-bio-modal__accolades {
	list-style: none;
	margin: 0 0 24px;
	padding: 0;
	display: grid;
	gap: 10px;
}

.gw-bio-modal__accolades li {
	position: relative;
	padding-left: 24px;
	font-size: 0.9375rem;
	line-height: 1.45;
	color: rgba(255, 255, 255, 0.85);
}

.gw-bio-modal__accolades li::before {
	content: '';
	position: absolute;
	left: 0;
	top: 0.45em;
	width: 8px;
	height: 8px;
	border: 1px solid var(--primary, #BD8565);
	rotate: 45deg;
}

.gw-bio-modal__bio {
	font-size: 1rem;
	line-height: 1.7;
	color: rgba(255, 255, 255, 0.9);
}

.gw-bio-modal__bio p {
	margin: 0 0 1em;
}

.gw-bio-modal__bio p:last-child {
	margin-bottom: 0;
}

.gw-bio-modal__bio a {
	color: var(--secondary, #8CD1CB);
}

.gw-bio-modal__disclaimer {
	margin-top: 26px;
	padding-top: 18px;
	border-top: 1px solid rgba(255, 255, 255, 0.12);
	color: rgba(255, 255, 255, 0.55);
}

/* Entrance choreography
   ------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
	@keyframes gw-bio-rise {
		from {
			opacity: 0;
			translate: 0 12px;
		}
	}

	@keyframes gw-bio-wipe {
		from {
			opacity: 0;
			clip-path: inset(0 100% 0 0);
		}
	}

	.gw-bio-modal[open] .gw-bio-modal__photo,
	.gw-bio-modal[open] .gw-bio-modal__ident,
	.gw-bio-modal[open] .gw-bio-modal__accolades li,
	.gw-bio-modal[open] .gw-bio-modal__bio,
	.gw-bio-modal[open] .gw-bio-modal__disclaimer {
		animation: gw-bio-rise 0.5s cubic-bezier(0.16, 1, 0.3, 1) backwards;
	}

	.gw-bio-modal[open] .gw-bio-modal__photo { animation-delay: 0.1s; }
	.gw-bio-modal[open] .gw-bio-modal__ident { animation-delay: 0.16s; }

	.gw-bio-modal[open] .gw-bio-modal__divider {
		animation: gw-bio-wipe 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.22s backwards;
	}

	.gw-bio-modal[open] .gw-bio-modal__accolades li:nth-child(1) { animation-delay: 0.28s; }
	.gw-bio-modal[open] .gw-bio-modal__accolades li:nth-child(2) { animation-delay: 0.33s; }
	.gw-bio-modal[open] .gw-bio-modal__accolades li:nth-child(3) { animation-delay: 0.38s; }
	.gw-bio-modal[open] .gw-bio-modal__accolades li:nth-child(4) { animation-delay: 0.43s; }
	.gw-bio-modal[open] .gw-bio-modal__accolades li:nth-child(n + 5) { animation-delay: 0.48s; }

	.gw-bio-modal[open] .gw-bio-modal__bio { animation-delay: 0.34s; }
	.gw-bio-modal[open] .gw-bio-modal__disclaimer { animation-delay: 0.4s; }
}

@media (prefers-reduced-motion: reduce) {
	.gw-bio-modal,
	.gw-bio-modal::backdrop {
		transition-duration: 0.01ms;
	}
}

/* Small screens
   ------------------------------------------------- */
@media only screen and (max-width: 767px) {
	.gw-bio-modal {
		padding: 12px;
	}

	.gw-bio-modal__card {
		width: 100%;
	}

	.gw-bio-modal__header {
		flex-direction: column;
		align-items: flex-start;
		gap: 18px;
		padding: 32px 24px 20px;
	}

	.gw-bio-modal__photo {
		width: 120px;
	}

	.gw-bio-modal__name {
		font-size: 1.65rem;
	}

	.gw-bio-modal__divider {
		margin: 0 24px;
	}

	.gw-bio-modal__body {
		padding: 22px 24px 32px;
	}

	.gw-bio-modal__close {
		top: 12px;
		right: 12px;
		width: 36px;
		height: 36px;
	}
}
