/* Mauro Valadim — Scheme B · Institutional Equity Desk */
:root {
  --ink: #12161c;
  --ink-mid: #1c232c;
  --ink-lift: #252d38;
  --paper: #e8ebef;
  --paper-soft: #f1f3f5;
  --paper-deep: #d5dae0;
  --slate: #5c6874;
  --slate-soft: #8a949e;
  --line: rgba(18, 22, 28, 0.12);
  --line-on-dark: rgba(232, 235, 239, 0.14);
  --pine: #1f4d3a;
  --pine-bright: #2d6b52;
  --pine-glow: rgba(31, 77, 58, 0.22);
  --font-display: "Instrument Serif", "Times New Roman", Georgia, serif;
  --font-body: "IBM Plex Sans", "Segoe UI", sans-serif;
  --gutter: clamp(1.1rem, 4.5vw, 2.25rem);
  --measure: min(1080px, calc(100% - (var(--gutter) * 2)));
  --narrow: min(680px, calc(100% - (var(--gutter) * 2)));
  --header-h: 3.55rem;
  --section-y: clamp(3.5rem, 10vw, 6.75rem);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--safe-top) + 0.75rem);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .hero-enter__item,
  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: clamp(0.98rem, 0.15vw + 0.94rem, 1.05rem);
  font-weight: 400;
  line-height: 1.68;
  color: var(--slate);
  background:
    linear-gradient(180deg, #edf0f3 0%, var(--paper) 45%, #dde2e7 100%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body.is-nav-open {
  overflow: hidden;
}

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

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  text-align: left;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--pine);
  color: var(--paper-soft);
  border-radius: 2px;
}

.skip-link:focus {
  top: calc(0.75rem + var(--safe-top));
}

.wrap {
  width: var(--measure);
  margin-inline: auto;
}

.wrap.narrow {
  width: var(--narrow);
}

/* ——— Header ——— */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  padding-top: var(--safe-top);
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
  background: rgba(18, 22, 28, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}

.site-header.is-scrolled {
  border-bottom-color: var(--line-on-dark);
  background: rgba(18, 22, 28, 0.97);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  height: var(--header-h);
  width: var(--measure);
  margin-inline: auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.brand-mark {
  width: 0.55rem;
  height: 0.55rem;
  background: var(--pine-bright);
  box-shadow: 0 0 0 3px var(--pine-glow);
}

.brand-word {
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: 0.01em;
  color: var(--paper-soft);
}

.site-nav {
  display: none;
  margin-left: auto;
  gap: 1.25rem;
}

.site-nav a {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--slate-soft);
  transition: color 0.25s var(--ease);
}

.site-nav a:hover,
.site-nav a.is-active {
  color: #fff;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-left: auto;
}

.lang-switch {
  display: inline-flex;
  border: 1px solid var(--line-on-dark);
  overflow: hidden;
}

.lang-btn {
  padding: 0.28rem 0.55rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--slate-soft);
}

.lang-btn.is-active {
  background: var(--pine);
  color: #fff;
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0.4rem;
}

.nav-toggle-bar {
  display: block;
  height: 1.5px;
  width: 100%;
  background: var(--paper-soft);
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}

body.is-nav-open .nav-toggle-bar:first-child {
  transform: translateY(3.25px) rotate(45deg);
}

body.is-nav-open .nav-toggle-bar:last-child {
  transform: translateY(-3.25px) rotate(-45deg);
}

.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.75rem var(--gutter) 1.25rem;
  background: var(--ink-mid);
  border-bottom: 1px solid var(--line-on-dark);
}

.mobile-nav[hidden],
.nav-backdrop[hidden] {
  display: none !important;
}

.mobile-nav a {
  padding: 0.85rem 0;
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--paper-soft);
  border-bottom: 1px solid var(--line-on-dark);
}

.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.45);
}

@media (min-width: 960px) {
  .site-nav {
    display: flex;
  }

  .nav-toggle,
  .mobile-nav,
  .nav-backdrop {
    display: none !important;
  }

  .header-tools {
    margin-left: 1.5rem;
  }
}

