@import url("tokens.css");

/* === Tesouro Marketing Site — Shared styles === */
/* Linear-like minimal density, indigo design system, generous whitespace. */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--background);
  color: var(--foreground);
  font-size: 16px;
  line-height: 1.55;
  font-feature-settings: "ss01", "cv11";
  letter-spacing: -0.005em;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }

::selection { background: var(--indigo); color: var(--indigo-foreground); }

/* Scale */
:root {
  --tx-ink:        oklch(0.18 0.012 280);   /* primary text — slightly warmer than zinc */
  --tx-body:       oklch(0.32 0.012 280);
  --tx-muted:      oklch(0.50 0.014 280);
  --tx-subtle:     oklch(0.65 0.012 280);
  --line:          oklch(0.92 0.006 280);
  --line-strong:   oklch(0.85 0.008 280);
  --surface:       oklch(0.99 0.003 280);
  --surface-muted: oklch(0.975 0.005 280);
  --surface-tint:  oklch(0.97 0.012 277);   /* faintest indigo wash */
  --ink-deep:      oklch(0.16 0.05 277);    /* deep indigo near-black for hero/CTA bands */
  --ink-deeper:    oklch(0.20 0.07 277);

  /* Brand */
  --brand:         oklch(0.457 0.24 277.023);
  --brand-soft:    oklch(0.93  0.048 273);
  --brand-deep:    oklch(0.384 0.167 277);
  --brand-foreground: oklch(0.962 0.018 272);

  /* Layout */
  --container: 1200px;
  --gutter: 32px;
  --section-y: 88px;

  /* Type */
  --fs-h1: clamp(40px, 5.2vw, 64px);
  --fs-h2: clamp(30px, 3.6vw, 44px);
  --fs-h3: clamp(22px, 2.2vw, 28px);
  --fs-eyebrow: 12px;
  --fs-body: 16.5px;
  --fs-lead: 19px;
}

@media (max-width: 760px) {
  :root { --gutter: 20px; --section-y: 56px; }
}

/* Typography */
h1, h2, h3, h4 { letter-spacing: -0.022em; line-height: 1.08; color: var(--tx-ink); margin: 0; font-weight: 500; }
h1 { font-size: var(--fs-h1); letter-spacing: -0.028em; font-weight: 480; }
h2 { font-size: var(--fs-h2); letter-spacing: -0.024em; font-weight: 480; }
h3 { font-size: var(--fs-h3); font-weight: 520; }
p { margin: 0; }

.eyebrow {
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--brand);
  display: inline-block;
}

.lead {
  font-size: var(--fs-lead);
  line-height: 1.5;
  color: var(--tx-body);
  letter-spacing: -0.012em;
  text-wrap: pretty;
  max-width: 60ch;
}

.mono {
  font-family: var(--font-mono);
  font-feature-settings: "ss02";
}

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

section { padding-block: var(--section-y); }
.section-tight { padding-block: 80px; }

/* === NAV === */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.85);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--duration-base) var(--ease-standard);
}
.nav.is-scrolled { border-bottom-color: var(--line); }
.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding-inline: var(--gutter);
  height: 64px;
  display: flex;
  align-items: center;
  gap: 36px;
}
.nav-logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.nav-logo img { height: 22px; width: auto; }
.nav-links { display: flex; align-items: center; gap: 4px; flex: 1; }
.nav-link {
  position: relative;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 470;
  color: var(--tx-body);
  border-radius: var(--radius-md);
  transition: color var(--duration-fast) var(--ease-standard), background-color var(--duration-fast) var(--ease-standard);
  display: inline-flex; align-items: center; gap: 6px;
}
.nav-link:hover { color: var(--tx-ink); background: var(--surface-muted); }
.nav-link[aria-current="page"] { color: var(--tx-ink); }
.nav-link[aria-current="page"]::after {
  content: "";
  position: absolute; left: 14px; right: 14px; bottom: 1px;
  height: 1.5px; background: var(--brand); border-radius: 2px;
}
.nav-link .caret { width: 10px; height: 10px; opacity: 0.5; }

/* Dropdown */
.has-menu { position: relative; }
.has-menu:hover, .has-menu:focus-within, .has-menu.is-open { z-index: 10; }
.menu {
  position: absolute;
  top: calc(100% + 6px);
  left: -8px;
  min-width: 320px;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: 0 1px 0 oklch(0 0 0 / 0.02), 0 24px 48px -16px oklch(0 0 0 / 0.18), 0 8px 16px -8px oklch(0 0 0 / 0.08);
  padding: 8px;
  opacity: 0; visibility: hidden;
  transform: translateY(-4px);
  transition: opacity var(--duration-base) var(--ease-standard),
              transform var(--duration-base) var(--ease-standard),
              visibility var(--duration-base) var(--ease-standard);
}
.has-menu:hover .menu, .has-menu:focus-within .menu {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.menu-item {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-lg);
  transition: background-color var(--duration-fast) var(--ease-standard);
}
.menu-item:hover { background: var(--surface-muted); }
.menu-item .glyph {
  width: 32px; height: 32px;
  border-radius: var(--radius-md);
  background: var(--brand-soft);
  color: var(--brand);
  display: grid; place-items: center;
}
.menu-item .glyph svg { width: 16px; height: 16px; }
.menu-item .title { font-size: 14px; font-weight: 540; color: var(--tx-ink); line-height: 1.2; display: block; }
.menu-item .sub { font-size: 12.5px; color: var(--tx-muted); margin-top: 4px; display: block; }

