/* TradeChain marketing site — one stylesheet shared by every page.
   Colours are estimated from the redesign mockup (TRADECHAIN_REDESIGN.md §2);
   TODO: client to confirm final brand values. */

:root {
  /* Brand */
  --navy-900: #111a3e;
  --navy-800: #182266;
  --navy-700: #1f2a7a;
  --navy-600: #2b3a96;
  --sky-500: #2bb3e6;

  /* Neutrals */
  --text: #111a3e;
  --text-muted: #4a5270;
  --border: #e3e6ef;
  --surface: #ffffff;
  --surface-alt: #f5f6fa;
  --on-navy-muted: #c3c9e6;

  /* Status */
  --success: #2e9e5b;
  --success-text: #1f7a44; /* --success fails AA as small text on white/--success-bg */
  --success-bg: #e6f5ec;
  --info-bg: #e8ecfb;
  --error: #c62828;

  /* Rating tiers */
  --gold-bg: #fdf3d6;   --gold-border: #e7c45a;
  --silver-bg: #f1f2f5; --silver-border: #c4c8d2;
  --bronze-bg: #fbe7d8; --bronze-border: #d99a6c;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --container: 1120px;
  --header-h: 72px;
  --section-pad: 80px;
}

@media (max-width: 767px) {
  :root { --section-pad: 48px; --header-h: 64px; }
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; color: var(--navy-900); line-height: 1.2; }
h1 { font-size: 44px; line-height: 1.1; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 28px; font-weight: 700; letter-spacing: -0.01em; }
h3 { font-size: 18px; font-weight: 600; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: var(--navy-700); }
img { max-width: 100%; display: block; }

@media (max-width: 767px) {
  h1 { font-size: 28px; }
  h2 { font-size: 24px; }
}

:focus-visible { outline: 3px solid var(--sky-500); outline-offset: 2px; border-radius: 2px; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
@media (max-width: 767px) { .container { padding: 0 16px; } }

.skip-link {
  position: absolute; left: 16px; top: -48px; z-index: 100;
  background: var(--navy-900); color: #fff; padding: 8px 14px; border-radius: var(--radius-sm);
}
.skip-link:focus { top: 12px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.eyebrow {
  font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-muted);
}

/* ---------- Buttons and links ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font: inherit; font-size: 15px; font-weight: 600; line-height: 1.2;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s, color .15s, border-color .15s;
}
.btn-primary { background: var(--navy-700); color: #fff; }
.btn-primary:hover { background: var(--navy-600); }
.btn-primary:disabled { opacity: .65; cursor: progress; }
.btn-white { background: #fff; color: var(--navy-700); }
.btn-white:hover { background: var(--info-bg); }
.btn-outline { background: transparent; color: #fff; border-color: #fff; }
.btn-outline:hover { background: rgba(255, 255, 255, .1); }
.btn-sm { padding: 8px 14px; font-size: 14px; }

.arrow-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 600; color: var(--navy-700); text-decoration: none;
}
.arrow-link:hover { text-decoration: underline; }
.arrow-link svg { width: 14px; height: 14px; flex: none; transition: transform .15s; }
.arrow-link:hover svg { transform: translateX(2px); }

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .97); border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(1.4) blur(6px);
}
.site-header .container {
  display: flex; align-items: center; gap: 20px; min-height: var(--header-h);
}
.brand { display: flex; align-items: center; gap: 16px; text-decoration: none; flex: none; }
.brand img { height: 30px; width: auto; }
.tagline {
  font-size: 12px; line-height: 1.35; color: var(--text-muted);
  padding-left: 16px; border-left: 1px solid var(--border); max-width: 170px;
}
.site-nav { display: flex; align-items: center; gap: 22px; margin-left: auto; }
.site-nav a {
  font-size: 14px; font-weight: 500; color: var(--text-muted); text-decoration: none;
  padding: 4px 0; border-bottom: 2px solid transparent;
}
.site-nav a:hover, .site-nav a.is-active { color: var(--navy-900); border-bottom-color: var(--sky-500); }
.header-actions { display: flex; align-items: center; gap: 16px; }
.header-actions .signin { font-size: 14px; font-weight: 600; color: var(--navy-900); text-decoration: none; }
.header-actions .signin:hover { text-decoration: underline; }
.menu-toggle {
  display: none; align-items: center; justify-content: center;
  width: 40px; height: 40px; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: #fff; color: var(--navy-900); cursor: pointer;
}
.menu-toggle svg { width: 20px; height: 20px; }
.menu-toggle .icon-close { display: none; }
.menu-toggle[aria-expanded="true"] .icon-open { display: none; }
.menu-toggle[aria-expanded="true"] .icon-close { display: block; }

@media (max-width: 1180px) { .tagline { display: none; } }

@media (max-width: 1023px) {
  .site-header .container { gap: 12px; }
  .js .menu-toggle { display: inline-flex; }
  .header-actions { margin-left: auto; gap: 10px; }
  .header-actions .signin { display: none; }
  .site-nav {
    position: absolute; top: 100%; left: 0; right: 0; margin: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; border-bottom: 1px solid var(--border);
    padding: 8px 16px 16px; box-shadow: 0 12px 24px -16px rgba(17, 26, 62, .25);
  }
  /* Collapsed only once JS has loaded, so the menu is never unreachable without it. */
  .js .site-nav:not(.is-open) { display: none; }
  .site-nav a { padding: 12px 4px; border-bottom: 1px solid var(--border); font-size: 15px; }
  .site-nav a:hover, .site-nav a.is-active { border-bottom-color: var(--border); }
  .site-nav .signin-mobile { color: var(--navy-900); font-weight: 600; border-bottom: 0; }
}
@media (min-width: 1024px) {
  .site-nav .signin-mobile { display: none; }
}
@media (max-width: 420px) {
  .brand img { height: 24px; }
  .header-actions .btn { padding: 8px 12px; font-size: 13px; }
}

