/* ═══════════════════════════════════════════════════════════════════════
   NARRATIVE EXPERIENCES — Design System
   Version: 1.0
   Client: Bank Muscat (Asalah Priority Banking)
   Purpose: Interactive demo / pitch presentation
   
   This file defines ALL design tokens, typography, spacing, colors,
   component base styles, animation curves, and responsive breakpoints
   BEFORE any section-specific code is written.
   ═══════════════════════════════════════════════════════════════════════ */


/* ─────────────────────────────────────────────────────────────────────
   1. COLOR TOKENS
   Bank Muscat brand palette + extended UI colors
   ───────────────────────────────────────────────────────────────────── */

:root {
  /* Primary — Bank Muscat Red */
  --color-primary:        #EF3E42;
  --color-primary-dark:   #C73035;
  --color-primary-light:  #F26B5E;
  --color-primary-subtle: #FDD7CB;
  --color-primary-ghost:  rgba(239, 62, 66, 0.08);
  --color-primary-glow:   rgba(239, 62, 66, 0.25);

  /* Neutral — Bank Muscat Black + Greys */
  --color-black:          #231F20;
  --color-grey-90:        #333333;
  --color-grey-80:        #58595B;
  --color-grey-60:        #808285;
  --color-grey-40:        #A7A9AC;
  --color-grey-20:        #D1D3D4;
  --color-grey-10:        #E9ECEF;
  --color-grey-05:        #F4F4F2;
  --color-white:          #FFFFFF;

  /* Semantic */
  --color-success:        #059669;
  --color-success-ghost:  rgba(5, 150, 105, 0.08);
  --color-warning:        #D97706;
  --color-warning-ghost:  rgba(217, 119, 6, 0.08);
  --color-info:           #2563EB;
  --color-info-ghost:     rgba(37, 99, 235, 0.08);
  --color-danger:         #DC2626;

  /* Backgrounds */
  --bg-page:              var(--color-white);
  --bg-section-alt:       var(--color-grey-05);
  --bg-dark:              var(--color-black);
  --bg-glass:             rgba(255, 255, 255, 0.92);
  --bg-glass-dark:        rgba(35, 31, 32, 0.92);
  --bg-overlay:           rgba(0, 0, 0, 0.5);

  /* Borders */
  --border-light:         1px solid var(--color-grey-10);
  --border-subtle:        1px solid rgba(0, 0, 0, 0.06);
  --border-dark:          1px solid rgba(255, 255, 255, 0.08);


  /* ─────────────────────────────────────────────────────────────────────
     2. TYPOGRAPHY
     Roboto 100/300/400/600 — clean, modern, matches Bank Muscat's minimal tone
     Loaded via: https://fonts.googleapis.com/css?family=Roboto:100,300,400,600
     ───────────────────────────────────────────────────────────────────── */

  /* Font families */
  --font-body:            'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display:         'Roboto', sans-serif;
  --font-arabic:          'Roboto', sans-serif;
  --font-mono:            'Roboto Mono', 'SF Mono', monospace;

  /* Font sizes — modular scale (1.25 ratio) */
  --text-xs:              11px;
  --text-sm:              13px;
  --text-base:            15px;
  --text-md:              18px;
  --text-lg:              22px;
  --text-xl:              28px;
  --text-2xl:             36px;
  --text-3xl:             48px;
  --text-4xl:             64px;
  --text-5xl:             80px;

  /* Font weights (Roboto: 100, 300, 400, 600) */
  --weight-thin:          100;
  --weight-light:         300;
  --weight-regular:       400;
  --weight-medium:        400;   /* mapped to regular — Roboto 500 not loaded */
  --weight-semibold:      600;
  --weight-bold:          600;
  --weight-black:         600;

  /* Line heights */
  --leading-tight:        1.1;
  --leading-snug:         1.25;
  --leading-normal:       1.5;
  --leading-relaxed:      1.7;
  --leading-loose:        1.9;

  /* Letter spacing */
  --tracking-tight:       -1px;
  --tracking-normal:      0;
  --tracking-wide:        0.5px;
  --tracking-wider:       1.5px;
  --tracking-widest:      3px;


  /* ─────────────────────────────────────────────────────────────────────
     3. SPACING
     8px base grid
     ───────────────────────────────────────────────────────────────────── */

  --space-1:              4px;
  --space-2:              8px;
  --space-3:              12px;
  --space-4:              16px;
  --space-5:              20px;
  --space-6:              24px;
  --space-8:              32px;
  --space-10:             40px;
  --space-12:             48px;
  --space-16:             64px;
  --space-20:             80px;
  --space-24:             96px;
  --space-32:             128px;

  /* Section padding */
  --section-pad-x:        32px;
  --section-pad-y:        100px;
  --section-max-width:    900px;


  /* ─────────────────────────────────────────────────────────────────────
     4. BORDER RADIUS
     ───────────────────────────────────────────────────────────────────── */

  --radius-sm:            6px;
  --radius-md:            10px;
  --radius-lg:            16px;
  --radius-xl:            20px;
  --radius-2xl:           24px;
  --radius-full:          100px;


  /* ─────────────────────────────────────────────────────────────────────
     5. SHADOWS
     ───────────────────────────────────────────────────────────────────── */

  --shadow-xs:            0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm:            0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md:            0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-lg:            0 8px 32px rgba(0, 0, 0, 0.08);
  --shadow-xl:            0 12px 48px rgba(0, 0, 0, 0.12);
  --shadow-glow:          0 0 30px var(--color-primary-glow);


  /* ─────────────────────────────────────────────────────────────────────
     6. ANIMATION & TRANSITIONS
     ───────────────────────────────────────────────────────────────────── */

  /* Easing curves */
  --ease-out:             cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out:          cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring:          cubic-bezier(0.68, -0.55, 0.27, 1.55);
  --ease-bounce:          cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Durations */
  --duration-fast:        150ms;
  --duration-normal:      300ms;
  --duration-slow:        500ms;
  --duration-slower:      800ms;
  --duration-cinematic:   1200ms;

  /* Stagger delay between sequential items */
  --stagger-fast:         50ms;
  --stagger-normal:       80ms;
  --stagger-slow:         120ms;


  /* ─────────────────────────────────────────────────────────────────────
     7. Z-INDEX LAYERS
     ───────────────────────────────────────────────────────────────────── */

  --z-base:               1;
  --z-sticky:             10;
  --z-navbar:             99;
  --z-compact-header:     200;
  --z-overlay:            500;
  --z-modal:              900;
  --z-splash:             9999;
  --z-splash-content:     10000;


  /* ─────────────────────────────────────────────────────────────────────
     8. BREAKPOINTS (reference — used in @media queries)
     ───────────────────────────────────────────────────────────────────── */
  /* 
     Mobile:    < 640px
     Tablet:    640px – 1024px
     Desktop:   > 1024px
     Wide:      > 1440px
  */
}


