/* The Hang Seng Atlas — companion site. Minimalist, monochrome chrome,
   thin type; matches the app. Light default, dark via prefers-color-scheme. */

:root {
  --surface: #ffffff;
  --ink: #111110;
  --ink-2: #55534e;
  --ink-3: #8a8880;
  --hairline: rgba(0, 0, 0, 0.12);
  --wash: rgba(0, 0, 0, 0.03);
}

@media (prefers-color-scheme: dark) {
  :root {
    --surface: #0d0d0d;
    --ink: #f2f1ec;
    --ink-2: #c3c2b7;
    --ink-3: #898781;
    --hairline: rgba(255, 255, 255, 0.14);
    --wash: rgba(255, 255, 255, 0.05);
  }
}

* {
  box-sizing: border-box;
  margin: 0;
}

body {
  background: var(--surface);
  color: var(--ink);
  font-family: 'Helvetica Neue', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-weight: 300;
  line-height: 1.7;
  letter-spacing: 0.01em;
}

a {
  color: inherit;
  text-underline-offset: 3px;
}

code {
  font-size: 0.9em;
}

/* ---------------------------------------------------------------- masthead */
.masthead {
  max-width: 880px;
  margin: 0 auto;
  padding: 72px 24px 40px;
  text-align: center;
}
.masthead h1 {
  font-size: clamp(20px, 4vw, 30px);
  font-weight: 400;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}
.masthead p {
  margin-top: 12px;
  color: var(--ink-2);
  font-size: 15px;
}
.masthead.compact {
  padding-bottom: 12px;
}
.site-nav {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 26px;
}
.site-nav a {
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .13em;
  text-decoration: none;
  text-transform: uppercase;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--ink);
}
.site-nav a[aria-current="page"] {
  border-bottom: 1px solid currentColor;
}

/* ------------------------------------------------------------------ widget */
.widget-section {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 24px;
}
.widget-frame {
  border: 1px solid var(--hairline);
  aspect-ratio: 16 / 9;
  min-height: 380px;
}
.widget-frame iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}
.widget-caption {
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--ink-3);
  text-align: center;
}

/* ------------------------------------------------------------------- body */
main {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 24px 60px;
}
section {
  margin-top: 72px;
}
h2 {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink);
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 10px;
  margin-bottom: 22px;
}
h3 {
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 6px;
}
p {
  font-size: 15px;
  color: var(--ink-2);
  margin-bottom: 14px;
}
p strong {
  color: var(--ink);
  font-weight: 500;
}
.step {
  margin-bottom: 34px;
}
figure {
  margin: 20px 0 6px;
}
figure img {
  width: 100%;
  height: auto;
  border: 1px solid var(--hairline);
}
figcaption {
  margin-top: 8px;
  font-size: 12px;
  color: var(--ink-3);
}

/* ------------------------------------------------------------------- cards */
.cards {
  display: grid;
  gap: 14px;
}
.card {
  border: 1px solid var(--hairline);
  border-left: 2px solid var(--ink);
  padding: 18px 20px;
}
.card p {
  margin-bottom: 0;
  font-size: 13.5px;
}

/* -------------------------------------------------------------------- fine */
.fine p {
  font-size: 13px;
  color: var(--ink-3);
}
.fine p strong {
  color: var(--ink-2);
}

