/*
 * The public website (fluentinfinance.co.uk). Plain CSS, no build step.
 * Tokens mirror the app (src/index.css) and follow look-n-feel.md: house easing only,
 * layered shadows with a hairline ring, entrances that blur in, raised primary buttons.
 */
@font-face {
  font-family: 'Inter Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/fonts/inter-latin-wght-normal.woff2') format('woff2-variations');
}

:root {
  --ink: #1a1a1a;
  --paper: #fafaf7;
  --paper-2: #f0f0ea;
  --surface: #ffffff;
  --line: rgb(26 26 26 / 0.11);
  --line-strong: rgb(26 26 26 / 0.2);
  --muted: rgb(26 26 26 / 0.62);
  --navy: #003366;
  --navy-deep: #002855;
  --heading: #003366;
  --green: #2e8b57;
  --green-deep: #1a5c38;
  --green-text: #22744a;
  --flow: #0077b6;
  --flow-deep: #005a87;
  --ops: #2e8b57;
  --ops-deep: #1a5c38;
  --risk: #b5451b;
  --risk-deep: #7a2a10;
  --deal: #7b2d8b;
  --deal-deep: #4a1a5a;
  --bezel: #16181d;

  --ease-smooth: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.17, 1, 0.32, 1);
  --ease-spring: cubic-bezier(0.35, 1.55, 0.65, 1);
  --ease-in-out: cubic-bezier(0.66, 0, 0.34, 1);
  --duration-fast: 150ms;
  --duration-normal: 200ms;
  --duration-slow: 280ms;

  --radius: 0.625rem;
  --radius-lg: calc(var(--radius) * 1.6);
  --radius-xl: calc(var(--radius) * 2.6);

  --shadow-card:
    0 1px 2px rgb(26 26 26 / 0.05),
    0 2px 4px rgb(26 26 26 / 0.02),
    0 0 0 0.5px rgb(26 26 26 / 0.08);
  --shadow-elevated:
    0 2px 4px rgb(26 26 26 / 0.05),
    0 12px 32px -12px rgb(26 26 26 / 0.14),
    0 0 0 0.5px rgb(26 26 26 / 0.08);
  --shadow-phone:
    0 2px 4px rgb(26 26 26 / 0.06),
    0 24px 48px -16px rgb(0 40 85 / 0.28),
    0 60px 90px -40px rgb(0 40 85 / 0.22),
    0 0 0 0.5px rgb(26 26 26 / 0.2);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e8e8e3;
    --paper: #121418;
    --paper-2: #1a1d22;
    --surface: #1c1f25;
    --line: rgb(255 255 255 / 0.1);
    --line-strong: rgb(255 255 255 / 0.2);
    --muted: rgb(232 232 227 / 0.66);
    --heading: #e8e8e3;
    --green-text: #5cc48a;
    --bezel: #2a2e35;
    --shadow-card:
      0 1px 2px rgb(0 0 0 / 0.3),
      0 0 0 0.5px rgb(255 255 255 / 0.1);
    --shadow-elevated:
      0 12px 32px -12px rgb(0 0 0 / 0.5),
      0 0 0 0.5px rgb(255 255 255 / 0.1);
    --shadow-phone:
      0 24px 48px -16px rgb(0 0 0 / 0.6),
      0 0 0 0.5px rgb(255 255 255 / 0.14);
    color-scheme: dark;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Inter Variable', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--heading);
  letter-spacing: -0.025em;
  line-height: 1.1;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.5rem, 6vw, 4.25rem);
  font-weight: 800;
  letter-spacing: -0.035em;
}

h2 {
  font-size: clamp(1.875rem, 4vw, 2.75rem);
  font-weight: 750;
}

