/* ==========================================================================
   FLAG ATLAS — senojflags.com homepage
   Apple / Netflix / macOS inspired: dark canvas, glass cards, big rounded
   corners, soft glow, spring-like hover motion, generous whitespace.
   ========================================================================== */

:root {
	--sfl-bg: #07070a;
	--sfl-bg-elevated: #101014;
	--sfl-text: #f5f5f7;
	--sfl-text-dim: rgba(245, 245, 247, 0.6);
	--sfl-text-faint: rgba(245, 245, 247, 0.38);
	--sfl-glass: rgba(255, 255, 255, 0.06);
	--sfl-glass-border: rgba(255, 255, 255, 0.10);
	--sfl-glass-hover: rgba(255, 255, 255, 0.10);
	--sfl-accent: #2997ff;
	--sfl-radius-lg: 28px;
	--sfl-radius-md: 20px;
	--sfl-radius-sm: 16px;
	--sfl-ease: cubic-bezier(0.16, 1, 0.3, 1);
	--sfl-ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Scope everything to the atlas wrapper so we never leak styles into
   Astra's header/footer or admin bar. */
.sfl-atlas-main {
	background: var(--sfl-bg);
	color: var(--sfl-text);
	font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	overflow-x: hidden;
	margin: 0;
	padding: 0;
}

.sfl-atlas-main * {
	box-sizing: border-box;
}

/* -------------------------------------------------------------------------- */
/* HERO                                                                      */
/* -------------------------------------------------------------------------- */

.sfl-hero {
	position: relative;
	min-height: 64vh;
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 120px 24px 80px;
	overflow: hidden;
}

.sfl-hero__glow {
	position: absolute;
	inset: -20% -20% auto -20%;
	height: 120%;
	background: radial-gradient(circle at 50% 0%, rgba(41, 151, 255, 0.25), transparent 60%);
	pointer-events: none;
	z-index: 0;
	animation: sfl-glow-pulse 8s ease-in-out infinite;
}

@keyframes sfl-glow-pulse {
	0%, 100% { opacity: 0.7; transform: scale(1); }
	50% { opacity: 1; transform: scale(1.08); }
}

.sfl-hero__inner {
	position: relative;
	z-index: 1;
	max-width: 760px;
	margin: 0 auto;
}

.sfl-hero__eyebrow {
	display: inline-block;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--sfl-accent);
	margin-bottom: 18px;
	opacity: 0;
	animation: sfl-fade-up 0.8s var(--sfl-ease) 0.1s forwards;
}

