/* =========================================================
   Habiton OÜ — Modern responsive stylesheet
   ========================================================= */

:root {
    --color-dark: #141414;
    --color-dark-90: rgba(20, 20, 20, 0.9);
    --color-dark-70: rgba(20, 20, 20, 0.7);
    --color-accent: #c9a227;      /* warm gold */
    --color-accent-dark: #a9861a;
    --color-text: #2b2b2b;
    --color-muted: #6c6c6c;
    --color-bg: #ffffff;
    --color-bg-alt: #f5f4f1;
    --color-line: #e6e4df;

    --radius: 14px;
    --radius-sm: 10px;
    --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 14px 40px rgba(0, 0, 0, 0.12);

    --header-h: 92px;
    --container: 1200px;

    --font: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

/* ---------- Base ---------- */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-h);
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--font);
    font-weight: 400;
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

h1, h2, h3 {
    line-height: 1.2;
    margin: 0;
    font-weight: 700;
}

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------- Header ---------- */
.site-header {
    position: fixed;
    inset: 0 0 auto 0;
    height: var(--header-h);
    z-index: 1000;
    display: flex;
    align-items: center;
    transition: background-color 0.3s ease, box-shadow 0.3s ease, backdrop-filter 0.3s ease;
}

.site-header.scrolled {
    background: var(--color-dark-90);
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.25);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand-logo {
    height: 68px;
    width: auto;
}

.primary-nav ul {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.primary-nav a {
    display: inline-block;
    padding: 10px 16px;
    color: #fff;
    font-weight: 500;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    border-radius: 999px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.primary-nav a:hover,
.primary-nav a:focus-visible {
    background: rgba(255, 255, 255, 0.14);
    color: var(--color-accent);
}

/* Hamburger */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    width: 46px;
    height: 46px;
    padding: 0;
    background: rgba(0, 0, 0, 0.25);
    border: none;
    border-radius: 12px;
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    margin: 0 auto;
    background: #fff;
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.2s ease;
}

.nav-toggle.open span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
.nav-toggle.open span:nth-child(2) {
    opacity: 0;
}
.nav-toggle.open span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* ---------- Hero ---------- */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    background: url("../img/house.jpg") center / cover no-repeat;
    background-attachment: fixed;
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(20, 20, 20, 0.7) 0%,
        rgba(20, 20, 20, 0.5) 45%,
        rgba(20, 20, 20, 0.75) 100%
    );
}

.hero-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: var(--header-h);
}

.hero-logo {
    width: min(520px, 80vw);
    height: auto;
    margin-bottom: 28px;
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.4));
}

.hero-tagline {
    font-size: clamp(1.05rem, 2.5vw, 1.5rem);
    font-weight: 300;
    letter-spacing: 0.02em;
    max-width: 640px;
    margin: 0 0 36px;
    color: rgba(255, 255, 255, 0.92);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: center;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-block;
    padding: 14px 30px;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.03em;
    border-radius: 999px;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary {
    background: var(--color-accent);
    color: #1c1400;
    box-shadow: 0 10px 26px rgba(201, 162, 39, 0.35);
}
.btn-primary:hover,
.btn-primary:focus-visible {
    background: var(--color-accent-dark);
    transform: translateY(-2px);
}

.btn-ghost {
    background: transparent;
    color: #fff;
    border: 1.5px solid rgba(255, 255, 255, 0.7);
}
.btn-ghost:hover,
.btn-ghost:focus-visible {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
}

/* Scroll cue */
.scroll-cue {
    position: absolute;
    bottom: 26px;
    left: 50%;
    transform: translateX(-50%);
    width: 26px;
    height: 44px;
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-radius: 999px;
    z-index: 2;
}
.scroll-cue span {
    position: absolute;
    top: 8px;
    left: 50%;
    width: 4px;
    height: 8px;
    margin-left: -2px;
    background: #fff;
    border-radius: 4px;
    animation: scroll-bounce 1.8s infinite;
}
@keyframes scroll-bounce {
    0% { opacity: 0; transform: translateY(0); }
    40% { opacity: 1; }
    80%, 100% { opacity: 0; transform: translateY(16px); }
}

/* ---------- Sections ---------- */
.section {
    padding: clamp(64px, 9vw, 120px) 0;
}

.section-alt {
    background: var(--color-bg-alt);
}

.section-head {
    max-width: 760px;
    margin: 0 auto clamp(40px, 6vw, 64px);
    text-align: center;
}

.eyebrow {
    display: inline-block;
    margin-bottom: 14px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--color-accent-dark);
}

