/* ==========================================================================
   Sinha Theme — Main Stylesheet
   Breakpoints: mobile <768px | small desktop <1200px | fluid in between
   ========================================================================== */

/* --------------------------------------------------------------------------
   Custom Properties
   -------------------------------------------------------------------------- */

:root {
	/* Colours */
	--color-dark:  #020101;
	--color-light: #F7F7EF;

	/* Font family */
	--font-family: 'Lexend', sans-serif;

	/* Font weights */
	--weight-light:   300;
	--weight-regular: 400;
	--weight-medium:  500;

	/*
	 * Fluid typography using clamp().
	 * Formula: clamp(mobile-size, slope-intercept + slope * 100vw, desktop-size)
	 * Fluid range: 768px → 1200px (432px span)
	 *
	 * h1:           36px → 64px   (28px rise)
	 * h2:           24px → 48px   (24px rise)
	 * h3:           20px → 32px   (12px rise)
	 * h4:           16px → 24px   ( 8px rise)
	 * body/p:       16px → 20px   ( 4px rise)
	 * quote:        16px → 20px   ( 4px rise)
	 * quote-author: 13px → 16px   ( 3px rise)
	 */
	--font-size-h1:           clamp(2.25rem,  -0.861rem + 6.481vw, 4rem);
	--font-size-h2:           clamp(1.5rem,   -1.167rem + 5.556vw, 3rem);
	--font-size-h3:           clamp(1.25rem,  -0.083rem + 2.778vw, 2rem);
	--font-size-h4:           clamp(1rem,      0.111rem + 1.852vw, 1.5rem);
	--font-size-body:         clamp(1rem,      0.556rem + 0.926vw, 1.25rem);
	--font-size-quote:        clamp(1rem,      0.556rem + 0.926vw, 1.25rem);
	--font-size-quote-author: clamp(0.8125rem, 0.479rem + 0.694vw, 1rem);
	--font-size-nav: clamp(0.8125rem, 0.479rem + 0.694vw, 1rem);

	/* Spacing scale */
	--space-xs:  0.5rem;
	--space-sm:  1rem;
	--space-md:  1.5rem;
	--space-lg:  2.5rem;
	--space-xl:  4rem;
	--space-2xl: 6rem;

	/* Vertical rhythm tokens (heading↔content↔image). Alias the scale on
	   desktop; collapse to --space-md on mobile via the override below. */
	--flow-lg: var(--space-lg);
	--flow-xl: var(--space-xl);

	/* Layout */
	--container-max: 83.75rem; /* 1340px */
	--container-pad: 1.25rem; /* 20px on mobile */

	/* Transitions */
	--transition-base: 200ms ease;

	/* Header height — updated at runtime by JS; fallback covers non-JS */
	--header-height: 72px;

	/* Hero animation display type — 64px semibold on large viewports,
	   scales down on shorter screens using vh so the full stack fits */
	--font-size-hero: clamp(2rem, 6vh, 4rem);
}

/* Collapse vertical rhythm to --space-md (1.5rem) on mobile. */
@media (max-width: 767px) {
	:root {
		--flow-lg: var(--space-md);
		--flow-xl: var(--space-md);
	}
}

/* --------------------------------------------------------------------------
   Reset & Base
   -------------------------------------------------------------------------- */

*,
*::before,
*::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

html {
	font-size: 100%; /* 16px base */
	/* No scroll-behavior: smooth — it conflicts with GSAP ScrollToPlugin /
	   ScrollTrigger, which drive scrolling per-frame in JS. */
	-webkit-text-size-adjust: 100%;
}

body {
	font-family: var(--font-family);
	font-size: var(--font-size-body);
	font-weight: var(--weight-light);
	line-height: 1.6;
	color: var(--color-dark);
	background-color: var(--color-light);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */

h1,
h2,
h3,
h4,
h5,
h6 {
	line-height: 1.2;
	letter-spacing: -0.02em;
}

h1 {
	font-size: var(--font-size-h1);
	font-weight: var(--weight-medium);
}

h2 {
	font-size: var(--font-size-h2);
	font-weight: var(--weight-regular);
}

h3 {
	font-size: var(--font-size-h3);
	font-weight: var(--weight-regular);
}

h4 {
	font-size: var(--font-size-h4);
	font-weight: var(--weight-medium);
}

h5,
h6 {
	font-size: var(--font-size-body);
	font-weight: var(--weight-medium);
}

p {
	font-size: var(--font-size-body);
	font-weight: var(--weight-light);
	line-height: 1.3;
	max-width: 68ch;
}

p + p {
	margin-top: var(--space-md);
}

/* --------------------------------------------------------------------------
   Blockquote
   -------------------------------------------------------------------------- */

blockquote {
	font-size: var(--font-size-quote);
	font-weight: var(--weight-light);
	line-height: 1.6;
	border-left: 2px solid var(--color-dark);
	padding-left: var(--space-md);
	margin: var(--space-lg) 0;
}

blockquote p {
	font-size: inherit;
	max-width: none;
}

blockquote cite,
blockquote .wp-block-quote__citation {
	display: block;
	font-size: var(--font-size-quote-author);
	font-weight: var(--weight-light);
	font-style: normal;
	margin-top: var(--space-xs);
	opacity: 0.6;
}

/* --------------------------------------------------------------------------
   Links
   -------------------------------------------------------------------------- */

a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 0.2em;
	transition: opacity var(--transition-base);
}

a:hover,
a:focus-visible {
	opacity: 0.65;
}

a:focus-visible {
	outline: 2px solid var(--color-dark);
	outline-offset: 3px;
	border-radius: 2px;
}

/* --------------------------------------------------------------------------
   Lists
   -------------------------------------------------------------------------- */

ul,
ol {
	padding-left: 1.25em;
}

