*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Theme tokens (light defaults; auto-overridden by OS/browser dark mode) */
:root {
  color-scheme: light dark;

  --bg-color: #ffffff;
  --text-color: #111111;
  --header-color: #111111;

  --link-color: #0b57d0;
  --link-visited-color: #6f42c1;

  --border-color: #111111;
  --border-muted-color: #444444;

  --code-bg: #000000;

  --popup-bg: #ffffff;
  --popup-border: #cccccc;
  --muted-text: #666666;
  --muted-text-2: #999999;
  --shadow-color: rgba(0, 0, 0, 0.15);

  --pill-available-bg: #78fa64;
  --pill-available-fg: #081a08;
  --pill-muted-bg: #f0f0f0;
  --pill-muted-fg: #111111;
  --pill-muted-border: #d0d0d0;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: #0f0f10;
    --text-color: #e8e8ea;
    --header-color: #ffffff;

    --link-color: #8ab4f8;
    --link-visited-color: #c58af9;

    --border-color: #e8e8ea;
    --border-muted-color: #b5b5b5;

    --code-bg: #000000;

    --popup-bg: #151517;
    --popup-border: #3a3a3d;
    --muted-text: #b5b5b5;
    --muted-text-2: #8f8f93;
    --shadow-color: rgba(0, 0, 0, 0.5);

    --pill-muted-bg: #2a2a2d;
    --pill-muted-fg: #e8e8ea;
    --pill-muted-border: #3a3a3d;
  }
}

/* html is set to 62.5% so that all the REM measurements are 1rem = 10px */
html {
  font-size: 62.5%;
}

body,
input,
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: 'IBM Plex Mono', monospace;
}

body {
  padding: 2rem 4rem;
  font-size: 1.4rem;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--bg-color);
}

.content {
  font-size: 1.8rem;
}

.status-pill {
  display: inline-block;
  padding: 0.05em 0.55em;
  border-radius: 999px;
  font-size: 0.85em;
  font-weight: 700;
  letter-spacing: 0.2px;
  border: 1px solid transparent;
}

.status-pill--available,
.status-pill--updating {
  background: var(--pill-available-bg);
  color: var(--pill-available-fg);
}

.status-pill--other {
  background: var(--pill-muted-bg);
  color: var(--pill-muted-fg);
  border-color: var(--pill-muted-border);
}

a {
  color: var(--link-color);
}

a:visited {
  color: var(--link-visited-color);
}

/* Prevent visited-link styling from recoloring interactive SVG maps (e.g. scorecard). */
#map-container svg a:link,
#map-container svg a:visited,
#map-container svg a:hover,
#map-container svg a:active {
  fill: inherit;
  stroke: inherit;
  color: inherit;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: var(--header-color);
}

p {
  margin-bottom: 1.2rem;
}

.small-note {
  font-size: 0.9em;
  color: var(--muted-text);
}

.small-note a {
  color: inherit;
}

.small-note a:visited {
  color: inherit;
}

.table-container {
  overflow-x: auto;
}

table {
  border-collapse: collapse;
}

table td,
table th {
  padding: 4px 8px;
  overflow-wrap: break-word;
  text-align: left;
}

table.data {
  border: 1px solid var(--border-color);
  min-width: 640px;
}

table.data th {
  border-bottom: 1px solid var(--border-color);
}

table.data td,
table.data th {
  padding: 10px 20px;
  border-right: 1px dotted var(--border-muted-color);
}


table.data tr td.right,
table.data tr th.right {
  text-align: right;
}

/* Catalog grouped table */
.catalog-table .catalog-model-cell {
  font-weight: 700;
  vertical-align: top;
  white-space: nowrap;
}

.catalog-glyph {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin-right: 0.8rem;
}

.catalog-glyph svg {
  height: 1em;
  width: 1em;
}


.catalog-table .catalog-resolution {
  font-size: 0.8em;
}

.catalog-table tr.catalog-group-last td,
.catalog-table tr.catalog-group-last + tr td {
  border-top: 1px solid var(--border-color);
}

caption {
  padding: 10px;
}

/* Hero section */
.hero-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  max-width: 78rem;
  margin: 4rem auto 6rem;
  min-width: 0;
}

.hero-section > * {
  min-width: 0;
}

.hero-heading {
  font-size: 4rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin: 0 0 1.6rem;
  color: var(--header-color);
}

.hero-subtitle {
  font-size: 1.8rem;
  line-height: 1.5;
  color: var(--muted-text);
  margin: 0 0 2.4rem;
}

.hero-cta {
  display: inline-block;
  padding: 0.8rem 2rem;
  border: 1px solid var(--border-color);
  color: var(--header-color);
  text-decoration: none;
  text-transform: uppercase;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 1px;
  transition: background-color 0.15s, color 0.15s;
}

.hero-cta:visited {
  color: var(--header-color);
}

.hero-cta:hover {
  background-color: var(--header-color);
  color: var(--bg-color);
}

.hero-stats {
  display: flex;
  margin-top: 3.2rem;
}

.hero-stat {
  padding: 0 2rem;
  border-left: 1px solid var(--border-muted-color);
}

.hero-stat:first-child {
  padding-left: 0;
  border-left: none;
}

.hero-stat-value {
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--header-color);
  line-height: 1.2;
}

.hero-stat-label {
  font-size: 1.2rem;
  color: var(--muted-text);
}

