/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.6;
  color: #000;
  background-color: #fff;
  font-weight: 400;
}

/* ==========================================================================
   Loading Screen
   ========================================================================== */

.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 1;
  transition: opacity 0.6s ease;
}

.loading-screen.fade-out {
  opacity: 0;
  pointer-events: none;
}

.loading-content {
  text-align: center;
  color: #000;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-top: 3px solid #000;
  border-radius: 50%;
  margin: 0 auto 1.5rem;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.loading-text {
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0.5px;
}

/* ==========================================================================
   Page Animation
   ========================================================================== */

.fade-in {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.8s ease forwards;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in:nth-child(1) {
  animation-delay: 0.1s;
}
.fade-in:nth-child(2) {
  animation-delay: 0.2s;
}
.fade-in:nth-child(3) {
  animation-delay: 0.3s;
}
.fade-in:nth-child(4) {
  animation-delay: 0.4s;
}
.fade-in:nth-child(5) {
  animation-delay: 0.5s;
}
.fade-in:nth-child(6) {
  animation-delay: 0.6s;
}

/* ==========================================================================
   Layout & Container
   ========================================================================== */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

section {
  padding: 5rem 0;
}

section:nth-child(even) {
  background-color: #f5f5f5;
}

/* ==========================================================================
   Typography
   ========================================================================== */

h1,
h2,
h3 {
  font-weight: 600;
  line-height: 1.2;
  color: #000;
}

h1 {
  font-size: 3rem;
  font-weight: 300;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 2rem;
  margin-bottom: 3rem;
  text-align: center;
  font-weight: 500;
}

h3 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

p {
  margin-bottom: 1rem;
  color: rgba(0, 0, 0, 0.8);
  line-height: 1.7;
}

/* ==========================================================================
   Navigation
   ========================================================================== */

.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  z-index: 100;
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
}

.nav-brand {
  font-size: 1.2rem;
  font-weight: 600;
  color: #000;
}

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

.nav-links a {
  text-decoration: none;
  color: rgba(0, 0, 0, 0.7);
  font-size: 0.9rem;
  font-weight: 400;
  transition: color 0.2s ease;
}

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

/* 漢堡選單按鈕 */
.nav-toggle {
  display: none;
  flex-direction: column;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  gap: 0.25rem;
}

.hamburger-line {
  width: 24px;
  height: 2px;
  background-color: #000;
  transition: all 0.3s ease;
  transform-origin: center;
}

/* 漢堡選單動畫 */
.nav-toggle.active .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.nav-toggle.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: 6rem;
}

.hero-content {
  max-width: 600px;
}

.hero-avatar {
  width: 240px;
  height: 240px;
  object-fit: cover;
  margin: 0 auto 2rem;
  display: block;
  border-radius: 50%;
  animation: liquidMorph 6s ease-in-out infinite;
}

@keyframes liquidMorph {
  0%,
  100% {
    border-radius: 50%;
  }
  33% {
    border-radius: 60% 40% / 40% 60%;
  }
  66% {
    border-radius: 40% 60% / 60% 40%;
  }
}

.hero-title {
  margin-bottom: 1rem;
}

.hero-subtitle {
  font-size: 1.5rem;
  color: rgba(0, 0, 0, 0.7);
  margin-bottom: 0.1rem;
  font-weight: 400;
}

.text-changer {
  display: inline-block;
  position: relative;
}

.text-changer::after {
  content: "|";
  display: inline-block;
  animation: blink 1s infinite;
  margin-left: 2px;
  color: rgba(0, 0, 0, 0.7);
}

@keyframes blink {
  0%,
  50% {
    opacity: 1;
  }
  51%,
  100% {
    opacity: 0;
  }
}

.hero-description {
  font-size: 1.1rem;
  color: rgba(0, 0, 0, 0.6);
  max-width: 400px;
  margin: 0 auto;
}

/* ==========================================================================
   About Section
   ========================================================================== */

