/* ============================================
   GEEKS IN THE WOODS - GLOBAL DESIGN SYSTEM
   One source of truth for all pages
   ============================================ */

/* ============================================
   1. DESIGN TOKENS
   ============================================ */
:root {
    /* Colors */
    --color-bg: #ffffff;
    --color-text-primary: #333333;
    --color-text-secondary: #666666;
    --color-text-muted: #999999;
    
    /* Accent Colors - Logo-based hierarchy */
    --color-nav-primary: #5A72FF;      /* Blue/purple from logo for navigation */
    --color-nav-primary-hover: #00E6A1; /* Neon green on interaction */
    --color-accent: #00E6A1;           /* Neon green for CTAs/actions */
    --color-accent-hover: #00C48F;     /* Darker green on hover */
    --color-accent-active: #00A375;    /* Even darker for active state */
    
    --color-border: #e5e5e5;
    --color-border-strong: #cccccc;
    --color-focus: #00E6A1;
    --color-pill-bg: rgba(0, 0, 0, 0.04);
    
    /* Button Design Tokens */
    --button-surface-neutral: #fafafa;
    --button-surface-neutral-hover: #333333;
    --button-surface-neutral-active: #222222;
    --button-surface-accent: var(--color-accent);
    --button-surface-accent-hover: var(--color-accent-hover);
    --button-surface-accent-active: var(--color-accent-active);
    --button-label-neutral: var(--color-text-primary);
    --button-label-neutral-hover: #ffffff;
    --button-label-accent: #ffffff;
    --button-border-neutral: var(--color-border-strong);
    --button-border-accent: transparent;
    --button-elevation-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --button-elevation-md: 0 2px 4px rgba(0, 0, 0, 0.08);
    --button-elevation-hover: 0 3px 6px rgba(0, 0, 0, 0.12);
    --button-padding-x: 1.75rem;
    --button-padding-y: 0.875rem;
    --button-radius: 8px;
    --button-min-height: 44px;
    
    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-size-h1: 2rem;        /* 32px */
    --font-size-h2: 1.375rem;    /* 22px */
    --font-size-body: 1.125rem;  /* 18px */
    --font-size-small: 0.875rem; /* 14px */
    --line-height-body: 1.7;
    --line-height-heading: 1.3;
    
    /* Spacing */
    --spacing-section-desktop: 108px;
    --spacing-section-mobile: 84px;
    --spacing-hero-top: 90px;
    --spacing-paragraph: 1.5rem;
    --spacing-heading: 2rem;
    
    /* Layout - Two Layer System */
    --max-width-page: 1120px;    /* Page container */
    --max-width-text: 640px;      /* Text measure */
    
    /* Header */
    --header-height-desktop: 68px;
    --header-height-mobile: 56px;
    --header-padding-x-desktop: 28px;
    --header-padding-x-mobile: 18px;
    
    /* Animation */
    --duration-base: 200ms;
    --duration-reveal: 600ms;
    --easing: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   2. RESET & BASE
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    background: var(--color-bg);
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-body);
    line-height: var(--line-height-body);
    color: var(--color-text-primary);
    background: var(--color-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   3. TYPOGRAPHY - GLOBAL RULES
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 500;
    line-height: var(--line-height-heading);
    color: var(--color-text-primary);
    letter-spacing: -0.02em;
}

h1 {
    font-size: var(--font-size-h1);
    margin-bottom: 1.5rem;
}

h2 {
    font-size: var(--font-size-h2);
    margin-bottom: 1.25rem;
}

p {
    margin-bottom: var(--spacing-paragraph);
    max-width: var(--max-width-text);
    text-align: left;
    color: var(--color-text-secondary);
}

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

strong {
    font-weight: 600;
    color: var(--color-text-primary);
}

small {
    font-size: var(--font-size-small);
    color: var(--color-text-muted);
}

/* ============================================
   4. LINKS - GLOBAL RULES
   ============================================ */
a {
    color: var(--color-accent);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: all var(--duration-base) var(--easing);
}

a:hover {
    color: var(--color-accent-hover);
    text-decoration-thickness: 2px;
}

a:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 3px;
    border-radius: 2px;
}

a:visited {
    color: var(--color-accent);
    opacity: 0.9;
}

/* Navigation links (special case) */
.nav-link {
    color: var(--color-nav-primary);
    text-decoration: none;
    font-size: var(--font-size-small);
    font-weight: 450;
    padding: 6px 8px;
    position: relative;
    transition: all 150ms var(--easing);
}

.nav-link:visited {
    color: var(--color-nav-primary);
}

.nav-link:hover {
    color: var(--color-nav-primary-hover);
}

.nav-link:hover::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 8px;
    right: 8px;
    height: 2px;
    background: var(--color-nav-primary-hover);
}

.nav-link.active {
    color: var(--color-text-primary);
    font-weight: 500;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 8px;
    right: 8px;
    height: 2px;
    background: var(--color-text-primary);
}

/* ============================================
   5. BUTTON SYSTEM - GLOBAL COMPONENT
   ============================================ */

