/* Portfolio site — plain CSS, no build step.
   Tiers: 1 = hero (2x2 cells), 2 = wide (2x1), 3 = standard (1x1), 4 = compact (1x1, name only). */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --text: #15181d;
  --muted: #5f6673;
  --line: rgba(20, 24, 31, 0.08);
  --shadow: 0 1px 2px rgba(16, 20, 28, 0.05), 0 6px 20px -10px rgba(16, 20, 28, 0.18);
  --shadow-hover: 0 2px 6px rgba(16, 20, 28, 0.06), 0 18px 40px -16px rgba(16, 20, 28, 0.32);
  --accent: #1f6feb;
  --spot: rgba(31, 111, 235, 0.10);
  --badge-exit-bg: #e8f5ec;  --badge-exit-fg: #1b6b3a;
  --badge-ipo-bg: #efe9fb;   --badge-ipo-fg: #5a34b3;
  --badge-cof-bg: #fff2df;   --badge-cof-fg: #9a5b00;
  --radius: 16px;
  --gap: 12px;
  --cell: 150px;
}

/* Dark theme: opt-in only. The page is light by default and does NOT follow
   the OS setting. To enable later, add data-theme="dark" to <html> (and, if
   wanted, a toggle that sets it). Everything below stays ready for that. */
:root[data-theme="dark"] {
    --bg: #0f1115;
    --surface: #181b21;
    --surface-2: #1f232b;
    --text: #eef0f4;
    --muted: #9aa3b2;
    --line: rgba(255, 255, 255, 0.08);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
    --shadow-hover: 0 2px 6px rgba(0, 0, 0, 0.35), 0 22px 44px -16px rgba(0, 0, 0, 0.7);
    --accent: #6ea4ff;
    --spot: rgba(110, 164, 255, 0.12);
    --badge-exit-bg: #17331f;  --badge-exit-fg: #8fdca6;
    --badge-ipo-bg: #2a1f4d;   --badge-ipo-fg: #c9b6ff;
    --badge-cof-bg: #3a2a0c;   --badge-cof-fg: #ffc978;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }

/* Header */
.site-header { padding: 44px 0 18px; }
.title { font-size: 34px; letter-spacing: -0.02em; margin: 0 0 6px; font-weight: 700; }
.subtitle { margin: 0; color: var(--muted); max-width: 60ch; }

/* Sector nav */
.sector-nav {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.sector-nav ul {
  list-style: none; margin: 0; padding: 10px 0;
  display: flex; flex-wrap: wrap; gap: 6px;
}
.sector-nav a {
  display: inline-block; white-space: nowrap;
  padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 500;
  color: var(--muted); background: transparent;
  transition: background .15s ease, color .15s ease;
}
.sector-nav a:hover { background: var(--surface-2); color: var(--text); }
.sector-nav a.active { background: var(--text); color: var(--bg); }
.sector-nav .count { opacity: .55; margin-left: 4px; font-variant-numeric: tabular-nums; }

/* Sections */
.sector { padding: 30px 0 6px; scroll-margin-top: calc(var(--nav-h, 0px) + 8px); }
.sector-head { display: flex; align-items: baseline; gap: 10px; margin: 0 0 12px; }
.sector-head h2 { font-size: 20px; margin: 0; letter-spacing: -0.01em; }
.sector-head .n { color: var(--muted); font-size: 13px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--cell), 1fr));
  grid-auto-rows: var(--cell);
  grid-auto-flow: dense;
  gap: var(--gap);
}

/* Cards */
.card {
  position: relative;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  will-change: transform;
  -webkit-tap-highlight-color: transparent;
}
.card::before {            /* soft spotlight that follows the pointer */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%), var(--spot), transparent 60%);
  opacity: 0; transition: opacity .25s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: transparent; }
.card:hover::before { opacity: 1; }
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.card.no-link { cursor: default; }
.card.no-link:hover { transform: none; }

