/* ============================================
   malagovska.design — Style
   Modern Farmhouse / Scandi-Polish aesthetic
   ============================================ */

/* --- Custom Properties --- */
:root {
    --bg: #F7F4EF;
    --text: #1C1C1A;
    --sand: #C9B89A;
    --sage: #8A9E7A;
    --dark: #2A2A27;
    --gold: #B8965A;
    --bg-muted: #EDE8E0;

    --font-serif: 'Cormorant Garamond', Georgia, serif;
    --font-sans: 'DM Sans', system-ui, -apple-system, sans-serif;

    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 2rem;
    --space-lg: 4rem;
    --space-xl: 6rem;
    --space-2xl: 10rem;

    --radius: 4px;
    --transition: 0.3s ease;
}

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

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

body {
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.65;
    color: var(--text);
    background-color: var(--bg);
    overflow-x: hidden;
}

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

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* --- Typography --- */
h1, h2, h3 {
    font-family: var(--font-serif);
    font-weight: 500;
    line-height: 1.15;
}

h1 { font-size: clamp(3rem, 8vw, 6rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.75rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.35rem); }

p {
    max-width: 60ch;
    margin-bottom: 1em;
}
p:last-child { margin-bottom: 0; }

/* --- Layout --- */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

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

/* --- Fade-in Animations --- */
.fade-in {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}
.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Language Toggle --- */
.lang-toggle {
    position: fixed;
    top: var(--space-md);
    right: var(--space-md);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    background: rgba(247, 244, 239, 0.85);
    backdrop-filter: blur(8px);
    padding: 8px 14px;
    border-radius: 20px;
    border: 1px solid rgba(201, 184, 154, 0.3);
}

.lang-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    letter-spacing: inherit;
    color: var(--sand);
    padding: 2px 4px;
    transition: color var(--transition);
}
.lang-btn.active {
    color: var(--text);
}
.lang-btn:hover {
    color: var(--gold);
}
.lang-divider {
    color: var(--sand);
    opacity: 0.5;
}

/* --- Main Navigation --- */
.main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
    padding: var(--space-sm) 0;
    transition: background var(--transition), box-shadow var(--transition);
}
.main-nav.scrolled {
    background: rgba(247, 244, 239, 0.92);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(201, 184, 154, 0.2);
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.02em;
}

.nav-hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    flex-direction: column;
    gap: 5px;
}
.nav-hamburger span {
    display: block;
    width: 22px;
    height: 1.5px;
    background: var(--text);
    transition: transform var(--transition), opacity var(--transition);
}

.nav-links {
    display: flex;
    gap: var(--space-md);
}
.nav-links a {
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: var(--text);
    opacity: 0.7;
    transition: opacity var(--transition);
    position: relative;
}
.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--gold);
    transition: width var(--transition);
}
.nav-links a:hover {
    opacity: 1;
}
.nav-links a:hover::after {
    width: 100%;
}

/* --- Hero --- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    padding: var(--space-xl) var(--space-md);
}

.hero-bg-elements {
    position: absolute;
    inset: 0;
    pointer-events: none;
    color: var(--sage);
}
.hero-branch {
    position: absolute;
    height: 80%;
    top: 10%;
    width: auto;
}
.hero-branch--left { left: 2%; }
.hero-branch--right { right: 2%; }

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-pre {
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--sand);
    margin-bottom: var(--space-md);
}

.hero-title {
    color: var(--text);
    margin-bottom: var(--space-sm);
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-family: var(--font-serif);
    font-size: clamp(1rem, 2.5vw, 1.4rem);
    font-style: italic;
    font-weight: 400;
    color: var(--sage);
    margin-bottom: var(--space-md);
}

.hero-divider {
    display: flex;
    justify-content: center;
}
.hero-divider svg {
    width: 120px;
    height: 20px;
    color: var(--sand);
}

.scroll-indicator {
    position: absolute;
    bottom: var(--space-md);
    left: 50%;
    transform: translateX(-50%);
    animation: float 2.5s ease-in-out infinite;
    color: var(--sand);
    opacity: 0.6;
    transition: opacity var(--transition);
}
.scroll-indicator:hover { opacity: 1; }
.scroll-indicator svg {
    width: 28px;
    height: 28px;
}

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

/* --- Section Label --- */
.section-label {
    margin-bottom: var(--space-md);
}
.section-label span {
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--gold);
    position: relative;
    padding-left: 32px;
}
.section-label span::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 20px;
    height: 1px;
    background: var(--gold);
}