/* Base Button - Shared Foundation */
.btn {
    /* Layout */
    display: inline-block;
    padding: var(--button-padding-y) var(--button-padding-x);
    min-height: var(--button-min-height);
    
    /* Typography */
    font-family: var(--font-family);
    font-size: var(--font-size-small);
    font-weight: 500;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    
    /* Visual */
    border-radius: var(--button-radius);
    cursor: pointer;
    position: relative;
    
    /* Transitions */
    transition: all var(--duration-base) var(--easing);
}

/* Default/Neutral Button Variant */
.btn,
.btn-neutral {
    background: var(--button-surface-neutral);
    color: var(--button-label-neutral);
    border: 1px solid var(--button-border-neutral);
    box-shadow: var(--button-elevation-sm);
}

.btn:hover,
.btn-neutral:hover {
    background: var(--button-surface-neutral-hover);
    color: var(--button-label-neutral-hover);
    border-color: var(--button-surface-neutral-hover);
    box-shadow: var(--button-elevation-hover);
    transform: translateY(-1px);
    text-decoration: none;
}

.btn:active,
.btn-neutral:active {
    background: var(--button-surface-neutral-active);
    box-shadow: var(--button-elevation-sm);
    transform: translateY(0);
}

/* Accent/Primary Button Variant */
.btn-accent,
.btn-primary {
    background: var(--button-surface-accent);
    color: var(--button-label-accent);
    border: 1px solid var(--button-border-accent);
    box-shadow: var(--button-elevation-md);
}

.btn-accent:hover,
.btn-primary:hover {
    background: var(--button-surface-accent-hover);
    color: var(--button-label-accent);
    border-color: var(--button-border-accent);
    box-shadow: var(--button-elevation-hover);
    transform: translateY(-1px);
    text-decoration: none;
}

.btn-accent:active,
.btn-primary:active {
    background: var(--button-surface-accent-active);
    box-shadow: var(--button-elevation-sm);
    transform: translateY(0);
}

/* Fix for visited state on accent buttons */
.btn-accent:visited,
.btn-primary:visited {
    color: var(--button-label-accent);
}

/* Ghost/Quiet Button Variant */
.btn-ghost,
.btn-quiet {
    background: transparent;
    color: var(--color-text-primary);
    border: 1px solid var(--button-border-neutral);
    box-shadow: none;
}

.btn-ghost:hover,
.btn-quiet:hover {
    background: var(--button-surface-neutral);
    color: var(--button-label-neutral);
    border-color: var(--button-border-neutral);
    box-shadow: var(--button-elevation-sm);
    transform: translateY(-1px);
    text-decoration: none;
}

.btn-ghost:active,
.btn-quiet:active {
    background: var(--color-border);
    box-shadow: none;
    transform: translateY(0);
}

/* Focus State - All Variants */
.btn:focus-visible,
.btn-neutral:focus-visible,
.btn-accent:focus-visible,
.btn-primary:focus-visible,
.btn-ghost:focus-visible,
.btn-quiet:focus-visible {
    outline: 3px solid var(--color-focus);
    outline-offset: 2px;
    z-index: 1;
}

/* Disabled State - All Variants */
.btn:disabled,
.btn[aria-disabled="true"] {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Button Group Layout */
.btn-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
    margin: 2rem 0;
}

.btn-group.btn-group-center {
    justify-content: center;
}

.btn-group.btn-group-start {
    justify-content: flex-start;
}

.btn-group.btn-group-end {
    justify-content: flex-end;
}

/* Button within Groups */
.btn-group .btn {
    margin: 0;
}

/* ============================================
   6. LAYOUT COMPONENTS - TWO LAYER SYSTEM
   ============================================ */
/* Page Container - Outer layer */
.container {
    max-width: var(--max-width-page);
    margin: 0 auto;
    padding: 0 var(--header-padding-x-desktop);
}

/* Section Spacing */
.section {
    padding: var(--spacing-section-desktop) 0;
}

/* Text Measure - Inner layer */
.content {
    max-width: var(--max-width-text);
}

/* Centered content variant */
.content-centered {
    max-width: var(--max-width-text);
    margin: 0 auto;
}

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

.text-center p {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

/* ============================================
   7. LISTS - GLOBAL COMPONENT
   ============================================ */
ol, ul {
    max-width: var(--max-width-text);
    padding-left: 2rem;
    margin: 2rem 0;
}

ol li, ul li {
    margin-bottom: 1rem;
    line-height: var(--line-height-body);
    color: var(--color-text-secondary);
}

ol li strong, ul li strong {
    display: inline-block;
    margin-bottom: 0.25rem;
}

/* ============================================
   8. HEADER & NAVIGATION
   ============================================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--color-bg);
    height: var(--header-height-desktop);
    /* Clean header - no borders or shadows */
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--header-height-desktop);
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--color-text-primary);
    font-weight: 500;
    transition: opacity var(--duration-base) ease;
}

.logo:hover {
    opacity: 0.7;
    text-decoration: none;
}