/* ——— Hero · dossier panel ——— */
.hero {
  background:
    radial-gradient(ellipse 70% 80% at 100% 0%, rgba(31, 77, 58, 0.28), transparent 55%),
    radial-gradient(ellipse 50% 60% at 0% 100%, rgba(37, 45, 56, 0.9), transparent 50%),
    linear-gradient(165deg, #0f1318 0%, var(--ink) 48%, #171c24 100%);
  color: var(--paper-soft);
  padding:
    calc(var(--header-h) + var(--safe-top) + 3.5rem)
    0
    3.75rem;
}

.hero-panel {
  display: grid;
  gap: 1.75rem 2.25rem;
  padding: 1.75rem;
  min-height: 360px;
  align-items: start;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 40%),
    rgba(18, 22, 28, 0.55);
  border: 1px solid var(--line-on-dark);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 24px 48px -32px rgba(0, 0, 0, 0.65);
}

.hero-media {
  position: relative;
  width: min(260px, 62vw);
  aspect-ratio: 4 / 5;
  justify-self: end;
  overflow: hidden;
  background: var(--ink-lift);
}

.hero-media::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0 0 auto auto;
  width: 3px;
  height: 42%;
  background: var(--pine-bright);
}

.hero-media::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: auto 0 0 auto;
  width: 34%;
  height: 3px;
  background: var(--pine-bright);
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 26%;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  justify-content: center;
}

.hero-eyebrow {
  margin: 0 0 0.85rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--pine-bright);
}

.hero-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 0.92;
  letter-spacing: -0.02em;
  color: #fff;
}

.hero-given,
.hero-family {
  display: block;
}

.hero-given {
  font-size: clamp(2.6rem, 6vw, 3.85rem);
  font-style: italic;
}

.hero-family {
  font-size: clamp(2.35rem, 5.5vw, 3.5rem);
  margin-top: 0.08em;
}

.hero-facts {
  display: grid;
  gap: 0.85rem 1.5rem;
  margin: 1.25rem 0 0;
  padding: 1rem 0 0;
  border-top: 1px solid var(--line-on-dark);
}

.hero-facts div {
  min-width: 0;
}

.hero-facts dt {
  margin: 0 0 0.2rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--slate-soft);
}

.hero-facts dd {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 500;
  color: rgba(241, 243, 245, 0.92);
}

.hero-lede {
  margin: 1.15rem 0 0;
  max-width: 26rem;
  padding-left: 0.85rem;
  border-left: 2px solid var(--pine);
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-style: italic;
  line-height: 1.35;
  color: rgba(241, 243, 245, 0.82);
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  align-self: flex-start;
  margin-top: 1.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--pine-bright);
  transition: color 0.25s var(--ease), gap 0.25s var(--ease);
}

.hero-cta::after {
  content: "→";
  font-size: 1rem;
  line-height: 1;
}

.hero-cta:hover {
  color: #fff;
  gap: 0.7rem;
}

.hero-trail {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.35rem;
  margin: 0;
  padding: 1rem 0 0;
  border-top: 1px solid var(--line-on-dark);
  grid-column: 1 / -1;
}

.hero-trail li {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--slate-soft);
}

.hero-trail li:not(:last-child)::after {
  content: "";
  display: inline-block;
  width: 1.1rem;
  height: 1px;
  margin: 0 0.55rem 0 0.7rem;
  vertical-align: middle;
  background: var(--pine-bright);
  opacity: 0.65;
}

@media (min-width: 780px) {
  .hero {
    padding:
      calc(var(--header-h) + var(--safe-top) + 4.25rem)
      0
      4.5rem;
  }

  .hero-panel {
    grid-template-columns: 1fr 300px;
    gap: 0 3rem;
    padding: 2.25rem 2.35rem 1.75rem;
    min-height: 420px;
    align-items: stretch;
  }

  .hero-media {
    width: 300px;
    justify-self: end;
    grid-column: 2;
    grid-row: 1;
  }

  .hero-copy {
    grid-column: 1;
    grid-row: 1;
    padding: 0.5rem 0 0.65rem;
  }

  .hero-facts {
    grid-template-columns: 1fr 1fr;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
  }

  .hero-lede {
    margin-top: 1.4rem;
    font-size: 1.3rem;
  }

  .hero-cta {
    margin-top: 1.6rem;
  }

  .hero-trail {
    padding-top: 1.25rem;
  }
}

/* ——— Sections ——— */
.section {
  padding: var(--section-y) 0;
}

.section-head {
  margin-bottom: clamp(1.5rem, 3.5vw, 2.4rem);
}

.section-label {
  margin: 0 0 0.55rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--pine);
}

.section-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.section-dek {
  margin: 0.75rem 0 0;
  font-size: 0.95rem;
  color: var(--slate-soft);
}

.prose p {
  margin: 0 0 1rem;
  max-width: 64ch;
}

