:root {
  --bg-color: #0a0a0a;
  --accent-color: #ff0000;
  --text-main: #ffffff;
  --text-dimmed: #888;
  --sidebar-width: 300px;
  --nav-speed: 0.3s;
}

body {
  margin: 0;
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  display: flex;
  flex-direction: row;
  overflow-x: hidden;
  overflow-y: scroll;
}

/* --- LATAUSRUUTU --- */
#loader {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: #000; display: flex; justify-content: center; align-items: center;
  z-index: 9999; transition: opacity 0.8s ease;
}
#loader h1 {
  font-size: clamp(30px, 6vw, 80px);
  font-weight: 200;
  letter-spacing: 12px;
  text-indent: 12px;
  opacity: 0;
  text-transform: none;
  animation: introText 0.8s ease forwards;
}
@keyframes introText { to { opacity: 1; } }

/* --- TAKAISIN YLÖS --- */
.back-to-top { 
    position: fixed; bottom: 40px; right: 40px; display: none; 
    background: #111; color: #ffffff; border: none; 
    width: 55px; height: 55px; border-radius: 50%; 
    font-size: 18px; cursor: pointer; z-index: 1000; 
    transition: all 0.4s ease; display: flex; justify-content: center; align-items: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}
.back-to-top svg { position: absolute; top: 0; left: 0; transform: rotate(-90deg); width: 55px; height: 55px }
.back-to-top circle { fill: none; stroke-width: 3 }
.progress-bg { stroke: rgba(255, 255, 255, 0.1) }
.progress-bar { stroke: var(--accent-color); stroke-dasharray: 157; stroke-dashoffset: 157; transition: stroke-dashoffset 0.1s linear }


/* --- SIVUPALKKI --- */
aside {
  width: var(--sidebar-width);
  height: 100vh;
  position: fixed;
  left: 0; top: 0;
  padding: 60px 40px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #1a1a1a;
  background: var(--bg-color);
  overflow-y: auto;
  z-index: 100;
}

.logo {
  font-size: 20px;
  letter-spacing: 3px;
  text-decoration: none;
  color: var(--text-main);
  margin-bottom: 60px;
  display: block;
  line-height: 1.1;
  font-weight: 300;
  text-transform: none;
}

nav { 
  display: flex; 
  flex-direction: column; 
  gap: 18px;
  margin-bottom: 40px;
}

nav a {
  text-decoration: none;
  color: var(--text-dimmed);
  font-size: 13px; 
  letter-spacing: 1px;
  transition: all var(--nav-speed) ease-out;
  line-height: 1.4;
  display: inline-block;
  text-transform: none;
}

nav a:hover { color: var(--text-main); transform: translateX(4px); }

nav a.active { 
  color: var(--text-main); 
  font-size: 14px;
  font-weight: 400;
  border-left: 2px solid var(--accent-color);
  padding-left: 15px;
  margin-left: -17px;
  pointer-events: none;
}

