@font-face {
    font-family: 'Impact';
    src: url('../fonts/impact/impact.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap; /* This helps with performance */
}

:root {
  --header-height: 80px;
  --primary-color: #f7bb29; /* Yellow */
  --secondary-color: #d99f21; /* Darker Yellow */
  --accent-color: #ffffff; /* White */
  --background-dark: #000000; /* Black */
  --background-light: #1a1a1a; /* Dark Gray */
  --text-light: #000000; /* Black */
  --text-muted: #333333; /* Darker grey for muted text */
  --border-color-dark: #2a2a2a;
  --border-color-light: #444444;
  --font-family-base: "Impact", sans-serif;
  --font-family-heading: "Impact", sans-serif;
  --font-size-base: 16px;
  --line-height-base: 1.75;
  --heading-font-weight: 700;
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 3rem;
  --spacing-2xl: 4rem;
  --border-width: 1px; /* Thinner borders */
  --border-radius: 2rem; /* Slightly smaller radius */
  --glass-background-color: rgba(26, 26, 26, 0.5);
  --glass-border-color: rgba(247, 187, 41, 0.3); /* Adjusted to new primary color */
  --glass-blur: 10px;

  /* New variable for header text/foreground color */
  --header-text-color: var(--background-dark);
}

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

html, body {
    height: 100%;
}

html {
  scroll-snap-type: y proximity;
}

body {
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  color: var(--text-light);
  margin: 0;
  padding: 0;
  background-color: black;
  transition-duration: 1s;
}

.layer-1 {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-family-heading);
  font-weight: var(--heading-font-weight);
  line-height: 1.2;
  color: var(--text-light);
}

h1 { font-size: 3rem; }
h2 { font-size: 2.5rem; }
h3 { font-size: 2rem; }
h4 { font-size: 1.75rem; }
h5 { font-size: 1.5rem; }
h6 { font-size: 1.25rem; }

p {
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

.glass-effect {
  background-color: var(--glass-background-color);
  backdrop-filter: blur(var(--glass-blur));
  border: var(--border-width) solid var(--glass-border-color);
}

/* General section styles */
.block-section {
  background-color: var(--background-dark);
  padding-top: var(--spacing-2xl);
  padding-bottom: var(--spacing-2xl);
  position: relative; /* For the pseudo-element */
}

/* Soft transition between sections */
.block-section:not(:first-child)::before {
  content: '';
  position: absolute;
  top: -1px; /* Overlap to prevent gaps */
  left: 0;
  right: 0;
  height: 150px;
  background: linear-gradient(to bottom, var(--background-dark) 20%, transparent 100%);
  pointer-events: none;
  z-index: 1;
}

.block-section__container {
  max-width: 1200px;
  margin: 0 auto;
  padding-left: var(--spacing-lg);
  padding-right: var(--spacing-lg);
  position: relative; /* Ensure content is above the pseudo-element */
  z-index: 3; /* Higher than the ::before pseudo-element */
}

.block-section__title {
  text-align: center;
  color: var(--primary-color);
  font-family: var(--font-family-heading);
  font-weight: var(--heading-font-weight);
}

.block-section__description {
  text-align: center;
  color: var(--text-muted);
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.block-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center; /* This is the key to centering the last item */
  gap: var(--spacing-lg);
}

/* Define how items within the flex-grid should behave */
.block-grid > * {
    flex: 1 1 320px; /* Grow, Shrink, Basis */
    max-width: 400px; /* Prevent items from becoming too wide */
}

.card-title {
  font-family: var(--font-family-heading);
  font-weight: var(--heading-font-weight);
  margin-bottom: var(--spacing-sm);
  color: var(--text-light); /* Titles in cards should be lighter */
}

.card-description {
  font-family: var(--font-family-base);
  line-height: var(--line-height-base);
}

.card {
  background-color: var(--glass-background-color);
  backdrop-filter: blur(var(--glass-blur));
  border: var(--border-width) solid var(--glass-border-color);
  border-radius: var(--border-radius);
  padding: var(--spacing-lg);
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
}

/* Responsive adjustments for sections and grids */
@media (max-width: 768px) {
  .block-section {
    padding-top: var(--spacing-xl);
    padding-bottom: var(--spacing-xl);
  }

  .block-section__title {
    margin-bottom: var(--spacing-lg);
  }
}

/* --- FLOW/RHYTHM SPACING --- */
.block-section__container > * + * {
  margin-top: var(--spacing-xl);
}

.block-section__title + .block-section__description {
    margin-top: var(--spacing-md);
}

/* --- BUTTON STYLES --- */
.btn {
    display: inline-block;
    padding: var(--spacing-sm) var(--spacing-md);
    font-family: var(--font-family-heading);
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--border-radius);
    cursor: pointer !important;
    transition: transform 0.3s ease, background-color 0.3s ease;
    border: 1px solid black;
}

.btn--primary {
    background-color: var(--primary-color);
    color: var(--background-dark);
}

.btn--primary:hover {
    background-color: transparent;
    color: var(--primary-color);
}

