/* Shared across index, about and contact: site footer, menu button and menu drawer */
:root { --serif: "Sora", "Segoe UI", system-ui, sans-serif; --hud: "Barlow Semi Condensed", "Segoe UI", system-ui, sans-serif; }

/* ============ SITE FOOTER ============
   A full footer below the last chapter; the page snaps to it as one more stop. It keeps its own dark palette so it
   reads as solid ground under the 3D scene in both render modes */
.site-foot {
  --f-bg: #0b100d; --f-bg2: #111915; --f-text: #e9e5db; --f-dim: rgba(233, 229, 219, .62); --f-line: rgba(233, 229, 219, .12);
  --f-accent: #5fd08a;
  position: relative; z-index: 17; min-height: 62vh; box-sizing: border-box;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: clamp(48px, 8vh, 88px) 6vw 0;
  background: radial-gradient(120% 90% at 0% 0%, rgba(95, 208, 138, .10), transparent 55%), linear-gradient(180deg, var(--f-bg2), var(--f-bg));
  color: var(--f-text); font-family: var(--hud); font-size: 17px; line-height: 1.55;
  border-top: 1px solid var(--f-line);
}
.site-foot::before { /* accent hairline along the top edge */
  content: ""; position: absolute; left: 6vw; top: -1px; width: 140px; height: 3px; background: var(--f-accent);
}
.sf-grid { display: grid; grid-template-columns: 1.75fr 1fr 1.3fr .8fr; gap: clamp(28px, 4vw, 64px); align-items: start; }
.sf-logo { display: flex; align-items: center; gap: 16px; }
.sf-logo .emblem { width: 54px; height: 54px; color: var(--f-accent); flex: none; }
.sf-logo b { display: block; font-family: var(--serif); font-weight: 800; font-size: clamp(20px, 1.75vw, 28px); letter-spacing: .05em; line-height: 1.1; white-space: nowrap; }
.sf-logo span { display: block; font-family: var(--serif); font-size: 13px; letter-spacing: .34em; color: var(--f-accent); margin-top: 6px; }
.sf-tag { font-family: var(--serif); font-size: 17px; margin: 26px 0 10px; color: var(--f-text); }
.sf-desc { margin: 0; color: var(--f-dim); max-width: 38ch; }
.site-foot h4 {
  margin: 6px 0 22px; font-family: var(--serif); font-weight: 700; font-size: 13px; letter-spacing: .28em; text-transform: uppercase;
  color: var(--f-accent);
}
.sf-item { display: flex; gap: 14px; align-items: flex-start; color: var(--f-text); text-decoration: none; margin-bottom: 20px; }
.sf-item svg { width: 20px; height: 20px; flex: none; margin-top: 4px; padding: 9px; border-radius: 50%; color: var(--f-accent);
  background: rgba(95, 208, 138, .1); border: 1px solid rgba(95, 208, 138, .25); box-sizing: content-box; transition: background .3s, color .3s; }
.sf-item span { font-size: 19px; font-weight: 600; letter-spacing: .02em; word-break: break-word; }
.sf-item small { display: block; font-size: 12px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: var(--f-dim); }
a.sf-item:hover span { color: var(--f-accent); }
a.sf-item:hover svg { background: var(--f-accent); color: var(--f-bg); }
.sf-item address { font-style: normal; font-size: 17px; color: var(--f-text); line-height: 1.6; }
.sf-link {
  display: block; width: fit-content; padding: 0; margin: 0 0 14px; background: none; border: 0; cursor: pointer;
  font: inherit; font-size: 17px; color: var(--f-dim); text-decoration: none; text-align: left; transition: color .25s, transform .25s;
}
.sf-link:hover { color: var(--f-text); transform: translateX(4px); }
.sf-bottom {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-top: clamp(40px, 7vh, 72px); padding: 22px 0 26px; border-top: 1px solid var(--f-line);
  font-size: 14px; letter-spacing: .08em; color: var(--f-dim);
}
.sf-bottom a { color: var(--f-accent); text-decoration: none; font-weight: 700; }
.sf-bottom a:hover { text-decoration: underline; }
.site-foot a:focus-visible, .site-foot button:focus-visible { outline: 2px solid var(--f-accent); outline-offset: 4px; }

/* while the footer is up, the bottom HUD and the sequence rail get out of its way */
body.in-foot .views, body.in-foot .readout, body.in-foot .hud-corner.bl, body.in-foot .hud-corner.br,
body.in-foot .seq-nav, body.in-foot .proc-stage { opacity: 0 !important; pointer-events: none !important; }
body.roam .site-foot { display: none; }

@media (max-width: 1100px) {
  /* brand on its own row, then the three columns side by side: keeps the footer close to one screen tall */
  .sf-grid { grid-template-columns: 1fr 1fr .8fr; row-gap: 32px; }
  .sf-brand { grid-column: 1 / -1; }
  .sf-tag { margin-top: 18px; }
}
@media (max-width: 1100px) and (max-height: 800px) {
  .site-foot { padding-top: 40px; min-height: 0; }
  .sf-bottom { margin-top: 28px; }
}
@media (max-width: 640px) {
  .site-foot { padding: 44px 20px 0; font-size: 16px; min-height: 0; }
  .sf-grid { grid-template-columns: 1fr; gap: 34px; }
  .sf-item span { font-size: 17px; }
  .sf-logo b { white-space: normal; }
  .sf-bottom { flex-direction: column; gap: 6px; font-size: 13px; }
}