ul li,
ol li {
	font-size: var(--font-size-body);
	font-weight: var(--weight-light);
	line-height: 1.7;
}

li + li {
	margin-top: 0.35em;
}

/* --------------------------------------------------------------------------
   Images & Media
   -------------------------------------------------------------------------- */

img,
video,
iframe {
	max-width: 100%;
	height: auto;
	display: block;
}

figure {
	margin: var(--space-lg) 0;
}

figcaption {
	font-size: var(--font-size-quote-author);
	font-weight: var(--weight-light);
	margin-top: var(--space-xs);
	opacity: 0.6;
}

/* --------------------------------------------------------------------------
   Layout — Container
   -------------------------------------------------------------------------- */

.container {
	width: 100%;
	max-width: var(--container-max);
	margin-inline: auto;
	padding-inline: var(--container-pad);
}

@media (min-width: 48rem) { /* 768px */
	.container {
		--container-pad: 2.5rem;
	}
}

@media (min-width: 75rem) { /* 1200px */
	.container {
		--container-pad: 3rem;
	}
}

/* --------------------------------------------------------------------------
   Site Layout
   -------------------------------------------------------------------------- */

.site {
	display: flex;
	flex-direction: column;
	min-height: 100dvh;
	overflow-x: clip; /* prevent 100vw full-bleed from creating horizontal scroll */
}

.site-main {
	flex: 1;
	padding-bottom: var(--space-xl);
}

/* --------------------------------------------------------------------------
   Site Header
   -------------------------------------------------------------------------- */

.site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	padding-block: var(--space-md);
	backdrop-filter: blur(5px);
	-webkit-backdrop-filter: blur(5px);
	color: var(--color-dark);
	transition: color var(--transition-base);
}

.site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-sm);
}

.site-header__branding {
	display: inline-flex;
	align-items: center;
	text-decoration: none;
	opacity: 1;
	transition: opacity var(--transition-base);
}

.site-header__branding:hover,
.site-header__branding:focus-visible {
	opacity: 1;
}

/* "Sanjay Sinha" slides out to the right of the icon on hover (desktop only).
   Clipped via its own max-width + overflow so the leading space collapses too. */
.site-header__brand-text {
	display: inline-block;
	font-size: var(--font-size-nav);
	font-weight: var(--weight-medium);
	letter-spacing: 0.02em;
	line-height: 1.4;
	color: var(--color-dark);
	white-space: nowrap;
	overflow: hidden;
	max-width: 0;
	padding-left: 0;
	opacity: 0;
	transform: translateX(-0.5rem);
	transition:
		max-width var(--transition-base),
		padding-left var(--transition-base),
		opacity var(--transition-base),
		transform var(--transition-base);
}

@media (min-width: 768px) {
	.site-header__branding:hover .site-header__brand-text,
	.site-header__branding:focus-visible .site-header__brand-text {
		max-width: 12rem;
		padding-left: 1rem;
		opacity: 1;
		transform: translateX(0);
	}
}

/* Keep the sliding text visible against dark sections. */
.site-header.is-dark .site-header__brand-text {
	color: var(--color-light);
}

.site-header__title {
	font-size: 1.25rem; /* fixed 20px */
	font-weight: var(--weight-regular);
	line-height: 1;
	letter-spacing: -0.01em;
}

.site-header__logo-icon {
	display: block;
	width: 2.5rem;
	height: 2.5rem;
	transition: filter var(--transition-base), transform var(--transition-base);
}

/* Icon grows on hover and eases back to normal size only once the cursor leaves. */
@media (min-width: 768px) {
	.site-header__branding:hover .site-header__logo-icon,
	.site-header__branding:focus-visible .site-header__logo-icon {
		transform: scale(1.18);
	}
}

@media (prefers-reduced-motion: reduce) {
	.site-header__brand-text {
		transition: none;
	}

	.site-header__branding:hover .site-header__logo-icon,
	.site-header__branding:focus-visible .site-header__logo-icon {
		transform: none;
	}
}

/* --------------------------------------------------------------------------
   Primary Navigation
   -------------------------------------------------------------------------- */

.nav-primary {
	display: flex;
	align-items: center;
}

.nav-primary__list {
	list-style: none;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-xl);
}

.nav-primary__list li + li {
	margin-top: 0;
}

.nav-primary__list a {
	font-size: var(--font-size-nav);
	font-weight: var(--weight-medium);
	text-decoration: none;
	letter-spacing: 0.02em;
	opacity: 0.4;
	transition: opacity var(--transition-base);
}

.nav-primary__list a:hover,
.nav-primary__list a:focus-visible,
.nav-primary__list .current-menu-item > a {
	opacity: 1;
}

/* Mobile: stretch the nav to fill remaining header width.
   space-between puts the first link flush with the nav start (just after the logo)
   and Contact flush with the right container edge, with equal gaps in between. */
@media (max-width: 767px) {
	.nav-primary {
		flex: 1;
	}

	.nav-primary__list {
		gap: 0;
		flex-wrap: nowrap;
		justify-content: space-between;
		align-items: center;
		width: 100%;
	}
}

/* Contact link — pill button, always outlined. */
.nav-primary__contact-btn {
	border: 1px solid currentColor;
	border-radius: 100px;
	padding: 0.7em 1.75em;
	transition: background-color var(--transition-base), color var(--transition-base);
}

.nav-primary__contact-btn:hover,
.nav-primary__contact-btn:focus-visible {
	background-color: var(--color-dark);
	color: var(--color-light);
}


/* --------------------------------------------------------------------------
   Site header — dark-section color adaptation
   Toggled by JS (.is-dark class) via ScrollTrigger when dark sections are
   behind the sticky header. Inheriting color cascades to nav links via
   the base `a { color: inherit }` rule.
   -------------------------------------------------------------------------- */

