/* Clark Renders — Work (work.html). Built on showcase.css: the same colours, type, logo, menu,
   rolling text (.reel) and quick fades (.slide) as the homepage. */

html, body.work { height: 100%; overflow: hidden; }
.work { display: flex; flex-direction: column; height: 100svh; }
.soft { color: var(--soft); }
:root { --wlogo: clamp(26px, 2.1vw, 38px); }

/* inner pages: the logo small and centred at the top (the homepage keeps its large one, and the logo
   glides between the two when you change page — see the end of showcase.css) */
.w-head { position: relative; z-index: 30; display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; padding: var(--pad) var(--pad) 0; }
.w-head .mark { grid-column: 2; --logo: var(--wlogo); font-size: var(--logo); margin-top: 1px; }
.w-controls { grid-column: 3; justify-self: end; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; padding-top: 4px; }

/* the page title (on Work, the types) at the top left, in the logo's old place; the chosen type in italic */
.w-bar { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: clamp(16px, 3.4vh, 38px) var(--pad) clamp(12px, 2.2vh, 26px); }
@media (max-width: 900px) {
  .w-head .mark { --logo: 26px; }
  .w-bar { padding-top: 14px; }
}
.w-page { white-space: nowrap; }
.w-types { font-size: var(--fs-state); line-height: 1.05; }
/* the chosen category simply comes up to full strength; nothing changes shape, so nothing moves */
.w-types button { padding: 0; letter-spacing: -0.005em; transition: color 400ms ease; }
.w-types button[aria-pressed="false"] { color: var(--soft); }
@media (hover: hover) and (pointer: fine) { .w-types button[aria-pressed="false"]:hover { color: color-mix(in srgb, var(--ink) 70%, var(--soft)); } }
.w-types sup { font-size: 0.42em; vertical-align: 1.1em; margin: 0 0.3em 0 0.2em; letter-spacing: 0.04em; color: var(--soft); }
.w-types .sep { color: var(--soft); }

/* the stage: details on the left, the images on the right */
.w-stage {
  position: relative; flex: 1; min-height: 0;
  display: grid; grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr); column-gap: 4vw;
  margin: 0 var(--pad) var(--pad);
  user-select: none; -webkit-user-select: none; touch-action: none;
}
.w-stage > * { transition: opacity 260ms ease; }
.w-stage.fading > * { opacity: 0; transition-duration: 160ms; }

/* the details */
.w-info { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; min-width: 0; }
.w-count.reel { font-size: var(--fs-small); --lh: 1.1em; margin-bottom: 1em; width: 6em; }
.w-name.reel { font-size: var(--fs-big); letter-spacing: -0.025em; width: 100%; }
.w-by.reel { font-size: var(--fs-state); --lh: 1em; color: var(--soft); margin-top: 0.3em; width: 100%; }
.w-meta { margin-top: 1.2em; }
.w-meta .tg { color: var(--soft); margin-left: 1.4em; }
.w-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 1.3em; min-height: clamp(44px, 6.4vh, 72px); transition: opacity 300ms ease; }
.w-thumbs.out { opacity: 0; transition-duration: 120ms; }
.w-thumb { position: relative; height: clamp(44px, 6.4vh, 72px); padding: 0; opacity: 0.45; transition: opacity 250ms ease; }
.w-thumb.on { opacity: 1; }
.w-thumb img { display: block; height: 100%; width: auto; }
.w-thumb .film { position: absolute; right: 4px; bottom: 3px; color: #fff; font-size: 9px; letter-spacing: 0.02em; text-shadow: 0 0 4px rgba(0, 0, 0, 0.6); }
@media (hover: hover) and (pointer: fine) { .w-thumb:hover { opacity: 1; } }
.w-more { align-self: center; padding: 0 4px; }
.w-go { margin-top: 1.3em; border-bottom: 2px solid currentColor; padding-bottom: 1px; }

/* the images */
.w-col { position: relative; overflow: hidden; min-height: 0; }
.hero {
  position: absolute; left: 0; top: 0; display: block; -webkit-user-drag: none;
  transition: transform 650ms var(--ease-move), opacity 500ms ease;
  will-change: transform;
}
.hero.no-anim { transition: none; }
.hero img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; pointer-events: none; transition: opacity 380ms ease, transform 900ms var(--ease-out); }
.hero img.in { opacity: 0; }
.hero:not(.on) { opacity: 0.26; cursor: pointer; }
@media (hover: hover) and (pointer: fine) {
  .hero:not(.on):hover { opacity: 0.5; }
  .hero.on:hover img { transform: scale(1.015); }
}

