:root {
  color-scheme: dark;
  --ink: #071016;
  --ink-soft: #0d1920;
  --surface: #101c23;
  --paper: #f3e7cf;
  --text: #e8e4dc;
  --muted: #aeb8bc;
  --gold: #c6964b;
  --gold-soft: #e2bf7b;
  --teal: #5d928d;
  --oxblood: #7b282b;
  --line: rgba(198, 150, 75, 0.28);
  --max-width: 1240px;
  --radius: 4px;
  --serif: Georgia, "Times New Roman", serif;
  --sans: Inter, "Segoe UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--ink);
  font-family: var(--sans);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  opacity: 0.18;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.12'/%3E%3C/svg%3E");
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  display: block;
}

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

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 14px;
  color: var(--ink);
  background: var(--paper);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 10;
  width: min(calc(100% - 48px), var(--max-width));
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(232, 228, 220, 0.12);
  transform: translateX(-50%);
  transition: min-height 180ms ease, background 180ms ease, border-color 180ms ease;
}

.site-header.scrolled {
  position: fixed;
  min-height: 64px;
  border-color: var(--line);
  background: rgba(7, 16, 22, 0.94);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--paper);
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 700;
}

.brand img {
  width: 42px;
  height: 42px;
}

.site-header nav,
footer nav {
  display: flex;
  gap: 32px;
}

.site-header nav a,
footer nav a {
  position: relative;
  padding: 12px 0;
  color: #e3e5e3;
  font-size: 0.88rem;
}

.site-header nav a::after,
footer nav a::after {
  position: absolute;
  right: 0;
  bottom: 4px;
  left: 0;
  height: 1px;
  content: "";
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 180ms ease;
}

.site-header nav a:hover::after,
.site-header nav a:focus-visible::after,
footer nav a:hover::after,
footer nav a:focus-visible::after {
  transform: scaleX(1);
}

.hero {
  position: relative;
  min-height: min(840px, 94vh);
  display: grid;
  align-items: center;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero-media {
  position: absolute;
  inset: 0 0 0 28%;
  background: url("imperium-verborum/assets/story/liber-vii-03-march-to-alesia.webp") center 45% / cover no-repeat;
}

.hero-media::before {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(90deg, var(--ink) 0%, rgba(7, 16, 22, 0.98) 8%, rgba(7, 16, 22, 0.7) 29%, transparent 58%),
    linear-gradient(180deg, rgba(7, 16, 22, 0.18), transparent 55%, var(--ink) 100%);
}

.hero-copy {
  position: relative;
  z-index: 1;
  width: min(calc(100% - 48px), var(--max-width));
  margin: 50px auto 0;
}

.hero-copy h1 {
  max-width: 660px;
  margin: 0;
  color: var(--paper);
  font-family: var(--serif);
  font-size: clamp(3.2rem, 6.2vw, 6rem);
  font-weight: 500;
  line-height: 0.98;
}

.hero-copy > p {
  max-width: 530px;
  margin: 28px 0 0;
  color: #d0d7d8;
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.button {
  min-height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 20px;
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 700;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.button > svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.button > img {
  width: 25px;
  height: 25px;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-2px);
}

.button-primary {
  color: var(--paper);
  border-color: #bd714a;
  background: linear-gradient(180deg, #852f2f, #5d2024);
  box-shadow: 0 12px 32px rgba(54, 8, 11, 0.32);
}

.button-primary:hover,
.button-primary:focus-visible {
  background: linear-gradient(180deg, #963a36, #692327);
}

.button-secondary {
  color: var(--gold-soft);
  background: rgba(7, 16, 22, 0.72);
}

.button-secondary:hover,
.button-secondary:focus-visible {
  background: rgba(198, 150, 75, 0.1);
}

.hero-scroll {
  position: absolute;
  bottom: 20px;
  left: 50%;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 5px;
  color: rgba(232, 228, 220, 0.66);
  font-size: 0.72rem;
  text-transform: uppercase;
  transform: translateX(-50%);
}

.hero-scroll svg {
  width: 22px;
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.5;
  animation: descend 1.8s ease-in-out infinite;
}

.featured-game,
.library,
.principles,
footer {
  width: min(calc(100% - 48px), var(--max-width));
  margin-inline: auto;
}

.featured-game {
  min-height: 650px;
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.35fr);
  gap: clamp(42px, 7vw, 96px);
  align-items: center;
  padding: 90px 0;
  border-bottom: 1px solid var(--line);
}

.section-label {
  margin: 0 0 20px;
  color: var(--gold);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
}

.featured-copy h2,
.section-heading h2 {
  margin: 0;
  color: var(--paper);
  font-family: var(--serif);
  font-weight: 500;
}

.featured-copy h2 {
  font-size: clamp(2.2rem, 4.2vw, 4.5rem);
  line-height: 1.03;
}

.game-meta {
  color: #b9c5c7;
  font-size: 0.84rem;
}

.game-meta span {
  margin: 0 7px;
  color: var(--gold);
}

.featured-copy > p:not(.section-label):not(.game-meta) {
  max-width: 50ch;
  color: var(--muted);
  line-height: 1.7;
}

.featured-copy .button {
  margin-top: 18px;
}

.featured-screen {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(198, 150, 75, 0.66);
  border-radius: var(--radius);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
}

.featured-screen img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center;
  transition: transform 500ms ease, filter 300ms ease;
}

.featured-screen span {
  position: absolute;
  right: 14px;
  bottom: 14px;
  padding: 8px 11px;
  color: var(--paper);
  border: 1px solid rgba(226, 191, 123, 0.55);
  background: rgba(7, 16, 22, 0.86);
  font-size: 0.76rem;
  font-weight: 800;
}

.featured-screen:hover img,
.featured-screen:focus-visible img {
  filter: brightness(1.08);
  transform: scale(1.015);
}

.library,
.principles {
  padding: 90px 0;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 34px;
}

.section-heading h2 {
  font-size: clamp(2.1rem, 4vw, 3.5rem);
}

.section-heading > p {
  max-width: 420px;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  text-align: right;
}

.game-entry {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(0, 1.15fr);
  overflow: hidden;
  border: 1px solid rgba(198, 150, 75, 0.66);
  border-radius: var(--radius);
  background: var(--ink-soft);
  transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.game-entry[hidden] {
  display: none;
}

.game-entry:hover,
.game-entry:focus-visible {
  border-color: var(--gold-soft);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.26);
  transform: translateY(-3px);
}

.game-entry figure {
  min-height: 340px;
  margin: 0;
  overflow: hidden;
}

.game-entry figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 48% 48%;
  transition: transform 500ms ease;
}

.game-entry:hover figure img {
  transform: scale(1.025);
}

.game-entry-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(28px, 5vw, 62px);
}

