@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/inter-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/inter-italic-latin.woff2") format("woff2");
}

@font-face {
  font-family: "New Rocker";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/new-rocker-latin.woff2") format("woff2");
}

:root {
  --neutral-primary-soft: #0e1520;
  --neutral-primary: #0a0e18;
  --neutral-primary-medium: #141e30;
  --neutral-secondary-medium: #141e30;
  --neutral-tertiary: #141e30;
  --border-default: #0e1a2e;
  --border-default-medium: #1a3060;
  --border-accent: #3f70ac;
  --brand: #024fcb;
  --brand-soft: #0c1e3e;
  --brand-strong: #023fa2;
  --fg-brand: #3a88e8;
  --heading: #f8b700;
  --body: #94a3b8;
  --body-subtle: #64748b;
  --white: #fff;
  --dark: #060a10;
  --focus: #93c5fd;
  --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 25%);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 45%), 0 2px 4px -2px rgb(0 0 0 / 35%), 0 0 15px rgb(2 79 203 / 8%);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 50%), 0 4px 6px -4px rgb(0 0 0 / 40%), 0 0 25px rgb(2 79 203 / 12%);
  --max: 72rem;
  --read: 46rem;
  --spring-snappy: linear(0, 0.009, 0.035 2.1%, 0.141 4.4%, 0.723 12.9%, 0.938 16.7%, 1.017 19.4%, 1.067 22.5%, 1.089 26%, 1.079 30.3%, 1.049 36%, 1.024 42.6%, 1.011 50.3%, 1.004 59.2%, 1.001 69.3%, 1);
  --ease-snap: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --neutral-primary-soft: #080c14;
    --neutral-primary: #060a10;
    --neutral-primary-medium: #0e1520;
    --neutral-secondary-medium: #0e1a2e;
    --neutral-tertiary: #0e1a2e;
    --border-default: #3f70ac;
    --border-default-medium: #5f8fc9;
    --border-accent: #3f70ac;
    --brand: #0758c9;
    --brand-soft: #10264d;
    --brand-strong: #063f9d;
    --fg-brand: #70adf4;
    --heading: #ffd24a;
    --body: #c2ccdc;
    --body-subtle: #93a4bd;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: linear-gradient(180deg, var(--dark) 0%, var(--neutral-primary-soft) 50%, var(--dark) 100%);
  color: var(--body);
  font-family: "Inter", sans-serif;
  font-size: 16px;
  line-height: 1.7;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--fg-brand);
  text-decoration-thickness: 0.09em;
  text-underline-offset: 0.16em;
}

a:hover {
  text-decoration: none;
}

a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  color: var(--heading);
  font-family: "New Rocker", serif;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h1 {
  margin-bottom: 24px;
  font-size: 36px;
}

h2 {
  font-size: 32px;
}

p {
  margin: 0 0 16px;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 8px;
  left: 8px;
  padding: 12px 16px;
  border: 2px solid var(--white);
  border-radius: 2px;
  background: var(--brand);
  color: var(--white);
  font-family: "Inter", sans-serif;
  font-weight: 700;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: none;
}

.site-frame {
  width: min(100%, 96rem);
  min-height: 100vh;
  margin: auto;
  background: transparent;
}

.mast {
  padding: 24px;
  border-bottom: 2px solid var(--border-default);
  background: var(--neutral-primary-soft);
  box-shadow: var(--shadow-lg);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  color: var(--heading);
  text-decoration: none;
}

.wordmark img {
  width: 128px;
  max-height: 72px;
  object-fit: contain;
  object-position: left;
}

.wordmark span {
  font-family: "New Rocker", serif;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.mast nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 24px;
}

.mast nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  border-radius: 2px;
  color: var(--white);
  font-family: "New Rocker", serif;
  font-size: 14px;
  letter-spacing: 0.1em;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 150ms, background-color 150ms;
}

.mast nav a:hover {
  color: var(--heading);
}

