/*
 * KASTELAN stylesheet.
 * Plain CSS3, mobile first, brand variables, zero dependency.
 * Art direction: Swiss minimalism, clean lines, generous whitespace.
 */

/* Self-hosted fonts (latin subset, variable weight). Replaces Google Fonts:
   no render-blocking external request and no third-party data transfer. */
@font-face {
    font-family: 'Montserrat';
    src: url('../fonts/montserrat-latin.woff2') format('woff2');
    font-weight: 500 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Roboto';
    src: url('../fonts/roboto-latin.woff2') format('woff2');
    font-weight: 300 500;
    font-style: normal;
    font-display: swap;
}

/* Brand variables */
:root {
    --bg:           #F8F9FA;
    --bg-alt:       #EEF2F5;
    --surface:      #FFFFFF;
    --text:         #2B373D;
    --text-soft:    #455A64;
    --primary:      #007AC3;
    --primary-dark: #0668a6;
    --accent:       #4DD0E1;

    --border:       #DFE4E8;
    --shadow-sm:    0 1px 3px rgba(43, 55, 61, 0.06);
    --shadow-md:    0 8px 24px rgba(43, 55, 61, 0.08);
    --radius:       12px;
    --radius-sm:    8px;

    --container:    1140px;
    --header-h:     68px;

    --font-title:   'Montserrat', system-ui, sans-serif;
    --font-body:    'Roboto', system-ui, -apple-system, sans-serif;
}

/* Reset and base */
*, *::before, *::after { 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-body);
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.65;
    color: var(--text);
    background-color: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3 {
    font-family: var(--font-title);
    color: var(--text);
    line-height: 1.2;
    margin: 0 0 0.5em;
}

p { margin: 0 0 1rem; }

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

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

:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
    border-radius: 2px;
}

.skip-link {
    position: absolute;
    left: -999px;
    top: 0;
    z-index: 1000;
    background: var(--primary);
    color: #fff;
    padding: 0.6rem 1rem;
    border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; color: #fff; }

/* Utilities */
.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: 1.25rem;
}

.accent-text { color: var(--primary); }

.btn {
    display: inline-block;
    font-family: var(--font-title);
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1;
    padding: 0.85rem 1.6rem;
    border-radius: var(--radius-sm);
    border: 2px solid transparent;
    cursor: pointer;
    transition: background-color .2s ease, color .2s ease, transform .15s ease, border-color .2s ease;
}
.btn:hover { transform: translateY(-2px); }

