/* Open Source Ratings. The colours and the typeface are the home page's, so elestia.ai reads as one site. */
@font-face { font-family: "Schibsted Grotesk"; font-style: normal; font-weight: 400 900; font-display: swap; src: url("/opensource/fonts/schibsted-grotesk.woff2") format("woff2"); }
@font-face { font-family: "Schibsted fallback"; font-weight: 400 500; src: local("Arial"), local("Helvetica Neue"); size-adjust: 103%; ascent-override: 95.1%; descent-override: 25.2%; line-gap-override: 0%; }
@font-face { font-family: "Schibsted fallback"; font-weight: 501 900; src: local("Arial Bold"), local("Arial-BoldMT"), local("Helvetica Neue Bold"); size-adjust: 103%; ascent-override: 95.1%; descent-override: 25.2%; line-gap-override: 0%; }

:root {
  color-scheme: light dark;
  --paper: #f2f4f1;
  --surface: #fcfdfb;
  --ink: #17201d;
  --ink2: #3b4742;
  --muted: #5c6963;
  --rule: #d0d8d3;
  --accent: #0b6a5a;
  --accent-soft: #e1efea;
  /* A score's colour: its hue runs from red to green, at this lightness and strength. */
  --plate-l: 0.86;
  --plate-c: 0.12;
  --heat-l: 0.925;
  --heat-c: 0.07;
  --pad: 32px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #111815;
    --surface: #18211d;
    --ink: #e3e9e5;
    --ink2: #c3cdc7;
    --muted: #96a49d;
    --rule: #2d3934;
    --accent: #5dc8af;
    --accent-soft: #15332c;
    --plate-l: 0.44;
    --plate-c: 0.1;
    --heat-l: 0.3;
    --heat-c: 0.055;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.5 "Schibsted Grotesk", "Schibsted fallback", system-ui, sans-serif; }
