/*
 * Liquid glass look, light and dark (November 2026).
 *
 * Loaded after the main stylesheet and not inside a cascade layer, so these
 * rules win over the built Tailwind classes without !important. Everything
 * visual sits inside "@media screen": printed reports and emailed PDFs stay
 * flat, white and dark-on-light whichever look is chosen.
 *
 * Light is the default. Dark is html[data-theme="dark"], set by theme.js.
 */

/* The word ANALYZER beside the mark, in the site's own typeface. */
.g-word {
	font-family: 'Inter Variable', ui-sans-serif, system-ui, sans-serif;
	/* Strokes about as thick as the mountain outline */
	font-weight: 330;
	text-transform: uppercase;
	letter-spacing: -0.01em;
	color: #693f23;
	font-size: 26px;
	line-height: 1;
}
.g-mark-dark {
	display: none !important;
}
/* The word sits up beside the top of the mark, next to where the green
   trend line ends, rather than centred on it. */
.g-logo {
	align-items: flex-start;
	gap: 0;
}
/* Tucked in so the A's left leg runs alongside the last rise of the line. */
.g-logo .g-word {
	/* As tall as the mark: from the green dot down to the foot of the
	   mountains (line-height 1 puts the capitals there with no margin). */
	font-size: 46px;
	margin-top: 0;
	margin-left: 8px;
}
/* One soft shadow under the mark and the word, so the whole logo floats */
.g-logo {
	position: relative;
}
.g-logo::after {
	/* Same soft shadow the mark used to carry on its own, now one band
	   running under the mark and the whole word. */
	content: '';
	position: absolute;
	left: 4px;
	right: -2px;
	top: 46.5px;
	height: 5px;
	border-radius: 50%;
	background: radial-gradient(ellipse closest-side, rgba(59, 36, 22, 0.3) 35%, rgba(59, 36, 22, 0));
	filter: blur(0.8px);
	pointer-events: none;
}
html[data-theme='dark'] .g-logo::after {
	/* On the dark page the same band, as a soft light glow */
	background: radial-gradient(ellipse closest-side, rgba(255, 236, 214, 0.32) 35%, rgba(255, 236, 214, 0));
}
/* Smaller on a phone so the header still fits */
@media (max-width: 480px) {
	.g-logo::after {
		top: 37px;
		height: 4px;
	}
	.g-logo img {
		width: 3rem !important;
		height: 2.625rem !important;
	}
	.g-logo .g-word {
		font-size: 37px;
		margin-left: 6px;
	}
}

