/*
Theme Name: CD Web
Theme URI: https://cdweb.co.uk
Author: Chris Dyson
Description: Custom hand-coded theme for cdweb.co.uk
Version: 1.0
Text Domain: cdweb
*/

/* ==========================================================================
   Design tokens
   ========================================================================== */
:root {
	--color-1: hsl(217 66% 43%);
	--color-2: hsl(315 76% 54%);
	--color-3: hsl(180 1% 35%);
	--color-4: hsl(0 0% 15%);
	--site-bg: #f7f7f7;
	--box-bg: #ffffff;
	--border-color: #e2e2e2;
	--body-text: #363636;
	--neutral: #6b6b6b;

	--radius: 1rem;
	--radius-sm: 0.6rem;

	--space-xs: clamp(1rem, 0.3vw + 0.95rem, 1.3rem);
	--space-s: clamp(1.6rem, 0.5vw + 1.4rem, 2rem);
	--space-m: clamp(2.4rem, 0.7vw + 2.1rem, 3rem);
	--space-l: clamp(3.2rem, 1.4vw + 2.7rem, 4.5rem);
	--space-xl: clamp(4.5rem, 3vw + 3.5rem, 7rem);

	--h1: clamp(2.6rem, 2.2vw + 2rem, 4.6rem);
	--h2: clamp(1.8rem, 1.2vw + 1.5rem, 2.7rem);
	--h3: clamp(1.5rem, 0.6vw + 1.3rem, 1.9rem);
	--h4: clamp(1.2rem, 0.3vw + 1.1rem, 1.4rem);

	--max-width: 1200px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
	margin: 0;
	font-family: "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	font-size: 1.05rem;
	line-height: 1.6;
	color: var(--body-text);
	background-color: var(--site-bg);
	position: relative;
	-webkit-font-smoothing: antialiased;
	overflow-x: clip;
}

/* Aurora background — layered blurred gradient blobs, fixed behind all content */
.aurora {
	position: fixed;
	inset: 0;
	z-index: -1;
	overflow: hidden;
	pointer-events: none;
}
.aurora::before,
.aurora::after,
.aurora span {
	content: "";
	position: absolute;
	border-radius: 50%;
	filter: blur(90px);
	opacity: 0.55;
	will-change: transform;
}
.aurora::before {
	width: 60vw; height: 60vw;
	max-width: 900px; max-height: 900px;
	top: -15vw; left: -10vw;
	background: radial-gradient(circle, hsl(217 66% 43% / 0.55), transparent 70%);
	animation: aurora-drift-1 16s ease-in-out infinite alternate;
}
.aurora::after {
	width: 55vw; height: 55vw;
	max-width: 800px; max-height: 800px;
	top: 10vh; right: -15vw;
	background: radial-gradient(circle, hsl(315 76% 54% / 0.5), transparent 70%);
	animation: aurora-drift-2 19s ease-in-out infinite alternate;
}
.aurora span {
	width: 45vw; height: 45vw;
	max-width: 650px; max-height: 650px;
	bottom: -10vw; left: 20vw;
	background: radial-gradient(circle, hsl(233 66% 55% / 0.4), transparent 70%);
	animation: aurora-drift-3 21s ease-in-out infinite alternate;
}
@keyframes aurora-drift-1 {
	0% { transform: translate(0, 0) scale(1); }
	100% { transform: translate(14vw, 9vh) scale(1.25); }
}
@keyframes aurora-drift-2 {
	0% { transform: translate(0, 0) scale(1); }
	100% { transform: translate(-12vw, 12vh) scale(1.2); }
}
@keyframes aurora-drift-3 {
	0% { transform: translate(0, 0) scale(1); }
	100% { transform: translate(10vw, -11vh) scale(1.22); }
}
@media (prefers-reduced-motion: reduce) {
	.aurora::before, .aurora::after, .aurora span { animation: none; }
}

