/* Greygram — front-page sections (Work, Services, About, CTA). */

/* Scroll-triggered reveal — JS toggles .is-visible when element enters viewport. */

/* block mode: whole element fades and rises */
.reveal {
	opacity: 0;
	transform: translateY(32px);
	transition: opacity 0.85s cubic-bezier(0.2, 0.8, 0.2, 1),
	            transform 0.85s cubic-bezier(0.2, 0.8, 0.2, 1);
	will-change: opacity, transform;
}

.reveal.is-visible {
	opacity: 1;
	transform: none;
}

/* line mode: each word starts hidden, JS sets per-line transition-delay so
   visible lines cascade in one at a time */
.reveal-lines .reveal-word {
	display: inline-block;
	opacity: 0;
	transform: translateY(28px);
	transition: opacity 0.7s cubic-bezier(0.2, 0.8, 0.2, 1),
	            transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
	will-change: opacity, transform;
}

.reveal-lines.is-visible .reveal-word {
	opacity: 1;
	transform: none;
}


.section {
	padding-top: clamp(5rem, 11vw, 9rem);
	padding-bottom: clamp(5rem, 11vw, 9rem);
}

/* Shared section heading */
.section-head { margin-bottom: clamp(2.5rem, 6vw, 5rem); }

/* small italic uppercase label above each section's heading */
.section-label {
	display: block;
	font-family: 'Libre Baskerville', serif;
	font-style: italic;
	text-transform: uppercase;
	font-size: 1.05rem;
	color: var(--grey);
	opacity: 0.65;
	letter-spacing: 0.02em;
	margin-bottom: 1rem;
}

/* inline animated-gradient text — a "shimmer" word within a heading.
   Needs display:inline-block + -webkit-text-fill-color for the gradient to
   actually clip to the text in Chrome/Safari. */
.h-word {
	display: inline-block;
	color: transparent;
	-webkit-text-fill-color: transparent;
	/* dark range only — never goes lighter than the page bg, so the word stays
	   readable through the full shimmer cycle */
	background-image: linear-gradient(90deg, var(--ink) 0%, #5a6270 50%, var(--ink) 100%);
	background-size: 200% 100%;
	background-repeat: repeat-x; /* tile so the gradient never runs off-screen */
	-webkit-background-clip: text;
	background-clip: text;
	animation: ctaShimmer 7.5s linear infinite;
	/* descender room: background-clip:text clips to the element box;
	   padding + negative margin preserve layout while giving g/j/p/y tails space */
	padding-bottom: 0.15em;
	margin-bottom: -0.15em;
}

/* big section headings — scoped so each can be tuned independently */
.section-heading {
	font-weight: 500;
	font-size: clamp(2.475rem, 6.93vw, 5.445rem);
	line-height: 0.98;
	letter-spacing: -0.04em;
}

/* ===== Work ===== */
.work-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: clamp(1.5rem, 3vw, 2.5rem);
}

.work-card {
	display: block;
	transform-origin: center;
	transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.work-card:hover,
.work-card:active { transform: scale(1.1); }

.work-card__media {
	position: relative;
	display: block;
	aspect-ratio: 4 / 3;
	background: var(--ink);
	border-radius: 18px;
	overflow: hidden;
	color: var(--paper);
}

.work-card__cover {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	z-index: 1;
	transition: opacity 0.5s ease;
}

.work-card--has-video:hover .work-card__cover { opacity: 0; }

.work-card__video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	z-index: 0;
	opacity: 0;
	transition: opacity 0.5s ease;
}

.work-card--has-video:hover .work-card__video { opacity: 1; }

.work-card--has-video .work-card__media::before { display: none; }

/* image/visual layer — zooms ~10% on hover, clipped by the media's overflow.
   Radial placeholder so the zoom is visible until real images are added. */
.work-card__media::before {
	content: '';
	position: absolute;
	inset: 0;
	background: radial-gradient(120% 120% at 30% 25%, var(--grey-light), var(--ink) 70%);
	transition: transform 0.6s ease;
}

.work-card:hover .work-card__media::before {
	transform: none;
}

/* full tint for legibility; eases off on hover to reveal the (zoomed) image */
.work-card__media::after {
	content: '';
	position: absolute;
	inset: 0;
	background: rgba(20, 24, 31, 0.4);
	transition: background 0.5s ease;
}

.work-card:hover .work-card__media::after {
	background: rgba(20, 24, 31, 0.18);
}

/* single row, vertically centred: title left, category right; split on hover */
.work-card__meta {
	position: absolute;
	left: 0;
	right: 0;
	top: 50%;
	transform: translateY(-50%);
	z-index: 1;
	display: flex;
	flex-direction: row;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	padding: 0 clamp(1.5rem, 3vw, 2.5rem);
}

