/* Matias Causa — Leadership Portfolio
   Colors and type match the Figma "Leadership Portfolio" page. */

:root {
  --navy: #0b2545;
  --blue: #134074;
  --ink: #1d2a44;
  --muted: #4f5d75;
  --eyebrow: #8da9c4;
  --pale: #eef4f8;
  --border: #d0dbeb;
  --white: #ffffff;
  --gold: #b38235;
  --serif: "DM Serif Text", Georgia, "Times New Roman", serif;
  --sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --measure: 840px;
  --wide: 1120px;
  --radius: 8px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-underline-offset: 3px; }
a:hover { color: var(--navy); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3, h4, p { margin: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 16px; top: -48px; background: var(--gold); color: var(--white); padding: 8px 14px; border-radius: 6px; z-index: 20; text-decoration: none; }
.skip-link:focus { top: 12px; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: calc(var(--measure) + 48px); margin: 0 auto; padding: 0 24px; }
.container-wide { width: 100%; max-width: calc(var(--wide) + 48px); margin: 0 auto; padding: 0 24px; }

/* ---------- Site header ---------- */
.site-header { position: sticky; top: 0; z-index: 10; background: rgba(255,255,255,.94); backdrop-filter: saturate(160%) blur(8px); border-bottom: 1px solid var(--border); }
.site-header.on-dark { background: rgba(11,37,69,.96); border-bottom-color: rgba(255,255,255,.12); }
.site-header .bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }
.brand { font-family: var(--serif); font-size: 21px; color: var(--navy); text-decoration: none; white-space: nowrap; }
.on-dark .brand { color: var(--white); }
.nav { display: flex; align-items: center; gap: 24px; }
.nav a { font-size: 15px; font-weight: 500; color: var(--muted); text-decoration: none; }
.nav a:hover { color: var(--navy); }
.on-dark .nav a { color: var(--pale); }
.on-dark .nav a:hover { color: var(--white); }
.nav .nav-hide-sm { display: inline; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 999px; font-family: var(--sans); font-size: 15px; font-weight: 600; text-decoration: none; border: 1.5px solid transparent; cursor: pointer; line-height: 1.2; }
.btn-primary { background: var(--navy); color: var(--white); }
.btn-primary:hover { background: var(--blue); color: var(--white); }
.btn-ghost { background: transparent; color: var(--navy); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--navy); color: var(--navy); }
.btn-sm { padding: 8px 14px; font-size: 14px; }
.nav .btn { color: var(--white); }
.on-dark .nav .btn-primary { background: var(--white); color: var(--navy); }

/* ---------- Typography helpers ---------- */
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--eyebrow); }
.eyebrow-gold { color: var(--gold); }
.lead { font-size: 20px; line-height: 1.55; color: var(--muted); }
.serif { font-family: var(--serif); font-weight: 400; }

