/* solona.art — the rainbow butterfly tree on warm cream (light), the same butterflies glowing on a plum night (dark).
   Layout: one centred column; a header with the needle wordmark; the index is a grid of plain cards; a mod page is a
   gallery beside its facts. The rainbow only ever means a body (chips), never decoration. */
:root {
  --paper: #f6f0e4;        /* the art's cream */
  --paper-deep: #efe6d4;
  --card: #fbf7ef;
  --ink: #3b2417;          /* the tree's trunk */
  --muted: #7a6656;
  --line: #e2d6c2;
  --accent: #a3307e;       /* the canopy's magenta, for links and the download button */
  --accent-ink: #fff8f2;
  --focus: #2f6fd0;
  /* The tree's spectrum, one hue per body family. */
  --teal: #12868a; --blue: #2c63b8; --violet: #7140b0; --magenta: #b52a87;
  --red: #c2392d; --orange: #c46a10; --gold: #9a7c0a; --green: #2f8a3d;
  --chip-mix: 14%;
  --display: "Cormorant Garamond", "Cormorant", Garamond, "Times New Roman", serif;
  --body: "Jost", "Segoe UI", system-ui, sans-serif;
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1d1220; --paper-deep: #160d18; --card: #271a2b; --ink: #f3e9df; --muted: #bba9b4; --line: #3c2b40;
    --accent: #e872c2; --accent-ink: #1d1220; --focus: #8fb6ff;
    --teal: #4fd0cf; --blue: #7aa8ff; --violet: #b78cf0; --magenta: #f07ccc;
    --red: #ff8a7a; --orange: #ffaf55; --gold: #f1d35c; --green: #7fd68a;
    --chip-mix: 22%;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #1d1220; --paper-deep: #160d18; --card: #271a2b; --ink: #f3e9df; --muted: #bba9b4; --line: #3c2b40;
  --accent: #e872c2; --accent-ink: #1d1220; --focus: #8fb6ff;
  --teal: #4fd0cf; --blue: #7aa8ff; --violet: #b78cf0; --magenta: #f07ccc;
  --red: #ff8a7a; --orange: #ffaf55; --gold: #f1d35c; --green: #7fd68a;
  --chip-mix: 22%;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1rem/1.6 var(--body);
       min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
main { flex: 1 0 auto; }   /* a short page still puts the footer at the bottom of the window */
img { max-width: 100%; display: block; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--display); font-weight: 500; line-height: 1.15; text-wrap: balance; margin: 0; }
.wrap { max-width: 76rem; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px));
        padding-right: max(16px, env(safe-area-inset-right, 0px)); }

/* ── header ── */
.site-head { border-bottom: 1px solid var(--line); background: var(--paper); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: .75rem; }
.wordmark { display: block; width: clamp(150px, 30vw, 240px); }
.wordmark img { width: 100%; height: auto; }
.wordmark .dark { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .wordmark .light { display: none; }
                                      :root:not([data-theme="light"]) .wordmark .dark { display: block; } }
:root[data-theme="dark"] .wordmark .light { display: none; }
:root[data-theme="dark"] .wordmark .dark { display: block; }
.head-links { display: flex; gap: 1rem; font-size: .95rem; }
.head-links a { color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: .4rem; }
.head-links .ico { width: 1.05em; height: 1.05em; flex: none; fill: currentColor; }
/* Proteus's icon in the text's colour, as the other marks: its folds as the shape. */
.head-links .ico.app { background: currentColor; border-radius: 22%;
  -webkit-mask: url("../img/proteus-mark.png") center / contain no-repeat;
  mask: url("../img/proteus-mark.png") center / contain no-repeat; }
