/* andrewphan.com, the pages behind the home page (2026-11-24): stories, a story, films, commissions, about, say hello.
   Layout idea: a gallery wall. Every photograph is a matted print, and the facts about it sit beside it as a small
   wall label. Type stays at reading size. Nothing here adds a colour or a face to the shared system in site.css. */

/* Header: the page you are on keeps its hairline */
.bar nav a[aria-current="page"] { background-size: 100% 1px; }

/* ---------- Page head ---------- */
.ph { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); column-gap: clamp(28px, 6vw, 96px); row-gap: 28px; align-items: end; padding-block: clamp(48px, 8vw, 128px) 0; }
.ph-main { display: grid; gap: 18px; max-width: 50rem; }
.ph h1 { margin: 0; font: 400 clamp(40px, 5.2vw, 76px)/1.04 var(--display); letter-spacing: .005em; text-wrap: balance; }
.ph .dek { font-size: clamp(20px, 1.5vw, 23px); line-height: 1.5; max-width: 34rem; }
.ph-side { margin: 0; justify-self: end; max-width: 22rem; font-style: italic; color: var(--muted); }
html.motion .ph-main[data-reveal] { transform: none; }
@media (max-width: 860px) {
  .ph { grid-template-columns: minmax(0, 1fr); }
  .ph-side { justify-self: start; }
}
.end { padding-bottom: clamp(96px, 12vw, 176px); }
.note { margin: 18px 0 0; max-width: 34rem; color: var(--ink-2); }

/* ---------- Prints: a photograph in its window, on a mat ---------- */
.print { display: block; margin: 0; min-width: 0; text-decoration: none; }
.mat { display: block; background: var(--mat); padding: var(--pad); box-shadow: 0 0 0 1px var(--hair), 0 40px 80px -50px rgba(var(--shadow), .55); }
.win { display: block; overflow: hidden; background: color-mix(in srgb, var(--mat) 86%, var(--ink)); }
.win img { width: 100%; height: 100%; object-fit: cover; }
.r45 { aspect-ratio: 4 / 5; }
.r169 { aspect-ratio: 16 / 9; }
.sp-cap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; margin: 12px 0 0; font: 500 11px/1.5 var(--ui); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.print .sp-cap a { color: inherit; }
/* A print develops: the mat arrives first, the photograph comes up after it */
html.motion .print[data-reveal], html.motion .tile[data-reveal] { transform: none; }
html.motion [data-reveal] .win img { opacity: 0; transition: opacity 1.6s var(--sine) .3s, transform 1.4s var(--ease); }
html.motion [data-reveal].in .win img { opacity: 1; }
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  a .win img { transition: transform 1.4s var(--ease); }
  a:hover .win img, a:focus-visible .win img { transform: scale(1.025); }
}