.logo-mark {
    width: 50px;
    height: auto;
    display: block;
    /* Prevent baseline gap */
    vertical-align: middle;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 0;
    margin: 0;
    padding: 0;
    align-items: center;
}

.nav-list li {
    margin: 0;
    display: flex;
    align-items: center;
}

.nav-list li:not(:last-child)::after {
    content: '·';
    color: var(--color-text-muted);
    padding: 0 8px;
    font-size: var(--font-size-small);
}

/* ============================================
   9. MAIN CONTENT
   ============================================ */
main {
    flex: 1;
}

/* Hero Pattern */
.hero {
    text-align: center;
    padding-top: var(--spacing-hero-top);
    padding-bottom: 3rem;
}

.hero-title {
    font-size: var(--font-size-h1);
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--color-text-secondary);
    margin-bottom: 0.5rem;
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

.hero-description {
    font-size: var(--font-size-body);
    color: var(--color-text-muted);
    font-style: italic;
    text-align: center;
    margin: 0 auto;
}

/* Section Header Pattern */
.section-header {
    text-align: center;
    padding-top: var(--spacing-hero-top);
    margin-bottom: 3rem;
}

.section-title {
    font-size: var(--font-size-h2);
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: var(--font-size-body);
    color: var(--color-text-secondary);
    text-align: center;
    margin: 0 auto;
}

/* Content Block Pattern */
.content-block {
    margin-bottom: 3rem;
}

.content-block:last-child {
    margin-bottom: 0;
}

/* ============================================
   10. FOOTER
   ============================================ */
.site-footer {
    background: var(--color-bg);
    border-top: 1px solid var(--color-border);
    padding: 3rem 0;
    text-align: center;
}

.footer-logo {
    width: 96px;
    height: auto;
    opacity: 0.85;
    margin-bottom: 2rem;
    transition: opacity var(--duration-base) ease;
}

.footer-logo:hover {
    opacity: 1;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.footer-links a {
    color: var(--color-nav-primary);
    opacity: 0.7;
    text-decoration: none;
    font-size: var(--font-size-small);
    transition: all 150ms var(--easing);
}

.footer-links a:hover {
    color: var(--color-nav-primary-hover);
    opacity: 1;
}

.footer-text {
    font-size: var(--font-size-small);
    color: var(--color-text-muted);
    text-align: center;
    max-width: none;
    margin: 0 auto;
}

/* ============================================
   11. SPECIAL PATTERNS
   ============================================ */

/* Skip to Content (Accessibility) */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--color-text-primary);
    color: var(--color-bg);
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    border-radius: 0 0 8px 0;
    font-size: var(--font-size-small);
    font-weight: 500;
    z-index: 300;
    transition: left 0.2s ease;
}

.skip-link:focus {
    left: 0;
    outline: 3px solid var(--color-accent);
    outline-offset: 2px;
}

/* Closing Reflection Pattern */
.reflection {
    text-align: center;
    font-style: italic;
    color: var(--color-text-muted);
    padding: 3rem 0;
}

.reflection p {
    text-align: center;
    margin: 0 auto;
}

/* ============================================
   12. ANIMATIONS
   ============================================ */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(10px);
        animation: fadeIn var(--duration-reveal) var(--easing) forwards;
    }
    
    .reveal:nth-child(1) { animation-delay: 0ms; }
    .reveal:nth-child(2) { animation-delay: 100ms; }
    .reveal:nth-child(3) { animation-delay: 200ms; }
    
    @keyframes fadeIn {
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* ============================================
   13. RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    :root {
        --font-size-h1: 1.75rem;
        --font-size-h2: 1.25rem;
        --font-size-body: 1rem;
        --spacing-section-desktop: var(--spacing-section-mobile);
        --spacing-hero-top: 60px;
        --button-padding-x: 1.5rem;
        --button-padding-y: 1rem;
    }
    
    .container {
        padding: 0 var(--header-padding-x-mobile);
    }
    
    .site-header {
        height: auto;
    }
    
    .nav {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem 0;
        height: auto;
    }
    
    .nav-list {
        justify-content: center;
    }
    
    .btn-group {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }
    
    .btn-group .btn {
        width: 100%;
        max-width: none;
    }
    
    .btn {
        width: 100%;
        font-size: 1rem;
        white-space: normal;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 1rem;
    }
    
    .footer-logo {
        width: 84px;
    }
}

/* ============================================
   14. UTILITIES
   ============================================ */
.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;
}

.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }

/* ============================================
   15. ACCESSIBILITY
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

@media (prefers-contrast: high) {
    :root {
        --color-text-primary: #000000;
        --color-text-secondary: #000000;
        --color-border: #000000;
        --color-nav-primary: #0044aa;
        --color-nav-primary-hover: #0066cc;
        --color-accent: #0066cc;
    }
}

/* ============================================
   16. PRINT STYLES
   ============================================ */
@media print {
    .site-header,
    .site-footer,
    .btn-group,
    .nav {
        display: none;
    }
    
    body {
        font-size: 12pt;
        color: black;
    }
    
    a {
        color: black;
        text-decoration: underline;
    }
}