a { color: inherit; text-decoration-color: var(--rule); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
h1, h2, h3, p, ul, ol, dl, dd, table { margin: 0; }
ul, ol { padding: 0; list-style: none; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 var(--pad) 96px; }
.top { display: flex; align-items: center; gap: 28px; height: 76px; font-size: 15px; }
.mark { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; font-size: 14px; }
.mark svg { color: var(--ink); }
.top .here { color: var(--muted); text-decoration: none; }
.top .here:hover { color: var(--ink); }

h1 { font-size: clamp(34px, 5.2vw, 54px); line-height: 1.05; font-weight: 700; letter-spacing: -0.025em; }
h2 { font-size: 22px; line-height: 1.25; font-weight: 650; letter-spacing: -0.01em; }
.lede { max-width: 62ch; margin-top: 18px; font-size: 19px; line-height: 1.45; color: var(--ink2); }
.muted { color: var(--muted); }

/* The score plate: the one thing to read first. Its number is the label, so the colour only repeats it. */
.plate { display: inline-grid; place-items: center; flex: none; border-radius: 3px; background: oklch(var(--plate-l) var(--plate-c) var(--h)); font-weight: 700; letter-spacing: -0.01em; }
.plate.small { width: 44px; height: 30px; font-size: 15px; }
.plate.medium { width: 64px; height: 52px; font-size: 25px; }
.plate.large { width: 104px; height: 88px; font-size: 44px; letter-spacing: -0.03em; }

/* Index */
.intro { padding: 40px 0 0; }
.find { display: block; width: min(100%, 420px); margin-top: 28px; padding: 11px 14px; border: 1px solid var(--rule); border-radius: 6px; background: var(--surface); color: var(--ink); font: inherit; }
.find::placeholder { color: var(--muted); }
/* The categories by group: the group's name, then its categories in a row that wraps. */
.jump { display: grid; gap: 12px; max-width: 900px; margin-top: 28px; font-size: 15px; }
.jump[hidden] { display: none; }
.jump > div { display: grid; grid-template-columns: 136px minmax(0, 1fr); gap: 2px 24px; align-items: baseline; }
.jump p { display: flex; flex-wrap: wrap; gap: 0 20px; }
.jump a { padding: 4px 0; color: var(--ink2); }
.jump .jump-group { color: var(--ink); font-weight: 650; text-decoration: none; }
.jump .jump-group:hover { text-decoration: underline; }
.nothing { margin-top: 40px; color: var(--ink2); }
.group { margin-top: 88px; padding-top: 20px; border-top: 1px solid var(--rule); scroll-margin-top: 24px; }
.group > h2 { font-size: 30px; letter-spacing: -0.02em; }
.cats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 64px 80px; margin-top: 36px; }
.cat { scroll-margin-top: 24px; }
.cat h3 { font-size: 22px; line-height: 1.25; font-weight: 650; letter-spacing: -0.01em; }
.cat h3 a { text-decoration: none; }
.cat h3 a:hover { text-decoration: underline; text-decoration-thickness: 1px; }
.cat .job { margin-top: 4px; color: var(--muted); font-size: 15px; }
.rank { margin-top: 18px; }
.rank a { display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: center; gap: 14px; min-height: 44px; padding: 5px 0; text-decoration: none; }
.rank .name { font-weight: 600; }
.rank a:hover .name { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.rank .pick a { grid-template-columns: 64px minmax(0, 1fr); align-items: start; gap: 16px; padding: 0 0 16px; }
.rank .pick .name { display: block; font-size: 19px; line-height: 1.3; }
.rank .pick .best { display: block; margin-top: 2px; color: var(--ink2); font-size: 15px; line-height: 1.4; }
.rank [aria-current] .name { color: var(--accent); }
.more { display: inline-block; margin-top: 12px; padding: 6px 0; font-size: 15px; color: var(--accent); }

.method { max-width: 68ch; margin-top: 96px; }
.method p { margin-top: 12px; color: var(--ink2); }
.method dl { margin-top: 20px; display: grid; grid-template-columns: max-content 1fr; gap: 8px 24px; }
.method dt { font-weight: 600; }
.method dd { color: var(--ink2); }

/* Category */
.crumbs { padding-top: 28px; font-size: 15px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.crumbs + h1 { margin-top: 14px; }
.section { margin-top: 64px; }
.section > h2 + p { margin-top: 6px; color: var(--muted); font-size: 15px; max-width: 68ch; }
.grid { width: 100%; margin-top: 20px; border-collapse: collapse; }
.grid.facts td { font-variant-numeric: tabular-nums; }
.grid th { padding: 0 0 10px; font-size: 14px; font-weight: 500; color: var(--muted); text-align: center; white-space: nowrap; }
.grid th:first-child, .grid td:first-child { text-align: left; }
.grid td { padding: 10px 0; border-top: 1px solid var(--rule); text-align: center; }
.grid .cell { width: 84px; }
.grid.facts .cell { width: 124px; text-align: right; }
.grid.facts th { vertical-align: bottom; }
.grid.facts th.cell { padding-left: 16px; text-align: right; white-space: normal; }
.sort { all: unset; cursor: pointer; padding: 6px 0; }
.sort:hover { color: var(--ink); }
.sort:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
th[aria-sort] .sort { color: var(--ink); font-weight: 650; }
th[aria-sort] .sort::after { content: " ↓"; }
.proj { display: flex; align-items: center; gap: 16px; text-decoration: none; }
.proj .name { display: block; font-weight: 600; font-size: 17px; }
.proj:hover .name { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.proj .best { display: block; color: var(--ink2); font-size: 14.5px; line-height: 1.4; max-width: 44ch; }
.heat { display: inline-grid; place-items: center; width: 52px; height: 32px; border-radius: 3px; background: oklch(var(--heat-l) var(--heat-c) var(--h)); font-weight: 550; font-size: 15px; }

/* Project */
.hero { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 32px; margin-top: 18px; }
.hero .place { margin-top: 10px; color: var(--muted); }
.hero .summary { max-width: 62ch; margin-top: 18px; font-size: 19px; line-height: 1.45; }
.hero .best { max-width: 62ch; margin-top: 12px; color: var(--ink2); }
.hero .best b { font-weight: 650; color: var(--ink); }
.out { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 18px; font-size: 15px; }
.out a { padding: 4px 0; color: var(--accent); }
.note { max-width: 62ch; margin-top: 12px; font-size: 14.5px; color: var(--muted); }

.scores { margin-top: 16px; max-width: 760px; }
.scores details { border-top: 1px solid var(--rule); }
.scores details:last-child { border-bottom: 1px solid var(--rule); }
.scores summary { display: grid; grid-template-columns: 170px minmax(0, 1fr) 36px 12px; align-items: center; gap: 20px; min-height: 48px; cursor: pointer; list-style: none; }
.scores summary::-webkit-details-marker { display: none; }
.scores .label { font-weight: 550; }
.scores .num { text-align: right; font-weight: 650; }
.chev { width: 8px; height: 8px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg) translate(-2px, -2px); transition: transform 150ms; }
details[open] .chev { transform: rotate(-135deg) translate(-2px, -2px); }
/* A 0 to 10 track: the band is the likely range, the dot the score. */
.meter { position: relative; height: 6px; border-radius: 3px; background: var(--rule); }
.meter .band { position: absolute; top: 0; bottom: 0; left: var(--lo); right: calc(100% - var(--hi)); border-radius: 3px; background: oklch(var(--plate-l) var(--plate-c) var(--h)); }
.meter .dot { position: absolute; top: 50%; left: var(--s); width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--ink); border: 2px solid var(--paper); }
.why { padding: 4px 0 20px; max-width: 68ch; }
.why .q { color: var(--muted); font-size: 14.5px; }
.why .by { margin-top: 14px; font-weight: 650; font-size: 15px; }
.why .reason { margin-top: 4px; color: var(--ink2); }
.why .ev { margin-top: 8px; font-size: 14.5px; color: var(--muted); }
.why .ev li { margin-top: 3px; overflow-wrap: anywhere; }

.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 64px; max-width: 900px; }
.points { margin-top: 12px; }
.points li { position: relative; margin-top: 8px; padding-left: 20px; color: var(--ink2); }
.points li::before { content: ""; position: absolute; left: 2px; top: 0.62em; width: 8px; height: 2px; background: var(--muted); }
.points.good li::before { height: 8px; top: 0.4em; background: none; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); width: 10px; height: 6px; transform: rotate(-45deg); }

