/* ============================================================
   FinsiderAI Base Styles
   Modern reset + typography foundation + base element styles.
   Manrope-only typography. Cool palette. Modern fintech aesthetic.
   ============================================================ */

/* ============================================================
   1. RESET — Modern, opinionated
   ============================================================ */

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

html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100vh;
  line-height: var(--lh-relaxed);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern", "liga", "calt", "ss01";
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: var(--fw-regular);
  color: var(--c-text);
  background: var(--c-bg);
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: none;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

/* ============================================================
   2. TYPOGRAPHY — Base element styles
   Single Manrope family. Weight + size carries hierarchy.
   ============================================================ */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  color: var(--c-navy-900);
  line-height: var(--lh-snug);
  letter-spacing: var(--ls-tight);
  text-wrap: balance;
}

h1 {
  font-size: var(--fs-h1);
  letter-spacing: var(--ls-tighter);
  font-weight: var(--fw-extrabold);
}

h2 {
  font-size: var(--fs-h2);
  letter-spacing: var(--ls-tighter);
  font-weight: var(--fw-bold);
}

h3 {
  font-size: var(--fs-h3);
  font-weight: var(--fw-bold);
}

h4 {
  font-size: var(--fs-h4);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-normal);
}

h5 {
  font-size: var(--fs-h5);
  font-weight: var(--fw-semibold);
}

p {
  font-size: var(--fs-body);
  line-height: var(--lh-relaxed);
  color: var(--c-text);
  text-wrap: pretty;
}

p + p {
  margin-top: 0px;
}

/* Links */
a {
  color: var(--c-indigo-500);
  text-decoration: none;
  transition: color var(--t-fast);
}

a:hover {
  color: var(--c-indigo-400);
}

/* Inline code */
code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  padding: 0.15em 0.4em;
  background: var(--c-indigo-100);
  color: var(--c-navy-800);
  border-radius: var(--r-sm);
}

/* Numbers — always tabular for financial figures */
.num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

/* Caption / eyebrow text */
small {
  font-size: var(--fs-caption);
  color: var(--c-text-muted);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  font-weight: var(--fw-semibold);
}

/* ============================================================
   3. SELECTION
   ============================================================ */

::selection {
  background: var(--c-indigo-100);
  color: var(--c-navy-900);
}

/* ============================================================
   4. FOCUS — Accessible focus states
   ============================================================ */

:focus {
  outline: none;
}

:focus-visible {
  outline: none;
  border-radius: var(--r-sm);
}

/* ============================================================
   5. RESPONSIVE TYPOGRAPHY
   ============================================================ */

@media (max-width: 768px) {
  h1 {
    font-size: 2rem;
  }
  h2 {
    font-size: 1.625rem;
  }
  h3 {
    font-size: 1.25rem;
  }
  p {
    font-size: 1rem;
    text-align: left;
  }
}

/* ============================================================
   6. UTILITY — Container
   ============================================================ */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--sp-6);
}

@media (max-width: 768px) {
  .container {
    padding-inline: var(--sp-4);
  }
}

/* ============================================================
   8. ACCESSIBILITY — Reduced motion
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
   9. SKIP LINK
   ============================================================ */

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  background: var(--c-navy-800);
  color: var(--c-surface);
  border-radius: var(--r-md);
  text-decoration: none;
  font-weight: var(--fw-semibold);
  z-index: var(--z-toast);
  transition: top var(--t-fast);
}

.skip-link:focus {
  top: var(--sp-4);
}

/* ============================================================
   10. DESKTOP VISUAL SCALE REDUCTION — mobile untouched
   Reduces rem-based fonts via root font-size, plus key px spacing
   tokens that don't auto-scale with rem. Threshold: 1024px (tablet+).
   Makes 100% zoom match the previous ~80% zoom look on desktop.
   ============================================================ */
@media (min-width: 1024px) {
  html {
    font-size: 87.5%;  /* 1rem = 14px, scales all --fs-* tokens proportionally */
  }

  :root {
    /* Tighten vertical rhythm — px values don't scale with html font-size */
    --section-py-desktop: 60px;
    --sp-16: 56px;  /* 64px → 56px */
    --sp-20: 64px;  /* 80px → 64px */
    --sp-24: 80px;  /* 96px → 80px */
  }
}