.site-header.is-dark {
	color: var(--color-light);
}

.site-header.is-dark .site-header__logo-icon {
	filter: invert(1);
}

.site-header.is-dark a:focus-visible {
	outline-color: var(--color-light);
}

/* --------------------------------------------------------------------------
   In-page anchor offset — accounts for the sticky header height
   -------------------------------------------------------------------------- */

#social-proof,
#work,
#about {
	scroll-margin-top: var(--header-height);
}

/* --------------------------------------------------------------------------
   Site Footer
   -------------------------------------------------------------------------- */

.site-footer {
	padding-block: var(--space-lg);
	background-color: var(--color-dark);
	color: var(--color-light);
}

.site-footer__inner {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--space-md);
}

@media (min-width: 48rem) {
	.site-footer__inner {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		gap: var(--space-lg);
	}
}

.site-footer__brand {
	display: flex;
	align-items: center;
	gap: var(--space-sm);
}

.site-footer__logo {
	display: block;
	width: 2.5rem;
	height: 2.5rem;
	flex-shrink: 0;
}

.site-footer__copy {
	font-size: var(--font-size-quote-author);
	font-weight: var(--weight-light);
	opacity: 0.85;
	max-width: none;
	margin: 0;
}

.site-footer__links {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--space-xs) var(--space-lg);
	justify-content: flex-start;
}

.site-footer__links li + li {
	margin-top: 0;
}

@media (min-width: 48rem) {
	.site-footer__links {
		justify-content: flex-end;
	}
}

.site-footer__links a {
	font-size: var(--font-size-quote-author);
	font-weight: var(--weight-regular);
	text-decoration: none;
	color: inherit;
	opacity: 0.55;
	transition: opacity var(--transition-base);
}

.site-footer__links a:hover,
.site-footer__links a:focus-visible {
	opacity: 1;
}

/* --------------------------------------------------------------------------
   Entry — Posts & Pages
   -------------------------------------------------------------------------- */

.entry {
	max-width: 48rem;
}

.entry__header {
	margin-bottom: var(--space-lg);
}

.entry__title {
	margin-bottom: var(--space-sm);
}

.entry__meta {
	font-size: var(--font-size-quote-author);
	font-weight: var(--weight-light);
	opacity: 0.6;
	display: flex;
	flex-wrap: wrap;
	gap: 0.75em;
}

.entry__content {
	/* Vertical rhythm for editor-generated content */
}

.entry__content > * + * {
	margin-top: var(--space-md);
}

.entry__content h2 {
	margin-top: var(--space-xl);
}

.entry__content h3,
.entry__content h4 {
	margin-top: var(--space-lg);
}

/* --------------------------------------------------------------------------
   Post List / Archive
   -------------------------------------------------------------------------- */

.post-list {
	list-style: none;
	padding: 0;
	display: grid;
	gap: var(--space-lg);
}

.post-list li + li {
	margin-top: 0;
}

.post-card {
	border-top: 1px solid currentColor;
	padding-top: var(--space-md);
}

.post-card__date {
	font-size: var(--font-size-quote-author);
	font-weight: var(--weight-light);
	opacity: 0.5;
	margin-bottom: var(--space-xs);
}

.post-card__title {
	font-size: var(--font-size-h3);
	font-weight: var(--weight-regular);
	margin-bottom: var(--space-xs);
}

.post-card__title a {
	text-decoration: none;
}

.post-card__title a:hover {
	opacity: 0.6;
}

.post-card__excerpt {
	opacity: 0.75;
}

.post-card__excerpt p {
	font-size: var(--font-size-body);
}

/* --------------------------------------------------------------------------
   Page Header (archive / 404 titles)
   -------------------------------------------------------------------------- */

.page-header {
	margin-bottom: var(--space-xl);
	padding-bottom: var(--space-lg);
	border-bottom: 1px solid currentColor;
}

.page-header__title {
	font-size: var(--font-size-h1);
	font-weight: var(--weight-medium);
}

.page-header__description {
	margin-top: var(--space-sm);
	opacity: 0.65;
}

/* --------------------------------------------------------------------------
   Pagination
   -------------------------------------------------------------------------- */

.pagination {
	margin-top: var(--space-xl);
	padding-top: var(--space-lg);
	border-top: 1px solid currentColor;
}

.pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-sm);
	align-items: center;
}

.pagination .page-numbers {
	font-size: var(--font-size-quote-author);
	font-weight: var(--weight-regular);
	text-decoration: none;
	padding: 0.4em 0.75em;
	border: 1px solid currentColor;
	transition: background-color var(--transition-base), color var(--transition-base);
}

.pagination .page-numbers.current,
.pagination .page-numbers:hover {
	background-color: var(--color-dark);
	color: var(--color-light);
}

/* --------------------------------------------------------------------------
   404 Page
   -------------------------------------------------------------------------- */

.error-404 {
	max-width: 36rem;
}

.error-404 .search-form {
	margin-top: var(--space-lg);
	display: flex;
	gap: var(--space-xs);
}

.error-404 .search-field {
	flex: 1;
}

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */

input[type="text"],
input[type="email"],
input[type="search"],
input[type="url"],
textarea,
select {
	font-family: var(--font-family);
	font-size: var(--font-size-body);
	font-weight: var(--weight-light);
	color: var(--color-dark);
	background-color: var(--color-light);
	border: 1px solid currentColor;
	padding: 0.6em 0.85em;
	width: 100%;
	appearance: none;
	transition: outline var(--transition-base);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="search"]:focus,
input[type="url"]:focus,
textarea:focus,
select:focus {
	outline: 2px solid var(--color-dark);
	outline-offset: 2px;
}

