/* Shared components for the brand-switched marketing pages (landing.html for
   Kora, trade.html for Datum+Grain) from the 9 Oct 2026 design handoff.
   Everything reads brand-tokens.css via var(); the only brand branches are the
   few semantic aliases just below and the D+G label/uppercase rules. Square
   corners, no shadows, structure from 1px rules and flat fills.

   Load brand-tokens.css first. Set data-brand="kora" or "dg" on <html>. */

[data-brand="kora"] {
  --bs-primary: var(--color-accent-strong);
  --bs-primary-hover: var(--color-accent-strong-hover);
  --bs-primary-active: var(--color-accent-strong-active);
  --bs-on-primary: var(--color-on-accent-strong);
  --bs-link: var(--color-accent-strong);
  --bs-secondary: #22201C;
  --bs-secondary-hover: #3A3732;
  --bs-body-weight: 400;
}

[data-brand="dg"] {
  --bs-primary: var(--color-accent);
  --bs-primary-hover: var(--color-accent-hover);
  --bs-primary-active: var(--color-accent);
  --bs-on-primary: var(--color-on-accent);
  --bs-link: var(--color-accent);
  --bs-secondary: var(--color-text);
  --bs-secondary-hover: #2C2E31;
}

[data-brand] {
  --bs-pad-x: var(--page-pad);
  --bs-pad-y: var(--section-pad);
}

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

[data-brand] body, body.bs {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-family);
  font-stretch: var(--font-stretch-body);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}
[data-brand="dg"] body { line-height: 1.5; }

.bs a { color: var(--color-text); text-decoration: none; }
.bs a:hover { color: var(--bs-link); }
.bs :focus-visible { outline: 2px solid var(--bs-link); outline-offset: 2px; }
.bs h1, .bs h2, .bs h3 { font-weight: var(--weight-display); font-stretch: var(--font-stretch-display); text-wrap: balance; }
.bs p { text-wrap: pretty; }

/* --- Layout primitives --------------------------------------------------- */
.bs-section {
  padding: var(--bs-pad-y) var(--bs-pad-x);
  border-bottom: var(--rule-width) solid var(--color-rule);
}
.bs-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
}

/* --- Nav ----------------------------------------------------------------- */
.bs-nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; flex-wrap: wrap;
  padding: 20px var(--bs-pad-x);
  border-bottom: var(--rule-width) solid var(--color-rule);
}
.bs-logo { display: flex; align-items: center; gap: 10px; }
.bs-wordmark { font-size: 20px; font-weight: 550; letter-spacing: -0.02em; line-height: 1; }
[data-brand="dg"] .bs-wordmark { font-weight: 700; font-stretch: 75%; letter-spacing: 0.03em; }
.bs-wordmark .plus { color: var(--color-accent); }
.bs-nav-links { display: flex; gap: 28px; font-size: 15px; flex-wrap: wrap; align-items: center; }
[data-brand="dg"] .bs-nav-links { font-weight: 500; }

/* --- Buttons: label flush left, arrow pushed right ----------------------- */
.bs-btn {
  display: inline-flex; justify-content: space-between; align-items: center; gap: 24px;
  padding: 16px 20px; min-width: 240px;
  font: inherit; font-size: 16px; font-weight: 600; text-align: left; line-height: 1.2;
  border: 0; border-radius: 0; cursor: pointer;
  background: var(--bs-primary); color: var(--bs-on-primary) !important;
}
.bs-btn:hover { background: var(--bs-primary-hover); color: var(--bs-on-primary) !important; }
.bs-btn:active { background: var(--bs-primary-active); }
.bs-btn-sm { padding: 10px 16px; min-width: 0; font-size: 15px; }
.bs-btn-plain { min-width: 0; }
.bs-btn-dark { background: var(--bs-secondary); }
.bs-btn-dark:hover { background: var(--bs-secondary-hover); }
.bs-btn-outline {
  background: transparent; color: var(--color-text) !important;
  border: var(--rule-width) solid var(--color-rule); padding: 15px 20px; min-width: 0;
}
[data-brand="dg"] .bs-btn-outline { padding: 14px 20px; }
.bs-btn-outline:hover { background: var(--color-tint); color: var(--color-text) !important; }
.bs-link-cta {
  font-size: 15px; font-weight: 600; border-bottom: 1px solid var(--color-rule);
  padding-bottom: 2px; align-self: flex-start;
}

