/* ============================================================
   Inter marK Systems V.B. — Main Stylesheet
   Font: Segoe UI | Design: Clean, editorial, minimal-precise
   ============================================================ */

:root {
    --color-bg: #ffffff;
    --color-text: #1a1a1a;
    --color-text-muted: #6b6b6b;
    --color-accent: #FC6D00;
    --color-accent-hover: #d95c00;
    --color-border: #e5e5e5;
    --color-card-bg: #ffffff;
    --color-tag: #6b6b6b;
    --color-footer-bg: #ffffff;

    --font: 'Segoe UI', 'Segoe UI Variable', system-ui, -apple-system, sans-serif;

    --nav-h: 52px;
    --max-w: 1160px;
    --radius: 12px;
    --radius-sm: 6px;

    --shadow-card: 0 1px 3px rgba(0,0,0,0.07), 0 4px 16px rgba(0,0,0,0.05);
    --shadow-card-hover: 0 4px 20px rgba(0,0,0,0.12);

    --transition: 0.2s ease;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ── Layout ── */
.container {
    width: 100%;
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 24px;
}

/* ── NAV ── */
.site-header {
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--color-border);
    border-radius: 14px;
    height: var(--nav-h);
    width: calc(100% - 48px);
    max-width: var(--max-w);
    box-shadow: inset 0 -1px 0 rgba(0,0,0,0.06), 0 2px 12px rgba(0,0,0,0.08);
}

/* Body padding to avoid content hidden under floating nav */
body { padding-top: calc(var(--nav-h) + 20px); }

.navbar {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.nav-logo .logo-mark {
    font-size: 23px;
    letter-spacing: -0.5px;
    color: var(--color-text);
    font-family: 'major mono display';
    padding: 2px 6px;
    line-height: 1;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
    flex: 1;
}

.nav-links a {
    font-size: 14px;
    font-weight: 400;
    color: var(--color-text);
    padding-bottom: 2px;
    transition: color var(--transition);
    white-space: nowrap;
}

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

.nav-links a.active {
    color: var(--color-accent);
    border-bottom: 1.5px solid var(--color-accent);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    margin-left: auto;
}
.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--color-text);
    border-radius: 2px;
    transition: var(--transition);
}

/* ── HERO / PAGE HEADER ── */
.page-header {
    padding: 56px 0 40px;
}
.page-header .label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin-bottom: 12px;
}
.page-header h1 {
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 400;
    line-height: 1.15;
    letter-spacing: -0.5px;
}
.page-header h1 em {
    color: var(--color-accent);
    font-style: normal;
}
.page-header .subtitle {
    margin-top: 10px;
    font-size: 15px;
    color: var(--color-text-muted);
}

/* ── SECTION TITLES ── */
.section-head {
    margin-bottom: 28px;
}
.section-head h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
}
.section-head p {
    font-size: 14px;
    color: var(--color-text-muted);
}

/* ── CARDS GRID — 2 col ── */
.cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 60px;
}

/* ── SERVICE CARD ── */
.service-card {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--color-card-bg);
    display: grid;
    grid-template-columns: 1fr 1fr;
    box-shadow: var(--shadow-card);
    transition: box-shadow var(--transition);
}
.service-card:hover { box-shadow: var(--shadow-card-hover); }

.service-card-content {
    padding: 28px 28px 24px;
    display: flex;
    flex-direction: column;
}

.service-card .tag {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-tag);
    margin-bottom: 0px;
}

.service-card h3 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 12px;
    letter-spacing: -0.2px;
}

.service-card .descriz {
    font-size: 13.5px;
    line-height: 1.65;
    color: var(--color-text-muted);
    flex: 1;
}

.card-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text);
    border: none;
    padding: 0;
    transition: color var(--transition);
    cursor: pointer;
    background: none;
}
.card-link span { font-size: 12px; color: var(--color-text-muted); }
.card-link .arrow-btn {
    width: 28px;
    height: 28px;
    margin-left: 10px;
    border-radius: 10%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: background var(--transition), border-color var(--transition);
}
.card-link:hover .arrow-btn {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: white;
}

