/* ==========================================================================
   又悠數位 YoYou Studio — Homepage stylesheet
   Base: Aigence HTML template (tokens naming, button anatomy, preloader,
   GSAP/ScrollTrigger motion stack). Re-skinned into a new brand system.

   TABLE OF CONTENTS
   01 Design tokens
   02 Base
   03 Buttons (aigence-btn anatomy)
   04 Preloader / progress / skip link
   05 Header + desktop nav
   06 Mobile menu
   07 Hero
   08 Selected Works
   09 What I Do
   10 Beyond Launch
   11 About
   12 Let's Work Together
   13 Footer
   14 Reveal helpers
   15 Works archive page (works.html)
   ========================================================================== */

/* 01 Design tokens -------------------------------------------------------- */
:root {
  /* colour */
  --st-ink: #081435;
  --st-ink-2: #101c4d;
  --st-blue: #3a52ff;
  --st-blue-deep: #2b3fe0;
  --st-paper: #eef0f8;
  --st-white: #ffffff;
  --st-signal: #ff7a45;
  --st-text-dark: #081435;
  --st-text-mute-dark: #56608a;      /* on paper */
  --st-text-mute-light: rgba(238, 240, 248, .68); /* on ink / blue */
  --st-line-dark: rgba(8, 20, 53, .16);
  --st-line-light: rgba(238, 240, 248, .22);

  /* type */
  --st-font: "Plus Jakarta Sans", "Noto Sans TC", "Noto Sans CJK TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  --st-fs-body: 1rem;
  --st-fs-small: .875rem;
  --st-fs-h1: clamp(2.9rem, 12.4vw, 5.2rem);
  --st-fs-h2: clamp(2.2rem, 8.6vw, 4rem);
  --st-fs-h3: clamp(1.6rem, 6vw, 2.4rem);

  /* layout */
  --st-gutter: clamp(20px, 5vw, 72px);
  --st-max: 1480px;
  --st-header-h: 72px;
  --st-section: clamp(88px, 16vw, 168px);
  --st-ease: cubic-bezier(.22, .8, .24, 1);
  --st-ease-io: cubic-bezier(.76, 0, .24, 1);

  /* template-compatible aliases (kept so template snippets still resolve) */
  --aigence-font: var(--st-font);
  --aigence-base: var(--st-signal);
  --aigence-primary: var(--st-blue);
  --aigence-black: var(--st-ink);
  --aigence-white: var(--st-white);
}

/* 02 Base ----------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: auto; }
body {
  margin: 0;
  font-family: var(--st-font);
  font-size: var(--st-fs-body);
  line-height: 1.85;
  font-weight: 500;
  color: var(--st-text-dark);
  background: var(--st-ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.locked { overflow: hidden; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
h1, h2, h3, h4 { font-weight: 800; line-height: 1.12; letter-spacing: -.01em; }
.page-wrapper { position: relative; width: 100%; overflow-x: clip; }
.st-container { width: 100%; max-width: var(--st-max); margin: 0 auto; padding-inline: var(--st-gutter); }
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 2px solid var(--st-signal); outline-offset: 4px; }

/* text link with drawn underline */
.st-link {
  display: inline-flex; align-items: center; gap: .6em;
  position: relative; padding-block: .35em;
  font-weight: 700; font-size: 1rem; line-height: 1.4;
}
.st-link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: currentColor; transform-origin: right; transition: transform .6s var(--st-ease);
}
.st-link:hover::after { transform-origin: left; animation: st-underline .7s var(--st-ease); }
.st-link svg { width: 1.05em; height: 1.05em; transition: transform .5s var(--st-ease); }
.st-link:hover svg { transform: translateX(5px); }
@keyframes st-underline { 0% { transform: scaleX(1); transform-origin: right; } 45% { transform: scaleX(0); transform-origin: right; } 55% { transform: scaleX(0); transform-origin: left; } 100% { transform: scaleX(1); transform-origin: left; } }

