/* ===== VIRGILIO FAMILY OFFICE — MASTER STYLESHEET ===== */

/* --- CUSTOM FONTS --- */
@font-face {
    font-family: 'Roxborough CF';
    src: url('fonts/roxborough/Roxborough CF.ttf') format('truetype');
    font-weight: 400;
    font-display: swap;
}

/* --- VARIABLES --- */
:root {
    --bg-deep:    #00211b;
    --bg-primary: #002d25;
    --bg-card:    #003d32;
    --bg-card-hover: #004d3f;
    --border:     #005c4a;
    --border-light: #007a62;
    --gold:       #a8a29e;
    --gold-light: #c4bdb6;
    --gold-dim:   rgba(168, 162, 158, 0.15);
    --gold-glow:  rgba(168, 162, 158, 0.08);
    --green-live: #22c55e;
    --text:       #e7e5e4;
    --text-dim:   #a8a29e;
    --text-muted: #78716c;
    --serif:      'Helvetica Neue', Helvetica, Arial, sans-serif;
    --sans:       'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* --- RESET & BASE --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-weight: 700;
    background: var(--bg-deep);
    color: var(--text);
    overflow-x: hidden;
    line-height: 1.6;
}

/* --- TYPOGRAPHY --- */
h1, h2, h3 { font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-weight: 700; }
h1 { font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: clamp(2rem, 4vw, 3rem); line-height: 1.15; letter-spacing: -0.02em; font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); line-height: 1.2; }
h3 { font-size: 1.3rem; }
.gold { color: var(--gold); }
.text-dim { color: var(--text-dim); }
.text-muted { color: var(--text-muted); }

/* --- LAYOUT --- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; position: relative; z-index: 1; }
section { padding: 6rem 0; }

/* --- CARDS --- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 2rem;
    transition: transform 0.3s, border-color 0.3s, background 0.3s;
}
.card:hover {
    transform: translateY(-4px);
    border-color: var(--gold);
    background: var(--bg-card-hover);
}

/* --- NAVBAR --- */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    padding: 2.5rem 0 1rem 0;
    overflow: visible;
    transition: background 0.3s, padding 0.3s, border-bottom 0.3s;
}
.navbar.scrolled {
    background: rgba(0, 33, 27, 0.95);
    backdrop-filter: blur(12px);
    padding: 2.5rem 0 0.6rem 0;
    border-bottom: 1px solid var(--gold-dim);
}
.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    text-decoration: none;
}
.nav-brand svg { width: 44px; height: 44px; flex-shrink: 0; }
.nav-v-logo { width: 130px; height: auto; flex-shrink: 0; opacity: 0.85; margin-right: -1.8rem; margin-top: -3rem; }
.nav-brand-text {
    font-family: 'Cinzel', var(--serif);
    font-size: 1.35rem;
    font-weight: 500;
    color: var(--text);
    letter-spacing: 5px;
}
.nav-brand-sub {
    font-family: 'Cinzel', var(--serif);
    font-size: 0.6rem;
    color: var(--text-muted);
    letter-spacing: 4px;
    text-transform: uppercase;
}
.nav-brand-sub {
    font-size: 0.6rem;
    color: var(--text-muted);
    letter-spacing: 4px;
    text-transform: uppercase;
}
.nav-links { display: flex; gap: 2rem; align-items: center; }
.nav-links a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    transition: color 0.3s;
}
.nav-links a:hover { color: var(--gold); }
.nav-cta {
    padding: 0.5rem 1.25rem;
    background: transparent;
    border: 1px solid var(--gold);
    color: var(--gold) !important;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.3s, color 0.3s;
}
.nav-cta:hover {
    background: var(--gold);
    color: var(--bg-deep) !important;
}

/* Hamburger */
.hamburger { display: none; cursor: pointer; flex-direction: column; gap: 5px; }
.hamburger span { width: 24px; height: 2px; background: var(--gold); transition: 0.3s; }
.mobile-menu {
    display: none;
    flex-direction: column;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
}
.mobile-menu.active { display: flex; }
.mobile-menu a {
    padding: 0.75rem 1.5rem;
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
}
.mobile-menu a:hover { color: var(--gold); }

@media (max-width: 768px) {
    .hamburger { display: flex; }
    .nav-links { display: none; }
}