button,
input[type="submit"],
.button {
	font-family: var(--font-family);
	font-size: var(--font-size-body);
	font-weight: var(--weight-medium);
	color: var(--color-light);
	background-color: var(--color-dark);
	border: 1px solid var(--color-dark);
	padding: 0.6em 1.25em;
	cursor: pointer;
	display: inline-block;
	text-decoration: none;
	transition: background-color var(--transition-base), color var(--transition-base);
	appearance: none;
}

button:hover,
input[type="submit"]:hover,
.button:hover {
	background-color: transparent;
	color: var(--color-dark);
}

/* --------------------------------------------------------------------------
   WordPress Core Classes
   -------------------------------------------------------------------------- */

.alignleft {
	float: left;
	margin-right: var(--space-md);
	margin-bottom: var(--space-sm);
}

.alignright {
	float: right;
	margin-left: var(--space-md);
	margin-bottom: var(--space-sm);
}

.aligncenter {
	display: block;
	margin-inline: auto;
}

.alignwide {
	max-width: calc(var(--container-max) + 6rem);
	margin-inline: auto;
}

.alignfull {
	width: 100vw;
	max-width: 100vw;
	margin-inline: calc(50% - 50vw);
}

.wp-caption-text,
.wp-element-caption {
	font-size: var(--font-size-quote-author);
	font-weight: var(--weight-light);
	margin-top: var(--space-xs);
	opacity: 0.6;
}

.screen-reader-text {
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}

.screen-reader-text:focus {
	clip: auto !important;
	clip-path: none;
	background-color: var(--color-light);
	border-radius: 2px;
	display: block;
	font-size: var(--font-size-body);
	height: auto;
	left: 5px;
	line-height: normal;
	padding: 0.5em 1em;
	text-decoration: none;
	top: 5px;
	width: auto;
	z-index: 100000;
}

/* --------------------------------------------------------------------------
   Utility Classes
   -------------------------------------------------------------------------- */

.u-visually-hidden {
	clip: rect(1px, 1px, 1px, 1px);
	position: absolute;
	overflow: hidden;
	height: 1px;
	width: 1px;
}

.u-text-light {
	color: var(--color-light);
}

.u-bg-dark {
	background-color: var(--color-dark);
	color: var(--color-light);
}

/* --------------------------------------------------------------------------
   GSAP animation initial states
   Elements stay visible until JS runs; if JS fails they remain visible.

   No permanent `will-change` is set: these reveals run once (once: true), so a
   persistent will-change would promote every element to its own compositor
   layer forever with no payoff. transform/opacity tweens are composited by the
   browser regardless. GSAP can add will-change per-tween if ever needed.
   -------------------------------------------------------------------------- */

/* --------------------------------------------------------------------------
   Homepage
   -------------------------------------------------------------------------- */

.home {
	display: flex;
	flex-direction: column;
	gap: 25rem;
}

@media (max-width: 767px) {
	.home {
		gap: 12.5rem;
	}
}


/* --------------------------------------------------------------------------
   Homepage — Hero animation
   -------------------------------------------------------------------------- */

.home__hero {
	position: relative;
	/* Subtract the static header height (set by JS as --header-height) so the
	   hero fills exactly one viewport and the scroll arrow stays on-screen. */
	height: calc(100dvh - var(--header-height, 0px));
	min-height: 30rem; /* guard against very short viewports */
	display: flex;
	align-items: center;
	justify-content: center;
	/* No overflow:hidden — words start hidden via yPercent inside their own
	   overflow:hidden wrappers, so the stack can shift beyond the hero boundary
	   during animation without anything unwanted becoming visible. */
}

/* Remove site-main top padding on the front page so the hero sits
   immediately below the header with no extra gap */
body.home .site-main {
	padding-block-start: 0;
}

.home__hero-inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 100%;
}

/* Stack is a plain column container — the 3-col grid lives on each row */
.hero-stack {
	display: flex;
	flex-direction: column;
	width: 100%;
}

/* Each row is its own 3-column grid:
   [left modifiers] [Design anchor] [right modifiers] */
.hero-row {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	column-gap: 0.22em;
	align-items: baseline;
	width: 100%;
	max-width: var(--container-max);
	padding-inline: var(--container-pad);
}

/* Final sentence: positioned in the upper third of the hero, horizontally
   centred as a single phrase rather than spanning a full-width grid. */
.hero-final {
	position: absolute;
	top: 38%;
	left: 0;
	right: 0;
	transform: translateY(-50%);
	display: flex;
	justify-content: center;
	align-items: baseline;
	gap: 0.22em;
	padding-inline: var(--container-pad);
}

/* Word spacing for the "I am a" phrase */
.hero-final .hero-word--dim {
	word-spacing: -0.17em;
}

.hero-col--left {
	text-align: right;
}

/* anchor and right columns are both left-aligned */
.hero-col--anchor,
.hero-col--right {
	text-align: left;
}

/* Overflow-hidden clip container for the slide-up reveal.
   padding-bottom gives descenders (g, p, y) space below the line box
   so they are never cut off by the clip boundary. */
.hero-word-wrap {
	display: block;
	overflow: hidden;
	padding-bottom: 0.18em;
}

.hero-word {
	display: block;
	font-size: var(--font-size-hero);
	font-weight: 600;
	line-height: 1.15;
	letter-spacing: -0.02em;
	word-spacing: 0.02em; /* cancel the letter-spacing penalty on space characters */
	white-space: nowrap;
}

.hero-word--dim {
	color: rgba(2, 1, 1, 0.28);
}

/* Hero action buttons — replay + scroll-down, stacked at bottom centre */
.home__hero-actions {
	position: absolute;
	bottom: 4rem;
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.75rem;
}

.home__hero-replay,
.home__hero-scroll {
	display: flex;
	align-items: center;
	justify-content: center;
	background: none;
	border: none;
	padding: 0.25rem;
	cursor: pointer;
	opacity: 0.45;
	color: var(--color-dark);
	transition: opacity 0.2s ease;
}

