/* ============================================================
   homepage.css — Immersive front-page enhancements
   ============================================================ */

/* ── Custom Cursor ──────────────────────────────────────────── */

body.home { cursor: none; }

.cursor-dot,
.cursor-ring {
	position: fixed;
	top: 0; left: 0;
	border-radius: 50%;
	pointer-events: none;
	z-index: 9999;
	will-change: transform;
}

.cursor-dot {
	width: 5px; height: 5px;
	background-color: var(--color-accent);
	margin: -2.5px 0 0 -2.5px;
	box-shadow: 0 0 6px rgba(22,243,253,0.8), 0 0 14px rgba(22,243,253,0.4);
	transition: width 0.2s ease, height 0.2s ease;
}

.cursor-ring {
	width: 34px; height: 34px;
	border: 1px solid rgba(255,255,255,0.22);
	margin: -17px 0 0 -17px;
	transition: width 0.3s ease, height 0.3s ease, border-color 0.3s ease, background-color 0.3s ease;
}

.cursor-dot.cursor--active {
	width: 8px; height: 8px;
	margin: -4px 0 0 -4px;
}

.cursor-ring.cursor--active {
	width: 52px; height: 52px;
	margin: -26px 0 0 -26px;
	border-color: rgba(22,243,253,0.5);
	background-color: rgba(22,243,253,0.04);
}

/* ── Film grain overlay — animated ──────────────────────────── */

@keyframes film-grain {
	0%   { transform: translate(0,    0);    }
	11%  { transform: translate(-3px, 2px);  }
	22%  { transform: translate(2px,  -3px); }
	33%  { transform: translate(-2px, -2px); }
	44%  { transform: translate(3px,  2px);  }
	55%  { transform: translate(-2px, 3px);  }
	66%  { transform: translate(1px,  -2px); }
	77%  { transform: translate(-3px, 1px);  }
	88%  { transform: translate(2px,  3px);  }
}

.hero-grain,
.showreel::before,
.services::before,
.concepts-prev::after {
	content: '';
	position: absolute;
	inset: -8px; /* extra bleed so shifted grain never shows edge */
	background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
	background-size: 180px 180px;
	opacity: 0.042;
	pointer-events: none;
	z-index: 2;
	mix-blend-mode: overlay;
	animation: film-grain 0.09s steps(1) infinite;
}

.showreel { position: relative; overflow: hidden; }
.services  { position: relative; overflow: hidden; }
.concepts-prev { position: relative; overflow: hidden; }
.hero-grain { z-index: 3; }

/* ── Hero enhancements ──────────────────────────────────────── */

.hero-meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 2rem;
}

.hero-city {
	font-size: 0.6rem;
	font-weight: 500;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: rgba(255,255,255,0.25);
}

.hero-rule {
	width: 60px;
	height: 1px;
	background-color: var(--color-accent);
	box-shadow: 0 0 8px rgba(22,243,253,0.7), 0 0 20px rgba(22,243,253,0.3);
	margin-bottom: 2rem;
	transform-origin: left center;
	/* GSAP animates scaleX from 0→1 */
}

.hero-scroll-indicator {
	position: absolute;
	bottom: 2.5rem;
	left: 50%;
	transform: translateX(-50%);
}

.hero-bottom-bar {
	position: absolute;
	bottom: 2.5rem;
	right: var(--space-md);
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 0.35rem;
	z-index: 5;
}

.hero-bottom-stat {
	font-size: 0.58rem;
	font-weight: 500;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: rgba(255,255,255,0.2);
}

/* ── Word-split text reveal ─────────────────────────────────── */

.word-wrap {
	display: inline-block;
	overflow: hidden;
	vertical-align: bottom;
}

.word {
	display: inline-block;
	transform: translateY(110%);
	transition: transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
	transition-delay: calc( var(--wi, 0) * 60ms );
}

.words-visible .word {
	transform: translateY(0);
}

/* ── Philosophy media parallax ──────────────────────────────── */

