/* Dark "moonlit night" theme */
html {
  width: 100%;
  height: 100%;
  /* Radial gradient from center (black) to edges (dark deep blue) */
  background: radial-gradient(ellipse at center, #01060c 0%, #0a1a2b 100%);
  position: relative;
  overflow-x: hidden;
}

/* Starfield background canvas */
#starfieldCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  opacity: 0.4;
}

body {
  margin: 0;
  width: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', system-ui, sans-serif;
  color: #e0e6f0;
  /* Transparent to show html's radial gradient */
  background: transparent;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.01em;
}

/* Hidden SEO keywords - visible to search engines but not users */
.seo-keywords {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

/* Link hover effects */
a {
  color: #c3dafe;
  text-decoration: none;
  transition: all 0.2s ease;
}

a:hover {
  color: #d4e4ff;
  text-decoration: underline;
  text-decoration-color: rgba(212, 228, 255, 0.5);
  text-underline-offset: 2px;
}

a.pill:hover {
  text-decoration: none;
}

h1 {
  margin-top: 1rem;
  font-size: 2.5rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: -0.02em;
  line-height: 1.1;
  background: linear-gradient(135deg, #f5faff 0%, #c3dafe 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 2px 20px rgba(245, 250, 255, 0.1);
}

.tagline {
  font-style: italic;
  text-align: center;
  margin-bottom: 3rem;
  font-size: 1.1rem;
  line-height: 1.6;
  color: #c3dafe;
  opacity: 0.9;
  letter-spacing: 0.01em;
  transition: opacity 0.3s ease, color 0.3s ease;
}

.tagline:hover {
  opacity: 1;
  color: #d4e4ff;
}

.canvas-wrapper {
  position: relative;
  width: 100%;
  max-width: 800px;
  margin: 2rem auto;
}

#ballCanvas {
  width: 100%;
  max-width: 800px;
  height: auto;
  display: block;
  background: #01060c;
  position: relative !important;
  transform: none !important;
}

.canvas-instruction {
  position: absolute;
  bottom: 0.75rem;
  left: 0.75rem;
  padding: 0.625rem 1rem;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: #e0e6f0;
  font-size: 0.875rem;
  white-space: nowrap;
  pointer-events: none; /* Don't interfere with canvas clicks */
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3),
              0 1px 0 rgba(255, 255, 255, 0.05) inset;
  letter-spacing: 0.01em;
}

.canvas-wrapper:hover .canvas-instruction {
  background: rgba(0, 0, 0, 0.5);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4),
              0 1px 0 rgba(255, 255, 255, 0.08) inset;
}

.canvas-instruction .me-text {
  font-weight: 600;
  color: #f5faff;
  text-decoration: underline;
  text-decoration-style: wavy;
  text-underline-offset: 2px;
}

.about-author {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
}

.about-author summary {
  font-size: 1.5rem;
  font-weight: 600;
  color: #f5faff;
  cursor: pointer;
  padding: 1.25rem 1.5rem;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  margin-bottom: 1rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  letter-spacing: -0.01em;
}

.about-author summary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.about-author[open] summary {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}

.accordion {
  width: 90%;
  max-width: 700px;
}

details {
  background: rgba(255,255,255,0.05);
  border-radius: 6px;
  margin-bottom: 0.5rem;
  padding: 1rem;
  cursor: pointer;
  transition: background 0.3s ease;
}

details[open] {
  background: rgba(255,255,255,0.1);
}

details summary {
  font-weight: bold;
  outline: none;
}

details p, details ul {
  margin-top: 0.5rem;
}

canvas {
  width: 100%;
  max-width: 800px;
  height: auto;
  display: block;
  margin-top: 0.5rem;
  position: relative;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1),
              height 0.8s cubic-bezier(0.4, 0, 0.2, 1),
              max-width 0.8s cubic-bezier(0.4, 0, 0.2, 1),
              max-height 0.8s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.8s cubic-bezier(0.4, 0, 0.2, 1),
              position 0.8s cubic-bezier(0.4, 0, 0.2, 1),
              margin 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center center;
}

/* Only apply collapse to tree canvas, not ball canvas */
body.collapsed #treeCanvas {
  position: fixed;
  top: 1rem;
  left: 1rem;
  transform-origin: top left;
  z-index: 1000;
  margin: 0;
  border-radius: 8px;
  box-shadow: 0 0 0 2px transparent,
              0 0 20px rgba(0, 212, 255, 0.3),
              0 0 40px rgba(0, 153, 204, 0.2);
  animation: gradientBorder 4s ease infinite;
}