/* Hidden until the animation sequence completes; revealed by JS */
.home__hero-replay {
	visibility: hidden;
	opacity: 0;
	transition: opacity 0.4s ease, visibility 0s 0.4s;
}

.home__hero-replay.is-visible {
	visibility: visible;
	opacity: 0.45;
	transition: opacity 0.4s ease, visibility 0s 0s;
}

.home__hero-replay.is-visible:hover,
.home__hero-scroll:hover {
	opacity: 0.85;
}

.home__hero-replay:focus-visible,
.home__hero-scroll:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 4px;
	border-radius: 2px;
}

.home__hero-replay img,
.home__hero-scroll img {
	display: block;
}

/* Hide replay when reduced motion is preferred — animation won't run */
@media (prefers-reduced-motion: reduce) {
	.home__hero-replay {
		display: none;
	}
}

/* Mobile cycling stage — hidden by default; JS shows it on mobile breakpoints.
   Absolutely centred so the Design word stays fixed while modifiers cycle. */
.hero-mobile-stage {
	display: none; /* activated via JS: gsap.set(stage, { display: 'flex' }) */
	flex-direction: column;
	align-items: flex-start;
	position: absolute;
	top: 50%;
	left: 0;
	right: 0;
	padding-inline: var(--container-pad);
	transform: translateY(-50%);
}

/* --------------------------------------------------------------------------
   Homepage — Hero animation — Mobile overrides (< 768px)
   -------------------------------------------------------------------------- */

@media (max-width: 767px) {
	:root {
		/* Large enough for "Design" to span ~65% of viewport width */
		--font-size-hero: clamp(2.5rem, 11vw, 3.5rem);
	}

	.home__hero {
		align-items: flex-start;
		justify-content: center;
	}

	.home__hero-inner {
		align-items: flex-start;
	}

	/* Drop the 3-column grid on rows; stack vertically */
	.hero-row {
		display: flex;
		flex-direction: column;
		align-items: flex-start;
		gap: 0;
	}

	/* Final sentence: stack vertically, left-aligned on mobile */
	.hero-final {
		flex-direction: column;
		align-items: flex-start;
		justify-content: flex-start;
		gap: 0;
	}

	/* Left-side modifiers appear ABOVE Design */
	.hero-row[data-modifier-side="left"] .hero-col--left   { order: 1; }
	.hero-row[data-modifier-side="left"] .hero-col--anchor { order: 2; }

	/* Right-side modifiers appear BELOW Design */
	.hero-row[data-modifier-side="right"] .hero-col--anchor { order: 1; }
	.hero-row[data-modifier-side="right"] .hero-col--right  { order: 2; }

	/* Final row: "I am a" above, "Design", then "Engineer" below */
	.hero-final .hero-col--left   { order: 1; }
	.hero-final .hero-col--anchor { order: 2; }
	.hero-final .hero-col--right  { order: 3; }

	/* Hide unused empty placeholder cols */
	.hero-col--left:empty,
	.hero-col--right:empty { display: none; }

	.hero-word {
		white-space: normal;
	}
}

.home__work-heading {
	font-size: var(--font-size-h2);
	font-weight: var(--weight-regular);
	text-align: center;
	margin-bottom: var(--space-lg);
}

/* --------------------------------------------------------------------------
   Homepage — Social Proof section
   -------------------------------------------------------------------------- */

/* Static background for no-JS; GSAP replaces it with the animated body
   background so the dark zone spans the full viewport width. */
.home__social-proof {
	background-color: var(--color-dark);
	color: var(--color-light);
	padding-block: var(--space-2xl);
}

.home__social-proof .container {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--space-2xl);
}

/* Intro text — 40px desktop, fluid down to ~24px on mobile */
.home__social-proof-intro {
	font-size: clamp(1.5rem, 0.167rem + 2.778vw, 2.5rem); /* 24px → 40px */
	font-weight: var(--weight-regular);
	line-height: 1.1;
	text-align: center;
	max-width: 50rem; /* 800px — overrides global p max-width */
}

.home__social-proof-intro > *:first-child {
	margin-top: 0;
}

.home__social-proof-intro > *:last-child {
	margin-bottom: 0;
}

.home__social-proof-intro p {
	font-size: inherit;
	font-weight: inherit;
	line-height: inherit;
	max-width: none;
	text-align: inherit;
}

.home__social-proof-intro a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 0.12em;
}

.home__social-proof-intro a:hover,
.home__social-proof-intro a:focus-visible {
	opacity: 0.85;
}

.home__social-proof-intro ul,
.home__social-proof-intro ol {
	margin-top: var(--space-xs);
	margin-bottom: 0;
	padding-left: 1.25em;
	text-align: left;
	display: inline-block;
	vertical-align: top;
	max-width: 100%;
}

/* Logo strip */
.home__logos {
	list-style: none;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: var(--space-lg) var(--space-xl);
	width: 100%;
	max-width: 71.25rem; /* 1140px */
}

.home__logos-item {
	margin-top: 0; /* override global li + li margin */
}

.home__logos-item img {
	display: block;
	max-height: 2.5rem; /* 40px */
	width: auto;
	height: auto;
	opacity: 0.7;
	transition: opacity var(--transition-base);
}

.home__logos-item img:hover {
	opacity: 1;
}

@media (max-width: 767px) {
	.home__logos {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: var(--space-lg);
		justify-items: center;
	}

	.home__logos-item {
		width: 100%;
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.home__logos-item img {
		max-width: 100%;
		max-height: 2.5rem;
		width: auto;
		height: auto;
	}
}

/* Testimonials grid */
.home__testimonials {
	list-style: none;
	padding: 0;
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--space-xl);
	width: 100%;
	max-width: 65rem; /* 1040px */
}

