/* The public pages' look, built on the design system (assets/ds, copied from
   docs/design/design-system/tokens) and the app's colour tokens (tokens.css). Dark, flat and quiet:
   hairlines, white for emphasis, lime only for the brand and for anything live. This file only adds
   what a website needs on top: page layout, bigger type, the header and footer, forms and lists.
   Every colour is a token. The few the site adds are defined here once for each theme. */

:root {
  --site-shot-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  --site-code-prompt: var(--text-tertiary);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --site-shot-shadow: 0 18px 50px rgba(20, 20, 22, 0.18);
  }
}

:root[data-theme="light"] { --site-shot-shadow: 0 18px 50px rgba(20, 20, 22, 0.18); }

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 24px; }

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: 15px;
  line-height: 1.6;
}

a { color: var(--title-text); text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 3px; }
a:hover { color: var(--title-text); text-decoration-color: var(--title-text); }

h1, h2, h3 { color: var(--title-text); font-weight: 600; margin: 0; }
h1 { font-size: 30px; line-height: 1.2; letter-spacing: -0.02em; }
h2 { font-size: 17px; line-height: 1.35; }
h3 { font-size: 15px; line-height: 1.4; }
p { margin: 0; }
strong { color: var(--title-text); font-weight: 600; }
code, .mono { font-family: var(--font-mono); font-size: 0.9em; }

.nl-icon { flex: none; }
.hidden { display: none !important; }
/* A field only form-filling bots see, the contact form drops what fills it */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ===== Header, drawn by site.js ===== */

.site-header {
  position: relative;
  min-height: 61px;
  border-bottom: 1px solid var(--hairline);
  background: var(--background);
  z-index: 10;
}

.site-header .bar { height: 60px; display: flex; align-items: center; gap: 28px; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--title-text);
  text-decoration: none;
  white-space: nowrap;
}

.brand:hover { color: var(--title-text); }
.brand-logo { width: 28px; height: 28px; border-radius: 7px; font-size: 14px; }
.brand-name { font-weight: 650; font-size: 16px; letter-spacing: -0.01em; }

.nav { display: flex; align-items: center; gap: 24px; margin-left: auto; }

.nav > a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

.nav > a:hover, .nav > a[aria-current="page"] { color: var(--title-text); }

.nav > a.nav-signin {
  height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 6px;
  border: 1px solid var(--secondary-border);
  background: var(--secondary);
  color: var(--text);
}

.nav > a.nav-signin:hover { background: var(--border); color: var(--text); }

.menu-btn {
  display: none;
  margin-left: auto;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  border: 1px solid var(--card-border);
  background: transparent;
  color: var(--text);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.menu-btn:hover { background: var(--accent-tint8); }

/* The account menu */
.account { position: relative; }

.account-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  max-width: 240px;
  padding: 0 8px 0 10px;
  border-radius: 6px;
  border: 1px solid var(--card-border);
  background: transparent;
  color: var(--text);
  font: 500 13px var(--font-sans);
  cursor: pointer;
}

.account-btn:hover { background: var(--accent-tint8); }
.account-btn .nl-icon { color: var(--text-secondary); }
.account-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.account-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
}

.account.open .account-menu { display: flex; }
.account-menu__who { padding: 8px 10px 6px; }
.account-menu__email { color: var(--title-text); font-size: 13px; margin-top: 3px; overflow-wrap: anywhere; }
.account-menu .nl-menu__item { text-decoration: none; }
.account-menu .nl-menu__item[aria-current="page"] { background: var(--accent-tint8); }

/* ===== Footer, drawn by site.js ===== */

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--hairline);
  background: var(--background);
  color: var(--text-secondary);
  font-size: 14px;
}

.footer-top { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); gap: 32px; padding: 40px 0 32px; }
.footer-about p { margin-top: 12px; max-width: 340px; }
.footer-about .footer-maker { margin-top: 6px; color: var(--text-tertiary); font-size: 13px; }
.footer-links { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.footer-links .nl-label { margin-bottom: 4px; }
.footer-links a { color: var(--text-secondary); text-decoration: none; display: inline-flex; align-items: center; gap: 5px; }
.footer-links a:hover { color: var(--title-text); }
.footer-links a .nl-icon { color: var(--text-tertiary); }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 0 24px;
  border-top: 1px solid var(--hairline);
  color: var(--text-tertiary);
  font-size: 13px;
}

.nl-pill[aria-pressed="true"] { background: var(--accent-tint22); color: var(--accent-hover); }

/* ===== Page scaffolding ===== */

.page { width: 100%; max-width: 1120px; margin: 0 auto; padding: 48px 24px 72px; }
.narrow { max-width: 440px; }

