/* ==========================================================================
   RADIANTGLOOM — 02 LAYOUT
   Paper header, hard rules, document heads, section rhythm, footer.
   ========================================================================== */

/* --------------------------------------------------------------- header */
.rg-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 90;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: var(--paper);
  color: var(--ink);
  border-bottom: 1px solid var(--ink);
  transition: height 0.2s var(--ease);
}

.rg-header__inner {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1.5rem;
}

.rg-header.is-stuck {
  height: 62px;
}

/* brand */
.rg-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  justify-self: start;
  line-height: 1;
}

.rg-brand__mark {
  display: block;
  width: 23px;
  height: 23px;
  flex: none;
  background-color: currentColor;
  -webkit-mask: url("../img/logo-mark.png") no-repeat center / contain;
  mask: url("../img/logo-mark.png") no-repeat center / contain;
  transition: background-color 0.2s var(--ease);
}

.rg-brand:hover .rg-brand__mark {
  background-color: var(--ink);
}

.rg-brand__word {
  font-family: var(--display);
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1;
  padding-top: 1px;
}

/* The wordmark stays upright in both halves — no italic, no tilt. */
.rg-brand__gloom {
  font-style: normal;
}

/* nav */
.rg-nav {
  justify-self: center;
}

.rg-nav__list {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rg-nav__list a {
  display: block;
  padding: 0.5rem 0.65rem;
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink);
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}

.rg-nav__list a:hover,
.rg-nav__list a:focus-visible {
  background: var(--ink);
  color: var(--paper);
  outline: none;
}

.rg-nav__list .current-menu-item > a {
  background: var(--lime);
  color: var(--ink);
}

/* header actions */
.rg-header__actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.rg-header .rg-btn {
  min-height: 38px;
  padding: 0 0.9em;
  font-size: 0.6rem;
}

.rg-burger {
  display: none;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-direction: column;
  border: 1px solid var(--ink);
  color: var(--ink);
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}

.rg-burger span {
  display: block;
  width: 16px;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.2s var(--ease);
}

body.rg-menu-open .rg-burger span:nth-child(1) {
  transform: translateY(3.25px) rotate(45deg);
}

body.rg-menu-open .rg-burger span:nth-child(2) {
  transform: translateY(-3.25px) rotate(-45deg);
}

body.rg-menu-open .rg-burger {
  color: var(--paper);
  border-color: var(--paper);
}

/* mobile overlay */
.rg-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: var(--ink);
  color: var(--paper);
  padding: calc(var(--header-h) + 1.5rem) var(--gutter) 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s var(--ease), visibility 0.25s;
}

body.rg-menu-open .rg-overlay {
  opacity: 1;
  visibility: visible;
}

body.rg-menu-open {
  overflow: hidden;
}

.rg-overlay__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  counter-reset: rg-menu;
  border-top: 1px solid var(--line-ink);
}

.rg-overlay__list > li {
  counter-increment: rg-menu;
}

.rg-overlay__list a {
  position: relative;
  font-family: var(--display);
  font-size: clamp(2.1rem, 11vw, 3.4rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  padding: 0.55em 0 0.55em 2.4em;
  border-bottom: 1px solid var(--line-ink);
  display: block;
  transition: color 0.15s var(--ease), background-color 0.15s var(--ease);
}

.rg-overlay__list a::before {
  content: "0" counter(rg-menu);
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  color: var(--lime);
}

.rg-overlay__list a:hover {
  background: var(--lime);
  color: var(--ink);
}

.rg-overlay__list a:hover::before {
  color: var(--ink);
}

.rg-overlay__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: center;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--grey-ink);
  border-top: 1px solid var(--line-ink);
  padding-top: 1.1rem;
}

.rg-overlay__foot a:hover {
  color: var(--lime);
}

/* --------------------------------------------------------------- sections */
.rg-sec {
  position: relative;
  padding-block: var(--sec-y);
  overflow: hidden;
}

.rg-sec--tight {
  padding-block: clamp(2.5rem, 5vw, 4.5rem);
}

.rg-sec--flush {
  padding-block: 0;
}

.rg-sec--paper {
  background: var(--paper);
  color: var(--on-paper);
}

.rg-sec--ink {
  background: var(--ink);
  color: var(--on-ink);
}

/* section head: rule + eyebrow + title + optional aside */
.rg-shead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 24rem);
  align-items: end;
  gap: clamp(1.5rem, 4vw, 4rem);
  margin-bottom: clamp(2rem, 4vw, 3.5rem);
  padding-bottom: clamp(1.5rem, 3vw, 2.25rem);
  border-bottom: 1px solid var(--line-paper);
}

.rg-sec--ink .rg-shead {
  border-bottom-color: var(--line-ink);
}

.rg-shead__t {
  position: relative;
  max-width: 24ch;
}

.rg-shead__t h2 {
  margin-top: 0.55rem;
  font-size: var(--fs-700);
}

