/*
 * The public page of the fund.
 *
 * Colours, type scale, spacing and radii come from the same tokens the Mini
 * App uses (theme/tokens.css) — the file is copied into this image at build
 * time rather than duplicated, so the two can never drift apart.
 *
 * Nothing here is a component of the app. The page shares its look and
 * shares none of its code: a change on this page cannot reach the cabinet
 * where the money is.
 */

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

html {
  /* The page is dark before a single style loads: a white flash on a black
     product looks like something broke. */
  background-color: var(--si-bg, #080d12);
}

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background-color: var(--si-bg);
  color: var(--si-text);
  font-family: var(--si-font-ui);
  font-size: var(--si-body-size);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* A gold glow behind the first screen, the way the cards glow in the app. */
body::before {
  content: '';
  position: fixed;
  inset: -20vh 0 auto 0;
  height: 70vh;
  background: radial-gradient(60% 55% at 50% 0%, rgba(243, 182, 66, 0.14), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

main,
.header,
.footer {
  position: relative;
  z-index: 1;
}

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

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--si-space-4);
  flex-wrap: wrap;
  padding: var(--si-space-4);
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--si-space-3);
  text-decoration: none;
  color: var(--si-text);
}

.brand__mark {
  display: block;
  width: 36px;
  height: 36px;
  filter: drop-shadow(var(--si-gold-glow-soft));
}

.brand__name {
  font-size: var(--si-h3-size);
  font-weight: var(--si-h3-weight);
  letter-spacing: 0.01em;
}

.header__actions {
  display: flex;
  align-items: center;
  gap: var(--si-space-2);
  flex-wrap: wrap;
}

.lang {
  display: inline-flex;
  padding: 2px;
  border: 1px solid var(--si-border);
  border-radius: var(--si-radius-2);
  background-color: var(--si-surface-2);
}

.lang__button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--si-text-muted);
  font: inherit;
  font-size: var(--si-small-size);
  letter-spacing: 0.04em;
  padding: 6px 10px;
  border-radius: var(--si-radius-1);
  cursor: pointer;
}

.lang__button[aria-pressed='true'] {
  background-color: var(--si-surface-3);
  color: var(--si-gold);
}

.lang__button:focus-visible,
.button:focus-visible {
  outline: 2px solid var(--si-gold);
  outline-offset: 2px;
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--si-space-2);
  padding: 10px 18px;
  border-radius: var(--si-radius-3);
  font-size: var(--si-caption-size);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.12s ease;
}

.button:active {
  transform: scale(0.985);
}

.button--gold {
  background: var(--si-gold-gradient);
  color: var(--si-gold-ink);
  box-shadow: var(--si-gold-glow-soft);
}

.button--quiet {
  background-color: var(--si-surface-2);
  color: var(--si-text);
  border: 1px solid var(--si-border);
}

.button--wide {
  padding: 14px 24px;
  font-size: var(--si-body-size);
}

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

.hero {
  max-width: 720px;
  margin: 0 auto;
  padding: var(--si-space-7) var(--si-space-4) var(--si-space-8);
  text-align: center;
}

.hero__mark {
  width: 140px;
  height: 140px;
  max-width: 45vw;
  height: auto;
  filter: drop-shadow(var(--si-gold-glow));
}

.hero__title {
  margin: var(--si-space-5) 0 0;
  font-size: clamp(2rem, 7vw, 3.25rem);
  font-weight: var(--si-h1-weight);
  line-height: 1.1;
  letter-spacing: -0.01em;
  /* The name carries the same gold as the mark above it. */
  background: var(--si-gold-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__lead {
  margin: var(--si-space-4) auto 0;
  max-width: 34em;
  color: var(--si-text-2);
  font-size: clamp(var(--si-caption-size), 2.6vw, 1.0625rem);
}

.hero__actions {
  margin-top: var(--si-space-6);
  display: flex;
  flex-wrap: wrap;
  gap: var(--si-space-3);
  justify-content: center;
}

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

.trust {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 var(--si-space-4) var(--si-space-8);
}

.trust__title {
  margin: 0 0 var(--si-space-5);
  text-align: center;
  font-size: clamp(var(--si-h2-size), 4vw, 2.25rem);
  font-weight: var(--si-h2-weight);
}

.trust__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--si-space-3);
  /* One column on a phone, two from a tablet, three on a wide screen —
     without a single media query, so a width nobody thought to test still
     lands somewhere sensible. */
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
}

.card {
  padding: var(--si-space-5) var(--si-space-4);
  border: 1px solid var(--si-border);
  border-radius: var(--si-radius-5);
  background: var(--si-card-gradient);
  box-shadow: var(--si-card-shadow);
}

.card__title {
  margin: 0;
  font-size: var(--si-h3-size);
  font-weight: var(--si-h3-weight);
  color: var(--si-gold);
  /* Long headings must break rather than push the card wider. */
  overflow-wrap: anywhere;
}

.card__text {
  margin: var(--si-space-3) 0 0;
  color: var(--si-text-2);
  font-size: var(--si-caption-size);
}

.trust__closing {
  margin: var(--si-space-6) auto 0;
  max-width: 46em;
  text-align: center;
  font-size: clamp(var(--si-body-size), 2.4vw, 1.125rem);
  color: var(--si-text);
}

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

.footer {
  margin-top: auto;
  padding: var(--si-space-5) var(--si-space-4);
  text-align: center;
  border-top: 1px solid var(--si-border);
}

.footer__mark {
  font-size: var(--si-small-size);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--si-text-muted);
}

/* On the narrowest phones the two header buttons take the whole row rather
   than squeezing the name of the fund off the screen. */
@media (max-width: 26rem) {
  .header {
    justify-content: center;
  }

  .header__actions {
    width: 100%;
    justify-content: center;
  }

  /* The language switch takes its own row and the two buttons share the
     next one, rather than one button being left alone underneath. */
  .lang {
    order: -1;
  }

  .header__actions .button {
    flex: 1 1 0;
  }
}

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