/* --- Labels, kickers, tags ----------------------------------------------- */
.bs-kicker { font-size: 14px; font-weight: 600; color: var(--bs-link); }
[data-brand="dg"] .bs-label, .bs-label-caps {
  font-size: 12px; font-weight: 600; font-stretch: 75%; letter-spacing: 0.14em; text-transform: uppercase;
}
.bs-tag {
  display: inline-block; font-size: 13px; font-weight: 600; padding: 5px 10px;
  background: var(--color-tint); color: var(--color-text);
}
[data-brand="dg"] .bs-tag {
  font-size: 12px; font-weight: 700; font-stretch: 75%; letter-spacing: 0.1em; text-transform: uppercase;
}
.bs-tag-oak { background: var(--oak); }

/* --- Forms ---------------------------------------------------------------- */
.bs-field { display: grid; gap: 6px; }
.bs-field label { font-size: 14px; font-weight: 600; }
[data-brand="dg"] .bs-field label {
  font-size: 12px; font-stretch: 75%; letter-spacing: 0.12em; text-transform: uppercase;
}
.bs-input {
  font: inherit; font-size: 16px; padding: 12px 14px; border-radius: 0;
  border: var(--rule-width) solid var(--color-rule); background: var(--color-surface);
  color: var(--color-text); width: 100%;
}
textarea.bs-input { min-height: 96px; resize: vertical; }

/* --- Footer --------------------------------------------------------------- */
.bs-footer {
  padding: 40px var(--bs-pad-x);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 24px;
  font-size: 14px; line-height: 1.6; color: var(--color-text-muted);
}
.bs-footer a { color: var(--bs-link); }
/* Full-width bottom row of the footer grid: the copyright line. */
.bs-footer .bs-copyright { grid-column: 1 / -1; padding-top: 16px; border-top: 1px solid var(--color-rule-soft); font-size: 13px; }

/* --- Legal pages (/privacy) --------------------------------------------- */
.bs-legal { max-width: 78ch; }
.bs-legal h1 { margin: 8px 0 4px; }
.bs-legal h2 { margin: 36px 0 8px; font-size: 22px; }
.bs-legal p, .bs-legal li { font-size: 16px; line-height: 1.6; }
.bs-legal ul { padding-left: 1.2em; }
.bs-legal-meta { color: var(--color-text-muted); font-size: 14px; }
.bs-legal-table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 12px 0; }
.bs-legal-table th, .bs-legal-table td { text-align: left; vertical-align: top; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--color-rule-soft); }
.bs-legal-table th { border-bottom-color: var(--color-rule); }

/* --- Page-specific: Kora landing ------------------------------------------ */
.k-hero { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); border-bottom: 1px solid var(--color-rule); }
.k-hero-copy {
  padding: clamp(32px, 6vw, 88px) var(--bs-pad-x);
  display: flex; flex-direction: column; justify-content: space-between; gap: 48px;
}
.k-hero h1 {
  margin: 0; font-size: clamp(44px, 6vw, 84px); line-height: 0.98; letter-spacing: -0.035em;
}
.k-hero-body { display: flex; flex-direction: column; gap: 28px; max-width: 540px; }
.k-hero-body p { margin: 0; font-size: 19px; line-height: 1.55; }
.k-cta-row { display: flex; gap: 12px; flex-wrap: wrap; }
.k-hero-photo { min-height: 520px; border-left: 1px solid var(--color-rule); overflow: hidden; }
.k-hero-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.k-trust {
  display: flex; flex-wrap: wrap; gap: 8px 28px; padding: 18px var(--bs-pad-x);
  border-bottom: 1px solid var(--color-rule); font-size: 14px; font-weight: 600; color: var(--color-text-muted);
}

.k-split h2, .k-head h2 {
  margin: 0 0 20px; font-size: clamp(32px, 3.5vw, 48px); line-height: 1.05; letter-spacing: -0.025em;
}
.k-split { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 40px clamp(24px, 4vw, 64px); align-items: start; }
.k-split p { font-size: 17px; max-width: 54ch; margin: 0 0 18px; color: var(--color-text-muted); }
.k-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.k-shot {
  aspect-ratio: 4 / 5; background: var(--color-tint); display: flex; align-items: flex-end; padding: 20px;
  font-size: 14px; color: var(--color-text-muted); border: 1px solid var(--color-rule-soft);
}

