/* Layout: image-first gallery in the style of a UI reference library. Type tabs on top, a grid of covers, name and meta under each. */
:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --sunk: #f3f4f7;
  --ink: #15171d;
  --muted: #6a6f7e;
  --line: #e6e8ee;
  --screen: #1a1c24;
  --screen-ink: #f4f5f8;
  --scrim: rgb(14 16 21 / .4);
  --thumb: #ffffff;
  --gold-hi: #ffe08a; --gold-lo: #c08a12;
  --c-games: #e0562a;   --c-games-bg: #fbe4da;
  --c-uiux: #2a44e0;    --c-uiux-bg: #e1e6ff;
  --c-web: #0e8f6e;     --c-web-bg: #d6f1e8;
  --c-proto: #9b3fd6;   --c-proto-bg: #eedffa;
  --c-tools: #b07a00;   --c-tools-bg: #f8ecc9;
  --c-content: #d12f6a; --c-content-bg: #fbdde8;
  --ok: #0e8f6e; --wip: #c08400; --idea: #8b90a0;
  --f-display: "Bricolage Grotesque", "Rethink Sans", system-ui, sans-serif;
  --f-body: "Rethink Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0e1015; --surface: #181b24; --sunk: #161921; --ink: #eceef4; --muted: #959aac; --line: #252935;
  --screen: #07080b; --screen-ink: #eceef4; --scrim: rgb(0 0 0 / .6); --thumb: #2a2f3d;
  --c-games: #ff8a5c; --c-games-bg: #2f1c16;
  --c-uiux: #8a9bff;  --c-uiux-bg: #1b2140;
  --c-web: #4fd1a9;   --c-web-bg: #12292a;
  --c-proto: #c991f2; --c-proto-bg: #281a36;
  --c-tools: #f0bd4a; --c-tools-bg: #2d2412;
  --c-content: #ff7aa8; --c-content-bg: #301823;
  --ok: #4fd1a9; --wip: #f0bd4a; --idea: #959aac;
  color-scheme: dark;
} }
:root[data-theme="dark"] {
  --bg: #0e1015; --surface: #181b24; --sunk: #161921; --ink: #eceef4; --muted: #959aac; --line: #252935;
  --screen: #07080b; --screen-ink: #eceef4; --scrim: rgb(0 0 0 / .6); --thumb: #2a2f3d;
  --c-games: #ff8a5c; --c-games-bg: #2f1c16;
  --c-uiux: #8a9bff;  --c-uiux-bg: #1b2140;
  --c-web: #4fd1a9;   --c-web-bg: #12292a;
  --c-proto: #c991f2; --c-proto-bg: #281a36;
  --c-tools: #f0bd4a; --c-tools-bg: #2d2412;
  --c-content: #ff7aa8; --c-content-bg: #301823;
  --ok: #4fd1a9; --wip: #f0bd4a; --idea: #959aac;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; }
img { max-width: 100%; }
body { background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 15px; line-height: 1.5; }
.wrap { max-width: 1280px; margin: 0 auto; padding-inline: clamp(16px, 4vw, 40px); padding-block: 40px 80px; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 8px; }

/* Header */
header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px; }
.who { display: grid; gap: 10px; }
.lede { max-width: 46ch; }
h1 { font-family: var(--f-display); font-weight: 700; font-size: clamp(40px, 6vw, 68px); line-height: .98; letter-spacing: -0.03em; margin: 0; text-wrap: balance; }
.lede { color: var(--muted); margin: 0; font-size: 16px; }
.elsewhere { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 24px; margin: 4px 0 0; font-size: 15px; color: var(--muted); }
.elsewhere a { font-weight: 500; color: var(--ink); text-decoration: underline; text-decoration-color: var(--line); text-decoration-thickness: 1.5px; text-underline-offset: 4px; transition: text-decoration-color .15s; }
.elsewhere a:hover { text-decoration-color: currentColor; }
.elsewhere .arr { display: inline-block; color: var(--muted); transition: transform .2s ease, color .2s; }
.elsewhere a:hover .arr { transform: translate(2px, -2px); color: var(--ink); }

