:root {
  --text: #f6f3ea;
  --muted: rgba(246, 243, 234, 0.72);
  --panel: rgba(11, 15, 18, 0.58);
  --panel-strong: rgba(11, 15, 18, 0.72);
  --line: rgba(255, 255, 255, 0.16);
  --accent: #f3b37a;
  --accent-soft: rgba(243, 179, 122, 0.68);
  --warm: #ffd0a3;
  --bg-blend-height: clamp(96px, 13vh, 160px);
  --site-cursor: url("../../images/cursor-small.png") 3 2, auto;
  --site-cursor-action: url("../../images/cursor-small.png") 3 2, pointer;
}

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

html {
  max-width: 100%;
  overflow-x: clip;
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
  max-width: 100%;
  background: #080c10;
  color: var(--text);
  cursor: var(--site-cursor);
  font-family: "Segoe UI", "Noto Sans TC", "PingFang TC", Arial, sans-serif;
  line-height: 1.75;
  animation: homePageEnter 0.36s ease both;
}

.nav,
.hero,
main,
footer {
  transition: opacity 0.26s ease, transform 0.26s ease;
}

body.page-exit-left .nav,
body.page-exit-left .hero,
body.page-exit-left main,
body.page-exit-left footer {
  opacity: 0;
  transform: translateX(-34px);
}

.cursor-effects {
  position: fixed;
  z-index: 90;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

a {
  color: inherit;
  cursor: var(--site-cursor-action);
  text-decoration: none;
}

button {
  cursor: var(--site-cursor-action);
}

.nav {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: calc(20px + env(safe-area-inset-top)) max(30px, 5vw) 20px;
  background: rgba(5, 8, 11, 0.48);
  color: #fff;
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 10px;
  font-size: 20px;
  font-weight: 800;
}

.brand-avatar {
  width: 34px;
  height: 34px;
  border: 2px solid rgba(255, 255, 255, 0.78);
  border-radius: 50%;
  object-fit: cover;
  object-position: center 18%;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.26);
}

.nav-links {
  display: flex;
  gap: 15px;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 4px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 16px;
  font-weight: 700;
  scrollbar-color: rgba(255, 255, 255, 0.34) transparent;
  scrollbar-width: thin;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
}

.nav-links > a {
  flex: 0 0 auto;
  white-space: nowrap;
}

.hero {
  --hero-parallax-x: 0px;
  --hero-parallax-y: 0px;
  --hero-content-x: 0px;
  --hero-content-y: 0px;
  position: relative;
  isolation: isolate;
  overflow: visible;
  display: grid;
  min-height: 100vh;
  padding: 82px 22px;
  place-items: center end;
  background: #080c10;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.hero::before {
  z-index: -2;
  inset: -7% -7% calc(var(--bg-blend-height) * -1) -7%;
  background: url("../../images/bg1.jpg") center top / cover no-repeat;
  transform: translate3d(var(--hero-parallax-x), var(--hero-parallax-y), 0) scale(1.05);
  will-change: transform;
  transition: transform 0.16s ease-out;
}

.hero::after {
  z-index: -1;
  inset: 0 0 calc(var(--bg-blend-height) * -1) 0;
  background: rgba(5, 8, 11, 0.38);
}

.content {
  width: min(660px, 100%);
  margin: 0 auto;
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  margin: -48px max(52px, 9vw) 0 auto;
  text-align: right;
}

.hero-inner {
  animation: fadeUp 0.9s ease both;
}

.hero-title {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 22px;
  min-width: 0;
  transform: translate3d(var(--hero-content-x), var(--hero-content-y), 0);
  transition: transform 0.16s ease-out;
  will-change: transform;
}

.hero-copy {
  min-width: 0;
  text-align: left;
}

.hero-avatar {
  flex: 0 0 auto;
  width: 166px;
  height: 166px;
  border: 3px solid rgba(255, 255, 255, 0.78);
  border-radius: 50%;
  object-fit: cover;
  object-position: center 18%;
  transform: translateY(-18px);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.38);
}

