/* pohsuanchen.archive — line drawer (home) + file sheets */
:root {
  --ink: #111;
  --mute: #6E6C66;
  --paper: #ECEBE7;
  --sans: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  --pad: clamp(16px, 2.2vw, 34px);
  --accent: #EFE48A;
  --on-accent: #111;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); font-family: var(--sans); font-size: 13px; line-height: 1.4; text-transform: lowercase; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }
.mono { font-family: var(--mono); font-size: 11px; letter-spacing: .02em; }
.mute { color: var(--mute); }

.grain {
  position: fixed; inset: -50%; width: 200%; height: 200%; pointer-events: none; z-index: 60;
  opacity: .07; background-size: 200px; animation: grain 1.2s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-4%, 3%); } 40% { transform: translate(3%, -5%); }
  60% { transform: translate(-2%, 4%); } 80% { transform: translate(5%, 1%); } 100% { transform: translate(0, 0); }
}

/* ================= home: drawer ================= */
.drawer-page { background: var(--paper); min-height: 100vh; }
.bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; }
.bg video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(28px) saturate(1.5) contrast(1.05); transform: scale(1.2); }
.bg .noise { position: absolute; inset: -50%; width: 200%; height: 200%; background-size: 160px; opacity: .22; mix-blend-mode: multiply; animation: grain 1s steps(5) infinite; }

.bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  display: flex; justify-content: space-between; gap: 24px; padding: 16px var(--pad); font-size: 12px;
}
.bar a:hover { text-decoration: underline; }
.bar-r { display: flex; gap: 22px; }

.home {
  position: relative; z-index: 1; min-height: 100vh;
  /* a light veil over the film so the black lines read clearly — it fades in from the top
     edge, so the home page melts into the archive instead of ending in a hard line */
  background: linear-gradient(to bottom, rgba(236, 235, 231, .1) 0%, rgba(236, 235, 231, .62) 30%, rgba(236, 235, 231, .62) 100%);
  display: grid; grid-template-columns: minmax(0, 960px) minmax(240px, 300px); gap: 3.5vw; align-items: center; justify-content: center;
  padding: 120px var(--pad) 60px;
}
.drawer-wrap { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; }
/* the drawer may run taller than the screen: it scrolls with the page rather than shrinking */
#drawer { width: 100%; max-width: 700px; overflow: visible; }
.hint { color: var(--mute); margin: 0; }

/* svg pieces */
#drawer .line { fill: none; stroke: var(--ink); stroke-width: 1.4; }
/* line drawing: outlines only. on hover the lifted file turns white and its tab takes the accent */
#drawer .edge { fill: none; stroke: var(--ink); stroke-width: 1.4; stroke-linejoin: round; }
#drawer .tab { fill: transparent; stroke: var(--ink); stroke-width: 1.4; stroke-linejoin: round; transition: fill .2s; }
#drawer .div .tab { fill: var(--ink); }
#drawer text { font-family: var(--sans); font-size: 17px; fill: var(--ink); text-transform: lowercase; }
#drawer .div text { fill: #F4F3EF; }
#drawer .card { cursor: pointer; transition: transform .28s cubic-bezier(.2, .7, .2, 1); }
#drawer .card:hover, #drawer .card:focus-visible, #drawer .card.on { transform: translateY(-16px); outline: none; }
#drawer .card:hover .tab, #drawer .card.on .tab { fill: var(--accent); }
#drawer .card:hover text, #drawer .card.on text { fill: var(--on-accent); }
#drawer .div:hover .tab, #drawer .div.on .tab { fill: var(--accent); }
#drawer .face { fill: transparent; stroke: var(--ink); stroke-width: 1.4; stroke-linejoin: round; }
#drawer .d-front { cursor: pointer; }
/* closed: the front sits in the middle, files tucked behind it. open: it slides down and they rise */
#drawer .d-all, #drawer .d-files { transition: transform .85s cubic-bezier(.2, .75, .2, 1); }
.drawer-wrap:not(.open) #drawer .d-all { transform: translateY(-580px); }
.drawer-wrap:not(.open) #drawer .d-files { transform: translateY(1040px); }  /* first few tabs just peek over the edge */
.drawer-wrap.open #drawer .d-files { transition-delay: .12s; }
#drawer .face-closed, #drawer .face-open, #drawer .stamp, #drawer .handle {
  transition: transform .85s cubic-bezier(.2, .75, .2, 1), opacity .5s; transform-box: fill-box; }
