/* ============================================================
   Web Design Lab — gallery shell
   The shell itself eats its own dogfood: glassmorphism, animated
   gradients, scroll-reveal, micro-interactions, light/dark theming.
   ============================================================ */

:root {
  --bg: #0b0d12;
  --bg-2: #11141c;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-2: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #eef1f7;
  --muted: #97a0b3;
  --muted-2: #6b7488;
  --accent: #7c5cff;
  --accent-2: #2bd1c4;
  --accent-3: #ff5c93;
  --ring: rgba(124, 92, 255, 0.55);
  --shadow: 0 18px 50px -20px rgba(0, 0, 0, 0.65);
  --radius: 16px;
  --radius-sm: 10px;
  --header-h: 64px;
  --maxw: 1320px;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: 'Inter', 'Noto Sans JP', system-ui, -apple-system, sans-serif;
}

html[data-theme='light'] {
  --bg: #f4f6fb;
  --bg-2: #eaeef6;
  --surface: rgba(15, 23, 42, 0.03);
  --surface-2: rgba(15, 23, 42, 0.06);
  --border: rgba(15, 23, 42, 0.10);
  --border-strong: rgba(15, 23, 42, 0.18);
  --text: #141a26;
  --muted: #54607a;
  --muted-2: #7a849c;
  --shadow: 0 18px 50px -24px rgba(20, 30, 60, 0.35);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ambient background blobs */
body::before {
  content: "";
  position: fixed;
  inset: -20vmax;
  z-index: -2;
  background:
    radial-gradient(40vmax 40vmax at 12% 8%, rgba(124, 92, 255, 0.20), transparent 60%),
    radial-gradient(38vmax 38vmax at 88% 16%, rgba(43, 209, 196, 0.16), transparent 60%),
    radial-gradient(46vmax 46vmax at 50% 100%, rgba(255, 92, 147, 0.14), transparent 60%);
  filter: blur(8px);
  animation: drift 26s ease-in-out infinite alternate;
}
@keyframes drift {
  0%   { transform: translate3d(0,0,0) scale(1); }
  100% { transform: translate3d(0,-3%,0) scale(1.06); }
}

::selection { background: var(--ring); color: #fff; }

a { color: inherit; text-decoration: none; }

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  background: color-mix(in srgb, var(--bg) 62%, transparent);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  height: var(--header-h);
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.brand { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 8px;
  background: conic-gradient(from 180deg, var(--accent), var(--accent-2), var(--accent-3), var(--accent));
  box-shadow: 0 0 0 1px var(--border-strong), 0 6px 18px -6px var(--ring);
  animation: spinmark 9s linear infinite;
}
@keyframes spinmark { to { filter: hue-rotate(360deg); } }
.brand-text { font-weight: 700; letter-spacing: .2px; font-size: 16px; }
.brand-text b { color: var(--accent-2); }

.search-wrap {
  flex: 1 1 auto;
  max-width: 520px;
  margin: 0 auto;
  position: relative;
  display: flex;
  align-items: center;
}
.search-ico {
  position: absolute; left: 12px; width: 18px; height: 18px; color: var(--muted);
  pointer-events: none;
}
#search {
  width: 100%;
  height: 42px;
  padding: 0 40px 0 38px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
#search:focus { border-color: var(--ring); box-shadow: 0 0 0 4px rgba(124,92,255,.16); background: var(--surface-2); }
.search-kbd {
  position: absolute; right: 10px;
  font: 600 12px var(--mono);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 6px; padding: 1px 7px; background: var(--surface);
}

.header-actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.stat-pill {
  font-size: 12.5px; font-weight: 600; color: var(--muted);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 6px 12px; white-space: nowrap;
  background: var(--surface);
}
.icon-btn {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: transform .15s, background .2s, border-color .2s;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--border-strong); transform: translateY(-1px); }
.icon-btn svg { width: 20px; height: 20px; }
.ico-moon { display: none; }
html[data-theme='light'] .ico-sun { display: none; }
html[data-theme='light'] .ico-moon { display: block; }

/* ===== Hero ===== */
.hero { position: relative; overflow: hidden; }
.hero-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 74px 20px 46px;
  text-align: center;
}
.hero-kicker {
  font: 600 12px/1 var(--mono);
  letter-spacing: 2.5px;
  color: var(--accent-2);
  margin: 0 0 18px;
}
.hero-title {
  font-size: clamp(30px, 6vw, 64px);
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
}
.grad {
  background: linear-gradient(100deg, var(--accent), var(--accent-2) 55%, var(--accent-3));
  background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: shine 6s linear infinite;
}
.grad2 { background-image: linear-gradient(100deg, var(--accent-3), var(--accent), var(--accent-2)); }
@keyframes shine { to { background-position: 200% center; } }
.hero-sub {
  max-width: 640px; margin: 0 auto 26px;
  color: var(--muted); font-size: clamp(14px, 1.6vw, 17px);
}
.hero-sub b { color: var(--text); }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn {
  font: inherit; font-weight: 600; font-size: 14.5px;
  padding: 12px 22px; border-radius: 999px; cursor: pointer;
  border: 1px solid transparent; transition: transform .15s, box-shadow .25s, background .2s;
}
.btn-primary {
  color: #fff;
  background: linear-gradient(100deg, var(--accent), var(--accent-3));
  box-shadow: 0 10px 30px -10px var(--ring);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 36px -10px var(--ring); }