.eyebrow {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 800;
}

h1 {
  max-width: 720px;
  font-size: 82px;
  line-height: 1.04;
  letter-spacing: 0;
  white-space: nowrap;
}

.hero p {
  max-width: 610px;
  margin-top: 18px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 24px;
}

main {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 100vh;
  margin-top: 0;
  padding: calc(92px + var(--bg-blend-height)) 18px 92px;
  background: transparent;
}

main::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.main-bg {
  position: absolute;
  z-index: -2;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.main-bg-layer {
  position: absolute;
  inset: 0;
  opacity: 0;
  background-image: url("../../images/bg2.jpg");
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
  transition: opacity 1.2s ease;
  will-change: opacity;
  -webkit-mask-image: linear-gradient(
    180deg,
    transparent 0,
    rgba(0, 0, 0, 0.34) calc(var(--bg-blend-height) * 0.42),
    #000 var(--bg-blend-height)
  );
  mask-image: linear-gradient(
    180deg,
    transparent 0,
    rgba(0, 0, 0, 0.34) calc(var(--bg-blend-height) * 0.42),
    #000 var(--bg-blend-height)
  );
}

.main-bg-layer.is-active {
  opacity: 1;
}

main::after {
  z-index: -1;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.22) 0,
    rgba(0, 0, 0, 0.56) calc(var(--bg-blend-height) * 1.6),
    rgba(0, 0, 0, 0.7) 100%
  );
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 var(--bg-blend-height));
  mask-image: linear-gradient(180deg, transparent 0, #000 var(--bg-blend-height));
}

.content {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 28px;
}

section {
  padding: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 58px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
  animation: fadeUp 0.75s ease both;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

section:hover {
  transform: translateY(-4px);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.38);
}

section:nth-child(2) { animation-delay: 0.08s; }
section:nth-child(3) { animation-delay: 0.16s; }
section:nth-child(4) { animation-delay: 0.24s; }
section:nth-child(5) { animation-delay: 0.32s; }
section:nth-child(6) { animation-delay: 0.4s; }
section:nth-child(7) { animation-delay: 0.48s; }
section:nth-child(8) { animation-delay: 0.56s; }

h2 {
  margin-bottom: 14px;
  font-size: 34px;
  line-height: 1.25;
  letter-spacing: 0;
}

p {
  color: var(--muted);
  font-size: 18px;
}

.meta,
.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 20px;
}

.meta-item,
.stat,
.project {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.meta-item b,
.stat b {
  display: block;
  color: var(--accent);
  font-size: 14px;
}

.meta-item span,
.stat span {
  color: var(--muted);
}

.tags,
.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.tag,
.contact-links > a,
.contact-links > span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border: 1px solid var(--accent-soft);
  border-radius: 6px;
  color: #e8fffb;
  font-weight: 800;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.tag:hover,
.contact-links > a:hover,
.contact-links > span:hover {
  border-color: var(--accent);
  transform: translateY(-3px) scale(1.03);
}

.contact-links {
  align-items: stretch;
  flex-direction: column;
}

.contact-links > a,
.contact-links > span {
  min-height: 54px;
}

.contact-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.9);
  object-fit: contain;
}

.timeline,
.project-list,
.anime-list,
.game-list {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.anime-list {
  gap: 0;
}

.anime-list + .anime-list {
  margin-top: 0;
}

.anime-list + .anime-list .anime:first-child {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.timeline-item {
  position: relative;
  padding-left: 25px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  top: 10px;
  left: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--warm);
  box-shadow: 0 0 0 5px rgba(242, 179, 122, 0.14);
}

.timeline-item b,
.project h3,
.list-title {
  display: block;
  color: #fff;
  font-size: 19px;
  letter-spacing: 0;
}

.list-title {
  margin-top: 22px;
  color: var(--accent);
}

.project a {
  color: #fff;
}

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

.project-preview {
  display: block;
  overflow: hidden;
  margin-bottom: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.28);
}

