:root {
  --bg: #080808;
  --bg-soft: #101010;
  --ink: #f2f2f2;
  --muted: #9a9a9a;
  --paper: #e8e8e8;
  --line: rgba(255, 255, 255, 0.22);
  --line-soft: rgba(255, 255, 255, 0.12);
  --card-paper: #c0c0c0;
  --card-ink: #15130f;
  --card-muted: rgba(21, 19, 15, 0.72);
  --mono: "Courier New", Courier, monospace;
  --type-color: #bfbfbf;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body.landing {
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-family: var(--mono);
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.06), transparent 34rem),
    linear-gradient(180deg, #121212 0%, #050505 100%);
}

.landing-noise,
.landing-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.landing-noise {
  opacity: 0.12;
  mix-blend-mode: screen;
  background-image:
    linear-gradient(0deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 39px 39px, 43px 43px;
}

.landing-vignette {
  box-shadow: inset 0 0 12rem rgba(0, 0, 0, 0.92);
}

.landing-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  width: min(1200px, 100%);
  margin: 0 auto;
}

.landing-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--ink);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.landing-brand__mark {
  width: 2.8rem;
  height: 2.8rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--paper);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.72rem;
}

.landing-brand strong,
.landing-brand small {
  display: block;
}

.landing-brand strong {
  font-size: 0.78rem;
  font-weight: 700;
}

.landing-brand small {
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.68rem;
}

.landing-skip {
  color: var(--paper);
  text-decoration: none;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  padding: 0.55rem 0.85rem;
  background: rgba(0, 0, 0, 0.45);
  transition: border-color 0.25s ease, color 0.25s ease;
}

.landing-skip:hover,
.landing-skip:focus-visible {
  border-color: #fff;
  color: #fff;
  outline: none;
}

.landing-stage {
  position: fixed;
  inset: 0;
  z-index: 2;
  perspective: 1400px;
  overflow: hidden;
}

.landing-carousel {
  position: absolute;
  left: 50%;
  top: 52%;
  width: 0;
  height: 0;
  transform-style: preserve-3d;
  will-change: transform;
}

.ficha-card {
  --type-color: #bfbfbf;
  position: absolute;
  left: 0;
  top: 0;
  width: min(190px, 28vw);
  aspect-ratio: 512 / 704;
  padding: 0.7rem 0.65rem 0.6rem;
  color: var(--card-ink);
  background: var(--card-paper);
  border: 3px solid rgba(21, 19, 15, 0.35);
  box-shadow: 0 1.4rem 2.8rem rgba(0, 0, 0, 0.55);
  transform: translate(-50%, -50%) rotateY(var(--ry)) translateZ(var(--radius)) rotateY(calc(var(--ry) * -1)) rotateZ(var(--tilt));
  transform-style: preserve-3d;
  backface-visibility: hidden;
  opacity: 0.92;
  overflow: hidden;
  font-family: var(--mono);
}

.ficha-card::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1.5px solid var(--type-color);
  pointer-events: none;
}

.ficha-card__accent {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 8px;
  height: 4px;
  background: var(--type-color);
}

