@font-face {
	font-family: 'Comfortaa';
	src: url('Comfortaa-Regular.woff2') format('woff2'),
	url('Comfortaa-Regular.woff') format('woff');
	font-weight: normal;
	font-style: normal;
	font-display: swap;
}

*, *::before, *::after {
	box-sizing: border-box;
}

html, body, h1, h2, h3, h4, ul, dl, dt, dd, figure {
	margin: 0;
	padding: 0;
}

button, input, textarea, select, h1, h2, h3, h4 {
	font: inherit;
	color: inherit;
}

th {
	font: inherit;
}

button {
	cursor: pointer;
}

ul {
	list-style: none;
}

dialog,
fieldset {
	padding: 0;
	border: 0;
}

.alt-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
}

@property --background-color {
	syntax: "<color>";
	inherits: true;
	initial-value: #fff;
}

@property --secondary-background-color {
	syntax: "<color>";
	inherits: true;
	initial-value: #fff;
}

@property --text-color {
	syntax: "<color>";
	inherits: true;
	initial-value: #fff;
}

@property --secondary-text-color {
	syntax: "<color>";
	inherits: true;
	initial-value: #fff;
}

@property --control-color {
	syntax: "<color>";
	inherits: true;
	initial-value: #fff;
}

@property --control-text-color {
	syntax: "<color>";
	inherits: true;
	initial-value: #fff;
}

@property --control-highlight-color {
	syntax: "<color>";
	inherits: true;
	initial-value: #fff;
}

@property --control-highlight-text-color {
	syntax: "<color>";
	inherits: true;
	initial-value: #fff;
}

:root {
	--background-color: #333;
	--secondary-background-color: #444;
	--text-color: #efefef;
	--secondary-text-color: #efefef;
	--condary-text-color: #efefef;
	--control-color: #6b6b6b;
	--control-text-color: #efefef;
	--control-highlight-color: #2f70ad;
	--control-highlight-text-color: #dbe4ea;

	--icon-scale: 1;
	--icon-stroke: currentcolor;
	--icon-fill-alert: #b80b0b;
	--icon-fill-active: #fdb601;

	background: var(--background-color);
	color: var(--text-color);
	font-family: sans-serif;
	transition-duration: 0.3s;
	transition-property: --background-color --secondary-background-color --text-color --control-color --control-text-color --control-highlight-color --control-highlight-text-color;

	font-family: Comfortaa, sans-serif;
}

@media (prefers-color-scheme: light) {
	:root {
		--background-color: #efefef;
		--text-color: #333;
	}
}

x-icon {
	flex: none;
	position: relative;
	display: inline-flex;
	width: 1em;
	aspect-ratio: 1;
}

x-icon svg {
	position: absolute;
	width: 100%;
	aspect-ratio: 1;
	transform: scale(calc(var(--icon-scale) * 1.4));
}

input, button, x-current-place a, x-weather-forecast .tab {
	--input-color: var(--control-color);
	--input-text-color: var(--control-text-color);

	border: 0.1em solid var(--input-color);
	border-radius: 0.2em;
	color: var(--input-text-color);
	outline: none;
	transition: border-color 0.3s, background-color 0.3s;
}

input {
	padding: 0.5em;
	background: transparent;
	color: inherit;
}

button {
	display: inline-flex;
	gap: 0.3em;
	align-items: center;
	justify-content: center;
	padding: 0.5em 1em;
	background: var(--input-color);
}

:is(input, button):is(:hover, :focus-visible) {
	--input-color: var(--control-highlight-color);
}

body > header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1em;
	flex-wrap: wrap;
	background: var(--secondary-background-color);
	color: var(--secondary-text-color);
}

body > header,
main {
	padding: 1em;
}

header {
	min-height: 5.5em;
}

header h1 {
	display: flex;
	align-items: center;
	gap: 0.5em;
	text-transform: uppercase;
}

main {
	display: flex;
	flex-direction: column;
	gap: 1em;
}

dialog {
	background: var(--background-color);
}

.dialog-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 0.5em;

	color: var(--background-color);
	background: var(--secondary-background-color);
}

@view-transition {
	navigation: auto;
}

header {
	view-transition-name: header;
}

main {
	view-transition-name: main;
}

:root { 
	--view-transition-duration: 0.3s;
}

@media (prefers-reduced-motion: reduce) {
	:root {
		--view-transition-duration: 0;
	}
}

::view-transition-old(main) {
  animation: slide-out var(--view-transition-duration) ease-out forwards;
}

::view-transition-new(main) {
  animation: slide-in var(--view-transition-duration) ease-out forwards;
}

@keyframes slide-out {
  to {
    transform: translateX(100%);
  }
}

@keyframes slide-in {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}