@font-face {
  font-family: "SPACE Open Sans";
  src: url("fonts/OpenSans-Latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 300 800;
  font-stretch: 100%;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "SPACE Open Sans";
  src: url("fonts/OpenSans-Cyrillic.woff2") format("woff2");
  font-style: normal;
  font-weight: 300 800;
  font-stretch: 100%;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

:root {
  --space-red: #ab1f38;
  --space-red-dark: #9a1906;
  --space-purple: #3b118f;
  --space-rose: #bd717f;
  --space-rose-light: #ccb1b6;
  --space-gray-80: #333333;
  --space-gray-65: #595959;
  --space-gray-30: #b2b2b2;
  --page: #000000;
  --ink: #ffffff;
  --muted: #d8d8d8;
  --gap: 30px;
  --content-max: 1296px;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--page);
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--page);
  font-family: "SPACE Open Sans", sans-serif;
  font-size: 16px;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.microstories {
  width: min(var(--content-max), calc(100% - 60px));
  margin-inline: auto;
}

.microstories {
  padding: 50px 0 80px;
}

.intro {
  width: 100%;
  margin-bottom: 64px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  font-size: clamp(2.25rem, 5vw, 4rem);
  line-height: 1.05;
}

@media (min-width: 651px) {
  h1 {
    white-space: nowrap;
  }
}

.intro > p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.65vw, 1.22rem);
  line-height: 1.55;
}

.intro a {
  color: white;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}

.story-year + .story-year {
  margin-top: 76px;
}

.admin-entry {
  margin: 48px 0 0;
  text-align: right;
}

.admin-entry a {
  color: var(--space-gray-30);
  font-size: 0.8rem;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.admin-entry a:hover,
.admin-entry a:focus-visible {
  color: white;
}

.section-heading {
  width: 100%;
  margin-bottom: 20px;
}

.section-heading h2 {
  width: 100%;
  margin: 0;
  color: var(--space-rose);
  font-size: clamp(1.65rem, 3vw, 2.25rem);
  line-height: 1.15;
}

.story-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
  align-items: start;
}

.story-card {
  position: relative;
  z-index: 0;
  width: 100%;
  aspect-ratio: 1;
  perspective: 1400px;
  transition: z-index 0s linear 180ms;
}

.story-card.is-preview,
.story-card.is-flipped {
  z-index: 10;
  transition-delay: 0s;
}

.story-card-button {
  width: 100%;
  height: 100%;
  display: block;
  margin: 0;
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
  font: inherit;
  text-align: inherit;
  transform: scale(1);
  transition: transform 380ms cubic-bezier(0.18, 0.82, 0.22, 1);
}

.story-card.is-preview .story-card-button,
.story-card.is-flipped .story-card-button {
  transform: scale(1.1);
}

.story-card-button:focus-visible {
  outline: 3px solid white;
  outline-offset: 6px;
}

.story-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  display: block;
}

.story-face {
  position: absolute;
  inset: 0;
  display: flex;
  overflow: hidden;
}

.story-face-front {
  z-index: 1;
  align-items: center;
  justify-content: center;
  opacity: 1;
  visibility: visible;
  transform: scale(1);
  transform-origin: center;
  transition: opacity 360ms ease, transform 460ms cubic-bezier(0.2, 0.76, 0.26, 1), visibility 0s linear 0s;
  background:
    linear-gradient(135deg, rgba(171, 31, 56, 0.22), transparent 42%),
    var(--space-gray-80);
}

.title-layer {
  position: relative;
  z-index: 2;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 13px;
  padding: 12%;
  text-align: center;
  opacity: 1;
  transform: scale(1);
  transition: opacity 420ms ease, transform 560ms ease;
}

.story-author {
  color: var(--space-rose);
  font-size: clamp(0.72rem, 1.15vw, 0.86rem);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.story-title {
  font-size: clamp(1.65rem, 3.4vw, 3.1rem);
  font-weight: 800;
  line-height: 1.04;
}

.image-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  opacity: 0;
  transform: scale(1.06);
  transition: opacity 580ms ease, transform 920ms cubic-bezier(0.2, 0.72, 0.2, 1);
}

.image-layer::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 56%, rgba(0, 0, 0, 0.18));
}

.image-layer img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.story-card.is-preview .title-layer {
  opacity: 0;
  transform: scale(0.94);
}

