/* ------------------------------------------------------------------
   IIMA Ventures — Portfolio
   Visual system modelled on greylock.com: paper background, charcoal
   type, hairline grid, light serif display + grotesque body.
   Accent swapped to IIMA red.
------------------------------------------------------------------- */

:root {
  --paper: #ededed;
  --paper-100: #fafafa;
  --paper-200: #e0e0e0;
  --charcoal: #2d2d24;
  --charcoal-900: #1f1e1d;
  --charcoal-600: #474643;
  --charcoal-500: #5c5b57;
  --charcoal-300: #b0b0aa;
  --charcoal-200: #cfcfca;
  --charcoal-100: #e7e7e5;
  --sage-200: #ddded3;
  --sage-300: #c9cabd;
  --stone: #65543e;
  --red: #ea3732;
  --red-dark: #c92b27;

  --font-display: "Montserrat", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Montserrat", "Helvetica Neue", Arial, sans-serif;

  --header-h: 88px;
  --layout-max: 1440px;
  --gutter: 32px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--charcoal);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.2;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
ul { list-style: none; margin: 0; padding: 0; }
[hidden] { display: none !important; }

.container {
  width: 100%;
  max-width: var(--layout-max);
  margin: 0 auto;
  padding: 0 16px;
}
@media (min-width: 1024px) { .container { padding: 0 var(--gutter); } }

/* Type scale (mirrors Greylock's .captions / .body / .h2) */
/* iimaventures.com labels: Montserrat Bold, 2px tracking, uppercase */
.captions {
  font-family: var(--font-body);
  font-size: 12px;
  line-height: 1.3;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  margin: 0;
}
.body { font-size: 16px; line-height: 1.5; margin: 0; font-weight: 500; }

.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 100;
  background: var(--charcoal); color: var(--paper); padding: 10px 14px;
}
.skip-link:focus { top: 8px; }

/* ---------------- Header (mirrors iimaventures.com) ---------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #fff;
  border-bottom: 1px solid var(--sage-200);
  transition: box-shadow .3s var(--ease);
}
.site-header.is-scrolled { box-shadow: 0 6px 24px rgba(31, 30, 29, .06); }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: var(--header-h);
}
.brand { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.brand img { height: 52px; width: auto; }
.brand-sub {
  font-size: 10px;
  font-weight: 500;
  color: var(--charcoal-500);
  white-space: nowrap;
}
@media (max-width: 767px) { .brand img { height: 42px; } .brand-sub { font-size: 9px; } :root { --header-h: 72px; } }

/* Desktop nav */
.site-nav > ul { display: flex; align-items: center; gap: 0; }
.nav-item { position: relative; }
.nav-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 20px 14px;
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: #222331;
  transition: color .2s var(--ease);
}
@media (min-width: 1280px) { .nav-link { font-size: 16px; padding: 20px 16px; } }
.nav-link:hover, .nav-link[aria-current="page"] { color: var(--red); }
.nav-link .caret { flex: none; transition: transform .25s var(--ease); }
.has-dropdown:hover .nav-link .caret, .has-dropdown.is-open .nav-link .caret { transform: rotate(180deg); }
.dropdown-toggle { display: none; }

.dropdown-menu {
  position: absolute; top: 100%; left: 8px;
  min-width: 220px;
  padding: 8px 0;
  background: #fff;
  border: 1px solid var(--sage-200);
  box-shadow: 0 16px 40px rgba(31, 30, 29, .12);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .2s var(--ease), transform .2s var(--ease), visibility 0s .2s;
}
.has-dropdown:hover .dropdown-menu, .has-dropdown.is-open .dropdown-menu, .has-dropdown:focus-within .dropdown-menu {
  opacity: 1; visibility: visible; transform: translateY(0); transition-delay: 0s;
}
.dropdown-menu a {
  display: block;
  padding: 10px 18px;
  font-size: 16px;
  font-weight: 400;
  color: #212529;
  white-space: nowrap;
  transition: background-color .15s, color .15s;
}
.dropdown-menu a:hover { background: var(--charcoal-100); color: var(--red); }

.nav-cta { margin-left: 16px; }
.btn-support {
  display: inline-flex; align-items: center;
  padding: 9px 16px;
  border-radius: 4px;
  background: var(--red);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  transition: background-color .2s var(--ease), transform .2s var(--ease);
}
.btn-support:hover { background: var(--red-dark); transform: translateY(-1px); }

