
/*
 * WorldTradePulse — Shared Site Design System
 * Used by homepage, support, privacy and documentation. 
 */

/* ---------- Design tokens ---------- */

:root {
  color-scheme: light;

  --app-background: #f6f3ec;
  --app-surface: #fffdf8;
  --app-surface-strong: #f0ece2;

  --app-text-primary: #24231f;
  --app-text-secondary: #716e66;
  --app-border: #e2ddd2;

  --app-accent: #315c58;
  --app-accent-hover: #254a46;
  --app-accent-soft: #e4ece9;

  --app-radius: 18px;
  --app-radius-small: 12px;
  --app-radius-large: 24px;

  --app-section-spacing: 36px;
  --app-header-height: 70px;

  --app-content-width: 1120px;
  --app-reading-width: 760px;

  --app-shadow:
    0 8px 28px rgba(36, 35, 31, 0.045);

  --app-font:
    -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
}

/* ---------- Reset ---------- */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--app-background);
  color: var(--app-text-primary);
  font-family: var(--app-font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

img,
svg {
  max-width: 100%;
}

img {
  display: block;
}

a {
  color: var(--app-accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

:focus-visible {
  outline: 2px solid var(--app-accent);
  outline-offset: 3px;
}

::selection {
  background: var(--app-accent-soft);
  color: var(--app-text-primary);
}

/* ---------- Typography ---------- */

h1,
h2,
h3,
h4 {
  color: var(--app-text-primary);
  letter-spacing: -0.025em;
  line-height: 1.2;
}

h1 {
  margin: 0 0 20px;
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 700;
}

h2 {
  margin: 0 0 18px;
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 600;
}

h3 {
  margin: 0 0 12px;
  font-size: 22px;
  font-weight: 600;
}

h4 {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 600;
}

p {
  margin: 0 0 16px;
}

small,
.text-small {
  font-size: 12px;
}

.text-muted {
  color: var(--app-text-secondary);
}

.lead {
  color: var(--app-text-secondary);
  font-size: 18px;
  line-height: 1.6;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--app-accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

/* ---------- Layout ---------- */

.container {
  width: min(
    calc(100% - 40px),
    var(--app-content-width)
  );
  margin-inline: auto;
}

.container-narrow {
  width: min(
    calc(100% - 40px),
    var(--app-reading-width)
  );
  margin-inline: auto;
}

.page {
  min-height: calc(
    100vh - var(--app-header-height)
  );
}

.section {
  padding-block: 64px;
}

.section + .section {
  border-top: 1px solid var(--app-border);
}

.section-header {
  margin-bottom: var(--app-section-spacing);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.cluster {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.grid {
  display: grid;
  gap: 20px;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  min-height: var(--app-header-height);
  background: var(--app-background);
  border-bottom: 1px solid var(--app-border);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: var(--app-header-height);
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--app-text-primary);
  text-decoration: none;
}

.site-brand:hover {
  text-decoration: none;
}

.site-brand img,
.site-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
}

.site-brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.site-brand-name {
  color: var(--app-text-primary);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.site-brand-subtitle {
  margin-top: 2px;
  color: var(--app-text-secondary);
  font-size: 10px;
  font-weight: 400;
  line-height: 1.3;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.site-nav a {
  color: var(--app-text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.15s ease;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--app-accent);
  text-decoration: none;
}

.site-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--app-border);
  border-radius: 12px;
  background: var(--app-surface);
  color: var(--app-text-primary);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    transform 0.15s ease;
}

.btn:hover {
  text-decoration: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--app-accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--app-accent-hover);
  color: #fff;
}

.btn-secondary {
  background: var(--app-surface);
  border-color: var(--app-border);
  color: var(--app-text-primary);
}

.btn-secondary:hover {
  background: var(--app-surface-strong);
}

.btn-soft {
  background: var(--app-accent-soft);
  color: var(--app-accent);
}

.btn-soft:hover {
  background: #d7e4e0;
}

.btn-link {
  padding-inline: 0;
  color: var(--app-accent);
}

/* ---------- Cards ---------- */

.card {
  padding: 24px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: var(--app-surface);
}

.card-strong {
  background: var(--app-surface-strong);
}

.card-interactive {
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
}

.card-interactive:hover {
  border-color: var(--app-accent);
  box-shadow: var(--app-shadow);
  transform: translateY(-2px);
}

.card h3:last-child,
.card p:last-child {
  margin-bottom: 0;
}

.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: 18px;
  border-radius: 12px;
  background: var(--app-accent-soft);
  color: var(--app-accent);
}

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

.hero {
  padding-block: 88px 76px;
}

.hero-content {
  max-width: 800px;
}

.hero h1 {
  max-width: 780px;
}

.hero .lead {
  max-width: 660px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

/* ---------- Information Panels ---------- */

.info-panel {
  padding: 24px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: var(--app-accent-soft);
}

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

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

/* ---------- Forms ---------- */

.form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  color: var(--app-text-primary);
  font-size: 13px;
  font-weight: 600;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  min-height: 44px;
  padding: 12px 14px;
  border: 1px solid var(--app-border);
  border-radius: 14px;
  background: var(--app-surface);
  color: var(--app-text-primary);
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--app-accent);
  box-shadow: 0 0 0 2px var(--app-accent-soft);
}

/* ---------- Documentation ---------- */

.docs-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 40px;
  padding-block: 36px 80px;
}