.text-gradient {
	background: linear-gradient(100deg, var(--color-1), var(--color-2));
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.text-serif {
	font-family: "Instrument Serif", Georgia, serif;
	font-style: italic;
	font-weight: 400;
}

/* Scroll-reveal animation (JS toggles .is-visible via IntersectionObserver) */
.reveal {
	opacity: 0;
	transform: translateY(24px);
	transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }
.reveal-stagger.is-visible .card,
.reveal-stagger.is-visible > * {
	animation: reveal-fade-up 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.reveal-stagger.is-visible .card:nth-child(1) { animation-delay: 0.05s; }
.reveal-stagger.is-visible .card:nth-child(2) { animation-delay: 0.12s; }
.reveal-stagger.is-visible .card:nth-child(3) { animation-delay: 0.19s; }
.reveal-stagger.is-visible .card:nth-child(4) { animation-delay: 0.26s; }
.reveal-stagger.is-visible .card:nth-child(5) { animation-delay: 0.33s; }
.reveal-stagger.is-visible .card:nth-child(6) { animation-delay: 0.4s; }
.reveal-stagger.is-visible .card:nth-child(7) { animation-delay: 0.47s; }
@keyframes reveal-fade-up {
	from { opacity: 0; transform: translateY(20px); }
	to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
	.reveal, .reveal-stagger .card, .reveal-stagger > * { opacity: 1; transform: none; animation: none; transition: none; }
}

.status-pill {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	padding: 0.4em 1em;
	border-radius: 50px;
	background: hsl(0 0% 100% / 0.7);
	backdrop-filter: blur(8px);
	border: 1px solid var(--border-color);
	font-size: 0.8rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--color-1);
	margin-bottom: var(--space-s);
}
.status-pill .dot { width: 0.4rem; height: 0.4rem; border-radius: 50%; background: var(--color-2); }

img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-1); text-decoration: none; }

h1, h2, h3, h4 {
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: 1.1;
	color: var(--color-4);
	margin: 0 0 var(--space-xs);
}
h1 { font-size: var(--h1); }
h2 { font-size: var(--h2); }
h3 { font-size: var(--h3); }
h4 { font-size: var(--h4); }
p { margin: 0 0 var(--space-xs); }
p:last-child { margin-bottom: 0; }

.container {
	max-width: var(--max-width);
	margin: 0 auto;
	padding: 0 var(--space-m);
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	padding: 0.85em 1.5em;
	border-radius: var(--radius-sm);
	font-weight: 600;
	font-size: 0.95rem;
	cursor: pointer;
	border: 1px solid transparent;
	transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.btn:hover { transform: translateY(-2px); }

.btn-primary {
	background: linear-gradient(135deg, var(--color-1), hsl(233 66% 48%));
	color: #fff;
	box-shadow: 0 10px 24px -10px hsl(217 66% 43% / 0.55);
}
.btn-primary:hover {
	background: linear-gradient(135deg, hsl(233 66% 48%), var(--color-2));
	color: #fff;
	box-shadow: 0 14px 28px -10px hsl(315 76% 54% / 0.5);
}

.btn-secondary {
	background: var(--box-bg);
	color: var(--color-4);
	border-color: var(--border-color);
}
.btn-secondary:hover { border-color: var(--color-1); color: var(--color-1); }

.btn-accent {
	background: var(--color-2);
	color: #fff;
	box-shadow: 0 8px 20px -8px hsl(315 76% 54% / 0.5);
}
.btn-accent:hover { background: var(--color-4); color: #fff; }

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	padding: var(--space-xs) 0;
}
.site-header .container {
	background: hsl(0 0% 100% / 0.75);
	backdrop-filter: blur(16px) saturate(160%);
	-webkit-backdrop-filter: blur(16px) saturate(160%);
	border: 1px solid hsl(0 0% 100% / 0.6);
	border-radius: 50px;
	box-shadow: 0 8px 32px -12px rgba(19,19,19,0.12);
	padding: 0.6rem 0.9rem 0.6rem 1.5rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-s);
}
.site-logo img { height: 2.2rem; width: auto; max-width: 40vw; object-fit: contain; flex-shrink: 0; }