.work-card__title,
.work-card__cat {
	transition: transform 0.3s linear, opacity 0.25s linear;
}

.work-card:hover .work-card__title {
	transform: translateX(-45%);
	opacity: 0;
}

.work-card:hover .work-card__cat {
	transform: translateX(45%);
	opacity: 0;
}

.work-card__title {
	font-weight: 700;
	font-size: clamp(1.6rem, 3vw, 2.6rem);
	letter-spacing: -0.02em;
	color: var(--paper);
}

.work-card__cat {
	font-family: 'Libre Baskerville', serif;
	font-style: italic;
	font-size: 1.05rem;
	color: var(--grey-light);
}

/* ===== Services — sticky stacked cards (dark) ===== */
.section--services {
	background: transparent;
	color: var(--ink);
}

.services-stack {
	position: relative;
	padding: 0 var(--gutter);
}

/* Real spacer (not padding) AFTER the last card so it has content to stick
   against — gives the last card a dwell/lock at centre before it scrolls away.
   padding-bottom does NOT extend a sticky child's range; a generated box does. */
.services-stack::after {
	content: '';
	display: block;
	height: 40vh;
}

.service-card {
	position: sticky;
	/* top = 50vh - half the card height (76vh) so it pins dead-centre WITHOUT a
	   translateY, which means the unpinned card sits at its natural flow position
	   (just below the heading) instead of being pulled up over it. */
	top: 15.8vh;
	transform-origin: center center;
	width: 100%;
	max-width: var(--maxw);
	margin: 0 auto;
	height: 75.24vh;
	color: var(--paper);
	border-radius: 50px;
	overflow: hidden;
	will-change: transform;
}

.service-card + .service-card { margin-top: 15.4vh; }

/* All cards pin centered (top:50%); JS lifts + shrinks the ones already
   passed so they recede upward. Dark ramp (ink → grey), darkest at the back. */