@media (min-width: 40rem) {
	.home__testimonials {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 60rem) {
	.home__testimonials {
		grid-template-columns: repeat(3, 1fr);
	}
}

.home__testimonial {
	margin-top: 0; /* override global li + li margin */
}

.home__testimonial-blockquote {
	border-left: none;
	padding-left: 0;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: var(--space-md);
}

.home__testimonial-quote {
	font-size: var(--font-size-quote);
	font-weight: var(--weight-light);
	line-height: 1.1;
	max-width: none;
	color: var(--color-light);
}

.home__testimonial-quote::before {
	content: '\201C'; /* opening curly quote */
}

.home__testimonial-quote::after {
	content: '\201D'; /* closing curly quote */
}

.home__testimonial-footer {
	display: flex;
	flex-direction: column;
	gap: 0.1em;
}

.home__testimonial-author {
	font-size: var(--font-size-quote-author);
	font-weight: var(--weight-regular);
	font-style: normal;
	line-height: 1.1;
	color: var(--color-light);
}

.home__testimonial-position {
	font-size: var(--font-size-quote-author);
	font-weight: var(--weight-light);
	font-style: normal;
	line-height: 1.1;
	opacity: 0.55;
	color: var(--color-light);
}

/* Social proof — contact CTA beneath testimonials */
.home__social-proof-cta {
	display: flex;
	justify-content: center;
}

/* --------------------------------------------------------------------------
   Homepage — About section
   -------------------------------------------------------------------------- */

/* Static dark background for no-JS; GSAP removes it (gsap.set transparent)
   and drives the body background so the dark zone spans the full viewport. */
.home__about {
	background-color: var(--color-dark);
	color: var(--color-light);
	padding-block: var(--space-2xl);
}

/* The container is the only direct child; flex + gap lives here so it
   correctly spaces the heading, content grid, and CTA. */
.home__about > .container {
	display: flex;
	flex-direction: column;
	gap: var(--space-lg);
}

.home__about-heading {
	font-size: var(--font-size-h2);
	font-weight: var(--weight-regular);
}

/* Invert the outline button for the dark About background. */
.home__about .btn-outline-rounded {
	color: var(--color-light);
	border-color: var(--color-light);
}

.home__about .btn-outline-rounded:hover,
.home__about .btn-outline-rounded:focus-visible {
	background-color: var(--color-light);
	color: var(--color-dark);
}

.home__about-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--space-lg);
}

@media (min-width: 48rem) {
	.home__about-grid {
		grid-template-columns: 1fr 1fr;
		align-items: start;
		gap: var(--space-xl);
	}
}

.home__about-text {
	/* 20px → 32px fluid, matching --font-size-h3 */
	font-size: clamp(1.25rem, -0.083rem + 2.778vw, 1.5rem);
	font-weight: var(--weight-light);
	line-height: 1.3;
	max-width: none;
}

.home__about-text > *:first-child {
	margin-top: 0;
}

.home__about-text > *:last-child {
	margin-bottom: 0;
}

.home__about-text p {
	font-size: inherit;
	font-weight: inherit;
	line-height: inherit;
	max-width: none;
}

.home__about-text a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

.home__about-text ul,
.home__about-text ol {
	padding-left: 1.25em;
	margin: var(--space-sm) 0;
}

.home__about-media-wrap {
	overflow: hidden;
}

.home__about-media {
	width: 100%;
	height: auto;
	display: block;
}

/* --------------------------------------------------------------------------
   Rounded outline button
   -------------------------------------------------------------------------- */

.btn-outline-rounded {
	display: inline-flex;
	align-items: center;
	font-family: var(--font-family);
	font-size: var(--font-size-body);
	font-weight: var(--weight-medium);
	color: var(--color-dark);
	background-color: transparent;
	border: 1px solid var(--color-dark);
	border-radius: 100px;
	padding: 0.7em 1.75em;
	text-decoration: none;
	transition: background-color var(--transition-base), color var(--transition-base);
	cursor: pointer;
}

.btn-outline-rounded:hover,
.btn-outline-rounded:focus-visible {
	background-color: var(--color-dark);
	color: var(--color-light);
}

/* Inverted variant — for use on dark backgrounds */
.btn-outline-rounded--inverted {
	color: var(--color-light);
	border-color: var(--color-light);
}

.btn-outline-rounded--inverted:hover,
.btn-outline-rounded--inverted:focus-visible {
	background-color: var(--color-light);
	color: var(--color-dark);
}

/* --------------------------------------------------------------------------
   Case Study Card — base (archive / any list context)
   -------------------------------------------------------------------------- */

.case-study-list {
	list-style: none;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0;
}

.case-study-list li + li {
	margin-top: 0;
}

.case-study-card {
	border-top: 1px solid color-mix(in srgb, currentColor 20%, transparent);
}

.case-study-card:last-child {
	border-bottom: 1px solid color-mix(in srgb, currentColor 20%, transparent);
}

.case-study-card__link {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--space-md);
	padding-block: var(--space-lg);
	text-decoration: none;
	transition: opacity var(--transition-base);
}

@media (min-width: 48rem) {
	.case-study-card__link {
		grid-template-columns: 40% 1fr;
		align-items: center;
		gap: var(--space-lg);
	}
}

.case-study-card__link:hover {
	opacity: 0.7;
}

.case-study-card__media-wrap {
	overflow: hidden;
	aspect-ratio: 16 / 10;
}

.case-study-card__media {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 400ms ease;
}

.case-study-card__link:hover .case-study-card__media {
	transform: scale(1.03);
}

.case-study-card__body {
	display: flex;
	flex-direction: column;
	gap: var(--space-xs);
}

.case-study-card__title {
	font-size: var(--font-size-h3);
	font-weight: var(--weight-regular);
}

