/* Header stays on top */
.site-header {
  display: flex;
  align-items: center;
  padding: var(--space-4) 0;
  position: sticky;
  top: 0;
  z-index: 100;
  background: transparent;
  color: var(--text);
  /* ensure logo/svg uses correct currentColor */
}

/* Ensure page actually reflects the CSS variable theme */
html,
body {
  background: var(--bg);
  color: var(--text);
}

.logo {
  margin-right: auto;
}

.logo svg,
.logo img,
.logo-img {
  height: 32px;
  width: auto;
  display: block;
}

.logo svg {
  fill: currentColor;
}

/* Only invert raster logos, not SVGs (SVG already follows currentColor) */
body.menu-open .logo img,
body.menu-open .logo-img {
  filter: invert(1);
}

body.menu-open .logo svg {
  filter: none;
}

/* Menu button always visible */
.menu-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: .5rem;
  display: block;
  line-height: 0;
}

.menu-toggle .icon {
  width: 32px;
  height: 32px;
}

.menu-toggle .icon-close {
  display: none;
}

.menu-toggle[aria-expanded="true"] .icon-open {
  display: none;
}

.menu-toggle[aria-expanded="true"] .icon-close {
  display: block;
}

/* Full-screen menu overlay (nav links under header) */
.site-nav {
  position: fixed;
  inset: 0;
  z-index: 90;
  /* below header (header is 100) */
  background: var(--bg);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .35s ease, visibility 0s linear .35s;

  overflow: hidden;
  /* needed for grain pseudo-element */
}

.site-nav.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity .35s ease;
}

/* Grain layer behind nav content
.site-nav::before {
  content: "";
  position: absolute;
  inset: -10%;
  pointer-events: none;
  z-index: 0;

  background-image: url("/assets/Film-Grain-Textures-FREE-Pack-8K/AU-FG-Texture1-8K.jpg");
  background-position: center;
  background-repeat: repeat;
  background-size: cover;

  opacity: 0.1;
}*/

/* Links are centered as a block, but left-aligned, stacked */
.site-nav ul {
  list-style: none;
  margin: 0 auto;
  max-width: 65ch;
  padding: calc(var(--header-offset, 72px) + var(--space-4)) var(--space-3) calc(var(--space-6) + 80px);
  /* extra bottom padding so fixed footer doesn't cover links */

  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  align-items: flex-start;

  position: relative;
  z-index: 1;
  /* above grain */
}

.site-nav li {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .4s ease, transform .4s ease;
}

.site-nav.open li {
  opacity: 1;
  transform: translateY(0);
}

.site-nav.open li:nth-child(1) {
  transition-delay: .05s;
}

.site-nav.open li:nth-child(2) {
  transition-delay: .1s;
}

.site-nav.open li:nth-child(3) {
  transition-delay: .15s;
}

.site-nav.open li:nth-child(4) {
  transition-delay: .2s;
}

.site-nav.open li:nth-child(5) {
  transition-delay: .25s;
}

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

/* When menu is open: whole site black + white text */
body.menu-open {
  --bg: #1a1a1a;
  --surface: #1a1a1a;
  --text: #ffffff;
  --muted: #ffffff;
  --link: #ffffff;
  --link-hover: #ffffff;
  --border: #ffffff;

  overflow: hidden;
  /* removed position: relative; to avoid stacking-context surprises */
}

body.menu-open .site-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 95;
  margin-top: 0;
  background: transparent;
  color: var(--text);
}

body.menu-open .site-footer .footer-signature {
  color: var(--text);
}

.site-footer {
  border-top: 0px solid var(--border);
  /* 1px */
  padding: var(--space-5) 0;
  margin-top: var(--space-6);
  color: var(--muted);
  font-size: .95rem;
}

body {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

.page-content {
  max-width: 65ch;
  margin: 3rem auto;
  text-align: left;
  line-height: var(--line-height);
  font-size: 1rem;
  color: var(--text);
}

.page-content-center {
  max-width: 65ch;
  margin: 3rem auto;
  text-align: left;
  line-height: 2.0;
  /* var(--line-height) */
  font-size: 1rem;
  color: var(--text);
}

.hero {
  padding: clamp(3rem, 6vw, 6rem) 0;
  display: grid;
  gap: var(--space-4);
}

.hero .btn {
  justify-self: start;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-4);
  padding: var(--space-6) 0;
}

.empty-footer {
  height: 80px;
  /* adjust as you like */
  background: transparent;
  pointer-events: none;
  /* no interactions */
}

.site-footer .footer-signature {
  margin: 0;
  font-family: "Titillium Web", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-weight: 200;
  /* ExtraLight */
  font-size: 20pt;
  letter-spacing: 0.05em;
  /* tracking ~ 50 */
  line-height: 1;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 32px;
}

.site-footer .footer-signature::after {
  content: "";
  height: 1px;
  /* 1px line */
  background: currentColor;
  /* follows text color */
  flex: 1;
  margin-right: 0px;
}

body.menu-open .site-footer .footer-signature {
  color: #ffffff;
}
