/* KR Mining Ventures — shared styles */
:root {
  --krmv-blue: #143C89;
  --krmv-blue-deep: #0e2d68;
  --krmv-gray: #606670;
  --krmv-gray-light: #E6E6E6;
  --krmv-orange: #F0AB56;
  --krmv-ink: #1A1A1A;
  --krmv-paper: #f4f1ec; /* warm light, matches Social Capital reference vibe */
  --krmv-paper-deep: #ebe7df;
  --krmv-black: #0a0a0a;

  --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-body: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html {
  /* Reserva sempre o espaço do scrollbar — garante viewport idêntica em todas as páginas
     (sem isso, páginas com scroll ficam ~15px mais estreitas e o menu desalinha do index) */
  scrollbar-gutter: stable;
}
html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  color: var(--krmv-ink);
  background: var(--krmv-paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- TRANSIÇÃO ENTRE PÁGINAS ---------- */
/* Fade-in automático ao carregar; fade-out aplicado via JS antes de navegar */
body {
  animation: page-enter 0.35s ease both;
  transition: opacity 0.28s ease;
}
body.is-leaving { opacity: 0; }

@keyframes page-enter {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  body {
    animation: none;
    transition: none;
  }
}

a { color: inherit; text-decoration: none; }

/* ---------- NAV (used on dark side of home + light pages) ---------- */
.krmv-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  white-space: nowrap;
}
.krmv-nav a {
  position: relative;
  padding: 4px 0;
  transition: opacity .2s ease;
  opacity: 0.85;
}
.krmv-nav a:hover { opacity: 1; }
.krmv-nav a.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 1px;
  background: currentColor;
}

/* ---------- WORDMARK (small SOCIAL CAPITAL-style typographic mark) ---------- */
.krmv-wordmark {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  white-space: nowrap;
}
.krmv-wordmark::after {
  content: "_";
  margin-left: 2px;
  animation: blink 1.1s steps(2, start) infinite;
}
@keyframes blink { to { visibility: hidden; } }

/* ---------- BUTTONS ---------- */
.krmv-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border: 1px solid var(--krmv-ink);
  background: transparent;
  color: var(--krmv-ink);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .25s ease, color .25s ease, border-color .25s ease;
}
.krmv-btn:hover {
  background: var(--krmv-ink);
  color: var(--krmv-paper);
}
.krmv-btn--accent {
  border-color: var(--krmv-blue);
  color: var(--krmv-blue);
}
.krmv-btn--accent:hover {
  background: var(--krmv-blue);
  color: #fff;
}
.krmv-btn--ghost-dark {
  border-color: rgba(255,255,255,0.6);
  color: #fff;
}
.krmv-btn--ghost-dark:hover {
  background: #fff;
  color: var(--krmv-ink);
}

/* Two-color accent inside button text, like Social Capital "READ OUR ANNUAL LETTER" */
.krmv-btn .accent { color: var(--krmv-orange); }
.krmv-btn .accent-blue { color: var(--krmv-blue); }

/* ---------- HAMBURGER TOGGLE ---------- */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: inherit;
  z-index: 200;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: currentColor;
  transition: transform .3s ease, opacity .3s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ---------- MOBILE DRAWER ---------- */
.nav-drawer {
  position: fixed;
  inset: 0;
  background: var(--krmv-ink);
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}
.nav-drawer.open {
  opacity: 1;
  pointer-events: auto;
}

.nav-drawer__links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 36px;
  margin-bottom: 48px;
}
.nav-drawer__links a {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.75);
  transition: color .2s ease;
}
.nav-drawer__links a:hover,
.nav-drawer__links a.active { color: #fff; }

.lang-switcher--drawer {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: rgba(255,255,255,0.5);
  display: flex;
  gap: 10px;
}
.lang-switcher--drawer span[data-lang] {
  cursor: pointer;
  transition: color .2s ease;
}
.lang-switcher--drawer span[data-lang]:hover,
.lang-switcher--drawer span[data-lang].active { color: #fff; }
.lang-switcher--drawer .sep { pointer-events: none; }

/* ---------- RESPONSIVE ---------- */
/* Nav+lang precisam de ~700px e só cabem em 50% da viewport a partir de ~1580px */
@media (max-width: 1600px) {
  .krmv-nav { display: none; }
  .lang-switcher:not(.lang-switcher--drawer) { display: none; }
  .nav-toggle { display: flex; }
}

/* ---------- LANG SWITCHER (dropdown com ícone de globo) ---------- */
.lang-switcher {
  position: relative;
  display: inline-block;
}
.lang-switcher__trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 4px;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  opacity: 0.85;
  transition: opacity .2s ease;
}
.lang-switcher__trigger:hover { opacity: 1; }
.lang-switcher__icon { display: block; }
.lang-switcher__chevron {
  display: block;
  opacity: 0.85;
  transition: transform .25s ease;
}
.lang-switcher.is-open .lang-switcher__chevron { transform: rotate(180deg); }

.lang-switcher__menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  list-style: none;
  margin: 0;
  padding: 6px 0;
  min-width: 160px;
  background: var(--krmv-paper);
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 14px 32px rgba(0,0,0,0.12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
  z-index: 200;
}
.lang-switcher.is-open .lang-switcher__menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.lang-switcher__menu li { margin: 0; }
.lang-switcher__menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 10px 18px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--krmv-ink);
  transition: background .15s ease, color .15s ease;
}
.lang-switcher__menu button:hover { background: rgba(0,0,0,0.04); }
.lang-switcher__menu button.active {
  color: var(--krmv-blue);
  font-weight: 500;
}

