/* ─── FOUNDER'S NOTE POPUP (homepage, 50% scroll) ─── */
.efn {
	--efn-gold: #cfaa43;
	--efn-gold-soft: #d4bc6e;
	--efn-gold-deep: #b8943f;
	--efn-ink: #050505;
	--efn-panel: #0b0b0d;
	--efn-text: #f0eeea;
	--efn-muted: #a3a3ae;
	--efn-line: rgba(207, 170, 67, 0.22);
	--efn-serif: 'Playfair Display', 'Playfair Fallback', Georgia, serif;
	--efn-sans: 'Libre Franklin', 'Franklin Fallback', system-ui, sans-serif;
	--efn-mono: 'IBM Plex Mono', 'Plex Mono Fallback', ui-monospace, monospace;

	position: fixed;
	inset: 0;
	z-index: 9990; /* below .cfo-modal-overlay (9999) so Subscribe can open on top */
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	font-family: var(--efn-sans);
}

.efn[hidden] { display: none; }

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

/* Scrim: lighter than the login modals so the page stays visible behind */
.efn__scrim {
	position: absolute;
	inset: 0;
	background: rgba(5, 5, 7, 0.62);
	backdrop-filter: blur(6px) saturate(120%);
	-webkit-backdrop-filter: blur(6px) saturate(120%);
	opacity: 0;
	transition: opacity 0.45s ease;
}

/* Card */
.efn__card {
	position: relative;
	display: grid;
	grid-template-columns: 300px 1fr;
	width: 100%;
	max-width: 820px;
	max-height: calc(100vh - 48px);
	overflow: hidden;
	background: var(--efn-panel);
	background-image:
		radial-gradient(120% 80% at 100% 0%, rgba(207, 170, 67, 0.12) 0%, transparent 55%),
		linear-gradient(180deg, #0e0e11 0%, #070708 100%);
	border: 1px solid var(--efn-line);
	border-radius: 20px;
	box-shadow:
		0 40px 90px -20px rgba(0, 0, 0, 0.85),
		0 0 0 1px rgba(255, 255, 255, 0.03) inset;
	color: var(--efn-text);
	outline: none;
	opacity: 0;
	transform: translateY(28px) scale(0.98);
	transition: opacity 0.5s cubic-bezier(.2, .7, .2, 1), transform 0.6s cubic-bezier(.2, .7, .2, 1);
}

/* Gold hairline across the top edge */
.efn__card::before {
	content: '';
	position: absolute;
	top: 0;
	left: 10%;
	right: 10%;
	height: 1px;
	background: linear-gradient(90deg, transparent, var(--efn-gold), transparent);
	opacity: 0.8;
	z-index: 2;
}

.efn.is-open .efn__scrim { opacity: 1; }
.efn.is-open .efn__card { opacity: 1; transform: none; }
.efn.is-closing .efn__scrim { opacity: 0; }
.efn.is-closing .efn__card { opacity: 0; transform: translateY(16px) scale(0.985); transition-duration: 0.3s; }

/* Close */
.efn__close {
	position: absolute;
	top: 16px;
	right: 16px;
	z-index: 3;
	width: 34px;
	height: 34px;
	display: grid;
	place-items: center;
	border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, 0.12);
	background: rgba(255, 255, 255, 0.04);
	color: #bdbdc6;
	cursor: pointer;
	transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
}
.efn__close:hover { color: #fff; border-color: var(--efn-gold); transform: rotate(90deg); }

/* Portrait panel */
.efn__portrait {
	position: relative;
	margin: 0;
	overflow: hidden;
	background: #062347;
}
.efn__portrait img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 42% 20%;
	transform: scale(1.06);
	transition: transform 6s ease-out;
}
.efn.is-open .efn__portrait img { transform: scale(1); }

.efn__portrait::after {
	content: '';
	position: absolute;
	inset: 0;
	background:
		linear-gradient(180deg, rgba(5, 5, 7, 0) 45%, rgba(5, 5, 7, 0.92) 100%),
		linear-gradient(90deg, rgba(5, 5, 7, 0) 70%, rgba(11, 11, 13, 0.9) 100%);
}

.efn__portrait-caption {
	position: absolute;
	left: 24px;
	right: 24px;
	bottom: 22px;
	z-index: 1;
	display: flex;
	flex-direction: column;
	gap: 4px;
}
.efn__name {
	font-family: var(--efn-serif);
	font-size: 1.25rem;
	font-weight: 600;
	color: #fff;
	letter-spacing: 0.2px;
}
.efn__role {
	font-family: var(--efn-mono);
	font-size: 0.66rem;
	letter-spacing: 1.6px;
	text-transform: uppercase;
	color: var(--efn-gold-soft);
}

/* Content */
.efn__content {
	padding: 44px 44px 34px;
	overflow-y: auto;
}

.efn__eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 18px;
	font-family: var(--efn-mono);
	font-size: 0.68rem;
	letter-spacing: 2px;
	text-transform: uppercase;
	color: var(--efn-gold);
}
.efn__dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--efn-gold);
	box-shadow: 0 0 0 0 rgba(207, 170, 67, 0.6);
	animation: efn-pulse 2.4s ease-out infinite;
}
@keyframes efn-pulse {
	0% { box-shadow: 0 0 0 0 rgba(207, 170, 67, 0.55); }
	70% { box-shadow: 0 0 0 9px rgba(207, 170, 67, 0); }
	100% { box-shadow: 0 0 0 0 rgba(207, 170, 67, 0); }
}

