/*
  KoiHub theme: Frutiger Aero meets Android Market.
  Glossy green header, sky gradient with bubbles and a grass hill, frosted glass panels,
  shiny rounded app icons, split-gradient buttons. Light and dark.

  Re-tint it with two variables on :root (hue numbers 0-359):
    --h   main color (header, buttons, links, hill), default 100 (green)
    --sk  sky color (background), default 200 (blue)

  Dark mode follows the system, or force it with data-theme="dark" or "light" on <html>.
  Add class "gloss" to any .icon for the shiny highlight.
  Fonts: Nunito (headings) and Noto Sans (body), loaded below.
*/
@import url("https://fonts.googleapis.com/css2?family=Nunito:wght@600;800&family=Noto+Sans:wght@400;500;700&display=swap");

/* base reset */
:root { color-scheme: light; }
body { margin: 0; }
img { max-width: 100%; }
[hidden] { display: none !important; }

:root {
  --h: 100; --sk: 200;
  --bg: hsl(var(--sk) 70% 85%);
  --sky-top: hsl(var(--sk) 78% 64%);
  --sky-bot: hsl(var(--sk) 85% 96%);
  --bokeh: rgba(255, 255, 255, .42);
  --hill: hsl(var(--h) 58% 52%);
  --hill-2: hsl(var(--h) 60% 42%);
  --glass-a: rgba(255, 255, 255, .93);
  --glass-b: rgba(255, 255, 255, .74);
  --edge: rgba(255, 255, 255, .95);
  --line: rgba(20, 80, 120, .16);
  --shadow: rgba(14, 90, 140, .24);
  --fg: #0d3042;
  --muted: #45667a;
  --link: hsl(var(--h) 80% 24%);
  --mark: hsl(var(--h) 60% 42%);
  --b1: hsl(var(--h) 58% 50%); --b2: hsl(var(--h) 72% 34%); --b3: hsl(var(--h) 86% 26%); --bd: hsl(var(--h) 86% 20%); --tsh: hsl(var(--h) 100% 10% / .55);
  --alt-a: #ffffff; --alt-b: #e4f1f7; --alt-c: #c9dfea; --alt-d: #dbeaf3; --alt-fg: #0d3042; --alt-ts: #ffffff; --alt-bd: rgba(20, 80, 120, .35);
  --font-display: "Nunito", "Segoe UI", system-ui, sans-serif;
  --font-body: "Noto Sans", "Droid Sans", "Segoe UI", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: hsl(var(--sk) 70% 9%); --sky-top: hsl(var(--sk) 75% 22%); --sky-bot: hsl(var(--sk) 80% 7%); --bokeh: rgba(110, 200, 255, .1);
    --hill: hsl(var(--h) 50% 24%); --hill-2: hsl(var(--h) 50% 16%);
    --glass-a: rgba(24, 56, 84, .9); --glass-b: rgba(14, 38, 60, .8); --edge: rgba(255, 255, 255, .16); --line: rgba(255, 255, 255, .13); --shadow: rgba(0, 0, 0, .55);
    --fg: #e8f4fa; --muted: #95b3c5; --link: hsl(var(--h) 70% 62%); --mark: hsl(var(--h) 62% 52%);
    --alt-a: #3c6585; --alt-b: #28516f; --alt-c: #1b3f5a; --alt-d: #254a66; --alt-fg: #e8f4fa; --alt-ts: rgba(0, 0, 0, .5); --alt-bd: rgba(255, 255, 255, .28);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: hsl(var(--sk) 70% 9%); --sky-top: hsl(var(--sk) 75% 22%); --sky-bot: hsl(var(--sk) 80% 7%); --bokeh: rgba(110, 200, 255, .1);
  --hill: hsl(var(--h) 50% 24%); --hill-2: hsl(var(--h) 50% 16%);
  --glass-a: rgba(24, 56, 84, .9); --glass-b: rgba(14, 38, 60, .8); --edge: rgba(255, 255, 255, .16); --line: rgba(255, 255, 255, .13); --shadow: rgba(0, 0, 0, .55);
  --fg: #e8f4fa; --muted: #95b3c5; --link: hsl(var(--h) 70% 62%); --mark: hsl(var(--h) 62% 52%);
  --alt-a: #3c6585; --alt-b: #28516f; --alt-c: #1b3f5a; --alt-d: #254a66; --alt-fg: #e8f4fa; --alt-ts: rgba(0, 0, 0, .5); --alt-bd: rgba(255, 255, 255, .28);
  color-scheme: dark;
}
* { box-sizing: border-box; }
body {
  background: var(--bg); color: var(--fg); font: 400 15px/1.55 var(--font-body);
  padding-block: 16px 48px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(130% 42% at 50% 118%, var(--hill) 0 58%, transparent 59%),
    radial-gradient(90% 34% at 8% 112%, var(--hill-2) 0 60%, transparent 61%),
    radial-gradient(circle at 14% 16%, var(--bokeh) 0 46px, transparent 48px),
    radial-gradient(circle at 82% 10%, var(--bokeh) 0 70px, transparent 72px),
    radial-gradient(circle at 68% 46%, var(--bokeh) 0 30px, transparent 32px),
    radial-gradient(circle at 24% 62%, var(--bokeh) 0 54px, transparent 56px),
    linear-gradient(var(--sky-top), var(--sky-bot) 75%);
}
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid #ffb300; outline-offset: 2px; }
.wrap { max-width: 980px; margin: 0 auto; }
h1, h2 { font-family: var(--font-display); font-weight: 800; margin: 0; text-wrap: balance; }
code { font-size: .92em; background: var(--alt-d); padding: 1px 6px; border-radius: 5px; }
.glass {
  background: linear-gradient(var(--glass-a), var(--glass-b)); border: 1px solid var(--edge); border-radius: 16px;
  box-shadow: 0 1px 0 var(--edge) inset, 0 8px 24px var(--shadow); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}