#drawer .face-closed { transform-origin: 50% 0; }
#drawer .stamp { transform-origin: 50% 50%; }
#drawer .box { fill: transparent; stroke: var(--ink); stroke-width: 1.4; vector-effect: non-scaling-stroke; }
#drawer .stamp .line { vector-effect: non-scaling-stroke; }
#drawer .st { font-family: var(--mono); font-size: 17px; letter-spacing: .06em; }
#drawer .st.big { font-size: 25px; }
#drawer .st, #drawer .inner { transition: opacity .3s .25s; }
#drawer .label { fill: var(--accent); stroke: var(--ink); stroke-width: 1.4; }
#drawer .label-text { font-size: 18px; fill: var(--on-accent); }
#drawer .tag { opacity: 0; transition: opacity .25s; }
/* closed */
.drawer-wrap:not(.open) #drawer .face-open, .drawer-wrap:not(.open) #drawer .lip { opacity: 0; }
/* open: the face flattens; the big ruled box empties and shrinks down to the size of the
   small name tag, then hands over to it (the yellow tag fades in as the box fades out) */
.drawer-wrap.open #drawer .face-closed { transform: scaleY(.37); opacity: 0; }
.drawer-wrap.open #drawer .st, .drawer-wrap.open #drawer .inner { opacity: 0; transition: opacity .2s; }
.drawer-wrap.open #drawer .stamp { transform: translateY(-90px) scale(.446, .204); opacity: 0;
  transition: transform .7s cubic-bezier(.3, .7, .2, 1), opacity .25s .6s; }
.drawer-wrap.open #drawer .tag { opacity: 1; transition: opacity .35s .55s; }
.drawer-wrap.open #drawer .handle { opacity: 0; }
/* closed: the files are hidden and only the two resting tabs show; open: they swap */
#drawer .d-files { transition: transform .85s cubic-bezier(.2, .75, .2, 1), opacity .4s; }
.drawer-wrap:not(.open) #drawer .d-files { opacity: 0; }
#drawer .peek { transition: opacity .3s; }
#drawer .peek .tab.dark { fill: var(--ink); }
#drawer .peek text.light { fill: #F4F3EF; }
.drawer-wrap.open #drawer .peek { opacity: 0; pointer-events: none; }

/* table of contents (third reference) */
.toc { display: flex; flex-direction: column; justify-content: center; min-width: 0; padding-bottom: 40px; }
.toc-head { display: grid; grid-template-columns: 44px 1fr; color: var(--ink); padding-bottom: 14px; font-size: 10px; }
.toc-group { display: grid; grid-template-columns: 22px 74px minmax(0, 1fr); column-gap: 6px; border-top: 1px solid rgba(17, 17, 17, .45); padding-bottom: 4px; }
.toc-group .n, .toc-group .cat { padding-top: 4px; font-weight: 700; font-size: 10.5px; line-height: 1.2; }
.toc-group ul { list-style: none; margin: 0; padding: 0; display: none; }
.toc-group.open ul { display: block; }
.toc-group { cursor: default; padding-bottom: 6px; }
.toc-group .cat { display: flex; justify-content: space-between; gap: 8px; grid-column: 2 / -1; }
.toc-group .cnt { font-family: var(--mono); font-weight: 400; font-size: 9.5px; color: var(--mute); }
.toc-group.open .cat { background: var(--accent); color: var(--on-accent); padding-inline: 4px; }
.toc-group.open ul { grid-column: 2 / -1; }
.toc-group li a span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; }
.toc-group li a { display: grid; grid-template-columns: 44px 1fr 24px; gap: 4px; white-space: nowrap; padding: 3px 0; border-bottom: 1px solid rgba(17, 17, 17, .18); font-family: var(--mono); font-size: 9.5px; line-height: 1.3; }
.toc-group li:last-child a { border-bottom: 0; }
.toc-group li a .pg { text-align: right; }
.toc-group li a:hover, .toc-group li a.on { background: var(--accent); color: var(--on-accent); }
.toc-foot { display: flex; flex-direction: column; gap: 4px; padding-top: 10px; border-top: 1px solid rgba(17, 17, 17, .45); font-size: 9.5px; }
.toc-foot a:hover { text-decoration: underline; }

