/* ==========================================================================
   mirex.ink - Architektonisches Wohnen
   Unique Premium Design System
   ========================================================================== */

/* ===== CSS Variables & Design Tokens ===== */
:root {
    /* Unique Color Palette - Deep Indigo & Warm Graphite */
    --color-primary: #1a2640;        /* Deep night indigo */
    --color-secondary: #2d3e5f;      /* Midnight blue */
    --color-accent: #3d7872;         /* Nefrite jade */
    --color-warm: #524c48;           /* Warm graphite */
    --color-light: #b8c4d6;          /* Pale blue mist */
    --color-surface: #e8eaf0;        /* Soft lavender grey */
    --color-bg: #f4f5f9;             /* Whisper blue */
    --color-bg-alt: #dfe3eb;         /* Stone blue */
    
    /* Typography Scale */
    --font-display: 'Instrument Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Inter', -apple-system, sans-serif;
    
    /* Fluid Spacing */
    --space-unit: clamp(1rem, 2vw, 1.5rem);
    --gap-xs: calc(var(--space-unit) * 0.5);
    --gap-sm: var(--space-unit);
    --gap-md: calc(var(--space-unit) * 2);
    --gap-lg: calc(var(--space-unit) * 3);
    --gap-xl: calc(var(--space-unit) * 5);
    
    /* Architectural Proportions */
    --ratio-phi: 1.618;
    --border-radius-sm: 4px;
    --border-radius-md: 8px;
    --border-radius-lg: 16px;
    --border-radius-xl: 24px;
}

/* ===== Modern Reset ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: clamp(15px, 1.05vw, 17px);
    line-height: 1.65;
    color: var(--color-primary);
    background: var(--color-bg);
    overflow-x: hidden;
}

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

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

button {
    font-family: inherit;
    cursor: pointer;
}

/* ===== Typography System ===== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 500;
    line-height: 1.15;
    margin: 0;
    letter-spacing: -0.02em;
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 400;
}

h2 {
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 400;
}

h3 {
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    font-weight: 500;
}

p {
    margin: 0 0 1.2em;
    max-width: 65ch;
}

/* ===== Layout Primitives ===== */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 clamp(1.5rem, 4vw, 4rem);
}

.container-narrow {
    max-width: 900px;
}

.container-wide {
    max-width: 1800px;
}