.efn__title {
	margin: 0 0 18px;
	font-family: var(--efn-serif);
	font-size: clamp(1.7rem, 2.6vw, 2.15rem);
	font-weight: 600;
	line-height: 1.15;
	letter-spacing: -0.3px;
	color: #fff;
}
.efn__title em {
	font-style: italic;
	font-weight: 500;
	background: linear-gradient(100deg, var(--efn-gold-soft) 0%, var(--efn-gold) 45%, var(--efn-gold-deep) 100%);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.efn__body p {
	margin: 0 0 12px;
	font-size: 0.95rem;
	line-height: 1.65;
	color: #cfcfd6;
}
.efn__body p:last-child { margin-bottom: 0; }

/* Stats */
.efn__stats {
	list-style: none;
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	margin: 24px 0 26px;
	padding: 0;
	border-top: 1px solid var(--efn-line);
	border-bottom: 1px solid var(--efn-line);
}
.efn__stats li {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 14px 0 14px 16px;
	border-left: 1px solid var(--efn-line);
}
.efn__stats li:first-child { border-left: 0; padding-left: 0; }
.efn__stats strong {
	font-family: var(--efn-serif);
	font-size: 1.35rem;
	font-weight: 600;
	color: var(--efn-gold-soft);
	line-height: 1.1;
}
.efn__stats span {
	font-family: var(--efn-mono);
	font-size: 0.62rem;
	letter-spacing: 1.2px;
	text-transform: uppercase;
	color: var(--efn-muted);
}

/* Actions */
.efn__actions {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px 18px;
}
.efn__cta {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 14px 24px;
	border: 0;
	border-radius: 999px;
	background: linear-gradient(135deg, #e2c46a 0%, var(--efn-gold) 50%, var(--efn-gold-deep) 100%);
	color: #0a0a0a;
	font-family: var(--efn-sans);
	font-size: 0.95rem;
	font-weight: 700;
	letter-spacing: 0.2px;
	cursor: pointer;
	overflow: hidden;
	box-shadow: 0 10px 28px -8px rgba(207, 170, 67, 0.55);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.efn__cta::after { /* sheen */
	content: '';
	position: absolute;
	top: 0;
	left: -60%;
	width: 40%;
	height: 100%;
	background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.45), transparent);
	transform: skewX(-20deg);
	transition: left 0.7s ease;
}
.efn__cta:hover { transform: translateY(-1px); box-shadow: 0 14px 34px -8px rgba(207, 170, 67, 0.7); }
.efn__cta:hover::after { left: 120%; }
.efn__cta svg { transition: transform 0.2s ease; }
.efn__cta:hover svg { transform: translateX(3px); }

.efn__fine {
	margin: 0;
	font-size: 0.78rem;
	color: var(--efn-muted);
}

.efn__footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 22px;
}
.efn__mail {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 0.86rem;
	color: var(--efn-text);
	text-decoration: none;
	border-bottom: 1px solid rgba(207, 170, 67, 0.35);
	padding-bottom: 2px;
	transition: color 0.2s, border-color 0.2s;
}
.efn__mail svg { color: var(--efn-gold); }
.efn__mail:hover { color: var(--efn-gold-soft); border-color: var(--efn-gold); }

.efn__later {
	background: none;
	border: 0;
	padding: 4px 0;
	font-family: var(--efn-sans);
	font-size: 0.82rem;
	color: var(--efn-muted);
	cursor: pointer;
	transition: color 0.2s;
}
.efn__later:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }

.efn__sign {
	margin: 22px 0 0;
	font-family: var(--efn-serif);
	font-style: italic;
	font-size: 0.92rem;
	color: var(--efn-muted);
}
.efn__sign span {
	display: inline-block;
	margin-left: 4px;
	font-size: 1.25rem;
	color: var(--efn-gold-soft);
}

/* Focus visibility */
.efn button:focus-visible,
.efn a:focus-visible {
	outline: 2px solid var(--efn-gold);
	outline-offset: 3px;
}

/* ─── Tablet / mobile ─── */
@media (max-width: 760px) {
	.efn { align-items: flex-end; padding: 0; }

	.efn__card {
		grid-template-columns: 1fr;
		max-height: 92vh;
		border-radius: 20px 20px 0 0;
		border-bottom: 0;
		transform: translateY(100%);
	}
	.efn.is-closing .efn__card { transform: translateY(100%); }

	/* Portrait collapses into an avatar row */
	.efn__portrait {
		display: flex;
		align-items: center;
		gap: 14px;
		padding: 26px 24px 0;
		background: none;
		overflow: visible;
	}
	.efn__portrait::after { display: none; }
	.efn__portrait img {
		position: static;
		flex: 0 0 auto;
		width: 56px;
		height: 56px;
		border-radius: 50%;
		object-position: 45% 18%;
		border: 1px solid var(--efn-gold);
		box-shadow: 0 0 0 4px rgba(207, 170, 67, 0.12);
		transform: none !important;
	}
	.efn__portrait-caption { position: static; }
	.efn__name { font-size: 1.05rem; }

	.efn__content { padding: 20px 24px 28px; }
	.efn__title { font-size: 1.65rem; }
	.efn__body p { font-size: 0.92rem; }
	.efn__stats { margin: 20px 0 22px; }
	.efn__stats li { padding-left: 12px; }
	.efn__stats strong { font-size: 1.15rem; }

	.efn__actions { flex-direction: column; align-items: stretch; text-align: center; }
	.efn__cta { justify-content: center; width: 100%; }
	.efn__footer { flex-direction: column-reverse; align-items: center; }
	.efn__sign { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	.efn__scrim,
	.efn__card,
	.efn__portrait img,
	.efn__cta,
	.efn__cta::after { transition: none !important; }
	.efn__dot { animation: none; }
}