/* ================= about (old home screen) ================= */
.about { position: relative; z-index: 1; height: 100vh; height: 100svh; min-height: 640px; overflow: hidden;
  background: rgba(236, 235, 231, .1); }
.about-name { position: absolute; inset: 0; pointer-events: none; }
.about-name img { position: absolute; max-width: none; height: auto; width: 74vw; left: 13vw; top: 46%; transform: translateY(-50%) rotate(8deg); }
.about-name .typed { position: absolute; right: calc(4% + clamp(150px, 14vw, 250px)); top: calc(46% - 1vw); font-size: 17px; letter-spacing: .18em; white-space: nowrap; }
.about-portrait { position: absolute; right: 4%; top: 58%; width: clamp(150px, 14vw, 250px); margin: 0; display: flex; flex-direction: column; gap: 6px; }
.about-portrait img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; }
.about-text { position: absolute; left: var(--pad); top: 18%; width: min(300px, 26vw); display: flex; flex-direction: column; gap: 10px; z-index: 2; }
.about-text p { margin: 0; font-size: 14px; line-height: 1.45; }
.about-text a:hover { text-decoration: underline; }
.about-foot { position: absolute; left: var(--pad); right: var(--pad); bottom: 16px; display: flex; justify-content: space-between; gap: 24px; }
.about-foot a:hover { text-decoration: underline; }
#hero-list { display: flex; flex-direction: column; line-height: 1.6; }
#hero-list .mute { margin-top: 8px; }
#hero-list a:hover { text-decoration: underline; }

@media (max-width: 900px) {
  .about-text { width: auto; right: var(--pad); top: 70px; }
  .about-name img { width: 110vw; left: -5vw; top: 48%; }
  .about-name .typed { right: auto; left: 50%; top: 66%; transform: translateX(-50%); font-size: 13px; }
  .about-portrait { right: 50%; transform: translateX(50%); top: auto; bottom: 56px; width: 32vw; }
  .home { grid-template-columns: 1fr; padding-top: 60px; }
  .hide-s { display: none; }
  .toc { padding-top: 24px; }
}

/* ================= file sheet (second reference) ================= */
.sheet-page { background: #E6E5E1; }
.sheet { position: relative; min-height: 100vh; padding: 30px var(--pad) 40px; overflow: hidden; }
.row5 { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); column-gap: 18px; }
.row5 > :nth-child(4), .row5 > :nth-child(5) { text-align: right; justify-self: end; }
.marks { font-size: 13px; padding: 4px 0; }
.sheet-head { font-size: 13px; padding: 14px 0 18px; }
.sheet-head a:hover { text-decoration: underline; }

.ghost {
  position: absolute; z-index: 0; left: var(--pad); right: var(--pad); top: 120px;
  font-size: clamp(26px, 2.9vw, 44px); line-height: 1.12; letter-spacing: -.01em;
  color: rgba(17, 17, 17, .12); pointer-events: none; text-transform: none;
  display: grid; grid-template-columns: 1fr 1fr; column-gap: 3vw;
}
.ghost p { margin: 0 0 1em; }
.ghost p + p { margin-top: 10vh; }

