/* layout.css ============================================================
   Base elements and the frame: header, navigation, footer.
   ====================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h-stuck) + 16px);
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--type-body);
  font-weight: 300;
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg, video, iframe { display: block; max-width: 100%; }
img { height: auto; }

h1, h2, h3, h4 {
  margin: 0 0 .5em;
  font-family: var(--font-display);
  color: var(--ink);
  text-wrap: balance;
  overflow-wrap: break-word;
}
h1 { font-size: var(--type-display); font-weight: 800; line-height: var(--leading-tight); letter-spacing: -.02em; }
h2 { font-size: var(--type-h2); font-weight: 800; line-height: var(--leading-heading); letter-spacing: -.015em; }
h3, h4 { font-size: var(--type-subhead); font-weight: 700; line-height: 1.25; }
p, li { margin: 0 0 1em; }
p { text-wrap: pretty; }
a { color: inherit; }
strong, b { font-weight: 700; }
em { font-style: italic; }

::selection { background: var(--gold); color: var(--ink); }
:focus-visible { outline: 3px solid var(--coral); outline-offset: 3px; border-radius: 4px; }

.skip-link {
  position: absolute; left: 16px; top: -64px; z-index: 300;
  padding: 12px 18px; border-radius: var(--pill);
  background: var(--ink); color: var(--cream);
  font-family: var(--font-display); font-weight: 800; text-decoration: none;
  transition: top var(--dur) var(--ease);
}
.skip-link:focus { top: 12px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.wrap { width: 100%; max-width: calc(var(--maxw) + var(--gut) * 2); margin-inline: auto; padding-inline: var(--gut); }
.wrap--wide { max-width: calc(var(--maxw-wide) + var(--gut) * 2); }

/* ---------------------------------------------------------------- header */
.site-head {
  position: sticky; top: 0; z-index: 100;
  background: var(--cream);
  border-bottom: var(--stroke) solid transparent;
  transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.site-head.is-stuck { border-bottom-color: var(--ink); }
.head-row {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px;
  min-height: var(--header-h); transition: min-height var(--dur) var(--ease);
}
.is-stuck .head-row { min-height: var(--header-h-stuck); }
.brandmark { display: inline-flex; justify-content: center; padding: 6px 10px; text-decoration: none; }
.brandmark img { height: 80px; width: auto; transition: height var(--dur) var(--ease), transform var(--dur) var(--spring); }
.brandmark:hover img { transform: rotate(-3deg) scale(1.03); }
.is-stuck .brandmark img { height: 56px; }

.nav-list { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-list--left { justify-content: flex-end; }
.nav-list--right { justify-content: flex-start; }
.nav-list li { margin: 0; position: relative; }
.nav-link, .sub-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  min-block-size: 44px; padding: 0 12px;
  border: 0; border-radius: var(--pill); background: none;
  font-family: var(--font-display); font-size: .875rem; font-weight: 800; letter-spacing: .01em;
  color: var(--ink); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color var(--dur) var(--ease), transform var(--dur) var(--spring);
}
.nav-link:hover, .sub-toggle:hover { background: var(--mint); }
.nav-link[aria-current="page"], .has-sub.is-current > .sub-toggle { background: var(--maize); }
.sub-toggle svg { width: 12px; height: 12px; transition: transform var(--dur) var(--ease); }

.sub {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 250px;
  margin: 0; padding: 10px; list-style: none;
  background: #fff; border: var(--stroke) solid var(--ink); border-radius: 20px; box-shadow: var(--pop);
  opacity: 0; visibility: hidden; transform: translateY(-6px) rotate(-1deg);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--spring), visibility 0s linear var(--dur);
}
.sub a { display: flex; flex-direction: column; padding: 10px 14px; border-radius: 14px; text-decoration: none; font-family: var(--font-display); font-weight: 800; }
.sub a span { font-family: var(--font-body); font-size: 13px; font-weight: 300; color: var(--ink-soft); }
.sub li:first-child a:hover, .sub li:first-child a[aria-current="page"] { background: var(--maize); }
.sub li:last-child a:hover, .sub li:last-child a[aria-current="page"] { background: var(--coral-soft); }
.has-sub.is-open .sub, .has-sub:focus-within .sub { opacity: 1; visibility: visible; transform: none; transition: opacity var(--dur) var(--ease), transform var(--dur) var(--spring), visibility 0s; }
.has-sub.is-open .sub-toggle svg { transform: rotate(180deg); }
@media (hover: hover) and (min-width: 1081px) {
  .has-sub:hover .sub { opacity: 1; visibility: visible; transform: none; transition: opacity var(--dur) var(--ease), transform var(--dur) var(--spring), visibility 0s; }
  .has-sub::before { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 10px; }
}

.nav-toggle {
  display: none; justify-self: end; align-items: center; justify-content: center;
  width: 50px; height: 50px; margin-right: -4px;
  border: var(--stroke) solid var(--ink); border-radius: 50%;
  background: var(--maize); color: var(--ink); cursor: pointer; box-shadow: 3px 3px 0 var(--ink);
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  display: block; width: 20px; height: 2.5px; border-radius: 2px; background: currentColor; position: relative;
  transition: transform var(--dur) var(--ease), background-color var(--dur);
}
.nav-toggle span::before, .nav-toggle span::after { content: ""; position: absolute; left: 0; }
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }
.nav-open .nav-toggle span { background: transparent; }
.nav-open .nav-toggle span::before { transform: translateY(6px) rotate(45deg); }
.nav-open .nav-toggle span::after { transform: translateY(-6px) rotate(-45deg); }