.btn-ghost {
  color: var(--text); background: var(--surface); border-color: var(--border);
}
.btn-ghost:hover { background: var(--surface-2); transform: translateY(-2px); }

.hero-marquee {
  margin-top: 40px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  overflow: hidden;
}
.marquee-track {
  display: flex; gap: 10px; width: max-content;
  animation: marquee 38s linear infinite;
}
.hero-marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }
.marquee-chip {
  font: 500 13px var(--mono); color: var(--muted);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 7px 14px; background: var(--surface); white-space: nowrap;
}

/* ===== Filters ===== */
.filters {
  position: sticky; top: var(--header-h); z-index: 40;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  border-bottom: 1px solid var(--border);
}
.filters-inner {
  max-width: var(--maxw); margin: 0 auto;
  padding: 12px 20px;
  display: flex; gap: 8px; overflow-x: auto;
  scrollbar-width: none;
}
.filters-inner::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  font: 600 13px var(--sans);
  color: var(--muted);
  padding: 8px 15px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
  cursor: pointer; white-space: nowrap;
  transition: color .2s, background .2s, border-color .2s, transform .12s;
}
.chip:hover { color: var(--text); border-color: var(--border-strong); transform: translateY(-1px); }
.chip .c-count { opacity: .6; margin-left: 6px; font-family: var(--mono); font-size: 11px; }
.chip.active {
  color: #fff; border-color: transparent;
  background: linear-gradient(100deg, var(--accent), var(--accent-3));
  box-shadow: 0 8px 20px -10px var(--ring);
}

