/* === Reset & Base === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: #f8f8f8;
  color: #1a1a1a;
  font-family: 'Segoe UI', 'Apple SD Gothic Neo', sans-serif;
  font-size: 16px;
  line-height: 1.7;
}

a {
  color: inherit;
  text-decoration: none;
}

/* === Navigation === */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid #e8e8e8;
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1a1a1a;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 2rem;
}

.nav-links a {
  font-size: 0.9rem;
  color: #777;
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: #1a1a1a;
}

/* === Section Shared === */
section {
  padding: 100px 2rem;
}

.section-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.section-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 3rem;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 40px;
  height: 3px;
  background: #5865f2;
  border-radius: 2px;
}

/* === Hero === */
#hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 2rem;
  position: relative;
  background: #fff;
}

.hero-content {
  max-width: 700px;
  margin: 0 auto;
  width: 100%;
}

.hero-sub {
  font-size: 1rem;
  color: #5865f2;
  font-weight: 600;
  margin-bottom: 0.5rem;
  letter-spacing: 0.05em;
}

.hero-name {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800;
  color: #111;
  line-height: 1.15;
  margin-bottom: 1.2rem;
}

.hero-desc {
  font-size: 1.05rem;
  color: #666;
  margin-bottom: 2.5rem;
  line-height: 1.8;
}

.hero-btns {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-block;
  padding: 0.75rem 2rem;
  background: #5865f2;
  color: #fff;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  transition: background 0.2s, transform 0.2s;
}

.btn-primary:hover {
  background: #4752c4;
  transform: translateY(-2px);
}

.btn-secondary {
  display: inline-block;
  padding: 0.75rem 2rem;
  border: 2px solid #ddd;
  color: #555;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  transition: border-color 0.2s, color 0.2s;
}

.btn-secondary:hover {
  border-color: #5865f2;
  color: #5865f2;
}

.hero-scroll {
  position: absolute;
  bottom: 3rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: #bbb;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
}

.scroll-line {
  width: 1px;
  height: 50px;
  background: linear-gradient(to bottom, #bbb, transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* === About === */
#about {
  background: #f8f8f8;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.about-text p {
  color: #555;
  margin-bottom: 1rem;
  font-size: 1rem;
}

.about-info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 1rem 1.2rem;
  background: #fff;
  border-radius: 10px;
  border: 1px solid #e8e8e8;
}

.info-label {
  font-size: 0.75rem;
  color: #5865f2;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.info-value {
  font-size: 0.95rem;
  color: #333;
}

/* === Skills === */
#skills {
  background: #fff;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.skill-card {
  background: #f8f8f8;
  border: 1px solid #e8e8e8;
  border-radius: 12px;
  padding: 1.8rem 1.5rem;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.skill-card:hover {
  border-color: #5865f2;
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(88, 101, 242, 0.1);
}

.skill-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.skill-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #111;
  margin-bottom: 0.5rem;
}

.skill-card p {
  font-size: 0.875rem;
  color: #777;
  line-height: 1.6;
}

/* === Projects === */
#projects {
  background: #f8f8f8;
}

.projects-hint {
  color: #999;
  font-size: 0.9rem;
  margin-top: -2rem;
  margin-bottom: 2.5rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.project-card:hover {
  border-color: #5865f2;
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(88, 101, 242, 0.1);
}

.project-card.featured {
  grid-column: span 2;
  display: flex;
  flex-direction: row;
}

.project-thumb {
  overflow: hidden;
  background: #f0f0f0;
}

.project-card:not(.featured) .project-thumb {
  height: 180px;
}

.project-card.featured .project-thumb {
  width: 340px;
  flex-shrink: 0;
}

.project-thumb img,
.project-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.project-card:hover .project-thumb img {
  transform: scale(1.04);
}

.project-body {
  padding: 1.4rem 1.6rem 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  flex: 1;
}

.project-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.project-year {
  font-size: 0.8rem;
  color: #5865f2;
  font-weight: 700;
  background: rgba(88, 101, 242, 0.08);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag {
  font-size: 0.72rem;
  color: #666;
  background: #f2f2f2;
  border: 1px solid #e0e0e0;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.tag-new {
  background: rgba(88, 101, 242, 0.08) !important;
  border-color: #5865f2 !important;
  color: #5865f2 !important;
  font-weight: 700;
}

.project-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #111;
}

.project-subtitle {
  font-size: 0.83rem;
  color: #999;
  margin-top: -0.3rem;
}

.project-desc {
  font-size: 0.875rem;
  color: #666;
  line-height: 1.65;
  flex: 1;
}

.project-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.5rem;
  padding-top: 0.8rem;
  border-top: 1px solid #f0f0f0;
}