.docs-sidebar {
  position: sticky;
  top: calc(var(--app-header-height) + 24px);
  align-self: start;
  max-height: calc(
    100vh - var(--app-header-height) - 48px
  );
  overflow-y: auto;
  padding: 18px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: var(--app-surface);
}

.docs-sidebar-title {
  margin: 0 0 16px;
  font-size: 14px;
  font-weight: 700;
}

.docs-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.docs-nav a {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--app-text-secondary);
  font-size: 14px;
}

.docs-nav a:hover {
  background: var(--app-surface-strong);
  color: var(--app-text-primary);
  text-decoration: none;
}

.docs-nav a[aria-current="page"] {
  background: var(--app-accent-soft);
  color: var(--app-accent);
  font-weight: 600;
}

.docs-content {
  min-width: 0;
  max-width: var(--app-reading-width);
}

.docs-content h1 {
  font-size: clamp(30px, 4vw, 42px);
}

.docs-content h2 {
  margin-top: 40px;
  padding-top: 8px;
}

.docs-content h3 {
  margin-top: 28px;
}

.docs-content ul,
.docs-content ol {
  padding-left: 24px;
  margin-bottom: 20px;
}

.docs-content li {
  margin-bottom: 8px;
}

.docs-content code {
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--app-surface-strong);
  font-size: 0.9em;
}

.docs-content pre {
  overflow-x: auto;
  padding: 20px;
  border: 1px solid var(--app-border);
  border-radius: 12px;
  background: var(--app-surface);
}

.docs-content pre code {
  padding: 0;
  background: transparent;
}

.docs-content blockquote {
  margin: 24px 0;
  padding: 16px 20px;
  border-left: 3px solid var(--app-accent);
  background: var(--app-accent-soft);
}

.docs-table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

/* ---------- Tables ---------- */

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th,
.table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--app-border);
  text-align: left;
  vertical-align: top;
}

.table th {
  background: var(--app-surface-strong);
  color: var(--app-text-primary);
  font-weight: 600;
}

.table td {
  color: var(--app-text-secondary);
}

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

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  border: 1px solid var(--app-border);
  border-radius: 14px;
  background: var(--app-surface);
  overflow: hidden;
}

.faq-item summary {
  padding: 18px 20px;
  color: var(--app-text-primary);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.faq-item summary:hover {
  background: var(--app-surface-strong);
}

.faq-item > div {
  padding: 0 20px 20px;
  color: var(--app-text-secondary);
}

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

.site-footer {
  margin-top: auto;
  padding: 36px 0;
  border-top: 1px solid var(--app-border);
  background: var(--app-background);
}

.site-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.site-footer p {
  margin: 0;
  color: var(--app-text-secondary);
  font-size: 12px;
}

.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.site-footer-links a {
  color: var(--app-text-secondary);
  font-size: 12px;
}

.site-footer-links a:hover {
  color: var(--app-accent);
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .docs-layout {
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 24px;
  }
}

@media (max-width: 700px) {
  .site-brand-name {
    font-size: 15px;
  }

  .site-brand-subtitle {
    display: none;
  }

  .site-logo,
  .site-brand img {
    width: 36px;
    height: 36px;
  }

  .site-header-inner {
    gap: 12px;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: var(--app-header-height);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 12px 20px 20px;
    border-bottom: 1px solid var(--app-border);
    background: var(--app-background);
    box-shadow: var(--app-shadow);
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a {
    padding: 12px;
    border-radius: 10px;
  }

  .site-nav a:hover,
  .site-nav a[aria-current="page"] {
    background: var(--app-accent-soft);
  }

  .section {
    padding-block: 44px;
  }

  .hero {
    padding-block: 56px 48px;
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .docs-layout {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding-block: 24px 56px;
  }

  .docs-sidebar {
    position: static;
    max-height: none;
  }

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

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

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