.btn--primary {
    background-color: var(--primary);
    color: #fff;
}
.btn--primary:hover { background-color: var(--primary-dark); color: #fff; }

.btn--ghost {
    background-color: transparent;
    color: var(--text);
    border-color: var(--border);
}
.btn--ghost:hover { border-color: var(--primary); color: var(--primary); }

.btn--block { width: 100%; text-align: center; }

/* Fixed header and navbar */
.site-header {
    position: fixed;
    inset: 0 0 auto 0;
    height: var(--header-h);
    z-index: 100;
    background-color: rgba(248, 249, 250, 0.85);
    backdrop-filter: saturate(180%) blur(10px);
    -webkit-backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid transparent;
    transition: border-color .25s ease, box-shadow .25s ease;
}
.site-header.is-scrolled {
    border-bottom-color: var(--border);
    box-shadow: var(--shadow-sm);
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.logo { display: inline-flex; align-items: center; }
.logo__img { display: block; height: 34px; width: auto; }
.logo__mark {
    font-family: var(--font-title);
    font-weight: 700;
    font-size: 1.35rem;
    letter-spacing: 0.14em;
    color: var(--text);
}
.logo__mark--footer { color: #fff; }

.nav-toggle {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
}
.nav-toggle__bar {
    display: block;
    width: 24px;
    height: 2px;
    margin-inline: auto;
    background-color: var(--text);
    transition: transform .25s ease, opacity .2s ease;
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.primary-nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background-color: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease;
}
.primary-nav.is-open { max-height: 380px; }

.primary-nav ul {
    list-style: none;
    margin: 0;
    padding: 0.5rem 1.25rem 1rem;
}
.nav-link {
    display: block;
    font-family: var(--font-title);
    font-weight: 500;
    color: var(--text);
    padding: 0.75rem 0.25rem;
    border-bottom: 1px solid var(--border);
}
.primary-nav li:last-child .nav-link { border-bottom: none; }
.nav-link:hover,
.nav-link.active { color: var(--primary); }

/* Hero */
.hero {
    padding-top: calc(var(--header-h) + 3.5rem);
    padding-bottom: 4rem;
    background-color: var(--bg);
    background-image:
        radial-gradient(circle at 85% 12%, rgba(77, 208, 225, 0.12), transparent 38%),
        radial-gradient(circle at 8% 88%, rgba(0, 122, 195, 0.08), transparent 40%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='400' viewBox='0 0 1200 400'%3E%3Cg fill='none' stroke='%23007AC3' stroke-opacity='0.10' stroke-width='1.5'%3E%3Cpath d='M0 80 C 300 20 600 140 1200 60'/%3E%3Cpath d='M0 160 C 300 100 600 220 1200 140'/%3E%3Cpath d='M0 240 C 300 180 600 300 1200 220'/%3E%3Cpath d='M0 320 C 300 260 600 380 1200 300'/%3E%3C/g%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center top, center bottom, center bottom;
    background-size: auto, auto, 100% auto;
}

.hero__eyebrow {
    font-family: var(--font-title);
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-size: 0.8rem;
    color: var(--primary);
    margin-bottom: 1rem;
}
.hero__title {
    font-size: clamp(2rem, 6vw, 3.4rem);
    font-weight: 700;
    max-width: 18ch;
    margin-bottom: 1.25rem;
}
.hero__subtitle {
    font-size: clamp(1.05rem, 2.5vw, 1.25rem);
    color: var(--text-soft);
    font-weight: 300;
    max-width: 56ch;
    margin-bottom: 2rem;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 1rem; }

.hero__media { display: none; }
.hero__image { width: 100%; height: auto; }

/* Generic sections */
.section { padding-block: 4rem; }
.section--alt { background-color: var(--bg-alt); }

.section__head {
    max-width: 50rem;
    margin: 0 auto 3rem;
    text-align: center;
}
.section__head--left { margin-inline: 0; text-align: left; }

.section__eyebrow {
    font-family: var(--font-title);
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-size: 0.78rem;
    color: var(--primary);
    margin-bottom: 0.6rem;
}
.section__title {
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    font-weight: 600;
}

/* Philosophy */
.philo-grid { display: grid; gap: 2.5rem; }

.philo-intro { display: grid; gap: 1.5rem; align-content: start; }
.philo-image { display: none; width: 100%; height: auto; }

.philo-lead {
    font-size: 1.2rem;
    color: var(--text-soft);
    font-weight: 300;
    max-width: 60ch;
    margin-inline: auto;
    text-align: center;
}

.values {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 1.5rem;
}
.value {
    padding-left: 1.25rem;
    border-left: 3px solid var(--accent);
}
.value__title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}
.value p { margin: 0; color: var(--text-soft); }

/* Services cards */
.cards {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 1fr;
}

.card {
    position: relative;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem 1.75rem;
    box-shadow: var(--shadow-sm);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: transparent;
}

.card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background-color: rgba(0, 122, 195, 0.08);
    color: var(--primary);
    margin-bottom: 1.1rem;
}
.card__icon svg { width: 26px; height: 26px; }

.card__title { font-size: 1.25rem; font-weight: 600; margin-bottom: 0.5rem; }
.card__text { margin: 0; color: var(--text-soft); font-size: 0.97rem; }
.card__text a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.card__text a:hover { color: var(--primary-dark); }

.card--feature {
    background:
        linear-gradient(180deg, rgba(77, 208, 225, 0.10), rgba(0, 122, 195, 0.05));
    border-color: var(--accent);
}
.card--feature .card__icon {
    background-color: rgba(77, 208, 225, 0.20);
    color: var(--primary-dark);
}
.card__badge {
    position: absolute;
    top: 1.1rem;
    right: 1.1rem;
    font-family: var(--font-title);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--primary-dark);
    background-color: rgba(77, 208, 225, 0.30);
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
}

/* Contact */
.contact-grid { display: grid; gap: 2.5rem; }

.contact-info__text { color: var(--text-soft); max-width: 42ch; }

.contact-address {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-style: normal;
    font-weight: 500;
    color: var(--text);
    margin-top: 1.5rem;
}
.contact-address__icon {
    display: inline-flex;
    color: var(--primary);
    flex-shrink: 0;
}
.contact-address__icon svg { width: 22px; height: 22px; }

.contact-form-wrap {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    box-shadow: var(--shadow-sm);
}

.field { margin-bottom: 1.1rem; }
.field label {
    display: block;
    font-family: var(--font-title);
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
}
.field input,
.field textarea {
    width: 100%;
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--text);
    background-color: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem 0.9rem;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.field textarea { resize: vertical; min-height: 130px; }
.field input:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 122, 195, 0.15);
}

