/*
 * Signal — the redesign's own system.
 *
 * Replaces design-system.css, which was a port of the French site's tokens. The
 * brief changed: the French design reads austere, converts less, and the English
 * site is meant to sell two courses rather than present a catalogue.
 *
 * What carried over from the French site is the typeface and nothing else.
 * InterVariable 4.1 is the same file alti-trading.fr serves, and the display
 * tracking (-0.032em) is measured from it, so the two sites read as one brand
 * without the English one inheriting the mood.
 *
 * The palette is light. A dark variant exists in the design canvas and was shown
 * side by side; light was chosen. Two things stay dark on purpose — the price
 * panel and the frame around member screenshots — because a trading screen is
 * dark and a page that never shows one loses its subject.
 *
 * Everything is scoped under `.sg`. The Divi stylesheet is still loaded on the
 * pages that have not been rebuilt yet, and a bare `.btn` or `.shell` would
 * collide with it; the ancestor also lifts specificity above most of Divi's
 * rules without a single `!important`.
 */

/*
 * InterVariable 4.1 — the same file alti-trading.fr serves. Declared here as
 * well as in design-system.css so this sheet stands alone once that one goes;
 * the browser dedupes identical sources.
 */
@font-face {
  font-family: InterVariable;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/inter/InterVariable.woff2') format('woff2');
}

@font-face {
  font-family: InterVariable;
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/inter/InterVariable-Italic.woff2') format('woff2');
}

:root {
  /* Type ------------------------------------------------------------- */
  --sg-font: InterVariable, Inter, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  /* Measured off the French source, where -1.92px at 60px is -0.032em. */
  --sg-track-display: -0.032em;
  --sg-track-tight: -0.02em;

  /* Neutrals --------------------------------------------------------- */
  --sg-ground: oklch(0.988 0.004 264);
  --sg-raised: oklch(1 0 0);
  --sg-raised-2: oklch(0.972 0.006 264);
  --sg-sunk: oklch(0.962 0.006 264);
  --sg-line: oklch(0.902 0.007 264);
  --sg-ink: oklch(0.175 0.012 264);
  --sg-body: oklch(0.415 0.014 264);
  --sg-soft: oklch(0.510 0.014 264);

  /*
   * The one accent, and the only colour a button is ever painted in. The bright
   * value is a fill; as small text on white it is 2.6:1, so text uses its own
   * step down the ramp. Both measured, not guessed.
   */
  --sg-up: oklch(0.845 0.185 148);
  --sg-up-ink: oklch(0.20 0.06 150);
  --sg-up-text: oklch(0.470 0.115 155);
  --sg-down-text: oklch(0.495 0.150 27);

  /*
   * The courses keep the identity colours their existing icons already
   * carry: orange for Starter, blue for Trader Pro. They badge, they never act
   * — buttons stay on the accent, so there is never a question about where to
   * click. Each has a darker text step, because the badge hues land at 2.5:1
   * and 2.2:1 as small text on white.
   */
  --sg-starter: oklch(0.735 0.155 44);
  --sg-starter-dim: oklch(0.735 0.155 44 / 0.16);
  --sg-starter-text: oklch(0.540 0.155 44);
  --sg-trpro: oklch(0.755 0.095 259);
  --sg-trpro-dim: oklch(0.755 0.095 259 / 0.18);
  --sg-trpro-text: oklch(0.525 0.095 259);

  /* The deliberate dark artefacts. */
  --sg-panel: oklch(0.185 0.028 264);
  --sg-panel-ink: oklch(0.975 0.006 264);
  --sg-panel-body: oklch(0.775 0.018 264);
  --sg-panel-line: oklch(0.300 0.028 264);

  /* Shape and rhythm -------------------------------------------------- */
  --sg-radius: 8px;
  --sg-radius-lg: 16px;
  --sg-radius-pill: 999px;
  --sg-gutter: 20px;
  --sg-page: 1160px;
  --sg-section: 88px;

  --sg-shadow-sm: 0 1px 2px oklch(0.20 0.02 264 / 0.04), 0 8px 20px oklch(0.20 0.02 264 / 0.05);
  --sg-shadow: 0 2px 6px oklch(0.20 0.02 264 / 0.05), 0 22px 50px oklch(0.20 0.02 264 / 0.10);
}

@media (max-width: 999px) {
  :root {
    --sg-gutter: 16px;
    --sg-section: 64px;
  }
}

/* Root ---------------------------------------------------------------- */