.prose p:last-child {
  margin-bottom: 0;
}

/* About */
.section--about {
  background: var(--paper-soft);
}

.about-grid {
  display: grid;
  gap: 1.5rem 3rem;
}

.about-body {
  margin: 0 0 1.5rem;
  max-width: 52ch;
  font-size: 1.05rem;
  color: var(--slate);
}

.about-meta {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
}

.about-meta li {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 1rem;
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--line);
}

.about-meta li:last-child {
  border-bottom: 0;
}

.meta-k {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--slate-soft);
  align-self: center;
}

.meta-v {
  color: var(--ink);
  font-weight: 500;
}

@media (min-width: 800px) {
  .about-grid {
    grid-template-columns: minmax(220px, 0.85fr) 1.15fr;
    align-items: start;
  }

  .about-grid .section-head {
    margin-bottom: 0;
  }
}

/* Formation */
.section--formation {
  background:
    linear-gradient(180deg, #e2e6eb 0%, var(--paper) 100%);
}

.formation-grid {
  display: grid;
  gap: 1.25rem 3.5rem;
}

@media (min-width: 900px) {
  .formation-grid {
    grid-template-columns: 0.9fr 1.1fr;
    align-items: start;
  }

  .formation-grid .section-head {
    margin-bottom: 0;
    position: sticky;
    top: calc(var(--header-h) + var(--safe-top) + 1.25rem);
  }
}

/* Accordion path */
.section--path {
  background: var(--paper-soft);
}

.accordion {
  border-top: 1px solid var(--line);
}

.acc-item {
  border-bottom: 1px solid var(--line);
}

.acc-trigger {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.85rem 1.15rem;
  align-items: center;
  padding: 1.25rem 0.15rem;
  transition: background 0.25s var(--ease);
}

.acc-trigger:hover {
  background: rgba(31, 77, 58, 0.04);
}

.acc-year {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--pine);
  min-width: 7.5rem;
}

.acc-title {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
  line-height: 1.25;
  color: var(--ink);
}

.acc-icon {
  width: 1.1rem;
  height: 1.1rem;
  position: relative;
}

.acc-icon::before,
.acc-icon::after {
  content: "";
  position: absolute;
  background: var(--ink);
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}

.acc-icon::before {
  inset: 50% 0 auto;
  height: 1.5px;
  transform: translateY(-50%);
}

.acc-icon::after {
  inset: 0 auto 0 50%;
  width: 1.5px;
  transform: translateX(-50%);
}

.acc-trigger[aria-expanded="true"] .acc-icon::after {
  transform: translateX(-50%) scaleY(0);
  opacity: 0;
}

.acc-panel {
  padding: 0 0 1.4rem;
  max-width: 68ch;
}

.acc-panel[hidden] {
  display: none;
}

@media (max-width: 640px) {
  .acc-trigger {
    grid-template-columns: 1fr auto;
  }

  .acc-year {
    grid-column: 1 / -1;
    min-width: 0;
  }
}

/* Credentials */
.section--credentials {
  background: var(--ink);
  color: var(--slate-soft);
}

.section--credentials .section-label {
  color: var(--pine-bright);
}

.section--credentials .section-title {
  color: var(--paper-soft);
}

.section--credentials .section-dek {
  color: var(--slate-soft);
}

.cred-layout {
  display: grid;
  gap: 2rem;
}

.cred-bar {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1.5rem;
}

.cred-bar span {
  padding: 0.4rem 0.7rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
  border: 1px solid var(--line-on-dark);
  background: var(--ink-lift);
}

.cred-frame {
  margin: 0;
}

.cred-frame img {
  width: 100%;
  border: 1px solid var(--line-on-dark);
  filter: saturate(0.92);
}

@media (min-width: 900px) {
  .cred-layout {
    grid-template-columns: 0.85fr 1.15fr;
    align-items: center;
    gap: 3rem;
  }
}

/* Close */
.section--close {
  background: var(--paper-soft);
}

.close-quote {
  margin: 0 0 2rem;
  padding: 0;
  border: 0;
}

.close-line {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.6rem);
  font-style: italic;
  line-height: 1.2;
  color: var(--ink);
}

.close-line--soft {
  margin-top: 0.55rem;
  font-size: clamp(1rem, 2vw, 1.2rem);
  font-style: normal;
  color: var(--slate);
}

.close-meta {
  display: inline-flex;
  flex-direction: column;
  gap: 0.2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}

.close-meta-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--slate-soft);
}

.close-meta-value {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--ink);
}