.service-card--1 { background: var(--ink-deep); }
.service-card--2 { background: #2f343c; }
.service-card--3 { background: var(--service-mid); }
.service-card--4 { background: #646c77; }

.service-card__inner {
	min-height: inherit;
	padding: clamp(2.5rem, 5vw, 5rem);
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
}

.service-card__star {
	position: absolute;
	top: clamp(2rem, 4vw, 3.5rem);
	left: clamp(2rem, 4vw, 3.5rem);
	width: clamp(4rem, 9vw, 8rem);
	height: clamp(4rem, 9vw, 8rem);
	opacity: 0.35;
	animation: starSpin 8s linear infinite;
}

@keyframes starSpin {
	from { transform: rotate(0deg); }
	to   { transform: rotate(360deg); }
}

.service-card__title > span { display: block; }
.service-card__title-dim { opacity: 0.7; }

.service-card__title {
	font-weight: 400;
	font-size: clamp(4.05rem, 9.9vw, 9rem);
	line-height: 0.94;
	letter-spacing: -0.04em;
	text-align: right;
	padding-bottom: 4rem;
	border-bottom: 1px solid rgba(231, 233, 234, 0.2);
	margin-bottom: 2rem;
}

.service-card__list {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	justify-content: flex-start;
	margin-bottom: 1rem;
}

.service-card__list li {
	font-family: 'Anthine', sans-serif;
	font-size: 0.88rem;
	color: var(--paper);
	border: 0.5px solid rgba(231, 233, 234, 0.25);
	border-radius: 999px;
	padding: 0.4rem 1rem;
}

.service-card__desc {
	font-size: clamp(1.35rem, 2.25vw, 1.725rem);
	line-height: 1.4;
	color: var(--paper);
	text-align: left;
}

/* ===== About ===== */
.about-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: clamp(2rem, 5vw, 3.5rem);
	align-items: start;
}

.about-heading {
	font-weight: 800;
	font-size: clamp(2.75rem, 6.6vw, 5.5rem);
	line-height: 1.05;
	letter-spacing: -0.03em;
	margin-top: 1rem;
}

.about-heading em {
	font-family: 'Libre Baskerville', serif;
	font-weight: 500;
}

.about-body {
	column-count: 2;
	column-gap: clamp(2rem, 4vw, 4rem);
}

.about-body p {
	font-size: 1.1rem;
	font-weight: 300;
	letter-spacing: 0.05em;
	line-height: 1.7;
	color: var(--ink);
	break-inside: avoid;
}

.about-body p + p { margin-top: 1.25rem; }

@media (max-width: 760px) {
	.about-body { column-count: 1; }
}

/* ===== CTA ===== */
.section--cta {
	color: var(--ink);
	text-align: center;
}

.cta-inner {
	display: flex;
	flex-direction: column;
	align-items: center;
}

/* "Let's Talk" headline with the 3D GG symbol sitting behind it */
.cta-headline {
	position: relative;
	display: inline-block;
	margin-top: 10vh;
	margin-bottom: clamp(8rem, 16vw, 12rem);
}

.cta-mark {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: clamp(336px, 43.2vw, 672px);
	height: clamp(336px, 43.2vw, 672px);
	z-index: 2; /* overlay on top of .cta-title */
	pointer-events: none;
	opacity: 1;
	--poster-color: transparent;
}

/* hide model-viewer's built-in loading progress bar (the thin line that
   flashes across the top of the 3D area during scroll/repaint) */
.cta-mark::part(default-progress-bar) { display: none; }

.cta-title {
	position: relative;
	z-index: 1;
	font-weight: 500;
	font-size: clamp(8rem, 24vw, 22rem);
	line-height: 0.95;
	letter-spacing: -0.04em;
	/* shimmer: gradient slides through the letters (background-clip: text) */
	color: transparent;
	background: linear-gradient(90deg, var(--ink) 0%, var(--grey-light) 50%, var(--ink) 100%) 0 0 / 200% 200%;
	-webkit-background-clip: text;
	background-clip: text;
	animation: ctaShimmer 7.5s linear infinite;
}

@keyframes ctaShimmer {
	0%   { background-position:   0% 50%; }
	100% { background-position: 200% 50%; }
}

/* Lede paragraph below headline — matches Work heading size/layout */
.cta-heading {
	width: 100%;
	margin: 0 0 clamp(2.5rem, 5vw, 4rem);
	text-align: left;
	font-weight: 500;
	font-size: clamp(2.475rem, 6.93vw, 5.445rem);
	line-height: 0.98;
	letter-spacing: -0.04em;
	color: var(--ink);
}

.cta-heading em {
	font-family: 'Libre Baskerville', serif;
	font-style: italic;
	font-weight: 400;
}

/* Light island matching the nav island colour — full container width to match
   the service cards in #services (same --maxw + gutter system). */
.cta-island {
	width: 100%;
	background: rgba(210, 214, 216, 0.5625);
	color: var(--ink);
	border-radius: 24px;
	padding: clamp(6rem, 12vw, 9rem) clamp(1.5rem, 3vw, 2.5rem);
}

.cta-island__prompt {
	font-family: 'Libre Baskerville', serif;
	font-style: italic;
	font-size: clamp(1.4rem, 2.4vw, 2rem);
	line-height: 1.2;
	color: var(--ink);
	margin: 0 0 clamp(3rem, 6vw, 4rem);
}

.cta-island__actions {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: nowrap;
	gap: 0.75rem;
	/* fixed row height — never changes no matter which chip is hovered, so the
	   island stays put */
	height: 6rem;
}

/* dark chips on the light island — colour matches service-card--3.
   Hover: chip grows ~15% (font-size + padding) and turns darkest; siblings
   shift out of the way naturally via flex layout. */
.cta-chip {
	display: inline-block;
	flex-shrink: 0;
	padding: 1.4rem 2.8rem;
	background: var(--service-mid);
	color: var(--paper);
	border-radius: 999px;
	font-size: 1.9rem;
	line-height: 1; /* predictable height so the row min-height holds */
	font-weight: 500;
	letter-spacing: 0.01em;
	transition:
		background 0.375s ease,
		font-size 0.4375s cubic-bezier(0.2, 0.8, 0.2, 1),
		padding 0.4375s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Mac-dock feel: while the row is being hovered, all chips shrink to 75%;
   the hovered chip itself overrides back up to 115% (and turns darkest). */
.cta-island__actions:hover .cta-chip {
	font-size: 1.425rem;
	padding: 1.05rem 2.1rem;
}

.cta-island__actions:hover .cta-chip:hover {
	background: var(--ink-deep);
	font-size: 2.185rem;
	padding: 1.61rem 3.22rem;
}

/* ===== Responsive ===== */
@media (max-width: 980px) {
	.about-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
	.service-card__title { font-size: clamp(2rem, 10vw, 4rem); }
	.service-card__star {
		width: clamp(3.2rem, 7.2vw, 6.4rem);
		height: clamp(3.2rem, 7.2vw, 6.4rem);
	}
	.service-card__inner { padding-top: 5rem; }
	.service-card__desc { font-size: clamp(1.215rem, 2.025vw, 1.553rem); }
}

@media (max-width: 600px) {
	/* Services card text -15% on mobile */
	.service-card__title { font-size: clamp(1.7rem, 8.5vw, 3.4rem); }
	.service-card__desc { font-size: clamp(1.03rem, 1.72vw, 1.32rem); }
	.service-card__list li { font-size: 0.748rem; }
}

@media (max-width: 560px) {
	.work-grid { grid-template-columns: 1fr; }
	.cta-island__actions {
		flex-direction: column;
		height: auto;
		align-items: stretch;
	}
	.cta-chip { text-align: center; }
}

/* Standalone Services/About pages: first section sits under the fixed nav —
   clear it on mobile so the section label isn't tucked behind the island. */
@media (max-width: 600px) {
	#swup > .section--services:first-child,
	#swup > .section--about:first-child {
		padding-top: calc(var(--nav-h) + 3rem + env(safe-area-inset-top));
	}
}

/* ===== FAQ (Services page) ===== */
.section--faq .section-heading { max-width: 18ch; }

.faq-list {
	border-top: 1px solid rgba(27, 34, 44, 0.12);
}

.faq-item {
	border-bottom: 1px solid rgba(27, 34, 44, 0.12);
}

.faq-q {
	list-style: none;
	cursor: none;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1.5rem;
	padding: clamp(1.25rem, 2.5vw, 1.75rem) 0;
	font-size: clamp(1.15rem, 2.2vw, 1.6rem);
	font-weight: 500;
	letter-spacing: -0.01em;
	color: var(--ink);
	transition: opacity 0.2s ease;
}

.faq-q::-webkit-details-marker { display: none; }

.faq-q::after {
	content: '+';
	flex-shrink: 0;
	font-size: 1.5em;
	font-weight: 300;
	line-height: 1;
	transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.faq-item[open] .faq-q::after { transform: rotate(45deg); }

.faq-q:hover { opacity: 0.55; }

.faq-a {
	padding: 0 0 clamp(1.25rem, 2.5vw, 1.75rem);
	max-width: 60ch;
}

.faq-a p {
	font-size: 1.05rem;
	line-height: 1.7;
	font-weight: 300;
	color: var(--grey);
}

/* ===== 404 (full-screen, centered; nav + footer hidden) ===== */
body.error404 .site-header,
body.error404 .mobile-nav,
body.error404 .site-footer { display: none; }

.error-404 {
	min-height: 100vh;
	min-height: 100dvh;
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 2rem var(--gutter);
}

.error-404__inner {
	display: flex;
	flex-direction: column;
	align-items: center;
}

.error-404__code {
	font-weight: 100;
	font-size: clamp(7rem, 30vw, 22rem);
	line-height: 0.85;
	letter-spacing: -0.05em;
	color: var(--ink);
}

.error-404__title {
	margin-top: 0.75rem;
	display: inline-block;
	font-weight: 500;
	font-size: clamp(2rem, 6vw, 4rem);
	line-height: 1;
	letter-spacing: -0.03em;
	color: transparent;
	-webkit-text-fill-color: transparent;
	background-image: linear-gradient(90deg, var(--ink) 0%, #5a6270 50%, var(--ink) 100%);
	background-size: 200% 100%;
	background-repeat: repeat-x;
	-webkit-background-clip: text;
	background-clip: text;
	animation: ctaShimmer 7.5s linear infinite;
	padding-bottom: 0.15em;
	margin-bottom: -0.15em;
}

.error-404__text {
	margin-top: 1.5rem;
	max-width: 46ch;
	font-size: 1.1rem;
	line-height: 1.7;
	font-weight: 300;
	color: var(--grey);
}

.error-404__links {
	margin-top: 2.5rem;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.75rem 1rem;
}

.error-404__links a {
	cursor: none;
	display: inline-block;
	padding: 0.85rem 1.9rem;
	border-radius: 999px;
	font-size: 1rem;
	font-weight: 500;
	letter-spacing: 0.01em;
	text-decoration: none;
	color: var(--ink);
	background: transparent;
	border: 1px solid rgba(27, 34, 44, 0.25);
	transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease,
	            transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.error-404__links a:hover {
	background: var(--ink);
	border-color: var(--ink);
	color: var(--paper);
	transform: translateY(-2px);
}

/* primary CTA pill — filled by default */
.error-404__links a.error-404__cta {
	background: var(--ink);
	border-color: var(--ink);
	color: var(--paper);
}

.error-404__links a.error-404__cta:hover {
	background: var(--ink-deep);
	border-color: var(--ink-deep);
}
