/* SoftGrid Labs — shared look for every page: warm dark panels ("embers"), thin borders and system type, coloured by
   the logo — amber for the main action, rose for highlights, light amber links. Header, buttons, cards, labels, footer,
   scroll reveal. Page extras: home.css, project.css, account.css. */
@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/jetbrains-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #100c0b;
  --bg-inset: #0a0807;
  --panel: #1a1312;
  --panel-2: #241b19;
  --border: #352a27;
  --border-muted: #352a27b3;
  --border-strong: #5a4943;
  --text: #f5eeea;
  --muted: #a8968f;
  --faint: #76655f;
  /* the logo's two squares, plus a few friends */
  --primary: #ffb347;
  --primary-hover: #ffc46b;
  --primary-dim: rgb(255 179 71 / .12);
  --rose: #ff5e7e;
  --rose-dim: rgb(255 94 126 / .12);
  --sky: #7cc4ff;
  --violet-new: #b69cff;
  --amber: #ffd27a;
  --link: #ffc98a;
  --green: var(--primary);
  --green-btn: var(--primary);
  --green-btn-hover: var(--primary-hover);
  --purple: var(--violet-new);
  --orange: var(--amber);
  --red: #ff5d5d;
  /* old names, still used by inline styles on some pages */
  --violet: var(--link);
  --violet-400: var(--link);
  --violet-300: var(--link);
  --indigo: var(--link);
  --cyan: var(--green);
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "JetBrains Mono", monospace;
  --radius: .375rem;
  --radius-lg: .75rem;
}

* { box-sizing: border-box; }
/* sizes are in rem, so the layout grows a little on wide screens: 16px up to 1600px wide, then up to 20px on 2K and wider */
html { background: var(--bg); overflow-x: clip; scroll-behavior: smooth; scroll-padding-top: 5rem;
  font-size: clamp(1rem, calc(1rem + (100vw - 1600px) * .004), 1.25rem); }
body { margin: 0; background: var(--bg); color: var(--text); font: .9375rem/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: var(--radius); }
code { font: .85em var(--mono); padding: .15em .4em; border-radius: var(--radius); background: rgb(168 150 143 / .14); color: var(--text); }
.wrap { width: 100%; max-width: 80rem; margin: 0 auto; padding: 0 1rem; }
@media (min-width: 760px) { .wrap { padding: 0 2rem; } }
.mono { font-family: var(--mono); font-size: .75rem; color: var(--muted); }
.silver { color: var(--text); }

/* the old starfield and hero lights are gone in this design */
.space, .beam, .glow, .sheen, #particles { display: none !important; }
main, .site-header, .site-footer { position: relative; z-index: 1; }