h3 {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

p {
  margin: 0;
}

.green {
  color: var(--green-text);
}

.wrap {
  width: 100%;
  max-width: 72rem;
  margin-inline: auto;
  padding-inline: max(1rem, env(safe-area-inset-left));
}

@media (min-width: 48rem) {
  .wrap {
    padding-inline: 2rem;
  }
}

.lead {
  color: var(--muted);
  font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
  line-height: 1.55;
  max-width: 38rem;
  text-wrap: pretty;
}

.fine {
  color: var(--muted);
  font-size: 0.875rem;
}

.quiet {
  text-decoration: none;
  color: var(--muted);
  font-weight: 550;
  transition: color var(--duration-fast) var(--ease-smooth);
}

.quiet:hover {
  color: var(--ink);
}

/* Buttons: the raised one is a solid face on a darker edge (look-n-feel Rule 7). */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0 1.5rem;
  border-radius: var(--radius-lg);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  white-space: nowrap;
  transition:
    transform var(--duration-fast) var(--ease-smooth),
    box-shadow var(--duration-fast) var(--ease-smooth),
    background-color var(--duration-normal) var(--ease-smooth);
}

.btn:active {
  transform: scale(0.98) translateY(1px);
}

.btn-raised {
  background: var(--green);
  color: #fff;
  box-shadow: 0 4px 0 var(--green-deep);
}

.btn-raised:hover {
  background: color-mix(in oklch, var(--green) 92%, white);
}

.btn-raised:active {
  transform: translateY(4px);
  box-shadow: 0 0 0 var(--green-deep);
}

.btn-ghost {
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.btn-ghost:hover {
  box-shadow: var(--shadow-elevated);
}

.btn-small {
  min-height: 2.5rem;
  padding: 0 1rem;
  font-size: 0.9375rem;
  background: var(--navy);
  color: #fff;
  box-shadow: 0 3px 0 var(--navy-deep);
}

.btn-small:active {
  transform: translateY(3px);
  box-shadow: 0 0 0 var(--navy-deep);
}

@media (prefers-color-scheme: dark) {
  .btn-small {
    background: var(--flow);
    box-shadow: 0 3px 0 var(--flow-deep);
  }
}

:focus-visible {
  outline: 2px solid var(--flow);
  outline-offset: 3px;
}

/* Keyboard users can jump past the header. */
.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 20;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  box-shadow: var(--shadow-elevated);
  transition: top var(--duration-normal) var(--ease-smooth);
}

.skip:focus {
  top: 1rem;
}

/* Header */
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in oklch, var(--paper) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  box-shadow: 0 0.5px 0 var(--line);
  padding-top: env(safe-area-inset-top);
}

.top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
}

.brand {
  display: flex;
  align-items: center;
  height: 2.5rem;
  text-decoration: none;
}

.brand img {
  height: 2.5rem;
  width: auto;
}

/* The PNG wordmark is navy on transparent and vanishes on dark, so dark swaps it for the
   mascot plus a live-text wordmark (as src/components/Logo.tsx does in the app). */
.logo-dark {
  display: none;
  align-items: center;
  gap: 0.4rem;
}

.wordmark {
  display: flex;
  flex-direction: column;
  font-weight: 900;
  font-size: 1rem;
  line-height: 1;
  letter-spacing: -0.02em;
}

.wordmark span:first-child {
  color: #8db8e8;
}

.wordmark span:last-child {
  color: var(--green-text);
}

@media (prefers-color-scheme: dark) {
  .logo-light {
    display: none;
  }

  .logo-dark {
    display: flex;
  }
}

.top-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  font-size: 0.9375rem;
}

@media (max-width: 40rem) {
  .top-links .quiet {
    display: none;
  }
}

/* Hero */
.hero {
  display: grid;
  gap: 3rem;
  align-items: center;
  padding-block: 3rem 4rem;
}

@media (min-width: 56rem) {
  .hero {
    grid-template-columns: 1.15fr 1fr;
    padding-block: 5rem 6rem;
  }
}

.hero-copy {
  display: grid;
  gap: 1.5rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.875rem;
  padding-top: 0.5rem;
}

@media (max-width: 30rem) {
  .hero-actions .btn {
    flex: 1 1 100%;
  }
}

.hero-visual {
  position: relative;
  justify-self: center;
  width: min(100%, 19rem);
}

.mascot {
  position: absolute;
  width: 7.5rem;
  left: -4.5rem;
  bottom: 2.5rem;
  z-index: 2;
  filter: drop-shadow(0 10px 14px rgb(0 40 85 / 0.18));
  rotate: -8deg;
}