/* --- ANIMATION STYLES --- */
/* Generic Pull-in Animation for Section Containers */
.animated-pull-in-container {
    height: 88%; /* Default height, can be overridden */
    width: 95%; /* Default width, can be overridden */
    padding-top: 2%; /* Default padding, can be overridden */
    border-radius: 4vh; /* Default border-radius, can be overridden */
    background-color: var(--primary-color); /* Default background, can be overridden */
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: width 1.5s cubic-bezier(0.23, 1, 0.32, 1), height 1.5s cubic-bezier(0.23, 1, 0.32, 1), border-radius 1.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.animated-pull-in-container.initial-state {
    width: 100%;
    height: 100%;
    border-radius: 0;
}

/* Generic styles for elements that animate within a section */
.animated-section [data-animate-item] {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.animated-section [data-animate-item].is-visible {
    opacity: 1;
    transform: translateY(0);
}

.animated-section [data-animate-item][data-animate-delay="0.2s"] {
    transition-delay: 0.2s;
}

.animated-section [data-animate-item][data-animate-delay="0.4s"] {
    transition-delay: 0.4s;
}

.animated-section [data-animate-item][data-animate-delay="0.6s"] {
    transition-delay: 0.6s;
}

.animated-section [data-animate-item][data-animate-delay="0.7s"] {
    transition-delay: 0.7s;
}

.animated-section [data-animate-item][data-animate-delay="0.9s"] {
    transition-delay: 0.9s;
}

/* Specific animation for image scaling from bottom */
.animated-section .image-scale-from-bottom[data-animate-item] {
    transform: scale(0.9);
    transform-origin: bottom center;
}

.animated-section .image-scale-from-bottom[data-animate-item].is-visible {
    transform: scale(1);
}

/* Styles for the dynamically generated background shapes */
.background-shape {
    position: absolute; /* Positioned relative to their container */
    z-index: 0; /* Behind the container's content */
    opacity: 0.07;
    transition: opacity 0.5s ease-out, transform 0.5s ease-out; /* Added for scroll animation */
}

.background-shape.is-visible {
    opacity: 0.07; /* Final opacity when visible */
    transform: translateY(0); /* Final position when visible */
}


/* --- FOOTER STYLES --- */
footer {
    position: relative;
    z-index: 1;
    background-color: var(--background-dark);
}

/* --- HEADER STYLES --- */
.main-header-block {
    background-color: var(--primary-color);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--header-text-color); /* Use new variable */
    padding: var(--spacing-sm) 0; /* Adjusted padding */
    position: fixed;
    top: 2.5vh;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    border-radius: 40px;
    border: 2px solid var(--header-text-color); /* Use new variable */
    width: 90%;
    max-width: 1200px;
    transition: background-color 0.5s ease, border-color 0.5s ease; /* Add border-color transition */
}

.main-header-block__logo {
    height: 40px;
    width: auto;
    display: block;
    filter: invert(1); /* Always invert */
}

.main-header-block__navigation-link {
    color: var(--header-text-color); /* Use new variable */
    text-decoration: none;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--spacing-xs);
    transition: background-color 0.3s ease, color 0.3s ease;
    font-weight: 500;
    white-space: nowrap;
}

.main-header-block__navigation-link:hover {
    background-color: var(--header-text-color); /* Use new variable */
    color: var(--primary-color);
}

.main-header-block__lang-button {
    background-color: transparent;
    border: 2px solid var(--header-text-color); /* Use new variable */
    color: var(--header-text-color); /* Use new variable */
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: var(--font-size-base);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease; /* Add color and border-color transition */
}

.main-header-block__lang-button:hover {
    background-color: rgba(0, 0, 0, 0.1); /* Keep this as is or adjust if needed */
}

.main-header-block__lang-dropdown {
    position: absolute;
    top: calc(100% + var(--spacing-xs));
    right: 0;
    background-color: var(--primary-color); /* This should probably stay primary or be adjusted based on header color */
    border-radius: var(--border-radius);
    overflow: hidden;
    z-index: 1000;
    min-width: 120px;
    display: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    border: 2px solid var(--header-text-color); /* Use new variable */
}

.main-header-block__lang-dropdown .main-header-block__lang-link {
    display: block;
    padding: var(--spacing-sm) var(--spacing-md);
    color: var(--header-text-color); /* Use new variable */
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
    text-align: center;
}

.main-header-block__lang-dropdown .main-header-block__lang-link:hover {
    background-color: var(--header-text-color); /* Use new variable */
    color: var(--primary-color);
}

.main-header-block__lang-dropdown .main-header-block__lang-link--active {
    background-color: var(--header-text-color); /* Use new variable */
    font-weight: var(--heading-font-weight);
    color: var(--primary-color);
}

/* --- MOBILE MENU STYLES --- */
.main-header-block__mobile-toggle-bar {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--header-text-color); /* Use new variable */
    border-radius: 3px;
    transition: transform 0.3s ease, opacity 0.3s ease, background-color 0.5s ease; /* Add background-color transition */
}

.mobile-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--primary-color); /* This will be controlled by JS */
    z-index: 999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1), background-color 0.5s ease; /* Add background-color transition */
}

.mobile-nav__navigation-link {
    color: var(--header-text-color); /* Use new variable */
    text-decoration: none;
    font-size: calc(var(--font-size-base) * 1.75);
    font-weight: var(--heading-font-weight);
    padding: var(--spacing-sm);
    transition: color 0.3s ease;
}

.mobile-nav__navigation-link:hover {
    color: var(--header-text-color); /* Use new variable */
    opacity: 0.7;
}

.mobile-nav__lang-link {
    color: var(--header-text-color); /* Use new variable */
    text-decoration: none;
    font-size: var(--font-size-base);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--border-radius);
    transition: color 0.3s ease, background-color 0.3s ease;
    opacity: 0.7;
}

.mobile-nav__lang-link--active {
    color: var(--primary-color);
    background-color: var(--header-text-color); /* Use new variable */
    opacity: 1;
}