.section-head h2 {
    font-size: clamp(1.6rem, 3.6vw, 2.6rem);
    font-weight: 800;
}

/* ---------- About ---------- */
.about-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: clamp(32px, 6vw, 72px);
    align-items: center;
}

.about-text p {
    font-size: 1.08rem;
    color: var(--color-muted);
    margin: 0 0 18px;
}
.about-text strong {
    color: var(--color-text);
}

.stats {
    display: grid;
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.stats li {
    padding: 22px 26px;
    background: var(--color-bg);
    border: 1px solid var(--color-line);
    border-left: 4px solid var(--color-accent);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}

.stat-value {
    display: block;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--color-text);
}
.stat-label {
    color: var(--color-muted);
    font-size: 0.95rem;
}

/* ---------- Services ---------- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 22px;
}

.service-card {
    padding: 30px 28px;
    background: var(--color-bg);
    border: 1px solid var(--color-line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.service-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
    border-color: transparent;
}

.service-card h3 {
    font-size: 1.15rem;
    margin-bottom: 10px;
    color: var(--color-text);
}
.service-card h3::before {
    content: "";
    display: block;
    width: 40px;
    height: 3px;
    margin-bottom: 16px;
    background: var(--color-accent);
    border-radius: 3px;
}
.service-card p {
    margin: 0;
    color: var(--color-muted);
    font-size: 0.98rem;
}

.services-note {
    max-width: 720px;
    margin: clamp(36px, 5vw, 56px) auto 0;
    text-align: center;
    font-style: italic;
    color: var(--color-muted);
}

/* ---------- Contact ---------- */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    max-width: 860px;
    margin: 0 auto;
}

.contact-card {
    padding: 34px 32px;
    background: var(--color-dark);
    color: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}
.contact-card h3 {
    font-size: 1.3rem;
    margin-bottom: 18px;
}
.contact-role {
    margin: 0 0 18px;
    color: rgba(255, 255, 255, 0.7);
}

.contact-meta,
.contact-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 12px;
}
.contact-meta li {
    color: rgba(255, 255, 255, 0.85);
}
.contact-meta span {
    display: inline-block;
    min-width: 120px;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.contact-links a {
    display: inline-flex;
    align-items: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-accent);
    transition: color 0.2s ease;
}
.contact-links a:hover,
.contact-links a:focus-visible {
    color: #fff;
}

/* ---------- Footer ---------- */
.site-footer {
    background: var(--color-dark);
    color: rgba(255, 255, 255, 0.7);
    padding: 40px 0;
}
.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
}
.footer-logo {
    height: 72px;
    width: auto;
    opacity: 0.9;
}
.site-footer p {
    margin: 0;
    font-size: 0.9rem;
}

/* =========================================================
   Responsive — Tablet & Mobile
   ========================================================= */
@media (max-width: 900px) {
    .about-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .site-header {
        background: var(--color-dark-90);
        backdrop-filter: blur(8px);
    }

    .primary-nav {
        position: fixed;
        inset: var(--header-h) 0 auto 0;
        background: var(--color-dark-90);
        backdrop-filter: blur(10px);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.35s ease;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    }
    .primary-nav.open {
        max-height: 340px;
    }
    .primary-nav ul {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 12px 16px 20px;
    }
    .primary-nav a {
        display: block;
        padding: 14px 16px;
        border-radius: 10px;
        font-size: 1.05rem;
    }

    /* Fixed background can be janky on mobile — use scroll */
    .hero {
        background-attachment: scroll;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 18px;
    }

    .hero-actions {
        flex-direction: column;
        width: 100%;
        max-width: 280px;
    }
    .btn {
        width: 100%;
        text-align: center;
    }

    .contact-card {
        padding: 28px 24px;
    }
    .contact-meta span {
        display: block;
        min-width: 0;
        margin-bottom: 2px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    .scroll-cue span {
        animation: none;
    }
    * {
        transition-duration: 0.01ms !important;
    }
}