/* ============ MENU BUTTON + DRAWER (shared by every page) ============ */
.menu-btn {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  border: 1px solid var(--accent); background: var(--accent); color: #fff;
  font: 700 12px/1 var(--hud); letter-spacing: .24em; text-transform: uppercase; padding: 9px 14px 9px 12px;
  transition: filter .3s, background .3s;
}
.menu-btn:hover { filter: brightness(1.12); }
.menu-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.mb-bars { display: grid; gap: 3px; width: 16px; }
.mb-bars i { display: block; height: 2px; background: currentColor; transition: transform .35s var(--ease, ease), opacity .25s; }
.mb-bars i:nth-child(2) { width: 70%; justify-self: end; }

html.menu-open, html.menu-open body { overflow: hidden; }
.menu-drawer { position: fixed; inset: 0; z-index: 90; visibility: hidden; pointer-events: none; }
.menu-drawer.open { visibility: visible; pointer-events: auto; }
.md-backdrop { position: absolute; inset: 0; background: rgba(5, 9, 7, .55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  opacity: 0; transition: opacity .45s; }
.menu-drawer.open .md-backdrop { opacity: 1; }
.md-panel {
  --m-bg: #0b100d; --m-text: #e9e5db; --m-dim: rgba(233, 229, 219, .6); --m-line: rgba(233, 229, 219, .12); --m-accent: #5fd08a;
  position: absolute; top: 0; right: 0; bottom: 0; width: min(460px, 100vw); box-sizing: border-box;
  display: flex; flex-direction: column; padding: 26px 40px 34px;
  background: radial-gradient(110% 60% at 100% 0%, rgba(95, 208, 138, .14), transparent 60%), var(--m-bg);
  color: var(--m-text); font-family: var(--hud); border-left: 1px solid var(--m-line);
  transform: translateX(102%); transition: transform .6s cubic-bezier(.2, .8, .2, 1);
  overflow-y: auto;
}
.menu-drawer.open .md-panel { transform: none; }
.md-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 22px; border-bottom: 1px solid var(--m-line); }
.md-head span { font-size: 12px; font-weight: 700; letter-spacing: .32em; text-transform: uppercase; color: var(--m-dim); }
.md-close { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--m-line); background: none; color: var(--m-text);
  font-size: 24px; line-height: 1; cursor: pointer; transition: background .3s, color .3s, transform .4s; }
.md-close:hover { background: var(--m-accent); color: var(--m-bg); transform: rotate(90deg); }
.md-links { list-style: none; margin: 26px 0 auto; padding: 0; }
.md-links li { opacity: 0; transform: translateX(28px); transition: opacity .5s, transform .6s cubic-bezier(.2, .8, .2, 1); }
.menu-drawer.open .md-links li { opacity: 1; transform: none; }
.menu-drawer.open .md-links li:nth-child(1) { transition-delay: .12s; }
.menu-drawer.open .md-links li:nth-child(2) { transition-delay: .18s; }
.menu-drawer.open .md-links li:nth-child(3) { transition-delay: .24s; }
.menu-drawer.open .md-links li:nth-child(4) { transition-delay: .30s; }
.md-links a {
  display: flex; align-items: baseline; gap: 18px; padding: 16px 0; border-bottom: 1px solid var(--m-line);
  color: var(--m-text); text-decoration: none; font-family: var(--serif); font-weight: 700; font-size: clamp(26px, 4.2vh, 34px);
  letter-spacing: .01em; transition: color .25s, padding-left .35s cubic-bezier(.2, .8, .2, 1);
}
.md-links a i { font: 600 13px var(--hud); font-style: normal; letter-spacing: .2em; color: var(--m-accent); min-width: 22px; }
.md-links a:hover, .md-links a:focus-visible { color: var(--m-accent); padding-left: 8px; outline: none; }
.md-links a[aria-current="page"] { color: var(--m-accent); }
.md-links a[aria-current="page"]::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--m-accent); margin-left: auto; align-self: center; }
.md-foot { margin-top: 34px; display: grid; gap: 12px; font-size: 16px; }
.md-foot small { font-size: 12px; font-weight: 700; letter-spacing: .28em; text-transform: uppercase; color: var(--m-dim); }
.md-foot a { color: var(--m-text); text-decoration: none; font-weight: 600; }
.md-foot a:hover { color: var(--m-accent); }
.md-wa {
  display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 8px; padding: 14px 18px;
  background: #25d366; color: #06230f !important; font-weight: 700 !important; letter-spacing: .14em; text-transform: uppercase; font-size: 14px;
  transition: filter .25s;
}
.md-wa:hover { filter: brightness(1.08); }
.md-wa svg { width: 20px; height: 20px; }
@media (max-width: 440px) {
  .menu-btn { padding: 8px 10px; gap: 7px; letter-spacing: .14em; font-size: 11px; }
  .md-panel { padding: 20px 24px 28px; }
}
@media (prefers-reduced-motion: reduce) {
  .md-panel, .md-links li, .md-backdrop { transition: none; }
}