footer {
  border-top: 1px solid var(--hairline);
  padding: 26px 24px 40px;
  text-align: center;
}
footer p {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* --------------------------------------------------------------- data page */
.data-main {
  max-width: 1040px;
  padding-top: 0;
}
.data-intro {
  margin-top: 38px;
  text-align: center;
}
.data-intro h2 {
  max-width: 720px;
  margin: 0 auto 18px;
  border: 0;
  padding: 0;
  font-size: clamp(20px, 3.5vw, 34px);
  font-weight: 300;
  letter-spacing: -.02em;
  line-height: 1.25;
  text-transform: none;
}
.data-intro > p:not(.eyebrow) {
  font-size: 13px;
  color: var(--ink-3);
}
.eyebrow {
  margin-bottom: 12px;
  color: var(--ink-3);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.spotlight-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 34px;
  border: 1px solid var(--hairline);
}
.spotlight {
  min-width: 0;
  padding: 24px;
  text-align: left;
}
.spotlight + .spotlight {
  border-left: 1px solid var(--hairline);
}
.spotlight span {
  display: block;
  margin-bottom: 18px;
  color: var(--ink-3);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.spotlight strong {
  display: block;
  font-size: clamp(24px, 4vw, 38px);
  font-weight: 300;
  letter-spacing: -.04em;
  line-height: 1;
}
.spotlight p {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.45;
}
.ranking {
  border-top: 1px solid var(--hairline);
}
.rank-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 72px;
  align-items: center;
  gap: 14px;
  min-height: 67px;
  border-bottom: 1px solid var(--hairline);
}
.rank-number {
  color: var(--ink-3);
  font-size: 10px;
  letter-spacing: .08em;
}
.rank-copy > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
}
.rank-copy strong {
  font-size: 13px;
  font-weight: 400;
}
.rank-copy span {
  color: var(--ink-3);
  font-size: 10px;
  white-space: nowrap;
}
.rank-track {
  height: 2px;
  overflow: hidden;
  background: var(--wash);
}
.rank-track i {
  display: block;
  height: 100%;
}
.rank-track i.negative {
  opacity: .48;
}
.rank-value {
  font-size: 15px;
  font-weight: 400;
  text-align: right;
}
.negative-text {
  color: var(--ink-3);
}
.pair-grid,
.loyalty-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 34px;
}
.data-block h3 {
  margin-bottom: 14px;
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.table-scroll {
  overflow-x: auto;
}
.pair-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}
.pair-table th {
  padding: 8px 6px;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  color: var(--ink-3);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .08em;
  text-align: left;
  text-transform: uppercase;
}
.pair-table th.number,
.pair-table td.number {
  text-align: right;
}
.pair-table td {
  padding: 10px 6px;
  border-bottom: 1px solid var(--hairline);
  vertical-align: middle;
}
.pair-names span {
  display: block;
  line-height: 1.45;
}
.pair-names i,
.outlier-list > li > i {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 7px;
  border-radius: 50%;
}
.pair-names small {
  color: var(--ink-3);
  font-size: 8.5px;
  white-space: nowrap;
}
.muted-number {
  color: var(--ink-3);
}
.compact-ranking .rank-row {
  min-height: 49px;
  grid-template-columns: 28px minmax(0, 1fr) 58px;
  gap: 10px;
}
.compact-ranking .rank-copy > div:first-child {
  margin-bottom: 5px;
}
.outlier-list {
  list-style: none;
  padding: 0;
  border-top: 1px solid var(--hairline);
}
.outlier-list li {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) 45px;
  align-items: center;
  min-height: 49px;
  border-bottom: 1px solid var(--hairline);
}
.outlier-list > li > i {
  margin: 0;
}
.outlier-list strong,
.outlier-list small {
  display: block;
}
.outlier-list strong {
  overflow: hidden;
  font-size: 12px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.outlier-list small {
  color: var(--ink-3);
  font-size: 9px;
}
.outlier-list b {
  font-size: 12px;
  font-weight: 400;
  text-align: right;
}
.data-note {
  margin-bottom: 30px;
}

@media (min-width: 640px) {
  .cards {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .spotlight-grid,
  .pair-grid,
  .loyalty-layout {
    grid-template-columns: 1fr;
  }
  .spotlight + .spotlight {
    border-top: 1px solid var(--hairline);
    border-left: 0;
  }
  .pair-grid,
  .loyalty-layout {
    gap: 48px;
  }
  .rank-row {
    grid-template-columns: 28px minmax(0, 1fr) 58px;
    gap: 8px;
  }
  .rank-copy span {
    display: none;
  }
}