@media (max-width: 30rem) {
  .mascot {
    width: 5.5rem;
    left: -0.75rem;
    bottom: 1rem;
  }
}

/* Phone frame around the real app screenshots */
.phone {
  position: relative;
  padding: 0.6rem;
  border-radius: 2.75rem;
  background: var(--bezel);
  box-shadow: var(--shadow-phone);
}

.phone img {
  width: 100%;
  border-radius: 2.2rem;
  aspect-ratio: 780 / 1688;
  object-fit: cover;
  object-position: top;
  background: var(--paper);
}

/* Numbers */
.numbers {
  border-block: 0.5px solid var(--line);
  background: var(--paper-2);
}

.numbers-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem 1rem;
  padding-block: 2rem;
}

@media (min-width: 48rem) {
  .numbers-row {
    grid-template-columns: repeat(4, 1fr);
  }
}

.numbers-row div {
  display: grid;
  gap: 0.125rem;
  text-align: center;
}

.numbers-row strong {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--heading);
  font-variant-numeric: tabular-nums;
}

.numbers-row span {
  color: var(--muted);
  font-size: 0.9375rem;
}

/* Sections */
.section-head {
  display: grid;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.modes,
.banks {
  padding-block: 5rem;
}

@media (min-width: 56rem) {
  .modes,
  .banks {
    padding-block: 7rem;
  }
}

/* Modes: the phone shows whichever team you pick */
.modes-grid {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}

@media (min-width: 56rem) {
  .modes-grid {
    grid-template-columns: 1fr 19rem;
    gap: 5rem;
  }
}

.phone-mode {
  justify-self: center;
  width: min(100%, 19rem);
}

.mode-tabs {
  display: grid;
  gap: 0.75rem;
}

/* Phones: the four modes sit as a compact grid above the screenshot they change, with the
   chosen mode's line as a caption; from 56rem each tab carries its own line. */
.mode-caption {
  color: var(--muted);
  text-align: center;
  margin-top: -1.25rem;
  min-height: 3.2em;
}

@media (max-width: 55.99rem) {
  .mode-tabs {
    grid-template-columns: 1fr 1fr;
    gap: 0.625rem;
  }

  .mode-tab {
    padding: 0.875rem 1rem 0.875rem 1.375rem;
  }

  .mode-line {
    display: none;
  }
}

@media (min-width: 56rem) {
  .mode-caption {
    display: none;
  }
}

.mode-tab {
  --c: var(--flow);
  --c-deep: var(--flow-deep);
  display: grid;
  gap: 0.25rem;
  text-align: left;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 0;
  border-radius: var(--radius-lg);
  padding: 1.125rem 1.25rem 1.125rem 1.5rem;
  position: relative;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition:
    transform var(--duration-fast) var(--ease-smooth),
    box-shadow var(--duration-normal) var(--ease-smooth),
    background-color var(--duration-normal) var(--ease-smooth),
    color var(--duration-normal) var(--ease-smooth);
}

.mode-tab::before {
  content: '';
  position: absolute;
  left: 0.6rem;
  top: 1.1rem;
  bottom: 1.1rem;
  width: 4px;
  border-radius: 4px;
  background: var(--c);
  transition: opacity var(--duration-normal) var(--ease-smooth);
}

.mode-tab[data-mode='ops'] {
  --c: var(--ops);
  --c-deep: var(--ops-deep);
}

.mode-tab[data-mode='risk'] {
  --c: var(--risk);
  --c-deep: var(--risk-deep);
}

.mode-tab[data-mode='deal'] {
  --c: var(--deal);
  --c-deep: var(--deal-deep);
}

.mode-tab:hover {
  box-shadow: var(--shadow-elevated);
}

.mode-tab:active {
  transform: scale(0.98) translateY(1px);
}

.mode-tab[aria-selected='true'] {
  background: var(--c);
  color: #fff;
  box-shadow: 0 4px 0 var(--c-deep);
}

.mode-tab[aria-selected='true']::before {
  opacity: 0;
}

.mode-name {
  font-weight: 750;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
}

.mode-line {
  font-size: 0.9875rem;
  color: var(--muted);
  transition: color var(--duration-normal) var(--ease-smooth);
}

.mode-tab[aria-selected='true'] .mode-line {
  color: rgb(255 255 255 / 0.88);
}

#mode-shot.swap {
  animation: enter-blur var(--duration-slow) var(--ease-smooth) both;
}

