/* ============================================
   BASE — Reset, Variables & Global Styles
   ============================================ */

:root {
    /* Primary Teal Scale */
    --primary-900: #074b5c;
    --primary-800: #096478;
    --primary-700: #107896;
    --primary-600: #1490b3;
    --primary-500: #1aa8cf;
    --primary-400: #4dbfdb;
    --primary-300: #80d2e7;
    --primary-200: #b3e5f2;
    --primary-100: #d9f2f9;
    --primary-50:  #ecf9fc;

    /* Warm Neutrals */
    --warm-950: #0f0e0d;
    --warm-900: #1c1a18;
    --warm-800: #2e2b28;
    --warm-700: #454240;
    --warm-600: #5c5856;
    --warm-500: #78746f;
    --warm-400: #9a9590;
    --warm-300: #bbb7b2;
    --warm-200: #dcd9d5;
    --warm-100: #eeece9;
    --warm-50:  #f8f7f5;

    /* Accent Colors */
    --accent-yellow:       #ffdd00;
    --accent-yellow-hover: #f0ce00;
    --accent-yellow-light: #f5f2e4;
    --accent-coral:        #d4847a;
    --accent-coral-light:  #f9e8e6;
    --accent-coral-pale:   #fce8e8;
    --accent-coral-pale-2: #f8d4d4;

    /* Gold / amber palette */
    --accent-gold:         #d4a84b;
    --accent-gold-light:   #f5e6c4;
    --accent-gold-pale:    #fdf6e3;
    --accent-gold-pale-2:  #fbefc0;
    --accent-star:         #f59e0b;

    /* Sage / green palette */
    --accent-sage:         #7a9e7a;
    --accent-sage-light:   #e8f2e8;
    --accent-sage-pale:    #d0e4d0;
    --accent-sage-mid:     #6aab6a;

    /* Semantic Colors */
    --text-primary:   var(--warm-900);
    --text-secondary: var(--warm-600);
    --text-tertiary:  var(--warm-500);
    --text-inverse:   var(--warm-50);

    --bg-primary:   var(--warm-50);
    --bg-secondary: var(--warm-100);
    --bg-tertiary:  var(--warm-200);
    --bg-accent:    var(--primary-50);

    --border-light:  var(--warm-200);
    --border-medium: var(--warm-300);

    /* Typography */
    --font-display: 'Fraunces', serif;
    --font-body:    'Plus Jakarta Sans', sans-serif;

    /* Heading size tokens — single source of truth for heading sizes.
       Consumed by theme.json (global defaults) and global-content.css (page scope).
       To change a heading size: update the clamp() here only — both places inherit.
       Clamp values are fluid: min at ~320px viewport, max at ~1200px. */
    --tbr-h1-size: clamp(2rem, 4vw + .5rem, 2.75rem);
    --tbr-h2-size: clamp(1.25rem, 1.5vw + .5rem, 1.625rem);
    --tbr-h3-size: clamp(1.125rem, 1vw + 0.75rem, 1.3125rem);
    --tbr-h4-size: clamp(0.9375rem, 0.5vw + 0.875rem, 1.0625rem);
    --tbr-h5-size: 0.9375rem;
    --tbr-h6-size: 0.8125rem;

    --text-xs:   0.75rem;
    --text-sm:   0.875rem;
    --text-base: 1rem;
    --text-lg:   1.125rem;
    --text-xl:   1.25rem;
    --text-2xl:  1.5rem;
    --text-3xl:  1.875rem;
    --text-4xl:  2.25rem;
    --text-5xl:  3rem;
    --text-6xl:  3.75rem;
    --text-7xl:  4.5rem;

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

    /* Layout */
    --header-height:        68px;
    --container-narrow:     680px;
    --container-default:    1080px;
    --container-wide:       1280px;
    --container-article:    768px;   /* blog post content column: 1fr in (1fr 320px / gap 4rem) inside .container */

    /* Borders & Shadows */
    --radius-sm:   6px;
    --radius-md:   10px;
    --radius-lg:   16px;
    --radius-xl:   24px;
    --radius-full: 9999px;

    --shadow-sm:    0 1px 2px rgba(15, 14, 13, 0.04);
    --shadow-md:    0 4px 12px rgba(15, 14, 13, 0.06);
    --shadow-lg:    0 8px 24px rgba(15, 14, 13, 0.08);
    --shadow-xl:    0 16px 48px rgba(15, 14, 13, 0.1);
    --shadow-hover: 0 8px 24px rgba(15, 14, 13, 0.12);

    /* Transitions */
    --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
    --duration-fast:   150ms;
    --duration-normal: 250ms;
    --duration-slow:   400ms;
}

/* Reset */
*,
*::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-body);
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

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

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

ul {
    list-style: none;
}

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

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

.animate-fade-in-up {
    animation: fadeInUp var(--duration-slow) var(--ease-out) forwards;
    opacity: 0;
}

.animate-delay-1 { animation-delay: 100ms; }
.animate-delay-2 { animation-delay: 200ms; }
.animate-delay-3 { animation-delay: 300ms; }
.animate-delay-4 { animation-delay: 400ms; }

.animate-delay-5 { animation-delay: 500ms; }

/* ── Scroll to top ─────────────────────────────────────────────────────────── */

.tbr-stt {
    position: fixed;
    bottom: 2rem;
    right: 1.5rem;
    z-index: 200;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary-700);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity var(--duration-base, 0.2s) ease,
                transform var(--duration-base, 0.2s) ease,
                background var(--duration-base, 0.2s) ease;
}

.tbr-stt--visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.tbr-stt:hover {
    background: var(--primary-800, #0a5f78);
}

.tbr-stt svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .tbr-stt {
        bottom: 1.25rem;
        right: 1rem;
        width: 40px;
        height: 40px;
    }
    .tbr-stt svg {
        width: 18px;
        height: 18px;
    }
}
