/* Public portfolio pages (/u/<name>) */
:root {
  --paper: #f4f1ea;
  --paper2: #ebe6da;
  --card: #fbf9f4;
  --ink: #151515;
  --ink2: #4a463f;
  --mute: #8a8478;
  --line: #ddd6c8;
  --red: #ff4a1c;
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'Instrument Sans', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--paper); color: var(--ink); font: 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
body.pf-locked { overflow: hidden; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
#pf-root { max-width: 1240px; margin: 0 auto; padding: 0 28px; }

.pf-top { display: flex; align-items: center; justify-content: space-between; padding: 22px 0; }
.pf-mark { font: 700 24px/1 var(--serif); letter-spacing: -0.04em; text-decoration: none; }
.pf-mark span, .pf-foot a span, .pf-badge span { color: var(--red); }
.pf-share { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--ink); background: var(--card); font-weight: 600; transition: transform .12s, box-shadow .12s; box-shadow: 3px 3px 0 var(--ink); }
.pf-share:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }

.pf-hero { display: flex; gap: 28px; align-items: flex-start; padding: 40px 0 44px; border-bottom: 1.5px solid var(--ink); }
.pf-avatar { flex: none; width: 104px; height: 104px; border-radius: 50%; display: grid; place-items: center; background: var(--accent, var(--red)); color: #fff; font: 600 38px/1 var(--serif); letter-spacing: -0.03em; box-shadow: 4px 4px 0 var(--ink); }
.pf-eyebrow { margin: 4px 0 8px; font: 500 12px var(--mono); text-transform: uppercase; letter-spacing: .14em; color: var(--ink2); }
.pf-hero h1 { margin: 0; font: 600 clamp(40px, 7vw, 84px)/0.98 var(--serif); letter-spacing: -0.045em; }
.pf-bio { max-width: 640px; margin: 18px 0 0; font-size: 19px; color: var(--ink2); white-space: pre-line; }
.pf-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.pf-link { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); text-decoration: none; font-weight: 500; font-size: 14px; }
.pf-link:hover { border-color: var(--ink); }
.pf-link svg { width: 16px; height: 16px; color: var(--accent, var(--red)); }

.pf-filter { display: flex; flex-wrap: wrap; gap: 8px; padding: 26px 0 0; }
.pf-filter button { height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: none; font-weight: 600; font-size: 14px; }
.pf-filter button em { font: 500 12px var(--mono); font-style: normal; color: var(--mute); margin-left: 4px; }
.pf-filter button.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.pf-filter button.on em { color: var(--paper2); }

/* Rows that keep each piece's shape and fill the width */
.pf-grid { display: flex; flex-wrap: wrap; gap: 18px; padding: 28px 0 40px; }
.pf-grid::after { content: ''; flex: 999 1 0; }
.pf-item { margin: 0; flex: calc(var(--r) * 100) 1 calc(var(--r) * 250px); min-width: 0; max-width: 100%; }
.pf-item[hidden] { display: none; }
.pf-open { display: block; width: 100%; padding: 0; border: 0; border-radius: 12px; overflow: hidden; background: var(--paper2); aspect-ratio: var(--r); box-shadow: 0 1px 0 rgba(0, 0, 0, .06); transition: transform .18s, box-shadow .18s; }
.pf-open:hover { transform: translateY(-3px); box-shadow: 0 14px 30px -14px rgba(0, 0, 0, .35); }
.pf-open:focus-visible { outline: 3px solid var(--accent, var(--red)); outline-offset: 3px; }
.pf-open img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pf-item figcaption { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; padding: 10px 2px 0; }
.pf-item figcaption b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-item figcaption small { flex: none; font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--mute); }
.pf-empty { width: 100%; padding: 60px 0; text-align: center; color: var(--mute); font-size: 18px; }

.pf-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 28px 0 60px; border-top: 1px solid var(--line); }
.pf-foot p { margin: 0; color: var(--ink2); }
.pf-foot p a { font: 700 18px var(--serif); letter-spacing: -0.03em; text-decoration: none; color: var(--ink); }
.pf-cta { display: inline-flex; align-items: center; height: 44px; padding: 0 20px; border-radius: 999px; background: var(--ink); color: var(--paper); text-decoration: none; font-weight: 600; box-shadow: 3px 3px 0 var(--red); transition: transform .12s, box-shadow .12s; }
.pf-cta:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--red); }
.pf-badge { position: fixed; right: 18px; bottom: 18px; z-index: 20; padding: 8px 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); text-decoration: none; font-size: 13px; color: var(--ink2); box-shadow: 0 6px 20px -8px rgba(0, 0, 0, .3); }
.pf-badge b { font: 700 14px var(--serif); letter-spacing: -0.03em; color: var(--ink); }
.pf-badge:hover { border-color: var(--ink); }

