/* =========================================================================
   Farbstoffe Milestones — Roadmap
   Concept: a laboratory capillary column down which dye flows as you scroll.
   Each milestone is a coloured droplet node on the column.
   Scoped under .fb-rm to resist theme bleed.
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600&display=swap');

.fb-rm {
	/* ---- Tokens (override these to re-theme) ---- */
	--fb-ink:        #070A18;
	--fb-ink-2:      #0E1430;
	--fb-surface:    rgba(255, 255, 255, 0.045);
	--fb-surface-2:  rgba(255, 255, 255, 0.08);
	--fb-border:     rgba(255, 255, 255, 0.10);
	--fb-text:       #EEF1FB;
	--fb-text-soft:  rgba(238, 241, 251, 0.66);
	--fb-text-mute:  rgba(238, 241, 251, 0.42);

	/* The dye spectrum that flows down the column */
	--fb-flow: linear-gradient(180deg,
		#22D3EE 0%, #6C5CE7 30%, #EC4899 58%, #F59E0B 80%, #34D399 100%);

	--fb-rail-w:   4px;
	--fb-maxw:     1140px;
	--fb-radius:   18px;
	--fb-accent:   #6C5CE7; /* per-item, set inline */

	--fb-display: "Space Grotesk", ui-sans-serif, "Segoe UI", system-ui, sans-serif;
	--fb-body:    "Inter", ui-sans-serif, -apple-system, "Segoe UI", Roboto, system-ui, sans-serif;

	position: relative;
	box-sizing: border-box;
	overflow: clip;
	padding: clamp(56px, 9vw, 132px) 20px;
	background:
		radial-gradient(1100px 620px at 18% -8%, rgba(108, 92, 231, 0.20), transparent 60%),
		radial-gradient(900px 600px at 96% 8%, rgba(34, 211, 238, 0.14), transparent 58%),
		linear-gradient(180deg, var(--fb-ink-2) 0%, var(--fb-ink) 60%);
	color: var(--fb-text);
	font-family: var(--fb-body);
	-webkit-font-smoothing: antialiased;
	line-height: 1.6;
}

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

/* Faint drifting colour haze in the background */
.fb-rm__atmos {
	position: absolute;
	inset: -10% -10% 0 -10%;
	pointer-events: none;
	background:
		radial-gradient(380px 380px at 80% 30%, rgba(236, 72, 153, 0.10), transparent 70%),
		radial-gradient(420px 420px at 12% 70%, rgba(52, 211, 153, 0.10), transparent 70%);
	filter: blur(4px);
	z-index: 0;
}

/* ---- Header ---- */
.fb-rm__head {
	position: relative;
	z-index: 1;
	max-width: var(--fb-maxw);
	margin: 0 auto clamp(40px, 6vw, 84px);
	text-align: center;
}
.fb-rm__title {
	font-family: var(--fb-display);
	font-weight: 700;
	font-size: clamp(2rem, 5.2vw, 3.75rem);
	line-height: 1.04;
	letter-spacing: -0.02em;
	margin: 0;
	color: var(--fb-text);
	background: var(--fb-flow);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
}
.fb-rm__intro {
	max-width: 60ch;
	margin: 18px auto 0;
	font-size: clamp(1rem, 1.5vw, 1.18rem);
	color: var(--fb-text-soft);
}

/* ---- Track + capillary rail ---- */
.fb-rm__track {
	position: relative;
	z-index: 1;
	max-width: var(--fb-maxw);
	margin: 0 auto;
}
.fb-rm__rail {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 50%;
	transform: translateX(-50%);
	width: var(--fb-rail-w);
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.07);
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
	overflow: visible;
}
/* The dye fill — JS clips it from the bottom as you scroll (scrub) */
.fb-rm__rail-fill {
	position: absolute;
	inset: 0;
	border-radius: inherit;
	background: var(--fb-flow);
	background-size: 100% 100vh;
	box-shadow: 0 0 18px rgba(108, 92, 231, 0.55);
}
/* The bright meniscus that rides the leading edge of the dye */
.fb-rm__rail-glow {
	position: absolute;
	left: 50%;
	top: 0;
	width: 16px;
	height: 16px;
	margin: -8px 0 0 -8px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 0 16px 4px rgba(255, 255, 255, 0.65), 0 0 30px 10px rgba(108, 92, 231, 0.5);
	opacity: 0;
}

