:root {
  --white: #ffffff;
  --black: #111111;
  --grey: #6e6e6e;
  --line: #d9d9d9;
  --accent: #ff5a36;
  --max-width: 1200px;
  --font-base: "Helvetica Neue", "PingFang TC", "Microsoft JhengHei", -apple-system, BlinkMacSystemFont, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-base);
  background: var(--white);
  color: var(--black);
  line-height: 1.5;
}

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

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

ul {
  list-style: none;
}

/* Inverted circular cursor (desktop only) */
.has-custom-cursor {
  cursor: none;
}

.has-custom-cursor a,
.has-custom-cursor button {
  cursor: none;
}

.cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--white);
  mix-blend-mode: difference;
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: opacity 0.2s ease, width 0.2s ease, height 0.2s ease;
}

.cursor-dot.visible {
  opacity: 1;
}

.cursor-dot.grow {
  width: 56px;
  height: 56px;
}

/* Top / bottom bars */
.bar {
  position: sticky;
  background: var(--white);
  z-index: 100;
}

.bar-top {
  top: 0;
  border-bottom: 1px solid var(--line);
}

.bar-bottom {
  position: static;
  border-top: 1px solid var(--line);
}

.bar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mark {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.bar-links {
  display: flex;
  gap: 28px;
}

.bar-links a {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--black);
  position: relative;
}

.bar-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.2s ease;
}

.bar-links a:hover::after {
  width: 100%;
}

.copyright {
  font-size: 0.75rem;
  color: var(--grey);
  letter-spacing: 0.03em;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  width: 22px;
  height: 1px;
  background: var(--black);
}

/* Sections */
.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 110px 32px;
  border-bottom: 1px solid var(--line);
}

.section:last-of-type {
  border-bottom: none;
}

.eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--grey);
  margin-bottom: 40px;
}

.accent-text {
  color: var(--accent);
}

/* Full-screen hero carousel */
.hero {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background: var(--black);
}

.hero-slides {
  position: absolute;
  inset: 0;
}

.hero-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1s ease;
}

.hero-slide.is-active {
  opacity: 1;
}

/* About */
.intro {
  font-family: "Noto Sans TC", "Microsoft JhengHei Light", "PingFang TC", var(--font-base);
  font-size: clamp(1.05rem, 1.9vw, 1.5rem);
  font-weight: 200;
  line-height: 1.8;
  max-width: 680px;
  letter-spacing: 0.02em;
}

.intro .em {
  font-weight: 400;
  font-style: italic;
}

.role {
  margin-top: 32px;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--grey);
}

/* Work list */
.work-list {
  border-top: 1px solid var(--line);
}

.work-item {
  border-bottom: 1px solid var(--line);
}

.work-item a {
  position: relative;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding: 34px 4px;
}

.work-title {
  position: relative;
  z-index: 1;
  display: inline-block;
  font-size: clamp(1.4rem, 3vw, 2.4rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: #eeeeee;
  mix-blend-mode: difference;
}

/* Image reveal spans the FULL viewport width (edge to edge, no side gutters).
   The row lives inside a max-width container, so the preview breaks out of it
   with the full-bleed trick (left:50% + margin-left:-50vw + width:100vw).
   The title and meta stay in the content column and invert over the image
   via mix-blend-mode: difference.
   Adjust per work-item via inline style:
     --preview-size : image scale (default cover — fills the band)
     --preview-pos  : which part of the image shows (background-position)
   Text colors (#eeeeee / #919191) are tuned so difference-blending against
   the plain white background reproduces black / grey exactly at rest. */
.work-preview {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100vw;
  margin-left: -50vw;
  z-index: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  background-size: var(--preview-size, cover);
  background-position: var(--preview-pos, 50% 50%);
  background-repeat: no-repeat;
}

.work-item:hover .work-preview {
  opacity: 1;
}

.work-meta {
  position: relative;
  z-index: 1;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #919191;
  mix-blend-mode: difference;
  white-space: nowrap;
}

/* Contact */
.contact-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.contact-list a {
  display: inline-block;
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  font-weight: 500;
  padding: 10px 0;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.contact-list a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* Project detail page */
.back-link {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--grey);
  margin-bottom: 40px;
  transition: color 0.2s ease;
}

.back-link:hover {
  color: var(--accent);
}

.project-header {
  padding-bottom: 56px;
}

.project-title {
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: 24px;
}

.project-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
}

.project-meta-row div {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.project-meta-row span:first-child {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--grey);
}

.project-meta-row span:last-child {
  font-size: 0.95rem;
  font-weight: 500;
}

.project-meta-row a:hover {
  color: var(--accent);
}

.project-hero {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.project-body {
  max-width: 720px;
  padding-top: 56px;
  font-size: 1.05rem;
  color: var(--grey);
}

.project-body p + p {
  margin-top: 20px;
}

.project-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 56px;
}

.project-gallery img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.project-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.project-nav a {
  font-size: clamp(1.2rem, 2.6vw, 1.8rem);
  font-weight: 500;
  transition: color 0.2s ease;
}

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

.project-nav .label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--grey);
  margin-bottom: 8px;
}

/* Responsive */
@media (max-width: 700px) {
  .work-preview {
    display: none;
  }

  .cursor-dot {
    display: none;
  }

  .has-custom-cursor {
    cursor: auto;
  }

  .bar-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }

  .bar-links.open {
    max-height: 220px;
  }

  .bar-links li {
    padding: 16px 32px;
    border-top: 1px solid var(--line);
  }

  .bar-top .nav-toggle {
    display: flex;
  }

  .bar-bottom .bar-links {
    display: none;
  }

  .section {
    padding: 64px 20px;
  }

  .work-item a {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 24px 4px;
  }

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