/* Rubin IT project showcase. Colours and shapes follow rubinit.net. */
:root {
  --navy: #352D59;
  --navy-deep: #2a2347;
  --orange: #E88829;
  --orange-dark: #c96f17;
  --bg: #FFFFFF;
  --bg-alt: #F4F4F4;
  --card: #FFFFFF;
  --text: #3a3a3a;
  --muted: #6b6880;
  --chip-bg: #EEECF5;
  --chip-text: #352D59;
  --icon-bg: #352D59;
  --shadow: 1px 1px 5px rgba(0, 0, 0, .2);
  --shadow-hover: 0 10px 28px rgba(53, 45, 89, .22);
  --radius: 20px;
  --pill: 69px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1d1933;
    --bg-alt: #16132a;
    --card: #262043;
    --text: #ecebf3;
    --muted: #b4b0c8;
    --chip-bg: #352D59;
    --chip-text: #f2eefc;
    --icon-bg: #3f3670;
    --shadow: 0 1px 4px rgba(0, 0, 0, .5);
    --shadow-hover: 0 10px 28px rgba(0, 0, 0, .55);
  }
}
:root[data-theme="dark"] {
  --bg: #1d1933;
  --bg-alt: #16132a;
  --card: #262043;
  --text: #ecebf3;
  --muted: #b4b0c8;
  --chip-bg: #352D59;
  --chip-text: #f2eefc;
  --icon-bg: #3f3670;
  --shadow: 0 1px 4px rgba(0, 0, 0, .5);
  --shadow-hover: 0 10px 28px rgba(0, 0, 0, .55);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Nunito Sans", "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}
a { color: inherit; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

/* Header */
.site-header { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 10; }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 76px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
.lockup { display: inline-flex; flex-direction: column; line-height: 1; text-decoration: none; color: #fff; }
.lockup-top { font-size: 30px; font-weight: 800; letter-spacing: .3px; }
.lockup-it { color: var(--orange); }
.lockup-sub { font-size: 12px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; margin-top: 4px; opacity: .9; }
.nav { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.nav a { text-decoration: none; font-weight: 600; }
.nav a:not(.pill):hover { color: var(--orange); }

/* Buttons */
.pill {
  display: inline-block; background: var(--orange); color: #fff; text-decoration: none;
  font-weight: 700; border-radius: var(--pill); padding: 11px 24px; transition: background .15s;
}
.pill:hover { background: var(--orange-dark); }
.pill:focus-visible, .card a:focus-visible, .nav a:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }
.pill-small { padding: 8px 18px; font-size: 15px; }

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-deep) 100%);
  color: #fff; padding: 64px 0 72px; position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; right: -120px; top: -120px; width: 360px; height: 360px;
  border-radius: 50%; background: var(--orange); opacity: .14;
}
.eyebrow { color: var(--orange); font-weight: 800; text-transform: uppercase; letter-spacing: 2px; font-size: 13px; margin: 0 0 8px; }
.hero h1 { font-size: clamp(32px, 5vw, 52px); line-height: 1.1; margin: 0 0 12px; font-weight: 800; }
.lead { font-size: clamp(18px, 2.4vw, 22px); font-weight: 700; margin: 0 0 12px; }
.intro { max-width: 640px; margin: 0; opacity: .88; }

