/* ===========================
   CSS Variables & Base Styles
   =========================== */

:root {
    /* Colors - Warm, light palette */
    --color-bg: #fff6ef;
    --color-surface: #ffffff;
    --color-surface-light: #fff0e4;
    --color-text: #2a1f16;
    --color-text-muted: #6f5f52;
    --color-accent: #ff7a1a;
    --color-accent-secondary: #ff4d5a;
    --color-accent-tertiary: #f2b35e;
    --color-gradient-start: #ff7a1a;
    --color-gradient-end: #ff4d5a;
    --color-glow: rgba(255, 122, 26, 0.22);
    --color-warm: #f2b35e;
    
    /* Typography */
    --font-display: 'Archivo Black', sans-serif;
    --font-body: 'Space Grotesk', sans-serif;
    --font-mono: 'Space Mono', monospace;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 6rem;
    --spacing-xxl: 8rem;
    
    /* Layout */
    --container-width: 1280px;
    --border-radius: 14px;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-text);
    background-color: #f6f0e6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* ===========================
   Animations
   =========================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        height: 0;
    }
    to {
        height: 60px;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

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

.fade-in {
    animation: fadeInUp 0.8s ease-out forwards;
}

.fade-in-delay-1 {
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.2s forwards;
}

.fade-in-delay-2 {
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.4s forwards;
}

.fade-in-delay-3 {
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.6s forwards;
}

/* ===========================
   Hero Section
   =========================== */

.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero-background {
    position: absolute;
    inset: 0;
    background: #f6f0e6;
    z-index: 0;
}

.hero-background::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        repeating-linear-gradient(90deg, rgba(42, 31, 22, 0.04), rgba(42, 31, 22, 0.04) 1px, transparent 1px, transparent 48px);
    opacity: 0.12;
}

.hero-content {
    position: relative;
    z-index: 1;
    padding: var(--spacing-xxl) 0;
}

.hero-text {
    max-width: 980px;
    text-align: left;
    margin: 0;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2.8rem, 7.5vw, 6.5rem);
    line-height: 0.92;
    margin-bottom: var(--spacing-lg);
    font-weight: 700;
    letter-spacing: 0.01em;
}

.hero-title .title-main {
    color: #1b140f;
    text-transform: uppercase;
    font-weight: 600;
    display: inline-block;
    white-space: nowrap;
    margin-left: 0;
}

.title-line {
    display: block;
}

.title-emphasis {
    display: inline-block;
    margin-top: 0.04em;
    padding: 0;
    background: transparent;
    color: #e32119;
    text-transform: uppercase;
    font-style: normal;
    box-shadow: none;
    font-size: clamp(3.6rem, 11vw, 10rem);
    letter-spacing: 0.02em;
}

.hero-subtitle {
    font-size: clamp(1rem, 1.6vw, 1.2rem);
    color: #2a1f16;
    margin-bottom: var(--spacing-lg);
    max-width: 560px;
    font-weight: 500;
}

.hero-cta {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
    justify-content: center;
}

.scroll-indicator {
    position: absolute;
    bottom: var(--spacing-lg);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #2a1f16;
}

.scroll-line {
    width: 1px;
    height: 60px;
    background: linear-gradient(to bottom, #2a1f16, transparent);
    animation: slideDown 1.5s ease-out infinite;
}

/* ===========================
   Buttons
   =========================== */

.btn {
    display: inline-block;
    padding: 1rem 2rem;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    border-radius: 999px;
    box-shadow: 0 18px 30px rgba(255, 122, 26, 0.18);
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--color-gradient-start), var(--color-gradient-end));
    opacity: 0;
    transition: opacity var(--transition-base);
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-gradient-start), var(--color-gradient-end));
    color: white;
}

.btn-primary:hover::before {
    opacity: 0.2;
}

.btn-secondary {
    background: transparent;
    color: var(--color-accent);
    border: 1px solid color-mix(in srgb, var(--color-accent) 70%, transparent);
    backdrop-filter: blur(8px);
}

.btn-secondary:hover {
    background: var(--color-accent);
    color: #ffffff;
}

.hero .btn-primary {
    background: #1b140f;
    color: #ffffff;
}