/* Toolbar */
.bar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--bg); margin-top: 36px; padding-block: 12px; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.tabs-scroll { position: relative; flex: 0 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; background: var(--sunk); border-radius: 999px; padding: 4px; }
.tabs-scroll::-webkit-scrollbar { display: none; }
.tabs-scroll.fade-r { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent); }
.tabs-scroll.fade-l { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 48px), transparent); }
.tabs-scroll.fade-l.fade-r { -webkit-mask-image: linear-gradient(to right, transparent, #000 48px, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(to right, transparent, #000 48px, #000 calc(100% - 48px), transparent); }
.thumb { position: absolute; top: 4px; left: 0; height: calc(100% - 8px); border-radius: 999px; background: var(--thumb); box-shadow: 0 1px 2px rgb(0 0 0 / .08), 0 2px 8px -2px rgb(0 0 0 / .12); transition: transform .32s cubic-bezier(.3, 1.3, .5, 1), width .32s cubic-bezier(.3, 1.3, .5, 1); }
.thumb.still { transition: none; }
.tabs { position: relative; display: flex; gap: 2px; list-style: none; margin: 0; padding: 0; }
.tab { font: inherit; font-size: 14px; font-weight: 500; color: var(--muted); background: none; border: 0; padding: 7px 14px; border-radius: 999px; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; transition: color .15s; }
.tab:hover { color: var(--ink); }
.tab:focus-visible { outline-offset: -2px; border-radius: 999px; }
.tab[aria-selected="true"] { color: var(--ink); }
.tab .n { font-family: var(--f-mono); font-size: 11px; font-weight: 500; opacity: .6; font-variant-numeric: tabular-nums; }
.tools { display: flex; gap: 8px; flex: 1 1 300px; min-width: 0; justify-content: flex-end; }
.search, .sort { font: inherit; font-size: 14px; height: 42px; border-radius: 999px; border: 1px solid transparent; background: var(--sunk); color: var(--ink); transition: background .15s, border-color .15s, box-shadow .15s; }
.search { flex: 1; width: 0; min-width: 0; padding: 0 64px 0 16px; }
.search:hover, .sort:hover { border-color: var(--line); }
.search:focus { outline: none; background: var(--surface); border-color: var(--line); box-shadow: 0 0 0 4px var(--sunk); }
.search::placeholder { color: var(--muted); }
.search-wrap { position: relative; flex: 1; min-width: 0; max-width: 260px; display: flex; }
.kbd { position: absolute; right: 9px; top: 50%; translate: 0 -50%; font: 500 11px/1 var(--f-mono); color: var(--muted); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 5px 6px; cursor: pointer; }
.kbd:hover { color: var(--ink); }
.search:focus + .kbd, .search:not(:placeholder-shown) + .kbd { display: none; }
.sort-wrap { position: relative; flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.sort { padding: 0 14px 0 16px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-weight: 500; }
.caret { width: 7px; height: 7px; margin-left: 4px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: translateY(-2px) rotate(45deg); transition: transform .2s; }
.sort[aria-expanded="true"] .caret { transform: translateY(1px) rotate(-135deg); }
.sort-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 10; min-width: 100%; width: max-content; padding: 6px; display: grid; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 16px 40px -12px rgb(0 0 0 / .3); transform-origin: top right; animation: menu-in .14s ease-out; }
.sort-menu[hidden] { display: none; }
@keyframes menu-in { from { opacity: 0; transform: scale(.96) translateY(-4px); } }
.sort-menu button { font: inherit; font-size: 14px; text-align: left; color: var(--ink); background: none; border: 0; border-radius: 9px; padding: 9px 36px 9px 12px; cursor: pointer; position: relative; }
.sort-menu button:hover, .sort-menu button:focus-visible { background: color-mix(in srgb, var(--ink) 7%, transparent); outline: none; }
.sort-menu button[aria-checked="true"] { font-weight: 600; }
.sort-menu button[aria-checked="true"]::after { content: ""; position: absolute; right: 14px; top: 50%; width: 5px; height: 9px; border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: translateY(-65%) rotate(45deg); }

/* Sections & grid */
main { margin-top: 32px; }
.group + .group { margin-top: 56px; }
.group-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 20px; }
.group-head h2 { font-family: var(--f-display); font-weight: 700; font-size: 22px; letter-spacing: -0.02em; margin: 0; }
.group-head .count { font-family: var(--f-mono); font-size: 12px; color: var(--muted); }
.group-head p { margin: 0; flex-basis: 100%; font-size: 14px; color: var(--muted); }
.grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: 36px 24px; }

