/* Fonts */

@font-face {
  font-family: Astroneer;
  src: url('assets/A-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: Astroneer;
  src: url('assets/A-Bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: Roboto;
  src: url('assets/Roboto-Light.ttf') format('truetype');
  font-weight: 300;
  font-display: swap;
}

@font-face {
  font-family: Roboto;
  src: url('assets/Roboto-Bold.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: Roboto;
  src: url('assets/Roboto-LightItalic.ttf') format('truetype');
  font-weight: 300;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: Roboto;
  src: url('assets/Roboto-BoldItalic.ttf') format('truetype');
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

/* Theme and base styles */

:root {
  --navy: #33517e;
  --blue: #1e9ff1;
  --pink: #e776ba;
  --purple: #b188d4;
  --yellow: #ffd444;
  --lightblue: #cceaff;
  --body: #606060;
  --sidebar: 280px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  font:
    300 16px/22px Roboto,
    sans-serif;
  color: var(--body);
  background-image:
    linear-gradient(to bottom, transparent 10%, rgba(255, 115, 243, 0.35) 100%),
    radial-gradient(ellipse at 20% 0, rgba(30, 159, 241, 0.12), transparent 60%),
    linear-gradient(135deg, #c7d8f5 12%, #acb9e4 48%, #b9b1e7 100%),
    url('assets/bg.png');
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  background-blend-mode: hue, screen, screen, normal;
}

a {
  color: var(--pink);
  text-decoration: none;
}

main a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover {
  color: white;
  background: var(--purple);
  cursor: crosshair;
}

a:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 4px;
}

h1,
h2,
h3 {
  font-family: Astroneer, sans-serif;
  font-weight: 700;
}

h1 {
  margin: 0;
  color: var(--navy);
  font-size: 36px;
  line-height: 40px;
}

mark {
  background: #fff4cb;
  color: var(--body);
  padding: 0;
}

/* Accessibility */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: fixed;
  left: calc(var(--sidebar) + 12px);
  top: -60px;
  padding: 10px;
  background: white;
  z-index: 10;
}

.skip-link:focus {
  top: 10px;
}

/* Page layout */

.scroll-pane {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

main {
  display: flex;
  flex-direction: column;
  position: relative;
  width: calc(906px + var(--sidebar));
  max-width: 100%;
  min-height: 100%;
  padding: 26px 46px 60px calc(var(--sidebar) + 46px);
  background: linear-gradient(116deg, transparent 6%, rgba(255, 255, 255, 0.12) 17%, transparent 31%), linear-gradient(140deg, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0.1) 48%, rgba(255, 255, 255, 0.05));
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 5px 5px 20px rgba(65, 115, 158, 0.13);
  outline: none;
}

.view {
  flex: 1;
}

/* Sidebar and navigation */

.mobile-header,
.menu-backdrop {
  display: none;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  background: white;
  box-shadow: 6px 0 0 #33517e14;
  z-index: 2;
  overflow: hidden;
}

.yue {
  display: block;
  position: relative;
  width: 294px;
  height: 296px;
  margin-left: calc((100% - 294px) / 2);
  color: var(--blue);
}

.yue:hover {
  background: transparent;
}

.avatar-ring {
  position: absolute;
  left: 69px;
  top: 55px;
  width: 153px;
  height: 153px;
  border: 1px solid #d4dff0;
  border-radius: 50%;
  padding: 6px;
}

.avatar {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: url('assets/avatar.png') -32px 0/206px 165px no-repeat;
}

.crown-backing {
  position: absolute;
  left: 74px;
  top: 71px;
  width: 40px;
  height: 10px;
  background: white;
  rotate: 320deg;
}

.crown {
  position: absolute;
  left: 61px;
  top: 42px;
  width: 44px;
  height: 44px;
  color: #f5d333;
  font:
    48px/44px 'Segoe UI Symbol',
    serif;
  text-align: center;
  rotate: -40deg;
}

.yuelarge {
  position: absolute;
  left: 39px;
  top: 243px;
}

.yue-label {
  position: absolute;
  left: 161px;
  top: 242px;
  font:
    700 10px/12px Astroneer,
    sans-serif;
  color: #5288c8;
}

.yue-star {
  position: absolute;
  left: 204px;
  top: 236px;
}

.yue-divider {
  position: absolute;
  left: 32px;
  top: 287px;
}

.sidebar-star {
  display: block;
  height: 79px;
  padding-top: 29px;
  text-align: center;
  font:
    24px/24px 'Segoe UI Symbol',
    sans-serif;
  color: var(--blue);
}

.sidebar nav {
  margin: 0 20px;
}

.nav-section {
  margin: 0 0 25px;
}

.nav-section h2,
.return-link {
  margin: 0;
  background: var(--pink);
  padding: 6px 9px 5px;
  height: 31px;
  color: white;
  font:
    700 17px/20px Astroneer,
    sans-serif;
}

.nav-section ul {
  list-style: none;
  margin: 5px 0 0;
  padding: 0 0 0 18px;
}

.nav-section li {
  font:
    400 14px/22px Astroneer,
    sans-serif;
}

.nav-section li::before {
  content: '\2726';
  display: inline-block;
  color: var(--blue);
  font-family: 'Segoe UI Symbol', sans-serif;
  margin-right: 8px;
  font-size: 12px;
}

.nav-section li:hover::before,
.nav-section li:focus-within::before {
  color: var(--yellow);
}

.nav-section a {
  color: var(--blue);
}

.nav-section a:hover {
  color: white;
}

.nav-section:last-of-type {
  margin-bottom: 18px;
}

.return-link {
  display: block;
  background: var(--lightblue);
  color: var(--blue);
}

/* Page headings */

.page-header {
  margin: 0 0 10px;
}

.page-header p {
  font-family: Astroneer, sans-serif;
  color: var(--navy);
  font-size: 14px;
  font-weight: 300;
  line-height: 18px;
  margin: 2px 0 0;
}

.page-header p::before {
  content: '\2726';
  display: inline-block;
  color: var(--pink);
  font-family: 'Segoe UI Symbol', sans-serif;
  margin-right: 6px;
}

/* Paper content */

.paper {
  background: white;
  box-shadow: 6px 6px 0 #33517e14;
  padding: 30px;
  min-height: 200px;
}

.paper p {
  margin: 0 0 18px;
}

.paper strong {
  color: var(--purple);
  font-weight: 300;
}

.paper h1 {
  padding-bottom: 10px;
}

.paper h2 {
  position: relative;
  font-size: 28px;
  line-height: 35px;
  padding: 5px 40px 5px 13px;
  margin: 10px 0 14px;
  background: #e0f2ff;
  color: var(--blue);
}

.paper h2::after {
  content: '\2726';
  position: absolute;
  right: 15px;
  top: 3px;
  color: white;
  font:
    30px/35px 'Segoe UI Symbol',
    sans-serif;
}

.paper h2:hover::after {
  color: var(--yellow);
}

.paper h2:not(:first-child) {
  margin-top: 30px;
}

.paper h3 {
  margin: 0 0 5px;
  font-size: 21px;
  line-height: 29px;
  color: var(--pink);
}

.paper ul,
.paper ol {
  margin: 0 0 18px;
  padding-left: 34px;
}

.paper ul {
  list-style: none;
}

.paper ul > li {
  position: relative;
}

.paper ul > li::before {
  content: '\2726';
  color: var(--blue);
  font-family: 'Segoe UI Symbol', sans-serif;
  position: absolute;
  top: 0;
  left: -17px;
  width: 22px;
}

.paper ul > li:hover::before {
  color: var(--yellow);
}

.paper ol > li::marker {
  color: var(--purple);
  font-weight: 700;
}

.paper li {
  margin-bottom: 10px;
  padding-left: 5px;
}

.paper code {
  color: var(--purple);
  font-size: 14px;
  overflow-wrap: anywhere;
  background: #f3f6fb;
}

.paper hr {
  border: 0;
  height: 1px;
  background: #edf0f7;
  margin: 35px 0;
}

.paper img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 0 18px;
}

.paper pre {
  padding: 16px;
  overflow-x: auto;
  background: #f3f6fb;
}

.paper pre code {
  background: transparent;
}

.paper + .paper {
  margin-top: 40px;
}

.paper table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  margin-bottom: 18px;
}

.paper th,
.paper td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid #e7eaf2;
}

