/* ANCHOR SWITCH ETF — Dot Quiet Design on the web: paper with a dot grid, serif titles, one indigo dot for "now". */

:root {
  color-scheme: light dark;
  --paper: #f6f6f4;
  --card: #fefdfb;
  --ink: #1c1c1e;
  --ink2: rgba(28, 28, 30, 0.88);
  --secondary: #6e6e73;
  --tertiary: #a1a1a6;
  --hairline: rgba(0, 0, 0, 0.08);
  --grid: rgba(28, 28, 30, 0.14);
  --accent: #2f71c1;
  --inkfill: rgba(28, 28, 30, 0.85);
  --onink: #f6f6f4;
  --pill: rgba(28, 28, 30, 0.16);
  --track: rgba(28, 28, 30, 0.06);
  --dash: rgba(28, 28, 30, 0.3);
  --shadow: 0 2px 3px rgba(0, 0, 0, 0.035);
  --wait1: rgba(28, 28, 30, 0.45);
  --wait2: rgba(28, 28, 30, 0.25);
  --wait3: rgba(28, 28, 30, 0.12);
  --serif-zh: "Songti SC", "Noto Serif SC", "Source Han Serif SC", serif;
  --serif-en: ui-serif, "New York", "Iowan Old Style", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --rounded: ui-rounded, "SF Pro Rounded", -apple-system, system-ui, sans-serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1b1b1b;
    --card: #262626;
    --ink: #f2f1ed;
    --ink2: rgba(242, 241, 237, 0.88);
    --secondary: #a1a1a6;
    --tertiary: #6e6e73;
    --hairline: rgba(255, 255, 255, 0.1);
    --grid: rgba(242, 241, 237, 0.14);
    --accent: #5092e5;
    --inkfill: rgba(242, 241, 237, 0.85);
    --onink: #1b1b1b;
    --pill: rgba(242, 241, 237, 0.2);
    --track: rgba(242, 241, 237, 0.08);
    --dash: rgba(242, 241, 237, 0.3);
    --shadow: 0 2px 3px rgba(0, 0, 0, 0.12);
    --wait1: rgba(242, 241, 237, 0.45);
    --wait2: rgba(242, 241, 237, 0.25);
    --wait3: rgba(242, 241, 237, 0.12);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  position: relative;
  min-height: 100vh;
  margin: 0;
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* The 24 px dot grid, fading in from 35% at the top so it never competes with the title. */
body::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(circle at 12px 12px, var(--grid) 0.9px, transparent 1.3px);
  background-size: 24px 24px;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.35) 0, #000 560px);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.35) 0, #000 560px);
}

[hidden] {
  display: none !important;
}

p {
  margin: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.dot {
  flex: 0 0 auto;
  display: inline-block;
  border-radius: 50%;
}

.wrap {
  position: relative;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 32px);
}

/* ---------------------------------------------------------------- header */

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 16px;
  padding: 28px 0;
}

.brand {
  margin: 0;
  font-family: var(--serif-en);
  font-weight: 600;
  font-size: 19px;
  line-height: 1.6;
  letter-spacing: 0.05em;
  color: var(--ink);
}

.masthead-side {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--secondary);
}

.status .dot {
  width: 7px;
  height: 7px;
  background: var(--accent);
}

.lang {
  display: inline-flex;
  padding: 2px;
  border-radius: 999px;
  background: var(--track);
}

.lang button {
  position: relative;
  height: 28px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

/* A taller touch target than the 28 px it shows. */
.lang button::after {
  content: "";
  position: absolute;
  inset: -8px 0;
}

.lang button[aria-pressed="true"] {
  background: var(--card);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
  font-weight: 600;
}

.lang button:focus-visible,
.plot:focus-visible,
.retry:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------- waiting and problems */

.waiting,
.problem,
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.waiting {
  padding: clamp(96px, 14vw, 168px) 0;
}

.problem {
  padding: clamp(80px, 12vw, 144px) 12px;
}

.wait-dots {
  display: flex;
  gap: 8px;
}

.wait-dots .dot {
  width: 8px;
  height: 8px;
}

.wait-dots .dot:nth-child(1) {
  background: var(--wait1);
}

.wait-dots .dot:nth-child(2) {
  background: var(--wait2);
}

.wait-dots .dot:nth-child(3) {
  background: var(--wait3);
}

.quiet-title {
  margin: 22px 0 0;
  font-family: var(--serif-en);
  font-weight: 600;
  font-size: clamp(22px, 2.6vw, 26px);
  line-height: 1.3;
  color: var(--ink);
}

.quiet-body {
  max-width: 28em;
  margin-top: 10px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--secondary);
}

.retry {
  height: 36px;
  margin-top: 22px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--track);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s var(--ease);
}