/* ---- List + items ---- */
.fb-rm__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: clamp(40px, 6vw, 80px);
}
.fb-rm__item {
	position: relative;
	width: 50%;
	padding: 0 clamp(28px, 4vw, 56px);
}
.fb-rm--alternate .fb-rm__item--left  { align-self: flex-start; text-align: right; }
.fb-rm--alternate .fb-rm__item--right { align-self: flex-end;   text-align: left;  }

/* Node sitting on the rail */
.fb-rm__node {
	position: absolute;
	top: 30px;
	width: 22px;
	height: 22px;
	display: grid;
	place-items: center;
}
.fb-rm--alternate .fb-rm__item--left  .fb-rm__node { right: -11px; }
.fb-rm--alternate .fb-rm__item--right .fb-rm__node { left: -11px; }

.fb-rm__node-ring {
	position: absolute;
	inset: 0;
	border-radius: 50%;
	border: 2px solid var(--fb-accent);
	opacity: 0.55;
}
.fb-rm__node-dot {
	width: 11px;
	height: 11px;
	border-radius: 50%;
	background: var(--fb-accent);
	box-shadow: 0 0 0 4px var(--fb-ink), 0 0 14px 2px var(--fb-accent);
	transition: transform .35s ease, box-shadow .35s ease;
}
.fb-rm__item.is-active .fb-rm__node-dot {
	transform: scale(1.35);
	box-shadow: 0 0 0 4px var(--fb-ink), 0 0 22px 6px var(--fb-accent);
}

/* ---- Card ---- */
.fb-rm__card {
	position: relative;
	display: inline-block;
	text-align: left;
	width: 100%;
	background: var(--fb-surface);
	border: 1px solid var(--fb-border);
	border-radius: var(--fb-radius);
	overflow: hidden;
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	box-shadow: 0 18px 50px -28px rgba(0, 0, 0, 0.8);
	transition: border-color .35s ease, transform .35s ease, box-shadow .35s ease;
}
.fb-rm__card::before {
	content: "";
	position: absolute;
	inset: 0 auto 0 0;
	width: 3px;
	background: var(--fb-accent);
	opacity: 0.9;
}
.fb-rm__item.is-active .fb-rm__card {
	border-color: color-mix(in srgb, var(--fb-accent) 55%, var(--fb-border));
	box-shadow: 0 24px 60px -28px rgba(0, 0, 0, 0.85),
		0 0 0 1px color-mix(in srgb, var(--fb-accent) 30%, transparent);
}

.fb-rm__media {
	position: relative;
	overflow: hidden;
	aspect-ratio: 16 / 9;
	background: var(--fb-ink);
}
.fb-rm__img {
	display: block;
	width: 100%;
	height: 116%; /* extra height for the parallax drift */
	object-fit: cover;
	will-change: transform;
}

.fb-rm__body { padding: clamp(20px, 2.4vw, 30px); }

.fb-rm__year {
	display: block;
	font-family: var(--fb-display);
	font-weight: 700;
	font-size: clamp(1.9rem, 3.4vw, 2.7rem);
	line-height: 1;
	letter-spacing: -0.02em;
	color: var(--fb-accent);
}
.fb-rm__eyebrow {
	display: inline-block;
	margin-top: 12px;
	font-family: var(--fb-display);
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--fb-text-mute);
}
.fb-rm__heading {
	font-family: var(--fb-display);
	font-weight: 600;
	font-size: clamp(1.2rem, 2vw, 1.6rem);
	line-height: 1.18;
	letter-spacing: -0.01em;
	margin: 8px 0 10px;
	color: var(--fb-text);
}
.fb-rm__text {
	font-size: 1rem;
	color: var(--fb-text-soft);
}
.fb-rm__text > :first-child { margin-top: 0; }
.fb-rm__text > :last-child  { margin-bottom: 0; }
.fb-rm__text a { color: var(--fb-accent); text-decoration: underline; text-underline-offset: 3px; }

