:root {
  color-scheme: light;
  --milk: #ffffff;
  --graphite: #242424;
  --muted: #626873;
  --line: #e1e4e8;
  --surface: #f1f3f6;
  --mono: "IBM Plex Mono", monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; background: var(--milk); }
body { margin: 0; background: var(--milk); color: var(--graphite); font-family: Inter, Arial, sans-serif; font-size: 1rem; -webkit-font-smoothing: antialiased; }
button { font: inherit; }
.shell { width: min(100% - 80px, 1080px); min-height: 100vh; min-height: 100svh; margin-inline: auto; display: flex; flex-direction: column; }
.masthead { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding-block: 30px 24px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 13px; min-width: 0; }
h1 { margin: 0; font-size: 1.125rem; font-weight: 600; letter-spacing: -.025em; line-height: 1.4; }
.mark { position: relative; width: 25px; height: 25px; flex-shrink: 0; }
.mark::before, .mark::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; }
.mark::before { top: 0; left: 0; background: var(--graphite); }
.mark::after { right: 0; bottom: 0; border: 1px solid var(--graphite); background: var(--milk); }
.counter { flex-shrink: 0; font-family: var(--mono); font-size: .8125rem; line-height: 1.5; color: var(--muted); font-variant-numeric: tabular-nums; }
main { flex: 1; width: 100%; max-width: 940px; margin-inline: auto; padding-block: 28px 32px; display: flex; flex-direction: column; justify-content: center; }
.intro { margin: 0 0 24px; font-size: 1rem; line-height: 1.5; color: var(--muted); }
.brief { min-width: 0; }
main[data-has-brief="true"] { max-width: 800px; }
.stage { display: grid; align-items: center; }
.stage > * { grid-area: 1 / 1; min-width: 0; }
main[data-has-brief="false"] .brief { border-top: 0; }
main[data-has-brief="false"] { padding-block: 28px; }
main[data-has-brief="false"] .actions { flex-direction: column-reverse; justify-content: center; gap: 10px; padding-top: 10px; }
main[data-has-brief="false"] .generate { width: min(100%, 310px); }
.welcome { padding: 0; text-align: center; }
/* Compensate for the large heading's extra space below its visible letters. */
.welcome h2 { margin: 0 0 max(0px, calc(1rem - .2857em)); font-size: clamp(2rem, 4.2vw, 3.5rem); font-weight: 500; line-height: 1.1; letter-spacing: -.055em; text-transform: uppercase; text-wrap: balance; overflow-wrap: anywhere; }
.welcome p { margin: 0; font-size: 1rem; line-height: 1.65; color: var(--muted); }
.results { --reel-height: 10.5rem; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--graphite); }
.field { min-width: 0; padding: 20px; display: grid; grid-template-rows: minmax(2.5rem, auto) var(--reel-height); }
.field:nth-child(odd) { border-right: 1px solid var(--line); }
.field:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
dt { margin: 0; font-size: 1rem; font-weight: 700; text-transform: uppercase; line-height: 1.4; overflow-wrap: anywhere; }
dd { margin: 0; min-width: 0; }
.reel-window { position: relative; height: var(--reel-height); overflow: hidden; isolation: isolate; }
.settled, .reel-item { height: var(--reel-height); display: grid; align-items: center; padding-block: 8px; }
.reel-strip { position: absolute; top: 0; left: 0; width: 100%; will-change: transform; }
.reel-value { width: 100%; min-width: 0; text-align: center; }
.field-value { font-size: clamp(1.125rem, 2.5vw, 2rem); font-weight: 500; line-height: 1.25; letter-spacing: -.035em; overflow-wrap: anywhere; text-wrap: balance; }
.niche-field .field-value { white-space: pre-line; line-height: 1.1; }
.identity-name { font-size: clamp(1.5rem, 4.5vw, 3.5rem); font-weight: 500; line-height: 1.06; letter-spacing: -.055em; text-transform: uppercase; overflow-wrap: anywhere; text-wrap: balance; }
.identity-name.is-long { font-size: clamp(1.25rem, 3.8vw, 2.75rem); }
.translation { margin-top: 3px; font-family: var(--mono); color: var(--muted); font-size: 1rem; line-height: 1.45; overflow-wrap: anywhere; text-wrap: balance; }
.palette { display: grid; grid-template-columns: repeat(var(--colors), minmax(0, 1fr)); width: min(100%, 208px); padding: 0; margin: 0 auto; list-style: none; }
.swatch { min-width: 0; }
.color { display: block; height: 112px; background: var(--swatch); box-shadow: inset 0 0 0 1px rgb(36 36 36 / 5%); }
.hex { display: block; padding-top: 10px; font: .875rem/1.4 var(--mono); letter-spacing: -.015em; text-align: center; white-space: nowrap; user-select: all; }
.actions { display: flex; justify-content: flex-end; align-items: center; gap: 24px; padding-top: 24px; }
.generate { display: inline-flex; width: min(100%, 310px); justify-content: space-between; align-items: center; gap: 26px; min-height: 56px; padding: 14px 22px; border: 1px solid var(--graphite); border-radius: 0; background: var(--graphite); color: var(--milk); font-size: 1rem; font-weight: 500; line-height: 1.4; cursor: pointer; touch-action: manipulation; transition: background .18s, transform .15s; }
.generate:hover { background: #3a3e45; }
.generate[aria-disabled="true"] { cursor: progress; background: #3a3e45; }
.generate[aria-disabled="true"]:active { transform: none; }
.generate[aria-disabled="true"] .refresh { animation: turn 1.65s cubic-bezier(.4,0,.2,1); }
@keyframes turn { to { transform: rotate(360deg); } }
.generate:active { transform: translateY(1px); }
.generate:focus-visible { outline: 2px solid var(--graphite); outline-offset: 4px; }
.refresh { flex-shrink: 0; }
.keyboard-hint { font-size: .8125rem; line-height: 1.5; color: var(--muted); }
kbd { font-family: inherit; padding: 4px 6px; margin-left: 2px; border: 1px solid var(--line); border-radius: 3px; }
footer { display: flex; justify-content: space-between; gap: 20px; padding-block: 18px 22px; border-top: 1px solid var(--line); font-size: .75rem; line-height: 1.5; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; border: 0; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
.notice { font-size: .875rem; line-height: 1.5; }
@media (max-width: 700px) {
  .shell { width: calc(100% - 40px); }
  .masthead { padding-block: 23px 20px; }
  main { padding-block: 22px 28px; }
  .intro { margin-bottom: 20px; }
  .results { --reel-height: 11rem; }
  .field { padding: 12px; }
  .translation { font-size: .875rem; }
  .color { height: 88px; }
  .palette { max-width: 144px; }
  .actions { padding-top: 20px; }
  .generate { width: 100%; min-height: 54px; padding-inline: 18px; gap: 12px; }
  .keyboard-hint, .footer-detail { display: none; }
  .welcome p br { display: none; }
  .welcome p { max-width: 330px; margin-inline: auto; }
  footer { padding-block: 16px 20px; }
}
@media (max-width: 420px) {
  .shell { width: calc(100% - 32px); }
  .masthead { padding-block: 18px 16px; gap: 12px; }
  .brand { gap: 9px; }
  h1 { font-size: 1rem; }
  .counter { font-size: .75rem; }
  main { padding-block: 18px 24px; }
  .intro { font-size: .9375rem; margin-bottom: 14px; max-width: 290px; }
  .actions { padding-top: 16px; }
}
@media (max-width: 550px) {
  .palette { row-gap: 4px; }
  .swatch { display: contents; }
  .color { grid-row: 1; grid-column: calc(var(--index) + 1); margin-bottom: 4px; }
  .hex { grid-row: calc(var(--index) + 2); grid-column: 1 / -1; display: flex; justify-content: center; align-items: center; gap: 6px; padding: 0; }
  .hex::before { content: ""; width: 8px; height: 8px; flex-shrink: 0; background: var(--swatch); box-shadow: inset 0 0 0 1px rgb(36 36 36 / 10%); }
}
@media (min-width: 701px) and (max-height: 800px) {
  .masthead { padding-block: 22px 18px; }
  main { padding-block: 20px; }
  .intro { margin-bottom: 20px; }
  .actions { padding-top: 20px; }
  footer { padding-block: 14px 16px; }
}
@media (max-width: 350px) {
  .masthead { flex-wrap: wrap; row-gap: 10px; }
  .counter { margin-left: 34px; }
  .generate { padding-inline: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