/* Big view */
.pf-box { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 24px; background: rgba(21, 21, 21, .92); }
.pf-box[hidden] { display: none; }
.pf-box figure { margin: 0; max-width: min(1200px, 100%); max-height: 100%; display: flex; flex-direction: column; align-items: center; min-width: 0; }
.pf-box img { max-width: 100%; max-height: calc(100vh - 140px); border-radius: 8px; object-fit: contain; background: #222; }
.pf-box figcaption { color: #f4f1ea; text-align: center; padding-top: 14px; max-width: 720px; }
.pf-box figcaption b { display: block; font: 600 22px var(--serif); letter-spacing: -0.02em; }
.pf-box figcaption span { display: block; color: #cfc8b8; margin-top: 4px; white-space: pre-line; }
.pf-x, .pf-nav { width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .12); color: #fff; display: grid; place-items: center; flex: none; }
.pf-x:hover, .pf-nav:hover { background: rgba(255, 255, 255, .24); }
.pf-x { position: absolute; top: 18px; right: 18px; }
.pf-toast { position: fixed; left: 50%; bottom: 70px; transform: translateX(-50%); z-index: 60; padding: 10px 18px; border-radius: 999px; background: var(--ink); color: var(--paper); font-weight: 600; }

/* Not found */
.pf-missing { max-width: 680px; margin: 0 auto; padding: 70px 28px; }
.pf-missing h1 { margin: 60px 0 16px; font: 600 clamp(32px, 6vw, 56px)/1.05 var(--serif); letter-spacing: -0.04em; }
.pf-missing h1 em { font-weight: 400; color: var(--red); }
.pf-missing p { color: var(--ink2); font-size: 18px; }
.pf-missing-cta a { font-weight: 600; color: var(--ink); }

@media (max-width: 680px) {
  #pf-root { padding: 0 16px; }
  .pf-hero { flex-direction: column; gap: 18px; padding: 20px 0 30px; }
  .pf-avatar { width: 76px; height: 76px; font-size: 28px; }
  .pf-grid { gap: 14px; }
  .pf-item { flex-basis: 100%; }
  .pf-nav { position: absolute; bottom: 20px; }
  .pf-nav.prev { left: 20px; }
  .pf-nav.next { right: 20px; }
  .pf-box img { max-height: calc(100vh - 220px); }
  .pf-badge { display: none; }
}

/* Top links (public page and Explore) */
.pf-topnav { display: flex; align-items: center; gap: 10px; }
.pf-topnav > a:not(.pf-cta) { font-weight: 600; text-decoration: none; padding: 8px 10px; border-radius: 999px; }
.pf-topnav > a:not(.pf-cta):hover { background: var(--paper2); }
.pf-cta.small { height: 40px; padding: 0 16px; font-size: 14px; }

/* Explore */
.ex-hero { padding: 36px 0 30px; border-bottom: 1.5px solid var(--ink); }
.ex-hero h1 { margin: 0; font: 600 clamp(38px, 6.5vw, 78px)/1 var(--serif); letter-spacing: -0.045em; }
.ex-hero h1 em { font-weight: 400; color: var(--red); }
.ex-search { display: flex; align-items: center; gap: 10px; max-width: 520px; height: 48px; margin-top: 24px; padding: 0 16px; border-radius: 999px; background: var(--card); border: 1.5px solid var(--ink); }
.ex-search svg { color: var(--mute); }
.ex-search input { flex: 1; min-width: 0; border: 0; outline: none; background: none; font: inherit; }
.ex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 26px 22px; padding: 30px 0 20px; }
.ex-grid .pf-empty { grid-column: 1 / -1; }
.ex-card { display: flex; flex-direction: column; gap: 12px; text-decoration: none; }
.ex-covers { display: grid; gap: 4px; aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden; background: var(--paper2); transition: transform .18s, box-shadow .18s; }
.ex-covers.n2 { grid-template-columns: 1fr 1fr; }
.ex-covers.n3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.ex-covers.n3 span:first-child { grid-row: span 2; }
.ex-covers span { min-width: 0; min-height: 0; background: #e3ddd0; }
.ex-covers img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ex-card:hover .ex-covers { transform: translateY(-3px); box-shadow: 0 16px 30px -16px rgba(0, 0, 0, .4); }
.ex-card:focus-visible { outline: none; }
.ex-card:focus-visible .ex-covers { outline: 3px solid var(--red); outline-offset: 3px; }
.ex-who { display: flex; align-items: center; gap: 10px; }
.ex-who i { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font: 600 14px var(--serif); font-style: normal; }
.ex-who b { display: block; font-weight: 600; line-height: 1.2; }
.ex-who small { color: var(--mute); font-size: 13px; }
.ex-bio { color: var(--ink2); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: -4px; }
.ex-more { display: flex; justify-content: center; padding: 10px 0 40px; }
@media (max-width: 680px) { .pf-topnav > a:not(.pf-cta) { display: none; } .ex-grid { grid-template-columns: 1fr; } }
.pf-foot p a.pf-plain { font: 600 15px var(--sans); letter-spacing: 0; text-decoration: underline; color: var(--ink2); }
.ex-more [hidden], .pf-share[hidden] { display: none; }