.hero .btn-primary:hover::before {
    opacity: 0;
}

.hero .btn-secondary {
    border-color: rgba(27, 20, 15, 0.5);
    color: #1b140f;
}

.hero .btn-secondary:hover {
    background: #1b140f;
    color: #ffffff;
}

.btn-full {
    width: 100%;
    justify-content: center;
}

.btn span {
    position: relative;
    z-index: 1;
}

/* ===========================
   Section Styles
   =========================== */

section {
    padding: var(--spacing-sm) 0;
    position: relative;
}

.section-header {
    margin-bottom: var(--spacing-sm);
}

.section-label {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #e32119;
    margin-bottom: var(--spacing-sm);
}

.section-label-line {
    position: relative;
    display: block;
    text-align: center;
    color: #e32119;
    margin-top: var(--spacing-xl);
    background: #f6f0e6;
    padding: 0 var(--spacing-sm);
}

.section-label-line::before,
.section-label-line::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 42%;
    height: 1px;
    background: rgba(27, 20, 15, 0.35);
}

.section-label-line::before {
    left: 0;
}

.section-label-line::after {
    right: 0;
}
.section-title {
    font-family: var(--font-display);
    font-size: clamp(3.6rem, 10vw, 6.8rem);
    font-weight: 700;
    line-height: 0.95;
    text-transform: uppercase;
    letter-spacing: 0.01em;
}

.section-title-wide {
    display: flex;
    justify-content: space-between;
    width: 100%;
    letter-spacing: 0;
    transform: none;
}

.section-title-wide span {
    display: inline-block;
}

.section-divider-label {
    padding: var(--spacing-xs) 0 0;
    background: #f6f0e6;
}

.section-divider-text {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    gap: var(--spacing-md);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #1b140f;
}

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

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

.section-header.align-center .section-label {
    margin-left: auto;
    margin-right: auto;
}

.section-break.align-center .section-break-inner {
    text-align: center;
}

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

.contact-info.align-center .contact-details {
    align-items: center;
}

.section-subtitle {
    color: var(--color-text-muted);
    margin-top: var(--spacing-sm);
    max-width: 640px;
    font-size: 1.05rem;
}

/* ===========================
   Services Categories (Grouped)
   =========================== */

.services {
    background: #f6f0e6;
    border-top: 1px solid rgba(27, 20, 15, 0.35);
    padding-top: var(--spacing-lg);
    padding-bottom: 0;
}

.services::before {
    content: none;
}

.section-title-accent {
    
}

.services-grid-simple {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--spacing-lg);
}

.services-columns {
    align-items: stretch;
}

.services-col {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.services-col-center {
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: stretch;
}

.services-vertical {
    display: flex;
    gap: var(--spacing-xl);
    height: 100%;
}

.services-vertical-word {
    font-family: var(--font-display);
    font-size: clamp(5.6rem, 9vw, 8.2rem);
    font-weight: 700;
    text-transform: uppercase;
    color: #e32119;
    line-height: 0.9;
    writing-mode: vertical-rl;
    text-orientation: upright;
    letter-spacing: 0.2em;

    display: flex;
    align-items: center;
}

.service-tile {
    padding: var(--spacing-md) 0;
}

.service-tile-title {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 500;
    text-transform: uppercase;
    color: #1b140f;
    margin-bottom: var(--spacing-md);
    line-height: 1.1;
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
}

.service-tile-text {
    color: var(--color-text-muted);
    font-size: 1rem;
    line-height: 1.7;
    margin-left: 2em;
}

.service-tile-number {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: #1b140f;
    letter-spacing: 0.04em;
}

.work {
    background: #f6f0e6;
    padding-top: 0;
    margin-top: var(--spacing-md);
}

.services-category {
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing-lg);
    background: #f6f0e6;
    border: 1px solid rgba(27, 20, 15, 0.15);
    position: relative;
    border-radius: var(--border-radius);
    box-shadow: none;
    backdrop-filter: blur(14px);
}

.services-category:last-child {
    margin-bottom: 0;
}

.services-category::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: none;
    opacity: 0;
}

