/* AItitude page styles. Tokens (fonts, colours, themes) are in tokens.css. */
*, *::before, *::after { box-sizing: border-box; }
html { scrollbar-gutter: stable; color-scheme: light dark; background: var(--bg); color: var(--fg); transition: background-color .5s, color .5s; }
body { margin: 0; font: 18px/1.5 var(--mono); min-height: 100vh; display: flex; flex-direction: column; }
@media (prefers-reduced-motion: reduce) { html { transition: none; } }

/* Attitude indicator, homepage only: lower right, running off the page edge. horizon.js fades it
   to the letter field's strength; it starts hidden so it never flashes on other screens. */
#horizon-art { position: fixed; right: -5vw; bottom: -14vh; width: min(66vh, 52vw); aspect-ratio: 1; fill: none; stroke: currentColor; stroke-width: 1; opacity: 0; visibility: hidden; pointer-events: none; }
#horizon-art * { vector-effect: non-scaling-stroke; }
@media (max-width: 640px) { #horizon-art { width: 92vw; right: -26vw; bottom: -12vh; } }
#field { position: fixed; inset: 0; margin: 0; font: 13px/1.2 var(--mono); letter-spacing: .4em; white-space: pre; overflow: hidden; opacity: .22; pointer-events: none; user-select: none; }

.bar { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; padding: 1rem; font: 13px/1.35 var(--mono); }
.bar > :last-child { text-align: right; }
.theme-cell { grid-column: 4; }
/* Credit under the homepage CTA: dimmed by colour, the faintest mix that still passes AA (4.5:1).
   Light 82% (4.7:1), dark 50% (5.0:1). */
.credit { --credit-mix: 82%; margin-top: 2rem; font: 13px/1.35 var(--mono); color: color-mix(in srgb, var(--fg) var(--credit-mix), var(--bg)); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .credit { --credit-mix: 50%; } }
:root[data-theme="dark"] .credit { --credit-mix: 50%; }
.credit a { color: inherit; text-decoration: none; }
.credit a:hover { text-decoration: underline; }
.home { color: inherit; text-decoration: none; }
.home:hover { text-decoration: underline; }
/* Rolling label: words stack in one grid cell and rotate through the clip */
.ticker { display: inline-grid; overflow: hidden; perspective: 12em; vertical-align: top; }
.ticker > span { grid-area: 1 / 1; backface-visibility: hidden; white-space: pre; }
/* The rolling glyph: 1em box, its bar on the capitals' centre line (cap height 0.73em, so the box
   sits 0.135em below the baseline), a hair of space after "AI" */
.ticker svg { display: inline-block; width: 1em; height: 1em; vertical-align: -.135em; margin-left: .1em; }
.bar button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; }
.bar button:hover { background: none; color: inherit; text-decoration: underline; }
@media (max-width: 640px) {
  .bar { grid-template-columns: 1fr auto; }
  .theme-cell { grid-column: auto; }
  #bar-status { order: 3; grid-column: 1 / -1; }
}

main { position: relative; flex: 1; width: 100%; max-width: 44rem; padding: 3rem 1rem 3rem; }
@media (min-width: 900px) { main { margin-left: 25%; } }

.name { font-family: var(--mono); }
.label { font: 12px/1.4 var(--mono); text-transform: uppercase; letter-spacing: .06em; margin: 0 0 .75rem; }
h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); line-height: 1.15; font-weight: 600; margin: 0 0 1.75rem; color: var(--display); }
h1:focus { outline: none; }
.display { font-size: clamp(2.6rem, 9vw, 5.5rem); line-height: 1; letter-spacing: -.02em; }
h2 { font-size: 1.4rem; margin: 2rem 0 .25rem; }
/* Result verdict, set like the share image: mono bold "AI" with the drawn glyph on the
   cap-height centre line (box 0.8em, bar at its middle, so it sits 0.035em below the baseline). */
.verdict { font: 700 clamp(4.5rem, 22vw, 9rem)/1 var(--mono); letter-spacing: 0; white-space: nowrap; }
.verdict svg { display: inline-block; width: .8em; height: .8em; vertical-align: -.035em; margin-left: .02em; }
.verdict-type { font: 700 1.4rem/1.3 var(--mono); white-space: pre-wrap; }