/* ===== Header - Floating Minimal ===== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: clamp(1rem, 2vw, 1.5rem) 0;
    background: transparent;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.site-header.scrolled {
    background: rgba(26, 38, 64, 0.92);
    backdrop-filter: blur(20px) saturate(180%);
    box-shadow: 0 1px 0 rgba(184, 196, 214, 0.1);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-family: var(--font-display);
    font-size: clamp(1.1rem, 1.8vw, 1.4rem);
    font-weight: 300;
    letter-spacing: 0.05em;
    color: var(--color-light);
    display: flex;
    align-items: baseline;
    gap: 0.3em;
    transition: opacity 0.3s ease;
}

.logo:hover {
    opacity: 0.7;
}

.logo-mark {
    font-weight: 600;
}

.main-nav {
    display: flex;
    gap: clamp(1.5rem, 3vw, 2.5rem);
    align-items: center;
}

.main-nav a {
    font-size: clamp(0.9rem, 1vw, 1rem);
    font-weight: 400;
    color: rgba(184, 196, 214, 0.8);
    position: relative;
    padding: 0.5rem 0;
    transition: color 0.3s ease;
    letter-spacing: 0.02em;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--color-light);
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--color-accent);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-nav a:hover::after,
.main-nav a.active::after {
    width: 100%;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    background: none;
    border: none;
    padding: 0.5rem;
}

.nav-toggle span {
    width: 24px;
    height: 1px;
    background: var(--color-light);
    transition: transform 0.3s ease;
}

/* ===== Hero - Architectural Manifesto ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding: calc(var(--gap-xl) + 4rem) 0 var(--gap-xl);
    background: 
        linear-gradient(165deg, 
            var(--color-primary) 0%, 
            #1e3152 35%,
            var(--color-secondary) 70%,
            #273951 100%);
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -20%;
    right: -10%;
    width: 70%;
    height: 140%;
    background: radial-gradient(
        ellipse at center,
        rgba(61, 120, 114, 0.15) 0%,
        transparent 65%
    );
    pointer-events: none;
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(-30px, 50px) rotate(2deg); }
    66% { transform: translate(30px, -30px) rotate(-2deg); }
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -10%;
    left: -5%;
    width: 50%;
    height: 80%;
    background: radial-gradient(
        ellipse at center,
        rgba(184, 196, 214, 0.08) 0%,
        transparent 60%
    );
    pointer-events: none;
}

.hero-inner {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--gap-lg);
}

.hero-content {
    max-width: 1000px;
}

.hero-eyebrow {
    display: inline-block;
    font-size: clamp(0.85rem, 1vw, 0.95rem);
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: var(--gap-md);
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards 0.2s;
}

.hero-title {
    font-size: clamp(3rem, 7vw, 7rem);
    font-weight: 300;
    line-height: 1.05;
    color: var(--color-light);
    margin-bottom: var(--gap-md);
    letter-spacing: -0.03em;
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards 0.4s;
}

.hero-title strong {
    font-weight: 500;
    display: block;
    background: linear-gradient(120deg, var(--color-light), var(--color-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: clamp(1.1rem, 1.8vw, 1.5rem);
    line-height: 1.6;
    color: rgba(184, 196, 214, 0.8);
    max-width: 700px;
    margin-bottom: var(--gap-lg);
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards 0.6s;
}

.hero-actions {
    display: flex;
    gap: var(--gap-sm);
    flex-wrap: wrap;
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards 0.8s;
}

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

.hero-visual {
    margin-top: var(--gap-lg);
    position: relative;
    opacity: 0;
    animation: fadeIn 1.2s ease forwards 1s;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

.hero-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--gap-sm);
}

.hero-stat {
    background: rgba(184, 196, 214, 0.05);
    border: 1px solid rgba(184, 196, 214, 0.1);
    border-radius: var(--border-radius-md);
    padding: var(--gap-md);
    backdrop-filter: blur(10px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-stat:hover {
    background: rgba(184, 196, 214, 0.08);
    border-color: rgba(61, 120, 114, 0.3);
    transform: translateY(-4px);
}

.stat-value {
    font-size: clamp(2rem, 3vw, 2.8rem);
    font-weight: 300;
    color: var(--color-accent);
    display: block;
    margin-bottom: 0.3em;
}

.stat-label {
    font-size: clamp(0.9rem, 1vw, 1rem);
    color: rgba(184, 196, 214, 0.7);
    letter-spacing: 0.02em;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.8em;
    padding: clamp(0.9rem, 1.2vw, 1.1rem) clamp(1.8rem, 2.5vw, 2.5rem);
    border-radius: var(--border-radius-md);
    font-size: clamp(0.95rem, 1vw, 1.05rem);
    font-weight: 500;
    letter-spacing: 0.01em;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--color-accent);
    color: #ffffff;
    box-shadow: 0 4px 20px rgba(61, 120, 114, 0.3);
}

.btn-primary:hover {
    background: #4a8f87;
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(61, 120, 114, 0.4);
}

.btn-ghost {
    background: transparent;
    color: var(--color-light);
    border: 1px solid rgba(184, 196, 214, 0.3);
}

.btn-ghost:hover {
    background: rgba(184, 196, 214, 0.1);
    border-color: var(--color-accent);
}

/* ===== Section - Philosophy ===== */
.section-philosophy {
    padding: var(--gap-xl) 0;
    background: var(--color-bg);
    position: relative;
}

.philosophy-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: var(--gap-xl);
    align-items: center;
}

.philosophy-image {
    position: relative;
    aspect-ratio: 3/4;
    border-radius: var(--border-radius-xl);
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(26, 38, 64, 0.2);
}