/* Hamburger */
.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  flex-direction: column; justify-content: center; align-items: center; gap: 5px;
}
.nav-toggle span { display: block; width: 22px; height: 2px; background: #222331; transition: transform .3s var(--ease), opacity .2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile / tablet: same links stacked, dropdowns expand in place */
@media (max-width: 1023px) {
  .nav-toggle { display: flex; }
  .site-nav {
    display: none;
    position: absolute; left: 0; right: 0; top: 100%;
    background: #fff;
    border-bottom: 1px solid var(--sage-200);
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
  }
  .site-nav.is-open { display: block; }
  .site-nav > ul { flex-direction: column; align-items: stretch; }
  .nav-item { border-bottom: 1px solid var(--sage-200); display: flex; flex-wrap: wrap; align-items: center; }
  .nav-link { flex: 1; padding: 16px 20px; }
  .nav-link .caret { display: none; }
  .dropdown-toggle {
    display: block; width: 52px; height: 52px; flex: none;
    background: no-repeat center / 14px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256' fill='%23222331'%3E%3Cpath d='M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z'/%3E%3C/svg%3E");
    transition: transform .25s var(--ease);
  }
  .has-dropdown.is-open .dropdown-toggle { transform: rotate(180deg); }
  .dropdown-menu {
    position: static; flex-basis: 100%;
    display: none;
    border: 0; box-shadow: none; padding: 0 0 8px;
    background: var(--paper-100);
    opacity: 1; visibility: visible; transform: none; transition: none;
  }
  .has-dropdown.is-open .dropdown-menu { display: block; }
  .has-dropdown:hover .dropdown-menu:not(.is-open) { display: none; }
  .has-dropdown.is-open:hover .dropdown-menu { display: block; }
  .dropdown-menu a { padding: 12px 32px; }
  .nav-cta { margin: 0; padding: 16px 20px; border-bottom: 0; }
  .btn-support { width: 100%; justify-content: center; }
}

/* ---------------- Hero ---------------- */
.hero { background: var(--paper); }
.hero-frame {
  border-left: 1px solid var(--sage-200);
  border-right: 1px solid var(--sage-200);
  padding: 0;
}
.hero-grid {
  padding: 56px 16px 40px;
}
@media (min-width: 1024px) { .hero-grid { padding: 88px 24px 48px; } }

.hero-eyebrow { color: var(--charcoal-500); margin-bottom: 20px; }

.hero-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 40px;
  line-height: 1;
  letter-spacing: -0.02em;
  margin: 0;
  max-width: 14ch;
  color: var(--charcoal);
  text-wrap: balance;
}
@media (min-width: 768px) { .hero-title { font-size: 56px; letter-spacing: -0.025em; } }
@media (min-width: 1024px) { .hero-title { font-size: 81px; line-height: .9; letter-spacing: -0.03em; } }

/* Entrance: blur-in reveal (Greylock hero effect) */
.reveal {
  opacity: 0;
  filter: blur(8px);
  transform: translateY(12px);
  animation: reveal-in 1.1s var(--ease) forwards;
}
.hero-eyebrow.reveal { animation-delay: .05s; }
.hero-title.reveal { animation-delay: .15s; }
@keyframes reveal-in {
  to { opacity: 1; filter: blur(0); transform: translateY(0); }
}

/* Logo marquee strip */
.marquee {
  position: relative;
  overflow: hidden;
  padding: 22px 0;
  border-top: 1px solid var(--sage-200);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track {
  display: flex;
  align-items: center;
  width: max-content;
  animation: marquee 70s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track img {
  height: 28px;
  width: auto;
  max-width: 134px;
  margin: 0 28px;
  object-fit: contain;
  filter: grayscale(1) contrast(1.05);
  opacity: .8;
}
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------------- Filters ---------------- */
.companies-frame {
  border-left: 1px solid var(--sage-200);
  border-right: 1px solid var(--sage-200);
  border-bottom: 1px solid var(--sage-200);
  padding: 0;
}
.filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 8px 20px 12px;
  border-top: 1px solid var(--sage-200);
  border-bottom: 1px solid var(--sage-200);
  position: relative;
  z-index: 5;
}
.filters-left, .filters-right { display: flex; align-items: center; gap: 8px; }
.filters-right { gap: 20px; padding-right: 12px; }

.filter { position: relative; }
.filter-trigger {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 4px 6px 8px;
  color: var(--charcoal-900);
  transition: color .2s var(--ease);
}
.filter-trigger svg { transition: transform .25s var(--ease); }
.filter-trigger:hover { color: var(--red); }
.filter.is-open .filter-trigger svg { transform: rotate(180deg); }
.filter.has-selection .filter-trigger .captions::after {
  content: "";
  display: inline-block;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--red);
  margin-left: 8px; vertical-align: middle; position: relative; top: -1px;
}

