:root{
  --c1: #5b4d76;
  --c2: #1f3a61;
  --c3: #4d1d1d;
  --c4: #5a541d;
  --text: #ddb9b9;
  --muted: rgba(255,255,255,0.7);
  --card: rgba(0,0,0,0.4);
  --card-border: rgba(255,255,255,0.1);
  --accent: #55aaff;
  --shadow: 0 10px 30px rgba(0,0,0,0.5);
  --maxw: 2500px;
  --radius: 30px;
  --transition: 0.3s ease;

}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  color: var(--text);
  height: 100vh;
  overflow: hidden;
  position: relative;
  background:
    radial-gradient(1200px 800px, var(--c1), transparent 60%),
    radial-gradient(1000px 700px, var(--c2), transparent 60%),
    radial-gradient(900px 900px, var(--c3), transparent 60%),
    radial-gradient(800px 800px, var(--c4), transparent 60%),
    #0a081c;
  background-repeat: no-repeat;
  animation: drift 30s ease-in-out infinite;
  overflow-x: hidden;
}

@keyframes drift {
  0%{ background-position: 20% 20%, 78% 30%, 35% 80%, 65% 70%; }
  25%{ background-position: 30% 40%, 65% 20%, 50% 70%, 55% 90%; }
  50%{ background-position: 45% 15%, 85% 45%, 20% 90%, 75% 55%; }
  75%{ background-position: 15% 35%, 90% 20%, 45% 85%, 60% 80%; }
  100%{ background-position: 20% 20%, 78% 30%, 35% 80%, 65% 70%; }
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="400" height="400" viewBox="0 0 400 400"><defs><filter id="f"><feTurbulence type="fractalNoise" baseFrequency="0.01 0.015" numOctaves="2" seed="3"/><feDisplacementMap in="SourceGraphic" scale="9"/></filter></defs><rect width="100%" height="100%" fill="none" filter="url(%23f)"/></svg>');
  opacity: 0.1;
  mix-blend-mode: overlay;
  animation: flow 30s linear infinite;
  pointer-events: none;
}

@keyframes flow {
  0% { transform: translate3d(0,0,0) scale(1.05); }
  50% { transform: translate3d(-2%,1%,0) scale(1.08); }
  100% { transform: translate3d(2%,-1%,0) scale(1.05); }
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 20px;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header.button {
  display: flex;
  justify-content: space-between;
}

.header h1 {
  margin: 0;
  font-size: 1.2rem;
  color: var(--muted);
  display: flex;
  flex-direction: column;
}

.theme-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--card-border);
  font-size: 18px;
  margin-right: 250px;
  top: 30px;
  right: 55px;
  z-index: 3000;
  position: fixed;
  cursor: pointer;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition), background var(--transition);
}

.theme-btn:hover {
  background: rgba(255,255,255,0.25);
  transform: scale(1.1);
}

.language {
  margin-right: 35px;
  position: fixed;
  top: 24px;
  right: 140px;
  z-index: 3000;
}

.language .button {
  margin-right: 12px;
}

.container {
  height: 100vh;
  overflow: hidden;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.card-stack-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.card {
  position: absolute;
  opacity: 0;
  visibility: hidden;
  transform: translateY(100px) scale(0.95);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1.61, 0.36, 1);
  padding: 28px;
  box-sizing: border-box;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  max-width: 950px;
  max-height: 80vh;
  overflow-y: auto;
}

.card.active:hover {
  box-shadow: 0 16px 40px rgba(255,255,255,0.3);
  transform: translateY(-2px) scale(1.03);
}

.card.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  z-index: 2;
}

.card.exit-up { opacity: 0; transform: translateY(-100px) scale(0.9); z-index: 1; }
.card.exit-down { opacity: 0; transform: translateY(100px) scale(0.9); z-index: 1; }
.card.enter-up { opacity: 0; transform: translateY(200px) scale(1.05); z-index: 3; }
.card.enter-down { opacity: 0; transform: translateY(-200px) scale(1.05); z-index: 3; }