.main-nav ul {
	display: flex;
	list-style: none;
	margin: 0;
	padding: 0.3rem;
	gap: 0.2rem;
	background: hsl(0 0% 0% / 0.04);
	border-radius: 50px;
}
.main-nav a {
	display: block;
	padding: 0.6em 1.2em;
	border-radius: 50px;
	color: var(--color-4);
	font-weight: 600;
	font-size: 0.95rem;
	transition: background-color 0.2s ease, color 0.2s ease;
}
.main-nav a:hover { background: #fff; }
.main-nav .current-menu-item a { background: linear-gradient(135deg, var(--color-1), hsl(233 66% 48%)); color: #fff; }

.header-actions { display: flex; align-items: center; gap: var(--space-s); }
.social-icons { display: flex; gap: 0.5rem; }
.social-icons a {
	display: flex; align-items: center; justify-content: center;
	width: 2.4rem; height: 2.4rem;
	border: 1px solid var(--border-color);
	border-radius: var(--radius-sm);
	color: var(--color-4);
	transition: background-color 0.2s ease, color 0.2s ease;
}
.social-icons a:hover { background: var(--color-4); color: #fff; }
.social-icons svg { width: 1.1rem; height: 1.1rem; fill: currentColor; }

.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 0.5rem; }
.nav-toggle svg { width: 1.6rem; height: 1.6rem; }

@media (max-width: 860px) {
	.main-nav { display: none; }
	.main-nav.is-open {
		display: block; position: absolute; top: 100%; left: 0; right: 0;
		background: #fff; border-top: 1px solid var(--border-color); padding: var(--space-s);
		z-index: 100;
	}
	.main-nav.is-open ul { flex-direction: column; background: none; border: none; padding: 0; }
	.nav-toggle { display: block; }
	.site-header .container { position: relative; }
	.header-actions .social-icons { display: none; }
	.header-actions { gap: var(--space-xs); }
	.header-actions .btn-primary { padding: 0.7em 1em; font-size: 0.85rem; }
}

@media (max-width: 480px) {
	.site-header .container { flex-wrap: nowrap; padding: 0 var(--space-s); }
	.site-logo img { max-width: 32vw; }
}

/* ==========================================================================
   Sections / cards
   ========================================================================== */
section { padding: var(--space-l) 0; }
.section-tight { padding: var(--space-m) 0; }

.section-heading {
	position: sticky;
	top: calc(var(--space-l) + 5rem);
	align-self: start;
}

.two-col {
	display: grid;
	grid-template-columns: 1fr 2fr;
	gap: var(--space-m);
	align-items: start;
}
@media (max-width: 860px) {
	.two-col { grid-template-columns: 1fr; }
	.section-heading { position: static; }
}

.card {
	background: var(--box-bg);
	border: 1px solid var(--border-color);
	border-radius: var(--radius);
	padding: var(--space-s);
	box-shadow: 0 2px 8px -4px rgba(19,19,19,0.06);
	transition: box-shadow 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
}
.card:hover {
	box-shadow: 0 20px 40px -18px hsl(217 66% 43% / 0.25);
	transform: translateY(-4px);
	border-color: hsl(217 66% 43% / 0.3);
}

.card-accent {
	border-color: var(--color-2);
	box-shadow: 6px 6px 0 0 var(--color-2);
}
.card-accent:hover {
	transform: translate(-2px, -2px);
	box-shadow: 8px 8px 0 0 var(--color-2);
	border-color: var(--color-2);
}

.card-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 3rem;
	height: 3rem;
	border-radius: 50%;
	background: linear-gradient(135deg, hsl(217 66% 43% / 0.12), hsl(315 76% 54% / 0.12));
	font-size: 1.4rem !important;
	margin-bottom: 0.75rem;
}

.card-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: var(--space-s);
}
@media (max-width: 700px) {
	.card-grid { grid-template-columns: 1fr; }
}

.card-list { display: flex; flex-direction: column; gap: var(--space-s); }

.card > img { aspect-ratio: 16/10; object-fit: cover; object-position: top; width: 100%; }
.card h3, .card h4 { margin-bottom: 0.5rem; }
.card p { color: var(--neutral); }
.card ul { margin: 0.75rem 0 0; padding-left: 1.2rem; color: var(--neutral); }
.card ul li { margin-bottom: 0.4rem; }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
	padding-top: var(--space-l);
	padding-bottom: var(--space-l);
}
.hero .two-col { grid-template-columns: 1fr 2fr; }
@media (max-width: 860px) { .hero .two-col { grid-template-columns: 1fr; } }

.hero-photo {
	background: var(--box-bg);
	border: 1px solid var(--border-color);
	border-radius: var(--radius);
	padding: var(--space-m);
	text-align: center;
	box-shadow: 0 24px 48px -28px rgba(19,19,19,0.18);
}
.hero-photo img {
	border-radius: var(--radius-sm);
	aspect-ratio: 1/1;
	object-fit: cover;
	width: 100%;
	margin-bottom: var(--space-s);
}
.hero-photo .social-icons { justify-content: center; margin-bottom: var(--space-s); }
.availability-badge {
	display: inline-flex; align-items: center; gap: 0.4em;
	padding: 0.5em 1em; border-radius: 50px;
	border: 1px solid var(--border-color); font-size: 0.9rem; font-weight: 600;
}
.availability-badge .dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: #2ecc71; }