.lede { color: var(--text-secondary); margin-top: 10px; font-size: 16px; line-height: 1.55; }
.stack > * + * { margin-top: 16px; }
.section { margin-top: 36px; }
.section-gap { margin-top: 14px; }
.lede + .notice, h1 + .notice { margin-top: 18px; }
.section > h2 { margin-bottom: 14px; }
.muted { color: var(--text-secondary); }
.faint { color: var(--text-tertiary); }
.small { font-size: 13px; line-height: 1.5; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* ===== Cards, notices, key and value lists ===== */

.card { background: var(--surface); border: 1px solid var(--card-border); border-radius: 8px; padding: 22px; }
.card > h2 { margin: 0 0 14px; }
.card .actions + p { margin-top: 16px; }

.notice {
  display: block;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  border: 1px solid var(--card-border);
  background: var(--surface);
  color: var(--text);
}

form .notice, .card .notice { margin-top: 16px; }
.notice.error { background: var(--danger-subtle); border-color: var(--danger-banner-border); color: var(--danger-muted-text); }

.kv { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 10px 16px; margin: 0; font-size: 14px; }
.kv dt { color: var(--text-secondary); }
.kv dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }

/* ===== Forms ===== */

.field { display: flex; flex-direction: column; gap: 7px; }
.field + .field, .card > p + .field { margin-top: 16px; }
.field > span { font-size: 13px; font-weight: 500; color: var(--text-muted); }
.field .nl-input { height: 38px; font-size: 14px; }
.field textarea.nl-input { height: auto; min-height: 76px; padding: 9px 10px; line-height: 1.45; resize: vertical; }
.nl-input.code { font-family: var(--font-mono); font-size: 20px; letter-spacing: 0.14em; height: 46px; }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 22px; }
.actions:empty { display: none; }
.actions .right { margin-left: auto; }

.nl-btn { text-decoration: none; }
.nl-btn--xl { height: 38px; padding: 0 16px; font-size: 14px; }
.nl-btn--hero { height: 44px; padding: 0 20px; font-size: 15px; gap: 8px; }
.nl-btn--textlink { background: transparent; border: 0; padding: 0 2px; height: auto; color: var(--text-secondary); font: 500 13px var(--font-sans); cursor: pointer; }
.nl-btn--textlink:hover { background: transparent; color: var(--title-text); }
.nl-btn--textlink:disabled { background: transparent; border: 0; color: var(--text-faint); }
.nl-btn:disabled { cursor: default; }
a.nl-btn:hover { text-decoration: none; }

/* The link page's question, the account page's column and the admin search */
.ask-title { font-size: 19px; line-height: 1.35; margin: 6px 0 18px; }
.account-page > * { max-width: 760px; }
.admin-search { display: flex; gap: 8px; max-width: 440px; }
.admin-search .nl-input { height: 32px; }

/* ===== Lists and tables ===== */

.rows { border: 1px solid var(--card-border); border-radius: 8px; background: var(--surface); }
.row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; }
.row + .row { border-top: 1px solid var(--hairline); }
.row .grow { flex: 1; min-width: 0; }
.row .title { color: var(--title-text); font-weight: 500; overflow-wrap: anywhere; }
.row .meta { color: var(--text-secondary); font-size: 13px; margin-top: 2px; overflow-wrap: anywhere; }
.row.empty { color: var(--text-secondary); }
.rows + p { margin-top: 12px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--card-border); border-radius: 8px; background: var(--surface); }
table { width: 100%; min-width: 720px; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-secondary); padding: 11px 12px; border-bottom: 1px solid var(--hairline); white-space: nowrap; }
td { padding: 10px 12px; border-top: 1px solid var(--hairline); vertical-align: top; }
tr:first-child td { border-top: none; }
td .nl-input { height: 30px; font-size: 12.5px; }
td select.nl-input { min-width: 112px; padding-right: 10px; }
td:first-child { min-width: 180px; }
td .title { color: var(--title-text); font-weight: 500; }
td .inline { display: flex; gap: 6px; align-items: center; min-width: 220px; }

/* ===== The landing and download pages ===== */

.band { padding: 88px 0; border-top: 1px solid var(--hairline); }
.band--surface { background: var(--surface); }
.band--first { border-top: 0; padding-top: 72px; }

.band-head { max-width: 640px; }
.band-head h2, .section-title { font-size: 30px; line-height: 1.2; letter-spacing: -0.02em; }
.band-head .eyebrow + h2 { margin-top: 12px; }
.band-head p { margin-top: 14px; color: var(--text-secondary); font-size: 16px; }
.band-head + * { margin-top: 40px; }

