@font-face {
    font-family: 'Nyght Serif';
    src: url('font/NyghtSerif-Medium.woff2') format('woff2'),
         url('font/NyghtSerif-Medium.woff') format('woff');
    font-weight: 500;
    font-style: normal;
}

/* Variabili */

:root {
    --green-gradient:
    linear-gradient(
    135deg,
    #54786C 0%,
    #829B85 100%
    );
    --green:#54786C;
    --green-light:#829B85;
    --green-soft: #E2F1EA;
    --card-bg:#FDFCF9;
    --section-bg:#F0EADA;
    --card-radius: 24px;
    --card-padding: 32px;
}

*, *::before, *::after {
    box-sizing: border-box;
}

/* Caricamento */

.cv-loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--section-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}

.cv-loader.hidden {
    opacity: 0;
    pointer-events: none;
}

.cv-loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--green-soft);
    border-top-color: var(--green);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Regole globali */

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
    font-family: 'Montserrat', sans-serif;
    color: #3E3D36;
    background-color: var(--section-bg);
}

h1 {
    margin: 0;
    font-family: 'Nyght Serif', serif;
    font-size: 64px;
    font-weight: 500;
    line-height: 1.1;
    letter-spacing: .06em;
    color: #FFFFFF;
}

h2 {
    margin: 0;
    font-family: 'Nyght Serif', serif;
    font-size: 32px;
    font-weight: 400;
    line-height: 1.1;
    letter-spacing: .02em;
    color: #FFFFFF;
}

h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 500;
    line-height: 1.2;
    color: #000;
}

h4 {
    margin: 8px 0 0;
    font-size: 18px;
    font-weight: 500;
    line-height: 1.3;
    color: var(--green);
}

p {
    margin: 0;
    font-size: 16px;
    line-height: 1.8;
    color: #3E3D36;
}

/* Componenti riutilizzabili */

.glass-effect {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    border-radius: var(--card-radius);
    box-shadow:
        inset 0 0 1px rgba(255,255,255,0.55),
        0 2px 5px rgba(0,0,0,0.1);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.glass-effect::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(
        135deg,
        rgba(255,255,255,1) 0%,
        rgba(255,255,255,1) 12%,
        rgba(255,255,255,0.08) 40%,
        rgba(255,255,255,0.08) 60%,
        rgba(255,255,255,1) 88%,
        rgba(255,255,255,1) 100%
    );
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);

    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.cv-grid {
    display: grid;
    gap: 32px;
    margin-top: 64px;
}

.cv-card {
    display: flex;
    flex-direction: column;
    padding: var(--card-padding);
    border-radius: var(--card-radius);
    background: var(--card-bg);
    border: 1px solid rgba(84,120,108,.15);
    transition:
        transform .3s ease,
        box-shadow .3s ease,
        border-color .3s ease;
}

.cv-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
}

.cv-card-icon {
    width: 52px;
    height: 52px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    background: var(--green-soft);
    color: var(--green);
    font-size: 20px;
}

.cv-card-body {
    display: flex;
    flex-direction: column;
}

/* Navbar */

.cv-nav-wrapper {
    position: fixed;
    top: 32px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 160px);
    max-width: 1400px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    z-index: 20;
    user-select: none;
}

.cv-navbar{
    width: fit-content;
    padding:18px 48px;
    background:rgba(255,255,255,.08);
    display:flex;
    justify-content:center;
    align-items:center;
    transition:background .35s ease;
}

.cv-nav-icon-left,
.cv-nav-icon-right {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 999px;
    text-decoration: none;
    transition:
        background 0.3s ease,
        transform 0.3s ease;
}

.cv-nav-icon-left:hover,
.cv-nav-icon-right:hover {
    background: rgba(255,255,255,0.18);
    transform: translateY(-2px);
}

.cv-nav-icon-left img,
.cv-nav-icon-right img {
    display: block;
    height: auto;
}

.cv-nav-icon-left img {
    width: 32px;
}

.cv-nav-icon-right img {
    width: 42px;
}

.cv-nav-icon-left.scrolled,
.cv-nav-icon-right.scrolled {
    background: rgba(84, 120, 108, 0.75);
}

.cv-nav-menu {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: 32px;
}

.cv-nav-menu a {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 999px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #FFFFFF;
    transition:
        background 0.3s ease,
        box-shadow 0.3s ease,
        color 0.3s ease;
}