.about-content {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.about-content p {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}

.stats {
  display: flex;
  justify-content: center;
  gap: 4rem;
  margin-top: 3rem;
}

.stat {
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 2.5rem;
  font-weight: 300;
  color: #000;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 0.9rem;
  color: rgba(0, 0, 0, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ==========================================================================
   Skills Section
   ========================================================================== */

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 3rem;
  max-width: 900px;
  margin: 0 auto;
}

.skill-category h3 {
  margin-bottom: 1.5rem;
  color: #000;
}

.skill-category ul {
  list-style: none;
}

.skill-category li {
  padding: 0.5rem 0;
  color: rgba(0, 0, 0, 0.8);
  font-size: 0.95rem;
  position: relative;
  padding-left: 1rem;
}

.skill-category li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: rgba(0, 0, 0, 0.3);
}

/* ==========================================================================
   Education Section
   ========================================================================== */

.education-list {
  max-width: 800px;
  margin: 0 auto;
}

.education-item {
  display: flex;
  gap: 3rem;
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

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

.education-period {
  flex-shrink: 0;
  width: 120px;
  font-size: 0.85rem;
  color: rgba(0, 0, 0, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.education-details h3 {
  margin-bottom: 0.5rem;
}

.education-school {
  color: rgba(0, 0, 0, 0.7);
  margin-bottom: 0.5rem;
}

.education-degree {
  font-size: 0.9rem;
  color: rgba(0, 0, 0, 0.5);
}

/* ==========================================================================
   Experience Section
   ========================================================================== */

.timeline {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 1px;
  background: rgba(0, 0, 0, 0.1);
}

.timeline-item {
  position: relative;
  padding-left: 3rem;
  margin-bottom: 3rem;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -4px;
  top: 0.5rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #000;
}

.timeline-period {
  font-size: 0.85rem;
  color: rgba(0, 0, 0, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.timeline-content h3 {
  margin-bottom: 0.5rem;
}

.company {
  color: rgba(0, 0, 0, 0.7);
  margin-bottom: 1rem;
  font-weight: 500;
}

.job-description {
  color: rgba(0, 0, 0, 0.8);
  line-height: 1.6;
}

/* ==========================================================================
   Articles Section
   ========================================================================== */

.articles-list {
  max-width: 800px;
  margin: 0 auto;
}

.article-item {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

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

.article-date {
  font-size: 0.85rem;
  color: rgba(0, 0, 0, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 1rem;
}

.article-item h3 {
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

.article-item p {
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.article-link {
  color: #000;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  border-bottom: 1px solid rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
}

.article-link:hover {
  border-bottom-color: #000;
}

/* ==========================================================================
   Gallery Section
   ========================================================================== */

.gallery {
  padding: 0;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 0;
  width: 100%;
}

.gallery-item {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 0;
  box-shadow: none;
  transition: transform 0.3s ease;
}

.gallery-item:hover {
  z-index: 1;
}

.gallery-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-image {
  transform: scale(1.1);
}

/* ==========================================================================
   Interests Section
   ========================================================================== */

.interests-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 3rem;
  max-width: 900px;
  margin: 0 auto;
}

.interest-item {
  text-align: center;
  padding: 2rem 1rem;
}

.interest-icon {
  width: 48px;
  height: 48px;
  color: rgba(0, 0, 0, 0.7);
  margin: 0 auto 1.5rem;
}

.interest-item h3 {
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.interest-item p {
  font-size: 0.9rem;
  color: rgba(0, 0, 0, 0.7);
  line-height: 1.5;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
  background-color: #2c2c2c;
  color: rgba(255, 255, 255, 0.8);
  padding: 3rem 0 2rem;
  margin-top: 5rem;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 2rem;
}

.footer-info p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.6;
}

.footer-info p:first-child {
  margin-bottom: 0.5rem;
  color: rgba(255, 255, 255, 0.9);
}

.footer-links {
  display: flex;
  gap: 2rem;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: rgba(255, 255, 255, 1);
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
  .container {
    padding: 0 1.5rem;
  }

  section {
    padding: 3rem 0;
  }

  h1 {
    font-size: 2.5rem;
  }

  h2 {
    font-size: 1.8rem;
    margin-bottom: 2rem;
  }

  .navbar .container {
    padding: 1rem 1.5rem;
  }

  /* 手機版選單樣式 */
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    transition: right 0.3s ease;
    z-index: 99;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
  }

  .nav-links.active {
    right: 0;
  }

  .nav-links li {
    list-style: none;
  }

  .nav-links a {
    font-size: 1.1rem;
    font-weight: 500;
    padding: 1rem;
    display: block;
    text-align: center;
  }

  .hero {
    padding-top: 4rem;
  }

  .hero-avatar {
    width: 100px;
    height: 100px;
  }

  .hero-subtitle {
    font-size: 1.3rem;
  }

  .text-changer {
    min-height: 1.5rem;
  }

  .text-changer::after {
    margin-left: 1px;
  }

  .stats {
    flex-direction: column;
    gap: 2rem;
  }

  .skills-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .education-item {
    flex-direction: column;
    gap: 1rem;
  }

  .timeline-item {
    padding-left: 2rem;
  }

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

  .interests-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
    gap: 1.5rem;
  }

  .footer-links {
    gap: 1.5rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .nav-links {
    width: 250px;
    gap: 1.5rem;
  }

  .nav-links a {
    font-size: 1rem;
  }

  .hero-avatar {
    width: 80px;
    height: 80px;
  }

  .hero-subtitle {
    font-size: 1.1rem;
  }

  .stats {
    gap: 1.5rem;
  }

  .stat-number {
    font-size: 2rem;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

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

  .interest-item {
    padding: 1.5rem 0.5rem;
  }
}
