/* Motion Sites structure, rebuilt for TOBIRA's existing X collection.
   Measured reference: 24/16px page inset, 68px navigation, 4/2 columns, 12px column gap. */
:root{color-scheme:light;--page:#fff;--surface:#f3f3f2;--hover:#e9e9e7;--ink:#181818;--muted:#686868;--primary:#181818;--on-primary:#fff;--page-inset:40px;--header-height:68px;--font:"Hiragino Sans","Hiragino Kaku Gothic ProN",-apple-system,BlinkMacSystemFont,sans-serif}
*{box-sizing:border-box}html{scroll-padding-top:92px}body{margin:0;background:var(--page);color:var(--ink);font-family:var(--font);font-size:14px;line-height:1.6;-webkit-font-smoothing:antialiased}button,input,select{font:inherit}button,a{-webkit-tap-highlight-color:transparent}button{border:0;cursor:pointer;color:inherit}a{color:inherit;text-decoration:none}button:disabled{opacity:.3;cursor:default}svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex:none}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,video:focus-visible{outline:2px solid #655cff;outline-offset:4px}[hidden]{display:none!important}.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}.skip-link{position:fixed;top:8px;left:16px;z-index:100;background:var(--primary);color:var(--on-primary);padding:8px 16px;transform:translateY(-150%)}.skip-link:focus{transform:none}
.site-header{position:sticky;top:0;z-index:30;display:flex;align-items:center;gap:24px;height:68px;padding:16px var(--page-inset);background:var(--page)}.header-start,.header-actions{display:flex;align-items:center;gap:12px;flex-shrink:0}.header-actions{margin-left:auto;gap:8px}.brand{display:flex;align-items:center;justify-content:center;width:32px;height:36px}.brand svg{width:32px;height:32px;stroke:none}.current-page{font-family:-apple-system,BlinkMacSystemFont,sans-serif;font-size:21px;font-weight:750;letter-spacing:-.8px;white-space:nowrap}.main-nav{display:flex;align-items:center;gap:28px;margin-left:12px;color:var(--muted);white-space:nowrap}.main-nav,.mobile-menu{font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","SF Pro Display",Inter,"Hiragino Kaku Gothic ProN","Noto Sans JP",sans-serif;font-size:16px;font-weight:600;line-height:22px;letter-spacing:.2px}.button{display:inline-flex;align-items:center;justify-content:center;gap:9px;min-height:44px;padding:11px 22px;border-radius:999px;font-size:13px;font-weight:600;line-height:1.5;transition:background-color .15s,opacity .15s}.primary{background:var(--primary);color:var(--on-primary)}.secondary{background:var(--surface)}.signup-link{min-height:36px;padding:8px 20px;font-size:12px}.icon-button{width:36px;height:36px;padding:0;display:inline-grid;place-items:center;background:transparent;border-radius:50%;color:var(--muted)}.menu-toggle{display:none}.mobile-menu{position:absolute;top:68px;left:16px;right:16px;padding:16px;background:var(--surface);border-radius:20px;box-shadow:0 16px 48px #0008}.mobile-menu a{display:block;padding:12px}
.gallery-intro{display:flex;flex-direction:column;align-items:center;text-align:center;padding:64px var(--page-inset) 48px}.hero-eyebrow{margin:0 0 12px;font-size:11px;line-height:16px;font-weight:600;color:#d8c4df;letter-spacing:.06em}.gallery-intro h1{margin:0;font-size:56px;line-height:1.18;font-weight:800;letter-spacing:-.065em}.hero-gradient{position:relative;display:inline-block;background:radial-gradient(80.17% 109.2% at var(--gradient-x,44.373%) var(--gradient-y,35.1526%),#d0b2ff 0%,#ffeed8 42.83%,#e8400d 88.38%);background-size:200% 200%;background-clip:text;-webkit-background-clip:text;color:transparent;animation:gradient-shift 6s ease-in-out infinite}.hero-gradient::after{content:"";position:absolute;inset:20% 10%;background:linear-gradient(90deg,#e87d5933,#d0b2ff44);filter:blur(22px);z-index:-1}.hero-description{margin:16px 0 24px;font-size:15px;line-height:1.8;color:var(--muted)}.hero-button{min-height:56px;padding:16px 30px;background:linear-gradient(#fff 20%,#cedbf5);color:#151922;font-size:15px;font-weight:700}.hero-button svg{width:18px}
@property --gradient-x{syntax:"<percentage>";inherits:false;initial-value:44.373%}
@property --gradient-y{syntax:"<percentage>";inherits:false;initial-value:35.1526%}
@keyframes gradient-shift{0%,100%{--gradient-x:44.373%;--gradient-y:35.1526%}33%{--gradient-x:61.34%;--gradient-y:50.46%}66%{--gradient-x:30%;--gradient-y:60%}}
.filter-bar{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:0 var(--page-inset);margin:4px 0 20px}.source-filters{display:flex;align-items:center;gap:4px;min-width:0;overflow:auto;scrollbar-width:none}.source-filters::-webkit-scrollbar{display:none}.source-filters button{flex:none;padding:9px 20px;border-radius:999px;background:transparent;color:var(--muted);font-size:13px;font-weight:600;white-space:nowrap}.source-filters button[aria-pressed=true]{background:var(--surface);color:var(--ink)}.filter-options{flex-shrink:0}.filter-options select{max-width:155px;background:var(--surface);color:var(--ink);border:0;padding:10px 32px 10px 16px;border-radius:999px;font-size:12px;cursor:pointer}.result-count{padding:0 var(--page-inset);margin:-6px 0 16px;color:var(--muted);font-size:11px}.search-form{margin:0 var(--page-inset) 24px;display:flex;align-items:center;gap:12px;padding:10px 16px;border-radius:16px;background:var(--surface)}.search-form input{min-width:0;flex:1;background:transparent;border:0;padding:8px;color:var(--ink);outline-offset:0}.search-form .secondary{background:#383838;min-height:36px;padding:8px 16px}
.gallery-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));grid-auto-rows:1px;column-gap:12px;padding:0 var(--page-inset);min-height:300px;align-items:start}.design-card{position:relative;min-width:0;grid-row-end:span 320}.card-link{display:block;min-width:0;border-radius:20px}.thumbnail{position:relative;display:grid;place-items:center;aspect-ratio:var(--preview-ratio,4/3);overflow:hidden;border-radius:20px;background:var(--surface);isolation:isolate}.thumbnail>img,.thumbnail>video{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;object-position:center;transition:opacity .2s}.thumbnail>video{opacity:0;pointer-events:none}.thumbnail>video.is-ready{opacity:1}.card-meta{display:flex;align-items:flex-start;gap:10px;padding:16px 1px 0}.card-caption{flex:1;min-width:0}.card-caption h2{margin:0;font-size:16px;line-height:1.45;font-weight:700;letter-spacing:-.025em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.card-author{display:flex;align-items:center;gap:6px;margin-top:4px;color:var(--muted);font-size:11px;line-height:18px}.card-author>span:last-child{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.avatar{display:grid;place-items:center;flex-shrink:0;width:36px;height:36px;border-radius:50%;overflow:hidden;background:var(--hover);font-size:12px}.avatar img{width:100%;height:100%;object-fit:cover}.card-author .avatar{width:18px;height:18px;font-size:9px}.code-indicator{display:inline-flex;align-items:center;justify-content:center;color:var(--muted);width:24px;height:24px;flex-shrink:0}.code-indicator svg{width:22px;height:22px}.video-toggle{position:absolute;left:10px;top:10px;z-index:2;width:30px;height:30px;display:grid;place-items:center;background:#161616a8;color:white;border-radius:50%;opacity:0;transition:opacity .15s}.video-toggle svg{width:14px;height:14px}.design-card:hover .video-toggle,.design-card:focus-within .video-toggle,.video-toggle[aria-pressed=true]{opacity:1}.missing-image{position:absolute;inset:16px;display:grid;place-items:center;text-align:center;font-size:12px;color:var(--muted)}.empty-gallery{grid-column:1/-1;grid-row:span 180;text-align:center;padding:48px 16px;color:var(--muted)}.skeleton{grid-row:span 300}.skeleton .thumbnail{aspect-ratio:4/3}.skeleton .card-meta{height:60px}
.pagination{display:flex;align-items:center;justify-content:center;gap:8px;padding:24px var(--page-inset) 64px}.pagination button{height:40px;min-width:40px;padding:0 12px;border-radius:999px;background:var(--surface);font-size:12px}.pagination button[aria-current=page]{background:var(--primary);color:var(--on-primary)}.pagination .ellipsis{color:var(--muted)}.error-state{text-align:center;padding:48px 24px}
/* An expanded work lives in the collection, matching the reference's detail structure. */
#detail{display:grid;grid-template-columns:minmax(0,3fr) minmax(0,1fr);gap:12px;margin:16px var(--page-inset) 24px;scroll-margin-top:84px}.detail-main{position:relative;min-width:0;overflow:hidden;background:var(--surface);border-radius:24px;align-self:start}.detail-toolbar{position:absolute;top:12px;left:12px;right:12px;display:flex;justify-content:space-between;pointer-events:none;z-index:5}.detail-toolbar button{background:#181818bf;color:#fff;pointer-events:auto;backdrop-filter:blur(12px)}.detail-paging{display:flex;gap:8px}.detail-content{display:grid;grid-template-columns:minmax(0,1fr) 280px;min-height:580px}.detail-media{position:relative;display:grid;place-items:center;background:#191919;min-height:440px;overflow:hidden}.detail-media img,.detail-media video{width:100%;height:100%;max-height:740px;object-fit:contain}.detail-media video{position:absolute;inset:0}.detail-info{display:flex;flex-direction:column;align-items:flex-start;gap:20px;min-width:0;padding:68px 24px 28px}.detail-info h2{font-size:22px;line-height:1.35;font-weight:700;letter-spacing:-.025em;overflow-wrap:anywhere;margin:0}.detail-author{display:flex;align-items:center;gap:10px;min-width:0;width:100%}.detail-author>div{min-width:0}.detail-author strong{display:block;font-size:12px;overflow-wrap:anywhere}.detail-author small{display:block;font-size:11px;color:var(--muted)}.detail-description{font-size:12px;line-height:1.85;color:var(--muted);margin:0;overflow-wrap:anywhere;white-space:pre-line}.source-link{display:inline-flex;align-items:center;gap:8px;font-size:12px;min-height:36px}.source-link svg{width:15px;height:15px}.detail-cta{display:flex;flex-direction:column;gap:12px;width:100%;margin-top:auto}.detail-cta .button{width:100%;font-size:12px;padding:12px;white-space:normal;text-align:center}.detail-cta .button svg{width:16px;height:16px}.detail-cta .secondary{background:var(--hover)}.detail-related{min-width:0;display:grid;gap:24px;align-content:start}.detail-related .video-toggle{display:none}.detail-related .design-card{grid-row:auto}.detail-message{grid-column:1/-1;padding:64px 24px;text-align:center}.detail-open .gallery-intro,.detail-open .filter-bar,.detail-open .result-count,.detail-open .search-form,.detail-open .library-promo{display:none}.detail-open .gallery-grid{padding-top:0}
.code-access{display:flex;flex-direction:column;gap:12px;width:100%;min-width:0}.code-preview{overflow:hidden;border-radius:14px;background:#191a1f;color:#c7cbd4;user-select:none;pointer-events:none}.code-preview-heading{display:flex;align-items:center;gap:8px;padding:14px 16px 0;color:#9297a3;font:10px/1.5 ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:.04em}.code-preview-heading svg{width:14px;height:14px}.code-preview pre{height:148px;margin:0;padding:16px;overflow:hidden;filter:blur(3px);opacity:.8;mask-image:linear-gradient(#000 60%,transparent);font:11px/1.85 ui-monospace,SFMono-Regular,Menlo,monospace;white-space:pre}.code-preview code{font:inherit}.syntax-tag{color:#c4a5f3}.syntax-attr{color:#98c4e8}.syntax-string{color:#b1caa0}
.library-promo{display:grid;grid-template-columns:1fr 1fr;align-items:center;gap:64px;margin:24px var(--page-inset) 72px;padding:56px;background:var(--surface);border-radius:28px;overflow:hidden}.promo-mark svg{width:42px;height:42px;stroke:none}.promo-copy h2{margin:24px 0 16px;font-size:32px;line-height:1.5;letter-spacing:-.05em}.promo-copy p{color:var(--muted);font-size:13px;line-height:1.9;margin:0 0 28px}.promo-art{position:relative;height:360px;isolation:isolate}.promo-art img{position:absolute;width:76%;height:70%;object-fit:cover;border-radius:20px;box-shadow:0 24px 64px #0007}.promo-art img:nth-child(1){top:0;left:0;transform:rotate(-8deg)}.promo-art img:nth-child(2){bottom:0;right:0;transform:rotate(7deg)}.site-footer{display:flex;align-items:center;gap:24px;padding:24px var(--page-inset) 32px;color:var(--muted);font-size:11px}.site-footer p{margin:0 auto 0 0}.site-footer a{display:inline-flex;align-items:center;gap:8px}.site-footer svg{width:16px;height:16px}
@media(hover:hover){.main-nav a:hover,.source-link:hover,.site-footer a:hover{color:var(--ink)}.source-link:hover{text-decoration:underline;text-underline-offset:4px}.icon-button:hover,.source-filters button:hover{background:var(--hover);color:var(--ink)}.button:hover{opacity:.88}.card-link.is-code-hover .card-caption h2{color:#6541a5}}
/* Related previews fit the work's height instead of pushing the collection down. */
@media(min-width:901px){.detail-related{contain:size;align-self:stretch;grid-template-rows:repeat(2,minmax(0,1fr));min-height:0}.detail-related .design-card{height:100%;min-height:0}.detail-related .card-link{display:flex;flex-direction:column;height:100%;min-height:0}.detail-related .thumbnail{flex:1;min-height:0;aspect-ratio:auto}.detail-related .card-meta{flex-shrink:0}}
@media(max-width:1100px){.main-nav{gap:20px;margin-left:0}.main-nav a:nth-child(2){display:none}.detail-content{grid-template-columns:minmax(0,1fr) 240px}.detail-info{padding-left:18px;padding-right:18px}.library-promo{gap:32px;padding:40px}}
@media(max-width:900px){.main-nav{display:none}.menu-toggle{display:inline-grid}.gallery-grid{grid-template-columns:repeat(3,minmax(0,1fr))}#detail{grid-template-columns:minmax(0,1fr)}.detail-related{display:none}.detail-content{grid-template-columns:minmax(0,1fr) 280px}.library-promo{grid-template-columns:1fr}.promo-art{display:none}}
@media(max-width:639px){:root{--page-inset:16px}.site-header{gap:12px}.header-start{gap:8px}.current-page{font-size:18px}.brand,.brand svg{width:27px}.signup-link{display:none}.gallery-intro{padding-top:48px;padding-bottom:40px}.gallery-intro h1{font-size:38px;line-height:1.25;letter-spacing:-.065em}.hero-eyebrow{font-size:10px}.hero-description{font-size:12px;line-height:1.85;margin:18px 0 26px}.hero-button{min-height:52px;padding:15px 24px;font-size:13px}.filter-bar{gap:8px;margin-bottom:18px}.source-filters button{padding:9px 14px;font-size:12px}.filter-options select{max-width:98px;padding:10px 8px;font-size:11px}.result-count{font-size:10px}.gallery-grid{grid-template-columns:repeat(2,minmax(0,1fr));column-gap:12px}.thumbnail{border-radius:16px}.card-link{border-radius:16px}.card-meta{padding-top:12px;gap:4px}.card-caption h2{font-size:13px;line-height:1.4}.card-author{font-size:10px;gap:4px}.card-author .avatar{width:16px;height:16px}.code-indicator{width:18px;height:18px}.code-indicator svg{width:18px;height:18px}.video-toggle{opacity:1;width:26px;height:26px;top:8px;left:8px}.pagination{gap:4px;padding-bottom:36px}.pagination button{font-size:11px;min-width:36px;padding:0 10px}.pagination .page-number:not([aria-current]):not(.adjacent){display:none}.search-form{gap:6px;padding:8px 10px}.search-form input{font-size:12px}.search-form>svg{display:none}.search-form .button{font-size:11px;padding:8px 12px}#detail{margin-top:8px}.detail-main{border-radius:20px}.detail-content{display:block;min-height:0}.detail-media{height:auto;min-height:260px;aspect-ratio:4/3}.detail-media img,.detail-media video{position:absolute;inset:0;width:100%;height:100%}.detail-info{padding:24px 20px;gap:20px}.detail-info h2{font-size:24px}.detail-description{font-size:13px}.detail-author strong{font-size:13px}.detail-author small{font-size:12px}.detail-cta .button{font-size:13px;min-height:46px}.code-preview pre{height:180px}.library-promo{margin-bottom:32px;padding:28px 24px;border-radius:22px}.promo-copy h2{font-size:24px}.promo-copy p{font-size:12px}.site-footer{flex-wrap:wrap;gap:12px}.site-footer p{order:3;width:100%}.site-footer a{margin-left:auto}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
@media(prefers-reduced-transparency:reduce){.detail-toolbar button{background:#242424;backdrop-filter:none}}
.card-meta{flex-wrap:wrap;row-gap:8px}.card-caption{flex-basis:100%}.code-indicator{gap:5px;width:auto;height:auto;min-height:26px;padding:3px 9px;border-radius:7px;background:var(--surface);color:var(--ink);font-size:11px;font-weight:600;line-height:20px;white-space:nowrap}.code-indicator svg{width:16px;height:16px;flex-shrink:0}
.code-peek{position:absolute;inset:0;z-index:3;display:flex;flex-direction:column;overflow:hidden;background:#181b22;color:#d4d8e2;text-align:left;font-family:Consolas,"SFMono-Regular",monospace;opacity:0;visibility:hidden;transform:translateY(6px);transition:opacity 160ms ease-out,transform 160ms ease-out,visibility 160ms;pointer-events:none}
.code-peek-tabs{display:flex;flex-shrink:0;gap:1px;background:#101319;font-size:10px;white-space:nowrap}.code-peek-tabs>span{padding:12px 9px;color:#8793a5}.code-peek-tabs .active{background:#000;color:#e5e9f0;box-shadow:inset 0 2px #80b7ff}.code-peek-tabs i{font-size:9px;font-style:normal;color:#e5ba80}.code-peek-tabs>span:nth-child(2) i{color:#8ebeff}.code-peek-tabs>span:nth-child(3) i{color:#e5d078}
.code-peek-body{flex:1;min-height:0;overflow:hidden;padding:10px 0;mask-image:linear-gradient(#000 85%,transparent)}.code-peek-file{display:block;padding:4px 12px 5px 32px;font-size:9px;color:#7e899c}.code-peek code{display:block;font-size:clamp(9px,.78vw,12px);line-height:1.7}.peek-line{display:flex;white-space:pre}.peek-line>b{flex:0 0 30px;padding-right:9px;text-align:right;font-weight:400;color:#657084;user-select:none}.peek-line em{font-style:normal;color:#9dc9ff}.peek-line strong{font-weight:400;color:#d7bbfa}.peek-line q{color:#d6bd91}.peek-line q::before,.peek-line q::after{content:none}
.code-peek-footer{display:flex;flex-direction:column;gap:5px;flex-shrink:0;padding:9px 12px;background:#212b3c;font-size:9px;color:#a9b8cd}.code-peek-footer strong{font-family:var(--font);font-size:11px;color:#edf4ff;font-weight:600}.card-link:focus-visible .code-peek{opacity:1;visibility:visible;transform:translateY(0)}
@media(hover:hover) and (pointer:fine){.card-link.is-code-hover .code-peek{opacity:1;visibility:visible;transform:translateY(0)}.card-link.is-code-hover .code-indicator{background:#26354c;color:#c7dfff}.card-link.is-code-hover .code-peek-body{animation:code-peek-reveal 200ms ease-out}}
@keyframes code-peek-reveal{from{opacity:.4;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}
@media(prefers-reduced-motion:reduce){.code-peek{transition:none;transform:none}.card-link.is-code-hover .code-peek-body{animation:none}}
.code-peek-body{position:relative}.code-peek-file{display:none}.code-peek-body>code{position:absolute;inset:12px 0 auto;opacity:0}.code-peek-body>code:first-of-type{opacity:1}
@media(hover:hover) and (pointer:fine){.card-link.is-code-hover .code-peek-body>code{animation:code-file-cycle 6s linear infinite}.card-link.is-code-hover .code-peek-tabs>span{animation:code-tab-cycle 6s linear infinite}.card-link.is-code-hover .code-peek-body>code:nth-of-type(2),.card-link.is-code-hover .code-peek-tabs>span:nth-child(2){animation-delay:-4s}.card-link.is-code-hover .code-peek-body>code:nth-of-type(3),.card-link.is-code-hover .code-peek-tabs>span:nth-child(3){animation-delay:-2s}.design-card:has(.card-link.is-code-hover .code-peek)>.video-toggle{opacity:0;pointer-events:none}}
@keyframes code-file-cycle{0%,28%{opacity:1;transform:translateY(0)}33%,95%{opacity:0;transform:translateY(3px)}100%{opacity:1;transform:translateY(0)}}
@keyframes code-tab-cycle{0%,28%,100%{background:rgb(255 255 255 / 6%);color:#e5e9f0;box-shadow:inset 0 2px #80b7ff}33%,95%{background:transparent;color:#9ba8bb;box-shadow:none}}
@media(prefers-reduced-motion:reduce){.card-link.is-code-hover .code-peek-body>code,.card-link.is-code-hover .code-peek-tabs>span{animation:none}}
.gallery-intro.gallery-intro-compact{padding:32px var(--page-inset) 24px;text-align:left}.gallery-intro-compact h1{margin:0;font-size:clamp(24px,3vw,32px);line-height:1.25;letter-spacing:-.035em}.gallery-intro-compact .hero-description{margin:10px 0 0;font-size:13px;line-height:1.6}
/* Keep the actual work visible above a compact, crisp editor study. */
.code-peek{inset:auto 0 0;height:62%;min-height:0;max-height:100%;border-radius:12px 12px 0 0;background:linear-gradient(135deg,#181d28,#111722);box-shadow:0 -12px 32px #0005;font-synthesis:none;-webkit-font-smoothing:antialiased}
.code-peek-project{display:flex;align-items:center;gap:7px;flex-shrink:0;padding:7px 12px;background:#141a24;font-size:10px;min-width:0}.code-peek-project>span:nth-child(2){overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.code-project-mark{color:var(--code-accent)}.code-peek-project small{margin-left:auto;flex-shrink:0;font-size:9px;color:#8d9caf}.code-peek-tabs{font-size:10px}.code-peek-tabs>span{padding:7px 10px}.code-peek-body>code{inset:8px 0 auto;font-size:11px;line-height:1.65;color:#c1d5eb}.peek-line:nth-child(2){color:var(--code-accent)}.peek-line>b{color:#697b91}.code-peek-footer{flex-direction:row;align-items:center;justify-content:space-between;gap:6px;padding:7px 10px;background:#1b2738;font-size:9px}.code-peek-footer strong{color:var(--code-accent);font-size:10px}.code-peek-body{mask-image:linear-gradient(#000 80%,transparent)}
@media(min-width:1200px){.code-peek-body>code{font-size:12px}.code-peek-tabs{font-size:11px}}
@media(max-width:1100px){.code-peek{height:72%}.code-peek-project{display:none}.code-peek-tabs>span{padding:5px 6px;font-size:9px}.code-peek-footer{padding:5px 7px;font-size:8px}.code-peek-footer strong{font-size:9px}.code-peek-body>code{font-size:10px;inset:5px 0 auto}}
.code-peek{background:rgb(18 18 18 / 40%);backdrop-filter:blur(12px) saturate(.85);-webkit-backdrop-filter:blur(12px) saturate(.85);box-shadow:0 8px 24px rgb(0 0 0 / 28%);text-shadow:0 1px 3px rgb(0 0 0 / 65%)}.code-peek-project,.code-peek-tabs,.code-peek-footer{background:transparent}.code-peek-tabs .active{background:rgb(255 255 255 / 6%)}
.thumbnail[data-preview-shape=landscape] .code-peek{inset:auto 8px 8px auto;width:50%;height:50%;border-radius:9px;box-shadow:0 6px 20px rgb(0 0 0 / 28%);transform-origin:bottom right;transform:translate(6px,6px)}
.thumbnail[data-preview-shape=landscape] .code-peek-project{display:none}.thumbnail[data-preview-shape=landscape] .code-peek-tabs>span{flex:1;padding:5px 3px;font-size:0;text-align:center}.thumbnail[data-preview-shape=landscape] .code-peek-tabs i{display:none}.thumbnail[data-preview-shape=landscape] .code-peek-tabs>span::after{font-size:8px;content:'HTML'}.thumbnail[data-preview-shape=landscape] .code-peek-tabs>span:nth-child(2)::after{content:'CSS'}.thumbnail[data-preview-shape=landscape] .code-peek-tabs>span:nth-child(3)::after{content:'JS'}
.thumbnail[data-preview-shape=landscape] .code-peek-body>code{font-size:9px;line-height:1.5;inset:5px 0 auto}.thumbnail[data-preview-shape=landscape] .peek-line>b{flex-basis:18px;padding-right:4px}.thumbnail[data-preview-shape=landscape] .code-peek-footer{padding:4px 6px;gap:2px;flex-direction:column;align-items:flex-start;font-size:7px}.thumbnail[data-preview-shape=landscape] .code-peek-footer strong{font-size:8px}
.card-link:is(.is-code-hover,:focus-visible) .code-peek{transform:translate(0,0)}
@media(prefers-reduced-motion:reduce){.thumbnail[data-preview-shape=landscape] .code-peek{transform:none}}
@media(prefers-reduced-transparency:reduce){.code-peek{background:#121212;backdrop-filter:none;-webkit-backdrop-filter:none}}


/* Phone filters and media controls remain easy to tap without focus zoom. */
@media (max-width: 639px) {
  .source-filters button, .filter-options select, .pagination button, .source-link { min-height: 44px; }
  .filter-bar { flex-wrap: wrap; gap: 12px; }
  .source-filters { width: 100%; }
  .filter-options { margin-left: auto; }
  .filter-options select { max-width: 180px; font-size: 16px; }
  .search-form input { font-size: 16px; }
  .search-form .button { min-height: 44px; }
  .video-toggle { width: 44px; height: 44px; }
  .detail-toolbar .icon-button { min-width: 44px; min-height: 44px; }
  .detail-info { padding-inline: 20px; }
}

.code-preview{position:relative}.code-preview-login{position:absolute;inset:35px 14px 0;display:flex;align-items:center;justify-content:center;text-align:center;color:#b9beca;font-size:12px;font-weight:500;letter-spacing:.03em;text-shadow:0 1px 10px #000;pointer-events:none}

/* Prompt collection labels stay above moving previews. */
.prompt-tag{position:absolute;top:12px;left:12px;z-index:2;display:inline-flex;align-items:center;padding:6px 10px;border-radius:6px;background:linear-gradient(125deg,#f5df9d,#d9ae50);color:#392907;font-size:10px;font-weight:800;line-height:1.2;letter-spacing:.09em;box-shadow:0 2px 8px #0003;pointer-events:none}.is-prompt>.video-toggle{left:auto;right:10px}

/* Visible exit for visitors arriving directly from an ad, including phones. */
.gallery-return-link{display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:0 14px;border-radius:999px;background:var(--surface,#242424);color:inherit;text-decoration:none;font-size:13px;font-weight:600;line-height:1.4}
.gallery-return-link svg{width:16px;height:16px;flex:none}
.gallery-return-link:hover{filter:brightness(1.15)}
.gallery-return-link:focus-visible{outline:2px solid currentColor;outline-offset:3px}

.gallery-brand-phone{display:none}
@media(max-width:639px){.gallery-brand-wide{display:none}.gallery-brand-phone{display:inline}}

/* Header exit sits immediately before the menu control. */
.gallery-return-link{white-space:nowrap}
.mobile-menu{transform-origin:top right}
.menu-toggle path{transform-origin:12px 12px;transition:transform 240ms cubic-bezier(.22,1,.36,1),opacity 160ms}
.menu-toggle[aria-expanded=true] .menu-line-top{transform:translateY(6px) rotate(45deg);transform-origin:12px 6px}
.menu-toggle[aria-expanded=true] .menu-line-middle{opacity:0}
.menu-toggle[aria-expanded=true] .menu-line-bottom{transform:translateY(-6px) rotate(-45deg);transform-origin:12px 18px}
@media(max-width:639px){.site-header{gap:4px}.header-actions{gap:4px}.gallery-return-link{gap:4px;padding:0 8px;font-size:10px;white-space:normal;max-width:94px}.gallery-return-link svg{width:12px;height:12px}.menu-toggle{width:36px;min-height:44px}}
@media(max-width:359px){.header-start{gap:4px}.current-page{font-size:16px}.gallery-return-link{max-width:76px;padding:0 6px}}

/* Shared lettering from the homepage OpenGallery wordmark. */
.open-gallery-wordmark{display:block;height:auto;fill:currentColor}
.current-page .open-gallery-wordmark{width:142px}
.gallery-intro h1 .open-gallery-wordmark{width:clamp(220px,25vw,310px)}
@media(max-width:639px){.current-page .open-gallery-wordmark{width:118px}}

/* Keep every header item on one shared center line. */
.site-header .brand,.site-header .current-page,.site-header .main-nav>a,.site-header .header-actions>a{align-items:center;justify-content:center;height:40px;min-height:40px;padding-block:0;line-height:1}
.site-header .brand svg{display:block}
.gallery-intro.gallery-intro-compact{align-items:flex-start;justify-content:center;min-height:360px;padding:80px var(--page-inset);text-align:left}
.gallery-intro-compact .hero-description{max-width:56ch;margin-top:18px;font-size:16px;line-height:1.8}
@media(max-width:639px){.gallery-intro.gallery-intro-compact{min-height:240px;padding:52px var(--page-inset)}.gallery-intro-compact .hero-description{font-size:14px}}
.gallery-intro #gallery-title{display:flex;align-items:center;justify-content:flex-start;line-height:1}
.site-header .current-page,.site-header .main-nav>a{display:inline-flex}

/* Public excerpts: readable real code, no login overlay. */
.code-excerpt{min-width:0;border-radius:14px;background:#191a1f;color:#c7cbd4;padding:16px}.code-excerpt[hidden]{display:none}.excerpt-heading{margin:0 0 12px;font-size:12px;color:#e5e7eb}.excerpt-tabs{display:flex;gap:8px;margin-bottom:12px}.excerpt-tabs button{border:0;background:transparent;color:#aeb4c0;border-radius:6px;padding:6px 10px;cursor:pointer;font:12px ui-monospace,monospace}.excerpt-tabs button[aria-pressed="true"]{background:#30333d;color:white}.code-excerpt pre{margin:0;max-height:340px;overflow:auto;font:12px/1.7 ui-monospace,SFMono-Regular,Menlo,monospace;tab-size:2}.code-excerpt code{font:inherit}.excerpt-note{margin:12px 0 0;color:#aeb4c0;font-size:11px;overflow-wrap:anywhere}.code-excerpt :focus-visible{outline:2px solid #a6baff;outline-offset:3px}

/* Compact editor: format source to fit, without nested scrollbars. */
.code-excerpt{padding:0;background:#17191f;color:#cbd2df;border-radius:14px;box-shadow:none;overflow:hidden}.excerpt-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:0;padding:16px 16px 12px;background:transparent;font:500 11px/1.4 system-ui;color:#aab2c2}.excerpt-live-label{font:9px/1.4 ui-monospace,monospace;letter-spacing:.12em;color:#667084}.excerpt-tabs{gap:16px;margin:0 16px;padding:0;background:transparent}.excerpt-tabs button{border-radius:0;padding:9px 0;color:#707b8f;display:flex;gap:6px;align-items:center;font:11px ui-monospace,monospace;box-shadow:none}.excerpt-tabs button[aria-pressed="true"]{background:transparent;color:#e5e9f2;box-shadow:inset 0 -2px #86a9f9}.excerpt-file-icon{color:#d7ba7d;font-size:9px}.excerpt-tabs button:first-child .excerpt-file-icon{color:#86b9ee;font-size:13px}.code-excerpt pre{padding:16px 14px 0 10px;margin:0;height:276px;max-height:none;overflow:hidden;white-space:pre-wrap;font:11.5px/1.85 Consolas,'Cascadia Code',ui-monospace,monospace;mask-image:linear-gradient(#000 0%,#000 85%,transparent 100%)}.excerpt-line{display:flex;min-width:0}.excerpt-line-number{flex:0 0 22px;padding-right:10px;text-align:right;user-select:none;color:#4d576b;font-size:10px}.excerpt-line-text{min-width:0;white-space:pre-wrap;overflow-wrap:anywhere;flex:1;padding-right:0}.code-excerpt .token-property{color:#9fc4e6}.code-excerpt .token-string{color:#d5b58e}.code-excerpt .token-number{color:#b4c99b}.code-excerpt .token-keyword{color:#c4a7df}.code-excerpt .token-comment{color:#7d899f}.code-excerpt .token-punctuation{color:#8996ad}.excerpt-note{margin:0;padding:12px 16px 14px;background:transparent;color:#778299;font:10px/1.5 system-ui;overflow-wrap:anywhere}.code-excerpt :focus-visible{outline-offset:-2px}
/* Keep public navigation hover behavior consistent with the homepage. */
.site-header :is(.main-nav, .mobile-menu) a {
  opacity: 1; transition: color 150ms cubic-bezier(0, 0, .2, 1) !important;
}
.site-header :is(.main-nav, .mobile-menu) a::after { content: none; }
@media (hover: hover) {
  .site-header :is(.main-nav, .mobile-menu) a:hover {
    color: #707070; opacity: .8; background: transparent; text-decoration: none;
  }
}

/* Retain production sorting alongside the current gallery UI. */
.gallery-sort{display:flex;align-items:center;gap:8px;margin-left:auto;white-space:nowrap;font-size:13px}.gallery-sort select{font:inherit;color:inherit;background:var(--surface,#242424);border:0;border-radius:20px;padding:10px 14px}.filter-bar{flex-wrap:wrap;gap:12px}

/* Keep gallery filters and native sorting compact, with a dedicated arrow gutter. */
.filter-bar { flex-wrap:nowrap; gap:12px; margin-top:0; margin-bottom:12px; }
.source-filters { flex:1 1 0; width:auto; min-width:0; gap:4px; padding-block:2px; }
.source-filters button { min-height:32px; height:32px; padding:6px 12px; font-size:13px; line-height:20px; }
.gallery-sort { display:flex; align-items:center; flex:0 0 auto; gap:6px; margin-left:auto; white-space:nowrap; font-size:12px; }
.gallery-sort select {
  appearance:none; -webkit-appearance:none; box-sizing:border-box;
  border:0; border-radius:999px; background-color:var(--surface,#242424); color:var(--ink);
  height:32px; min-height:32px; min-width:104px; margin:0;
  padding:0 32px 0 12px; font:inherit; line-height:normal;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23999999' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 10px center; background-size:16px;
  cursor:pointer;
}
.gallery-sort select:focus-visible { outline:2px solid var(--ink); outline-offset:2px; }
.gallery-intro { padding-top:36px; padding-bottom:24px; }
.hero-description { margin-bottom:12px; }
@media(max-width:639px) {
  .filter-bar { gap:8px; }
  .source-filters button { padding-inline:10px; font-size:12px; }
  .gallery-sort { font-size:12px; }
  .gallery-intro { padding-top:28px; padding-bottom:20px; }
}
@media(pointer:coarse) {
  .source-filters button, .gallery-sort select { min-height:44px; }
}

/* Gallery sorting uses the same rounded, blurred menu surface as library sorting. */
.gallery-sort { position:relative; }
.gallery-sort select[hidden] { display:none; }
.gallery-sort-trigger { display:flex; align-items:center; justify-content:space-between; gap:12px; min-width:104px; height:32px; padding:0 12px; border-radius:999px; background:var(--surface); color:var(--ink); font:inherit; }
.gallery-sort-trigger::after { content:''; width:6px; height:6px; border-right:1.5px solid currentColor; border-bottom:1.5px solid currentColor; transform:rotate(45deg) translateY(-2px); transition:transform 180ms ease; }
.gallery-sort-trigger[aria-expanded=true]::after { transform:rotate(225deg) translate(-2px,-1px); }
.gallery-sort-menu { position:absolute; z-index:85; top:calc(100% + 8px); right:0; width:180px; padding:8px; border-radius:20px; background:rgba(255,255,255,.96); backdrop-filter:blur(24px); -webkit-backdrop-filter:blur(24px); box-shadow:0 12px 80px rgba(0,0,0,.16); transform-origin:top right; }
.gallery-sort-menu[hidden] { display:none; }
.gallery-sort-menu button { display:flex; align-items:center; justify-content:space-between; width:100%; height:36px; padding:0 10px; border-radius:12px; background:transparent; color:var(--ink); font:inherit; font-size:14px; font-weight:600; }
.gallery-sort-menu button[aria-checked=true]::after { content:'✓'; }
.gallery-sort-menu button:hover, .gallery-sort-menu button:focus-visible { background:var(--hover); outline:none; }
/* Align the first filter's text with the count and card grid. */
.source-filters { margin-left:-12px; }
@media(max-width:639px) { .source-filters { margin-left:-10px; } }
@media(pointer:coarse) { .gallery-sort-trigger, .gallery-sort-menu button { min-height:44px; } }
@media(prefers-reduced-motion:reduce) { .gallery-sort-trigger::after { transition:none; } }
/* 「しくみを読み解く」 under an Open Gallery item. Uses the gallery's own tokens. */
.how-built{grid-column:1/-1;display:grid;gap:28px;padding:40px 48px 48px;border-top:1px solid rgba(255,255,255,.08);color:var(--ink)}
.how-built h3{margin:0;font-size:12px;font-weight:600;letter-spacing:.08em;color:var(--muted)}
.how-built h4{margin:0 0 8px;font-size:14px;font-weight:600;line-height:1.5}
.how-built p{margin:0}
.how-built-lead{max-width:34em;font-size:20px;line-height:1.7;font-weight:600}
.how-built-steps{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin:0;padding:0;list-style:none;counter-reset:step}
.how-built-steps li{counter-increment:step;padding:20px;border-radius:12px;background:var(--page)}
.how-built-steps li::before{content:counter(step);display:block;margin-bottom:12px;font-size:12px;font-weight:600;color:var(--muted)}
.how-built-show{margin-top:14px;padding:0;border:0;background:none;color:var(--ink);font:inherit;font-size:12px;font-weight:600;text-decoration:underline;text-underline-offset:4px;cursor:pointer;min-height:44px}
.how-built-marker{position:absolute;z-index:2;display:flex;align-items:center;gap:8px;height:36px;margin:-18px 0 0 -18px;padding:0 14px 0 0;border:0;border-radius:18px;background:#161616;color:#fff;font:600 12px/1 var(--font);white-space:nowrap;cursor:pointer;box-shadow:0 0 0 0 rgba(255,255,255,.55);animation:how-built-ping 1.4s ease-out infinite}
.how-built-marker-left{flex-direction:row-reverse;padding:0 0 0 14px;transform:translateX(calc(-100% + 36px))}
.how-built-marker b{display:grid;place-items:center;width:36px;height:36px;border:2px solid #fff;border-radius:50%;box-sizing:border-box;font-size:14px}
@keyframes how-built-ping{to{box-shadow:0 0 0 22px rgba(255,255,255,0)}}
@media(prefers-reduced-motion:reduce){.how-built-marker{animation:none}}
.how-built-steps p,.how-built-points{font-size:13px;line-height:1.85;color:var(--muted)}
.how-built-group{max-width:44em}
.how-built-points{margin:0;padding-left:1.2em}
.how-built-prompt{display:grid;gap:12px;justify-items:start;padding:20px;border-radius:12px;background:var(--page)}
.how-built-prompt p{font-size:13px;line-height:1.85;user-select:text}
.how-built-checked{max-width:44em;font-size:12px;line-height:1.85;color:var(--muted)}
@media(max-width:820px){.how-built{padding:28px 20px 32px;gap:24px}.how-built-lead{font-size:17px}.how-built-steps{grid-template-columns:1fr}}

/* Light editorial introduction: work previews lead into the existing library. */
.gallery-intro.gallery-intro-compact{display:grid;grid-template-columns:minmax(0,1fr) 300px;align-items:center;gap:48px;min-height:260px;padding:32px var(--page-inset)}
.gallery-intro-copy{min-width:0}
.gallery-intro h1 .open-gallery-wordmark{width:230px}
.gallery-intro-compact .hero-description{max-width:58ch;margin:14px 0 4px;color:var(--muted);font-size:15px;line-height:1.9}
.gallery-intro-link{display:inline-flex;align-items:center;gap:12px;min-height:44px;font-size:13px;font-weight:550}
.gallery-intro-link:hover{text-decoration:underline;text-underline-offset:4px}
.gallery-promo{min-width:0;background:var(--surface);border-radius:16px;padding:8px;box-shadow:none}
.gallery-promo-preview{position:relative;isolation:isolate;height:70px;background:var(--surface);border-radius:10px;overflow:hidden}
.gallery-promo-preview img{position:absolute;top:28px;left:50%;width:46%;height:110px;object-fit:cover;object-position:top;border-radius:10px;box-shadow:0 4px 18px rgb(0 0 0 / .15)}
.gallery-promo-preview img:nth-child(1){transform:translateX(-112%) rotate(-9deg)}
.gallery-promo-preview img:nth-child(2){z-index:2;top:16px;transform:translateX(-50%)}
.gallery-promo-preview img:nth-child(3){transform:translateX(12%) rotate(9deg)}
.gallery-promo-copy{padding:12px 12px 4px}
.gallery-promo-label{margin:0 0 8px;color:var(--muted);font-size:10px;font-weight:600;letter-spacing:.12em}
.gallery-promo h2{margin:0;font-size:14px;font-weight:550;line-height:1.5;letter-spacing:-.035em}
.gallery-promo-copy>p:not(.gallery-promo-label){margin:6px 0 0;font-size:12px;line-height:1.8;color:var(--muted)}
.gallery-promo-link{display:flex;justify-content:space-between;align-items:center;gap:16px;min-height:44px;padding:6px 0;border-radius:6px;background:transparent;font-size:13px;font-weight:550}
.gallery-promo-link:hover{background:var(--hover)}
.thumbnail,.card-link{border-radius:14px}
.card-caption h2{font-size:14px;font-weight:550}
.card-meta{padding-top:12px}
.gallery-grid{column-gap:20px}
.detail-main{background:var(--surface)}
.how-built{border-top-color:rgb(0 0 0 / .08)}
.gallery-sort-menu button:focus-visible{outline:2px solid #655cff;outline-offset:-2px}
@media(min-width:640px) and (max-width:1100px){:root{--page-inset:28px}.gallery-intro.gallery-intro-compact{gap:28px;grid-template-columns:minmax(0,1fr) 280px}}
@media(max-width:760px){.gallery-intro.gallery-intro-compact{grid-template-columns:1fr;gap:20px;min-height:0;padding:28px var(--page-inset) 24px}.gallery-promo{max-width:460px;width:100%;display:grid;grid-template-columns:90px minmax(0,1fr);align-items:center;gap:12px}.gallery-promo-preview{height:100px}.gallery-intro-compact .hero-description{font-size:14px}.gallery-grid{column-gap:12px}}
@media(max-width:639px){:root{--page-inset:16px}.gallery-intro h1 .open-gallery-wordmark{width:210px}.gallery-promo-copy{padding:4px 4px 0}.card-caption h2{font-size:13px}.filter-bar{flex-wrap:wrap}.source-filters{flex-basis:100%}.gallery-sort{margin-left:auto}}

.detail-open .gallery-intro.gallery-intro-compact{display:none}

.gallery-intro-link::after,.gallery-promo-link::after{content:"→"}
.library-promo .hero-button{background:var(--primary);color:var(--on-primary)}

/* A quiet code action with a distinct glyph and a directional cue. */
.code-indicator{gap:8px;min-height:32px;padding:0 2px;background:transparent;border-radius:8px;font-size:11px;font-weight:550;color:#525252;transition:color 160ms ease}
.code-indicator svg{box-sizing:content-box;width:16px;height:16px;padding:7px;border-radius:9px;background:var(--surface);transition:background 160ms ease,color 160ms ease}
.code-indicator::after{content:"↗";font-size:14px;margin-left:2px;transition:transform 160ms ease}
@media(hover:hover) and (pointer:fine){.card-link .code-indicator:hover,.card-link.is-code-hover .code-indicator{background:transparent;color:var(--ink)}.card-link .code-indicator:hover svg,.card-link.is-code-hover .code-indicator svg{background:var(--ink);color:#fff}.code-indicator:hover::after{transform:translate(2px,-2px)}}
.card-link:focus-visible .code-indicator{color:var(--ink)}
@media(prefers-reduced-motion:reduce){.code-indicator,.code-indicator svg,.code-indicator::after{transition:none}.code-indicator:hover::after{transform:none}}

.gallery-code-dialog{width:min(420px,calc(100vw - 32px));box-sizing:border-box;padding:36px 28px 24px;border:0;border-radius:20px;background:#fff;color:#181818;box-shadow:0 24px 80px #0002}
.gallery-code-dialog::backdrop{background:#0005;backdrop-filter:blur(4px)}
.gallery-code-dialog h2{font-size:19px;margin:12px 0;line-height:1.5}.gallery-code-dialog p{font-size:13px;line-height:1.8;color:#666;margin:0 0 24px}
.gallery-code-dialog .button{width:100%;box-sizing:border-box}.code-dialog-close{position:absolute;right:8px;top:8px;width:44px;height:44px;background:transparent;font-size:24px;color:inherit}
.code-dialog-signin,.code-dialog-back{display:flex;align-items:center;justify-content:center;min-height:44px;width:100%;font:inherit;font-size:13px;color:inherit;background:transparent}.code-dialog-back{color:#666}

/* The shared header is fixed; keep detail controls below its hit area. */
.detail-open #gallery{padding-top:80px}
