/* Kinstead's website: the landing page and the wiki. Loaded after the game's
   own style.css, so the windows, buttons, chips and fonts are the game's
   (a change to the game's look carries over); this file only lays out the
   pages, which scroll, unlike the game. */

:root {
  --sky-1: #6cb6ea;
  --sky-2: #dff2fb;
  --paper: #fffdf6;
  --paper-2: #f3efe2;
  --rule: #d8d2bf;
  --grass: #8a9f5a;
  --head-h: 46px;
}

html, body { height: auto; min-height: 100%; overflow-x: hidden; overflow-y: auto; }
body.site {
  background: linear-gradient(var(--sky-1), var(--sky-2) 70vh, #eef8fc) fixed;
  font-size: 15px; line-height: 1.5;
}
body.site a { color: var(--navy); }
body.site img { max-width: 100%; }
.site .wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.site h1, .site h2, .site h3, .site h4 { font-family: var(--display); font-weight: 700; color: var(--navy); line-height: 1.15; }
.skip { position: absolute; left: -999px; top: 0; z-index: 99; background: var(--tip); padding: 6px 10px; }
.skip:focus { left: 8px; top: 8px; }

/* --------------------------------------------------- the shared header */
.site-head {
  position: sticky; top: 0; z-index: 30; background: var(--face); box-shadow: var(--raised), 0 2px 0 rgba(0, 0, 0, 0.18);
}
.site-head .wrap { display: flex; align-items: center; gap: 10px; min-height: var(--head-h); padding-top: 4px; padding-bottom: 4px; }
.site-logo {
  display: inline-flex; align-items: center; gap: 7px; text-decoration: none; font-family: var(--display); font-weight: 700;
  font-size: 24px; color: var(--navy) !important; text-shadow: 2px 2px 0 #fff; white-space: nowrap;
}
.site-logo svg { width: 28px; height: 28px; image-rendering: pixelated; flex: none; }
.site-nav { display: flex; gap: 3px; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
.site-nav a {
  display: inline-flex; align-items: center; gap: 5px; min-height: 30px; padding: 3px 11px; background: var(--face); box-shadow: var(--raised);
  color: var(--ink) !important; text-decoration: none; font-weight: 600; font-size: 14px; white-space: nowrap;
}
.site-nav a:active, .site-nav a[aria-current="page"] { box-shadow: var(--sunken); background: #b5b5b5; }
.site-nav a.play { box-shadow: 0 0 0 1px #000, var(--raised); font-weight: 700; color: #00006a !important; }
.site-nav a.play:active { box-shadow: 0 0 0 1px #000, var(--sunken); }
.site-nav a:focus-visible, .btn:focus-visible { outline: 1px dotted #000; outline-offset: -5px; }
@media (max-width: 620px) {
  .site-head .wrap { gap: 6px; padding-left: 10px; padding-right: 10px; }
  .site-logo { font-size: 20px; gap: 5px; }
  .site-logo svg { width: 22px; height: 22px; }
  .site-nav { flex-wrap: nowrap; gap: 2px; }
  .site-nav a { padding: 3px 7px; font-size: 13px; gap: 3px; min-height: 28px; }
  .site-nav a .ms { font-size: 15px; }
}
@media (max-width: 420px) { .site-nav a:not(.play) .ms { display: none; } }
@media (max-width: 340px) { .site-logo { font-size: 17px; } .site-nav a .ms { display: none; } }

/* windows on the page: a game panel with a navy title bar */
.win { background: var(--face); box-shadow: var(--raised), 3px 3px 0 rgba(0, 0, 0, 0.22); }
.win > .tb {
  display: flex; align-items: center; gap: 6px; padding: 4px 8px; font-family: var(--display); font-weight: 700; font-size: 14px;
  color: #fff; background: linear-gradient(90deg, var(--navy), var(--navy-2));
}
.win > .tb .ms { font-size: 17px; }
.win > .tb .tb-btns { margin-left: auto; display: flex; gap: 2px; }
.win > .tb .tb-btns i { width: 16px; height: 14px; background: var(--face); box-shadow: var(--raised); display: block; }
.win > .body { padding: 12px 14px 14px; }
.doc { background: var(--paper); box-shadow: var(--sunken); }

.btn.big { font-size: 17px; padding: 10px 22px; min-height: 44px; font-family: var(--display); }
.btn.big .ms { font-size: 22px; }
a.btn { text-decoration: none; color: var(--ink); }
a.btn.primary { color: #00006a; }

.site-foot { margin: 40px 0 0; padding: 18px 0 26px; background: var(--face); box-shadow: var(--raised); font-size: 13px; color: var(--ink-2); }
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.site-foot .grow { flex: 1; }

/* ------------------------------------------------------------- landing */
/* the hero: the town, wall to wall, with the title card over its left side */
.hero { position: relative; overflow: hidden; background: linear-gradient(var(--sky-1), var(--sky-2)); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.18); }
.hero-town {
  position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; max-width: none !important; object-fit: cover; object-position: 62% 50%;
  pointer-events: none;
}
@media (min-width: 961px), (min-resolution: 1.5dppx) { .hero-town { image-rendering: pixelated; } }
.hero .wrap { position: relative; z-index: 1; display: flex; align-items: center; min-height: min(78vh, 720px); padding-top: 24px; padding-bottom: 24px; }
.hero-card { position: relative; z-index: 1; text-align: center; width: 100%; max-width: 400px; }
.hero-card .body { padding: 18px 20px 16px; }
.hero-card .logo { font-size: clamp(44px, 7vw, 64px); margin: 2px 0 0; }
.hero-card .tagline { font-size: 15px; margin: 10px 0 16px; color: var(--ink-2); }
.hero-card .btn { width: 100%; justify-content: center; margin-top: 6px; }
.hero-card .cont { display: grid; grid-template-columns: 64px 1fr; gap: 8px; align-items: center; text-align: left; padding: 6px 10px; }
.hero-card .cont img { width: 64px; height: 40px; object-fit: cover; box-shadow: var(--field); background: var(--grass); }
.hero-card .cont small { display: block; font-family: var(--font); font-weight: 400; font-size: 12px; color: var(--ink-2); }
.hero-card .facts { margin-top: 12px; font-size: 12px; color: var(--ink-2); }
.hero-card .facts b { color: var(--ink); }
@media (max-width: 820px) {
  .hero { background: none; box-shadow: none; }
  .hero-town { position: relative; display: block; height: auto; aspect-ratio: 2 / 1; }
  .hero .wrap { display: block; min-height: 0; padding-top: 0; padding-bottom: 4px; margin-top: -34px; }
  .hero-card { max-width: 460px; margin: 0 auto; }
}

.sect { margin: 34px 0 0; }
.sect > h2 { font-size: 28px; margin: 0 0 4px; text-shadow: 2px 2px 0 rgba(255, 255, 255, 0.8); }
.sect > p.lead { margin: 0 0 14px; color: var(--ink-2); max-width: 760px; }
.feats { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 430px), 1fr)); gap: 16px; }
.feat { display: flex; flex-direction: column; }
.feat .body { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.feat p { margin: 0; font-size: 14px; }
.feat .more { margin-top: auto; padding-top: 4px; font-size: 13px; font-weight: 700; }
.shot { position: relative; aspect-ratio: 16 / 10; background: linear-gradient(var(--sky-1), var(--sky-2)); box-shadow: var(--sunken); overflow: hidden; }
.shot img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* the pictures are at the art's own resolution: crisp pixels when they are
   scaled up, smooth when a small screen shows them smaller */
@media (min-width: 1000px), (min-resolution: 1.5dppx) { .shot img { image-rendering: pixelated; } }
.shot.icon { display: flex; align-items: center; justify-content: center; }
.shot.icon > .ms { font-size: 84px; color: rgba(0, 0, 80, 0.55); }
.shot.seasons span { position: absolute; bottom: 5px; font-size: 11px; background: var(--tip); padding: 0 4px; box-shadow: 1px 1px 0 #000; }
.shot.mp { display: grid; place-items: center; }
.mp-demo { display: grid; gap: 8px; justify-items: center; }
.mp-code { font-family: var(--display); font-size: 30px; letter-spacing: 0.08em; background: #fff; box-shadow: var(--field); padding: 2px 14px; color: var(--navy); }
.mp-cursors { display: flex; gap: 14px; }
.mp-cursors span { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; }
.mp-cursors i { width: 14px; height: 14px; border-radius: 50%; border: 3px solid currentColor; display: inline-block; }
.chips.big .chip { font-size: 13px; padding: 2px 8px; }
.tree-mini { display: grid; grid-auto-rows: 1fr; gap: 2px; padding: 10px 14px; font-size: 12px; height: 100%; align-content: stretch; }
.tree-mini .r { display: grid; grid-template-columns: 104px 1fr; gap: 8px; align-items: center; }
.tree-mini .r b { font-weight: 700; text-align: right; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tree-mini .r span { display: flex; gap: 4px; height: 100%; padding: 2px 0; }
.tree-mini .r span i { flex: 1; max-width: 54px; background: var(--face); box-shadow: var(--raised); }
.tree-mini .r:nth-child(odd) span i { background: #d8d4c8; }
.saver { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; padding: 12px 16px; font-size: 13px; align-content: center; height: 100%; }
.saver dt { color: var(--ink-2); }
.saver dd { margin: 0; font-weight: 700; }
.news .body { padding: 8px 12px 12px; }
.news ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.news li { display: grid; grid-template-columns: 92px 1fr; gap: 8px; padding: 4px 8px; background: #fff; box-shadow: var(--field); font-size: 13px; }
.news li time { color: var(--ink-2); font-size: 12px; }
.news .empty { color: var(--ink-2); font-size: 13px; }
.two { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 820px) { .two { grid-template-columns: 1fr; } .feats { grid-template-columns: 1fr; } }
.wiki-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; }
.wiki-links a { display: flex; gap: 6px; align-items: center; padding: 6px 10px; background: var(--face); box-shadow: var(--raised); text-decoration: none; color: var(--ink) !important; font-weight: 600; font-size: 14px; }
.wiki-links a:active { box-shadow: var(--sunken); }
.wiki-links a .ms { color: var(--navy); }

/* ---------------------------------------------------------------- wiki */
.wiki { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 14px; max-width: 1320px; margin: 14px auto 0; padding: 0 16px; align-items: start; }
.wiki-side { position: sticky; top: calc(var(--head-h) + 12px); max-height: calc(100vh - var(--head-h) - 24px); max-height: calc(100dvh - var(--head-h) - 24px); display: flex; flex-direction: column; }
.wiki-side .body { padding: 8px; overflow-y: auto; flex: 1; }
.wiki-search { position: relative; }
.wiki-search input {
  width: 100%; font: inherit; font-size: 14px; padding: 5px 8px 5px 28px; border: 0; background: #fff; box-shadow: var(--sunken); border-radius: 0; color: #000;
}
.wiki-search > .ms { position: absolute; left: 7px; top: 7px; color: var(--ink-2); font-size: 17px; pointer-events: none; }
.wiki-results { position: absolute; left: 0; right: 0; top: calc(100% + 2px); z-index: 40; background: var(--face); box-shadow: var(--raised), 3px 3px 0 rgba(0, 0, 0, 0.25); max-height: min(60vh, 460px); overflow-y: auto; padding: 3px; }
.wiki-results a { display: block; padding: 4px 8px; text-decoration: none; color: var(--ink) !important; font-size: 13px; line-height: 1.3; }
.wiki-results a small { display: block; color: var(--ink-2); font-size: 11px; }
.wiki-results a.on, .wiki-results a:hover { background: var(--navy); color: #fff !important; }
.wiki-results a.on small, .wiki-results a:hover small { color: #dde; }
.wiki-results .none { padding: 6px 8px; font-size: 13px; color: var(--ink-2); }
.wiki-nav h4 { font-family: var(--font); font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); margin: 12px 4px 3px; }
.wiki-nav a { display: flex; align-items: center; gap: 6px; padding: 3px 6px; text-decoration: none; color: var(--ink) !important; font-size: 14px; line-height: 1.3; }
.wiki-nav a .ms { font-size: 16px; color: var(--navy); width: 18px; }
.wiki-nav a:hover { background: #d5d5d5; }
.wiki-nav a[aria-current="page"] { background: var(--navy); color: #fff !important; }
.wiki-nav a[aria-current="page"] .ms { color: #fff; }
.wiki-toggle { display: none; }
.wiki-main { min-width: 0; }
.wiki-main > .body { padding: 0; }
.wiki-page { padding: 18px 26px 30px; min-height: 60vh; }
.wiki-page h1 { font-size: 34px; margin: 0 0 4px; }
.wiki-page .crumbs { font-size: 12px; color: var(--ink-2); margin-bottom: 2px; }
.wiki-page .summary { font-size: 16px; color: var(--ink-2); margin: 0 0 14px; max-width: 820px; }
.wiki-page h2 { font-size: 24px; margin: 30px 0 8px; padding-bottom: 3px; border-bottom: 2px solid var(--rule); scroll-margin-top: calc(var(--head-h) + 12px); }
.wiki-page h3 { font-size: 19px; margin: 22px 0 6px; scroll-margin-top: calc(var(--head-h) + 12px); }
.wiki-page h2 a.anchor, .wiki-page h3 a.anchor { margin-left: 6px; font-size: 0.7em; color: var(--rule) !important; text-decoration: none; visibility: hidden; }
.wiki-page h2:hover a.anchor, .wiki-page h3:hover a.anchor { visibility: visible; }
.wiki-page p, .wiki-page li { max-width: 860px; }
.wiki-page ul, .wiki-page ol { padding-left: 22px; }
.wiki-page li { margin: 3px 0; }
.wiki-page code { font-family: Consolas, 'Courier New', monospace; font-size: 0.92em; background: var(--paper-2); padding: 0 3px; }
.wiki-page .kbd { font-family: var(--font); font-size: 12px; color: var(--ink); white-space: nowrap; }
.wiki-page .toc { display: inline-block; margin: 4px 0 6px; padding: 8px 14px 10px 10px; background: var(--paper-2); box-shadow: var(--field); font-size: 14px; }
.wiki-page .toc b { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-2); margin-bottom: 2px; }
.wiki-page .toc ol { margin: 0; padding-left: 20px; columns: 2 220px; column-gap: 26px; }
.wiki-page .toc li { margin: 1px 0; break-inside: avoid; }
.wiki-page .note { background: #fff8d8; box-shadow: var(--field); padding: 8px 12px; margin: 10px 0; font-size: 14px; max-width: 860px; }
.wiki-page .note .ms { color: #8a6400; }
.wiki-page .see { margin-top: 26px; padding-top: 10px; border-top: 2px solid var(--rule); font-size: 14px; }
.wiki-page .see a { margin-right: 10px; }
.tbl-wrap { overflow-x: auto; margin: 8px 0 12px; max-width: 100%; }
.wiki-page table { border-collapse: collapse; font-size: 14px; background: #fff; box-shadow: var(--field); }
.wiki-page th, .wiki-page td { text-align: left; padding: 4px 10px; border-bottom: 1px solid #ece7d6; vertical-align: top; }
.wiki-page th { background: var(--face); font-weight: 700; font-size: 13px; white-space: nowrap; box-shadow: inset 0 -1px var(--lo); }
.wiki-page td.n, .wiki-page th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wiki-page tr:last-child td { border-bottom: 0; }
.wiki-page td .ms { font-size: 16px; }
.wiki-page .muted { color: var(--ink-2); }
.wiki-loading { padding: 30px 0; color: var(--ink-2); }
.wiki-home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin: 10px 0; }
.wiki-home-grid section { background: var(--paper-2); box-shadow: var(--field); padding: 8px 12px 10px; }
.wiki-home-grid h3 { margin: 2px 0 4px !important; font-size: 16px !important; display: flex; gap: 6px; align-items: center; }
.wiki-home-grid ul { margin: 0; padding-left: 18px; font-size: 14px; }
.stats-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.stats-row div { background: #fff; box-shadow: var(--field); padding: 4px 12px; font-size: 13px; color: var(--ink-2); }
.stats-row b { display: block; font-family: var(--display); font-size: 22px; color: var(--navy); line-height: 1.1; }

/* buildings */
.bld { margin: 26px 0 0; padding-top: 18px; border-top: 2px solid var(--rule); scroll-margin-top: calc(var(--head-h) + 12px); }
.bld:target, .tech:target, .hl { animation: hl 2.2s ease-out; }
@keyframes hl { from { background: #fff3b0; } to { background: transparent; } }
.bld-head { display: grid; grid-template-columns: 160px 1fr; gap: 14px; align-items: start; }
.bld-head h2 { border: 0; margin: 0 0 4px; padding: 0; font-size: 24px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.bld-head h2 .alt { font-family: var(--font); font-weight: 400; font-size: 13px; color: var(--ink-2); }
.bld-head p { margin: 4px 0; }
.bld .tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0; }
.bld .tags .chip { font-size: 12px; }
.chip.tag-merge { background: #e6dcf4; } .chip.tag-estate { background: #f4e2c8; } .chip.tag-branch { background: #d8e8f6; } .chip.tag-large { background: #e2efd2; }
.thumb { display: block; width: 100%; aspect-ratio: 4 / 3; background: #9fb383; box-shadow: var(--field); object-fit: cover; }
.thumb.ph { background: linear-gradient(135deg, #a8bc8c, #93a878); }
.levels { display: grid; grid-template-columns: repeat(auto-fill, minmax(208px, 1fr)); gap: 10px; margin: 12px 0 6px; }
.lvl { background: #fff; box-shadow: var(--field); padding: 8px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; scroll-margin-top: calc(var(--head-h) + 12px); }
.lvl .ln { display: flex; justify-content: space-between; gap: 6px; align-items: baseline; }
.lvl .ln b { font-size: 14px; }
.lvl .ln span { font-weight: 700; color: #6a4a00; white-space: nowrap; }
.lvl .ln small { display: block; font-weight: 400; color: var(--ink-2); font-size: 11px; }
.lvl dl { display: grid; grid-template-columns: auto 1fr; gap: 1px 8px; margin: 0; }
.lvl dt { color: var(--ink-2); }
.lvl dd { margin: 0; font-weight: 700; text-align: right; }
.lvl .needs { display: flex; flex-wrap: wrap; gap: 3px; }
.lvl .needs span { background: #fff1e0; box-shadow: var(--field); padding: 0 5px; font-size: 12px; }
.lvl .needs span.res { background: #e8ecff; }
.lvl .needs span.pop { background: #e9f4e0; }
.bld-paths { font-size: 14px; margin: 8px 0 0; }
.bld-paths li { margin: 2px 0; }
.bld .works { font-size: 14px; margin: 6px 0; }
.overview td:first-child { white-space: nowrap; }

/* research */
.branch { margin: 14px 0 0; }
.branch h3 { margin: 0 0 6px; }
.techs { display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch; }
.tech { flex: 1 1 230px; max-width: 330px; background: #fff; box-shadow: var(--field); padding: 8px 10px; font-size: 13px; position: relative; scroll-margin-top: calc(var(--head-h) + 12px); }
.tech .tn { display: flex; justify-content: space-between; gap: 6px; align-items: baseline; }
.tech .tn b { font-size: 14px; }
.tech .tn span { white-space: nowrap; color: #2a3a8a; font-weight: 700; }
.tech .tier { font-size: 11px; color: var(--ink-2); }
.tech p { margin: 4px 0; }
.tech .un { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.tech .un a, .tech .un span { display: inline-flex; align-items: center; gap: 4px; background: var(--paper-2); box-shadow: var(--field); padding: 1px 5px 1px 1px; font-size: 12px; text-decoration: none; color: var(--ink) !important; }
.tech .un img, .tech .un .ph { width: 32px; height: 24px; object-fit: cover; background: #9fb383; }
.tech .req { display: flex; flex-wrap: wrap; gap: 3px; margin: 3px 0 0; }
.tech .req a { font-size: 11px; background: #e8ecff; box-shadow: var(--field); padding: 0 5px; text-decoration: none; }
.style-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin: 10px 0; }
.style-grid figure { margin: 0; background: #fff; box-shadow: var(--field); padding: 6px; font-size: 13px; }
.style-grid figcaption b { display: block; font-size: 14px; }
.maps { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; margin: 10px 0; }
.maps figure { margin: 0; background: #fff; box-shadow: var(--field); padding: 8px; font-size: 13px; }
.maps canvas { width: 100%; height: auto; background: #9fb383; box-shadow: var(--field); image-rendering: pixelated; display: block; aspect-ratio: 3 / 2; }
.maps figcaption b { display: block; font-size: 15px; margin-top: 4px; }
.maps .m { color: var(--ink-2); font-size: 12px; }

@media (max-width: 900px) {
  .wiki { grid-template-columns: 1fr; margin-top: 8px; padding: 0 8px; }
  .wiki-side { position: relative; top: 0; max-height: none; }
  .wiki-side .wiki-nav { display: none; }
  .wiki-side.open .wiki-nav { display: block; }
  .wiki-toggle { display: inline-flex; margin-left: auto; }
  .wiki-side .body { overflow: visible; }
  .wiki-page { padding: 14px 14px 24px; }
  .wiki-page h1 { font-size: 28px; }
  .bld-head { grid-template-columns: 110px 1fr; gap: 10px; }
  .bld-head h2 { font-size: 21px; }
}
@media (max-width: 480px) {
  .levels { grid-template-columns: 1fr 1fr; gap: 6px; }
  .lvl { padding: 6px; font-size: 12px; }
  .lvl dl { grid-template-columns: 1fr; }
  .lvl dd { text-align: left; margin-bottom: 2px; }
  .bld-head { grid-template-columns: 1fr; }
  .bld-head .thumb { max-width: 220px; }
  .tech { max-width: none; }
}
