/*
 * NumTrade corporate theme.
 *
 * Declares only the values that differ from the site.css contract, plus the
 * tokens that are structural to this theme alone. Reusable corporate rules are
 * scoped through the stable theme-numtrade body class.
 */
:root {
  /* Value overrides on the shared contract. */
  --size-small: 0.9375rem;
  --size-lede: clamp(1.0625rem, 1.7vw, 1.25rem);
  --line-heading: 1.04;

  /* Corporate-only colour roles. */
  --color-wash: #f5f5f5;
  --color-action-hover: #3c3c3c;
  --color-footer-text: #d7d7d7;

  /* Corporate-only structure. */
  --header-height: 5rem;
  --card-shadow-offset: 0.375rem;
  --card-shadow: var(--card-shadow-offset) var(--card-shadow-offset) 0 var(--color-ink);

  /* Corporate-only type roles. */
  --size-brand-detail: 0.6875rem;
  --size-navigation: 0.875rem;
  --size-footer: 0.875rem;
  --size-card-title: 1.0625rem;
  --size-hero: clamp(2.3125rem, 6vw, 4.75rem);
}

.theme-numtrade { line-height: var(--line-body); }

.site-header--corporate {
  position: sticky;
  z-index: 20;
  top: 0;
  background: var(--color-paper);
  border-bottom: var(--border-width) solid var(--color-line);
}

.site-header--corporate .site-header__inner {
  position: relative;
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.site-header--corporate .brand {
  display: inline-flex;
  min-height: var(--control-min-height);
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  color: var(--color-ink);
  text-decoration: none;
  line-height: 1.15;
}

.brand__name {
  font-size: var(--size-brand);
  font-weight: 700;
  letter-spacing: var(--tracking-wide);
}

/*
 * The tagline wraps rather than being held on one line.
 *
 * "white-space: nowrap" here was a bet that the text always fits, and that bet
 * depends on the font. Helvetica Neue exists on macOS; on Linux and Android the
 * stack falls through to Liberation Sans or DejaVu Sans, which are wider, and
 * the uppercase letter-spaced label then overflowed its own flex item at phone
 * widths. Wrapping cannot overflow, whatever font resolves, so no breakpoint
 * has to be tuned per platform.
 */
.brand__detail {
  margin-top: var(--space-1);
  color: var(--color-muted);
  font-size: var(--size-brand-detail);
  font-weight: 600;
  letter-spacing: 0.07em;
  text-wrap: balance;
  text-transform: uppercase;
}

.site-menu {
  display: none;
  position: relative;
  margin-left: auto;
}

.site-menu > summary { display: none; }

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-5);
  font-size: var(--size-navigation);
}

.site-nav a {
  text-decoration: none;
  text-underline-offset: var(--space-1);
}

.site-nav a:hover { text-decoration: underline; }

.menu-toggle-mark {
  font-size: 1.125rem;
  line-height: 1;
}

.eyebrow {
  margin: 0 0 var(--space-4);
  color: var(--color-muted);
  font-size: var(--size-label);
  font-weight: 700;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

.action {
  display: inline-flex;
  min-height: var(--control-min-height);
  align-items: center;
  margin-top: var(--space-7);
  padding: var(--space-2) var(--space-4);
  background: var(--color-ink);
  color: var(--color-paper);
  font-size: var(--size-navigation);
  font-weight: 700;
  text-decoration: none;
}

.action:hover { background: var(--color-action-hover); }

.section {
  padding: clamp(3.5rem, 6vw, 5.5rem) 0;
  scroll-margin-top: var(--header-height);
}

.section-title {
  max-width: 21ch;
  margin: 0;
  font-size: var(--size-heading);
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
  line-height: var(--line-heading);
  text-wrap: balance;
}

.section-intro {
  max-width: var(--text-measure);
  margin: var(--space-4) 0 0;
  color: var(--color-muted);
  text-wrap: pretty;
}

.card-grid {
  display: grid;
  gap: var(--space-5);
  margin-top: var(--space-8);
  padding: 0 var(--card-shadow-offset) var(--card-shadow-offset) 0;
}

.content-card {
  padding: var(--space-6);
  background: var(--color-paper);
  border: var(--border-width) solid var(--color-ink);
  box-shadow: var(--card-shadow);
}

.content-card__meta {
  display: block;
  color: var(--color-muted);
  font-size: var(--size-label);
  font-weight: 700;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
}

.content-card__title {
  margin: 0;
  font-size: var(--size-card-title);
  line-height: 1.3;
}

.content-card__copy {
  margin: var(--space-3) 0 0;
  color: var(--color-muted);
  font-size: var(--size-small);
  line-height: 1.55;
  text-wrap: pretty;
}

.site-footer--corporate {
  padding: var(--space-7) 0;
  background: var(--color-ink);
  color: var(--color-paper);
}

.site-footer--corporate .footer-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr));
  gap: var(--space-6) var(--space-7);
  color: var(--color-footer-text);
  font-size: var(--size-footer);
}