/* ---------- header: a solid bar like GitHub's ---------- */
.site-header { position: sticky; top: 0; z-index: 20; background: var(--bg-inset); border-bottom: 1px solid var(--border-muted); }
.site-header .wrap { display: flex; align-items: center; gap: 1.5rem; height: 4rem; max-width: none; }
.header-right { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
.brand { display: flex; align-items: center; gap: .625rem; color: var(--text); font-weight: 600; font-size: .9375rem; white-space: nowrap; }
.brand:hover { text-decoration: none; color: var(--text); }
.brand img { width: 2rem; height: 2rem; image-rendering: pixelated; border-radius: 50%; transition: transform .5s cubic-bezier(.3,1.6,.5,1); }
.brand:hover img { transform: rotate(-12deg) scale(1.08); }
.nav { display: flex; gap: .25rem; }
.nav a { position: relative; color: var(--text); font-size: .875rem; font-weight: 500; padding: .375rem .625rem; border-radius: var(--radius); transition: background .15s; }
.nav a:hover { background: rgb(168 150 143 / .14); text-decoration: none; }
.nav a[aria-current="page"]::after { content: ""; position: absolute; left: .625rem; right: .625rem; bottom: -.9375rem; height: 2px;
  border-radius: 2px; background: var(--rose); }
@media (max-width: 760px) { .nav { display: none; } }

/* ---------- buttons: .light is the green primary, .dark the default grey ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; height: 2rem; padding: 0 .75rem; border-radius: var(--radius);
  font: 500 .875rem/1 var(--sans); white-space: nowrap; cursor: pointer; border: 1px solid var(--border);
  color: var(--text); background: var(--panel-2); transition: background .15s, border-color .15s, transform .1s; }
.btn:hover { text-decoration: none; background: #2c2220; border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn.light { color: #100c0b; font-weight: 600; background: var(--primary); border-color: transparent; box-shadow: 0 0 0 0 rgb(255 179 71 / 0); }
.btn.light:hover { background: var(--primary-hover); box-shadow: 0 0 1.25rem rgb(255 179 71 / .25); }
.site-header .btn.dark { background: transparent; }
.site-header .btn.dark:hover { background: rgb(168 150 143 / .14); }
.btn.big { height: 2.5rem; padding: 0 1.125rem; font-size: .9375rem; }

/* ---------- animations switch (common.js) ---------- */
/* an icon button left of Log in / Account: amber sparkle while on, crossed out and grey while off */
.motion-btn { display: inline-grid; place-items: center; width: 2rem; height: 2rem; padding: 0; border-radius: var(--radius); cursor: pointer;
  border: 1px solid var(--border); background: transparent; color: var(--primary); transition: background .15s, border-color .15s, color .15s; }
.motion-btn:hover { background: rgb(168 150 143 / .14); border-color: var(--border-strong); }
.motion-btn svg { width: 1rem; height: 1rem; }
.still .motion-btn { color: var(--muted); }
.motion-btn .off { display: none; }
.still .motion-btn .on { display: none; }
.still .motion-btn .off { display: block; }


/* ---------- labels ---------- */
.chips { display: flex; gap: .375rem; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: .375rem; padding: 0 .5rem; height: 1.375rem; border-radius: 2rem; font-size: .75rem; font-weight: 500;
  color: var(--link); background: rgb(255 201 138 / .1); border: 1px solid transparent; }
.chip.plain { color: var(--muted); background: transparent; border-color: var(--border); }
.chip.live { color: var(--primary); background: var(--primary-dim); border-color: rgb(255 179 71 / .35); }
.chip.live::before { content: ""; width: .375rem; height: .375rem; border-radius: 50%; background: currentColor; }

/* ---------- cards (project tiles): a bordered box with a screenshot on top ---------- */
.bento { display: grid; gap: 1rem; }
.tile { --mx: -999px; --my: -999px; position: relative; display: flex; flex-direction: column; overflow: hidden; border-radius: var(--radius-lg);
  color: var(--text); background: var(--bg); border: 1px solid var(--border); isolation: isolate;
  transition: border-color .2s, transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s; }
/* a soft light that follows the pointer (space.js / index.html set --mx and --my) */
.tile::after, .shot::after { content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none; border-radius: inherit;
  background: radial-gradient(22rem circle at var(--mx) var(--my), rgb(255 179 71 / .06), transparent 60%); }
a.tile:hover { text-decoration: none; border-color: var(--border-strong); box-shadow: 0 .75rem 2rem rgb(1 4 9 / .55); }
.visual { position: relative; display: grid; place-items: center; overflow: hidden; background: var(--bg-inset); border-bottom: 1px solid var(--border-muted); }
.visual img { transition: transform .6s cubic-bezier(.2,.8,.2,1); }
a.tile:hover .visual img { transform: scale(1.03); }
.tilt { aspect-ratio: 16 / 10; }
.tilt img { width: 100%; height: 100%; object-fit: cover; object-position: top left; }
.fan { aspect-ratio: 16 / 10; display: flex; justify-content: center; align-items: flex-start; gap: 4%; padding: 6% 6% 0; }
.fan img { width: 26%; border-radius: .75rem .75rem 0 0; border: 1px solid var(--border); border-bottom: 0; }
.fan img:nth-child(2) { margin-top: 3%; }

.cap { position: relative; padding: 1rem 1.125rem 1.125rem; }
.cap .chips { margin-bottom: .5rem; }
.cap h3 { margin: 0; font-size: 1.125rem; font-weight: 600; color: var(--text); }
.cap p { margin: .25rem 0 0; color: var(--muted); font-size: .875rem; }
.go { position: absolute; right: 1rem; bottom: 1.125rem; color: var(--muted); transition: transform .2s, color .2s; }
a.tile:hover .go { color: var(--primary); transform: translateX(.25rem); }

/* ---------- closing call to action ---------- */
.outro { position: relative; max-width: min(calc(100% - 2rem), 76rem); margin: 5rem auto 0; padding: 3.5rem 1.5rem; text-align: center;
  border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--panel); overflow: hidden; isolation: isolate; }
.outro::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .5;
  background-image: linear-gradient(var(--border-muted) 1px, transparent 1px), linear-gradient(90deg, var(--border-muted) 1px, transparent 1px);
  background-size: 2rem 2rem; -webkit-mask-image: radial-gradient(ellipse 60% 80% at 50% 0%, #000, transparent);
  mask-image: radial-gradient(ellipse 60% 80% at 50% 0%, #000, transparent); }
.outro h2 { margin: .75rem auto 0; max-width: 24ch; font-size: clamp(1.75rem, 3.5vw, 2.5rem); font-weight: 600; letter-spacing: -.02em; line-height: 1.15; }
.outro p { margin: .75rem auto 1.75rem; max-width: 46ch; color: var(--muted); }
.outro .cta { display: flex; flex-wrap: wrap; gap: .625rem; justify-content: center; }

/* ---------- footer ---------- */
.site-footer { margin-top: 5rem; padding: 2.5rem 0 2rem; border-top: 1px solid var(--border-muted); color: var(--muted); font-size: .75rem; }
.foot-top { display: grid; gap: 2rem; margin-bottom: 2rem; }
@media (min-width: 760px) { .foot-top { grid-template-columns: 1.2fr 2fr; } }
.foot-brand .brand { margin-bottom: .75rem; }
.foot-brand p { max-width: 32ch; margin: 0; font-size: .8125rem; }
.foot-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 1.5rem; }
.foot-cols h4 { margin: 0 0 .75rem; font-size: .8125rem; font-weight: 600; color: var(--text); }
.foot-cols a { display: block; width: fit-content; margin-bottom: .5rem; color: var(--muted); font-size: .8125rem; }
.foot-cols a:hover { color: var(--primary); }
.foot-bottom { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between; align-items: center; padding-top: 1.25rem;
  border-top: 1px solid var(--border-muted); }
.site-footer p { margin: 0; }
.site-footer a { color: var(--muted); }
.legal { flex-basis: 100%; font-size: .6875rem; color: var(--faint); }

/* ---------- reveal on scroll (class added by script) ---------- */
.js .reveal { opacity: 0; transform: translateY(1rem); transition: opacity .6s ease, transform .6s cubic-bezier(.2,.8,.2,1), border-color .2s, box-shadow .25s; }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- animations off: the system asks for less motion, or the visitor switched them off (common.js sets .still) ---------- */
.still *, .still *::before, .still *::after { animation: none !important; transition: none !important; }
.still .reveal { opacity: 1; transform: none; }
html.still { scroll-behavior: auto; }
