/* the aero theme: the bot's card style (backend/steinkauz/helpers/render/card-chrome.js) on the
   website. a page opts in with body class aero-page instead of glass-page and keeps its markup, so
   pages move over one at a time; navigation.js swaps body classes and stylesheets between them.
   colours are the raw oxygen plasma ones the cards use. */

/* #region aero · fonts */

@font-face {
	font-family: "WineTahoma";
	src: url("/assets/fonts/WineTahoma-Regular.ttf") format("truetype");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "WineTahoma";
	src: url("/assets/fonts/WineTahoma-Bold.ttf") format("truetype");
	font-weight: 700;
	font-style: normal;
	font-display: swap;
}

/* #endregion aero · fonts */

/* #region aero · palette and page */

html:has(.aero-page) {
	background: #000;
}

.aero-page {
	--aero-text: #E6E7E8;
	--aero-quiet: #989898;
	--aero-link: #A4C0E4;
	--aero-link-hot: #CFE0F7;
	--aero-tint: #EF8441;
	--aero-tint-rgb: 239, 132, 65;
	--aero-hover-rgb: 119, 183, 255;
	--aero-radius: 4px;
	--aero-radius-panel: 3px;
	--aero-radius-groove: 2px;
	--aero-halo: 0 0 6px rgba(0, 0, 0, 0.85), 0 1px 0 rgba(0, 0, 0, 0.9);

	width: 100%;
	min-height: 100vh;
	max-width: none;
	margin: 0;
	padding: clamp(1rem, 4vw, 3rem) clamp(0.75rem, 3vw, 2rem);

	color: var(--aero-text);
	background: #000;

	/* real tahoma where windows has it, wine's clone everywhere else */
	font-family: Tahoma, "WineTahoma", "DejaVu Sans", Verdana, sans-serif;
}

/* #endregion aero · palette and page */

/* #region aero · glass frame */

/* the window frame: tinted glass lit from the floor, streaked, grained, with a reflection over its
   top. the reflection is sized in pixels, so a tall page reflects at its top only */
.aero-page .glass-stage {
	position: relative;

	display: flex;
	flex-direction: column;
	gap: 10px;

	width: min(100%, 56rem);
	margin: 0 auto;
	padding: 12px;

	border: 1px solid rgba(0, 0, 0, 0.85);
	border-radius: var(--aero-radius);

	background-color: #000;
	background-image:
		linear-gradient(
			180deg,
			rgba(255, 255, 255, 0.16) 0,
			rgba(255, 255, 255, 0.02) 260px,
			transparent 320px
		),
		linear-gradient(
			105deg,
			transparent 0 6%,
			rgba(255, 255, 255, 0.07) 9%,
			transparent 12% 30%,
			rgba(255, 255, 255, 0.045) 33%,
			transparent 36% 55%,
			rgba(255, 255, 255, 0.07) 58%,
			transparent 61% 80%,
			rgba(255, 255, 255, 0.04) 83%,
			transparent 86%
		),
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E"),
		radial-gradient(
			60% 45% at 50% 100%,
			rgba(var(--aero-tint-rgb), 0.3),
			transparent 75%
		),
		linear-gradient(
			180deg,
			color-mix(in srgb, var(--aero-tint) 30%, #000),
			color-mix(in srgb, var(--aero-tint) 10%, #000)
		);

	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.75);
}

/* the light rim inside the dark one, fading toward the floor */
.aero-page .glass-stage::before {
	content: "";
	position: absolute;
	inset: 0;

	border: 1px solid transparent;
	border-radius: inherit;

	background:
		linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.06))
		border-box;

	-webkit-mask:
		linear-gradient(#000 0 0) padding-box,
		linear-gradient(#000 0 0);
	-webkit-mask-composite: xor;
	mask:
		linear-gradient(#000 0 0) padding-box,
		linear-gradient(#000 0 0);
	mask-composite: exclude;

	pointer-events: none;
}

/* #endregion aero · glass frame */

/* #region aero · sunken panels */

.aero-page .glass-cell {
	position: relative;

	padding: clamp(1rem, 3vw, 1.5rem);

	border: 1px solid rgba(0, 0, 0, 0.85);
	border-radius: var(--aero-radius-panel);

	text-align: center;

	background-image:
		linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 7px),
		linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 45%),
		linear-gradient(180deg, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.55));
}

