/*
 * BASE STYLES - Horizon Labs
 * This file contains all structural styles and default CSS variables.
 * Theme files override the :root variables to change the look.
 */

/* ==========================================
   CSS CUSTOM PROPERTIES (Design Tokens)
   ========================================== */
:root {
    /* Colors - Primary */
    --color-primary: #2563eb;
    --color-primary-light: #3b82f6;
    --color-primary-dark: #1d4ed8;

    /* Colors - Accent */
    --color-accent: #f59e0b;
    --color-accent-light: #fbbf24;
    --color-accent-dark: #d97706;

    /* Colors - Background */
    --color-bg: #ffffff;
    --color-bg-alt: #f8fafc;
    --color-bg-elevated: #ffffff;

    /* Colors - Text */
    --color-text: #1e293b;
    --color-text-muted: #64748b;
    --color-text-inverse: #ffffff;

    /* Colors - Border & Dividers */
    --color-border: #e2e8f0;
    --color-border-strong: #cbd5e1;

    /* Typography - Font Families */
    --font-display: 'Instrument Serif', Georgia, serif;
    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'Space Mono', monospace;

    /* Typography - Sizes */
    --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: 2rem;
    --text-4xl: 2.5rem;
    --text-5xl: 3.5rem;
    --text-6xl: 4.5rem;

    /* Typography - Line Heights */
    --leading-tight: 1.1;
    --leading-snug: 1.25;
    --leading-normal: 1.5;
    --leading-relaxed: 1.75;

    /* Typography - Letter Spacing */
    --tracking-tight: -0.02em;
    --tracking-normal: 0;
    --tracking-wide: 0.05em;
    --tracking-wider: 0.1em;

    /* 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;
    --space-4xl: 6rem;
    --space-5xl: 8rem;

    /* Layout */
    --max-width: 1200px;
    --content-width: 800px;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;

    /* Hero Shapes */
    --shape-1-bg: var(--color-primary);
    --shape-2-bg: var(--color-accent);
    --shape-3-bg: var(--color-primary-light);

    /* Component Specific */
    --nav-height: 80px;
    --card-bg: var(--color-bg-elevated);
    --card-border: var(--color-border);
    --card-shadow: var(--shadow-md);
    --btn-radius: var(--radius-md);
    --input-radius: var(--radius-md);

    /* Section Label */
    --label-color: var(--color-primary);
    --label-tracking: var(--tracking-wider);
}

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

html {
    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: var(--leading-normal);
    color: var(--color-text);
    background-color: var(--color-bg);
}

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

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

ul, ol {
    list-style: none;
}

/* ==========================================
   TYPOGRAPHY
   ========================================== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 400;
    line-height: var(--leading-tight);
    letter-spacing: var(--tracking-tight);
}

.section-label {
    display: block;
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: var(--label-tracking);
    color: var(--label-color);
    margin-bottom: var(--space-md);
}

.section-title {
    font-size: var(--text-4xl);
    margin-bottom: var(--space-xl);
}

/* ==========================================
   LAYOUT
   ========================================== */
.page-wrapper {
    overflow-x: hidden;
}

section {
    padding: var(--space-5xl) var(--space-xl);
}

@media (max-width: 768px) {
    section {
        padding: var(--space-3xl) var(--space-lg);
    }

    .section-title {
        font-size: var(--text-3xl);
    }
}

/* ==========================================
   NAVIGATION
   ========================================== */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-xl);
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    z-index: 1000;
    transition: background var(--transition-base), border-color var(--transition-base);
}

.nav__logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-family: var(--font-display);
    font-size: var(--text-xl);
}

.nav__logo-mark {
    color: var(--color-primary);
    font-size: var(--text-2xl);
}

.nav__links {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
}

.nav__links a {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text-muted);
    transition: color var(--transition-fast);
}

.nav__links a:hover {
    color: var(--color-text);
}

.nav__cta {
    padding: var(--space-sm) var(--space-lg);
    background: var(--color-primary);
    color: var(--color-text-inverse) !important;
    border-radius: var(--btn-radius);
    transition: background var(--transition-fast), transform var(--transition-fast) !important;
}