.band { position: relative; z-index: 1; padding-bottom: 26px; }
.band .cells { align-items: start; padding-top: 10px; }
.cell { margin: 0; width: 100%; }
.row5 > .cell:nth-child(4), .row5 > .cell:nth-child(5) { justify-self: stretch; }
/* pictures show whole, at their own shape — nothing is cropped */
.cell img { width: 100%; height: auto; cursor: zoom-in; background: #D9D8D3; }
.cell.wide { grid-column: span 2; }
.cell.vid { grid-column: 2 / span 3; }
.cell video { width: 100%; background: #111; }
.cell figcaption { font-size: 11px; line-height: 1.3; padding-top: 6px; text-align: left; }

.band.piece h2 { margin: 6px 0 0; font-weight: 400; font-size: clamp(20px, 1.8vw, 28px); text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }
.sheet-foot { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: end; padding-top: 30px; }
.sheet-foot h1 { margin: 0 0 0 9%; font-weight: 400; font-size: clamp(22px, 2vw, 30px); text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }
.sheet-foot p { margin: 12px 0 0; font-size: clamp(15px, 1.35vw, 19px); line-height: 1.35; max-width: 70ch; text-indent: 13%; }
.sheet-foot .pager { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; font-size: 13px; }
.sheet-foot .pager a:hover { text-decoration: underline; }

.lightbox { position: fixed; inset: 0; z-index: 80; background: rgba(230, 229, 225, .97); display: none; align-items: center; justify-content: center; padding: 40px; cursor: zoom-out; }
.lightbox.open { display: flex; }
.lightbox img { max-height: 100%; object-fit: contain; }

@media (max-width: 760px) {
  .row5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .marks { display: none; }
  .sheet-head > :nth-child(n+3) { display: none; }
  .cell.vid, .cell.wide { grid-column: 1 / -1; }
  .ghost { grid-template-columns: 1fr; }
  .sheet-foot { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .grain, .bg .noise { animation: none; } }

/* work text: short line, details, context and process */
.work-text { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0,1.1fr) minmax(0,1fr) minmax(0,1fr); gap: 40px; padding: 30px 0 10px; border-top: 1px solid currentColor; margin-top: 40px; }
.work-text h1 { margin: 0 0 14px; font-weight: 400; font-size: clamp(22px, 2vw, 30px); text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }
.work-text .wt-lead p { margin: 0; font-size: clamp(16px, 1.4vw, 20px); line-height: 1.35; }
.wt-details { list-style: none; margin: 18px 0 0; padding: 0; font-size: 12px; line-height: 1.6; }
.wt-details li::before { content: '— '; }
.work-text h3 { margin: 4px 0 12px; font-weight: 400; font-size: 13px; }
.wt-col p { margin: 0 0 1em; font-size: 14px; line-height: 1.55; max-width: 60ch; }
.band.piece .part-text { margin: 10px 0 0; max-width: 62ch; font-size: 14px; line-height: 1.55; }
@media (max-width: 900px) { .work-text { grid-template-columns: 1fr; gap: 22px; } }

/* layouts picked in the checklist */
.row5.cells .cell.lay { grid-column: var(--c) / span var(--s); justify-self: stretch; }
.band .cells { row-gap: 18px; }
@media (max-width: 900px) { .row5.cells .cell.lay { grid-column: auto / span 1; } .row5.cells .cell.lay.big { grid-column: 1 / -1; } }

/* free layouts from the checklist */
.free { position: relative; z-index: 1; height: 0; margin-top: 10px; }
.free > .cell.fr { position: absolute; margin: 0; }
@media (max-width: 900px) {
  .free { height: auto; padding-bottom: 0 !important; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; }
  .free > .cell.fr { position: static; width: auto !important; }
  .free > .cell.fr.big { grid-column: 1 / -1; }
}

/* touch screens: the picked file */
.pick { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: stretch; margin: 14px auto 0; max-width: 700px; border: 1px solid var(--ink); font-size: 12px; }
.pick[hidden] { display: none; }
.pick button { font: inherit; background: none; border: 0; color: inherit; font-size: 16px; cursor: pointer; min-height: 48px; }
.pick button:first-child { border-right: 1px solid var(--ink); } .pick button:last-child { border-left: 1px solid var(--ink); }
.pick-open { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 0 12px; background: var(--accent); color: var(--on-accent); }
.pick-open .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-open .go { font-weight: 700; }
@media (hover: none) { .toc-group .cat, .toc-group .n { cursor: pointer; padding-block: 8px; } .toc-group li a { padding: 8px 0; font-size: 11px; } }
