/* OpenTTM — openttm.net
   One stylesheet for the whole site. No build step, no dependencies, no CDN:
   the site is copied to the server as plain files. */

:root {
  --accent:      #2f6f4e;
  --accent-dark: #24573d;
  --accent-soft: #eaf3ee;
  --ink:         #1a1c1a;
  --muted:       #5c635e;
  --line:        #e2e6e3;
  --bg:          #ffffff;
  --surface:     #f7f9f8;
  --warn-bg:     #fdf6e7;
  --warn-line:   #e8d194;
  --warn-ink:    #6b5312;
  --radius:      10px;
  --measure:     34rem;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --accent:      #6bbf92;
    --accent-dark: #8ed2ac;
    --accent-soft: #17251d;
    --ink:         #e8ece9;
    --muted:       #9aa39d;
    --line:        #2b322d;
    --bg:          #12140f;
    --surface:     #181b17;
    --warn-bg:     #2a2313;
    --warn-line:   #5c4c1d;
    --warn-ink:    #e5cf94;
  }
}
:root[data-theme="dark"] {
  --accent:      #6bbf92;
  --accent-dark: #8ed2ac;
  --accent-soft: #17251d;
  --ink:         #e8ece9;
  --muted:       #9aa39d;
  --line:        #2b322d;
  --bg:          #12140f;
  --surface:     #181b17;
  --warn-bg:     #2a2313;
  --warn-line:   #5c4c1d;
  --warn-ink:    #e5cf94;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 62rem; margin-left: auto; margin-right: auto;
  padding-left: 1.5rem; padding-right: 1.5rem;
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-dark); }

/* ---------------------------------------------------------------- header */

/* The header is sticky, so a jump to #anchor would land under it. Leave room
   for the header plus a little air; the phone header is two rows (see below). */
html { scroll-padding-top: 5rem; }

header.site {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky; top: 0; z-index: 10;
}
header.site .wrap {
  display: flex; align-items: center; gap: 1.5rem;
  min-height: 4rem; flex-wrap: wrap;
}
.brand {
  display: flex; align-items: center; gap: .6rem;
  font-weight: 650; letter-spacing: -.01em; font-size: 1.05rem;
  color: var(--ink); text-decoration: none; margin-right: auto;
}
.brand svg { display: block; }
nav.site a {
  color: var(--muted); text-decoration: none;
  font-size: .95rem; margin-left: 1.4rem;
}
nav.site a:hover, nav.site a[aria-current="page"] { color: var(--ink); }

/* ------------------------------------------------------------------ hero */

.hero { padding-top: 4.5rem; padding-bottom: 3rem; }
.hero h1 {
  font-size: clamp(2.1rem, 5vw, 3.1rem);
  line-height: 1.1; letter-spacing: -.025em;
  margin: 0 0 1rem; font-weight: 700;
}
.hero .lede {
  font-size: 1.2rem; color: var(--muted);
  max-width: var(--measure); margin: 0 0 2rem;
}

