/* ==========================================================================
   Iran Rope — homepage scroll story
   ========================================================================== */

/* ---- Hero (Scene 1) ---- */
.hero {
	position: relative;
	min-height: 100svh;
	display: flex;
	align-items: center;
	color: var(--c-white);
	overflow: hidden;
	background: var(--c-primary);
}
.hero__scene {
	position: absolute;
	inset: 0;
	z-index: 0;
}
.hero__scene svg { width: 100%; height: 100%; display: block; }
.hero__scene::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(10,35,66,0.15) 0%, rgba(10,35,66,0.75) 88%);
}
.hero__clouds ellipse {
	animation: ir-drift 40s linear infinite;
}
.hero__clouds ellipse:nth-child(2) { animation-duration: 55s; animation-direction: reverse; }
@keyframes ir-drift {
	from { transform: translateX(-40px); }
	to { transform: translateX(40px); }
}

.hero__content {
	position: relative;
	z-index: 1;
	max-width: 640px;
	padding-block: var(--space-7);
}
.hero__content .section__eyebrow { color: var(--c-orange); }
.hero__content h1 { color: var(--c-white); }
.hero__subtitle { color: rgba(255,255,255,0.82); font-size: 1.1rem; }
.hero__cta-group { display: flex; gap: var(--space-3); flex-wrap: wrap; margin-top: var(--space-4); }
.hero__scroll-hint {
	margin-top: var(--space-6);
	font-size: 0.85rem;
	color: rgba(255,255,255,0.6);
	position: relative;
	padding-inline-start: 28px;
}
.hero__scroll-hint::before {
	content: '';
	position: absolute;
	inset-inline-start: 0;
	top: 2px;
	width: 14px;
	height: 22px;
	border: 2px solid rgba(255,255,255,0.6);
	border-radius: 8px;
}
.hero__scroll-hint::after {
	content: '';
	position: absolute;
	inset-inline-start: 6px;
	top: 6px;
	width: 2px;
	height: 6px;
	background: var(--c-orange);
	border-radius: 2px;
	animation: ir-scrolldot 1.6s ease infinite;
}
@keyframes ir-scrolldot {
	0% { transform: translateY(0); opacity: 1; }
	70% { transform: translateY(8px); opacity: 0; }
	100% { transform: translateY(0); opacity: 0; }
}

/* ==========================================================================
   Story section — default (no-JS / reduced-motion) layout: a plain,
   fully-readable stacked sequence. This is the baseline; story.js layers
   the pinned/animated presentation on top when it's supported.
   ========================================================================== */
.story {
	position: relative;
	background: var(--c-primary);
}
.story__sticky {
	position: relative;
	display: block;
}
.story__scene { display: none; } /* only shown in pinned mode */
.story__dots { display: none; }

.story__cards {
	position: static;
	display: grid;
	gap: var(--space-4);
	padding: var(--space-7) var(--space-4);
	max-width: 720px;
	margin-inline: auto;
}
.story-card {
	position: static;
	opacity: 1;
	transform: none;
	background: rgba(255,255,255,0.06);
	border: 1px solid rgba(255,122,0,0.35);
	border-inline-start: 3px solid var(--c-orange);
	border-radius: 14px;
	padding: var(--space-4) var(--space-5);
	color: var(--c-white);
}
.story-card h2 { color: var(--c-white); font-size: 1.4rem; }
.story-card p { color: rgba(255,255,255,0.75); margin-bottom: var(--space-2); }
.story-card__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 10px;
	background: rgba(255,122,0,0.16);
	color: var(--c-orange);
	margin-bottom: var(--space-2);
	font-size: 20px;
}
.story-card__cta {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--c-orange);
	text-decoration: none;
	font-weight: 600;
}
.story-card__cta:hover { text-decoration: underline; }