.nav-cta { margin-left: auto; display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

/* Mobile nav */
.nav-burger { display: none; padding: 8px; border-radius: var(--radius-md); }
.nav-burger:hover { background: var(--surface-muted); }

/* Keyboard support: open menu on focus-within as well as hover. */
.has-menu:focus-within .menu { display: block; }

/* Skip link — first focusable element on every page. Off-screen until focus. */
.skip-link {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 10000;
  background: var(--brand);
  color: var(--brand-foreground);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 540;
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform var(--duration-base) var(--ease-standard);
}
.skip-link:focus { transform: translateY(0); }
@media (max-width: 980px) {
  .nav-links, .nav-cta .btn-text { display: none; }
  .nav-burger { display: inline-flex; }
  /* Show submenu when armed by the mobile two-tap handler */
  .has-menu.is-open > .menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
}
/* Below ~720px the in-nav CTA clips off-screen — hide it so the burger is
   reachable. Users still have the CTA in every page body + footer. */
@media (max-width: 720px) {
  .nav-cta .btn-primary { display: none; }
  .nav-cta { gap: 4px; }
  .nav-burger { padding: 10px; min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
}

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border-radius: var(--radius-lg);
  font-size: 14px;
  font-weight: 530;
  letter-spacing: -0.005em;
  white-space: nowrap;
  transition: background-color var(--duration-fast) var(--ease-standard),
              color var(--duration-fast) var(--ease-standard),
              border-color var(--duration-fast) var(--ease-standard),
              transform var(--duration-instant) var(--ease-standard),
              box-shadow var(--duration-fast) var(--ease-standard);
}
.btn:active { transform: translateY(1px); }
.btn .arrow { transition: transform var(--duration-base) var(--ease-standard); }
.btn:hover .arrow { transform: translateX(3px); }

.btn-primary {
  background: var(--brand);
  color: var(--brand-foreground);
  box-shadow: inset 0 0 0 1px oklch(1 0 0 / 0.12), 0 1px 2px oklch(0 0 0 / 0.15);
}
.btn-primary:hover { background: var(--brand-deep); }

.btn-secondary {
  background: white;
  color: var(--tx-ink);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.btn-secondary:hover { box-shadow: inset 0 0 0 1px var(--tx-muted); background: var(--surface-muted); }

.btn-ghost {
  color: var(--tx-ink);
  padding: 0 6px;
}
.btn-ghost:hover { color: var(--brand); }

.btn-on-dark {
  background: white;
  color: var(--ink-deep);
}
.btn-on-dark:hover { background: var(--brand-soft); }

.btn-lg { height: 46px; padding: 0 22px; font-size: 15px; }

/* Inline link */
.link-inline {
  color: var(--brand);
  font-weight: 530;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid transparent;
  transition: border-color var(--duration-fast) var(--ease-standard);
}
.link-inline:hover { border-bottom-color: var(--brand); }
.link-inline .arrow { transition: transform var(--duration-base) var(--ease-standard); }
.link-inline:hover .arrow { transform: translateX(3px); }

/* === HERO PATTERNS === */
.page-hero {
  padding-top: 48px;
  padding-bottom: 64px;
  border-bottom: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  /* Faint indigo grid wash */
  content: "";
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, transparent 0%, var(--surface-tint) 100%),
    radial-gradient(900px 300px at 80% 0%, oklch(0.93 0.05 277 / 0.5), transparent 60%);
  pointer-events: none;
  z-index: 0;
}
.page-hero > * { position: relative; z-index: 1; }

/* === Cards / surfaces === */
.card {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 28px;
  transition: border-color var(--duration-base) var(--ease-standard),
              box-shadow var(--duration-base) var(--ease-standard),
              transform var(--duration-base) var(--ease-standard);
}
.card.is-link { cursor: pointer; }
.card.is-link:hover {
  border-color: var(--line-strong);
  box-shadow: 0 1px 0 oklch(0 0 0 / 0.02), 0 12px 32px -16px oklch(0 0 0 / 0.12);
  transform: translateY(-2px);
}
.card-title { font-size: 19px; font-weight: 540; color: var(--tx-ink); letter-spacing: -0.015em; }

/* Stat treatment */
.stat-num {
  font-size: clamp(44px, 5.4vw, 64px);
  font-weight: 380;
  letter-spacing: -0.04em;
  color: var(--tx-ink);
  line-height: 1;
  font-feature-settings: "lnum", "tnum";
}
.stat-label {
  font-size: 14.5px;
  color: var(--tx-body);
  line-height: 1.45;
  margin-top: 14px;
  text-wrap: pretty;
}
.stat-source {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--tx-subtle);
  margin-top: 10px;
  font-family: var(--font-mono);
  letter-spacing: 0;
}
a.stat-source {
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-standard);
}
a.stat-source:hover { color: var(--brand); }
a.stat-source .ext { opacity: 0.6; transition: opacity var(--duration-fast) var(--ease-standard); }
a.stat-source:hover .ext { opacity: 1; }
a.stat-source:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 2px;
  color: var(--brand);
}

