/* 
 * Base CSS Framework
 * Created for Othala Solutions Website 
 * Modern, clean architecture with CSS custom properties
 */

/* ============= CSS Reset ============= */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Remove default margin */
body,
h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

/* Set core root defaults */
html:focus-within {
  scroll-behavior: smooth;
}

/* Set core body defaults */
body {
  min-height: 100vh;
  text-rendering: optimizeSpeed;
  line-height: 1.5;
}

/* Inherit fonts for inputs and buttons */
input,
button,
textarea,
select {
  font: inherit;
}

/* Remove list styles */
ul[role='list'],
ol[role='list'],
ul,
ol {
  list-style: none;
}

/* Make images easier to work with */
img,
picture {
  max-width: 100%;
  display: block;
}

/* ============= CSS Variables ============= */
:root {
  /* Color System */
  --color-primary: #4f46e5;       /* Royal Blue */
  --color-primary-light: #818cf8;
  --color-primary-dark: #3730a3;
  
  --color-secondary: #8b5cf6;     /* Emerald Green */
  --color-secondary-light: #34d399;
  --color-secondary-dark: #059669;
  
  --color-accent: #f43f5e;        /* Amber */
  --color-accent-light: #fbbf24;
  --color-accent-dark: #d97706;
  
  /* Neutral Colors */
  --color-black: #0f172a;         /* Slate 950 */
  --color-dark: #1e293b;          /* Slate 800 */
  --color-gray-dark: #334155;     /* Slate 700 */
  --color-gray: #64748b;          /* Slate 500 */
  --color-gray-light: #94a3b8;    /* Slate 400 */
  --color-light: #e2e8f0;         /* Slate 200 */
  --color-white: #f8fafc;         /* Slate 50 */
  
  /* Semantic Colors */
  --color-success: #8b5cf6;       /* Green */
  --color-warning: #f43f5e;       /* Amber */
  --color-danger: #ef4444;        /* Red */
  --color-info: #3b82f6;          /* Blue */
  
  /* Background Colors */
  --bg-body: #f8fafc;             /* Light mode background */
  --bg-dark: #0f172a;             /* Dark sections */
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.05);
  
  /* Typography */
  --font-primary: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
  
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);     /* 12-14px */
  --text-sm: clamp(0.875rem, 0.8rem + 0.375vw, 1rem);       /* 14-16px */
  --text-base: clamp(1rem, 0.925rem + 0.375vw, 1.125rem);   /* 16-18px */
  --text-lg: clamp(1.125rem, 1rem + 0.625vw, 1.25rem);      /* 18-20px */
  --text-xl: clamp(1.25rem, 1.125rem + 0.625vw, 1.5rem);    /* 20-24px */
  --text-2xl: clamp(1.5rem, 1.3rem + 1vw, 1.875rem);        /* 24-30px */
  --text-3xl: clamp(1.875rem, 1.625rem + 1.25vw, 2.25rem);  /* 30-36px */
  --text-4xl: clamp(2.25rem, 1.875rem + 1.875vw, 3rem);     /* 36-48px */
  --text-5xl: clamp(3rem, 2.5rem + 2.5vw, 4rem);            /* 48-64px */
  --text-6xl: clamp(3.75rem, 3.125rem + 3.125vw, 5rem);     /* 60-80px */
  
  /* Font Weights */
  --font-thin: 100;
  --font-extralight: 200;
  --font-light: 300;
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  --font-extrabold: 800;
  --font-black: 900;
  
  /* Spacing System (rem) */
  --space-1: 0.25rem;   /* 4px */
  --space-2: 0.5rem;    /* 8px */
  --space-3: 0.75rem;   /* 12px */
  --space-4: 1rem;      /* 16px */
  --space-5: 1.25rem;   /* 20px */
  --space-6: 1.5rem;    /* 24px */
  --space-8: 2rem;      /* 32px */
  --space-10: 2.5rem;   /* 40px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */
  --space-20: 5rem;     /* 80px */
  --space-24: 6rem;     /* 96px */
  --space-32: 8rem;     /* 128px */
  --space-40: 10rem;    /* 160px */
  --space-48: 12rem;    /* 192px */
  --space-56: 14rem;    /* 224px */
  --space-64: 16rem;    /* 256px */
  
  /* Border Radius */
  --radius-sm: 0.125rem;    /* 2px */
  --radius: 0.25rem;        /* 4px */
  --radius-md: 0.375rem;    /* 6px */
  --radius-lg: 0.5rem;      /* 8px */
  --radius-xl: 0.75rem;     /* 12px */
  --radius-2xl: 1rem;       /* 16px */
  --radius-3xl: 1.5rem;     /* 24px */
  --radius-full: 9999px;    /* Full rounded */
  
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition: 0.3s ease;
  --transition-slow: 0.5s ease;
  
  /* Container Width */
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1280px;
  --container-2xl: 1536px;
  
  /* Z-index */
  --z-behind: -1;
  --z-normal: 0;
  --z-above: 1;
  --z-dropdown: 10;
  --z-sticky: 50;
  --z-fixed: 100;
  --z-modal: 200;
  --z-popover: 300;
  --z-toast: 500;
  --z-tooltip: 600;
}

