:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --fg: #1c1b19;
  --muted: #5f5a52;
  --rule: #d9d4ca;
  --link: #9a4318;
  --code-bg: #f3f1ec;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1b19;
    --fg: #ece8df;
    --muted: #a39b8c;
    --rule: #3a3833;
    --link: #e08a5c;
    --code-bg: #262521;
  }
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.6 "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--link);
}

img {
  display: block;
  max-width: 100%;
}

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

/* Site header */

.site-header {
  border-bottom: 1px solid var(--rule);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 16px;
  min-height: 52px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.site-name {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--fg);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.site-name img {
  width: 24px;
  height: 24px;
}

.site-nav {
  display: flex;
  gap: 20px;
  font-size: 0.95rem;
}

.site-nav a {
  white-space: nowrap;
  color: var(--muted);
  text-decoration: none;
}

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

/* Content */

main {
  flex: 1;
  padding: 40px 0 56px;
}

h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.2;
  margin: 0 0 8px;
}

h2 {
  font-size: 1.15rem;
  margin: 40px 0 12px;
}

p {
  margin: 0 0 16px;
}

.lede {
  color: var(--muted);
  margin-bottom: 32px;
}

.meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 32px;
}

.fine-print {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 12px;
}

.breadcrumb {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0 0 16px;
}

.title-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 8px;
}

.title-row img {
  width: 56px;
  height: 56px;
  border-radius: 12px;
}

.title-row h1 {
  margin: 0;
}

/* Sheet: narrow label column beside wide content */

.sheet {
  display: grid;
  grid-template-columns: 172px 1fr;
  border-top: 1px solid var(--rule);
}

.sheet > h2 {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--muted);
  margin: 0;
  padding: 18px 32px 18px 0;
}

.sheet > div {
  padding: 18px 0;
  min-width: 0;
}

.sheet > h2,
.sheet > div {
  border-bottom: 1px solid var(--rule);
}

.sheet > div > :last-child {
  margin-bottom: 0;
}

.app-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.app-row img {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  flex-shrink: 0;
}

.app-row h3 {
  font-size: 1.15rem;
  font-weight: 500;
  margin: 0 0 4px;
}

.app-row p {
  margin: 0 0 8px;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-size: 0.95rem;
}

.socials {
  display: flex;
  gap: 8px;
  margin: -10px;
}

/* 44px tap targets around 24px glyphs; the negative margin keeps the glyphs aligned with the column. */
.socials a {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
}

.socials a:hover {
  opacity: 0.75;
}

.shots {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.shots img {
  width: 120px;
  height: auto;
  border-radius: 8px;
}

/* Tables and definition lists */

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  margin: 0 0 24px;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 8px 12px 8px 0;
  border-bottom: 1px solid var(--rule);
}

th {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.85rem;
}

.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 24px;
  margin: 0;
}

.facts dt {
  color: var(--muted);
}

.facts dd {
  margin: 0;
}

/* Footer */

footer {
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.85rem;
}

footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding-top: 16px;
  padding-bottom: 16px;
}

footer p {
  margin: 0;
}

footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

footer a {
  color: var(--muted);
}

/* Legal documents (body copied from commander_crush/docs) */

.legal article {
  line-height: 1.65;
}

.legal article h2 {
  font-size: 1.2rem;
  margin: 36px 0 12px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
}

.legal article h3 {
  font-size: 1.02rem;
  margin: 24px 0 8px;
}

.legal article ul {
  margin: 0 0 16px;
  padding-left: 1.25em;
}

.legal article li {
  margin-bottom: 6px;
}

.legal article th,
.legal article td {
  border: 1px solid var(--rule);
  padding: 8px 10px;
}

.legal article th {
  background: var(--code-bg);
  color: var(--fg);
}

@media (max-width: 600px) {
  .sheet {
    grid-template-columns: 1fr;
  }

  .sheet > h2 {
    border-bottom: none;
    padding-bottom: 0;
  }
}

@media (max-width: 480px) {
  .site-nav {
    gap: 14px;
  }

  .legal article table {
    display: block;
    overflow-x: auto;
  }
}

.store-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin: 8px 0;
}

/* Google's PNG carries built-in clear space; trim it so both badges look the same height. */
.store-badges .badge-play {
  width: 156px;
  height: 60px;
  border-radius: 0;
  display: block;
  margin: -10px -10px -10px -10px;
}

.store-badges .badge-appstore {
  width: 120px;
  height: 40px;
  border-radius: 0;
  display: block;
}