/* --- HERO --- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    padding-top: 5rem;
}
.hero::before {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 800px; height: 800px;
    background: radial-gradient(circle, var(--gold-dim) 0%, transparent 70%);
    animation: heroGlow 8s ease-in-out infinite;
    pointer-events: none;
}
@keyframes heroGlow {
    0%, 100% { opacity: 0.3; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.6; transform: translate(-50%, -50%) scale(1.1); }
}
/* Hero watermark logo — above text */
.hero-watermark {
    position: relative;
    width: min(50vw, 450px);
    margin: 0 auto 1.5rem auto;
    z-index: 2;
    opacity: 0.15;
    pointer-events: none;
    animation: watermarkPulse 8s ease-in-out infinite;
}
.hero-watermark img {
    width: 100%;
    height: auto;
}
@keyframes watermarkPulse {
    0%, 100% { opacity: 0.12; transform: scale(1); }
    50% { opacity: 0.18; transform: scale(1.02); }
}
/* Section watermark decorations */
.section-watermark {
    position: absolute;
    height: auto;
    pointer-events: none;
    z-index: 0;
}

/* Chi Siamo — Mercurio alato, alzato in alto nel buco sopra le card */
#chi-siamo .section-watermark {
    width: min(45vw, 420px);
    opacity: 0.055;
    right: -5%;
    top: -5%;
}

/* Servizi (Cosa Facciamo) — Grifone a sinistra, tutto visibile */
#servizi .section-watermark {
    width: min(38vw, 350px);
    opacity: 0.05;
    left: 4%;
    top: 5%;
}

/* Portafogli — Tritone a destra, più in alto, a specchio */
#portafogli .section-watermark {
    width: min(55vw, 500px);
    opacity: 0.04;
    right: -2%;
    top: 2%;
    transform: scaleX(-1);
}

/* Strategie — Diana a specchio, a sinistra */
#strategie .section-watermark {
    width: min(35vw, 220px);
    opacity: 0.045;
    left: 0;
    top: 2%;
    transform: scaleX(-1);
}

/* Perché Noi — Guerriero a specchio, destra, più alto */
#perche-noi .section-watermark {
    width: min(45vw, 400px);
    opacity: 0.05;
    right: 2%;
    top: 0%;
    transform: scaleX(-1);
}

/* Contatti — Grifone -20%, spostato a sinistra */
#contatti .section-watermark {
    width: min(56vw, 480px);
    opacity: 0.04;
    left: 30%;
    top: 50%;
    transform: translate(-50%, -50%);
}

@media (max-width: 768px) {
    .section-watermark { opacity: 0.03 !important; }
    #chi-siamo .section-watermark { width: min(60vw, 250px); right: -10%; }
    #servizi .section-watermark { width: min(55vw, 230px); left: -8%; }
    #portafogli .section-watermark { width: min(65vw, 280px); }
    #strategie .section-watermark { width: min(60vw, 260px); }
    #contatti .section-watermark { width: min(80vw, 320px); }
}

.hero-content { position: relative; z-index: 2; max-width: 800px; padding: 0 1.5rem; padding-top: 2rem; }
.hero h1 { margin-bottom: 1.5rem; }
.hero p { font-size: 1.15rem; color: var(--text-dim); margin-bottom: 2.5rem; max-width: 600px; margin-left: auto; margin-right: auto; }
.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 3rem;
}
.hero-stat {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1rem;
}
.hero-stat-value { font-family: var(--serif); font-size: 1.1rem; color: var(--gold); font-weight: 600; }
.btn-primary {
    display: inline-block;
    padding: 0.85rem 2.5rem;
    background: var(--gold);
    color: var(--bg-deep);
    font-weight: 700;
    font-size: 0.9rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    letter-spacing: 0.5px;
    transition: transform 0.2s, box-shadow 0.3s;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(184, 154, 62, 0.3);
}

@media (max-width: 640px) {
    .hero-stats { grid-template-columns: 1fr; }
}

/* --- SECTIONS --- */
.section-bg { background: linear-gradient(180deg, rgba(0, 45, 37, 0.5) 0%, transparent 100%); }

/* --- GRID LAYOUTS --- */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
@media (max-width: 768px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* --- PORTFOLIO SECTION --- */
.profile-tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.5rem; }
.profile-tab {
    padding: 0.6rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background: transparent;
    color: var(--text-dim);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: var(--sans);
}
.profile-tab:hover { border-color: var(--gold); color: var(--gold); }
.profile-tab.active {
    background: var(--gold);
    color: var(--bg-deep);
    border-color: var(--gold);
}

.profile-info-bar {
    display: flex;
    gap: 2rem;
    align-items: center;
    padding: 0.75rem 1.25rem;
    background: var(--gold-glow);
    border: 1px solid var(--gold-dim);
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
}
.profile-info-bar .label { color: var(--text-muted); }
.profile-info-bar .value { color: var(--gold); font-weight: 600; }