.case-study-card__subtitle {
	font-size: var(--font-size-body);
	font-weight: var(--weight-light);
	opacity: 0.65;
	max-width: none;
}

.case-study-card__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25em 1em;
	font-size: var(--font-size-quote-author);
	font-weight: var(--weight-light);
	opacity: 0.5;
	max-width: none;
}

/* --------------------------------------------------------------------------
   Case Study Card — 2-col grid variant (homepage)
   -------------------------------------------------------------------------- */

.case-study-list--grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--space-xl);
	border: none; /* grid uses gap, not borders between rows */
}

@media (min-width: 40rem) {
	.case-study-list--grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

/* Reset the base card border style for grid layout */
.case-study-list--grid .case-study-card {
	border: none;
}

.case-study-list--grid .case-study-card:last-child {
	border: none;
}

/* Override the link to stack vertically: media on top, text below */
.case-study-list--grid .case-study-card__link {
	grid-template-columns: 1fr;
	padding-block: 0;
	gap: var(--space-sm);
}

.case-study-list--grid .case-study-card__media-wrap {
	overflow: visible;
	aspect-ratio: unset;
}

.case-study-list--grid .case-study-card__media {
	height: auto;
	object-fit: unset;
}

.case-study-list--grid .case-study-card__title {
	font-size: var(--font-size-h4);
	font-weight: var(--weight-regular);
	margin-top: var(--space-xs);
}

/* --------------------------------------------------------------------------
   Case Study Single — wrapper + header
   -------------------------------------------------------------------------- */

/* Title now precedes the hero, so standard site-main top padding applies. */

.case-study {
	display: flex;
	flex-direction: column;
}

/* Full-bleed breakout utility — reserved for future use. */
.cs-full-bleed {
	width: 100vw;
	max-width: 100vw;
	margin-inline: calc(50% - 50vw);
}

.case-study__hero {
	overflow: hidden;
	line-height: 0; /* remove inline gap below video/img */
}

.case-study__hero-media {
	width: 100%;
	height: auto;
	display: block;
	max-height: 90vh;
	object-fit: cover;
}

.case-study__header {
	display: flex;
	flex-direction: column;
	gap: var(--space-sm);
	padding-block: var(--flow-lg);
}

.case-study__title {
	font-size: var(--font-size-h1);
	font-weight: var(--weight-regular);
	max-width: 22ch;
}

.case-study__subtitle {
	font-size: clamp(1rem, 0.556rem + 0.926vw, 1.25rem); /* 16px → 20px */
	font-weight: var(--weight-light);
	max-width: none;
	opacity: 0.4;
}

.case-study__meta {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-sm) var(--space-lg);
	margin-top: var(--space-xs);
}

.case-study__meta-item {
	display: flex;
	flex-direction: column;
	gap: 0.2em;
}

.case-study__meta-item dt {
	font-size: var(--font-size-quote-author);
	font-weight: var(--weight-light);
	opacity: 0.5;
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

.case-study__meta-item dd {
	font-size: var(--font-size-body);
	font-weight: var(--weight-regular);
}

/* --------------------------------------------------------------------------
   Flexible content — shared block spacing
   -------------------------------------------------------------------------- */

.case-study__content {
	display: flex;
	flex-direction: column;
	gap: 0;
	padding-block: var(--flow-xl);
}

.cs-block {
	/* Individual blocks may override layout as needed. */
}

/* Default spacing between adjacent blocks */
.cs-block + .cs-block {
	margin-top: var(--flow-xl);
}

/* Tighter spacing between adjacent media blocks */
.cs-block--full-media + .cs-block--half-media,
.cs-block--full-media + .cs-block--full-media,
.cs-block--half-media + .cs-block--full-media,
.cs-block--half-media + .cs-block--half-media {
	margin-top: var(--space-sm);
}

/* --------------------------------------------------------------------------
   Block: Text — 50/50 heading + content grid
   -------------------------------------------------------------------------- */

.cs-block--text {
	/* full container width */
}

.cs-block__text-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--flow-lg);
}

@media (min-width: 48rem) {
	.cs-block__text-grid {
		grid-template-columns: 1fr 1fr;
		gap: var(--space-xl);
		align-items: start;
	}
}

.cs-block__text-heading {
	font-size: var(--font-size-h2);
	font-weight: var(--weight-regular);
}

.cs-block__text-content > * + * {
	margin-top: var(--space-md);
}


/* --------------------------------------------------------------------------
   Block: Full-width media
   -------------------------------------------------------------------------- */

.cs-block--full-media {
	margin: 0; /* reset figure margin */
	line-height: 0;
}

.cs-block--full-media .cs-block__media {
	width: 100%;
	height: auto;
	display: block;
}

/* --------------------------------------------------------------------------
   Block: Half-width media — 2-col grid
   -------------------------------------------------------------------------- */

.cs-block--half-media {
	/* within container */
}

.cs-block__half-grid {
	list-style: none;
	padding: 0;
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--space-sm);
}

