/* =========================================================================
   Tacke Infotech — portfolio (October 2026). Loaded after home.css, which
   carries the tokens, header, footer and buttons.
   One shelf of six covers, then one identical block per brand: a 1 + 4 photo
   grid that opens a full-screen viewer, the brief, films, and the case study
   folded away until asked for.
   ========================================================================= */

.pf-page .topbar { color: var(--ink); }

/* hero */
.pfh { padding: clamp(120px, 14vw, 170px) 0 clamp(28px, 4vw, 48px); }
.pfh h1 { margin-top: 18px; font-size: clamp(38px, 5vw, 76px); line-height: 1.02; letter-spacing: -.035em; max-width: 18ch; text-wrap: balance; }
.pfh h1 .soft { display: block; color: var(--ink-3); }
/* `ch` is a Latin glyph: 18ch holds only ~9 Chinese characters and split 拥 / 有 */
:lang(zh-Hans) .pfh h1 { max-width: 15em; letter-spacing: 0; }
.pfh__stats { display: flex; flex-wrap: wrap; gap: 14px 44px; margin-top: 34px; padding-top: 22px; border-top: 1px solid var(--line); }
.pfh__stats li { display: grid; gap: 2px; max-width: 26ch; }
.pfh__stats b { font-size: clamp(28px, 2.6vw, 38px); line-height: 1; letter-spacing: -.035em; }
.pfh__stats span { font-size: 13.5px; color: var(--ink-3); }

/* shelf (the cards and pills themselves live in home.css: the homepage shows them too) */
.shelf { padding: 0 0 clamp(40px, 6vw, 72px); }

/* brand block */
.pfb { padding: clamp(56px, 7vw, 96px) 0; border-top: 1px solid var(--line); scroll-margin-top: 60px; }
.pfb:nth-of-type(even) { background: var(--paper-2); }
.pfb:nth-of-type(even) .pill { background: var(--card); }
.pfb__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 18px; margin-bottom: clamp(22px, 3vw, 34px); }
.pfb__no { flex: 1 1 100%; font: 700 13px var(--mono); color: var(--accent-ink); }
.pfb__name { font-size: clamp(34px, 4.2vw, 60px); line-height: 1; letter-spacing: -.04em; }
.pfb__head .pill { align-self: center; }
.pfb__meta { flex: 1 1 100%; font-size: 15.5px; color: var(--ink-3); }
.pfb__grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(28px, 4.5vw, 64px); align-items: start; }
.pfb__lede { font-size: clamp(20px, 1.8vw, 26px); line-height: 1.3; letter-spacing: -.015em; font-weight: 700; text-wrap: balance; }
.pfb__text > p:not(.pfb__lede) { margin-top: 14px; color: var(--ink-2); font-size: 16.5px; line-height: 1.65; }
.pfb__top { display: inline-flex; align-items: center; gap: 6px; margin-top: 22px; font: 600 12px var(--mono); color: var(--ink-3); }
.pfb__top:hover { color: var(--ink); }
.pfb__top svg { width: 13px; height: 13px; }

/* gallery: one big tile and up to four small ones */
.pfg { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: repeat(2, auto); gap: 8px; }
.pfg__item { position: relative; display: block; overflow: hidden; border-radius: 12px; background: var(--paper-2); aspect-ratio: 1; }
.pfg__item img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease), filter .3s; }
.pfg__item:hover img { transform: scale(1.05); }
.pfg__item:first-child { grid-column: 1 / span 2; grid-row: 1 / span 2; aspect-ratio: auto; }
.pfg__item.is-more { display: none; }
.pfg__more {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(20, 16, 14, .55); color: #fff; font-size: clamp(18px, 2vw, 26px); font-weight: 700; letter-spacing: -.02em;
  transition: background .25s;
}
.pfg__item:hover .pfg__more { background: rgba(20, 16, 14, .4); }
.pfg--n4 .pfg__item:nth-child(4) { grid-column: 3 / span 2; aspect-ratio: auto; }
.pfg--n3 .pfg__item:nth-child(2), .pfg--n3 .pfg__item:nth-child(3) { grid-column: 3 / span 2; aspect-ratio: auto; }
.pfg--n2 .pfg__item:nth-child(2) { grid-column: 3 / span 2; grid-row: 1 / span 2; aspect-ratio: auto; }
.pfg--n1 .pfg__item:first-child { grid-column: 1 / -1; aspect-ratio: 16 / 9; }
.pfg__all { margin-top: 12px; font: 600 12.5px var(--mono); color: var(--ink-2); padding: 6px 0; }
.pfg__all:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
html:not(.js) .pfg__all { display: none; }