.cv-nav-menu a.active {
    background: rgba(255,255,255,0.18);
    box-shadow:
        inset 0 0 1px rgba(255,255,255,0.45),
        0 4px 12px rgba(255,255,255,0.08);
    color: #FFFFFF;
}

.cv-nav-menu a:hover {
    background: rgba(255,255,255,0.10);
}

.cv-navbar.scrolled {
    background: rgba(84, 120, 108, 0.75);
}

/* Struttura hero section */

.cv-hero {
    position: relative;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}

.cv-hero-bg {
    z-index: 1;
    position: absolute;
    inset: 0;
    background-image: url('img/cv-hero-bg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    pointer-events: none;
}

.cv-hero-content {
    position: relative;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 100px 80px 80px;
    gap: 60px;
}

.cv-hero-text {
    max-width: 650px;
}

.cv-hero-text h2 {
    color: #FFFFFF;
}

.cv-hero-text p {
    margin-top: 32px;
    color: var(--section-bg);
}

.cv-hero-image {
    flex-shrink: 0;
    max-width: 420px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.cv-hero-image img {
    display: block;
    width: 100%;
    height: auto;
    user-select: none;
}

/* Struttura sezioni */

.cv-section {
    padding: 80px 40px;
}

.cv-section-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.cv-section-title {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 24px 48px;
    border-radius: 999px;
    background: var(--green-gradient);
}

/* Sezione esperienze lavorative */

.cv-timeline {
    position: relative;
    width: 100%;
    margin: 64px 0 0;
    padding: 40px 0;
}

.cv-timeline::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 10%;
    width: 2px;
    background: var(--green-gradient);
}

.cv-timeline-date {
    display:inline-block;
    margin-top:6px;
}

.cv-timeline-card {
    padding: 20px 32px 28px;
    margin-top: 16px;
}

.cv-timeline-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cv-timeline-item {
    position: relative;
    width: 80%;
    margin-left: 10%;
    padding: 20px 0 20px 48px;
    margin-bottom: 80px;
}

.cv-timeline-item h3 {
    margin-top: 16px;
}

.cv-timeline-item p {
    margin-top: 16px;
}

.cv-timeline-item::before {
    content: "";
    position: absolute;
    top: 28px;
    left: -4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--green-light);
    box-shadow: 0 0 0 4px var(--section-bg);
}

.cv-timeline-item::after {
    content: "";
    position: absolute;
    top: 33px;
    left: 10px;
    width: 28px;
    height: 2px;
    background: var(--green-gradient);
}

/* Sezione istruzione */

.cv-education-grid{
    grid-template-columns:repeat(2,1fr);
}

.cv-education-card {
    color: inherit;
    text-decoration: none;
}

.cv-education-card:hover {
    transform: translateY(-8px);
    border-color: rgba(84,120,108,.35);
    box-shadow: 0 18px 40px rgba(0,0,0,.08);
}

.cv-education-card-large {
    grid-column: 1 / -1;
}

.cv-education-arrow {
    margin-left: auto;
    color: var(--green);
    font-size: 18px;
    transition: transform .3s ease;
}

.cv-education-card:hover .cv-education-arrow {
    transform: translate(4px,-4px);
}

.cv-education-period {
    display:inline-block;
    margin-top:18px;
    font-size:14px;
    font-weight:500;
}

.cv-education-list {
    list-style:none;
    margin:24px 0 0;
    padding:0;
}

.cv-education-list li {
    position:relative;
    padding-left:22px;
    margin-bottom:10px;
    line-height:1.7;
}

.cv-education-list li::before {
    content:"•";
    position:absolute;
    left:0;
    color: var(--green);
    font-size:20px;
}

/* Sezione competenze */

.cv-competencies-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 32px;
    margin-top: 64px;
}

.cv-courses-card {
    grid-column: 1;
    grid-row: 1 / 3;
}

.cv-skills-card,
.cv-tools-card {
    height: 100%;
}

.cv-course-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cv-course-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cv-course-item:not(:last-child) {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(84,120,108,.12);
}

.cv-course-title {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
}

.cv-course-item h4 {
    margin: 0;
}


.cv-course-item p {
    font-size: 14px;
    line-height: 1.5;
    color: #6B6A63;
}

