/* ShackAssistant website - the page itself.

   Light on purpose: the logo is drawn for a light ground - its dark "SHACK" and the tagline vanish on a
   dark one. Every colour is named here once. */
:root{
  --bg:      #f4f7fb;
  --paper:   #ffffff;
  --ink:     #0f1b2d;
  --muted:   #55657a;
  --line:    #dde5ef;
  --blue:    #1570c9;   /* text-safe version of the logo blue */
  --cyan:    #27a8ec;   /* the logo's bright blue */
  --navy:    #0b1830;
  --gold:    #c98a00;
  --ok:      #1d7a36;
  --maxw:    1180px;
  --radius:  12px;
}

*{ box-sizing: border-box; }
html{ -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body{
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.65 "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
}
img{ max-width: 100%; height: auto; }
a{ color: var(--blue); }
a:hover{ color: var(--cyan); }
code, kbd, pre{ font-family: Consolas, "Cascadia Mono", Menlo, monospace; }
code{ background: #eaf1f9; border: 1px solid #d6e2f0; border-radius: 4px; padding: 0 .3em; font-size: .9em; overflow-wrap: anywhere; }
kbd{
  display: inline-block; min-width: 1.6em; padding: 0 .4em; font-size: .85em; text-align: center;
  background: #fff; border: 1px solid #b9c5d4; border-bottom-width: 2px; border-radius: 4px;
}
.wrap{ max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

/* ── Header ─────────────────────────────────────────────────────────────── */
header.site{
  position: sticky; top: 0; z-index: 20;
  background: rgba(255,255,255,.94);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}
header.site .bar{ display: flex; align-items: center; gap: 18px; height: 72px; }
.brand{ display: flex; align-items: center; }
.brand img{ width: 186px; height: auto; display: block; }
header.site nav{ margin-left: auto; display: flex; align-items: center; gap: 4px; }
header.site nav a{
  color: var(--ink); text-decoration: none; font-weight: 600; font-size: .95rem;
  padding: 8px 14px; border-radius: 8px;
}
header.site nav a:hover{ background: #eef4fb; color: var(--blue); }
header.site nav a[aria-current="page"]{ color: var(--blue); }
header.site nav a.dl{ background: var(--blue); color: #fff; margin-left: 6px; }
header.site nav a.dl:hover{ background: var(--cyan); }
header.site nav a.dl span:not(:empty){ opacity: .85; font-weight: 500; margin-left: 4px; }
.navtoggle{
  display: none; margin-left: auto; border: 1px solid var(--line); background: #fff; border-radius: 8px;
  font-size: 1.3rem; line-height: 1; padding: 8px 11px; cursor: pointer; color: var(--ink);
}

/* ── Hero ───────────────────────────────────────────────────────────────── */
.hero{
  background:
    radial-gradient(900px 420px at 70% 0%, rgba(39,168,236,.16), transparent 70%),
    radial-gradient(700px 380px at 0% 30%, rgba(21,112,201,.10), transparent 70%),
    var(--paper);
  border-bottom: 1px solid var(--line);
  padding: 56px 0 64px;
}
.hero-grid{ display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 48px; align-items: center; }
.hero h1{ margin: 18px 0 14px; font-size: clamp(1.9rem, 1.2rem + 2.4vw, 3rem); line-height: 1.12; letter-spacing: -.01em; }
.hero h1 .accent{ color: var(--blue); }
.hero p.lead{ font-size: 1.12rem; color: var(--muted); margin: 0 0 26px; }
.hero .logo-big{ width: 100%; max-width: 480px; display: block; }
.cta{ display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.btn{
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600;
  border-radius: 10px; padding: 12px 20px; border: 1px solid transparent; cursor: pointer; font-size: 1rem;
}
.btn.primary{ background: var(--blue); color: #fff; box-shadow: 0 8px 22px rgba(21,112,201,.28); }
.btn.primary:hover{ background: var(--cyan); color: #fff; }
.btn.ghost{ background: #fff; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover{ border-color: var(--cyan); color: var(--blue); }
.btn small{ font-weight: 500; opacity: .85; }
.meta{ color: var(--muted); font-size: .88rem; margin-top: 14px; }

/* ── Sections ───────────────────────────────────────────────────────────── */
section.block{ padding: 64px 0 8px; }
section.block + section.block{ padding-top: 40px; }
.eyebrow{
  display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: var(--blue); margin-bottom: 6px;
}
h2{ font-size: clamp(1.45rem, 1.1rem + 1.2vw, 2rem); line-height: 1.2; margin: 0 0 14px; }
h3{ font-size: 1.15rem; margin: 26px 0 8px; }
p{ margin: 0 0 14px; }
.intro{ color: var(--muted); font-size: 1.05rem; max-width: 780px; }

.cards{ display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 18px; margin-top: 26px; }
/* Grid and flex children may shrink below their content; the screenshots scale themselves (site.js). */
.hero-grid > *, .feature > *, .cards > *{ min-width: 0; }
.card{
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 22px 18px;
  text-decoration: none; color: inherit; display: block; transition: border-color .15s, transform .15s, box-shadow .15s;
}
a.card:hover{ border-color: var(--cyan); transform: translateY(-2px); box-shadow: 0 12px 30px rgba(15,27,45,.08); color: inherit; }
.card .ico{ font-size: 1.5rem; line-height: 1; }
.card h3{ margin: 10px 0 6px; font-size: 1.06rem; }
.card p{ margin: 0; color: var(--muted); font-size: .94rem; }
.card .more{ display: inline-block; margin-top: 10px; font-weight: 600; font-size: .9rem; color: var(--blue); }

/* A feature: text beside its screenshot, alternating sides. */
.feature{ display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 40px; align-items: start; margin: 30px 0 10px; }
.feature.flip{ grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
.feature.flip > .text{ order: 2; }
.feature.stack{ grid-template-columns: minmax(0, 1fr); }
.feature ul{ padding-left: 1.2em; margin: 0 0 14px; }
.feature li{ margin: 4px 0; }

/* Sticky in-page navigation on the long pages. */
.toc{
  display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 0; margin: 0;
  list-style: none; border-bottom: 1px solid var(--line);
}
.toc a{
  display: inline-block; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; text-decoration: none; color: var(--ink); font-size: .88rem; font-weight: 600;
}
.toc a:hover{ border-color: var(--cyan); color: var(--blue); }
/* The same list of guides at the foot of every guide page, and the one you are on. */
.toc.guides{ border-bottom: 0; padding-top: 4px; }
.toc a[aria-current="page"]{ border-color: var(--cyan); background: #eef7fd; color: var(--blue); }
/* "Read the whole thing" under a step of the quickstart. */
.more-link{ display: inline-block; font-weight: 600; font-size: .92rem; margin: 2px 0 0; }
.page-head{ background: var(--paper); border-bottom: 1px solid var(--line); padding: 44px 0 0; }
.page-head h1{ margin: 6px 0 10px; font-size: clamp(1.8rem, 1.3rem + 1.8vw, 2.6rem); line-height: 1.15; }
.page-head p{ color: var(--muted); max-width: 800px; font-size: 1.05rem; }
.anchor{ scroll-margin-top: 90px; }

/* Examples */
pre.example{
  background: #0d1a2e; color: #d6e4f5; border-radius: 10px; padding: 16px 18px; overflow-x: auto;
  font-size: .86rem; line-height: 1.55; margin: 0 0 16px; border: 1px solid #1c2e4a;
}
pre.example .c{ color: #7f93ad; }          /* comment */
pre.example .k{ color: #7cc7ff; }          /* key / tag */
pre.example .v{ color: #ffd479; }          /* value */
pre.example .s{ color: #9be39b; }          /* string */
.ex-title{ font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 18px 0 6px; }

table.facts{ width: 100%; border-collapse: collapse; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 8px 0 18px; font-size: .95rem; }
table.facts th, table.facts td{ text-align: left; padding: 9px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.facts th{ background: #f0f5fb; font-size: .82rem; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
table.facts tr:last-child td{ border-bottom: 0; }
/* The compatibility table: a tick or a dash in the Open and Save columns. */
table.facts td.yes{ color: #1f8a3a; font-weight: 700; }
table.facts td.no{ color: var(--muted); }
/* A word too long for its cell may break rather than push the table past the page. break-word and NOT
   anywhere: anywhere also lowers the column's minimum width, and the table then squeezes a label column
   down to a letter at a time ("Statio/n"). Long paths are code, and code breaks anywhere by itself. */
table.facts th, table.facts td{ overflow-wrap: break-word; }
/* Keep a short label cell ("Red", "Ctrl+G") on one line - but only the FIRST column: a swatch or a key
   inside a sentence further along must not turn that whole sentence into one line (it did, 2000 px wide). */
table.facts td:first-child:has(> kbd), table.facts td:first-child:has(> .swatch){ white-space: nowrap; overflow-wrap: normal; }
.swatch{ display: inline-block; width: 1.1em; height: 1.1em; border-radius: 3px; vertical-align: -.18em; margin-right: 6px; border: 1px solid rgba(0,0,0,.2); }

/* Search in the guides (guide.html, assets/js/guide-search.js). */
.gsearch{ max-width: 780px; margin: 6px 0 26px; }
.gsearch input{
  width: 100%; font: inherit; font-size: 1.02rem; padding: 11px 14px; border: 1px solid #c7d3e2;
  border-radius: 10px; background: #fff; color: var(--ink);
}
.gsearch input:focus{ outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(39,168,236,.18); }
.gs-results{ margin-top: 10px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 16px 10px; }
.gs-results ul{ list-style: none; margin: 0; padding: 0; }
.gs-results li{ padding: 10px 0; border-top: 1px solid var(--line); }
.gs-results li:first-child{ border-top: 0; }
.gs-results a{ text-decoration: none; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.gs-results .gs-title{ font-weight: 700; }
.gs-results .gs-page{ color: var(--muted); font-size: .85rem; }
.gs-results p{ margin: 4px 0 0; color: var(--muted); font-size: .92rem; overflow-wrap: break-word; }
.gs-results mark{ background: #fff1b8; color: inherit; border-radius: 2px; padding: 0 1px; }
.gs-count, .gs-none{ margin: 6px 0 4px !important; font-size: .88rem; }
/* The contest definitions on download.php: a search row, the count, the table and the pages. */
.ctd-search{ display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 6px; }
.ctd-search input{ flex: 1 1 220px; width: auto; min-width: 0; }
.ctd-count{ color: var(--muted); font-size: .92rem; margin: 8px 0 4px; }
#ctd-results{ transition: opacity .15s; }
#ctd-results.ctd-busy{ opacity: .55; }
table.facts.ctd td:nth-child(2) code{ overflow-wrap: anywhere; }
table.facts.ctd td:nth-child(2) a{ text-decoration: none; }
.pager{ display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; margin: 14px 0 0; }
.pager a, .pager span{
  min-width: 2.3em; padding: 5px 10px; border-radius: 8px; border: 1px solid var(--line); background: #fff;
  text-align: center; text-decoration: none; font-weight: 600; font-size: .92rem; color: var(--ink);
}
.pager a:hover{ border-color: var(--cyan); color: var(--blue); }
.pager .cur{ background: var(--blue); border-color: var(--blue); color: #fff; }
.pager .gap{ border-color: transparent; background: none; min-width: 0; padding: 5px 2px; }
.pager .off{ color: var(--muted); opacity: .55; }
.sr-only{ position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* A line in the author's own voice. */
blockquote.quote{ margin: 22px 0; padding: 4px 0 4px 20px; border-left: 4px solid var(--cyan); max-width: 70ch; }
blockquote.quote p{ margin: 0; font-size: 1.2rem; font-style: italic; line-height: 1.5; color: var(--ink); }
blockquote.quote cite{ display: block; margin-top: 8px; font-style: normal; font-size: .9rem; color: var(--muted); }
blockquote.quote cite::before{ content: "\2014\00a0"; }

.note{
  border-left: 4px solid var(--cyan); background: #eef7fd; padding: 12px 16px; border-radius: 0 10px 10px 0;
  margin: 14px 0 18px; font-size: .95rem;
}
.note.warn{ border-left-color: var(--gold); background: #fdf6e6; }

/* Guide steps */
.steps{ counter-reset: step; list-style: none; padding: 0; margin: 0; }
.step{ position: relative; padding: 0 0 8px 64px; margin: 0 0 34px; }
.step::before{
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 0; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; color: #fff; background: var(--blue);
  box-shadow: 0 6px 16px rgba(21,112,201,.3);
}
.step h3{ margin: 8px 0 8px; font-size: 1.25rem; }

/* ── Download page ──────────────────────────────────────────────────────── */
.release{
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 26px; align-items: center;
  background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 28px 30px;
  box-shadow: 0 18px 50px rgba(15,27,45,.07);
}
.release img{ width: 88px; }
.release .v{ font-size: 2.1rem; font-weight: 700; line-height: 1.1; }
.release .sub{ color: var(--muted); font-size: .92rem; }
.hash{ font-family: Consolas, monospace; font-size: .78rem; word-break: break-all; color: var(--muted); }
.empty{ background: var(--paper); border: 1px dashed #b9c8da; border-radius: 16px; padding: 30px; text-align: center; color: var(--muted); }

/* ── Footer ─────────────────────────────────────────────────────────────── */
footer.site{ background: var(--navy); color: #b8c7dc; margin-top: 70px; padding: 26px 0; font-size: .92rem; }
footer.site .foot{ display: flex; gap: 14px; align-items: center; }
footer.site .foot img{ width: 40px; flex: none; }
footer.site b{ color: #fff; margin-right: 6px; }
footer.site .dev{ margin-top: 2px; font-size: .86rem; color: #8ea3bd; }
footer.site a{ color: #8fd0ff; text-decoration: none; }
footer.site a:hover{ text-decoration: underline; }

/* ── Screenshots ────────────────────────────────────────────────────────── */
/* Real captures of the program, at the size they were taken: a window narrower than the column stays
   at its own size and therefore sharp, a wider one is scaled down to fit. Clicking opens it whole. */
figure.shot{ margin: 0; }
figure.shot + figure.shot{ margin-top: 22px; }
.shot a.shotlink{ display: inline-block; max-width: 100%; text-decoration: none; }
.shot img{
  display: block; width: auto; max-width: 100%; height: auto;
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
  box-shadow: 0 16px 40px rgba(15,27,45,.13);
}
.shot a.shotlink:hover img{ border-color: var(--cyan); }
.shot figcaption{ color: var(--muted); font-size: .85rem; margin-top: 10px; max-width: 70ch; }
.shot figcaption b{ color: var(--ink); }
.shot.wide img{ width: 100%; }

/* A screenshot that has not been taken yet. The markup is the FINAL markup, with the file name it will
   have; while that file is missing, site.js marks the figure and the dashed box below says what the
   picture has to show. Drop the PNG in images/ and it simply appears - nothing in the HTML changes. */
figure.shot.missing > a{ display: none; }
figure.shot.missing::before{
  content: "Screenshot to come \2014  " attr(data-want);
  display: flex; align-items: center; justify-content: center; min-height: 128px;
  border: 2px dashed #b9c8da; border-radius: 10px; background: #fbfdff;
  color: var(--muted); font-size: .9rem; line-height: 1.5; padding: 24px 22px; text-align: center;
}
figure.shot.missing figcaption{ color: #8496ab; }

/* A row of smaller screenshots that belong together (dialogs, settings tabs, the steps of a wizard). */
.gallery{ display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 20px; margin: 20px 0 6px; align-items: start; }
.gallery > figure{ margin: 0; }
.gallery img{ width: 100%; }
.gallery figcaption{ font-size: .82rem; margin-top: 8px; }
.gallery.two{ grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); }
.gallery > *{ min-width: 0; }

/* The viewer (site.js). Without JavaScript the same link simply opens the image itself. */
.viewer{
  position: fixed; inset: 0; z-index: 60; background: rgba(8,16,28,.86);
  display: grid; place-items: center; padding: 26px; overflow: auto; cursor: zoom-out;
}
.viewer img{ max-width: 100%; max-height: calc(100vh - 52px); width: auto; border-radius: 8px; background: #fff; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.viewer .close{
  position: fixed; top: 14px; right: 18px; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.12); color: #fff;
  font-size: 1.1rem; cursor: pointer;
}
.viewer .close:hover{ background: rgba(255,255,255,.25); }

/* ── Small screens ──────────────────────────────────────────────────────── */
@media (max-width: 940px){
  .hero-grid, .feature, .feature.flip{ grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .feature.flip > .text{ order: 0; }
  .release{ grid-template-columns: minmax(0, 1fr); text-align: center; justify-items: center; }
}
@media (max-width: 760px){
  .navtoggle{ display: block; }
  header.site nav{
    display: none; position: absolute; top: 72px; left: 0; right: 0; flex-direction: column; align-items: stretch;
    background: #fff; border-bottom: 1px solid var(--line); padding: 10px 16px 16px; gap: 2px;
  }
  header.site nav.open{ display: flex; }
  header.site nav a.dl{ margin: 6px 0 0; text-align: center; }
  .brand img{ width: 150px; }
  .wrap{ padding: 0 16px; }
  .step{ padding-left: 0; padding-top: 56px; }
}
/* Wide enough: the label column gets room for a two-word label, instead of the bare minimum the table
   hands it when the column beside it carries the long sentences. Not on a phone - there it would not fit. */
@media (min-width: 761px){
  table.facts td:first-child, table.facts th:first-child{ min-width: 9em; }
}
/* A phone: a three-column table spends 84 px on cell padding alone, and that is what pushed it past the
   screen. Less padding, and a word that still does not fit is hyphenated instead of cut without a mark. */
@media (max-width: 480px){
  table.facts th, table.facts td{ padding: 8px 8px; hyphens: auto; }
  /* Four columns on 320 px: the two tick columns hold one short word and give up their padding. */
  table.facts.files{ font-size: .88rem; }
  table.facts.files th:nth-child(2), table.facts.files th:nth-child(3),
  table.facts.files td:nth-child(2), table.facts.files td:nth-child(3){ padding-left: 4px; padding-right: 4px; }
}