/* the lit lower lip, brightest in the middle and nearly gone at the ends */
.aero-page .glass-cell::after {
	content: "";
	position: absolute;
	left: var(--aero-radius-panel);
	right: var(--aero-radius-panel);
	bottom: -2px;
	height: 1px;

	background:
		linear-gradient(
			90deg,
			rgba(255, 255, 255, 0.11),
			rgba(255, 255, 255, 0.32) 50%,
			rgba(255, 255, 255, 0.11)
		);

	pointer-events: none;
}

/* #endregion aero · sunken panels */

/* #region aero · display cases */

/* embeds sit under glass like the card avatar: lifted, a white glow just outside, a lit edge.
   an iframe paints over inset shadows, so the edge is an outline, which paints over the content */
.aero-page .glass-well {
	border: 0;
	border-radius: var(--aero-radius-panel);

	background: #000;

	outline: 1px solid rgba(255, 255, 255, 0.35);
	outline-offset: -1px;

	box-shadow:
		0 0 7px rgba(255, 255, 255, 0.35),
		0 5px 12px rgba(0, 0, 0, 0.75);
}

/* #endregion aero · display cases */

/* #region aero · text */

.aero-page header,
.aero-page h1,
.aero-page h2,
.aero-page h3,
.aero-page legend,
.aero-page .page-title,
.aero-page .card-title,
.aero-page .field-title,
.aero-page .title-row {
	color: var(--aero-text);
	text-shadow: var(--aero-halo);
}

.aero-page h2 {
	margin-top: 0;
}

.aero-page .muted,
.aero-page .user-info {
	color: var(--aero-quiet);
}

.aero-page strong {
	color: var(--aero-text);
}

.aero-page ::selection {
	background: var(--aero-tint);
	color: #000;
}

/* #endregion aero · text */

/* #region aero · links */

.aero-page a {
	color: var(--aero-link);
	text-shadow: var(--aero-halo);
	text-decoration-color: rgba(164, 192, 228, 0.45);
	text-underline-offset: 2px;
}

.aero-page a:hover,
.aero-page a:focus-visible {
	color: var(--aero-link-hot);
	text-shadow: 0 0 8px rgba(var(--aero-hover-rgb), 0.6);
}

/* #endregion aero · links */

/* #region aero · buttons */

/* win7 glass: a reflection cut off at the waist, light rising off the floor, a lit rim. hover is
   oxygen's blue glow, keyboard focus its orange one */