.nav__cta:hover {
    background: var(--color-primary-dark);
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    .nav__links {
        display: none;
    }
}

/* ==========================================
   BUTTONS
   ========================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-md) var(--space-xl);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: 600;
    border-radius: var(--btn-radius);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn--primary {
    background: var(--color-primary);
    color: var(--color-text-inverse);
}

.btn--primary:hover {
    background: var(--color-primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn--secondary {
    background: transparent;
    color: var(--color-text);
    border-color: var(--color-border-strong);
}

.btn--secondary:hover {
    border-color: var(--color-text);
    background: var(--color-bg-alt);
}

/* ==========================================
   HERO
   ========================================== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: calc(var(--nav-height) + var(--space-4xl)) var(--space-xl) var(--space-4xl);
    background: var(--color-bg);
    overflow: hidden;
}

.hero__content {
    position: relative;
    z-index: 2;
    max-width: var(--content-width);
}

.hero__eyebrow {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
    color: var(--color-primary);
    margin-bottom: var(--space-lg);
}

.hero__title {
    font-size: var(--text-6xl);
    margin-bottom: var(--space-xl);
}

.hero__title em {
    font-style: italic;
    color: var(--color-primary);
}

.hero__subtitle {
    font-size: var(--text-lg);
    color: var(--color-text-muted);
    max-width: 540px;
    margin-bottom: var(--space-2xl);
    line-height: var(--leading-relaxed);
}

.hero__actions {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
}

/* Hero Visual Shapes */
.hero__visual {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 50%;
    pointer-events: none;
}

.hero__shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.15;
    animation: float 6s ease-in-out infinite;
}

.hero__shape--1 {
    width: 400px;
    height: 400px;
    background: var(--shape-1-bg);
    top: 15%;
    right: 5%;
    animation-delay: 0s;
}

.hero__shape--2 {
    width: 250px;
    height: 250px;
    background: var(--shape-2-bg);
    top: 50%;
    right: 25%;
    animation-delay: -2s;
}

.hero__shape--3 {
    width: 180px;
    height: 180px;
    background: var(--shape-3-bg);
    top: 30%;
    right: 35%;
    animation-delay: -4s;
}

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

@media (max-width: 768px) {
    .hero {
        min-height: auto;
        padding-bottom: var(--space-3xl);
    }

    .hero__title {
        font-size: var(--text-4xl);
    }

    .hero__visual {
        display: none;
    }
}

/* ==========================================
   ABOUT SECTION
   ========================================== */
.about {
    background: var(--color-bg-alt);
}

.about__content {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: var(--space-4xl);
    max-width: var(--max-width);
    margin: 0 auto;
}

.about__lead {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    line-height: var(--leading-snug);
    margin-bottom: var(--space-lg);
}

.about__text p {
    color: var(--color-text-muted);
    line-height: var(--leading-relaxed);
}

.about__stats {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

.stat {
    opacity: 0;
    transform: translateX(20px);
    transition: all var(--transition-slow);
}

.stat.is-visible {
    opacity: 1;
    transform: translateX(0);
}

.stat__number {
    display: block;
    font-family: var(--font-display);
    font-size: var(--text-5xl);
    color: var(--color-primary);
    line-height: 1;
}

.stat__label {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
}

@media (max-width: 768px) {
    .about__content {
        grid-template-columns: 1fr;
        gap: var(--space-2xl);
    }

    .about__stats {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .stat {
        flex: 1;
        min-width: 120px;
    }

    .stat__number {
        font-size: var(--text-3xl);
    }
}

/* ==========================================
   SERVICES SECTION
   ========================================== */
.services {
    max-width: var(--max-width);
    margin: 0 auto;
}

.services__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--space-xl);
}

.service-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
    transition: all var(--transition-base);
    opacity: 0;
    transform: translateY(20px);
}

.service-card.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.service-card:hover {
    border-color: var(--color-primary);
    box-shadow: var(--card-shadow);
    transform: translateY(-4px);
}

.service-card__icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg-alt);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-lg);
    color: var(--color-primary);
}

.service-card__icon svg {
    width: 24px;
    height: 24px;
}

.service-card__title {
    font-size: var(--text-xl);
    margin-bottom: var(--space-sm);
}