/* Footer */
.site-footer {
  padding: 2.5rem 0 calc(1.85rem + var(--safe-bottom));
  background: #0c1015;
  color: var(--slate-soft);
}

.footer-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--paper-soft);
}

.footer-role,
.footer-sign {
  margin: 0.3rem 0 0;
  font-size: 0.88rem;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.6rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--line-on-dark);
}

.footer-copy {
  margin: 0;
  font-size: 0.8rem;
}

.footer-nav {
  display: flex;
  gap: 1.1rem;
}

.footer-nav a {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.7;
  transition: opacity 0.25s var(--ease);
}

.footer-nav a:hover {
  opacity: 1;
}

/* Reveals */
[data-reveal] {
  opacity: 0;
  transform: translateY(0.9rem);
  transition: opacity 0.65s var(--ease), transform 0.65s var(--ease);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* ——— Responsive polish ——— */
@media (max-width: 779px) {
  :root {
    --header-h: 3.25rem;
    --section-y: clamp(2.75rem, 8vw, 4.5rem);
  }

  .brand-word {
    font-size: 1.05rem;
  }

  .brand-mark {
    width: 0.45rem;
    height: 0.45rem;
  }

  .hero {
    padding:
      calc(var(--header-h) + var(--safe-top) + 2rem)
      0
      2.25rem;
  }

  .hero-panel {
    min-height: 0;
    padding: 1.25rem;
    gap: 1.35rem;
  }

  .hero-media {
    width: min(220px, 70vw);
    justify-self: center;
    order: -1;
  }

  .hero-given {
    font-size: clamp(2.2rem, 9vw, 2.85rem);
  }

  .hero-family {
    font-size: clamp(2rem, 8vw, 2.55rem);
  }

  .hero-facts {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .hero-lede {
    font-size: 1.05rem;
  }

  .hero-trail {
    gap: 0.35rem 0.15rem;
  }

  .hero-trail li {
    font-size: 0.6rem;
    letter-spacing: 0.08em;
  }

  .hero-trail li:not(:last-child)::after {
    width: 0.7rem;
    margin: 0 0.35rem 0 0.45rem;
  }

  .about-meta li {
    grid-template-columns: 1fr;
    gap: 0.25rem;
    padding: 0.85rem 1rem;
  }

  .acc-trigger {
    padding: 1.05rem 0;
    gap: 0.55rem 0.75rem;
  }

  .cred-bar {
    margin-top: 1.15rem;
  }

  .cred-bar span {
    padding: 0.35rem 0.55rem;
    font-size: 0.62rem;
  }

  .close-line {
    font-size: clamp(1.45rem, 6.5vw, 2rem);
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .lang-btn {
    padding: 0.35rem 0.5rem;
    min-height: 2rem;
  }

  .nav-toggle {
    width: 2.5rem;
    height: 2.5rem;
  }

  .mobile-nav a {
    font-size: 1.25rem;
    padding: 0.95rem 0;
  }

  .hero-panel {
    padding: 1.05rem;
  }

  .hero-media {
    width: min(190px, 68vw);
  }

  .section-title {
    font-size: clamp(1.7rem, 7.5vw, 2.2rem);
  }

  .prose p {
    font-size: 0.98rem;
  }
}

@media (min-width: 780px) and (max-width: 1023px) {
  .hero-panel {
    grid-template-columns: 1fr 240px;
    gap: 0 1.75rem;
    padding: 1.75rem 1.6rem 1.45rem;
    min-height: 360px;
  }

  .hero-media {
    width: 240px;
  }

  .hero-given {
    font-size: clamp(2.35rem, 4.2vw, 3.1rem);
  }

  .hero-family {
    font-size: clamp(2.15rem, 3.8vw, 2.85rem);
  }

  .about-grid {
    gap: 1.5rem 2rem;
  }

  .formation-grid {
    gap: 1.25rem 2rem;
  }

  .cred-layout {
    gap: 1.75rem;
  }
}

@media (min-width: 1024px) {
  .site-nav {
    gap: 1.45rem;
  }
}

@media (min-width: 1280px) {
  :root {
    --measure: min(1140px, calc(100% - (var(--gutter) * 2)));
  }
}

@media (hover: none) and (pointer: coarse) {
  .site-nav a,
  .footer-nav a,
  .hero-cta,
  .lang-btn,
  .acc-trigger {
    -webkit-tap-highlight-color: transparent;
  }

  .acc-trigger {
    min-height: 3rem;
  }
}