/* ---------- INTERNAL PAGE HEADER ---------- */
/* Estrutura ESPELHO EXATO do home__right-top do index:
   - O painel direito é absoluto: top: 36px, left: 50%, right: 0, padding: 0 48px
   - Isso replica linha por linha o CSS do .home__right-top (que está em top:36px
     dentro de .home__right que começa em viewport 50%) */
.page-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: 128px;
  background: rgba(244, 241, 236, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, background .2s ease;
}
.page-header.is-stuck {
  background: rgba(244, 241, 236, 0.88);
  border-bottom-color: rgba(0,0,0,0.06);
}

.page-header__brand {
  position: absolute;
  top: 50%;
  left: 96px;             /* ← margem horizontal unificada do site (ver CLAUDE.md) */
  transform: translateY(-50%);
}
.page-header__logo { height: 80px; width: auto; display: block; }

.page-header__right {
  position: absolute;
  top: 36px;
  left: 50%;
  right: 0;
  padding: 0 96px;        /* ← IDÊNTICO ao .home__right-top (mantém alinhamento com index) */
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 28px;
  color: var(--krmv-ink);
}
.page-header__right .krmv-nav { flex: 1; justify-content: center; }
.page-header__right .nav-toggle { color: var(--krmv-ink); }

/* ---------- INTERNAL PAGE LAYOUT ---------- */
.page {
  padding-top: 128px;
}
.page__content {
  padding: 32px 96px 120px;     /* 96px lateral — alinha com o logo e com o padding do header */
}
.page__title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 60px;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 96px 0 96px;
  color: var(--krmv-ink);
}

/* ---------- SECTIONS (layout shared across pages) ---------- */
.sec {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 96px;
  padding: 88px 0;
  border-top: 1px solid rgba(0,0,0,0.08);
}
.sec__label { position: relative; }
.sec__label::before {
  content: "";
  display: block;
  width: 56px;
  height: 2px;
  background: var(--krmv-ink);
  margin-bottom: 28px;
}
.sec__label .kicker {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--krmv-gray);
  display: block;
  margin-bottom: 12px;
}
.sec__label h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 0;
  color: var(--krmv-ink);
}
.sec__body {
  max-width: 1400px;
  font-family: var(--font-display);
  font-size: 21px;
  line-height: 1.75;
  color: #1A1A1A;
}
.sec__body p { margin: 0 0 1.15em; text-wrap: pretty; }
.sec__body p:last-child { margin-bottom: 0; }
.sec__body strong { font-weight: 600; color: var(--krmv-blue); }

/* ---------- FOOTER CTA ---------- */
.footer-cta {
  margin-top: 64px;
  padding: 80px 0;
  border-top: 1px solid rgba(0,0,0,0.12);
}
.footer-cta h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
  max-width: 18ch;
  color: var(--krmv-ink);
}
.footer-cta p {
  color: #3a3f47;
  font-size: 18px;
  line-height: 1.6;
  max-width: 56ch;
  margin: 0 0 32px;
}
.footer-cta__actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------- PAGE FOOTER ---------- */
.pagefoot {
  padding: 32px 64px;
  border-top: 1px solid rgba(0,0,0,0.12);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--krmv-gray);
}
.pagefoot a:hover { color: var(--krmv-ink); }
.pagefoot__nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pagefoot__nav .sep { opacity: 0.4; }

/* ---------- RESPONSIVE (internal pages) ---------- */
@media (max-width: 980px) {
  .page-header { height: 80px; }
  .page-header__brand { left: 28px; }     /* sobrescreve o left:56px do desktop */
  .page-header__right { padding: 0 28px; top: 0; height: 100%; align-items: center; }
  .page-header__logo { height: 48px; }
  .page { padding-top: 80px; }
  .page__content { padding: 24px 28px 80px; }
  .page__title { margin: 64px 0 56px; font-size: 40px; }
  .sec { grid-template-columns: 1fr; gap: 24px; padding: 40px 0; }
  .pagefoot { padding: 24px 28px; }
  .pagefoot__nav { display: none; }
}
@media (max-width: 1600px) {
  .page-header .krmv-nav,
  .page-header .lang-switcher { display: none; }
  /* Hamburger fixo no canto superior direito, igual ao index */
  .page-header .nav-toggle {
    display: flex;
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 400;
    color: var(--krmv-ink);
  }
}