.paper th {
  color: var(--navy);
}

.paper blockquote {
  margin: 0 0 18px;
  padding: 12px 18px;
  border-left: 3px solid var(--pink);
  background: #faf6fc;
}

.paper blockquote p:last-child {
  margin-bottom: 0;
}

.paper details {
  margin-bottom: 18px;
}

.paper summary {
  color: var(--purple);
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 10px;
}

.paper a {
  overflow-wrap: anywhere;
}

.margintop30 {
  margin-top: 30px;
}

/* Reference lists: controls, results, and pagination */

.catalog {
  padding: 22px 24px;
}

.list-filters input,
.list-filters select,
.catalog button {
  min-width: 0;
  border: 1px solid #d9e4f3;
  border-radius: 0;
  padding: 7px 9px;
  color: var(--navy);
  background: white;
  font: inherit;
  font-size: 13px;
  line-height: 18px;
}

.catalog button {
  cursor: pointer;
}

.catalog button:hover:not(:disabled) {
  color: white;
  background: var(--purple);
  border-color: var(--purple);
}

.catalog button:disabled {
  opacity: 0.45;
  cursor: default;
}

.catalog button:focus-visible,
.catalog summary:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 2px;
}

.list-filters {
  position: sticky;
  top: 0;
  z-index: 1;
  display: grid;
  align-items: end;
  gap: 10px;
  padding: 14px;
  background: #f0f7ff;
  box-shadow: 0 4px 12px #33517e12;
}

