/* madgeeked shared look. Used by the main site and by every project's docs site. */
:root {
  --bg: #0a0914; --panel: rgba(18, 17, 31, .72); --panel-solid: #12111f; --line: #2a2842; --text: #f1f0fb; --dim: #a3a1bd;
  --blue: #1855da; --indigo: #5544d5; --purple: #9535ca;
  --grad: linear-gradient(135deg, #1855da, #5544d5 55%, #9535ca);
  --accent: #8b97ff; --honey: #ffc247;
  --display: "Outfit", "Helvetica Neue", Arial, system-ui, sans-serif;
  --body: "Outfit", "Helvetica Neue", Arial, system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body { margin: 0; min-height: 100vh; background: radial-gradient(900px 500px at 15% 0%, rgba(85,68,213,.16), transparent 70%), radial-gradient(800px 500px at 100% 100%, rgba(149,53,202,.14), transparent 70%), var(--bg); background-attachment: fixed; color: var(--text); font: 17px/1.6 var(--body); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.wrap { max-width: 880px; margin: 0 auto; padding: 0 24px; position: relative; }
.gh { display: inline-flex; align-items: center; gap: 8px; }
.gh svg { width: 18px; height: 18px; fill: currentColor; }

/* The visualizer lives behind the whole page. */
#flow { position: fixed; left: 0; right: 0; bottom: 0; width: 100%; height: 34vh; z-index: -1; pointer-events: none; display: block; }

/* Name and logo: four places, switched by body class (hdr-left, hdr-right, hdr-center, hdr-hero). */
.top { display: flex; align-items: center; gap: 16px; padding: 22px 0; --hs: 56px; --hl: 44px; }
.top a.brand { display: inline-flex; align-items: center; gap: 16px; text-decoration: none; color: inherit; }
.top img { width: var(--hl); height: auto; flex: none; }
.brandname { font-family: var(--namefont, var(--display)); font-weight: var(--namew, 800); font-size: calc(var(--ns, 1) * var(--hs)); line-height: .95; letter-spacing: var(--nametrack, -.045em); margin: 0; }
body.hdr-left .top { justify-content: flex-start; }
body.hdr-right .top { justify-content: flex-end; }
body.hdr-center .top { justify-content: center; --hs: 72px; --hl: 60px; }
body.hdr-hero .top { justify-content: flex-start; padding: 64px 0 28px; --hs: min(88px, 14vw); --hl: clamp(56px, 11vw, 92px); gap: 22px; }
body.hdr-hero .top a.brand { gap: 22px; }
.spacer { height: clamp(24px, 12vh, 120px); }
body.hdr-hero .spacer { height: clamp(24px, 14vh, 150px); }

section { padding: 22px 0 8px; }
.project { display: grid; gap: 22px; background: var(--panel); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border: 1px solid var(--line); border-radius: 18px; padding: 28px; align-items: center; }
.project .head { display: flex; align-items: center; gap: 18px; }
.project .head img { width: 72px; height: 72px; flex: none; }
.project h2 { font: 700 34px/1.05 var(--display); letter-spacing: -.03em; margin: 0; background: linear-gradient(90deg, #6b9bff, #cf7bf5); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tag { margin: 4px 0 0; font-weight: 650; background: linear-gradient(90deg, #6b9bff, #cf7bf5); -webkit-background-clip: text; background-clip: text; color: transparent; }
.facts { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; color: var(--dim); font-size: 16px; }
.facts li::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--grad); margin-right: 10px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 18px; }
.btn { display: inline-block; text-decoration: none; font-weight: 650; padding: 11px 20px; border-radius: 999px; border: 1px solid var(--line); background: rgba(10, 9, 20, .35); color: var(--text); transition: border-color .15s, filter .15s; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--grad); color: #fff; border-color: transparent; }
.btn.primary:hover { filter: brightness(1.12); }
.btn.big { font-size: 20px; padding: 16px 34px; }
.btn.honey { border-color: var(--honey); color: var(--honey); }
.btn.honey:hover { background: rgba(255, 194, 71, .12); }

.more { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 36px 0 64px; }
.socials { display: flex; flex-wrap: wrap; gap: 18px; }
.socials a { color: var(--dim); text-decoration: none; }
.socials a:hover { color: var(--text); }
@media (min-width: 720px) { .project { grid-template-columns: 1.3fr 1fr; padding: 34px; } }

/* Scenic backgrounds (themes.js). Every theme gets an outline on the name and logo so they read on any scene. */
#scene { position: fixed; inset: 0; z-index: -2; background: #ffb070; overflow: hidden; }
.mgs { position: absolute; inset: 0; overflow: hidden; transition: opacity .6s ease; pointer-events: none; }
.mgs img { max-width: none; display: block; }
body.scenic, body.scenic-docs { background: transparent; }
body.scenic #flow { display: none; }
body.scenic-docs #flow { opacity: .85; }
body[data-theme="honey"] { --panel: rgba(50, 24, 6, .55); --line: rgba(255, 220, 160, .28); }
body[data-theme="autumn"] { --panel: rgba(50, 22, 8, .55); --line: rgba(255, 210, 150, .28); }
body[data-theme="golden"] { --panel: rgba(40, 10, 20, .55); --line: rgba(255, 200, 170, .28); }
body[data-theme="lake-teal"] { --panel: rgba(8, 40, 44, .55); --line: rgba(170, 235, 235, .3); }
body[data-theme="chanceify"] { --panel: rgba(20, 8, 40, .62); --line: rgba(200, 170, 255, .28); }
body[data-theme] .brandname { color: #fff; -webkit-text-stroke: 5px rgba(12, 8, 20, .65); paint-order: stroke fill; text-shadow: 0 2px 14px rgba(0, 0, 0, .3); }
body[data-theme] .top .brand img { filter: drop-shadow(2px 0 0 #1a0f08) drop-shadow(-2px 0 0 #1a0f08) drop-shadow(0 2px 0 #1a0f08) drop-shadow(0 -2px 0 #1a0f08); }
body[data-theme] .btn.honey { background: rgba(30, 16, 4, .62); }
body[data-theme] .btn { background: rgba(10, 9, 20, .5); }
body[data-theme] .btn.primary { background: var(--grad); }
body[data-theme] .facts, body[data-theme] .socials a { color: #e8e3f5; }
body[data-theme] .socials a { text-shadow: 0 1px 6px rgba(0, 0, 0, .6); }
.themes { position: fixed; top: 16px; left: 16px; z-index: 5; }
.themes button { font: 500 15px/1 var(--body); color: #fff; background: rgba(12, 8, 20, .55); border: 1px solid rgba(255, 255, 255, .3); border-radius: 999px; cursor: pointer; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.themes button:hover { border-color: #fff; }
.themes .tbtn { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px 8px 14px; }
.themes .em { font-size: 18px; line-height: 1; }
.themes .ar svg { width: 12px; height: 8px; display: block; transition: transform .2s; }
.themes.open .ar svg { transform: rotate(180deg); }
.tmenu { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.tmenu[hidden] { display: none; }
.tmenu button { display: inline-flex; align-items: center; justify-content: center; padding: 8px 14px; }
.tmenu button[aria-current="true"] { box-shadow: 0 0 0 2px rgba(255, 255, 255, .9); }
@media (hover: none) { [data-hover-theme] { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; } }
.top a.brand { flex-direction: row-reverse; }
body[data-theme] .socials a { background: rgba(30, 16, 4, .62); border: 1px solid rgba(255, 255, 255, .28); border-radius: 999px; padding: 9px 18px; font-weight: 650; color: #fff; text-shadow: none; }
body[data-theme] .socials a:hover { border-color: #fff; }

/* one font everywhere, readable on any device */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body, button, input, select, textarea, a { font-family: var(--body); }
body { text-rendering: optimizeLegibility; font-synthesis: none; }
.facts, .doc table, .shots figcaption, .foot, .nav { min-height: 0; }
body[data-theme] .facts, body[data-theme] .doc p, body[data-theme] .doc li { text-shadow: 0 1px 8px rgba(0, 0, 0, .55); }
@media (max-width: 600px) { body { font-size: 16px; } .facts { font-size: 15px; } }

/* buy me a honey: honey pours over the button on hover */
.btn.honey { position: relative; overflow: hidden; isolation: isolate; display: inline-flex; align-items: center; gap: 8px; }
.btn.honey .hn { font-size: 1.15em; line-height: 1; display: inline-block; }
.btn.honey .hd { position: absolute; left: 0; right: 0; top: 0; height: 100%; z-index: -1; background: linear-gradient(#ffcf47, #f0a020); transform: translateY(-112%); transition: transform .75s cubic-bezier(.45, .05, .25, 1); pointer-events: none; }
.btn.honey .hd::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 16px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='16' viewBox='0 0 40 16'%3E%3Cpath d='M0 0h40v6c-4 0-4 9-8 9s-4-6-8-6-3 7-7 7-4-10-8-10-5 5-9 5z' fill='%23f0a020'/%3E%3C/svg%3E") repeat-x; }
.btn.honey:hover .hd, .btn.honey:focus-visible .hd { transform: translateY(0); }
.btn.honey:hover, .btn.honey:focus-visible { color: #3a1e04; border-color: #ffcf47; }
.btn.honey .hn { transition: transform .4s .2s; }
.btn.honey:hover .hn { transform: translateY(-1px) rotate(-12deg) scale(1.15); }

/* github: the icon pops and shakes */
.socials a.gh { display: inline-flex; align-items: center; gap: 8px; }
.socials a.gh svg { width: 18px; height: 18px; fill: currentColor; transition: transform .2s; }
.socials a.gh img { width: 24px; height: 24px; border-radius: 6px; object-fit: cover; transition: transform .2s; }
.socials a.gh:hover svg, .socials a.gh:focus-visible svg, .socials a.gh:hover img, .socials a.gh:focus-visible img { animation: ghpop .7s ease both; }
@keyframes ghpop { 0% { transform: scale(1) rotate(0); } 20% { transform: scale(1.5) rotate(-14deg); } 35% { transform: scale(1.5) rotate(12deg); } 50% { transform: scale(1.5) rotate(-10deg); } 65% { transform: scale(1.5) rotate(8deg); } 80% { transform: scale(1.5) rotate(-4deg); } 100% { transform: scale(1.4) rotate(0); } }
@media (prefers-reduced-motion: reduce) { .btn.honey .hd { transition: none; } .socials a.gh:hover svg { animation: none; transform: scale(1.3); } }

/* bear next to every link to madgeeked / chance */
a.bearlink { white-space: nowrap; }
a.bearlink img { width: 1.35em; height: 1.35em; vertical-align: -.38em; margin-left: .4em; border-radius: 5px; object-fit: cover; }

/* phones: the chanceify card is a small row instead of a big block */
@media (max-width: 600px) {
  .project { gap: 10px; padding: 14px 16px; border-radius: 16px; grid-template-columns: 1fr; }
  .project > div:first-child { display: flex; flex-direction: column; gap: 10px; }
  .project .head { gap: 12px; min-width: 0; }
  .project .head img { width: 44px; height: 44px; }
  .project h2 { font-size: 22px; }
  .project .tag { margin-top: 2px; font-size: 13px; }
  .project .actions { margin-top: 0; gap: 8px; flex-wrap: nowrap; }
  .project .btn { padding: 8px 16px; font-size: 14px; flex: 1; text-align: center; }
  .project .facts { display: none; }
}
