/* Mikhak by Amin Abedi, SIL Open Font License 1.1 (fonts/OFL.txt); served from this site so it loads in Iran */
@font-face {
  font-family: Mikhak;
  src: url("fonts/Mikhak.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #faf8f5;
  --surface: #ffffff;
  --ink: #1f1d1a;
  --muted: #6b665e;
  --line: #e7e2da;
  --soft: #f3efe9;
  --up: #1f7a4d;
  --down: #b3412e;
  --link: #1d4ed8;
  --pathfinder: #0f766e;
  --thermometer: #c2410c;
  --seismograph: #6d28d9;
  --accountant: #a16207;
  --gossip: #be185d;
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161513;
    --surface: #1f1e1b;
    --ink: #ece8e1;
    --muted: #a39d93;
    --line: #34312c;
    --soft: #272521;
    --up: #4ade80;
    --down: #f8836f;
    --link: #93b4ff;
    --pathfinder: #2dd4bf;
    --thermometer: #fb923c;
    --seismograph: #a78bfa;
    --accountant: #facc15;
    --gossip: #f472b6;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Mikhak, Tahoma, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.8;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.4; margin: 0 0 .4em; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.25rem; margin-top: 1.6em; }
h3 { font-size: 1.05rem; }
p { margin: .3em 0; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }
.show-sm { display: none; }
.lead { font-size: 1.1rem; color: var(--muted); max-width: 46em; }
.sym { color: var(--muted); font-size: .8em; font-weight: 400; direction: ltr; unicode-bidi: isolate; }

/* character accents */
.ch-pathfinder { --accent: var(--pathfinder); }
.ch-thermometer { --accent: var(--thermometer); }
.ch-seismograph { --accent: var(--seismograph); }
.ch-accountant { --accent: var(--accountant); }
.ch-gossip { --accent: var(--gossip); }
.icon {
  width: 1.4em; height: 1.4em; flex: none;
  fill: none; stroke: var(--accent, currentColor); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

/* header */
.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.brand { font-weight: 800; font-size: 1.3rem; color: var(--ink); }
.cast-nav { display: flex; gap: 4px; overflow-x: auto; margin-inline-start: auto; scrollbar-width: none; }
.cast-nav a {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px;
  color: var(--ink); font-size: .9rem; white-space: nowrap;
}
.cast-nav a:hover { background: var(--soft); text-decoration: none; }

/* "what is this site" note on inner pages, for visitors who arrive from search */
.intro {
  display: flex; gap: 12px; align-items: flex-start; margin-top: 16px; padding: 12px 16px;
  background: var(--soft); border-radius: var(--radius); font-size: .92rem; color: var(--muted);
}
.intro p { margin: 0; max-width: 62em; }
.intro b { color: var(--ink); }
.intro a[class^="ch-"] { color: var(--accent); font-weight: 600; }
.intro-x {
  margin-inline-start: auto; flex: none; font: inherit; font-size: 1.3rem; line-height: 1; border: 0;
  background: transparent; color: var(--muted); cursor: pointer; padding: 2px 6px; border-radius: 8px;
}
.intro-x:hover { background: var(--line); }
.js .intro.closed { display: none; }

/* home */
.home-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.home-grid .featured { margin-top: 0; }
.how { background: var(--soft); border-radius: var(--radius); padding: 16px 20px; }
.how h2 { margin: 0 0 6px; font-size: 1.1rem; }
.how ol { margin: 0; padding-inline-start: 20px; display: grid; gap: 6px; }
.how p { margin-top: 10px; }
.cast-row .cast { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.hero { padding: 32px 0 16px; }
.hero h1 { font-size: 2rem; }
.featured, .card, .cast-card, .state, .disagree, .move {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.featured { padding: 20px; margin-top: 16px; }
.featured-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.featured-head h2 { margin: 0; }
.featured .spark { width: 220px; }
.price { font-size: 1.2rem; font-weight: 700; margin: 0; }
.price .muted { font-weight: 400; font-size: .9rem; }
.quotes { list-style: none; padding: 0; margin: 16px 0 8px; display: grid; gap: 10px; }
.quotes li { display: flex; gap: 10px; align-items: flex-start; }
.quotes .icon { margin-top: .25em; }
.go { font-weight: 700; }

.cast { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.cast-card {
  display: flex; flex-direction: column; gap: 6px; padding: 16px; color: var(--ink);
  border-top: 4px solid var(--accent);
}
.cast-card:hover { text-decoration: none; border-color: var(--accent); }
.cast-top { display: flex; align-items: center; gap: 8px; font-size: 1.1rem; }
.cast-card .q { color: var(--muted); font-size: .92rem; }
.counts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.count { background: var(--soft); border-radius: 8px; padding: 1px 8px; font-size: .85rem; color: var(--muted); }
.count.strong { color: var(--ink); font-weight: 600; }

.search {
  width: 100%; padding: 10px 14px; font: inherit; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink); margin-bottom: 8px;
}
.coins { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.coins th, .coins td { padding: 8px 12px; text-align: right; border-bottom: 1px solid var(--line); }
.coins th { font-size: .85rem; color: var(--muted); font-weight: 500; background: var(--soft); }
.coins tr:last-child td { border-bottom: 0; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.up { color: var(--up); }
.down { color: var(--down); }

/* coin, character, indicator pages */
.crumbs { font-size: .9rem; color: var(--muted); padding-top: 16px; }
.coin-head { padding: 12px 0 8px; }
.char-head { display: flex; gap: 14px; align-items: flex-start; padding: 16px 0 8px; }
.char-head > .icon { width: 3rem; height: 3rem; stroke-width: 1.5; }

.tabs {
  display: inline-flex; gap: 4px; padding: 4px; margin: 12px 0 4px; background: var(--soft); border-radius: 12px;
  position: sticky; top: 8px; z-index: 2;
}
.tabs button {
  font: inherit; border: 0; background: transparent; color: var(--muted); padding: 6px 18px; border-radius: 9px; cursor: pointer;
}
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); font-weight: 700; box-shadow: 0 1px 3px rgb(0 0 0 / .08); }
.tabs { display: none; }
.js .tabs { display: inline-flex; }
.js .hz { display: none; }
.js .hz.on { display: block; }
.js .hz-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.overview { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 20px; align-items: start; margin-top: 8px; }
.glance { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; }
.glance h2 { margin: 0; font-size: 1.1rem; }
.glance .quotes { margin-bottom: 0; }
.side .move:first-child { margin-top: 0; }
.now { background: var(--surface); border: 1px solid var(--line); border-inline-start: 4px solid var(--accent); border-radius: 10px; padding: 8px 14px; margin-top: 10px; max-width: 46em; }
.states { display: grid; grid-template-columns: repeat(auto-fill, minmax(440px, 1fr)); gap: 12px; margin-top: 12px; }
.states .state { margin: 0; }
.elsewhere { margin-top: 32px; }
.move { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px; margin: 12px 0; flex-wrap: wrap; }
.spark { width: 200px; height: 44px; direction: ltr; }
.spark polyline { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.spark.up polyline { stroke: var(--up); }
.spark.down polyline { stroke: var(--down); }

.disagree { padding: 12px 16px; margin: 12px 0; border-inline-start: 4px solid var(--muted); }
.disagree ul { margin: 4px 0 0; padding-inline-start: 20px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; margin-top: 12px; }
.card { padding: 16px; border-top: 4px solid var(--accent); display: flex; flex-direction: column; gap: 4px; }
.card-head { display: flex; gap: 10px; align-items: flex-start; }
.card-head .icon { width: 1.8rem; height: 1.8rem; margin-top: .1em; }
.card-head h3 { margin: 0; }
.card-head h3 a { color: var(--ink); }
.card .q { color: var(--muted); font-size: .88rem; margin: 0; }
.says { font-size: 1.12rem; font-weight: 600; margin: 8px 0 2px; }
.since { color: var(--muted); font-size: .85rem; }
.rate { background: var(--soft); border-radius: 10px; padding: 8px 12px; font-size: .9rem; margin-top: 6px; }
.tools { margin-top: 6px; font-size: .92rem; }
.tools summary, .more summary { cursor: pointer; color: var(--muted); }
.tools ul { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 10px; }

.state { padding: 16px; margin: 12px 0; border-inline-start: 4px solid var(--accent); }
.state h3 .n { color: var(--muted); font-weight: 400; font-size: .85rem; margin-inline-start: 6px; }
.chips { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips a { display: inline-block; padding: 2px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: .88rem; color: var(--ink); background: var(--bg); }
.chips a:hover { border-color: var(--accent); text-decoration: none; }
.more { margin-top: 6px; font-size: .9rem; }

.prose { max-width: 720px; padding-bottom: 24px; }
.cast-list { list-style: none; padding: 0; display: grid; gap: 8px; }
.cast-list li { display: flex; gap: 10px; align-items: flex-start; }
.cast-list .icon { margin-top: .25em; }

.foot { margin-top: 48px; padding: 20px 0 32px; border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; }

@media (max-width: 900px) {
  .home-grid, .overview { grid-template-columns: 1fr; }
  .cast-row .cast { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
  .states { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .wrap { padding: 0 16px; }
  h1, .hero h1 { font-size: 1.45rem; }
  .hide-sm { display: none; }
  .show-sm { display: inline; }
  .cast-nav { margin-inline-start: 0; width: 100%; padding-bottom: 6px; }
  .cast-nav span { font-size: .85rem; }
  .coins th, .coins td { padding: 8px; }
  .featured .spark, .spark { width: 100%; }
  .tabs { width: 100%; }
  .tabs button { flex: 1; padding: 6px 8px; }
}
