/* 
   PRECISION ENGINEERING DESIGN SYSTEM 
   Theme: Dark Mode Tech / Modern Swiss
*/

:root {
    /* Colors */
    --bg-root: #0b0c10;
    /* Charcoal very dark */
    --bg-surface: #14161f;
    /* Slightly lighter for cards */
    --bg-surface-hover: #1c1f2b;

    --text-primary: #f8fafc;
    /* Off-white */
    --text-secondary: #94a3b8;
    /* Muted cool gray */

    --accent: #2563eb;
    /* Electric Blue */
    --accent-hover: #3b82f6;

    --border: #2d3748;
    /* Subtle dark borders */
    --border-light: #4a5568;

    /* Spacing & Layout */
    --container-width: 1200px;
    --radius-soft: 8px;
    --radius-pill: 9999px;

    /* Typography */
    --font-stack: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* RESET & BASE */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-stack);
    background-color: var(--bg-root);
    color: var(--text-primary);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: -0.04em;
    /* Tight tracking for impact */
    margin-top: 0;
}

h1 {
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

h2 {
    font-size: 2.25rem;
    margin-bottom: 1.2rem;
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 0.8rem;
}

p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    max-width: 70ch;
}

a {
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* LAYOUT UTILS */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* NAVBAR - Glassy & Tech */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 24px 0;
    background: rgba(11, 12, 16, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--text-primary);
    text-transform: uppercase;
}

.logo a {
    color: inherit;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-links a:not(.btn-software):not(.lang-switch a) {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    position: relative;
}

.nav-links a:not(.btn-software):not(.lang-switch a):hover {
    color: var(--text-primary);
}

/* Micro-interaction: Ununderline swipe */
.nav-links a:not(.btn-software):not(.lang-switch a)::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: -4px;
    left: 0;
    background-color: var(--accent);
    transition: width 0.3s ease;
}

.nav-links a:not(.btn-software):not(.lang-switch a):hover::after {
    width: 100%;
}

.btn-software {
    background-color: var(--accent);
    color: white !important;
    padding: 10px 20px;
    border-radius: var(--radius-soft);
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: -0.01em;
    box-shadow: 0 4px 14px 0 rgba(37, 99, 235, 0.3);
    /* Blueprint glow */
}

.btn-software:hover {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.lang-switch {
    display: flex;
    gap: 16px;
    margin-left: 16px;
    padding-left: 16px;
    border-left: 1px solid var(--border);
}

.lang-switch a {
    font-size: 1.2rem;
    opacity: 0.4;
    filter: grayscale(1);
}

.lang-switch a:hover,
.lang-switch a.active {
    opacity: 1;
    filter: grayscale(0);
    transform: scale(1.1);
}

/* HERO SECTION */
.hero {
    padding: 120px 0;
    background: radial-gradient(circle at 80% 20%, rgba(37, 99, 235, 0.08) 0%, transparent 40%);
}

.hero-content {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    /* Text gets more space */
    gap: 60px;
    align-items: center;
}

.hero h1 {
    font-size: 3.75rem;
    /* Massive */
    letter-spacing: -0.05em;
    line-height: 1.05;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 2rem;
}

.text-col p {
    font-size: 1.25rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 3rem;
}

.cta-group {
    display: flex;
    gap: 16px;
}

.btn-primary,
.btn-secondary {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 14px 28px;
    font-weight: 600;
    font-size: 1rem;
    border-radius: var(--radius-soft);
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--text-primary);
    /* White contrast */
    color: var(--bg-root);
    border: 1px solid var(--text-primary);
}

.btn-primary:hover {
    background: transparent;
    color: var(--text-primary);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

.btn-secondary:hover {
    border-color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

/* PROFILE IMAGE - Precision Frame */
.profile-placeholder,
.profile-img {
    width: 320px;
    height: 320px;
    border-radius: 4px;
    /* Sharper corners for tech look */
    object-fit: cover;
    margin-left: auto;

    /* Tech border effect */
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.1),
        /* Inner bezel */
        20px 20px 0 rgba(37, 99, 235, 0.1);
    /* Graphic element */
}

.profile-placeholder {
    background: var(--bg-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    border: 1px dashed var(--border);
}

/* BLOG GRID - Clean Swiss Layout */
.blog-grid {
    padding: 100px 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 40px;
}

.article-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-soft);
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.3s ease;
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    /* Precision highlight */
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
}