.philosophy {
	position: relative;
	overflow: hidden;
}

.philosophy-media {
	position: absolute;
	top: 0; right: 0;
	width: 38%;
	height: 100%;
	overflow: hidden;
	pointer-events: none;
}

.philosophy-media__img {
	width: 100%;
	height: 120%; /* extra height for parallax travel */
	object-fit: cover;
	object-position: center;
}

.philosophy-media__mask {
	position: absolute;
	inset: 0;
	background: linear-gradient(
		to right,
		#ffffff 0%,
		rgba(255,255,255,0.65) 30%,
		rgba(255,255,255,0) 100%
	);
}

@media (max-width: 900px) {
	.philosophy-media { display: none; }
}

/* ── Service Panels ─────────────────────────────────────────── */

.services-inner {
	max-width: var(--max-width);
	margin-inline: auto;
	padding-inline: var(--space-md);
}

.service-panel {
	display: grid;
	grid-template-columns: 1fr 1fr;
	min-height: 85vh;
}

.service-panel--flip {
	direction: rtl;
}

.service-panel--flip > * {
	direction: ltr;
}

.service-panel__img-wrap {
	position: relative;
	overflow: hidden;
}

.service-panel__img {
	width: 100%;
	height: 120%;
	object-fit: cover;
	display: block;
}

.service-panel__img-overlay {
	position: absolute;
	inset: 0;
	background: rgba(6,6,6,0.25);
	transition: background-color 0.4s ease;
}

.service-panel:hover .service-panel__img-overlay {
	background: rgba(6,6,6,0.15);
}

.service-panel__content {
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 5rem 4.5rem;
	background-color: var(--color-black);
	border-top: 1px solid rgba(255,255,255,0.05);
}

.service-panel__num {
	font-size: 0.58rem;
	font-weight: 500;
	letter-spacing: 0.24em;
	color: var(--color-accent);
	opacity: 0.6;
	margin-bottom: 1.5rem;
}

.service-panel__tag {
	display: inline-block;
	font-size: 0.58rem;
	font-weight: 500;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: rgba(255,255,255,0.2);
	border: 1px solid rgba(255,255,255,0.08);
	border-radius: 2px;
	padding: 0.25rem 0.6rem;
	margin-bottom: 1.75rem;
	align-self: flex-start;
}

.service-panel__title {
	font-size: clamp(2rem, 3.5vw, 3.2rem);
	font-weight: 300;
	letter-spacing: -0.04em;
	line-height: 0.95;
	color: var(--color-white);
	margin: 0 0 1.75rem;
}

.service-panel__desc {
	font-size: clamp(0.88rem, 1.2vw, 1rem);
	line-height: 1.75;
	color: rgba(255,255,255,0.42);
	margin: 0 0 2rem;
	max-width: 42ch;
}

.service-panel__caps {
	list-style: none;
	padding: 0;
	margin: 0 0 2.5rem;
	display: flex;
	flex-direction: column;
	gap: 0.55rem;
}

.service-panel__caps li {
	font-size: 0.72rem;
	letter-spacing: 0.08em;
	color: rgba(255,255,255,0.28);
	padding-left: 1rem;
	position: relative;
}

.service-panel__caps li::before {
	content: '—';
	position: absolute;
	left: 0;
	color: var(--color-accent);
	opacity: 0.5;
	font-size: 0.6rem;
}

.service-panel__cta {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.68rem;
	font-weight: 500;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: rgba(255,255,255,0.35);
	text-decoration: none;
	transition: color 0.25s ease, gap 0.3s ease, text-shadow 0.25s ease;
	align-self: flex-start;
}

.service-panel__cta:hover {
	color: var(--color-accent);
	gap: 0.85rem;
	text-shadow: 0 0 10px rgba(22,243,253,0.45);
}

@media (max-width: 860px) {
	.service-panel {
		grid-template-columns: 1fr;
		min-height: auto;
	}
	.service-panel--flip { direction: ltr; }
	.service-panel__img-wrap { aspect-ratio: 16/9; }
	.service-panel__img { height: 100%; }
	.service-panel__content { padding: 3rem var(--space-md); }
}

