/* Word Grid Games — wordgridgames.com
   Editorial stylesheet. Deliberately unrelated to the Word Night product site.
   No external requests: system fonts only, no images, no script.

   The motif is the letter tile — one square with a hairline rule, at four scales:
   the 2x2 board mark in the masthead (same shape as the favicon), the numbered tile
   on a ranked entry, the filled/hollow tile on a pro/con line, and the heavy rule
   that separates sections. Everything else gets less decoration, not more. */

:root {
  color-scheme: light dark;

  --paper: #fbfaf7;
  --ink: #16150f;
  --ink-soft: #514d45;
  --rule: #d6d1c4;
  --rule-strong: #16150f;
  --tint: #f2efe6;
  --link: #8f2f0f;
  --pick: #14532d;
  --warn: #8f1030;

  --measure: 39rem;
  --gutter: clamp(1.15rem, 4vw, 2rem);

  /* Charter and Iowan Old Style ship on macOS and iOS; Georgia is the
     Windows and Android fallback. Nothing is downloaded either way. */
  --serif: Charter, "Iowan Old Style", "Bitstream Charter", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, "DejaVu Sans Mono", Consolas, monospace;

  --f-body:  clamp(1.0625rem, 1.01rem + 0.28vw, 1.1875rem);
  --f-h1:    clamp(2.05rem,  1.45rem + 2.55vw, 3.1rem);
  --f-h2:    clamp(1.45rem,  1.28rem + 0.72vw, 1.85rem);
  --f-h3:    clamp(1.35rem,  1.20rem + 0.62vw, 1.6rem);
  --f-micro: 0.76rem;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--f-body);
  line-height: 1.5;
  font-synthesis-weight: none;
}

@media (min-width: 34rem) { body { line-height: 1.62; } }

.wrap {
  width: 100%;
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

h1, h2, h3, .masthead-title, .post-list a {
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: -0.014em;
}

h1 { font-size: var(--f-h1); line-height: 1.06; letter-spacing: -0.028em; margin: 0.15rem 0 0.55rem; text-wrap: balance; }
h2 { font-size: var(--f-h2); line-height: 1.16; letter-spacing: -0.018em; margin: 2.6rem 0 0.55rem; text-wrap: balance; }
h3 { font-size: var(--f-h3); line-height: 1.20; margin: 1.6rem 0 0.35rem; text-wrap: balance; }

p, ul, ol { margin: 0 0 1rem; }
p { text-wrap: pretty; }
ul, ol { padding-left: 1.25rem; }
li { margin-bottom: 0.4rem; }

a { color: var(--link); text-underline-offset: 2px; }

/* ---------- accessibility ---------- */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: var(--paper);
  font-weight: 700;
}

.skip-link:focus { left: 0; }

:focus-visible {
  outline: 3px solid var(--link);
  outline-offset: 2px;
}

/* The + and − on a pro/con line are decorative CSS, so the text carries the label. */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- masthead ---------- */

.masthead { border-bottom: 1px solid var(--rule); background: var(--paper); }

.masthead .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: flex-start;
  gap: 0.1rem 0.9rem;
  padding-block: 0.7rem 0.6rem;
}

.masthead-title {
  font-size: clamp(1.25rem, 1.05rem + 0.85vw, 1.6rem);
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  color: var(--ink);
  text-decoration: none;
}

/* The board mark, drawn in two gradients. Same shape as the favicon. */
.masthead-title::before {
  content: "";
  flex: none;
  width: 1.02em;
  height: 1.02em;
  border: 1.5px solid currentColor;
  background:
    linear-gradient(currentColor, currentColor) center / 1.5px 100% no-repeat,
    linear-gradient(currentColor, currentColor) center / 100% 1.5px no-repeat;
}

.masthead-tag {
  font-family: var(--mono);
  font-style: normal;
  font-size: var(--f-micro);
  line-height: 1.3;
  color: var(--ink-soft);
}

@media (min-width: 34rem) { .masthead-tag { margin-left: auto; text-align: right; } }

.topnav {
  border-bottom: 2px solid var(--rule-strong);
  font-family: var(--mono);
  font-size: var(--f-micro);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* One non-wrapping strip with a fade, instead of three wrapped rows on a phone. */
.topnav .wrap {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  gap: 1.25rem;
  padding-block: 0;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 2.2rem), transparent);
          mask-image: linear-gradient(90deg, #000 calc(100% - 2.2rem), transparent);
}

.topnav .wrap::-webkit-scrollbar { display: none; }

.topnav a {
  display: inline-block;
  white-space: nowrap;
  color: var(--ink-soft);
  text-decoration: none;
  padding-block: 0.85rem;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}

