/* ============================================================
   base.css — CSS Reset + Custom Properties
   GlowTechy Theme
   ============================================================ */

/* -----------------------------------------------
   1. CSS Custom Properties (Design Tokens)
----------------------------------------------- */
:root {
    /* Colors */
    --color-accent:        #ffd700;
    --color-accent-hover:  #cda500;
    --color-header-bg:     #ffffff;
    --color-nav-bg:        #1a1a1b;
    --color-footer-bg:     #34495e;
    --color-page-bg:       #f5f5f5;
    --color-card-bg:       #ffffff;
    --color-text:          #333333;
    --color-text-muted:    #666666;
    --color-text-light:    #999999;
    --color-link:          #333333;
    --color-link-hover:    #ffd700;
    --color-border:        #e5e5e5;
    --color-white:         #ffffff;
    --color-black:         #000000;
    --color-overlay:       rgba(0, 0, 0, 0.55);
    --color-overlay-hero:  rgba(0, 0, 0, 0.65);
    --color-nav-text:      #e0e0e0;
    --color-nav-hover-bg:  rgba(255, 215, 0, 0.12);

    /* Typography */
    --font-heading:  'Alegreya', Georgia, 'Times New Roman', serif;
    --font-body:     system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-size-base: 15px;
    --line-height-base: 1.7;
    --font-size-sm:   0.875rem;
    --font-size-lg:   1.125rem;
    --font-size-xl:   1.25rem;
    --font-size-2xl:  1.5rem;
    --font-size-3xl:  1.875rem;
    --font-size-4xl:  2.25rem;

    /* Spacing */
    --space-xs:   0.25rem;
    --space-sm:   0.5rem;
    --space-md:   1rem;
    --space-lg:   1.5rem;
    --space-xl:   2rem;
    --space-2xl:  3rem;
    --space-3xl:  4rem;

    /* Layout */
    --container-max:    1200px;
    --container-pad:    1rem;
    --sidebar-width:    300px;
    --border-radius:    4px;
    --border-radius-md: 6px;
    --border-radius-lg: 8px;

    /* Shadows */
    --shadow-sm:   0 1px 3px rgba(0,0,0,0.08);
    --shadow-md:   0 2px 8px rgba(0,0,0,0.12);
    --shadow-lg:   0 4px 20px rgba(0,0,0,0.15);
    --shadow-card: 0 2px 10px rgba(0,0,0,0.08);

    /* Transitions */
    --transition-fast:   0.15s ease;
    --transition-base:   0.25s ease;
    --transition-slow:   0.4s ease;

    /* Z-index layers */
    --z-base:     1;
    --z-dropdown: 100;
    --z-sticky:   200;
    --z-header:   300;
    --z-modal:    400;
    --z-toast:    500;

    /* Section title accent border */
    --section-accent-width: 4px;
    --section-accent-color: #ffd700;
}

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

html {
    font-size: var(--font-size-base);
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--color-text);
    background-color: var(--color-page-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Remove default list styles where needed */
ul, ol {
    list-style: none;
}

/* Improve media defaults */
img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
}

img {
    height: auto;
    border-style: none;
}

/* Inherit fonts for form elements */
input, button, textarea, select {
    font: inherit;
}

/* Remove built-in form typography styles */
button {
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}

/* Improve text rendering */
p, h1, h2, h3, h4, h5, h6 {
    overflow-wrap: break-word;
}

/* Remove text-decoration on anchors by default */
a {
    color: inherit;
    text-decoration: none;
}

/* Accessible focus outline */
:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* Reduce motion for accessibility */
@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;
    }
}

/* -----------------------------------------------
   3. Base Typography
----------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.3;
    color: var(--color-text);
}

h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h2 { font-size: clamp(1.3rem, 2.5vw, 1.75rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.375rem); }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

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

p:last-child {
    margin-bottom: 0;
}

strong, b {
    font-weight: 700;
}

em, i {
    font-style: italic;
}

small {
    font-size: var(--font-size-sm);
}

blockquote {
    border-left: 4px solid var(--color-accent);
    padding: var(--space-md) var(--space-lg);
    margin: var(--space-lg) 0;
    background: #fafafa;
    color: var(--color-text-muted);
    font-style: italic;
}

code, pre {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
    background: #f0f0f0;
    border-radius: var(--border-radius);
}

code {
    padding: 0.125em 0.375em;
}

pre {
    padding: var(--space-md);
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

hr {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: var(--space-xl) 0;
}

/* -----------------------------------------------
   4. Links
----------------------------------------------- */
a {
    color: var(--color-link);
    transition: color var(--transition-fast);
}

a:hover,
a:focus {
    color: var(--color-link-hover);
}

/* -----------------------------------------------
   5. Utility Classes
----------------------------------------------- */
.clearfix::after {
    content: '';
    display: table;
    clear: both;
}

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

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

.hidden { display: none !important; }

/* -----------------------------------------------
   6. Print Reset
----------------------------------------------- */
@media print {
    *, *::before, *::after {
        background: transparent !important;
        color: #000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    a, a:visited { text-decoration: underline; }
    thead { display: table-header-group; }
    tr, img { page-break-inside: avoid; }
    p, h2, h3 { orphans: 3; widows: 3; }
    h2, h3 { page-break-after: avoid; }
}
