@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;1,400&family=Geologica:wght@400;700;900&family=JetBrains+Mono:wght@700&display=swap");

:root {
	/* 🌒 DARK MODE IS DEFAULT */
	--sage-main: #9cb39e;
	--sage-hover: #b5ccb7;
	--sage-bg: rgba(156, 179, 158, 0.15);

	/* Night sky: A very dark, desaturated midnight slate/green */
	--sky-bg: radial-gradient(circle at 50% 50%, #0c1412 0%, #060908 100%);
	--star-color: 255, 255, 255;
	--star-opacity: 0.15;

	/* Illuminating Cursor Glow */
	--cursor-glow-color: rgba(156, 179, 158, 0.15);

	--text-dark: #f0f0f0;
	--text-muted: #a0a5ab;
	--bg-page: #0a0e14;
	--bg-card: rgba(255, 255, 255, 0.04);
	--nav-bg: rgba(15, 20, 28, 0.75);
	--border-color: rgba(255, 255, 255, 0.08);
	--card-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
	--btn-text: #0a0e14;
	--ui-bg: transparent;

	/* Interactive Mouse Variables (Updated by JS) */
	--mouse-x: 0.5;
	--mouse-y: 0.5;
}

/* ☀️ LIGHT MODE OVERRIDES */
[data-theme="light"] {
	--sage-main: #6b8e70;
	--sage-hover: #527057;
	--sage-bg: #eef2ef;

	/* Day sky matches page, allowing green stars to show through */
	--sky-bg: var(--bg-page);
	--star-color: 107, 142, 112; /* RGB for #6b8e70 */
	--star-opacity: 0.35;

	/* Illuminating Cursor Glow */
	--cursor-glow-color: rgba(107, 142, 112, 0.12);

	--text-dark: #3d3d3c;
	--text-muted: #8a8a88;
	--bg-page: #f7f7f6;
	--bg-card: #ffffff;
	--nav-bg: rgba(247, 247, 246, 0.85);
	--border-color: rgba(0, 0, 0, 0.05);
	--card-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
	--btn-text: #fff;
	--ui-bg: #fff;
}

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

body {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	background-color: var(--bg-page);
	color: var(--text-dark);
	-webkit-font-smoothing: antialiased;
	min-height: 100vh;
	position: relative;
	overflow-x: hidden;
	transition: background-color 0.5s ease, color 0.5s ease;
}

/* ── Global Illuminating Cursor Glow ── */
.global-glow {
	position: fixed;
	inset: 0;
	width: 100vw;
	height: 100vh;
	pointer-events: none;
	z-index: 9999;
	background: radial-gradient(
		circle 300px at calc(var(--mouse-x) * 100vw) calc(var(--mouse-y) * 100vh),
		var(--cursor-glow-color),
		transparent 100%
	);
	transition: background 0.5s ease;
}

/* ── The Night Sky ── */
.night-sky {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: -1;
	background: var(--sky-bg);
	pointer-events: none;
	transition: background 0.6s ease;
	perspective: 600px;
	overflow: hidden;
}

/* Interactive Star Layer: Shifts SLIGHTLY toward the mouse */
.sky-parallax {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	transform: translate(
		calc((var(--mouse-x) - 0.5) * 25px),
		calc((var(--mouse-y) - 0.5) * 25px)
	);
	transition: transform 0.15s ease-out;
}

.star-rotation {
	position: absolute;
	top: -50%;
	left: -50%;
	width: 200%;
	height: 200%;
	animation: sky-drift 300s linear infinite;
}

@keyframes sky-drift {
	0% {
		transform: rotate(0deg);
	}
	100% {
		transform: rotate(360deg);
	}
}

/* Crisp Dots for Stars */
.stars {
	width: 100%;
	height: 100%;
	background-image: radial-gradient(
			circle,
			rgba(var(--star-color), var(--star-opacity)) 1px,
			transparent 1px
		),
		radial-gradient(
			circle,
			rgba(var(--star-color), calc(var(--star-opacity) * 0.6)) 1px,
			transparent 1px
		);
	background-size: 100px 100px, 180px 180px;
	background-position: 0 0, 40px 60px;
	transition: background-image 0.6s ease;
}

/* ── Floating Pill Nav & Theme Switch ── */
.nav-container {
	position: sticky;
	top: 1rem;
	z-index: 50;
	padding: 0 1.5rem;
	pointer-events: none;
}
.navbar {
	max-width: 850px;
	margin: 0 auto;
	background: var(--nav-bg);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border: 1px solid var(--border-color);
	border-radius: 999px;
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
	padding: 0.6rem 1.25rem;
	display: flex;
	justify-content: space-between;
	align-items: center;
	pointer-events: auto;
	transition: background 0.4s, border-color 0.4s;
}
.nav-brand {
	font-family: "Geologica", sans-serif;
	font-weight: 900;
	font-size: 1.2rem;
	color: var(--sage-hover);
}
.nav-links {
	display: flex;
	gap: 1.5rem;
}
.nav-links a {
	text-decoration: none;
	color: var(--text-dark);
	font-family: "Geologica", sans-serif;
	font-weight: 700;
	font-size: 0.9rem;
	transition: color 0.2s;
}
.nav-links a:hover {
	color: var(--sage-main);
}

.nav-actions {
	display: flex;
	align-items: center;
	gap: 1rem;
}

/* ── The Theme Switch Slider (Green Ring logic) ── */
.theme-switch {
	position: relative;
	display: inline-block;
	width: 58px;
	height: 30px;
}
.theme-switch input {
	opacity: 0;
	width: 0;
	height: 0;
}
.slider {
	position: absolute;
	cursor: pointer;
	inset: 0;
	background-color: rgba(0, 0, 0, 0.08);
	transition: 0.4s;
	border-radius: 34px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 6px;
	border: 1px solid var(--border-color);
}
:root .slider {
	background-color: rgba(255, 255, 255, 0.05);
}
[data-theme="light"] .slider {
	background-color: rgba(0, 0, 0, 0.06);
}

/* The Green Ring that frames the active icon */
.slider:before {
	position: absolute;
	content: "";
	height: 24px;
	width: 24px;
	left: 2px;
	bottom: 2px;
	background-color: transparent;
	border: 2px solid var(--sage-main);
	transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.4s;
	border-radius: 50%;
	box-sizing: border-box;
	z-index: 2;
	box-shadow: 0 0 8px rgba(156, 179, 158, 0.4);
}
/* Move ring to the Moon (Right side) when checked */
input:checked + .slider:before {
	transform: translateX(28px);
}
.icon {
	font-size: 14px;
	z-index: 1;
	line-height: 1;
	user-select: none;
	width: 20px;
	height: 20px;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Cart */
.nav-cart {
	display: flex;
	align-items: center;
	gap: 6px;
	background: var(--sage-main);
	color: var(--btn-text);
	padding: 6px 14px;
	border-radius: 999px;
	font-family: "Geologica", sans-serif;
	font-weight: 700;
	font-size: 0.9rem;
	cursor: pointer;
	transition: background 0.2s;
}
.nav-cart:hover {
	background: var(--sage-hover);
}
.cart-count {
	font-family: "JetBrains Mono", monospace;
	font-size: 0.9rem;
}
.cart-count.pop {
	animation: pop 0.2s ease;
}
@keyframes pop {
	50% {
		transform: scale(1.4);
	}
}

@media (max-width: 600px) {
	.nav-links {
		display: none;
	}
}

/* ── Header ── */
.hero {
	text-align: center;
	padding: 4rem 1.5rem 3rem;
	display: flex;
	flex-direction: column;
	align-items: center;
}
.eyebrow {
	font-family: "JetBrains Mono", monospace;
	font-size: 0.7rem;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--text-muted);
}
.title {
	font-family: "Geologica", sans-serif;
	font-weight: 900;
	font-size: clamp(2.5rem, 6vw, 4.5rem);
	letter-spacing: -0.03em;
	margin: 0.5rem 0;
	color: var(--text-dark);
	transition: color 0.4s;
}
.divider {
	width: 50px;
	height: 3px;
	background: var(--sage-main);
	border-radius: 2px;
	transition: background 0.4s;
}
.subtitle {
	font-family: "Cormorant Garamond", serif;
	font-style: italic;
	font-size: 1.3rem;
	margin-top: 1rem;
	color: var(--text-muted);
	max-width: 400px;
	transition: color 0.4s;
}
.hero-icon {
	width: 44px;
	height: 44px;
	margin-top: 1.5rem;
	color: var(--sage-main);
	opacity: 0.5;
	transition: color 0.4s;
}

/* ── Grid & Cards ── */
.store-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 1.5rem;
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 1.5rem 5rem;
}
.card {
	background: var(--bg-card);
	border-radius: 20px;
	overflow: hidden;
	box-shadow: var(--card-shadow);
	border: 1px solid var(--border-color);
	display: flex;
	flex-direction: column;
	transition: transform 0.3s, box-shadow 0.3s, background 0.4s, border-color 0.4s;
}
.card:hover {
	transform: translateY(-4px);
	box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

.img-wrap {
	position: relative;
	width: 100%;
	aspect-ratio: 1 / 1;
	background: rgba(0, 0, 0, 0.05);
	overflow: hidden;
}
.product-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: 0;
	transform: scale(0.95);
	transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.8s ease;
}
.product-img.is-revealed {
	opacity: 1;
	transform: scale(1);
}
.card:hover .product-img.is-revealed {
	transform: scale(1.05);
}

