/* GrandHills Capital — design tokens & shared styles
   Dark default · light via [data-theme="light"]
   Brand: editorial minimalism · serif display · gold accent · slate utility
*/

:root {
  color-scheme: dark light;

  /* ─── Color · DARK (default) ─────────────────────────── */
  --bg: #0E0F12;
  --surface: #16181D;
  --surface-2: #1B1E24;
  --text: #F2EFE9;
  --slate: #9CA0A8;
  --slate-dim: #6C7079;
  --line: #2A2D33;
  --line-soft: #1F2127;
  --gold: #C7A961;
  --gold-strong: #D4B873;
  --blue: #4D7CFF;
  --shadow-1: 0 1px 0 rgba(255,255,255,.04);

  /* Surface tints for nav blur — RGB triplets so we can use alpha */
  --bg-rgb: 14, 15, 18;

  /* ─── Type ───────────────────────────────────────────── */
  --serif: "Instrument Serif", "Times New Roman", serif;
  --sans: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* ─── Scale ──────────────────────────────────────────── */
  --max: 1320px;
  --gutter: clamp(20px, 4vw, 56px);
}

/* ─── LIGHT theme override ─────────────────────────────── */
[data-theme="light"] {
  --bg: #FAF8F4;            /* warm cream, ties to off-white text from dark */
  --surface: #F3EFE6;       /* slightly recessed surface */
  --surface-2: #ECE7DC;     /* deeper surface variant */
  --text: #15171B;          /* deep graphite — not pure black */
  --slate: #5C6068;         /* primary slate (stronger contrast on cream) */
  --slate-dim: #8A8F98;     /* secondary slate */
  --line: #D8D2C5;          /* hairline rule */
  --line-soft: #E5E0D4;     /* softer rule */
  --gold: #9B7E3A;          /* deeper gold — passes WCAG AA on cream */
  --gold-strong: #876B2D;
  --blue: #2C50C9;          /* deeper blue for contrast */
  --shadow-1: 0 1px 0 rgba(0,0,0,.04);
  --bg-rgb: 250, 248, 244;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transition: background-color .25s ease, color .25s ease;
}

::selection { background: var(--gold); color: var(--bg); }

a { color: inherit; text-decoration: none; transition: opacity .25s ease, color .25s ease; }
a:hover { opacity: .7; }
a.external:hover { color: var(--blue); opacity: 1; }

img { display: block; max-width: 100%; }

/* Scrollbar polish — subtle in both themes */
* { scrollbar-color: var(--line) transparent; scrollbar-width: thin; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--line); border-radius: 0; }
*::-webkit-scrollbar-track { background: transparent; }

/* Focus visible — keyboard accessibility */
:focus-visible {
  outline: 1px solid var(--gold);
  outline-offset: 3px;
}

/* ─── Layout ──────────────────────────────────────────── */
.shell {
  max-width: var(--max);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.rule { border: 0; border-top: 1px solid var(--line); margin: 0; }

/* ─── Nav ─────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(var(--bg-rgb), .78);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  border-bottom: 1px solid var(--line-soft);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px;
  height: 68px;
}
.brand {
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: .01em;
  display: flex; align-items: baseline; gap: 8px;
  white-space: nowrap;
}
.brand-mark {
  display: inline-block; width: 6px; height: 6px; background: var(--gold);
  transform: translateY(-3px);
}
.nav-links {
  display: flex; gap: 30px;
  font-size: 14px;
  color: var(--slate);
  letter-spacing: .02em;
  white-space: nowrap;
}
.nav-links a.active { color: var(--text); }

.nav-right {
  display: flex; align-items: center; gap: 22px;
}

.nav-cta {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--gold);
  border-bottom: 1px solid var(--gold);
  padding-bottom: 2px;
  white-space: nowrap;
}

/* Theme toggle button — borderless, monospace label */
.theme-toggle {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--slate);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: 7px 10px;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  transition: color .2s, border-color .2s;
  border-radius: 0;
}
.theme-toggle:hover { color: var(--text); border-color: var(--text); }
.theme-toggle .dot {
  display: inline-block; width: 6px; height: 6px;
  background: var(--gold);
  transform: translateY(-1px);
}

/* Language toggle — borderless, two-state */
.lang-toggle {
  display: inline-flex; align-items: center; gap: 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--slate);
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 0;
}
.lang-toggle a {
  padding: 7px 10px;
  color: var(--slate);
  transition: color .2s ease, background-color .2s ease;
  display: inline-block;
}
.lang-toggle a:hover { color: var(--text); opacity: 1; }
.lang-toggle a.cur {
  color: var(--bg);
  background: var(--gold);
}
.lang-toggle a.cur:hover { color: var(--bg); }
.lang-toggle a + a { border-left: 1px solid var(--line); }

@media (max-width: 1100px) {
  .nav-links { gap: 22px; font-size: 13px; }
}
@media (max-width: 920px) {
  .nav-links { display: none; }
  .theme-toggle .label-full { display: none; }
}
@media (max-width: 540px) {
  .lang-toggle { display: none; }
  .nav-cta { display: none; }
}

