/* Diffusion Desk: no framework, system fonts, light/dark aware.
   Kept deliberately simple: plain flex/grid, no transforms, no blur, no clipped text. */
:root {
  --bg: #f5f5f8; --surface: #ffffff; --surface-2: #eeedf4; --text: #16141f; --muted: #555268;
  --border: #e1dfea; --shadow: 0 1px 3px rgb(20 16 40 / .08);
  --accent: #6a4cff; --link: #5236e6;
  --comfy: #d9f02a; --comfy-ink: #1d2100; --civitai: #1971c2; --civitai-ink: #fff; --red: #c92a2a; --red-ink: #fff; --models: #7048e8; --models-ink: #fff;
  --note-bg: #fff7e0; --note-border: #e0b23a; --note-text: #4d3b00;
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f0e15; --surface: #18171f; --surface-2: #23222d; --text: #ecebf3; --muted: #a8a5ba;
    --border: #2d2b3a; --shadow: 0 1px 3px rgb(0 0 0 / .5);
    --link: #ab9bff; --note-bg: #2a2412; --note-border: #8a6d1c; --note-text: #f3dc9b;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f0e15; --surface: #18171f; --surface-2: #23222d; --text: #ecebf3; --muted: #a8a5ba;
  --border: #2d2b3a; --shadow: 0 1px 3px rgb(0 0 0 / .5);
  --link: #ab9bff; --note-bg: #2a2412; --note-border: #8a6d1c; --note-text: #f3dc9b;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 var(--font); overflow-wrap: break-word; }
a { color: var(--link); }
img { max-width: 100%; height: auto; display: block; }
.wrap { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: 1.25rem; }
.skip { position: absolute; left: -999px; top: .5rem; z-index: 50; background: var(--surface); color: var(--text); padding: .5rem .9rem; border-radius: 8px; }
.skip:focus { left: .5rem; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- header ---------- */
.hero { color: #fff; background: #17132e linear-gradient(120deg, #2a1d6b 0%, #17132e 55%, #3a1430 100%); }
.hero-bg { display: none; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding-block: .9rem; }
.brand { display: inline-flex; align-items: center; gap: .55rem; min-width: 0; color: #fff; text-decoration: none; font-weight: 700; }
.brand span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logo { flex: none; display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 8px; font-weight: 800; background: linear-gradient(135deg, #7c5cff, #ff4d8d); }
.controls { flex: none; display: flex; align-items: center; gap: .5rem; }
.lang-switch { display: flex; border: 1px solid rgb(255 255 255 / .35); border-radius: 999px; overflow: hidden; }
.lang-switch a { display: block; min-width: 2.75rem; padding: .4rem .7rem; text-align: center; color: #fff; text-decoration: none; font-weight: 700; font-size: .85rem; line-height: 1.2; }
.lang-switch a + a { border-left: 1px solid rgb(255 255 255 / .35); }
.lang-switch a:hover { background: rgb(255 255 255 / .15); }
.lang-switch a[aria-current] { background: #fff; color: #1a1530; }
.icon-btn { display: grid; place-items: center; width: 2.3rem; height: 2.3rem; padding: 0; border-radius: 999px; cursor: pointer; color: #fff;
  background: transparent; border: 1px solid rgb(255 255 255 / .35); }
.icon-btn:hover { background: rgb(255 255 255 / .15); }
.icon-btn .i-sun { display: none; }
:root[data-theme="dark"] .icon-btn .i-sun { display: block; } :root[data-theme="dark"] .icon-btn .i-moon { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .icon-btn .i-sun { display: block; } :root:not([data-theme="light"]) .icon-btn .i-moon { display: none; } }
.hero-body { padding: 1.25rem 1.25rem 2rem; }
.kicker { margin: 0 0 .5rem; font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #c9bfff; }
.hero h1 { margin: 0; font-size: clamp(2rem, 6vw, 3.4rem); line-height: 1.1; font-weight: 800; letter-spacing: -.02em; color: #fff; }
.tagline { margin: .5rem 0 .9rem; font-size: clamp(1.02rem, 2.2vw, 1.25rem); color: rgb(255 255 255 / .88); max-width: 46ch; }
.meta { display: flex; flex-wrap: wrap; gap: .25rem .6rem; margin: 0; font-size: .88rem; color: rgb(255 255 255 / .75); }
.meta .dot { opacity: .5; }

/* ---------- filter tabs ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.5rem 0; }
.tab { font: 600 .92rem/1 var(--font); color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  padding: .55rem .9rem; cursor: pointer; display: inline-flex; align-items: center; gap: .45rem; }
.tab:hover { border-color: var(--muted); }
.tab .count { font-size: .75rem; padding: .1rem .4rem; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.tab[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }
.tab[aria-pressed="true"] .count { background: transparent; color: inherit; }
.tab-comfyui::before, .tab-civitai::before, .tab-civitai-red::before, .tab-models::before { content: ""; width: .6rem; height: .6rem; border-radius: 50%; }
.tab-comfyui::before { background: var(--comfy); box-shadow: 0 0 0 1px rgb(0 0 0 / .3); } .tab-civitai::before { background: var(--civitai); } .tab-civitai-red::before { background: var(--red); } .tab-models::before { background: var(--models); }
.noscript { padding: .8rem 1rem; border-radius: 10px; background: var(--surface-2); color: var(--muted); }

/* ---------- cards ---------- */
.grid { display: grid; grid-template-columns: 1fr; gap: 1.25rem; padding-bottom: 3rem; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.card { position: relative; display: flex; flex-direction: column; min-width: 0; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.card[hidden] { display: none; }
.media { position: relative; margin: 0; aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-2); }
.media a { display: block; width: 100%; height: 100%; }
.media img { width: 100%; height: 100%; object-fit: cover; }
.credit { position: absolute; z-index: 2; right: .5rem; bottom: .5rem; max-width: calc(100% - 1rem); padding: .1rem .45rem; border-radius: 5px;
  font-size: .7rem; line-height: 1.5; color: #fff; background: rgb(10 8 20 / .7); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.body { display: flex; flex-direction: column; gap: .5rem; padding: 1rem 1.1rem 1.1rem; flex: 1; min-width: 0; }
.card-head { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem; font-size: .82rem; color: var(--muted); }
.card-head time { margin-left: auto; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tag, .lead-label { display: inline-block; padding: .18rem .55rem; border-radius: 999px; font-size: .72rem; font-weight: 700; line-height: 1.4; }
.tag-comfyui { background: var(--comfy); color: var(--comfy-ink); }
.tag-civitai { background: var(--civitai); color: var(--civitai-ink); }
.tag-civitai-red { background: var(--red); color: var(--red-ink); }
.tag-models { background: var(--models); color: var(--models-ink); }
.lead-label { background: var(--accent); color: #fff; text-transform: uppercase; letter-spacing: .03em; }
.card-title { margin: 0; font-size: 1.1rem; line-height: 1.3; font-weight: 700; }
.card-title a { color: var(--text); text-decoration: none; }
.card-title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }   /* whole card is clickable */
.card:hover .card-title a { text-decoration: underline; }
.summary { margin: 0; color: var(--muted); font-size: .95rem; }
.model-specs { margin: 0; display: flex; flex-wrap: wrap; gap: .35rem; font-size: .78rem; }
.spec { padding: .12rem .5rem; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); }
.spec b { color: var(--text); font-weight: 600; }
.spec-type { border-color: var(--models); color: var(--models); font-weight: 700; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .spec-type { color: #b197fc; border-color: #b197fc; } }
:root[data-theme="dark"] .spec-type { color: #b197fc; border-color: #b197fc; }
.note { position: relative; z-index: 2; margin: .2rem 0 0; padding: .5rem .7rem; font-size: .85rem; border-radius: 8px; background: var(--note-bg); border-left: 3px solid var(--note-border); color: var(--note-text); }
.card-foot { margin: auto 0 0; padding-top: .6rem; border-top: 1px solid var(--border); font-size: .85rem; color: var(--muted); display: flex; align-items: center; gap: .3rem; min-width: 0; }
.card-foot a { position: relative; z-index: 2; font-weight: 600; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-foot a:hover { text-decoration: underline; }
.card-foot .arrow { margin-left: auto; color: var(--muted); }

/* lead story: full width; image left / text right on wide screens */
.card.lead { grid-column: 1 / -1; }
.card.lead .card-title { font-size: 1.35rem; }
@media (min-width: 860px) {
  .card.lead { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
  .card.lead .media { aspect-ratio: auto; min-height: 340px; }
  .card.lead .media img { position: absolute; inset: 0; }
  .card.lead .body { padding: 1.6rem 1.8rem; gap: .75rem; }
  .card.lead .card-title { font-size: 1.7rem; line-height: 1.2; }
  .card.lead .summary { font-size: 1.02rem; }
}

/* category placeholders (no real image available) */
.ph { display: flex; flex-direction: column; justify-content: flex-end; padding: 1rem 1.1rem; color: #fff; }
.ph-mark { font-size: 1.8rem; line-height: 1; font-weight: 800; letter-spacing: -.02em; }
.ph-sub { margin-top: .35rem; font-size: .78rem; opacity: .85; text-transform: uppercase; letter-spacing: .06em; }
.ph-comfyui { background: linear-gradient(135deg, #17181f, #3a4012); color: var(--comfy); }
.ph-civitai { background: linear-gradient(135deg, #0b2a4d, #1971c2); }
.ph-civitai-red { background: linear-gradient(135deg, #2b0a0f, #c92a2a); }
.ph-models { background: linear-gradient(135deg, #1a1033, #7048e8); }
.empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 3rem 0; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding: 2.5rem 0 3rem; font-size: .93rem; color: var(--muted); }
.site-footer h2 { margin: 0 0 .5rem; font-size: 1.2rem; color: var(--text); }
.site-footer h3 { margin: 1.6rem 0 .6rem; font-size: 1rem; color: var(--text); }
.site-footer p { max-width: 75ch; }
.sources { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr; gap: .35rem 1.2rem; }
@media (min-width: 760px) { .sources { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sources li { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sources .url { font-size: .8rem; opacity: .75; }
.small { font-size: .82rem; margin-top: 1.6rem; }

@media (max-width: 420px) {
  .wrap { padding-inline: 1rem; }
  .hero-body { padding-inline: 1rem; }
  .tab { padding: .5rem .75rem; font-size: .88rem; }
}