.game-entry h3,
.future-entry h3,
.principle-rail h3 {
  margin: 0;
  color: var(--paper);
  font-family: var(--serif);
  font-weight: 500;
}

.game-entry h3 {
  font-size: clamp(1.75rem, 3vw, 2.7rem);
}

.game-entry-copy > div > p:last-child,
.future-entry p,
.principle-rail p {
  color: var(--muted);
  line-height: 1.6;
}

.entry-action {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 24px;
  padding-top: 16px;
  color: var(--gold-soft);
  border-top: 1px solid var(--line);
  font-weight: 800;
}

.entry-action svg {
  width: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 30px;
}

.filter-chip {
  min-height: 42px;
  padding: 0 20px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(7, 16, 22, 0.5);
  font-family: var(--sans);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.filter-chip:hover,
.filter-chip:focus-visible {
  color: var(--gold-soft);
  border-color: rgba(198, 150, 75, 0.6);
  transform: translateY(-2px);
}

.filter-chip:focus-visible {
  outline: 2px solid var(--gold-soft);
  outline-offset: 3px;
}

.filter-chip.is-active {
  color: var(--paper);
  border-color: var(--gold);
  background: rgba(198, 150, 75, 0.16);
}

.game-grid {
  display: grid;
  gap: 18px;
}

.filter-empty {
  margin: 4px 0 0;
  padding: 26px;
  color: var(--muted);
  border: 1px dashed rgba(198, 150, 75, 0.4);
  border-radius: var(--radius);
  text-align: center;
}

.future-entry {
  min-height: 190px;
  display: flex;
  align-items: center;
  gap: clamp(26px, 5vw, 62px);
  margin-top: 18px;
  padding: clamp(26px, 4vw, 48px);
  border: 1px dashed rgba(198, 150, 75, 0.58);
  border-radius: var(--radius);
}

.temple-mark {
  flex: 0 0 84px;
}

.temple-mark svg {
  width: 84px;
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.2;
}

.future-entry h3 {
  font-size: clamp(1.5rem, 2.5vw, 2.15rem);
}

.future-entry p {
  margin-bottom: 0;
}

.principles {
  border-top: 1px solid var(--line);
}

.project-intro {
  max-width: 760px;
  margin: -8px 0 40px;
}

.project-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.75;
}