.philosophy-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.philosophy-image:hover img {
    transform: scale(1.05);
}

.philosophy-content {
    max-width: 600px;
}

.section-label {
    font-size: clamp(0.85rem, 1vw, 0.95rem);
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: var(--gap-sm);
}

.section-title {
    font-size: clamp(2.2rem, 4vw, 3.5rem);
    font-weight: 300;
    line-height: 1.15;
    color: var(--color-primary);
    margin-bottom: var(--gap-md);
}

.section-text {
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.7;
    color: var(--color-secondary);
    margin-bottom: var(--gap-md);
}

/* ===== Feature Blocks - Non-standard Layout ===== */
.section-features {
    padding: var(--gap-xl) 0;
    background: linear-gradient(180deg, var(--color-bg) 0%, var(--color-surface) 100%);
}

.features-masonry {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--gap-md);
    margin-top: var(--gap-lg);
}

.feature-card {
    background: #ffffff;
    border-radius: var(--border-radius-lg);
    padding: var(--gap-lg);
    border: 1px solid rgba(26, 38, 64, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.feature-card:nth-child(2) {
    transform: translateY(40px);
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 60px rgba(26, 38, 64, 0.12);
    border-color: var(--color-accent);
}

.feature-number {
    font-size: clamp(3rem, 5vw, 4rem);
    font-weight: 200;
    color: rgba(61, 120, 114, 0.2);
    line-height: 1;
    margin-bottom: var(--gap-sm);
}

.feature-title {
    font-size: clamp(1.3rem, 2vw, 1.8rem);
    font-weight: 500;
    color: var(--color-primary);
    margin-bottom: var(--gap-sm);
}

.feature-text {
    font-size: clamp(0.95rem, 1.1vw, 1.05rem);
    line-height: 1.65;
    color: var(--color-secondary);
}

/* ===== Gallery - Architectural ===== */
.section-gallery {
    padding: var(--gap-xl) 0;
    background: var(--color-primary);
    color: var(--color-light);
}

.gallery-header {
    text-align: center;
    margin-bottom: var(--gap-lg);
}

.gallery-header .section-title {
    color: var(--color-light);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--gap-sm);
}

.gallery-item {
    position: relative;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    aspect-ratio: 4/5;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-item:nth-child(1) {
    grid-column: span 5;
}

.gallery-item:nth-child(2) {
    grid-column: span 7;
}

.gallery-item:nth-child(3) {
    grid-column: span 7;
}

.gallery-item:nth-child(4) {
    grid-column: span 5;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.gallery-item:hover {
    transform: scale(0.98);
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(26, 38, 64, 0.85) 0%,
        transparent 60%
    );
    display: flex;
    align-items: flex-end;
    padding: var(--gap-md);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-caption {
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    font-weight: 500;
    color: #ffffff;
}

/* ===== Contact Section - Multi-step Form ===== */
.section-contact {
    padding: var(--gap-xl) 0;
    background: var(--color-bg);
}

.contact-wrapper {
    max-width: 800px;
    margin: 0 auto;
}

.contact-intro {
    text-align: center;
    margin-bottom: var(--gap-lg);
}

.form-progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--gap-lg);
    position: relative;
}

.form-progress::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--color-surface);
    transform: translateY(-50%);
    z-index: 0;
}

