/* etf.gf.cx — specimen-book idiom picked up from patterns.gf.cx.
   Same root variables, sans/serif/mono triplet, paper grain. Publication
   visual language wrapped around a cockpit-style tab + table layout. */

:root {
  --bg: #f7f3ec; --bg-warm: #ebe3d5; --bg-card: rgba(255, 255, 255, 0.6);
  --ink: #1a1816; --ink-soft: #5a544d; --accent: #2c4a3a;
  --line: rgba(26, 24, 22, 0.12); --line-strong: rgba(26, 24, 22, 0.32);
  --red: #a83333; --amber: #8b4513; --green: #1f6b3d; --blue: #1a6a8a;
  --sans: 'Atkinson Hyperlegible', Verdana, Tahoma, sans-serif;
  --serif: 'Newsreader', 'Times New Roman', Georgia, serif;
  --mono: ui-monospace, 'SF Mono', monospace;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--sans);
  font-size: 17px; line-height: 1.6; -webkit-font-smoothing: antialiased;
  position: relative;
}
body::before {
  content: ''; position: fixed; inset: 0;
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.1 0 0 0 0 0.09 0 0 0 0 0.08 0 0 0 0 0.08 0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.45; mix-blend-mode: multiply; pointer-events: none; z-index: 0;
}
main.page { position: relative; z-index: 1;
  max-width: 1100px; margin: 0 auto; padding: 2rem 1.5rem 4rem;
}
em { font-family: var(--serif); font-style: italic; color: var(--accent); font-weight: 400; }
a { color: inherit; text-decoration: underline; text-underline-offset: 3px;
    text-decoration-color: var(--line-strong); }
a:hover { color: var(--accent); text-decoration-color: var(--accent); }
code { font-family: var(--mono); font-size: 0.88em;
       background: rgba(26,24,22,0.06); padding: 1px 5px; border-radius: 3px; }

/* Top nav --------------------------------------------------------- */
.nav { font-size: 13px; letter-spacing: 1.4px; text-transform: uppercase;
       font-weight: 700; color: var(--ink-soft); margin-bottom: 1.25rem; }

/* Volume mark + identity card ------------------------------------ */
.vol-mark {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.3em;
  text-transform: uppercase; color: var(--ink-soft); opacity: 0.75;
  padding-bottom: 6px; border-bottom: 1px solid var(--line);
  display: inline-block; margin-bottom: 18px;
}
.identity {
  background: var(--bg-card); border: 1px solid var(--line-strong);
  border-radius: 8px; padding: 28px 30px 24px; margin-bottom: 28px;
  display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap;
}
.identity__icon { width: 72px; height: 72px; flex-shrink: 0; color: var(--accent); }
.identity__icon img { width: 100%; height: 100%; display: block; }
.identity__body { flex: 1; min-width: 250px; }
.identity__kicker {
  font-size: 13px; letter-spacing: 1.4px; text-transform: uppercase;
  font-weight: 700; color: var(--blue); margin-bottom: 8px;
}
.identity__name {
  font-family: var(--serif); font-weight: 400; font-style: italic;
  font-size: 60px; line-height: 1.0; letter-spacing: -0.8px;
}
.identity__name em { color: var(--accent); }
.identity__sub {
  font-size: 19px; margin-top: 14px; color: var(--ink-soft);
  line-height: 1.55; max-width: 65ch;
}
.identity__sub code { font-size: 14px; }
@media (max-width: 600px) { .identity__name { font-size: 42px; } }

