:root {
  color-scheme: dark;
  --fate-ink: #f7efe1;
  --fate-muted: #b8beca;
  --fate-gold: #d1b374;
  --fate-panel: rgba(4, 7, 14, 0.9);
  --fate-line: rgba(180, 194, 220, 0.16);
  --fate-green: #41d88f;
  --fate-blue: #45a8ff;
  --fate-violet: #c061ff;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #060812;
}

body.fate-nexus-page {
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  color: var(--fate-ink);
  background:
    radial-gradient(circle at 20% 34%, rgba(20, 146, 186, 0.22), transparent 18rem),
    radial-gradient(circle at 78% 26%, rgba(159, 58, 198, 0.2), transparent 17rem),
    radial-gradient(circle at 50% 78%, rgba(200, 130, 74, 0.08), transparent 20rem),
    radial-gradient(circle at 22% 20%, rgba(255, 255, 255, 0.22) 0 1px, transparent 1px),
    radial-gradient(circle at 72% 34%, rgba(255, 255, 255, 0.18) 0 1px, transparent 1px),
    radial-gradient(circle at 42% 62%, rgba(255, 255, 255, 0.14) 0 1px, transparent 1px),
    linear-gradient(180deg, #090b16 0%, #03050b 100%),
    #05070d;
  background-size: auto, auto, auto, 160px 160px, 210px 210px, 260px 260px, auto;
  font-family: "Times New Roman", Georgia, serif;
}

body.fate-nexus-page::before,
body.fate-nexus-page::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body.fate-nexus-page::before {
  background:
    radial-gradient(circle at 23% 28%, rgba(31, 173, 214, 0.23), transparent 20rem),
    radial-gradient(circle at 78% 21%, rgba(160, 62, 214, 0.19), transparent 18rem),
    radial-gradient(circle at 48% 16%, rgba(213, 190, 129, 0.08), transparent 12rem);
  mix-blend-mode: screen;
}

body.fate-nexus-page::after {
  background:
    linear-gradient(90deg, rgba(2, 4, 9, 0.72), transparent 24%, transparent 74%, rgba(2, 4, 9, 0.72)),
    linear-gradient(180deg, rgba(2, 4, 9, 0.3), rgba(2, 4, 9, 0.78));
}

.fate-hub {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 18px;
}

.fate-stage {
  position: relative;
  width: min(100%, 1180px);
  min-height: 704px;
  display: grid;
  align-content: center;
  gap: 20px;
  overflow: hidden;
  padding: 30px 34px 26px;
  border: 1px solid rgba(197, 207, 231, 0.12);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(5, 8, 17, 0.7), rgba(3, 6, 12, 0.96)),
    rgba(4, 7, 14, 0.9);
  box-shadow:
    0 32px 90px rgba(0, 0, 0, 0.54),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.fate-stage::before,
.fate-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.fate-stage::before {
  background:
    radial-gradient(circle at 20% 37%, rgba(32, 188, 220, 0.18), transparent 17rem),
    radial-gradient(circle at 79% 34%, rgba(186, 79, 255, 0.16), transparent 16rem),
    radial-gradient(circle at 51% 20%, rgba(255, 255, 255, 0.26) 0 1px, transparent 1px),
    radial-gradient(circle at 26% 18%, rgba(255, 255, 255, 0.18) 0 1px, transparent 1px),
    radial-gradient(circle at 77% 62%, rgba(255, 255, 255, 0.16) 0 1px, transparent 1px),
    linear-gradient(180deg, rgba(5, 9, 18, 0.08), rgba(5, 9, 18, 0.76));
  background-size: auto, auto, 180px 180px, 240px 240px, 300px 300px, auto;
  opacity: 0.92;
}

.fate-stage::after {
  background:
    radial-gradient(circle at 20% 52%, rgba(34, 180, 210, 0.14), transparent 16rem),
    radial-gradient(circle at 78% 44%, rgba(186, 79, 255, 0.14), transparent 15rem),
    linear-gradient(180deg, rgba(3, 6, 12, 0.08), rgba(3, 6, 12, 0.82));
}

.fate-stage > * {
  position: relative;
  z-index: 1;
}

.fate-top-actions {
  position: absolute;
  top: 24px;
  right: 28px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
}

.fate-language-selector {
  position: relative;
  color: rgba(238, 242, 250, 0.92);
  font: 700 0.74rem/1 "Trebuchet MS", Verdana, sans-serif;
}

.fate-language-selector summary {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid rgba(224, 231, 245, 0.14);
  border-radius: 999px;
  background: rgba(5, 8, 17, 0.68);
  cursor: pointer;
  list-style: none;
  text-transform: uppercase;
}

.fate-language-selector summary::-webkit-details-marker {
  display: none;
}

.fate-language-selector summary:focus-visible,
.fate-language-menu a:focus-visible {
  outline: 2px solid rgba(209, 179, 116, 0.9);
  outline-offset: 2px;
}

.fate-language-flag {
  display: inline-flex;
  width: 20px;
  height: 14px;
  flex: 0 0 20px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  line-height: 0;
}

.fate-language-flag svg {
  display: block;
  width: 100%;
  height: 100%;
}

.fate-language-chevron {
  color: var(--fate-gold);
  font-size: 0.9rem;
  transition: transform 160ms ease;
}

.fate-language-selector[open] .fate-language-chevron {
  transform: rotate(180deg);
}

.fate-language-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 210px;
  display: grid;
  gap: 4px;
  padding: 7px;
  border: 1px solid rgba(209, 179, 116, 0.24);
  border-radius: 10px;
  background: rgba(5, 8, 16, 0.97);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(16px);
}