.numbers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px 32px; margin-top: 18px; max-width: 900px; }
.numbers dt { color: var(--muted); font-size: 14.5px; }
.numbers dd { margin-top: 2px; font-size: 19px; font-weight: 600; font-variant-numeric: tabular-nums; }
.numbers dd small { font-size: 14.5px; font-weight: 400; color: var(--muted); }
.reviewers { margin-top: 12px; color: var(--ink2); max-width: 68ch; }
.reviewers li { margin-top: 4px; }

.foot { margin-top: 96px; padding-top: 20px; border-top: 1px solid var(--rule); color: var(--muted); font-size: 14.5px; max-width: 68ch; }

@media (max-width: 820px) {
  :root { --pad: 20px; }
  .cats { grid-template-columns: minmax(0, 1fr); gap: 52px; }
  .find { width: 100%; }
  .lede, .hero .summary { font-size: 17px; }
  .jump > div { grid-template-columns: minmax(0, 1fr); }
  .jump a { padding: 10px 0; }
  .group { margin-top: 64px; }
  .two { grid-template-columns: minmax(0, 1fr); }
  .numbers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .plate.large { width: 84px; height: 70px; font-size: 36px; }
  .scores summary { grid-template-columns: minmax(0, 1fr) 36px 12px; gap: 6px 16px; padding: 10px 0; }
  .scores .meter { grid-row: 2; grid-column: 1 / -1; margin-bottom: 6px; }

  /* The tables become one block per project: its name, then the cells in a row, each under its label. */
  .grid, .grid tbody { display: block; }
  .grid thead { display: none; }
  .grid tr { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0 4px; padding: 14px 0; border-top: 1px solid var(--rule); }
  .grid.facts tr { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 4px; }
  .grid td { display: block; padding: 0; border: 0; }
  .grid td:first-child { grid-column: 1 / -1; margin-bottom: 10px; }
  .grid.facts td:first-child { margin-bottom: 0; }
  .grid .cell, .grid.facts .cell { width: auto; text-align: left; }
  .grid .cell::before { content: attr(data-label); display: block; margin-bottom: 3px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
  /* The labels of the numbers are longer than a third of a phone, so they wrap, and the numbers stay on one line. */
  .grid.facts .cell { display: flex; flex-direction: column; justify-content: space-between; }
  .grid.facts .cell::before { white-space: normal; }
  .heat { width: 100%; max-width: 52px; }
}

@media (prefers-reduced-motion: reduce) {
  .chev { transition: none; }
}