.ficha-card__code {
  display: block;
  position: relative;
  z-index: 1;
  margin: 0.55rem 0.2rem 0.55rem;
  font-size: 0.52rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--card-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ficha-card__title {
  display: block;
  position: relative;
  z-index: 1;
  margin: 0 0.15rem 0.55rem;
  font-size: clamp(0.72rem, 1.55vw, 0.92rem);
  font-weight: 700;
  line-height: 1.15;
  text-transform: uppercase;
  color: var(--card-ink);
}

.ficha-card__ref,
.ficha-card__territory,
.ficha-card__obs,
.ficha-card__footer {
  position: relative;
  z-index: 1;
  display: block;
  margin: 0 0.15rem;
  color: var(--card-ink);
}

.ficha-card__ref {
  font-size: 0.55rem;
  margin-bottom: 0.2rem;
}

.ficha-card__territory {
  font-size: 0.52rem;
  line-height: 1.25;
  margin-bottom: 0.55rem;
  color: var(--card-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ficha-card__obs {
  font-size: 0.5rem;
  line-height: 1.3;
  color: var(--card-muted);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ficha-card__footer {
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 0.7rem;
  font-size: 0.48rem;
  color: var(--card-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.landing-story {
  position: fixed;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  padding: 5.5rem 1.25rem 6rem;
  pointer-events: none;
}

.landing-story::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(42rem, 92vw);
  height: min(22rem, 58vh);
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.78) 0%, rgba(0, 0, 0, 0.4) 55%, transparent 75%);
  pointer-events: none;
}

.story-chapter {
  grid-area: 1 / 1;
  width: min(34rem, 100%);
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(1.1rem) scale(0.985);
  filter: blur(4px);
  transition:
    opacity 0.55s ease,
    transform 0.55s ease,
    filter 0.55s ease,
    visibility 0s linear 0.55s;
}

.story-chapter.is-active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  filter: blur(0);
  pointer-events: auto;
  transition:
    opacity 0.55s ease,
    transform 0.55s ease,
    filter 0.55s ease,
    visibility 0s linear 0s;
}

.story-kicker {
  margin: 0 0 0.85rem;
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.story-chapter h1,
.story-chapter h2 {
  margin: 0 0 1rem;
  font-family: var(--mono);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-shadow: 0 0.4rem 2rem rgba(0, 0, 0, 0.75);
}

.story-chapter h1 {
  font-size: clamp(2.4rem, 8vw, 4.4rem);
}

.story-chapter h2 {
  font-size: clamp(1.35rem, 4.2vw, 2.1rem);
}

.story-lead,
.story-chapter p:not(.story-kicker) {
  margin: 0 auto;
  max-width: 34rem;
  color: #d0d0d0;
  font-size: clamp(0.86rem, 1.9vw, 0.98rem);
  line-height: 1.55;
  text-shadow: 0 0.25rem 1.4rem rgba(0, 0, 0, 0.8);
}

.story-cta {
  display: inline-flex;
  margin-top: 1.5rem;
  padding: 0.85rem 1.25rem;
  color: #111;
  background: var(--paper);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.74rem;
  font-weight: 700;
  border: 1px solid transparent;
  box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.45);
  transition: transform 0.2s ease, background 0.2s ease;
  pointer-events: auto;
}

.story-cta:hover,
.story-cta:focus-visible {
  background: #fff;
  transform: translateY(-2px);
  outline: none;
}

.landing-progress {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
}

.landing-progress__bar {
  height: 100%;
  width: 0%;
  background: #cfcfcf;
  transform-origin: left center;
}

.landing-hint {
  position: fixed;
  left: 50%;
  bottom: 1.4rem;
  z-index: 5;
  transform: translateX(-50%);
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: opacity 0.4s ease;
}

.landing-hint small {
  display: block;
  margin-top: 0.25rem;
  letter-spacing: 0.08em;
  text-transform: none;
  opacity: 0.75;
}

.landing-hint.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.landing-noscript {
  position: relative;
  z-index: 6;
  max-width: 32rem;
  margin: 6rem auto;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid var(--line);
}

.page-transition {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0s linear 0.35s;
}

.page-transition.is-active,
html.is-entering-landing .page-transition,
body.is-exiting .page-transition {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.35s ease, visibility 0s linear 0s;
}

.page-transition__veil {
  position: absolute;
  inset: 0;
  background: #050505;
  transform: scaleY(0.02);
  transform-origin: center;
  transition: transform 0.7s cubic-bezier(0.7, 0, 0.2, 1);
}

.page-transition.is-active .page-transition__veil,
html.is-entering-landing .page-transition__veil,
body.is-exiting .page-transition__veil {
  transform: scaleY(1);
}

.page-transition__label {
  position: relative;
  z-index: 1;
  margin: 0;
  color: #cfcfcf;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.35s ease 0.2s, transform 0.35s ease 0.2s;
}

.page-transition.is-active .page-transition__label,
html.is-entering-landing .page-transition__label,
body.is-exiting .page-transition__label {
  opacity: 1;
  transform: translateY(0);
}

body.is-exiting {
  pointer-events: none;
}

body.is-exiting .landing-header,
body.is-exiting .landing-story,
body.is-exiting .landing-hint,
body.is-exiting .landing-progress {
  opacity: 0;
  transition: opacity 0.35s ease;
}

body.is-exiting .landing-carousel {
  transition: transform 0.85s cubic-bezier(0.55, 0, 0.2, 1), filter 0.85s ease;
  filter: blur(2px) brightness(0.7);
}

body.is-exiting .ficha-card {
  transition: opacity 0.7s ease, filter 0.7s ease;
  opacity: 0.35;
}

html.is-entering-landing body.landing > :not(.page-transition) {
  opacity: 0;
}

html.is-entering-landing.is-landing-ready body.landing > :not(.page-transition) {
  opacity: 1;
  transition: opacity 0.7s ease;
}

html.is-entering-landing.is-landing-ready .page-transition {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.55s ease, visibility 0s linear 0.55s;
}

html.is-entering-landing.is-landing-ready .page-transition__veil {
  transform: scaleY(0.02);
}

body.is-reduced .landing-carousel {
  animation: none;
}

body.is-reduced .story-chapter {
  position: relative;
  grid-area: auto;
  opacity: 1;
  visibility: visible;
  transform: none;
  filter: none;
  margin: 0 auto 2.5rem;
  pointer-events: auto;
}

body.is-reduced {
  overflow: auto;
}

body.is-reduced .landing-story {
  position: relative;
  display: block;
  padding: 6rem 1.25rem 4rem;
}

body.is-reduced .landing-stage {
  position: absolute;
  opacity: 0.35;
}

body.is-reduced .landing-hint,
body.is-reduced .landing-progress {
  display: none;
}

@media (max-width: 720px) {
  .ficha-card {
    width: min(140px, 38vw);
  }

  .landing-header {
    padding-inline: 0.9rem;
  }

  .landing-skip {
    font-size: 0.62rem;
    padding: 0.45rem 0.65rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .story-chapter {
    transition: none;
  }
}
