/* Brand variables and base theme */
:root {
	--primary: #50358d;
	--secondary: #b7d9bf;
	--accent: #9079c4;
	--bg: #fafafa;
	--text: #222222;
	--muted: #f1eef9;
	/* Extended palette */
	--success: #1f9d55;
	--warning: #e09f3e;
	--info: #3178c6;
	--radius: 8px;
	--maxw: 1120px;
	--space-1: 4px;
	--space-2: 8px;
	--space-3: 12px;
	--space-4: 16px;
	--space-5: 24px;
	--space-6: 32px;
	--space-7: 48px;
	--space-8: 64px;
}

html { box-sizing: border-box; }
*, *::before, *::after { box-sizing: inherit; }
html, body { height: 100%; }
body {
	margin: 0;
	font-family: system-ui, -apple-system, Segoe UI, Roboto, Inter, "Nunito Sans", Arial, sans-serif;
	font-size: 16px;
	line-height: 1.6;
	color: var(--text);
	background: var(--bg);
	text-rendering: optimizeLegibility;
    color-scheme: light dark;
}

img { max-width: 100%; height: auto; }
a { color: var(--primary); text-decoration: none; }
a:hover, a:focus { text-decoration: underline; }
/* Accent underline for headings and links in light theme */
h2 { position: relative; }
h2::after { content: ""; display: block; width: 56px; height: 3px; margin-top: 8px; background: linear-gradient(90deg, var(--secondary), var(--accent)); border-radius: 2px; }
html[data-theme="dark"] h2::after { background: linear-gradient(90deg, #5aa380, #7e6ac7); opacity: .8; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--space-4); }
.skip-link { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.skip-link:focus { position: static; width: auto; height: auto; padding: var(--space-3); background: var(--secondary); color: #000; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Header */
.site-header { position: sticky; top: 0; background: #fff; box-shadow: 0 2px 12px rgba(0,0,0,.06); z-index: 1000; }
.site-header.glass { background: rgba(255,255,255,.6); backdrop-filter: blur(10px); box-shadow: 0 8px 30px rgba(0,0,0,.08); border-bottom: 1px solid rgba(255,255,255,.3); }
.site-header.scrolled { background: rgba(255,255,255,.8); box-shadow: 0 10px 32px rgba(0,0,0,.12); }
.site-header .actions .btn { background: transparent; border-color: #ddd; }
/* Theme toggle button inverts by theme with higher specificity */
.site-header .actions .theme-toggle { background: #50358d; color: #fff; border-color: #50358d; }
.site-header .actions .theme-toggle:hover { opacity: .9; }
html[data-theme="dark"] .site-header .actions .theme-toggle { background: #fff; color: #0f0f14; border-color: #fff; }
/* Theme toggle button inverts by theme */
.site-header .theme-toggle { background: #50358d; color: #fff; border-color: transparent; }
.site-header .theme-toggle:hover { opacity: .9; }
html[data-theme="dark"] .site-header .theme-toggle { background: #fff; color: #0f0f14; border-color: transparent; }
html[data-theme="dark"] .site-header { background: rgba(10,10,16,.7); }
html[data-theme="dark"] .site-header.glass { background: rgba(16,16,24,.5); box-shadow: 0 8px 30px rgba(0,0,0,.4); border-bottom-color: rgba(255,255,255,.08); }
html[data-theme="dark"] .site-header.scrolled { background: rgba(20,20,30,.7); box-shadow: 0 10px 32px rgba(0,0,0,.55); }
.header-inner { display: flex; gap: var(--space-5); align-items: center; justify-content: space-between; padding: var(--space-4) 0; }
.nav { display: flex; gap: var(--space-5); list-style: none; margin: 0; padding: 0; }
.logo img { display: block; }
/* Larger logo and nav spacing */
.header-inner .logo img { height: 125px; width: auto; max-height: none; filter: drop-shadow(0 0 2px rgba(0,0,0,.5)); }
html[data-theme="dark"] .header-inner .logo img { filter: drop-shadow(0 0 2px rgba(255,255,255,.45)); }
@media (max-width: 520px) {
	.header-inner .logo img { height: 56px; }
}
.nav { gap: calc(var(--space-5) * 1.25); }
.nav a { font-size: 1.0625rem; }
/* Theme toggle */
html[data-theme="dark"] {
	--bg: #0f0f14;
	--text: #e6e6f2;
	--muted: #171726;
	--accent: #7e6ac7;
	--primary: #b8a5ff;
	--secondary: #88d1a0;
	--success: #58c38a;
	--warning: #f0b46a;
	--info: #7fb4ff;
}

/* Buttons */
.btn { display: inline-block; padding: 10px 16px; border-radius: var(--radius); font-weight: 600; border: 1px solid transparent; }
.btn.primary { background: var(--primary); color: #fff; }
.btn.secondary { background: #6a54b8; color: #fff; }
.btn.cta { border-color: var(--primary); color: var(--primary); }
.btn.cta:hover { background: var(--primary); color: #fff; }
html[data-theme="dark"] .btn.cta { color: var(--primary); border-color: var(--primary); }
html[data-theme="dark"] .btn.cta:hover { background: var(--primary); color: #0f0f14; }

/* Gradient text utility */
.gradient-text { background: linear-gradient(90deg, #ffffff, #e9e3ff); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Hero */
.hero { position: relative; overflow: hidden; color: #fff; }
.hero-inner { padding: clamp(72px, 12vw, 128px) 0 clamp(48px, 8vw, 96px); text-align: center; position: relative; z-index: 2; }
.hero .lead { font-size: 1.125rem; opacity: .95; margin-bottom: var(--space-5); }
.hero-bg { position: absolute; inset: 0; background: radial-gradient(1200px 800px at 20% 20%, rgba(255,255,255,.08), transparent 60%), radial-gradient(1000px 700px at 80% 30%, rgba(255,255,255,.06), transparent 60%), linear-gradient(135deg, var(--primary), var(--accent)); z-index: 1; filter: saturate(120%); transform: translate3d(var(--parallax-x, 0), var(--parallax-y, 0), 0); transition: transform .2s ease; }
/* Aurora orbs */
.hero::before,
.hero::after {
	content: "";
	position: absolute;
	inset: auto;
	width: 60vmax;
	height: 60vmax;
	background: radial-gradient(circle at 30% 30%, rgba(183,217,191,.35), transparent 60%);
	filter: blur(60px);
	opacity: .55;
	transform: translate(-40%, -30%);
	border-radius: 50%;
	z-index: 0;
}
.hero::after {
	left: auto;
	right: -20vmax;
	transform: translate(30%, 10%);
	background: radial-gradient(circle at 70% 70%, rgba(144,121,196,.35), transparent 60%);
}
@media (prefers-reduced-motion: no-preference) {
	@keyframes floaty {
		0% { transform: translate(-40%, -30%) scale(1); }
		50% { transform: translate(-38%, -28%) scale(1.04); }
		100% { transform: translate(-40%, -30%) scale(1); }
	}
	.hero::before { animation: floaty 14s ease-in-out infinite; }
	.hero::after { animation: floaty 18s ease-in-out reverse infinite; }
}

/* Angled divider for section after hero */
.hero + .section {
    position: relative;
    padding-top: calc(var(--space-6) + 32px);
}
.hero + .section::before {
	content: "";
	position: absolute;
	left: 0; right: 0; top: -48px; height: 48px;
	background: var(--bg);
	transform: skewY(-3deg);
	transform-origin: top left;
}

/* Sections */
.section { padding: var(--space-7) 0; }
.section.muted { background: var(--muted); }
.highlights { background: #fff; }
html[data-theme="dark"] .section.muted { background: #121222; }
html[data-theme="dark"] .highlights { background: #0f0f14; }
/* Consistent vertical rhythm */
/* Removed extra adjacency padding to avoid overly large gaps between sections */
.container > h1, .container > h2 { margin-top: 0; }
.container > p.lead { margin-top: var(--space-3); }
.grid.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-6); align-items: start; }
@media (max-width: 800px) { .grid.two { grid-template-columns: 1fr; } }
.grid.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--space-5); }
.card { background: #fff; border-radius: var(--radius); padding: var(--space-5); box-shadow: 0 2px 10px rgba(0,0,0,.04); position: relative; }
.card { border: 1px solid transparent; background-image: linear-gradient(#fff, #fff), linear-gradient(90deg, var(--secondary), var(--accent)); background-origin: border-box; background-clip: padding-box, border-box; }
html[data-theme="dark"] .card { background-image: linear-gradient(#151527, #151527), linear-gradient(90deg, #5aa380, #7e6ac7); }
.card:hover { box-shadow: 0 12px 30px rgba(0,0,0,.08); transform: translateY(-2px); transition: transform .2s ease, box-shadow .2s ease; }
.card:focus-within { outline: 3px solid var(--secondary); }

/* Card icon badge + small button */
.icon-circle { width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--secondary), var(--accent)); color: #fff; font-weight: 800; margin-bottom: var(--space-3); box-shadow: 0 6px 16px rgba(0,0,0,.12); }
.btn.small { padding: 8px 12px; font-size: .875rem; }
html[data-theme="dark"] .card { background: #151527; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
/* Team avatars */
.team .card { text-align: left; }
.avatar { width: 160px; height: 200px; border-radius: var(--radius); object-fit: cover; display: block; margin: 0 0 var(--space-4); box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.avatar.rounded { border-radius: 16px; }

/* CTA banner */
.cta-banner { background: linear-gradient(90deg, var(--primary), var(--accent)); color: #fff; }
.cta-banner .container { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-6) 0; flex-wrap: wrap; }

/* Trusted By marquee */
.marquee { background: #fff; border-top: 1px solid #eee; border-bottom: 1px solid #eee; }
.marquee-inner { display: flex; gap: clamp(32px, 6vw, 96px); padding: var(--space-5) 0; overflow: hidden; position: relative; }
.marquee-track { display: flex; gap: clamp(32px, 6vw, 96px); will-change: transform; }
.marquee-logo { height: 28px; opacity: .7; filter: grayscale(100%); transition: opacity .2s ease, filter .2s ease; }
.marquee-logo:hover { opacity: 1; filter: grayscale(0%); }
@media (prefers-reduced-motion: reduce) {
	.marquee-track { animation: none !important; }
}

/* Featured case study */
.case { display: grid; grid-template-columns: 1.2fr 1fr; gap: var(--space-6); align-items: center; }
.case .case-media { border-radius: var(--radius); overflow: hidden; box-shadow: 0 4px 24px rgba(0,0,0,.12); transform: perspective(900px) rotateY(0deg) rotateX(0deg); transition: transform .3s ease; }
.case .case-media img { display: block; width: 100%; height: auto; }
.case .case-content .eyebrow { text-transform: uppercase; letter-spacing: .08em; color: #6a54b8; font-weight: 700; }
.case .case-content .title { font-size: clamp(1.4rem, 1.2vw + 1rem, 2rem); margin: 0 0 var(--space-3); }
.case .actions { justify-content: flex-start; }
@media (max-width: 900px) { .case { grid-template-columns: 1fr; } }

/* Metrics/Highlights */
.highlights { background: #fff; }
.highlights .stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-5); }
.stats { display: grid; grid-template-columns: repeat(2, minmax(220px, 1fr)); gap: var(--space-5); align-items: stretch; }
@media (max-width: 640px) { .stats { grid-template-columns: 1fr; } }
.stat { background: #fff; border-radius: var(--radius); padding: var(--space-5); box-shadow: 0 2px 10px rgba(0,0,0,.04); text-align: center; }
.stat .num { font-size: clamp(2rem, 5vw, 3rem); font-weight: 800; color: var(--primary); display: block; }
.stat .label { color: #555; }
html[data-theme="dark"] .stat { background: #16162a; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
html[data-theme="dark"] .stat .label { color: #b5b5c9; }

/* Form errors */
.error { display: block; min-height: 1.2em; color: #b3261e; font-size: .875rem; }
.form-status { margin: 8px 0 16px; padding: 8px 12px; border-radius: 8px; background: #fff3f2; color: #b3261e; }

/* Scroll reveal */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity .6s ease, transform .6s ease; }
.reveal.revealed { opacity: 1; transform: translateY(0); }

/* Carousel (Impact) */
.carousel { position: relative; }
.carousel-track { display: grid; grid-auto-flow: column; grid-auto-columns: min(80%, 360px); gap: var(--space-5); overflow-x: auto; padding: var(--space-4) 0; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
.carousel-track::-webkit-scrollbar { height: 8px; }
.carousel-track::-webkit-scrollbar-thumb { background: rgba(0,0,0,.15); border-radius: 8px; }
.carousel-track > .card { scroll-snap-align: start; }
.carousel-controls { display: flex; gap: var(--space-3); justify-content: center; margin-top: var(--space-3); }
.carousel-controls button { background: #fff; border: 1px solid #ddd; border-radius: 999px; padding: 8px 12px; cursor: pointer; }
.carousel-controls button[disabled] { opacity: .5; cursor: not-allowed; }

/* Sticky timeline (Process) */
.timeline { display: grid; grid-template-columns: 260px 1fr; gap: var(--space-6); align-items: start; }
.timeline-nav { position: sticky; top: 96px; list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.timeline-nav li { border-left: 3px solid transparent; padding-left: var(--space-3); }
.timeline-nav li.active { border-color: var(--primary); }
.timeline-nav a { color: #555; text-decoration: none; display: block; font-weight: 600; }
.timeline-content { display: grid; gap: var(--space-5); }
/* Timeline visual connectors */
.timeline-content { position: relative; }
.timeline-content::before { content: ""; position: absolute; left: 20px; top: 0; bottom: 0; width: 2px; background: #e6e6f2; }
html[data-theme="dark"] .timeline-content::before { background: #2a2a3c; }
.timeline-content > section { position: relative; padding-left: 48px; }
.timeline-content > section::before { content: ""; position: absolute; left: 12px; top: 24px; width: 16px; height: 16px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 4px rgba(80,53,141,.12); }
html[data-theme="dark"] .timeline-content > section::before { box-shadow: 0 0 0 4px rgba(184,165,255,.12); }

@media (max-width: 800px) {
	.timeline { grid-template-columns: 1fr; }
	.timeline-nav { position: static; display: flex; overflow-x: auto; gap: var(--space-4); padding-bottom: var(--space-3); }
	.timeline-nav li { border-left: none; border-bottom: 3px solid transparent; padding: 0 0 var(--space-2); white-space: nowrap; }
	.timeline-nav li.active { border-bottom-color: var(--primary); }
}

/* Footer */
.site-footer { border-top: 1px solid #eaeaea; margin-top: var(--space-6); }
.footer-inner { display: grid; gap: var(--space-4); padding: var(--space-5) 0; }
.footer-nav { list-style: none; display: flex; gap: var(--space-4); margin: 0; padding: 0; flex-wrap: wrap; }
.footer-meta { color: #555; display: flex; gap: var(--space-3); align-items: center; }
html[data-theme="dark"] .site-footer { border-top-color: #2a2a3c; }
html[data-theme="dark"] .footer-meta { color: #b5b5c9; }

/* Accessibility helpers */
:focus-visible { outline: 3px solid var(--secondary); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
	* { animation: none !important; transition: none !important; }
}

/* Responsive type */
h1 { font-size: clamp(1.7rem, 2.4vw + 1rem, 2.6rem); line-height: 1.2; margin: 0 0 var(--space-4); }
h2 { font-size: clamp(1.3rem, 1vw + 1rem, 1.8rem); margin: 0 0 var(--space-3); }
h3 { font-size: 1.05rem; margin: 0 0 var(--space-2); }
p { margin: 0 0 var(--space-4); }

/* Utility */
.lead { text-align: justify; }
.actions { display: flex; gap: var(--space-3); justify-content: center; }

/* Style Guide (for README reference) */
/* Colors: primary #50358d, secondary #b7d9bf, accent #9079c4, bg #fafafa, text #222 */
/* Radii: 8px; Spacing scale: 4,8,12,16,24,32,48,64 */



/* Dark theme for hero section - ensure gradient updates properly */
html[data-theme="dark"] .hero-bg {
	background: radial-gradient(1200px 800px at 20% 20%, rgba(255,255,255,.05), transparent 60%), radial-gradient(1000px 700px at 80% 30%, rgba(255,255,255,.03), transparent 60%), linear-gradient(135deg, var(--primary), var(--accent)) !important;
}

html[data-theme="dark"] .hero::before {
	background: radial-gradient(circle at 30% 30%, rgba(136, 209, 160, .25), transparent 60%);
}

html[data-theme="dark"] .hero::after {
	background: radial-gradient(circle at 70% 70%, rgba(126, 106, 199, .25), transparent 60%);
}