@media screen {
	:root {
		--g-page: #f1e4d3;
		--g-fill: linear-gradient(180deg, rgba(255, 250, 243, 0.64), rgba(255, 244, 232, 0.36));
		--g-border: rgba(255, 255, 255, 0.6);
		--g-shadow:
			inset 0 1.5px 0 rgba(255, 255, 255, 1), inset 0 0 0 1px rgba(255, 255, 255, 0.25),
			inset 0 -1px 0 rgba(59, 36, 22, 0.08), 0 22px 46px -24px rgba(59, 36, 22, 0.5),
			0 2px 6px rgba(59, 36, 22, 0.08);
		--g-blur: blur(24px) saturate(170%);
		--g-dark: linear-gradient(180deg, #5a3824 0%, #3b2416 55%, #2c1a0f 100%);
		--g-dark-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), inset 0 -2px 6px rgba(0, 0, 0, 0.25), 0 8px 18px -8px rgba(59, 36, 22, 0.7);
		--g-on-dark: #fff;
		--g-pill: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.56));
		--g-pill-border: rgba(255, 255, 255, 0.95);
		--g-pill-shadow: inset 0 1px 0 #fff, 0 3px 10px -5px rgba(59, 36, 22, 0.3);
		--g-pill-text: #3b2416;
		--g-current: rgba(255, 255, 255, 0.9);
		--g-current-text: #3b2416;
		--g-pane: rgba(255, 255, 255, 0.5);
		--g-pane-border: rgba(255, 255, 255, 0.78);
		--g-field: rgba(255, 255, 255, 0.8);
		--g-track: rgba(59, 36, 22, 0.1);
		--g-up-line: #15803d;
		--g-glow-1: #c98c55;
		--g-glow-2: #9a6440;
		--g-glow-3: #e3a96e;
		--g-glow-4: #f0c48f;
		--g-mountains: #3b2416;
		--g-mountains-opacity: 0.05;
		/* Helper text one step darker than before, to read on glass */
		--color-muted: #6f5c4b;
	}

	html[data-theme='dark'] {
		color-scheme: dark;
		--g-page: #1c110a;
		--g-fill: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.05));
		--g-border: rgba(255, 255, 255, 0.16);
		--g-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), inset 0 -1px 0 rgba(0, 0, 0, 0.25), 0 24px 50px -24px rgba(0, 0, 0, 0.7);
		--g-dark: linear-gradient(180deg, #fff7ec, #ecd9c2);
		--g-dark-shadow: inset 0 1px 0 #fff, 0 8px 18px -8px rgba(0, 0, 0, 0.6);
		--g-on-dark: #2c1a0f;
		--g-pill: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.07));
		--g-pill-border: rgba(255, 255, 255, 0.2);
		--g-pill-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
		--g-pill-text: #f7efe4;
		--g-current: rgba(255, 255, 255, 0.88);
		--g-current-text: #2c1a0f;
		--g-pane: rgba(255, 255, 255, 0.06);
		--g-pane-border: rgba(255, 255, 255, 0.12);
		--g-field: rgba(255, 255, 255, 0.08);
		--g-track: rgba(255, 255, 255, 0.12);
		--g-up-line: #4ade80;
		--g-glow-1: #7a4a2a;
		--g-glow-2: #a0663a;
		--g-glow-3: #4b2c18;
		--g-glow-4: #6b4026;
		--g-mountains: #ffffff;
		--g-mountains-opacity: 0.035;
		/* The site's own colours, turned for a dark page */
		--color-cocoa: #f7efe4;
		--color-cocoa-soft: #e2d2c0;
		--color-muted: #c4af98;
		--color-gold: #e0ae63;
		--color-line: rgba(255, 255, 255, 0.12);
		--color-cream: rgba(255, 255, 255, 0.08);
		--color-paper: #1c110a;
		--color-up: #4ade80;
		--color-down: #f87171;
	}
	html[data-theme='dark'] .g-word {
		color: #f1dcc4;
	}
	html[data-theme='dark'] .g-mark-light {
		display: none !important;
	}
	html[data-theme='dark'] .g-mark-dark {
		display: inline-block !important;
	}

	/* Only the page canvas gets the colour, so the lit background (below)
	   shows through everything above it. */
	html {
		background: var(--g-page);
	}
	body.g {
		background: transparent;
	}

	/* Warm, softly lit background the glass sits on */
	.g-ambient {
		position: fixed;
		inset: 0;
		z-index: -1;
		overflow: hidden;
		pointer-events: none;
	}
	.g-ambient span {
		position: absolute;
		border-radius: 50%;
		filter: blur(60px);
	}
	.g-ambient span:nth-child(1) { width: 52vw; height: 52vw; left: -16vw; top: 12vh; background: radial-gradient(circle, var(--g-glow-1), transparent 70%); }
	.g-ambient span:nth-child(2) { width: 56vw; height: 56vw; right: -18vw; top: -14vh; background: radial-gradient(circle, var(--g-glow-2), transparent 70%); opacity: 0.8; }
	.g-ambient span:nth-child(3) { width: 42vw; height: 42vw; right: 6vw; bottom: -24vh; background: radial-gradient(circle, var(--g-glow-3), transparent 70%); }
	.g-ambient span:nth-child(4) { width: 36vw; height: 36vw; left: 30vw; top: 36vh; background: radial-gradient(circle, var(--g-glow-4), transparent 70%); }
	.g-ambient svg {
		position: absolute;
		left: -6vw;
		bottom: -8vh;
		width: 112vw;
		height: auto;
		fill: var(--g-mountains);
		opacity: var(--g-mountains-opacity);
	}

	/* Glass panels: the header, every card on a page */
	.g-glass,
	.g-card,
	.g main > section,
	.g section[data-step],
	.g-list > div {
		position: relative;
		background: var(--g-fill);
		-webkit-backdrop-filter: var(--g-blur);
		backdrop-filter: var(--g-blur);
		border: 1px solid var(--g-border);
		border-radius: 22px;
		box-shadow: var(--g-shadow);
	}
	.g-card,
	.g main > section,
	.g section[data-step] {
		padding: 24px 26px;
	}
	.g main > section {
		border-top: 1px solid var(--g-border);
		margin-top: 18px;
	}
	.g main > section.prose-report {
		max-width: none;
	}

	/* Header: a frosted bar floating above the page */
	.g-header-wrap {
		position: sticky;
		top: 0;
		z-index: 30;
		padding: 12px 14px 0;
	}
	.g-header {
		max-width: 72rem;
		margin: 0 auto;
		border-radius: 22px;
		padding-top: 14px;
		padding-bottom: 14px;
	}
	/* The menu scrolls sideways on a phone; on wider screens it doesn't clip,
	   and on a phone it gets room underneath for the highlighted pill. */
	.g-header nav {
		gap: 8px;
		padding: 4px 4px 8px;
	}
	@media (min-width: 640px) {
		.g-header nav {
			overflow: visible;
			padding: 4px;
		}
	}
	.g-header nav a {
		color: var(--color-cocoa-soft);
		font-weight: 550;
		padding: 9px 18px;
		border: 1px solid transparent;
	}
	.g-header nav a:hover {
		background: var(--color-cream);
	}
	.g-header nav a.g-on {
		background: var(--g-current);
		color: var(--g-current-text);
		font-weight: 650;
		border: 1px solid rgba(255, 255, 255, 0.95);
		box-shadow: inset 0 1px 0 #fff, 0 2px 8px -4px rgba(59, 36, 22, 0.3);
	}
	.g-header .g-signout,
	.g-theme {
		padding: 7px 14px;
		border-radius: 999px;
		background: var(--g-pill);
		border: 1px solid var(--g-pill-border);
		box-shadow: var(--g-pill-shadow);
		color: var(--g-pill-text);
		text-decoration: none;
	}
	.g-theme {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 36px;
		height: 36px;
		padding: 0;
		cursor: pointer;
		font-size: 16px;
		line-height: 1;
	}
	.g-theme .g-sun {
		display: none;
	}
	html[data-theme='dark'] .g-theme .g-sun {
		display: inline;
	}
	html[data-theme='dark'] .g-theme .g-moon {
		display: none;
	}

	/* Buttons and choice chips */
	.btn {
		background: var(--g-dark);
		color: var(--g-on-dark);
		border: 1px solid rgba(255, 255, 255, 0.18);
		box-shadow: var(--g-dark-shadow);
	}
	.btn:hover {
		background: var(--g-dark);
		filter: brightness(1.12);
	}
	.btn-quiet,
	.chip {
		background: var(--g-pill);
		border: 1px solid var(--g-pill-border);
		box-shadow: var(--g-pill-shadow);
		color: var(--g-pill-text);
	}
	.btn-quiet:hover,
	.chip:hover {
		border-color: var(--g-pill-border);
		filter: brightness(1.05);
	}
	.chip:has(input:checked) {
		background: var(--g-dark);
		color: var(--g-on-dark);
		border-color: rgba(255, 255, 255, 0.18);
		box-shadow: var(--g-dark-shadow);
	}
	.field {
		background: var(--g-field);
		color: var(--color-cocoa);
		border-color: var(--color-line);
		border-radius: 12px;
		box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
	}

	/* New analysis: steps as a segmented glass control, lists on lighter panes */
	.g [data-progress] {
		width: fit-content;
		gap: 4px;
		padding: 5px;
		border: 1px solid var(--g-border);
		border-radius: 999px;
		background: var(--g-fill);
		-webkit-backdrop-filter: var(--g-blur);
		backdrop-filter: var(--g-blur);
		box-shadow: var(--g-shadow);
	}
	.g [data-progress] li[data-state='current'] button {
		background: var(--g-current);
		color: var(--g-current-text);
		font-weight: 650;
		box-shadow: inset 0 1px 0 #fff, 0 2px 8px -4px rgba(59, 36, 22, 0.3);
	}
	.g section[data-step] [data-reveal],
	.g section[data-step] .divide-y {
		margin-top: 16px;
		padding: 10px 16px;
		background: var(--g-pane);
		border: 1px solid var(--g-pane-border);
		border-radius: 16px;
		box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
	}
	.g form[data-wizard] > div.border-t {
		border-top: 0;
		padding-top: 0;
		margin-top: 20px;
	}

	/* My analytics: each saved analysis is its own card */
	.g-list {
		border-top: 0;
	}
	.g-list > div {
		margin-top: 10px;
		padding: 14px 20px;
		border-radius: 18px;
	}

	/* Messages */
	.g main p[role='status'],
	.g main p[role='alert'],
	.g main div[role='alert'] {
		border-radius: 14px;
		background: var(--g-pane);
	}

	/* Text never sits on clear glass where transparency is turned down, or
	   where the browser can't blur: panels become solid instead. */
	@media (prefers-reduced-transparency: reduce) {
		.g-glass, .g-card, .g main > section, .g section[data-step], .g-list > div, .g [data-progress] {
			background: var(--g-page);
			-webkit-backdrop-filter: none;
			backdrop-filter: none;
		}
	}
	@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
		.g-glass, .g-card, .g main > section, .g section[data-step], .g-list > div, .g [data-progress] {
			background: var(--g-page);
		}
	}
}
