/* CSS-INDEX:

- VARIABLES
- BASE RULES
- HEADER & NAVIGATION
- HERO-SECTION
- DYNAMICALLY LOADED SECTIONS (ALL)
- DYNAMICALLY LOADED SECTIONS (SINGLE)
- FOOTER
- LOADING & ERROR MESSAGES
- RESPONSIVE STYLES & HAMBURGER MENU
*/





/* ////////// VARIABLES ////////// */

:root {
    /* Layout */
    --content-max-width: 1200px;
    --section-min-width: 400px; 
    --section-max-width: 400px;

    /* General spacing */
    --spacing-xs: 0.5rem;
    --spacing-s: 1rem;
    --spacing-m: 2rem;
    --spacing-l: 3rem;
    --spacing-xl: 4rem;
    --spacing-xxl: 6rem;

    /* Icon size */
    --icon-size-s: 1.5rem;
    --icon-size-m: 2rem;
    
    /* Section spacing */
    --padding-button-vertical: 1rem;
    --padding-button-horizontal: 2rem;

    --padding-section: 4rem;
    --padding-section-vertical: 4rem;
    --padding-section-horizontal: 4rem;

    --padding-section-tablet-vertical: 3rem;
    --padding-section-tablet-horizontal: 6rem;


    --padding-section-mobile: 1rem;
    --padding-section-mobile-vertical: 2rem;
    --padding-section-mobile-horizontal: 1rem;

    /* Gap */
    --gap-small: 1rem;
    --gap-section: 2rem;
    --gap-text: 2rem;
    --gap-section-content: 2rem;
    --gap-nav-desktop: 3rem;
    --gap-nav-tablet: 2rem;

    /* Margin */
    --margin-m: 2rem;
    --margin-l: 4rem;
    --margin-xl: 8rem;

    /* Header */
    --header-top-bottom-padding: 1.5rem;
    --header-height: calc(2rem + (2 * var(--header-top-bottom-padding))); /* Logo + padding */

    /* Colors */
    --color-black: rgba(0, 0, 0, 1);
    --color-black-hover: rgba(80, 80, 80, 1);
    --color-grey: rgba(60, 60, 60, 1);
    --color-white: rgba(255, 255, 255, 1);
    --color-white-hover: rgba(160, 160, 160, 1);
    
    --color-text-black: rgba(17, 6, 6, 1);
    --color-text-white: rgba(255, 255, 255, 1);
    --color-text-white-hover: rgba(175, 175, 175, 1);

    --color-text-link: rgba(0, 0, 0, 1);
    --color-text-link-hover: rgba(100, 100, 100, 1);


    --color-background-black: rgba(39, 39, 39, 1);
    --color-background-white: rgba(255, 255, 255, 1);
    --color-background-grey: rgba(237, 237, 237, 1);

    --color-footer: rgb(17, 6, 6);

    /* Typografy */
    --font-size-xs: 0.8rem;
    --font-size-s: 0.85rem;
    --font-size-base: 1rem;
    --font-size-m: 1.1rem;
    --font-size-l: 1.25rem;
    --font-size-xl: 1.5rem;
    --font-size-xxl: 3rem;

    /* Border radius */
    --border-radius: 0.5rem;

    /* Image default height */
    --img-height: 300px;
}


