/* L2 Empires — base do design system (fonte: Design system/styles.css, adaptada pro site) */

@font-face {
  font-family: "Empires Display";
  src: url("/assets/empires/fonts/cormorant-garamond-variable.ttf") format("truetype");
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
}

@font-face {
  font-family: "Empires UI";
  src: url("/assets/empires/fonts/montserrat-variable.ttf") format("truetype");
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
}

:root {
  --void: #090a0c;
  --void-soft: #0e1013;
  --basalt: #17191c;
  --iron: #24262a;
  --smoke: #8c8b84;
  --mist: #aaa79f;
  --ivory: #e7e0d1;
  --white: #f5f0e6;
  --gold: #b8a06c;
  --gold-bright: #d0ba86;
  --gold-deep: #74613e;
  --ember: #a9472f;
  --ember-bright: #cc6248;
  --success: #7e9a77;
  --danger: #c46a58;
  --line: rgba(208, 186, 134, 0.19);
  --line-strong: rgba(208, 186, 134, 0.46);
  --line-cold: rgba(231, 224, 209, 0.12);
  --font-display: "Empires Display", Georgia, serif;
  --font-ui: "Empires UI", "Segoe UI", sans-serif;
  --max: 88rem;
  --gutter: clamp(1.15rem, 4vw, 4.5rem);
  --section-space: clamp(6.5rem, 12vw, 11rem);
  --ease: cubic-bezier(.2, .75, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scrollbar-color: var(--gold-deep) var(--void);
  scrollbar-width: thin;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--void);
  color: var(--ivory);
  cursor: url("/assets/empires/images/cursor-gauntlet.png") 8 4, auto;
  font-family: var(--font-ui);
  font-size: 1rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

body::-webkit-scrollbar { width: .56rem; }
body::-webkit-scrollbar-track { background: var(--void); }
body::-webkit-scrollbar-thumb { background: var(--gold-deep); }

::selection { background: var(--gold); color: var(--void); }

a, button, input, select, textarea, [tabindex] {
  cursor: url("/assets/empires/images/cursor-gauntlet.png") 8 4, pointer;
}

button, input, select, textarea { font: inherit; }
button { color: inherit; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .35em; }

:focus-visible {
  outline: 1px solid var(--gold-bright);
  outline-offset: 5px;
}

.visually-hidden,
.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;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 1rem;
  left: 1rem;
  padding: .75rem 1rem;
  transform: translateY(-160%);
  background: var(--white);
  color: var(--void);
  font-weight: 700;
}

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

/* ---- Cabeçalho ---- */

.site-header {
  position: fixed;
  z-index: 40;
  top: 0;
  left: 0;
  display: grid;
  width: 100%;
  min-height: 5.6rem;
  padding: 0 var(--gutter);
  align-items: center;
  grid-template-columns: minmax(10rem, 1fr) auto minmax(10rem, 1fr);
  border-bottom: 1px solid transparent;
  transition: background-color .4s var(--ease), border-color .4s var(--ease), backdrop-filter .4s var(--ease);
}

.site-header.is-scrolled {
  border-color: var(--line-cold);
  background: rgba(9, 10, 12, .86);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: .7rem;
  text-decoration: none;
}

.brand__sigil {
  width: 2.75rem;
  height: 3.2rem;
  object-fit: contain;
  filter: drop-shadow(0 .45rem 1.1rem rgba(0, 0, 0, .42));
}

.brand__wordmark {
  width: 7.8rem;
  height: auto;
  object-fit: contain;
  object-position: left center;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: center;
}

.site-nav__links {
  display: flex;
  align-items: center;
  gap: clamp(1.2rem, 2.2vw, 2.5rem);
}

.site-nav a {
  position: relative;
  padding: .4rem 0;
  color: var(--mist);
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-decoration: none;
  text-transform: uppercase;
}

.site-nav a::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  content: "";
  transform: scaleX(0);
  transform-origin: right;
  background: var(--gold-bright);
  transition: transform .32s var(--ease);
}