.list-filters label {
  display: grid;
  gap: 4px;
  color: var(--navy);
  font-size: 13px;
  line-height: 16px;
}

.list-filters input,
.list-filters select {
  width: 100%;
  height: 34px;
}

.list-filters input:focus,
.list-filters select:focus {
  border-color: transparent;
  outline: none;
  box-shadow: none;
  background: #fcfaff;
}

.list-results {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0 8px;
  font-size: calc(11px + 1pt);
  line-height: 16px;
  color: #81899a;
}

.list-results p {
  margin: 0;
}

.list-results code {
  font-size: inherit;
}

.list-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 16px 0 0;
  color: var(--navy);
  font-size: 13px;
  font-weight: 400;
}

.list-pagination-top {
  margin: 0 0 10px;
}

.list-empty {
  padding: 28px 0;
  text-align: center;
  font-size: calc(14px + 1pt);
}

/* Footer */

.site-footer {
  position: relative;
  z-index: 1;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.6);
  color: var(--navy);
  font-size: 12px;
  line-height: 18px;
}

.site-footer p {
  margin: 0 0 8px;
}

/* Animation and reduced motion */

@supports (interpolate-size: allow-keywords) and selector(details::details-content) {
  details {
    interpolate-size: allow-keywords;
  }

  details::details-content {
    block-size: 0;
    opacity: 0;
    overflow: clip;
    transition:
      block-size 0.24s ease,
      opacity 0.18s ease,
      content-visibility 0.24s allow-discrete;
  }

  details[open]::details-content {
    block-size: auto;
    opacity: 1;
  }
}