/* Tabs in publication idiom -------------------------------------- */
.tabs__head {
  display: flex; align-items: baseline; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; margin: 36px 0 0;
  padding-bottom: 14px; border-bottom: 1px solid var(--line-strong);
}
.tabs__label {
  font-size: 13px; letter-spacing: 1.6px; text-transform: uppercase;
  font-weight: 700; color: var(--ink-soft);
}
.tabs {
  display: flex; gap: 4px; margin: 14px 0 28px; flex-wrap: wrap;
  padding-bottom: 12px; border-bottom: 1px solid var(--line);
}
.tab {
  font: inherit; font-family: var(--serif); font-style: italic;
  font-size: 22px; padding: 8px 16px 6px; background: transparent; border: 0;
  border-bottom: 2px solid transparent; cursor: pointer;
  color: var(--ink-soft); letter-spacing: -0.2px;
  transition: color .15s, border-color .15s;
}
.tab:hover:not(:disabled) { color: var(--ink); }
.tab.is-active { color: var(--accent); border-bottom-color: var(--accent); }
.tab--placeholder { opacity: 0.5; cursor: default; }
.tab .badge {
  font-family: var(--mono); font-size: 11px; margin-left: 6px;
  font-style: normal; letter-spacing: 0;
}
.badge-alert {
  background: var(--amber); color: var(--bg); padding: 1px 8px;
  border-radius: 10px; font-weight: 700;
}
.badge-ok {
  background: var(--green); color: var(--bg); padding: 1px 8px;
  border-radius: 10px; font-weight: 700;
}

/* Panels --------------------------------------------------------- */
.panel { display: none; }
.panel.is-active { display: block;
                   animation: panel-in 0.35s cubic-bezier(0.2, 0.7, 0.3, 1) backwards; }
@keyframes panel-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) { .panel.is-active { animation: none; } }

/* Filter controls ------------------------------------------------ */
.controls {
  display: flex; flex-wrap: wrap; gap: 14px 18px; align-items: flex-end;
  margin-bottom: 18px; padding: 16px 18px;
  background: var(--bg-card); border: 1px solid var(--line); border-radius: 6px;
}
.controls label {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--ink-soft); font-weight: 700;
}
.controls select, .controls input {
  font: inherit; font-family: var(--sans); font-size: 14px; padding: 6px 8px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 3px;
  color: var(--ink); min-width: 140px; text-transform: none; letter-spacing: 0;
  font-weight: 400;
}
.controls input { min-width: 100px; }
.result-count {
  font-family: var(--mono); font-size: 12px; color: var(--ink-soft);
  margin-left: auto; align-self: center; padding-bottom: 4px;
}

/* Publication-style tables --------------------------------------- */
.table-wrap {
  overflow-x: auto; border: 1px solid var(--line); border-radius: 6px;
  background: var(--bg);
  box-shadow: 0 1px 0 rgba(26,24,22,0.04), 0 8px 22px -16px rgba(26,24,22,0.18);
}
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
thead th {
  background: var(--bg-warm); text-align: left;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--ink-soft); font-weight: 700;
  padding: 10px 12px; border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
}
thead th.num { text-align: right; }
tbody td {
  padding: 9px 12px; border-bottom: 1px solid var(--line);
  vertical-align: middle; line-height: 1.5;
}
tbody tr:last-child td { border-bottom: 0; }
tbody td.num {
  text-align: right; font-family: var(--mono); font-size: 13px;
  font-variant-numeric: tabular-nums;
}
tbody tr:hover { background: var(--bg-warm); }
tbody td.ticker {
  font-family: var(--mono); font-weight: 700;
  color: var(--accent); letter-spacing: 0.04em;
}
.pos { color: var(--green); }
.neg { color: var(--red); }

/* Portfolio header strip ----------------------------------------- */
.portfolio-header { margin-bottom: 18px; }
.ph-totals {
  display: flex; flex-wrap: wrap; gap: 24px 36px;
  padding: 18px 22px; background: var(--bg-card);
  border: 1px solid var(--line-strong); border-radius: 8px;
  margin-bottom: 8px;
}
.ph-item { display: flex; flex-direction: column; gap: 3px; }
.ph-label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--ink-soft); font-weight: 700;
}
.ph-value {
  font-family: var(--mono); font-size: 20px;
  font-variant-numeric: tabular-nums; color: var(--ink);
}
.hint { font-size: 13px; color: var(--ink-soft); padding: 6px 2px; line-height: 1.55; }