.hero { max-width: 760px; }
.hero h1 { font-size: 56px; line-height: 1.05; letter-spacing: -0.035em; }
.hero-line { margin-top: 12px; font-size: 24px; line-height: 1.3; letter-spacing: -0.015em; font-weight: 500; color: var(--title-text); }
.hero .lede { font-size: 17px; margin-top: 16px; max-width: 620px; }
.release-line a { color: inherit; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 30px; }
.release-line { margin-top: 16px; color: var(--text-tertiary); font-size: 13px; }
.release-line span + span::before { content: "·"; margin: 0 8px; color: var(--text-faint); }

.shot { display: block; width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--card-border); box-shadow: var(--site-shot-shadow); background: var(--background); }
.hero-shot { margin-top: 56px; }
figure { margin: 0; }
figcaption { margin-top: 14px; color: var(--text-tertiary); font-size: 13px; }

/* The games, one row each */
.games { border: 1px solid var(--card-border); border-radius: 10px; background: var(--background); }
.game { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 18px 20px; }
.game + .game { border-top: 1px solid var(--hairline); }
.game-badge { width: 44px; height: 44px; border-radius: 10px; font-size: 15px; letter-spacing: -0.02em; }
.game-badge--rust { background: var(--game-rust); color: var(--game-rust-ink); }
.game-badge--hytale { background: var(--game-hytale); color: var(--game-hytale-ink); }
.game-badge--7dtd { background: var(--game-7dtd); color: var(--game-7dtd-ink); }
.game-badge--ask { background: var(--primary); color: var(--text-secondary); border: 1px dashed var(--border); }
.game h3 { font-size: 16px; }
.game p { color: var(--text-secondary); font-size: 14px; margin-top: 3px; }
.game-side { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.game-os { display: flex; gap: 6px; flex-wrap: wrap; }

/* Text beside a screenshot, swapping sides down the page */
.feature { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 48px; align-items: center; }
.feature + .feature { margin-top: 88px; }
.feature--flip { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); }
.feature--flip > :first-child { order: 2; }
.feature .eyebrow + h2 { margin-top: 12px; }
.feature h3 { font-size: 22px; line-height: 1.25; letter-spacing: -0.015em; }
.feature > div > p { margin-top: 12px; color: var(--text-secondary); }

/* Check-icon lists */
.checks { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.checks li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; align-items: start; }
.checks .nl-icon { margin-top: 3px; color: var(--accent-hover); }

/* Points in a grid, each an icon, a title and a sentence or two */
.points { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 36px 40px; }
.points--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.point .nl-icon { color: var(--title-text); }
.point h3 { margin-top: 12px; font-size: 15px; }
.point p { margin-top: 6px; color: var(--text-secondary); font-size: 14px; }

/* A few lines of a real terminal */
.term { background: var(--console); border: 1px solid var(--card-border); border-radius: 8px; padding: 16px 18px; overflow-x: auto; }
.term pre { margin: 0; font: 400 12.5px/22px var(--font-mono); color: var(--text-muted); white-space: pre; }
.term .p { color: var(--site-code-prompt); user-select: none; }
.term .c { color: var(--text-tertiary); }