.hover-bar {
	position: absolute;
	bottom: 12px;
	left: 50%;
	transform: translateX(-50%) translateY(10px);
	width: calc(100% - 24px);
	opacity: 0;
	pointer-events: none;
	z-index: 10;
	transition: opacity 0.3s ease, transform 0.3s ease;
}
.card:hover .hover-bar {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
	pointer-events: auto;
}

.add-to-cart {
	width: 100%;
	padding: 12px;
	border-radius: 999px;
	border: none;
	background: var(--sage-main);
	color: var(--btn-text);
	font-family: "Geologica", sans-serif;
	font-weight: 700;
	font-size: 0.85rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	cursor: pointer;
	transition: background 0.2s, transform 0.1s;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.add-to-cart:hover {
	background: var(--sage-hover);
}
.add-to-cart:active {
	transform: scale(0.98);
}

.card-body {
	padding: 1.25rem;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}
.card-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
}
.card-header h2 {
	font-family: "Geologica", sans-serif;
	font-weight: 700;
	font-size: 1.15rem;
	line-height: 1.2;
	color: var(--text-dark);
}
.price {
	font-family: "JetBrains Mono", monospace;
	font-weight: 700;
	color: var(--text-dark);
	font-size: 0.95rem;
}
.description {
	font-size: 0.85rem;
	color: var(--text-muted);
	line-height: 1.4;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* Variants */
.variants {
	margin-top: 0.25rem;
}
.variant-label-title {
	font-family: "JetBrains Mono", monospace;
	font-size: 0.65rem;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--text-muted);
	margin-bottom: 0.5rem;
}
.variant-options {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}
.v-btn input[type="radio"] {
	display: none;
}
.v-ui {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 4px 10px;
	border: 1px solid var(--border-color);
	border-radius: 99px;
	font-size: 0.75rem;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.2s;
	color: var(--text-muted);
	background: var(--ui-bg);
}
.v-btn input[type="radio"]:checked + .v-ui {
	border-color: var(--sage-main);
	background: var(--sage-bg);
	color: var(--text-dark);
}
.v-btn:hover input:not(:checked) + .v-ui {
	border-color: var(--sage-main);
}
.swatch {
	width: 12px;
	height: 12px;
	border-radius: 50%;
	border: 1px solid rgba(0, 0, 0, 0.1);
}

.text-input {
	width: 100%;
	padding: 8px 12px;
	border: 1px solid var(--border-color);
	border-radius: 8px;
	font-family: inherit;
	font-size: 0.85rem;
	outline: none;
	transition: border-color 0.2s;
	background: var(--ui-bg);
	color: var(--text-dark);
}
.text-input:focus {
	border-color: var(--sage-main);
}