.mast-note {
  margin: 24px 0 0;
  color: var(--body);
  font-size: 14px;
}

.portal {
  position: relative;
  display: grid;
  min-height: 100dvh;
  overflow: hidden;
  background: transparent;
  isolation: isolate;
}

.portal-copy {
  position: relative;
  z-index: 2;
  display: flex;
  min-height: 62dvh;
  flex-direction: column;
  justify-content: center;
  padding: clamp(64px, 10vw, 128px) 24px;
  background:
    radial-gradient(circle at 82% 18%, rgb(2 79 203 / 18%), transparent 26%),
    linear-gradient(145deg, rgb(14 21 32 / 94%), rgb(6 10 16 / 99%));
  box-shadow: inset 0 0 35px rgb(2 79 203 / 8%);
}

.portal h1 {
  max-width: 9.5ch;
  margin-bottom: clamp(28px, 4vw, 52px);
  font-size: clamp(3.4rem, 12vw, 8.8rem);
  line-height: 0.84;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.portal h1 em {
  color: var(--heading);
  font-style: normal;
}

.portal-copy > p:not(.kicker) {
  max-width: 43ch;
  font-size: clamp(16px, 1.4vw, 19px);
}

.portal-reveal {
  animation: portal-enter 620ms var(--spring-snappy) both;
}

.portal-reveal-1 {
  animation-delay: 40ms;
}

.portal-reveal-2 {
  animation-delay: 120ms;
}

.portal-reveal-3 {
  animation-delay: 240ms;
}

.portal-reveal-4 {
  animation-delay: 340ms;
}

.portal-reveal-art {
  animation-delay: 0ms;
}

@keyframes portal-enter {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sigil-link {
  display: inline-flex;
  width: max-content;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 10px 16px;
  border: 2px solid var(--fg-brand);
  border-radius: 2px;
  background: linear-gradient(var(--brand-strong), var(--brand-soft));
  box-shadow: var(--shadow-xs), inset rgb(184 216 248 / 15%) 0 1px 0, rgb(2 79 203 / 35%) 0 4px 10px -5px;
  color: var(--heading);
  font-family: "New Rocker", serif;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-decoration: none;
  text-shadow: 0 1px 3px rgb(0 0 0 / 90%);
  text-transform: uppercase;
  transition: filter 150ms, transform 150ms, box-shadow 150ms;
}

.sigil-link:hover {
  filter: brightness(1.2);
  box-shadow: var(--shadow-md);
}

.sigil-link:active {
  filter: brightness(0.85);
  transform: scale(0.98);
}

.portal-art {
  position: relative;
  display: block;
  min-height: 38dvh;
  overflow: hidden;
  border-block: 2px solid var(--border-accent);
  color: var(--heading);
  box-shadow: var(--shadow-md);
}

.portal-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.035) translateY(calc(var(--portal-scroll, 0) * -18px));
  filter: saturate(0.78) contrast(1.04);
  transition: transform 700ms var(--spring-snappy), filter 400ms var(--ease-snap);
  will-change: transform;
}

.portal-art:hover img,
.portal-art:focus-visible img {
  transform: scale(1.055) translateY(calc(var(--portal-scroll, 0) * -18px));
  filter: saturate(0.92) contrast(1.06);
}

.portal-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 55%, rgb(6 10 16 / 94%));
}

.portal-art span {
  position: absolute;
  z-index: 1;
  right: 24px;
  bottom: 24px;
  left: 24px;
  font-family: "New Rocker", serif;
  font-size: 20px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: transform 400ms var(--ease-snap), color 400ms var(--ease-snap);
}

.portal-art:hover span,
.portal-art:focus-visible span {
  color: var(--white);
  transform: translateY(-3px);
}

