/* ============================================
   base.css — Design System: "Editorial Blueprint"
   powerbimvp.com — Jihwan Kim

   Architectural precision meets editorial warmth.
   Signal orange on warm stone. Geometric accents.
   ============================================ */

/* --- Google Fonts Import --- */
@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=IBM+Plex+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700&family=JetBrains+Mono:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=swap');

/* ============================================
   CSS Custom Properties
   ============================================ */
:root {
    /* --- Signal Orange (Primary Accent) --- */
    --accent-700: #c2410c;
    --accent-600: #d4500e;
    --accent-500: #E8590C;
    --accent-400: #f97316;
    --accent-300: #fb923c;
    --accent-200: #fdba74;
    --accent-100: #fed7aa;
    --accent-50:  #fff7ed;

    /* --- Stone (Warm Neutrals) --- */
    --stone-950: #1c1917;
    --stone-900: #292524;
    --stone-800: #44403c;
    --stone-700: #57534e;
    --stone-600: #78716c;
    --stone-500: #a8a29e;
    --stone-400: #c8c1ba;
    --stone-300: #d6d3d1;
    --stone-200: #e7e5e4;
    --stone-100: #f5f5f4;
    --stone-50:  #fafaf9;

    /* --- Slate Blue (Secondary — links, info) --- */
    --blue-700: #1e40af;
    --blue-600: #2563eb;
    --blue-500: #3b82f6;
    --blue-400: #60a5fa;
    --blue-100: #dbeafe;

    /* --- Semantic Colors --- */
    --bg:             #faf9f7;
    --bg-alt:         #f3f1ee;
    --bg-elevated:    #ffffff;
    --bg-code:        #1e1e2e;
    --text-primary:   var(--stone-900);
    --text-secondary: var(--stone-600);
    --text-tertiary:  var(--stone-500);
    --text-inverse:   #fafaf9;
    --border:         var(--stone-200);
    --border-strong:  var(--stone-300);
    --link:           var(--blue-600);
    --link-hover:     var(--blue-700);

    /* --- Tag Colors (per topic) --- */
    --tag-powerbi:    #2563eb;
    --tag-pbir:       #E8590C;
    --tag-dax:        #7c3aed;
    --tag-fabric:     #0891b2;
    --tag-devops:     #16a34a;
    --tag-tmdl:       #ca8a04;
    --tag-default:    var(--stone-600);

    /* --- Typography --- */
    --font-display: 'DM Serif Display', Georgia, serif;
    --font-body:    'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono:    'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;

    --text-xs:   0.75rem;    /* 12px */
    --text-sm:   0.875rem;   /* 14px */
    --text-base: 1rem;       /* 16px */
    --text-lg:   1.125rem;   /* 18px */
    --text-xl:   1.25rem;    /* 20px */
    --text-2xl:  1.5rem;     /* 24px */
    --text-3xl:  1.875rem;   /* 30px */
    --text-4xl:  2.25rem;    /* 36px */
    --text-5xl:  3rem;       /* 48px */

    --leading-tight:  1.25;
    --leading-snug:   1.375;
    --leading-normal: 1.5;
    --leading-relaxed: 1.75;
    --leading-loose:  2;

    --tracking-tight:  -0.025em;
    --tracking-normal: 0;
    --tracking-wide:   0.025em;
    --tracking-wider:  0.05em;

    /* --- Spacing --- */
    --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;

    /* --- Layout --- */
    --content-max:   72rem;   /* 1152px */
    --article-max:   44rem;   /* 704px */
    --nav-height:    4rem;    /* 64px */

    /* --- Borders --- */
    --radius-sm:  4px;
    --radius-md:  8px;
    --radius-lg:  12px;
    --radius-xl:  16px;
    --radius-full: 9999px;

    /* --- Shadows (warm-tinted) --- */
    --shadow-sm:  0 1px 2px rgba(28, 25, 23, 0.05);
    --shadow-md:  0 4px 6px -1px rgba(28, 25, 23, 0.07), 0 2px 4px -2px rgba(28, 25, 23, 0.05);
    --shadow-lg:  0 10px 15px -3px rgba(28, 25, 23, 0.08), 0 4px 6px -4px rgba(28, 25, 23, 0.04);
    --shadow-xl:  0 20px 25px -5px rgba(28, 25, 23, 0.1), 0 8px 10px -6px rgba(28, 25, 23, 0.05);
    --shadow-card: 0 1px 3px rgba(28, 25, 23, 0.06), 0 1px 2px rgba(28, 25, 23, 0.04);
    --shadow-card-hover: 0 10px 30px -8px rgba(28, 25, 23, 0.12), 0 4px 8px rgba(28, 25, 23, 0.04);

    /* --- Transitions --- */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --duration-fast: 150ms;
    --duration-base: 250ms;
    --duration-slow: 400ms;
}

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

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

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: 400;
    line-height: var(--leading-normal);
    color: var(--text-primary);
    background-color: var(--bg);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Subtle warm noise texture on body */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.02'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}

