/* tools.newtn.net overview page. System fonts only (no font CDN). */
:root {
  --bg: #f6f5f2;
  --surface: #ffffff;
  --text: #1c1d21;
  --muted: #62646c;
  --line: #e3e1db;
  --line-strong: #c9c6bd;
  --accent: #e0731f;
  --accent-soft: #fbeadb;
  --focus: #2563eb;
  --shadow: 0 1px 2px rgb(20 20 30 / .04), 0 8px 24px -12px rgb(20 20 30 / .18);
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "Cascadia Mono", Consolas, "Liberation Mono", monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121317;
    --surface: #1a1c21;
    --text: #ecebe8;
    --muted: #9a9ca5;
    --line: #2a2d34;
    --line-strong: #3d414a;
    --accent: #f28a3a;
    --accent-soft: #3a2616;
    --focus: #7aa2ff;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 10px 28px -14px rgb(0 0 0 / .6);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--font);
}
main, .site-head, .site-foot {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: 24px;
}
main { flex: 1; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 6px; }

/* header */
.site-head { padding-top: 56px; padding-bottom: 36px; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-size: 1.5rem;
  font-weight: 650;
  letter-spacing: -.01em;
}
.brand-mark { width: 30px; height: 30px; fill: var(--line-strong); }
.brand-mark .accent { fill: var(--accent); }
.tagline { margin: 10px 0 0; color: var(--muted); font-size: 1.05rem; }

/* tiles */
.tiles {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: border-color .15s, transform .15s;
}
.tile:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.tile:has(.tile-title a:focus-visible) { outline: 2px solid var(--focus); outline-offset: 3px; }
.tile-icon { width: 48px; height: 48px; margin-bottom: 4px; }
.tile-icon img { display: block; width: 48px; height: 48px; border-radius: 12px; }
.tile-initial {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 1.4rem;
}
.tile-title { margin: 0; font-size: 1.15rem; font-weight: 650; letter-spacing: -.005em; }
.tile-title a { text-decoration: none; outline: none; }
/* whole tile is clickable */
.tile-title a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.tile-desc { margin: 0; color: var(--muted); font-size: .95rem; flex: 1; }
.tile-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.tile-link code {
  font-family: var(--mono);
  font-size: .8rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.copy {
  position: relative;
  z-index: 1;
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.copy:hover { color: var(--text); border-color: var(--line-strong); }
.copy svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.copy.done { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.empty { color: var(--muted); }

/* footer */
.site-foot { padding-top: 48px; padding-bottom: 40px; }
.gh {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: .95rem;
}
.gh:hover { color: var(--text); }
.gh svg { width: 18px; height: 18px; fill: currentColor; }

@media (max-width: 520px) {
  main, .site-head, .site-foot { padding-inline: 16px; }
  .site-head { padding-top: 36px; padding-bottom: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .tile, .copy { transition: none; }
  .tile:hover { transform: none; }
}

/* 404 page */
.notfound { padding-block: 40px; }
.notfound h1 { margin: 0 0 8px; font-size: 1.6rem; }
.notfound p { color: var(--muted); }