.fate-language-menu a {
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-radius: 7px;
  color: rgba(238, 242, 250, 0.82);
  text-decoration: none;
  text-transform: none;
}

.fate-language-menu a:hover,
.fate-language-menu a.is-active {
  color: #fff8e8;
  background: rgba(209, 179, 116, 0.12);
}

.fate-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;
}

.fate-hero-copy {
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
}

.fate-brand-logo {
  display: block;
  max-width: 100%;
  filter:
    drop-shadow(0 0 20px rgba(209, 179, 116, 0.26))
    drop-shadow(0 18px 28px rgba(0, 0, 0, 0.5));
}

.fate-brand-logo > img {
  display: block;
  width: 100%;
  height: auto;
}

.fate-brand-logo--hero {
  width: min(88vw, 760px);
}

.fate-brand-logo--gate {
  width: min(38vw, 152px);
}

.fate-hero-copy h1 {
  margin: 0;
  color: #f7ead1;
  font-size: 3.25rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.22),
    0 8px 28px rgba(0, 0, 0, 0.52);
}

.fate-tagline {
  margin: 0;
  color: var(--fate-gold);
  font: 700 0.88rem/1.2 "Trebuchet MS", Verdana, sans-serif;
  letter-spacing: 0;
  text-transform: uppercase;
}

.fate-intro {
  width: min(100%, 460px);
  margin: 4px 0 8px;
  color: rgba(228, 232, 241, 0.82);
  font: 400 0.95rem/1.42 "Trebuchet MS", Verdana, sans-serif;
}

.fate-projects {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  width: min(100%, 860px);
  margin: 0 auto;
}

