:root {
  --color-accent: #f1526a;
  --color-navy: #2d3a8c;
  --color-text: #1f2430;
  --color-muted: #6b7280;
  --color-bg-alt: #f6f6f8;
  --color-border: #e8e8ec;
  --color-card-shadow: 0 2px 12px rgba(20, 20, 40, 0.06);
  --max-width: 1100px;
  --content-width: 720px;
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC",
    "Helvetica Neue", Arial, sans-serif;

  /* type scale — kept to 6 sizes so text doesn't jump around */
  --fs-2xs: 13px;
  --fs-xs: 14px;
  --fs-base: 16px;
  --fs-md: 18px;
  --fs-lg: 20px;
  --fs-xl: 30px;

  --lh-heading: 1.3;
  --lh-body: 1.7;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--color-text);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  line-height: var(--lh-heading);
}

a {
  color: inherit;
  text-decoration: none;
}
.link-accent {
  color: var(--color-accent);
}

img {
  max-width: 100%;
  display: block;
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}
.wrap-narrow {
  max-width: var(--content-width);
}

/* ---------- Logo mark ---------- */
.logo-mark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 18px;
  color: var(--color-text);
}
.logo-mark .glyph {
  width: 18px;
  height: 18px;
  display: block;
}
.logo-mark-lg {
  display: block;
  width: 44px;
  height: 44px;
  margin: 0 auto;
}
.logo-mark-lg.sm {
  width: 28px;
  height: 28px;
}

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 20;
  background: #fff;
}
.site-header:has(+ .project-topbar) {
  border-bottom: none;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.site-header nav {
  display: flex;
  gap: 32px;
  font-size: var(--fs-xs);
}
.site-header nav a:hover {
  color: var(--color-accent);
}

/* ---------- Hero ---------- */
.hero {
  background: var(--color-bg-alt);
  text-align: center;
  padding: 80px 24px 64px;
}
.hero .logo-mark-lg {
  margin-bottom: 28px;
}
.hero h1 {
  font-size: var(--fs-xl);
  font-weight: 700;
  margin: 0 0 28px;
  max-width: var(--content-width);
  margin-left: auto;
  margin-right: auto;
}
.hero h1 .highlight {
  color: var(--color-accent);
}
.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
}
.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 999px;
  font-size: var(--fs-xs);
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn-primary {
  background: var(--color-accent);
  color: #fff;
}
.btn-primary:hover {
  background: #d63b52;
}
.btn-ghost {
  background: transparent;
  color: var(--color-accent);
}
.btn-ghost:hover {
  text-decoration: underline;
}

/* ---------- Marquee ---------- */
.marquee {
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  overflow: hidden;
  white-space: nowrap;
  padding: 18px 0;
}
.marquee-track {
  display: inline-flex;
  animation: marquee 28s linear infinite;
}
.marquee-track span {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  font-size: var(--fs-xs);
  color: var(--color-muted);
}
.marquee-track span b {
  color: var(--color-navy);
  font-weight: 600;
}
@keyframes marquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}
@media (prefers-reduced-motion: reduce) {
  .marquee-track {
    animation: none;
  }
}

/* ---------- Section ---------- */
.section {
  padding: 64px 0;
}
.section-alt {
  background: var(--color-bg-alt);
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 16px;
  margin-bottom: 40px;
}
.section-head.no-divider {
  border-bottom: none;
}
.section-head h2 {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--color-navy);
  margin: 0;
}
.section-head .page-title {
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--color-text);
}
.section-links {
  display: flex;
  gap: 20px;
  font-size: var(--fs-xs);
  color: var(--color-muted);
}
.section-links a:hover {
  color: var(--color-accent);
}

/* ---------- Experience entries ---------- */
.experience {
  display: flex;
  gap: 20px;
  padding: 32px 0;
  border-bottom: 1px dashed var(--color-border);
}
.experience:last-child {
  border-bottom: none;
}
.experience-logo {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--color-bg-alt);
}
.experience-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}
.experience-body h3 {
  font-size: var(--fs-md);
  margin: 0 0 4px;
}
.experience-meta {
  color: var(--color-muted);
  font-size: var(--fs-xs);
  margin-bottom: 12px;
}
.experience-body p {
  margin: 0 0 12px;
  font-size: var(--fs-base);
}
.tag-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: var(--fs-2xs);
  color: var(--color-muted);
}
.tag-row + .tag-row {
  margin-top: 8px;
}
.tag-row.cta {
  margin-top: 24px;
}
.tag {
  background: var(--color-bg-alt);
  border-radius: 999px;
  padding: 6px 14px;
  color: var(--color-text);
}
.tag-accent {
  color: var(--color-accent);
  background: #fdeef1;
}
.tag-row a.tag:hover {
  background: var(--color-accent);
  color: #fff;
}

/* mini card grid inside experience (AAPD / travel media) */
.mini-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin: 16px 0;
}
.mini-card {
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 18px;
}
.mini-card h4 {
  font-size: var(--fs-base);
  margin: 0 0 8px;
}
.mini-card .mini-tag {
  display: inline-block;
  font-size: var(--fs-2xs);
  background: var(--color-bg-alt);
  border-radius: 999px;
  padding: 4px 10px;
  margin-bottom: 8px;
}
.mini-card p {
  font-size: var(--fs-xs);
  color: var(--color-muted);
  margin: 0;
}

details.collapse {
  border-top: 1px dashed var(--color-border);
  padding-top: 20px;
  margin-top: 8px;
}
details.collapse summary + * {
  margin-top: 12px;
}
details.collapse summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--color-navy);
  font-size: var(--fs-xs);
  list-style: none;
}
details.collapse summary::-webkit-details-marker {
  display: none;
}
details.collapse summary::after {
  content: "  ▾ 展開更多";
  color: var(--color-muted);
  font-weight: 400;
  font-size: var(--fs-2xs);
}
details.collapse[open] summary::after {
  content: "  ▴ 收合";
}