.service-card__desc {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    line-height: var(--leading-relaxed);
}

/* ==========================================
   WORK SECTION
   ========================================== */
.work {
    background: var(--color-bg-alt);
    max-width: var(--max-width);
    margin: 0 auto;
}

.work__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-xl);
}

.project-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--card-border);
    transition: all var(--transition-base);
    opacity: 0;
    transform: translateY(20px);
}

.project-card.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.project-card:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-8px);
}

.project-card--featured {
    grid-column: span 2;
    grid-row: span 2;
}

.project-card__image {
    aspect-ratio: 16/10;
    background: var(--color-bg-alt);
    overflow: hidden;
}

.project-card--featured .project-card__image {
    aspect-ratio: 16/12;
}

.project-card__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: var(--color-text-inverse);
    font-family: var(--font-display);
    font-size: var(--text-4xl);
    opacity: 0.9;
}

.project-card--featured .project-card__placeholder {
    font-size: var(--text-6xl);
}

.project-card__content {
    padding: var(--space-xl);
}

.project-card__category {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    color: var(--color-primary);
    margin-bottom: var(--space-sm);
}

.project-card__title {
    font-size: var(--text-xl);
    margin-bottom: var(--space-sm);
}

.project-card--featured .project-card__title {
    font-size: var(--text-2xl);
}

.project-card__desc {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    line-height: var(--leading-relaxed);
}

@media (max-width: 1024px) {
    .work__grid {
        grid-template-columns: 1fr;
    }

    .project-card--featured {
        grid-column: span 1;
        grid-row: span 1;
    }
}

/* ==========================================
   TESTIMONIAL SECTION
   ========================================== */
.testimonial {
    background: var(--color-primary);
    color: var(--color-text-inverse);
    text-align: center;
    padding: var(--space-5xl) var(--space-xl);
}

.testimonial__quote {
    max-width: var(--content-width);
    margin: 0 auto;
}

.testimonial__quote p {
    font-family: var(--font-display);
    font-size: var(--text-3xl);
    font-style: italic;
    line-height: var(--leading-snug);
    margin-bottom: var(--space-2xl);
}

.testimonial__author {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.testimonial__author strong {
    font-weight: 600;
}

.testimonial__author span {
    opacity: 0.8;
    font-size: var(--text-sm);
}

@media (max-width: 768px) {
    .testimonial__quote p {
        font-size: var(--text-xl);
    }
}

/* ==========================================
   CONTACT SECTION
   ========================================== */
.contact {
    text-align: center;
}

.contact__content {
    max-width: var(--content-width);
    margin: 0 auto;
}

.contact__text {
    font-size: var(--text-lg);
    color: var(--color-text-muted);
    margin-bottom: var(--space-xl);
}

.contact__email {
    display: inline-block;
    font-family: var(--font-display);
    font-size: var(--text-3xl);
    color: var(--color-primary);
    border-bottom: 2px solid transparent;
    transition: border-color var(--transition-fast);
    margin-bottom: var(--space-2xl);
}

.contact__email:hover {
    border-color: var(--color-primary);
}

.contact__social {
    display: flex;
    justify-content: center;
    gap: var(--space-lg);
}

.contact__social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: var(--color-bg-alt);
    color: var(--color-text-muted);
    transition: all var(--transition-fast);
}

.contact__social a:hover {
    background: var(--color-primary);
    color: var(--color-text-inverse);
    transform: translateY(-2px);
}

/* ==========================================
   FOOTER
   ========================================== */
.footer {
    background: var(--color-bg-alt);
    padding: var(--space-2xl) var(--space-xl);
    border-top: 1px solid var(--color-border);
}

.footer__content {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer__brand {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-family: var(--font-display);
    font-size: var(--text-lg);
}

.footer__copyright {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

@media (max-width: 768px) {
    .footer__content {
        flex-direction: column;
        gap: var(--space-md);
        text-align: center;
    }
}

/* ==========================================
   ANIMATION UTILITIES
   ========================================== */
.about__text {
    opacity: 0;
    transform: translateY(20px);
    transition: all var(--transition-slow);
}

.about__text.is-visible {
    opacity: 1;
    transform: translateY(0);
}