.k-dark {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  background: var(--color-text); color: var(--color-bg); border-bottom: 1px solid var(--color-rule);
}
.k-dark-photo { min-height: 460px; overflow: hidden; }
.k-dark-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.k-dark-copy { padding: clamp(32px, 5vw, 72px) var(--bs-pad-x); display: flex; flex-direction: column; justify-content: space-between; gap: 32px; }
.k-dark .bs-kicker { color: var(--color-accent-on-dark); }
.k-dark h2 { margin: 0; font-size: clamp(32px, 3.5vw, 48px); line-height: 1.05; letter-spacing: -0.025em; }
.k-dark p.lead { margin: 12px 0 0; color: var(--color-text-on-dark-muted); font-size: 17px; max-width: 52ch; }
.k-steps { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.k-steps li { display: grid; grid-template-columns: 56px 1fr; gap: 16px; padding: 18px 0; border-top: 1px solid #5A554C; }
.k-steps li:last-child { border-bottom: 1px solid #5A554C; }
.k-steps .n { font-size: 15px; color: var(--color-accent-on-dark); }
.k-steps b { font-weight: 600; font-size: 20px; }
.k-steps span span { color: var(--color-text-on-dark-muted); font-size: 16px; line-height: 1.5; display: block; }

.k-routes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); border-top: 1px solid var(--color-rule); margin-top: 32px; }
.k-route { padding: 28px 28px 28px 0; display: flex; flex-direction: column; gap: 14px; border-right: 1px solid var(--color-rule-soft); }
.k-route + .k-route { padding: 28px 0 28px 28px; border-right: 0; }
.k-route h3 { margin: 0; font-size: 24px; line-height: 1.15; letter-spacing: -0.015em; }
.k-route p { margin: 0; font-size: 16px; color: var(--color-text-muted); }
.k-route ul { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; font-size: 15px; }
.k-route li::before { content: "→ "; color: var(--bs-link); }
.k-route .bs-btn { margin-top: auto; align-self: flex-start; }
.k-routes-3 .k-route + .k-route { border-right: 1px solid var(--color-rule-soft); }
.k-routes-3 .k-route:last-child { border-right: 0; }
.k-points { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 24px clamp(24px, 4vw, 48px); border-top: 1px solid var(--color-rule); padding-top: 24px; }
.k-points p { margin: 0; font-size: 17px; color: var(--color-text-muted); }
.k-note { margin: 24px 0 0; font-size: 14px; color: var(--color-text-muted); }

.k-list { display: grid; max-width: 860px; border-top: 1px solid var(--color-rule); }
.k-list details { border-bottom: 1px solid var(--color-rule-soft); padding: 18px 0; }
.k-list summary { display: flex; gap: 16px; align-items: baseline; font-size: 20px; font-weight: 550; letter-spacing: -0.01em; list-style: none; cursor: pointer; }
.k-list summary::-webkit-details-marker { display: none; }
.k-list .plus { color: var(--bs-link); font-weight: 400; flex: none; width: 1ch; }
.k-list details[open] .plus { transform: rotate(45deg); display: inline-block; }
.k-list details p { margin: 12px 0 0 calc(1ch + 16px); max-width: 60ch; font-size: 16px; color: var(--color-text-muted); }
.k-list .bs-tag { font-size: 14px; }

.k-cta {
  padding: var(--bs-pad-y) var(--bs-pad-x); background: var(--oak); color: var(--color-text);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 32px; align-items: end;
}
.k-cta h2 { margin: 0; font-size: clamp(36px, 5vw, 72px); line-height: 1; letter-spacing: -0.035em; }
.k-cta p { margin: 0 0 20px; font-size: 18px; max-width: 480px; }
.k-cta a { color: inherit; }
.k-enquire { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 40px clamp(24px, 4vw, 64px); align-items: start; }
.k-enquire h2 { margin: 0 0 16px; font-size: clamp(32px, 3.5vw, 48px); line-height: 1.05; letter-spacing: -0.025em; }
.k-enquire p { font-size: 17px; max-width: 46ch; color: var(--color-text-muted); margin: 0 0 18px; }
.k-form { display: grid; gap: 16px; }

/* --- Page-specific: D+G trade (v2) ---------------------------------------- */
.d-hero { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); border-bottom: 1px solid var(--color-rule); }
.d-hero-copy { padding: clamp(32px, 5vw, 72px) var(--bs-pad-x); display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }
.d-datum { display: flex; align-items: center; gap: 10px; color: var(--color-text-muted); }
.d-hero h1 { margin: 0; font-size: clamp(40px, 5.2vw, 76px); line-height: 1.02; letter-spacing: -0.025em; }
.d-hero-body { display: flex; flex-direction: column; gap: 28px; max-width: 540px; border-top: 1px solid var(--color-rule); padding-top: 20px; }
.d-hero-body p { margin: 0; font-size: 18px; }
.d-photo { min-height: 480px; border-left: 1px solid var(--color-rule); filter: grayscale(1); background: var(--color-tint); display: flex; align-items: flex-end; padding: 20px; font-size: 14px; color: var(--color-text-muted); }
.d-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.d-photo.has-img { padding: 0; }
.d-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); border-bottom: 1px solid var(--color-rule); }
.d-stat { padding: 28px; border-right: 1px solid var(--color-rule); display: flex; flex-direction: column; gap: 6px; }
.d-stat:last-child { border-right: 0; }
.d-stat .v { font-size: 34px; font-weight: 550; letter-spacing: -0.02em; font-stretch: 87.5%; text-transform: none; }
.d-stat .bs-label-caps { color: var(--color-text-muted); }
.d-h2 { margin: 0; font-size: clamp(30px, 3.4vw, 48px); line-height: 1.05; letter-spacing: -0.02em; }
.d-who { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); border-top: 1px solid var(--color-rule); margin-top: 32px; }
.d-who > div { padding: 24px; border-right: 1px solid var(--color-rule-soft); display: flex; flex-direction: column; gap: 10px; }
.d-who > div:first-child { padding-left: 0; }
.d-who > div:last-child { border-right: 0; padding-right: 0; }
.d-who .mark { font-size: 13px; font-weight: 700; font-stretch: 75%; letter-spacing: 0.12em; color: var(--color-accent); }
.d-who h3 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }
.d-who p { margin: 0; font-size: 16px; color: var(--color-text-muted); }
.d-spec { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); border-bottom: 1px solid var(--color-rule); }
.d-spec-copy { padding: clamp(32px, 5vw, 72px) var(--bs-pad-x); display: flex; flex-direction: column; gap: 24px; border-right: 1px solid var(--color-rule); }
.d-spec table { border-collapse: collapse; width: 100%; font-size: 16px; }
.d-spec td { padding: 12px 0; }
.d-spec td:first-child { width: 40%; color: var(--color-text); }
.d-spec tr { border-bottom: 1px solid var(--color-rule-soft); }
.d-spec tr:first-child { border-top: 1px solid var(--color-rule); }
.d-spec tr:last-child { border-bottom: 1px solid var(--color-rule); }
.d-cta { padding: var(--bs-pad-y) var(--bs-pad-x); background: var(--color-tint); display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr)); gap: 32px; align-items: end; }
.d-cta h2 { margin: 0; font-size: clamp(34px, 4.4vw, 64px); line-height: 1.02; letter-spacing: -0.025em; }
.d-cta p { margin: 0 0 20px; font-size: 17px; color: var(--color-text-muted); max-width: 480px; }
.d-cta .bs-btn { font-weight: 700; font-stretch: 75%; letter-spacing: 0.08em; font-size: 15px; max-width: 300px; }

@media (max-width: 720px) {
  .bs-nav-links a:not(.bs-btn) { display: none; }
  .k-route, .k-route + .k-route { padding: 24px 0; border-right: 0; border-bottom: 1px solid var(--color-rule-soft); }
  .d-stat { border-right: 0; border-bottom: 1px solid var(--color-rule); }
  .d-who > div { padding: 24px 0; border-right: 0; }
  .d-spec-copy { border-right: 0; }
}