.site-nav a:hover,
.site-nav a[aria-current="page"] { color: var(--white); }
.site-nav a:hover::after,
.site-nav a[aria-current="page"]::after { transform: scaleX(1); transform-origin: left; }

.menu-toggle { display: none; }

/* ---- Herói cerimonial ---- */

.hero {
  position: relative;
  display: grid;
  min-height: 100svh;
  overflow: hidden;
  align-items: end;
  isolation: isolate;
}

.hero__image,
.hero__veil {
  position: absolute;
  inset: 0;
}

.hero__sigil {
  position: absolute;
  z-index: -1;
  top: 50%;
  left: 50%;
  width: clamp(18rem, 29vw, 29rem);
  opacity: .12;
  transform: translate(-50%, -48%);
  filter: drop-shadow(0 1.5rem 3rem rgba(0, 0, 0, .78));
}

.hero__image {
  z-index: -3;
  transform: scale(1.04);
  background-position: 67% center;
  background-size: cover;
  background-repeat: no-repeat;
  filter: saturate(.78) contrast(1.06) brightness(.79);
  transition: transform 1.8s var(--ease), filter 1.8s var(--ease);
}

.is-ready .hero__image { transform: scale(1); filter: saturate(.82) contrast(1.06) brightness(.83); }

.hero__veil {
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(6, 7, 9, .93) 0%, rgba(6, 7, 9, .57) 38%, rgba(6, 7, 9, .08) 70%),
    linear-gradient(0deg, rgba(6, 7, 9, .94) 0%, transparent 48%, rgba(6, 7, 9, .6) 100%);
}

.hero::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, .04);
  content: "";
  pointer-events: none;
}

.hero__content {
  width: min(63rem, calc(100% - (2 * var(--gutter))));
  margin: 6rem auto 0;
  align-self: center;
  justify-self: center;
  opacity: 0;
  text-align: center;
  transform: translateY(1.8rem);
  transition: opacity .9s .15s var(--ease), transform 1.1s .15s var(--ease);
}

.is-ready .hero__content { opacity: 1; transform: translateY(0); }

.hero h1 {
  max-width: 17ch;
  margin: 0 auto;
  color: var(--white);
  font-family: var(--font-display);
  font-size: clamp(4rem, 8.5vw, 8.5rem);
  font-weight: 400;
  letter-spacing: .01em;
  line-height: 1;
  text-wrap: balance;
}

.hero__content > p {
  max-width: 43rem;
  margin: 1rem auto 0;
  color: #d7d1c6;
  font-size: clamp(.8rem, 1vw, .94rem);
}

.ornament { display: flex; width: min(15rem, 60vw); margin: 1.8rem auto 0; align-items: center; gap: .8rem; color: var(--gold-bright); }
.ornament i { height: 1px; flex: 1; background: linear-gradient(90deg, transparent, currentColor); opacity: .65; }
.ornament i:last-child { background: linear-gradient(90deg, currentColor, transparent); }
.ornament b { font-size: .72rem; font-weight: 400; }

.hero__coordinate {
  position: absolute;
  right: var(--gutter);
  bottom: clamp(8rem, 13vw, 10rem);
  display: flex;
  align-items: center;
  gap: .8rem;
  color: rgba(231, 224, 209, .65);
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.hero__coordinate i { width: 2.2rem; height: 1px; background: var(--line-strong); }

/* ---- Seções ---- */

.section {
  padding: var(--section-space) var(--gutter);
}

.section-head {
  display: grid;
  max-width: var(--max);
  margin: 0 auto clamp(3.5rem, 7vw, 6.5rem);
  grid-template-columns: minmax(0, 1.15fr) minmax(20rem, .62fr);
  align-items: end;
  gap: clamp(2rem, 7vw, 8rem);
}

.section-head h2 {
  max-width: 16ch;
  margin: 0;
  color: var(--white);
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 5vw, 5.45rem);
  font-weight: 450;
  letter-spacing: -.01em;
  line-height: .98;
  text-wrap: balance;
}

.section-head p {
  max-width: 44rem;
  margin: 0;
  color: var(--mist);
}