.portal-card {
  padding: 28px;
  box-sizing: border-box;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  width: 100%;
}

h1 { font-size: clamp(28px, 4vw, 44px); margin: 10px 0 14px; font-weight: 700; }
h2 { font-size: clamp(22px, 3vw, 30px); margin: 0 0 12px; font-weight: 600; }
p { line-height: 1.7; font-size: 1.05rem; color: var(--muted); }
strong { color: #c4a6a6; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 18px;
}

.button, .nav a {
  display: inline-flex;
  align-items: center;
  justify-content: left;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 14px;
  border: 1px solid var(--card-border);
  background: rgba(255,255,255,0.12);
  color: #c4a6a6;
  text-decoration: none;
  font-weight: 500;
  transition: transform var(--transition), background var(--transition), box-shadow var(--transition);
  box-shadow: var(--shadow);
}

.button:hover, .nav a:hover {
  transform: translateY(-2px) scale(1.03);
  background: rgba(255,255,255,0.18);
  box-shadow: 0 12px 28px rgba(0,0,0,0.3);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.footer {
  opacity: 0.85;
  font-size: 0.95rem;
  text-align: center;
  padding: 30px 0 10px;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 10;
  backdrop-filter: blur(6px);
}

hr { border: none; border-top: 1px solid var(--card-border); margin: 24px 0; }

.pager {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
}

.pager a { flex: 1 1 auto; text-align: center; }
.pager a.secondary { background: rgba(0,0,0,0.15); }

body::after{
  content:"";
  position: fixed;
  inset: -12%;
  pointer-events: none;
  background: conic-gradient(from 210deg at 50% 50%, var(--c1) 0%, var(--c2) 25%, var(--c3) 55%, var(--c4) 80%, var(--c1) 100%);
  filter: blur(120px) saturate(120%);
  opacity: 0.45;
  mix-blend-mode: screen;
  animation: swirl 40s linear infinite;
  will-change: transform;
}

@keyframes swirl { to { transform: rotate(360deg); } }

.container { position: relative; }

.side-nav {
  position: relative;
  top: 75px;
  right: -12.5%;
  width: 250px;
  z-index: 100;
}

.side-nav .grid { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.side-nav h1 { text-align: center; }

.portal-sidebar {
  position: fixed;
  top: 0; right: 0;
  width: 320px; height: 100vh;
  background: var(--card, rgba(255,255,255,0.08));
  box-shadow: -4px 0 24px rgba(0,0,0,0.25);
  z-index: 2000;
  transform: translateX(100%);
  transition: transform 0.3s var(--transition, ease);
  display: flex; flex-direction: column; align-items: stretch;
  padding: 0 0 24px 0;
}

.portal-sidebar.active { transform: translateX(0); }

body.portal-open main, body.portal-open header, body.portal-open footer { filter: blur(6px); pointer-events: none; user-select: none; }

.portal-open-btn {
  position: fixed;
  top: 24px; right: 32px;
  z-index: 3000;
  padding: 12px 24px;
  font-size: 1rem;
  border-radius: 30px;
  background: var(--c2, #1b62ff);
  color: #a6c0c4;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  transition: background 0.2s, opacity 0.5s ease 0.5s, visibility 0.5s ease 0.5s;
  opacity: 1;
  visibility: visible;
}

.portal-open-btn:hover { background: var(--c1, #7b5bd6); }

body.portal-open .portal-open-btn { opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0.3s ease; pointer-events: none; }

@media (max-width: 900px) {
  .side-nav { position: static; width: 100%; margin: 0 0 20px 0; }
}

.dot-nav { 
  position: fixed; 
  top: 50%; 
  right: 60px;
  transform: translateY(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center; 
}

.dot-nav-box { 
  background: rgba(30,30,40,0.418);
  border-radius: 18px;
  box-shadow: 0 4px 24px rgba(255,255,255,0.548);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}

.dot-nav .dot { 
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #bbb;
  opacity: 0.5;
  transition: background 0.3s, opacity 0.3s, transform 0.3s;
  cursor: pointer;
  border: 2px solid transparent;
}

.dot-nav .dot.active { 
  background: var(--c2, #1b62ff);
  opacity: 1;
  transform: scale(1.2);
  border-color: #fff;
}

.team-images { 
  display: flex;
  justify-content: space-between; 
  align-items: center; 
  gap: 20px; 
  margin-top: 20px; 
}

.team-images section { 
  flex: 1; 
  display: flex; 
  justify-content: center; 
}

.team-images img { 
  max-width: 100%; 
  height: auto; 
  border-radius: 12px; 
  box-shadow: 0 4px 10px rgba(0,0,0,0.2); 
}

#github a { 
  color: inherit; 
  font-weight: inherit; 
}

#scroll-info { 
  display: flex; 
  justify-content: center; 
  align-items: center; 
  text-align: center; 
}

a.logo h1 { 
  margin: 0; 
}

a.logo { 
  display: inline-block; 
  text-decoration: none; 
  color: inherit; 
}

#how a { 
  color: inherit;
  text-decoration: underline;
 }


.close-btn { 
  position: absolute;
  top: 10px; 
  left: 10px; 
  font-weight: bold; 
  font-size: 18px; 
  color: var(--text); 
  background: var(--card); 
  border: 1px solid var(--card-border); 
  border-radius: var(--radius); 
  box-shadow: var(--shadow); 
  backdrop-filter: blur(8px); 
  padding: 8px 14px; cursor: pointer; 
  z-index: 1000; transition: transform var(--transition), box-shadow var(--transition); 
}

.close-btn:hover { 
  transform: translateY(-2px) scale(1.03); 
  background: rgba(255,255,255,0.18);
  box-shadow: 0 12px 28px rgba(0,0,0,0.3);
}


.team-container { 
  display: flex; 
  justify-content: center; 
  align-items: flex-start; 
  gap: 40px; margin-top: 30px; 
}

.team-member { 
  display: flex; 
  flex-direction: column; 
  align-items: center; 
  text-align: center; 
}

.team-member img { 
  max-width: 150px; 
  aspect-ratio: 3/4; 
  object-fit: cover; 
  border-radius: var(--radius); box-shadow: var(--shadow); 
  margin-bottom: 8px; 
}

.team-member.leo img { 
  max-width: 200px; 
}

@media (max-width: 900px) {

  .card { 
    max-width: 95%; 
    margin: 0 auto; 
  }

  .dot-nav { 
    position: fixed; 
    bottom: 20px; 
    top: auto;
    right: 50%; 
    transform: translateX(50%); 
    flex-direction: row; 
  }
  
  .dot-nav-box { 
    flex-direction: row; 
    padding: 10px 14px; 
    gap: 12px; 
    box-shadow: 0 4px 12px rgba(255,255,255,0.3); 
  }
  
  .side-nav { 
    position: static; 
    width: 100%; 
    margin: 12px 0; 
    display: flex; 
    justify-content: center; 
  }
  
  .side-nav .grid { 
    flex-direction: row; 
    flex-wrap: wrap; gap: 12px; 
  }

}

@media (max-width: 600px) {

  .card.active { 
    transform: scale(0.8);
    transform-origin: top center;
    max-width: 90%;
    max-height: 90vh; 
    margin-top: 70px; 

  }
  .card.active * { 
    margin: 0.8em 0;
  }

  .card.active img { 
    max-width: 100%;
    height: auto;
  }

  .card.active .grid { 
    gap: 8px;
  }

  .card.active:hover { 
    transform: scale(0.8) translateY(0); 
    box-shadow: var(--shadow); 
  }
  
}