/* 03 Buttons -------------------------------------------------------------- */
.aigence-btn {
  position: relative; display: inline-flex; align-items: center;
  margin: 0; padding: 0; border: 0; background: none; cursor: pointer;
  border-radius: 100px;
  font-family: inherit; text-decoration: none; vertical-align: middle;
  -webkit-tap-highlight-color: transparent;
}
.aigence-btn__text {
  position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 12px; overflow: hidden;
  padding: 18px 30px; border-radius: 100px;
  font-size: 15px; font-weight: 800; line-height: 1.3; letter-spacing: .02em; text-align: center;
  color: var(--st-ink); background: var(--st-signal);
  transition: color .5s var(--st-ease);
}
.aigence-btn__text::after {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: var(--st-paper); transform: translateY(101%);
  transition: transform .55s var(--st-ease);
}
.aigence-btn__arrow { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.aigence-btn:hover .aigence-btn__text::after { transform: translateY(0); }
.aigence-btn:hover .aigence-btn__arrow { animation: st-slide-right .55s var(--st-ease); }
@keyframes st-slide-right { 0% { transform: translateX(0); } 45% { transform: translateX(150%); opacity: 0; } 46% { transform: translateX(-150%); opacity: 0; } 100% { transform: translateX(0); opacity: 1; } }
.aigence-btn--paper .aigence-btn__text { background: var(--st-paper); color: var(--st-ink); }
.aigence-btn--paper .aigence-btn__text::after { background: var(--st-signal); }
.aigence-btn--sm .aigence-btn__text { padding: 13px 24px; font-size: 14px; }

/* 04 Preloader / progress / skip ----------------------------------------- */
.preloader {
  position: fixed; inset: 0; z-index: 9991; display: flex; align-items: center; justify-content: center;
  background: var(--st-ink); color: var(--st-paper);
  transition: transform .9s var(--st-ease-io), visibility 0s linear .9s;
}
.preloader__name { overflow: hidden; padding: 6px; }
.preloader__name img { display: block; width: auto; height: clamp(54px, 9vw, 76px); animation: st-pre-in .9s var(--st-ease) both; }
@keyframes st-pre-in { from { transform: translateY(110%); } to { transform: none; } }
html.is-ready .preloader { transform: translateY(-100%); visibility: hidden; }
html:not(.js) .preloader { display: none; }

.progress { position: fixed; z-index: 1002; left: 0; top: 0; width: 100%; height: 3px; pointer-events: none; }
.progress i { display: block; height: 100%; width: 100%; background: var(--st-signal); transform: scaleX(0); transform-origin: left; }

.skip-link {
  position: fixed; left: 12px; top: -80px; z-index: 2000; padding: 10px 16px;
  background: var(--st-signal); color: var(--st-ink); font-weight: 800; border-radius: 6px;
}
.skip-link:focus { top: 12px; }

/* 05 Header + desktop nav ------------------------------------------------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 1000; height: var(--st-header-h);
  color: var(--st-paper);
  transition: transform .6s var(--st-ease), background-color .4s ease, backdrop-filter .4s ease;
}
.site-header::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: rgba(8, 20, 53, .88);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  opacity: 0; transition: opacity .4s ease;
}
.site-header.is-solid::before { opacity: 1; }
.site-header.is-hidden { transform: translateY(-100%); }
body.locked .site-header { transform: none; }
.site-header__inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { position: relative; z-index: 3; display: inline-flex; align-items: center; }
.brand__logo { display: block; width: auto; height: 38px; transition: filter .4s ease; }

.main-nav { display: none; }
.main-nav__list { display: flex; align-items: center; gap: clamp(18px, 2.3vw, 38px); }
.main-nav__link { position: relative; display: block; padding: 6px 0; text-align: center; line-height: 1.25; }
.main-nav__zh { display: block; font-size: .95rem; font-weight: 700; }
.main-nav__en { display: block; margin-top: 2px; font-size: .66rem; font-weight: 600; letter-spacing: .06em; color: var(--st-text-mute-light); transition: color .3s; }
.main-nav__link::after { content: ""; position: absolute; left: 50%; bottom: -6px; width: 5px; height: 5px; border-radius: 50%; background: var(--st-signal); transform: translateX(-50%) scale(0); transition: transform .4s var(--st-ease); }
.main-nav__link:hover::after, .main-nav__link[aria-current="page"]::after { transform: translateX(-50%) scale(1); }
.main-nav__link:hover .main-nav__en { color: var(--st-paper); }
.site-header__cta { display: none; }

.nav-toggle {
  position: relative; z-index: 3; width: 48px; height: 48px; margin-right: -10px;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  border: 0; background: none; cursor: pointer; color: inherit;
}
.nav-toggle span { display: block; width: 26px; height: 2px; background: currentColor; transition: transform .5s var(--st-ease), opacity .3s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

@media (min-width: 1100px) {
  :root { --st-header-h: 88px; }
  .main-nav { display: block; }
  .site-header__cta { display: inline-flex; }
  .nav-toggle { display: none; }
  .brand__logo { height: 42px; }
}
@media (min-width: 1400px) { .brand__logo { height: 48px; } }

/* 06 Mobile menu ---------------------------------------------------------- */
.mobile-menu {
  position: fixed; inset: 0; z-index: 999; display: flex; flex-direction: column;
  padding: calc(var(--st-header-h) + 8px) var(--st-gutter) calc(24px + env(safe-area-inset-bottom, 0px));
  color: var(--st-paper); overflow-y: auto;
  background: radial-gradient(120% 55% at 100% 100%, rgba(58, 82, 255, .38), rgba(58, 82, 255, 0) 62%), var(--st-ink);
  clip-path: circle(0 at calc(100% - 34px) 36px); visibility: hidden;
  transition: clip-path .85s var(--st-ease-io), visibility 0s linear .85s;
}
.mobile-menu.is-open { clip-path: circle(160% at calc(100% - 34px) 36px); visibility: visible; transition: clip-path .85s var(--st-ease-io), visibility 0s; }
.mobile-menu__list { margin-block: auto; padding-block: 8px; counter-reset: m; }
.mobile-menu__item { overflow: hidden; border-top: 1px solid var(--st-line-light); }
.mobile-menu__item:last-child { border-bottom: 1px solid var(--st-line-light); }
.mobile-menu__link {
  display: grid; grid-template-columns: 34px 1fr auto; align-items: center; column-gap: 8px; padding: 15px 0;
  transform: translateY(105%); opacity: 0; transition: transform .8s var(--st-ease), opacity .6s ease, color .3s;
}
.mobile-menu.is-open .mobile-menu__link { transform: none; opacity: 1; transition-delay: calc(.28s + var(--i) * .06s); }
.mobile-menu__no { font-size: .8rem; font-weight: 800; color: var(--st-signal); letter-spacing: .04em; }
.mobile-menu__text { display: flex; flex-direction: column; line-height: 1.2; }
.mobile-menu__zh { font-size: clamp(1.75rem, 8.2vw, 2.3rem); font-weight: 900; letter-spacing: -.01em; }
.mobile-menu__en { margin-top: 4px; font-size: .75rem; font-weight: 600; letter-spacing: .06em; color: var(--st-text-mute-light); }
.mobile-menu__arrow { width: 22px; height: 22px; color: var(--st-text-mute-light); transition: color .3s, transform .5s var(--st-ease); }
.mobile-menu__link:active .mobile-menu__arrow, .mobile-menu__link:focus-visible .mobile-menu__arrow { color: var(--st-signal); transform: translate(3px, -3px); }
.mobile-menu__link[aria-current="page"] .mobile-menu__zh { color: var(--st-signal); }
.mobile-menu__link[aria-current="page"] .mobile-menu__arrow { color: var(--st-signal); }
.mobile-menu__foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px 20px; padding-top: 22px; opacity: 0; transform: translateY(16px); transition: opacity .6s ease .55s, transform .7s var(--st-ease) .55s; }
.mobile-menu.is-open .mobile-menu__foot { opacity: 1; transform: none; }
.mobile-menu__mail { font-size: .95rem; font-weight: 700; color: var(--st-text-mute-light); border-bottom: 1px solid var(--st-line-light); padding-bottom: 3px; }
@media (max-height: 740px) {
  .mobile-menu__link { padding: 9px 0; }
  .mobile-menu__zh { font-size: clamp(1.5rem, 7vw, 1.9rem); }
  .mobile-menu__en { margin-top: 2px; }
  .mobile-menu__foot { padding-top: 14px; }
}
@media (min-width: 1100px) { .mobile-menu { display: none; } }