.service-card-image {
    position: relative;
    overflow: hidden;
    min-height: 220px;
    background: #f0f0f0;
}
.service-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.service-card-image .img-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #2d2d6e 50%, #1a1a3e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 220px;
}

/* ── BAILOR CARD (right side, image top) ── */
.bailor-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--color-card-bg);
    box-shadow: var(--shadow-card);
    transition: box-shadow var(--transition);
}
.bailor-card:hover { box-shadow: var(--shadow-card-hover); }

.bailor-card-image {
    height: 200px;
    overflow: hidden;
    background: #1a2e1a;
}
.bailor-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.bailor-card-image .img-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0d1f0d 0%, #1a3a1a 50%, #0d2a0d 100%);
    min-height: 200px;
}
.bailor-card-content {
    padding: 24px 28px 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ── CORE VALUES SECTION ── */
.corevalues-section {
    margin-bottom: 60px;
}

.corevalue-card {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 280px;
    box-shadow: var(--shadow-card);
}
.corevalue-card:last-child { margin-bottom: 0; }
.corevalue-card.dark {
    background: #1a1a2e;
    color: white;
    border-color: #2d2d4e;
}
.corevalue-card.dark .tag { color: rgba(255,255,255,0.5); }
.corevalue-card.dark .descriz { color: rgba(255,255,255,0.7); }

.corevalue-content {
    padding: 40px 44px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.corevalue-content .tag {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-tag);
    margin-bottom: 10px;
}
.corevalue-content h3 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 16px;
    letter-spacing: -0.3px;
}
.corevalue-content .descriz {
    font-size: 14px;
    line-height: 1.7;
    color: var(--color-text-muted);
    max-width: 420px;
}