.cv-course-status {
    flex-shrink: 0;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.cv-course-status--completed {
    background: var(--green-soft);
    color: var(--green);
}

.cv-course-status--progress {
    background: #E6F0F8;
    color: #49739A;
}

.cv-skill-list{
    display:flex;
    flex-wrap:wrap;
    gap:12px;
}

.cv-skill{
    padding:10px 16px;
    border-radius:999px;
    background:var(--green-soft);
    color:var(--green);
    font-size:14px;
    font-weight:500;
}

.cv-tools-grid{
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:16px;
}

.cv-tool {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px;
    border-radius: 16px;
    background: transparent;
    transition:
        background .25s ease,
        transform .25s ease;
}

.cv-tool:hover{
    background: rgba(226, 241, 234, .6);
    transform: translateY(-2px);
}

.cv-tool i {
    font-size: 28px;
    color: var(--green);
}

.cv-tool span {
    color: #000;
    font-size: 15px;
    font-weight: 500;
}

/* Footer*/

.cv-footer{
    padding:120px 40px;
    background-image: url("img/cv-footer-bg.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    text-align:center;
}

.cv-footer h2{
    color:#fff;
    font-size:56px;
    margin-bottom:56px;
}

.cv-footer-buttons{
    position:relative;
    display:flex;
    justify-content:center;
    align-items:center;
    gap:24px;
    min-height:90px;
    transform: translateX(-20px);
}

.cv-footer-btn{
    padding:18px 36px;
    border:none;
    border-radius:999px;
    background:#fff;
    color:var(--green); 
    font-size:16px;
    font-weight:600;
    text-decoration:none;
    transition:
        transform .25s ease,
        box-shadow .25s ease;
}

.cv-footer-btn:hover{
    transform:translateY(-3px);
    box-shadow:0 10px 24px rgba(0,0,0,.18);
}

.cv-runaway-placeholder{
    width:150px;    
    height:58px;
    flex-shrink:0;
}

.cv-runaway-btn{
    position:absolute;
    left:calc(50% + 90px);
    top:50%;
    transform:translateY(-50%);
    transition:
        left .28s cubic-bezier(.22,1,.36,1),
        top .28s cubic-bezier(.22,1,.36,1);
}

.cv-success-message{
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%) scale(.9);
    padding: 24px 32px;
    border-radius: 20px;
    background: #fff;
    color: var(--green);
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
    opacity: 0;
    pointer-events: none;
    max-width: 420px;
    width: calc(100% - 48px);
    text-align: center;
    transition:
        opacity .5s ease,
        transform .5s ease;
    z-index: 9999;
}

.cv-success-message.show{
    opacity:1;
    transform:translate(-50%,-50%) scale(1);
}


/* Sezione Mobile responsive */

@media (max-width: 768px) {

.cv-hero-content {
    flex-direction: column-reverse;
    justify-content: center;
    align-items: center;
    text-align: center;
    transform: none;
    gap: 20px;
    padding: 100px 32px 80px;
}

.cv-hero-bg {
    background-position: center bottom;
}

.cv-hero-image {
    max-width: 180px;
}

.cv-hero-text {
    max-width: 500px;
}

.cv-hero-image,
.cv-hero-text {
    transform: translateY(-120px);
}

.cv-hero-text h1 {
    font-size: 32px;
}

.cv-hero-text h2 {
    font-size: 14px;
}

.cv-hero-text p {
    font-size: 12px;
    line-height: 1.7;
}

.cv-nav-icon-left,
.cv-nav-icon-right,
.cv-navbar {
    display: none;
}

.cv-section-title{
    padding: 16px 28px;
    border-radius: 999px;
}

.cv-section-title h2{
    font-size: 24px;
    line-height: 1.2;
}

.cv-timeline::before{
    left:18px;
}

.cv-timeline-item::before{
    left:-15px;
}

.cv-timeline-item::after{
    left:0;
    width:18px;
}

.cv-timeline-item{
    width:100%;
    margin-left:0;
    padding:16px 0 16px 42px;
}

.cv-timeline-card h3{
    font-size:18px;
}

.cv-timeline-card h4{
    font-size:16px;
}

.cv-timeline-card p{
    font-size:15px;
    line-height:1.8;
}

.cv-education-grid {
    grid-template-columns: 1fr;
}

.cv-education-card-large {
    grid-column: auto;
}

.cv-competencies-grid{
    grid-template-columns: 1fr;
    gap: 24px;
    margin-top: 40px;
}

.cv-courses-card,
.cv-skills-card,
.cv-tools-card{
    grid-column: auto;
    grid-row: auto;
    padding: 24px;
}

.cv-footer-buttons{
    transform: none;
    gap: 16px;
}

.cv-runaway-placeholder{
    display: none;
}

.cv-runaway-btn{
    position: static;
    left: auto;
    top: auto;
    transform: none;
}

}