/* ---------- Header ---------- */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 40;
  border-bottom: 1px solid transparent;
  view-transition-name: site-header;
  transition:
    background-color 0.4s,
    border-color 0.4s,
    box-shadow 0.4s,
    transform 0.5s var(--ease-out);
}

.site-header.is-scrolled,
.menu-open .site-header {
  background-color: rgb(33 17 16 / 0.86);
  border-bottom-color: var(--rule-night);
  box-shadow: 0 10px 30px -18px rgb(10 3 2 / 0.8);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
}

.site-header.is-hidden {
  transform: translateY(-100%);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  height: var(--header-h);
}

.brand {
  display: block;
  border-radius: var(--r-sm);
  transition:
    opacity 0.5s var(--ease-out),
    translate 0.5s var(--ease-out),
    filter 0.3s;
}

.brand__logo {
  width: auto;
  height: 44px;
  filter: drop-shadow(0 4px 6px rgb(20 6 4 / 0.35));
}

.brand:hover {
  filter: brightness(1.08);
}

/* On the home page the header logo waits until the big hero scroll has gone by. */
.site-header--home:not(.show-brand) .brand {
  opacity: 0;
  translate: 0 -0.5rem;
  pointer-events: none;
}

.menu-open .site-header--home .brand {
  opacity: 1;
  translate: 0 0;
  pointer-events: auto;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.site-nav__link {
  position: relative;
  padding-block: 0.5rem;
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
  color: var(--on-wall-muted);
  transition: color 0.25s;
}

.site-nav__link:hover,
.site-nav__link[aria-current="page"] {
  color: var(--plaster);
}

.site-nav__link::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
  translate: -50% 0;
  scale: 0;
  transition: scale 0.3s var(--ease-spring);
}

.site-nav__link:hover::after,
.site-nav__link[aria-current="page"]::after {
  scale: 1;
}

.menu-button {
  display: none;
  align-items: center;
  gap: 0.75rem;
  min-height: 44px;
  padding: 0 0.9rem;
  background: rgb(255 255 255 / 0.06);
  border: 1px solid var(--rule-wall);
  border-radius: var(--r-pill);
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: 600;
}

.menu-button__icon {
  position: relative;
  width: 18px;
  height: 8px;
  border-block: 1.5px solid currentColor;
  transition: border-color 0.3s;
}

.menu-button__icon::before,
.menu-button__icon::after {
  content: "";
  position: absolute;
  inset: 2.5px 0 auto;
  height: 1.5px;
  background: currentColor;
  scale: 1 0;
  transition: rotate 0.35s var(--ease-out), scale 0.2s;
}

.menu-open .menu-button__icon {
  border-color: transparent;
}

.menu-open .menu-button__icon::before {
  scale: 1 1;
  rotate: 45deg;
}

.menu-open .menu-button__icon::after {
  scale: 1 1;
  rotate: -45deg;
}

.menu {
  position: fixed;
  inset: 0;
  z-index: 39;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: calc(var(--header-h) + var(--space-4)) var(--gutter) var(--space-4);
  background: var(--night);
  opacity: 0;
  transition: opacity 0.35s var(--ease-out);
}

.menu.is-open {
  opacity: 1;
}

.menu__list {
  list-style: none;
  padding: 0;
}

.menu__list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 0.7rem;
  border-bottom: 1px solid var(--rule-night);
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 8vw, 2.6rem);
  line-height: 1.15;
  text-decoration: none;
}

.menu__list .icon {
  width: 1.5rem;
  height: 1.5rem;
  color: var(--gold);
}

.menu__list li {
  opacity: 0;
  translate: 0 1rem;
  transition:
    opacity 0.5s var(--ease-out),
    translate 0.6s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 60ms + 80ms);
}

.menu.is-open .menu__list li {
  opacity: 1;
  translate: 0 0;
}

.menu__note {
  font-size: var(--text-sm);
  color: var(--on-night-muted);
}

.menu__note [lang="la"] {
  display: block;
  font-size: var(--text-md);
  font-style: italic;
  color: var(--plaster);
}

html.menu-open {
  overflow: hidden;
}

@media (max-width: 52rem) {
  .site-nav {
    display: none;
  }

  .menu-button {
    display: inline-flex;
  }
}

/* ---------- Buttons ---------- */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  min-height: 3rem;
  padding: 0.85rem 1.5rem;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.2;
  text-decoration: none;
  transition:
    transform 0.25s var(--ease-out),
    box-shadow 0.25s,
    background-color 0.25s,
    border-color 0.25s,
    color 0.25s;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0) scale(0.98);
}

.btn--sm {
  min-height: 2.5rem;
  padding: 0.55rem 1.1rem;
}

.btn--primary {
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: var(--night);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.4), var(--shadow-sm);
}

.btn--primary:hover {
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.4), 0 12px 28px -10px rgb(227 176 75 / 0.75);
}

.btn--ghost {
  background: rgb(255 255 255 / 0.05);
  border-color: rgb(246 236 220 / 0.65);
  color: var(--plaster);
}

.btn--ghost:hover {
  background: rgb(255 255 255 / 0.12);
  border-color: var(--plaster);
}

.surface-parchment .btn--ghost {
  background: transparent;
  border-color: rgb(35 21 15 / 0.45);
  color: var(--ink);
}

.btn__arrow {
  transition: translate 0.35s var(--ease-out);
}

.btn:hover .btn__arrow {
  translate: 3px 0;
}

.btn[aria-busy="true"] {
  cursor: progress;
  opacity: 0.75;
}