/* films */
.pff-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.pff {
  display: inline-flex; align-items: center; gap: 12px; padding: 6px 12px 6px 6px; border-radius: 14px;
  background: var(--card); box-shadow: 0 0 0 1px var(--line); font-size: 14px; font-weight: 600; text-align: left;
  transition: box-shadow .2s, transform .2s var(--ease);
}
.pff:hover { box-shadow: 0 0 0 1px var(--ink); transform: translateY(-1px); }
.pff img { width: 96px; height: 54px; border-radius: 9px; object-fit: cover; }
.pff svg { width: 22px; height: 22px; color: var(--accent); flex: none; }

/* case study */
.pfcase { margin-top: 24px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.pfcase summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0;
  font-weight: 700; font-size: 15px; cursor: pointer; list-style: none;
}
.pfcase summary::-webkit-details-marker { display: none; }
.pfcase summary svg { width: 14px; height: 14px; transition: transform .3s var(--ease); }
.pfcase[open] summary svg { transform: rotate(180deg); }
.pfcase__body { padding: 0 0 20px; color: var(--ink-2); font-size: 15.5px; line-height: 1.65; }
.pfcase__body .block-label { margin: 18px 0 6px; font: 700 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.pfcase__body .block-label:first-child { margin-top: 4px; }
.pfcase__body .block-label--accent { color: var(--accent-ink); }
.pfcase__body ul { display: grid; gap: 6px; }
.pfcase__body li { position: relative; padding-left: 18px; }
.pfcase__body li::before { content: ""; position: absolute; left: 2px; top: .7em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.pfcase__body p + p { margin-top: 8px; }

/* closing */
.pfend { padding: clamp(72px, 9vw, 120px) 0; background: var(--space); color: #fff; }
.pfend .eyebrow { color: var(--glow); }
.pfend .h2 { color: #fff; }
.pfend__grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.pfend__text p { color: rgba(255, 255, 255, .75); font-size: 16.5px; line-height: 1.65; }
.pfend__text p + p { margin-top: 14px; }
.pfend__text .pfend__note { font-size: 13px; color: rgba(255, 255, 255, .45); }
.pfend__cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 32px; margin-top: clamp(40px, 6vw, 72px); padding-top: 28px; border-top: 1px solid rgba(255, 255, 255, .12); }
.pfend__cta p { font-size: clamp(18px, 1.6vw, 22px); color: rgba(255, 255, 255, .7); max-width: 52ch; }
.pfend__cta b { color: #fff; }

/* viewer */
.lbx {
  position: fixed; inset: 0; z-index: 300; display: grid; grid-template-rows: 1fr auto;
  background: rgba(8, 10, 14, .96); color: #fff; opacity: 0; transition: opacity .25s;
}
.lbx[hidden] { display: none; }
.lbx.is-on { opacity: 1; }
.lbx__stage { position: relative; min-height: 0; margin: 64px 72px 0; touch-action: pan-y; }
.lbx__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.lbx__video { position: absolute; inset: 0; display: grid; place-items: center; }
.lbx__video iframe { width: min(100%, calc((100vh - 200px) * 16 / 9)); aspect-ratio: 16 / 9; border: 0; border-radius: 12px; background: #000; }
.lbx__video p { font-size: 16px; color: rgba(255, 255, 255, .7); }
.lbx__bar { display: flex; align-items: center; gap: 18px; padding: 16px 24px 22px; min-height: 64px; }
.lbx__cap { flex: 1; font-size: 14px; line-height: 1.45; color: rgba(255, 255, 255, .72); max-width: 90ch; }
.lbx__count { font: 600 12.5px var(--mono); color: rgba(255, 255, 255, .55); white-space: nowrap; }
.lbx__btn {
  position: absolute; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%;
  background: rgba(255, 255, 255, .08); color: #fff; transition: background .2s;
}
.lbx__btn:hover { background: rgba(255, 255, 255, .18); }
.lbx__btn svg { width: 18px; height: 18px; }
.lbx__close { top: 12px; right: 14px; }
.lbx__prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lbx__next { right: 12px; top: 50%; transform: translateY(-50%); }
.lbx.is-single .lbx__prev, .lbx.is-single .lbx__next, .lbx.is-single .lbx__count { display: none; }
body.lbx-open { overflow: hidden; }

@media (max-width: 1080px) {
  .pfb__grid, .pfend__grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .pfg { gap: 6px; }
  .pfg__item { border-radius: 9px; }
  .lbx__stage { margin: 56px 0 0; }
  .lbx__prev, .lbx__next { top: auto; bottom: -58px; transform: none; }
  .lbx__prev { left: auto; right: 72px; }
  .lbx__bar { padding-right: 140px; }
}