/* Rebalance — specimen plates ------------------------------------ */
.rebalance-meta {
  padding: 14px 18px; background: var(--bg-card);
  border: 1px solid var(--line-strong); border-radius: 8px;
  margin-bottom: 20px; font-size: 14px; color: var(--ink-soft);
}
.rebalance-meta-row { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.rebalance-meta strong { color: var(--ink); font-weight: 700; }
.rebalance-meta .dot { opacity: 0.45; }

.rebalance-empty {
  padding: 22px 24px; background: var(--bg-card);
  border: 1px solid var(--line-strong); border-radius: 8px;
  text-align: center; color: var(--green); font-weight: 700;
  font-family: var(--serif); font-style: italic; font-size: 22px;
}

.rebalance-cards {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
}

.rb-card {
  position: relative;
  background: var(--bg-warm); border: 1px solid var(--line);
  border-radius: 6px; padding: 18px 20px 16px;
  display: flex; flex-direction: column; gap: 12px;
  box-shadow: 0 1px 0 rgba(26,24,22,0.04),
              0 8px 22px -10px rgba(26,24,22,0.18);
  animation: card-in 0.5s cubic-bezier(0.2, 0.7, 0.3, 1) backwards;
}
.rb-card:nth-child(1) { animation-delay: 0.05s; }
.rb-card:nth-child(2) { animation-delay: 0.12s; }
.rb-card:nth-child(3) { animation-delay: 0.19s; }
.rb-card:nth-child(4) { animation-delay: 0.26s; }
.rb-card:nth-child(5) { animation-delay: 0.33s; }
.rb-card:nth-child(6) { animation-delay: 0.40s; }
@keyframes card-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) { .rb-card { animation: none; } }

.rb-card::before {
  content: attr(data-plate);
  position: absolute; top: 12px; right: 14px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--ink-soft); opacity: 0.7;
}
.rb-card.rb-trim { border-left: 4px solid var(--amber); }
.rb-card.rb-add  { border-left: 4px solid var(--green); }

.rb-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.rb-action {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.14em;
  font-weight: 700; color: var(--ink-soft);
}
.rb-card.rb-add  .rb-action { color: var(--green); }
.rb-card.rb-trim .rb-action { color: var(--amber); }
.rb-ticker {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: 32px; line-height: 1; color: var(--accent); letter-spacing: -0.5px;
}
.rb-amount {
  margin-left: auto; font-family: var(--mono); font-size: 18px;
  font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink);
}
.rb-name { font-size: 13.5px; color: var(--ink-soft);
           font-family: var(--serif); font-style: italic; line-height: 1.4; }

.rb-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 10px 4px; padding: 12px 0; border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.rb-grid div { display: flex; flex-direction: column; gap: 2px; }
.rb-grid dt {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--ink-soft); font-weight: 700;
}
.rb-grid dd {
  font-family: var(--mono); font-size: 13px;
  font-variant-numeric: tabular-nums; color: var(--ink);
}

.rb-alts { display: flex; flex-direction: column; gap: 8px; }
.rb-alts-label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--ink-soft); font-weight: 700;
}
.rb-alts-label code { text-transform: none; letter-spacing: 0; font-size: 10.5px; }
.rb-alts-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.alt-chip {
  display: inline-block; padding: 5px 11px;
  background: var(--bg); border: 1px solid var(--line-strong);
  border-radius: 14px; font-family: var(--mono);
  font-size: 12px; font-weight: 700; color: var(--accent);
  text-decoration: none; transition: background .15s, border-color .15s, color .15s;
}
.alt-chip:hover {
  background: var(--accent); color: var(--bg); border-color: var(--accent);
  text-decoration: none;
}
.alt-empty {
  font-size: 12px; color: var(--ink-soft);
  font-family: var(--serif); font-style: italic;
}

/* Footer --------------------------------------------------------- */
.foot {
  margin-top: 56px; padding-top: 18px; border-top: 1px solid var(--line);
  font-size: 13px; color: var(--ink-soft);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
}
.foot .dot { opacity: 0.45; }
.foot a { color: var(--accent); text-decoration-color: var(--line-strong); }