/* --- Section Title --- */
.section-title {
    margin-bottom: var(--space-md);
    color: var(--text);
}

/* --- About --- */
.about-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    grid-template-rows: auto auto;
    gap: var(--space-lg);
    align-items: start;
}
.about-photo {
    grid-row: 1 / 3;
}
.photo-placeholder {
    width: 100%;
    aspect-ratio: 1;
    border-radius: var(--radius);
    overflow: hidden;
}
.photo-placeholder svg {
    width: 100%;
    height: 100%;
}

.about-text p {
    color: rgba(28, 28, 26, 0.8);
    font-size: 1.05rem;
}

.about-stats {
    display: flex;
    gap: var(--space-lg);
}
.stat {
    display: flex;
    flex-direction: column;
}
.stat-number {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--sage);
    line-height: 1;
}
.stat-label {
    font-size: 0.85rem;
    color: rgba(28, 28, 26, 0.6);
    margin-top: 4px;
}

/* --- Botanical Divider --- */
.botanical-divider {
    text-align: center;
    padding: var(--space-sm) 0;
}
.botanical-divider svg {
    width: 100%;
    max-width: 400px;
    height: 40px;
}

/* --- Instagram --- */
.instagram {
    background-color: var(--bg-muted);
    padding: var(--space-xl) 0;
}

.instagram-header {
    text-align: center;
    margin-bottom: var(--space-lg);
}
.instagram-desc {
    color: rgba(28, 28, 26, 0.7);
    max-width: 50ch;
    margin: 0 auto var(--space-md);
    font-size: 1.05rem;
}

.instagram-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: white;
    padding: 8px 20px;
    border-radius: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.badge-count {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--sage);
}
.badge-label {
    font-size: 0.8rem;
    color: rgba(28, 28, 26, 0.6);
}

.instagram-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-xs);
    max-width: 800px;
    margin: 0 auto;
}

.ig-tile {
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: var(--radius);
    transition: transform var(--transition);
}
.ig-tile:hover {
    transform: scale(1.02);
}
.ig-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.ig-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-serif);
    font-size: 1rem;
    font-style: italic;
    color: rgba(28, 28, 26, 0.35);
}

.instagram-cta {
    text-align: center;
    margin-top: var(--space-lg);
}

/* --- Buttons --- */
.btn {
    display: inline-block;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 14px 36px;
    border-radius: 30px;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
}
.btn--primary {
    background: var(--dark);
    color: white;
}
.btn--primary:hover {
    background: var(--text);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(42, 42, 39, 0.2);
}
.btn--accent {
    background: var(--gold);
    color: white;
}
.btn--accent:hover {
    background: #a6843f;
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(184, 150, 90, 0.3);
}

/* --- Book --- */
.book {
    padding: var(--space-xl) 0;
}
.book-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: var(--space-xl);
    align-items: center;
}
.book-placeholder {
    display: flex;
    justify-content: center;
}
.book-placeholder svg {
    width: 100%;
    max-width: 280px;
    filter: drop-shadow(8px 8px 20px rgba(0,0,0,0.1));
}

.book-text .section-title {
    margin-bottom: var(--space-sm);
}
.book-text p {
    color: rgba(28, 28, 26, 0.8);
    font-size: 1.05rem;
}
.book-text .btn {
    margin-top: var(--space-sm);
}
.book-meta {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin: var(--space-xs) 0 var(--space-sm);
}
.book-rating {
    color: var(--gold);
    font-size: 0.9rem;
    font-weight: 500;
}
.book-price {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--sage);
}
.book-note {
    font-size: 0.8rem;
    font-style: italic;
    color: rgba(28, 28, 26, 0.4);
    margin-top: var(--space-xs);
}