.hero-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#globe-canvas {
  display: block;
  width: 100%;
  max-width: 400px;
  aspect-ratio: 1;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.globe-timeline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  max-width: 300px;
  margin-top: 0.4rem;
}

.globe-time-label {
  font-size: 0.75rem;
  color: var(--muted-text-2);
  white-space: nowrap;
}

#globe-slider {
  flex: 1;
  height: 2px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--muted-text-2);
  opacity: 0.4;
  outline: none;
  cursor: pointer;
}

#globe-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted-text);
  cursor: pointer;
}

#globe-slider::-moz-range-thumb {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted-text);
  border: none;
  cursor: pointer;
}

.globe-footnote {
  font-size: 1rem;
  color: var(--muted-text-2);
  text-align: center;
  margin-top: 0.4rem;
}

.globe-footnote a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

nav,
.content,
.frame {
  max-width: 78rem;
  margin: auto;
}

nav {
  margin: 1.25rem auto 2.25rem;
}

nav ul {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 1.25rem;
  padding-inline-start: 0;
  margin: 0;
}

nav li {
  list-style: none;
}

nav ul li:first-child {
  font-weight: 700;
  margin-right: auto;
}

footer {
  max-width: 78rem;
  margin: 6rem auto 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--popup-border);
  color: var(--muted-text);
  font-size: 1.4rem;
  text-align: center;
}

footer > div + div {
  margin-top: 0.5rem;
}

#footer-frame {
  display: block;
  width: 100%;
  border: 0;
  margin: 6rem auto 2rem;
}

#footer-frame[style*="height"] {
  overflow: hidden;
}



article {
  border: 1px solid var(--border-color);
  margin: 2rem -3rem;
  padding: 2rem 3rem;
}

article img {
  max-width: 100%;
}

.content.centered {
  text-align: center;
}

.content pre[class*="language-"] {
  background-color: var(--code-bg);
}

.frame {
  margin: 2rem auto;
  border: 1px solid #292929;
  border-radius: 6px;
  background: #171717;
  overflow: hidden;
}

.frameHeader {
  display: flex;
  height: 40px;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid #292929;
  background: black;
  border-top-left-radius: 5px;
  border-top-right-radius: 5px;
  gap: 12px;
}

.frameHeaderTitle {
  position: relative;
  display: grid;
  height: 40px;
  align-items: center;
  color: #fafafa;
  font-size: 14px;
  line-height: 40px;
  vertical-align: top;
  border-bottom: 1px solid white;
}

.frameHeaderSubtitle {
  height: 40px;
  color: #898989;
  font-size: 14px;
  line-height: 40px;
}

.frameContent {
  width: 100%;
  margin: 0;
  overflow-x: auto;
  background: #1d1f21;
}

.frameContent code {
  font-family: inherit;
  font-size: 1.5rem;
  letter-spacing: 0.1px;
  line-height: 22.5px;
}

.frameContentMobile {
  display: none;
}

.frameResult {
  width: 100%;
  outline: 1px solid #292929;
  display: block;
}

#newsletter {
  margin-top: 4rem;
}

#newsletter form > * {
  margin: 1rem 0;
}

.content input,
.content select {
  font-size: inherit;
}

/* Latest popup styles */
#latest-popup {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  background: var(--popup-bg);
  color: var(--text-color);
  border: 1px solid var(--popup-border);
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 4px 12px var(--shadow-color);
  max-width: 300px;
  z-index: 1000;
}

#latest-popup .popup-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

#latest-popup .popup-type {
  font-weight: bold;
  color: var(--muted-text);
}

#latest-popup .popup-close {
  background: none;
  border: none;
  font-size: 1.2em;
  cursor: pointer;
  color: var(--muted-text-2);
  padding: 0;
  line-height: 1;
}

#latest-popup .popup-title {
  font-weight: 500;
  text-decoration: none;
  color: inherit;
}

#latest-popup .popup-date {
  color: var(--muted-text);
  font-size: 0.8em;
  margin-top: 0.25rem;
}

.scorecard-chart figure {
  margin: 0;
}

.responsive-flex {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
}

@media screen and (max-width: 1000px) {
  body {
    padding: 2rem 1rem;
  }

  nav ul {
    justify-content: flex-start;
  }

  nav ul li:first-child {
    flex-basis: 100%;
    margin-right: 0;
  }

  .hero-section {
    grid-template-columns: 1fr;
    gap: 2rem;
    margin: 2rem auto 4rem;
  }

  .hero-visual {
    order: -1;
  }

  .hero-heading {
    display: none;
  }

  .hero-content {
    text-align: center;
  }

  .hero-stats {
    flex-wrap: wrap;
    gap: 1.6rem 0;
    justify-content: center;
  }


  .frame {
    margin: 4rem auto;
  }

  .frameContentDesktop + .frameContentMobile {
    display: none;
  }

  .frameContentMobile {
    display: block;
  }

  .frameHeaderTitle {
    display: none;
  }
  
  /* Allow header to grow to fit wrapped subtitle */
  .frameHeader {
    height: auto;
    min-height: 40px;
    align-items: center;
    padding: 8px 16px;
  }
  
  .frameHeaderSubtitle {
    height: auto;
    line-height: 1.3;
    white-space: normal;
  }

  .site-footer__inner {
    justify-content: center;
    text-align: center;
  }
}

@media (prefers-color-scheme: dark) {
  img[src$="/assets/github-mark.svg"],
  img[src$="github-mark.svg"] {
    filter: invert(1);
  }
}
