/* 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;
  --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", "Hanken Grotesk", system-ui, sans-serif;
  --f-body: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "JetBrains 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;
  --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;
  --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; max-width: 46ch; }
h1 { font-family: var(--f-display); font-weight: 700; font-size: clamp(34px, 5vw, 52px); line-height: 1.02; letter-spacing: -0.03em; margin: 0; text-wrap: balance; }
.lede { color: var(--muted); margin: 0; font-size: 16px; }.elsewhere { display: flex; flex-wrap: wrap; gap: 8px; }
.elsewhere a { font-size: 13px; font-weight: 500; text-decoration: none; padding: 8px 14px; border-radius: 999px; background: var(--sunk); transition: background .15s; }
.elsewhere a:hover { background: var(--line); }

/* 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 { flex: 1 1 520px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.tabs { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.tab { font: inherit; font-size: 14px; font-weight: 600; color: var(--muted); background: none; border: 0; padding: 8px 14px; border-radius: 999px; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; transition: background .15s, color .15s; }
.tab:hover { color: var(--ink); background: var(--sunk); }
.tab[aria-selected="true"] { color: var(--bg); background: var(--ink); }
.tab .n { font-family: var(--f-mono); font-size: 11px; font-weight: 500; opacity: .7; font-variant-numeric: tabular-nums; }
.tools { display: flex; gap: 8px; flex: 1 1 300px; justify-content: flex-end; }
.search, .sort { font: inherit; font-size: 14px; height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--sunk); color: var(--ink); }
.search { flex: 1; min-width: 0; max-width: 240px; }
.search::placeholder { color: var(--muted); }
.sort { cursor: pointer; padding-right: 10px; }

/* 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); }
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; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.date { font-family: var(--f-mono); font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 12px; font-weight: 500; line-height: 1; padding: 5px 9px; border-radius: 999px; background: var(--sunk); color: var(--muted); }
.sum { font-size: 13px; color: var(--muted); margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* 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; }

.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 { max-width: none; }
  .grid { gap: 28px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