.project-preview img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  object-fit: cover;
}

.project h3 {
  margin-bottom: 6px;
}

.showcase-grid,
.photo-grid,
.collection-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 20px;
}

.figure-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.figure-card img {
  display: block;
  width: 100%;
  height: clamp(190px, 42vw, 320px);
  object-fit: cover;
}

.gallery-card img {
  height: clamp(190px, 42vw, 300px);
  object-fit: cover;
}

.figure-card figcaption {
  padding: 12px 14px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 16px;
  font-weight: 800;
}

.zoomable-image {
  cursor: var(--site-cursor-action);
}

.zoomable-image:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

body.lightbox-open {
  overflow: hidden;
}

.lightbox {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.84);
  opacity: 0;
  transition: opacity 0.16s ease;
}

.lightbox[hidden] {
  display: none;
}

.lightbox.is-open {
  opacity: 1;
}

.lightbox-panel {
  position: relative;
  display: grid;
  gap: 12px;
  width: min(1100px, 100%);
  max-height: 92vh;
}

.lightbox-image {
  display: block;
  max-width: 100%;
  max-height: 82vh;
  margin: 0 auto;
  border-radius: 8px;
  object-fit: contain;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.48);
}

.lightbox-caption {
  color: rgba(255, 255, 255, 0.88);
  font-size: 16px;
  font-weight: 800;
  text-align: center;
}

.lightbox-close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  background: rgba(9, 12, 15, 0.92);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}

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

.anime,
.game {
  display: flex;
  align-items: flex-start;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
  font-size: 17px;
}

.anime {
  padding: 8px 0;
  line-height: 1.5;
}

.game {
  padding: 13px 0;
}

.anime:last-child,
.game:last-child {
  border-bottom: 0;
}

.anime-note,
.game-note {
  margin-top: 18px;
  color: rgba(255, 255, 255, 0.64);
  font-size: 15px;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(22px);
  }

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

@keyframes homePageEnter {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

footer {
  padding: 24px;
  background: #05080b;
  color: rgba(255, 255, 255, 0.68);
  text-align: center;
  font-size: 14px;
}

@media (max-width: 720px) {
  .nav {
    flex-direction: column;
    gap: 7px;
    padding: calc(14px + env(safe-area-inset-top)) 18px 10px;
  }

  .brand {
    font-size: 18px;
  }

  .brand-avatar {
    width: 30px;
    height: 30px;
  }

  .nav-links {
    display: grid;
    grid-template-columns: repeat(4, max-content);
    width: 100%;
    min-height: 0;
    justify-content: center;
    justify-items: center;
    gap: 6px 14px;
    overflow: hidden;
    padding-bottom: 0;
    font-size: 13px;
    scrollbar-width: none;
    white-space: normal;
  }

  .hero {
    padding: calc(150px + env(safe-area-inset-top)) 18px 70px;
  }

  .hero-inner {
    width: 100%;
    margin: -28px 0 0;
  }

  h1 {
    font-size: 50px;
    overflow-wrap: anywhere;
    white-space: normal;
  }

  .hero-title {
    gap: 14px;
    max-width: 100%;
  }

  .main-bg-layer {
    background-attachment: scroll;
  }

  .hero-avatar {
    width: 106px;
    height: 106px;
    transform: translateY(-12px);
  }

  .hero p,
  p {
    font-size: 18px;
  }

  main {
    padding: calc(58px + var(--bg-blend-height)) 14px 58px;
  }

  section {
    padding: 28px;
  }

  h2 {
    font-size: 30px;
  }

  .meta,
  .stats {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 380px) {
  .nav-links {
    grid-template-columns: repeat(3, max-content);
  }

  .hero {
    padding-top: calc(174px + env(safe-area-inset-top));
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .hero::before {
    transform: none;
    will-change: auto;
  }

  .hero-title {
    transform: none;
    will-change: auto;
  }

  .cursor-effects {
    display: none;
  }
}