.retry:hover {
  background: var(--pill);
}

/* ---------------------------------------------------------------- holding now */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: clamp(56px, 9vw, 112px) 0 clamp(64px, 8vw, 104px);
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: clamp(28px, 4vw, 44px);
  font-size: 14px;
  font-weight: 500;
  color: var(--secondary);
}

.kicker .dot {
  width: 8px;
  height: 8px;
  background: var(--tertiary);
}

/* One row: on a narrow screen the columns narrow and their categories wrap. */
.holdings {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: clamp(10px, 2.2vw, 28px);
}

.holding {
  display: flex;
  align-items: flex-start;
  gap: clamp(10px, 2.2vw, 28px);
}

.plus {
  font-family: var(--serif-en);
  font-weight: 300;
  font-size: clamp(36px, 8.5vw, 104px);
  line-height: 1;
  color: var(--tertiary);
}

.holding-col {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ticker {
  font-family: var(--serif-en);
  font-weight: 600;
  font-size: clamp(36px, 8.5vw, 104px);
  line-height: 1;
  letter-spacing: -0.01em;
  white-space: nowrap;
  color: var(--ink);
}

/* Narrower than a 390 px phone the row shrinks with the screen, so three columns stay on one line inside the page
   and no name breaks (现金 would otherwise stack its two characters). */
@media (max-width: 389px) {
  .holdings,
  .holding {
    gap: clamp(6px, 2.2vw, 10px);
  }

  .ticker,
  .plus {
    font-size: clamp(28px, 11.4vw - 8.5px, 36px);
  }
}

:lang(zh) .ticker.is-cash {
  font-family: var(--serif-zh);
}

.weight {
  margin-top: clamp(12px, 1.6vw, 20px);
  font-family: var(--rounded);
  font-weight: 800;
  font-size: clamp(22px, 3.2vw, 38px);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--ink2);
}

.category {
  min-height: 1.4em;
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--secondary);
}

.weight-dots {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: clamp(32px, 4vw, 48px);
}

.weight-group {
  display: flex;
  gap: 6px;
}

.weight-group .dot {
  width: 8px;
  height: 8px;
  background: var(--ink2);
}

/* Cash: a ring, not a filled dot. */
.weight-group.is-cash .dot {
  background: transparent;
  border: 1.5px solid var(--tertiary);
}

.since {
  margin-top: 22px;
  font-size: 15px;
  color: var(--secondary);
}

/* ---------------------------------------------------------------- sections and cards */

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 14px;
}

h2 {
  margin: 0;
  font-family: var(--serif-en);
  font-weight: 600;
  font-size: clamp(24px, 3vw, 30px);
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink);
}

:lang(zh) :is(h2, .quiet-title) {
  font-family: var(--serif-zh);
}

.fact {
  font-size: 14px;
  color: var(--secondary);
  font-variant-numeric: tabular-nums;
}

.card {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.perf-card {
  padding: clamp(20px, 3vw, 32px);
}

/* ---------------------------------------------------------------- since inception */

.figures {
  display: flex;
  flex-wrap: wrap;
  gap: 24px clamp(32px, 6vw, 72px);
}

.figure-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--ink2);
}

.key-line {
  width: 18px;
  height: 2px;
  border-radius: 1px;
  background: var(--ink);
}

.key-dots {
  display: inline-flex;
  gap: 3px;
}

.key-dots .dot {
  width: 3px;
  height: 3px;
  background: var(--secondary);
}

