/* The Scale of AI: a measuring instrument. A log ruler down the left, one reading, annotations in the margin. */
.scale {
  --bg: #16101a;
  --bone: #efe7dc;
  --ash: #a69daa;
  --dim: #6f6574;
  --line: rgba(239, 231, 220, .1);
  --amber: #f2b45c;
  --ruler-w: 64px;
  --notes-w: 0px;
  --depth: 0;
  --sans: "Archivo", ui-sans-serif, system-ui, sans-serif;
  background: var(--bg); font-family: var(--sans); font-variation-settings: "wdth" 100;
}
@media (min-width: 900px) { .scale { --notes-w: min(30vw, 360px); --ruler-w: 76px; } }

/* The deeper you go, the warmer it gets: compute turns into heat. */
.heat {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: var(--depth);
  background: radial-gradient(90% 60% at 60% 120%, rgba(214, 110, 52, .32), transparent 70%), linear-gradient(180deg, transparent 40%, rgba(46, 18, 12, .5));
}

/* Opening */
.opening { position: relative; min-height: calc(100svh - 68px); padding: clamp(40px, 12vh, 140px) var(--gutter) 60px; max-width: 1160px; margin: 0 auto; display: flex; flex-direction: column; }
.opening h1 { margin: 0; font-size: clamp(52px, 10vw, 132px); line-height: .88; letter-spacing: -.02em; font-weight: 300; }
.opening h1 span { display: inline-block; }
.opening h1 .s1 { font-variation-settings: "wdth" 62; font-weight: 250; }
.opening h1 .s2 { font-variation-settings: "wdth" 85; font-weight: 500; }
.opening h1 .s3 { font-variation-settings: "wdth" 100; font-weight: 650; }
.opening h1 .s4 { font-variation-settings: "wdth" 125; font-weight: 900; }
.standfirst { max-width: 36ch; margin: 26px 0 0; font-size: clamp(18px, 1.8vw, 21px); line-height: 1.5; color: var(--ash); }
.one { display: flex; align-items: center; gap: 16px; margin-top: auto; padding-top: 70px; }
.dot-one { width: 9px; height: 9px; border-radius: 50%; background: var(--amber); }
.one p { margin: 0; font-size: 17px; color: var(--bone); }
.prompt { margin: 14px 0 0 25px; font-size: 15px; color: var(--ash); }

/* Tools */
.tools { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; max-width: 1160px; margin: 0 auto; padding: 0 var(--gutter) 18px; }
.find { position: relative; flex: 0 1 280px; min-width: 200px; }
.find input {
  width: 100%; height: 40px; padding: 0 2px; border: 0; border-bottom: 1px solid var(--ash); border-radius: 0; outline: none; background: transparent;
  color: var(--bone); font: 400 16px var(--sans);
}
.find input::placeholder { color: var(--dim); }
.find input:focus { border-bottom-color: var(--amber); }
.find-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30; margin: 0; padding: 4px 0; list-style: none; max-height: 300px; overflow: auto;
  background: #1f1825; border: 1px solid #3a2f40; border-radius: 6px;
}
.find-list li { display: flex; justify-content: space-between; gap: 10px; padding: 9px 12px; cursor: pointer; font-size: 15px; }
.find-list li small { color: var(--ash); white-space: nowrap; }
.find-list li[aria-selected="true"], .find-list li:hover { background: #2c2233; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.legend button { display: inline-flex; align-items: center; gap: 7px; padding: 4px 0; border: 0; background: none; cursor: pointer; font: 500 14px var(--sans); color: var(--bone); }
.legend button i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.legend button[aria-pressed="false"] { color: var(--dim); }
.legend button[aria-pressed="false"] i { background: transparent; box-shadow: 0 0 0 1px var(--dim) inset; }
.legend button:hover { text-decoration: underline; text-underline-offset: 4px; }

/* Stage */
.stage { position: relative; }
.axis { position: sticky; top: 68px; z-index: 10; height: 32px; margin-left: calc(var(--ruler-w) + var(--notes-w)); pointer-events: none; }
.axis::before { content: ""; position: absolute; inset: 0 0 -8px; background: linear-gradient(180deg, var(--bg) 60%, transparent); }
.axis-in { position: absolute; inset: 0; }
.axis-in span { position: absolute; top: 9px; transform: translateX(-50%); font: 500 12px var(--sans); font-variation-settings: "wdth" 75; letter-spacing: .02em; color: var(--ash); }
.ruler { position: absolute; top: 0; bottom: 0; left: 0; width: var(--ruler-w); border-right: 1px solid rgba(239, 231, 220, .22); }
.ruler i { position: absolute; right: 0; height: 1px; width: 7px; background: rgba(239, 231, 220, .3); }
.ruler i.major { width: 16px; background: rgba(239, 231, 220, .7); }
.ruler b { position: absolute; right: 22px; transform: translateY(-55%); font: 700 17px/1 var(--sans); font-variation-settings: "wdth" 70; color: var(--bone); }
.ruler b sup { font-size: .62em; vertical-align: .55em; margin-left: 1px; }
.plot { position: absolute; top: 0; bottom: 0; left: calc(var(--ruler-w) + var(--notes-w)); right: 0; }
.notes { position: absolute; top: 0; bottom: 0; left: var(--ruler-w); width: var(--notes-w); }
@media (max-width: 899px) { .notes { width: calc(100% - var(--ruler-w)); z-index: 6; pointer-events: none; } }

.decade { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid var(--line); }
.decade small { position: absolute; left: 8px; top: 6px; font: 500 12px var(--sans); color: var(--dim); }
.yearline { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px solid rgba(239, 231, 220, .04); }

.dot {
  --s: 8px; position: absolute; width: var(--s); height: var(--s); margin: calc(var(--s) / -2) 0 0 calc(var(--s) / -2); padding: 0; border: 0; border-radius: 50%;
  background: var(--c); cursor: pointer; z-index: 2; box-shadow: 0 0 0 1.5px var(--bg);
  transition: transform .18s ease-out, opacity .3s;
}
.dot::before { content: ""; position: absolute; inset: -8px; border-radius: 50%; }
.dot.spec { background: var(--bg); box-shadow: 0 0 0 1.5px var(--c) inset, 0 0 0 1.5px var(--bg); }
.dot.frontier::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1px solid var(--c); opacity: .55; }
.dot.hot { transform: scale(1.6); z-index: 4; }
.dot:hover, .dot:focus-visible, .dot.sel { transform: scale(1.9); z-index: 5; }
.dot.dim { opacity: .07; pointer-events: none; }
.dot.found { animation: found 1.1s ease-out 2; }
@keyframes found { 0% { box-shadow: 0 0 0 1.5px var(--bg), 0 0 0 1.5px var(--c); } 100% { box-shadow: 0 0 0 1.5px var(--bg), 0 0 0 22px transparent; } }