/* ---------- Cards ---------- */

.card {
  position: relative;
  background: linear-gradient(180deg, var(--night-2), var(--night));
  border: 1px solid rgb(246 236 220 / 0.08);
  border-radius: var(--r-lg);
  box-shadow: var(--highlight), var(--shadow-md);
}

/* The Pompeian inset frame line, kept from the wall-painting motif. */
.card--frame::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgb(227 176 75 / 0.32);
  border-radius: calc(var(--r-lg) - 8px);
  pointer-events: none;
  transition:
    opacity 0.9s var(--ease-out) 0.2s,
    scale 0.9s var(--ease-out) 0.2s,
    border-color 0.4s;
}

.card--lift {
  transition:
    transform 0.45s var(--ease-out),
    box-shadow 0.45s var(--ease-out);
}

.card--lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--highlight), var(--shadow-lg);
}

.card--lift.card--frame:hover::after {
  border-color: rgb(227 176 75 / 0.7);
}

/* ---------- Chips and tags ---------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.25rem;
  padding: 0.4rem 0.95rem;
  background: rgb(255 255 255 / 0.04);
  border: 1px solid rgb(246 236 220 / 0.2);
  border-radius: var(--r-pill);
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
  color: var(--on-night-muted);
  white-space: nowrap;
  transition:
    background-color 0.25s,
    border-color 0.25s,
    color 0.25s;
}

button.chip:hover {
  border-color: rgb(246 236 220 / 0.45);
  color: var(--plaster);
}

.chip[aria-pressed="true"],
.chip[aria-selected="true"] {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--night);
}

.chip .icon {
  width: 1rem;
  height: 1rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.7rem;
  border-radius: var(--r-pill);
  background: rgb(227 176 75 / 0.14);
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--gold);
}

/* ---------- Meter ---------- */

.meter {
  height: 6px;
  overflow: hidden;
  border-radius: var(--r-pill);
  background: rgb(246 236 220 / 0.12);
}

.meter > span {
  display: block;
  width: calc(var(--value, 0) * 100%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--gold-bright));
  transition: width 0.9s var(--ease-out);
}

/* ---------- Surfaces ---------- */

.surface-night {
  background-color: var(--night);
  background-image: radial-gradient(ellipse 70% 55% at 50% 0%, rgb(156 46 37 / 0.22), transparent 70%);
}

.surface-parchment {
  position: relative;
  z-index: 1;
  background-color: var(--parchment);
  background-image:
    var(--parchment-fibre),
    radial-gradient(ellipse 120% 90% at 50% 50%, transparent 55%, rgb(160 115 50 / 0.2));
  color: var(--ink);
}

/* Torn top and bottom edges, echoing the scroll in the logo. */
.surface-parchment::before,
.surface-parchment::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 22px;
  background: var(--parchment);
  -webkit-mask: var(--torn-edge) 0 0 / 600px 100% repeat-x;
  mask: var(--torn-edge) 0 0 / 600px 100% repeat-x;
  pointer-events: none;
}

.surface-parchment::before {
  bottom: calc(100% - 1px);
}

.surface-parchment::after {
  top: calc(100% - 1px);
  transform: scaleY(-1);
}

/* ---------- Sections ---------- */

.section {
  position: relative;
  padding-block: var(--space-7);
}

.section-head {
  max-width: 46rem;
  margin-bottom: var(--space-5);
}

.section-head--center {
  margin-inline: auto;
  text-align: center;
}

.section-head__title {
  margin-top: var(--space-2);
  font-family: var(--font-display);
  font-size: var(--text-xl);
  line-height: 1.08;
}

.section-head__lead {
  margin-top: var(--space-2);
  font-size: var(--text-md);
  line-height: 1.5;
  color: var(--on-wall-muted);
}

.surface-night .section-head__lead {
  color: var(--on-night-muted);
}

.surface-parchment .section-head__lead {
  color: var(--ink-muted);
}

/* ---------- Footer ---------- */

.site-footer {
  padding-block: var(--space-6) var(--space-4);
  border-top: 1px solid var(--rule-night);
}

.site-footer__inner {
  display: grid;
  gap: var(--space-5);
}

.site-footer .brand {
  display: inline-block;
}

.site-footer .brand__logo {
  height: 56px;
}

.motto {
  margin-top: var(--space-3);
  font-size: var(--text-sm);
  color: var(--on-night-muted);
}

.motto [lang="la"] {
  display: block;
  font-size: var(--text-md);
  font-style: italic;
  color: var(--plaster);
}

.footer-nav {
  display: grid;
  grid-template-columns: repeat(2, auto);
  justify-content: start;
  gap: var(--space-4) var(--space-5);
}

.footer-nav__title {
  margin-bottom: 0.75rem;
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}

.footer-nav ul {
  list-style: none;
  padding: 0;
  font-family: var(--font-ui);
  font-size: var(--text-sm);
}

.footer-nav a {
  display: inline-block;
  padding-block: 0.4rem;
  color: var(--on-night-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-nav a:hover {
  color: var(--plaster);
}

.site-footer__legal [lang="la"] {
  font-family: var(--font-text);
  font-size: var(--text-sm);
  font-style: italic;
}

.site-footer__legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding-top: var(--space-3);
  border-top: 1px solid var(--rule-night);
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  color: var(--on-night-muted);
}

@media (min-width: 48rem) {
  .site-footer__inner {
    grid-template-columns: 1fr auto;
    align-items: start;
  }

  .site-footer__legal {
    grid-column: 1 / -1;
  }
}
