@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url('./assets/fonts/archivo-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD;
}

:root {
  --paper: #F6F6F4;
  --tone: #EAEAE6;
  --tone-deep: #DCDCD6;
  --ink: #241B19;
  --ink-soft: #5B504B;
  --yellow: #FFE600;
  --font: 'Archivo', 'PingFang TC', 'Noto Sans TC', 'Microsoft JhengHei', sans-serif;
  --m: clamp(16px, 2.2vw, 32px);
  --header: 72px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 18px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, ul, figure { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img, video, svg { display: block; max-width: 100%; }
::selection { background: var(--yellow); color: var(--ink); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: fixed; z-index: 100; top: 12px; left: 12px; padding: 12px 18px; background: var(--yellow); transform: translateY(-200%); }
.skip-link:focus { transform: none; }

/* 頁首：字標、三個連結 */
.site-header { position: fixed; z-index: 60; top: 0; left: 0; right: 0; height: var(--header); display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-inline: var(--m); color: var(--ink); transition: color 200ms ease; }
.site-header.on-ink { color: var(--ink); background: var(--paper); }
.site-header.solid { background: var(--paper); }
.wordmark { font-weight: 800; font-stretch: 112%; font-size: 22px; letter-spacing: -.02em; }
.site-nav { display: flex; gap: clamp(16px, 3vw, 40px); font-size: 16px; }
.site-nav a { position: relative; padding-block: 12px; }
.site-nav a::before { content: ''; position: absolute; z-index: -1; left: -2px; right: -2px; top: 52%; height: 38%; background: var(--yellow); transform: scaleX(0); transform-origin: 0 50%; transition: transform 260ms var(--ease); }
.site-nav a:hover::before, .site-nav a:focus-visible::before { transform: scaleX(1); }

/* 開場舞台 */
.opening { position: relative; }
.js .opening { height: 420vh; }
.stage { position: relative; height: 100svh; overflow: hidden; }
.js .stage { position: sticky; top: 0; }
.layer { position: absolute; inset: 0; }

.blueprint-layer { z-index: 2; }
.blueprint { width: 100%; height: 100%; overflow: visible; }
.blueprint .ln { fill: none; stroke: var(--ink); stroke-width: 1; vector-effect: non-scaling-stroke; opacity: .18; }
.blueprint .ln-strong { opacity: .3; }
.blueprint .letters { fill: var(--ink); font-family: var(--font); font-weight: 800; font-stretch: 118%; letter-spacing: -.02em; }
.blueprint .lbl { fill: var(--ink); font-family: var(--font); font-size: 14px; font-weight: 500; letter-spacing: .04em; }
.blueprint .lbl-box { fill: var(--paper); }
.blueprint .hi { fill: var(--yellow); }
.blueprint .tag-ink { fill: var(--ink); }
.blueprint .lbl-on-ink { fill: var(--yellow); font-weight: 600; }
.js .blueprint .draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.3s var(--ease) forwards; }
.js .blueprint .letters, .js .blueprint .lbl-group { animation: none; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade-in { from { opacity: 0; } }

.brand-title { margin: 0; }
.fallback-title { display: none; }
.no-js .fallback-title { display: block; position: absolute; left: var(--m); right: var(--m); top: 50%; transform: translateY(-50%); font-size: 14vw; line-height: .9; font-weight: 800; font-stretch: 118%; letter-spacing: -.03em; }
.opening-lede { position: absolute; z-index: 3; left: calc(var(--m) + 20px); bottom: var(--lede-bottom, calc(var(--m) + 20px)); max-width: 22em; padding: 6px 10px; background: var(--paper); font-size: 17px; font-weight: 500; line-height: 1.5; }

.flood { z-index: 4; pointer-events: none; opacity: 0; }
.flood i { position: absolute; left: 0; top: 0; width: 100px; height: 100px; margin: -50px 0 0 -50px; background: var(--yellow); will-change: transform; }

.yellow { z-index: 5; background: var(--yellow); opacity: 0; overflow: hidden; pointer-events: none; will-change: transform; }
.giant { position: absolute; left: 50%; top: 50%; font-weight: 900; font-stretch: 125%; font-size: 150vh; font-size: 150svh; line-height: .74; color: var(--ink); visibility: hidden; will-change: transform; }

.box-scene { position: absolute; inset: 0; display: grid; place-items: center; perspective: 1700px; visibility: hidden; }
.box { --s: 200px; position: relative; width: var(--s); height: var(--s); transform-style: preserve-3d; will-change: transform; }
.face, .flap { position: absolute; transform-style: preserve-3d; background: var(--ink); }
.face { width: var(--s); height: var(--s); }
.base { inset: 0; }
.anchor { position: absolute; left: 50%; top: 50%; width: 2px; height: 2px; transform: translateZ(var(--s)); }
.wall-n { left: 0; bottom: 100%; transform-origin: 50% 100%; }
.wall-s { left: 0; top: 100%; transform-origin: 50% 0; }
.wall-e { top: 0; left: 100%; transform-origin: 0 50%; }
.wall-w { top: 0; right: 100%; transform-origin: 100% 50%; }
.flap-n, .flap-s { left: 0; width: var(--s); height: calc(var(--s) * .5); }
.flap-e, .flap-w { top: 1%; height: 98%; width: calc(var(--s) * .48); }
.flap-n { bottom: 100%; transform-origin: 50% 100%; }
.flap-s { top: 100%; transform-origin: 50% 0; }
.flap-e { left: 100%; transform-origin: 0 50%; }
.flap-w { right: 100%; transform-origin: 100% 50%; }
.print { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; font-weight: 800; font-stretch: 112%; font-size: calc(var(--s) * .15); letter-spacing: -.02em; color: var(--paper); backface-visibility: hidden; transform: rotateX(180deg) translateZ(1px); }

.items { position: absolute; inset: 0; z-index: 7; pointer-events: none; }
.items .item { position: absolute; transform-origin: 50% 50%; will-change: transform, opacity; opacity: 0; }

/* 落點：NFC 立牌 */
.landing { z-index: 1; display: flex; flex-direction: column; gap: clamp(20px, 3.4vh, 40px); padding: calc(var(--header) + 8px) var(--m) var(--m); }
.landing-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 40px; }
.landing-head h2, .works-head h2 { font-size: clamp(40px, 5.4vw, 84px); line-height: 1.04; font-weight: 600; letter-spacing: -.02em; }
.landing-head p, .works-head p { max-width: 27em; font-size: 18px; }
.stand-row { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stand-card { display: flex; flex-direction: column; min-height: 0; }
.stand-tile { position: relative; flex: 1; min-height: 180px; background: var(--tone); overflow: hidden; }
.stand-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.stand-cut { display: none; }
.items .item img { display: block; width: 100%; height: 100%; }
.stand-card h3 { margin-top: 14px; font-size: 22px; font-weight: 600; line-height: 1.3; }
.stand-card p { margin-top: 4px; font-size: 16px; line-height: 1.5; }

/* 右下角的進度小箱子：沿用大箱子的面與上蓋樣式，只是尺寸小 */
.mini-box { position: fixed; z-index: 55; right: calc(var(--m) + 6px); bottom: calc(var(--m) + 6px); width: 92px; height: 92px; display: grid; place-items: center; perspective: 420px; pointer-events: none; }
.mini-box .box { --s: 20px; }
.mini-box { transition: opacity 250ms ease; }
.mini-box.is-hidden { opacity: 0; }

/* 互動網站 */
.works { padding: clamp(120px, 14vw, 200px) var(--m) 0; }
.works-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 40px; padding-bottom: 40px; }
/* 四張等大的作品卡，兩欄；右欄整體往下錯開，交錯但每欄仍對齊 */
.work-grid { --stagger: clamp(56px, 9vw, 160px); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(16px, 2vw, 28px); row-gap: clamp(40px, 5vw, 72px); padding-bottom: var(--stagger); }
.work { display: flex; flex-direction: column; }
.work:nth-child(even) { transform: translateY(var(--stagger)); }
.work-media { position: relative; overflow: hidden; aspect-ratio: 16 / 10; background: var(--tone); }
.work-media img, .work-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 700ms var(--ease), opacity 300ms ease; }
.work-media video { opacity: 0; }
.work.is-playing .work-media video { opacity: 1; }