@keyframes gradientBorder {
  0%, 100% {
    box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.6),
                0 0 20px rgba(0, 212, 255, 0.3),
                0 0 40px rgba(0, 153, 204, 0.2);
  }
  25% {
    box-shadow: 0 0 0 2px rgba(0, 153, 204, 0.7),
                0 0 20px rgba(0, 102, 255, 0.3),
                0 0 40px rgba(0, 212, 255, 0.2);
  }
  50% {
    box-shadow: 0 0 0 2px rgba(0, 102, 255, 0.6),
                0 0 20px rgba(0, 153, 204, 0.3),
                0 0 40px rgba(0, 212, 255, 0.2);
  }
  75% {
    box-shadow: 0 0 0 2px rgba(0, 153, 204, 0.7),
                0 0 20px rgba(0, 212, 255, 0.3),
                0 0 40px rgba(0, 102, 255, 0.2);
  }
}

/* Mobile devices: shrink collapsed logo to 1px */
@media (max-width: 768px) {
  body.collapsed #treeCanvas {
    width: 1px !important;
    max-width: 1px !important;
    height: 1px !important;
    transform: scale(1);
    overflow: hidden;
  }
}

main {
  position: relative;
  width: 100%;
  max-width: 800px;
  transition: margin-top 0.8s ease;
}

body.collapsed main {
  margin-top: 0;
}


body.collapsed {
  padding-top: 0;
}

/* New layout styles for content sections */
:root {
  --bg: #0b0f14;
  --fg: #e8f0ff;
  --muted: #a8b3c7;
  --accent: #c3dafe;
  --card: #111827;
  --line: #1f2937;
}

main {
  padding: 2rem 1.5rem 4rem;
  width: 100%;
  max-width: 800px;
}

h1, h2, h3 {
  line-height: 1.2;
  margin: 24px 0 8px;
}

h2 {
  font-size: 1.5rem;
  color: #f5faff;
  transition: color 0.3s ease;
}

h2:hover {
  color: #ffffff;
}

h3 {
  font-size: 1.25rem;
  color: #e0e6f0;
  transition: color 0.3s ease;
}

h3:hover {
  color: #f5faff;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 860px) {
  .grid.cols-2,
  .grid.cols-3 {
    grid-template-columns: 1fr;
  }
}

.card {
  background: rgba(17, 24, 39, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3),
              0 1px 0 rgba(255, 255, 255, 0.05) inset;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4),
              0 1px 0 rgba(255, 255, 255, 0.08) inset;
  transform: translateY(-2px);
}

.card:hover h2,
.card:hover h3 {
  color: #ffffff;
}

.card ul li {
  transition: color 0.2s ease, transform 0.2s ease;
  transform-origin: left center;
}

.card:hover ul li {
  color: rgba(224, 230, 240, 0.95);
}

.card ul li:hover {
  color: #ffffff;
  transform: translateX(4px);
}

.muted {
  color: var(--muted);
}

.pill {
  display: inline-block;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  margin: 4px 6px 0 0;
  background: #0e1624;
  color: var(--fg);
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.pill:hover {
  background: #1a2332;
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.copy {
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #0e1624;
  color: var(--fg);
  font-size: 0.9rem;
}

.copy:hover {
  background: #1a2332;
}

/* Bottom Footer Container */
.bottom-footer {
  width: 100%;
  max-width: 1200px;
  margin: 4rem auto 0;
  padding: 2rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
  position: relative;
}

/* Site footer - centered at bottom */
.site-footer {
  color: rgba(224, 230, 240, 0.5);
  padding: 0.5rem 0.75rem;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  flex: 1;
  text-align: center;
}

.site-footer p {
  margin: 0;
  font-size: 0.875rem;
  letter-spacing: 0.01em;
  line-height: 1.4;
}

/* Infomaniak logo - part of footer container */
.infomaniak-logo {
  width: auto;
  height: auto;
  padding: 0.15rem 0.25rem;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  opacity: 0.95;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  flex: 0 0 auto;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.infomaniak-logo:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.95);
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.infomaniak-logo img {
  width: auto;
  height: 120px;
  max-width: 160px;
  object-fit: contain;
  filter: brightness(0.9);
}

/* Mobile responsive */
@media (max-width: 768px) {
  .bottom-footer {
    flex-direction: column;
    align-items: center;
    padding: 1.5rem 1rem;
    gap: 1.5rem;
  }
  
  .site-footer {
    text-align: center;
  }
  
  .infomaniak-logo {
    padding: 0.15rem 0.2rem;
  }
  
  .infomaniak-logo img {
    height: 100px;
    max-width: 140px;
  }
}

/* Old footer styles - keeping for backwards compatibility */
footer {
  border-top: 1px solid var(--line);
  margin-top: 32px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.accent {
  color: var(--accent);
}

.spacer {
  height: 24px;
}

code, pre {
  background: #0f172a;
  border: 1px solid #1f2937;
  border-radius: 10px;
}

code {
  padding: 2px 6px;
  font-size: 0.9em;
}

pre {
  padding: 12px;
  overflow: auto;
}

.kbd {
  border: 1px solid #374151;
  border-bottom-width: 3px;
  border-radius: 8px;
  padding: 2px 6px;
  font-weight: 600;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

ul {
  margin: 0.5rem 0;
  padding-left: 1.5rem;
}

li {
  margin: 0.25rem 0;
}