/* ////////// FONTS ////////// */
@font-face {
    font-family: "Jost";
    src: url("/fonts/Jost-VariableFont_wght.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Overpass";
    src: url("/fonts/Overpass-VariableFont_wght.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Overpass";
    src: url("/fonts/Overpass-Italic-VariableFont_wght.woff2") format("woff2");
    font-weight: 100 900;
    font-style: italic;
    font-display: swap;
}







/* ////////// BASE RULES ////////// */

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

html, body {
    overscroll-behavior: none;
}

html {
    scroll-padding-top: 3rem;
}

body {

    overflow-y: scroll;
    height: 100vh;
    font-family: 'Overpass', 'Jost', sans-serif;
    color: var(--color-text-black);
}

h1, h2, h3 {
    font-family: 'Jost', serif;
    color: var(--color-text-black);
}

h1 { 
    font-size: var(--font-size-xxl);
    margin: 0;
}

h2 { 
    font-size: var(--font-size-xl);
    margin-bottom: var(--spacing-s);
}

h3 { font-size: var(--font-size-s); }

p {
    font-family: 'Overpass', Arial, sans-serif;
    font-size: var(--font-size-base);
    line-height: 1.6;
    font-weight: 300;
}

li {
    line-height: 1.75;
    font-size: var(--font-size-base);
    font-weight: 300;
}

.link {
    color: var(--color-text-link);
    text-decoration: underline;
}
  
.link:hover {
    color: var(--color-text-link-hover);
}

button{
    font-family: 'Overpass', Arial, sans-serif;
    font-size: var(--font-size-base);
    font-weight: 300;
}

.header__links a {
    font-family: 'Jost', Arial, sans-serif;
    font-size: var(--font-size-xl);
    font-weight: 500;
}


.icon {
    width: var(--icon-size-m);
    height: var(--icon-size-m);
    flex-shrink: 0;
}














/* ////////// HEADER & NAVIGATION ////////// */

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--color-background-black);
    z-index: 10;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.3);
}


/* Navigation container */
.header__nav {
    padding: var(--header-top-bottom-padding) 4rem;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    position: relative;
}


/* Logo */
.header__logo-image {
    position: relative;
    z-index: 11;
    height: 2rem;
}


/* Navigation buttons */
.header__link-icon {
    margin-right: 8px;
    width: var(--icon-size-s);
    height: var(--icon-size-s);
}

.header__links {
    contain: layout;
    display: flex;
    gap: var(--gap-nav-desktop);
}

.header__links a {
    font-size: var(--fontsize);
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--color-text-white);
    white-space: nowrap;
    position: relative;
    transition: opacity 0.3s ease;
}

.header__link:hover {
    color: var(--color-text-white-hover);
    transition: color 0.2s ease;
}

.header__links a::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    width: 100%;
    height: 2px;
    background-color: var(--color-white);
    transform: scaleX(0);
    transition: transform 0.1s ease-in-out;
}

.header__links a:active {
    opacity: 1;
    transform: scale(0.95);
}


/* Animation */
.header__links a.animate-left-right::after {
    transform-origin: left center;
}

.header__links a.animate-right-left::after {
    transform-origin: right center;
}

.header__links a.animate-left-right.active::after {
    transform: scaleX(1);
}

.header__links a.animate-right-left.active::after {
    transform: scaleX(1);
}









/* ////////// HERO-SECTION /////////// */

.hero {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    min-height: 100dvh;
    overflow: hidden;
    background-color: var(--color-text-white);
}

/* HERO VIDEO */
.hero__video {
    contain: strict;
    position: absolute; /* taustalle */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    transform: translateZ(0);
    will-change: transform;
    opacity: 0;
    transition: opacity 2.5s ease;
    object-fit: cover; /* säilyttää kuvasuhteen mutta peittää koko alueen */
    z-index: 2; /* muut elementit näkyville päälle */
}

.hero__video[data-loaded="true"] {
  opacity: 1;
}

/* Fallback kuva reduced motion käyttäjille */
.hero__video-fallback {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}



/* Hero-content */
.hero__content {
    position: absolute;
    display: flex;
    flex-direction: column;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    align-items: center;
    z-index: 5;
    width: 100%;
}

.hero__title {
    text-align: center;
    font-weight: 800;
    color: var(--color-text-black);
    line-height: 100%;
    letter-spacing: 0.05em;
}

.hero__subtitle {
    font-weight: 800;
}

    /*
    display: inline-block;
    position: relative;
    padding: 0.5rem;
    background: var(--color-background-black);
    border: none;
    color: var(--color-white);
    width: 100%;
    */

/* Tutustu työnäytteisiini */
.hero__button {
  /* Layout */
  max-width: fit-content;
  margin-top: var(--spacing-m);
  display: inline-block;
  position: relative;
  
  /* Teksti ja ikoni */
  padding: var(--padding-button-vertical) var(--padding-button-horizontal);
  scroll-margin-top: var(--header-height);
  
  background: var(--color-black);
  border: none;
  color: var(--color-white);
  cursor: pointer;
  transition: all 0.3s ease;
  
  &:hover {
    background: var(--color-black-hover);
    scale: 0.98;
  }
}









