/* ============================================================================
   Joshi Capital — styles
   Palette matched to aumj.live: warm cream ground, ink-brown type, tan accent.
   ============================================================================ */

:root {
  --cream:       #f4ebdb;   /* page ground        */
  --cream-deep:  #ead9bf;   /* sunken surfaces    */
  --paper:       #faf4e8;   /* raised cards       */

  --ink:         #2a1f17;   /* primary type       */
  --ink-muted:   #6b5b4a;   /* secondary type     */
  --ink-faint:   #94826d;   /* captions, labels   */

  --tan:         #b8956a;   /* accent             */
  --tan-soft:    rgba(184, 149, 106, 0.16);
  --line:        rgba(42, 31, 23, 0.14);
  --line-soft:   rgba(42, 31, 23, 0.08);

  --up:          #4a7c59;   /* gains  — muted forest green */
  --down:        #a84a38;   /* losses — warm brick         */

  --serif: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans:  "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono:  "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --wrap: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 28px;
}

h1, h2, h3 { margin: 0; font-weight: 400; letter-spacing: -0.01em; }

a { color: inherit; }

::selection { background: var(--tan); color: var(--cream); }

[hidden] { display: none !important; }

/* ── Masthead ─────────────────────────────────────────────────────────── */

.masthead {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(244, 235, 219, 0.85);
  backdrop-filter: saturate(1.3) blur(14px);
  -webkit-backdrop-filter: saturate(1.3) blur(14px);
  border-bottom: 1px solid var(--line-soft);
}

.masthead-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 68px;
}

.wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 12px;
  text-decoration: none;
}

.wordmark-mark {
  font-family: var(--serif);
  font-size: 26px;
  line-height: 1;
  color: var(--tan);
  letter-spacing: 0.02em;
}

.wordmark-name {
  font-family: var(--serif);
  font-size: 20px;
  color: var(--ink);
  letter-spacing: 0.01em;
}

.nav {
  display: flex;
  gap: 28px;
  font-size: 14px;
  color: var(--ink-muted);
}

.nav a {
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: color .16s, border-color .16s;
}

.nav a:hover { color: var(--ink); border-bottom-color: var(--tan); }

@media (max-width: 640px) {
  .masthead-inner { height: 56px; }
  .wordmark-name { display: none; }   /* the JC mark carries the brand */
  .nav { gap: 18px; font-size: 13px; }
}

/* Very narrow phones: keep all four nav links on one line */
@media (max-width: 400px) {
  .nav { gap: 11px; font-size: 12px; }
}

/* ── Hero ─────────────────────────────────────────────────────────────── */

.hero {
  padding: 96px 0 72px;
  border-bottom: 1px solid var(--line-soft);
  background:
    radial-gradient(1100px 460px at 50% -160px, rgba(184, 149, 106, 0.22), transparent 70%);
}

.eyebrow {
  margin: 0 0 26px;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.hero-aum {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 56px;
}

.hero-aum-figure {
  font-family: var(--serif);
  font-size: clamp(64px, 13vw, 136px);
  line-height: 0.94;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.hero-aum-note {
  font-size: 14px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tan);
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 12px 32px -18px rgba(42, 31, 23, 0.28);
}

.stat {
  background: var(--paper);
  padding: 26px 28px;
}

.stat-label {
  font-size: 12px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 12px;
}

.stat-value {
  font-family: var(--mono);
  font-size: 34px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
  color: var(--ink);
}

.stat-value.up   { color: var(--up); }
.stat-value.down { color: var(--down); }

.stat-period {
  margin: 0;
  font-size: 12.5px;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

.asof {
  margin: 26px 0 0;
  font-size: 13px;
  color: var(--ink-faint);
}

/* ── Contact page ─────────────────────────────────────────────────────── */

.contact-hero { min-height: 62vh; }

.contact-title {
  font-family: var(--serif);
  font-size: clamp(44px, 7vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin-bottom: 22px;
}

.contact-lede {
  max-width: 520px;
  margin: 0 0 44px;
  font-size: 16.5px;
  color: var(--ink-muted);
  line-height: 1.7;
}

.contact-card {
  max-width: 560px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 34px;
  box-shadow: 0 12px 32px -18px rgba(42, 31, 23, 0.28);
}

.contact-email {
  display: inline-block;
  margin: 4px 0 26px;
  font-family: var(--serif);
  font-size: clamp(24px, 4.4vw, 36px);
  color: var(--ink);
  text-decoration: none;
  border-bottom: 2px solid var(--tan);
  padding-bottom: 3px;
  word-break: break-all;
}

.contact-email:hover { color: var(--tan); }

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.contact-btn {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 22px;
  text-decoration: none;
  cursor: pointer;
  transition: background .16s, border-color .16s, color .16s;
}

.contact-btn:hover { border-color: var(--tan); }

.contact-btn-primary {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--cream);
}

.contact-btn-primary:hover { background: var(--tan); border-color: var(--tan); color: var(--ink); }

.contact-back { color: var(--ink-faint); text-decoration: none; }
.contact-back:hover { color: var(--ink); }

/* ── Sections ─────────────────────────────────────────────────────────── */

.section { padding: 76px 0; border-bottom: 1px solid var(--line-soft); }

.section-title {
  font-family: var(--serif);
  font-size: 16px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--tan);
  margin-bottom: 34px;
}

.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 32px;
  margin-bottom: 24px;
  box-shadow: 0 10px 28px -20px rgba(42, 31, 23, 0.25);
}