@keyframes star-sparkle {
  0%,
  100% {
    transform: scale(1) rotate(0);
  }
  40% {
    transform: scale(1.35) rotate(12deg);
  }
  70% {
    transform: scale(0.95) rotate(-8deg);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .yue-star:hover,
  .yuelarge:hover ~ .yue-star,
  .yue-label:hover ~ .yue-star,
  .nav-section li:hover::before,
  .nav-section li:focus-within::before,
  .page-header p:hover::before,
  .paper h2:hover::after,
  .paper ul > li:hover::before {
    animation: star-sparkle 0.55s ease-out both;
  }
}

@media (prefers-reduced-motion: reduce) {
  details::details-content {
    transition: none;
  }
}

/* Responsive layout */

@media (max-width: 1050px) {
  .catalog .list-filters {
    grid-template-columns: 1fr 1fr auto;
  }

  .list-search {
    grid-column: 1 / -1;
  }

  main {
    padding-left: calc(var(--sidebar) + 30px);
    padding-right: 30px;
  }
}

@media (max-width: 700px) {
  .catalog {
    padding: 16px 12px;
  }

  .catalog .list-filters {
    grid-template-columns: 1fr;
  }

  .list-results > span {
    display: none;
  }

  :root {
    --sidebar: 0px;
  }
  .mobile-header {
    position: fixed;
    inset: 0 0 auto;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 20px;
    border-bottom: 4px solid #d8e2f3;
    background: white;
    z-index: 5;
  }
  .mobile-yue {
    display: flex;
    align-items: center;
    gap: 13px;
  }
  .mobile-yue:hover {
    background: transparent;
  }
  .mobile-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: url('assets/avatar.png') -9.5px 0/61.4px 49.2px;
    border: 1px solid #d4dff0;
    outline: 3px solid white;
    box-shadow: 0 0 0 4px #d4dff0;
  }
  .menu-toggle {
    border: 0;
    background: #cceaff;
    color: var(--blue);
    padding: 8px 12px;
    font:
      700 16px/20px Astroneer,
      sans-serif;
    cursor: crosshair;
  }
  .menu-toggle:hover {
    background: var(--pink);
    color: white;
  }
  .menu-toggle:focus-visible {
    outline: 2px solid var(--navy);
    outline-offset: 3px;
  }
  .sidebar {
    top: 68px;
    width: min(280px, 86vw);
    transform: translateX(-100%);
    visibility: hidden;
    z-index: 4;
    overflow-y: auto;
  }
  .sidebar .yue,
  .sidebar-star {
    display: none;
  }
  .sidebar nav {
    margin: 28px 26px;
  }
  .nav-section ul {
    padding-left: 17px;
    margin-top: 10px;
  }
  .nav-section li {
    font-size: 13px;
    line-height: 36px;
  }
  .nav-section {
    margin-bottom: 26px;
  }
  .menu-open .sidebar {
    transform: translateX(0);
    visibility: visible;
  }
  .menu-open .menu-backdrop {
    display: block;
    position: fixed;
    inset: 68px 0 0;
    background: #33517e55;
    border: 0;
    z-index: 3;
    cursor: crosshair;
  }
  .scroll-pane {
    top: 68px;
    scrollbar-gutter: auto;
  }
  main {
    padding: 23px 20px 40px;
    border-right: 0;
  }
  h1 {
    font-size: 30px;
    line-height: 35px;
  }
  .page-header {
    margin-bottom: 17px;
  }
  .page-header p {
    font-size: 13px;
    line-height: 18px;
    margin-top: 5px;
  }
  .paper h2 {
    font-size: 24px;
    line-height: 29px;
  }
  .skip-link {
    left: 20px;
    z-index: 6;
  }
  .skip-link:focus {
    top: 72px;
  }
}

@media (max-height: 780px) and (min-width: 701px) {
  .yue {
    transform: scale(0.8);
    transform-origin: top center;
    height: 246px;
  }
  .sidebar-star {
    height: 40px;
    padding-top: 0;
  }
  .nav-section {
    margin-bottom: 16px;
  }
  .nav-section ul {
    margin-top: 8px;
  }
}
