/* ==========================================================================
   LAYOUT
   The frame shared by every page.
   1. Top bar
   2. Header and main navigation
   3. Mobile navigation
   4. Sections and section headings
   5. Breadcrumbs
   6. Footer
   ========================================================================== */


/* 1. Top bar
   -------------------------------------------------------------------------- */
.topbar {
  background: var(--band);
  color: var(--on-dark-muted);
  font-size: 14px;
}
.topbar__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  min-height: 42px;
}
.topbar__links { display: flex; gap: 24px; }
.topbar__offices,
.topbar a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  color: var(--on-dark-muted);
  text-decoration: none;
}
.topbar a:hover { color: var(--on-dark); }
.topbar svg { width: 16px; height: 16px; }


/* 2. Header and main navigation
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 40;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.site-header__row {
  display: flex;
  align-items: center;
  gap: 24px;
  height: var(--header-h);
}
.site-header__logo img { height: 50px; width: auto; }
.site-header__cta { flex: none; }

.main-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}
.main-nav__group { position: relative; }
.main-nav__link {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--ink);
  font-weight: 500;
  font-size: 15px;
  text-decoration: none;
  white-space: nowrap;
}
.main-nav__link:hover, .main-nav__link[aria-current="page"] { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.main-nav__group > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  font-size: 15px;
  color: var(--ink);
  white-space: nowrap;
}
.main-nav__group > summary::-webkit-details-marker { display: none; }
.main-nav__label { color: inherit; text-decoration: none; }
.main-nav__label:hover { text-decoration: underline; text-underline-offset: 4px; }
.main-nav__group > summary svg { width: 12px; height: 12px; color: var(--muted); transition: transform .2s; }
.main-nav__group[open] > summary { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.main-nav__group[open] > summary svg { transform: rotate(180deg); }

.main-nav__panel {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  min-width: 300px;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow);
}
.main-nav__panel a {
  display: block;
  padding: 11px 12px;
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
  font-size: 15px;
  line-height: 1.35;
}
.main-nav__panel a:hover,
.main-nav__panel a[aria-current="page"] { background: var(--bg-alt); }

.main-nav__panel--platforms {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  min-width: 580px;
  left: 50%;
  transform: translateX(-50%);
}
.main-nav__panel--platforms > a {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 12px;
  align-items: start;
}
.main-nav__panel--platforms small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 13.5px;
}
.main-nav__foot {
  grid-column: 1 / -1;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}
.main-nav__foot a { font-weight: 600; }


/* 3. Mobile navigation
   -------------------------------------------------------------------------- */
.mobile-nav { display: none; margin-left: auto; }
.mobile-nav > summary {
  list-style: none;
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  cursor: pointer;
  font-weight: 500;
  color: var(--ink);
}
.mobile-nav > summary::-webkit-details-marker { display: none; }
.mobile-nav__body {
  position: fixed;
  inset: calc(72px + env(safe-area-inset-top, 0px)) 0 0 0;
  overflow-y: auto;
  padding: 8px var(--gutter) calc(120px + env(safe-area-inset-bottom, 0px));
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.mobile-nav__body details { border-bottom: 1px solid var(--line); }
.mobile-nav__link {
  display: flex;
  align-items: center;
  min-height: 56px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 19px;
  text-decoration: none;
}
.mobile-nav__body summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 56px;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 19px;
  color: var(--ink);
}
.mobile-nav__body summary::-webkit-details-marker { display: none; }
.mobile-nav__body summary svg { width: 14px; height: 14px; transition: transform .2s; }
.mobile-nav__body details[open] summary svg { transform: rotate(180deg); }
.mobile-nav__body ul { margin-bottom: 12px; }
.mobile-nav__body li a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  color: var(--text);
  text-decoration: none;
}
.mobile-nav__body li a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.mobile-nav__body .swatch { width: 16px; height: 16px; --bite: 6px; }
.mobile-nav__contact { display: grid; gap: 4px; padding-top: 20px; }
.mobile-nav__contact a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
}
.mobile-nav__contact svg { width: 20px; height: 20px; color: var(--brand-ink); }