.panel:last-child { margin-bottom: 0; }

.panel-head { margin-bottom: 26px; }

.panel-head h3 {
  font-family: var(--serif);
  font-size: 27px;
  color: var(--ink);
}

.panel-sub {
  margin: 6px 0 0;
  font-size: 13.5px;
  color: var(--ink-faint);
}

.chart-scroll, .table-scroll { overflow-x: auto; }

.empty-note {
  margin: 0;
  padding: 26px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  color: var(--ink-faint);
  font-size: 14px;
  text-align: center;
}

/* ── Charts ───────────────────────────────────────────────────────────── */

svg.chart { display: block; width: 100%; height: auto; overflow: visible; }

.axis-line   { stroke: var(--line); stroke-width: 1; }
.grid-line   { stroke: var(--line-soft); stroke-width: 1; }
.axis-label  { fill: var(--ink-faint); font-family: var(--mono); font-size: 11px; }
.bar-value   { fill: var(--ink-muted); font-family: var(--mono); font-size: 11px; font-weight: 500; }
.bar-up      { fill: var(--up); }
.bar-down    { fill: var(--down); }
.bar-partial { opacity: 0.55; }
.chart-note {
  margin: 16px 0 0;
  font-size: 12.5px;
  color: var(--ink-faint);
}
.growth-line { fill: none; stroke: var(--tan); stroke-width: 2; stroke-linejoin: round; }
.growth-dot  { fill: var(--tan); }
.growth-area { fill: var(--tan-soft); }

/* ── Holdings pie ─────────────────────────────────────────────────────── */

.pie-layout {
  display: grid;
  grid-template-columns: minmax(260px, 380px) 1fr;
  gap: 40px;
  align-items: center;
}

.pie-chart { max-width: 380px; margin: 0 auto; width: 100%; }

.pie-slice {
  stroke: var(--paper);
  stroke-width: 1.5;
  transition: opacity .15s;
}

svg.pie:hover .pie-slice { opacity: 0.45; }
svg.pie .pie-slice:hover { opacity: 1; }

.pie-center-num {
  fill: var(--ink);
  font-family: var(--serif);
  font-size: 44px;
}

.pie-center-label {
  fill: var(--ink-faint);
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.pie-legend {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 7px 26px;
  align-content: center;
}

.legend-row {
  display: flex;
  align-items: baseline;
  gap: 9px;
  font-size: 13.5px;
  line-height: 1.45;
}

.legend-swatch {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  align-self: center;
}

.legend-name {
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.legend-name .ticker { margin-left: 7px; }

.legend-weight {
  margin-left: auto;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--ink-muted);
}

@media (max-width: 860px) {
  .pie-layout { grid-template-columns: 1fr; gap: 30px; }
}

/* ── Tables ───────────────────────────────────────────────────────────── */

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  min-width: 460px;
}

/* The statistics table is only two columns — it never needs a minimum width */
#table-stats { min-width: 0; }

.data-table th {
  text-align: left;
  font-weight: 500;
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding: 0 16px 12px 0;
  border-bottom: 1px solid var(--line);
}