.label { position: absolute; z-index: 3; transform: translateY(-50%); white-space: nowrap; pointer-events: none; font: 500 12.5px var(--sans); color: #e2d9e4; text-shadow: 0 0 6px var(--bg), 0 0 2px var(--bg); }
.label.left { transform: translate(-100%, -50%); }
.label small { color: var(--dim); font-size: 11.5px; margin-left: 5px; }
.label.dim { opacity: 0; }

/* Margin annotations */
.note { position: absolute; left: 22px; right: 30px; }
.note .when { margin: 0; font-size: 13px; font-weight: 500; color: var(--ash); }
.note h3 { margin: 3px 0 6px; font-size: 20px; line-height: 1.2; font-weight: 650; font-variation-settings: "wdth" 108; letter-spacing: -.01em; }
.note p { margin: 0; font-size: 15px; line-height: 1.55; color: #d6ccd9; }
.note .facts { margin-top: 8px; font-size: 13.5px; color: var(--ash); }
.note .facts b { color: var(--bone); font-weight: 600; }
.note a { display: inline-block; margin-top: 6px; font-size: 13.5px; color: var(--bone); text-decoration: underline; text-decoration-color: var(--dim); text-underline-offset: 3px; }
.note a:hover { text-decoration-color: var(--bone); }
.note .lead { position: absolute; right: -30px; width: 24px; height: 0; border-top: 1px solid var(--c, var(--amber)); }
.note .lead::after { content: ""; position: absolute; right: -3px; top: -3.5px; width: 6px; height: 6px; border-radius: 50%; background: var(--c, var(--amber)); }
.note.human h3 { color: var(--amber); }
@media (max-width: 899px) {
  .note { left: 14px; right: auto; width: min(76%, 330px); padding: 12px 14px; background: rgba(22, 16, 26, .9); border-left: 2px solid var(--c, var(--amber)); pointer-events: auto; }
  .note .lead { display: none; }
  .note h3 { font-size: 17px; }
  .note p { font-size: 14px; }
}

/* The reading: a scan line across the chart and the current depth, pinned to the bottom */
.scanline { position: fixed; left: 0; right: 0; top: 50%; z-index: 5; height: 0; border-top: 1px dashed rgba(242, 180, 92, .45); pointer-events: none; opacity: 0; transition: opacity .3s; }
.scanline::before { content: ""; position: absolute; left: calc(var(--ruler-w) - 7px); top: -6px; border: 6px solid transparent; border-left-color: var(--amber); }
.reading {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 40px;
  padding: 40px var(--gutter) max(18px, env(safe-area-inset-bottom)); pointer-events: none;
  background: linear-gradient(0deg, var(--bg) 42%, rgba(22, 16, 26, .85) 70%, transparent);
  opacity: 0; transform: translateY(12px); transition: opacity .3s, transform .3s;
}
body.diving .reading, body.diving .scanline { opacity: 1; transform: none; }
.gauge { display: grid; min-width: 200px; }
.gauge b { font-size: clamp(38px, 5vw, 58px); line-height: .95; font-weight: 800; font-variation-settings: "wdth" 70; letter-spacing: -.01em; color: var(--bone); font-variant-numeric: tabular-nums; }
.gauge b sup { font-size: .55em; vertical-align: .75em; margin-left: 2px; color: var(--amber); }
.gauge span { margin-top: 6px; font-size: 14px; color: var(--ash); }
.compare { display: flex; flex-wrap: wrap; gap: 8px 32px; margin: 0; padding-bottom: 2px; }
.compare dt { font-size: 12.5px; color: var(--ash); }
.compare dd { margin: 2px 0 0; font-size: 16px; font-weight: 600; }
@media (max-width: 700px) {
  .reading { gap: 6px 20px; padding-top: 30px; }
  .gauge { min-width: 0; }
  .compare { gap: 6px 18px; }
  .compare div:nth-child(1) { display: none; }
  .compare dd { font-size: 14px; }
}

/* Detail card */
.card {
  position: fixed; z-index: 50; width: min(350px, calc(100vw - 24px)); padding: 18px 18px 16px; border-radius: 6px;
  background: #1f1825; border: 1px solid #3a2f40; box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .85); color: var(--bone);
}
.card .x { position: absolute; right: 8px; top: 8px; width: 32px; height: 32px; border: 0; background: none; color: var(--ash); cursor: pointer; font-size: 20px; line-height: 1; }
.card .x:hover { color: var(--bone); }
.card .field { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ash); }
.card .field i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.card h3 { margin: 6px 36px 2px 0; font-size: 19px; line-height: 1.25; font-weight: 650; font-variation-settings: "wdth" 108; }
.card .by { margin: 0; color: var(--ash); font-size: 14px; }
.card .flop { margin: 14px 0 2px; font-size: 26px; font-weight: 800; font-variation-settings: "wdth" 70; }
.card .flop sup { font-size: .55em; vertical-align: .7em; color: var(--amber); }
.card .conf { margin: 0; font-size: 13px; color: var(--ash); }
.card dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 12px 0 0; padding-top: 12px; border-top: 1px solid #3a2f40; font-size: 14px; }
.card dt { color: var(--ash); }
.card dd { margin: 0; font-weight: 600; text-align: right; }
.card .abs { margin: 12px 0 0; color: #cfc5d3; font-size: 13.5px; line-height: 1.5; }
.card a { display: inline-block; margin-top: 10px; font-size: 13.5px; color: var(--bone); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--dim); }
@media (max-width: 760px) { .card { left: 10px !important; right: 10px; top: auto !important; bottom: 130px; width: auto; } }

/* Ending */
.ending { max-width: 760px; margin: 0 auto; padding: clamp(90px, 18vh, 170px) var(--gutter) 170px; }
.ending h2 { margin: 0; font-size: clamp(34px, 5.4vw, 64px); line-height: 1; font-weight: 700; font-variation-settings: "wdth" 112; letter-spacing: -.02em; }
.summary { margin: 26px 0 0; font-size: clamp(19px, 2vw, 23px); line-height: 1.5; color: var(--bone); }
.summary.quiet { color: var(--ash); font-size: 18px; }
.ending-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 26px; margin-top: 34px; }
.act { padding: 0; border: 0; background: none; cursor: pointer; font: 600 16px var(--sans); color: var(--bone); text-decoration: underline; text-decoration-color: var(--dim); text-underline-offset: 5px; text-decoration-thickness: 1px; }
.act:first-child { padding: 12px 20px; border-radius: 4px; background: var(--amber); color: #21150c; text-decoration: none; }
.act:hover { text-decoration-color: var(--bone); }
.act:first-child:hover { background: #f6c47a; }
.method { margin-top: 40px; border-top: 1px solid var(--line); }
.method + .method { margin-top: 0; }
.method summary { cursor: pointer; padding: 16px 0; font-weight: 600; }
.method p { margin: 0 0 18px; color: #cfc5d3; font-size: 15.5px; line-height: 1.6; }
.method a { color: var(--bone); }
.table-wrap { max-height: 480px; overflow: auto; margin-bottom: 18px; }
.method table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.method th { position: sticky; top: 0; background: var(--bg); text-align: left; padding: 8px 8px 8px 0; color: var(--ash); font-weight: 600; }
.method td { padding: 7px 8px 7px 0; border-top: 1px solid var(--line); }
.method td:nth-child(4) { font-variant-numeric: tabular-nums; white-space: nowrap; }