.services-category-header {
    position: relative;
    z-index: 1;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid rgba(27, 20, 15, 0.15);
}

.services-category-title {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #1b140f;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
    position: relative;
    z-index: 1;
}

.service-card {
    padding: var(--spacing-md);
    background: #ffffff;
    border: 1px solid rgba(27, 20, 15, 0.12);
    border-radius: calc(var(--border-radius) + 2px);
    transition: transform var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base);
    box-shadow: none;
}

.service-card:hover {
    transform: translateY(-6px);
    border-color: rgba(227, 33, 25, 0.5);
    box-shadow: 0 8px 20px rgba(27, 20, 15, 0.12);
}

.service-icon {
    font-size: 1.8rem;
    margin-bottom: var(--spacing-sm);
}

.service-title {
    font-family: var(--font-display);
    font-size: 1.4rem;
    margin-bottom: var(--spacing-xs);
    font-weight: 700;
    text-transform: uppercase;
}

.service-description {
    color: var(--color-text-muted);
    line-height: 1.6;
}

/* Set category accent via data attribute */
.services-category {
    --services-accent: var(--color-accent);
}

/* Match these strings exactly to your data/services.yml category values */
.services-category[data-category="Statistical Services"] {
    --services-accent: var(--color-accent-secondary);
}

.services-category[data-category="Data Analytics"] {
    --services-accent: var(--color-accent);
}

.services-category[data-category="Advanced Analytics"] {
    --services-accent: var(--color-accent-tertiary);
}

/* Accent line + subtle glow per category */
.services-category-header::after {
    content: '';
    display: block;
    margin-top: var(--spacing-sm);
    height: 1px;
    background: linear-gradient(90deg, var(--services-accent), transparent);
    opacity: 0.9;
}

/* Make cards inherit category accent */
.services-category .service-card:hover {
    border-left-color: var(--services-accent);
}

.services-category .service-icon {
    color: var(--services-accent);
}

/* ===========================
   Service Skills (Optional)
   =========================== */

.service-skills {
    margin-top: var(--spacing-md);
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
}

.service-skill {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 0.25rem 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid rgba(27, 20, 15, 0.18);
    color: var(--color-text-muted);
    background: transparent;
}

/* Slightly tint chips based on category accent */
.services-category .service-skill {
    border-color: color-mix(in srgb, var(--services-accent) 25%, transparent);
    background: transparent;
    color: #1b140f;
}


/* ===========================
   Work Section
   =========================== */

.work-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
}

.work-item {
    background: #ffffff;
    padding: var(--spacing-lg);
    border: 1px solid rgba(27, 20, 15, 0.12);
    transition: all var(--transition-base);
    position: relative;
    border-radius: var(--border-radius);
    box-shadow: none;
    backdrop-filter: blur(10px);
}

.work-row {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
    gap: var(--spacing-lg);
    align-items: center;
}

.work-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: #e32119;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-base);
}

.work-item:hover::before {
    transform: scaleX(1);
}

.work-item:hover {
    border-color: rgba(27, 20, 15, 0.25);
    transform: translateY(-4px);
}

.work-category {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #e32119;
    display: block;
    margin-bottom: var(--spacing-sm);
}

.work-title {
    font-family: var(--font-display);
    font-size: 1.8rem;
    margin-bottom: var(--spacing-sm);
    font-weight: 700;
    text-transform: uppercase;
}

.work-description {
    color: var(--color-text-muted);
    margin-bottom: var(--spacing-md);
    line-height: 1.7;
}

.work-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-md);
}