.work-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 16px 0 8px; }
.work-copy h3 { position: relative; z-index: 0; font-size: 24px; font-weight: 600; line-height: 1.3; padding-inline: 2px; }
.work-copy h3::before { content: ''; position: absolute; z-index: -1; inset: 0; background: var(--yellow); transform: scaleX(0); transform-origin: 0 50%; transition: transform 320ms var(--ease); }
.work:hover .work-copy h3::before, .work:focus-visible .work-copy h3::before { transform: scaleX(1); }
.work-copy p { font-size: 16px; }

/* 頁尾：名字回到整個寬度 */
.site-footer { margin-top: clamp(120px, 14vw, 200px); padding: 40px var(--m) var(--m); background: var(--yellow); }
.footer-row { display: flex; justify-content: space-between; gap: 24px; font-size: 16px; }
.footer-row a { text-decoration: underline; text-underline-offset: 5px; }
.footer-mark { margin-top: 48px; width: fit-content; font-size: 9.2vw; line-height: .8; font-weight: 800; font-stretch: 118%; letter-spacing: -.03em; white-space: nowrap; }
.footer-mark b { font-size: 1.9em; font-weight: 900; }
.copyright { margin-top: 24px; font-size: 14px; }

/* 減少動態效果、無 JavaScript：開場改成靜態一頁接一頁 */
.static .opening, .no-js .opening { height: auto; }
.static .stage, .no-js .stage { position: relative; height: auto; overflow: visible; }
.static .layer, .no-js .layer { position: relative; inset: auto; }
.static .blueprint-layer, .no-js .blueprint-layer { height: 100svh; }
.static .flood, .static .yellow, .static .items,
.no-js .flood, .no-js .yellow, .no-js .mini-box { display: none; }
.static .landing, .no-js .landing { min-height: 100svh; }