.hero-content {
	background: var(--box-bg);
	border: 1px solid var(--border-color);
	border-radius: var(--radius);
	padding: var(--space-m);
	box-shadow: 0 24px 48px -28px rgba(19,19,19,0.18);
}
.hero-content .btn-row { display: flex; gap: var(--space-xs); flex-wrap: wrap; margin-top: var(--space-s); }

/* ==========================================================================
   Stats banner
   ========================================================================== */
.stats-banner {
	background: var(--box-bg);
	border: 1px solid var(--color-2);
	border-radius: var(--radius);
	padding: var(--space-l);
	margin-top: var(--space-m);
}
.stats-row {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: var(--space-s);
	margin: var(--space-m) 0;
	text-align: center;
}
@media (max-width: 700px) { .stats-row { grid-template-columns: 1fr 1fr; } }
.stat-number { font-size: clamp(2rem, 4vw, 3rem); font-weight: 800; color: var(--color-1); }
.stat-label { font-size: 0.9rem; color: var(--neutral); }
.stats-banner .stats-subtext { font-size: 0.9rem; color: var(--neutral); }

/* ==========================================================================
   Forms
   ========================================================================== */
.contact-card {
	background: var(--box-bg);
	border: 1px solid var(--border-color);
	border-radius: var(--radius);
	padding: var(--space-m);
	box-shadow: 0 2px 8px -4px rgba(19,19,19,0.06);
}
.form-group { margin-bottom: var(--space-s); }
.form-group label { display: block; margin-bottom: 0.4rem; font-weight: 600; font-size: 0.95rem; }
.form-group input, .form-group textarea {
	width: 100%;
	padding: var(--space-xs);
	border: 1px solid var(--border-color);
	border-radius: var(--radius-sm);
	background: var(--site-bg);
	font-family: inherit;
	font-size: 1rem;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-group input:focus, .form-group textarea:focus {
	outline: none;
	border-color: var(--color-1);
	box-shadow: 0 0 0 3px hsl(217 66% 43% / 0.15);
}
.form-checkbox { display: flex; align-items: flex-start; gap: 0.5rem; margin-bottom: var(--space-s); font-size: 0.9rem; }
.form-checkbox input { margin-top: 0.3rem; }
.form-submit { width: 100%; justify-content: center; }
.form-message { padding: 1rem; border-radius: var(--radius-sm); margin-bottom: var(--space-s); }
.form-message.success { background: #e7f7ed; color: #1c6b3a; }
.form-message.error { background: #fdecec; color: #a3211f; }

.contact-details { display: flex; flex-direction: column; gap: var(--space-s); margin-bottom: var(--space-m); }
.contact-details .item { display: flex; align-items: center; gap: 0.75rem; }
.contact-details .item svg { width: 1.2rem; height: 1.2rem; color: var(--color-1); flex-shrink: 0; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
	background: #efefef;
	padding: var(--space-l) 0 var(--space-m);
	margin-top: var(--space-l);
	border-top: 1px solid var(--border-color);
}
.site-footer .footer-top {
	display: flex; justify-content: space-between; align-items: flex-start;
	gap: var(--space-m); margin-bottom: var(--space-m); flex-wrap: wrap;
}
.site-footer .footer-info { font-size: 0.9rem; color: var(--neutral); line-height: 1.8; }
.site-footer hr { border: none; border-top: 1px solid var(--border-color); margin: var(--space-s) 0; }
.site-footer .footer-bottom { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; font-size: 0.85rem; color: var(--neutral); }

/* ==========================================================================
   Blog / single post
   ========================================================================== */
.post-content { max-width: 780px; margin: 0 auto; }
.post-content h2 { margin-top: var(--space-m); }
.post-content h3 { margin-top: var(--space-m); }
.post-content ul, .post-content ol { padding-left: 1.4rem; }
.post-meta { color: var(--neutral); font-size: 0.9rem; margin-bottom: var(--space-m); }
.post-content .download-cta {
	background: var(--box-bg); border: 1px solid var(--border-color);
	border-radius: var(--radius); padding: var(--space-m); margin-top: var(--space-l);
	text-align: center;
}

/* ==========================================================================
   Utility
   ========================================================================== */
.text-center { text-align: center; }
.text-muted { color: var(--neutral); }
.mt-0 { margin-top: 0; }