.sg {
  background: var(--sg-ground);
  color: var(--sg-body);
  font-family: var(--sg-font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  /*
   * `clip` and not `hidden`: `overflow-x: hidden` forces the other axis to
   * `auto`, which on a full-page element produces a second scrollbar.
   */
  overflow-x: clip;
}

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

.sg a {
  color: var(--sg-up-text);
  text-decoration: none;
}

.sg a:hover,
.sg a:focus-visible {
  color: var(--sg-ink);
}

.sg :focus-visible {
  outline: 2px solid var(--sg-up-text);
  outline-offset: 2px;
}

.sg .sg-shell {
  width: 100%;
  max-width: var(--sg-page);
  margin-inline: auto;
  padding-inline: var(--sg-gutter);
}

.sg .sg-section {
  padding-block: var(--sg-section);
}

/*
 * Text for screen readers only. A table cell holding nothing but a tick says
 * nothing when it is read aloud, so the word goes in beside the mark.
 */
.sg .sg-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Numbers that sit in columns: prices, percentages, instalments. Inter's
   tabular figures keep them aligned without a second typeface. */
.sg .sg-num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}

/* Type ----------------------------------------------------------------- */

.sg h1,
.sg h2,
.sg h3,
.sg h4 {
  margin: 0;
  color: var(--sg-ink);
  font-family: var(--sg-font);
  text-wrap: balance;
}

.sg .sg-d1 {
  font-size: clamp(2.25rem, 1.35rem + 3.4vw, 3.75rem);
  line-height: 1.03;
  letter-spacing: var(--sg-track-display);
  font-weight: 700;
}

.sg .sg-d2 {
  font-size: clamp(1.875rem, 1.25rem + 2.4vw, 2.75rem);
  line-height: 1.05;
  letter-spacing: var(--sg-track-display);
  font-weight: 700;
}

.sg .sg-d3 {
  font-size: clamp(1.375rem, 1.1rem + 1.1vw, 1.875rem);
  line-height: 1.1;
  letter-spacing: -0.026em;
  font-weight: 600;
}

.sg .sg-d4 {
  font-size: 1.1875rem;
  line-height: 1.3;
  letter-spacing: var(--sg-track-tight);
  font-weight: 600;
}

.sg .sg-lead {
  margin: 1.125rem 0 0;
  max-width: 54ch;
  font-size: 1.125rem;
  line-height: 1.5;
  color: var(--sg-body);
  text-wrap: pretty;
}

.sg .sg-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sg-soft);
}

.sg .sg-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sg-up);
  flex: none;
}

/*
 * Heading on the left, a short aside on the right. Below 860px the aside drops
 * under the heading and goes back to reading left, because right-aligned text
 * on a narrow column is hard work for no gain.
 */
.sg .sg-head {
  display: flex;
  align-items: flex-end;
  gap: 2rem;
  margin-bottom: 2.25rem;
}

.sg .sg-head .sg-lead {
  margin: 0 0 0.25rem auto;
  max-width: 34ch;
  font-size: 0.9375rem;
  text-align: right;
}

@media (max-width: 859px) {
  .sg .sg-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .sg .sg-head .sg-lead {
    margin: 0;
    text-align: left;
  }
}

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

.sg .sg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  /* Never below the 44px touch target, at any size. */
  min-height: 48px;
  padding: 0 1.5rem;
  border: 1px solid transparent;
  border-radius: var(--sg-radius);
  font-family: var(--sg-font);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.18s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.18s ease, color 0.18s ease;
}

.sg .sg-btn--sm {
  min-height: 44px;
  padding: 0 1.125rem;
  font-size: 0.875rem;
}

.sg .sg-btn--wide {
  width: 100%;
}

.sg .sg-btn--go {
  background: var(--sg-up);
  color: var(--sg-up-ink);
}

.sg .sg-btn--go:hover,
.sg .sg-btn--go:focus-visible {
  background: oklch(0.80 0.19 148);
  color: var(--sg-up-ink);
}

.sg .sg-btn--ghost {
  border-color: var(--sg-line);
  color: var(--sg-ink);
  background: var(--sg-raised);
}

.sg .sg-btn--ghost:hover,
.sg .sg-btn--ghost:focus-visible {
  border-color: var(--sg-ink);
  color: var(--sg-ink);
}

.sg .sg-btn--solid {
  background: var(--sg-ink);
  color: var(--sg-ground);
}

.sg .sg-btn--solid:hover,
.sg .sg-btn--solid:focus-visible {
  background: oklch(0.10 0.012 264);
  color: var(--sg-ground);
}

/* On the dark panel the ghost has to borrow the panel's own line colour. */
.sg .sg-panel .sg-btn--ghost {
  background: transparent;
  border-color: var(--sg-panel-line);
  color: var(--sg-panel-ink);
}

.sg .sg-panel .sg-btn--ghost:hover,
.sg .sg-panel .sg-btn--ghost:focus-visible {
  border-color: var(--sg-panel-ink);
  color: var(--sg-panel-ink);
}

.sg .sg-btn svg {
  width: 1em;
  height: 1em;
  flex: none;
}

/*
 * Candlesticks behind a heading. A band at the section's own aspect ratio, not
 * a stretched fill: sliced into a tall hero it renders as a handful of giant
 * candles, which reads as a broken background rather than a market.
 */
