/*******************************************************************************
 * Font
 ******************************************************************************/
@font-face {
  font-family: "ARGPixel";
  src: url("/assets/fonts/Minecraft1.1.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

h1 {
  font-size: clamp(1.8rem, 5vw, 3.3rem);
}

h2 {
  font-size: clamp(1.4rem, 1.15rem + 0.9vw, 1.8rem);
}

h3 {
  font-size: clamp(1.2rem, 1.08rem + 0.45vw, 1.45rem);
}

/*******************************************************************************
 * Variables
 ******************************************************************************/
:root {
  --bg-deep: #000207;

  --red: #9e2632;
  --red-dark: #5e141d;
  --red-bright: #c43543;

  --cream: #e4e2b4;
  --cream-dim: #a8a77f;

  --text: #d7d3aa;
  --text-dim: #8f8a6b;

  --black: #050505;
  --button-bg: rgba(0, 0, 0, 0.58);

  --content-width: 85ch;
  --heading-shadow-opacity: 0.65;
  --heading-shadow-blur: 25px;
  --heading-shadow-padding-x: 68px;
  --heading-shadow-padding-y: 18px;

  --heading-shadow-radius: 18px;

  --content-side-space: min(4%, 4em);
}


/*******************************************************************************
 * Base
 ******************************************************************************/
html {
  scrollbar-gutter: stable;
  min-height: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  overflow-x: clip;
  background:
    radial-gradient(
      circle at center,
      rgba(2, 3, 8, 0.90) 5%,
      rgba(2, 3, 8, 0.94) 35%,
      rgba(2, 3, 8, 0.99) 74%,
      #000 100%
    );
  background-attachment: fixed;
  font-family: "ARGPixel", "Courier New", monospace;
  color: var(--text);
}

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

/*******************************************************************************
 * Background
 ******************************************************************************/
html::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;

  background-image: url("/assets/img/background/ribs.webp");
  background-repeat: no-repeat;
  background-position: center top;
  background-size: min(2200px, max(600px, 110%)) auto;
}

/*******************************************************************************
 * Divider
 ******************************************************************************/

.material-divider {
  display: block;
  width: min(160px, 45%);
  height: auto;
  margin: 2.5em auto;
}

/*******************************************************************************
 * Page
 ******************************************************************************/
body {
  position: relative;

  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0;

  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.1rem);
  line-height: 1.4;
  letter-spacing: 0.04em;

  background: transparent;
  color: var(--text);
  text-shadow: 0 0 7px rgba(196, 53, 67, 0.18);
}

/* Текст только для программ чтения с экрана. */
.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;
}


/*******************************************************************************
 * CRT scanlines
 ******************************************************************************/
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;

  background:
    repeating-linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.035) 0,
      rgba(255, 255, 255, 0.035) 1px,
      rgba(0, 0, 0, 0.16) 2px,
      rgba(0, 0, 0, 0.16) 4px
    );
  mix-blend-mode: overlay;
  opacity: 0.5;
}

/*******************************************************************************
 * Screen darkening
 ******************************************************************************/
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;

  background:
    radial-gradient(
      circle at center,
      transparent 47%,
      rgba(0, 0, 0, 0.24) 82%,
      rgba(0, 0, 0, 0.68) 100%
    ),
    linear-gradient(
      to bottom,
      rgba(160, 20, 30, 0.07),
      transparent 18%,
      transparent 82%,
      rgba(160, 20, 30, 0.08)
    );
}

body > * {
  position: relative;
  z-index: 1;
}


/*******************************************************************************
 * Typography
 ******************************************************************************/
h1,
h2,
h3 {
  position: relative;
  isolation: isolate;

  width: fit-content;
  max-width: 100%;
  margin: 0.4em auto;
  padding: 0 min(2ch, 4%);

  color: var(--red-bright);

  text-align: center;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: none;
}

h1 .heading-text {
  background-image: linear-gradient(
    to bottom,
    var(--red-bright) 0%,
    var(--red) 70%,
    var(--red-dark) 100%
  );

  background-clip: text;
  -webkit-background-clip: text;

  color: transparent;
  -webkit-text-fill-color: transparent;
}

h1 .heading-text {
  position: relative;
  z-index: 1;
  display: inline-block;
}

h1::before {
  content: "";

  position: absolute;
  z-index: 0;

  top: calc(-1 * var(--heading-shadow-padding-y));
  right: calc(-1 * var(--heading-shadow-padding-x));
  bottom: calc(-1 * var(--heading-shadow-padding-y));
  left: calc(-1 * var(--heading-shadow-padding-x));

  background: rgba(0, 0, 0, var(--heading-shadow-opacity));
  border-radius: var(--heading-shadow-radius);
  filter: blur(var(--heading-shadow-blur));

  pointer-events: none;
}

/*******************************************************************************
 * Text
 ******************************************************************************/

p {
  margin: 0.8em 4%;
  padding: 0 min(2ch, 4%);
}

.text {
  margin: 0.4em 4%;
}

