/* Design review adapted from Unslop by Damir Sokolovsky (@heydamir), CC BY 4.0. */
@font-face {
  font-family: "IBM Plex Sans";
  src: url("ibm-plex-sans-latin-wght-normal.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Sans";
  src: url("ibm-plex-sans-latin-ext-wght-normal.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02D9-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Site Roboto";
  src: url("roboto-latin-wght-normal.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Site Roboto";
  src: url("roboto-latin-ext-wght-normal.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02D9-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF;
}

:root {
  color-scheme: dark;
  font-family: "IBM Plex Sans", Arial, sans-serif;
  --background: #141719;
  --deep: #101214;
  --panel: #191d1f;
  --raised: #222729;
  --white: #f3f2ec;
  --muted: #c1c6c5;
  --subtle: #a1a9a8;
  --edge: #323839;
  --control-edge: #596264;
  --gold: #dfb779;
  --paper: #eeece3;
  --container: 1280px;
  --page-edge: clamp(20px, 4vw, 64px);
  --control-radius: 8px;
  --panel-radius: 12px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --masthead-unit: clamp(.69px, .05981vw, 1.25px);
  --masthead-height: calc(79 * var(--masthead-unit));
  --brand-navy: #060f19;
  --masthead-gold: #ffcc4c;
  --masthead-edge: #a4bfda47;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  min-width: 0;
  min-height: 100vh;
  margin: 0;
  background: var(--background);
  color: var(--white);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.55;
}

h1, h2, h3, p, figure { margin: 0; }
h1, h2, h3 { font-weight: 500; line-height: 1.14; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { color: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }

.site-container { width: min(var(--container), calc(100% - 2 * var(--page-edge))); margin-inline: auto; }

.skip-link {
  position: fixed;
  z-index: 10;
  inset: 8px auto auto 8px;
  padding: 8px 16px;
  transform: translateY(-160%);
  border-radius: var(--control-radius);
  background: var(--paper);
  color: var(--deep);
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  position: relative;
  z-index: 3;
  font-family: "Site Roboto", Arial, sans-serif;
  color: #f8f8fa;
  background: var(--brand-navy);
}

.inner-page {
  --background: var(--brand-navy);
  --deep: #050d18;
  --panel: #0b1927;
  --raised: #12253a;
  --white: #f8f8fa;
  --muted: #d0dce8;
  --subtle: #aabed2;
  --edge: #33475c;
  --control-edge: #58728a;
  --gold: var(--masthead-gold);
  --paper: var(--masthead-gold);
  --gold-hover: #ffda71;
  position: relative;
  isolation: isolate;
}

.inner-page .site-header { background: transparent; }

.page-backdrop {
  position: absolute;
  z-index: -1;
  inset: 0 0 auto;
  height: min(100%, clamp(980px, 62vw, 1240px));
  pointer-events: none;
}

.page-backdrop img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .8;
}

.page-backdrop::after {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, #040a148a, #060f198c 25%, #060f19b8 61%, var(--brand-navy) 100%),
    linear-gradient(90deg, transparent, #060f1999 18% 44%, transparent 78%);
  content: "";
}

.header-inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  min-height: 76px;
}

.brand { display: block; width: clamp(164px, 16.5vw, 228px); max-width: 100%; }
.brand img { width: 100%; height: auto; }

.navigation, .header-actions { display: flex; align-items: center; min-width: 0; }
.navigation { justify-content: center; gap: clamp(12px, 1.55vw, 24px); }
.header-actions { gap: 12px; }

.nav-link, .icon-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
  white-space: nowrap;
}

.nav-link:hover, .icon-button:hover,
.nav-link[aria-current="page"], .nav-link[data-section-current], .nav-dropdown[open] > summary { color: var(--white); }
.nav-link[aria-current="page"], .nav-link[data-section-current] { font-weight: 600; }
.nav-link[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; text-decoration-color: var(--gold); }

.nav-dropdown { position: relative; }
.nav-dropdown > summary { cursor: pointer; list-style: none; }
.nav-dropdown > summary::-webkit-details-marker { display: none; }

.icon, .chevron, .menu-icon, .menu-icon-close { width: 16px; height: 16px; flex: none; opacity: .85; }
.nav-dropdown[open] .chevron { transform: rotate(180deg); }
.icon-button { width: 40px; border-radius: var(--control-radius); }
.icon-button:hover { background: var(--raised); }

.nav-popup {
  position: absolute;
  z-index: 2;
  inset: calc(100% + 4px) auto auto -12px;
  display: grid;
  min-width: max-content;
  padding: 4px;
  border: 1px solid var(--edge);
  border-radius: var(--control-radius);
  background: var(--panel);
}
.nav-dropdown:not([open]) > .nav-popup { display: none; }

.nav-popup .nav-link, .nav-popup a {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 40px;
  padding-inline: 12px;
  border-radius: 4px;
  color: var(--muted);
  font-size: 14px;
}
.nav-popup a:is(:hover, :focus-visible, [aria-current]) { background: var(--raised); color: var(--white); }

.language-menu .nav-popup { inset: calc(100% + 4px) 0 auto auto; }
.mobile-account, .menu-toggle { display: none; }

.site-header .nav-link { color: #f8f8fa; }
.site-header .nav-link:is([aria-current="page"], [data-section-current], :hover) { color: var(--masthead-gold); }
.site-header .nav-popup { background: #0b1725; border-color: var(--masthead-edge); }
.site-header .navigation .nav-link:not(.desktop-account) + .desktop-account { border-block-start: 1px solid var(--masthead-edge); }

.header-art {
  position: absolute;
  z-index: -1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  border-block-end: 1px solid #e2b76042;
}

.header-glow {
  position: absolute;
  inset: 0 auto auto 0;
  width: 300px;
  height: 180px;
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(ellipse, #ffc45d2b, #ffca6c0b 45%, transparent 70%);
  opacity: 0;
}

.header-art[data-pointer] .header-glow { opacity: 1; }

@media (prefers-reduced-motion: no-preference) {
  .header-art::after {
    position: absolute;
    inset: auto auto 0 -35%;
    width: 35%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #ffd371aa 72%, #fff4d8, transparent);
    box-shadow: 0 -2px 14px #f6b74282;
    animation: masthead-light 2.4s .2s ease-out both;
    content: "";
  }

  .header-glow { transition: opacity 200ms ease-out; }
  .site-header:has(.header-art) .nav-link { transition: color 160ms ease-out; }
  .site-header:has(.header-art) details[open] > .nav-popup { animation: masthead-popover 180ms ease-out; }
}

@media (prefers-reduced-motion: reduce) {
  .header-glow { display: none; }
}

@keyframes masthead-light {
  0% { transform: translateX(0); opacity: 0; }
  18%, 70% { opacity: 1; }
  100% { transform: translateX(390%); opacity: 0; }
}

@keyframes masthead-popover {
  from { transform: translateY(-4px); opacity: .7; }
  to { transform: translateY(0); opacity: 1; }
}

.action-group, .related-links { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.action-group { margin-top: 24px; }
.action-primary, .action-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  max-width: 100%;
  padding: 12px 16px;
  border: 1px solid transparent;
  border-radius: var(--control-radius);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  overflow-wrap: anywhere;
  transition: color 160ms var(--ease), background-color 160ms var(--ease), border-color 160ms var(--ease);
}
.action-primary { background: var(--paper); color: #191c1d; }
.action-primary:hover { background: #fffdf6; }
.inner-page .action-primary:hover { background: var(--gold-hover); }
.action-secondary { border-color: var(--control-edge); background: var(--panel); color: var(--white); }
.action-secondary:hover { background: var(--raised); border-color: var(--muted); }

.figure-caption {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  min-height: 32px;
  margin-top: 8px;
  color: var(--subtle);
  font-size: 13px;
  line-height: 1.4;
}
.figure-caption::before {
  flex: none;
  width: 24px;
  height: 8px;
  background: repeating-linear-gradient(90deg, currentColor 0 1px, transparent 1px 6px);
  color: var(--gold);
  content: "";
}
.figure-caption span:first-of-type:not(:only-of-type) { color: var(--muted); }
.section-kicker { color: var(--subtle); font-size: 14px; }

@media (min-width: 1160px) {
  .site-header .header-inner {
    width: auto;
    min-height: 0;
    height: var(--masthead-height);
    gap: 0;
    padding-inline: 6.16vw 2.42vw;
  }

  .site-header .brand {
    position: relative;
    width: calc(358 * var(--masthead-unit));
    max-width: none;
    margin-inline-end: calc(119 * var(--masthead-unit));
  }

  .site-header .brand::after {
    position: absolute;
    inset: 16% calc(-56 * var(--masthead-unit)) auto auto;
    width: 1px;
    height: calc(30 * var(--masthead-unit));
    background: #6f7a88;
    content: "";
  }

  .site-header .navigation {
    justify-content: space-between;
    align-items: stretch;
    height: 100%;
    gap: calc(12 * var(--masthead-unit));
  }

  .site-header .nav-link {
    position: relative;
    height: 100%;
    min-height: 0;
    gap: calc(7 * var(--masthead-unit));
    font-size: calc(17 * var(--masthead-unit));
    font-weight: 500;
  }

  .site-header .navigation > .nav-link[aria-current="page"],
  .site-header .navigation > details > summary[data-section-current] { text-decoration: none; }
  .site-header .navigation > .nav-link[aria-current="page"]::after,
  .site-header .navigation > details > summary[data-section-current]::after {
    position: absolute;
    inset: auto 0 calc(10 * var(--masthead-unit));
    height: 2px;
    background: linear-gradient(90deg, #f6bf24, #fff0b2, #f6bf24);
    box-shadow: 0 0 calc(12 * var(--masthead-unit)) #ffc6307a;
    content: "";
  }

  .site-header .header-actions { margin-inline-start: calc(82 * var(--masthead-unit)); gap: calc(17 * var(--masthead-unit)); }
  .site-header .search-toggle, .site-header .search-toggle img { width: calc(26 * var(--masthead-unit)); }
  .site-header .search-toggle img { height: calc(26 * var(--masthead-unit)); }
  .site-header .search-toggle img, .site-header .chevron { opacity: 1; }
  .site-header .chevron { width: calc(16 * var(--masthead-unit)); height: calc(16 * var(--masthead-unit)); }
  .site-header .language-menu > summary { min-height: calc(25 * var(--masthead-unit)); padding-inline-start: calc(21 * var(--masthead-unit)); border-inline-start: 1px solid #b5c6da24; }
  .site-header .language-menu .nav-popup { top: calc(100% + 12px); }
  .site-header .navigation .nav-popup { top: calc(100% - 4px); }
  .site-header .nav-popup :is(a, .nav-link) { min-height: 40px; font-size: max(14px, calc(15 * var(--masthead-unit))); }
}

@media (max-width: 1159px) {
  :root { --masthead-height: 68px; }
  .header-inner { grid-template-columns: minmax(0, 1fr) auto; min-height: var(--masthead-height); }
  .header-actions { gap: 8px; }
  .menu-toggle { display: flex; }
  .menu-toggle[aria-expanded="false"] .menu-icon-close, .menu-toggle[aria-expanded="true"] .menu-icon { display: none; }
  .navigation {
    position: absolute;
    inset: 100% 0 auto;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    max-height: calc(100dvh - 68px);
    overflow: auto;
    padding: 12px var(--page-edge) 16px;
    border-bottom: 1px solid var(--edge);
    background: var(--deep);
  }
  .navigation[data-menu-open] { display: flex; }
  .navigation .nav-link { justify-content: flex-start; min-height: 44px; padding-inline: 8px; }
  .site-header .navigation .nav-popup { position: static; padding: 0 0 4px 12px; border: 0; background: transparent; }
  .reference-home .site-header .navigation .nav-popup { background: #0b1725; }
  .site-header .navigation .nav-popup .desktop-account { display: none; }
  .mobile-account { display: block; border-top: 1px solid var(--edge); margin-top: 8px; padding-top: 4px; }
}

@media (max-width: 760px) {
  :root { --page-edge: 20px; }
  .page-backdrop img { object-position: 13% center; }
  .page-backdrop::after {
    background: linear-gradient(180deg, #040a14b3, #060f19c9 37%, #060f19a6 58%, var(--brand-navy) 100%);
  }
}

@media (max-width: 520px) {
  .header-inner { gap: 8px; }
  .header-actions { gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
