/* Wharton Investment Competition. Penn navy and red; chart series validated with the dataviz palette checker. */
:root { --w-blue: #011f5b; --w-red: #990000; --w-ink: var(--ink); --w-quiet: var(--muted);
  --w-s1: #2c5ea8; --w-s2: #c0392b; --w-s3: #1f8a70; --w-grid: rgba(0, 0, 0, 0.07); --w-cut: #b9c0ca; --w-f: #c0392b; --w-blank: #e3e7ee; --w-blank-ink: #3d4b63;
  --w-sec-tech: #e4ebfb; --w-sec-health: #e2f3ea; --w-sec-staples: #fbecdd; --w-sec-util: #ede6fb; --w-sec-fin: #dff1f4; --w-sec-comm: #fbe6ed; --w-sec-energy: #f8f0d4; --w-sec-bonds: #eaecef; }
:root[data-theme="dark"] { --w-blue: #b6c9df; --w-red: #ef8585; --w-s1: #5b8fd9; --w-s2: #e06458; --w-s3: #2f9e7e; --w-grid: rgba(255, 255, 255, 0.08); --w-cut: #4a5260; --w-f: #e06458; --w-blank: #2a3242; --w-blank-ink: #c4cfdf;
  --w-sec-tech: #22304f; --w-sec-health: #1c3a31; --w-sec-staples: #3d2e1c; --w-sec-util: #31284c; --w-sec-fin: #1a3843; --w-sec-comm: #452433; --w-sec-energy: #3d3720; --w-sec-bonds: #2a2e35; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --w-blue: #b6c9df; --w-red: #ef8585; --w-s1: #5b8fd9; --w-s2: #e06458; --w-s3: #2f9e7e; --w-grid: rgba(255, 255, 255, 0.08); --w-cut: #4a5260; --w-f: #e06458; --w-blank: #2a3242; --w-blank-ink: #c4cfdf;
  --w-sec-tech: #22304f; --w-sec-health: #1c3a31; --w-sec-staples: #3d2e1c; --w-sec-util: #31284c; --w-sec-fin: #1a3843; --w-sec-comm: #452433; --w-sec-energy: #3d3720; --w-sec-bonds: #2a2e35; } }

/* ---------- hero: the funnel on a Penn-navy wall ---------- */
#hero { background: #011f5b; }
.w-wall { position: absolute; inset: 0; background:
  radial-gradient(80% 90% at 100% 0%, rgba(84, 132, 196, 0.6) 0%, rgba(84, 132, 196, 0) 62%),
  linear-gradient(180deg, #0a2a68 0%, #0e3478 55%, #123d86 100%); }
:root[data-theme="dark"] .w-wall { filter: brightness(0.7); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .w-wall { filter: brightness(0.7); } }
.w-stage { position: absolute; left: 0; top: 0; width: 1200px; height: 720px; transform-origin: 0 0; }
.w-stage canvas { position: absolute; left: 0; top: 0; width: 1200px; height: 720px; }
.w-hero-copy { position: absolute; left: 64px; top: 138px; width: 286px; color: #fff; }
.w-hero-copy .w-n { position: relative; display: block; margin: 0 0 2px; font: 500 96px/1 var(--sans); letter-spacing: -4px; font-variant-numeric: tabular-nums; }
.w-hero-copy .w-n-size { visibility: hidden; }
.w-hero-copy #h-n { position: absolute; left: 0; top: 0; }
.w-hero-copy .w-unit { font: 400 18px/26px var(--sans); color: rgba(255, 255, 255, 0.7); }
.w-rail { list-style: none; margin: 34px 0 0; padding: 0; }
.w-rail li { display: flex; gap: 14px; align-items: baseline; padding: 6px 0; font: 400 16px/22px var(--sans); color: rgba(255, 255, 255, 0.34); transition: color 0.14s ease; }
.w-rail li b { width: 34px; flex: none; text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; }
.w-rail li.past { color: rgba(255, 255, 255, 0.58); }
.w-rail li.on { color: #fff; }
.w-note { margin: 16px 0 0 48px; min-height: 69px; font: 400 14px/23px var(--sans); color: rgba(255, 255, 255, 0.7); }

/* ---------- shared demo pieces ---------- */
.w-top { position: absolute; left: 24px; right: 24px; top: 20px; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; pointer-events: none; }
.w-top .w-step { color: var(--w-quiet); font: 400 12px/17px var(--sans); }
.w-top h3 { margin: 4px 0 0; font: 500 16px/22px var(--sans); color: var(--ink); letter-spacing: -0.2px; }
.w-top p { margin: 3px 0 0; font: 400 12px/17px var(--sans); color: var(--ink-2); max-width: 380px; }
.w-big { font: 500 38px/1 var(--sans); letter-spacing: -1.5px; color: var(--ink); font-variant-numeric: tabular-nums; text-align: right; }
.w-big small { display: block; margin-top: 6px; font: 400 11px/14px var(--sans); letter-spacing: 0; color: var(--w-quiet); }
.w-tip { position: absolute; z-index: 10; pointer-events: none; min-width: 150px; max-width: 250px; padding: 9px 11px; border-radius: 9px;
  background: var(--bg); color: var(--ink); box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.14), 0 8px 24px rgba(0, 0, 0, 0.14);
  font: 400 12px/17px var(--sans); opacity: 0; transition: opacity 0.12s ease; }
.w-tip.on { opacity: 1; }
.w-tip b { font-weight: 600; }
.w-tip span { display: block; color: var(--ink-2); }
.w-tip em { display: block; margin-top: 4px; font-style: normal; color: var(--ink); }
.w-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.w-svg { position: absolute; left: 0; top: 0; overflow: visible; }
.w-svg text { font: 400 11px var(--sans); fill: var(--w-quiet); }
.w-svg .lbl { fill: var(--ink); font-weight: 500; }
.w-svg .grid { stroke: var(--w-grid); stroke-width: 1; }
.w-svg .cross { stroke: var(--w-quiet); stroke-width: 1; stroke-dasharray: 2 3; opacity: 0; }

/* ---------- funnel ---------- */
#d-funnel { --h: 580px; }
#d-funnel canvas { position: absolute; left: 0; top: 0; }

/* ---------- client model ---------- */
#d-client { --h: 420px; }
.w-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.w-dot { stroke: var(--frame); stroke-width: 2; }

/* ---------- countries ---------- */
#d-countries { height: auto; min-height: 400px; padding: 20px 20px 18px; }
/* A tier list: one row per grade, the grade in a colored block, the countries as flags. */
.w-tiers { display: flex; flex-direction: column; gap: 6px; }
.w-tier { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.w-tier > b { flex: none; align-self: stretch; width: 54px; display: grid; place-items: center; border-radius: 8px; font: 600 24px/1 var(--sans); color: #1b1c1d; }
.t-a { background: #8fd3a2; } .t-b { background: #c9e38f; } .t-c { background: #f5dc85; } .t-d { background: #f4b985; } .t-f { background: #f09a96; }
.w-flags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.w-flags button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 0; border: 0; background: none; cursor: pointer;
  font: 400 11.5px/14px var(--sans); color: var(--ink-2); opacity: 0; transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.36s cubic-bezier(0.2, 0.9, 0.3, 1.2), color 0.14s; transition-delay: calc(var(--i) * 40ms); }
#d-countries.in .w-flags button { opacity: 1; transform: none; }
.w-flags img { display: block; width: 40px; height: 30px; border-radius: 4px; object-fit: cover; box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.14); transition: transform 0.14s ease; }
.w-flags button:hover { color: var(--ink); }
/* Since our report: each flag's fund return, and the tier's average at the end of the row. */
.w-flags em { height: 15px; font: 500 12px/15px var(--sans); font-style: normal; color: var(--ink); font-variant-numeric: tabular-nums; opacity: 0; transition: opacity 0.2s ease; }
#d-countries.ret .w-flags em { opacity: 1; }
.w-tavg { margin-left: auto; flex: none; text-align: right; font: 400 11.5px/15px var(--sans); color: var(--w-quiet); opacity: 0; transition: opacity 0.2s ease; }
.w-tavg b { display: block; font: 500 20px/24px var(--sans); color: var(--ink); letter-spacing: -0.4px; font-variant-numeric: tabular-nums; }
#d-countries.ret .w-tavg { opacity: 1; }
.w-flags button:hover img { transform: translateY(-2px); }
.w-crit { margin: 16px 2px 0; font: 400 12px/17px var(--sans); color: var(--w-quiet); }
.w-china { position: absolute; inset: 0; padding: 30px 32px; overflow: auto; opacity: 0; pointer-events: none; transition: opacity 0.3s ease; }
.w-china.on { opacity: 1; pointer-events: auto; }
.w-china .w-step { color: var(--w-quiet); font: 400 12px/17px var(--sans); }
.w-china blockquote { margin: 10px 0 22px; font: 500 19px/27px var(--sans); color: var(--ink); letter-spacing: -0.3px; }
.w-china p { margin: 0 0 10px; font: 400 14px/21px var(--sans); color: var(--ink-2); }
.w-tiers, .w-crit { transition: opacity 0.3s ease; }
.w-off { opacity: 0; pointer-events: none; }

/* ---------- scores ---------- */
#d-scores { --h: 460px; }
.w-card { position: absolute; inset: 0; padding: 24px 26px; opacity: 0; pointer-events: none; transition: opacity 0.3s ease; overflow: hidden; }
.w-card.on { opacity: 1; pointer-events: auto; }
.w-card h3 { margin: 0; font: 500 18px/24px var(--sans); color: var(--ink); }
.w-card .w-step { color: var(--w-quiet); font: 400 12px/17px var(--sans); }
.w-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 16px; }
.w-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px 18px; }
.w-metrics div { font: 400 12px/16px var(--sans); color: var(--w-quiet); }
.w-metrics b { display: block; font: 500 15px/20px var(--sans); color: var(--ink); font-variant-numeric: tabular-nums; }
.w-also { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 20px; }
.w-also div { font: 400 12px/16px var(--sans); color: var(--w-quiet); }
.w-also b { display: block; font: 500 22px/28px var(--sans); color: var(--ink); letter-spacing: -0.5px; }

/* ---------- sizing ---------- */
#d-sizing { --h: 600px; }
#z-key { position: absolute; left: 24px; right: 24px; top: 84px; margin: 0; }
#z-key span { white-space: normal; }
#z-wts .w-bars { top: 140px; }
#z-heat text.on { fill: var(--ink); font-weight: 600; }
.w-pair { display: grid; grid-template-columns: 46px 1fr 74px; align-items: center; gap: 8px; height: 19px; font: 400 11.5px/15px var(--sans); color: var(--ink-2); }
.w-pair > div { display: flex; flex-direction: column; gap: 2px; }
.w-pair i { display: block; height: 5px; border-radius: 0 3px 3px 0; background: var(--w-s1); }
.w-pair i.b { background: var(--w-s3); }
.w-pair span:last-child { text-align: right; color: var(--ink); font-variant-numeric: tabular-nums; }
.w-pair em { font-style: normal; color: var(--w-quiet); margin-left: 8px; }
.w-spark { display: block; margin: 7px 0 2px; overflow: visible; }
.w-spark path { fill: none; stroke: var(--w-s1); stroke-width: 1.5; stroke-linejoin: round; }
.w-spark .rep { stroke: var(--muted); stroke-dasharray: 2 3; }
.w-spark-x { display: flex !important; justify-content: space-between; margin-bottom: 5px; font-size: 10.5px; color: var(--w-quiet) !important; }
.w-spark-x i { font-style: normal; }
.w-rets { display: grid !important; grid-template-columns: 1fr auto; gap: 1px 12px; margin-top: 2px; color: var(--ink-2) !important; }
.w-rets b { font-weight: 500; color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }
.w-cur, .w-nodata { margin-top: 4px; font-size: 11px; color: var(--w-quiet) !important; }
.w-tip em + .w-spark { margin-top: 8px; }
.w-bars { position: absolute; left: 24px; right: 24px; top: 84px; bottom: 16px; }
.w-sector { font: 500 12px/17px var(--sans); color: var(--ink); margin: 10px 0 3px; }
.w-sector span { color: var(--w-quiet); font-weight: 400; margin-left: 4px; }
.w-bar { position: relative; display: grid; grid-template-columns: 54px 1fr 46px; align-items: center; gap: 8px; height: 15px; font: 400 11.5px/15px var(--sans); color: var(--ink-2); }
.w-bar i { display: block; height: 7px; border-radius: 0 3px 3px 0; background: var(--w-s1); transform-origin: 0 50%; transition: transform 0.6s cubic-bezier(0.3, 0.9, 0.3, 1); }
.w-bar span:last-child { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); }
.w-cols { columns: 2; column-gap: 28px; }
.w-cols > div { break-inside: avoid; }

/* ---------- performance ---------- */
#d-performance { --h: 580px; }
.w-end { cursor: pointer; }
.w-hold-head { position: absolute; left: 16px; right: 16px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font: 400 12.5px/18px var(--sans); color: var(--ink-2); }
.w-hold-head b { font-weight: 500; color: var(--ink); }
.w-hold { position: absolute; left: 16px; }
.w-key { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; font: 400 11.5px/16px var(--sans); color: var(--w-quiet); }
.w-key span { white-space: nowrap; }
.w-key i { display: inline-block; width: 9px; height: 9px; margin-right: 5px; border-radius: 3px; background: var(--c); vertical-align: -0.5px; }
#p-main, #p-risk { padding: 0; }
.w-stats { position: absolute; left: 24px; right: 24px; display: grid; grid-template-columns: minmax(0, 1fr) repeat(3, minmax(64px, auto)); gap: 7px 22px; align-items: baseline; font: 400 13px/18px var(--sans); }
.w-stats > b { font: 400 12px/17px var(--sans); color: var(--w-quiet); text-align: right; }
.w-stats span { color: var(--ink-2); white-space: nowrap; }
.w-stats strong { font-weight: 500; color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }
.w-stats strong.q { font-weight: 400; color: var(--w-quiet); }

/* ---------- the final: Wharton's photo ---------- */
#d-field { height: auto; }
#d-field img { display: block; width: 100%; height: auto; aspect-ratio: 1600 / 1067; object-fit: cover; }

@media (max-width: 699px) { .w-hero-copy { display: none; } }
@media (max-width: 640px) {
  #d-funnel { --h: 600px; }
  #d-countries { padding: 16px 16px 14px; }
  .w-tier > b { width: 44px; font-size: 20px; }
  .w-flags { gap: 6px 10px; }
  #d-scores { --h: 470px; }
  .w-metrics { grid-template-columns: repeat(2, 1fr); }
  #d-sizing { --h: 760px; }
  .w-pair { height: 16px; }
  #d-client { --h: 460px; }
  #z-wts .w-bars { top: 178px; }
  #d-performance { --h: 640px; }
  .w-stats { gap: 6px 12px; font-size: 12px; }
  .w-cols { columns: 1; }
  .w-big { font-size: 30px; }
  .w-china blockquote { font-size: 16px; line-height: 23px; }
}
@media (prefers-reduced-motion: reduce) {
  .w-bar i, .w-china, .w-card, .w-tiers, .w-crit, .w-tip, .w-flags button, .w-flags em, .w-tavg { transition: none; }
}