/* =========================================================================
   Light theme
   ========================================================================= */
.fb-rm--light {
	--fb-ink:       #F4F5FA;
	--fb-ink-2:     #FFFFFF;
	--fb-surface:   #FFFFFF;
	--fb-surface-2: #F2F3F9;
	--fb-border:    rgba(16, 20, 48, 0.10);
	--fb-text:      #10142F;
	--fb-text-soft: rgba(16, 20, 48, 0.68);
	--fb-text-mute: rgba(16, 20, 48, 0.45);
	background:
		radial-gradient(1000px 600px at 18% -8%, rgba(108, 92, 231, 0.10), transparent 60%),
		radial-gradient(900px 560px at 96% 8%, rgba(34, 211, 238, 0.10), transparent 58%),
		linear-gradient(180deg, #FFFFFF 0%, #F4F5FA 100%);
}
.fb-rm--light .fb-rm__rail { background: rgba(16, 20, 48, 0.10); box-shadow: inset 0 0 0 1px rgba(16,20,48,.06); }
.fb-rm--light .fb-rm__node-dot { box-shadow: 0 0 0 4px var(--fb-ink-2), 0 0 14px 2px var(--fb-accent); }
.fb-rm--light .fb-rm__card { backdrop-filter: none; -webkit-backdrop-filter: none; }

/* =========================================================================
   Animation gating — content is fully visible without JS.
   When roadmap.js confirms GSAP is present it adds .is-enhanced, and only
   then do we hide things for the reveal (GSAP animates them back in).
   ========================================================================= */
.fb-rm.is-enhanced .fb-rm__item { opacity: 0; }
.fb-rm.is-enhanced .fb-rm__rail-fill { clip-path: inset(0 0 100% 0); }

/* =========================================================================
   Responsive — single column with the rail on the left
   ========================================================================= */
@media (max-width: 820px) {
	.fb-rm--alternate .fb-rm__rail,
	.fb-rm--left      .fb-rm__rail { left: 11px; transform: none; }

	.fb-rm__list { gap: 34px; }

	.fb-rm--alternate .fb-rm__item,
	.fb-rm--left      .fb-rm__item {
		width: 100%;
		align-self: stretch !important;
		text-align: left !important;
		padding: 0 0 0 40px;
	}
	.fb-rm--alternate .fb-rm__item--left  .fb-rm__node,
	.fb-rm--alternate .fb-rm__item--right .fb-rm__node,
	.fb-rm--left      .fb-rm__item         .fb-rm__node { left: 0; right: auto; top: 26px; }
}

/* Left-aligned layout on desktop too (layout="left") */
.fb-rm--left .fb-rm__rail { left: 11px; transform: none; }
.fb-rm--left .fb-rm__item {
	width: 100%;
	align-self: stretch;
	text-align: left;
	padding: 0 0 0 48px;
}
.fb-rm--left .fb-rm__node { left: 0; right: auto; }

/* =========================================================================
   Reduced motion — everything visible, no scrub, no transforms
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
	.fb-rm.is-enhanced .fb-rm__item { opacity: 1; }
	.fb-rm.is-enhanced .fb-rm__rail-fill { clip-path: none; }
	.fb-rm__img { height: 100%; }
	.fb-rm__node-dot,
	.fb-rm__card { transition: none; }
}

/* Keyboard focus visibility for any links inside cards */
.fb-rm a:focus-visible {
	outline: 2px solid var(--fb-accent);
	outline-offset: 3px;
	border-radius: 3px;
}