/* header */
.mk {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 16px; color: #fff; text-shadow: 0 1px 1px var(--tsh);
  background: linear-gradient(var(--b1) 0%, var(--b2) 49%, var(--b3) 50%, var(--b2) 100%);
  border: 1px solid rgba(255, 255, 255, .55); box-shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 8px 20px var(--shadow);
}
.logo { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; overflow: hidden; font: 800 20px var(--font-display); color: var(--b3); text-shadow: 0 1px 0 #fff;
  background: linear-gradient(#ffffff, #e6f3da 55%, #c3dfa4); box-shadow: 0 2px 4px rgba(0, 40, 0, .4), 0 0 0 1px rgba(255, 255, 255, .8) inset; }
.logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.logo svg { width: 60%; height: 60%; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.brand { font: 800 23px var(--font-display); min-width: 0; overflow-wrap: anywhere; }
.tgl { margin-left: auto; flex: none; width: 38px; height: 38px; display: grid; place-items: center; padding: 0; border: 1px solid rgba(255, 255, 255, .65); border-radius: 50%; color: #fff; cursor: pointer;
  background: linear-gradient(rgba(255, 255, 255, .38), rgba(255, 255, 255, .1) 50%, rgba(0, 0, 0, .12) 51%, rgba(255, 255, 255, .16)); }
.tgl svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 1px 1px var(--tsh)); }
.tgl:active { filter: brightness(.9); }
.intro { margin: 14px 0 0; padding: 12px 16px; }

/* tabs and labels */
.tabs { display: flex; gap: 2px; overflow-x: auto; margin: 14px 2px 6px; border-bottom: 1px solid var(--line); }
.tab { flex: none; background: none; border: 0; border-bottom: 4px solid transparent; padding: 10px 16px 8px; color: var(--muted); font: 800 14px var(--font-display); text-transform: uppercase; letter-spacing: .06em; cursor: pointer; }
.tab[aria-selected="true"] { color: var(--link); border-bottom-color: var(--mark); }
.lbl { display: flex; align-items: center; gap: 10px; font: 800 17px var(--font-display); margin: 20px 2px 10px; }
.lbl::after { content: ""; flex: 1; height: 2px; background: linear-gradient(90deg, var(--line), transparent); }
.lbl .n { order: 2; font: 700 12px var(--font-body); color: var(--muted); }

/* featured banners */
.feat { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 2px 2px 16px; }
.ban { position: relative; flex: none; display: block; width: min(86%, 430px); aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; scroll-snap-align: start; border: 1px solid var(--edge); box-shadow: 0 8px 20px var(--shadow); }
.ban svg, .hero svg, .bimg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; }
.ban::after, .hero::after { content: ""; position: absolute; inset: 0 0 52% 0; background: linear-gradient(rgba(255, 255, 255, .42), rgba(255, 255, 255, .04)); pointer-events: none; }
.ban .cap { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 12px; padding: 30px 14px 12px; color: #fff; background: linear-gradient(transparent, rgba(0, 28, 48, .82)); }
.ban .cap .t { display: flex; flex-direction: column; min-width: 0; }
.ban .nm { font: 800 20px/1.2 var(--font-display); }
.ban .tg { font-size: 12.5px; line-height: 1.4; color: rgba(255, 255, 255, .9); }
.ban:hover { filter: brightness(1.05); }

/* project list and tiles */
.list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 12px; }
.list.grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); gap: 14px; }
.app { display: flex; align-items: center; gap: 14px; padding: 12px 14px; min-width: 0; transition: transform .12s; }
.app:hover { transform: translateY(-2px); }
.app:active { transform: translateY(1px); }
.app .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.app .nm { font: 800 18px/1.2 var(--font-display); overflow-wrap: anywhere; }
.by { color: var(--link); font-weight: 700; font-size: 13px; }
.app .tg { color: var(--muted); font-size: 13px; line-height: 1.4; }
.chev { font: 400 30px/1 var(--font-body); color: var(--muted); }
.grid .app { flex-direction: column; text-align: center; padding: 18px 12px; }
.grid .app .tx { align-items: center; }
.grid .chev { display: none; }
.pill { align-self: flex-start; display: inline-block; margin-top: 4px; padding: 1px 10px; border-radius: 999px; border: 1px solid rgba(0, 0, 0, .22); color: #fff; font: 800 11px var(--font-display); letter-spacing: .05em; text-transform: uppercase; text-shadow: 0 -1px 0 rgba(0, 0, 0, .35); box-shadow: 0 1px 0 rgba(255, 255, 255, .5) inset;
  background: linear-gradient(hsl(var(--sh, 0) var(--ss, 0%) 48%), hsl(var(--sh, 0) var(--ss, 0%) 30%)); }