/* ============= Base Styles ============= */
body {
  font-family: var(--font-primary);
  font-size: var(--text-base);
  font-weight: var(--font-normal);
  line-height: 1.6;
  color: var(--color-dark);
  background-color: var(--bg-body);
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: var(--transition-fast);
}

a:hover {
  color: var(--color-primary-dark);
}

/* ============= Layout Classes ============= */
.container {
  width: 100%;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
  margin-left: auto;
  margin-right: auto;
}

@media (min-width: 640px) {
  .container {
    max-width: var(--container-sm);
  }
}

@media (min-width: 768px) {
  .container {
    max-width: var(--container-md);
  }
}

@media (min-width: 1024px) {
  .container {
    max-width: var(--container-lg);
  }
}

@media (min-width: 1280px) {
  .container {
    max-width: var(--container-xl);
  }
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

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

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-2 {
  gap: var(--space-2);
}

.gap-4 {
  gap: var(--space-4);
}

.gap-6 {
  gap: var(--space-6);
}

.gap-8 {
  gap: var(--space-8);
}

.grid {
  display: grid;
}

.grid-cols-1 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

.grid-cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 991px) {
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 768px) {
  .md\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  
  .md\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .lg\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  
  .lg\:grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* ============= Spacing Classes ============= */
.mt-2 {
  margin-top: var(--space-2);
}

.mt-4 {
  margin-top: var(--space-4);
}

.mt-8 {
  margin-top: var(--space-8);
}

.mb-2 {
  margin-bottom: var(--space-2);
}

.mb-4 {
  margin-bottom: var(--space-4);
}

.mb-8 {
  margin-bottom: var(--space-8);
}

.py-2 {
  padding-top: var(--space-2);
  padding-bottom: var(--space-2);
}

.py-4 {
  padding-top: var(--space-4);
  padding-bottom: var(--space-4);
}

.py-8 {
  padding-top: var(--space-8);
  padding-bottom: var(--space-8);
}

.px-2 {
  padding-left: var(--space-2);
  padding-right: var(--space-2);
}

.px-4 {
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

.px-8 {
  padding-left: var(--space-8);
  padding-right: var(--space-8);
}

/* ============= Display & Position ============= */
.relative {
  position: relative;
}

.absolute {
  position: absolute;
}

.fixed {
  position: fixed;
}

.sticky {
  position: sticky;
}

.top-0 {
  top: 0;
}

.left-0 {
  left: 0;
}

.right-0 {
  right: 0;
}

.bottom-0 {
  bottom: 0;
}

.z-0 {
  z-index: var(--z-normal);
}

.z-10 {
  z-index: var(--z-dropdown);
}

.z-50 {
  z-index: var(--z-sticky);
}

.hidden {
  display: none;
}

.block {
  display: block;
}

.inline-block {
  display: inline-block;
}

.w-full {
  width: 100%;
}

.h-full {
  height: 100%;
}

.overflow-hidden {
  overflow: hidden;
}

/* ============= Typography Classes ============= */
.text-xs {
  font-size: var(--text-xs);
}

.text-sm {
  font-size: var(--text-sm);
}

.text-base {
  font-size: var(--text-base);
}

.text-lg {
  font-size: var(--text-lg);
}

.text-xl {
  font-size: var(--text-xl);
}

.text-2xl {
  font-size: var(--text-2xl);
}

.text-3xl {
  font-size: var(--text-3xl);
}

.text-4xl {
  font-size: var(--text-4xl);
}

.text-5xl {
  font-size: var(--text-5xl);
}

.font-thin {
  font-weight: var(--font-thin);
}

.font-light {
  font-weight: var(--font-light);
}

.font-normal {
  font-weight: var(--font-normal);
}

.font-medium {
  font-weight: var(--font-medium);
}

.font-semibold {
  font-weight: var(--font-semibold);
}

.font-bold {
  font-weight: var(--font-bold);
}

.font-extrabold {
  font-weight: var(--font-extrabold);
}

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

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

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

.leading-tight {
  line-height: 1.25;
}

.leading-normal {
  line-height: 1.5;
}

.leading-loose {
  line-height: 2;
}

/* ============= Color Classes ============= */
.text-primary {
  color: var(--color-primary);
}

.text-secondary {
  color: var(--color-secondary);
}

.text-accent {
  color: var(--color-accent);
}

.text-white {
  color: var(--color-white);
}

.text-dark {
  color: var(--color-dark);
}

.text-gray {
  color: var(--color-gray);
}

.bg-primary {
  background-color: var(--color-primary);
}

.bg-secondary {
  background-color: var(--color-secondary);
}

.bg-accent {
  background-color: var(--color-accent);
}

.bg-white {
  background-color: var(--color-white);
}

.bg-dark {
  background-color: var(--color-dark);
}

.bg-light {
  background-color: var(--color-light);
}

/* ============= Helper Classes ============= */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.visually-hidden:not(:focus):not(:active) {
  position: absolute;
  width: 1px;
  height: 1px;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

/* ============= Header Styles ============= */
.header.header-scrolled {
    background-color: var(--color-white);
    box-shadow: var(--shadow-md);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.header.header-scrolled .nav-link {
    color: var(--color-dark);
}

.header.header-scrolled .nav-link.active,
.header.header-scrolled .nav-link:hover {
    color: var(--color-primary);
}

.header.header-scrolled .nav-toggle span {
    background: var(--color-dark);
}

/* ============= Footer Styles ============= */
.site-footer {
    background-color: #f8fafc; /* var(--bg-body) */
    color: var(--color-gray-dark);
    padding: var(--space-16) 0 0;
    font-size: var(--text-sm);
    border-top: 1px solid var(--color-light);
}

.footer-top {
    display: grid;
    grid-template-columns: 1.5fr 2fr;
    gap: var(--space-16);
    padding-bottom: var(--space-12);
    border-bottom: 1px solid var(--color-light);
}

.footer-logo {
    max-width: 150px;
    margin-bottom: var(--space-6);
}

.footer-about p {
    max-width: 350px;
    line-height: 1.7;
    margin-bottom: var(--space-8);
    color: var(--color-dark);
}

.footer-socials {
    display: flex;
    gap: var(--space-4);
}

.footer-socials a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: var(--color-light);
    color: var(--color-gray-dark);
    border-radius: 50%;
    transition: var(--transition);
}

.footer-socials a:hover {
    background-color: var(--color-primary);
    color: var(--color-white);
    transform: translateY(-3px);
}

.footer-links-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-8);
}

.footer-links h4 {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--color-dark);
    margin-bottom: var(--space-6);
}