.story-card.is-preview .image-layer {
  opacity: 1;
  transform: scale(1);
}

.story-face-back {
  z-index: 2;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(20px, 7.5%, 42px);
  color: white;
  background:
    linear-gradient(145deg, rgba(59, 17, 143, 0.34), transparent 52%),
    #171717;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transform: translateX(7%) rotate(1.5deg) scale(0.95);
  transform-origin: center;
  pointer-events: none;
  transition: opacity 360ms ease, transform 460ms cubic-bezier(0.2, 0.76, 0.26, 1), visibility 0s linear 360ms;
}

.story-card.is-flipped .story-face-front {
  opacity: 0;
  visibility: hidden;
  transform: translateX(-7%) rotate(-1.5deg) scale(0.95);
  transition: opacity 360ms ease, transform 460ms cubic-bezier(0.2, 0.76, 0.26, 1), visibility 0s linear 360ms;
}

.story-card.is-flipped .story-face-back {
  opacity: 1;
  visibility: visible;
  transform: translateX(0) rotate(0) scale(1);
  pointer-events: auto;
  transition: opacity 360ms ease, transform 460ms cubic-bezier(0.2, 0.76, 0.26, 1), visibility 0s linear 0s;
}

body.effect-fade .story-face-back {
  transform: scale(0.98);
}

body.effect-fade .story-card.is-flipped .story-face-front {
  transform: scale(0.98);
}

body.effect-fade .story-card.is-flipped .story-face-back {
  transform: scale(1);
}

body.effect-fold .story-face-front {
  transform: scaleX(1) scaleY(1);
  transition: opacity 160ms ease 230ms, transform 230ms cubic-bezier(0.66, 0, 1, 1) 230ms, visibility 0s linear 230ms;
}

body.effect-fold .story-face-back {
  opacity: 0;
  visibility: hidden;
  transform: scaleX(0.035) scaleY(0.98);
  transition: opacity 160ms ease 0s, transform 230ms cubic-bezier(0, 0, 0.34, 1) 0s, visibility 0s linear 230ms;
}

body.effect-fold .story-card.is-flipped .story-face-front {
  opacity: 0;
  visibility: hidden;
  transform: scaleX(0.035) scaleY(0.98);
  transition: opacity 160ms ease 0s, transform 230ms cubic-bezier(0.66, 0, 1, 1) 0s, visibility 0s linear 230ms;
}

body.effect-fold .story-card.is-flipped .story-face-back {
  opacity: 1;
  visibility: visible;
  transform: scaleX(1) scaleY(1);
  transition: opacity 160ms ease 230ms, transform 230ms cubic-bezier(0, 0, 0.34, 1) 230ms, visibility 0s linear 230ms;
}

.story-text {
  display: flex;
  flex-direction: column;
  gap: 0.72em;
  font-size: clamp(0.76rem, 1.15vw, 1rem);
  line-height: 1.43;
  text-align: center;
}

.story-paragraph {
  display: block;
}

.story-back-hint {
  position: absolute;
  right: 16px;
  bottom: 15px;
  width: 17px;
  height: 17px;
  color: #ffffff;
  opacity: 0.88;
}

.story-back-hint svg {
  width: 100%;
  height: 100%;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

html.is-embedded [data-space-header],
html.is-embedded [data-space-footer],
body.is-embedded [data-space-header],
body.is-embedded [data-space-footer] {
  display: none;
}

body.is-embedded .microstories {
  width: 100%;
  padding: 0 0 30px;
}

@media (max-width: 980px) {
  .story-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .story-text {
    font-size: clamp(0.82rem, 1.8vw, 1rem);
  }
}

@media (max-width: 650px) {
  :root {
    --gap: 30px;
  }

  .microstories {
    width: min(100% - 24px, 540px);
  }

  .microstories {
    padding-top: 38px;
  }

  .intro {
    margin-bottom: 48px;
  }

  .story-grid {
    grid-template-columns: minmax(0, 1fr);
    margin-inline: 18px;
  }

  .story-card.is-preview .story-card-button,
  .story-card.is-flipped .story-card-button {
    transform: scale(1.1);
  }

  .story-text {
    font-size: clamp(0.88rem, 3.55vw, 1.02rem);
  }

}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