.tag {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 0.3rem 0.8rem;
    background: transparent;
    color: #1b140f;
    border: 1px solid rgba(27, 20, 15, 0.18);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.work-link {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: #e32119;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all var(--transition-fast);
    display: inline-block;
}

.work-link:hover {
    color: var(--color-text);
    transform: translateX(4px);
}

.work-media {
    display: flex;
    align-items: center;
    justify-content: center;
}

.work-image-placeholder {
    width: 100%;
    aspect-ratio: 4 / 3;
    border: 1px solid rgba(27, 20, 15, 0.2);
    background:
        linear-gradient(135deg, rgba(27, 20, 15, 0.06), rgba(27, 20, 15, 0.02)),
        repeating-linear-gradient(45deg, transparent 0 12px, rgba(27, 20, 15, 0.06) 12px 24px);
}

/* ===========================
   Publications Section
   =========================== */

.publications {
    background: #f6f0e6;
}

.publications-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.publication-item {
    padding: var(--spacing-lg);
    border-left: 2px solid var(--color-surface-light);
    background: #ffffff;
    border-radius: var(--border-radius);
    box-shadow: none;
    transition: all var(--transition-base);
}

.publication-item:hover {
    border-left-color: var(--color-accent);
    padding-left: calc(var(--spacing-lg) + 8px);
}

.publication-meta {
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
    flex-wrap: wrap;
}

.publication-type,
.publication-date {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.publication-type {
    color: #e32119;
}

.publication-date {
    color: var(--color-text-muted);
}

.publication-title {
    font-family: var(--font-display);
    font-size: 1.6rem;
    margin-bottom: var(--spacing-xs);
    font-weight: 700;
    text-transform: uppercase;
}

.publication-venue {
    color: var(--color-text-muted);
    font-style: italic;
    margin-bottom: var(--spacing-sm);
}

.publication-description {
    color: var(--color-text-muted);
    line-height: 1.7;
    margin-bottom: var(--spacing-sm);
}

.publication-link {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: #e32119;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all var(--transition-fast);
    display: inline-block;
}

.publication-link:hover {
    color: var(--color-text);
    transform: translateX(4px);
}

/* ===========================
   Contact Section
   =========================== */

.contact {
    background: #f6f0e6;
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xl);
}

.contact-description {
    color: var(--color-text-muted);
    margin-bottom: var(--spacing-lg);
    line-height: 1.7;
    max-width: 500px;
    font-size: 1.05rem;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.contact-detail {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.contact-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-muted);
}

.contact-value {
    font-size: 1.2rem;
    color: #e32119;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.contact-value:hover {
    color: var(--color-text);
}

/* ===========================
   Contact Form
   =========================== */

.contact-form {
    background: #ffffff;
    padding: var(--spacing-lg);
    border: 1px solid rgba(27, 20, 15, 0.12);
    border-radius: var(--border-radius);
    box-shadow: none;
    backdrop-filter: blur(12px);
}

.form-group {
    margin-bottom: var(--spacing-md);
}

.form-group label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--spacing-xs);
    color: var(--color-text-muted);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.875rem;
    font-family: var(--font-body);
    font-size: 1rem;
    background: #fffdf9;
    border: 1px solid rgba(27, 20, 15, 0.18);
    color: var(--color-text);
    transition: all var(--transition-base);
    border-radius: 8px;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    background: #ffffff;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* ===========================
   Section-break
   =========================== */


.section-break {
    background: #f6f0e6;
    position: relative;
}

.section-break::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(27, 20, 15, 0.35);
    opacity: 1;
}

.section-break-inner {
    padding: var(--spacing-lg);
    border-radius: var(--border-radius);
    background: #ffffff;
    border: 1px solid rgba(27, 20, 15, 0.12);
    box-shadow: none;
    backdrop-filter: blur(10px);
}


/* ===========================
   Footer
   =========================== */

.footer {
    background: #f6f0e6;
    padding: var(--spacing-lg) 0;
    border-top: 1px solid rgba(27, 20, 15, 0.12);
}

.footer-content {
    text-align: center;
    color: var(--color-text-muted);
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

/* ===========================
   Responsive Design
   =========================== */

@media (max-width: 968px) {
    :root {
        --spacing-lg: 3rem;
        --spacing-xl: 4rem;
        --spacing-xxl: 5rem;
    }
    
    .contact-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .work-grid {
        grid-template-columns: 1fr;
    }

    .work-row {
        grid-template-columns: 1fr;
    }

    .services-grid-simple {
        grid-template-columns: 1fr;
    }

    .services-col-center {
        order: 2;
    }
}

@media (max-width: 640px) {
    .hero-cta {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        text-align: center;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }

    .services-grid-simple {
        grid-template-columns: 1fr;
    }
}