.card .logo {
  display: flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; border-radius: 14px;
  background: var(--surface-2);
  overflow: hidden; flex: none;
  transition: transform .25s ease;
}
.card:hover .logo { transform: scale(1.04); }
.card .logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.card .logo.pad img { width: 84%; height: 84%; }
/* Wordmark-shaped logos get a wider box on the big tiles so they stay legible. */
.card.t1 .logo.pad { width: 224px; }
.card.t2 .logo.pad { width: 128px; }
/* Light marks get a dark tile in light mode; dark marks get a light tile in dark mode. */
.card .logo.tone-light { background: #1c2028; }
:root[data-theme="dark"] .card .logo.tone-light { background: var(--surface-2); }
:root[data-theme="dark"] .card .logo.tone-dark { background: #e9ecf1; }
.card .logo.mono { color: #fff; font-weight: 700; letter-spacing: .02em; font-size: 20px; }

.card .meta { min-width: 0; position: relative; z-index: 1; }
.card .name {
  font-weight: 600; font-size: 15px; line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card .year {
  color: var(--muted); font-size: 12px; line-height: 1.3; margin-top: 2px;
  font-variant-numeric: tabular-nums; letter-spacing: .02em;
}
.card .badges { position: absolute; top: 10px; right: 10px; display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }

/* Tier sizing */
.card.t1 { grid-column: span 2; grid-row: span 2; padding: 20px; }
.card.t1 .logo { width: 112px; height: 112px; border-radius: 26px; }
.card.t1 .name { font-size: 22px; }
.card.t1 .year { font-size: 14px; }

.card.t2 { grid-column: span 2; flex-direction: row; justify-content: flex-start; align-items: center; gap: 14px; }
.card.t2 .logo { width: 72px; height: 72px; border-radius: 18px; }
.card.t2 .name { font-size: 17px; }
.card.t2 .badges { position: static; margin-top: 6px; justify-content: flex-start; }

.card.t4 { padding: 12px; }
.card.t4 .logo { width: 44px; height: 44px; border-radius: 12px; }
.card.t4 .logo.mono { font-size: 16px; }
.card.t4 .name { font-size: 13.5px; }
.card.t4 .year { font-size: 11.5px; }

/* Badges */
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600; letter-spacing: .02em; line-height: 1.5;
}
.badge-exit { background: var(--badge-exit-bg); color: var(--badge-exit-fg); }
.badge-ipo { background: var(--badge-ipo-bg); color: var(--badge-ipo-fg); }
.badge-cofounded { background: var(--badge-cof-bg); color: var(--badge-cof-fg); }

/* Footer */
.site-footer { padding: 40px 0 60px; color: var(--muted); font-size: 13px; }
.site-footer .sep { margin: 0 8px; }

/* Responsive */
@media (max-width: 720px) {
  :root { --cell: 128px; --gap: 10px; --radius: 14px; }
  /* Wrapped pills take 3-4 rows on a phone; don't pin them to the top. */
  .sector-nav { position: static; }
  .sector-nav ul { padding: 8px 0; gap: 5px; }
  .sector-nav a { font-size: 12px; padding: 5px 10px; }
  .site-header { padding: 28px 0 14px; }
  .title { font-size: 28px; }
  .card { padding: 12px; }
  .card .logo { width: 48px; height: 48px; }
  .card.t1 { padding: 16px; }
  .card.t1 .logo { width: 88px; height: 88px; border-radius: 22px; }
  .card.t1 .logo.pad { width: 176px; }
  .card.t2 .logo.pad { width: 104px; }
  .card.t1 .name { font-size: 19px; }
  .card.t2 .logo { width: 60px; height: 60px; }
  .card.t2 .name { font-size: 15px; }
}
@media (max-width: 400px) {
  :root { --cell: 108px; --gap: 8px; }
  .card.t2 { flex-direction: column; justify-content: space-between; align-items: flex-start; gap: 0; }
  .card.t2 .badges { position: absolute; margin: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .card, .card .logo, .card::before, .sector-nav a { transition: none; }
  .card:hover { transform: none; }
}