/* ---------- "Everything": pages of images, each with one project picked out ---------- */
.w-board { display: none; position: absolute; inset: 0; overflow: hidden; }
html[data-mode="board"] .w-board { display: block; }
html[data-mode="board"] .w-info, html[data-mode="board"] .w-col { visibility: hidden; }
.b-view { position: absolute; left: 0; right: 0; top: 0; overflow: hidden; }
.b-track { position: absolute; left: 0; right: 0; top: 0; transition: transform 850ms var(--ease-move); }
.b-page { position: absolute; left: 0; right: 0; overflow: hidden; }
.b-pic { position: absolute; display: block; -webkit-user-drag: none; }
.b-pic img { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; transition: transform 900ms var(--ease-out), opacity 350ms ease; }
.b-pic .cap {
  position: absolute; left: 0; top: 100%; padding-top: 7px; white-space: nowrap;
  font-size: var(--fs-small); line-height: 1.1; opacity: 0; transform: translateY(-3px);
  transition: opacity 250ms ease, transform 350ms var(--ease-out);
}
.b-pic .cap .by { color: var(--soft); margin-left: 0.6em; }
@media (hover: hover) and (pointer: fine) {
  .b-pic:hover img { transform: scale(1.03); }
  .b-pic:hover .cap { opacity: 1; transform: none; }
  .b-page.has-hover .b-pic:not(.same) img { opacity: 0.45; }
}
/* the project picked out on each page */
.b-feat { position: absolute; display: flex; gap: 26px; align-items: flex-end; }
.b-text .lab { letter-spacing: 0.02em; }

/* the strip along the bottom: a line, the page, and what comes next */
.b-foot {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: space-between; align-items: flex-end;
  border-top: 1px solid var(--line); padding-bottom: 2px;
}
.b-next { display: inline-flex; align-items: center; gap: 0.7em; }
.b-next .arr { position: relative; width: 9px; height: 14px; }
.b-next .arr::before { content: ""; position: absolute; left: 4px; top: 0; bottom: 1px; width: 1.5px; background: currentColor; }
.b-next .arr::after { content: ""; position: absolute; left: 1px; bottom: 1px; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); transform-origin: 70% 70%; }
.b-foot.last .arr { transform: rotate(180deg); }
.b-next .arr { transition: transform 400ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .b-next:hover .arr { transform: translateY(3px); } .b-foot.last .b-next:hover .arr { transform: rotate(180deg) translateY(3px); } }
html[data-mode="board"] .w-page { display: none; }
/* names on hover — inside the picture: larger name, the architect beneath, over a soft fade */
html[data-cap="in"] .b-pic:not(.cap-on) .cap {
  top: auto; bottom: 0; right: 0; padding: 48px 14px 12px;
  display: flex; flex-direction: column; gap: 3px; white-space: normal;
  color: #fff; font-size: clamp(14px, 1.15vw, 18px); line-height: 1.05; letter-spacing: -0.005em;
  background: linear-gradient(to top, rgba(12, 11, 9, 0.55), rgba(12, 11, 9, 0));
  transform: translateY(6px);
}
html[data-cap="in"] .b-pic:not(.cap-on) .cap .by { margin-left: 0; color: rgba(255, 255, 255, 0.78); font-size: 0.72em; }
.b-pic { overflow: visible; }
html[data-cap="in"] .b-pic { overflow: hidden; }
/* names on hover — below the picture, a size up from before */
html[data-cap="below"] .b-pic:not(.cap-on) .cap { font-size: clamp(12px, 1.02vw, 15px); padding-top: 8px; }
.b-pic.cap-on .cap { opacity: 1; transform: none; right: 0; overflow: hidden; text-overflow: ellipsis; }
.b-pic.cap-on .cap .by { display: none; }
.b-label { position: absolute; left: 0; margin: 0; letter-spacing: 0.02em; }
.b-feat.col { flex-direction: column; align-items: flex-start; gap: 22px; }
.b-cell { position: absolute; justify-content: flex-end; }
.b-cell.to-right { align-items: flex-end; text-align: right; }
.b-rule { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); }
.b-draft { display: inline-flex; gap: 1em; align-items: baseline; }
.b-draft button { color: var(--soft); }
.b-draft button[aria-pressed="true"] { color: var(--ink); }
.b-feat.flip { flex-direction: row-reverse; }
.b-feat .b-pic { position: relative; flex: none; }
.b-feat .b-pic .cap { display: none; }
.b-text { display: flex; flex-direction: column; align-items: flex-start; padding-bottom: 2px; }
.b-feat.flip .b-text { align-items: flex-end; text-align: right; }
.b-text .lab { margin-bottom: 0.9em; }
.b-text .nm { font-size: var(--fs-big); line-height: 0.9; letter-spacing: -0.025em; }
.b-text .cr { margin-top: 0.9em; font-size: 0.72em; letter-spacing: 0.02em; }
.b-text .by { font-size: var(--fs-state); line-height: 1; color: var(--soft); margin-top: 0.2em; }
.b-text .cr + .by { color: var(--ink); margin-top: 0.15em; }
.b-foot.one { border-top-color: transparent; }
.b-foot.one .arr { display: none; }
.b-text .ds { margin-top: 1.1em; max-width: 26em; color: var(--soft); }
.b-text .sc { margin-top: 0.9em; }
.b-text .go { margin-top: 1.2em; border-bottom: 2px solid currentColor; padding-bottom: 1px; }
.b-feat.top { align-items: flex-start; }
.b-feat.top .b-text { padding-top: 2px; }