/* 07b Shared entrance helpers (home + works) ------------------------------- */
html.js .hero__fade { opacity: 0; transform: translateY(22px); }
html.js.is-ready .hero__fade { opacity: 1; transform: none; transition: opacity 1s ease, transform 1s var(--st-ease); transition-delay: calc(.7s + var(--i, 0) * .1s); }
@keyframes st-fade-in { from { opacity: 0; transform: translateY(30px); } }

/* 08 Selected Works -------------------------------------------------------- */
.works { position: relative; background: var(--st-paper); color: var(--st-ink); padding-block: var(--st-section); }
.works__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: clamp(48px, 9vw, 110px); }
.works__title { font-size: var(--st-fs-h2); font-weight: 900; line-height: 1.05; }
.works__title small { display: block; margin-top: .45em; font-size: clamp(.95rem, 2.2vw, 1.15rem); font-weight: 600; color: var(--st-text-mute-dark); letter-spacing: .02em; }
.works__list { display: flex; flex-direction: column; gap: clamp(64px, 12vw, 140px); }

.work { position: relative; display: block; }
.work__link { display: block; color: inherit; }
.work__media { position: relative; overflow: hidden; background: var(--st-ink-2); }
@media (max-width: 1099.98px) {
  .work__media {
    border-radius: 14px;
    box-shadow: 0 16px 36px -10px rgba(11, 14, 23, .12);
  }
}
.work__plx { position: absolute; inset: 0; }
.work__media img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.001); transition: transform 1.2s var(--st-ease); will-change: transform; }
.work--a .work__media { aspect-ratio: 16 / 10; }
.work--b .work__media { aspect-ratio: 4 / 5; }
.work--c .work__media { aspect-ratio: 11 / 5; }
.work__cursor {
  position: absolute; z-index: 3; left: 0; top: 0; width: 104px; height: 104px; margin: -52px 0 0 -52px; border-radius: 50%;
  display: none; align-items: center; justify-content: center; text-align: center; font-size: 1.2rem; font-weight: 800; line-height: 1.25;
  color: var(--st-ink); background: var(--st-signal); pointer-events: none; opacity: 0; transform: scale(.4);
  /* 位移、縮放、透明度由 studio.js 的 GSAP 控制，這裡不能再加 transition（會造成標籤從舊位置滑過來） */
}
.work__body { display: grid; gap: 6px 24px; margin-top: 22px; }
.work__name { font-size: var(--st-fs-h3); font-weight: 800; line-height: 1.2; }
.work__name span { background: linear-gradient(currentColor, currentColor) 0 100% / 0 2px no-repeat; transition: background-size .7s var(--st-ease); padding-bottom: 2px; }
.work__cat { font-size: 1rem; font-weight: 700; color: var(--st-blue-deep); }
.work__tags { display: flex; flex-wrap: wrap; font-size: var(--st-fs-small); color: var(--st-text-mute-dark); line-height: 1.7; }
.work__tags li:not(:last-child)::after { content: "／"; margin: 0 .5em; opacity: .55; }
.work__go { display: inline-flex; align-items: center; gap: .6em; margin-top: 10px; font-weight: 800; font-size: .95rem; }
.work__go svg { width: 1.1em; height: 1.1em; transition: transform .5s var(--st-ease); }
@media (hover: hover) {
  .work__link:hover .work__media img { transform: scale(1.06); }
  .work__link:hover .work__name span { background-size: 100% 2px; }
  .work__link:hover .work__go svg { transform: translateX(6px); }
}
.work__link:active .work__name span { background-size: 100% 2px; }
.work__link:active .work__go svg { transform: translateX(6px); }
.works__all { display: none; }
.works__more { margin-top: clamp(56px, 9vw, 110px); display: flex; justify-content: flex-end; }
.works__more .st-link { font-size: 1.1rem; }
.works__head:last-child,
.works:not(:has(.work)) .works__head { margin-bottom: 0; }
.works:not(:has(.work)) .works__list,
.works:not(:has(.work)) .works__more { display: none; }