.corevalue-image {
    overflow: hidden;
    position: relative;
}
.corevalue-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.corevalue-image .img-placeholder {
    width: 100%;
    height: 100%;
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cv-placeholder-light {
    background: linear-gradient(135deg, #e8edf5 0%, #d0d8ea 100%);
}
.cv-placeholder-pencil {
    background: linear-gradient(135deg, #f5f0e8 0%, #e8dfc8 100%);
}
.cv-placeholder-dark {
    background: linear-gradient(135deg, #0d0d2e 0%, #1a1a50 50%, #2d1a50 100%);
}

/* ── SECTION DIVIDER ── */
.section-block {
    padding: 60px 0;
    border-top: 1px solid var(--color-border);
}
.section-block:first-of-type { border-top: none; padding-top: 0; }

/* ── PROGETTI PAGE ── */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 60px;
}

.project-card {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--color-card-bg);
    box-shadow: var(--shadow-card);
    transition: box-shadow var(--transition);
    display: flex;
    flex-direction: column;
}
.project-card:hover { box-shadow: var(--shadow-card-hover); }

.project-card-image {
    height: 200px;
    overflow: hidden;
    background: #d0d0d0;
}
.project-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.project-card-image .img-placeholder {
    width: 100%;
    height: 200px;
    background: #c8c8c8;
}

.project-card-content {
    padding: 18px 20px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.project-card-content .tag {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-tag);
    margin-bottom: 6px;
}
.project-card-content h3 {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 6px;
}
.project-card-content .date {
    font-size: 13px;
    color: var(--color-text-muted);
    margin-bottom: auto;
}
.project-card-content .card-link {
    margin-top: 16px;
}

/* ── PROJECT DETAIL PAGE ── */
.project-detail {
    padding-bottom: 80px;
}
.project-hero {
    width: 100%;
    max-height: 460px;
    overflow: hidden;
    border-radius: var(--radius);
    margin-bottom: 40px;
    background: linear-gradient(135deg, #e8edf5 0%, #ccd6ea 100%);
}
.project-hero img {
    width: 100%;
    height: 460px;
    object-fit: cover;
}
.project-hero .img-placeholder {
    width: 100%;
    height: 460px;
    background: linear-gradient(135deg, #dce5f5 0%, #c4d0ea 60%, #dce8f0 100%);
}

.project-meta {
    margin-bottom: 32px;
}
.project-meta .tag {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin-bottom: 8px;
}
.project-meta h1 {
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 400;
    letter-spacing: -0.5px;
    margin-bottom: 6px;
}
.project-meta .date {
    font-size: 14px;
    color: var(--color-text-muted);
}

.project-descriz h2 {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 12px;
}
.project-descriz p {
    font-size: 15px;
    line-height: 1.75;
    color: var(--color-text-muted);
    margin-bottom: 16px;
    max-width: 740px;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--color-text);
    margin-bottom: 32px;
    transition: color var(--transition);
}
.back-btn:hover { color: var(--color-accent); }

/* ── INFORMAZIONI PAGE ── */
.info-page {
    padding-bottom: 80px;
}
.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
}

/* Chat */
.chat-section h2,
.contact-section h2 {
    font-size: 26px;
    font-weight: 400;
    margin-bottom: 24px;
    letter-spacing: -0.2px;
}

.chat-box {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 520px;
}
.chat-messages {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.chat-empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--color-text-muted);
    font-weight: 300;
}
.chat-input-row {
    display: flex;
    border-top: 1px solid var(--color-border);
}
.chat-input-row input {
    flex: 1;
    border: none;
    padding: 14px 18px;
    font-family: var(--font);
    font-size: 14px;
    outline: none;
    color: var(--color-text);
    background: transparent;
}
.chat-input-row input::placeholder { color: #aaa; }
.chat-send-btn {
    width: 52px;
    background: var(--color-accent);
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition);
}
.chat-send-btn:hover { background: var(--color-accent-hover); }

/* Chat bubbles */
.chat-bubble {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.5;
}
.chat-bubble.user {
    background: var(--color-accent);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 3px;
}
.chat-bubble.agent {
    background: #f2f2f2;
    color: var(--color-text);
    align-self: flex-start;
    border-bottom-left-radius: 3px;
}
.chat-bubble.typing { color: var(--color-text-muted); font-style: italic; }

/* Contact form */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text);
}
.form-group input,
.form-group textarea {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-family: var(--font);
    font-size: 14px;
    color: var(--color-text);
    outline: none;
    transition: border-color var(--transition);
    background: var(--color-bg);
}
.form-group input:focus,
.form-group textarea:focus { border-color: var(--color-accent); }
.form-group input::placeholder,
.form-group textarea::placeholder { color: #aaa; }
.form-group textarea { resize: vertical; min-height: 220px; }

.submit-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--color-accent);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    padding: 13px 20px;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition);
    width: 100%;
}
.submit-btn:hover { background: var(--color-accent-hover); }
.submit-btn .btn-note {
    font-size: 12px;
    opacity: 0.8;
}
.submit-btn .btn-arrow { font-size: 16px; }

/* ── FOOTER ── */
.site-footer {
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--color-border);
    border-radius: 14px;
    max-width: var(--max-w);
    box-shadow: inset 0 1px 0 rgba(0,0,0,0.06), 0 2px 12px rgba(0,0,0,0.08);
    padding: 14px 0;
    margin: 20px auto 0;
    width: calc(100% - 48px);
    margin-top: auto;
}

/* Body padding bottom to avoid content hidden under fixed footer */

.footer-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 20px;
}
.footer-logo {
    display: flex;
    flex-direction: column;
    align-items: baseline;
    gap: 0;
}
.footer-logo .logo-mark {
    font-size: 14px;
    font-family: 'major mono display';
    letter-spacing: -0.3px;
}

.footer-copy {
    font-size: 10px;
    margin-top: -5px;
    color: var(--color-text);
}
.footer-cookie {
    font-size: 10px;
    color: var(--color-text-muted);
    margin-left: auto;
}
.footer-top {
    font-size: 18px;
    color: var(--color-text-muted);
    transition: color var(--transition);
}
.footer-top:hover { color: var(--color-accent); }

/* ── UTILITIES ── */
.sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.mt-20 { margin-top: 20px; }
.mb-60 { margin-bottom: 60px; }