.grid .pill { align-self: center; }

/* app icons: gloss is a class added to every icon unless turned off */
.icon { position: relative; flex: none; width: 72px; height: 72px; font-size: 38px; border-radius: 18px; display: grid; place-items: center; overflow: hidden;
  box-shadow: 0 4px 10px var(--shadow), 0 0 0 1px rgba(255, 255, 255, .5) inset; }
.icon.gloss { box-shadow: 0 4px 10px var(--shadow), 0 0 0 1px rgba(255, 255, 255, .65) inset, 0 -12px 16px rgba(0, 0, 0, .2) inset; }
.icon.gloss::after { content: ""; position: absolute; z-index: 1; left: 4%; right: 4%; top: 3%; height: 48%; border-radius: 16px 16px 50% 50% / 16px 16px 22px 22px; background: linear-gradient(rgba(255, 255, 255, .72), rgba(255, 255, 255, .1)); }
.icon img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.icon .ch { position: relative; z-index: 2; font: 800 1em/1 var(--font-display); color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .5); }
.icon svg { position: relative; z-index: 2; width: 56%; height: 56%; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .5)); }
.icon.sm { width: 46px; height: 46px; border-radius: 12px; font-size: 24px; }
.icon.lg { width: 104px; height: 104px; border-radius: 24px; border: 3px solid var(--edge); box-sizing: border-box; font-size: 56px; }
.icon.lg.gloss::after { border-radius: 20px 20px 50% 50% / 20px 20px 30px 30px; }

/* buttons */
.gbtn { display: inline-block; border: 1px solid var(--bd); border-radius: 10px; padding: 9px 26px; font: 800 16px var(--font-display); color: #fff; text-shadow: 0 -1px 0 var(--tsh); cursor: pointer;
  background: linear-gradient(var(--b1) 0%, var(--b2) 48%, var(--b3) 50%, var(--b2) 100%); box-shadow: 0 1px 0 rgba(255, 255, 255, .55) inset, 0 4px 10px var(--shadow); }
.gbtn:hover { filter: brightness(1.07); }
.gbtn:active { filter: brightness(.92); transform: translateY(1px); }
.gbtn.alt { color: var(--alt-fg); border-color: var(--alt-bd); text-shadow: 0 1px 0 var(--alt-ts); background: linear-gradient(var(--alt-a), var(--alt-b) 48%, var(--alt-c) 50%, var(--alt-d)); }