.fate-project-card {
  --card-line: rgba(255, 255, 255, 0.18);
  --card-core: rgba(255, 255, 255, 0.12);
  position: relative;
  min-height: 344px;
  display: grid;
  grid-template-rows: auto 122px auto 1fr auto;
  gap: 10px;
  overflow: hidden;
  padding: 14px 18px 16px;
  border: 1px solid var(--card-line);
  border-radius: 8px;
  color: #eff5ff;
  background:
    linear-gradient(180deg, rgba(8, 12, 22, 0.76), rgba(3, 7, 14, 0.92)),
    rgba(7, 11, 20, 0.84);
  box-shadow:
    0 20px 34px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  font-family: "Trebuchet MS", Verdana, sans-serif;
  text-align: center;
  text-decoration: none;
  transform: translateZ(0);
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.fate-project-card::before,
.fate-project-card::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.fate-project-card::before {
  inset: 0;
  background:
    radial-gradient(circle at 50% 18%, var(--card-core), transparent 9rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 32%, rgba(0, 0, 0, 0.26));
}

.fate-project-card::after {
  inset: 1px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 7px;
}

.fate-project-card > * {
  position: relative;
  z-index: 1;
}

.fate-project-card:hover,
.fate-project-card:focus-visible {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--card-line) 70%, #ffffff);
  box-shadow:
    0 26px 42px rgba(0, 0, 0, 0.4),
    0 0 30px color-mix(in srgb, var(--card-core) 56%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  outline: none;
}

.fate-project-card--real {
  --card-line: rgba(65, 216, 143, 0.38);
  --card-core: rgba(65, 216, 143, 0.24);
}

.fate-project-card--fantasy {
  --card-line: rgba(69, 168, 255, 0.34);
  --card-core: rgba(69, 168, 255, 0.22);
  grid-template-rows: auto 138px 1fr auto;
}

.fate-project-card--original {
  --card-line: rgba(192, 97, 255, 0.38);
  --card-core: rgba(192, 97, 255, 0.24);
}

.fate-project-pill {
  justify-self: center;
  min-width: 154px;
  padding: 7px 12px 6px;
  border-radius: 999px;
  color: #dff8ef;
  background: color-mix(in srgb, var(--card-core) 60%, rgba(4, 7, 13, 0.78));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--card-line) 50%, transparent);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

.fate-project-visual {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 122px;
  overflow: hidden;
}

.fate-project-visual--real img {
  width: 152px;
  max-height: 106px;
  max-width: 92%;
  object-fit: contain;
  filter:
    drop-shadow(0 16px 14px rgba(0, 0, 0, 0.42))
    drop-shadow(0 0 20px rgba(65, 216, 143, 0.18));
  transform: translateY(4px);
}

.fate-project-visual--fantasy {
  isolation: isolate;
}

.fate-fantasy-lockup {
  position: relative;
  z-index: 1;
  width: min(100%, 270px);
  height: 138px;
  object-fit: contain;
  filter:
    drop-shadow(0 12px 12px rgba(0, 0, 0, 0.48))
    drop-shadow(0 0 18px rgba(69, 168, 255, 0.3));
  transform: translateY(2px);
}

.fate-project-visual--original {
  overflow: hidden;
  border-radius: 7px;
  background:
    linear-gradient(180deg, rgba(49, 30, 72, 0.44), rgba(7, 9, 19, 0.16)),
    radial-gradient(circle at 50% 52%, rgba(107, 194, 255, 0.12), transparent 58%),
    url("/static/assets/hero_visual.png") center / contain no-repeat;
  background-color: rgba(7, 10, 18, 0.9);
}

