:root {
    --primary: #004aad;
    --secondary: #e86b00;
    --dark: #0f0f0f;
    --light: #f5f5f5;
    --white: #ffffff;
    --text-dark: #1a1a1a;
    --text-light: #666666;
    --border: #e0e0e0;
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.15);
}

/* Dark Mode Variables */
body.dark-mode {
    --text-dark: #ffffff;
    --text-light: #b0b0b0;
    --border: #333333;
    --light: #1a1a1a;
    --white: #0f0f0f;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-dark);
    background-color: var(--white);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Typography */
h1, h2, h3 {
    font-weight: 700;
    line-height: 1.2;
}

h1 {
    font-size: 4.5rem;
    font-weight: 900;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 3rem;
    font-weight: 800;
}

h3 {
    font-size: 1.5rem;
    font-weight: 700;
}

p {
    color: var(--text-light);
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--secondary) 0%, #d45a00 100%);
    color: var(--white);
    border: none;
    padding: 12px 28px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(232, 107, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    transition: left 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(232, 107, 0, 0.4);
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary.btn-large {
    padding: 16px 40px;
    font-size: 1.1rem;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    z-index: 1000;
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

body.dark-mode .navbar {
    background: rgba(15, 15, 15, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.logo-link:hover {
    transform: scale(1.05);
}

.logo-img {
    height: 50px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
    transition: all 0.3s ease;
}

.logo-link:hover .logo-img {
    filter: brightness(1.1);
}

.nav-links {
    display: flex;
    gap: 35px;
    flex: 1;
    margin-left: 60px;
}

.nav-links a {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    transition: color 0.3s ease;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--secondary);
    transition: width 0.3s ease;
}

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

.nav-links a:hover::after {
    width: 100%;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-left: auto;
}

/* Theme Toggle Button */
.theme-toggle {
    background: transparent;
    border: 2px solid var(--text-dark);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: var(--text-dark);
}

.theme-toggle:hover {
    border-color: var(--secondary);
    color: var(--secondary);
    transform: rotate(20deg);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    stroke-width: 2;
}

.sun-icon {
    display: block;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.moon-icon {
    display: none;
    position: absolute;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

body.dark-mode .sun-icon {
    display: none;
}

body.dark-mode .moon-icon {
    display: block;
}

.nav-btn {
    margin-left: 0;
}

/* Hero Section */
.hero {
    position: relative;
    padding: 140px 40px 80px;
    overflow: hidden;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    transition: background 0.3s ease;
}

body.dark-mode .hero {
    background: linear-gradient(135deg, #1a1a1a 0%, #0f0f0f 100%);
}

.hero-bg {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

/* Animated Gradient Blobs */
.gradient-blob {
    position: absolute;
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    opacity: 0.3;
    animation: blobAnimation 15s infinite ease-in-out;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    top: -100px;
    right: -100px;
    animation-delay: 0s;
}

.blob-2 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, var(--primary), #00a8ff);
    top: 50%;
    right: 10%;
    animation-delay: 2s;
}

.blob-3 {
    width: 350px;
    height: 350px;
    background: linear-gradient(135deg, var(--secondary), #ff6b35);
    bottom: -50px;
    right: 30%;
    animation-delay: 4s;
}

@keyframes blobAnimation {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(30px, -50px) scale(1.1);
    }
    50% {
        transform: translate(-20px, 20px) scale(0.9);
    }
    75% {
        transform: translate(50px, 50px) scale(1.05);
    }
}

.hero-container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    position: relative;
    z-index: 2;
}

.hero-left {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.hero-title {
    color: var(--text-dark);
    line-height: 1.1;
    animation: fadeInUp 0.8s ease-out;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-light);
    max-width: 90%;
    animation: fadeInUp 0.8s ease-out 0.1s both;
}

.hero-right {
    display: flex;
    justify-content: center;
    animation: fadeInRight 0.8s ease-out 0.2s both;
}

.hero-image-wrapper {
    position: relative;
    width: 100%;
    max-width: 400px;
    aspect-ratio: 1;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.15);
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.8s ease;
}

.hero-image-wrapper:hover .hero-image {
    transform: scale(1.05);
}

/* Feature Sections */
.feature-section {
    padding: 100px 40px;
    background: var(--white);
    border-top: 1px solid var(--border);
    transition: background-color 0.3s ease;
}

body.dark-mode .feature-section {
    background: ##0f3450;
    border-top-color: #333333;
}

.feature-section.reverse {
    background: var(--light);
}

body.dark-mode .feature-section.reverse {
    background: #1a1a1a;
}

.feature-container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.feature-section.reverse .feature-container {
    grid-template-columns: 1fr 1fr;
}

.feature-section.reverse .feature-content {
    order: 2;
}

.feature-section.reverse .feature-image-wrapper {
    order: 1;
}

.feature-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.section-title {
    color: var(--text-dark);
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
}

.feature-content p {
    color: var(--text-light);
    font-size: 1rem;
    line-height: 1.7;
}

.feature-image-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: visible;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-image-wrapper:hover {
    transform: scale(1.05);
}

/* Immagine proporzionata e contenuta verticalmente */
.feature-image {
    width: auto;
    max-width: 90%;       /* non più larga del 90% del contenitore */
    max-height: 70vh;     /* non più alta del 70% della finestra */
    height: auto;
    object-fit: contain;  /* mostra tutta l’immagine senza tagliarla */
    transition: transform 0.6s ease;
}

.feature-image-wrapper:hover .feature-image {
    transform: scale(1.05);
}



/* Example Box Styling */
.example-box {
    background: linear-gradient(135deg, rgba(0, 74, 173, 0.08), rgba(232, 107, 0, 0.08));
    border-left: 4px solid var(--secondary);
    border-radius: 12px;
    padding: 25px;
    margin: 30px 0;
    transition: all 0.3s ease;
}

body.dark-mode .example-box {
    background: linear-gradient(135deg, rgba(0, 74, 173, 0.15), rgba(232, 107, 0, 0.15));
}

.example-box:hover {
    box-shadow: 0 10px 30px rgba(232, 107, 0, 0.15);
    transform: translateX(5px);
}

.example-title {
    color: var(--secondary);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 20px;
    display: block;
}

.example-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(232, 107, 0, 0.2);
}

.example-item:last-child {
    border-bottom: none;
}

.example-label {
    color: var(--text-light);
    font-weight: 600;
    font-size: 0.9rem;
}

.example-text {
    color: var(--text-dark);
    font-weight: 700;
    font-size: 1rem;
    margin: 0;
}

/* CTA Section */
.cta-section {
    padding: 100px 40px;
    background: linear-gradient(135deg, var(--primary) 0%, #003580 100%);
    color: var(--white);
    text-align: center;
    transition: background 0.3s ease;
}

body.dark-mode .cta-section {
    background: linear-gradient(135deg, #003580 0%, #001a40 100%);
}

.cta-container {
    max-width: 800px;
    margin: 0 auto;
}

.cta-section h2 {
    color: var(--white);
    margin-bottom: 15px;
}

.cta-section p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    margin-bottom: 30px;
}

.cta-section .btn-primary {
    background: linear-gradient(135deg, var(--secondary) 0%, #d45a00 100%);
}

/* Footer */
.footer {
    background: var(--dark);
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    padding: 30px 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    transition: background-color 0.3s ease;
}

body.dark-mode .footer {
    background: #000000;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive */
@media (max-width: 1024px) {
    h1 {
        font-size: 3.5rem;
    }

    h2 {
        font-size: 2.2rem;
    }

    .hero-container {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .hero-right {
        order: -1;
    }

    .feature-container {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .feature-section.reverse .feature-content {
        order: 1;
    }

    .feature-section.reverse .feature-image-wrapper {
        order: 2;
    }

    .nav-links {
        gap: 20px;
        margin-left: 30px;
    }
}

@media (max-width: 768px) {
    .nav-container {
        padding: 0 20px;
        flex-wrap: wrap;
        gap: 15px;
    }

    .nav-links {
        display: none;
    }

    .nav-right {
        margin-left: auto;
    }

    h1 {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 1.8rem;
    }

    .hero {
        padding: 100px 20px 60px;
    }

    .hero-container {
        gap: 30px;
    }

    .hero-subtitle {
        max-width: 100%;
    }

    .feature-section {
        padding: 60px 20px;
    }

    .feature-container {
        gap: 30px;
    }

    .cta-section {
        padding: 60px 20px;
    }

    .blob-1, .blob-2, .blob-3 {
        width: 200px;
        height: 200px;
    }

    .example-box {
        padding: 20px;
    }

    .example-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .logo-img {
        height: 40px;
    }
}

/* === SIMULATOR BitRound Integration === */
.example-simulator-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: start;
  margin-top: 80px;
}

.bitround-style {
  background: linear-gradient(135deg, rgba(0,74,173,0.15), rgba(232,107,0,0.15));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: 36px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.25);
  color: #fff;
  backdrop-filter: blur(12px);
  transition: transform 0.3s ease;
}

.bitround-style:hover { transform: translateY(-5px); }

.bitround-style h3 { color: #e86b00; margin-top: 0; }

.bitround-style .expense-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.bitround-style .expense-btn {
  background: rgba(0,74,173,0.15);
  border: none;
  border-radius: 10px;
  padding: 12px;
  color: #fff;
  cursor: pointer;
  font-size: 15px;
  transition: background 0.2s ease;
}
.bitround-style .expense-btn:hover {
  background: rgba(232,107,0,0.3);
}

.bitround-style .expenses-list {
  list-style: none;
  padding: 0;
  margin: 10px 0;
}

.bitround-style .expense-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
  margin-bottom: 8px;
  padding: 8px 10px;
}

.bitround-style .expense-item-remove {
  border: none;
  background: transparent;
  color: #e86b00;
  cursor: pointer;
  font-size: 16px;
}

.bitround-style .results, .bitround-style .recap {
  margin-top: 18px;
  font-size: 1rem;
}

.bitround-style .results strong,
.bitround-style .recap strong {
  color: #004aad;
}

body.dark-mode .bitround-style .results  strong,
body.dark-mode .simulator-box .results  strong {
  color: #fff;
}


.bitround-style .weeks-slider input[type="range"] {
  width: 100%;
}

.bitround-style .btn-reset {
  margin-top: 20px;
  background: #e86b00;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 20px;
  cursor: pointer;
  font-size: 15px;
  transition: background 0.3s ease;
}
.bitround-style .btn-reset:hover {
  background: #ff8c33;
}

@media (max-width: 900px) {
  .example-simulator-wrapper {
    grid-template-columns: 1fr;
  }
}


/* === SIMULATOR BELOW EXAMPLE BOX === */
.bitround-style.narrow {
  margin: 50px auto 0;
  max-width: 600px;   /* allineato alla larghezza del testo */
  padding: 36px;
}

.example-box {
  max-width: 600px;
  margin: 0 auto;
  text-align: left;
}

@media (max-width: 900px) {
  .bitround-style.narrow,
  .example-box {
    max-width: 90%;
  }
}


/* === PARTICLE FIELD BACKGROUND === */


#hero-particles{
  position: fixed;
  top:0; left:0;
  width:100vw; height:100vh;
  z-index: 1;                 /* prima era 0 */
  pointer-events:none;
  background:
    radial-gradient(circle at 50% 20%, rgba(0,74,173,0.10), transparent 70%),
    radial-gradient(circle at 80% 80%, rgba(232,107,0,0.10), transparent 70%);
}


body.dark-mode #hero-particles {
  background:
    radial-gradient(circle at 50% 20%, rgba(0,74,173,0.15), transparent 70%),
    radial-gradient(circle at 80% 80%, rgba(232,107,0,0.15), transparent 70%);
}


/* Porta i contenuti principali sopra il canvas */
.nav-container,
.hero-container,
.feature-container,
.cta-container,
.footer-container {
  position: relative;
  z-index: 2;
}