.old_data {
  color: var(--red-bright);
}

.old_data_y {
  color: var(--cream);
}

.center {
  text-align: center;
}

.justify {
  text-align: justify;
}

/*******************************************************************************
 * Links
 ******************************************************************************/

a {
  color: var(--cream);
  text-decoration: none;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: none;
}

a.back {
  color: var(--red-bright);
}

a.underlined {
  border-bottom: 2px dotted var(--red-bright);
}

a:hover,
a:focus {
  color: var(--black);
  background: var(--cream);
  border-bottom-color: var(--cream);
  outline: none;
  text-shadow: none;
}

ul,
ol {
  padding-left: 1.3em;
}

ol li,
ul li {
  margin-bottom: 0.75em;
}

code {
  padding: 0 0.25em;
  background: rgba(158, 38, 50, 0.12);
  color: var(--cream);
  font-family: "ARGPixel", "Courier New", monospace;
}

.right-link {
  width: fit-content;
  max-width: calc(100% - var(--content-side-space));
  margin-inline: auto var(--content-side-space);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.right-link a {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  min-width: 0;
  max-width: 100%;
}

.right-link p {
  max-width: 100%;
  margin: 0.25em 0;
}


/*******************************************************************************
 * Media
 ******************************************************************************/

img.icon {
  height: 1em;
  width: auto;
  flex: 0 0 auto;
}

.data-image {
  display: block;
  margin: 2em auto;
  max-width: 100%;
  height: auto;
}


/*******************************************************************************
 * Separators
 ******************************************************************************/

hr {
  position: relative;
  border: 0;
  height: 4px;
  max-width: min(100%, var(--content-width));
  background:
    repeating-linear-gradient(
      to right,
      var(--red-dark) 0,
      var(--red-dark) 18px,
      transparent 18px,
      transparent 26px
    );
  opacity: 0.95;
}

.top {
  margin: 2em min(4%, 4em);
}

.bottom {
  margin: 2em var(--content-side-space) 1em;
}


/*******************************************************************************
 * Forms
 ******************************************************************************/

label,
summary {
  display: block;
  margin-bottom: 7px;

  color: var(--red-bright);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  user-select: none;
}

summary {
  cursor: pointer;
}

input,
textarea,
select {
  width: 100%;
  margin-bottom: 17px;
  padding: 13px 14px;

  background-color: rgba(0, 0, 0, 0.72);
  color: var(--cream);
  border: 2px solid var(--red-dark);
  border-radius: 0;

  font-family: "ARGPixel", "Courier New", monospace;
  font-size: 1rem;
  line-height: 1.35;
  letter-spacing: 0.03em;

  outline: none;
  box-shadow:
    inset 0 0 16px rgba(0, 0, 0, 0.75),
    0 0 0 1px rgba(0, 0, 0, 0.8);
}

textarea {
  resize: vertical;
}

select {
  appearance: none;
  -webkit-appearance: none;

  padding-right: 42px;
  cursor: pointer;

  background-image:
    linear-gradient(
      45deg,
      transparent 50%,
      var(--red-bright) 50%
    ),
    linear-gradient(
      135deg,
      var(--red-bright) 50%,
      transparent 50%
    );

  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 12px) 50%;

  background-size:
    6px 6px,
    6px 6px;

  background-repeat: no-repeat;
}

select option {
  background: var(--bg-deep);
  color: var(--cream);
}

.feedback-category-select option[value="category_3"] {
  color: var(--red-bright);
}

.feedback-category-select--old-data {
  color: var(--red-bright);
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--red-bright);
  box-shadow:
    inset 0 0 18px rgba(0, 0, 0, 0.85),
    0 0 14px rgba(196, 53, 67, 0.32);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-dim);
}

/* Общая форма проверки пароля на страницах ENTRY. */
.entry-password-form {
  margin: 1.5em var(--content-side-space);
}

.entry-password-form > p {
  margin-inline: 0;
}


/*******************************************************************************
 * Feedback form
 ******************************************************************************/

.feedback-form__field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 1em;
  align-items: start;
}

.feedback-form__field > label,
.feedback-form__field > input,
.feedback-form__field > textarea,
.feedback-form__field > select {
  grid-column: 1 / -1;
}

.feedback-form__field > input,
.feedback-form__field > textarea,
.feedback-form__field > select {
  margin-bottom: 5px;
}

.feedback-form__required-note {
  margin-top: 0;
  color: var(--cream-dim);
  font-size: 0.9em;
}

.feedback-form__required {
  color: var(--cream);
}

.feedback-form__note,
.feedback-form__counter {
  margin: 0;
  color: var(--cream-dim);
  font-size: 0.9em;
  line-height: 1.25;
}

.feedback-form__note {
  grid-column: 1;
}

.feedback-form__counter {
  grid-column: 2;
  justify-self: end;
  white-space: nowrap;
}

/*******************************************************************************
 * Feedback messages
 ******************************************************************************/