/* --- Portfolio --- */
.portfolio {
    background-color: var(--bg-muted);
    padding: var(--space-xl) 0;
}
.portfolio .section-title {
    text-align: center;
}
.portfolio-intro {
    text-align: center;
    color: rgba(28, 28, 26, 0.7);
    max-width: 55ch;
    margin: 0 auto var(--space-lg);
    font-size: 1.05rem;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
}

.portfolio-tile {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition);
}
.portfolio-tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
}

.tile-image {
    aspect-ratio: 16/10;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-color: #E8E2D8;
}
.tile-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    padding: var(--space-sm);
}
.tile-category {
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: white;
    background: rgba(42, 42, 39, 0.6);
    padding: 4px 12px;
    border-radius: 12px;
    backdrop-filter: blur(4px);
}

.tile-title {
    font-family: var(--font-serif);
    padding: var(--space-sm) var(--space-sm) 4px;
    font-weight: 500;
}
.tile-desc {
    font-size: 0.9rem;
    color: rgba(28, 28, 26, 0.6);
    padding: 0 var(--space-sm) var(--space-sm);
}

.portfolio-note {
    text-align: center;
    font-size: 0.85rem;
    font-style: italic;
    color: rgba(28, 28, 26, 0.4);
    margin-top: var(--space-lg);
}

/* --- Contact --- */
.contact {
    padding: var(--space-xl) 0;
    text-align: center;
}
.contact .section-title {
    text-align: center;
}
.contact-intro {
    color: rgba(28, 28, 26, 0.7);
    max-width: 40ch;
    margin: 0 auto var(--space-lg);
    font-size: 1.05rem;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
    max-width: 900px;
    margin: 0 auto;
}
.contact-grid--4 {
    grid-template-columns: repeat(4, 1fr);
    max-width: 1000px;
}

.contact-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: var(--space-md);
    border-radius: var(--radius);
    border: 1px solid rgba(201, 184, 154, 0.3);
    transition: all var(--transition);
    background: white;
}
.contact-card:hover {
    border-color: var(--gold);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}
.contact-card svg {
    width: 32px;
    height: 32px;
    color: var(--sage);
}
.contact-type {
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--gold);
}
.contact-value {
    font-size: 0.9rem;
    color: rgba(28, 28, 26, 0.7);
    word-break: break-all;
}

/* --- Footer --- */
.footer {
    background: var(--dark);
    color: rgba(255,255,255,0.5);
    padding: var(--space-md) 0;
}
.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.footer-copy {
    font-size: 0.8rem;
}
.footer-made {
    font-size: 0.8rem;
    font-family: var(--font-serif);
    font-style: italic;
}

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

@media (max-width: 900px) {
    .about-grid {
        grid-template-columns: 1fr;
    }
    .about-photo {
        grid-row: auto;
        max-width: 220px;
        margin: 0 auto;
    }
    .about-stats {
        justify-content: center;
    }
    .book-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .book-visual {
        order: -1;
    }
    .book-placeholder svg {
        max-width: 200px;
    }
    .book-text p {
        max-width: 100%;
    }
    .portfolio-grid {
        grid-template-columns: 1fr;
    }
    .contact-grid,
    .contact-grid--4 {
        grid-template-columns: repeat(2, 1fr);
        max-width: 500px;
    }
}

@media (max-width: 640px) {
    :root {
        --space-xl: 4rem;
    }

    .hero-branch { display: none; }

    .hero-title {
        font-size: clamp(2.5rem, 12vw, 4rem);
    }

    .nav-hamburger {
        display: flex;
    }
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        max-width: 300px;
        height: 100vh;
        background: var(--bg);
        flex-direction: column;
        padding: 5rem var(--space-md) var(--space-md);
        transition: right 0.4s ease;
        box-shadow: -4px 0 20px rgba(0,0,0,0.1);
    }
    .nav-links.open {
        right: 0;
    }
    .nav-links a {
        font-size: 1rem;
        padding: var(--space-xs) 0;
        opacity: 1;
    }

    .about-stats {
        flex-direction: column;
        gap: var(--space-sm);
        align-items: center;
    }

    .instagram-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-inner {
        flex-direction: column;
        gap: var(--space-xs);
        text-align: center;
    }

    .lang-toggle {
        top: var(--space-sm);
        right: var(--space-sm);
    }
}