/* ---------- Sections ---------- */

section[id], main[id] { scroll-margin-top: calc(var(--header-h) + 8px); }
.section { padding: var(--section-pad) 0; }
.section-alt { background: var(--surface-alt); }
.section-navy { background: var(--navy-700); color: #fff; }
.section-navy h2, .section-navy h3 { color: #fff; }
.section-head { max-width: 720px; margin-bottom: 36px; }
.section-head p { margin-top: 10px; color: var(--text-muted); font-size: 16px; }
.section-navy .section-head p { color: var(--on-navy-muted); }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.card h3 { font-size: 16px; }
.card p { font-size: 15px; color: var(--text-muted); margin-top: 6px; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-6 { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 1023px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-6, .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-6 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 767px) {
  .grid-2, .grid-3, .grid-4, .grid-6 { grid-template-columns: 1fr; }
}

/* ---------- Hero ---------- */

.hero { background: var(--navy-700); color: #fff; padding: 72px 0 80px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center; }
.hero .eyebrow { color: var(--sky-500); }
.hero h1 { color: #fff; margin-top: 14px; }
.hero .lead { margin-top: 18px; font-size: 18px; line-height: 1.55; color: var(--on-navy-muted); max-width: 540px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.commodity-line { margin-top: 24px; font-size: 13px; color: var(--on-navy-muted); }

.status-card {
  background: #fff; color: var(--text); border-radius: var(--radius-lg); padding: 22px 24px;
  box-shadow: 0 24px 48px -24px rgba(0, 0, 0, .45);
}
.status-card-head {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  padding-bottom: 14px; border-bottom: 1px solid var(--border);
}
.status-card-head .muted { color: var(--text-muted); }
.status-card-head .funded { color: var(--success-text); font-weight: 700; }
.timeline { margin-top: 6px; }
.timeline li {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 10px 0; font-size: 15px;
}
.timeline li + li { border-top: 1px solid var(--surface-alt); }
.timeline .label { flex: 1; }
.timeline time, .timeline .when { font-size: 13px; color: var(--text-muted); }
.timeline .dot {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%;
}
.timeline .done .dot { background: var(--success-bg); color: var(--success); }
.timeline .done .dot svg { width: 12px; height: 12px; }
.timeline .current .dot { background: var(--navy-700); box-shadow: 0 0 0 4px var(--info-bg); width: 14px; height: 14px; margin: 0 3px; }
.timeline .current .label { font-weight: 600; }
.timeline .current .when { color: var(--navy-700); font-weight: 600; }
.timeline .pending .dot { background: var(--silver-border); width: 12px; height: 12px; margin: 0 4px; }
.timeline .pending .label { color: var(--text-muted); }
.status-card-foot { margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-muted); }

@media (max-width: 1023px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .status-card { max-width: 520px; }
}
@media (max-width: 767px) {
  .hero { padding: 48px 0 56px; }
  .hero .lead { font-size: 16px; }
}

/* ---------- Trust strip ---------- */

.trust { padding: 40px 0; background: var(--surface-alt); border-bottom: 1px solid var(--border); }
.trust .card { border-top: 3px solid var(--navy-700); }

/* ---------- How it works ---------- */

.steps .card { display: flex; flex-direction: column; }
.badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--navy-600); color: #fff; font-size: 14px; font-weight: 700;
  margin-bottom: 14px;
}
.steps h3 { font-size: 15px; }
.steps p { font-size: 14px; }

/* ---------- Roles ---------- */

.roles .card { display: flex; flex-direction: column; }
.roles .card p { flex: 1; margin-bottom: 14px; }

/* ---------- Corridors ---------- */

.corridor-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.pill {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; line-height: 1.5;
}
.pill-open { background: var(--success-bg); color: var(--success-text); }
.pill-interest { background: var(--info-bg); color: var(--navy-700); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 5px 12px; border-radius: 999px; background: var(--info-bg);
  color: var(--navy-900); font-size: 13px; font-weight: 500;
}
.corridor-note { margin-top: 16px; font-size: 13px; color: var(--text-muted); }
.corridors .card .arrow-link { margin-top: 14px; }

/* ---------- Proof (navy) ---------- */

.proof-card {
  background: var(--navy-800); border: 1px solid rgba(255, 255, 255, .14);
  border-radius: var(--radius); padding: 22px 20px;
}
.proof-card h3 {
  font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--sky-500); margin-bottom: 14px;
}
.checklist li { display: flex; gap: 10px; font-size: 14px; line-height: 1.5; }
.checklist li + li { margin-top: 10px; }
.checklist svg { flex: none; width: 16px; height: 16px; margin-top: 3px; color: var(--sky-500); }
.proof-card .checklist li { color: #e6e9f6; }

/* ---------- Ratings ---------- */

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.split p { margin-top: 14px; color: var(--text-muted); }
.split .arrow-link { margin-top: 20px; }
.tiers { display: grid; gap: 12px; }
.tier {
  display: flex; align-items: center; gap: 18px;
  border: 1px solid; border-radius: var(--radius); padding: 16px 18px;
}
.tier p { margin: 0; font-size: 15px; color: var(--text); }
.tier .pill { flex: none; min-width: 64px; text-align: center; background: #fff; color: var(--navy-900); border: 1px solid; }
.tier-gold { background: var(--gold-bg); border-color: var(--gold-border); }
.tier-gold .pill { border-color: var(--gold-border); }
.tier-silver { background: var(--silver-bg); border-color: var(--silver-border); }
.tier-silver .pill { border-color: var(--silver-border); }
.tier-bronze { background: var(--bronze-bg); border-color: var(--bronze-border); }
.tier-bronze .pill { border-color: var(--bronze-border); }
@media (max-width: 767px) {
  .split { grid-template-columns: 1fr; gap: 32px; }
  .tier { flex-direction: column; align-items: flex-start; gap: 10px; }
}

/* ---------- About ---------- */

.about-top { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; }
.about-top p { margin-top: 14px; color: var(--text-muted); }
.about-top h3 { font-size: 20px; }
.neutral { border-left: 3px solid var(--sky-500); padding-left: 24px; align-self: start; margin-top: 6px; }
.team { margin-top: 56px; }
.team > p { margin-top: 10px; color: var(--text-muted); max-width: 760px; }
.team .grid { margin-top: 24px; }
.stat-num { font-size: 34px; font-weight: 700; line-height: 1.1; color: var(--navy-700); letter-spacing: -0.02em; }
.stat-label { margin-top: 8px; font-size: 16px; font-weight: 600; color: var(--navy-900); }
@media (max-width: 767px) {
  .about-top { grid-template-columns: 1fr; gap: 32px; }
  .neutral { padding-left: 18px; }
}

/* ---------- FAQ ---------- */

.faq-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1023px) { .faq-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 767px) { .faq-grid { grid-template-columns: 1fr; } }
.faq {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px; cursor: pointer; list-style: none;
  font-size: 15px; font-weight: 600; color: var(--navy-900);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary svg { flex: none; width: 16px; height: 16px; fill: none; stroke: var(--navy-700); stroke-width: 2; stroke-linecap: round; }
.faq summary .v { transform-box: fill-box; transform-origin: center; transition: transform .2s; }
.faq[open] summary .v { transform: scaleY(0); } /* + collapses to − */
.faq p { padding: 0 20px 18px; font-size: 15px; color: var(--text-muted); }

/* ---------- Contact ---------- */

.contact-grid { display: grid; grid-template-columns: .8fr 1.6fr; gap: 48px; align-items: start; }
.contact-intro p { margin-top: 12px; color: var(--text-muted); }
.contact-intro .mail { display: inline-block; margin-top: 16px; font-weight: 600; }
.form-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; }
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-full { grid-column: 1 / -1; }
.field label { font-size: 13px; font-weight: 600; color: var(--navy-900); }
.field .opt { font-weight: 400; color: var(--text-muted); }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: 15px; color: var(--text);
  padding: 10px 12px; border: 1px solid #c9cedc; border-radius: var(--radius-sm); background: #fff;
}
.field select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%234a5270' stroke-width='2'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 14px; }
.field select:invalid { color: var(--text-muted); }
.field textarea { resize: vertical; min-height: 110px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--navy-700); box-shadow: 0 0 0 3px var(--info-bg); }
.field [aria-invalid="true"] { border-color: var(--error); }
.error { min-height: 0; font-size: 12px; color: var(--error); }
.error:empty { display: none; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--text-muted); }
.consent input { flex: none; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--navy-700); }
.consent label { font-size: 14px; font-weight: 400; color: var(--text-muted); }
.form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 18px; margin-top: 20px; }
.form-actions small { font-size: 13px; color: var(--text-muted); }
.form-status { margin-top: 14px; font-size: 14px; }
.form-status:empty { display: none; }
.form-status.is-error { color: var(--error); }
.form-success { text-align: left; }
.form-success h3 { font-size: 20px; }
.form-success p { margin-top: 8px; color: var(--text-muted); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 1023px) {
  .contact-grid { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 767px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-card { padding: 20px; }
}
@media (min-width: 768px) and (max-width: 1023px) {
  .form-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Footer ---------- */

.site-footer { background: var(--navy-900); color: var(--on-navy-muted); padding: 40px 0; font-size: 14px; }
.site-footer .container { display: flex; justify-content: space-between; gap: 24px 40px; flex-wrap: wrap; }
.site-footer a { color: #fff; }
.footer-info p + p { margin-top: 6px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: flex-start; }
.footer-links a { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Legal pages ---------- */

.legal-header .container { justify-content: space-between; }
.legal-header .back { font-size: 14px; font-weight: 600; color: var(--navy-700); text-decoration: none; }
.legal-header .back:hover { text-decoration: underline; }
.legal-main { padding: 56px 0 80px; }
.narrow { max-width: 748px; } /* ~700px content + gutters */
.legal-main h1 { font-size: 36px; }
.legal-main .intro { margin-top: 14px; color: var(--text-muted); }
.legal-table {
  width: 100%; margin-top: 32px; border-collapse: collapse;
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  font-size: 15px;
}
.legal-table th, .legal-table td { padding: 14px 18px; text-align: left; vertical-align: top; border-top: 1px solid var(--border); }
.legal-table tr:first-child th, .legal-table tr:first-child td { border-top: 0; }
.legal-table th { width: 38%; font-weight: 600; color: var(--navy-900); background: var(--surface-alt); }
.legal-table td { color: var(--text-muted); }
.legal-links { margin-top: 32px; }
.legal-links a.card { display: block; text-decoration: none; transition: border-color .15s; }
.legal-links a.card:hover { border-color: var(--navy-700); }
.legal-links .card h2 { font-size: 16px; display: flex; justify-content: space-between; align-items: center; }
.legal-links .card h2 svg { width: 14px; height: 14px; color: var(--navy-700); }
.legal-footer .container { justify-content: flex-start; }
@media (max-width: 767px) {
  .legal-main { padding: 36px 0 56px; }
  .legal-main h1 { font-size: 28px; }
  .legal-table, .legal-table tbody, .legal-table tr, .legal-table th, .legal-table td { display: block; width: 100%; }
  .legal-table th { border-top: 1px solid var(--border); padding-bottom: 4px; }
  .legal-table td { border-top: 0; padding-top: 4px; }
}