/* ---------- Wall label: the facts beside a print ---------- */
.label { display: grid; margin: 0; border-top: 1px solid var(--hair); }
.label > div { display: grid; grid-template-columns: 6.5em minmax(0, 1fr); gap: 4px 14px; padding: 12px 0; border-bottom: 1px solid var(--hair); }
.label dt { font: 500 11px/1.9 var(--ui); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.label dd { margin: 0; font-size: 17px; line-height: 1.5; }
.label small { display: block; margin-top: 3px; font-size: 15px; line-height: 1.45; color: var(--muted); }
.label a { text-decoration-thickness: 1px; text-underline-offset: 3px; }
@media (max-width: 420px) { .label > div { grid-template-columns: minmax(0, 1fr); gap: 0; } }

/* ---------- Every story: a wall of prints, hung by year ---------- */
.wall { display: grid; gap: clamp(72px, 10vw, 160px); margin-top: clamp(56px, 8vw, 120px); }
.yr { display: grid; grid-template-columns: minmax(0, 10rem) minmax(0, 1fr); column-gap: clamp(24px, 5vw, 88px); align-items: start; }
.yr-label { position: sticky; top: 28px; display: grid; gap: 10px; margin: 0; }
.yr-label h2 { margin: 0; font: 400 clamp(40px, 4.4vw, 64px)/1 var(--display); letter-spacing: .03em; }
.yr-prints { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(28px, 3.4vw, 52px) clamp(16px, 2.2vw, 36px); align-items: start; }
.tile { display: grid; gap: 14px; align-content: start; min-width: 0; text-decoration: none; }
.tile:first-child { grid-column: span 2; grid-row: span 2; }
.yr-prints[data-n="3"] .tile:nth-child(2) { grid-column: 3; grid-row: 1; }
.yr-prints[data-n="3"] .tile:nth-child(3) { grid-column: 4; grid-row: 2; }
.tile .mat { padding: clamp(7px, .9vw, 12px); box-shadow: 0 0 0 1px var(--hair), 0 30px 60px -40px rgba(var(--shadow), .5); }
.tile:first-child .mat { padding: var(--pad); }
.tile-words { display: grid; gap: 6px; }
.tile-t { font: 400 clamp(19px, 1.5vw, 22px)/1.25 var(--serif); text-wrap: balance; }
.tile:first-child .tile-t { font-size: clamp(25px, 2.3vw, 34px); line-height: 1.15; }
.tile-dek { display: none; margin: 2px 0 0; max-width: 30rem; font-size: 18px; font-style: italic; line-height: 1.45; color: var(--ink-2); }
.tile:first-child .tile-dek { display: block; }
html.motion .tile[data-reveal] { transition-delay: calc(var(--i, 0) * 90ms); }
@media (hover: hover) and (pointer: fine) {
  .tile-t { background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; justify-self: start; padding-bottom: 2px; transition: background-size .55s var(--ease); }
  .tile:hover .tile-t, .tile:focus-visible .tile-t { background-size: 100% 1px; }
}
@media (max-width: 860px) {
  .yr { grid-template-columns: minmax(0, 1fr); row-gap: 22px; }
  .yr-label { position: static; display: flex; align-items: baseline; gap: 14px; }
  .yr-prints { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .yr-prints[data-n="3"] .tile:not(:first-child) { grid-column: auto; grid-row: auto; }
}

/* ---------- One story ---------- */
.st-open { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); column-gap: clamp(28px, 6vw, 96px); align-items: end; padding-block: clamp(20px, 3vw, 48px) 0; }
.st-print { width: min(100%, 620px, calc((100svh - 190px) * .8)); min-width: min(100%, 300px); }
.st-words { display: grid; gap: 18px; min-width: 0; padding-bottom: clamp(0px, 2vw, 32px); }
.st-words h1 { margin: 0; font: 400 clamp(38px, 4.6vw, 68px)/1.04 var(--display); letter-spacing: .005em; text-wrap: balance; }
.st-dek { margin: 0; max-width: 30rem; font: italic 400 clamp(20px, 1.6vw, 23px)/1.45 var(--serif); color: var(--ink-2); }
html.motion .st-words[data-reveal] { transform: none; }
@media (max-width: 860px) {
  .st-open { grid-template-columns: minmax(0, 1fr); row-gap: 28px; }
  .st-print { width: min(100%, 460px); }
}

/* The words: the label and the side heads keep to the margin and stay beside their text as it scrolls */
.st-body { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); column-gap: clamp(28px, 6vw, 96px); margin-top: clamp(64px, 9vw, 136px); }
.st-side { grid-column: 1; min-width: 0; }
.st-text { grid-column: 2; min-width: 0; }
.st-rule { grid-column: 1 / -1; height: 1px; margin: clamp(36px, 5vw, 64px) 0 clamp(28px, 3.4vw, 44px); border: 0; background: var(--hair); }
.st-side .label, .st-side h2, .st-side .cap { position: sticky; top: 28px; }
.st-side .label { max-width: 26rem; }
.st-side h2 { margin: 0; max-width: 22rem; font: 400 clamp(22px, 1.9vw, 27px)/1.2 var(--serif); letter-spacing: 0; text-wrap: balance; }
.st-side h2.cap { font: 500 11px/1.4 var(--ui); letter-spacing: .2em; }
.st-text p { margin: 0 0 1.05em; }
.st-text > :last-child { margin-bottom: 0; }
.st-text.first p { font-size: clamp(20px, 1.45vw, 22px); line-height: 1.62; }
.st-text a { text-decoration-thickness: 1px; text-underline-offset: 3px; }
.st-sources { font: 400 14px/1.55 var(--ui); color: var(--ink-2); }
.st-sources ul { display: grid; gap: 8px; margin: 0; padding-left: 1.1em; }
.st-sources a { overflow-wrap: anywhere; }
@media (max-width: 860px) {
  .st-body { grid-template-columns: minmax(0, 1fr); }
  .st-side, .st-text { grid-column: 1; }
  .st-side { margin-bottom: 14px; }
  .st-side .label { margin-bottom: 14px; }
  .st-side .label, .st-side h2, .st-side .cap { position: static; }
}

/* Newer and older, each with its print */
.pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(24px, 4vw, 64px); margin-top: clamp(72px, 10vw, 152px); border-top: 1px solid var(--hair); }
.pager a { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 20px; align-items: center; padding: 28px 0; text-decoration: none; }
.pager .older { grid-column: 2; grid-template-columns: minmax(0, 1fr) 72px; text-align: right; }
.pager .older .pg-thumb { order: 2; }
.pg-thumb { display: block; background: var(--mat); padding: 5px; box-shadow: 0 0 0 1px var(--hair); }
.pg-thumb img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.pg-words { display: grid; gap: 6px; min-width: 0; }
.pg-t { font: 400 clamp(20px, 1.8vw, 26px)/1.2 var(--serif); transition: transform .6s var(--ease); }
.pager-all { margin: 28px 0 0; }
@media (hover: hover) and (pointer: fine) {
  .pager a:hover .pg-t, .pager a:focus-visible .pg-t { transform: translateX(8px); }
  .pager .older:hover .pg-t, .pager .older:focus-visible .pg-t { transform: translateX(-8px); }
}
@media (max-width: 620px) {
  .pager { grid-template-columns: minmax(0, 1fr); }
  .pager .older { grid-column: 1; border-top: 1px solid var(--hair); }
}