/* phones: one project at a time, its neighbours peeking in at the sides; details underneath */
@media (max-width: 900px) {
  .w-bar { padding-left: var(--pad); }
  .w-types { font-size: 19px; }
  .w-stage { display: flex; flex-direction: column; }
  .w-col { order: 1; flex: none; height: 52%; overflow: visible; margin: 0 calc(var(--pad) * -1); }
  .w-info { order: 2; justify-content: flex-start; padding-top: 16px; }
  .w-name.reel { font-size: 30px; }
  .w-by.reel { font-size: 17px; }
  .w-count.reel { margin-bottom: 0.7em; }
  .w-meta { margin-top: 0.8em; }
  .w-meta .tg { margin-left: 1em; }
  .w-thumbs { margin-top: 0.9em; flex-wrap: nowrap; overflow: hidden; }
  .w-go { margin-top: 0.9em; }
  .w-bar { flex-wrap: wrap; }
  /* phones: the board's names always show, small, inside each tile */
  html[data-cap] .b-pic:not(.b-big) .cap {
    opacity: 1; transform: none; top: auto; bottom: 0; right: 0; padding: 26px 8px 7px;
    color: #fff; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    background: linear-gradient(to top, rgba(12, 11, 9, 0.5), rgba(12, 11, 9, 0));
  }
  html[data-cap] .b-pic .cap .by { display: none; }
  .b-pic { overflow: hidden; }
  .b-big .cap { display: none; }
  .b-text.ph { padding: 2px 0; }
  .b-text.ph .lab { margin-bottom: 0.5em; font-size: 10px; }
  .b-text.ph .nm { font-size: 21px; }
  .b-text.ph .by { font-size: 13px; }
  .b-text.ph .ds, .b-text.ph .sc { display: none; }
  .b-text.ph .go { margin-top: 0.7em; }
  .b-feat, .b-feat.flip { flex-direction: column; align-items: flex-start; gap: 10px; }
  .b-feat.flip .b-text { align-items: flex-start; text-align: left; }
  .b-text .lab { margin-bottom: 0.4em; }
  .b-text .nm { font-size: 28px; }
  .b-text .by { font-size: 16px; }
  .b-text .ds { margin-top: 0.6em; }
  .b-text .sc { display: none; }
  .b-text .go { margin-top: 0.7em; }
}
@media (prefers-reduced-motion: reduce) {
  .hero, .hero img, .w-stage > *, .w-thumbs { transition: none; }
}

/* Work: the categories are centred under the centred logo, above the grid (computers only; on other
   pages the title stays top-left, where its page's information starts) */
@media (min-width: 901px) { .w-bar:has(> .w-types) { justify-content: center; } }

/* changing category: the tiles change over one by one (see choose() in work.js) */
.b-pic, .b-text { transition: opacity 520ms ease, transform 700ms var(--ease-out); }
.b-pic.b-out, .b-text.b-out { opacity: 0; transform: translateY(-10px); transition-duration: 240ms, 320ms; transition-timing-function: ease, ease; }
.b-pic.b-in, .b-text.b-in { opacity: 0; transform: translateY(16px); transition: none; }
@media (prefers-reduced-motion: reduce) { .b-pic, .b-text { transition: none; } }
