/* Ironcraft legal and support pages. Shared by every page that site/build.py renders.
   The host's CSP is style-src 'self': keep all styling in this file, never inline. */

:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --surface: #f4f5f7;
  --text: #1b1d21;
  --muted: #4a505a;
  --line: #d5d8de;
  --link: #9a3a00;
  --focus: #c24a00;
  --note-bg: #f4f5f7;
  --draft-bg: #fff4e5;
  --draft-line: #b25e00;
  --draft-text: #3d2400;
  --mark-bg: #ffe08a;
  --mark-text: #1b1d21;
  --measure: 70ch;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121417;
    --surface: #1b1e23;
    --text: #e9ebee;
    --muted: #b7bdc7;
    --line: #353a42;
    --link: #ff9a5c;
    --focus: #ffb380;
    --note-bg: #1b1e23;
    --draft-bg: #2a1d0e;
    --draft-line: #e08a3c;
    --draft-text: #ffd9b0;
    --mark-bg: #6b4e00;
    --mark-text: #fff3cc;
  }
}

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1.0625rem/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  overflow-wrap: anywhere;
}

.wrap {
  max-width: calc(var(--measure) + 2rem);
  margin: 0 auto;
  padding: 0 1rem;
}

a { color: var(--link); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 2px; }
main:focus { outline: none; }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -10rem;
  padding: 0.6rem 1rem;
  background: var(--bg);
  color: var(--link);
  border: 2px solid var(--focus);
  z-index: 10;
}
.skip-link:focus { top: 0.75rem; }

.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
}
.brand { font-weight: 700; font-size: 1.15rem; letter-spacing: 0.01em; }
a.brand { color: var(--text); text-decoration: none; }
a.brand:hover { text-decoration: underline; }

.site-nav ul,
.footer-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav a { display: inline-block; padding: 0.4rem 0; }
.site-nav a[aria-current="page"] { color: var(--text); font-weight: 650; text-decoration-thickness: 2px; }

main { padding: 1.5rem 0 3rem; }

h1, h2, h3, h4 { line-height: 1.25; margin: 2rem 0 0.75rem; scroll-margin-top: 1rem; }
h1 { font-size: clamp(1.8rem, 6vw, 2.4rem); margin-top: 1rem; letter-spacing: -0.01em; }
h2 { font-size: 1.4rem; padding-top: 0.5rem; border-top: 1px solid var(--line); }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; }

p, ul, ol, table, .callout, .table-wrap { margin: 0 0 1rem; }
ul, ol { padding-left: 1.4rem; }
li { margin: 0.35rem 0; }
li > ul, li > ol { margin: 0.35rem 0 0; }
strong { font-weight: 650; }

code {
  font: 0.92em ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--surface);
  padding: 0.1em 0.3em;
  border-radius: 4px;
}

.callout {
  background: var(--note-bg);
  border-left: 4px solid var(--line);
  padding: 0.75rem 1rem;
  border-radius: 6px;
}
.callout > :last-child { margin-bottom: 0; }

.callout.draft,
.build-banner {
  background: var(--draft-bg);
  border: 1px solid var(--draft-line);
  border-left-width: 6px;
  color: var(--draft-text);
}
.build-banner { margin: 0; padding: 0.6rem 1rem; text-align: center; border-width: 0 0 1px; }

mark.placeholder {
  background: var(--mark-bg);
  color: var(--mark-text);
  padding: 0 0.2em;
  border-radius: 3px;
  font-weight: 600;
}

.toc {
  background: var(--surface);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin: 1.5rem 0;
}
.toc-title { font-weight: 650; margin: 0 0 0.25rem; }
.toc ol { margin: 0; columns: 2 16rem; column-gap: 2rem; }
.toc li { break-inside: avoid; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
table { border-collapse: collapse; width: 100%; margin: 0; font-size: 0.97rem; }
th, td { text-align: left; vertical-align: top; padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--line); }
th { background: var(--surface); font-weight: 650; }
tr:last-child td { border-bottom: 0; }
td { min-width: 9rem; }

.meta { color: var(--muted); }

img { max-width: 100%; height: auto; }

/* App Store link ({app-store} in the Markdown). Text button: 44 pt target, the link colour as fill. */
.cta { margin: 1.25rem 0; }
.cta-button {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.6rem 1.4rem;
  border-radius: 999px;
  background: var(--link);
  color: var(--bg);
  font-weight: 650;
  text-decoration: none;
}
.cta-button:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.cta-badge { display: inline-block; }
.cta-badge img { display: block; height: 3.25rem; width: auto; }
.cta-soon { font-weight: 650; }

/* Screenshot gallery (a paragraph of image lines). Scrolls sideways when the column is narrow. */
.shots-wrap {
  margin: 1.5rem 0 2rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  border-radius: 8px;
}
.shots {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(9.5rem, 1fr);
  gap: 1rem;
  margin: 0;
  padding: 0.25rem 0.25rem 0.75rem;
  list-style: none;
}
.shots li { margin: 0; scroll-snap-align: start; }
.shots figure { margin: 0; }
.shots img {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  background: #000000;
}
.shots figcaption { margin-top: 0.5rem; color: var(--muted); font-size: 0.92rem; line-height: 1.4; }
@media (max-width: 40rem) {
  .shots { grid-auto-columns: 62%; }
}

.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 0.95rem; }
.site-footer .wrap { padding-top: 1.25rem; padding-bottom: 2rem; }
.site-footer p { margin: 0 0 0.75rem; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

@media print {
  :root { --bg: #ffffff; --text: #000000; --muted: #333333; --link: #000000; --line: #999999; }
  .skip-link, .site-nav, .toc, .build-banner, .shots-wrap, .cta { display: none; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.85em; }
  h2 { break-after: avoid; }
  .table-wrap { overflow: visible; border: 0; }
}