/* ===== Showcase (example sites) — full-width tinted band ===== */
.showcase {
  background:
    radial-gradient(90% 75% at 50% -10%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%),
    var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: clamp(48px, 6vw, 84px) clamp(20px, 5vw, 54px) clamp(58px, 7vw, 104px);
  margin-bottom: 18px;
}
.sc-head, .showcase-grid { max-width: var(--maxw); margin-left: auto; margin-right: auto; }
.sc-head { margin-bottom: 26px; }
.sc-en { font: 800 13px var(--mono); letter-spacing: .28em; text-transform: uppercase; color: var(--accent-3); }
.sc-title { font-size: clamp(22px, 3.4vw, 34px); font-weight: 800; letter-spacing: -.01em; margin: 8px 0 8px; }
.sc-title b { background: linear-gradient(100deg, var(--accent), var(--accent-3)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sc-lead { color: var(--muted); font-size: 14px; max-width: 64ch; margin: 0; }
.showcase-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 24px; }
.sc-card { display: block; border: 1px solid var(--border); border-radius: 16px; overflow: hidden; background: var(--surface);
  transition: transform .25s cubic-bezier(.2,.7,.2,1), border-color .25s, box-shadow .3s; }
.sc-card:hover { transform: translateY(-6px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.sc-frame { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: #0e1118; }
.sc-iframe { position: absolute; top: 0; left: 0; width: 1280px; height: 800px; border: 0; pointer-events: none;
  transform-origin: top left; transform: scale(.305); background: #0e1118; }
.sc-frame::after { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 -50px 50px -40px rgba(0,0,0,.5), inset 0 0 0 1px rgba(255,255,255,.04); }
.sc-badge { position: absolute; top: 12px; left: 12px; z-index: 2; font: 800 11px var(--mono); letter-spacing: .14em; color: #fff; padding: 5px 12px; border-radius: 99px; }
.sc-idol { background: linear-gradient(100deg, #ff5c93, #ff4d8d); }
.sc-saas { background: linear-gradient(100deg, #4f7cff, #8b5cf6); }
.sc-cafe { background: linear-gradient(100deg, #c98a3b, #7a8a5a); }
.sc-info { padding: 16px 18px 18px; }
.sc-info h3 { font-size: 17px; margin: 0 0 3px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.sc-info h3 span { font-size: 11px; font-weight: 500; color: var(--muted); }
.sc-info > p { color: var(--muted); font-size: 13.5px; margin: 0 0 11px; font-family: var(--mono); }
.sc-tech { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 13px; padding: 0; }
.sc-tech li { font: 500 11px var(--mono); color: var(--accent-2); border: 1px solid var(--border); border-radius: 6px; padding: 2px 8px; }
.sc-open { font: 700 13px var(--sans); color: var(--accent); }
.sc-card:hover .sc-open { text-decoration: underline; }
@media (max-width: 860px) { .showcase-grid { grid-template-columns: 1fr; } }

/* ===== Gallery grid ===== */
.gallery { max-width: var(--maxw); margin: 0 auto; padding: 28px 20px 60px; }
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
}
.card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  cursor: pointer;
  transition: transform .22s cubic-bezier(.2,.7,.2,1), border-color .22s, box-shadow .25s;
  opacity: 0; transform: translateY(14px);
}
.card.in { opacity: 1; transform: none; }
.card:hover {
  transform: translateY(-6px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}
.card:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.card-stage {
  position: relative;
  height: 380px;
  background:
    linear-gradient(var(--surface-2), var(--surface-2)),
    repeating-conic-gradient(rgba(127,127,127,.10) 0 25%, transparent 0 50%) 0 0 / 22px 22px;
  overflow: hidden;
}
.card-stage iframe {
  width: 100%; height: 100%; border: 0; display: block;
  background: #fff;
}
html[data-theme='dark'] .card-stage iframe { background: #0e1118; }
.card-stage .ph {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--muted-2); font: 500 13px var(--mono);
}
.card-stage .ph .spin {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--border-strong); border-top-color: var(--accent);
  animation: cspin .8s linear infinite; margin-bottom: 8px;
}
@keyframes cspin { to { transform: rotate(360deg); } }
.card-stage::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  box-shadow: inset 0 -40px 40px -30px rgba(0,0,0,.4);
}
.card-body { padding: 18px 20px 20px; }
.card-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.card-cat { font: 600 12px var(--mono); color: var(--accent-2); letter-spacing: .3px; }
.card-title { font-weight: 700; font-size: 18px; margin: 0 0 6px; }
.card-desc {
  color: var(--muted); font-size: 14px; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-tags { margin-top: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.tag {
  font: 500 11px var(--mono); color: var(--muted);
  border: 1px solid var(--border); border-radius: 6px; padding: 2px 7px;
  background: var(--surface);
}
.badge-diff {
  margin-left: auto;
  font: 600 11px var(--sans); padding: 2px 9px; border-radius: 999px;
  border: 1px solid var(--border);
}
.diff-初級 { color: #5fd38a; border-color: rgba(95,211,138,.4); }
.diff-中級 { color: #ffc45f; border-color: rgba(255,196,95,.4); }
.diff-上級 { color: #ff7b9c; border-color: rgba(255,123,156,.4); }

.empty { text-align: center; color: var(--muted); padding: 60px 0; }

/* crawlable full index (HTML sitemap) */
.index-map { margin-top: 56px; padding-top: 30px; border-top: 1px solid var(--border); }
.index-map > h2 { font-size: 22px; margin: 0 0 6px; }
.index-map .im-note { color: var(--muted); font-size: 13.5px; margin: 0 0 22px; }
.im-cat { margin-bottom: 22px; }
.im-cat h3 { font-size: 16px; margin: 0 0 8px; }
.im-cat h3 a { color: var(--accent-2); }
.im-cat h3 a:hover { text-decoration: underline; }
.im-cat h3 span { color: var(--muted-2); font: 500 12px var(--mono); }
.im-cat ul { margin: 0; padding-left: 18px; columns: 2; column-gap: 32px; }
.im-cat li { font-size: 13px; color: var(--muted); margin-bottom: 7px; break-inside: avoid; }
.im-cat li a { color: var(--text); font-weight: 600; }
.im-cat li a:hover { color: var(--accent-2); }
@media (max-width: 640px) { .im-cat ul { columns: 1; } }

/* homepage: compact category links + link to the full list page */
.cat-links { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.cat-links a {
  font: 600 13.5px var(--sans); color: var(--text);
  border: 1px solid var(--border); border-radius: 999px; padding: 9px 16px; background: var(--surface);
  transition: border-color .15s, background .15s, transform .12s;
}
.cat-links a:hover { border-color: var(--border-strong); background: var(--surface-2); transform: translateY(-1px); }
.cat-links a span { color: var(--muted-2); font-family: var(--mono); font-size: 11px; margin-left: 4px; }
.all-link { margin: 4px 0 0; }
.all-link a { font-weight: 700; color: var(--accent-2); font-size: 15px; }
.all-link a:hover { text-decoration: underline; }

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--border);
  text-align: center; padding: 30px 20px 50px;
  color: var(--muted); font-size: 13px;
}
.site-footer .muted { color: var(--muted-2); font-size: 12px; }

/* ===== Modal ===== */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(4, 6, 12, 0.62);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: fade .2s ease;
}
@keyframes fade { from { opacity: 0; } }
.modal-card {
  position: relative;
  width: min(1180px, 96vw);
  max-height: 92vh;
  display: flex; flex-direction: column;
  border-radius: 20px;
  border: 1px solid var(--border-strong);
  background: var(--bg-2);
  box-shadow: 0 40px 90px -30px rgba(0,0,0,.7);
  overflow: hidden;
  animation: pop .26s cubic-bezier(.2,.8,.2,1);
}
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.98); } }
.modal-head {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 18px 20px; border-bottom: 1px solid var(--border);
}
.modal-meta { min-width: 0; }
.modal-meta h2 { margin: 8px 0 4px; font-size: 20px; }
.modal-meta p { margin: 0; color: var(--muted); font-size: 14px; }
.badge {
  display: inline-block; font: 600 11px var(--mono);
  color: var(--accent-2); letter-spacing: .3px;
}
.tagrow { margin-top: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.modal-close { flex: 0 0 auto; margin-left: auto; }

.modal-body {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  min-height: 0; flex: 1 1 auto;
}
.preview-pane { display: flex; flex-direction: column; min-width: 0; border-right: 1px solid var(--border); }
.preview-toolbar {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.dots { display: flex; gap: 6px; }
.dots i { width: 11px; height: 11px; border-radius: 50%; background: var(--border-strong); }
.dots i:nth-child(1){ background:#ff5f57;} .dots i:nth-child(2){ background:#febc2e;} .dots i:nth-child(3){ background:#28c840;}
.vp-buttons { display: flex; gap: 4px; margin: 0 auto; }
.vp-buttons button, .mini-btn {
  font: 600 12px var(--sans); color: var(--muted);
  border: 1px solid var(--border); background: var(--surface);
  border-radius: 8px; padding: 5px 10px; cursor: pointer;
  transition: color .15s, background .15s, border-color .15s;
}
.vp-buttons button.active { color: #fff; background: linear-gradient(100deg,var(--accent),var(--accent-3)); border-color: transparent; }
.vp-buttons button:hover, .mini-btn:hover { color: var(--text); border-color: var(--border-strong); }
.preview-actions { display: flex; gap: 6px; }
.preview-stage {
  flex: 1 1 auto; min-height: 320px;
  display: grid; place-items: center;
  padding: 16px;
  background:
    repeating-conic-gradient(rgba(127,127,127,.08) 0 25%, transparent 0 50%) 0 0 / 24px 24px;
  overflow: auto;
}
#previewFrame {
  width: 100%; height: 100%; min-height: 300px;
  border: 1px solid var(--border); border-radius: 12px;
  background: #fff;
  transition: width .3s ease;
  box-shadow: var(--shadow);
}

.code-pane { display: flex; flex-direction: column; min-width: 0; background: var(--bg); }
.tabs { display: flex; gap: 4px; padding: 10px 12px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.tab {
  font: 600 12.5px var(--mono); color: var(--muted);
  padding: 8px 14px; cursor: pointer;
  border: 1px solid transparent; border-bottom: none;
  border-radius: 9px 9px 0 0; background: transparent;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); background: var(--surface-2); border-color: var(--border); }
.tab .t-lines { opacity: .5; margin-left: 6px; font-size: 11px; }
.tab[data-k="ai"] { color: var(--accent-2); }
.tab[data-k="ai"].active { background: color-mix(in srgb, var(--accent) 16%, transparent); border-color: var(--border-strong); }
.code-scroll code.wrap { white-space: pre-wrap; word-break: break-word; }
.code-scroll { position: relative; flex: 1 1 auto; overflow: auto; }
.code-scroll pre { margin: 0; }
.code-scroll code { font: 13px/1.65 var(--mono); padding: 16px 18px; display: block; background: transparent !important; }
.copy-btn {
  position: sticky; float: right; top: 10px; right: 10px; margin: 10px 10px 0 0;
  z-index: 2;
  font: 600 12px var(--sans); color: var(--text);
  border: 1px solid var(--border-strong); background: var(--surface-2);
  border-radius: 8px; padding: 6px 12px; cursor: pointer;
  transition: background .15s;
}
.copy-btn:hover { background: var(--accent); color: #fff; border-color: transparent; }
.copy-btn.done { background: var(--accent-2); color: #04201d; border-color: transparent; }

/* scrollbars */
.code-scroll::-webkit-scrollbar, .preview-stage::-webkit-scrollbar { width: 10px; height: 10px; }
.code-scroll::-webkit-scrollbar-thumb, .preview-stage::-webkit-scrollbar-thumb {
  background: var(--border-strong); border-radius: 10px;
}

/* ===== Toast ===== */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
  background: var(--bg-2); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: 12px;
  padding: 11px 18px; font-size: 13.5px; font-weight: 600;
  box-shadow: var(--shadow); opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s; z-index: 200;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== Responsive ===== */
@media (max-width: 880px) {
  .modal-body { grid-template-columns: 1fr; }
  .preview-pane { border-right: none; border-bottom: 1px solid var(--border); }
  .preview-stage { min-height: 260px; }
  .search-kbd { display: none; }
  .stat-pill { display: none; }
}
@media (max-width: 560px) {
  .brand-text { display: none; }
  .hero-inner { padding-top: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* one column on narrow screens */
@media (max-width: 760px) {
  .grid { grid-template-columns: 1fr; }
  .card-stage { height: 320px; }
}

/* ============================================================
   Builder — select techniques (max 5) → compose a dummy site
   ============================================================ */
.pick-btn {
  position: absolute; top: 12px; right: 12px; z-index: 3;
  width: 38px; height: 38px; border-radius: 11px;
  display: grid; place-items: center;
  border: 1px solid var(--border-strong);
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  color: var(--text); cursor: pointer; font-size: 20px; line-height: 1;
  transition: transform .15s, background .2s, color .2s, border-color .2s;
}
.pick-btn:hover { transform: scale(1.08); border-color: var(--accent); }
.pick-btn svg { width: 20px; height: 20px; }
.card.picked { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent), var(--shadow); }
.card.picked .pick-btn {
  background: linear-gradient(100deg, var(--accent), var(--accent-3));
  color: #fff; border-color: transparent;
}

/* modal action row: open individual page + add to site */
.modal-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.page-link-btn {
  font: 600 13.5px var(--sans);
  padding: 9px 16px; border-radius: 10px; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--text);
  transition: background .2s, transform .12s;
}
.page-link-btn:hover { background: color-mix(in srgb, var(--accent) 28%, transparent); transform: translateY(-1px); }
.add-site-btn {
  font: 600 13.5px var(--sans);
  padding: 9px 16px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text);
  transition: background .2s, color .2s, border-color .2s;
}

/* 技法デモ / 使用例 トグル */
.view-toggle { display: inline-flex; margin-top: 12px; border: 1px solid var(--border); border-radius: 11px; overflow: hidden; background: var(--surface); }
.view-toggle[hidden] { display: none; }
.vt-btn {
  font: 600 13px var(--sans); color: var(--muted); background: transparent;
  border: none; padding: 9px 16px; cursor: pointer; white-space: nowrap;
  transition: color .15s, background .15s;
}
.vt-btn + .vt-btn { border-left: 1px solid var(--border); }
.vt-btn:hover { color: var(--text); }
.vt-btn.active { color: #fff; background: linear-gradient(100deg, var(--accent-2), var(--accent)); }
.add-site-btn:hover { border-color: var(--accent); }
.add-site-btn.on { background: linear-gradient(100deg, var(--accent), var(--accent-3)); color: #fff; border-color: transparent; }

/* selection tray (floating bottom bar) */
.tray {
  position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 140%);
  z-index: 90;
  width: min(960px, calc(100vw - 32px));
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px 12px 18px;
  border-radius: 18px;
  border: 1px solid var(--border-strong);
  background: color-mix(in srgb, var(--bg-2) 88%, transparent);
  backdrop-filter: blur(18px) saturate(150%); -webkit-backdrop-filter: blur(18px) saturate(150%);
  box-shadow: 0 24px 60px -20px rgba(0,0,0,.6);
  transition: transform .35s cubic-bezier(.2,.8,.2,1);
}
.tray.show { transform: translate(-50%, 0); }
.tray-label { font: 700 13px var(--sans); color: var(--text); white-space: nowrap; }
.tray-label b { color: var(--accent-2); font-family: var(--mono); }
.tray-chips { display: flex; gap: 8px; overflow-x: auto; flex: 1 1 auto; scrollbar-width: none; padding: 2px; }
.tray-chips::-webkit-scrollbar { display: none; }
.tray-chip {
  flex: 0 0 auto; display: flex; align-items: center; gap: 7px;
  font: 600 12.5px var(--sans); color: var(--text);
  border: 1px solid var(--border); background: var(--surface);
  border-radius: 999px; padding: 6px 8px 6px 13px; white-space: nowrap;
}
.tray-chip button {
  width: 18px; height: 18px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--surface-2); color: var(--muted); font-size: 13px; line-height: 1;
  display: grid; place-items: center;
}
.tray-chip button:hover { background: var(--accent-3); color: #fff; }
.tray-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.tray-clear {
  font: 600 13px var(--sans); color: var(--muted); cursor: pointer;
  background: none; border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px;
}
.tray-clear:hover { color: var(--text); border-color: var(--border-strong); }
.tray-build {
  font: 700 13.5px var(--sans); color: #fff; cursor: pointer;
  border: none; border-radius: 10px; padding: 10px 18px; white-space: nowrap;
  background: linear-gradient(100deg, var(--accent), var(--accent-3));
  box-shadow: 0 10px 24px -10px var(--ring);
}
.tray-build:hover { transform: translateY(-1px); }
.tray-build:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* builder result modal */
.builder { position: fixed; inset: 0; z-index: 110; display: grid; place-items: center; padding: 16px; }
.builder[hidden] { display: none; }
.builder-card {
  position: relative; width: min(1280px, 98vw); height: 94vh;
  display: flex; flex-direction: column;
  border-radius: 18px; overflow: hidden;
  border: 1px solid var(--border-strong); background: var(--bg-2);
  box-shadow: 0 40px 100px -30px rgba(0,0,0,.75);
  animation: pop .26s cubic-bezier(.2,.8,.2,1);
}
.builder-head {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px; border-bottom: 1px solid var(--border); flex: 0 0 auto;
}
.builder-head h2 { margin: 0; font-size: 17px; }
.builder-head .muted { color: var(--muted); font-size: 13px; }
.builder-head .spacer { flex: 1 1 auto; }
.builder-stage { flex: 1 1 auto; min-height: 0; background: var(--bg); }
.builder-stage iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.mini-btn.primary { color: #fff; background: linear-gradient(100deg, var(--accent), var(--accent-3)); border-color: transparent; }

@media (max-width: 760px) {
  .tray { bottom: 12px; gap: 10px; padding: 10px; }
  .tray-label { display: none; }
}

/* ============================================================
   Pager (30 per page)
   ============================================================ */
.pager {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-top: 36px;
}
.pager[hidden] { display: none; }
.pg-info { color: var(--muted); font: 500 13px var(--mono); }
.pg-btns { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.pg-btn {
  font: 600 13.5px var(--sans); color: var(--text); cursor: pointer; min-width: 42px;
  border: 1px solid var(--border); background: var(--surface);
  border-radius: 10px; padding: 9px 13px;
  transition: background .15s, border-color .15s, color .15s, transform .12s;
}
.pg-btn:hover:not(:disabled) { border-color: var(--border-strong); background: var(--surface-2); transform: translateY(-1px); }
.pg-btn.active { color: #fff; border-color: transparent; background: linear-gradient(100deg, var(--accent), var(--accent-3)); box-shadow: 0 8px 20px -10px var(--ring); }
.pg-btn:disabled { opacity: .4; cursor: not-allowed; }
