/* Static emoji and browse pages. Same plum, violet and sun world as the
   app; light by default, dark when the visitor turned it on in the app. */

:root {
  --plum-900: #1d1229;
  --plum-800: #2a1b3d;
  --violet-600: #44318d;
  --sun: #ffc83d;
  --sun-ring: rgba(255, 200, 61, 0.35);
  --bg: #ffffff;
  --text: #2a1b3d;
  --muted: #6b5f7d;
  --line: #e7e2ee;
  --tile: #f6f3fa;
  --tile-hover: #ece6f4;
  color-scheme: light;
}

html.dark {
  --bg: #2a1b3d;
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.7);
  --line: rgba(255, 255, 255, 0.14);
  --tile: rgba(255, 255, 255, 0.06);
  --tile-hover: rgba(255, 255, 255, 0.12);
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Oswald", system-ui, sans-serif;
  line-height: 1.45;
}

a { color: inherit; }

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Header bar, matching the app's compact header. */
.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: calc(env(safe-area-inset-top) + 12px) max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left));
  background: var(--plum-900);
  color: #fff;
  box-shadow: 0 6px 24px -12px rgba(10, 4, 20, 0.6);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: none;
  text-decoration: none;
  font-family: "Train One", "Oswald", sans-serif;
  font-size: 22px;
  border-radius: 8px;
}

.brand img { image-rendering: pixelated; }

.search { flex: 1; max-width: 560px; }

.search input {
  width: 100%;
  height: 44px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: var(--violet-600);
  color: #fff;
  font: inherit;
  font-size: 17px;
}

.search input::placeholder { color: rgba(255, 255, 255, 0.74); }

.search input:focus-visible,
.brand:focus-visible,
.btn:focus-visible {
  outline: 3px solid var(--sun-ring);
  outline-offset: 2px;
}

@media (max-width: 560px) {
  .brand span { display: none; }
}

/* Page body */
.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 15px;
  margin-bottom: 24px;
  word-break: break-all;
}

.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

h1 {
  margin: 0 0 8px;
  font-size: clamp(30px, 5vw, 48px);
  font-weight: 600;
  line-height: 1.1;
  word-break: break-word;
}

h2 {
  font-size: 22px;
  font-weight: 500;
  margin: 48px 0 16px;
}

.lede { color: var(--muted); font-size: 18px; margin: 0 0 24px; }

/* Emoji detail */
.emoji {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
  align-items: center;
}

@media (min-width: 760px) {
  .emoji { grid-template-columns: 340px minmax(0, 1fr); }
}

.stages {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.stage {
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1.25;
  padding: 16px;
}

.stage.light { background: #ffffff; }
.stage.dark { background: #1a1d21; }

.stage img {
  width: 100%;
  max-width: 128px;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
}

/* Tiny pixel-art emoji stay crisp when scaled up. */
.stages.px img { image-rendering: pixelated; }

.eyebrow {
  margin: 0 0 4px;
  color: var(--violet-600);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 14px;
  font-weight: 500;
}

html.dark /* Tiny pixel-art emoji stay crisp when scaled up. */
.stages.px img { image-rendering: pixelated; }

.eyebrow { color: var(--sun); }

.facts {
  display: flex;
  gap: 24px;
  margin: 12px 0 20px;
}

.facts dt { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; }
.facts dd { margin: 0; font-size: 18px; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; }

.btn {
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--tile);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  text-decoration: none;
  cursor: pointer;
}

.btn:hover { background: var(--tile-hover); }

.btn.primary {
  background: var(--plum-900);
  border-color: var(--plum-900);
  color: #fff;
}

html.dark .btn.primary {
  background: var(--sun);
  border-color: var(--sun);
  color: var(--plum-900);
}

.how {
  margin: 20px 0 0;
  color: var(--muted);
  font-family: system-ui, sans-serif;
  font-size: 15px;
  max-width: 52ch;
}

.how b { font-weight: 600; color: var(--text); }
.how code { font-size: 14px; background: var(--tile); padding: 1px 6px; border-radius: 6px; }

/* Emoji grids */
.grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
}

.grid a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  height: 100%;
  padding: 14px 8px 10px;
  border-radius: 14px;
  background: var(--tile);
  text-decoration: none;
  font-size: 13px;
  text-align: center;
}

.grid a:hover { background: var(--tile-hover); }

.grid img { width: 56px; height: 56px; object-fit: contain; }

.grid span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pager {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 15px;
}

.pager a { text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pager a:hover { text-decoration: underline; }
.pager [rel="next"] { text-align: right; }

/* Browse */
.letters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 24px;
}

.letters a {
  display: grid;
  place-items: center;
  min-width: 40px;
  height: 40px;
  padding: 0 8px;
  border-radius: 10px;
  background: var(--tile);
  text-decoration: none;
  font-size: 17px;
}

.letters a:hover { background: var(--tile-hover); }

.letters a[aria-current] {
  background: var(--plum-900);
  color: #fff;
}

html.dark .letters a[aria-current] { background: var(--sun); color: var(--plum-900); }

.groups {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.groups a {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 4px 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--tile);
  text-decoration: none;
}

.groups a:hover { background: var(--tile-hover); }
.groups b { grid-row: span 2; font-size: 30px; font-weight: 600; min-width: 1.4em; text-align: center; }
.groups span { color: var(--muted); font-size: 14px; }
.groups .peek { display: flex; gap: 4px; }
.groups .peek img { object-fit: contain; }

.pages {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 32px;
}

.pages a, .pages span {
  display: grid;
  place-items: center;
  min-width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--tile);
  text-decoration: none;
}

.pages span[aria-current] { background: var(--plum-900); color: #fff; }

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
  padding: 32px 16px calc(32px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.foot a { text-decoration: none; }
.foot a:hover { text-decoration: underline; }

/* Topics */
.topics {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.topics a {
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--tile);
  color: var(--text);
  text-decoration: none;
}

.topics a:hover { background: var(--tile-hover); }

.grid.spaced { margin-top: 28px; }

.topic-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.topic-list a {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--tile);
  text-decoration: none;
  font-size: 16px;
}

.topic-list a:hover { background: var(--tile-hover); }
.topic-list span { color: var(--muted); font-size: 13px; }

/* Upload guide */
.guide { max-width: 980px; }
.guide .lede { max-width: 62ch; margin: 8px 0 32px; color: var(--muted); font-size: 18px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.step-card { padding: 24px 26px; border: 1px solid var(--line); border-radius: 20px; background: var(--tile); }
.step-card h2 { margin: 0 0 12px; font-family: "Train One", "Oswald", sans-serif; font-weight: 400; font-size: 30px; }
.step-card ol { margin: 0; padding-left: 22px; display: grid; gap: 10px; font-family: system-ui, sans-serif; font-size: 16px; line-height: 1.5; }
.step-card b { font-weight: 600; }
.step-card code, .faq code { font-size: 14px; background: var(--bg); padding: 1px 6px; border-radius: 6px; }
.fine { margin: 16px 0 0; color: var(--muted); font-family: system-ui, sans-serif; font-size: 14px; line-height: 1.5; }
.faq { margin-top: 40px; }
.faq h2 { margin: 0 0 12px; font-size: 24px; font-weight: 500; }
.faq dl { margin: 0; display: grid; gap: 14px; max-width: 70ch; }
.faq dt { font-size: 18px; }
.faq dd { margin: 4px 0 0; color: var(--muted); font-family: system-ui, sans-serif; font-size: 15px; line-height: 1.55; }
.faq a { text-underline-offset: 3px; }