.sfl-hero__title {
	font-size: clamp(40px, 7vw, 88px);
	line-height: 1.05;
	font-weight: 700;
	letter-spacing: -0.02em;
	margin: 0 0 20px;
	background: linear-gradient(180deg, #ffffff 0%, rgba(255,255,255,0.7) 100%);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	opacity: 0;
	animation: sfl-fade-up 0.9s var(--sfl-ease) 0.2s forwards;
}

.sfl-hero__subtitle {
	font-size: clamp(16px, 2vw, 20px);
	line-height: 1.5;
	color: var(--sfl-text-dim);
	max-width: 560px;
	margin: 0 auto;
	opacity: 0;
	animation: sfl-fade-up 0.9s var(--sfl-ease) 0.35s forwards;
}

@keyframes sfl-fade-up {
	from { opacity: 0; transform: translateY(18px); }
	to { opacity: 1; transform: translateY(0); }
}

/* -------------------------------------------------------------------------- */
/* CONTINENT STICKY NAV                                                      */
/* -------------------------------------------------------------------------- */

.sfl-continent-nav {
	position: sticky;
	top: 0;
	z-index: 40;
	background: rgba(7, 7, 10, 0.72);
	backdrop-filter: blur(20px) saturate(160%);
	-webkit-backdrop-filter: blur(20px) saturate(160%);
	border-bottom: 1px solid var(--sfl-glass-border);
	padding: 14px 0;
}

.sfl-continent-nav__track {
	display: flex;
	gap: 10px;
	overflow-x: auto;
	max-width: 1280px;
	margin: 0 auto;
	padding: 0 24px;
	scrollbar-width: none;
}

.sfl-continent-nav__track::-webkit-scrollbar {
	display: none;
}

.sfl-continent-nav__pill {
	flex: 0 0 auto;
	padding: 8px 18px;
	border-radius: 999px;
	background: var(--sfl-glass);
	border: 1px solid var(--sfl-glass-border);
	color: var(--sfl-text-dim);
	font-size: 14px;
	font-weight: 500;
	text-decoration: none;
	white-space: nowrap;
	transition: background 0.25s var(--sfl-ease), color 0.25s var(--sfl-ease), border-color 0.25s var(--sfl-ease);
}

.sfl-continent-nav__pill:hover,
.sfl-continent-nav__pill.is-active {
	background: var(--sfl-text);
	color: #07070a;
	border-color: var(--sfl-text);
}

/* -------------------------------------------------------------------------- */
/* CONTINENT SECTIONS                                                        */
/* -------------------------------------------------------------------------- */

.sfl-continent {
	max-width: 1280px;
	margin: 0 auto;
	padding: 88px 24px 24px;
	scroll-margin-top: 70px;
	overflow: visible;
}

.sfl-continent__header {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	margin-bottom: 28px;
	padding-bottom: 18px;
	border-bottom: 1px solid var(--sfl-glass-border);
}

.sfl-continent__title {
	font-size: clamp(26px, 3.4vw, 38px);
	font-weight: 700;
	letter-spacing: -0.01em;
	margin: 0;
}

.sfl-continent__count {
	font-size: 14px;
	color: var(--sfl-text-faint);
	font-weight: 500;
}

/* -------------------------------------------------------------------------- */
/* NETFLIX-STYLE SCROLL ROW                                                  */
/* -------------------------------------------------------------------------- */

.sfl-row {
	position: relative;
	display: flex;
	align-items: center;
}

.sfl-row__track {
	display: flex;
	gap: 16px;
	overflow-x: auto;
	scroll-behavior: smooth;
	scroll-snap-type: x proximity;
	padding: 6px 4px 18px;
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.sfl-row__track::-webkit-scrollbar {
	display: none;
}

/* Equal-size cards for every flag, no exceptions */
.sfl-tile {
	flex: 0 0 auto;
	scroll-snap-align: start;
	width: 220px;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 12px;
	padding: 0;
	background: transparent;
	border: none;
	cursor: pointer;
	text-align: left;
	font: inherit;
	color: var(--sfl-text);

	opacity: 0;
	transform: translateY(18px);
	transition: opacity 0.5s var(--sfl-ease), transform 0.5s var(--sfl-ease);
}

.sfl-tile.is-visible {
	opacity: 1;
	transform: translateY(0);
}

/* The frame is what gets the card treatment — fixed aspect ratio so every
   flag, regardless of its native proportions, sits in an identical box. */
.sfl-tile__flag-frame {
	width: 100%;
	aspect-ratio: 4 / 3;
	border-radius: var(--sfl-radius-md);
	background: var(--sfl-glass);
	border: 1px solid var(--sfl-glass-border);
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 18px;
	transition:
		transform 0.4s var(--sfl-ease-spring),
		border-color 0.3s var(--sfl-ease),
		box-shadow 0.4s var(--sfl-ease),
		background 0.3s var(--sfl-ease);
}

/* The actual flag — let flag-icons size itself (background-size: contain
   is set by the flag-icons library). We only control the box it sits in,
   never the image's own background-size, so it never stretches. */
.sfl-tile__flag {
	width: 100%;
	height: 100%;
	display: block;
	filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.35));
	transition: transform 0.4s var(--sfl-ease-spring);
}

.sfl-tile:hover .sfl-tile__flag-frame,
.sfl-tile:focus-visible .sfl-tile__flag-frame {
	transform: translateY(-6px) scale(1.04);
	border-color: rgba(255, 255, 255, 0.28);
	background: var(--sfl-glass-hover);
	box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.6);
	outline: none;
}

.sfl-tile:hover .sfl-tile__flag {
	transform: scale(1.06);
}

.sfl-tile:active .sfl-tile__flag-frame {
	transform: translateY(-2px) scale(1.01);
}

.sfl-tile__name {
	font-size: 15px;
	font-weight: 600;
	letter-spacing: -0.01em;
	padding-left: 2px;
}

/* Row nav buttons (prev/next) — Netflix-style circular arrows that sit
   over the row and fade in only on hover of the whole row. */
.sfl-row__nav {
	position: absolute;
	top: 0;
	bottom: 18px;
	width: 56px;
	z-index: 5;
	display: flex;
	align-items: center;
	justify-content: center;
	background: none;
	border: none;
	color: var(--sfl-text);
	cursor: pointer;
	opacity: 0;
	transition: opacity 0.25s var(--sfl-ease), background 0.25s var(--sfl-ease);
}

.sfl-row:hover .sfl-row__nav {
	opacity: 1;
}