.sg .sg-texture {
  position: absolute;
  inset: 0 0 auto;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  /*
   * The band's height is its own, and capped twice.
   *
   * Left to size itself from the artwork's aspect ratio it grew with the
   * viewport: at 2000px wide the band was 515px tall, taller than the section
   * holding it, and since the section does not clip, both the candles and the
   * fade below them spilled over the next section — repainting the page
   * background across the top of whatever came next.
   *
   * `max-height: 100%` resolves against the section, so the band can never
   * outgrow its own container again.
   */
  height: clamp(220px, 26vw, 420px);
  max-height: 100%;
}

.sg .sg-texture svg {
  display: block;
  width: 100%;
  /* Fills the band; `preserveAspectRatio="…slice"` crops rather than stretches,
     so the candles keep their shape at every width. */
  height: 100%;
  opacity: 0.3;
}

.sg .sg-texture::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, var(--sg-ground) 72%);
}

/* Panels and screenshots ------------------------------------------------ */

.sg .sg-panel {
  border: 1px solid var(--sg-panel-line);
  border-radius: var(--sg-radius-lg);
  background: var(--sg-panel);
  color: var(--sg-panel-body);
  box-shadow: var(--sg-shadow);
}

.sg .sg-panel h1,
.sg .sg-panel h2,
.sg .sg-panel h3,
.sg .sg-panel h4 {
  color: var(--sg-panel-ink);
}

.sg .sg-shot {
  border: 1px solid var(--sg-line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--sg-raised);
  box-shadow: var(--sg-shadow);
}

.sg .sg-shot img {
  display: block;
  width: 100%;
  height: auto;
}

.sg .sg-shot__bar {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.7rem 0.95rem;
  border-bottom: 1px solid var(--sg-line);
  background: var(--sg-raised);
}

.sg .sg-shot__bar > img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.sg .sg-shot__who {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--sg-ink);
  line-height: 1.2;
}

.sg .sg-shot__meta {
  font-size: 0.72rem;
  color: var(--sg-soft);
}

.sg .sg-shot__pl {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--sg-up-text);
}

/* Course identity ---------------------------------------------------- */

.sg .sg-pid {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sg .sg-pid__icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sg .sg-pid__icon svg {
  display: block;
  width: 30px;
  height: 30px;
}

.sg .sg-pid--starter .sg-pid__icon {
  background: var(--sg-starter-dim);
}

.sg .sg-pid--trpro .sg-pid__icon {
  background: var(--sg-trpro-dim);
}

.sg .sg-pid__k {
  display: block;
  font-size: 0.6875rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  font-weight: 600;
}

.sg .sg-pid--starter .sg-pid__k {
  color: var(--sg-starter-text);
}

.sg .sg-pid--trpro .sg-pid__k {
  color: var(--sg-trpro-text);
}

/* Faces, prices, checklists --------------------------------------------- */

.sg .sg-faces {
  display: flex;
}

.sg .sg-faces img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--sg-ground);
  margin-left: -11px;
}

.sg .sg-faces img:first-child {
  margin-left: 0;
}

.sg .sg-price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.7rem;
  font-variant-numeric: tabular-nums;
}

.sg .sg-price b {
  font-size: 2.375rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--sg-ink);
}

.sg .sg-price s {
  font-size: 1.0625rem;
  color: var(--sg-soft);
}

.sg .sg-price em {
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.5rem;
  border-radius: var(--sg-radius-pill);
  background: var(--sg-up);
  color: var(--sg-up-ink);
}

.sg .sg-panel .sg-price b {
  color: var(--sg-panel-ink);
}

.sg .sg-panel .sg-price s {
  color: var(--sg-panel-body);
}

.sg .sg-instal {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sg .sg-instal li {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--sg-line);
  border-radius: var(--sg-radius-pill);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  color: var(--sg-body);
}

.sg .sg-instal b {
  color: var(--sg-ink);
  font-weight: 600;
}

.sg .sg-checks {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.sg .sg-checks li {
  display: flex;
  gap: 0.7rem;
  font-size: 0.9375rem;
  color: var(--sg-body);
}

.sg .sg-checks svg {
  width: 16px;
  height: 16px;
  flex: none;
  margin-top: 0.2rem;
  color: var(--sg-up-text);
}

.sg .sg-panel .sg-checks li {
  color: var(--sg-panel-body);
}

.sg .sg-panel .sg-checks svg {
  color: var(--sg-up);
}

/* Guarantee ------------------------------------------------------------- */

.sg .sg-guarantee {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.375rem;
  border: 1px solid var(--sg-line);
  border-radius: 12px;
}

.sg .sg-guarantee svg {
  width: 30px;
  height: 30px;
  flex: none;
  color: var(--sg-up-text);
}

.sg .sg-guarantee p {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--sg-body);
}

.sg .sg-guarantee b {
  color: var(--sg-ink);
  font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
  .sg .sg-btn {
    transition: none;
  }
}