button { font: 15px/1.3 var(--mono); color: inherit; background: var(--bg); border: 1px solid currentColor; border-radius: 0; padding: .75rem 1rem; margin: .25rem 0; cursor: pointer; }
button:hover, button[aria-pressed="true"] { background: var(--fg); color: var(--bg); }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
/* Feather icons: 1.15em, centred on the text in buttons, links and keycaps */
.icon { display: inline-block; width: 1.15em; height: 1.15em; flex: none; vertical-align: -.22em; }
button { display: inline-flex; align-items: center; gap: .55em; }
[hidden] { display: none !important; } /* keeps the hidden attribute working on flex buttons */
kbd .icon { width: 1em; height: 1em; vertical-align: -.15em; }
/* Primary action: filled and bold, same size as every other button; hover inverts to the outline style */
.primary { background: var(--fg); color: var(--bg); font-weight: 700; }
.primary:hover { background: var(--bg); color: var(--fg); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-top: 1.75rem; }
.actions button { margin: 0; }
button:disabled { visibility: hidden; } /* keeps its space so nothing shifts */

/* Question screens: fixed heights so nothing moves from one question to the next */
.question { font-size: clamp(1.25rem, 3vw, 1.85rem); line-height: 1.3; height: calc(3 * 1.3em); display: flex; align-items: flex-end; } /* JetBrains Mono needs 1.3 to keep its ascent and descent inside each line */
/* Each line of the question gets a solid background so the letter field never runs through the words */
/* .mask: a solid page-colour background on each line of text, so the letter field never runs through it */
.mask { background: var(--bg); padding: 0 .2em; margin: 0 -.2em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
/* Answer text starts right under the mark, top-aligned, so 1-, 2- and 3-line answers line up */
.tile { position: relative; margin: 0; height: 9.5rem; padding: .85rem; display: flex; flex-direction: column; justify-content: flex-start; align-items: flex-start; gap: .8rem; text-align: left; font: 16px/1.3 var(--mono); }
.tile .mark { display: block; height: 28px; } /* drawn marks, 28 px tall, 16 to 38 px wide; borders are equal */
.tile .mark svg { display: block; }
.tile .kbd { position: absolute; top: .6rem; right: .65rem; }
/* Keycaps: a small outlined key with a heavier bottom edge */
kbd, .kbd { display: inline-block; min-width: 1.6em; padding: .15em .4em .1em; font: 11px/1.2 var(--mono); text-align: center; text-transform: none; border: 1px solid currentColor; border-bottom-width: 2px; border-radius: 3px; }
/* Back on the left (hidden but holding its space on a round's first question), key hint pinned to the
   tiles' right edge: the negative margin cancels the mask's padding so the text lines up with the tile edge */
.nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.25rem; }
.hint { margin: 0 -.6rem 0 0; padding: .4rem .6rem; background: var(--bg); } /* masks the letter field behind it */
.hint kbd { margin: 0 .1em; }
@media (hover: none) { .tile .kbd, .hint { display: none; } } /* touch screens: no keyboard to hint at */
@media (max-width: 640px) {
  .question { height: calc(5 * 1.3em); }
  .tiles { grid-template-columns: 1fr; }
  .tile { height: 4.6rem; flex-direction: row; align-items: flex-start; justify-content: flex-start; gap: .85rem; font-size: 15px; }
  .tile .mark { flex: 0 0 38px; margin: -4px .4rem 0 0; } /* fits the double mark, so every row's text starts at the same x; centred on the first line */
  .tile .text { padding-top: .05em; }
  .tile .kbd { position: static; margin-left: auto; }
  .hint { display: none; }
}
.scale { display: flex; justify-content: space-between; font: 12px/1.4 var(--mono); text-transform: uppercase; }
.line { position: relative; height: 2px; background: currentColor; margin: 2rem 0 .5rem; }
.marker { position: absolute; top: -9px; width: 3px; height: 20px; background: currentColor; transform: translateX(-50%); }
textarea { width: 100%; font: 13px/1.4 var(--mono); color: inherit; background: var(--bg); border: 1px solid currentColor; border-radius: 0; padding: .5rem; }

.formats { display: flex; flex-wrap: wrap; gap: .5rem; }
.formats button { margin: 0; }
.dim { opacity: .7; }
.preview { display: block; max-width: 100%; max-height: 60vh; margin: 1rem 0; border: 1px solid currentColor; }
.web { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: end; margin: 1rem 0; }
.web figure { margin: 0; }
.web img { display: block; margin-bottom: .75rem; outline: 1px solid currentColor; outline-offset: 4px; }
.web figcaption { font: 12px/1.6 var(--mono); }
.web a { color: inherit; }
code { font: 14px var(--mono); }
.wordmark { position: relative; margin: 0; padding: 0 1rem .5rem; font: clamp(3rem, 21.5vw, 24rem)/.9 var(--mono); letter-spacing: -.05em; color: var(--display); white-space: nowrap; overflow: hidden; }
svg { display: block; }
/* Spacing that used to be inline style attributes (a strict CSP blocks those) */
.gap-1 { margin-top: 1rem; }
.gap-3 { margin-top: 3rem; }