/* ////////// DYNAMICALLY LOADED SECTIONS (ALL) /////////// */

.section-wrapper {
    position: relative;
    z-index: 2;
    background: var(--color-background-white);
    margin-top: 100vh;
    min-height: 100vh;
}

.section {
    contain: paint layout;
    position: relative;
    padding: var(--padding-section-vertical) var(--padding-section-horizontal);
    background: var(--color-background-white);
    z-index: 5;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s, transform 0.5s;
}

.section.visible {
    opacity: 1;
    transform: translateY(0);
}

.section__container {
    max-width: var(--content-max-width);
    margin: 0 auto;
}

.section__content {
    display: flex;
    gap: var(--gap-section-content);
    flex-wrap: wrap;
}

.section__main-title {

    color: var(--color-text-black);
    margin-bottom: var(--margin-l);
}

.section__title {
    text-align: left;
    font-weight: 800;
    color: var(--color-text-black);
}

.section__text {
    display: flex;
    flex-direction: column;
    gap: var(--gap-text);
}

.section__text,
.section__media {
    flex: 1;
    min-width: var(--section-min-width);
}

.section__media-title {
    width: 100%;
}

.section__image {
    width: 100%;
    height: auto;
    display: block;
}

.text-block{
    display: grid;
    gap: var(--spacing-xs);

}

.text-block__content{
    margin-bottom: var(--margin-m);
}

/* Cards */
.cards{
    margin-top: var(--spacing-xs);
}

.card {
    display: flex;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-xs);
    align-items: center;
}

.card .icon {
    height: var(--icon-size-s);
}

/* Cards XL */

.skill__highlights {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
}

.cards-xl{
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: var(--gap-small);
}

.card-xl {
    gap: var(--spacing-xs);
    text-align: center;
    position: relative;
    padding: 0.5rem;
    background: var(--color-grey);
    border-radius: var(--border-radius);
    min-width: 150px;
}

.card-xl .icon {
    height: var(--icon-size-m);
}

.card-xl__title {
    color: var(--color-text-white);
}


/* List */
.list {
    list-style-type: square;
    padding-left: var(--spacing-m);
}











/* ////////// DYNAMICALLY LOADED SECTIONS (INDIVIDUAL) /////////// */


/* TYÖNÄYTTEENI */
#works{
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.3);
}

.section--works {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
}

.section--works .section__text {
    min-width: 160px;
}

.projects{
    display: grid;
    gap: var(--gap-section);
}

.project{
    margin-bottom: var(--padding-section);
}

.project__details{
    display: grid;
    gap: var(--gap-section);
}

.project__keywords {
    display: flex;
    flex-wrap: wrap;
    gap: var(--gap-section-content);
}

.project__keywords > div {
    flex: 1;
    min-width: 160px;
}

.project__keywords li, .project__keywords .card__title {
    font-size: var(--font-size-s);
}

.project-divider {
    width: 100%;
    height: 1px;
    background-color: var(--color-text-white-hover);
}

.project__video {
    max-width: 90vh;
    max-height: 90vh;
}



/* MINÄ */
.section--info{
background-color: var(--color-background-grey);
}

.section--info .section__media {
    display: flex;
    flex: 0 1 auto;
    flex-wrap: wrap;
    justify-content: right;
    gap: 1rem;
}




.section--info .section__media img {
    height: var(--img-height);
    width: auto;
}