/* ── Showreel Bento ─────────────────────────────────────────── */

.showreel {
	background-color: #080808;
	padding: 5rem 0 4rem;
}

.showreel-header {
	display: flex;
	align-items: center;
	gap: 1.5rem;
	padding: 0 var(--space-md);
	margin-bottom: 2rem;
	max-width: var(--max-width);
	margin-inline: auto;
}

.showreel-label {
	font-size: 0.62rem;
	font-weight: 500;
	letter-spacing: 0.26em;
	text-transform: uppercase;
	color: rgba(255,255,255,0.3);
	flex-shrink: 0;
}

.showreel-rule {
	flex: 1;
	height: 1px;
	background: rgba(255,255,255,0.07);
}

.showreel-grid {
	display: grid;
	grid-template-columns: 2.5fr 0.8fr 0.8fr 1fr;
	gap: 3px;
	padding: 0 var(--space-md);
	max-width: var(--max-width);
	margin-inline: auto;
}

.showreel-cell {
	position: relative;
	overflow: hidden;
	cursor: pointer;
	background-color: #111;
	text-decoration: none;
	color: inherit;
	display: block;
}

.showreel-cell--main {
	grid-column: 1;
	grid-row: 1 / 3;
	aspect-ratio: 16 / 9;
	align-self: center;
}

.showreel-cell--portrait {
	grid-column: 4;
	grid-row: 1 / 3;
	aspect-ratio: 9 / 16;
	align-self: center;
}

.showreel-cell--wide {
	grid-column: 2 / 4;
	grid-row: 2;
}

.showreel-cell--banner {
	grid-column: 1 / -1;
	cursor: pointer;
}

.showreel-cell--banner .showreel-cell__media {
	aspect-ratio: 21 / 6;
	height: auto;
}

.showreel-cell__media {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), filter 0.4s ease;
	filter: grayscale(20%) brightness(0.92);
}

.showreel-cell:hover .showreel-cell__media {
	transform: scale(1.04);
	filter: grayscale(0%) brightness(1);
}

.showreel-cell__overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(0,0,0,0.65) 0%, transparent 55%);
	opacity: 0.8;
	transition: opacity 0.3s ease;
}

.showreel-cell:hover .showreel-cell__overlay {
	opacity: 0.5;
}

.showreel-cell__label {
	position: absolute;
	bottom: 1rem;
	left: 1rem;
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
	opacity: 0;
	transform: translateY(6px);
	transition: opacity 0.3s ease, transform 0.3s ease;
}

.showreel-cell:hover .showreel-cell__label {
	opacity: 1;
	transform: translateY(0);
}

.showreel-cell__type {
	font-size: 0.55rem;
	font-weight: 500;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: rgba(255,255,255,0.45);
}

.showreel-cell__name {
	font-size: 0.8rem;
	font-weight: 400;
	color: rgba(255,255,255,0.9);
	letter-spacing: 0.02em;
}

/* Play hint centred on the banner cell */
.showreel-cell__play-hint {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	display: flex;
	align-items: center;
	gap: 0.6rem;
	color: rgba(255,255,255,0.55);
	font-size: 0.6rem;
	font-weight: 500;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	transition: color 0.3s ease, opacity 0.3s ease;
	pointer-events: none;
}

.showreel-cell--banner:hover .showreel-cell__play-hint {
	color: rgba(255,255,255,0.9);
}

/* ── Showreel modal (sound-design full reel player) ─────────────── */

.sr-modal {
	position: fixed;
	inset: 0;
	z-index: 1200;
	display: none;
	align-items: center;
	justify-content: center;
}

.sr-modal.is-open {
	display: flex;
}

.sr-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0,0,0,0.92);
	cursor: pointer;
}

.sr-modal__stage {
	position: relative;
	z-index: 1;
	max-width: min(92vw, 1200px);
	width: 100%;
}