.kicker {
  margin-bottom: 16px;
  color: var(--heading);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.cabinet,
.archive-head,
.reading-page > header,
.constellation,
.related,
.field-list {
  padding: 64px 24px;
  background: transparent;
}

.section-title {
  display: grid;
  gap: 16px;
  margin-bottom: 48px;
}

.gallery {
  display: grid;
  gap: 24px;
}

.story {
  position: relative;
  align-self: start;
  padding: 12px;
  border: 2px solid var(--border-accent);
  border-radius: 2px;
  background: linear-gradient(var(--neutral-primary-medium), var(--neutral-primary));
  box-shadow: var(--shadow-md);
  transition: border-color 150ms, box-shadow 150ms;
}

.story::after {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 3px;
  border: 1px solid var(--border-accent);
  border-radius: 2px;
  pointer-events: none;
}

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

.story:hover {
  border-color: var(--fg-brand);
  box-shadow: var(--shadow-lg);
}

.story-image {
  display: block;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border-radius: 2px;
  background: var(--dark);
}

.story-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 250ms;
}

.story:hover img {
  transform: scale(1.025);
}

.story .kicker {
  margin: 20px 8px 8px;
}

.story h2 {
  margin: 0 8px 12px;
  font-size: 20px;
}

.story h2 a {
  color: var(--heading);
  text-decoration: none;
}

.story > p:last-child {
  margin: 0 8px 16px;
  color: var(--body);
}

.constellation {
  display: grid;
  gap: 24px;
  border-block: 2px solid var(--border-default);
  box-shadow: inset 0 0 35px rgb(2 79 203 / 8%);
}

.constellation h2,
.constellation > p {
  max-width: 65ch;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 16px 24px;
  border-bottom: 2px solid var(--border-default);
  background: var(--neutral-primary-soft);
  font-size: 14px;
}

.breadcrumb a {
  color: var(--fg-brand);
}

.breadcrumb i,
.field-note > span,
.article-grid aside span {
  color: var(--heading);
}

.archive-head h1 {
  max-width: 13ch;
}

.archive-head > p:not(.kicker) {
  max-width: 65ch;
  margin-top: 24px;
  font-size: 18px;
}

.reading-page {
  background: transparent;
}

.reading-page > header {
  border-bottom: 2px solid var(--border-default);
}

.reading-page > header h1 {
  max-width: 14ch;
}

.hero-figure {
  margin: 0;
  background: var(--dark);
  box-shadow: var(--shadow-lg);
}

.hero-figure img {
  width: 100%;
  max-height: 720px;
  object-fit: cover;
}

.article-grid {
  display: grid;
  padding: 48px 24px;
}

.article-grid aside {
  display: none;
}

.prose {
  width: min(100%, var(--read));
  margin-inline: auto;
}

.prose > * {
  max-width: 100%;
}

.prose > p:first-child {
  font-size: 18px;
}

.prose h2,
.prose h3 {
  margin: 48px 0 16px;
}

.prose h2 {
  font-size: 32px;
}

.prose h3 {
  font-size: 24px;
}

.prose img {
  width: auto;
  max-height: 760px;
  margin: 32px auto;
  border: 2px solid var(--border-accent);
  border-radius: 2px;
  box-shadow: var(--shadow-md);
}

.prose blockquote,
.disclosure {
  margin: 32px 0;
  padding: 24px;
  border: 2px solid var(--border-default-medium);
  border-left-color: var(--fg-brand);
  border-radius: 2px;
  background: linear-gradient(var(--neutral-primary-medium), var(--neutral-primary));
  box-shadow: var(--shadow-md);
}

.prose ul,
.prose ol {
  padding-left: 24px;
}

.prose li + li {
  margin-top: 16px;
}

.prose table {
  display: block;
  max-width: 100%;
  overflow: auto;
  border-collapse: collapse;
}

.prose th,
.prose td {
  padding: 16px;
  border: 2px solid var(--border-default);
}

.related {
  border-top: 2px solid var(--border-default);
}

.related-grid {
  display: grid;
  gap: 24px;
}

.disclosure {
  max-width: 48rem;
  font-size: 14px;
}

.field-list {
  padding-top: 32px;
}

.field-note {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 16px;
  padding: 32px 0;
  border-top: 2px solid var(--border-default);
}