.chart-wrapper {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.25rem;
    margin-bottom: 1rem;
}
.chart-box { position: relative; height: 380px; }
.dd-chart-box { position: relative; height: 160px; margin-top: 0.5rem; }

.chart-legend-bar {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    padding: 0.75rem 0;
    font-size: 0.8rem;
    flex-wrap: wrap;
}
.legend-item { display: flex; align-items: center; gap: 0.4rem; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

/* Compare toggles */
.compare-section {
    margin: 1.5rem 0;
    padding: 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
}
.compare-title {
    font-family: var(--sans);
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
    font-weight: 600;
}
.compare-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
@media (max-width: 640px) { .compare-grid { grid-template-columns: 1fr; } }
.compare-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: border-color 0.3s, background 0.3s;
}
.compare-toggle:hover { border-color: var(--text-muted); }
.compare-toggle.active { border-color: var(--gold-dim); background: var(--gold-glow); }
.compare-toggle input { display: none; }
.compare-dot {
    width: 12px; height: 12px;
    border-radius: 50%;
    border: 2px solid var(--text-muted);
    transition: 0.3s;
    flex-shrink: 0;
}
.compare-toggle.active .compare-dot { border-color: currentColor; background: currentColor; }
.compare-label { font-size: 0.8rem; color: var(--text-dim); line-height: 1.3; }
.compare-label strong { display: block; color: var(--text); font-weight: 600; font-size: 0.85rem; }

/* --- METRICS TABLE --- */
.metrics-wrap { overflow-x: auto; margin-top: 1.5rem; }
.metrics-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    white-space: nowrap;
}
.metrics-table th {
    background: var(--bg-card);
    color: var(--text-muted);
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border);
}
.metrics-table td {
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-dim);
}
.metrics-table tbody tr:hover { background: rgba(255,255,255,0.02); }
.metrics-table .star-row {
    background: var(--gold-glow);
    border-left: 3px solid var(--gold);
}
.metrics-table .star-row td { color: var(--text); font-weight: 500; }
.metrics-table .star-row td:first-child { color: var(--gold); font-weight: 700; }
.metrics-table .best-val { color: var(--gold); font-weight: 700; }
.model-desc { font-size: 0.7rem; color: var(--text-muted); font-weight: 400; display: block; margin-top: 2px; }

/* --- LOCKED STRATEGIES --- */
.locked-card { position: relative; overflow: hidden; }
.locked-blur { filter: blur(6px); opacity: 0.4; pointer-events: none; }
.lock-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 33, 27, 0.6);
    backdrop-filter: blur(4px);
    border-radius: 0.75rem;
    z-index: 5;
}
.lock-overlay svg { width: 48px; height: 48px; color: var(--gold); margin-bottom: 0.75rem; }
.lock-overlay p { font-weight: 600; margin-bottom: 1rem; }
.btn-outline {
    padding: 0.5rem 1.25rem;
    border: 1px solid var(--gold);
    color: var(--gold);
    background: transparent;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.3s, color 0.3s;
}
.btn-outline:hover { background: var(--gold); color: var(--bg-deep); }

/* --- CONTACT FORM --- */
.form-input {
    width: 100%;
    padding: 0.7rem 1rem;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text);
    font-size: 0.9rem;
    font-family: var(--sans);
    margin-bottom: 0.75rem;
    transition: border-color 0.3s;
}
.form-input:focus { outline: none; border-color: var(--gold); }
.form-input::placeholder { color: var(--text-muted); }

/* --- MODAL --- */
.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 20, 16, 0.7);
    z-index: 200;
    align-items: center;
    justify-content: center;
}
.modal-backdrop.active { display: flex; }
.modal-box {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 0.75rem;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
}

/* --- FOOTER --- */
.footer {
    background: var(--bg-deep);
    border-top: 1px solid var(--border);
    padding: 2.5rem 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.footer a { color: var(--text-muted); text-decoration: none; transition: color 0.3s; }
.footer a:hover { color: var(--gold); }

/* --- SCROLL REVEAL ANIMATIONS --- */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}
.reveal.delay-1 { transition-delay: 0.1s; }
.reveal.delay-2 { transition-delay: 0.2s; }
.reveal.delay-3 { transition-delay: 0.3s; }
.reveal.delay-4 { transition-delay: 0.4s; }
.reveal.delay-5 { transition-delay: 0.5s; }
.reveal.delay-6 { transition-delay: 0.6s; }

/* --- NUMBER COUNTER ANIMATION --- */
@keyframes countUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
