/* semiatic.com — one stylesheet, phone-first, light + dark. */
:root {
  color-scheme: light dark;
  --bg: #f7f5f0;
  --card: #ffffff;
  --ink: #1b2126;
  --muted: #5a646c;
  --line: #d9d4ca;
  --accent: #0d6b66;
  --accent-soft: #e2f0ee;
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121619;
    --card: #1b2125;
    --ink: #e9e6e0;
    --muted: #a3aab0;
    --line: #333b41;
    --accent: #62c9c0;
    --accent-soft: #1d3432;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }
main { max-width: 64rem; margin: 0 auto; padding: 0 1rem 2rem; }
h1 { font-size: 1.6rem; line-height: 1.2; margin: 0.9rem 0 0.4rem; letter-spacing: -0.01em; }
h2 { font-size: 1.15rem; margin: 1.6rem 0 0.5rem; }
.lede { margin: 0 0 0.9rem; color: var(--muted); }
.small { font-size: 0.9rem; color: var(--muted); }
.count { font-weight: 400; color: var(--muted); font-size: 0.95rem; }

.top {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  max-width: 64rem; margin: 0 auto; padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 800; font-size: 1.15rem; letter-spacing: 0.02em; color: var(--ink); text-decoration: none; }
.top nav { display: flex; gap: 0.9rem; font-size: 0.92rem; white-space: nowrap; }
.top nav a { text-decoration: none; }
.top nav a:hover { text-decoration: underline; }

.sym { width: 48px; height: 48px; flex: none; color: var(--ink); }
.sym-md { width: 72px; height: 72px; }
.sym-xl { width: 128px; height: 128px; }

/* step 1 */
.shapes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.55rem; }
.shape {
  display: flex; flex-direction: column; align-items: center; gap: 0.15rem;
  padding: 0.7rem 0.3rem 0.55rem; min-height: 7.2rem;
  background: var(--card); border: 2px solid var(--line); border-radius: var(--radius);
  color: var(--ink); text-decoration: none; text-align: center;
}
.shape .sym { width: 56px; height: 56px; }
.shape:hover, .shape:focus-visible { border-color: var(--accent); }
.shape[aria-current="true"] { border-color: var(--accent); background: var(--accent-soft); }
.shape .t-name { font-weight: 700; }
.shape .t-mark { font-size: 0.8rem; color: var(--muted); line-height: 1.25; }
.step2-hint { display: none; }
.js .step2-hint { display: block; margin: 0.8rem 0 0; color: var(--muted); font-size: 0.95rem; }
.js .step2-hint[hidden] { display: none; }
.js .group { display: none; }
.js .group.open { display: block; }
.group { scroll-margin-top: 0.5rem; }
.group h2 { margin-top: 1.2rem; }

/* tiles (variants, siblings, chart) */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.55rem; }
.tiles-one { grid-template-columns: minmax(0, 16rem); }
.tile {
  display: grid; grid-template-columns: 48px 1fr; grid-template-rows: auto auto; column-gap: 0.6rem;
  align-items: center; padding: 0.55rem 0.6rem;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--ink); text-decoration: none; line-height: 1.25;
}
.tile .sym { grid-row: 1 / span 2; }
.tile span { min-width: 0; overflow-wrap: break-word; hyphens: auto; }
.tile .t-name { font-weight: 600; font-size: 0.93rem; align-self: end; }
.tile .t-mark { font-size: 0.8rem; color: var(--muted); align-self: start; }
.tile:hover, .tile:focus-visible { border-color: var(--accent); }
.tile-us { border-style: dashed; }

.chart-link { margin: 1.2rem 0 0; font-weight: 600; }
.howto ul, .sources ul { padding-left: 1.2rem; }
.howto li { margin: 0.35rem 0; }

/* symbol page */
.crumbs { font-size: 0.88rem; color: var(--muted); margin-top: 0.7rem; }
.crumbs a { text-decoration: none; }
.hero { display: flex; gap: 1rem; align-items: flex-start; margin-top: 0.4rem; }
.hero .sym-xl { width: 104px; height: 104px; margin-top: 0.6rem; padding: 6px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.hero h1 { margin-top: 0.5rem; }
.meaning { font-size: 1.05rem; margin: 0.3rem 0 0; }
.badge { display: inline-block; margin: 0.5rem 0 0; padding: 0.1rem 0.55rem; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-size: 0.85rem; font-weight: 600; }
.todo { background: var(--accent-soft); border-radius: var(--radius); padding: 0.2rem 1rem 0.3rem; margin-top: 1rem; }
.todo h2 { margin-top: 0.6rem; }
.facts { display: grid; grid-template-columns: 1fr; gap: 0; margin: 1rem 0 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.facts div { padding: 0.5rem 0.9rem; border-top: 1px solid var(--line); }
.facts div:first-child { border-top: 0; }
.facts dt { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.facts dd { margin: 0; }
.us-row { display: flex; gap: 0.9rem; align-items: flex-start; }
.us-row p { margin: 0; }
.us .sym-md { padding: 4px; border: 1px dashed var(--line); border-radius: var(--radius); background: var(--card); }
.sources li { margin: 0.3rem 0; overflow-wrap: anywhere; }

/* chart */
.jump { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.4rem; margin: 0.4rem 0 0; }
.jump a { display: flex; flex-direction: column; align-items: center; gap: 0.1rem; padding: 0.45rem 0.2rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); text-decoration: none; font-size: 0.72rem; text-align: center; line-height: 1.2; }
.jump .sym { width: 36px; height: 36px; }
.jump a:hover { border-color: var(--accent); }
.family { scroll-margin-top: 0.5rem; }
.family > p { margin-top: 0; color: var(--muted); }
.tbl { overflow-x: auto; margin: 0.8rem 0; }
table { border-collapse: collapse; min-width: 18rem; background: var(--card); border-radius: var(--radius); }
caption { text-align: left; font-weight: 600; padding: 0 0 0.3rem; }
th, td { border: 1px solid var(--line); padding: 0.35rem 0.7rem; text-align: left; font-size: 0.95rem; }
th { background: var(--accent-soft); }

.foot { max-width: 64rem; margin: 1rem auto 0; padding: 1rem 1rem 2rem; border-top: 1px solid var(--line); font-size: 0.85rem; color: var(--muted); }

@media (min-width: 720px) {
  h1 { font-size: 2.1rem; }
  .shapes { grid-template-columns: repeat(6, 1fr); }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr)); }
  .hero .sym-xl { width: 152px; height: 152px; }
  .facts { grid-template-columns: 1fr 1fr; }
  .facts div:nth-child(2) { border-top: 0; }
  .facts div:nth-child(even) { border-left: 1px solid var(--line); }
}
