/* Teamly – front end */
.tml {
	--tml-accent: #7c3aed;
	--tml-cols: 3;
	--tml-muted: color-mix(in srgb, currentColor 62%, transparent);
	--tml-line: color-mix(in srgb, currentColor 12%, transparent);
	--tml-soft: color-mix(in srgb, currentColor 3.5%, transparent);
	--tml-ratio: 4 / 5;
	--tml-radius: 20px;
	line-height: 1.45;
	margin: 0 0 2em;
}
.tml *, .tml *::before, .tml *::after { box-sizing: border-box; }
.tml--square { --tml-ratio: 1 / 1; }

/* Grid */
.tml--grid { display: grid; grid-template-columns: repeat(var(--tml-cols), minmax(0, 1fr)); gap: 24px; }
@media (max-width: 900px) { .tml--grid { grid-template-columns: repeat(min(var(--tml-cols), 2), minmax(0, 1fr)); gap: 18px; } }
@media (max-width: 520px) { .tml--grid { grid-template-columns: 1fr; } }

.tml-card { display: flex; flex-direction: column; min-width: 0; }
.tml-card__media {
	position: relative;
	overflow: hidden;
	aspect-ratio: var(--tml-ratio);
	border-radius: var(--tml-radius);
	background: linear-gradient(135deg, color-mix(in srgb, var(--tml-accent) 75%, #fff), var(--tml-accent));
}
.tml .tml-photo {
	display: block;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	margin: 0 !important;
	object-fit: cover;
	transition: transform 0.6s cubic-bezier(.2, .8, .2, 1);
}
.tml-card:hover .tml-photo { transform: scale(1.045); }
.tml-initials {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	font-size: clamp(32px, 6vw, 56px);
	font-weight: 800;
	letter-spacing: -0.02em;
	color: rgba(255, 255, 255, 0.92);
}
.tml--circle .tml-card { align-items: center; text-align: center; }
.tml--circle .tml-card__media { width: 70%; aspect-ratio: 1; border-radius: 50%; }
.tml--circle .tml-tags, .tml--circle .tml-card__foot { justify-content: center; }

.tml-card__body { padding: 14px 4px 0; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.tml .tml-name { margin: 0 !important; font-size: 1.12em; font-weight: 700; line-height: 1.25; letter-spacing: -0.01em; }
.tml .tml-role { margin: 0 !important; color: var(--tml-accent); font-weight: 600; font-size: 0.92em; }
.tml .tml-tags { list-style: none !important; margin: 6px 0 0 !important; padding: 0 !important; display: flex; flex-wrap: wrap; gap: 6px; }
.tml .tml-tags li { margin: 0 !important; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--tml-soft); border: 1px solid var(--tml-line); }
.tml-card__foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 12px; }

.tml-links { display: flex; gap: 6px; flex-wrap: wrap; }
.tml .tml-link {
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	border-radius: 11px;
	color: inherit !important;
	background: var(--tml-soft);
	border: 1px solid var(--tml-line);
	text-decoration: none !important;
	transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
}
.tml .tml-link:hover, .tml .tml-link:focus-visible { background: var(--tml-accent); border-color: var(--tml-accent); color: #fff !important; transform: translateY(-2px); }
.tml .tml-more {
	all: unset;
	box-sizing: border-box;
	margin-left: auto;
	padding: 8px 14px;
	border-radius: 999px;
	font-size: 13px;
	font-weight: 650;
	color: var(--tml-accent);
	background: color-mix(in srgb, var(--tml-accent) 10%, transparent);
	cursor: pointer;
	transition: background 0.2s, color 0.2s;
}
.tml .tml-more:hover { background: var(--tml-accent); color: #fff; }
.tml .tml-more:focus-visible { outline: 2px solid var(--tml-accent); outline-offset: 2px; }

/* List */
.tml--list { display: grid; gap: 16px; }
.tml--list .tml-card { flex-direction: row; gap: 22px; padding: 16px; border-radius: var(--tml-radius); background: var(--tml-soft); border: 1px solid var(--tml-line); align-items: center; text-align: left; }
.tml--list .tml-card__media { width: 132px; flex: none; border-radius: 16px; }
.tml--list .tml-card__body { padding: 0; }
@media (max-width: 560px) { .tml--list .tml-card { flex-direction: column; align-items: stretch; } .tml--list .tml-card__media { width: 100%; } }

/* Compact */
.tml--compact { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.tml--compact .tml-card { flex-direction: row; align-items: center; gap: 12px; padding: 10px; border-radius: 16px; border: 1px solid var(--tml-line); text-align: left; }
.tml--compact .tml-card__media { width: 56px; height: 56px; aspect-ratio: 1; flex: none; border-radius: 50%; }
.tml--compact .tml-initials { font-size: 18px; }
.tml--compact .tml-card__body { padding: 0; }
.tml--compact .tml-name { font-size: 1em; }
.tml--compact .tml-card__foot { padding-top: 6px; }
.tml--compact .tml-link { width: 30px; height: 30px; border-radius: 9px; }
.tml--compact .tml-more { padding: 5px 10px; font-size: 12px; }

/* Modal */
.tml-modal {
	width: min(760px, calc(100vw - 32px));
	max-height: calc(100vh - 48px);
	padding: 0;
	border: 0;
	border-radius: 24px;
	color: #0f172a;
	background: #fff;
	box-shadow: 0 30px 80px -20px rgba(15, 23, 42, 0.5);
	overflow: hidden;
}
.tml-modal::backdrop { background: rgba(15, 23, 42, 0.55); backdrop-filter: blur(4px); }
.tml-modal[open] { animation: tml-in 0.28s cubic-bezier(.2, .9, .3, 1.15); }
@keyframes tml-in { from { opacity: 0; transform: translateY(16px) scale(0.97); } }
.tml-modal__inner { display: grid; grid-template-columns: 280px 1fr; max-height: calc(100vh - 48px); }
.tml-modal__media { position: relative; background: linear-gradient(135deg, color-mix(in srgb, var(--tml-accent) 75%, #fff), var(--tml-accent)); min-height: 280px; }
.tml-modal__media .tml-photo { position: absolute; inset: 0; }
.tml-modal__body { padding: 30px 30px 26px; overflow: auto; display: flex; flex-direction: column; gap: 6px; }
.tml-modal .tml-name { font-size: 1.5em; }
.tml-bio { margin-top: 10px; font-size: 0.97em; color: #334155; }
.tml-bio p { margin: 0 0 0.8em; }
.tml-modal .tml-links { margin-top: auto; padding-top: 14px; }
.tml-modal__x {
	all: unset;
	position: absolute;
	z-index: 2;
	top: 14px;
	right: 14px;
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.9);
	color: #0f172a;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}
.tml-modal__x:focus-visible { outline: 2px solid var(--tml-accent); outline-offset: 2px; }
@media (max-width: 640px) {
	.tml-modal__inner { grid-template-columns: 1fr; overflow: auto; }
	.tml-modal__media { min-height: 0; aspect-ratio: 4 / 3; }
}
.tml-missing { padding: 12px 16px; border: 1px dashed #cbd5e1; border-radius: 12px; color: #64748b; }
@media (prefers-reduced-motion: reduce) { .tml *, .tml-modal { animation: none !important; transition: none !important; } }
@supports not (color: color-mix(in srgb, red 10%, white)) {
	.tml { --tml-muted: inherit; --tml-line: rgba(127, 127, 127, 0.2); --tml-soft: rgba(127, 127, 127, 0.06); }
	.tml-card__media, .tml-modal__media { background: var(--tml-accent); }
	.tml .tml-more { background: rgba(127, 127, 127, 0.1); }
}
