/*
Theme Name: Latent Fintech
Theme URI: https://fintech.alphaobs.com/
Author: Latent
Description: Institution design for Latent's fintech site. Navy, warm white and gold; Libre Franklin with Source Serif 4; architectural photography; SVG infographics; Insights blog.
Version: 1.0.0
Requires PHP: 7.4
Text Domain: latent-fintech
*/

/* ============ The Institution: tokens ============ */
:root {
  --navy: #0c203a;
  --navy-2: #091830;
  --bg: #fcfbf8;
  --bg-2: #f3f1ec;
  --txt: #1a2433;
  --muted: #5b6675;
  --gold: #96762e;
  --line: rgba(12, 32, 58, 0.14);
  --line-strong: rgba(12, 32, 58, 0.4);
  --sans: "Libre Franklin", system-ui, sans-serif;
  --serif: "Source Serif 4", Georgia, serif;
  --container: 1140px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--txt);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-family: var(--sans); letter-spacing: -0.015em; }
h1 { font-size: clamp(2.4rem, 5.4vw, 4.1rem); font-weight: 700; line-height: 1.06; }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); font-weight: 600; line-height: 1.18; }
p { margin: 0 0 1em; }
a { color: inherit; text-underline-offset: 3px; }
img { max-width: 100%; }
.nowrap { white-space: nowrap; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
section { padding: 88px 0; }

.eyebrow {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 18px;
}

/* ============ Reveal ============ */
[data-reveal] { opacity: 0; transform: translateY(14px); transition: opacity 0.6s ease, transform 0.6s ease; }
[data-reveal].in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ============ Buttons ============ */
.btn {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  padding: 14px 28px;
  border-radius: 3px;
  border: 1px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { background: #16355c; }
.btn-light { background: #fff; color: var(--navy); }
.btn-light:hover { background: #e8ecf2; }
.btn-lg { padding: 16px 36px; }

.text-link {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  align-self: center;
  color: var(--navy);
  text-decoration: none;
  border-bottom: 2px solid var(--gold);
  padding-bottom: 2px;
}
.text-link:hover { color: var(--gold); }

/* ============ Utility bar ============ */
.utility {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  background: var(--navy);
  color: #c6cfdb;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  padding: 7px 24px;
}
@media (max-width: 640px) { .utility span:last-child { display: none; } }

/* ============ Nav ============ */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(252, 251, 248, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; gap: 28px; height: 72px; }
.brand { margin-right: auto; display: flex; align-items: center; }
.brand img { height: 44px; width: auto; display: block; }
.nav-links { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  font-size: 0.86rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--muted);
  padding: 8px 13px;
}
.nav-links a:hover { color: var(--navy); }
.nav-toggle { display: none; }

@media (max-width: 880px) {
  .nav-cta { display: none; }
  .nav-toggle {
    display: flex; flex-direction: column; gap: 5px;
    background: none; border: 0; padding: 8px; cursor: pointer;
  }
  .nav-toggle span { width: 22px; height: 2px; background: var(--navy); }
  .nav-links {
    position: absolute; top: 72px; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line-strong);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links li { border-top: 1px solid var(--line); }
  .nav-links a { display: block; padding: 14px 24px; }
}

/* ============ Hero ============ */
.hero { padding: 0; }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  min-height: 620px;
}
.hero-copy {
  padding: 92px 56px 72px max(24px, calc((100vw - var(--container)) / 2 + 24px));
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.hero .lede { color: var(--muted); max-width: 560px; margin: 26px 0 34px; font-size: 1.05rem; }
.cta-row { display: flex; flex-wrap: wrap; gap: 24px; }
.hero-photo {
  background: var(--navy) url("assets/img/hero.jpg") center / cover no-repeat;
  min-height: 400px;
}
.trusted { margin-top: 64px; border-top: 1px solid var(--line); padding-top: 20px; }
.trusted p {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}
.trusted ul { display: flex; flex-wrap: wrap; gap: 8px 26px; list-style: none; margin: 0; padding: 0; }
.trusted li { font-size: 0.9rem; font-weight: 600; color: var(--navy); opacity: 0.75; }
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-copy { padding: 64px 24px 56px; }
  .hero-photo { order: -1; min-height: 240px; }
}

/* ============ Figures band ============ */
.figures { background: var(--navy); color: #fff; padding: 56px 0; }
.figures-inner { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.figures strong {
  display: block;
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.figures span { color: #b7c2d2; font-size: 0.9rem; max-width: 260px; display: block; margin-top: 6px; }
@media (max-width: 720px) { .figures-inner { grid-template-columns: 1fr; gap: 28px; } }

/* ============ Approach pillars ============ */
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px; margin-top: 52px; }
.pillar { border-top: 3px solid var(--navy); padding-top: 22px; }
.pillar h3 { font-size: 1.25rem; font-weight: 600; }
.pillar-line { font-family: var(--serif); font-style: italic; color: var(--gold); margin: 8px 0 16px; font-size: 1.02rem; }
.pillar ul { margin: 0; padding: 0; list-style: none; }
.pillar li {
  color: var(--muted);
  font-size: 0.93rem;
  padding: 9px 0 9px 22px;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.pillar li::before { content: "·"; position: absolute; left: 0; color: var(--gold); font-weight: 700; }
@media (max-width: 860px) { .pillars { grid-template-columns: 1fr; gap: 28px; } }

/* ============ Mission band ============ */
.mission {
  background:
    linear-gradient(rgba(9, 24, 48, 0.88), rgba(9, 24, 48, 0.88)),
    url("assets/img/skyline.jpg") center / cover no-repeat;
  color: #fff;
  padding: 108px 0;
}
.mission-inner { display: grid; grid-template-columns: 1.25fr 1fr; gap: 72px; align-items: start; }
.mission figure { margin: 0; }
.mission blockquote {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  line-height: 1.4;
}
.mission figure:last-child blockquote { font-size: clamp(1.05rem, 1.8vw, 1.3rem); color: #c9d3e0; }
.mission figcaption {
  margin-top: 18px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}
@media (max-width: 860px) { .mission-inner { grid-template-columns: 1fr; gap: 44px; } }

/* ============ Services ============ */
.services { background: var(--bg-2); }
.svc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 40px 48px;
  margin-top: 52px;
}
.svc { border-top: 1px solid var(--line-strong); padding-top: 20px; }
.svc h3 { font-size: 1.12rem; font-weight: 600; margin-bottom: 10px; }
.svc p { color: var(--muted); font-size: 0.94rem; }
.svc-tag {
  font-size: 0.7rem !important;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold) !important;
  margin: 0;
}

/* ============ Work ============ */
.work-list { margin-top: 52px; border-top: 1px solid var(--line-strong); }
.work-row {
  display: grid;
  grid-template-columns: 160px 280px 1fr;
  gap: 32px;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.work-sector {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0;
}
.work-row h3 { font-size: 1.3rem; font-weight: 600; }
.work-row p:last-child { margin: 0; color: var(--muted); font-size: 0.94rem; }
@media (max-width: 860px) { .work-row { grid-template-columns: 1fr; gap: 6px; } }

/* ============ Testimonials ============ */
.lead-quote { margin: 0 0 52px; max-width: 860px; }
.lead-quote blockquote { margin: 0; }
.lead-quote h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(1.7rem, 3.4vw, 2.6rem); }
.lead-quote figcaption, .quote-grid figcaption {
  margin-top: 16px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.quote-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0 44px;
  border-top: 1px solid var(--line-strong);
}
.quote-grid figure { margin: 0; padding: 26px 0; border-bottom: 1px solid var(--line); }
.quote-grid blockquote { margin: 0; font-family: var(--serif); font-size: 1.05rem; line-height: 1.5; }

/* ============ FAQ ============ */
.faq { background: var(--bg-2); }
.faq-list { max-width: 780px; margin-top: 44px; border-top: 1px solid var(--line-strong); }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list summary {
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 600;
  padding: 20px 40px 20px 0;
  list-style: none;
  position: relative;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: "+";
  position: absolute; right: 4px; top: 50%;
  transform: translateY(-50%);
  color: var(--gold);
  font-size: 1.2rem;
}
.faq-list details[open] summary::after { content: "\2212"; }
.faq-list details p { color: var(--muted); padding-bottom: 22px; margin: 0; max-width: 640px; }

/* ============ Contact ============ */
.contact { background: var(--navy); color: #fff; padding: 96px 0; }
.contact-inner { max-width: 660px; text-align: center; margin: 0 auto; }
.contact-logo { height: 52px; width: auto; margin-bottom: 28px; }
.contact h2 { color: #fff; }
.contact p { color: #b7c2d2; margin: 14px 0 36px; }
.contact-rows { margin: 0 0 36px; border-top: 1px solid rgba(255,255,255,0.25); text-align: left; }
.contact-rows > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid rgba(255,255,255,0.14);
}
.contact-rows dt {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8fa0b8;
}
.contact-rows dd { margin: 0; font-size: 0.95rem; }
.contact-rows a:hover { color: var(--gold); }

/* ============ Footer ============ */
.footer { border-top: 1px solid var(--line); padding: 26px 0; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; }
.footer p { margin: 0; font-size: 0.78rem; color: var(--muted); }
.footer a { color: var(--navy); }

/* ============ Focus ============ */
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* ============ Delivery infographic ============ */
.delivery { background: var(--bg-2); }
.chart-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 28px 28px 18px;
  margin-top: 52px;
  box-shadow: 0 1px 2px rgba(12, 32, 58, 0.05);
}
.chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.chart-title { font-weight: 600; font-size: 1.05rem; }
.chart-sub { color: var(--muted); font-size: 0.82rem; }
.chart-badge {
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid rgba(150, 118, 46, 0.45);
  border-radius: 999px;
  padding: 4px 12px;
  white-space: nowrap;
}
.chart-card svg { width: 100%; height: auto; display: block; }
.chart-card .grid-line { stroke: rgba(12, 32, 58, 0.1); }
.chart-card .grid-base { stroke: rgba(12, 32, 58, 0.35); }
.chart-card .curve-line { fill: none; stroke: var(--navy); stroke-width: 3; stroke-linecap: round; }
.chart-card .curve-area { fill: rgba(12, 32, 58, 0.07); }
.chart-card .curve-dot { fill: var(--navy); }
.chart-card .curve-dot.gold { fill: var(--gold); }
.chart-card .axis-txt, .chart-card .phase-tick { font: 600 12px var(--sans); fill: var(--muted); letter-spacing: 0.04em; }
.chart-card .phase-tick.active { fill: var(--gold); }
.chart-card .phase-lbl { font: 600 13px var(--sans); fill: var(--navy); }
.chart-card .curve-note { font: italic 13px var(--serif); fill: var(--muted); }

/* ============ Pillar vignettes ============ */
.pillar-viz { margin: 18px 0 4px; }
.pillar-viz svg { width: 100%; height: auto; display: block; }
.pv-box { fill: none; stroke: rgba(12, 32, 58, 0.35); stroke-width: 1.6; }
.pv-check { fill: none; stroke: var(--gold); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.pv-line { fill: none; stroke: var(--navy); stroke-width: 2.4; stroke-linecap: round; }
.pv-soft { fill: none; stroke: rgba(12, 32, 58, 0.2); stroke-width: 1.6; stroke-dasharray: 4 5; }
.pv-label { font: 500 12.5px var(--sans); fill: var(--muted); }
.pv-gold { stroke: var(--gold); }
.pv-fill-soft { fill: rgba(12, 32, 58, 0.06); }

/* ============ Case studies (image-led) ============ */
.cases { background: var(--bg-2); }
.case-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 26px;
  margin-top: 52px;
}
.case-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.case-card:hover { box-shadow: 0 10px 28px rgba(12, 32, 58, 0.12); transform: translateY(-3px); }
.case-media {
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 24px;
}
.case-media img { max-height: 100%; width: auto; max-width: 70%; object-fit: contain; }
.case-media.case-media-photo { padding: 0; }
.case-media.case-media-photo img { width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: top; }
.case-body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.case-sector {
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0;
}
.case-card h3 { font-size: 1.15rem; font-weight: 600; }
.case-card .case-desc { color: var(--muted); font-size: 0.92rem; margin: 0; flex: 1; }
.case-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.case-chips span {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--navy);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 12px;
}

/* ============ Figures mini-viz ============ */
.figures .fig-viz { margin-top: 14px; }
.figures .fig-viz svg { display: block; width: 130px; height: 26px; }
.fig-bar { fill: rgba(255, 255, 255, 0.28); }
.fig-bar.hi { fill: var(--gold); }

/* ============ Insights (blog) ============ */
.page-hero { background: var(--navy); color: #fff; padding: 72px 0 64px; }
.page-hero .eyebrow { color: var(--gold); }
.page-hero h1 { font-size: clamp(2rem, 4.4vw, 3.2rem); color: #fff; }
.page-hero p { color: #b7c2d2; max-width: 640px; margin: 18px 0 0; }
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 26px;
  padding: 72px 0 88px;
}
.post-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.post-card:hover { box-shadow: 0 10px 28px rgba(12, 32, 58, 0.12); transform: translateY(-3px); }
.post-card img { aspect-ratio: 16 / 9; width: 100%; height: auto; object-fit: cover; display: block; }
.post-card-body { padding: 20px 22px 24px; display: flex; flex-direction: column; gap: 8px; }
.post-date { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); }
.post-card h2 { font-size: 1.2rem; font-weight: 600; line-height: 1.3; }
.post-card p { color: var(--muted); font-size: 0.92rem; margin: 0; }

/* single post */
.post-hero { padding: 64px 0 8px; }
.post-hero .post-date { display: block; margin-bottom: 14px; }
.post-hero h1 { font-size: clamp(1.9rem, 4vw, 3rem); max-width: 820px; }
.post-hero .post-byline { color: var(--muted); font-size: 0.9rem; margin-top: 16px; }
.post-content { max-width: 760px; padding: 32px 0 88px; }
.post-content h2 { font-size: 1.5rem; margin: 40px 0 14px; }
.post-content h3 { font-size: 1.15rem; margin: 28px 0 10px; }
.post-content p, .post-content li { color: #333d4d; font-size: 1.02rem; line-height: 1.75; }
.post-content ul { padding-left: 22px; }
.post-content li { margin-bottom: 8px; }
.post-content strong { color: var(--txt); }
.post-back { display: inline-block; margin: 0 0 28px; font-weight: 600; font-size: 0.85rem; color: var(--navy); text-decoration: none; border-bottom: 2px solid var(--gold); padding-bottom: 2px; }
.post-back:hover { color: var(--gold); }

/* ============ Infographic animation ============
   Plays when the ancestor [data-reveal] gains .in (see assets/js/main.js).
   Elements start hidden only once .in applies; before that the whole card is
   already hidden by the reveal itself. */
.in .draw {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: lft-draw 2.8s cubic-bezier(0.4, 0, 0.2, 1) var(--d, 0s) forwards;
}
.in .draw-quick {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: lft-draw 0.8s ease-out var(--d, 0s) forwards;
}
@keyframes lft-draw { to { stroke-dashoffset: 0; } }

.in .pop {
  transform-box: fill-box;
  transform-origin: center;
  transform: scale(0);
  animation: lft-pop 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) var(--d, 0s) forwards;
}
@keyframes lft-pop { to { transform: scale(1); } }

.in .rise {
  opacity: 0;
  transform: translateY(8px);
  animation: lft-rise 1s ease-out var(--d, 0s) forwards;
}
@keyframes lft-rise { to { opacity: 1; transform: translateY(0); } }

.in .fade {
  opacity: 0;
  animation: lft-fade 1.4s ease-out var(--d, 0s) forwards;
}
@keyframes lft-fade { to { opacity: 1; } }

/* figures band: bars grow, region dots pop */
.in .fig-viz rect, .in .fig-viz circle {
  transform-box: fill-box;
  transform-origin: bottom;
  transform: scaleY(0);
  animation: lft-grow 1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.in .fig-viz circle { transform: scale(0); transform-origin: center; animation-name: lft-pop; }
.in .fig-viz rect:nth-child(1), .in .fig-viz circle:nth-child(1) { animation-delay: 0.3s; }
.in .fig-viz rect:nth-child(2), .in .fig-viz circle:nth-child(2) { animation-delay: 0.55s; }
.in .fig-viz rect:nth-child(3), .in .fig-viz circle:nth-child(3) { animation-delay: 0.8s; }
.in .fig-viz rect:nth-child(4) { animation-delay: 1.05s; }
.in .fig-viz rect:nth-child(5) { animation-delay: 1.3s; }
@keyframes lft-grow { to { transform: scaleY(1); } }

@media (prefers-reduced-motion: reduce) {
  .in .draw, .in .draw-quick, .in .pop, .in .rise, .in .fade,
  .in .fig-viz rect, .in .fig-viz circle {
    animation: none;
    opacity: 1;
    transform: none;
    stroke-dasharray: none;
    stroke-dashoffset: 0;
  }
}
