.projets-page { padding-top: 44px; padding-bottom: 80px; }

.projets-intro { max-width: 60ch; margin-bottom: 40px; }
.projets-intro h1 { font-size: clamp(2rem, 4vw, 2.8rem); margin: 14px 0 8px; }
.projets-sub { color: var(--text-muted); }

.table-area {
	display: flex;
	align-items: flex-start;
	gap: 28px;
}

.cards-table {
	flex: 1;
	display: flex;
	flex-wrap: wrap;
	gap: 0 -34px;
	padding: 20px 10px 40px;
	position: relative;
}

/* ---------- Carte ---------- */
.project-card {
	--rot: 0deg;
	display: block;
	width: 258px;
	min-height: 220px;
	background: linear-gradient(160deg, var(--surface), var(--surface-2));
	border: 1px solid var(--line);
	border-radius: var(--radius-m);
	padding: 20px 20px 18px;
	margin: 0 -30px 26px 0;
	box-shadow: 0 14px 30px -16px rgba(0,0,0,0.55);
	transform: rotate(var(--rot));
	transition: transform 0.25s ease, box-shadow 0.25s ease, z-index 0s;
	cursor: pointer;
	position: relative;
	color: inherit;
	text-decoration: none;
	animation: dealIn 0.4s ease both;
}

/* Cartes en pioche ou en défausse : présentes dans le HTML, invisibles tant
   que projets.js ne les fait pas passer sur la table. */
.project-card.in-pioche { display: none; }

/* Carte "bannie" par un filtre actif : invisible et exclue du tirage par
   projets.js, mais jamais déplacée ni retirée du DOM — elle garde sa place
   sur la table (ou en pioche/défausse) et réapparaît dès que le filtre
   change d'avis. visibility (et non display) pour ne pas faire bouger le
   reste de la table. */
.project-card.filtered-out { visibility: hidden; pointer-events: none; }

@keyframes dealIn {
	from { opacity: 0; transform: translateY(16px) rotate(var(--rot)); }
	to { opacity: 1; transform: translateY(0) rotate(var(--rot)); }
}

.project-card:hover,
.project-card:focus-visible {
	transform: rotate(0deg) translateY(-10px) scale(1.045);
	z-index: 30;
	box-shadow: 0 28px 60px -18px rgba(0,0,0,0.7);
	border-color: var(--accent);
}

.project-card:last-child { margin-right: 0; }

.card-type-row {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
	margin-bottom: 12px;
}

.card-type {
	font-family: var(--font-mono);
	font-size: 0.66rem;
	letter-spacing: 0.02em;
	color: var(--accent);
	background: var(--accent-soft);
	padding: 3px 8px;
	border-radius: 999px;
}

.card-title {
	font-size: 1.24rem;
	margin: 0 0 10px;
}

.card-meta {
	list-style: none;
	margin: 0 0 12px;
	padding: 0;
	font-size: 0.82rem;
	color: var(--text-muted);
	display: grid;
	gap: 4px;
}

.card-meta li span { color: var(--text-faint); }

.card-tech {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
}

.card-tech span {
	font-size: 0.72rem;
	font-family: var(--font-mono);
	color: var(--text-muted);
	border: 1px solid var(--line);
	padding: 3px 8px;
	border-radius: 6px;
}

/* ---------- Assombrissement au survol ---------- */
.dimmer {
	position: fixed;
	inset: 0;
	background: rgba(6, 9, 16, 0.6);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.25s ease;
	z-index: 20;
}
.dimmer.active { opacity: 1; }

.tooltip {
	position: fixed;
	z-index: 60;
	background: var(--accent);
	color: #08130f;
	font-size: 0.78rem;
	font-weight: 500;
	padding: 6px 12px;
	border-radius: 999px;
	pointer-events: none;
	opacity: 0;
	transform: translate(-50%, -140%);
	transition: opacity 0.15s ease;
	white-space: nowrap;
}
.tooltip.visible { opacity: 1; }

/* ---------- Pile / pioche ---------- */
.deck-aside {
	flex: 0 0 190px;
	position: sticky;
	top: 110px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
}

.deck-pile {
	position: relative;
	width: 150px;
	height: 190px;
	background: none;
	border: none;
	cursor: pointer;
	padding: 0;
	color: var(--text);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-end;
	gap: 10px;
}

.deck-pile-stack {
	position: absolute;
	top: 0; left: 50%;
	width: 120px;
	height: 150px;
	transform: translateX(-50%);
}

.deck-pile-stack::before,
.deck-pile-stack::after,
.deck-pile {
	border-radius: var(--radius-m);
}

.deck-pile-stack::before,
.deck-pile-stack::after {
	content: '';
	position: absolute;
	inset: 0;
	border: 1px solid var(--line);
	border-radius: var(--radius-m);
	background: linear-gradient(160deg, var(--surface), var(--surface-2));
}
.deck-pile-stack::before { transform: rotate(-6deg) translateY(4px); }
.deck-pile-stack::after { transform: rotate(4deg) translateY(2px); }

.deck-pile-stack { border: 1px solid var(--line); background: var(--surface-2); box-shadow: 0 14px 26px -14px rgba(0,0,0,0.6); }

.deck-label {
	font-size: 0.82rem;
	font-weight: 500;
	text-align: center;
}
.deck-count {
	font-family: var(--font-mono);
	font-size: 0.72rem;
	color: var(--text-faint);
}

.deck-pile:hover .deck-label { color: var(--accent); }
.deck-pile:disabled { opacity: 0.4; cursor: default; }

.deck-mode-btn {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	background: var(--bg-alt);
	border: 1px solid var(--line);
	color: var(--text-muted);
	font-family: var(--font-mono);
	font-size: 0.74rem;
	padding: 7px 14px;
	border-radius: 999px;
	cursor: pointer;
	transition: border-color 0.15s ease, color 0.15s ease;
}
.deck-mode-btn:hover { border-color: var(--accent); color: var(--text); }
.deck-mode-btn .deck-mode-icon { font-size: 0.9rem; }

.deck-discard-btn:hover { border-color: var(--danger); color: var(--danger); }

@media (max-width: 760px) {
	.table-area { flex-direction: column-reverse; align-items: center; }
	.deck-aside { position: static; flex-direction: row; }
	.cards-table { justify-content: center; gap: 0; }
	.project-card { margin: 0 8px 20px; }
}