/* Deals */
.deals {
  background: var(--navy);
  color: #fff;
  padding-block: 5rem;
}

@media (prefers-color-scheme: dark) {
  .deals {
    background: #0d1b2b;
  }
}

.deals h2 {
  color: #fff;
}

.deals .lead {
  color: rgb(255 255 255 / 0.74);
}

.deal-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
}

.deal {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  padding: 1.125rem;
  border-radius: var(--radius-lg);
  background: rgb(255 255 255 / 0.07);
  box-shadow: 0 0 0 0.5px rgb(255 255 255 / 0.16);
  line-height: 1.3;
  transition:
    transform var(--duration-normal) var(--ease-smooth),
    background-color var(--duration-normal) var(--ease-smooth);
}

.deal span {
  display: grid;
  gap: 0.25rem;
}

.deal strong {
  font-weight: 650;
}

.deal em {
  font-style: normal;
  font-size: 0.9375rem;
  color: rgb(255 255 255 / 0.68);
}

.deal:hover {
  background: rgb(255 255 255 / 0.11);
  transform: translateY(-2px);
}

.deal img {
  width: 2.25rem;
  height: auto;
  margin-top: 0.125rem;
  border-radius: 4px;
  box-shadow: 0 0 0 0.5px rgb(255 255 255 / 0.3);
  flex: none;
}

.rules {
  margin-top: 2rem;
  color: rgb(255 255 255 / 0.62);
  font-size: 0.9375rem;
  letter-spacing: 0.01em;
}

/* Banks: the real team view in a browser window, then three plain points. */
.window {
  margin: 0;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-phone);
}

.window-bar {
  display: flex;
  gap: 0.4rem;
  padding: 0.8rem 1rem;
  background: var(--paper-2);
  box-shadow: 0 0.5px 0 var(--line);
}

.window-bar i {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: var(--line-strong);
}

.window img {
  width: 100%;
  aspect-ratio: 2240 / 1440;
}

@media (max-width: 40rem) {
  /* On a phone, zoom into the top-left of the screenshot so it stays readable. */
  .window picture {
    display: block;
    overflow: hidden;
    aspect-ratio: 1 / 1;
  }

  .window img {
    width: 190%;
    max-width: none;
    margin: -4% 0 0 -9%;
  }
}

.bank-points {
  display: grid;
  gap: 2rem;
  margin-top: 3.5rem;
}

@media (min-width: 48rem) {
  .bank-points {
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
  }
}

.bank-points div {
  display: grid;
  align-content: start;
  gap: 0.5rem;
  padding-top: 1.25rem;
  border-top: 2px solid var(--green);
}

.bank-points p {
  color: var(--muted);
  font-size: 1rem;
}

/* Closing */
.closing {
  background: var(--paper-2);
  border-top: 0.5px solid var(--line);
  padding-block: 5rem 5.5rem;
}

.closing-inner {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 1.25rem;
}

.closing-inner .lead {
  margin-inline: auto;
}

.closing-inner .hero-actions {
  justify-content: center;
}

.closing-mascot {
  width: 6.5rem;
  filter: drop-shadow(0 8px 12px rgb(0 40 85 / 0.16));
}

/* Footer */
.foot {
  padding-block: 2rem calc(2rem + env(safe-area-inset-bottom));
  color: var(--muted);
  font-size: 0.875rem;
}

.foot-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  justify-content: space-between;
}

/* Entrances blur in (look-n-feel Rule 5), staggered by --i. Only once JS is running, so
   the page is never blank without it. */
@keyframes enter-blur {
  from {
    opacity: 0;
    transform: translateY(6px);
    filter: blur(2px);
  }
}

.js .reveal {
  opacity: 0;
}

.js .reveal.in {
  opacity: 1;
  animation: enter-blur calc(var(--duration-slow) * 1.6) var(--ease-smooth) both;
  animation-delay: calc(min(var(--i, 0), 8) * 60ms);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
}