/* --- MASTERS LISÄYKSET TÄSSÄ --- */
nav a.masters-nav-item {
  color: #fff;
  border-left: 2px solid transparent;
  padding-left: 15px;
  margin-left: -17px;
  margin-top: 15px;
  margin-bottom: 10px;
}
nav a.masters-nav-item span {
  display: block;
  font-size: 10px;
  color: var(--text-dimmed);
  margin-top: 5px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
nav a.masters-nav-item.active {
  border-left: 2px solid var(--accent-color);
}


.info-nav { margin-top: auto; padding-top: 30px; border-top: 1px solid #1a1a1a }
.ig-link { margin-top: 20px; color: #ffffff; transition: all 0.3s ease; opacity: 0.7 }
.ig-link:hover { color: var(--accent-color); transform: scale(1.1); opacity: 1 }


/* --- MOBIILIOTSIKKO --- */
.mobile-header {
  display: none;
  margin-bottom: 45px;
  padding-top: 10px;
}
.mobile-logo {
  font-size: 17px;
  letter-spacing: 3px;
  font-weight: 300;
  margin-bottom: 30px;
  line-height: 1.2;
}
.mobile-page-title {
  font-size: 14px;
  color: var(--text-main);
  letter-spacing: 4px;
  font-weight: 300;
  text-transform: none;
}

/* --- GRID & MAIN --- */
main {
  margin-left: var(--sidebar-width);
  width: calc(100% - var(--sidebar-width));
  padding: 40px;
  box-sizing: border-box;
  min-height: 100vh;
}
.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 20px;
}
.overview-item img { width: 100%; height: auto; display: block; opacity: 0.9; transition: opacity 0.5s ease; }

/* 1x1 Neliö merkkiä varten */
.overview-item.badge-item img {
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background-color: #050505;
  border: 1px solid #1a1a1a;
  padding: 15%;
  box-sizing: border-box;
}

.content-wrapper { max-width: 900px; margin: 0 auto; padding: 100px 50px }

.intro-section { margin-bottom: 140px; border-bottom: 1px solid #1a1a1a; padding-bottom: 80px }
.intro-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 70px }
.intro-title { font-size: 12px; letter-spacing: 4px; text-transform: none; color: #ffffff; margin-bottom: 35px; font-weight: 300 }
.intro-text { font-size: 17px; line-height: 1.7; color: #bbb; font-weight: 300; text-align: left }

.image-section { 
    margin-bottom: 160px; position: relative; 
}

/* --- VIEW TRANSITIONS API --- */
@view-transition {
  navigation: auto;
}
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.5s;
}

/* --- STAGGERED LOAD ANIMATION --- */
.stagger-item {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.stagger-item.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.gallery-img { 
    --border-opacity: 0.02; 
    width: 100%; height: auto; display: block; border-radius: 0; cursor: zoom-in; transition: all 0.5s ease; background-color: #111; border: 20px solid rgba(255, 255, 255, var(--border-opacity)); box-sizing: border-box; 
}
.gallery-img:hover { transform: scale(1.01); box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6) }

.project-info { margin-top: 25px; font-size: 14px; letter-spacing: 2px; color: #ffffff; line-height: 1.6; font-weight: 300; }
.project-info p:last-child { color: #cccccc; font-size: 12px; margin-top: 6px; letter-spacing: 1.5px; }

/* --- ABOUT SIVU --- */
.about-grid { display: flex; align-items: flex-start; gap: 60px }
.image-container { flex: 0 0 250px; position: sticky; top: 100px; overflow: hidden; border-radius: 2px }
.image-container img { width: 100%; height: auto; display: block }
.about-text { flex: 1; padding-bottom: 50px }
.about-text h1 { font-size: 32px; font-weight: 300; letter-spacing: 6px; text-transform: uppercase; margin-bottom: 40px; margin-top: 0 }
.about-section { margin-bottom: 30px }
.about-text p { font-size: 16px; line-height: 1.8; color: #bbbbbb; margin: 0 }




/* --- KONTAKTI --- */
.contact-section {
  max-width: 1200px;
  margin: 100px auto 0 auto;
  padding: min(100px, 12vh) 40px;
  background: #000;
  border-top: 1px solid #1a1a1a;
  box-sizing: border-box;
  text-align: left;
}
.contact-wrapper { max-width: 900px }
.contact-title { font-size: clamp(24px, 5vw, 32px); letter-spacing: 6px; margin-bottom: 40px; font-weight: 300; text-transform: none; }
.contact-info { font-size: clamp(14px, 2vw, 17px); color: var(--text-dimmed); line-height: 2.2; letter-spacing: 0.5px; }
.contact-info a { color: var(--accent-color); text-decoration: none; }
.copyright { margin-top: 80px; font-size: 10px; color: #333; letter-spacing: 2px; }

/* --- HAMPURILAINEN --- */
.menu-toggle {
  display: none;
  position: fixed; top: 30px; right: 30px;
  width: 44px; height: 44px;
  background: none; border: none; cursor: pointer;
  z-index: 2000;
}
.hamburger { width: 25px; height: 2px; background: #fff; position: relative; transition: all 0.4s ease; }
.hamburger::before, .hamburger::after { content: ''; width: 25px; height: 2px; background: #fff; position: absolute; left: 0; transition: all 0.4s ease; }
.hamburger::before { top: -8px; }
.hamburger::after { top: 8px; }
.menu-open .hamburger { background: transparent; }
.menu-open .hamburger::before { top: 0; transform: rotate(45deg); }
.menu-open .hamburger::after { top: 0; transform: rotate(-45deg); }

/* --- RESPONSIVISUUS --- */
@media (max-width: 1024px) {
  aside {
    position: fixed; left: -100%; width: 100%; height: 100vh;
    transition: left 0.5s cubic-bezier(0.77, 0, 0.175, 1);
    z-index: 1500; background: rgba(10, 10, 10, 0.98); padding: 120px 40px;
  }
  body.menu-open aside { left: 0; }
  .menu-toggle { display: flex; align-items: center; justify-content: center; position: relative; top: auto; right: auto; }
  main { margin-left: 0; width: 100%; padding: 120px 20px 40px; }
  
  .mobile-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    position: fixed; 
    top: 0; left: 0; width: 100%;
    padding: 20px 30px; 
    box-sizing: border-box;
    z-index: 2000;
    transition: transform 0.3s ease-in-out, background-color 0.3s ease-in-out, backdrop-filter 0.3s ease-in-out;
  }
  .mobile-header.header--hidden {
    transform: translateY(-100%);
  }
  .mobile-header.is-scrolled {
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
  .mobile-logo {
    margin-bottom: 0;
  } 
  
  .overview-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .content-wrapper { padding: 40px 0; }
  .intro-grid { grid-template-columns: 1fr; gap: 30px }
  
  .about-grid { flex-direction: column; gap: 40px; align-items: center }
  .image-container { position: relative; top: 0; flex: 0 0 auto; width: 100%; max-width: 250px }
  .about-text { text-align: left; max-width: 100%; padding-bottom: 20px; }
}

/* --- EVÄSTEBANNERI --- */
#cookie-banner {
  position: fixed;
  bottom: 20px;
  right: 20px;
  max-width: 400px;
  background-color: rgba(15, 15, 15, 0.95);
  border: 1px solid #333;
  padding: 20px;
  z-index: 9998; /* Alle latausruudun, mutta yli muun */
  display: none; /* Piilotettu oletuksena (JS näyttää tarvittaessa) */
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
}
#cookie-banner p {
  font-size: 12px;
  color: var(--text-dimmed);
  line-height: 1.6;
  margin: 0 0 15px 0;
}
.cookie-buttons {
  display: flex;
  gap: 10px;
}
.cookie-btn {
  background: none;
  border: 1px solid #333;
  color: #fff;
  padding: 8px 15px;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s ease;
}
.cookie-btn:hover {
  border-color: #fff;
}
.cookie-btn.accept {
  border-color: #4caf50; /* Vihreä väri */
  color: #4caf50;
}
.cookie-btn.accept:hover {
  background-color: #4caf50;
  color: #fff;
}
@media (max-width: 768px) {
  #cookie-banner {
    bottom: 0;
    right: 0;
    left: 0;
    max-width: 100%;
    border-width: 1px 0 0 0;
  }
}