.fate-project-card strong {
  align-self: end;
  color: color-mix(in srgb, var(--card-line) 74%, #ffffff);
  font-size: 1.14rem;
  font-weight: 900;
  line-height: 1.05;
  text-transform: uppercase;
}

.fate-project-copy {
  align-self: start;
  color: rgba(231, 237, 248, 0.82);
  font-size: 0.84rem;
  line-height: 1.38;
}

.fate-project-action {
  justify-self: center;
  min-width: 138px;
  padding: 9px 16px 8px;
  border: 1px solid color-mix(in srgb, var(--card-line) 42%, transparent);
  border-radius: 999px;
  color: color-mix(in srgb, var(--card-line) 80%, #ffffff);
  background: rgba(5, 8, 15, 0.54);
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

.fate-project-action--quiet {
  color: rgba(231, 237, 248, 0.74);
}

.fate-footer {
  display: grid;
  justify-items: center;
  gap: 10px;
  color: rgba(208, 216, 231, 0.7);
  font: 400 0.78rem/1.2 "Trebuchet MS", Verdana, sans-serif;
}

.fate-footer strong {
  color: var(--fate-gold);
}

.fate-footer nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

.fate-footer a {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  color: rgba(220, 228, 242, 0.74);
  text-decoration: none;
}

.fate-footer svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

body.is-language-gate {
  overflow: hidden;
}

.fate-language-gate {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 22px;
}

.fate-language-gate-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 4, 10, 0.8);
  backdrop-filter: blur(16px);
}

.fate-language-gate article {
  position: relative;
  width: min(100%, 520px);
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 30px;
  border: 1px solid rgba(209, 179, 116, 0.3);
  border-radius: 18px;
  color: #f7efe1;
  background:
    radial-gradient(circle at 50% 0%, rgba(209, 179, 116, 0.12), transparent 14rem),
    rgba(5, 8, 16, 0.97);
  box-shadow: 0 40px 110px rgba(0, 0, 0, 0.66);
  font-family: "Trebuchet MS", Verdana, sans-serif;
  text-align: center;
}

.fate-language-gate h2,
.fate-language-gate p {
  margin: 0;
}

.fate-language-gate h2 {
  font-size: clamp(1.35rem, 4vw, 1.85rem);
}

.fate-language-gate p {
  max-width: 420px;
  color: rgba(231, 237, 248, 0.78);
  font-size: 0.92rem;
  line-height: 1.5;
}

.fate-language-gate-options {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 8px;
}

.fate-language-gate-options a {
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 18px 12px;
  border: 1px solid rgba(209, 179, 116, 0.22);
  border-radius: 12px;
  color: #f7efe1;
  background: rgba(255, 255, 255, 0.035);
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.fate-language-gate-options a:hover,
.fate-language-gate-options a:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(209, 179, 116, 0.66);
  background: rgba(209, 179, 116, 0.1);
  outline: none;
}

.fate-language-gate-options strong {
  font-size: 0.96rem;
}

.fate-language-gate-options small {
  color: rgba(231, 237, 248, 0.64);
  font-size: 0.72rem;
}

@media (max-width: 920px) {
  .fate-stage {
    min-height: calc(100svh - 28px);
    align-content: start;
    gap: 14px;
    padding: 28px 16px 18px;
  }

  .fate-top-actions {
    top: 14px;
    right: 14px;
  }

  .fate-brand-sigil {
    width: 56px;
    height: 56px;
  }

  .fate-brand-sigil::before {
    width: 14px;
    height: 54px;
  }

  .fate-brand-sigil::after {
    width: 54px;
    height: 14px;
  }

  .fate-brand-sigil span {
    width: 32px;
    height: 32px;
  }

  .fate-brand-sigil span::before,
  .fate-brand-sigil span::after {
    width: 9px;
    height: 40px;
  }

  .fate-hero-copy h1 {
    font-size: 2.05rem;
  }

  .fate-tagline {
    font-size: 0.74rem;
  }

  .fate-intro {
    width: min(100%, 300px);
    margin-bottom: 2px;
    font-size: 0.78rem;
  }

  .fate-projects {
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    gap: 14px;
    padding: 0 18px 8px;
  }

  .fate-project-card {
    width: min(100%, 360px);
    min-height: 332px;
  }

  .fate-project-card:hover,
  .fate-project-card:focus-visible {
    transform: none;
    border-color: color-mix(in srgb, var(--card-line) 70%, #ffffff);
    box-shadow:
      0 20px 34px rgba(0, 0, 0, 0.34),
      0 0 30px color-mix(in srgb, var(--card-core) 56%, transparent),
      inset 0 1px 0 rgba(255, 255, 255, 0.08);
    outline: none;
  }

  .fate-footer {
    gap: 8px;
    font-size: 0.72rem;
  }
}

@media (max-width: 520px) {
  body.fate-nexus-page {
    overflow-y: auto;
  }

  .fate-hub {
    padding: 8px;
  }

  .fate-stage {
    min-height: calc(100svh - 16px);
    padding: 14px 0 12px;
    border-radius: 18px;
  }

  .fate-projects {
    padding-inline: 14px;
  }

  .fate-project-card {
    min-height: 326px;
    grid-template-rows: auto 114px auto 1fr auto;
    padding-inline: 15px;
  }

  .fate-project-card--fantasy {
    grid-template-rows: auto 126px 1fr auto;
  }

  .fate-project-visual--real img {
    width: 138px;
    max-height: 94px;
  }

  .fate-project-copy {
    font-size: 0.78rem;
  }

  .fate-language-selector summary {
    min-height: 32px;
    padding-inline: 9px;
  }

  .fate-language-menu {
    width: min(210px, calc(100vw - 28px));
  }

  .fate-language-gate {
    padding: 14px;
  }

  .fate-language-gate article {
    padding: 24px 18px;
  }

  .fate-language-gate-options {
    grid-template-columns: 1fr;
  }
}
