/* Home page — planet scene, logo and buttons */
body {
  height: 100vh;            /* fallback for older browsers */
  height: 100dvh;           /* dynamic viewport — excludes iOS toolbars so nothing clips */
  display: flex;
  flex-direction: column;
  align-items: stretch;
  overflow: hidden;
}
main {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1.1rem, 3vh, 2rem);
  padding: clamp(0.5rem, 1.5vh, 1rem) 1.5rem max(2.5rem, env(safe-area-inset-bottom));
}
.hero {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
#scene {
  display: block;
  /* 300px offset accounts for logo + subtitle + buttons + padding + gaps at all sizes */
  width: min(560px, 92vw, calc(100vh - 300px));
  width: min(560px, 92vw, calc(100dvh - 300px));
  aspect-ratio: 1;
}
.logo {
  /* Height-driven sizing: shrinks with viewport height, capped at natural size */
  height: auto;
  max-height: clamp(60px, 14vh, 115px);
  width: auto;
  max-width: min(340px, 82vw);
  display: block;
  flex-shrink: 0;
}
.subtitle {
  font-size: clamp(0.85rem, 2.5vw, 1.1rem);
  font-weight: 400;
  color: #B1A6C7;
  letter-spacing: 0.04em;
  flex-shrink: 0;
  text-align: center;
  /* Pull subtitle halfway back toward logo — gap stays full between subtitle and buttons */
  margin-top: calc(-1 * clamp(0.55rem, 1.5vh, 1rem));
}
.buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  flex-shrink: 0;
}
.btn {
  padding: 0.7rem 1.7rem;
  border-radius: 2rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-decoration: none;
  border: 2px solid #7C3AED;
  background: transparent;
  color: #C084FC;
  box-shadow: 0 0 10px rgba(124, 58, 237, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  display: inline-flex;
  align-items: center;
}
.btn:hover { transform: translateY(-3px); }
.btn-projects:hover {
  background: rgba(124, 58, 237, 0.12);
  box-shadow: 0 0 28px rgba(168, 85, 247, 0.7), 0 0 8px rgba(168, 85, 247, 0.4);
}
.btn-instagram {
  border-color: #E879F9;
  color: #E879F9;
  box-shadow: 0 0 10px rgba(232, 121, 249, 0.2);
}
.btn-instagram:hover {
  background: rgba(232, 121, 249, 0.1);
  box-shadow: 0 0 28px rgba(232, 121, 249, 0.7), 0 0 8px rgba(232, 121, 249, 0.4);
}
.btn-email {
  border-color: #2DD4BF;
  color: #2DD4BF;
  box-shadow: 0 0 10px rgba(45, 212, 191, 0.2);
}
.btn-email:hover {
  background: rgba(45, 212, 191, 0.1);
  box-shadow: 0 0 28px rgba(45, 212, 191, 0.7), 0 0 8px rgba(45, 212, 191, 0.4);
}
.btn-danger {
  border-color: #FF2D55;
  color: #FF6B81;
  box-shadow: 0 0 10px rgba(255, 45, 85, 0.25);
  gap: 0;
  padding: 0.7rem;
  border-radius: 50%;
  justify-content: center;
}
.btn-danger .swirl {
  width: 1.6em;
  height: 1.6em;
  flex-shrink: 0;
  color: #FF2D55;
  filter: drop-shadow(0 0 3px rgba(255, 45, 85, 0.8));
  animation: swirl-spin 5s linear infinite;
}
.btn-danger:hover .swirl {
  animation-duration: 1.6s;
  filter: drop-shadow(0 0 6px rgba(255, 45, 85, 1));
}
@keyframes swirl-spin { to { transform: rotate(360deg); } }
.btn-danger:hover {
  background: rgba(255, 45, 85, 0.12);
  box-shadow: 0 0 28px rgba(255, 45, 85, 0.75), 0 0 8px rgba(255, 45, 85, 0.45);
}
@media (max-width: 480px) {
  main {
    padding-bottom: max(3rem, calc(env(safe-area-inset-bottom) + 1.5rem));
  }
  .buttons {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }
  .btn { width: 190px; justify-content: center; font-size: 0.88rem; padding: 0.6rem 1.2rem; }
  .btn-danger { width: auto; padding: 0.6rem; }
}
/* .main-text groups logo+subtitle+buttons so they can move as one unit */
.main-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1.1rem, 3vh, 2rem);
}

/* Landscape mobile: stop squishing, allow scroll (phones only) */
@media (orientation: landscape) and (max-height: 600px) and (max-width: 959px) {
  body { height: auto; min-height: 100vh; min-height: 100dvh; overflow-y: auto; }
  main { flex: none; }
}
