/* Copyright (c) 2024-2025 Mateus Cezário Barreto */

@font-face
{
	font-family: "Inconsolata";
	src: url("Inconsolata-Regular.woff2") format("woff2");
}

:root, ::backdrop
{
	--content-space-width: min(100vw, 100vh);
	--empty-space-width: calc( 100vw - var(--content-space-width) );
	--main-font: "Victor Mono";
	--border-width: 0.6vw;
	--default-distance: min(1vw, 1vh);
	--color-background-1: #060e1e;
	--color-background-faded: #212121ab;
	--color-background-2: #060e1e;
	--color-background-interactive: #ffb30029;
	--color-text-normal: #dcdcdc;
	--color-text-marked: #85e80c;
	--color-text-shadowed: grey;
	--color-clickable-normal: #FF7700;
	--color-clickable-selected: #ffcd5b;
	--color-border: #85e80c;
	--color-border-hover: #bdbdbd;
}

html 
{ scroll-behavior: smooth; }

html, body, :modal
{
	margin: 0;
	padding: 0;
	width: 100%;
	color: var(--color-text-normal);
	background-color: var(--color-background-1);
	font-family: var(--main-font);
	font-size: 1rem;
}

header
{
	background-color: var(--color-background-2);
	border-color: var(--color-border);
	border-bottom-style: solid;
	border-bottom-width: var(--border-width);
	text-align: center;
}

main, header { padding: 2rem calc( var(--empty-space-width) / 2 + 0.6rem ); }

div[name="main-navigation"]
{
	display: flex;
	justify-content: space-around;
}

dialog[open]
{
	max-height: 90vh;
	margin-left: auto;
	margin-right: auto;
	margin-top: 2vh;
	padding: 2vh 0;
	width: calc( 100vw - var(--empty-space-width) );
}

ul
{
	margin-left: 1rem;
	border-left-style: solid;
	border-left-width: var(--border-width);
	border-left-color: var(--color-border);
}

figure, div, pre, math:not( p > math )
{
	padding: 1rem;
	margin-right: auto;
	margin-left: auto;
	height: auto;
	max-width: 90%;
	border-style: solid;
	border-width: var(--border-width);
	border-color: var(--color-border);
	break-inside: avoid;
}

p > math { margin: 0; }

section
{
	padding-left: 0.8rem;
	border-left-style: solid;
	border-left-width: 0.2rem;
	border-left-color: var(--color-border);
}

div, pre, math
{
	overflow-x: auto;
	overflow-y: hidden;
	text-wrap: nowrap;
}

div div
{
	border-style: unset;
	border-left-style: solid;
	border-left-width: var(--border-width);
	border-left-color: var(--color-border);
}

div:not( .line-break ) * { width: fit-content; }

div.line-break { text-wrap: auto; }

body, main, figure, div, section, p, h1
{
	box-sizing: border-box;
}

img, video
{
	max-height: 50vh;
	max-width: 100%;
	display: block;
}

figure { width: fit-content; padding: 0.8rem;}

strong, mark, code, kbd, blockquote > *
{
	color: var(--color-text-marked);
	background-color: unset;
}

math { font-size: 1.4rem; }

p math { font-size: 1em; }

figcaption, p.shadowed { color: var(--color-text-shadowed); }

a
{
	font-family: inherit;
	font-style: inherit;
	font-size: inherit;
	color: var(--color-clickable-normal);
	background-color: unset;
	border: unset;
	text-decoration: none;
}

a:hover { color: var(--color-clickable-selected); }

div:not(:has(div:hover)):hover
{
	border-color: var(--color-border-hover);
	background-color: var(--color-background-2);
}

section:not(:has(section:hover)):hover, ul:not(:has(ul:hover)):hover
{
	border-color: var(--color-border-hover);
}

@keyframes selectionColorChange
{
	0% { background-color: var(--color-clickable-normal); }
	50% { background-color: var(--color-clickable-selected); }
	100% { background-color: var(--color-clickable-normal); }
}

button:enabled:hover, input[type="submit"]:enabled:hover, input[type="reset"]:enabled:hover, input[type="button"]:enabled:hover,
button:enabled:focus, input[type="submit"]:enabled:focus, input[type="reset"]:enabled:focus, input[type="button"]:enabled:focus
{
	animation: selectionColorChange 1.8s infinite;
}