.rg-shead__num {
  display: block;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  color: var(--grey);
  margin-bottom: 0.4rem;
}

.rg-shead__aside {
  text-align: right;
}

.rg-shead__aside p {
  color: var(--on-paper-dim);
  font-size: 0.92rem;
  line-height: 1.6;
  margin: 0;
  max-width: 34ch;
  margin-left: auto;
}

.rg-sec--ink .rg-shead__aside p {
  color: var(--on-ink-dim);
}

@media (max-width: 900px) {
  .rg-shead {
    grid-template-columns: 1fr;
    align-items: start;
  }
  .rg-shead__aside {
    text-align: left;
  }
  .rg-shead__aside p {
    margin-left: 0;
  }
}

/* ------------------------------------------------------- interior page head */
.rg-head {
  position: relative;
  padding-top: calc(var(--header-h) + clamp(3rem, 6vw, 5.5rem));
  padding-bottom: clamp(2.25rem, 4vw, 3.5rem);
  background: var(--paper);
  color: var(--on-paper);
  border-bottom: 1px solid var(--ink);
  overflow: hidden;
}

.rg-head--paper {
  background: var(--paper);
  color: var(--on-paper);
}

.rg-head__crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--grey);
  margin-bottom: clamp(2rem, 4vw, 3.5rem);
}

.rg-head__crumbs a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.rg-head__crumbs a:hover {
  background: var(--lime);
  color: var(--ink);
  text-decoration: none;
}

.rg-head h1 {
  font-size: var(--fs-850);
  max-width: 20ch;
}

.rg-head__sub {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.5rem;
  margin-top: clamp(1.5rem, 3vw, 2.5rem);
  align-items: end;
}

.rg-head__sub p {
  grid-column: 1 / span 7;
  font-size: clamp(1.02rem, 1.25vw, 1.2rem);
  line-height: 1.55;
  color: var(--on-paper-dim);
  max-width: 54ch;
  margin: 0;
}

.rg-head__side {
  grid-column: 9 / span 4;
  justify-self: end;
  text-align: right;
}

@media (max-width: 900px) {
  .rg-head__sub {
    grid-template-columns: 1fr;
  }
  .rg-head__sub p,
  .rg-head__side {
    grid-column: 1;
    justify-self: start;
    text-align: left;
  }
}

/* --------------------------------------------------------------- footer */
.rg-footer {
  background: var(--ink);
  color: var(--on-ink);
  padding-top: clamp(3rem, 6vw, 5.5rem);
  border-top: 1px solid var(--ink);
  overflow: hidden;
}

.rg-footer__top {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: clamp(1.25rem, 3vw, 3rem);
  padding-bottom: clamp(2.5rem, 5vw, 4.5rem);
}

.rg-footer__top > * {
  padding-left: clamp(0.75rem, 1.5vw, 1.25rem);
  border-left: 1px solid var(--line-ink);
}

.rg-footer__brand {
  padding-left: 0;
  border-left: 0;
}

.rg-footer__brand .rg-brand {
  color: var(--paper);
}

.rg-footer__brand p {
  margin-top: 1.1rem;
  max-width: 34ch;
  color: var(--on-ink-dim);
  font-size: 0.92rem;
  line-height: 1.6;
}

.rg-footer__col h6 {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--grey-ink);
  margin: 0 0 1rem;
}

.rg-footer__col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.rg-footer__col a,
.rg-footer__col address {
  font-style: normal;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--on-ink);
}

.rg-footer__col a:hover {
  background: var(--lime);
  color: var(--ink);
}

.rg-footer__word {
  display: block;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.4rem, 13.2vw, 12.5rem);
  line-height: 0.8;
  letter-spacing: -0.055em;
  color: var(--paper);
  padding-bottom: 0.06em;
  white-space: nowrap;
  border-top: 1px solid var(--line-ink);
  padding-top: 0.18em;
}

.rg-footer__word i {
  font-style: normal;
  color: var(--lime);
}

.rg-footer__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding-block: 1.25rem;
  border-top: 1px solid var(--line-ink);
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--grey-ink);
}

.rg-footer__bar a:hover {
  color: var(--lime);
}

.rg-footer__legal ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.rg-top {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.rg-top svg {
  width: 11px;
  height: 11px;
}

@media (max-width: 900px) {
  .rg-footer__top {
    grid-template-columns: 1fr 1fr;
  }
  .rg-footer__brand {
    grid-column: 1 / -1;
  }
  .rg-footer__top > * {
    padding-left: 0;
    border-left: 0;
    padding-top: 1.25rem;
    border-top: 1px solid var(--line-ink);
  }
  .rg-footer__brand {
    padding-top: 0;
    border-top: 0;
  }
  .rg-burger {
    display: flex;
  }
  .rg-nav {
    display: none;
  }
}

@media (max-width: 560px) {
  .rg-header__actions .rg-btn {
    display: none;
  }
  .rg-footer__top {
    grid-template-columns: 1fr;
  }
}