.topnav a:hover { color: var(--link); }
.topnav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }

/* The masthead spans the page; only the article is held to the measure. */
@media (min-width: 46rem) {
  .masthead .wrap, .topnav .wrap, .site-footer .wrap { max-width: 58rem; }
}

/* ---------- article ---------- */

main { padding-bottom: 3rem; }

.meta {
  font-family: var(--mono);
  font-size: var(--f-micro);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.45;
  color: var(--ink-soft);
  border-bottom: 0;
  padding-bottom: 0;
  margin-bottom: 1.5rem;
}

.breadcrumb {
  font-family: var(--mono);
  font-size: var(--f-micro);
  color: var(--ink-soft);
  padding-top: 1.4rem;
  margin-bottom: 0.9rem;
}

.breadcrumb a { color: var(--ink-soft); }

.standfirst {
  font-family: var(--serif);
  font-size: clamp(1.15rem, 1.03rem + 0.5vw, 1.4rem);
  line-height: 1.32;
  color: var(--ink);
  margin-bottom: 1.6rem;
  text-wrap: pretty;
}

/* The block AI assistants quote. Ruled, not tinted — a tinted panel with a
   coloured bar is the shape of a cookie notice, not of a verdict. */
.verdict {
  border: 0;
  border-top: 3px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule);
  background: none;
  padding: 0.9rem 0 1.2rem;
  margin: 1.6rem 0 2rem;
}

.verdict::before {
  content: "The verdict";
  display: block;
  font-family: var(--mono);
  font-size: var(--f-micro);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.5rem;
}

.verdict p { font-size: 1.02em; }
.verdict p:last-child { margin-bottom: 0; }

/* ---------- review entries ---------- */

/* Numbering is opt-in: only a genuinely ranked list gets numbered tiles.
   A page whose entries include "what to avoid" must not imply a ranking. */
article.ranked { counter-reset: rank; }

.entry {
  border: 0;
  border-radius: 0;
  border-top: 1px solid var(--rule);
  background: none;
  padding: 1.5rem 0 0.6rem;
  margin: 1.8rem 0 0;
}

article.ranked .entry { counter-increment: rank; }

article.ranked .entry::before {
  content: counter(rank);
  float: left;
  width: 2.2rem;
  height: 2.2rem;
  margin: 0.15rem 0.75rem 0.35rem 0;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--rule-strong);
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
}

.entry.pick {
  border-top: 3px solid var(--rule-strong);
  background: none;
  padding-top: 1.6rem;
}

/* The pick is the loudest thing on the page and looks less like an advertisement
   than the green panel did, because the only thing marking it is editorial weight. */
article.ranked .entry.pick::before { background: var(--rule-strong); color: var(--paper); }
.entry.pick h3 { font-size: calc(var(--f-h3) * 1.16); }

.entry h3 { margin-top: 0; margin-bottom: 0.15rem; }

