/* ===== 基礎變數 ===== */
:root {
  --bg-deep: #0a0e17;
  --bg-card: rgba(18, 22, 35, 0.7);
  --text: #e8eaf0;
  --text-dim: #9aa3b2;
  --accent: #7a9bff;
  --accent-2: #5eead4;
  --glass: rgba(255, 255, 255, 0.08);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg-deep);
  color: var(--text);
  font-family: "Microsoft JhengHei", "PingFang TC", system-ui, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ===== 星空背景 ===== */
#stars {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.star {
  position: absolute;
  background: #fff;
  border-radius: 50%;
  animation: twinkle linear infinite;
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.3;
    transform: scale(0.8);
  }
  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}

/* ===== 品牌彩蛋：牧羊犬水印 ===== */
.brand-watermark {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 60px;
  height: 60px;
  opacity: 0.15;
  z-index: 5;
  background: url("assets/images/logo-dog.svg") center/contain no-repeat;
  pointer-events: none;
  transition: opacity 0.3s;
}

.brand-watermark:hover {
  opacity: 0.35;
}

/* ===== 滑鼠星塵軌跡 ===== */
.stardust {
  position: fixed;
  width: 4px;
  height: 4px;
  background: radial-gradient(circle, var(--accent), transparent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 3;
  animation: fadeOut 1s forwards;
}

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translateY(10px) scale(0.5);
  }
}

/* ===== 內容層 ===== */
.content {
  position: relative;
  z-index: 1;
}

/* ===== Header ===== */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 14, 23, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, #fff, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand-motto {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-left: 1rem;
  white-space: nowrap;
}

@media (max-width: 899px) {
  .brand-motto {
    display: none;
  }
}

nav ul {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

nav a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s;
}

nav a:hover {
  color: var(--text);
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.4rem;
  cursor: pointer;
}

@media (max-width: 768px) {
  header {
    padding: 0.75rem 1.2rem;
  }

  nav ul {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: rgba(10, 14, 23, 0.95);
    backdrop-filter: blur(12px);
    padding: 1rem;
    gap: 1rem;
    text-align: center;
    border-bottom: 1px solid var(--glass);
  }

  nav.active ul {
    display: flex;
  }

  .menu-toggle {
    display: block;
  }
}

/* ===== Section ===== */
section {
  padding: 4.5rem 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
}

.section-title {
  font-size: 1.8rem;
  margin-bottom: 2rem;
  text-align: center;
  background: linear-gradient(to right, #fff, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== Card ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--glass);
  border-radius: 14px;
  padding: 1.8rem;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

/* ===== YouTube Grid ===== */
.yt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.yt-wrap {
  position: relative;
  padding-bottom: 56.25%;
  border-radius: 12px;
  overflow: hidden;
}

.yt-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ===== Project Block ===== */
.project {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  align-items: center;
  text-align: center;
}

.project-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--glass);
}

.project-text {
  width: 100%;
}

.project h3 {
  margin: 0.5rem 0;
}

.project p {
  color: var(--text-dim);
  margin: 0.5rem 0 1rem;
}

@media (min-width: 768px) {
  .project {
    flex-direction: row;
    text-align: left;
  }

  .project-img {
    flex: 0 0 280px;
    max-width: 380px;
  }

  .project-text {
    flex: 1;
  }
}

/* ===== Button ===== */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0a0e17;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(122, 155, 255, 0.4);
}

/* ===== Founder ===== */
.founder {
  text-align: center;
}

.founder-img {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent);
  margin-bottom: 1rem;
}

.founder-role {
  color: var(--accent-2);
  margin: 0.3rem 0 1rem;
}

/* ===== Future Focus Tags ===== */
.focus-tags {
  display: flex;
  justify-content: center;
  gap: 0.8rem;
  margin: 1rem 0;
  flex-wrap: wrap;
}

.tag {
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  background: rgba(122, 155, 255, 0.15);
  border: 1px solid var(--accent);
  color: var(--accent);
}

/* ===== Footer ===== */
footer {
  text-align: center;
  padding: 3rem 1.5rem;
  border-top: 1px solid var(--glass);
  background: rgba(10, 14, 23, 0.95);
  color: var(--text-dim);
}

.socials {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.socials a {
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: color 0.2s;
}

.socials a:hover {
  color: var(--accent);
}

.contact-note {
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

/* ===== Loading / Error ===== */
.loading {
  text-align: center;
  padding: 3rem;
  color: var(--text-dim);
  grid-column: 1 / -1;
}

.error {
  text-align: center;
  padding: 2rem;
  color: #f87171;
}