@media (max-width: 760px) {
  :root { --header: 60px; }
  body { font-size: 17px; }
  .wordmark { font-size: 19px; }
  .site-nav { gap: 14px; font-size: 15px; }
  .site-nav a[href="#contact"] { display: block; }
  .mini-box { position: static; width: 44px; height: var(--header); perspective: 260px; }
  .mini-box .box { --s: 11px; }
  .opening-lede { font-size: 16px; right: calc(var(--m) + 20px); }
  .landing-head, .works-head { flex-direction: column; align-items: flex-start; gap: 10px; }
  .landing-head p, .works-head p { font-size: 16px; }
  .stand-row { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stand-tile { min-height: 0; }
  .stand-card h3 { margin-top: 8px; font-size: 17px; }
  .stand-card p { display: block; font-size: 14px; line-height: 1.45; }
  .work-grid { grid-template-columns: 1fr; padding-bottom: 0; }
  .work:nth-child(even) { transform: none; }
  .work-copy { gap: 2px; }
  .footer-row { flex-direction: column; }
  .footer-mark { font-size: 8.6vw; }
}

@media (prefers-reduced-motion: reduce) {
  .js .blueprint .draw { animation: none; stroke-dashoffset: 0; }
  .js .blueprint .letters, .js .blueprint .lbl-group { animation: none; }
  .work-media img, .work-media video { transition: none; }
}

/* Refinements keep the original blueprint, yellow field and staggered portfolio. */
html { scroll-padding-top: calc(var(--header) + 24px); }
h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
a, button { touch-action: manipulation; -webkit-tap-highlight-color: #ffe60066; }
button { font: inherit; color: inherit; cursor: pointer; }
.site-header { padding-top: env(safe-area-inset-top); }
.wordmark { white-space: nowrap; }
.site-header.on-ink :focus-visible { outline-color: var(--ink); }
.opening-intro { position: absolute; z-index: 3; left: calc(var(--m) + 24px); right: calc(var(--m) + 24px); bottom: calc(var(--m) + 28px); display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; }
.opening-lede { position: static; padding: 0; font-size: clamp(17px, 1.5vw, 22px); max-width: 30em; font-weight: 500; }
.primary-link { flex: none; display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 12px 24px; font-size: 16px; font-weight: 600; background: var(--yellow); transition: background-color 180ms, color 180ms; }
.primary-link:hover { background: var(--ink); color: var(--paper); }
.fallback-title { display: block; position: absolute; top: 45%; left: var(--m); right: var(--m); text-align: center; font-size: clamp(40px, 12vw, 180px); line-height: 1; letter-spacing: -.055em; }
.opening-ready .fallback-title { display: none; }
.box-scene.webgl-ready > .box { visibility: hidden; }
.box-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.box-caption { position: absolute; left: calc(var(--m) + 24px); bottom: calc(var(--m) + 32px); font-size: clamp(24px, 3.2vw, 48px); line-height: 1.2; font-weight: 600; letter-spacing: -.025em; opacity: 0; }
.landing-head h2, .works-head h2 { font-size: clamp(36px, 4.5vw, 66px); max-width: 11em; flex-shrink: 0; line-height: 1.15; }
.landing-head p, .works-head p { line-height: 1.75; }
.works-intro { max-width: 28em; }
.preview-toggle { margin-top: 18px; background: var(--tone); border: 0; min-height: 44px; padding: 8px 16px; font-size: 15px; transition: background-color 180ms; }
.preview-toggle:hover { background: var(--yellow); }
.contact-head { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; padding-block: 24px 72px; align-items: end; }
.contact-head h2 { font-size: clamp(36px, 4.5vw, 66px); line-height: 1.15; font-weight: 600; letter-spacing: -.035em; }
.contact-copy { max-width: 32em; }
.contact-copy p { font-size: 18px; line-height: 1.75; }
.contact-email { display: inline-block; margin-top: 24px; padding-block: 8px; font-size: clamp(20px, 2.8vw, 40px); font-weight: 600; letter-spacing: -.035em; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 8px; }
.contact-email:hover { text-decoration-thickness: 4px; }
.footer-row a { display: inline-flex; align-items: center; min-height: 44px; }
.site-footer { padding-bottom: max(var(--m), env(safe-area-inset-bottom)); }
.static .mini-box, .no-js .mini-box { display: none; }
.no-js .landing { min-height: 720px; }
@media (max-width: 1000px) {
  .landing-head, .works-head { flex-direction: column; align-items: flex-start; gap: 18px; }
  .landing-head p, .works-head p { max-width: 38em; }
}
@media (max-width: 760px) {
  :root { --header: calc(64px + env(safe-area-inset-top)); }
  .site-header { gap: 12px; }
  .wordmark { font-size: 18px; font-stretch: 100%; }
  .site-nav { gap: 14px; font-size: 14px; }
  .site-nav a { min-height: 44px; display: flex; align-items: center; }
  .mini-box { display: none; }
  .opening-intro { left: calc(var(--m) + 16px); right: calc(var(--m) + 16px); bottom: calc(var(--m) + 20px); flex-direction: column; align-items: flex-start; gap: 18px; }
  .opening-lede { font-size: 16px; line-height: 1.7; }
  .primary-link { min-height: 46px; padding: 10px 20px; }
  .box-caption { left: var(--m); bottom: 40px; font-size: 28px; }
  .landing { gap: 20px; padding-top: calc(var(--header) + 20px); }
  .landing-head h2, .works-head h2 { font-size: clamp(29px, 7.6vw, 44px); }
  .landing-head, .works-head { gap: 12px; }
  .stand-row { row-gap: 20px; }
  .stand-tile { min-height: 70px; }
  .stand-card h3 { font-size: 18px; }
  .works { padding-top: 88px; }
  .works-head { padding-bottom: 28px; }
  .work-copy h3 { font-size: 22px; }
  .work-grid { row-gap: 36px; }
  .site-footer { margin-top: 88px; padding-top: 36px; }
  .contact-head { grid-template-columns: 1fr; gap: 24px; padding: 0 0 48px; }
  .contact-copy p { font-size: 16px; }
  .contact-email { font-size: clamp(22px, 6.5vw, 32px); }
  .footer-row { gap: 10px; }
  .footer-mark { margin-top: 32px; }
  .static .landing, .no-js .landing { min-height: auto; }
  .static .stand-tile, .no-js .stand-tile { flex: none; aspect-ratio: 4 / 5; }
}
@media (max-height: 620px) and (min-width: 761px) {
  .landing { gap: 16px; }
  .landing-head h2 { font-size: 36px; }
  .stand-tile { min-height: 100px; }
  .stand-card h3 { margin-top: 8px; font-size: 18px; }
  .stand-card p { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
.brand-title { position: absolute; z-index: 1; left: 50%; top: 50%; width: max-content; max-width: calc(100% - 2 * var(--m)); transform: translate(-50%, -50%); font-size: clamp(40px, 6.7vw, 110px); line-height: 1; font-weight: 800; font-stretch: 112%; letter-spacing: -.04em; white-space: nowrap; }
.brand-row { display: inline-block; }
.brand-title b { font-size: 1.9em; font-weight: 800; }
@media (max-width: 760px) {
  .brand-title { font-size: clamp(38px, 13.5vw, 82px); line-height: 1.25; text-align: center; }
  .brand-row { display: block; }
  .brand-title b { font-size: 1.65em; }
  .blueprint .lbl-group { display: none; }
}
@media (max-width: 760px) and (max-height: 650px) {
  .brand-title { font-size: 11.5vw; }
  .opening-intro { bottom: 32px; gap: 12px; }
  .opening-lede { font-size: 14px; }
  .landing { gap: 12px; padding-top: calc(var(--header) + 12px); }
  .landing-head h2 { font-size: 27px; }
  .landing-head p { font-size: 14px; line-height: 1.5; }
  .stand-card p { font-size: 13px; }
  .stand-row { row-gap: 14px; }
}
.works { scroll-margin-top: calc(-1 * clamp(120px, 14vw, 200px)); }
@media (max-width: 1000px) { .mini-box { display: none; } }
@media (max-width: 760px) { .works { scroll-margin-top: -88px; } }
@media (max-width: 360px) {
  .site-header { gap: 8px; }
  .wordmark { font-size: 16px; }
  .site-nav { gap: 10px; font-size: 13px; white-space: nowrap; }
}