/* 4. Sections and section headings
   -------------------------------------------------------------------------- */
.section { padding-block: var(--section-space); }
.section--alt { background: var(--bg-alt); }
.section--tight-top { padding-top: clamp(40px, 5vw, 64px); }

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px 64px;
  align-items: end;
  margin-bottom: clamp(36px, 5vw, 56px);
}
.section-head p { max-width: 34em; }


/* 5. Breadcrumbs
   -------------------------------------------------------------------------- */
.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
  font-size: 14.5px;
}
.breadcrumbs li { display: flex; align-items: center; }
.breadcrumbs li + li::before {
  content: "";
  width: 5px; height: 5px;
  margin: 0 12px;
  border-radius: 1px;
  background: currentColor;
  opacity: .45;
}
.breadcrumbs a { color: inherit; text-underline-offset: 4px; }
.breadcrumbs [aria-current] { font-weight: 600; }


/* 6. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--bg-alt);
  padding-bottom: 32px;
}
.brand-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  height: 6px;
}
.brand-strip i { background: var(--c); }
.site-footer__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(4, minmax(0, 1fr));
  gap: 40px 32px;
  padding-top: clamp(56px, 7vw, 80px);
}
.site-footer__brand img { height: 56px; width: auto; }
.site-footer__brand > p { margin-top: 18px; font-size: 15px; max-width: 24em; }
.site-footer__legal {
  display: grid;
  gap: 4px;
  font-size: 14px;
  color: var(--muted);
}
.site-footer__social {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  margin-top: 16px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--ink);
}
.site-footer__social svg { width: 18px; height: 18px; }
.site-footer__col h2 {
  margin-bottom: 12px;
  font-family: var(--font-body);
  font-size: 15px;
  letter-spacing: 0;
}
.site-footer__col ul { display: grid; gap: 2px; }
.site-footer__col a,
.site-footer__col li > span {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  color: var(--text);
  font-size: 15px;
  text-decoration: none;
}
.site-footer__col a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.site-footer__col .swatch { width: 13px; height: 13px; --bite: 5px; }
.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--line-strong);
  font-size: 14px;
  color: var(--muted);
}
.site-footer__bottom nav { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.site-footer__bottom a { color: var(--muted); }


/* Breakpoints (architecture doc, page 11)
   -------------------------------------------------------------------------- */
@media (max-width: 1239px) {
  .main-nav__panel--platforms { left: 0; transform: none; }
  /* Six menu items plus the button: tighter on smaller laptops */
  .site-header__row { gap: 16px; }
  .main-nav { gap: 0; }
  .main-nav__group > summary, .main-nav__link { padding: 0 9px; font-size: 14px; }
  .site-header__cta { min-height: 44px; padding-inline: 18px; font-size: 15px; }
}
/* Below laptop width the six-item menu does not fit: tablets use the phone menu */
@media (max-width: 1023px) {
  :root { --header-h: 72px; }
  .topbar, .main-nav { display: none; }
  .mobile-nav { display: block; }
  .site-header__logo img { height: 42px; }
  .site-header__cta { margin-left: auto; }
  .mobile-nav { margin-left: 0; }
  .topbar__offices, .topbar a { white-space: nowrap; }
  .site-footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-footer__brand { grid-column: 1 / -1; }
}
@media (max-width: 899px) {
  /* Not enough room for offices + three links on one line: keep the links */
  .topbar__offices { display: none; }
  .topbar__row { justify-content: flex-end; }
}
@media (max-width: 767px) {
  .site-header .site-header__cta { display: none; }
  .mobile-nav { margin-left: auto; }
  .section-head { grid-template-columns: 1fr; }
}
@media (max-width: 599px) {
  .site-footer__grid { grid-template-columns: 1fr 1fr; gap: 32px 20px; }
}
@media (max-width: 479px) {
  .site-footer__grid { grid-template-columns: 1fr; }
}