/* ─────────────────────────────────────────────────────────────────────
   9. RESET & BASE STYLES
   ───────────────────────────────────────────────────────────────────── */

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  color: var(--color-black);
  background: var(--bg-page);
  overflow-x: hidden;
}

img, svg {
  display: block;
  max-width: 100%;
}

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}


/* ─────────────────────────────────────────────────────────────────────
   10. TYPOGRAPHY CLASSES
   ───────────────────────────────────────────────────────────────────── */

.text-display {
  font-family: var(--font-display);
  font-weight: var(--weight-thin);  /* Roboto 100 — elegant, large headlines */
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}

.text-heading {
  font-family: var(--font-body);
  font-weight: var(--weight-regular); /* Roboto 400 */
  line-height: var(--leading-snug);
}

.text-body {
  font-family: var(--font-body);
  font-weight: var(--weight-light);   /* Roboto 300 */
  line-height: var(--leading-relaxed);
  color: rgba(35, 31, 32, 0.7);
}

.text-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-regular); /* Roboto 400 */
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--color-primary);
}

.text-caption {
  font-size: var(--text-sm);
  color: var(--color-grey-60);
}

.text-mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}


/* ─────────────────────────────────────────────────────────────────────
   11. BUTTON SYSTEM
   ───────────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-sm);
  font-weight: var(--weight-regular);
  letter-spacing: var(--tracking-wide);
  border-radius: var(--radius-md);
  transition: all var(--duration-normal) var(--ease-out);
  position: relative;
  overflow: hidden;
}

/* Primary button */
.btn-primary {
  background: var(--color-primary);
  color: var(--color-white);
}
.btn-primary::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left var(--duration-slow);
}
.btn-primary:hover {
  background: var(--color-primary-dark);
}
.btn-primary:hover::before {
  left: 100%;
}
.btn-primary:active {
  transform: scale(0.97);
}