/* OTA YHTEYTTÄ */
.section--contact .section__media {
    display: flex;
    flex: 1 0 auto;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.section--contact .section__media img {
    height: var(--img-height);
    width: auto;
}

.section--contact .icon {
    width: var(--icon-size-s);
    height: var(--icon-size-s);
}









/* ////////// ACCORDION /////////// */
.accordion {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.accordion__toggle {
  /* Layout */
  max-width: fit-content;
  margin-top: var(--spacing-m);
  margin-bottom: var(--spacing-xxl);
  display: inline-block;
  position: relative;
  
  /* Teksti ja ikoni */
  padding: 14px 48px 14px 24px;
  scroll-margin-top: var(--header-height);
  
  /* Oletustyylit (suljettu tila) */
  background: var(--color-black);
  border: none;
  color: var(--color-white);
  cursor: pointer;
  transition: all 0.3s ease;
  
  &::after {
    content: "Lue lisää tästä projektista";
  }
  
  &:hover {
    background: var(--color-black-hover);
    scale: 0.98;
  }
}

/* Plus-merkki ikoni suljettuun tilaan */
.accordion__toggle::before {
  content: "+";
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  line-height: 1;
}

/* AVOINNA TILA - TÄSSÄ KAIKKI MUUTOKSET */
.accordion__toggle.is-open {
  background: var(--color-background-white);
  border: 1.5px solid var(--color-black);
  color: var(--color-black);
}

.accordion__toggle.is-open:hover {
  background: var(--color-white-hover);
}

.accordion__toggle.is-open::before {
  content: "−";
}

/* Avoinna-tila */
.accordion.is-open .accordion__toggle {
  order: 3;
  
  &::after {
    content: "Näytä vähemmän";
  }
  
  &::before {
    transform: translateY(-50%) rotate(180deg);
  }
}

/* Piilota span jos käytät ::after */
.accordion__text {
  display: none;
}

/* Sisältö */
.accordion__content {
  order: 2;
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  margin-top: 0;
  scroll-margin-top: var(--header-height);
  width: 100%;
  transition: 
    grid-template-rows 0.6s ease-out,
    opacity 0.6s ease-out,
    margin-top 0.6s ease-out;
}

.accordion__content > * {
  overflow: hidden;
  min-height: 0;
  /* Vain opacity fade sulkeutuessa, ei transformia */
  transition: opacity 0.6s ease-out;
}

.accordion__content.is-open {
  grid-template-rows: 1fr;
  opacity: 1;
  margin-top: var(--spacing-xl);
}

.accordion__content.is-open > * {
  /* Avaamisessa voi olla transform */
  transform: translateY(0);
  transition: transform 0.2s ease-out, opacity 0.2s ease-out;
}


/* HEART HOVER */

.heart-float {
  position: fixed;
  font-size: 1.5rem;
  pointer-events: none;
  user-select: none;
  z-index: 2;
  
  /* Starting position (set via JS as viewport coordinates) */
  left: var(--start-x, 0);
  top: var(--start-y, 0);
  
  /* Initial state - invisible and small */
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.3);
  
  /* Smooth transitions */
  transition: none;
}

.heart-float.animating {
  /* Animate to final position with custom easing */
  animation: heartFloat var(--duration, 2500ms) cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes heartFloat {
  0% {
    opacity: 0;
    transform: 
      translate(-50%, -50%) 
      translateX(0) 
      translateY(0) 
      scale(0.3) 
      rotate(0deg);
  }
  
  10% {
    opacity: 1;
    transform: 
      translate(-50%, -50%) 
      translateX(0) 
      translateY(0) 
      scale(var(--scale, 1)) 
      rotate(0deg);
  }
  
  100% {
    opacity: 0;
    transform: 
      translate(-50%, -50%) 
      translateX(var(--drift-x, 0)) 
      translateY(var(--drift-y, -100vh)) 
      scale(var(--scale, 1)) 
      rotate(var(--rotation, 0deg));
  }
}

/* Optional: Add slight blur when moving fast */
@media (prefers-reduced-motion: no-preference) {
  .heart-float.animating {
    filter: blur(0px);
    animation: heartFloat var(--duration, 2500ms) cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards,
               heartBlur var(--duration, 2500ms) ease-in-out forwards;
  }
  
  @keyframes heartBlur {
    0%, 15% {
      filter: blur(0px);
    }
    50% {
      filter: blur(0.5px);
    }
    85%, 100% {
      filter: blur(0px);
    }
  }
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  .heart-float.animating {
    animation: heartFloatReduced var(--duration, 2500ms) ease-out forwards;
  }
  
  @keyframes heartFloatReduced {
    0% {
      opacity: 0;
      transform: translate(-50%, -50%) scale(0.5);
    }
    20% {
      opacity: 1;
    }
    100% {
      opacity: 0;
      transform: translate(-50%, -50%) translateY(-50px) scale(0.8);
    }
  }
}










/* ////////// FOOTER ////////// */

/* Footer */
.footer {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    flex-direction: column;
    background-color: var(--color-footer);
    color: var(--color-text-white);
    width: 100%;
    position: relative;
    z-index: 2; 
}

/* Määritetään CSS-muuttuja opasiteetille */
.footer {
    --cover-opacity: 1;
}

/* Pseudo-elementti, joka peittää footerin */
.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-white);
    transition: opacity 0.8s ease;
    opacity: var(--cover-opacity);
    pointer-events: none;
    z-index: 1;
}