.project-engine {
  font-size: 0.78rem;
  color: #aaa;
}

.detail-hint {
  font-size: 0.78rem;
  color: #5865f2;
  font-weight: 600;
}

/* === Contact === */
#contact {
  background: #fff;
}

.contact-box {
  max-width: 500px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.contact-desc {
  color: #666;
  font-size: 1rem;
}

.contact-email {
  display: inline-flex;
  align-items: center;
  font-size: 1.1rem;
  font-weight: 600;
  color: #5865f2;
  border: 2px solid #5865f2;
  padding: 0.7rem 1.5rem;
  border-radius: 8px;
  width: fit-content;
  transition: background 0.2s, color 0.2s;
}

.contact-email:hover {
  background: #5865f2;
  color: #fff;
}

.contact-phone {
  display: inline-flex;
  align-items: center;
  font-size: 1.1rem;
  font-weight: 600;
  color: #444;
  border: 2px solid #ddd;
  padding: 0.7rem 1.5rem;
  border-radius: 8px;
  width: fit-content;
  transition: border-color 0.2s, color 0.2s;
}

.contact-phone:hover {
  border-color: #5865f2;
  color: #5865f2;
}

/* === Footer === */
footer {
  background: #f2f2f2;
  border-top: 1px solid #e8e8e8;
  text-align: center;
  padding: 2rem;
  color: #aaa;
  font-size: 0.85rem;
}

/* === Modal === */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  overflow-y: auto;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: #fff;
  border-radius: 16px;
  max-width: 680px;
  width: 100%;
  margin: auto;
  overflow: hidden;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  animation: modalIn 0.25s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: #f0f0f0;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 0.85rem;
  cursor: pointer;
  color: #555;
  z-index: 10;
  transition: background 0.2s;
}

.modal-close:hover {
  background: #e0e0e0;
}

.modal-media {
  width: 100%;
  max-height: 260px;
  overflow: hidden;
  background: #f0f0f0;
}

.video-thumb {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: #e8e8ff;
  cursor: pointer;
}

.play-btn {
  font-size: 2.5rem;
  color: #5865f2;
  line-height: 1;
}

.play-label {
  font-size: 0.8rem;
  color: #5865f2;
  font-weight: 600;
}

.modal-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.modal-video iframe {
  width: 100%;
  height: 100%;
  display: block;
}

.modal-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.modal-content {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.modal-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: #111;
  line-height: 1.3;
}

.modal-period {
  font-size: 0.85rem;
  color: #888;
}

.modal-summary {
  font-size: 0.95rem;
  color: #444;
  line-height: 1.75;
}

.modal-devlog {
  background: #f8f8f8;
  border-radius: 10px;
  padding: 1.2rem 1.4rem;
  border: 1px solid #eee;
}

.modal-devlog h4 {
  font-size: 0.8rem;
  font-weight: 700;
  color: #5865f2;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.8rem;
}

.modal-devlog ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.modal-devlog li {
  font-size: 0.875rem;
  color: #555;
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
}

.log-date {
  font-size: 0.78rem;
  color: #5865f2;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.modal-imgs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

.modal-imgs img {
  width: 100%;
  border-radius: 8px;
  object-fit: cover;
  aspect-ratio: 16/9;
}

/* === Fade-in Animation === */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* === Responsive === */
@media (max-width: 768px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .project-card.featured {
    grid-column: span 1;
    flex-direction: column;
  }

  .project-card.featured .project-thumb {
    width: 100%;
    height: 200px;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .modal-imgs {
    grid-template-columns: 1fr;
  }

  .hero-scroll {
    display: none;
  }
}

@media (max-width: 480px) {
  .nav-links {
    gap: 1.2rem;
    font-size: 0.8rem;
  }

  section {
    padding: 70px 1.2rem;
  }
}