.figure-value {
  margin-top: 6px;
  font-family: var(--rounded);
  font-weight: 800;
  font-size: clamp(32px, 4.4vw, 44px);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.figure-value.is-spy {
  color: var(--secondary);
}

.figure-note {
  margin-top: 6px;
  font-size: 13px;
  color: var(--secondary);
  font-variant-numeric: tabular-nums;
}

.compare {
  margin-top: 18px;
  font-size: 15px;
  color: var(--ink2);
}

.chart {
  display: flex;
  gap: 10px;
  margin-top: 28px;
}

.plot {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  height: 260px;
  border-radius: 4px;
  touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
}

.plot svg {
  position: absolute;
  inset: 0;
  overflow: visible;
}

.line-base {
  stroke: var(--tertiary);
  stroke-width: 1;
  stroke-dasharray: 4 5;
}

.line-spy {
  fill: none;
  stroke: var(--secondary);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-dasharray: 0 6;
}

.line-portfolio {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mark-portfolio {
  fill: var(--ink);
}

.mark-spy {
  fill: var(--card);
  stroke: var(--secondary);
  stroke-width: 2;
}

.crosshair {
  stroke: var(--tertiary);
  stroke-width: 1;
}

.base-label {
  position: absolute;
  left: 0;
  transform: translateY(-140%);
  white-space: nowrap;
  font-size: 12px;
  line-height: 1.6;
  color: var(--secondary);
  /* A halo of card colour keeps it legible where a line runs through it. */
  text-shadow: 0 0 2px var(--card), 0 0 2px var(--card), 0 0 4px var(--card);
  pointer-events: none;
}

/* Below the dashed line when the lines start out above it. */
.base-label.is-below {
  transform: translateY(40%);
}

.end-labels {
  position: relative;
  flex: 0 0 96px;
  height: 260px;
  font-variant-numeric: tabular-nums;
}

.end-label {
  position: absolute;
  left: 6px;
  transform: translateY(-50%);
  font-size: 13px;
  line-height: 1.25;
  white-space: nowrap;
}

.end-label .num {
  display: block;
  font-family: var(--rounded);
  font-weight: 800;
}

.end-label.is-portfolio {
  font-weight: 600;
  color: var(--ink);
}

.end-label.is-spy {
  color: var(--secondary);
}

.axis {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 10px;
  padding-right: 106px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--secondary);
  font-variant-numeric: tabular-nums;
}

/* A date never breaks; on a narrow plot the last one runs on under the end labels, where the row is empty. */
.axis span {
  white-space: nowrap;
}

/* The hover readout: one small card, values first. */
.tip {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  min-width: 112px;
  padding: 8px 12px 9px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: var(--card);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  font-size: 13px;
  line-height: 1.5;
  white-space: nowrap;
  pointer-events: none;
}

.tip-date {
  margin-bottom: 2px;
  color: var(--secondary);
  font-variant-numeric: tabular-nums;
}

.tip-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--secondary);
}

.tip-row strong {
  font-family: var(--rounded);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.tip-row .key-line {
  width: 12px;
}

.tip-row .key-dots {
  width: 12px;
  gap: 1.5px;
}

.tip-row .key-dots .dot {
  width: 3px;
  height: 3px;
}

.empty {
  padding: clamp(40px, 6vw, 72px) 12px;
}

/* ---------------------------------------------------------------- money flows */

.flows {
  margin-top: clamp(48px, 6vw, 72px);
}

.flows-card {
  padding: clamp(18px, 2.4vw, 24px) clamp(18px, 2.4vw, 24px) 6px;
}

.flows-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  padding-bottom: 16px;
}

.flow-dots {
  display: flex;
  gap: 6px;
}

.flow-dots .dot {
  width: 9px;
  height: 9px;
}

.flow-dots .is-withdrawal {
  background: var(--ink2);
}

.flow-dots .is-rotation {
  border: 1.5px solid var(--secondary);
}

.flow-dots .is-neutral {
  background: var(--pill);
}

.flow-dots .is-missing {
  border: 1.5px dashed var(--tertiary);
}

.flows-text {
  font-size: 15px;
  color: var(--ink2);
}

.flow-rows {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  column-gap: 40px;
}

.flow-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 8px 0;
  border-top: 1px solid var(--hairline);
}

.flow-text {
  flex: 1 1 auto;
  min-width: 0;
}

.flow-name {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink);
}

.flow-value {
  font-size: 13px;
  line-height: 1.5;
  color: var(--secondary);
  font-variant-numeric: tabular-nums;
}

.pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.pill.is-withdrawal {
  background: var(--inkfill);
  color: var(--onink);
}

.pill.is-rotation {
  background: var(--card);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--pill);
}

.pill.is-neutral {
  background: var(--track);
  color: var(--ink);
}

/* A dashed edge means "not there yet". */
.pill.is-missing {
  border: 1px dashed var(--dash);
  color: var(--secondary);
}

/* ---------------------------------------------------------------- footer */

.foot {
  margin-top: clamp(64px, 8vw, 96px);
  padding: 28px 0 48px;
  border-top: 1px solid var(--hairline);
  font-size: 13px;
  line-height: 1.7;
  color: var(--secondary);
}

.foot p:first-child {
  max-width: 46em;
}

.foot p + p {
  margin-top: 10px;
}

.noscript {
  padding: 64px 0;
  font-size: 15px;
  color: var(--secondary);
  text-align: center;
}

/* ---------------------------------------------------------------- motion and contrast */

@media (prefers-reduced-motion: no-preference) {
  .content {
    animation: fade-in 0.3s var(--ease) both;
  }

  @keyframes fade-in {
    from {
      opacity: 0;
    }

    to {
      opacity: 1;
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .lang button,
  .retry {
    transition: none;
  }
}

@media (prefers-contrast: more) {
  body::before {
    display: none;
  }

  :root {
    --hairline: rgba(28, 28, 30, 0.25);
  }
}

@media (prefers-contrast: more) and (prefers-color-scheme: dark) {
  :root {
    --hairline: rgba(242, 241, 237, 0.25);
  }
}
