/*
  Universal R3DMYST shell
  Shared by the main site and all project pages.
  Controls header/footer structure, typography and interaction only.
*/

:root {
  --shell-page-pad: clamp(1.5rem, 4vw, 4rem);
  --shell-accent: #a00800;

  /* Defaults only; each page overrides these in its own style.css. */
  --shell-header-bg: rgba(243, 243, 240, 0.94);
  --shell-header-text: #090909;
  --shell-header-muted: #4e4e4b;
  --shell-header-line: #d8d8d3;

  --shell-footer-bg: #f3f3f0;
  --shell-footer-text: #252525;
  --shell-footer-muted: #626262;
  --shell-footer-line: rgba(0, 0, 0, 0.06);
}

.shell-header,
.shell-footer,
.shell-header button,
.shell-footer button {
  font-family: Arial, Helvetica, sans-serif;
}

.shell-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 72px;
  min-height: 72px;
  padding: 0 var(--shell-page-pad);
  display: grid;
  align-items: center;
  gap: 2rem;
  color: var(--shell-header-text);
  background: var(--shell-header-bg);
  border-bottom: 1px solid var(--shell-header-line);
  backdrop-filter: blur(14px);
}

.shell-header--main {
  grid-template-columns: auto 1fr;
}

.shell-header--project {
  grid-template-columns: minmax(190px, 1fr) auto minmax(190px, 1fr);
}

.shell-brand {
  width: 40px;
  height: 40px;
  display: block;
  flex: 0 0 auto;
}

.shell-brand img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.shell-project-title {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--shell-header-text);
  background: transparent;
  border: 0;
  padding: 0;
  font-size: 0.84rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}

.shell-project-logo {
  display: block;
  width: auto;
  height: auto;
  max-height: 38px;
  object-fit: contain;
  object-position: center;
}

.shell-project-logo--mrtn {
  max-width: 112px;
}

.shell-project-logo--eh {
  max-width: 190px;
}

.shell-back-link {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--shell-header-muted);
  font-size: 0.66rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: color 180ms ease, transform 180ms ease;
}

.shell-back-link::before {
  content: "";
  width: 12px;
  height: 8px;
  flex: 0 0 12px;
  background: currentColor;
  clip-path: polygon(
    0 50%,
    42% 0,
    42% 36%,
    100% 36%,
    100% 64%,
    42% 64%,
    42% 100%
  );
}

.shell-back-link:hover,
.shell-back-link:focus-visible {
  color: var(--shell-accent);
  transform: translateX(-3px);
}

.shell-nav {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.4vw, 2rem);
}

.shell-nav a,
.shell-nav button {
  position: relative;
  flex: 0 0 auto;
  padding: 0.5rem 0;
  color: var(--shell-header-muted);
  background: transparent;
  border: 0;
  font-size: 0.66rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: color 180ms ease;
}

.shell-nav a::after,
.shell-nav button::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 0;
  height: 2px;
  background: var(--shell-accent);
  transition: right 180ms ease;
}

/* Deliberately no permanent active underline. */
.shell-nav a:hover,
.shell-nav a:focus-visible,
.shell-nav button:hover,
.shell-nav button:focus-visible,
.shell-nav .active {
  color: var(--shell-header-text);
}

.shell-nav a:hover::after,
.shell-nav a:focus-visible::after,
.shell-nav button:hover::after,
.shell-nav button:focus-visible::after {
  right: 0;
}


/* =========================================================
   Universal large footer
   ========================================================= */

.shell-footer {
  width: 100%;
  padding: clamp(4.5rem, 8vw, 7rem) var(--shell-page-pad) 1.5rem;
  color: #f4f1ed;
  background: #0d0d0f;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-family: Arial, Helvetica, sans-serif;
  text-transform: none;
  letter-spacing: normal;
}

.shell-footer-inner {
  width: min(100%, 1480px);
  margin: 0 auto;
}

.shell-footer-main {
  display: grid;
  grid-template-columns: minmax(260px, 1.5fr) repeat(2, minmax(150px, .65fr));
  gap: clamp(3rem, 7vw, 8rem);
  align-items: start;
  padding-bottom: clamp(4rem, 7vw, 6rem);
}

.shell-footer-brand {
  max-width: 520px;
}

.shell-footer-logo {
  display: block;
  width: auto;
  max-width: min(320px, 72vw);
  max-height: 78px;
  margin-bottom: 1.75rem;
  object-fit: contain;
  object-position: left center;
  filter: brightness(0) invert(1);
}

.shell-footer-logo--mark {
  width: 76px;
  height: 76px;
}

.shell-footer-description {
  max-width: 460px;
  margin: 0;
  color: rgba(255, 255, 255, 0.58);
  font-size: clamp(.92rem, 1.2vw, 1.04rem);
  line-height: 1.75;
}

.shell-footer-column {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .85rem;
}

.shell-footer-heading {
  position: relative;
  margin: 0 0 .85rem;
  padding-top: 1rem;
  color: var(--shell-accent);
  font-size: .66rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.shell-footer-heading::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 28px;
  height: 2px;
  background: currentColor;
}

.shell-footer a,
.shell-footer button {
  padding: 0;
  color: rgba(255, 255, 255, 0.78);
  background: transparent;
  border: 0;
  font: inherit;
  font-size: .88rem;
  line-height: 1.5;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: color 180ms ease, transform 180ms ease;
}

.shell-footer a:hover,
.shell-footer a:focus-visible,
.shell-footer button:hover,
.shell-footer button:focus-visible {
  color: var(--shell-accent);
  transform: translateX(3px);
}

.shell-footer-bottom {
  min-height: 68px;
  padding-top: 1.5rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.shell-footer-credit {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem 1.5rem;
  color: rgba(255, 255, 255, 0.42);
  font-size: .68rem;
  font-weight: 800;
  line-height: 1.5;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.shell-footer-credit strong {
  color: rgba(255, 255, 255, 0.72);
}

.shell-footer-utility {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 1rem 2rem;
}

.shell-footer-utility a,
.shell-footer-utility button {
  color: rgba(255, 255, 255, 0.62);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

body.reading .shell-footer {
  display: none;
}

@media (max-width: 900px) {
  .shell-footer-main {
    grid-template-columns: 1fr 1fr;
  }

  .shell-footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .shell-footer {
    padding-top: 4rem;
  }

  .shell-footer-main {
    grid-template-columns: 1fr;
    gap: 2.75rem;
    padding-bottom: 3.5rem;
  }

  .shell-footer-brand {
    grid-column: auto;
  }

  .shell-footer-logo {
    max-width: min(250px, 70vw);
    max-height: 64px;
  }

  .shell-footer-bottom {
    grid-template-columns: 1fr;
  }

  .shell-footer-utility {
    justify-content: flex-start;
  }
}