@media (min-width: 48rem) {
	.cs-block__half-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

.cs-block__half-item {
	margin-top: 0; /* override global li + li margin */
}

.cs-block__half-item figure {
	margin: 0;
	line-height: 0;
}

.cs-block__half-item .cs-block__media {
	width: 100%;
	height: auto;
	display: block;
}

/* --------------------------------------------------------------------------
   Word-reveal animation helpers
   Injected by JS splitIntoWords() — each word gets an outer clip wrapper
   and an inner span that GSAP translates from below.
   -------------------------------------------------------------------------- */

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

.anim-word {
	display: inline-block;
}

/* --------------------------------------------------------------------------
   Block: shared caption
   -------------------------------------------------------------------------- */

.cs-block__caption {
	display: block;
	font-size: var(--font-size-quote-author);
	font-weight: var(--weight-light);
	opacity: 0.55;
	margin-top: var(--space-xs);
	line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Block: Key stats
   -------------------------------------------------------------------------- */

.cs-block--stats {
	padding-block: var(--space-lg);
	border-top: 1px solid color-mix(in srgb, currentColor 20%, transparent);
}

.cs-stats {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--space-lg);
}

@media (min-width: 30rem) {
	.cs-stats {
		grid-template-columns: repeat(3, 1fr);
		gap: var(--space-xl);
	}
}

.cs-stats__item {
	display: flex;
	flex-direction: column;
	gap: 0.4em;
}

.cs-stats__label {
	font-size: var(--font-size-quote);
	font-weight: var(--weight-light);
	opacity: 1;
	text-transform: none;
}

.cs-stats__value {
	font-size: var(--font-size-h3);
	font-weight: var(--weight-regular);
	line-height: 1.2;
}

/* --------------------------------------------------------------------------
   Contact Page
   -------------------------------------------------------------------------- */

.contact-page {
	padding-block: var(--flow-lg);
}

.contact-page__grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--flow-xl); /* stacked on mobile; desktop overrides below */
}

@media (min-width: 48rem) {
	.contact-page__grid {
		grid-template-columns: 1fr 1fr;
		align-items: start;
		gap: var(--space-2xl);
	}
}

.contact-page__heading {
	font-size: var(--font-size-h1);
	font-weight: var(--weight-regular);
	margin-bottom: var(--flow-lg);
}

.contact-page__intro {
	margin-bottom: var(--flow-lg);
}

.contact-page__intro p {
	font-size: var(--font-size-body);
	font-weight: var(--weight-light);
	max-width: none;
}

.contact-page__intro p + p {
	margin-top: var(--space-sm);
}

/* Form layout */
.contact-form {
	display: flex;
	flex-direction: column;
	gap: var(--space-md);
}

.contact-form__field {
	display: flex;
	flex-direction: column;
	gap: 0.4em;
}

.contact-form__label {
	font-size: var(--font-size-body);
	font-weight: var(--weight-light);
}

/* Override base form styles for contact form inputs */
.contact-form__input,
.contact-form__textarea {
	font-family: var(--font-family);
	font-size: var(--font-size-body);
	font-weight: var(--weight-light);
	color: var(--color-dark);
	border: 1px solid rgba(2, 1, 1, 1);
	border-radius: 5px;
	padding: 0.65em 0.9em;
	width: 100%;
	appearance: none;
	transition: border-color var(--transition-base), outline var(--transition-base);
}

.contact-form__input:focus,
.contact-form__textarea:focus {
	outline: 2px solid var(--color-dark);
	outline-offset: 2px;
	border-color: var(--color-dark);
}

.contact-form__textarea {
	resize: vertical;
	min-height: 8rem;
}

.contact-form__input--error,
.contact-form__textarea--error {
	border-color: rgba(180, 0, 0, 0.6);
}

.contact-form__input--error:focus,
.contact-form__textarea--error:focus {
	outline-color: rgba(180, 0, 0, 0.8);
	border-color: rgba(180, 0, 0, 0.8);
}

.contact-form__captcha {
	margin-top: var(--space-xs);
}

.contact-form__actions {
	margin-top: var(--space-xs);
}

/* Status notices */
.contact-form__notice {
	padding: 0.75em 1em;
	border-radius: 5px;
	font-size: var(--font-size-body);
	font-weight: var(--weight-light);
	margin-bottom: var(--space-md);
}

.contact-form__notice--success {
	background-color: rgba(2, 1, 1, 0.05);
	border: 1px solid rgba(2, 1, 1, 0.15);
}

.contact-form__notice--error {
	background-color: rgba(180, 0, 0, 0.06);
	border: 1px solid rgba(180, 0, 0, 0.25);
	color: #8b0000;
}

/* Right column links */
.contact-page__right {
	padding-top: 0;
}

.contact-links {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: var(--space-md);
}

.contact-links li + li {
	margin-top: 0;
}

.contact-links__link {
	display: inline-flex;
	align-items: center;
	gap: 0.6em;
	font-size: 1.5rem; /* 24px fixed */
	font-weight: var(--weight-regular);
	text-decoration: none;
	transition: opacity var(--transition-base);
}

.contact-links__link:hover,
.contact-links__link:focus-visible {
	opacity: 0.6;
}

.contact-links__arrow {
	display: block;
	flex-shrink: 0;
	width: 1.25rem;
	height: 1.25rem;
}

/* --------------------------------------------------------------------------
   Case Study — Previous / Next navigation
   -------------------------------------------------------------------------- */

.case-study__nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding-block: var(--flow-xl);
	border-top: 1px solid color-mix(in srgb, currentColor 20%, transparent);
}

.case-study__nav-link {
	display: inline-flex;
	align-items: center;
	gap: 0.6em;
	font-size: 1.5rem; /* 24px */
	font-weight: var(--weight-regular);
	text-decoration: none;
	color: var(--color-dark);
	transition: opacity var(--transition-base);
}

.case-study__nav-link:hover,
.case-study__nav-link:focus-visible {
	opacity: 0.6;
}

.case-study__nav-arrow {
	display: block;
	flex-shrink: 0;
	width: 1.375rem;
	height: auto;
}

/* --------------------------------------------------------------------------
   Case Study Archive
   -------------------------------------------------------------------------- */

.archive-case-studies {
	display: flex;
	flex-direction: column;
	gap: var(--space-xl);
}

.archive-case-studies__header {
	padding-bottom: var(--space-lg);
	border-bottom: 1px solid color-mix(in srgb, currentColor 20%, transparent);
}

.archive-case-studies__title {
	font-size: var(--font-size-h1);
	font-weight: var(--weight-regular);
}