/* On a phone the marks alone, so the header stays one line; the names stay for screen readers. */
@media (max-width: 560px) {
  .head-links { gap: 1.1rem; }
  .head-links .ico { width: 1.35em; height: 1.35em; }
  .head-links .label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
/* Each link its own colour on hover, a rainbow left to right. */
.head-links a:nth-child(1):hover, .head-links a:nth-child(1):focus-visible { color: var(--red); }
.head-links a:nth-child(2):hover, .head-links a:nth-child(2):focus-visible { color: var(--gold); }
.head-links a:nth-child(3):hover, .head-links a:nth-child(3):focus-visible { color: var(--teal); }
.head-links a:nth-child(4):hover, .head-links a:nth-child(4):focus-visible { color: var(--violet); }

/* ── home intro: the tree at the side, a few butterflies drifting ── */
.intro { position: relative; overflow: hidden; }
.intro .wrap { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 13rem); gap: 1.5rem;
               align-items: center; padding-block: 1rem; }
.intro h1 { font-size: clamp(1.9rem, 4.2vw, 2.9rem); font-weight: 400; }
.intro p { color: var(--muted); max-width: 52ch; margin: .5rem 0 0; }
.intro .tree { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 50%; justify-self: end;
               -webkit-mask-image: radial-gradient(circle at 50% 45%, #000 52%, transparent 71%);
               mask-image: radial-gradient(circle at 50% 45%, #000 52%, transparent 71%); }
.drift { position: absolute; inset: 0; pointer-events: none; }
/* The intro's own three, larger: the same tinted shape as the page's butterflies (.flutter, below). */
.drift i { position: absolute; width: 6rem; aspect-ratio: 1; background: var(--c); opacity: var(--flutter-o, .13);
           -webkit-mask: url("../img/butterfly-shape.png") center / contain no-repeat;
           mask: url("../img/butterfly-shape.png") center / contain no-repeat;
           rotate: var(--r, 0deg); animation: drift 26s ease-in-out infinite alternate; }
.drift i:nth-child(1) { --c: #e0344a; left: 4%; top: 12%; --r: -14deg; }
.drift i:nth-child(2) { --c: #3fae4f; left: 46%; top: 55%; width: 4rem; animation-duration: 31s; --r: 18deg; }
.drift i:nth-child(3) { --c: #2f8fd8; left: 62%; top: 2%; width: 4.8rem; animation-duration: 37s; --r: -30deg; }
@keyframes drift { to { translate: 1.2rem -.8rem; rotate: 8deg; } }
@media (prefers-reduced-motion: reduce) { .drift i { animation: none; } }
@media (max-width: 640px) { .intro .wrap { grid-template-columns: 1fr; } .intro .tree { display: none; } }

/* ── finder: search, filters, sort ── */
.finder { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--paper); }
.finder .wrap { display: grid; gap: .6rem; padding-block: .75rem; }
/* On a phone the filters are most of a screen: they scroll away rather than cover the mods. */
@media (max-width: 700px) { .finder { position: static; } }
.finder-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.finder input[type=search], .finder select {
  font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .5rem .75rem; min-width: 0; }
.finder input[type=search] { flex: 1 1 16rem; }
.finder label { color: var(--muted); font-size: .9rem; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { --hue: var(--muted); font: inherit; font-size: .85rem; cursor: pointer; color: var(--hue);
        background: color-mix(in srgb, var(--hue) var(--chip-mix), transparent); border: 1px solid transparent;
        border-radius: 999px; padding: .2rem .7rem; }
.chip[aria-pressed="true"] { background: var(--hue); color: var(--paper); }
.chip.quiet { --chip-mix: 7%; }
.count-line { color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--paper); }

/* body hues */
[data-body="neolithe"] { --hue: var(--teal); } [data-body="bibo"] { --hue: var(--blue); }
[data-body="rue"] { --hue: var(--violet); } [data-body="yab"] { --hue: var(--magenta); }
[data-body="yab-buff"] { --hue: var(--red); } [data-body="tre"] { --hue: var(--orange); }
[data-body="rosaline"] { --hue: var(--gold); } [data-body="tbse"], [data-body="tbse-x"] { --hue: var(--green); }
[data-body="proteus"] { --hue: var(--accent); }

/* ── the grid ── */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: 1.1rem; padding-block: 1.25rem 2.5rem; }
.card { display: flex; flex-direction: column; min-width: 0; background: var(--card); border: 1px solid var(--line);
        border-radius: var(--radius); overflow: hidden; color: inherit; text-decoration: none; }
.card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
/* The previews are 16:9 title images: shown whole, never cropped; an odd one sits letterboxed. */
.card .thumb { aspect-ratio: 16 / 9; background: var(--paper-deep); overflow: hidden; }
.card .thumb img { width: 100%; height: 100%; object-fit: contain; transition: filter .2s; }
.card .meta { display: grid; gap: .15rem; padding: .6rem .75rem .75rem; }
.card h2 { font-size: 1.3rem; font-weight: 500; }
.card .sub { display: flex; justify-content: space-between; gap: .5rem; color: var(--muted); font-size: .85rem;
             font-variant-numeric: tabular-nums; }
.card[hidden] { display: none; }
.nsfw-blur .card[data-nsfw="1"] .thumb img { filter: blur(18px) saturate(.7); }
.badge { font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; color: var(--red); }

/* ── a mod's page ── */
.mod { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 2rem; padding-block: 1.5rem 3rem;
       align-items: start; }
@media (max-width: 760px) { .mod { grid-template-columns: 1fr; } }
.gallery { display: grid; gap: .6rem; align-content: start; }
.gallery .main { display: block; width: 100%; padding: 0; border: 0; font: inherit; border-radius: var(--radius);
                 overflow: hidden; background: var(--paper-deep); cursor: zoom-in; position: relative; }
.gallery .main img { display: block; width: 100%; height: auto; }
/* A magnifier in the corner says the picture can be enlarged. */
.gallery .main::after { content: ""; position: absolute; right: .6rem; bottom: .6rem; width: 2.2rem; height: 2.2rem;
  border-radius: 50%; background: rgb(0 0 0 / .55) no-repeat center / 1.2rem
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M15.5 15.5 21 21M10.5 7.5v6M7.5 10.5h6'/%3E%3C/svg%3E"); }
.gallery .main:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* The zoomed view: the whole screen, the picture fitted; .full shows it at its own size to scroll around. */
.zoom { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
        background: #0a060c; color: #fff; overflow: hidden; }
.zoom::backdrop { background: rgb(10 6 12 / .6); }
.zoom-stage { position: absolute; inset: 0; overflow: auto; display: grid; place-items: center; cursor: zoom-out; }
.zoom-stage img { max-width: 96vw; max-height: 92dvh; width: auto; height: auto; cursor: zoom-in; }
.zoom.full .zoom-stage { place-items: start; }
.zoom.full .zoom-stage img { max-width: none; max-height: none; margin: auto; cursor: zoom-out; }
.zoom button { position: absolute; border: 0; border-radius: 50%; background: rgb(0 0 0 / .55); color: #fff;
               font: 2rem/1 var(--body); width: 3rem; height: 3rem; cursor: pointer; display: grid; place-items: center; }
.zoom button:hover { background: rgb(0 0 0 / .8); }
.zoom button:focus-visible { outline: 3px solid #8fb6ff; }
.zoom-close { top: 1rem; right: 1rem; }
.zoom-step { top: 50%; transform: translateY(-50%); }
.zoom-step.prev { left: 1rem; } .zoom-step.next { right: 1rem; }
.zoom.single .zoom-step { display: none; }
.zoom-hint { position: absolute; left: 50%; bottom: .8rem; transform: translateX(-50%); margin: 0; font-size: .85rem;
             color: rgb(255 255 255 / .75); background: rgb(0 0 0 / .45); padding: .3rem .8rem; border-radius: 999px;
             white-space: nowrap; pointer-events: none; }
@media (max-width: 560px) { .zoom-hint { display: none; } .zoom-step { width: 2.6rem; height: 2.6rem; } }
.gallery .more { display: grid; grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)); gap: .5rem; align-items: start; }
.gallery .more button { display: block; padding: 0; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--paper-deep); cursor: pointer; }
/* The width/height attributes only reserve space; the picture is shown whole at 16:9, letterboxed if it isn't. */
.gallery .more img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: contain; }
.credits { margin: 1rem 0 0; }
.credits p, .facts .thanks { margin: 0 0 .5rem; color: var(--muted); font-size: .92rem; }
.facts h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 400; }
.facts .line { color: var(--muted); font-variant-numeric: tabular-nums; margin: .35rem 0 1rem; }
.download { display: inline-flex; align-items: center; gap: .5rem; background: var(--accent); color: var(--accent-ink);
            font-weight: 500; text-decoration: none; border-radius: var(--radius); padding: .7rem 1.2rem; }
.download:hover { filter: brightness(1.08); }
.desc { white-space: pre-line; max-width: 62ch; margin: 1.25rem 0; }
dl.spec { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1rem; margin: 1rem 0; }
dl.spec dt { color: var(--muted); }
dl.spec dd { margin: 0; min-width: 0; }
.also a { margin-right: 1rem; }

/* ── age check ── */
.gate { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 1rem;
        background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(6px); }
.gate[hidden] { display: none; }
.gate .box { max-width: 26rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; }
.gate h2 { font-size: 1.7rem; margin-bottom: .5rem; }
.gate .row { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.button { font: inherit; cursor: pointer; border-radius: var(--radius); padding: .55rem 1rem; border: 1px solid var(--line);
          background: var(--card); color: var(--ink); }
.button.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }

/* ── footer ── */
.site-foot { border-top: 1px solid var(--line); color: var(--muted); font-size: .95rem; }
.site-foot .wrap { padding-block: 1.25rem calc(1.25rem + env(safe-area-inset-bottom, 0px)); }
/* The Discord line on the left, the lifetime count on the right; the count drops under it when there's no room. */
.site-foot .wrap { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .35rem 1.5rem; }
.site-foot p { margin: 0; }
.site-foot .lifetime { font-variant-numeric: tabular-nums; }
.site-foot img { width: 1.4rem; display: inline-block; vertical-align: -.3rem; margin-right: .4rem; }

/* ── butterflies all over: the one shape, tinted each colour of the rainbow, faint, behind everything ── */
.flutter { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.flutter i { position: absolute; width: var(--w, 4rem); aspect-ratio: 1; background: var(--c); opacity: var(--flutter-o, .13);
             -webkit-mask: url("../img/butterfly-shape.png") center / contain no-repeat;
             mask: url("../img/butterfly-shape.png") center / contain no-repeat;
             rotate: var(--r, 0deg); animation: drift var(--d, 30s) ease-in-out infinite alternate; }
.flutter i:nth-child(1) { --c: #e0344a; left: 2%;  top: 36%; --w: 4.5rem; --r: -18deg; }
.flutter i:nth-child(2) { --c: #f08a24; left: 91%; top: 9%;  --w: 3.2rem; --r: 22deg; --d: 34s; }
.flutter i:nth-child(3) { --c: #e8c21c; left: 86%; top: 46%; --w: 5rem;   --r: -8deg; --d: 27s; }
.flutter i:nth-child(4) { --c: #3fae4f; left: 1%;  top: 58%; --w: 3.6rem; --r: 14deg; --d: 38s; }
.flutter i:nth-child(5) { --c: #2f8fd8; left: 94%; top: 78%; --w: 4rem;   --r: -26deg; --d: 31s; }
.flutter i:nth-child(6) { --c: #4b4fc4; left: 7%;  top: 88%; --w: 3rem;   --r: 30deg; --d: 36s; }
.flutter i:nth-child(7) { --c: #9b44c8; left: 48%; top: 94%; --w: 3.4rem; --r: -12deg; --d: 29s; }
.flutter i:nth-child(8) { --c: #d6449a; left: 70%; top: 2%;  --w: 2.8rem; --r: 8deg;  --d: 33s; }
.flutter i:nth-child(9) { --c: #2fb3a8; left: 24%; top: 4%;  --w: 2.6rem; --r: -34deg; --d: 40s; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --flutter-o: .18; } }
:root[data-theme="dark"] { --flutter-o: .18; }
@media (max-width: 640px) { .flutter i:nth-child(n) { --w: 2.4rem; } }
@media (prefers-reduced-motion: reduce) { .flutter i { animation: none; } }