/* Numbered list */
.numbered-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
@media (max-width: 860px) { .numbered-grid { grid-template-columns: 1fr; } }
.numbered-item .num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--brand);
  font-weight: 600;
  letter-spacing: 0.04em;
}
.numbered-item h3 { margin-top: 14px; margin-bottom: 10px; }
.numbered-item p { color: var(--tx-body); font-size: 15.5px; }

/* CTA band */
.cta-band {
  background: var(--ink-deep);
  color: white;
  position: relative;
  overflow: hidden;
}
.cta-band::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(700px 240px at 20% 30%, oklch(0.35 0.18 277 / 0.6), transparent 60%),
    radial-gradient(600px 200px at 90% 80%, oklch(0.28 0.14 290 / 0.5), transparent 60%);
  pointer-events: none;
}
.cta-band > * { position: relative; }
.cta-band h2 { color: white; }
.cta-band .lead { color: oklch(0.86 0.02 280); }

/* Footer */
.footer {
  border-top: 1px solid var(--line);
  background: var(--surface-muted);
  padding-block: 80px 32px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 64px;
}
@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 36px; }
}
.footer-col h4 {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--tx-muted);
  margin-bottom: 18px;
}
.footer-col a {
  display: block;
  font-size: 14px;
  color: var(--tx-body);
  padding: 8px 0;
  min-height: 24px;
  line-height: 1.4;
  transition: color var(--duration-fast) var(--ease-standard);
}
.footer-col a:hover { color: var(--brand); }
.footer-brand img { height: 22px; margin-bottom: 16px; }
.footer-brand p { font-size: 14px; color: var(--tx-muted); max-width: 28ch; line-height: 1.55; }

.footer-compliance {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  padding-top: 32px;
  margin-top: 8px;
  border-top: 1px solid var(--line);
}
.footer-compliance p {
  font-size: 13px;
  color: var(--tx-muted);
  line-height: 1.55;
  margin: 0;
  text-wrap: pretty;
}
@media (min-width: 720px) {
  .footer-compliance p { white-space: nowrap; }
}
.compliance-badges {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
}
.compliance-badges img {
  height: 56px;
  width: auto;
  display: block;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  margin-top: 28px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--tx-muted);
  flex-wrap: wrap;
  gap: 16px;
}
.footer-social { display: flex; gap: 8px; }
.footer-social a {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  color: var(--tx-muted);
  transition: color var(--duration-fast), border-color var(--duration-fast);
}
.footer-social a:hover { color: var(--brand); border-color: var(--brand); }

/* Utilities */
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.stack-sm > * + * { margin-top: 12px; }
.stack-md > * + * { margin-top: 20px; }
.stack-lg > * + * { margin-top: 32px; }
.cluster { display: flex; flex-wrap: wrap; gap: 12px; }

.divider {
  height: 1px;
  background: var(--line);
  border: 0;
  margin: 0;
}

.kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  color: var(--tx-muted);
}

/* Reveal animation on scroll */
.reveal {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 600ms var(--ease-standard), transform 600ms var(--ease-standard);
}
.reveal.is-in { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal.is-in {
    opacity: 1;
    transform: none;
    transition: none;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Section header pattern */
.section-head {
  max-width: 720px;
  margin-bottom: 56px;
}
.section-head .eyebrow { margin-bottom: 16px; }
.section-head .lead { margin-top: 18px; }

/* Two-column hero */
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 72px;
  align-items: center;
  min-height: 540px;
}
/* Product heroes: top-align the text column so the heading sits at a
   consistent height regardless of copy length (matches the simple
   single-column heroes like For Banks). Scoped via :has so the homepage
   and For Platforms heroes keep their centered layout. */
.hero-grid:has(.product-hero) { align-items: start; }
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; gap: 48px; min-height: 0; }
}

/* Generic 3-col grid */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 860px) { .grid-3 { grid-template-columns: 1fr; } }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 760px) { .grid-2 { grid-template-columns: 1fr; } }

.grid-2x2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 760px) { .grid-2x2 { grid-template-columns: 1fr; } }

/* === Feature/icon glyph === */
.glyph-lg {
  width: 40px; height: 40px;
  border-radius: var(--radius-lg);
  background: var(--brand-soft);
  color: var(--brand);
  display: grid; place-items: center;
  margin-bottom: 18px;
}
.glyph-lg svg { width: 20px; height: 20px; }

/* Print silence */
@media print { .nav, .footer { display: none; } }