/* What's coming in the next update. Once it's released the tags go. */
.next-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 320px); gap: 72px; align-items: start; }
.phone-shot { max-width: 320px; }
.phone-shot .shot { border-radius: 14px; }
.next-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.next-list li { padding: 20px 0; border-top: 1px solid var(--hairline); }
.next-list li:first-child { border-top: 0; padding-top: 0; }
.next-list h3 { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.next-list p { margin-top: 4px; padding-left: 28px; color: var(--text-secondary); font-size: 14px; }
.eyebrow .nl-status { text-transform: none; letter-spacing: 0; }
[data-next-update][data-released] .coming-tag { display: none; }
/* What only the next update makes true, like linking a host, stays hidden until it's out */
[data-next-update]:not([data-released]) .released-only { display: none; }

.cta { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.cta .band-head + * { margin-top: 0; }

/* The download page */
.downloads { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 20px; margin-top: 36px; align-items: start; }
.platform { background: var(--surface); border: 1px solid var(--card-border); border-radius: 10px; padding: 24px; }
.platform + .platform { margin-top: 20px; }
.platform-head { display: flex; align-items: center; gap: 12px; }
.platform-head .nl-icon { color: var(--title-text); }
.platform-head h2 { font-size: 20px; letter-spacing: -0.01em; }
.platform-head .nl-status { margin-left: auto; }
.platform > p { margin-top: 12px; color: var(--text-secondary); font-size: 14px; }
.platform .facts { margin-top: 18px; }
.platform .actions { margin-top: 22px; }
.file-name { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-tertiary); overflow-wrap: anywhere; }
.side-stack > .platform { padding: 20px; }
.side-stack .platform-head h2 { font-size: 16px; }
.note-list { margin-top: 48px; }

/* ===== Game requests ===== */

.requests-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; margin-top: 28px; align-items: start; }
.requests-tools { display: flex; flex-direction: column; gap: 14px; }
.search { position: relative; display: flex; align-items: center; }
.search .nl-input { height: 40px; font-size: 14px; padding-left: 36px; background: var(--search); border-color: var(--card-border); }
.search .nl-icon { position: absolute; left: 11px; color: var(--text-secondary); pointer-events: none; }
.request-list { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.request { display: grid; grid-template-columns: 22px 72px minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 8px 10px; background: var(--surface); border: 1px solid var(--card-border); border-radius: 8px; }
.request-rank { font: 600 13px var(--font-mono); color: var(--text-tertiary); text-align: right; }
.request-art {
  width: 72px;
  height: 40px;
  border-radius: 6px;
  background: repeating-linear-gradient(135deg, color-mix(in oklab, var(--game-other) 22%, transparent) 0 6px, color-mix(in oklab, var(--game-other) 14%, transparent) 6px 12px);
}
.request-name { color: var(--title-text); font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.request-meta { color: var(--text-secondary); font-size: 12.5px; margin-top: 1px; overflow-wrap: anywhere; }
.request .nl-status { justify-self: start; }
.nl-status--building { color: var(--warning-text); }

.vote {
  width: 52px;
  height: 46px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  border-radius: 6px;
  border: 1px solid var(--secondary-border);
  background: var(--secondary);
  color: var(--text);
  font: 600 12px var(--font-mono);
  cursor: pointer;
  padding: 0;
}

.vote:hover { background: var(--border); }
.vote[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.vote[aria-pressed="true"]:hover { background: var(--accent-hover); }
.vote:disabled { cursor: default; background: transparent; border-color: var(--card-border); color: var(--text-secondary); }
.vote .nl-icon { margin-bottom: -3px; }
.request-empty { padding: 14px 4px; color: var(--text-secondary); }
.no-match { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 4px; color: var(--text-secondary); }
.side-card { background: var(--surface); border: 1px solid var(--card-border); border-radius: 10px; padding: 18px; }
.side-card h2 { font-size: 15px; margin-bottom: 14px; }
.side-card .field .nl-input { height: 36px; }
.side-card .actions { margin-top: 18px; }
.side-card .actions .nl-btn { flex: 1; }

/* ===== Phones and small windows ===== */

@media (max-width: 900px) {
  .feature, .next-grid, .downloads, .requests-layout { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .feature--flip > :first-child { order: 0; }
  .points { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-top { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer-about { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .wrap { padding: 0 16px; }
  .page { padding: 32px 16px 56px; }
  h1 { font-size: 26px; }

  .menu-btn { display: inline-flex; }
  .site-header .bar { gap: 12px; }
  .nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 61px;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 8px 12px 14px;
    background: var(--background);
    border-bottom: 1px solid var(--hairline);
  }
  .site-header.open .nav { display: flex; }
  .nav > a { padding: 10px 8px; border-radius: 6px; font-size: 15px; }
  .nav > a:hover { background: var(--accent-tint8); }
  .nav > a.nav-signin { height: auto; justify-content: center; margin-top: 8px; padding: 10px 8px; }
  .account-btn { display: none; }
  .account-menu { display: flex; position: static; box-shadow: none; border: 0; border-top: 1px solid var(--hairline); border-radius: 0; background: transparent; padding: 8px 0 0; margin-top: 6px; min-width: 0; }
  .account-menu .nl-menu__item { padding: 10px 8px; font-size: 15px; }
  .account-menu__who { padding: 4px 8px 8px; }

  .band { padding: 56px 0; }
  .band--first { padding-top: 40px; }
  .band-head h2, .section-title { font-size: 24px; }
  .band-head + * { margin-top: 28px; }
  .hero h1 { font-size: 42px; }
  .hero-line { font-size: 19px; }
  .hero .lede { font-size: 16px; }
  .hero-shot { margin-top: 36px; }
  .feature + .feature { margin-top: 56px; }
  .feature h3 { font-size: 19px; }
  .points, .points--two { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .game { grid-template-columns: 40px minmax(0, 1fr); gap: 14px; padding: 16px; }
  .game-badge { width: 40px; height: 40px; align-self: start; }
  .game-side { grid-column: 2; justify-content: flex-start; }
  .footer-top { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; padding-top: 32px; }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .kv dd { margin-bottom: 10px; }
  .row { flex-wrap: wrap; }
  .row .grow { flex-basis: 60%; }
  .request { grid-template-columns: 56px minmax(0, 1fr) auto; row-gap: 8px; }
  .request-rank { display: none; }
  .request-art { width: 56px; height: 36px; }
  .request .nl-status { grid-column: 2; grid-row: 2; }
  .request .vote { grid-column: 3; grid-row: 1 / span 2; }
  .platform { padding: 20px; }
}