/* Ghost button */
.btn-ghost {
  background: transparent;
  color: var(--color-white);
  border: 1px solid rgba(255,255,255,0.25);
  backdrop-filter: blur(8px);
}
.btn-ghost:hover {
  background: var(--color-white);
  color: var(--color-primary);
  border-color: var(--color-white);
}

/* Outline button */
.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
}
.btn-outline:hover {
  background: var(--color-primary);
  color: var(--color-white);
}

/* Small button */
.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
  border-radius: var(--radius-sm);
}

/* Large button */
.btn-lg {
  padding: var(--space-4) var(--space-10);
  font-size: var(--text-base);
  border-radius: var(--radius-lg);
}


/* ─────────────────────────────────────────────────────────────────────
   12. CARD SYSTEM
   ───────────────────────────────────────────────────────────────────── */

.card {
  background: var(--color-white);
  border: var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  box-shadow: var(--shadow-sm);
  transition: all var(--duration-normal) var(--ease-out);
}
.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-dark {
  background: rgba(255,255,255,0.04);
  border: var(--border-dark);
  backdrop-filter: blur(8px);
}


/* ─────────────────────────────────────────────────────────────────────
   13. TAG / BADGE SYSTEM
   ───────────────────────────────────────────────────────────────────── */

.tag {
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  background: var(--color-primary-ghost);
  color: var(--color-primary);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-regular);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
}

.tag-success {
  background: var(--color-success-ghost);
  color: var(--color-success);
}

.tag-info {
  background: var(--color-info-ghost);
  color: var(--color-info);
}


/* ─────────────────────────────────────────────────────────────────────
   14. ANIMATION UTILITIES
   ───────────────────────────────────────────────────────────────────── */

/* Fade up — default hidden state, add .visible to trigger */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: all var(--duration-slow) var(--ease-out);
}
.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Fade in */
.fade-in {
  opacity: 0;
  transition: opacity var(--duration-slow) ease;
}
.fade-in.visible {
  opacity: 1;
}

/* Scale in */
.scale-in {
  opacity: 0;
  transform: scale(0.9);
  transition: all var(--duration-slow) var(--ease-out);
}
.scale-in.visible {
  opacity: 1;
  transform: scale(1);
}

/* Slide from left */
.slide-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: all var(--duration-slow) var(--ease-out);
}
.slide-left.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Slide from right */
.slide-right {
  opacity: 0;
  transform: translateX(40px);
  transition: all var(--duration-slow) var(--ease-out);
}
.slide-right.visible {
  opacity: 1;
  transform: translateX(0);
}


/* ─────────────────────────────────────────────────────────────────────
   15. LAYOUT UTILITIES
   ───────────────────────────────────────────────────────────────────── */

.container {
  max-width: var(--section-max-width);
  margin: 0 auto;
  padding: 0 var(--section-pad-x);
}

.container-wide {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--section-pad-x);
}

.section-padding {
  padding-top: var(--section-pad-y);
  padding-bottom: var(--section-pad-y);
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.text-center { text-align: center; }

/* Swoosh divider */
.swoosh-divider {
  width: 60px;
  height: 3px;
  background: var(--color-primary);
  border-radius: 2px;
}
.swoosh-divider.center { margin: var(--space-6) auto 0; }


/* ─────────────────────────────────────────────────────────────────────
   16. RESPONSIVE OVERRIDES
   ───────────────────────────────────────────────────────────────────── */

@media (max-width: 1024px) {
  :root {
    --section-pad-x: 24px;
    --section-pad-y: 80px;
  }
}

@media (max-width: 640px) {
  :root {
    --section-pad-x: 16px;
    --section-pad-y: 60px;
    --text-xl:  24px;
    --text-2xl: 28px;
    --text-3xl: 36px;
    --text-4xl: 44px;
    --text-5xl: 56px;
  }
}
