/* antisoftworks.com/themes: the theme gallery (TODO 52d, 52e, 53). Loaded
   after style.css, which gives the bar, the footer, the colour tokens and
   the light/dark switch. No inline style, no web fonts. Each card is
   coloured by the theme's six colours, which themes.js sets as --t0..--t5
   (paper, text, accent, pen 1, 2, 3) through the CSSOM. Motion is
   transform and opacity only, short, and off with prefers-reduced-motion. */

:root {
  --studio: url("img/studio-day.svg?v=20261012");
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --studio: url("img/studio-night.svg?v=20261012"); }
}
:root[data-theme="dark"] { --studio: url("img/studio-night.svg?v=20261012"); }

/* The studio is this page's picture: the home page's beach is not used. */
body { background: var(--bg); }
.wrap { padding-left: max(28px, env(safe-area-inset-left)); padding-right: max(28px, env(safe-area-inset-right)); }
.vh { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ── The studio on the island: the scene, with the title over the sky ── */
.studio { position: relative; height: clamp(300px, 40vw, 620px); }
.scene { position: absolute; inset: 0; background: var(--studio) 50% 100% / cover no-repeat; }
.studio > .wrap { position: relative; padding-top: 22px; }
.title { width: min(42%, 480px); padding: 16px 22px 18px; border-radius: 14px;
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  box-shadow: 0 10px 30px color-mix(in srgb, var(--fg) 12%, transparent); }
.title .kicker { margin: 0 0 4px; }
.title h1 { font-size: clamp(27px, 3vw, 36px); margin: 0 0 8px; max-width: none; }
.title p { margin: 0; color: var(--muted); font-size: 15.5px; line-height: 1.5; }

@media (max-width: 760px) {
  .wrap { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
}
@media (max-width: 960px) {
  .studio { height: auto; display: flex; flex-direction: column; }
  .studio > .wrap { position: static; padding-top: 22px; order: 1; width: 100%; }
  .title { width: auto; padding: 0; background: none; box-shadow: none;
    -webkit-backdrop-filter: none; backdrop-filter: none; }
  .title h1 { font-size: 31px; }
  .title p { font-size: 16.5px; max-width: 60ch; }
  .scene { position: relative; order: 2; height: clamp(190px, 56vw, 330px); margin: 18px max(28px, env(safe-area-inset-right)) 0
    max(28px, env(safe-area-inset-left)); border-radius: 14px; border: 1px solid var(--line); }
}
@media (max-width: 760px) {
  .scene { margin-left: max(16px, env(safe-area-inset-left)); margin-right: max(16px, env(safe-area-inset-right)); }
}

/* ── How to use a theme ──────────────────────────────────────────────── */
.how { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 26px; margin: 26px 0 0;
  padding: 14px 20px; background: var(--soft); border-radius: 12px; }
.how h2 { font-size: 16px; margin: 0; flex: none; }
.how ol { display: flex; flex-wrap: wrap; flex: 1 1 420px; gap: 6px 26px; margin: 0; padding: 0; list-style: none;
  font-size: 14.5px; line-height: 1.5; }
.how li { flex: 1 1 200px; }
.how li span { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: 8px;
  border-radius: 50%; background: var(--card); border: 1px solid var(--line); font-size: 11.5px; font-weight: 700; }
.how .get { flex: none; font-weight: 600; font-size: 14.5px; }
@media (max-width: 1100px) { .how h2, .how ol, .how .get { flex-basis: 100%; } }

/* ── Controls ────────────────────────────────────────────────────────── */
.gallery { margin-top: 34px; scroll-margin-top: 12px; }
.ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; margin: 0 0 18px; }
.search { display: flex; align-items: center; gap: 9px; flex: 1 1 240px; max-width: 400px; height: 42px;
  padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--muted); }
.search:focus-within { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: 1px; }
.search svg { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--fg);
  font: inherit; font-size: 15px; -webkit-appearance: none; appearance: none; }
.search input::placeholder { color: var(--muted); opacity: 1; }
.chips { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--card); }
.chip { font: inherit; font-size: 14.5px; border: 0; background: transparent; color: var(--muted);
  padding: 0 16px; height: 40px; cursor: pointer; transition: background-color .25s, color .25s; }
.chip + .chip { border-left: 1px solid var(--line); }
.chip:hover { color: var(--fg); background: var(--soft); }
.chip:focus-visible { outline-offset: -3px; }
.chip.on { background: var(--accent); color: var(--bg); font-weight: 600; }
.count { margin: 0 0 0 auto; font-size: 14px; color: var(--muted); }
@media (max-width: 560px) {
  .search { max-width: none; flex-basis: 100%; }
  .chips { flex: 1 1 auto; }
  .chip { flex: 1; padding: 0 8px; }
  .count { margin: 0; flex-basis: 100%; }
}

.notice { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin: 0 0 18px;
  padding: 14px 18px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--card); }
[hidden] { display: none !important; }
.notice p { margin: 0; flex: 0 1 auto; font-size: 15.5px; line-height: 1.5; }
.notice .button { padding: 7px 16px; }

/* ── Cards ───────────────────────────────────────────────────────────── */
.grid, .featwrap { list-style: none; margin: 0; padding: 0; }
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1100px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 800px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .grid { grid-template-columns: 1fr; } .tscene svg { aspect-ratio: 2 / 1; } }
.featwrap { margin: 0 0 18px; }

.tcard { display: flex; flex-direction: column; min-width: 0; overflow: hidden;
  background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--sea); border-radius: 12px;
  --day: inline; --night: none; }