.section-head--light h2 { color: #1b1b1b; }
.section-head--light p { color: #595750; }

.section-head--center {
  grid-template-columns: 1fr;
  justify-items: center;
  text-align: center;
}

/* ---- Acervo de imagens ---- */

.filter-bar {
  display: flex;
  max-width: var(--max);
  margin: 0 auto 2rem;
  overflow-x: auto;
  border-block: 1px solid var(--line-cold);
  scrollbar-width: none;
}

.filter-bar::-webkit-scrollbar { display: none; }
.filter-bar button {
  min-width: max-content;
  min-height: 3.65rem;
  padding: 0 1.3rem;
  border: 0;
  border-right: 1px solid var(--line-cold);
  border-radius: 0;
  background: transparent;
  color: var(--mist);
  font-size: .67rem;
  font-weight: 700;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.filter-bar button:hover,
.filter-bar button[aria-pressed="true"] { background: rgba(184, 160, 108, .08); color: var(--gold-bright); }

.image-archive {
  display: grid;
  max-width: var(--max);
  margin: 0 auto;
  grid-auto-flow: dense;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1px;
  background: var(--line-cold);
  border: 1px solid var(--line-cold);
}

.archive-item {
  position: relative;
  min-height: 31rem;
  margin: 0;
  overflow: hidden;
  background: var(--basalt);
  opacity: 1;
  transition: opacity .35s var(--ease), filter .35s var(--ease);
}

.archive-item--wide { grid-column: span 8; }
.archive-item--half { grid-column: span 6; }
.archive-item--portrait { grid-column: span 4; }
.archive-item:last-child { grid-column: span 12; min-height: 38rem; }
.archive-item.is-hidden { display: none; }
.archive-item img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.78) contrast(1.05); transition: transform .8s var(--ease), filter .5s var(--ease); }
.archive-item--art img { filter: saturate(.94) contrast(1.06); }
.archive-item:hover img { transform: scale(1.025); filter: saturate(.94) contrast(1.05); }
.archive-item figcaption {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  min-height: 5.5rem;
  padding: 1.2rem 1.4rem;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  background: linear-gradient(0deg, rgba(7, 8, 10, .94), rgba(7, 8, 10, 0));
}
.archive-item figcaption strong { font-family: var(--font-display); font-size: 1.2rem; font-weight: 500; }
.archive-item figcaption span { color: #c7c1b6; font-size: .62rem; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }

/* ---- Botões ---- */

.button {
  position: relative;
  display: inline-flex;
  min-height: 3.35rem;
  padding: 0 1.4rem;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  border: 1px solid rgba(231, 224, 209, .36);
  border-radius: 0;
  background: transparent;
  font-size: .59rem;
  font-weight: 650;
  letter-spacing: .17em;
  text-decoration: none;
  text-transform: uppercase;
  transition: background-color .25s var(--ease), border-color .25s var(--ease), color .25s var(--ease);
}

.button svg { width: 1.35rem; fill: none; stroke: currentColor; stroke-linecap: square; stroke-width: 1.5; }
.button:not(.button--quiet)::before,
.button:not(.button--quiet)::after { position: absolute; top: 50%; width: .28rem; height: .28rem; border: 1px solid currentColor; content: ""; transform: translateY(-50%) rotate(45deg); }
.button:not(.button--quiet)::before { left: -.18rem; }
.button:not(.button--quiet)::after { right: -.18rem; }
.button--primary { border-color: var(--gold); color: var(--gold-bright); }
.button--primary:hover { border-color: var(--ivory); background: var(--ivory); color: var(--void); }
.button--secondary { color: var(--ivory); }
.button--secondary:hover { border-color: var(--ivory); background: rgba(231, 224, 209, .06); color: var(--white); }
.button--quiet { border-color: transparent; color: var(--mist); text-decoration: underline; text-underline-offset: .35em; }
.button--quiet:hover { color: var(--white); }
.button:disabled { border-color: var(--line-cold); background: var(--iron); color: #767670; cursor: not-allowed; }
.button:disabled::before, .button:disabled::after { display: none; }
.button--full { width: 100%; justify-content: center; }

/* ---- Estados vivos ---- */

.state-list { border-top: 1px solid var(--line-cold); }
.state { display: grid; min-height: 3.7rem; padding: 0 .25rem; align-items: center; grid-template-columns: auto 1fr auto; gap: .8rem; border-bottom: 1px solid var(--line-cold); }
.state i { width: .48rem; height: .48rem; border-radius: 50%; background: var(--smoke); box-shadow: 0 2px .8rem rgba(119, 119, 112, .3); }
.state span { color: var(--mist); font-size: .76rem; }
.state strong { color: var(--ivory); font-family: var(--font-display); font-size: .85rem; font-variant-numeric: lining-nums tabular-nums; font-weight: 500; }
.state[data-state="online"] i { background: var(--success); box-shadow: 0 2px .85rem rgba(126, 154, 119, .42); }
.state[data-state="siege"] i { background: var(--ember-bright); box-shadow: 0 2px .85rem rgba(204, 98, 72, .4); }
.state[data-state="maintenance"] i { background: var(--gold); box-shadow: 0 2px .85rem rgba(184, 160, 108, .38); }

.empty-state { display: flex; padding: 1.6rem; flex-direction: column; justify-content: center; border: 1px solid var(--line-cold); }
.empty-state strong { color: var(--ivory); font-family: var(--font-display); font-size: 1rem; font-weight: 500; }
.empty-state p { margin: .3rem 0 0; color: var(--smoke); font-size: .78rem; }

/* ---- Campos ---- */

.field { display: grid; gap: .5rem; }
.field label,
.field > span { color: var(--mist); font-size: .66rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.field input, .field select, .field textarea { width: 100%; min-height: 3.45rem; padding: 0 .9rem; border: 1px solid var(--line); border-radius: 0; outline: none; background: #0a0c0f; color: var(--ivory); }
.field textarea { min-height: 5rem; padding: .8rem .9rem; resize: vertical; }
.field input::placeholder { color: #888780; opacity: 1; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--gold-bright); }
.field small,
.field .field__hint { color: var(--smoke); font-size: .72rem; }
.field--error input { border-color: rgba(196, 106, 88, .72); }
.field--error small { color: var(--danger); }

/* ---- Tabelas ---- */

.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 29rem; border-collapse: collapse; font-variant-numeric: lining-nums tabular-nums; }
th, td { padding: .9rem .65rem; border-bottom: 1px solid var(--line-cold); text-align: left; }
th { color: var(--smoke); font-size: .61rem; letter-spacing: .09em; text-transform: uppercase; }
td { color: var(--ivory); font-size: .82rem; }
td:first-child { color: var(--gold-bright); font-family: var(--font-display); }
td:last-child, th:last-child { text-align: right; }
.table-state { color: var(--smoke); text-align: center; }
td.table-state { text-align: center; }

/* ---- Painéis padrão ---- */

.pattern { width: 100%; max-width: var(--max); margin-right: auto; margin-left: auto; }

.pattern--hero { position: relative; min-height: 42rem; overflow: hidden; background: var(--void); color: var(--ivory); }
.pattern--hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: brightness(.67) saturate(.8); }
.pattern--hero::after { position: absolute; inset: 0; content: ""; background: linear-gradient(90deg, rgba(9, 10, 12, .88), rgba(9, 10, 12, .16) 72%); }
.pattern__content { position: absolute; z-index: 1; bottom: clamp(2rem, 6vw, 5rem); left: clamp(1.5rem, 5vw, 5rem); width: min(31rem, calc(100% - 3rem)); }
.pattern__content h3 { max-width: 11ch; margin: 0; font-family: var(--font-display); font-size: clamp(3rem, 6vw, 5.5rem); font-weight: 500; letter-spacing: -.035em; line-height: .95; }
.pattern__content p { margin: 1rem 0 1.8rem; color: #d0cbc1; }

.event-panel { position: relative; min-height: 31rem; overflow: hidden; color: var(--ivory); }
.event-panel img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: brightness(.54) saturate(.75); }
.event-panel::after { position: absolute; inset: 0; content: ""; background: linear-gradient(0deg, rgba(9, 10, 12, .95), transparent 75%); }
.event-panel > div { position: absolute; z-index: 1; right: 2rem; bottom: 2rem; left: 2rem; }
.event-panel h3 { max-width: 13ch; margin: 0; font-family: var(--font-display); font-size: clamp(2rem, 4vw, 3.7rem); font-weight: 500; letter-spacing: -.03em; line-height: 1; }
.event-panel p { margin: .75rem 0 1rem; color: #d2cdc3; }
.event-panel a { color: var(--gold-bright); font-size: .69rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }

/* ---- Rodapé ---- */

.site-footer {
  padding: clamp(3rem, 6vw, 5rem) var(--gutter) 2rem;
  border-top: 1px solid var(--line-cold);
  background: #07080a;
}

/* ---- Responsivo ---- */

@media (max-width: 68rem) {
  .site-header { grid-template-columns: 1fr auto; }
  .site-nav {
    position: fixed;
    top: 4.55rem;
    right: 0;
    left: 0;
    display: grid;
    padding: 1rem var(--gutter) 2rem;
    background: rgba(9, 10, 12, .97);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-.75rem);
    visibility: hidden;
    transition: opacity .25s var(--ease), transform .35s var(--ease), visibility 0s .35s;
  }
  .site-nav.is-open { opacity: 1; pointer-events: auto; transform: translateY(0); visibility: visible; transition-delay: 0s; }
  .site-nav__links { display: grid; width: 100%; gap: 0; }
  .site-nav a { padding: .8rem 0; border-bottom: 1px solid var(--line-cold); }
  .menu-toggle { display: grid; width: 2.75rem; height: 2.75rem; padding: .8rem; place-content: center; gap: .35rem; border: 1px solid var(--line); border-radius: 0; background: rgba(9, 10, 12, .52); }
  .menu-toggle > span:not(.sr-only) { display: block; width: 1.1rem; height: 1px; background: var(--ivory); transition: transform .3s var(--ease); }
  .menu-toggle[aria-expanded="true"] > span:first-child { transform: translateY(.2rem) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] > span:nth-child(2) { transform: translateY(-.2rem) rotate(-45deg); }
  .hero__coordinate { display: none; }
  .section-head { grid-template-columns: 1fr; gap: 1.4rem; }
}

@media (max-width: 48rem) {
  :root { --section-space: 5.8rem; }
  .site-header { min-height: 4.6rem; }
  .brand__sigil { width: 2.25rem; height: 2.65rem; }
  .brand__wordmark { width: 6.5rem; }
  .hero { min-height: 46rem; }
  .hero__image { background-position: 74% center; }
  .hero__veil { background: linear-gradient(0deg, rgba(6, 7, 9, .96) 0%, rgba(6, 7, 9, .55) 60%, rgba(6, 7, 9, .68) 100%); }
  .hero__content { width: calc(100% - 2 * var(--gutter)); margin: 4.5rem var(--gutter) 0; }
  .hero h1 { font-size: clamp(3rem, 14vw, 4.5rem); line-height: 1; }
  .hero__content > p { font-size: .88rem; }
  .hero__sigil { top: 49%; left: 50%; width: 17rem; opacity: .1; transform: translate(-50%, -50%); }
  .archive-item,
  .archive-item--wide,
  .archive-item--half,
  .archive-item--portrait,
  .archive-item:last-child { grid-column: span 12; min-height: 27rem; }
  .archive-item--portrait { min-height: 35rem; }
  .archive-item figcaption { align-items: flex-start; flex-direction: column; justify-content: flex-end; gap: .15rem; }
  .pattern--hero { min-height: 37rem; }
  .pattern--hero > img { object-position: 67% center; }
  .event-panel { min-height: 28rem; }
}

@media (pointer: coarse) {
  body, a, button, input, select, textarea, [tabindex] { cursor: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
  .hero__content { opacity: 1; transform: none; }
  .hero__image { transform: none; }
}