.footer__grid {
    display: flex;
    flex-wrap: wrap;
    line-height: 1.6;
    justify-content: flex-start;
    margin-left: var(--spacing-xl);
    margin-top: var(--spacing-m);
    margin-bottom: var(--spacing-m);
    gap: var(--spacing-l);

}

.footer__title{
    color: var(--color-text-white);
}

.footer__resource-link {
    color: var(--color-text-white-hover);

}

.footer__resource-link:hover {
    color: var(--color-text-white);
}

.footer__text--italic{
    color: var(--color-text-white);
    font-style: italic;
    max-width: 725px;
}

.footer__text--italic span {
    font-family: 'EmojiFont', sans-serif;
    font-style: normal;
}

/* Licenses */
.footer__extra {
    contain: content;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.2s ease-in-out, opacity 0.2s ease-in-out;
    transform-origin: top;
    margin-top: var(--spacing-s);
    margin-left: var(--spacing-xl);
    margin-right: var(--spacing-xl);
}

.footer__extra.show {
    opacity: 1;
    margin-top: var(--spacing-s);
    margin-bottom: var(--spacing-m);
}

.footer__toggle {
    color: var(--color-text-white);
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: underline;
}

.footer__toggle:hover {
    color: var(--color-text-white-hover);
}










/* ////////// LOADING & ERROR MESSAGES /////////// */
.error-message {
    text-align: center;
    padding: var(--spacing-m);
    color: rgba(102, 102, 102, 1);
    max-width: 600px;
    margin: 0 auto;
}

.error-message h2 {
    color: var(--color-text-black);
    margin-bottom: var(--spacing-s);
}

.section__loading {
    display: block;
    color: var(--color-text-black);
}




















/* /////////// RESPONSIVE STYLES & HAMBURGER MENU /////////// */

/* Hamburger button */

.header__hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 5;
    position: relative;
}

