/* ==========================================================================
   f365-shared.css — Financials 365: Single Source of Truth
   ──────────────────────────────────────────────────────────────────────────
   ALL design tokens and ALL reusable components live here.
   Per-page override files must never define :root or shared components.
   Loaded by every layout before nav.css and page-specific overrides.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. DESIGN TOKENS — canonical names only
   -------------------------------------------------------------------------- */
:root {
  /* Brand colours */
  --f365-teal-dark:   #008489;
  --f365-teal:        #00d0da;
  --f365-teal-light:  #00d1cd;
  --f365-slate:       #617c9a;
  --f365-blue:        #00b0f0;
  --f365-white:       #ffffff;

  /* Supporting colours */
  --f365-body-text:   #2c3e50;
  --f365-muted:       #5a6a7a;
  --f365-border:      rgba(0, 132, 137, 0.15);
  --f365-bg-light:    #f0f4f8;
  --f365-bg-dark:     #0d1f2d;

  /* Semantic state colours */
  --f365-error:          #c0392b;
  --f365-error-shadow:   rgba(192, 57, 43, 0.15);
  --f365-error-bg:       rgba(192, 57, 43, 0.08);
  --f365-error-border:   rgba(192, 57, 43, 0.20);

  /* Gradients */
  --f365-gradient-primary: linear-gradient(135deg, #008489 0%, #00d0da 50%, #00b0f0 100%);
  --f365-gradient-hero:    linear-gradient(135deg, #0d1f2d 0%, #132233 60%, #1a3040 100%);
  --f365-gradient-slate:   linear-gradient(135deg, #43566b, #617c9a);

  /* Spacing — 4px base unit */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-12: 48px;
  --space-16: 64px;
  --space-24: 96px;
  --space-32: 128px;

  /* Border radius */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   16px;
  --radius-xl:   24px;
  --radius-pill: 100px;

  /* Shadows */
  --shadow-sm:   0 2px 12px rgba(0, 132, 137, 0.12);
  --shadow-md:   0 8px 32px rgba(0, 132, 137, 0.18);
  --shadow-lg:   0 20px 60px rgba(0, 0, 0, 0.22);
  --shadow-glow: 0 0 48px rgba(0, 208, 218, 0.25);

  /* Motion */
  --ease-standard:   cubic-bezier(0.4, 0, 0.2, 1);
  --ease-decelerate: cubic-bezier(0.0, 0.0, 0.2, 1);
  --ease-spring:     cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast:   120ms;
  --duration-base:   220ms;
  --duration-slow:   400ms;
  --duration-xslow:  600ms;

  /* ── Backward-compatibility aliases ──────────────────────────────────────
     index-override.css was written with shortened token names before
     f365-shared.css existed. These aliases map the old names to the
     canonical values so index-override.css continues to work unchanged.
     Do not use these names in any new CSS — use the canonical names above.
     ----------------------------------------------------------------------- */

  /* Colour aliases */
  --f365-text:       #2c3e50;   /* → --f365-body-text  */
  --f365-text-muted: #5a6a7a;   /* → --f365-muted      */
  --f365-off-white:  #f5f8fa;   /* off-white surface   */
  --f365-dark:       #0d1f2d;   /* → --f365-bg-dark    */
  --f365-dark-card:  #132233;   /* dark card surface   */

  /* Gradient aliases */
  --f365-grad-primary:   linear-gradient(135deg, #008489 0%, #00d0da 50%, #00b0f0 100%);
  --f365-grad-hero:      linear-gradient(135deg, #0d1f2d 0%, #132233 60%, #1a3040 100%);
  --f365-grad-teal:      linear-gradient(135deg, #008489 0%, #00b0f0 100%);

  /* Package-specific gradients (index page only) */
  --f365-grad-core:      linear-gradient(135deg, #008489 0%, #00d0da 100%);
  --f365-grad-sales:     linear-gradient(135deg, #0070c0 0%, #00b0f0 100%);
  --f365-grad-purchases: linear-gradient(135deg, #43566b 0%, #617c9a 100%);
  --f365-grad-assets:    linear-gradient(135deg, #006468 0%, #00d1cd 100%);
  --f365-grad-jobs:      linear-gradient(135deg, #005a9e 0%, #00b0f0 100%);

  /* Duration aliases */
  --dur-fast: 120ms;   /* → --duration-fast */
  --dur-base: 220ms;   /* → --duration-base */
  --dur-slow: 400ms;   /* → --duration-slow */
}

/* --------------------------------------------------------------------------
   2. BASE
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--f365-body-text);
  padding-top: 90px;    /* clearance for fixed nav — hero sections override to 0 */
  padding-bottom: 0;    /* site.css sets padding-bottom: 50px — reset it here */
}

img {
  max-width: 100%;
  height: auto;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

/* --------------------------------------------------------------------------
   3. ACCESSIBILITY — Skip link
   -------------------------------------------------------------------------- */
.f365-skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  background: var(--f365-teal-dark);
  color: var(--f365-white);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  z-index: 9999;
  font-weight: 600;
  text-decoration: none;
}

.f365-skip-link:focus {
  top: var(--space-4);
}

/* --------------------------------------------------------------------------
   4. SECTION SCAFFOLDING
   -------------------------------------------------------------------------- */
.f365-section {
  padding: var(--space-24) 0;
}

.f365-section--light { background: var(--f365-white); }
.f365-section--alt   { background: var(--f365-bg-light); }
.f365-section--dark  { background: var(--f365-gradient-hero); color: var(--f365-white); }
.f365-section--teal  { background: var(--f365-gradient-primary); color: var(--f365-white); }
.f365-section--slate { background: var(--f365-gradient-slate); color: var(--f365-white); }

.f365-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.f365-eyebrow {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--f365-teal);
  margin-bottom: var(--space-2);
}

.f365-eyebrow--light   { color: var(--f365-white); }
.f365-eyebrow--center  { text-align: center; }

.f365-section__title {
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  font-weight: 600;
  color: var(--f365-body-text);
  margin: 0 0 var(--space-4);
}

.f365-section__title--center { text-align: center; }
.f365-section__title--light  { color: var(--f365-white); }

.f365-section__intro {
  max-width: 680px;
  margin: 0 auto var(--space-12);
  text-align: center;
  color: var(--f365-muted);
  line-height: 1.7;
}

.f365-section__intro--light { color: rgba(255, 255, 255, 0.8); }

.f365-rule {
  width: 60px;
  height: 3px;
  background: var(--f365-gradient-primary);
  border-radius: var(--radius-pill);
  margin: var(--space-4) auto var(--space-8);
}

.f365-rule--left { margin-left: 0; }

/* --------------------------------------------------------------------------
   5. BUTTONS
   -------------------------------------------------------------------------- */
.f365-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-pill);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: transform var(--duration-base) var(--ease-standard),
              box-shadow var(--duration-base) var(--ease-standard);
}

.f365-btn--primary,
.f365-btn--primary:link,
.f365-btn--primary:visited,
.f365-btn--primary:hover,
.f365-btn--primary:active {
  background: var(--f365-gradient-primary);
  color: var(--f365-white);
}

.f365-btn--outline,
.f365-btn--outline:link,
.f365-btn--outline:visited,
.f365-btn--outline:hover,
.f365-btn--outline:active {
  background: transparent;
  color: var(--f365-teal-dark);
  border: 2px solid var(--f365-teal-dark);
}

.f365-btn--outline-light,
.f365-btn--outline-light:link,
.f365-btn--outline-light:visited,
.f365-btn--outline-light:hover,
.f365-btn--outline-light:active {
  background: transparent;
  color: var(--f365-white);
  border: 2px solid rgba(255, 255, 255, 0.6);
}

.f365-btn--ghost,
.f365-btn--ghost:link,
.f365-btn--ghost:visited,
.f365-btn--ghost:hover,
.f365-btn--ghost:active {
  background: rgba(0, 132, 137, 0.1);
  color: var(--f365-teal-dark);
  border: 1px solid var(--f365-border);
}

.f365-btn--white,
.f365-btn--white:link,
.f365-btn--white:visited,
.f365-btn--white:hover,
.f365-btn--white:active {
  background: var(--f365-white);
  color: var(--f365-teal-dark);
  border: none;
}

.f365-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.f365-btn--sm { padding: var(--space-2) var(--space-4); font-size: 0.875rem; }
.f365-btn--lg { padding: var(--space-4) var(--space-8); font-size: 1.125rem; }

/* --------------------------------------------------------------------------
   6. CARDS
   -------------------------------------------------------------------------- */
.f365-card {
  background: var(--f365-white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--f365-border);
  border-top: 3px solid var(--f365-teal-dark);
  transition: transform var(--duration-base) var(--ease-standard),
              box-shadow var(--duration-base) var(--ease-standard);
}

.f365-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.f365-card--glass {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
}

/* --------------------------------------------------------------------------
   7. SCROLL REVEAL
   -------------------------------------------------------------------------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--duration-slow) var(--ease-decelerate),
              transform var(--duration-slow) var(--ease-decelerate);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

[data-reveal-delay="1"] { transition-delay:  80ms; }
[data-reveal-delay="2"] { transition-delay: 160ms; }
[data-reveal-delay="3"] { transition-delay: 240ms; }
[data-reveal-delay="4"] { transition-delay: 320ms; }
[data-reveal-delay="5"] { transition-delay: 400ms; }
[data-reveal-delay="6"] { transition-delay: 480ms; }

/* --------------------------------------------------------------------------
   8. FOOTER
   -------------------------------------------------------------------------- */
.f365-footer {
  background: var(--f365-gradient-hero);
  color: rgba(255, 255, 255, 0.75);
  text-align: center;
  padding: var(--space-12) var(--space-6);
  font-size: 0.9rem;
  line-height: 2;
}

/* site.css sets footer p { padding-top: 2%; padding-bottom: 1%; } — reset it */
.f365-footer p {
  padding: 0;
  margin: 0;
  color: rgba(255, 255, 255, 0.75);
}

.f365-footer a {
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-standard);
}

.f365-footer a:hover {
  color: var(--f365-teal);
}

.f365-footer__social {
  display: flex;
  justify-content: center;
  gap: var(--space-6);
  font-size: 1.25rem;
  margin-bottom: var(--space-6);
}

.f365-footer__links {
  margin-top: var(--space-4);
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
}

.f365-footer__links a {
  color: rgba(255, 255, 255, 0.5);
}

.f365-footer__links a:hover {
  color: var(--f365-teal);
}

/* --------------------------------------------------------------------------
   9. GRADIENT TEXT UTILITY
   -------------------------------------------------------------------------- */
.f365-gradient-text {
  background: var(--f365-gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --------------------------------------------------------------------------
   10. REDUCED MOTION — defined once here, never duplicated in per-page files
   -------------------------------------------------------------------------- */
@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;
  }
}