/* ---------- Public home ---------- */
.hero { padding: 72px 0 80px; }
.hero-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 56px; align-items: center; }
.hero h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(38px, 5.2vw, 60px); line-height: 1.08; color: var(--navy); margin: 16px 0 20px; letter-spacing: -.01em; }
.hero .lead { max-width: 36ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.portrait { position: relative; }
.portrait img { border-radius: 12px; aspect-ratio: 1 / 1; object-fit: cover; width: 100%; }
.portrait::after { content: ""; position: absolute; inset: 14px -14px -14px 14px; border: 2px solid var(--gold); border-radius: 12px; z-index: -1; }

.band { padding: 88px 0; }
.band-pale { background: var(--pale); }
.band-navy { background: var(--navy); color: var(--pale); }
.section-head { margin-bottom: 36px; }
.section-head h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(30px, 3.6vw, 40px); line-height: 1.15; color: var(--navy); margin-top: 10px; }
.band-navy .section-head h2 { color: var(--white); }
.prose p + p { margin-top: 16px; }
.prose p { color: var(--ink); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.aside-card { background: var(--white); border: 1px solid var(--border); border-left: 3px solid var(--gold); border-radius: var(--radius); padding: 24px 26px; }
.aside-card h3 { font-size: 15px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--blue); margin-bottom: 10px; }
.aside-card p { font-size: 16px; color: var(--muted); }
.brands { margin-top: 14px; font-size: 15px; color: var(--ink); font-weight: 500; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.stat { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 22px 24px; }
.stat .num { font-size: 44px; font-weight: 800; letter-spacing: -.02em; color: var(--blue); line-height: 1.05; }
.stat .label { font-size: 15px; font-weight: 600; color: var(--navy); margin-top: 10px; line-height: 1.35; }
.stat .desc { font-size: 14px; color: var(--muted); margin-top: 6px; line-height: 1.45; }

.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.card { display: flex; flex-direction: column; gap: 10px; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s, transform .15s; }
.card:hover { border-color: var(--blue); box-shadow: 0 10px 28px -16px rgba(11,37,69,.35); transform: translateY(-2px); color: inherit; }
.card .card-meta { font-size: 13px; color: var(--eyebrow); font-weight: 600; letter-spacing: .02em; }
.card h3 { font-family: var(--serif); font-weight: 400; font-size: 25px; line-height: 1.2; color: var(--navy); }
.card p { font-size: 16px; color: var(--muted); line-height: 1.55; flex: 1; }
.card .card-cta { font-size: 14px; font-weight: 600; color: var(--blue); display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; }
.lock { width: 14px; height: 14px; flex: none; }

.principles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.principle .n { font-size: 13px; font-weight: 700; letter-spacing: .12em; color: var(--gold); }
.principle h3 { font-family: var(--serif); font-weight: 400; font-size: 26px; color: var(--white); margin: 8px 0 12px; line-height: 1.2; }
.principle p { font-size: 16px; color: var(--pale); opacity: .9; }

.live-links { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.live-link { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 22px 24px; border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; color: var(--navy); background: var(--white); }
.live-link:hover { border-color: var(--blue); }
.live-link strong { display: block; font-size: 17px; }
.live-link span { font-size: 14px; color: var(--muted); }
.live-link .arrow { font-size: 20px; color: var(--blue); }

.contact { text-align: center; }
.contact h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(32px, 4vw, 44px); color: var(--white); margin: 12px 0 14px; }
.contact p { color: var(--pale); max-width: 54ch; margin: 0 auto; }
.contact .hero-actions { justify-content: center; }
.contact .btn-primary { background: var(--white); color: var(--navy); }
.contact .btn-primary:hover { background: var(--pale); }
.contact .btn-ghost { color: var(--white); border-color: rgba(255,255,255,.35); }
.contact .btn-ghost:hover { border-color: var(--white); color: var(--white); }

.site-footer { padding: 28px 0 36px; font-size: 14px; color: var(--muted); border-top: 1px solid var(--border); }
.site-footer .bar { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.site-footer a { color: var(--muted); }

/* ---------- Case study pages ---------- */
.cs-header { background: var(--navy); color: var(--white); padding: 96px 0 72px; }
.cs-header h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(36px, 5vw, 52px); line-height: 1.12; margin: 14px 0 16px; }
.cs-header .meta { color: var(--pale); font-size: 16px; }
.cs-header .meta span + span::before { content: "|"; margin: 0 12px; color: var(--eyebrow); }
.cs-body { padding: 72px 0 40px; }
.cs-section { padding-bottom: 48px; margin-bottom: 48px; border-bottom: 1px solid var(--border); }
.cs-section:last-of-type { border-bottom: 0; }
.cs-section > h2 { font-family: var(--serif); font-weight: 400; font-size: 32px; line-height: 1.2; color: var(--navy); margin-bottom: 22px; }
.cs-section > * + * { margin-top: 20px; }
.cs-section > h2 + * { margin-top: 0; }
.cs-section p { font-size: 17px; line-height: 1.65; }
.ask { font-size: 19px !important; font-weight: 500; color: var(--blue); line-height: 1.5 !important; padding-left: 18px; border-left: 3px solid var(--gold); }
.muted-note { color: var(--muted); font-size: 16px !important; font-style: italic; }
.sub h3 { font-size: 19px; font-weight: 600; color: var(--navy); margin-bottom: 8px; line-height: 1.35; }
.sub p { color: var(--muted); }
.sub + .sub { margin-top: 28px; }
.bullets { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.bullets li { position: relative; padding-left: 26px; font-size: 17px; line-height: 1.6; }
.bullets li::before { content: ""; position: absolute; left: 5px; top: .62em; width: 7px; height: 7px; border-radius: 50%; background: var(--blue); }
.tools { color: var(--muted); }

.metrics { display: grid; grid-template-columns: repeat(var(--cols, 3), 1fr); gap: 18px; background: var(--pale); border-radius: var(--radius); padding: 22px; }
.metrics .stat { padding: 20px; }
.metrics .stat .num { font-size: 38px; }
.stat.dark { background: var(--navy); border-color: var(--navy); }
.stat.dark .num, .stat.dark .label { color: var(--white); }
.stat.dark .desc { color: var(--pale); }

figure { margin: 0; }
.figure img { width: 100%; border-radius: var(--radius); border: 1px solid var(--border); background: var(--pale); }
.figure figcaption { font-size: 14px; color: var(--muted); margin-top: 10px; line-height: 1.5; }

/* Diagrams (HTML versions of the Figma graphics) */
.diagram { background: var(--pale); border-radius: var(--radius); padding: 26px; }
.diagram-title { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--blue); text-align: center; margin-bottom: 18px; }
.d-row { display: flex; align-items: stretch; gap: 12px; }
.d-box { flex: 1; background: var(--white); border: 1px solid var(--border); border-radius: 6px; padding: 16px; }
.d-box.dark { background: var(--navy); border-color: var(--navy); color: var(--white); }
.d-box .k { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--eyebrow); }
.d-box h4 { font-family: var(--serif); font-weight: 400; font-size: 19px; color: var(--navy); margin: 6px 0 6px; line-height: 1.2; }
.d-box.dark h4 { color: var(--white); }
.d-box p { font-size: 14px !important; line-height: 1.45 !important; color: var(--muted); }
.d-box.dark p { color: var(--pale); }
.d-box ul { margin: 10px 0 0; padding-left: 18px; font-size: 13px; color: var(--ink); }
.d-arrow { display: flex; align-items: center; justify-content: center; color: var(--eyebrow); font-size: 18px; flex: none; }
.d-tag { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .08em; padding: 3px 8px; border-radius: 4px; background: var(--navy); color: var(--white); float: right; margin-top: 4px; }
.d-tag.alt { background: var(--eyebrow); }
.d-foundation { margin-top: 12px; text-align: center; }
.d-connector { flex: .8; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 10px; font-weight: 700; letter-spacing: .1em; color: var(--eyebrow); }
.d-connector::before { content: ""; display: block; width: 100%; height: 0; border-top: 1.5px dashed var(--eyebrow); }