.field-note > span {
  font-weight: 700;
}

.field-note h2 {
  font-size: 24px;
}

.field-note h2 a {
  color: var(--heading);
}

.field-note p {
  max-width: 65ch;
  margin-top: 16px;
}

footer {
  display: grid;
  gap: 16px;
  padding: 40px 24px;
  border-top: 2px solid var(--border-default);
  background: var(--neutral-primary-soft);
  color: var(--body);
}

footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}

footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--fg-brand);
}

@media (min-width: 720px) {
  h1 {
    font-size: 48px;
  }

  h2 {
    font-size: 40px;
  }

  .gallery {
    grid-template-columns: repeat(2, 1fr);
  }

  .story-0,
  .story-3 {
    margin-top: 48px;
  }

  .related-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .section-title {
    grid-template-columns: 1fr 2fr;
    align-items: end;
  }

  .constellation {
    grid-template-columns: 1.1fr 1fr auto;
    align-items: center;
  }

  .field-list {
    padding-inline: 64px;
  }

  .field-note {
    grid-template-columns: 80px 1fr;
    padding-block: 48px;
  }
}

@media (min-width: 1040px) {
  h1 {
    font-size: 72px;
  }

  h2 {
    font-size: 48px;
  }

  .site-frame {
    display: grid;
    grid-template-columns: 256px 1fr;
    grid-template-areas: "mast main" "mast foot";
  }

  .mast {
    position: sticky;
    z-index: 5;
    top: 0;
    grid-area: mast;
    height: 100vh;
    padding: 40px 24px;
    border-right: 2px solid var(--border-default);
    border-bottom: 0;
  }

  .mast nav {
    flex-direction: column;
    margin-top: 56px;
  }

  .mast-note {
    position: absolute;
    right: 24px;
    bottom: 40px;
    left: 24px;
  }

  .site-frame > main {
    grid-area: main;
  }

  .site-frame > footer {
    grid-area: foot;
  }

  .portal {
    grid-template-columns: 1.05fr 0.95fr;
    min-height: 100dvh;
  }

  .portal-copy {
    min-height: 100dvh;
    padding: clamp(72px, 8vw, 128px) 56px;
  }

  .portal h1 {
    font-size: clamp(4.8rem, 8.2vw, 9.25rem);
  }

  .portal-art {
    min-height: 100dvh;
    border-block: 0;
    border-inline: 2px solid var(--border-accent);
  }

  .cabinet,
  .archive-head,
  .reading-page > header,
  .constellation,
  .related {
    padding: 96px 72px;
  }

  .gallery {
    grid-template-columns: repeat(3, 1fr);
  }

  .story-0,
  .story-3 {
    margin-top: 72px;
  }

  .article-grid {
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 48px;
    padding: 72px;
  }

  .article-grid aside {
    position: sticky;
    top: 48px;
    display: block;
    align-self: start;
    color: var(--body);
    font-size: 14px;
  }

  .article-grid aside span {
    display: block;
    font-size: 30px;
  }

  .breadcrumb {
    padding-inline: 72px;
  }

  footer {
    grid-template-columns: 1fr auto;
    padding: 48px 72px;
  }
}

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

  .story-image img,
  .sigil-link,
  .portal-art img,
  .portal-art span {
    transition: none;
  }

  .portal-reveal {
    animation: portal-fade 160ms cubic-bezier(0.16, 1, 0.3, 1) both;
    animation-delay: 0ms;
  }

  .portal-art img,
  .portal-art:hover img,
  .portal-art:focus-visible img {
    transform: none;
  }
}

@keyframes portal-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (max-width: 420px) {
  .wordmark {
    align-items: flex-start;
    flex-direction: column;
  }

  .gallery {
    gap: 24px;
  }

  .portal-copy {
    min-height: 66dvh;
  }

  .portal h1 {
    font-size: clamp(2.75rem, 13.5vw, 3.5rem);
  }
}