/* ─── Typography utilities ────────────────────────────── */
.display {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.015em;
}
.kicker {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--slate);
}
.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--slate-dim);
}
.lead {
  font-family: var(--serif);
  font-size: clamp(22px, 2.2vw, 30px);
  line-height: 1.35;
  color: var(--text);
  font-style: italic;
}
.body-lg { font-size: 18px; line-height: 1.7; color: var(--text); }
.muted { color: var(--slate); }

/* ─── Section ─────────────────────────────────────────── */
.section {
  padding-block: clamp(90px, 11vw, 160px);
  border-top: 1px solid var(--line);
}
.section-head {
  display: grid;
  grid-template-columns: 1fr 3fr;
  gap: clamp(32px, 6vw, 96px);
  align-items: baseline;
  margin-bottom: clamp(48px, 7vw, 96px);
}
.section-head .label {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--slate-dim);
}
.section-head .title {
  font-family: var(--serif);
  font-size: clamp(36px, 4.6vw, 64px);
  line-height: 1.08;
  letter-spacing: -.01em;
  margin: 0;
  font-weight: 400;
}
@media (max-width: 780px) {
  .section-head { grid-template-columns: 1fr; gap: 16px; }
}

/* ─── Buttons ─────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 14px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: 14px 0 12px;
  border-bottom: 1px solid var(--gold);
  color: var(--gold);
  border-radius: 0;
  cursor: pointer;
  background: transparent;
  border-top: 0; border-left: 0; border-right: 0;
}
.btn:hover { opacity: .75; }
.btn .arrow {
  display: inline-block;
  width: 22px; height: 1px; background: currentColor; position: relative;
  transition: width .25s ease;
}
.btn .arrow::after {
  content: ""; position: absolute; right: 0; top: -3px;
  width: 7px; height: 7px;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
  transform: rotate(45deg);
}
.btn:hover .arrow { width: 32px; }

.btn-ghost {
  color: var(--text);
  border-bottom-color: var(--line);
}
.btn-ghost:hover { color: var(--text); border-bottom-color: var(--text); }

/* ─── Meta / pills ────────────────────────────────────── */
.meta {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--slate-dim);
}

.pill {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--slate);
  padding: 5px 10px;
  border: 1px solid var(--line);
}

/* ─── Authority strip (partner logos) ─────────────────── */
.authority {
  padding-block: clamp(36px, 4vw, 56px);
  border-block: 1px solid var(--line-soft);
}
.authority .row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
}
.authority .label {
  font-family: var(--mono); font-size: 11px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--slate-dim);
  white-space: nowrap;
  padding-right: clamp(16px, 3vw, 32px);
  border-right: 1px solid var(--line);
}
.authority .marks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: clamp(20px, 3vw, 40px);
  align-items: center;
}
.authority .mark {
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.15;
  color: var(--slate);
  letter-spacing: .005em;
  opacity: .82;
  transition: opacity .25s, color .25s;
}
.authority .mark:hover { opacity: 1; color: var(--text); }
.authority .mark .sub {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--slate-dim);
  margin-top: 4px;
  font-weight: 400;
}
@media (max-width: 720px) {
  .authority .row { grid-template-columns: 1fr; }
  .authority .label { border-right: 0; padding-right: 0; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
}

/* ─── Footer ──────────────────────────────────────────── */
.foot {
  border-top: 1px solid var(--line);
  padding-block: 56px 36px;
  margin-top: clamp(90px, 11vw, 160px);
}
.foot-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 56px;
}
.foot h5 {
  margin: 0 0 18px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--slate-dim);
  font-weight: 500;
}
.foot ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; font-size: 14px; color: var(--slate); }
.foot .colophon {
  font-family: var(--serif);
  font-size: 30px;
  line-height: 1.12;
  letter-spacing: -.005em;
  max-width: 28ch;
}
.lang {
  display: flex; gap: 18px; font-family: var(--mono); font-size: 12px; color: var(--slate);
}
.lang span.cur { color: var(--gold); }
.foot-bot {
  border-top: 1px solid var(--line-soft);
  padding-top: 28px;
  display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between;
  font-family: var(--mono); font-size: 11px; letter-spacing: .1em;
  color: var(--slate-dim); text-transform: uppercase;
}
@media (max-width: 880px) {
  .foot-top { grid-template-columns: 1fr 1fr; }
}