.feedback-page__message {
  display: block;

  margin: 1.5em 4%;
  padding: 1.4em;

  background: rgba(0, 0, 0, 0.72);
  border: 3px solid var(--red-bright);

  color: var(--cream);
  text-align: center;

  box-shadow:
    inset 0 0 22px rgba(0, 0, 0, 0.82),
    0 0 18px rgba(168, 167, 127, 0.18);
}

.feedback-page__message > p {
  margin: 0;
  padding: 0;

  color: inherit;
  text-align: center;
}

.feedback-page__message > p + p {
  margin-top: 0.7em;
}

.feedback-page__message--error {
  background: rgba(30, 0, 6, 0.72);
  color: var(--red-bright);

  box-shadow:
    inset 0 0 22px rgba(0, 0, 0, 0.82),
    0 0 18px rgba(196, 53, 67, 0.28);
}

.feedback-page__message-close {
  display: block;
  margin: 1.1em auto 0;
}

.feedback-page__message[hidden] {
  display: none;
}

/*******************************************************************************
 * Buttons
 ******************************************************************************/

button {
  display: inline-block;
  box-sizing: border-box;
  max-width: 100%;
  margin: 6px 6px 6px 0;
  padding: 12px 16px;

  background: var(--button-bg);
  color: var(--red-bright);
  border: 2px solid var(--red-dark);
  border-radius: 0;

  font-family: "ARGPixel", "Courier New", monospace;
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  text-align: center;
  overflow-wrap: anywhere;

  cursor: pointer;
  text-shadow: 0 0 8px rgba(196, 53, 67, 0.35);
  box-shadow:
    inset 0 0 0 2px rgba(0, 0, 0, 0.65),
    0 0 12px rgba(94, 20, 29, 0.18);
}

button:hover,
button:focus {
  background: var(--cream);
  color: var(--black);
  border-color: var(--cream);
  outline: none;
  text-shadow: none;
  box-shadow:
    0 0 8px rgba(228, 226, 180, 0.24),
    inset 0 0 0 2px rgba(0, 0, 0, 0.65);
}

button:active {
  transform: translateY(1px);
}

a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--red-bright);
  outline-offset: 3px;
}

[aria-disabled="true"] {
  pointer-events: none;
  cursor: not-allowed;
  user-select: none;
  opacity: 0.42;
}


/*******************************************************************************
 * Error messages
 ******************************************************************************/

.red-border {
  margin: 1.5em 0;
  padding: 2em;
  border: 4px solid var(--red-bright);
  background: rgba(30, 0, 6, 0.52);
  box-shadow:
    inset 0 0 22px rgba(0, 0, 0, 0.78),
    0 0 18px rgba(196, 53, 67, 0.22);
}

.error,
.error p {
  text-align: center;
}

.error {
  color: var(--red-bright);
}

/*******************************************************************************
 * Blinking cursors
 ******************************************************************************/

.cursor,
.cursor1 {
  display: inline-block;
  margin-left: 0.15em;
  text-shadow: 0 0 8px rgba(228, 226, 180, 0.45);
  animation: cursor-blink 0.85s steps(1, end) infinite;
}

.cursor {
  color: var(--cream);
}

.cursor1 {
  color: var(--red-bright);
}


@keyframes cursor-blink {
  0%, 49% {
    opacity: 1;
  }

  50%, 100% {
    opacity: 0;
  }
}

/*******************************************************************************
 * Corrupted-file effect
 ******************************************************************************/

.cursed-file {
  position: relative;
  display: inline-block;
  max-width: 100%;
  color: var(--text);
  overflow-wrap: anywhere;
}

.cursed-file::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;

  color: transparent;

  background:
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 1.2em,
      var(--red-bright) 1.45em,
      var(--cream) 1.6em,
      var(--red-bright) 1.75em,
      transparent 2.05em,
      transparent 3.2em
    );

  background-size: 1.5em 100%;
  background-position: 0 50%;

  -webkit-background-clip: text;
  background-clip: text;

  animation: cursed-file-stripes 0.2s linear infinite;

  text-shadow:
    0 0 7px rgba(196, 53, 67, 0.32),
    0 0 14px rgba(94, 20, 29, 0.24);
}

@keyframes cursed-file-stripes {
  from {
    background-position: 0 50%;
  }

  to {
    background-position: -1.5em 50%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cursor,
  .cursor1 {
    animation: none;
  }

  .cursed-file::after {
    animation: none;

    background:
      linear-gradient(
        90deg,
        transparent 0%,
        transparent 18%,
        var(--red-bright) 38%,
        var(--red-bright) 62%,
        transparent 82%,
        transparent 100%
      );

    background-size: 4em 100%;
    background-position: 50% 50%;
    background-repeat: repeat;

    -webkit-background-clip: text;
    background-clip: text;

    text-shadow: none;
    filter: none;
  }
}

/*******************************************************************************
 * Icons on inverted links
 ******************************************************************************/

a:hover img.icon,
a:focus img.icon {
  filter: brightness(0);
}