.sr-modal__video {
	display: block;
	width: 100%;
	max-height: 85vh;
	background: #000;
}

.sr-modal__close {
	position: absolute;
	top: -2.4rem;
	right: 0;
	background: transparent;
	border: none;
	color: rgba(255,255,255,0.55);
	font-size: 1.6rem;
	line-height: 1;
	padding: 0.3rem 0.5rem;
	cursor: pointer;
	transition: color 0.2s ease;
}

.sr-modal__close:hover {
	color: #fff;
}

/* ── Showreel footer ────────────────────────────────────────────── */

.showreel-footer {
	display: flex;
	justify-content: flex-end;
	padding: 1.5rem var(--space-md) 0;
	max-width: var(--max-width);
	margin-inline: auto;
}

.showreel-cta {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.65rem;
	font-weight: 500;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: rgba(255,255,255,0.35);
	text-decoration: none;
	transition: color 0.2s ease, gap 0.3s ease;
}

.showreel-cta:hover {
	color: rgba(255,255,255,0.75);
	gap: 0.8rem;
}

@media (max-width: 900px) {
	.showreel-grid { grid-template-columns: 1fr 1fr; }
	.showreel-cell--main { grid-column: 1 / -1; grid-row: auto; aspect-ratio: unset; }
	.showreel-cell--main .showreel-cell__media { aspect-ratio: 16 / 7; height: auto; }
	.showreel-cell--portrait { grid-column: auto; grid-row: auto; aspect-ratio: unset; }
	.showreel-cell--portrait .showreel-cell__media { aspect-ratio: 3 / 4; height: auto; }
	.showreel-cell--wide { grid-column: 1 / -1; grid-row: auto; }
	.showreel-cell--banner .showreel-cell__media { aspect-ratio: 16 / 5; height: auto; }
	.showreel-cell__label { opacity: 1; transform: none; }
	.showreel-cell__play-hint { opacity: 1; }
}

@media (max-width: 540px) {
	.showreel-grid { grid-template-columns: 1fr; gap: 2px; }
	.showreel-cell--main .showreel-cell__media { aspect-ratio: 16 / 9; }
	.showreel-cell--portrait .showreel-cell__media { aspect-ratio: 9 / 16; }
	.showreel-cell--banner .showreel-cell__media { aspect-ratio: 4 / 3; }
}

/* ── Reduced motion overrides ───────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
	.word { transform: none; transition: none; }
	.cursor-rf { display: none; }
	.showreel-cell__media { transition: none; }
	.service-panel__img { transition: none; }
	.hero-grain,
	.showreel::before,
	.services::before,
	.concepts-prev::after { animation: none; }
}

/* .film-leader styles live in main.css (loads on every page) */

/* ── Scan Lines (persistent) ────────────────────────────────── */

body.home .scan-lines {
	position: fixed;
	inset: 0;
	background: repeating-linear-gradient(
		to bottom,
		transparent 0px, transparent 3px,
		rgba(0,0,0,0.022) 3px, rgba(0,0,0,0.022) 4px
	);
	pointer-events: none;
	z-index: 9990;
}

/* ── Film Strip Rail ────────────────────────────────────────── */

.film-strip {
	position: fixed;
	left: 0;
	top: 0;
	bottom: 0;
	width: 26px;
	z-index: 800;
	pointer-events: none;
	background: rgba(3,3,3,0.94);
	border-right: 1px solid rgba(255,255,255,0.055);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 7px;
	padding: 7px 0;
	overflow: hidden;
}

.film-sprocket {
	width: 12px;
	height: 8px;
	border: 1px solid rgba(255,255,255,0.1);
	border-radius: 1.5px;
	background: rgba(255,255,255,0.018);
	flex-shrink: 0;
}

@media (max-width: 900px) {
	.film-strip { display: none; }
}

/* ── Timecode HUD ───────────────────────────────────────────── */

.timecode-hud {
	position: fixed;
	bottom: 1.75rem;
	left: 36px;
	z-index: 801;
	pointer-events: none;
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
}