/* Card */
.card { display: grid; gap: 12px; text-decoration: none; }
.cover { position: relative; aspect-ratio: 4 / 3; max-width: 100%; border-radius: 18px; overflow: hidden; background: var(--cbg); display: grid; place-items: center; padding: 9%; transition: transform .25s ease; }
.cover > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover > img.contain { object-fit: contain; padding: 6%; background: var(--imgbg); }
/* Video-only grids use the thumbnail's own 16:9 shape so it fills the cover. */
.grid.wide .cover { aspect-ratio: 16 / 9; }
.grid.wide .cover > img.contain { object-fit: cover; padding: 0; }
a.card:hover .cover { transform: translateY(-3px); }
a.card:hover .frame { transform: scale(1.03); }
.open { position: absolute; top: 12px; right: 12px; width: 30px; height: 30px; border-radius: 50%; background: var(--surface); color: var(--ink); display: grid; place-items: center; font-size: 15px; opacity: 0; transform: translateY(4px); transition: opacity .2s, transform .2s; }
a.card:hover .open, a.card:focus-visible .open { opacity: 1; transform: none; }
.info { display: grid; gap: 6px; min-width: 0; }
.top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.name { font-weight: 600; font-size: 16px; line-height: 1.3; min-width: 0; text-wrap: balance; }
.date { font-family: var(--f-mono); font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.link { font-size: 12px; font-weight: 600; line-height: 1; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink); text-decoration: none; transition: border-color .15s, background .15s; }
.link:hover { border-color: var(--ink); }
.sum { font-size: 14px; line-height: 1.45; color: var(--muted); margin: 0; text-wrap: pretty; }

/* Mock frames, one per project type */
.frame { width: 100%; transition: transform .3s ease; box-shadow: 0 1px 2px rgb(0 0 0 / .06), 0 12px 28px -12px rgb(0 0 0 / .25); }
.ttl { font-family: var(--f-display); font-weight: 700; letter-spacing: -0.02em; line-height: 1.05; text-wrap: balance; overflow: hidden; }
.bars { display: grid; gap: 6px; }
.bars i { display: block; height: 6px; border-radius: 3px; background: currentColor; opacity: .14; }
.bars i:nth-child(2) { width: 78%; } .bars i:nth-child(3) { width: 56%; }