/* Grid */
.projects { background: var(--bg-alt); padding: 56px 0 72px; }
.section-title { color: var(--navy); font-size: 30px; font-weight: 800; margin: 0 0 28px; }
:root[data-theme="dark"] .section-title { color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .section-title { color: #fff; } }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 24px; }
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 26px 24px 24px; display: flex; flex-direction: column; aspect-ratio: 1 / 1;
  transition: transform .18s ease, box-shadow .18s ease; border-top: 5px solid var(--orange);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.icon {
  width: 52px; height: 52px; border-radius: 14px; background: var(--icon-bg); color: var(--orange);
  display: grid; place-items: center; margin-bottom: 16px; flex: none;
}
.icon svg { width: 28px; height: 28px; }
.card h3 { margin: 0 0 8px; font-size: 20px; font-weight: 800; line-height: 1.25; }
.card p { margin: 0 0 14px; color: var(--muted); font-size: 15px;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.chip { background: var(--chip-bg); color: var(--chip-text); font-size: 12px; font-weight: 700; border-radius: var(--pill); padding: 3px 10px; }
.card .pill { margin-top: auto; align-self: flex-start; padding: 9px 20px; font-size: 15px; }
.loading { color: var(--muted); }

/* Footer */
.site-footer { background: var(--navy); color: #fff; padding: 36px 0 20px; }
.footer-row { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.lockup-footer .lockup-top { font-size: 24px; }
.footer-links { display: flex; gap: 22px; flex-wrap: wrap; }
.footer-links a { text-decoration: none; font-weight: 600; }
.footer-links a:hover { color: var(--orange); }
.copyright { margin-top: 24px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.15); font-size: 14px; opacity: .8; }

@media (max-width: 600px) {
  .grid { grid-template-columns: 1fr; }
  .card { aspect-ratio: auto; min-height: 280px; }
  .header-row { justify-content: center; }
  .nav { justify-content: center; gap: 16px; }
  .hero { padding: 44px 0 52px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card, .pill { transition: none; }
  .card:hover { transform: none; }
}

/* Placeholder squares: no repo yet */
.pill-soon { background: transparent; color: var(--muted); border: 2px dashed var(--muted); cursor: default; }
.pill-soon:hover { background: transparent; }
.card-soon { border-top-style: dashed; }

/* Image logo from rubinit.net */
  .lockup { width: 160px; height: 53px; background: url("logo_lockup_rubin_it_bigger_dark_bg.png") left center / contain no-repeat; }
.lockup-top, .lockup-sub { display: none; }
.lockup-footer { width: 130px; height: 43px; }
/* Centered hero */
.hero { text-align: center; }
.hero .lead, .hero .intro { margin-left: auto; margin-right: auto; }

/* Release squares: click opens the latest release and notes */
.card-open { cursor: pointer; }
.card-open:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }
.card p { -webkit-line-clamp: 3; }
.card-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.card-foot .pill { margin-top: 0; }
.ver { font-size: 13px; font-weight: 800; color: var(--muted); overflow-wrap: anywhere; }
.ver-none { font-weight: 600; font-style: italic; }
.pill-notes { background: transparent; color: var(--navy); border: 2px solid var(--navy); cursor: pointer; }
:root[data-theme="dark"] .pill-notes { color: #fff; border-color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pill-notes { color: #fff; border-color: #fff; } }

.pj-box h3 { margin: 22px 0 8px; font-size: 18px; font-weight: 800; }
.rel-meta { margin: 0 0 12px; color: var(--muted); }
.rel-meta a { color: var(--orange-dark); font-weight: 700; }
.rel-kind { background: var(--chip-bg); color: var(--chip-text); font-size: 12px; font-weight: 800; border-radius: var(--pill); padding: 3px 10px; margin-right: 6px; }
.rel-kind-pre { background: #fdebd3; color: #7a4310; }
.rel-warn { margin: 0 0 12px; padding: 8px 12px; border-left: 4px solid var(--orange); background: var(--bg-alt); border-radius: 6px; font-size: 14px; }
.rel-files { list-style: none; margin: 4px 0 8px; padding: 0; display: grid; gap: 10px; }
.rel-files li { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; overflow-wrap: anywhere; }
.rel-files em { color: var(--muted); font-style: normal; font-size: 14px; }
.rel-notes { overflow-wrap: anywhere; }
.rel-notes > :first-child { margin-top: 0; }
.rel-notes img { max-width: 100%; height: auto; }
.rel-notes pre, .rel-notes code { background: var(--bg-alt); border-radius: 6px; font-size: 14px; }
.rel-notes code { padding: 1px 5px; }
.rel-notes pre { padding: 12px; overflow: auto; }
.rel-notes pre code { padding: 0; background: none; }
.rel-notes a, .rel-links a { color: var(--orange-dark); font-weight: 600; }
.rel-notes table { border-collapse: collapse; max-width: 100%; display: block; overflow: auto; }
.rel-notes th, .rel-notes td { border: 1px solid var(--chip-bg); padding: 4px 8px; }
.rel-links { margin: 20px 0 0; display: flex; gap: 18px; flex-wrap: wrap; }
.rel-checked { margin: 14px 0 0; font-size: 13px; color: var(--muted); }

/* Aligned squares (2026-11-24): every card in a row is the same height, and the title, description,
   tags and the version/Download row line up across cards (titles get two lines, descriptions three). */
.grid { align-items: stretch; }
.card { aspect-ratio: auto; min-height: 320px; height: 100%; }
.card h3 { min-height: calc(2 * 1.25em); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card p { min-height: calc(3 * 1.55em); }
.card .chips { min-height: 26px; }
@media (max-width: 600px) { .card h3, .card p { min-height: 0; } }

.pill-ghost { background: transparent; color: var(--navy); border: 2px solid var(--navy); padding: 7px 18px !important; }
.pill-ghost:hover { background: var(--navy); color: #fff; }
:root[data-theme="dark"] .pill-ghost { color: #fff; border-color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pill-ghost { color: #fff; border-color: #fff; } }
.readme { overflow-wrap: anywhere; border-top: 1px solid var(--chip-bg); padding-top: 8px; }
.readme h1, .readme h2, .readme h3, .readme h4 { color: var(--text); font-weight: 800; line-height: 1.25; margin: 26px 0 10px; scroll-margin-top: 16px; }
.readme h1 { font-size: 24px; } .readme h2 { font-size: 22px; } .readme h3 { font-size: 18px; } .readme h4 { font-size: 16px; }
.readme img { max-width: 100%; height: auto; border-radius: 10px; box-shadow: var(--shadow); margin: 8px 0; }
.readme a { color: var(--orange-dark); font-weight: 600; }
:root[data-theme="dark"] .readme a { color: var(--orange); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .readme a { color: var(--orange); } }
.readme pre, .readme code { background: var(--bg-alt); border-radius: 6px; font-size: 14px; }
.readme code { padding: 1px 5px; }
.readme pre { padding: 12px; overflow: auto; }
.readme pre code { padding: 0; background: none; }
.readme table { border-collapse: collapse; max-width: 100%; display: block; overflow: auto; margin: 10px 0; }
.readme th, .readme td { border: 1px solid var(--chip-bg); padding: 6px 10px; text-align: left; vertical-align: top; }
.readme th { background: var(--bg-alt); }
.readme blockquote { margin: 12px 0; padding: 8px 14px; border-left: 4px solid var(--orange); background: var(--bg-alt); border-radius: 6px; }
.readme .markdown-alert { margin: 12px 0; padding: 8px 14px; border-left: 4px solid var(--orange); background: var(--bg-alt); border-radius: 6px; }
.readme .markdown-alert-title { font-weight: 800; display: flex; align-items: center; gap: 6px; margin: 0 0 4px; }
.readme svg.octicon { width: 16px; height: 16px; fill: currentColor; }
.card .pill-soon { padding: 7px 18px; } /* same height as the Download pill (2px dashed border) */

/* Whole square is a link to the project page (stretched title link); Download stays its own link. */
.card { position: relative; }
.card-link { color: inherit; text-decoration: none; }
.card-link::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.card-link:focus-visible { outline: none; }
.card-link:focus-visible::after { outline: 3px solid var(--orange); outline-offset: 3px; }
.card .pill-dl { position: relative; z-index: 1; }

/* Project page */
.pj-bar { background: var(--navy); color: #fff; }
.pj-bar-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; flex-wrap: wrap; }
.pj-back { color: #fff; font-weight: 700; text-decoration: none; }
.pj-back:hover, .pj-foot a:hover { color: var(--orange); }
.pj-main { background: var(--bg-alt); padding: 40px 0 64px; }
.pj-wrap { max-width: 900px; }
.pj-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.pj-head .icon { margin: 0; width: 64px; height: 64px; border-radius: 16px; }
.pj-head .icon svg { width: 34px; height: 34px; }
.pj-title { flex: 1 1 240px; }
.pj-title h1, .pj-missing { margin: 0 0 6px; font-size: clamp(28px, 4.5vw, 40px); line-height: 1.15; font-weight: 800; color: var(--navy); }
.pj-title .chips { margin: 0; }
.pj-blurb { font-size: 18px; color: var(--muted); margin: 16px 0 24px; }
.pj-box { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border-top: 5px solid var(--orange); padding: 24px 28px; margin: 0 0 24px; }
.pj-box h2 { margin: 0 0 12px; font-size: 22px; font-weight: 800; color: var(--navy); }
.pj-box .readme { border-top: 0; padding-top: 0; }
.pj-box .readme > :first-child { margin-top: 0; }
.pj-foot { margin: 8px 0 0; }
.pj-foot a { color: var(--muted); font-weight: 700; text-decoration: none; }
:root[data-theme="dark"] .pj-title h1, :root[data-theme="dark"] .pj-missing, :root[data-theme="dark"] .pj-box h2 { color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pj-title h1, :root:not([data-theme="light"]) .pj-missing, :root:not([data-theme="light"]) .pj-box h2 { color: #fff; } }
@media (max-width: 600px) { .pj-box { padding: 20px 18px; } .pj-main { padding-top: 28px; } }

/* Stable release plus a newer prerelease */
.ver-pre { display: block; font-weight: 600; font-size: 12px; color: #a35a10; margin-top: 2px; }
:root[data-theme="dark"] .ver-pre { color: var(--orange); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ver-pre { color: var(--orange); } }
.rel-pre-block { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--chip-bg); }
.rel-files .pill-ghost { padding: 9px 22px !important; }