.filter-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 260px;
  background: var(--paper-100);
  border: 1px solid var(--sage-200);
  box-shadow: 0 16px 40px rgba(31, 30, 29, .12);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .2s var(--ease), transform .2s var(--ease), visibility 0s .2s;
}
.filter.is-open .filter-menu { opacity: 1; visibility: visible; transform: translateY(0); transition-delay: 0s; }

.filter-option {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%;
  padding: 10px 10px;
  text-align: left;
  font-size: 15px;
  color: var(--charcoal-900);
  transition: background-color .15s var(--ease);
}
.filter-option:hover { background: var(--charcoal-100); }
.filter-option .box {
  width: 16px; height: 16px; flex: none;
  border: 1px solid var(--charcoal-300);
  display: grid; place-items: center;
  transition: border-color .15s, background-color .15s;
}
.filter-option .box svg { opacity: 0; transform: scale(.6); transition: opacity .15s, transform .15s var(--ease); }
.filter-option[aria-checked="true"] .box { background: var(--red); border-color: var(--red); }
.filter-option[aria-checked="true"] .box svg { opacity: 1; transform: scale(1); }
.filter-option .label { flex: 1; }
.filter-option .num { font-size: 12px; color: var(--charcoal-500); }

.filter-clear { color: var(--red); padding: 6px 0; }
.filter-clear:hover { text-decoration: underline; text-underline-offset: 3px; }
.filter-count { color: var(--charcoal-600); white-space: nowrap; }

.active-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 12px; }
.active-chips:not(:empty) { padding: 16px 12px 0; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--charcoal-200);
  font-size: 13px;
  color: var(--charcoal-900);
  transition: border-color .15s, color .15s;
}
.chip:hover { border-color: var(--red); color: var(--red); }
.chip svg { width: 10px; height: 10px; }

/* ---------------- Logo grid ---------------- */
.logo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--sage-200);
  border-top: 1px solid var(--sage-200);
  margin-top: 16px;
}
@media (min-width: 640px)  { .logo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .logo-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .logo-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

.logo-cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 96px;
  padding: 0 12px;
  background: var(--paper);
  transition: background-color .25s var(--ease);
  overflow: hidden;
}
@media (min-width: 1024px) { .logo-cell { min-height: 128px; } }
.logo-cell:hover, .logo-cell:focus-visible { background: var(--paper-200); outline: none; }

/* every logo sits in the same 32px-tall / 60%-wide box for consistent sizing */
.logo-cell img {
  max-height: calc(22px * var(--s, 1));
  width: auto;
  max-width: calc(62% * var(--s, 1));
  object-fit: contain;
  filter: grayscale(1) contrast(1.05);
  opacity: .88;
  transition: filter .35s var(--ease), opacity .35s var(--ease), transform .35s var(--ease);
}
@media (min-width: 1024px) { .logo-cell img { max-height: calc(32px * var(--s, 1)); max-width: calc(60% * var(--s, 1)); } }
.logo-cell:hover img, .logo-cell:focus-visible img { filter: none; opacity: 1; transform: translateY(-2px); }

/* red line on hover — same construction as greylock's cobalt bar */
.logo-cell .line {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .35s var(--ease);
}
.logo-cell:hover .line, .logo-cell:focus-visible .line { transform: scaleX(1); }

.logo-cell .name {
  position: absolute;
  left: 12px; bottom: 10px;
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--charcoal-500);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .25s var(--ease), transform .25s var(--ease);
  pointer-events: none;
}
.logo-cell:hover .name, .logo-cell:focus-visible .name { opacity: 1; transform: translateY(0); }

/* rise-in on scroll (greylock's logo-rise keyframe) */
.logo-cell { opacity: 0; transform: translateY(10px); }
.logo-cell.is-visible { animation: logo-rise .6s var(--ease) forwards; animation-delay: var(--delay, 0s); }
@keyframes logo-rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.logo-cell.is-leaving { animation: logo-fall .2s var(--ease) forwards; }
@keyframes logo-fall { to { opacity: 0; transform: translateY(6px); } }