.site-footer--corporate .footer-layout p { margin: var(--space-1) 0 0; }

.footer-column__title {
  margin: 0;
  color: var(--color-paper);
  font-size: var(--size-label);
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.site-footer--corporate a {
  color: var(--color-paper);
  text-underline-offset: var(--space-1);
}

.site-footer--corporate a:focus-visible { outline-color: var(--color-paper); }

@media (max-width: 52rem) {
  .site-header--corporate .site-header__inner {
    min-height: var(--header-height);
    padding-top: var(--space-3);
    padding-bottom: var(--space-3);
    justify-content: flex-start;
  }

  .site-nav--desktop { display: none; }

  .site-menu {
    display: block;
    position: static;
    align-self: center;
    flex: 0 0 auto;
    margin-left: auto;
  }

  .site-menu > summary {
    display: inline-flex;
    min-height: var(--control-min-height);
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    min-width: 5.5rem;
    padding: var(--space-2) var(--space-3);
    border: var(--border-width) solid var(--color-ink);
    cursor: pointer;
    font-size: var(--size-label);
    font-weight: 700;
    letter-spacing: var(--tracking-label);
    list-style: none;
    text-transform: uppercase;
  }

  .site-menu > summary::-webkit-details-marker { display: none; }
  .site-menu[open] .menu-toggle-mark { transform: rotate(45deg); }

  .site-menu > .site-nav {
    display: none;
    position: absolute;
    z-index: 25;
    top: calc(100% + var(--border-width));
    right: 0;
    width: 100%;
    grid-template-columns: 1fr;
    justify-content: stretch;
    gap: 0;
    padding: var(--space-2);
    background: var(--color-paper);
    border: var(--border-width) solid var(--color-ink);
    box-shadow: var(--card-shadow);
  }

  .site-menu[open] > .site-nav { display: grid; }

  .site-nav a {
    display: flex;
    min-height: var(--control-min-height);
    align-items: center;
    padding: var(--space-3);
    border-bottom: var(--border-width) solid var(--color-line);
  }

  .site-nav a:last-child { border-bottom: 0; }
}

@media (max-width: 44rem) {
  .site-footer--corporate .footer-layout { grid-template-columns: 1fr; }
}

@media (max-width: 31rem) {
  .site-header--corporate .site-header__inner { gap: var(--space-3); }
}

@media (max-width: 22.5rem) {
  /*
   * Below 360px the hero drops a step, because the clamp minimum is only safe
   * for a narrow font. The stack resolves to Helvetica Neue on macOS, but to
   * Liberation Sans, DejaVu Sans, or whatever fontconfig aliases Arial to on
   * Linux and Android. Measured in a 288px column at 320px, 2.3125rem sets the
   * heading in five lines on the wider of those, against four on macOS.
   *
   * 2rem holds at four lines on every fallback measured. From 375px up the
   * column is wide enough that the full size fits regardless of font, so the
   * step is confined to the narrowest phones rather than applied to all of
   * them.
   */
  body { --size-hero: 2rem; }

  .site-header--corporate .site-header__inner { gap: var(--space-2); }

  .brand__detail {
    font-size: 0.625rem;
    letter-spacing: 0;
  }
}