.progress-step {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-surface);
    color: var(--color-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

.progress-step.active {
    background: var(--color-accent);
    color: #ffffff;
    box-shadow: 0 4px 20px rgba(61, 120, 114, 0.4);
}

.progress-step.completed {
    background: var(--color-primary);
    color: #ffffff;
}

.multi-step-form {
    background: #ffffff;
    border-radius: var(--border-radius-xl);
    padding: var(--gap-lg);
    box-shadow: 0 20px 60px rgba(26, 38, 64, 0.08);
}

.form-step {
    display: none;
}

.form-step.active {
    display: block;
    animation: fadeInRight 0.4s ease;
}

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

.step-title {
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    font-weight: 400;
    color: var(--color-primary);
    margin-bottom: var(--gap-md);
}

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

.form-label {
    display: block;
    font-size: clamp(0.9rem, 1vw, 1rem);
    font-weight: 500;
    color: var(--color-primary);
    margin-bottom: var(--gap-xs);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: clamp(0.85rem, 1.2vw, 1rem) clamp(1rem, 1.5vw, 1.25rem);
    border: 1px solid rgba(26, 38, 64, 0.15);
    border-radius: var(--border-radius-md);
    font-family: inherit;
    font-size: clamp(0.95rem, 1vw, 1.05rem);
    color: var(--color-primary);
    background: var(--color-bg);
    transition: all 0.3s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(61, 120, 114, 0.1);
    background: #ffffff;
}

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

.form-actions {
    display: flex;
    gap: var(--gap-sm);
    margin-top: var(--gap-md);
}

.btn-secondary {
    background: var(--color-surface);
    color: var(--color-primary);
}

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

/* ===== Footer ===== */
.site-footer {
    background: var(--color-primary);
    color: rgba(184, 196, 214, 0.7);
    padding: var(--gap-xl) 0 var(--gap-md);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: var(--gap-lg);
    padding-bottom: var(--gap-lg);
    border-bottom: 1px solid rgba(184, 196, 214, 0.1);
}

.footer-brand {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 2vw, 1.8rem);
    font-weight: 300;
    color: var(--color-light);
    margin-bottom: var(--gap-sm);
    letter-spacing: 0.05em;
}

.footer-tagline {
    font-size: clamp(0.95rem, 1vw, 1.05rem);
    line-height: 1.6;
    margin-bottom: var(--gap-md);
}

.footer-heading {
    font-size: clamp(0.9rem, 1vw, 1rem);
    font-weight: 500;
    color: var(--color-light);
    margin-bottom: var(--gap-sm);
    letter-spacing: 0.05em;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: var(--gap-xs);
}

.footer-links a {
    font-size: clamp(0.9rem, 1vw, 0.98rem);
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--color-accent);
}

.footer-bottom {
    padding-top: var(--gap-md);
    text-align: center;
    font-size: clamp(0.85rem, 0.95vw, 0.95rem);
}

/* ===== Responsive Design ===== */
@media (max-width: 1024px) {
    .philosophy-grid,
    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--gap-md);
    }
    
    .gallery-item {
        grid-column: span 6 !important;
    }
}

@media (max-width: 768px) {
    .main-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: var(--color-primary);
        flex-direction: column;
        align-items: flex-start;
        padding: 5rem 2rem 2rem;
        gap: 0;
        box-shadow: -10px 0 50px rgba(0, 0, 0, 0.3);
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 999;
    }
    
    .main-nav.is-open {
        right: 0;
    }
    
    .main-nav a {
        padding: 1rem 0;
        width: 100%;
        border-bottom: 1px solid rgba(184, 196, 214, 0.1);
    }
    
    .nav-toggle {
        display: flex;
        z-index: 1001;
    }
    
    .hero {
        min-height: 90vh;
        padding: calc(var(--gap-lg) + 3rem) 0 var(--gap-lg);
    }
    
    .features-masonry {
        grid-template-columns: 1fr;
    }
    
    .feature-card:nth-child(2) {
        transform: translateY(0);
    }
    
    .gallery-item {
        grid-column: span 12 !important;
        aspect-ratio: 16/10;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .hero-actions {
        flex-direction: column;
    }
    
    .hero-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== Utility Classes ===== */
.text-center {
    text-align: center;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ===== Reveal Animation ===== */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.6s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Custom Scrollbar ===== */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--color-accent);
    border-radius: 6px;
    border: 3px solid var(--color-bg);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-secondary);
}

/* ===== Selection ===== */
::selection {
    background: var(--color-accent);
    color: #ffffff;
}

::-moz-selection {
    background: var(--color-accent);
    color: #ffffff;
}

/* ===== Smooth Hover Effects ===== */
.feature-card,
.gallery-item,
.service-card {
    will-change: transform;
}

/* ===== Loading State ===== */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