.header__hamburger-line {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px 0;
    background-color: var(--color-white);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.header__hamburger:hover .header__hamburger-line {
    background-color: var(--color-text-white-hover);
  }

/* 1100px – NARROW DESKTOP */
   @media (max-width: 1100px) {
    /* Navigaation muutokset */
    .header__links {
        gap: var(--gap-nav-tablet);
    }
    
    .header__links .header__link-icon {
        display: none;
    }
}

/* Reset hamburger over tablet size */
   @media (min-width: 901px) {
    /* Critical: Reset all mobile menu transforms and positioning */
    .header__links {
        position: static !important;
        transform: none !important;
        height: auto !important;
        width: auto !important;
        padding-top: 0 !important;
        overflow: visible !important;
    }
    
    /* Reset link animations */
    .header__links a {
        opacity: 1 !important;
        transform: none !important;
        transition-delay: 0s !important;
    }
   }


/* 900px – TABLET */
@media (max-width: 900px) {
    
    /* Hamburger menu */
    .header__hamburger {
        display: block;
    }

    .header__hamburger.active .header__hamburger-line:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    
    .header__hamburger.active .header__hamburger-line:nth-child(2) {
        opacity: 0;
    }
    
    .header__hamburger.active .header__hamburger-line:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }


    /* Menu */
    .header__links {
        position: fixed;
        top: 0;
        right: 0;
        width: 100%;
        height: 100vh;
        height: 100dvh; /* Dynamic viewport height for mobile browsers */
        background: var(--color-background-black);
        flex-direction: column;
        justify-content: center;
        gap: var(--spacing-m);
        
        /* Initial position - off screen */
        transform: translateX(100%);
        
        /* No transition by default - prevents flash on resize */
        transition: none;
        
        z-index: 2;
        
        /* Smooth scrolling if menu items overflow */
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        
        /* Add padding-top to account for header */
        padding-top: var(--header-height);
    }
    
    /* Enable transition when opening */
    .header__links.active {
        transform: translateX(0);
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    /* Enable transition when closing */
    .header__links.closing {
        transform: translateX(100%);
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    }

    body:has(.header__hamburger.active){
        overflow: hidden;
    }

    
    .header__links a {
        font-size: var(--font-size-xxl);
        padding: var(--spacing-s) var(--spacing-m);
        width: 100%;
        display: flex;
        align-items: center;
        /* Always have transition ready */
        transition: padding 0.3s ease, color 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
        transition-delay: 0s;
    }
    
    /* Initial state when menu is NOT active - hidden */
    .header__links:not(.active):not(.closing) a {
        opacity: 0;
        transform: translateX(30px);
        /* Disable transitions when not active/closing to prevent flash on resize */
        transition: none;
    }
    
    /* When menu is active (opening), fade in links with stagger */
    .header__links.active a {
        opacity: 1;
        transform: translateX(0);
    }
    
    .header__links.active a:nth-child(1) { transition-delay: 0.2s; }
    .header__links.active a:nth-child(2) { transition-delay: 0.25s; }
    .header__links.active a:nth-child(3) { transition-delay: 0.3s; }
    .header__links.active a:nth-child(4) { transition-delay: 0.25s; }
    .header__links.active a:nth-child(5) { transition-delay: 0.3s; }
    .header__links.active a:nth-child(6) { transition-delay: 0.35s; }
    
    /* When closing, fade out links instantly (no delay) */
    .header__links.closing a {
        opacity: 0;
        transform: translateX(30px);
        transition-delay: 0s;
    }
    
    /* Active navigation button */
    .header__links a.active {
        background-color: rgba(255, 255, 255, 0.1);
    }
    
    .header__links a::after {
        left: 0;
        top: 0;
        width: 4px;
        height: 100%;
    }
    
    .header__links a.active::after {
        transform: scaleY(1);
    }
    
    .header__links .header__link-icon {
        width: var(--icon-size-m);
        height: var(--icon-size-m);
        margin-right: 1.5rem;
        display: inline-block;
    }
    
    .header__nav {
        padding: var(--padding-section-mobile);
    }

    .header__logo-image {
        padding: 0;
    }
    
    .section {
        padding: var(--padding-section-tablet-vertical) var(--padding-section-tablet-horizontal);
    }

    .section__content {
        flex-direction: column;
    }

    .footer__grid {
        margin-left: var(--padding-section-mobile);
        margin-right: var(--padding-section-mobile);
    }

    .footer__toggle {
        margin-right: var(--padding-section-mobile);
    }

    .footer__extra {
        margin-left: var(--padding-section-mobile);
        margin-right: var(--padding-section-mobile);
    }

    .section--info .section__media {
    justify-content: center;
    flex: none;
    flex-direction: row;
    }

    .section--contact .section__media {
        width: 100%;
        justify-content: flex-start;
    }

    .section__media,
    .section__text{
        max-width: 600px;
        min-width: 360px;
    }
}


/* 768px – MOBILE larger */

@media (max-width: 768px) {

    :root {
        --header-height: calc(2rem + (2 * 0.75rem)); /* Update for mobile logo + padding */
    }

    .header__nav {
        padding: 0.75rem 1rem;
    }

    .footer__grid {
        gap: var(--spacing-s);
    }

    .section {
    padding: var(--padding-section-mobile-vertical) var(--padding-section-mobile-horizontal);
    }
    
    .section__content {
        gap: var(--spacing-m);
    }


}


/* 480px – MOBILE smaller */

@media (max-width: 480px) {

    :root {
        --header-height: calc(1.25rem + (2 * 0.75rem)); /* Smaller logo on mobile */
    }

    .header__links a {
        font-size: var(--font-size-xl);
    }

    .header__logo-image{
        height: 1.25rem;
    }

    .section {
        padding: var(--padding-section-mobile-vertical) var(--padding-section-mobile-horizontal);
    }

    .section__text,
    .section__media {
        min-width: 280px;
    }

    .section--contact .section__media img {
            width: 100%;
            height: auto;
            display: block;
        }
}