@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@300;400;500;600&family=Zen+Kaku+Gothic+New:wght@400;500;700&display=swap');

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

/* Half black, half deep blue, with a touch of purple night sky background */
body {
  font-family: 'Noto Sans JP', 'Zen Kaku Gothic New', sans-serif;
  color: #ffffff;
  min-height: 100vh;
  background: linear-gradient(180deg, #030308 0%, #060b1e 50%, #160926 85%, #220d33 100%);
  background-attachment: fixed;
  padding: 32px 48px 64px;
  overflow-x: hidden;
  position: relative;
}

/* Background Stars */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(1.5px 1.5px at 20px 30px, #ffffff, rgba(0,0,0,0)),
    radial-gradient(1px 1px at 70px 120px, #e8d0ff, rgba(0,0,0,0)),
    radial-gradient(2px 2px at 150px 40px, #ffffff, rgba(0,0,0,0)),
    radial-gradient(1.5px 1.5px at 240px 190px, #a8c8ff, rgba(0,0,0,0)),
    radial-gradient(1px 1px at 310px 80px, #ffffff, rgba(0,0,0,0));
  background-size: 320px 320px;
  opacity: 0.65;
  pointer-events: none;
  z-index: -1;
}

/* Meteor Effect Styling */
.meteor {
  position: fixed;
  width: 140px;
  height: 2px;
  background: linear-gradient(90deg, #ffffff, rgba(255, 255, 255, 0));
  border-radius: 50%;
  filter: drop-shadow(0 0 6px #ffffff);
  transform: rotate(-35deg);
  pointer-events: none;
  z-index: 0;
  animation: meteorFall 1.2s linear forwards;
}

@keyframes meteorFall {
  0% {
    opacity: 1;
    transform: translate(0, 0) rotate(-35deg);
  }
  100% {
    opacity: 0;
    transform: translate(-450px, 450px) rotate(-35deg);
  }
}

/* Header & Nav */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
  position: relative;
  z-index: 10;
}

.logo {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.logo-text {
  font-family: 'Zen Kaku Gothic New', sans-serif;
  font-weight: 700;
  font-size: 2.4rem;
  letter-spacing: 0.08em;
}

.logo-sparkle {
  font-size: 1.4rem;
  opacity: 0.85;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 0.95rem;
  font-weight: 500;
}

.main-nav a {
  color: #ffffff;
  text-decoration: none;
  opacity: 0.75;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.main-nav a:hover,
.main-nav a.active {
  opacity: 1;
  background: rgba(255, 255, 255, 0.12);
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: #ffffff;
  font-size: 1.3rem;
  cursor: pointer;
}

/* Content & Tabs */
.content {
  margin-top: 40px;
  position: relative;
  z-index: 10;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

/* Glassmorphism Card Style */
.glass-card {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  padding: 28px 32px;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.intro-card {
  max-width: 700px;
}

.intro-card h1 {
  font-size: 1.8rem;
  margin-bottom: 14px;
}

.intro-card p {
  line-height: 1.8;
  opacity: 0.9;
}

/* Works Tab Floating Windows Grid */
.works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.floating-window {
  max-height: 380px;
  display: flex;
  flex-direction: column;
  animation: float 5s ease-in-out infinite;
}

.floating-window.delay-1 {
  animation-delay: 1.5s;
}

.floating-window.delay-2 {
  animation-delay: 3s;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
}

.floating-window h2 {
  font-size: 1.3rem;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  padding-bottom: 8px;
}

.card-content {
  overflow-y: auto;
  padding-right: 6px;
  line-height: 1.7;
  opacity: 0.9;
  font-size: 0.95rem;
}

/* Custom Scrollbar for floating windows */
.card-content::-webkit-scrollbar {
  width: 5px;
}
.card-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 4px;
}

/* About Me Tab */
.about-card {
  max-width: 520px;
}

.about-card h2 {
  font-size: 1.5rem;
  margin-bottom: 12px;
}

.about-card p {
  line-height: 1.7;
  opacity: 0.9;
  margin-bottom: 20px;
}

.social-links {
  display: flex;
  gap: 16px;
}

.social-links a {
  color: #ffffff;
  opacity: 0.8;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.social-links a:hover {
  opacity: 1;
  transform: translateY(-3px);
}

/* Responsive Styles */
@media (max-width: 640px) {
  body {
    padding: 24px 20px 48px;
  }
  .menu-toggle {
    display: block;
  }
  .main-nav {
    gap: 10px;
  }
}

.logo-sparkle {
  font-size: 1.4rem;
  display: inline-block; /* Required for transform rotation to work on spans */
  transform-origin: center;
  animation: professionalSpin 10s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes professionalSpin {
  0% {
    transform: rotate(0deg) scale(1);
    opacity: 0.75;
    filter: drop-shadow(0 0 0px rgba(255, 255, 255, 0));
  }
  50% {
    transform: rotate(180deg) scale(1.2);
    opacity: 1;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.9));
  }
  100% {
    transform: rotate(360deg) scale(1);
    opacity: 0.75;
    filter: drop-shadow(0 0 0px rgba(255, 255, 255, 0));
  }
}

/* Clickable Floating Windows */
.floating-window {
  cursor: pointer;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.floating-window:hover {
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 12px 35px rgba(255, 255, 255, 0.2);
}

/* Modal Overlay & Zoom Effect */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(3, 3, 8, 0.75);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 20px;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  max-width: 640px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  transform: scale(0.85);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.active .modal-card {
  transform: scale(1);
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: none;
  border: none;
  color: #ffffff;
  font-size: 1.8rem;
  cursor: pointer;
  opacity: 0.75;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.modal-close:hover {
  opacity: 1;
  transform: scale(1.1);
}

.modal-body {
  margin-top: 16px;
}

.detail-item {
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.detail-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.detail-item h3 {
  font-size: 1.1rem;
  margin-bottom: 6px;
  color: #e8d0ff;
}

.detail-item p {
  line-height: 1.7;
  opacity: 0.9;
  font-size: 0.95rem;
}