/* ===========================
   TREEB ARCHITECTURE
   Custom Stylesheet
   =========================== */

/* CSS VARIABLES — Design tokens */
:root {
    --color-deep-charcoal: #1a1a1a;
    --color-warm-beige: #f5f1eb;
    --color-terracotta: #d4816f;

    --font-display: 'Cormorant Garamond', serif;
    --font-mono: 'IBM Plex Mono', monospace;

    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* TAILWIND THEME EXTENSION */
@layer base {
    body {
        font-family: var(--font-mono);
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* ===========================
   TYPOGRAPHY SYSTEM
   =========================== */

.display-text {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -0.02em;
}

.body-text {
    font-family: var(--font-display);
    font-weight: 400;
    letter-spacing: -0.01em;
}

.mono-text {
    font-family: var(--font-mono);
    font-weight: 400;
    letter-spacing: 0.01em;
}

.logo-text {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.03em;
}

/* ===========================
   BACKGROUND & DEPTH
   =========================== */

.bg-warmBeige {
    background-color: var(--color-warm-beige);
    background-image:
        radial-gradient(circle at 20% 50%, rgba(212, 129, 111, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(26, 26, 26, 0.02) 0%, transparent 50%);
}

.bg-deepCharcoal {
    background-color: var(--color-deep-charcoal);
    background-image:
        radial-gradient(circle at 30% 20%, rgba(212, 129, 111, 0.08) 0%, transparent 50%);
}

.text-deepCharcoal {
    color: var(--color-deep-charcoal);
}

.text-warmBeige {
    color: var(--color-warm-beige);
}

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

/* ===========================
   NAVIGATION
   =========================== */

.nav-blur {
    background: rgba(245, 241, 235, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(26, 26, 26, 0.08);
    animation: navFadeIn 0.6s var(--ease-smooth);
}

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

.nav-link {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--color-deep-charcoal);
    opacity: 0.6;
    transition: opacity 0.3s var(--ease-smooth), color 0.3s var(--ease-smooth);
    position: relative;
}

.nav-link:hover {
    opacity: 1;
    color: var(--color-terracotta);
}

.nav-link.active {
    opacity: 1;
    color: var(--color-terracotta);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--color-terracotta);
}

/* ===========================
   HERO & PAGE HEADERS
   =========================== */

.hero-section {
    animation: heroReveal 1.2s var(--ease-smooth);
}

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

.hero-title {
    animation: titleSlideUp 1s var(--ease-smooth) 0.2s backwards;
}

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

.hero-subtitle {
    animation: subtitleFadeIn 1s var(--ease-smooth) 0.4s backwards;
}

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

.page-header {
    animation: pageHeaderReveal 0.9s var(--ease-smooth);
}

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

/* ===========================
   BUTTONS & INTERACTIONS
   =========================== */

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 18px 36px;
    background: var(--color-deep-charcoal);
    color: var(--color-warm-beige);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-radius: 0;
    border: 1px solid var(--color-deep-charcoal);
    transition: all 0.4s var(--ease-smooth);
    position: relative;
    overflow: hidden;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: var(--color-terracotta);
    transition: width 0.4s var(--ease-smooth);
    z-index: 0;
}

.cta-button:hover::before {
    width: 100%;
}

.cta-button:hover {
    border-color: var(--color-terracotta);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(26, 26, 26, 0.15);
}

.cta-button * {
    position: relative;
    z-index: 1;
}

.cta-button .arrow {
    transition: transform 0.4s var(--ease-smooth);
}

.cta-button:hover .arrow {
    transform: translateX(6px);
}

.cta-button-alt {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 18px 36px;
    background: transparent;
    color: var(--color-deep-charcoal);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border: 1px solid var(--color-deep-charcoal);
    transition: all 0.4s var(--ease-smooth);
}

.cta-button-alt:hover {
    background: var(--color-deep-charcoal);
    color: var(--color-warm-beige);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(26, 26, 26, 0.15);
}

.cta-button-alt .arrow {
    transition: transform 0.4s var(--ease-smooth);
}

.cta-button-alt:hover .arrow {
    transform: translateX(6px);
}

/* ===========================
   SECTIONS & CONTENT BLOCKS
   =========================== */

.philosophy-section {
    animation: sectionFadeIn 0.8s var(--ease-smooth);
}

.featured-section {
    animation: sectionFadeIn 0.8s var(--ease-smooth);
}

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

.section-title {
    animation: titleReveal 0.8s var(--ease-smooth);
}

@keyframes titleReveal {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.section-content {
    animation: contentReveal 0.8s var(--ease-smooth) 0.2s backwards;
}

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

.stats-grid .stat-item {
    animation: statPop 0.6s var(--ease-bounce);
}

.stats-grid .stat-item:nth-child(1) {
    animation-delay: 0.3s;
    opacity: 0;
    animation-fill-mode: forwards;
}

.stats-grid .stat-item:nth-child(2) {
    animation-delay: 0.45s;
    opacity: 0;
    animation-fill-mode: forwards;
}

.stats-grid .stat-item:nth-child(3) {
    animation-delay: 0.6s;
    opacity: 0;
    animation-fill-mode: forwards;
}

@keyframes statPop {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ===========================
   PROJECT CARDS
   =========================== */

.project-card {
    transition: all 0.5s var(--ease-smooth);
    position: relative;
}

.project-card:hover {
    transform: translateY(-8px);
}

.project-image {
    transition: transform 0.6s var(--ease-smooth);
    position: relative;
    overflow: hidden;
}

.project-card:hover .project-image {
    transform: scale(1.03);
}

.project-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(26, 26, 26, 0.3) 100%);
    opacity: 0;
    transition: opacity 0.5s var(--ease-smooth);
}

.project-card:hover .project-image::after {
    opacity: 1;
}

.project-info {
    transition: transform 0.5s var(--ease-smooth);
}

.project-card:hover .project-info {
    transform: translateX(8px);
}

.project-detail-card {
    animation: projectDetailReveal 0.8s var(--ease-smooth);
}

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

/* ===========================
   VALUE & TEAM CARDS
   =========================== */

.value-card {
    animation: cardReveal 0.7s var(--ease-smooth);
    transition: transform 0.4s var(--ease-smooth);
}

.value-card:nth-child(1) {
    animation-delay: 0.1s;
    opacity: 0;
    animation-fill-mode: forwards;
}

.value-card:nth-child(2) {
    animation-delay: 0.2s;
    opacity: 0;
    animation-fill-mode: forwards;
}

.value-card:nth-child(3) {
    animation-delay: 0.3s;
    opacity: 0;
    animation-fill-mode: forwards;
}

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

.value-card:hover {
    transform: translateY(-6px);
}

.team-member {
    transition: transform 0.4s var(--ease-smooth);
}

.team-member:hover {
    transform: translateY(-8px);
}

.award-item {
    transition: all 0.3s var(--ease-smooth);
}

.award-item:hover {
    padding-left: 16px;
    border-color: var(--color-terracotta) !important;
}

/* ===========================
   FORM ELEMENTS
   =========================== */

.contact-form {
    animation: formReveal 0.8s var(--ease-smooth) 0.2s backwards;
}

@keyframes formReveal {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.form-input {
    width: 100%;
    padding: 16px 0;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(26, 26, 26, 0.2);
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--color-deep-charcoal);
    transition: border-color 0.3s var(--ease-smooth);
    outline: none;
}

.form-input:focus {
    border-bottom-color: var(--color-terracotta);
}

.form-input::placeholder {
    color: rgba(26, 26, 26, 0.3);
    font-family: var(--font-mono);
}

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

select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%231a1a1a' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0 center;
    padding-right: 24px;
    cursor: pointer;
}

/* ===========================
   FOOTER
   =========================== */

.footer-link {
    font-family: var(--font-mono);
    color: var(--color-warm-beige);
    opacity: 0.7;
    transition: all 0.3s var(--ease-smooth);
    display: inline-block;
}

.footer-link:hover {
    opacity: 1;
    color: var(--color-terracotta);
    transform: translateX(4px);
}

/* ===========================
   RESPONSIVE ADJUSTMENTS
   =========================== */

@media (max-width: 1024px) {
    .hero-title {
        font-size: 5rem;
    }

    .display-text {
        font-size: clamp(2rem, 5vw, 4rem);
    }

    .grid.grid-cols-12 > * {
        grid-column: span 12;
    }

    .grid.grid-cols-3 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 3.5rem;
    }

    .nav-links {
        gap: 2rem;
    }

    .cta-button,
    .cta-button-alt {
        width: 100%;
        justify-content: center;
    }
}

/* ===========================
   UTILITY CLASSES
   =========================== */

.grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.03;
    z-index: 9999;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' /%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' /%3E%3C/svg%3E");
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Selection styling */
::selection {
    background: var(--color-terracotta);
    color: var(--color-warm-beige);
}

::-moz-selection {
    background: var(--color-terracotta);
    color: var(--color-warm-beige);
}