@media (min-width: 768px) {
  .work__body { grid-template-columns: 1fr auto; align-items: end; }
  .work__body-main { grid-column: 1; }
  .work__go { grid-column: 2; margin: 0; }
}
@media (min-width: 1100px) {
  .works__head { flex-direction: row; align-items: flex-end; justify-content: space-between; }
  .works__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(32px, 4vw, 72px); row-gap: clamp(64px, 10vh, 110px); }
  .work .work__media, .work--a .work__media, .work--b .work__media, .work--c .work__media { aspect-ratio: 16 / 10; }
  .work__body { grid-template-columns: 1fr auto; align-items: end; margin-top: 22px; }
  .work__name { font-size: clamp(1.7rem, 2.3vw, 2.5rem); }
  .work__cat { margin-top: 4px; }
  .work__tags { margin-top: 2px; }
  .work__go { margin: 0; }
  .work__cursor { display: flex; }
  .works__all {
    display: flex; flex-direction: column; justify-content: space-between; aspect-ratio: 16 / 10; padding: clamp(24px, 2.6vw, 44px);
    background: var(--st-ink); color: var(--st-paper); transition: background-color .6s var(--st-ease), color .6s var(--st-ease);
  }
  .works__all-label { font-size: .95rem; font-weight: 700; color: var(--st-text-mute-light); transition: color .6s var(--st-ease); }
  .works__all-text { display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: clamp(1.8rem, 3vw, 3.2rem); font-weight: 900; line-height: 1.15; }
  .works__all-text svg { width: 1.1em; height: 1.1em; flex-shrink: 0; transition: transform .6s var(--st-ease); }
  .works__all:hover { background: var(--st-signal); color: var(--st-ink); }
  .works__all:hover .works__all-label { color: var(--st-ink); }
  .works__all:hover svg { transform: translateX(10px); }
  .works__more { display: none; }
}