/* ---------- Project list cards ---------- */
.project-card {
  border: 1px solid var(--color-border);
  border-radius: 16px;
  box-shadow: var(--color-card-shadow);
  overflow: hidden;
  margin-bottom: 40px;
  transition: transform 0.2s ease;
}
.project-card:hover {
  transform: translateY(-4px);
}
.project-card-body {
  padding: 24px 28px 0;
}
.project-card h3 {
  font-size: var(--fs-lg);
  margin: 0 0 8px;
}
.project-card .experience-meta {
  margin-bottom: 16px;
}
.project-card-figure {
  position: relative;
  background: var(--color-bg-alt);
}
.project-card-figure img {
  width: 100%;
  height: auto;
}
.project-card-figure .tag-floating {
  position: absolute;
  top: 16px;
  right: 16px;
  background: #fff;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: var(--fs-2xs);
  font-weight: 600;
  box-shadow: var(--color-card-shadow);
}

.other-projects-head {
  text-align: center;
  color: var(--color-accent);
  font-weight: 700;
  font-size: var(--fs-xs);
  margin: 64px 0 24px;
}
.mini-project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.mini-project-card {
  display: flex;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--color-card-shadow);
}
.mini-project-card:hover {
  transform: translateY(-2px);
}
.mini-project-card-body {
  padding: 20px;
  flex: 1;
}
.mini-project-card h4 {
  font-size: var(--fs-base);
  margin: 0 0 8px;
}
.mini-project-card-figure {
  width: 40%;
  flex-shrink: 0;
}
.mini-project-card-figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.more-link {
  text-align: center;
  margin-top: 32px;
  font-size: var(--fs-xs);
  color: var(--color-muted);
}
.more-link a:hover {
  color: var(--color-accent);
}

/* ---------- Project detail page ---------- */
.project-topbar {
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 10;
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.project-topbar.is-visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.scroll-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 100%;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: left;
}
.project-topbar .wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 60px;
  font-size: var(--fs-xs);
}
.project-topbar .back {
  color: var(--color-accent);
  font-weight: 600;
}
.project-topbar .title {
  flex: 1;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.project-topbar .anchors {
  display: flex;
  gap: 18px;
  color: var(--color-muted);
}
.project-topbar .anchors a:hover {
  color: var(--color-accent);
}
.project-topbar .anchors a.active {
  color: var(--color-accent);
  font-weight: 600;
}
.project-topbar .next {
  color: var(--color-accent);
  font-weight: 600;
  white-space: nowrap;
}

.project-hero,
.project-section {
  scroll-margin-top: 136px;
}
.project-hero {
  padding: 48px 0 24px;
  background: var(--color-bg-alt);
}
.project-hero .meta-line {
  color: var(--color-muted);
  font-size: var(--fs-xs);
  margin-bottom: 12px;
}
.project-hero h1 {
  font-size: var(--fs-xl);
  margin: 0 0 32px;
}
.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  padding: 24px 0;
  margin-bottom: 40px;
}
.meta-grid dt {
  font-size: var(--fs-2xs);
  color: var(--color-muted);
  margin-bottom: 6px;
}
.meta-grid dd {
  margin: 0;
  font-weight: 600;
  font-size: var(--fs-base);
}

.project-section h2 {
  color: var(--color-navy);
  font-size: var(--fs-lg);
  margin: 56px 0 20px;
}
.project-section h3 {
  font-size: var(--fs-md);
  margin: 32px 0 12px;
}
.project-section p {
  font-size: var(--fs-base);
  margin: 0 0 16px;
}
.project-section ul {
  padding-left: 20px;
  font-size: var(--fs-base);
}
.project-section li {
  margin-bottom: 8px;
}
.project-section figure {
  margin: 24px 0;
}
.project-section figure img {
  border-radius: 12px;
  border: 1px solid var(--color-border);
}
.project-section figcaption {
  font-size: var(--fs-2xs);
  color: var(--color-muted);
  margin-top: 8px;
}
.img-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin: 24px 0;
}
.img-grid img {
  border-radius: 12px;
  border: 1px solid var(--color-border);
  width: 100%;
}
blockquote {
  border-left: 3px solid var(--color-accent);
  margin: 24px 0;
  padding: 4px 20px;
  color: var(--color-muted);
  font-size: var(--fs-base);
}
.next-project-cta {
  margin-top: 64px;
  padding: 32px 0;
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.next-project-cta a {
  color: var(--color-accent);
  font-weight: 600;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 40px 0 24px;
  margin-top: 40px;
}
.site-footer .footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 24px;
}
.footer-top nav {
  display: flex;
  gap: 24px;
  font-size: var(--fs-xs);
}
.footer-socials {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: var(--fs-xs);
  color: var(--color-muted);
}
.footer-socials svg {
  width: 18px;
  height: 18px;
}
.footer-bottom {
  display: flex;
  justify-content: space-between;
  color: var(--color-muted);
  font-size: var(--fs-2xs);
  flex-wrap: wrap;
  gap: 10px;
}

/* ---------- Access notice (framer old site) ---------- */
.notice-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}
.notice-page h1 {
  font-size: 24px;
  margin-bottom: 16px;
}
.notice-page p {
  color: var(--color-muted);
  font-size: 16px;
}

@media (max-width: 640px) {
  .site-header nav {
    gap: 16px;
    font-size: var(--fs-2xs);
  }
  .hero h1,
  .project-hero h1 {
    font-size: var(--fs-lg);
  }
  .project-topbar .anchors {
    display: none;
  }
}
