/* ========================================
   NOW2CODE — Design System & Base Styles
   LIGHT PREMIUM THEME
   ======================================== */

/* === CSS Custom Properties (Design Tokens) === */
:root {
    /* Backgrounds — clean light layers */
    --color-bg-primary:     #ffffff;
    --color-bg-secondary:   #f7f7f9;
    --color-bg-tertiary:    #eef0f5;
    --color-bg-elevated:    #ffffff;
    --color-border:         rgba(15, 23, 42, 0.08);
    --color-border-hover:   rgba(15, 23, 42, 0.16);

    /* Surface colors for cards */
    --color-surface:        #ffffff;
    --color-surface-hover:  #fafafc;

    /* Accent — Indigo system (kept, but light variants tuned for readability on white) */
    --color-accent:         #6366f1;
    --color-accent-light:   #4f46e5;   /* used on white as text — needs to be darker than base */
    --color-accent-lighter: #a5b4fc;
    --color-accent-dark:    #3730a3;
    --color-accent-glow:    rgba(99, 102, 241, 0.08);
    --color-accent-glow-strong: rgba(99, 102, 241, 0.18);

    /* Secondary accent (for gradients) */
    --color-accent2:        #06b6d4;
    --color-accent2-glow:   rgba(6, 182, 212, 0.10);

    /* Gradient */
    --gradient-accent:      linear-gradient(135deg, #6366f1, #06b6d4);
    --gradient-accent-text: linear-gradient(135deg, #4f46e5, #0891b2);
    --gradient-glow:        linear-gradient(135deg, rgba(99,102,241,0.18), rgba(6,182,212,0.18));

    /* Text */
    --color-text-primary:   #0a0b14;
    --color-text-secondary: #4b5563;
    --color-text-tertiary:  #9ca3af;

    /* Typography */
    --font-heading: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-body:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    --text-display:   clamp(2.5rem, 5vw + 1rem, 4.5rem);
    --text-h1:        clamp(2rem, 3.5vw + 0.5rem, 3.25rem);
    --text-h2:        clamp(1.75rem, 2.5vw + 0.5rem, 2.5rem);
    --text-h3:        clamp(1.25rem, 1.5vw + 0.25rem, 1.5rem);
    --text-h4:        clamp(1.0625rem, 1.2vw + 0.25rem, 1.25rem);
    --text-body:      clamp(0.9375rem, 0.8vw + 0.25rem, 1.0625rem);
    --text-small:     clamp(0.8125rem, 0.7vw + 0.2rem, 0.9375rem);
    --text-caption:   0.75rem;

    --leading-tight:   1.2;
    --leading-normal:  1.6;
    --leading-relaxed: 1.8;

    /* Spacing (8px grid) */
    --space-1:  0.25rem;
    --space-2:  0.5rem;
    --space-3:  0.75rem;
    --space-4:  1rem;
    --space-5:  1.25rem;
    --space-6:  1.5rem;
    --space-8:  2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;
    --space-32: 8rem;

    --section-padding: clamp(4rem, 8vw, 7rem);
    --container-max: 1200px;
    --container-padding: clamp(1.25rem, 4vw, 3rem);

    /* Borders & Radius */
    --radius-sm:  6px;
    --radius-md:  10px;
    --radius-lg:  14px;
    --radius-xl:  20px;
    --radius-2xl: 24px;
    --radius-full: 9999px;

    /* Shadows — softer for light theme */
    --shadow-sm:  0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md:  0 4px 16px rgba(15, 23, 42, 0.06);
    --shadow-lg:  0 12px 32px rgba(15, 23, 42, 0.08);
    --shadow-xl:  0 24px 56px rgba(15, 23, 42, 0.10);
    --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.18);
    --shadow-glow-lg: 0 0 60px rgba(99, 102, 241, 0.12), 0 0 120px rgba(6, 182, 212, 0.06);

    /* Transitions */
    --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
    --duration-fast:   0.2s;
    --duration-normal: 0.4s;
    --duration-slow:   0.8s;

    /* Z-Index Scale */
    --z-base:      1;
    --z-dropdown:  100;
    --z-sticky:    200;
    --z-overlay:   300;
    --z-modal:     400;
    --z-cursor:    500;
    --z-preloader: 1000;
}


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

html {
    scroll-behavior: auto;
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-body);
    font-weight: 400;
    line-height: var(--leading-normal);
    color: var(--color-text-primary);
    background-color: var(--color-bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

body.is-loading {
    overflow: hidden;
}

body.menu-open {
    overflow: hidden;
}

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

img {
    height: auto;
}

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

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

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

ul,
ol {
    list-style: none;
}

address {
    font-style: normal;
}

input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px var(--color-bg-secondary) inset;
    -webkit-text-fill-color: var(--color-text-primary);
}


/* === Typography === */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: var(--leading-tight);
    color: var(--color-text-primary);
    letter-spacing: -0.02em;
}

h1 { font-size: var(--text-h1); }
h2 { font-size: var(--text-h2); }
h3 { font-size: var(--text-h3); }
h4 { font-size: var(--text-h4); }

p {
    color: var(--color-text-secondary);
    line-height: var(--leading-normal);
}

/* Gradient text utility */
.text-gradient {
    background: var(--gradient-accent-text);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.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;
}


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

.section {
    padding-top: var(--section-padding);
    padding-bottom: var(--section-padding);
    position: relative;
}

.section--compact {
    padding-top: calc(var(--section-padding) * 0.5);
    padding-bottom: calc(var(--section-padding) * 0.5);
}

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


/* === Section Headers === */
.section-label {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    font-family: var(--font-body);
    font-size: var(--text-caption);
    font-weight: 600;
    color: var(--color-accent-light);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: var(--space-4);
}

.section-label::before {
    content: '';
    display: block;
    width: 24px;
    height: 2px;
    background: var(--gradient-accent);
    border-radius: var(--radius-full);
}

.section-title {
    font-size: var(--text-h2);
    font-weight: 700;
    margin-bottom: var(--space-4);
    max-width: 600px;
}

.section-subtitle {
    font-size: var(--text-body);
    color: var(--color-text-secondary);
    max-width: 520px;
    line-height: var(--leading-relaxed);
}

.section-header {
    margin-bottom: var(--space-12);
}

.section-header--center {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.section-header--center .section-label::before {
    display: none;
}

.section-header--split {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--space-8);
    flex-wrap: wrap;
}


/* === Skip Link (Accessibility) === */
.skip-link {
    position: absolute;
    top: -100%;
    left: var(--space-4);
    padding: var(--space-3) var(--space-6);
    background: var(--color-accent);
    color: #fff;
    font-weight: 600;
    border-radius: var(--radius-sm);
    z-index: calc(var(--z-preloader) + 1);
    transition: top 0.3s;
}

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


/* === Selection === */
::selection {
    background: var(--color-accent);
    color: #fff;
}

::-moz-selection {
    background: var(--color-accent);
    color: #fff;
}


/* === Scrollbar === */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--color-border-hover);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-accent);
}