.timecode-hud__reel {
	font-family: monospace;
	font-size: 0.48rem;
	letter-spacing: 0.18em;
	color: rgba(255,255,255,0.18);
	text-transform: uppercase;
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.timecode-hud__rec {
	color: var(--color-accent);
	animation: rec-pulse 2.4s ease-in-out infinite;
}

@keyframes rec-pulse {
	0%, 100% { opacity: 0; }
	50%       { opacity: 0.75; }
}

.timecode-hud__tc {
	font-family: monospace;
	font-size: 0.6rem;
	letter-spacing: 0.1em;
	color: rgba(255,255,255,0.2);
}

@media (max-width: 900px) {
	.timecode-hud { display: none; }
}

/* ── Reel Changeover Cue ────────────────────────────────────── */

.reel-cue {
	position: fixed;
	top: calc(var(--header-h, 72px) + 1.25rem);
	right: 1.5rem;
	z-index: 801;
	width: 9px;
	height: 9px;
	border-radius: 50%;
	border: 1px solid rgba(255,255,255,0.55);
	background: transparent;
	pointer-events: none;
	opacity: 0;
}

.reel-cue.is-active {
	animation: cue-blink 0.8s ease-in-out forwards;
}

@keyframes cue-blink {
	0%   { opacity: 0; }
	15%  { opacity: 0.8; }
	30%  { opacity: 0; }
	45%  { opacity: 0.8; }
	60%  { opacity: 0; }
	75%  { opacity: 0.6; }
	100% { opacity: 0; }
}

/* ── Hero Viewfinder Corners ────────────────────────────────── */

.hero-vf-corner {
	position: absolute;
	width: 20px;
	height: 20px;
	pointer-events: none;
	z-index: 4;
	border-color: rgba(255,255,255,0.2);
	border-style: solid;
	border-width: 0;
}
.hero-vf-corner--tl { top: calc(var(--header-h, 72px) + 2rem); left: calc(var(--space-md) + 2px); border-top-width: 1px; border-left-width: 1px; }
.hero-vf-corner--tr { top: calc(var(--header-h, 72px) + 2rem); right: calc(var(--space-md) + 2px); border-top-width: 1px; border-right-width: 1px; }
.hero-vf-corner--bl { bottom: 2.5rem; left: calc(var(--space-md) + 2px); border-bottom-width: 1px; border-left-width: 1px; }
.hero-vf-corner--br { bottom: 2.5rem; right: calc(var(--space-md) + 2px); border-bottom-width: 1px; border-right-width: 1px; }

/* ============================================================
   MOBILE RESPONSIVE OVERRIDES
   ============================================================ */

@media (max-width: 640px) {

	/* ── Hero ─────────────────────────────────────────────── */
	.hero-bottom-bar { display: none; }

	.hero-scroll-indicator { display: none; }

	/* ── Film strip sidebar — hide on mobile ──────────────── */
	.film-strip-sidebar { display: none; }

	.timecode-hud { display: none; }

	/* ── Showreel header ──────────────────────────────────── */
	.showreel-header {
		flex-direction: column;
		align-items: flex-start;
		gap: 0.75rem;
	}

	.showreel-footer { padding: 1rem var(--space-md) 0; }

	/* ── Service panels ───────────────────────────────────── */
	.service-panel__content { padding: 2.5rem var(--space-md); }

	.service-panel__title { font-size: clamp(1.8rem, 8vw, 2.4rem); }

	/* ── Concepts preview ─────────────────────────────────── */
	.concepts-prev__title { font-size: clamp(2.8rem, 14vw, 4.5rem); }
}

@media (max-width: 480px) {

	/* ── Showreel grid — single column ────────────────────── */
	.showreel-grid {
		grid-template-columns: 1fr;
		grid-template-rows: auto;
	}

	.showreel-grid .showreel-cell { grid-column: auto; grid-row: auto; }

	/* ── Philosophy media ─────────────────────────────────── */
	.philosophy-media { display: none; }
}