.footer-links ul {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.footer-links a {
    color: var(--color-gray-dark);
    transition: color 0.3s ease, transform 0.3s ease;
}

.footer-links a:hover {
    color: var(--color-primary);
    transform: translateY(-2px);
}

.footer-bottom {
    padding: var(--space-6) 0;
    text-align: center;
    font-size: var(--text-xs);
    color: var(--color-gray);
}

@media (max-width: 1024px) {
    .footer-top {
        grid-template-columns: 1fr;
        gap: var(--space-12);
    }

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

    .footer-about p {
        margin-left: auto;
        margin-right: auto;
    }

    .footer-logo {
        margin-left: auto;
        margin-right: auto;
    }

    .footer-socials {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .footer-links-group {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .footer-links-group {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-links a:hover {
        padding-left: 0;
    }
}

/* ============= Mobile Responsive Styles ============= */
@media (max-width: 991px) {
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .header-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 300px;
        height: 100vh;
        background-color: var(--bg-white);
        flex-direction: column;
        align-items: flex-start;
        padding: 5rem 2rem 2rem;
        transition: right 0.3s ease;
        box-shadow: var(--shadow-lg);
        overflow-y: auto;
        z-index: 1000;
    }

    .header-nav.active {
        right: 0;
    }

    .nav-list {
        flex-direction: column;
        width: 100%;
    }

    .nav-item {
        width: 100%;
    }

    .nav-link {
        display: block;
        padding: 1rem 0;
        color: var(--color-dark) !important;
    }

    .nav-button {
        margin: 1.5rem 0 0;
        width: 100%;
    }

    .nav-button .btn {
        width: 100%;
    }

}

@media (max-width: 768px) {
    /* === Header === */
    .header-container {
        align-items: center;
        padding: 0 1.5rem;
    }

    /* === Grid System === */
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }

    /* === Hero Section === */
    .hero {
        padding: 7rem 1.5rem 4rem 1.5rem;
    }

    .hero .grid,
    .hero-content {
        display: block !important;
        text-align: center !important;
    }

    .hero-title,
    .hero-subtitle,
    .hero-badge,
    .hero-buttons,
    .hero-stats {
        margin-left: auto !important;
        margin-right: auto !important;
        text-align: center !important;
    }

    .hero-title {
        font-size: 2.4rem !important;
        line-height: 1.25;
        word-break: break-word;
    }

    .hero-subtitle {
        font-size: 1.1rem !important;
        max-width: 95%;
        margin-top: 1.5rem;
        margin-bottom: 2.5rem;
        word-break: break-word;
    }

    .hero-buttons {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        width: 100%;
    }

    .hero-buttons .btn {
        width: 100%;
        max-width: 320px;
    }

    .hero-image {
        display: none;
    }

    .hero-badge {
        margin-bottom: 1.5rem;
    }

    .hero-stats {
        display: grid;
        grid-template-columns: 1fr;
        gap: 2rem;
        margin-top: 3rem;
        width: 100%;
        max-width: 320px;
    }

    /* === About Section on Homepage === */
    .about-section-premium .grid {
        display: block !important;
    }

    .about-section-premium .about-content-wrapper {
        text-align: center !important;
    }

    .about-section-premium .about-badge,
    .about-section-premium .about-actions {
        margin-left: auto;
        margin-right: auto;
    }

    .about-image-wrapper {
        display: block !important;
        margin-top: 3rem;
    }

    .about-image-container {
        margin: 0 auto;
        max-width: 400px;
    }

    /* === Enhanced CTA Section === */
    .enhanced-cta-container {
        display: block !important;
        padding: 3rem 1.5rem;
        text-align: center;
    }

    .enhanced-cta-content {
        text-align: center !important;
    }

    .enhanced-cta-buttons {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        margin-top: 2rem;
    }

    .enhanced-cta-visual {
        display: none;
    }

    /* === Card Layouts === */
    .section .grid-3,
    .section .grid-4 {
        grid-template-columns: 1fr !important;
        gap: 2rem;
    }
}
