/*
 * Memelio Magija — bazė: reset, tipografija, fono atmosfera, pagalbinės klasės.
 */

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

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
	scroll-padding-top: calc(var(--mm-header-h) + var(--mm-4));
	/*
	 * Prekės ženklas gyvena tamsoje — tai sąmoningas sprendimas, o ne
	 * praleista šviesi tema. Fonas dedamas ir ant <html>, kad tarp
	 * puslapio kraštų neprasišviestų sistemos spalva.
	 */
	background: var(--mm-bg);
	color-scheme: dark;
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
}

body {
	margin: 0;
	background: var(--mm-bg);
	color: var(--mm-text-2);
	font-family: var(--mm-font-body);
	font-size: var(--mm-fs-body);
	line-height: var(--mm-lh-body);
	font-weight: 400;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	overflow-x: hidden;
	text-rendering: optimizeLegibility;
}

/* Kai atidarytas mobilus meniu arba lightbox. */
body.mm-locked {
	overflow: hidden;
}

/* ---------------------------------------------------------------------
 * Fono atmosfera: subtilus grūdelis + raudonas švytėjimas viršuje.
 * Grūdelis yra tai, kas neleidžia dideliems juodiems plotams atrodyti
 * "plokščiai" — jis imituoja fotografijos triukšmą.
 * ------------------------------------------------------------------ */

.mm-grain {
	position: fixed;
	inset: 0;
	z-index: var(--mm-z-grain);
	pointer-events: none;
	opacity: 0.035;
	mix-blend-mode: overlay;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
	will-change: transform;
	animation: mm-grain-shift 640ms steps(2) infinite;
}

@keyframes mm-grain-shift {
	0% { transform: translate3d(0, 0, 0); }
	50% { transform: translate3d(-2%, 1%, 0); }
	100% { transform: translate3d(1%, -2%, 0); }
}

@media (prefers-reduced-motion: reduce) {
	.mm-grain { animation: none; }
}

/* ---------------------------------------------------------------------
 * Tipografija
 * ------------------------------------------------------------------ */

h1, h2, h3, h4, h5, h6 {
	margin: 0;
	font-family: var(--mm-font-display);
	font-weight: 300;
	line-height: var(--mm-lh-tight);
	letter-spacing: var(--mm-ls-display);
	color: var(--mm-text);
	text-transform: uppercase;
	text-wrap: balance;
}

h1 { font-size: var(--mm-fs-h1); }
h2 { font-size: var(--mm-fs-h2); }
h3 { font-size: var(--mm-fs-h3); line-height: var(--mm-lh-snug); }
h4 { font-size: var(--mm-fs-h4); line-height: var(--mm-lh-snug); }
h5, h6 { font-size: var(--mm-fs-body); line-height: var(--mm-lh-snug); }

p {
	margin: 0 0 var(--mm-4);
	text-wrap: pretty;
}

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

strong, b { color: var(--mm-text); font-weight: 600; }

a {
	color: inherit;
	text-decoration: none;
	transition: color var(--mm-dur-fast) var(--mm-ease);
}

ul, ol { margin: 0 0 var(--mm-4); padding-left: 1.15em; }
li { margin-bottom: var(--mm-2); }

img, svg, video, canvas {
	display: block;
	max-width: 100%;
	height: auto;
}

figure { margin: 0; }

hr {
	border: 0;
	border-top: 1px solid var(--mm-line);
	margin: var(--mm-7) 0;
}

blockquote {
	margin: 0;
	padding-left: var(--mm-5);
	border-left: 2px solid var(--mm-red);
	font-size: var(--mm-fs-lead);
	color: var(--mm-text);
}

code, pre { font-family: var(--mm-font-mono); font-size: 0.9em; }

::selection {
	background: var(--mm-red);
	color: #fff;
}

/* ---------------------------------------------------------------------
 * Fokusas — matomas, bet firminis. Prieinamumas nėra derybų objektas.
 * ------------------------------------------------------------------ */

:focus { outline: none; }

:focus-visible {
	outline: 2px solid var(--mm-red-bright);
	outline-offset: 3px;
	border-radius: var(--mm-radius-sm);
}

.mm-skip-link {
	position: absolute;
	top: -100px;
	left: var(--mm-4);
	z-index: 10000;
	padding: var(--mm-3) var(--mm-5);
	background: var(--mm-red);
	color: #fff;
	font-size: var(--mm-fs-sm);
	font-weight: 600;
	border-radius: var(--mm-radius);
	transition: top var(--mm-dur) var(--mm-ease);
}

.mm-skip-link:focus-visible { top: var(--mm-4); }

/* ---------------------------------------------------------------------
 * Pagalbinės klasės
 * ------------------------------------------------------------------ */

.mm-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Antraštės viršuje esantis mažas raudonas užrašas. */
.mm-eyebrow {
	display: inline-flex;
	align-items: center;
	gap: var(--mm-3);
	margin-bottom: var(--mm-4);
	font-family: var(--mm-font-body);
	font-size: var(--mm-fs-eyebrow);
	font-weight: 600;
	letter-spacing: var(--mm-ls-eyebrow);
	text-transform: uppercase;
	color: var(--mm-accent);
}

.mm-eyebrow--line::before {
	content: "";
	width: 28px;
	height: 1px;
	background: currentColor;
	opacity: 0.6;
}

/* Raudonas brūkšnys po antrašte (matomas footeryje ir sekcijose). */
.mm-rule {
	width: 32px;
	height: 2px;
	margin: var(--mm-3) 0 var(--mm-5);
	background: var(--mm-red);
}

.mm-lead {
	font-size: var(--mm-fs-lead);
	line-height: 1.65;
	color: var(--mm-text-2);
	max-width: var(--mm-maxw-text);
}

.mm-muted { color: var(--mm-text-3); }
.mm-tint { color: var(--mm-accent); }

.mm-text-center { text-align: center; }

/* Priverstinis eilutės lūžis, veikiantis tik plačiuose ekranuose.
   Siauruose jis tik gadintų natūralų teksto laužymą. */
@media (max-width: 700px) {
	br.mm-br-wide { display: none; }
}

.mm-mono {
	font-family: var(--mm-font-mono);
	font-variant-numeric: tabular-nums;
}

/* Dideli numeriai (01, 02, 03…) prie sekcijų ir kortelių. */
.mm-index {
	font-family: var(--mm-font-display);
	font-weight: 200;
	font-size: clamp(1.5rem, 1rem + 1.6vw, 2.25rem);
	line-height: 1;
	color: var(--mm-accent);
	opacity: 0.9;
	font-variant-numeric: tabular-nums;
}

/* Plonas skyriklis tarp sekcijų. */
.mm-divider {
	height: 1px;
	background: linear-gradient(90deg, transparent, var(--mm-line), transparent);
	border: 0;
	margin: 0;
}