.drawer { display: none; }

@media (max-width: 1240px) { .nav-link, .sub-toggle { padding: 0 9px; font-size: .8125rem; } }

@media (max-width: 1080px) {
  .head-row { grid-template-columns: auto 1fr auto; }
  .head-row > nav, .nav-list--left, .nav-list--right { display: none; }
  .brandmark { grid-column: 1; justify-content: flex-start; padding-left: 0; }
  .brandmark img { height: 54px; }
  .is-stuck .brandmark img { height: 46px; }
  .nav-toggle { display: inline-flex; grid-column: 3; }
  .drawer {
    display: block; position: fixed; inset: var(--header-h-stuck) 0 0 0; z-index: 99;
    padding: 12px var(--gut) 40px; background: var(--maize); overflow-y: auto; overscroll-behavior: contain;
    visibility: hidden; opacity: 0; transform: translateY(-10px);
    transition: opacity var(--dur) var(--ease), transform var(--dur) var(--spring), visibility 0s linear var(--dur);
  }
  .nav-open .drawer { visibility: visible; opacity: 1; transform: none; transition: opacity var(--dur) var(--ease), transform var(--dur) var(--spring), visibility 0s; }
  .drawer ul { list-style: none; margin: 0; padding: 0; }
  .drawer li { margin: 0; border-bottom: var(--stroke) solid rgba(18, 71, 52, .2); }
  .drawer a { display: flex; align-items: center; justify-content: space-between; min-block-size: 60px; font-family: var(--font-display); font-size: 1.5rem; font-weight: 800; text-decoration: none; }
  .drawer a[aria-current="page"]::after { content: ""; width: 14px; height: 14px; border-radius: 50%; background: var(--coral); border: var(--stroke) solid var(--ink); }
  .drawer .drawer-sub a { min-block-size: 48px; padding-left: 20px; font-size: 1.15rem; }
  .drawer .btn { margin-top: 28px; width: 100%; justify-content: center; background: #fff; }
  .drawer .drawer-contact { margin-top: 24px; font-size: 14px; }
  body.nav-open { overflow: hidden; }
}

/* ---------------------------------------------------------------- footer */
.site-foot {
  position: relative;
  background: var(--msu-green);
  color: var(--on-dark-soft);
  padding-block: var(--space-8) var(--space-5);
  font-size: var(--type-small);
}
.site-foot a { color: var(--cream); }
.foot-top { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 24px 48px; padding-bottom: var(--space-6); }
.foot-top img { height: 120px; width: auto; }
.foot-top .foot-line { max-width: 48ch; margin: 0; font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; line-height: 1.4; color: var(--cream); }
.foot-grid { display: grid; grid-template-columns: repeat(4, 1fr); border-top: var(--stroke) solid rgba(255, 240, 220, .25); }
.foot-grid > div { padding: var(--space-5) var(--space-4) var(--space-4) 0; min-width: 0; }
.foot-grid > div + div { padding-left: var(--space-4); border-left: 1px solid rgba(255, 240, 220, .2); }
.foot-grid h2 { font-size: var(--type-caption); font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--maize); margin-bottom: 14px; }
.foot-grid address { font-style: normal; }
.foot-grid address p { margin-bottom: 8px; }
.foot-grid ul { list-style: none; margin: 0; padding: 0; }
.foot-grid li { margin: 0; }
.foot-grid a { display: inline-flex; align-items: center; min-block-size: 32px; text-decoration: none; overflow-wrap: anywhere; }
.foot-grid a:hover { text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.foot-block + .foot-block { margin-top: 18px; }

.social { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; margin: 0; padding: 0; }
.social a {
  display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 50%;
  background: var(--maize); color: var(--ink); border: var(--stroke) solid var(--maize);
  transition: transform var(--dur) var(--spring), background-color var(--dur);
}
.social a:hover { transform: translateY(-3px) rotate(-8deg); background: var(--gold); }
.social svg { width: 19px; height: 19px; }
.foot-social-label { margin: 0 0 8px; font-family: var(--font-display); font-weight: 800; color: var(--maize); }

.foot-legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; margin-top: var(--space-5); padding-top: var(--space-4); border-top: 1px solid rgba(255, 240, 220, .2); font-size: 13px; }
.foot-legal p { margin: 0; }

@media (max-width: 980px) {
  .foot-top { grid-template-columns: auto 1fr; }
  .foot-top > div:last-child { grid-column: 1 / -1; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-grid > div:nth-child(3) { padding-left: 0; border-left: 0; }
  .foot-grid > div:nth-child(n+3) { border-top: 1px solid rgba(255, 240, 220, .2); }
}
@media (max-width: 560px) {
  .foot-top { grid-template-columns: 1fr; }
  .foot-top img { height: 100px; }
  .foot-grid { grid-template-columns: 1fr; }
  .foot-grid > div, .foot-grid > div + div { padding-left: 0; border-left: 0; }
  .foot-grid > div + div { border-top: 1px solid rgba(255, 240, 220, .2); }
}