/* game: a title screen */
.f-games { aspect-ratio: 16 / 10; background: var(--screen); color: var(--screen-ink); border-radius: 10px; padding: 9% 10%; display: grid; align-content: space-between; }
.f-games .ttl { font-size: clamp(16px, 2.1vw, 22px); text-transform: uppercase; }
.f-games .menu { display: grid; gap: 5px; font-family: var(--f-mono); font-size: 9px; letter-spacing: .12em; text-transform: uppercase; opacity: .75; }
.f-games .menu span:first-child { color: var(--c); opacity: 1; }
.f-games .menu span:first-child::before { content: "▸ "; }
/* uiux: a phone */
.f-uiux { width: 42%; aspect-ratio: 9 / 18; background: var(--surface); color: var(--ink); border-radius: 16px; border: 4px solid var(--screen); padding: 14% 10%; display: grid; align-content: start; gap: 10px; }
.f-uiux .ttl { font-size: 12px; }
.f-uiux .blk { aspect-ratio: 4 / 3; border-radius: 6px; background: var(--c); opacity: .85; }
/* web: a browser */
.f-web { aspect-ratio: 16 / 11; background: var(--surface); color: var(--ink); border-radius: 10px; overflow: hidden; display: grid; grid-template-rows: auto 1fr; }
.f-web .chrome { display: flex; align-items: center; gap: 4px; padding: 7px 9px; background: var(--sunk); border-bottom: 1px solid var(--line); }
.f-web .chrome b { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.f-web .chrome span { margin-left: 6px; flex: 1; height: 10px; border-radius: 5px; background: var(--line); }
.f-web .pg { padding: 8% 9%; display: grid; align-content: center; gap: 10px; }
.f-web .ttl { font-size: clamp(15px, 1.9vw, 20px); }
.f-web .cta { width: 34%; height: 14px; border-radius: 7px; background: var(--c); }
/* proto: a selected Figma frame */
.f-proto { width: 46%; position: relative; }
.f-proto .lbl { font-family: var(--f-mono); font-size: 9px; color: var(--c); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.f-proto .fr { aspect-ratio: 9 / 16; background: var(--surface); color: var(--ink); outline: 1.5px solid var(--c); padding: 14% 12%; display: grid; align-content: start; gap: 10px; position: relative; }
.f-proto .fr::before, .f-proto .fr::after { content: ""; position: absolute; width: 7px; height: 7px; background: var(--surface); border: 1.5px solid var(--c); }
.f-proto .fr::before { top: -4px; left: -4px; } .f-proto .fr::after { bottom: -4px; right: -4px; }
.f-proto .ttl { font-size: 12px; }
.f-proto.frame { box-shadow: none; }
/* tools: an app window with sidebar */
.f-tools { aspect-ratio: 16 / 11; background: var(--surface); color: var(--ink); border-radius: 10px; overflow: hidden; display: grid; grid-template-columns: 26% 1fr; }
.f-tools .side { background: var(--sunk); border-right: 1px solid var(--line); padding: 12px 10px; display: grid; align-content: start; gap: 7px; }
.f-tools .side i { height: 5px; border-radius: 3px; background: var(--ink); opacity: .12; }
.f-tools .side i:first-child { background: var(--c); opacity: 1; width: 60%; height: 8px; }
.f-tools .main { padding: 10% 10%; display: grid; align-content: center; gap: 10px; }
.f-tools .ttl { font-size: clamp(14px, 1.7vw, 18px); }
.f-tools .tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.f-tools .tiles i { aspect-ratio: 1; border-radius: 5px; background: var(--c); opacity: .2; }
.f-tools .tiles i:first-child { opacity: .8; }
/* content: a video thumbnail */
.f-content { aspect-ratio: 16 / 9; background: var(--screen); color: var(--screen-ink); border-radius: 10px; position: relative; padding: 8% 9%; display: grid; align-content: end; }
.f-content .ttl { font-size: clamp(14px, 1.8vw, 19px); max-width: 70%; }
.f-content .play { position: absolute; top: 50%; right: 12%; translate: 0 -50%; width: 30%; aspect-ratio: 1; max-width: 48px; border-radius: 50%; background: var(--c); }
.f-content .play::after { content: ""; position: absolute; inset: 0; margin: auto; translate: 10% 0; width: 0; height: 0; border-left: 11px solid var(--screen-ink); border-top: 7px solid transparent; border-bottom: 7px solid transparent; }
.f-content .dur { position: absolute; bottom: 8px; right: 8px; font-family: var(--f-mono); font-size: 9px; padding: 2px 5px; border-radius: 4px; background: rgb(0 0 0 / .6); color: #fff; }

/* Quick search palette */
.pal { width: min(560px, calc(100% - 32px)); margin: 14vh auto auto; padding: 0; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--ink); box-shadow: 0 24px 60px -16px rgb(0 0 0 / .35); overflow: hidden; }
.pal::backdrop { background: var(--scrim); }
.pal[open] { animation: pal-in .16s ease-out; }
@keyframes pal-in { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
.pal-q { width: 100%; font: inherit; font-size: 17px; padding: 18px 20px; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--ink); outline: none; }
.pal-q::placeholder { color: var(--muted); }
.pal-list { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow: auto; }
.pal-list li { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 10px 14px; border-radius: 10px; cursor: pointer; font-weight: 500; }
.pal-list li[aria-selected="true"] { background: var(--sunk); }
.pal-list .hint { font-family: var(--f-mono); font-size: 12px; font-weight: 400; color: var(--muted); white-space: nowrap; }
.pal-list .none { color: var(--muted); cursor: default; font-weight: 400; }
.pal-foot { display: flex; gap: 18px; padding: 10px 20px; border-top: 1px solid var(--line); font-family: var(--f-mono); font-size: 11px; color: var(--muted); }
.card.flash .cover { animation: flash 1.2s ease; }
@keyframes flash { 0%, 100% { box-shadow: 0 0 0 0 transparent; } 20%, 60% { box-shadow: 0 0 0 4px var(--c); } }

/* Trophies: a gold cup with the name under it */
/* Trophy room page */
.back { display: inline-block; font-size: 14px; font-weight: 500; color: var(--muted); text-decoration: none; margin-bottom: 28px; }
.back:hover { color: var(--ink); }
.room-head { display: grid; gap: 10px; margin-bottom: 48px; }
.ach { margin-top: 0; }
.elsewhere .cup-sm { width: 16px; height: 16px; margin-right: 6px; vertical-align: -2px; }
.cup.cup-sm { width: 16px; height: 16px; }
.trophies { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 44px 16px; }
.trophies li { transition: opacity .5s ease, transform .5s cubic-bezier(.3, 1.4, .5, 1); transition-delay: calc(var(--i) * 50ms); }
.ach.locked .trophies li { opacity: 0; transform: translateY(8px) scale(.94); }
.trophy { display: grid; justify-items: center; text-align: center; gap: 4px; color: inherit; text-decoration: none; }
.t-badge { display: flex; justify-content: center; align-items: flex-end; height: 76px; margin-bottom: 10px; }
.cup { width: 68px; height: 68px; }
.trophy b { font-size: 15px; font-weight: 600; line-height: 1.3; text-wrap: balance; }
.t-detail { font-size: 13px; color: var(--muted); max-width: 26ch; }
/* Locked trophies: a flat silhouette of the cup, no shine */
.cup-locked { color: var(--line); }
.cup-locked [fill="url(#tg)"] { fill: currentColor; }
.cup-locked [stroke="url(#tg)"] { stroke: currentColor; }
.cup-locked [fill="#fff"], .cup-locked [stroke="#fff"], .cup-locked [fill="#000"] { display: none; }
.locked-trophy b, .locked-trophy .t-detail { color: var(--muted); opacity: .6; }

.empty { padding: 60px 0; color: var(--muted); text-align: center; }
footer { margin-top: 72px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); }

@media (max-width: 640px) {
  .tools { flex-basis: 100%; }
  .search-wrap { max-width: none; }
  .trophies { grid-template-columns: 1fr 1fr; gap: 32px 12px; }
  .cup { width: 52px; height: 52px; }
  .t-badge { height: 64px; }
  .tabs-scroll { flex-basis: 100%; }
  .bar { gap: 8px; padding-block: 10px; }
  .search, .sort { height: 40px; }
  .tab { padding: 6px 12px; }
  /* Two trophies per row: drop a lone locked cup at the end */
  .trophies li:last-child:nth-child(odd):has(.locked-trophy) { display: none; }
  .kbd { display: none; }
  .grid { gap: 28px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