.aero-page .button,
.aero-page button {
	display: inline-block;

	padding: 0.35rem 0.9rem;

	border: 1px solid rgba(0, 0, 0, 0.85);
	border-radius: var(--aero-radius-panel);

	color: var(--aero-text);
	text-decoration: none;
	text-shadow: var(--aero-halo);

	background-image:
		linear-gradient(
			180deg,
			rgba(255, 255, 255, 0.22),
			rgba(255, 255, 255, 0.08) 48%,
			transparent 48%
		),
		radial-gradient(70% 60% at 50% 100%, rgba(255, 255, 255, 0.12), transparent 70%),
		linear-gradient(180deg, #3a3a3a, #141414);

	box-shadow:
		inset 0 0 0 1px rgba(255, 255, 255, 0.14),
		inset 0 1px 0 rgba(255, 255, 255, 0.32),
		0 2px 5px rgba(0, 0, 0, 0.6);
}

.aero-page .button:hover,
.aero-page button:hover {
	color: #fff;
	text-shadow: var(--aero-halo);

	background-image:
		linear-gradient(
			180deg,
			rgba(255, 255, 255, 0.26),
			rgba(255, 255, 255, 0.1) 48%,
			transparent 48%
		),
		radial-gradient(70% 70% at 50% 100%, rgba(var(--aero-hover-rgb), 0.45), transparent 75%),
		linear-gradient(180deg, #3a3a3a, #141414);

	box-shadow:
		inset 0 0 0 1px rgba(var(--aero-hover-rgb), 0.55),
		inset 0 1px 0 rgba(255, 255, 255, 0.4),
		0 0 8px rgba(var(--aero-hover-rgb), 0.55);
}

.aero-page .button:focus-visible,
.aero-page button:focus-visible {
	outline: none;
	color: #fff;
	text-shadow: var(--aero-halo);

	box-shadow:
		inset 0 0 0 1px rgba(255, 255, 255, 0.14),
		inset 0 1px 0 rgba(255, 255, 255, 0.32),
		0 0 0 1px rgba(var(--aero-tint-rgb), 0.9),
		0 0 7px rgba(var(--aero-tint-rgb), 0.6);
}

.aero-page .button:active,
.aero-page button:active {
	background-image:
		linear-gradient(180deg, rgba(0, 0, 0, 0.35), transparent 40%),
		linear-gradient(180deg, #1a1a1a, #2a2a2a);

	box-shadow:
		inset 0 1px 3px rgba(0, 0, 0, 0.7),
		inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

/* the button rules above set display, which would otherwise outrank the shared .hidden */
.aero-page .hidden {
	display: none;
}

/* #endregion aero · buttons */

/* #region aero · form fields */

/* fields are grooves: dark at the top, light catching the lower lip */
.aero-page textarea,
.aero-page input,
.aero-page select {
	border: 1px solid rgba(0, 0, 0, 0.9);
	border-radius: var(--aero-radius-groove);

	color: var(--aero-text);

	background-color: transparent;
	background-image: linear-gradient(180deg, rgba(0, 0, 0, 0.75), rgba(255, 255, 255, 0.06));

	box-shadow: 0 1px 0 rgba(255, 255, 255, 0.14);
}

.aero-page textarea:focus,
.aero-page input:focus,
.aero-page select:focus {
	outline: none;

	box-shadow:
		0 0 0 1px rgba(var(--aero-tint-rgb), 0.9),
		0 0 7px rgba(var(--aero-tint-rgb), 0.55);
}

.aero-page ::placeholder {
	color: var(--aero-quiet);
}

/* a card set into a sunken panel needs no rim glow of its own */
.aero-page .ring-light::after {
	content: none;
}

/* #endregion aero · form fields */

/* #region aero · scroller */

/* the track is a groove; the walking portals are glass buttons */
.aero-page .scroller {
	height: 52px;

	border: 1px solid rgba(0, 0, 0, 0.9);
	border-radius: var(--aero-radius-groove);

	background-color: transparent;
	background-image: linear-gradient(180deg, rgba(0, 0, 0, 0.75), rgba(255, 255, 255, 0.06));
}

.aero-page .scroller::after {
	box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.18);
}

/* display is restated: the general button rule above would leave the label unflexed and high */
.aero-page .scroller .scroller-item {
	top: 9px;

	display: flex;

	height: 32px;
	padding: 0 8px;

	border: 1px solid rgba(0, 0, 0, 0.85);
	border-radius: var(--aero-radius-panel);

	background-color: transparent;
	background-image:
		linear-gradient(
			180deg,
			rgba(255, 255, 255, 0.22),
			rgba(255, 255, 255, 0.08) 48%,
			transparent 48%
		),
		radial-gradient(70% 60% at 50% 100%, rgba(255, 255, 255, 0.12), transparent 70%),
		linear-gradient(180deg, #3a3a3a, #141414);

	box-shadow:
		inset 0 0 0 1px rgba(255, 255, 255, 0.14),
		inset 0 1px 0 rgba(255, 255, 255, 0.32),
		0 2px 6px rgba(0, 0, 0, 0.6);

	backdrop-filter: none;
}

/* a hidden portal keeps walking out of sight, same as on the glass theme */
.aero-page .scroller .scroller-item.hidden {
	display: flex;
	visibility: hidden;
}

.aero-page .scroller .scroller-item:hover,
.aero-page .scroller .scroller-item:focus-visible {
	background-image:
		linear-gradient(
			180deg,
			rgba(255, 255, 255, 0.26),
			rgba(255, 255, 255, 0.1) 48%,
			transparent 48%
		),
		radial-gradient(70% 70% at 50% 100%, rgba(var(--aero-hover-rgb), 0.45), transparent 75%),
		linear-gradient(180deg, #3a3a3a, #141414);

	box-shadow:
		inset 0 0 0 1px rgba(var(--aero-hover-rgb), 0.55),
		inset 0 1px 0 rgba(255, 255, 255, 0.4),
		0 0 8px rgba(var(--aero-hover-rgb), 0.55);
}

.aero-page .scroller span {
	color: var(--aero-text);
	font-size: 1em;
	text-shadow: var(--aero-halo);
}

/* #endregion aero · scroller */
