/* =========================================================
   Caspian Impact — shared stylesheet
   Design tokens, typography, layout, accessibility
   ========================================================= */

:root {
  /* Palette — derived from the Caspian logo:
     grey wordmark, green stem, warm coral/orange dandelion */
  --forest:      #2E4034;  /* deep muted green (from stem, darkened) — institutional base */
  --forest-deep: #23302A;  /* darker, for footers/hero */
  --sage:        #7A9A6E;  /* the logo's fresh green stem */
  --sage-soft:   #E4E7DE;  /* pale green-grey for panels */
  --paper:       #F7F5EF;  /* warm off-white background */
  --paper-pure:  #FFFFFF;  /* cards */
  --ink:         #3A3F42;  /* the logo's grey wordmark tone */
  --ink-soft:    #6B7075;  /* secondary text */
  --brass:       #C6431F;  /* accent — coral-red, AA on light bg */
  --brass-deep:  #A83512;  /* deeper coral, AA on light backgrounds */
  --brass-on-dark: #F09030; /* amber accent, AA on dark green backgrounds */
  --ember:       #F09030;  /* the dandelion's orange, for small highlights */
  --line:        #E1DCCF;  /* hairline dividers */

  /* Type */
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --body:    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Scale / rhythm */
  --measure: 68ch;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --section-y: clamp(3.5rem, 8vw, 7rem);
  --radius: 3px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--body);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.08rem);
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; height: auto; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 400; line-height: 1.12; color: var(--forest); margin: 0 0 0.5em; letter-spacing: -0.01em; }
p { margin: 0 0 1.1em; max-width: var(--measure); }

/* ---------- Accessibility: focus, skip link, motion ---------- */
:focus-visible {
  outline: 2px solid #1A1A1A;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px #FFFFFF, 0 0 0 6px #1A1A1A;
  border-radius: 2px;
}
/* On light backgrounds the layering reads dark-light-dark; on dark backgrounds
   the white middle band guarantees >=3:1 (WCAG 1.4.11) regardless of section colour. */
/* Remove default outline only where we provide :focus-visible */
:focus:not(:focus-visible) { outline: none; }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3.5rem;
  background: var(--forest);
  color: #fff;
  padding: 0.7rem 1.1rem;
  border-radius: var(--radius);
  z-index: 200;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 1rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Layout helpers ---------- */
.wrap { width: min(100% - 2 * var(--gutter), 1140px); margin-inline: auto; }
.wrap--narrow { width: min(100% - 2 * var(--gutter), 820px); margin-inline: auto; }
.section { padding-block: var(--section-y); }
.eyebrow {
  font-family: var(--body);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brass-deep);
  margin: 0 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.eyebrow::before {
  content: "";
  width: 1.75rem;
  height: 1px;
  background: var(--brass);
}