body > * {
    position: relative;
    z-index: 1;
}

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

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

a {
    color: var(--link);
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease-out);
}

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

ul, ol {
    list-style: none;
}

h1, h2, h3, h4, h5, h6 {
    text-wrap: balance;
}

p {
    text-wrap: pretty;
}

/* ============================================
   Typography
   ============================================ */

/* Display headings — DM Serif Display */
.display-xl {
    font-family: var(--font-display);
    font-size: var(--text-5xl);
    font-weight: 400;
    line-height: var(--leading-tight);
    letter-spacing: var(--tracking-tight);
    color: var(--text-primary);
}

.display-lg {
    font-family: var(--font-display);
    font-size: var(--text-4xl);
    font-weight: 400;
    line-height: var(--leading-tight);
    letter-spacing: var(--tracking-tight);
    color: var(--text-primary);
}

.display-md {
    font-family: var(--font-display);
    font-size: var(--text-3xl);
    font-weight: 400;
    line-height: var(--leading-snug);
    color: var(--text-primary);
}

.display-sm {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: 400;
    line-height: var(--leading-snug);
    color: var(--text-primary);
}

/* Body text utilities */
.text-lg {
    font-size: var(--text-lg);
    line-height: var(--leading-relaxed);
}

.text-sm {
    font-size: var(--text-sm);
    line-height: var(--leading-normal);
}

.text-xs {
    font-size: var(--text-xs);
    line-height: var(--leading-normal);
}

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

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

.font-medium {
    font-weight: 500;
}

.font-semibold {
    font-weight: 600;
}

.font-mono {
    font-family: var(--font-mono);
}

/* ============================================
   Material Symbols
   ============================================ */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    vertical-align: middle;
    user-select: none;
}

/* ============================================
   Geometric Accent — "Pipeline Connector" motif
   A sharp 3px left border accent used across cards,
   blockquotes, and active states
   ============================================ */
.accent-border {
    border-left: 3px solid var(--accent-500);
}

.accent-border-top {
    border-top: 3px solid var(--accent-500);
}

/* Accent dot — small signal indicator */
.accent-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-500);
    flex-shrink: 0;
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes progressGrow {
    from { width: 0; }
}

/* Staggered entrance utility */
.animate-in {
    animation: fadeInUp 0.5s var(--ease-out) both;
}

.animate-in:nth-child(1) { animation-delay: 0s; }
.animate-in:nth-child(2) { animation-delay: 0.06s; }
.animate-in:nth-child(3) { animation-delay: 0.12s; }
.animate-in:nth-child(4) { animation-delay: 0.18s; }
.animate-in:nth-child(5) { animation-delay: 0.24s; }
.animate-in:nth-child(6) { animation-delay: 0.30s; }
.animate-in:nth-child(7) { animation-delay: 0.36s; }
.animate-in:nth-child(8) { animation-delay: 0.42s; }

/* ============================================
   Utility 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: 0;
}

.container {
    width: 100%;
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 var(--space-6);
}

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

/* ============================================
   Accessibility
   ============================================ */
:focus-visible {
    outline: 2px solid var(--accent-500);
    outline-offset: 2px;
}

/* Skip link */
.skip-link {
    position: absolute;
    top: -100%;
    left: var(--space-4);
    padding: var(--space-2) var(--space-4);
    background: var(--accent-500);
    color: white;
    font-weight: 600;
    border-radius: var(--radius-md);
    z-index: 10000;
    transition: top var(--duration-fast);
}

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

/* Reduced motion */
@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;
    }
}

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