.grid .tcard:nth-child(4n+2) { border-top-color: var(--coral); }
.grid .tcard:nth-child(4n+3) { border-top-color: var(--sun); }
.grid .tcard:nth-child(4n+4) { border-top-color: var(--leaf); }
.tcard.dark { --day: none; --night: inline; }
.tscene { border-bottom: 1px solid var(--line); background: var(--t0, var(--soft)); line-height: 0; }
.tscene svg { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; }
.tbody { padding: 12px 14px 14px; display: flex; flex-direction: column; flex: 1; }
.tname { margin: 0; font-size: 16.5px; line-height: 1.3; letter-spacing: -.01em; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.tby { margin: 1px 0 0; font-size: 14px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tby:empty { display: none; }
.pal { display: flex; list-style: none; margin: 10px 0 12px; padding: 0; }
.pal li { display: flex; align-items: center; gap: 8px; }
.pal i { display: block; width: 14px; height: 14px; margin-right: -3px; border-radius: 50%;
  box-shadow: 0 0 0 2px var(--card), inset 0 0 0 1px color-mix(in srgb, var(--fg) 30%, transparent); }
.pal li:nth-child(1) i { background: var(--t0); } .pal li:nth-child(2) i { background: var(--t1); }
.pal li:nth-child(3) i { background: var(--t2); } .pal li:nth-child(4) i { background: var(--t3); }
.pal li:nth-child(5) i { background: var(--t4); } .pal li:nth-child(6) i { background: var(--t5); }
.pal span { display: none; }
.tact { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.tact .button { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; font-size: 14px;
  border-radius: 8px; line-height: 1.3; transition: transform .2s ease, filter .2s ease, border-color .2s ease; }
.tact .button:hover { transform: translateY(-1px); }
.tact .button:active { transform: translateY(1px); }
.tact .button svg { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round; }
.tmeta { display: flex; flex-wrap: wrap; gap: 2px 10px; margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.badge { align-self: flex-start; margin-bottom: 8px; padding: 2px 10px; border: 1px solid var(--line);
  border-radius: 999px; background: var(--soft); font-size: 11px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; }

/* The featured theme: big, with its six colours named. */
.tcard.feat { flex-direction: row; border-top-color: var(--coral); }
.tcard.feat .tscene { flex: 0.9 1 0; min-width: 0; border-bottom: 0; border-right: 1px solid var(--line); }
.tcard.feat .tscene svg { height: 100%; aspect-ratio: 16 / 9; }
.tcard.feat .tbody { flex: 1 1 0; min-width: 0; padding: 20px 24px 22px; justify-content: center; }
.tcard.feat .tname { font-size: 26px; letter-spacing: -.02em; white-space: normal; }
.tcard.feat .tby { font-size: 15px; white-space: normal; }
.tcard.feat .pal { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 12px; margin: 16px 0 18px; }
.tcard.feat .pal i { width: 20px; height: 20px; margin: 0; border-radius: 6px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--fg) 30%, transparent); }
.tcard.feat .pal span { display: block; font-size: 13px; line-height: 1.25; color: var(--muted); }
.tcard.feat .pal code { display: block; font: inherit; font-size: 12px; color: var(--fg); }
.tcard.feat .tact { margin-top: 0; }
.tcard.feat .tmeta { margin-top: 14px; font-size: 14px; }
@media (max-width: 760px) {
  .tcard.feat { flex-direction: column; }
  .tcard.feat .tscene { border-right: 0; border-bottom: 1px solid var(--line); }
  .tcard.feat .tscene svg { height: auto; aspect-ratio: 16 / 9; }
  .tcard.feat .tbody { padding: 14px 16px 16px; }
  .tcard.feat .tname { font-size: 22px; }
}

/* The island's colours. --t0..--t5 are the theme's; day or night shows the
   sun or the moon (--day and --night come down from the card). */
.f0 { fill: var(--t0); } .f1 { fill: var(--t1); } .f2 { fill: var(--t2); }
.f3 { fill: var(--t3); } .f4 { fill: var(--t4); } .f5 { fill: var(--t5); }
.cl { fill: var(--t1); opacity: .12; }
.sand { fill: color-mix(in srgb, var(--t3) 58%, var(--t0)); }
.tr { fill: none; stroke: var(--t1); stroke-width: 6; stroke-linecap: round; }
.ln { fill: none; stroke: var(--t1); stroke-width: 1.4; stroke-linecap: round; opacity: .75; }
.wv { fill: none; stroke: var(--t0); stroke-width: 2.2; stroke-linecap: round; opacity: .45; }
.day { display: var(--day, inline); }
.night { display: var(--night, none); }

/* A card still loading: the shape of a card, nothing in it. */
.tcard.skel { min-height: 262px; border-top-color: var(--line); background: var(--soft); }
.tcard.skel .tscene, .tcard.skel .tbody { visibility: hidden; }

.more { text-align: center; margin: 26px 0 0; max-width: none; }
.more .button { padding: 10px 28px; }

.about { margin-top: 64px; }
.about h2 { margin-bottom: 14px; }
.notes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; }
.notes p { font-size: 15px; color: var(--muted); max-width: 62ch; margin-bottom: 14px; }
.notes b { color: var(--fg); font-weight: 600; }
@media (max-width: 760px) { .notes { grid-template-columns: 1fr; } }
footer.site { margin-top: 72px; }

/* Motion (item 53): a card settles in once as it scrolls into view, and
   lifts a little under the pointer. Transform and opacity only. */
@media (prefers-reduced-motion: no-preference) {
  .tcard { transition: transform .35s cubic-bezier(.3, .7, .3, 1), opacity .5s ease-out, box-shadow .35s ease; }
  .grid .tcard:hover { transform: translateY(-3px) rotate(-.4deg);
    box-shadow: 0 12px 28px color-mix(in srgb, var(--fg) 14%, transparent); }
  .tcard.rise { opacity: 0; transform: translateY(12px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