.card-img {
    height: 220px;
    background: #1e2129;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}

.card-body {
    padding: 32px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-body h3 {
    font-size: 1.5rem;
    line-height: 1.2;
    margin-bottom: 16px;
    letter-spacing: -0.03em;
}

.card-body p {
    font-size: 0.95rem;
    margin-bottom: 24px;
    flex-grow: 1;
}

.read-more {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.read-more:hover {
    color: var(--accent-hover);
    gap: 10px;
    /* Slide arrow effect */
}

/* CONTACT SECTION */
.contact-section {
    padding: 100px 0;
    background: linear-gradient(to bottom, var(--bg-root), var(--bg-surface));
    border-top: 1px solid var(--border);
}

.contact-container {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.contact-form {
    margin-top: 40px;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-root);
    border: 1px solid var(--border);
    border-radius: var(--radius-soft);
    color: var(--text-primary);
    font-family: var(--font-stack);
    font-size: 1rem;
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.button-submit {
    width: 100%;
    padding: 14px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-soft);
    font-weight: 600;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s;
}

.button-submit:hover {
    background: var(--accent-hover);
}

/* FOOTER REFINEMENTS */
footer .social-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
    margin-top: 20px;
    flex-wrap: wrap;
}

footer .social-links a {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    transition: color 0.2s;
}

footer .social-links a:hover {
    color: var(--accent);
}

footer .social-links svg {
    width: 20px;
    height: 20px;
}

/* BLOG POST LAYOUT */
.blog-layout {
    display: grid;
    grid-template-columns: 2.5fr 1fr;
    gap: 80px;
    padding: 80px 0;
}

.article-content {
    font-size: 1.125rem;
}

.article-content h2 {
    margin-top: 3rem;
    font-size: 2rem;
    color: var(--text-primary);
}

.article-content p {
    color: #cbd5e1;
}

/* Lighter for long reading */

/* Sidebar */
.sidebar {
    position: sticky;
    top: 120px;
}

.software-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    padding: 32px;
    border-radius: var(--radius-soft);
}

.software-card h3 {
    color: var(--text-primary);
}

/* FOOTER */
footer {
    border-top: 1px solid var(--border);
    padding: 60px 0;
    margin-top: 120px;
    text-align: center;
    color: var(--text-secondary);
    background: var(--bg-root);
}

footer .social-links a {
    color: var(--text-secondary);
    margin: 0 16px;
    font-size: 0.9rem;
}

footer .social-links a:hover {
    color: var(--accent);
}

/* COOKIE BANNER */
#cookie-banner {
    position: fixed;
    bottom: 20px;
    right: 20px;
    left: auto;
    width: 380px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    padding: 24px;
    border-radius: var(--radius-soft);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    z-index: 9999;
}

#cookie-banner p {
    font-size: 0.9rem;
    margin: 0;
}

#cookie-btn {
    background: var(--text-primary);
    color: var(--bg-root);
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    align-self: flex-end;
}

#cookie-btn:hover {
    opacity: 0.9;
}

/* RESPONSIVE */
@media (max-width: 900px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 40px;
    }

    .hero h1 {
        font-size: 2.8rem;
    }

    .profile-placeholder,
    .profile-img {
        margin: 0 auto;
        width: 100%;
        max-width: 350px;
    }

    .blog-layout {
        grid-template-columns: 1fr;
    }

    .cta-group {
        justify-content: center;
    }

    .nav-links {
        display: none;
    }

    /* Simplified for now */

    /* Simple mobile menu adjustments could go here */
}
/* ── Tabelle riassuntive dentro gli articoli del blog (scannabilità) ── */
#article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.92rem;
}

#article-content th {
    background: #eff6ff;
    color: #1e40af;
    text-align: left;
    padding: 10px 14px;
    border: 1px solid #dbeafe;
    font-weight: 700;
}

#article-content td {
    padding: 10px 14px;
    border: 1px solid #e5e7eb;
    vertical-align: top;
}

#article-content tr:nth-child(even) td {
    background: #f9fafb;
}