/* ─── Tabular numerics ────────────────────────────────── */
.tnum { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* ─── Editorial markers ───────────────────────────────── */
.dropcap::first-letter {
  font-family: var(--serif);
  font-size: 5em;
  float: left;
  line-height: 0.88;
  padding: 6px 12px 0 0;
  color: var(--text);
}

/* ─── Theme-flash guard: paint background early ──────── */
html { background: var(--bg); }

/* ─── Reduced motion ─────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001s !important; transition-duration: .001s !important; }
  html { scroll-behavior: auto; }
}

/* ─── Russian typography corrections ─────────────────────
   Russian words are typically 30–50% longer than English equivalents.
   Per-component overrides for headings, max-widths, and a few specific blocks. */

html[lang="ru"] {
  text-wrap: pretty;
}
html[lang="ru"] h1, html[lang="ru"] h2, html[lang="ru"] h3 {
  text-wrap: balance;
}
/* Hyphens disabled globally — cheap and unprofessional in editorial typography */
html, html[lang="ru"], h1, h2, h3, h4, p {
  hyphens: manual;
  -webkit-hyphens: manual;
}

/* Hero (Home only) */
html[lang="ru"] .hero h1 {
  font-size: clamp(38px, 5.6vw, 78px) !important;
  letter-spacing: -.012em !important;
  max-width: 22ch;
}

/* Page heads (Projects, About, Investor-Access, SSF, e-pharmakit) */
html[lang="ru"] .page-head h1 {
  font-size: clamp(38px, 5.6vw, 80px) !important;
  max-width: 24ch !important;
}
html[lang="ru"] .preface h1 {
  font-size: clamp(36px, 5.4vw, 76px) !important;
  max-width: 24ch !important;
}
html[lang="ru"] .access h1 {
  font-size: clamp(34px, 5vw, 68px) !important;
  max-width: 22ch !important;
}

/* Section titles — give more breathing room */
html[lang="ru"] .section-head .title {
  font-size: clamp(28px, 3.6vw, 52px) !important;
  max-width: 26ch;
}
html[lang="ru"] .arch-head .title,
html[lang="ru"] .convo-head .title,
html[lang="ru"] .pcat-head .title,
html[lang="ru"] .partners-head .title {
  font-size: clamp(28px, 3.6vw, 52px) !important;
  max-width: 26ch;
}
html[lang="ru"] .model-head h2,
html[lang="ru"] .roadmap-head h2,
html[lang="ru"] .flywheel .copy h2,
html[lang="ru"] .compliance .vbox h2 {
  font-size: clamp(28px, 3.6vw, 50px) !important;
  max-width: 22ch;
}

/* Engagements (Home) — wider max-width for Russian */
html[lang="ru"] .engagement h3 {
  font-size: clamp(22px, 2.4vw, 32px) !important;
  max-width: 34ch !important;
  line-height: 1.22;
}
html[lang="ru"] .engagement .outcome .v { font-size: 22px; }

/* Pillars (Home approach) */
html[lang="ru"] .pillar h3 { font-size: 26px; }
html[lang="ru"] .approach-body p.lede { font-size: clamp(22px, 2.2vw, 28px); max-width: 28ch; }

/* Active portfolio rows (Home) */
html[lang="ru"] .pf-row .name { font-size: clamp(22px, 2.4vw, 30px); }

/* Channels grid (e-pharmakit) */
html[lang="ru"] .ch h3 { font-size: clamp(20px, 2.2vw, 26px); max-width: 26ch; }

/* Project mini-cards (Projects) */
html[lang="ru"] .pcard h3 { font-size: clamp(19px, 2vw, 24px); max-width: 30ch; }

/* Flagship (Projects) */
html[lang="ru"] .flagship h2 { font-size: clamp(30px, 3.8vw, 50px) !important; max-width: 24ch; }

/* Founding (About) */
html[lang="ru"] .founding h2 { font-size: clamp(30px, 3.8vw, 50px) !important; }
html[lang="ru"] .card h3 { font-size: 22px; }

/* CTA blocks */
html[lang="ru"] .cta-block h2,
html[lang="ru"] .cta-foot h2,
html[lang="ru"] .closing h2,
html[lang="ru"] .contact-grid h2 {
  font-size: clamp(30px, 3.8vw, 56px) !important;
  max-width: 24ch;
}

/* Mission statement (Projects) */
html[lang="ru"] .mission .statement { font-size: clamp(22px, 2.8vw, 38px); max-width: 32ch; }

/* Lead paragraphs */
html[lang="ru"] .page-head .lede { font-size: clamp(20px, 2vw, 26px); }
html[lang="ru"] .thesis aside h2 { font-size: clamp(26px, 3.2vw, 42px); max-width: 16ch; }
html[lang="ru"] .thesis .body .pull { font-size: clamp(20px, 2.2vw, 26px); max-width: 36ch; }

/* SSF paper section */
html[lang="ru"] .paper h2 { font-size: clamp(24px, 2.6vw, 34px); max-width: 28ch; }
html[lang="ru"] .paper .text .pull { font-size: 20px; max-width: 44ch; }

/* Nav CTA — Russian "ИНВЕСТ-БРИФ" is wider than "Investor brief" */
html[lang="ru"] .nav-cta { font-size: 11px; letter-spacing: .06em; }

/* Filter chips (Projects) */
html[lang="ru"] .filter-strip .chip { font-size: 10px; padding: 7px 10px; }

/* Caveat block (SSF) */
html[lang="ru"] .caveat .v { font-size: 18px; }

/* Phase items (e-pharmakit roadmap, e-pharmakit) */
html[lang="ru"] .phase .item { font-size: 16px; }

/* Results grid (SSF field record) */
html[lang="ru"] .result .v { font-size: clamp(30px, 3.8vw, 48px); }

/* Contact h2 (Home) */
html[lang="ru"] .contact-grid h2 { max-width: 24ch; }
