/* Shared by /tools/ and /tools/cramread/. One column, one accent, one radius scale. */
:root {
  --bg: #f4f5f8; --surface: #ffffff; --ink: #0d1117; --muted: #5b6573; --line: #e0e4eb;
  --accent: #2446ff; --accent-ink: #ffffff; --accent-soft: #e8ecff;
  --r-lg: 20px; --r-md: 12px; --r-sm: 8px;
  --shadow: 0 1px 2px rgba(13, 17, 23, .05), 0 8px 24px rgba(13, 17, 23, .05);
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0c10; --surface: #12151b; --ink: #eef1f6; --muted: #8f99a8; --line: #232832;
    --accent: #7b92ff; --accent-ink: #0a0c10; --accent-soft: #1a2142;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
  }
}
:root[data-theme="dark"] {
    --bg: #0a0c10; --surface: #12151b; --ink: #eef1f6; --muted: #8f99a8; --line: #232832;
    --accent: #7b92ff; --accent-ink: #0a0c10; --accent-soft: #1a2142;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
}
* { box-sizing: border-box; }
html { background: var(--bg); color-scheme: light dark; -webkit-text-size-adjust: 100%; }
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--ink);
  font: 16px/1.6 var(--sans); font-feature-settings: "tnum";
}
[hidden] { display: none !important; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: var(--wrap, 1200px); margin: 0 auto; padding-left: 20px; padding-right: 20px; }

/* Breadcrumb header */
.bar { padding-top: 22px; padding-bottom: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; font-size: 15px; color: var(--muted); }
.bar a { text-decoration: none; color: var(--muted); }
.bar a:hover { color: var(--ink); }
.bar .here { color: var(--ink); font-weight: 600; }
.bar .sep { opacity: .5; }
.lang-select { margin-inline-start: auto; }

main.wrap { flex: 1; padding-top: 48px; padding-bottom: 80px; }
h1 { margin: 0; font-size: clamp(36px, 7vw, 68px); line-height: 1.02; letter-spacing: -.04em; word-spacing: .07em; font-weight: 800; }
.sub { margin: 18px 0 0; max-width: 32em; color: var(--muted); font-size: clamp(17px, 2.2vw, 21px); line-height: 1.5; }
.foot { padding-bottom: 28px; text-align: center; font-size: 14px; color: var(--muted); }

/* Select */
.select {
  font: inherit; font-size: 15px; font-weight: 500; color: var(--ink); max-width: 100%;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 9px 12px; cursor: pointer;
}
.select:hover { border-color: var(--muted); }
.field .select { width: 100%; }
.lang-select { padding: 7px 10px; font-size: 14px; }
.theme-btn { width: 36px; height: 36px; padding: 0; display: inline-grid; place-items: center; border-radius: var(--r-md); }
.theme-btn svg { width: 18px; height: 18px; }

/* Buttons */
.btn {
  font: inherit; font-weight: 600; font-size: 15px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 10px 16px; cursor: pointer; white-space: nowrap; transition: border-color .15s, background .15s;
}
.btn:hover:not(:disabled) { border-color: var(--muted); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover:not(:disabled) { filter: brightness(1.08); border-color: var(--accent); }
.btn.ghost { background: transparent; }
.btn.big { padding: 15px 22px; font-size: 17px; border-radius: 14px; }

/* The focus word, shared by the demo and the reader */
.word {
  position: absolute; left: 50%; top: 50%; transform: translateY(-50%); display: flex;
  font: 500 clamp(32px, 9vw, 54px)/1 var(--mono); white-space: pre;
}
.word .pre { position: absolute; right: .5ch; text-align: right; }
.word .piv { display: inline-block; width: 0; }
.word .piv > span { position: absolute; transform: translateX(-50%); color: var(--accent); }
.word .post { position: absolute; left: .5ch; }

/* Tools index: one feature tile per tool */
.tools { list-style: none; margin: 56px 0 0; padding: 0; display: grid; gap: 20px; }
.tile {
  position: relative; display: grid; grid-template-columns: 1.05fr 1fr; min-height: 340px; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: 28px; box-shadow: var(--shadow);
  transition: border-color .2s, box-shadow .2s;
}
.tile:hover { border-color: var(--accent); }
.tile-copy { padding: 40px; display: flex; flex-direction: column; align-items: flex-start; }
.tile-name { margin: 0; font-size: clamp(30px, 4vw, 44px); line-height: 1; letter-spacing: -.04em; font-weight: 800; }
.tile-desc { margin: 14px 0 0; max-width: 24em; color: var(--muted); font-size: 18px; line-height: 1.5; }
.facts { list-style: none; margin: 22px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.facts li { font-size: 14px; font-weight: 600; padding: 6px 12px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); }
.tile-go {
  margin-top: auto; padding-top: 28px;
}
.tile-go a {
  display: inline-block; text-decoration: none; font-weight: 700; font-size: 16px;
  background: var(--accent); color: var(--accent-ink); padding: 13px 22px; border-radius: 14px;
}
.tile-go a::after { content: ""; position: absolute; inset: 0; border-radius: 28px; } /* whole tile is the link */
.demo { position: relative; background: #0b0e14; min-height: 260px; }
.demo::before, .demo::after { content: ""; position: absolute; left: 50%; width: 2px; height: 22px; background: #2a3140; }
.demo::before { top: 0; } .demo::after { bottom: 0; }
.demo .word { color: #eef1f6; font-size: clamp(34px, 5vw, 60px); }
.demo .piv > span { color: #ff6a4d; }
.demo-rate { position: absolute; left: 20px; bottom: 16px; font: 13px var(--mono); color: #7d889a; }
@media (max-width: 760px) {
  .tile { grid-template-columns: 1fr; }
  .tile-copy { padding: 28px 24px; }
  .demo { min-height: 200px; order: -1; }
}