.feedback {
  width: min(calc(100% - 48px), var(--max-width));
  margin-inline: auto;
  padding: 0 0 90px;
}

.feedback-card {
  padding: clamp(34px, 5vw, 60px);
  border: 1px solid rgba(198, 150, 75, 0.66);
  border-radius: var(--radius);
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(198, 150, 75, 0.12), transparent 55%),
    var(--ink-soft);
}

.feedback-copy {
  max-width: 620px;
}

.feedback-copy h2 {
  margin: 0;
  color: var(--paper);
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.9rem, 3.4vw, 3rem);
  line-height: 1.05;
}

.feedback-copy > p {
  margin: 18px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.feedback-actions {
  margin-top: 28px;
}

.feedback-note {
  margin: 18px 0 0;
  color: #8a9598;
  font-size: 0.8rem;
}

.principle-rail {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-block: 1px solid var(--line);
}

.principle-rail article {
  min-height: 210px;
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 22px;
  align-content: center;
  padding: 34px;
}

.principle-rail article + article {
  border-left: 1px solid var(--line);
}

.principle-rail svg {
  width: 48px;
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.4;
}

.principle-rail h3 {
  font-size: 1.3rem;
}

.principle-rail p {
  margin: 8px 0 0;
  font-size: 0.88rem;
}

footer {
  min-height: 150px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 20px;
  border-top: 1px solid var(--line);
}

footer .brand img {
  width: 36px;
  height: 36px;
}

footer > p {
  grid-column: 1 / -1;
  margin: -32px 0 0;
  color: #78888c;
  font-size: 0.72rem;
}

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

@keyframes descend {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}

@media (max-width: 900px) {
  .hero {
    min-height: 860px;
    align-items: end;
  }

  .hero-media {
    inset: 0;
    background-position: 51% 36%;
  }

  .hero-media::before {
    background:
      linear-gradient(180deg, rgba(7, 16, 22, 0.05) 12%, rgba(7, 16, 22, 0.62) 52%, var(--ink) 88%),
      linear-gradient(90deg, rgba(7, 16, 22, 0.24), transparent 40%, rgba(7, 16, 22, 0.08));
  }

  .hero-copy {
    margin-bottom: 90px;
  }

  .featured-game {
    grid-template-columns: 1fr;
  }

  .featured-screen {
    order: -1;
  }

  .game-entry {
    grid-template-columns: 1fr;
  }

  .game-entry figure {
    min-height: 300px;
  }

  .principle-rail {
    grid-template-columns: 1fr;
  }

  .principle-rail article + article {
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

@media (max-width: 640px) {
  .site-header,
  .hero-copy,
  .featured-game,
  .library,
  .principles,
  .feedback,
  footer {
    width: min(calc(100% - 32px), var(--max-width));
  }

  .site-header {
    min-height: 72px;
  }

  .brand {
    gap: 9px;
    font-size: 1.08rem;
  }

  .brand img {
    width: 34px;
    height: 34px;
  }

  .site-header nav {
    gap: 15px;
  }

  .site-header nav a {
    font-size: 0.75rem;
  }

  .hero {
    min-height: 780px;
  }

  .hero-media {
    background-position: 52% 32%;
  }

  .hero-copy h1 {
    font-size: clamp(2.65rem, 13vw, 4rem);
  }

  .hero-copy > p {
    font-size: 0.95rem;
  }

  .hero-actions {
    display: grid;
  }

  .button {
    width: 100%;
  }

  .featured-game,
  .library,
  .principles {
    padding: 64px 0;
  }

  .featured-game {
    min-height: 0;
    gap: 34px;
  }

  .featured-screen img {
    aspect-ratio: 4 / 3;
  }

  .section-heading {
    display: block;
  }

  .section-heading > p {
    margin-top: 12px;
    text-align: left;
  }

  .game-entry figure {
    min-height: 240px;
  }

  .game-entry-copy {
    padding: 26px 22px;
  }

  .future-entry {
    align-items: flex-start;
  }

  .temple-mark {
    flex-basis: 52px;
  }

  .temple-mark svg {
    width: 52px;
  }

  .principle-rail article {
    grid-template-columns: 42px 1fr;
    gap: 16px;
    padding: 28px 12px;
  }

  .principle-rail svg {
    width: 40px;
  }

  footer {
    grid-template-columns: 1fr;
    align-content: center;
    padding: 34px 0;
  }

  footer nav {
    gap: 22px;
  }

  footer > p {
    margin: 0;
  }
}

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

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
