/**
 * Jerry's Spare Main Stylesheet
 * Global resets, base typography, elements, and structural utilities
 */

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

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

body {
    font-family: var(--font-primary);
    color: var(--color-gray-900);
    background-color: var(--color-gray-50);
    line-height: 1.6;
    overflow-x: hidden;
}

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

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

button, input, select, textarea {
    font-family: inherit;
    font-size: 100%;
}

ul, ol {
    list-style: none;
}

/* =========================================================================
   TYPOGRAPHY
   ========================================================================= */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary);
    font-weight: var(--font-bold);
    color: var(--color-gray-900);
    line-height: 1.2;
    margin-bottom: var(--space-3);
}

h1 { font-size: clamp(32px, 5vw, 56px); }
h2 { font-size: clamp(28px, 4vw, 40px); }
h3 { font-size: clamp(24px, 3vw, 32px); }
h4 { font-size: 20px; }
h5 { font-size: 18px; }
h6 { font-size: 16px; }

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

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

.container-narrow {
    max-width: var(--container-narrow);
}

.section-padding {
    padding-top: clamp(60px, 8vw, 100px);
    padding-bottom: clamp(60px, 8vw, 100px);
}

/* Flexbox Grids */
.d-flex { display: flex; }
.flex-column { display: flex; flex-direction: column; }
.align-items-center { align-items: center; }
.justify-content-center { justify-content: center; }
.justify-content-between { justify-content: space-between; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }

/* CSS Grid */
.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 992px) {
    .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-cols-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 576px) {
    .grid-cols-2, .grid-cols-3, .grid-cols-4 { grid-template-columns: 1fr; }
}

/* =========================================================================
   COMPONENTS
   ========================================================================= */

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: var(--border-radius-sm);
    font-weight: var(--font-semibold);
    font-size: 16px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    line-height: 1;
}

.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-white);
}
.btn-primary:hover {
    background-color: var(--color-primary-dark);
    color: var(--color-white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: var(--color-secondary);
    color: var(--color-white);
}
.btn-secondary:hover {
    background-color: var(--color-secondary-dark);
    color: var(--color-white);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
}
.btn-outline:hover {
    background-color: var(--color-primary);
    color: var(--color-white);
}

.btn-lg {
    padding: 16px 32px;
    font-size: 18px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

/* Scroll Progress Bar */
.scroll-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    background: var(--color-secondary);
    z-index: 1040;
    width: 0%;
    transition: width 0.1s ease-out;
}

/* Back to top */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--color-primary);
    color: var(--color-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    z-index: var(--z-fixed);
    box-shadow: var(--shadow-lg);
    border: none;
}
.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}
.back-to-top:hover {
    background: var(--color-primary-dark);
    transform: translateY(-5px);
}

/* Text Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-primary { color: var(--color-primary) !important; }
.text-secondary { color: var(--color-secondary) !important; }
.text-muted { color: var(--color-gray-600) !important; }
.text-white { color: var(--color-white) !important; }

/* Display Utilities */
.d-none { display: none !important; }
.d-block { display: block !important; }
@media (max-width: 992px) {
    .d-none-md { display: none !important; }
}
@media (min-width: 993px) {
    .d-none-desktop { display: none !important; }
}