/* ---------- Links ---------- */
a { color: var(--brass-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--forest); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--body);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius);
  text-decoration: none;
  cursor: pointer;
  border: 1.5px solid var(--forest);
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.btn--primary { background: var(--forest); color: #fff; }
.btn--primary:hover { background: var(--forest-deep); color: #fff; transform: translateY(-2px); }
.btn--ghost { background: transparent; color: var(--forest); }
.btn--ghost:hover { background: var(--forest); color: #fff; }

/* =========================================================
   Header / navigation
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(247, 245, 239, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 1rem;
}
.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--forest); }
.brand__logo { height: 38px; width: auto; display: block; }
.brand__mark { width: 38px; height: 38px; flex: none; }
.brand__name { font-family: var(--display); font-size: 1.35rem; letter-spacing: -0.01em; line-height: 1; }
.brand__name small { display: block; font-family: var(--body); font-size: 0.62rem; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: var(--sage); margin-top: 3px; }

.nav__toggle { display: none; background: none; border: 0; padding: 0.4rem; cursor: pointer; color: var(--forest); }
.nav__toggle svg { width: 28px; height: 28px; }

.nav__menu { display: flex; align-items: center; gap: 0.4rem; list-style: none; margin: 0; padding: 0; }
.nav__menu a {
  display: inline-block;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--ink);
  text-decoration: none;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius);
  transition: background 0.2s ease, color 0.2s ease;
}
.nav__menu a:hover { background: var(--sage-soft); color: var(--forest); }
.nav__menu a[aria-current="page"] { color: var(--forest); font-weight: 600; }
.nav__menu a[aria-current="page"]::after {
  content: ""; display: block; height: 2px; background: var(--brass);
  margin-top: 3px; border-radius: 2px;
}

/* =========================================================
   Site search
   ========================================================= */
.search-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 0;
  padding: 0.5rem;
  margin-left: 0.25rem;
  cursor: pointer;
  color: var(--ink);
  border-radius: var(--radius);
}
.search-toggle:hover { background: var(--sage-soft); color: var(--forest); }
.search-toggle svg { width: 20px; height: 20px; }

.search-panel {
  position: absolute;
  top: 100%;
  right: var(--gutter);
  width: min(30rem, calc(100vw - 2 * var(--gutter)));
  background: var(--paper-pure);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 18px 40px -20px rgba(27, 40, 33, 0.4);
  padding: 1rem;
  z-index: 150;
}
.search-panel[hidden] { display: none; }
.search-field { position: relative; }
.search-input {
  width: 100%;
  font-family: var(--body);
  font-size: 1rem;
  padding: 0.75rem 0.9rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--paper);
}
.search-input::placeholder { color: var(--ink-soft); }
.search-results { list-style: none; margin: 0.75rem 0 0; padding: 0; }
.search-result { border-radius: var(--radius); }
.search-result__link {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.7rem 0.8rem;
  text-decoration: none;
  border-radius: var(--radius);
}
.search-result__link:hover,
.search-result.is-active .search-result__link {
  background: var(--sage-soft);
}
.search-result__title { color: var(--forest); font-weight: 600; font-size: 0.98rem; }
.search-result__sub { color: var(--ink-soft); font-size: 0.85rem; }
.search-status {
  font-size: 0.82rem;
  color: var(--ink-soft);
  margin-top: 0.6rem;
  padding: 0 0.2rem;
}

@media (max-width: 820px) {
  .search-panel { right: 0; left: 0; width: auto; margin: 0 var(--gutter); }
}

@media (max-width: 820px) {
  .nav__toggle { display: inline-flex; }
  .nav__menu {
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: 0.5rem var(--gutter) 1.25rem;
    display: none;
  }
  .nav__menu.is-open { display: flex; }
  .nav__menu a { padding: 0.85rem 0.5rem; border-bottom: 1px solid var(--line); border-radius: 0; }
  .nav__menu a[aria-current="page"]::after { display: none; }
}

/* =========================================================
   Hero
   ========================================================= */
.hero {
  position: relative;
  background: var(--forest-deep);
  color: #EFEDE4;
  overflow: hidden;
}
.hero__inner { position: relative; z-index: 2; padding-block: clamp(4rem, 11vw, 8.5rem); }
.hero h1 {
  color: #fff;
  font-size: clamp(2.4rem, 1.6rem + 3.6vw, 4.4rem);
  max-width: 15ch;
  margin-bottom: 0.4em;
}
.hero__lede { font-size: clamp(1.05rem, 1rem + 0.4vw, 1.3rem); color: #C9D3CC; max-width: 46ch; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 2rem; }
.hero__cta .btn--primary { background: var(--brass); border-color: var(--brass); color: #fff; }
.hero__cta .btn--primary:hover { background: var(--brass-deep); border-color: var(--brass-deep); color: #fff; }
.hero__cta .btn--ghost { color: #fff; border-color: rgba(255,255,255,0.5); }
.hero__cta .btn--ghost:hover { background: rgba(255,255,255,0.1); color: #fff; }

/* drifting dandelion seeds — the signature motif */
.seeds { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.seed {
  position: absolute;
  color: rgba(240, 144, 48, 0.55);
  animation: drift linear infinite;
}
.seed svg { width: 100%; height: 100%; }
@keyframes drift {
  0%   { transform: translate(0, 100%) rotate(0deg); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 0.8; }
  100% { transform: translate(40px, -20%) rotate(60deg); opacity: 0; }
}

/* =========================================================
   Generic page header (interior pages)
   ========================================================= */
.page-head { background: var(--forest); color: #fff; padding-block: clamp(3rem, 7vw, 5.5rem); }
.page-head h1 { color: #fff; font-size: clamp(2rem, 1.5rem + 2.4vw, 3.4rem); }
.page-head p { color: #C9D3CC; max-width: 52ch; margin-bottom: 0; }

/* =========================================================
   Stats strip
   ========================================================= */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stat { background: var(--paper-pure); padding: 2rem 1.5rem; }
.stat__num { font-family: var(--display); font-size: clamp(2rem, 1.5rem + 2vw, 3rem); color: var(--forest); line-height: 1; }
.stat__label { font-size: 0.85rem; color: var(--ink-soft); margin-top: 0.6rem; }

/* =========================================================
   Prose + two-column
   ========================================================= */
.lead { font-size: clamp(1.15rem, 1.05rem + 0.5vw, 1.45rem); color: var(--forest); font-family: var(--display); line-height: 1.4; }
.split { display: grid; grid-template-columns: 1fr; gap: clamp(2rem, 5vw, 4rem); }
@media (min-width: 860px) { .split { grid-template-columns: 0.9fr 1.1fr; align-items: start; } }

/* =========================================================
   Cards (portfolio / funds)
   ========================================================= */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }
.card {
  background: var(--paper-pure);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.8rem;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px -18px rgba(27,58,47,0.4); border-color: var(--sage); }
.card__tag { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--brass-deep); margin-bottom: 0.8rem; }
.card h3 { font-size: 1.3rem; margin-bottom: 0.5rem; }
.card p { font-size: 0.95rem; color: var(--ink-soft); margin-bottom: 1.2rem; }
.card__link { margin-top: auto; font-weight: 600; font-size: 0.9rem; text-decoration: none; color: var(--forest); }
.card__link:hover { color: var(--brass-deep); }
.card__link::after { content: " →"; }

/* =========================================================
   Team
   ========================================================= */
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.75rem; }
.member { text-align: left; }
.member__photo {
  aspect-ratio: 4/5; background: var(--sage-soft); border-radius: var(--radius);
  display: flex; align-items: flex-end; justify-content: center;
  font-family: var(--display); font-size: 3rem; color: var(--sage);
  margin-bottom: 1rem; overflow: hidden;
}
.member__name { font-size: 1.15rem; font-family: var(--display); font-weight: 400; line-height: 1.12; color: var(--forest); margin: 0 0 0.15rem; }
.member__role { font-size: 0.88rem; color: var(--ink-soft); }
.member__photo img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(100%); }

/* Clickable member card */
a.member {
  display: block; text-decoration: none; color: inherit;
  border-radius: var(--radius); transition: transform 0.2s ease;
}
a.member .member__photo { position: relative; transition: box-shadow 0.2s ease; }
a.member:hover { transform: translateY(-3px); }
a.member:hover h3 { color: var(--brass-deep); }
a.member:hover .member__photo { box-shadow: 0 12px 26px -16px rgba(46,64,52,0.55); }
a.member .member__role { transition: color 0.2s ease; }

/* Slot / coming-soon member */
.member--slot .member__photo {
  background: repeating-linear-gradient(135deg, var(--sage-soft), var(--sage-soft) 12px, #EDF0E8 12px, #EDF0E8 24px);
  color: var(--sage); font-size: 1rem; text-align: center; padding: 1rem;
  align-items: center; font-family: var(--body); font-weight: 500;
}

/* =========================================================
   Profile pages
   ========================================================= */
.profile { padding-block: var(--section-y); }
.profile__grid { display: grid; grid-template-columns: 1fr; gap: clamp(1.5rem, 4vw, 3rem); }
@media (min-width: 760px) { .profile__grid { grid-template-columns: 300px 1fr; align-items: start; } }
.profile__photo { border-radius: var(--radius); overflow: hidden; background: var(--sage-soft); position: sticky; top: 92px; }
.profile__photo img { width: 100%; filter: grayscale(100%); display: block; }
.profile__name { font-size: clamp(1.8rem, 1.4rem + 1.6vw, 2.6rem); margin-bottom: 0.2em; }
.profile__role { font-family: var(--body); font-size: 0.82rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--brass-deep); margin-bottom: 1.6rem; }
.profile__bio p { color: var(--ink); }
.profile__back { display: inline-flex; align-items: center; gap: 0.4rem; margin-bottom: 2rem; font-weight: 500; text-decoration: none; color: var(--ink-soft); }
.profile__back:hover { color: var(--brass-deep); }
@media (max-width: 759px) { .profile__photo { position: static; max-width: 260px; } }

/* =========================================================
   Investor Corner — document list
   ========================================================= */
.doc-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.doc-item { border-bottom: 1px solid var(--line); }
.doc-item a {
  display: flex; align-items: center; gap: 1rem;
  padding: 1.15rem 0.5rem; text-decoration: none; color: var(--ink);
  transition: background 0.15s ease, padding-left 0.15s ease;
}
.doc-item a:hover { background: var(--sage-soft); padding-left: 1rem; }
.doc-item__icon { flex: none; color: var(--brass-deep); }
.doc-item__meta { margin-left: auto; font-size: 0.82rem; color: var(--ink-soft); white-space: nowrap; }
.doc-item__title { font-weight: 500; }

/* =========================================================
   Portfolio logo wall — greyscale until hover
   ========================================================= */
.logo-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.logo-cell {
  background: var(--paper-pure);
  aspect-ratio: 400 / 220;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  transition: background 0.2s ease;
}
/* Linked logos */
a.logo-cell { text-decoration: none; }
.logo-cell img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: grayscale(100%);
  opacity: 0.78;
  transition: filter 0.25s ease, opacity 0.25s ease, transform 0.25s ease;
}
a.logo-cell:hover img,
a.logo-cell:focus-visible img {
  filter: grayscale(0%);
  opacity: 1;
  transform: scale(1.04);
}
a.logo-cell:focus-visible {
  outline: 2px solid #1A1A1A;
  outline-offset: -2px;
  box-shadow: inset 0 0 0 4px #FFFFFF, inset 0 0 0 6px #1A1A1A;
}
a.logo-cell:hover { background: var(--paper); }

/* Placeholder cells (logo not yet supplied) */
.logo-cell--placeholder {
  flex-direction: column;
  gap: 0.5rem;
  color: var(--ink-soft);
  background: repeating-linear-gradient(135deg, #fff, #fff 14px, #FBFAF6 14px, #FBFAF6 28px);
  text-align: center;
}
.logo-cell--placeholder .logo-cell__name { font-weight: 600; color: var(--forest); font-size: 0.95rem; }
.logo-cell--placeholder .logo-cell__note { font-size: 0.72rem; letter-spacing: 0.04em; text-transform: uppercase; }

.notice {
  background: var(--sage-soft); border-left: 3px solid var(--sage);
  padding: 1.25rem 1.5rem; border-radius: var(--radius); font-size: 0.95rem;
  color: var(--forest); margin-bottom: 2.5rem;
}

/* =========================================================
   Footer
   ========================================================= */
.site-footer { background: var(--forest-deep); color: #C9D3CC; padding-block: clamp(3rem, 6vw, 4.5rem) 2rem; }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 2.5rem; margin-bottom: 3rem; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.footer-heading { color: #fff; font-family: var(--body); font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 600; margin: 0 0 1rem; }
.site-footer a { color: #C9D3CC; text-decoration: none; }
.site-footer a:hover { color: var(--brass); }
.footer-links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; font-size: 0.95rem; }
.footer-links a.social { display: inline-flex; align-items: center; gap: 0.5rem; }
.footer-links a.social svg { width: 18px; height: 18px; flex: none; }
.footer-maps { display: inline-flex; align-items: center; gap: 0.5rem; margin-top: 0.2rem; }
.footer-maps svg { width: 16px; height: 16px; flex: none; }
.footer-brand__name { font-family: var(--display); font-size: 1.5rem; color: #fff; margin-bottom: 0.6rem; }
.footer-brand p { font-size: 0.92rem; max-width: 34ch; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.12); padding-top: 1.5rem; font-size: 0.82rem; color: #8B9A92; display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; }

/* =========================================================
   Photo collage band (home)
   ========================================================= */
.photo-band { background: var(--forest-deep); padding-block: 0; }
.photo-band__inner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: clamp(120px, 15vw, 200px);
  gap: 4px;
}
.photo-band figure { margin: 0; overflow: hidden; position: relative; }
.photo-band img {
  width: 100%; height: 100%; object-fit: cover;
  object-position: center 30%;
  filter: grayscale(100%); transition: transform 0.5s ease;
}
.photo-band figure:hover img { transform: scale(1.05); }
.photo-band .span-2-cols { grid-column: span 2; }
.photo-band .span-2-rows { grid-row: span 2; }
.photo-band__caption {
  background: var(--forest-deep); color: #C9D3CC; text-align: center;
  padding: 1.5rem var(--gutter); font-size: 0.9rem; letter-spacing: 0.02em;
}
@media (max-width: 720px) {
  .photo-band__inner { grid-template-columns: repeat(2, 1fr); grid-auto-rows: clamp(130px, 32vw, 190px); }
  .photo-band .span-2-cols { grid-column: span 2; }
  .photo-band .span-2-rows { grid-row: span 1; }
}

/* Fund page hero image */
.fund-hero {
  width: 100%; aspect-ratio: 16 / 6; object-fit: cover;
  filter: grayscale(100%); display: block; margin-bottom: 2.5rem;
  border-radius: var(--radius);
}
@media (max-width: 600px) { .fund-hero { aspect-ratio: 16 / 9; } }