.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.alert {
    border-radius: var(--radius-sm);
    padding: 1rem 1.1rem;
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
}
.alert ul { margin: 0.4rem 0 0; padding-left: 1.2rem; }
.alert p { margin: 0; }
.alert--success {
    background-color: rgba(77, 208, 225, 0.18);
    border: 1px solid var(--accent);
    color: var(--text);
}
.alert--error {
    background-color: #FDECEA;
    border: 1px solid #F1B0B0;
    color: #8A2A2A;
}

/* Footer */
.site-footer {
    background-color: var(--text);
    color: rgba(255, 255, 255, 0.75);
    padding-block: 2.5rem;
}
.site-footer__inner {
    display: grid;
    gap: 1.5rem;
}
.site-footer__brand p { margin: 0.35rem 0 0; font-size: 0.9rem; color: var(--accent); }
.site-footer__legal { margin: 0; font-size: 0.88rem; line-height: 1.7; }

/* Responsive: tablet */
@media (min-width: 768px) {
    .section { padding-block: 5.5rem; }
    .section--waves {
        position: relative;
        padding-bottom: 11rem;
        background-image: url("../images/philosophie-waves.svg");
        background-repeat: no-repeat;
        background-position: center bottom 1.5rem;
        background-size: 100% 240px;
    }
    .philo-image { display: block; }
    .hero { padding-top: calc(var(--header-h) + 5rem); padding-bottom: 6rem; }
    .hero__inner {
        display: grid;
        grid-template-columns: 2fr 1fr;
        align-items: center;
        gap: 2.5rem;
    }
    .hero__media { display: block; }

    .philo-grid {
        grid-template-columns: 1fr 1fr;
        align-items: start;
        gap: 3rem;
    }
    .philo-lead { text-align: left; margin-inline: 0; }
    .values { gap: 1.75rem; }

    .cards { grid-template-columns: repeat(2, 1fr); gap: 1.75rem; }

    .contact-grid { grid-template-columns: 1fr 1.1fr; align-items: start; gap: 3.5rem; }

    .site-footer__inner {
        grid-template-columns: 1fr auto;
        align-items: center;
    }
    .site-footer__legal { text-align: right; }
}

/* Responsive: desktop */
@media (min-width: 1024px) {
    .nav-toggle { display: none; }

    .primary-nav {
        position: static;
        max-height: none;
        overflow: visible;
        background: none;
        border: none;
        box-shadow: none;
    }
    .primary-nav ul {
        display: flex;
        gap: 0.5rem;
        padding: 0;
    }
    .nav-link {
        border-bottom: none;
        padding: 0.5rem 0.9rem;
        border-radius: var(--radius-sm);
    }
    .nav-link.active { background-color: rgba(0, 122, 195, 0.08); }

    .cards { grid-template-columns: repeat(4, 1fr); }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
    }
    .btn:hover, .card:hover { transform: none; }
}