.cta { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.btn {
  display: inline-block; background: var(--accent); color: #fff;
  padding: .8rem 1.5rem; border-radius: var(--radius);
  font-weight: 600; text-decoration: none; font-size: 1.02rem;
  border: 1px solid transparent;
}
.btn:hover { background: var(--accent-dark); color: #fff; }
.btn.secondary {
  background: transparent; color: var(--ink); border-color: var(--line);
}
.btn.secondary:hover { background: var(--surface); color: var(--ink); }
.cta .meta { color: var(--muted); font-size: .92rem; }

/* --------------------------------------------------------------- content */

main { padding-bottom: 5rem; }
section { padding-top: 2.5rem; padding-bottom: 2.5rem; }
section + section { border-top: 1px solid var(--line); }

h2 {
  font-size: 1.45rem; letter-spacing: -.015em;
  margin: 0 0 1rem; font-weight: 650;
}
h3 { font-size: 1.08rem; margin: 1.8rem 0 .5rem; font-weight: 650; }
p  { max-width: var(--measure); }
.muted { color: var(--muted); }
.small { font-size: .92rem; }

/* release-notes.html is rendered Markdown, so its lists carry no class */
.notes ul:not(.plain), .notes ol { max-width: var(--measure); padding-left: 1.4rem; }
.notes li { margin: .3rem 0; }
.notes hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0 1rem; }

ul.plain { list-style: none; padding: 0; max-width: var(--measure); }
ul.plain li { padding: .35rem 0 .35rem 1.4rem; position: relative; }
ul.plain li::before {
  content: ""; position: absolute; left: .25rem; top: 1.05em;
  width: .35rem; height: .35rem; border-radius: 50%; background: var(--accent);
}

/* ----------------------------------------------------------------- cards */

.grid {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  margin-top: 1.5rem;
}
/* four short cards read better as one row than as three and an orphan */
.grid.four { grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); }
.card {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.25rem; background: var(--surface);
}
.card h3 { margin: 0 0 .35rem; font-size: 1rem; }
.card p  { margin: 0; font-size: .94rem; color: var(--muted); }
a.card { text-decoration: none; color: inherit; display: block; }
a.card:hover { border-color: var(--accent); }

/* --------------------------------------------------------------- notices */

.notice {
  background: var(--warn-bg); border: 1px solid var(--warn-line);
  color: var(--warn-ink); border-radius: var(--radius);
  padding: 1rem 1.15rem; max-width: var(--measure); margin: 1.5rem 0;
}
.notice strong { color: inherit; }
.notice p:last-child { margin-bottom: 0; }
.notice p:first-child { margin-top: 0; }

.stub {
  border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 1.5rem; background: var(--surface); color: var(--muted);
  max-width: var(--measure); margin: 1.5rem 0;
}
.stub p:last-child { margin-bottom: 0; }

/* ------------------------------------------------------------ data table */

.facts { width: 100%; border-collapse: collapse; margin: 1.25rem 0; font-size: .95rem; }
.facts th, .facts td {
  text-align: left; padding: .6rem .8rem .6rem 0;
  border-bottom: 1px solid var(--line); vertical-align: top;
}
.facts th { font-weight: 600; white-space: nowrap; padding-right: 1.5rem; }
.facts td { color: var(--muted); }
.facts code { word-break: break-all; }

code, .mono {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: .88em;
}
code { background: var(--surface); padding: .12em .35em; border-radius: 4px; }

.scroll-x { overflow-x: auto; }

/* ---------------------------------------------------------------- footer */

footer.site {
  border-top: 1px solid var(--line); padding: 2.5rem 0;
  color: var(--muted); font-size: .92rem;
}
footer.site .wrap { display: flex; gap: 1.5rem; flex-wrap: wrap; }
footer.site p { margin: 0; max-width: none; }
footer.site .spacer { margin-left: auto; }

/* Nothing may be wider than the screen. A nowrap table header or a long
   unbroken string will otherwise push the page wider than the viewport, and
   then every max-width below is measured against the wrong number. */
table, pre, img, svg { max-width: 100%; }
.facts { table-layout: fixed; }

@media (max-width: 34rem) {
  html { scroll-padding-top: 7.5rem; }
  .hero { padding-top: 3rem; padding-bottom: 2rem; }
  nav.site a { margin-left: 0; margin-right: 1.1rem; }
  header.site .wrap { padding-top: .75rem; padding-bottom: .75rem; }
  .brand { margin-right: 0; width: 100%; }

  /* one column, and let long headings and paths break rather than overflow */
  .grid, .grid.four { grid-template-columns: 1fr; }
  .facts th { white-space: normal; padding-right: 1rem; }
  .hero h1 { overflow-wrap: break-word; }
  code { overflow-wrap: break-word; }
}