hr { color: var(--color-border); }

h1, h2, h3, h4, h5, h6, p:not( div > p )
{
	overflow-x: auto;
	overflow-y: hidden;
	line-height: 1.4em;
	margin-top: 0;
}

div.line-break > p { overflow-x: auto; }

h1, h2, h3, h4, h5, h6
{
	color: var(--color-text-marked);
	font-size: 1.4rem;
	font-weight: bold;
	margin: 0;
}

section { margin-top: 3rem; break-after: page; }

h1, h2, h3, h4, h5, h6, p, div, nav, li, ul, math, img, video { margin-bottom: 1.5rem; }

:last-child { margin-bottom: 0; }

:first-child { margin-top: 0; }

button, input[type="submit"], input[type="reset"], input[type="button"]
{
	font-size: 1rem;
	padding: 0.5rem;
	border-width: 0px;
	background-color: var(--color-clickable-normal);
	color: var(--color-background-1);
	text-decoration: none;
}

button svg {pointer-events:none;}

header img
{
	width: min(50vw, 50vh);
	margin-right: auto;
	margin-left: auto;
}

div.ficha
{
	display: grid;
	grid-template-rows: auto auto;
	grid-template-columns: max(60%) minmax(40%, 60%);
	width: 100%;
	max-width: unset;
	text-wrap: unset;
	padding: var(--default-distance);
}

div.ficha div.names
{
	grid-row: 1;
	grid-column: 1;
	border: 0;
	overflow-wrap: break-word;
	overflow: unset;
	text-wrap: unset;
	padding: var(--default-distance);
	width: 100%;
}

div.ficha figure
{
	grid-row: 1;
	grid-column: 2;
	justify-self: end;
	margin: 0;
	width: 100%;
	height: fit-content;
	text-align: center;
	position: relative;
	padding: 0;
}

div.ficha img
{
	margin: 0;
	aspect-ratio: 3 / 4;
}

div.ficha:not(.easteregg-visible) img
{
	animation-name: image-change;
	animation-timing-function: ease-in-out;
	animation-iteration-count: infinite;
	animation-duration: 10s;
}

div.ficha.easteregg-visible img:not(.easteregg)
{ opacity: 0; }

div.ficha div.description, div.ficha div.easteregg
{
	grid-row: 2;
	grid-column: 1 / 3;
	max-width: unset;
	border: unset;
	width: 100%;
	overflow-wrap: break-word;
	overflow: unset;
	text-wrap: unset;
	padding: var(--default-distance);
}

@keyframes image-change
{
	0% { opacity: 0; }
	10% { opacity: 1; } 
	50% { opacity: 1; } 
	60% { opacity: 0; }
	100% { opacity: 0; }
}

@keyframes shake {
	0%, 100% { transform: translateX(0); }
	20%, 60% { transform: translateX(-8px) rotate(-1deg); }
	40%, 80% { transform: translateX(8px) rotate(1deg); }
}

.animate-shake
{ animation: shake 0.3s ease-in-out; }

div.easteregg-visible
{ animation: glow 1s infinite alternate ease-in-out; }

@keyframes glow {
  0% {
    border-color: orange;
    box-shadow: 0 0 10px orange,
                0 0 20px orange;
  }
  
  100% {
    border-color: red;
    box-shadow: 0 0 10px red,
                0 0 30px red;
  }
}

div.easteregg-visible div.description,
div:not(.easteregg-visible) .easteregg,
div:not(.easteregg-visible).easteregg
{ display: none; }

div.easteregg-visible .easteregg
{ display: block; }

div.ficha figure img:nth-of-type(1)
{ animation-delay: 0s;}

div.ficha figure img:not(:nth-of-type(1))
{
	position: absolute;
	left: 0rem;
	top: 0rem;
	width: 100%;
	padding: inherit;
	box-sizing: border-box;
}

div.ficha figure img:not(:nth-of-type(1)):not(.easteregg)
{ opacity: 0; animation-delay: 5s; }

div.ficha img.easteregg
{ opacity: 1; }


@media print
{
	:root
	{
		--color-text-normal: black;
		--color-text-marked: black;
		--color-border: black;
		--color-clickable-normal: blue;
	}

	h1, h2, h3, h4, h5, h6, p:not( div > p )
	{
		word-wrap: break-word;
	}
}