.sfl-row__nav--prev {
	left: -8px;
	background: linear-gradient(90deg, var(--sfl-bg) 30%, transparent 100%);
	justify-content: flex-start;
	padding-left: 4px;
}

.sfl-row__nav--next {
	right: -8px;
	background: linear-gradient(270deg, var(--sfl-bg) 30%, transparent 100%);
	justify-content: flex-end;
	padding-right: 4px;
}

.sfl-row__nav svg {
	width: 22px;
	height: 22px;
	padding: 14px;
	border-radius: 50%;
	background: rgba(20, 20, 24, 0.85);
	border: 1px solid var(--sfl-glass-border);
	box-sizing: content-box;
	transition: background 0.25s var(--sfl-ease), transform 0.25s var(--sfl-ease-spring);
}

.sfl-row__nav:hover svg {
	background: var(--sfl-text);
	color: var(--sfl-bg);
	transform: scale(1.08);
}

.sfl-row__nav:disabled {
	opacity: 0 !important;
	pointer-events: none;
}

/* -------------------------------------------------------------------------- */
/* MODAL                                                                     */
/* -------------------------------------------------------------------------- */

.sfl-modal {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	visibility: hidden;
	opacity: 0;
	transition: opacity 0.3s var(--sfl-ease), visibility 0.3s var(--sfl-ease);
}

.sfl-modal.is-open {
	visibility: visible;
	opacity: 1;
}

.sfl-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.6);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
}

.sfl-modal__card {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 420px;
	background: var(--sfl-bg-elevated);
	border: 1px solid var(--sfl-glass-border);
	border-radius: var(--sfl-radius-lg);
	padding: 36px 32px 32px;
	box-shadow: 0 40px 80px -20px rgba(0,0,0,0.6);
	transform: translateY(20px) scale(0.97);
	transition: transform 0.4s var(--sfl-ease-spring);
}

.sfl-modal.is-open .sfl-modal__card {
	transform: translateY(0) scale(1);
}

.sfl-modal__close {
	position: absolute;
	top: 20px;
	right: 20px;
	width: 34px;
	height: 34px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: var(--sfl-glass);
	border: 1px solid var(--sfl-glass-border);
	color: var(--sfl-text-dim);
	cursor: pointer;
	transition: background 0.25s var(--sfl-ease), color 0.25s var(--sfl-ease), transform 0.25s var(--sfl-ease-spring);
}

.sfl-modal__close:hover {
	background: var(--sfl-text);
	color: var(--sfl-bg);
	transform: rotate(90deg);
}

.sfl-modal__flag-wrap {
	width: 100%;
	aspect-ratio: 4 / 3;
	border-radius: var(--sfl-radius-md);
	overflow: hidden;
	margin-bottom: 22px;
	box-shadow: 0 12px 30px -8px rgba(0,0,0,0.5);
	background: var(--sfl-glass);
	border: 1px solid var(--sfl-glass-border);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 22px;
}

.sfl-modal__flag {
	width: 100%;
	height: 100%;
	display: block;
	filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.35));
}

.sfl-modal__name {
	font-size: 26px;
	font-weight: 700;
	letter-spacing: -0.01em;
	margin: 0 0 6px;
}

.sfl-modal__capital {
	font-size: 14px;
	font-weight: 600;
	color: var(--sfl-accent);
	margin: 0 0 14px;
}

.sfl-modal__capital::before {
	content: "Capital — ";
	color: var(--sfl-text-faint);
	font-weight: 500;
}

.sfl-modal__blurb {
	font-size: 15px;
	line-height: 1.6;
	color: var(--sfl-text-dim);
	margin: 0;
}

/* -------------------------------------------------------------------------- */
/* RESPONSIVE                                                                */
/* -------------------------------------------------------------------------- */

@media (max-width: 980px) {
	.sfl-tile { width: 180px; }
	.sfl-row__nav { display: none; } /* touch devices scroll natively */
}

@media (max-width: 600px) {
	.sfl-hero { padding: 90px 20px 56px; min-height: 50vh; }
	.sfl-continent { padding: 56px 16px 16px; }
	.sfl-tile { width: 148px; }
	.sfl-row__track { gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
	.sfl-tile,
	.sfl-hero__eyebrow,
	.sfl-hero__title,
	.sfl-hero__subtitle,
	.sfl-hero__glow,
	.sfl-modal__card,
	.sfl-modal__close,
	.sfl-tile__flag-frame,
	.sfl-tile__flag {
		animation: none !important;
		transition: opacity 0.2s linear !important;
		transform: none !important;
	}
	.sfl-tile { opacity: 1; }
}