.multiplier { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; }
.mult-side { text-align: center; flex: 1; }
.mult-side h4 { font-family: var(--serif); font-weight: 400; font-size: 22px; color: var(--navy); margin-top: 12px; }
.mult-side p { font-size: 13px !important; color: var(--muted); }
.grid-dots { display: inline-grid; gap: 4px; }
.grid-dots i { display: block; width: 14px; height: 14px; border-radius: 2px; background: var(--blue); }
.grid-dots i:nth-child(3n) { background: var(--eyebrow); }
.grid-dots i:nth-child(4n+1) { background: var(--navy); }
.grid-dots.few { grid-template-columns: repeat(3, 18px); }
.grid-dots.few i { width: 18px; height: 18px; }
.grid-dots.many { grid-template-columns: repeat(8, 10px); gap: 3px; }
.grid-dots.many i { width: 10px; height: 10px; }
.mult-mid { flex: .9; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.mult-mid::before, .mult-mid::after { content: ""; width: 100%; border-top: 1.5px dashed var(--border); }
.mult-mid span { font-size: 11px; font-weight: 700; letter-spacing: .1em; color: var(--blue); background: var(--pale); border: 1px solid var(--border); padding: 4px 10px; border-radius: 999px; }

.ba { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ba-panel { background: var(--white); border: 1px solid var(--border); border-radius: 6px; padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.ba-panel h4 { font-family: var(--serif); font-weight: 400; font-size: 21px; color: var(--navy); }
.node { border: 1px solid var(--border); border-radius: 6px; padding: 10px; text-align: center; font-size: 14px; font-weight: 600; color: var(--navy); background: var(--white); }
.node.dark { background: var(--navy); border-color: var(--navy); color: var(--white); }
.node.dark small { display: block; font-weight: 400; font-size: 12px; color: var(--pale); margin-top: 2px; }
.ba-arrow { text-align: center; color: var(--eyebrow); line-height: 1; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.chip { font-size: 12px; font-weight: 500; color: var(--muted); border: 1.5px dashed var(--eyebrow); border-radius: 999px; padding: 4px 10px; }
.teams { display: grid; gap: 6px; }
.ba-note { font-size: 13px !important; color: var(--muted); line-height: 1.5 !important; margin-top: auto; }

.timeline { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; background: var(--pale); border-radius: var(--radius); padding: 22px; }
.timeline .stat .num { font-size: 34px; }

.cs-next { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; padding: 32px 0 64px; border-top: 1px solid var(--border); }
.cs-next a { font-weight: 600; font-size: 18px; text-decoration: none; }
.cs-next a:hover { text-decoration: underline; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 48px 20px; background: var(--navy); }
.login-card { width: 100%; max-width: 420px; background: var(--white); border-radius: 12px; padding: 40px 36px; box-shadow: 0 30px 60px -30px rgba(0,0,0,.5); }
.login-card .brand { display: inline-block; margin-bottom: 26px; }
.login-card h1 { font-family: var(--serif); font-weight: 400; font-size: 30px; color: var(--navy); line-height: 1.2; }
.login-card p { color: var(--muted); font-size: 16px; margin-top: 10px; }
.login-card form { margin-top: 26px; display: grid; gap: 14px; }
.login-card label { font-size: 14px; font-weight: 600; color: var(--navy); }
.login-card input[type=password] { width: 100%; font: inherit; font-size: 16px; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 8px; color: var(--ink); }
.login-card input[type=password]:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(19,64,116,.15); }
.login-card .btn { justify-content: center; width: 100%; }
.login-error { background: #fbeceb; color: #8a2a21; border-radius: 8px; padding: 10px 12px; font-size: 14px; }
.login-help { font-size: 14px !important; margin-top: 22px !important; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .principles { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .nav { gap: 14px; }
  .nav .nav-hide-sm { display: none; }
  .hero { padding: 40px 0 56px; }
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .portrait { max-width: 300px; order: -1; }
  .band { padding: 64px 0; }
  .two-col, .cards, .live-links, .ba { grid-template-columns: 1fr; }
  .metrics, .timeline { grid-template-columns: 1fr; }
  .d-row { flex-direction: column; }
  .d-arrow { transform: rotate(90deg); }
  .d-connector { padding: 6px 0; }
  .d-connector::before { width: 0; height: 18px; border-top: 0; border-left: 1.5px dashed var(--eyebrow); }
  .multiplier { flex-direction: column; }
  .mult-mid { width: 60%; }
  .cs-header { padding: 64px 0 48px; }
  .cs-body { padding-top: 48px; }
  .cs-header .meta span { display: block; }
  .cs-header .meta span + span::before { content: none; }
}
@media (max-width: 420px) {
  .stats { grid-template-columns: 1fr; }
  .site-header .btn { padding: 7px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card { transition: none; }
  .card:hover { transform: none; }
}
@media print {
  .site-header, .skip-link, .cs-next { display: none; }
  .cs-header { background: none; color: var(--navy); padding: 24px 0; }
  .cs-header .meta { color: var(--muted); }
}
@media (max-width: 760px) {
  .cs-next { flex-direction: column; align-items: flex-start; gap: 14px; }
  .cs-next a { font-size: 16px; }
}