.rank {
  display: block;
  border: 0;
  border-radius: 0;
  padding: 0;
  margin: 0 0 0.1rem;
  font-family: var(--mono);
  font-size: var(--f-micro);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.entry.pick .rank { color: var(--pick); }

.spec {
  clear: left;
  list-style: none;
  padding: 0;
  border-top: 1px solid var(--rule);
  margin: 1rem 0;
  font-size: 0.94rem;
}

/* Label above value on a phone: a fixed 8.5rem label column was taking 45% of the row. */
.spec li {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.05rem;
  padding: 0.5rem 0;
  margin: 0;
  border-bottom: 1px solid var(--rule);
}

.spec b {
  font-family: var(--mono);
  font-size: var(--f-micro);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

@media (min-width: 30rem) {
  .spec li { grid-template-columns: 8.5rem minmax(0, 1fr); gap: 0 1rem; align-items: baseline; }
}

/* The motif at its smallest: filled tile for, hollow tile against. */
.pro, .con { position: relative; margin: 0.3rem 0; padding-left: 1.35rem; }

.pro::before, .con::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.42em;
  width: 0.62em;
  height: 0.62em;
  border: 1.5px solid;
}

.pro::before { border-color: var(--pick); background: var(--pick); }
.con::before { border-color: var(--warn); background: none; }

/* ---------- screenshots ----------
   Exhibits, not hero art. Phone-shaped, deliberately modest, never full-bleed:
   a 1170×2532 source at text width would render a 1,400px skyscraper and read as
   an advertisement rather than as evidence. */

.shots { margin: 1.2rem 0 1rem; }

.shots-pair {
  display: flex;
  gap: 0.9rem;
  justify-content: center;
  flex-wrap: wrap;
}

.shots-pair img {
  display: block;
  width: 240px;
  height: auto;
  max-width: 100%;
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: var(--paper);
}

.shots figcaption {
  margin-top: 0.7rem;
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

/* One phone cannot show two phones side by side and stay legible. */
@media (max-width: 30rem) {
  .shots-pair { gap: 1.1rem; }
  .shots-pair img { width: 260px; }
}

/* ---------- tables ---------- */

table { border-collapse: collapse; width: 100%; min-width: 34rem; font-size: 0.9rem; font-variant-numeric: tabular-nums; }

/* A two-column table has no reason to scroll, and forcing one truncated twenty rows
   of the review's specification block. :not(:has()) leaves older browsers as they were. */
.table-scroll:not(:has(thead tr th:nth-child(3))) table { min-width: 0; }

.table-scroll {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  border: 0;
  border-radius: 0;
  border-block: 1px solid var(--rule);
  background:
    linear-gradient(90deg,  var(--paper), rgba(251,250,247,0))   0   0 / 2.2rem 100% no-repeat local,
    linear-gradient(-90deg, var(--paper), rgba(251,250,247,0)) 100%  0 / 2.2rem 100% no-repeat local,
    radial-gradient(farthest-side at 0   50%, rgba(22,21,15,.28), transparent)   0 0 / 1.15rem 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(22,21,15,.28), transparent) 100% 0 / 1.15rem 100% no-repeat scroll,
    var(--paper);
}

th, td {
  padding: 0.55rem 0.7rem;
  text-align: left;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

thead th {
  background: none;
  border-bottom: 1.5px solid var(--rule-strong);
  font-family: var(--mono);
  font-size: var(--f-micro);
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

tbody th[scope="row"] { font-family: var(--serif); font-size: 1.02em; }
tbody tr:last-child td { border-bottom: 0; }

/* The caption carries the date the facts were checked. It must never scroll away. */
caption {
  caption-side: bottom;
  position: sticky;
  left: 0;
  width: min(100%, calc(100vw - 2 * var(--gutter)));
  text-align: left;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: var(--f-micro);
  line-height: 1.45;
  padding: 0.6rem 0 0;
}

.table-scroll:has(thead tr th:nth-child(3)) caption::before {
  content: "Swipe sideways for the rest of this table. ";
  color: var(--link);
}

@media (min-width: 38rem) { .table-scroll caption::before { content: none; } }

/* ---------- faq ---------- */

.faq h3 { margin-bottom: 0.2rem; }
.faq-more { font-size: 0.9rem; margin-top: -0.4rem; }

/* ---------- lists of posts ---------- */

.post-list { list-style: none; padding: 0; }

.post-list li {
  border-bottom: 1px solid var(--rule);
  padding: 1rem 0;
  margin: 0;
}

.post-list a {
  font-size: 1.18rem;
  line-height: 1.2;
  display: inline-block;
  padding-block: 0.15rem;
  text-decoration: none;
}

.post-list a:hover { text-decoration: underline; }
.post-list p { margin: 0.25rem 0 0; color: var(--ink-soft); font-size: 0.92rem; }

/* ---------- footer ---------- */

.site-footer {
  border-top: 2px solid var(--rule-strong);
  margin-top: 2.5rem;
  padding: 1.3rem 0 2.5rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: var(--f-micro);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  gap: 1.2rem;
  margin-bottom: 0.7rem;
}

.site-footer a { color: var(--ink-soft); display: inline-block; padding-block: 0.35rem; }

/* ---------- dark mode ---------- */

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #14140f;
    --ink: #ece8dd;
    --ink-soft: #a09a8c;
    --rule: #3a382f;
    --rule-strong: #ece8dd;
    --tint: #1e1d16;
    --link: #e8956a;
    --pick: #7fca9a;
    --warn: #f0879f;
  }

  .table-scroll {
    background:
      linear-gradient(90deg,  #14140f, rgba(20,20,15,0))   0   0 / 2.2rem 100% no-repeat local,
      linear-gradient(-90deg, #14140f, rgba(20,20,15,0)) 100%  0 / 2.2rem 100% no-repeat local,
      radial-gradient(farthest-side at 0   50%, rgba(0,0,0,.6), transparent)   0 0 / 1.15rem 100% no-repeat scroll,
      radial-gradient(farthest-side at 100% 50%, rgba(0,0,0,.6), transparent) 100% 0 / 1.15rem 100% no-repeat scroll,
      #14140f;
  }

  article.ranked .entry.pick::before { color: #14140f; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