/* project page */
.back { display: inline-block; margin: 16px 2px 10px; font: 800 16px var(--font-display); color: var(--fg); }
.back:hover { color: var(--link); }
.page { overflow: hidden; }
.hero { position: relative; height: 150px; }
.body { padding: 0 18px 10px; }
.top { display: flex; gap: 16px; align-items: flex-start; margin-top: -46px; position: relative; z-index: 3; }
.top .id { padding-top: 54px; min-width: 0; }
.top h1 { font-size: clamp(24px, 5.5vw, 34px); line-height: 1.1; overflow-wrap: anywhere; }
.nohero .top { margin-top: 0; padding-top: 18px; }
.nohero .top .id { padding-top: 8px; }
.tag { margin: 14px 0 12px; max-width: 62ch; color: var(--muted); font-size: 15.5px; }
.tag a { color: var(--link); font-weight: 700; text-decoration: underline; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.tag-s { font: 700 12px var(--font-display); padding: 1px 10px; border-radius: 999px; background: linear-gradient(var(--alt-a), var(--alt-c)); border: 1px solid var(--alt-bd); color: var(--alt-fg); }
.acts { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.acts .pill { margin-top: 0; align-self: center; margin-left: 4px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); margin: 20px 0 4px; border-block: 1px solid var(--line); }
.stat { padding: 12px 8px; text-align: center; border-left: 1px solid var(--line); min-width: 0; }
.stat:first-child { border-left: 0; }
.stat .v { font: 800 19px/1.2 var(--font-display); overflow-wrap: anywhere; }
.stat .k { font-size: 12px; color: var(--muted); }

/* sections */
.secs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 36px; }
.sec { grid-column: 1 / -1; min-width: 0; margin-bottom: 8px; }
.sec.half { grid-column: auto; }
.sec p { margin: 0 0 12px; max-width: 64ch; }
.sec a { color: var(--link); font-weight: 700; text-decoration: underline; }
.sec ul, .sec ol { margin: 0 0 12px; padding-left: 22px; max-width: 64ch; }
.sec li::marker { color: var(--mark); }
.sec blockquote { margin: 0 0 12px; padding: 4px 14px; border-left: 4px solid var(--mark); color: var(--muted); max-width: 64ch; }
.sec pre { margin: 0 0 12px; padding: 12px 14px; overflow-x: auto; border-radius: 10px; background: var(--alt-d); font-size: 13px; line-height: 1.5; }
.sec pre code { background: none; padding: 0; font-size: inherit; }
.sh { font: 800 16px var(--font-display); margin: 14px 0 6px; }
.fig { margin: 4px 0 14px; max-width: 100%; }
.fig img, .pimg { display: block; max-width: 100%; border-radius: 10px; border: 3px solid var(--edge); box-shadow: 0 6px 16px var(--shadow); }
.pimg { margin: 6px 0 12px; }
.fig figcaption { color: var(--muted); font-size: 12.5px; margin-top: 6px; }
.shots { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 6px 14px 2px; }
.shot { flex: none; width: min(80%, var(--w, 380px)); scroll-snap-align: start; margin: 0; }
.frame { position: relative; aspect-ratio: var(--r, 16 / 10); border-radius: 12px; overflow: hidden; border: 3px solid var(--edge); box-shadow: 0 6px 16px var(--shadow); background: var(--alt-d); }
.frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: var(--fit, cover); display: block; }
.shot figcaption { margin-top: 8px; color: var(--muted); font-size: 12.5px; }
.post { border-top: 1px solid var(--line); }
.post:first-of-type { border-top: 0; }
.post summary { display: flex; align-items: baseline; gap: 10px; padding: 12px 0; cursor: pointer; list-style: none; }
.post summary::-webkit-details-marker { display: none; }
.post summary::before { content: "\25B8"; color: var(--link); transition: transform .15s; }
.post[open] > summary::before { transform: rotate(90deg); }
.post .pt { flex: 1; min-width: 0; font: 800 18px/1.25 var(--font-display); }
.post .d { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.post .pb { padding: 0 0 8px 22px; }
.facts { margin: 0; }
.facts div { display: flex; justify-content: space-between; gap: 18px; padding: 10px 0; border-top: 1px solid var(--line); }
.facts div:first-child { border-top: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; text-align: right; min-width: 0; overflow-wrap: anywhere; font-weight: 500; }
.facts .nokey dt { display: none; }
.facts .nokey dd { text-align: left; }
.chips.free { justify-content: flex-start; margin: 0 0 12px; }
.state { padding: 18px; color: var(--muted); max-width: 62ch; margin-top: 16px; }
.state p { margin: 0; }
.state .gbtn { margin-top: 14px; }
.foot { text-align: center; color: var(--muted); font-size: 12.5px; margin-top: 30px; }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); padding: 9px 18px; border-radius: 999px; color: #fff; font: 700 13px var(--font-display); background: rgba(8, 36, 56, .92); border: 1px solid rgba(255, 255, 255, .35); }
@media (max-width: 720px) {
  .secs { grid-template-columns: minmax(0, 1fr); }
  .sec.half { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .stat:nth-child(odd) { border-left: 0; }
  .icon.lg { width: 88px; height: 88px; border-radius: 20px; font-size: 48px; }
  .top .id { padding-top: 52px; }
  .nohero .top .id { padding-top: 6px; }
  .hero { height: 128px; }
}
@media (prefers-reduced-motion: reduce) { .app, .post summary::before { transition: none; } .app:hover { transform: none; } }