/* ==========================================================================
   Pinned / animated mode — added by story.js as `story--pinned` on
   `.story` once IntersectionObserver + rAF are available and the visitor
   has not requested reduced motion (checked in JS via matchMedia and the
   Customizer's "force reduced motion" flag).
   ========================================================================== */
.story.story--pinned {
	/* height is set inline by story.js: (stage-count + 1) * 100svh */
}
.story--pinned .story__sticky {
	position: sticky;
	top: 0;
	height: 100svh;
	overflow: hidden;
}
.story--pinned .story__scene {
	display: block;
	position: absolute;
	inset: 0;
}
.story--pinned .story__scene svg { height: 100%; width: auto; margin-inline: auto; display: block; }

.story--pinned #ir-character-instance {
	transition: transform 0.05s linear; /* smoothing handled by rAF interpolation, not CSS */
}
.ir-window-lit {
	fill: #ffce8a;
	opacity: 0;
	transition: opacity 0.5s ease;
	transition-delay: calc(var(--i, 0) * 35ms);
}
.story__scene.is-lit .ir-window-lit { opacity: 0.9; }

.ir-fx { transition: opacity 0.4s ease; }
.story--pinned .story__scene[data-active-fx="water"] #ir-fx-water,
.story--pinned .story__scene[data-active-fx="paint"] #ir-fx-paint {
	opacity: 1;
}

.story--pinned .story__cards {
	position: absolute;
	inset: 0;
	display: block;
	padding: 0;
	max-width: none;
	margin: 0;
	pointer-events: none;
}
.story--pinned .story-card {
	position: absolute;
	top: 50%;
	max-width: 340px;
	opacity: 0;
	transform: translateY(18px);
	transition: opacity 0.5s var(--ease-cinematic), transform 0.5s var(--ease-cinematic);
	pointer-events: none;
}
.story--pinned .story-card.is-active {
	opacity: 1;
	transform: translateY(0);
	pointer-events: auto;
}
.story--pinned .story-card--right {
	inset-inline-end: 6%;
	transform: translateY(18px) translateX(0);
}
.story--pinned .story-card--left {
	inset-inline-start: 6%;
	transform: translateY(18px) translateX(0);
}
.story--pinned .story-card--right { top: 22%; }
.story--pinned .story-card--left { top: 62%; }

.story--pinned .story__dots {
	display: flex;
	flex-direction: column;
	gap: 10px;
	position: absolute;
	inset-inline-end: 2%;
	top: 50%;
	transform: translateY(-50%);
	list-style: none;
	margin: 0;
	padding: 0;
	z-index: 2;
}
.story__dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: rgba(255,255,255,0.3);
	transition: background 0.3s ease, transform 0.3s ease;
}
.story__dot.is-active {
	background: var(--c-orange);
	transform: scale(1.4);
}

@media (max-width: 760px) {
	.story--pinned .story-card { max-width: 78vw; font-size: 0.94rem; }
	.story--pinned .story-card--right,
	.story--pinned .story-card--left {
		inset-inline: 5%;
		max-width: none;
	}
	.story--pinned .story-card--right { top: 16%; }
	.story--pinned .story-card--left { top: 68%; }
	.story--pinned .story__dots { display: none; }
	.hero__clouds { display: none; }
}

/* ---- Ending scene ---- */
.ending {
	position: relative;
	background: var(--c-primary);
	color: var(--c-white);
	overflow: hidden;
	padding-block: var(--space-7);
}
.ending__scene { position: absolute; inset: 0; opacity: 0.9; }
.ending__scene svg { width: 100%; height: 100%; }
.ending__content {
	position: relative;
	text-align: center;
	max-width: 640px;
}
.ending__content h2 { color: var(--c-white); }
.ending__content p { color: rgba(255,255,255,0.8); margin-inline: auto; }
.cta-final__buttons {
	display: flex;
	gap: var(--space-3);
	justify-content: center;
	flex-wrap: wrap;
	margin-top: var(--space-4);
}