/* 12 Let's Work Together --------------------------------------------------- */
.contact { position: relative; background: var(--st-ink); color: var(--st-paper); padding-block: var(--st-section) clamp(64px, 10vw, 110px); overflow: hidden; }
.contact__title { font-size: clamp(3.3rem, 17vw, 5.8rem); font-weight: 900; line-height: 1.04; letter-spacing: -.03em; }
.contact__title .line { display: block; white-space: nowrap; }
.contact__lead { margin-top: 30px; max-width: 26em; font-size: 1.05rem; color: var(--st-text-mute-light); }
.contact__actions { display: flex; flex-direction: column; align-items: flex-start; gap: 26px; margin-top: 40px; }
.contact__mail { display: inline-block; font-size: clamp(1.15rem, 5.4vw, 1.7rem); font-weight: 800; border-bottom: 2px solid var(--st-signal); padding-bottom: 4px; word-break: break-all; transition: color .3s; }
.contact__mail:hover { color: var(--st-signal); }
.contact__mail-note { display: block; margin-bottom: 8px; font-size: var(--st-fs-small); font-weight: 600; color: var(--st-text-mute-light); }
.contact__cta { position: relative; display: inline-flex; align-items: center; justify-content: center; text-align: center; }
@media (min-width: 1100px) {
  .contact__title { font-size: clamp(6rem, 12.6vw, 15rem); }
  .contact__bottom { display: grid; grid-template-columns: 1fr auto; align-items: end; column-gap: 6vw; margin-top: 7vh; }
  .contact__lead { margin-top: 0; }
  .contact__actions { margin-top: 0; flex-direction: row; align-items: flex-end; gap: 48px; }
  .contact__cta-round {
    width: 208px; height: 208px; border-radius: 50%; padding: 0; flex-direction: column; gap: 6px;
    background: var(--st-signal); color: var(--st-ink); font-weight: 900; font-size: 1.15rem; line-height: 1.3;
    transition: background-color .5s var(--st-ease), color .5s var(--st-ease);
  }
  .contact__cta-round svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .5s var(--st-ease); }
  .contact__cta-round:hover { background: var(--st-paper); }
  .contact__cta-round:hover svg { transform: rotate(45deg); }
}
@media (max-width: 1099.98px) {
  .contact__cta-round { display: none; }
  .contact__cta-mobile {
    border-radius: 100px;
    box-shadow: 0 12px 28px -6px rgba(255, 122, 69, .42);
    transition: transform .3s var(--st-ease), box-shadow .3s var(--st-ease);
  }
  .contact__cta-mobile:active {
    transform: scale(.96);
  }
}
@media (min-width: 1100px) { .contact__cta-mobile { display: none; } }

/* 13 Footer ---------------------------------------------------------------- */
.site-footer { background: var(--st-ink); color: var(--st-text-mute-light); padding-block: 0 36px; }
.site-footer__inner { border-top: 1px solid var(--st-line-light); padding-top: 34px; display: grid; gap: 28px; }
.site-footer__brand { display: inline-flex; }
.site-footer__brand img { display: block; width: auto; height: 44px; }
.site-footer__nav { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: var(--st-fs-small); font-weight: 600; }
.site-footer__nav a { padding-block: 6px; transition: color .3s; }
.site-footer__nav a:hover { color: var(--st-signal); }
.site-footer__meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; font-size: .8rem; }
.site-footer__top { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--st-paper); }
@media (min-width: 1100px) { .site-footer__inner { grid-template-columns: auto 1fr auto; align-items: center; column-gap: 56px; } .site-footer__meta { grid-column: 1 / -1; } }

/* 14 Reveal helpers --------------------------------------- */
html.js [data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity .9s ease, transform 1s var(--st-ease); transition-delay: var(--d, 0s); }
html.js [data-reveal].is-in, html.reveal-all [data-reveal] { opacity: 1; transform: none; }