.logo-filler { background: var(--paper); min-height: 96px; }
@media (min-width: 1024px) { .logo-filler { min-height: 128px; } }

.empty-state { padding: 64px 16px; color: var(--charcoal-600); text-align: center; }

/* ---------------- Footer (mirrors iimaventures.com) ---------------- */
.site-footer {
  position: relative;
  margin-top: 56px;
  background: #1c1c1c;
  color: #fff;
  overflow: clip;
}
.home .site-footer { margin-top: 0; }
.footer-topline { height: 6px; background: var(--red); }
.footer-inner { padding-top: 56px; padding-bottom: 28px; }

.footer-cols {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px 24px;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 8px;
}
.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-label {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #aba9a9;
}
.footer-col a {
  display: inline-block;
  width: max-content;
  font-size: 17px;
  font-weight: 500;
  color: #fff;
  transition: color .2s var(--ease);
}
.footer-col a:hover, .footer-col a.is-active { color: var(--red); }
.footer-social { display: flex; gap: 18px; align-items: center; }
.footer-social a { width: 36px; height: 36px; display: grid; place-items: center; color: #fff; }
.footer-social svg { width: 30px; height: 30px; transition: transform .2s var(--ease), color .2s; }
.footer-social a:hover svg { color: var(--red); transform: translateY(-2px); }

.footer-newsletter {
  max-width: 920px;
  margin: 56px auto 0;
  padding: 0 8px;
}
.footer-newsletter-label { display: block; margin-bottom: 12px; font-size: 18px; font-weight: 500; color: #ddd; }
.footer-newsletter-row { display: flex; }
.footer-newsletter input {
  flex: 1 1 auto; min-width: 0;
  height: 56px;
  padding: 0 16px;
  border: 0; border-radius: 0;
  font: inherit; font-size: 17px;
  background: #fff; color: #222;
}
.footer-newsletter input:focus { outline: 2px solid var(--red); outline-offset: -2px; }
.footer-newsletter button {
  flex: 0 0 auto;
  height: 56px;
  padding: 0 60px;
  background: var(--red);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: background-color .2s var(--ease);
}
.footer-newsletter button:hover { background: var(--red-dark); }

.footer-bottom {
  display: flex; align-items: center; justify-content: space-between; gap: 12px 24px;
  flex-wrap: wrap;
  margin-top: 96px;
  padding-top: 28px;
  border-top: 1px solid #3a3a3a;
  color: #8f8f8f;
  font-size: 16px;
}
.footer-bottom p { margin: 0; text-transform: uppercase; letter-spacing: 0.02em; }
.footer-legal { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.footer-legal a { color: #fff; font-weight: 500; transition: color .2s; }
.footer-legal a:hover { color: var(--red); }

@media (max-width: 1023px) {
  .footer-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px 24px; }
  .footer-newsletter { margin-top: 40px; }
  .footer-newsletter button { padding: 0 32px; }
  .footer-bottom { margin-top: 56px; }
}
@media (max-width: 599px) {
  .footer-inner { padding-top: 40px; }
  .footer-cols { grid-template-columns: 1fr; gap: 28px; }
  .footer-label { font-size: 15px; }
  .footer-col a { font-size: 16px; }
  .footer-newsletter-row { flex-direction: column; }
  .footer-newsletter input, .footer-newsletter button { width: 100%; height: 52px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; font-size: 14px; }
}

/* ---------------- Small-screen refinements ---------------- */
@media (max-width: 767px) {
  .filters { flex-wrap: wrap; padding: 14px 8px 14px 12px; gap: 8px 12px; }
  .filters-right { margin-left: auto; padding-right: 8px; }
  .filter-count { font-size: 11px; }
  .filter-menu { min-width: 220px; }
  .hero-title { font-size: 40px; }
  .marquee-track img { height: 22px; margin: 0 18px; }
  .logo-cell { min-height: 84px; }
}
@media (max-width: 420px) {
  .filters-right { flex-basis: 100%; justify-content: space-between; margin-left: 0; padding-left: 8px; }
  .filter-count { white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal, .logo-cell { animation: none !important; opacity: 1 !important; filter: none !important; transform: none !important; }
  .marquee-track { animation: none; }
  * { transition-duration: .01ms !important; }
}
