/* ==========================================================================
   AGYATVYAKTI — BASE
   Tokens · reset · typography · buttons · motion
   Stage 02: visual language.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. TOKENS
   -------------------------------------------------------------------------- */
:root {
	/* --- Colour ---
	   The canvas is warm paper sampled from the studio post (#f4f3f1), the ink
	   an indigo charcoal (#322f52) rather than pure black — so every line of
	   type ties back to the logo. The accent is the logo gradient itself,
	   sampled straight from the mark: magenta at the peak, blue at the base.
	   The gradient is the only colour on the page; solid single accents use
	   --agy-purple, the gradient's midpoint. */
	--agy-magenta: #c5077f;      /* logo top */
	--agy-purple: #8e129e;       /* logo mid — solid single accent */
	--agy-blue: #1e29bb;         /* logo base */
	--agy-blue-bright: #0060da;
	--agy-purple-dark: #6e0f7d;
	--agy-purple-light: #b23cc0;
	--agy-amber: #d7ae71;        /* node / detail accent, used sparingly */
	--agy-grad: linear-gradient(120deg, #c5077f 0%, #8e129e 46%, #1e29bb 100%);
	--agy-grad-soft: linear-gradient(120deg, rgba(197, 7, 127, 0.10) 0%, rgba(142, 18, 158, 0.10) 46%, rgba(30, 41, 187, 0.10) 100%);

	--agy-black: #322f52;        /* primary ink — indigo charcoal */
	--agy-white: #f4f3f1;        /* warm paper */

	/* Recessed paper, one step down from the page — used for alt sections. */
	--agy-bone-deep: #eae7e0;
	/* True dark surface for the inverted services block — deep indigo-black. */
	--agy-ink: #17162a;

	--agy-gray-900: #23213a;
	--agy-gray-700: #565272;     /* secondary text — indigo-tinted */
	--agy-gray-500: #7a768c;     /* muted — from the post */
	--agy-gray-300: #c9c6c0;
	--agy-gray-200: #ddd9d1;
	--agy-gray-100: #ece9e2;

	/* Semantic aliases. Stage 01 names retained so nothing breaks. */
	--agy-paper: var(--agy-white);
	--agy-gray: var(--agy-gray-700);
	--agy-border: var(--agy-gray-200);
	--agy-rule: rgba(50, 47, 82, 0.16);
	--agy-rule-soft: rgba(50, 47, 82, 0.06);
	--agy-rule-faint: rgba(50, 47, 82, 0.09);
	--agy-tint: rgba(142, 18, 158, 0.06);

	/* --- Typography ---
	   Bricolage Grotesque carries display and the wordmark — an expressive,
	   architectural grotesque. Space Grotesk runs the interface: body, nav,
	   buttons, forms. DM Mono is reserved strictly for annotation (indexes,
	   eyebrows, coordinates, meta) so small type reads as drawing notation. */
	--font-display: "Bricolage Grotesque", "Space Grotesk", system-ui, sans-serif;
	--font-body: "Space Grotesk", system-ui, -apple-system, sans-serif;
	--font-mono: "DM Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
	--font-devanagari: "Noto Sans Devanagari", "Nirmala UI", system-ui, sans-serif;
	--font-wordmark: "Bricolage Grotesque", "Space Grotesk", system-ui, sans-serif;

	--fs-display: clamp(4rem, 12vw, 10.5rem);
	--fs-h1: clamp(2.75rem, 6.4vw, 5.5rem);
	--fs-h2: clamp(2.15rem, 4.8vw, 3.9rem);
	--fs-h3: clamp(1.25rem, 2vw, 1.7rem);
	--fs-body: 1rem;
	--fs-lead: clamp(1.125rem, 1.5vw, 1.375rem);
	--fs-small: 0.9375rem;
	--fs-caption: 0.8125rem;
	--fs-eyebrow: 0.6875rem;
	--fs-nav: 0.9375rem;
	--fs-button: 0.9375rem;

	--lh-tight: 0.86;
	--lh-heading: 0.95;
	--lh-body: 1.65;

	--ls-display: -0.03em;
	--ls-heading: -0.02em;
	--ls-eyebrow: 0.13em;

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

	--section-padding: clamp(5.5rem, 9vw, 9rem);
	--section-padding-mobile: 4rem;
	--space-section: var(--section-padding);

	/* --- Layout --- */
	--container: 1180px;
	--container-wide: 1440px;
	--gutter: clamp(1.25rem, 4vw, 2.5rem);

	--radius-sm: 4px;
	--radius-md: 8px;
	--radius-lg: 14px;

	/* --- Motion --- */
	--ease: cubic-bezier(0.16, 1, 0.3, 1);
	--ease-out: cubic-bezier(0.16, 1, 0.3, 1);
	--ease-firm: cubic-bezier(0.7, 0, 0.2, 1);
	--dur-fast: 0.18s;
	--dur-base: 0.28s;
	--dur-slow: 0.55s;

	/* --- Header --- */
	--header-h: 78px;
}

/* --------------------------------------------------------------------------
   DARK MODE
   Applied via [data-theme="dark"] on the <html> element. Every token above
   has an inverted counterpart here, so anything using the tokens (which is
   the whole theme) flips without further work.
   -------------------------------------------------------------------------- */
[data-theme="dark"] {
	/* Warm-neutral dark rather than blue-black, so the flip reads as the
	   same paper under different light instead of a different brand. */
	--agy-white: #14131d;
	--agy-black: #f1efe9;
	--agy-bone-deep: #1d1c26;
	--agy-ink: #0a0a12;
	--agy-gray-900: #e6e2d8;
	--agy-gray-700: #a8a4b4;
	--agy-gray-500: #86828f;
	--agy-gray-300: #3a3843;
	--agy-gray-200: #26252e;
	--agy-gray-100: #1c1b24;
	/* Accent lightened for legibility on dark paper; the gradient stays the
	   only colour, brightened at both ends. */
	--agy-magenta: #ef4aa6;
	--agy-purple: #c65bd6;
	--agy-blue: #5566ee;
	--agy-purple-dark: #a83fbf;
	--agy-purple-light: #db8ae8;
	--agy-amber: #e0bd85;
	--agy-grad: linear-gradient(120deg, #ef4aa6 0%, #c65bd6 46%, #5566ee 100%);
	--agy-grad-soft: linear-gradient(120deg, rgba(239, 74, 166, 0.16) 0%, rgba(198, 91, 214, 0.16) 46%, rgba(85, 102, 238, 0.16) 100%);
	--agy-rule: rgba(241, 239, 233, 0.2);
	--agy-rule-soft: rgba(241, 239, 233, 0.07);
	--agy-rule-faint: rgba(241, 239, 233, 0.1);
	--agy-tint: rgba(198, 91, 214, 0.12);
}

/* Smooth theme flip — colours only, no layout thrash. */
html {
	transition: background-color 0.35s var(--ease-out), color 0.35s var(--ease-out);
}

/* --------------------------------------------------------------------------
   2. RESET
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
	box-sizing: border-box;
}

/* Native hidden attribute must always win over component display rules. */
[hidden] {
	display: none !important;
}

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
	scroll-padding-top: calc(var(--header-h) + var(--space-md));
}

body {
	margin: 0;
	background: var(--agy-white);
	color: var(--agy-black);
	font-family: var(--font-body);
	font-size: var(--fs-body);
	line-height: var(--lh-body);
	overflow-x: hidden;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

body.agy-no-scroll {
	overflow: hidden;
}

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

a {
	color: var(--agy-purple);
	text-decoration: none;
}

a:hover {
	color: var(--agy-purple-dark);
}

button {
	font: inherit;
	cursor: pointer;
}

ul,
ol {
	margin: 0;
	padding: 0;
}

figure {
	margin: 0;
}

:focus-visible {
	outline: 2px solid var(--agy-purple);
	outline-offset: 3px;
	border-radius: 2px;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 999;
	background: var(--agy-black);
	color: var(--agy-white);
	padding: var(--space-xs) var(--space-md);
	border-radius: 0 0 var(--radius-sm) 0;
	font-size: var(--fs-caption);
}

.skip-link:focus {
	left: 0;
	color: var(--agy-white);
}

/* --------------------------------------------------------------------------
   3. TYPOGRAPHY
   -------------------------------------------------------------------------- */
h1,
h2,
h3,
h4,
h5,
h6 {
	font-family: var(--font-display);
	color: var(--agy-black);
	margin: 0 0 var(--space-sm);
	font-weight: 700;
	line-height: var(--lh-heading);
	letter-spacing: var(--ls-heading);
	text-wrap: balance;
}

h1 {
	font-size: var(--fs-h1);
	font-weight: 800;
	line-height: var(--lh-tight);
	letter-spacing: var(--ls-display);
}

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

h3 {
	font-size: var(--fs-h3);
}

h4 {
	font-size: 1.0625rem;
}

p {
	margin: 0 0 var(--space-md);
	color: var(--agy-gray-700);
}

p:last-child {
	margin-bottom: 0;
}

strong {
	font-weight: 700;
	color: var(--agy-black);
}

.agy-display {
	font-family: var(--font-display);
	font-size: var(--fs-display);
	font-weight: 800;
	line-height: var(--lh-tight);
	letter-spacing: var(--ls-display);
}

.agy-devanagari {
	font-family: var(--font-devanagari);
	font-weight: 700;
}

.agy-lead {
	font-size: var(--fs-lead);
	line-height: 1.65;
	color: var(--agy-gray-700);
	max-width: 62ch;
}

.agy-small {
	font-size: var(--fs-small);
	color: var(--agy-gray-700);
}

.agy-caption {
	font-size: var(--fs-caption);
	color: var(--agy-gray-500);
	line-height: 1.55;
}

/* Eyebrow: index + label — an architectural annotation, not decoration. */
.agy-eyebrow {
	display: flex;
	align-items: center;
	gap: 0.7rem;
	margin: 0 0 var(--space-md);
	font-family: var(--font-mono);
	font-size: var(--fs-eyebrow);
	font-weight: 500;
	letter-spacing: var(--ls-eyebrow);
	text-transform: uppercase;
	color: var(--agy-gray-500);
}

.agy-eyebrow__index {
	color: var(--agy-purple);
}

.agy-eyebrow__rule {
	flex: 1 1 auto;
	max-width: 88px;
	height: 1px;
	background: var(--agy-rule);
}

.agy-muted {
	color: var(--agy-gray-300);
}

.agy-accent {
	color: var(--agy-purple);
}

/* --------------------------------------------------------------------------
   4. BUTTONS
   -------------------------------------------------------------------------- */
.agy-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.55rem;
	height: 50px;
	padding-inline: 1.5rem;
	border: 1px solid transparent;
	border-radius: var(--radius-md);
	font-family: var(--font-display);
	font-size: var(--fs-button);
	font-weight: 700;
	line-height: 1;
	letter-spacing: -0.005em;
	text-decoration: none;
	white-space: nowrap;
	transition: background var(--dur-base) var(--ease),
		color var(--dur-base) var(--ease),
		border-color var(--dur-base) var(--ease),
		transform var(--dur-base) var(--ease);
}

.agy-btn__arrow {
	display: inline-block;
	transition: transform var(--dur-base) var(--ease);
}

.agy-btn--primary {
	background: var(--agy-grad);
	color: #fff;
}

.agy-btn--primary:hover {
	background: var(--agy-grad);
	color: #fff;
	transform: translateY(-2px);
	box-shadow: 0 10px 26px -12px rgba(142, 18, 158, 0.55);
}

.agy-btn--primary:hover .agy-btn__arrow {
	transform: translate(2px, -2px);
}

.agy-btn--secondary {
	background: var(--agy-white);
	color: var(--agy-black);
	border-color: var(--agy-gray-300);
}

.agy-btn--secondary:hover {
	color: var(--agy-purple);
	border-color: var(--agy-purple);
	transform: translateY(-2px);
}

.agy-btn--text {
	height: auto;
	padding: 0;
	background: none;
	border: 0;
	border-radius: 0;
	color: var(--agy-purple);
}

.agy-btn--text:hover {
	color: var(--agy-purple-dark);
}

.agy-btn--text:hover .agy-btn__arrow {
	transform: translateX(3px);
}

.agy-btn:active {
	transform: translateY(0);
}

/* --------------------------------------------------------------------------
   5. MOTION
   Grouped reveals — elements move together, not independently.
   -------------------------------------------------------------------------- */
.reveal,
.reveal-up,
.reveal-scale,
.reveal-line {
	transition-timing-function: var(--ease);
	transition-duration: var(--dur-slow);
}

.reveal,
.reveal-up {
	opacity: 0;
	transform: translateY(20px);
	transition-property: opacity, transform;
}

.reveal-scale {
	opacity: 0;
	transform: scale(0.985);
	transition-property: opacity, transform;
}

.reveal-line {
	transform: scaleX(0);
	transform-origin: left;
	transition-property: transform;
}

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

.reveal-line.is-visible {
	transform: scaleX(1);
}

.reveal--delay-1 { transition-delay: 0.07s; }
.reveal--delay-2 { transition-delay: 0.14s; }
.reveal--delay-3 { transition-delay: 0.21s; }
.reveal--delay-4 { transition-delay: 0.28s; }

.no-js .reveal,
.no-js .reveal-up,
.no-js .reveal-scale {
	opacity: 1;
	transform: none;
}

.no-js .reveal-line {
	transform: scaleX(1);
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		transition-delay: 0ms !important;
		scroll-behavior: auto !important;
	}

	.reveal,
	.reveal-up,
	.reveal-scale {
		opacity: 1;
		transform: none;
	}

	.reveal-line {
		transform: scaleX(1);
	}
}