.data-table td {
  padding: 15px 16px 15px 0;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-muted);
  vertical-align: top;
}

.data-table tr:last-child td { border-bottom: none; }

.data-table .cell-name { color: var(--ink); font-weight: 500; }

.data-table .num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
  color: var(--ink);
}

.ticker {
  display: inline-block;
  margin-left: 9px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-faint);
}

.up   { color: var(--up); }
.down { color: var(--down); }

/* ── Allocation bars ──────────────────────────────────────────────────── */

.alloc-row { margin-bottom: 20px; }
.alloc-row:last-child { margin-bottom: 0; }

.alloc-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 9px;
  font-size: 14.5px;
}

.alloc-weight {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--ink-muted);
}

.alloc-track {
  height: 7px;
  background: var(--cream-deep);
  border-radius: 4px;
  overflow: hidden;
}

.alloc-fill {
  height: 100%;
  background: var(--tan);
  border-radius: 4px;
}

/* ── Mandate ──────────────────────────────────────────────────────────── */

.mandate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(268px, 1fr));
  gap: 22px;
}

.mandate-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 30px;
  box-shadow: 0 10px 28px -20px rgba(42, 31, 23, 0.25);
}

.mandate-card h3 {
  font-family: var(--serif);
  font-size: 23px;
  margin-bottom: 12px;
}

.mandate-card p {
  margin: 0;
  font-size: 14.5px;
  color: var(--ink-muted);
  line-height: 1.68;
}

/* ── Footer ───────────────────────────────────────────────────────────── */

.footer { padding: 60px 0 76px; }

.footer-top {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--line-soft);
}

.footer-mark {
  margin: 0;
  font-family: var(--serif);
  font-size: 26px;
  color: var(--ink);
}

.footer-by {
  margin: 5px 0 0;
  font-size: 13.5px;
  color: var(--ink-faint);
}

.footer-contact {
  font-size: 14px;
  color: var(--ink);
  text-decoration: none;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 22px;
  transition: background .16s, border-color .16s, color .16s;
}

.footer-contact:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--cream);
}

.disclosure {
  list-style: none;
  margin: 30px 0 0;
  padding: 0;
  max-width: 720px;
}

.disclosure li {
  position: relative;
  margin-bottom: 12px;
  padding-left: 18px;
  font-size: 12.5px;
  line-height: 1.62;
  color: var(--ink-faint);
}

.disclosure li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 5px;
  height: 1px;
  background: var(--ink-faint);
}

.copyright {
  margin: 30px 0 0;
  font-size: 12.5px;
  color: var(--ink-faint);
}

@media (max-width: 640px) {
  .wrap    { padding: 0 18px; }
  .hero    { padding: 52px 0 44px; }
  .section { padding: 48px 0; }
  .panel   { padding: 20px; border-radius: 12px; }

  .eyebrow { margin-bottom: 18px; font-size: 11.5px; }

  .hero-aum { margin-bottom: 36px; }
  .hero-aum-figure { font-size: clamp(56px, 19vw, 88px); }
  .hero-aum-note { font-size: 12px; }

  /* Stat cards become compact label/value rows instead of tall stacked boxes */
  .stat-row { grid-template-columns: 1fr; }
  .stat {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 2px 14px;
    padding: 15px 18px;
  }
  .stat-label { margin: 0; }
  .stat-value { margin: 0; font-size: 23px; }
  .stat-period { flex-basis: 100%; margin: 2px 0 0; font-size: 11.5px; }

  .asof { margin-top: 18px; font-size: 12px; }

  .section-title { margin-bottom: 24px; }
  .panel-head { margin-bottom: 20px; }
  .panel-head h3 { font-size: 22px; }

  /* Pie: tighter two-column legend, tickers dropped to make names fit */
  .pie-chart { max-width: 300px; }
  .pie-legend {
    grid-template-columns: repeat(auto-fill, minmax(146px, 1fr));
    gap: 6px 18px;
  }
  .legend-row { font-size: 12px; gap: 7px; }
  .legend-swatch { width: 8px; height: 8px; }
  .legend-name .ticker { display: none; }

  .mandate-card { padding: 22px; }
  .mandate-card h3 { font-size: 20px; }

  .footer { padding: 44px 0 56px; }

  .contact-hero { min-height: 0; }
  .contact-card { padding: 24px; }
}