/* ---------- Films ---------- */
.feature { margin-top: clamp(40px, 6vw, 72px); }
.feature .sp-cap { margin-top: 14px; }
.frames { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 2.4vw, 40px); align-items: start; margin-top: clamp(28px, 4vw, 56px); }
.frames .mat { padding: clamp(7px, .9vw, 12px); box-shadow: 0 0 0 1px var(--hair), 0 30px 60px -40px rgba(var(--shadow), .5); }
html.motion .frames .print[data-reveal]:nth-child(2) { transition-delay: .12s; }
html.motion .frames .print[data-reveal]:nth-child(3) { transition-delay: .24s; }
@media (max-width: 760px) { .frames { grid-template-columns: minmax(0, 1fr); } }

/* Rows: a title, what it was, the year */
.rows { list-style: none; margin: 28px 0 0; padding: 0; border-top: 1px solid var(--hair); }
.rows li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 24rem) 4rem; align-items: baseline; gap: 6px 24px; padding: 20px 0; border-bottom: 1px solid var(--hair); }
.rows-t { font: 400 clamp(24px, 2.4vw, 34px)/1.2 var(--serif); }
.rows-what { font-size: 17px; line-height: 1.45; color: var(--ink-2); }
.rows-when { text-align: right; font: 500 11px/1.4 var(--ui); letter-spacing: .2em; color: var(--muted); font-variant-numeric: tabular-nums; }
@media (max-width: 760px) {
  .rows li { grid-template-columns: minmax(0, 1fr) auto; }
  .rows-what { grid-column: 1 / -1; grid-row: 2; }
}

/* ---------- Commissions: a story and a film, side by side ---------- */
.pair { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(24px, 5vw, 80px); align-items: end; margin-top: clamp(40px, 6vw, 72px); }
html.motion .pair .print[data-reveal]:nth-child(2) { transition-delay: .15s; }
@media (max-width: 760px) { .pair { grid-template-columns: minmax(0, 1fr); } .pair .print:first-child { width: min(100%, 420px); } }

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: minmax(0, 36rem) minmax(0, 24rem); justify-content: space-between; column-gap: clamp(40px, 7vw, 120px); row-gap: 48px; align-items: start; margin-top: clamp(40px, 6vw, 88px); }
.about-text p { margin: 0 0 1.05em; }
.about-text p:first-child { margin-bottom: 1.2em; font-size: clamp(22px, 1.9vw, 27px); line-height: 1.42; text-wrap: pretty; }
.about-text > :last-child { margin-bottom: 0; }
.about-text a { text-decoration-thickness: 1px; text-underline-offset: 3px; }
.about-side { position: sticky; top: 28px; display: grid; gap: 28px; min-width: 0; }
html.motion .about-text[data-reveal] { transform: none; }
@media (max-width: 860px) {
  .about { grid-template-columns: minmax(0, 1fr); }
  .about-side { position: static; }
  .about-side .print { width: min(100%, 420px); }
}

/* ---------- Say hello ---------- */
.hello { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(40px, 7vw, 120px); align-items: start; margin-top: clamp(40px, 6vw, 88px); }
.asks { list-style: none; margin: 14px 0 0; padding: 0; border-top: 1px solid var(--hair); }
.asks li { border-bottom: 1px solid var(--hair); }
.asks a { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 16px; padding: 20px 0; text-decoration: none; }
.asks-t { font: 400 clamp(22px, 2vw, 28px)/1.2 var(--serif); transition: transform .6s var(--ease); }
.asks-go { font: 500 14px/1 var(--ui); color: var(--muted); transition: transform .5s var(--ease), color .3s; }
@media (hover: hover) and (pointer: fine) {
  .asks a:hover .asks-t, .asks a:focus-visible .asks-t { transform: translateX(12px); }
  .asks a:hover .asks-go, .asks a:focus-visible .asks-go { transform: translateX(5px); color: var(--ink); }
}
.asks a:active .asks-t { transform: translateX(12px) scale(.99); }
@media (max-width: 860px) { .hello { grid-template-columns: minmax(0, 1fr); } }

/* Footer links */
.foot .row a { color: inherit; }

@media (prefers-reduced-motion: reduce) {
  .pg-t, .asks-t, .asks-go, .tile-t { transition: none; }
}
