:root {
  color-scheme: light;
  --paper: #fbfaf8;
  --white: #fff;
  --ink: #201f1c;
  --muted: #625f57;
  --line: #e2dfd8;
  --accent: #303a32;
  --focus: #536f60;
  --swatch-height: 3rem;
  --swatch-radius: .35rem;
  --swatch-gap: .5rem;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif; }
a { color: inherit; text-underline-offset: .22em; }
button, input { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
.wrap { width: min(100% - 2.5rem, 54rem); margin-inline: auto; }
.site-header { display: flex; min-height: 72px; gap: 1rem; justify-content: space-between; align-items: center; padding: .35rem clamp(1rem, 5vw, 5rem); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; font-weight: 690; letter-spacing: -.035em; }
.brand img { display: block; flex: none; }
.site-header nav { display: flex; gap: clamp(.7rem, 3vw, 2rem); }
.site-header nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); font-size: .88rem; text-decoration: none; }
.site-header nav a:hover { text-decoration: underline; }
section[id], details[id] { scroll-margin-top: 1.25rem; }
.test { padding-block: clamp(3.1rem, 8vw, 7rem) clamp(3rem, 7vw, 6rem); }
.intro { text-align: center; margin-bottom: clamp(1.7rem, 4vw, 2.75rem); }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(2.6rem, 6.4vw, 5.25rem); line-height: 1.03; font-weight: 660; letter-spacing: -.075em; text-wrap: balance; }
.intro p { color: var(--muted); margin-top: .95rem; font-size: clamp(1rem, 2.1vw, 1.2rem); }
#start { width: min(100%, 38rem); margin-inline: auto; }
.upload { display: grid; justify-items: center; gap: .85rem; padding: clamp(1.4rem, 5vw, 3rem) 1rem; text-align: center; border: 1px dashed #a7a398; border-radius: 1rem; background: var(--white); }
.upload-icon { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 50%; font-size: 1.45rem; line-height: 1; }
.upload p, small, .muted { color: var(--muted); }
.upload strong { color: var(--ink); font-size: 1.15rem; font-weight: 650; }
small, .small { font-size: .85rem; }
.primary { display: inline-flex; justify-content: center; align-items: center; min-height: 47px; border-radius: .55rem; padding: .55rem 1.2rem; border: 1px solid var(--accent); background: var(--accent); color: white; font-weight: 650; cursor: pointer; }
.primary:hover { background: #414e43; }
.primary:disabled { background: #ebe9e4; border-color: var(--line); color: #625f57; cursor: default; }
.text-button { min-height: 44px; border: 0; background: transparent; padding: .35rem 0; color: var(--ink); text-decoration: underline; text-underline-offset: .23em; }
.file-label:has(+ input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 4px; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .88fr); gap: clamp(1.2rem, 4vw, 2.4rem); align-items: start; padding-block: 1.15rem; border-block: 1px solid var(--line); }
.picture { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; }
.stage { position: relative; width: min(100%, var(--photo-width), calc(var(--photo-ratio) * var(--photo-height-cap))); max-width: 100%; --photo-height-cap: 34rem; line-height: 0; }
canvas { display: block; height: auto; width: 100%; max-width: 100%; cursor: crosshair; border-radius: .55rem; }
#keys { margin-top: .65rem; text-align: center; }
#cursor, .marker { position: absolute; border-radius: 50%; pointer-events: none; transform: translate(-50%, -50%); }
#cursor { width: 23px; height: 23px; border: 2px solid white; box-shadow: 0 0 0 1px #292929; }
.marker { width: 12px; height: 12px; border: 2px solid #fff; box-shadow: 0 0 0 1px #292929; background: var(--swatch); }
.controls h2, .palette-group h3 { font-size: 1.22rem; line-height: 1.3; letter-spacing: -.025em; }
#spot-hint { color: var(--muted); margin: .35rem 0 .8rem; }
.slots { display: grid; gap: .35rem; }
.slot { color: var(--ink); display: flex; align-items: center; gap: .65rem; min-height: 46px; text-align: left; padding: .4rem .65rem; border-radius: .45rem; border: 1px solid var(--line); background: var(--white); }
.slot[aria-pressed=true] { border-color: var(--focus); background: #eef1eb; }
.chip { width: 20px; height: 20px; background: var(--swatch, transparent); border: 1px solid #25211e35; border-radius: 50%; flex: none; }
.hex { margin-left: auto; font: .81rem ui-monospace, monospace; }
.actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: .95rem; }
.quality { padding: .58rem .8rem; border-left: 2px solid #978563; margin-top: .8rem; background: #f2eee6; }
.status { color: var(--muted); margin-top: .6rem; }
.status:empty { display: none; }
#start:not([hidden]) ~ .status { text-align: center; }
.result { margin-top: 2.5rem; }
.result-label { color: var(--muted); font-size: .95rem; }
.result h2 { margin-bottom: .6rem; font-size: clamp(2.55rem, 6vw, 4.6rem); letter-spacing: -.072em; line-height: 1.04; }
#reason { max-width: 65ch; }
.traits { display: grid; grid-template-columns: repeat(4, 1fr); gap: .7rem; padding: .85rem 0; border-block: 1px solid var(--line); margin: 1.35rem 0 1.65rem; }
.traits dt { color: var(--muted); font-size: .85rem; }
.traits dd { margin: 0; font-weight: 650; }
.palette-group { margin-top: 1.35rem; }
.palette-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: var(--swatch-gap); margin-top: .6rem; }
.swatch { min-height: 44px; display: grid; grid-template-rows: var(--swatch-height) auto auto; text-align: left; border: 0; background: transparent; color: var(--ink); padding: 0; align-content: start; }
.swatch::before, .swatch-tile { display: block; height: var(--swatch-height); background: var(--swatch); border: 1px solid #28231822; border-radius: var(--swatch-radius); }
.swatch::before { content: ''; }
.swatch:hover .swatch-code { text-decoration: underline; }
.swatch-name { font-size: .84rem; line-height: 1.25; margin-top: .3rem; }
.swatch-code { font: .76rem/1.5 ui-monospace,monospace; color: var(--muted); }
.combinations { margin-top: 1.6rem; }
.combinations li { margin-bottom: .5rem; }
.reading { padding-block: clamp(2.4rem, 5vw, 3.8rem); border-top: 1px solid var(--line); }
.reading h2 { font-size: clamp(1.9rem, 4.3vw, 3rem); line-height: 1.13; letter-spacing: -.055em; font-weight: 655; margin-bottom: .95rem; }
.reading h3 { margin: 1.35rem 0 .35rem; font-size: 1.15rem; }
.reading p { margin-bottom: .85rem; max-width: 70ch; color: var(--muted); }
.method-list, .seasons-list { display: grid; gap: 0; margin-top: 1.15rem; }
.method-list > div, .seasons-list > div { display: grid; grid-template-columns: 7rem 1fr; gap: 1rem; border-top: 1px solid var(--line); padding: .7rem 0; }
.method-list dt, .seasons-list dt { font-weight: 650; }
.method-list dd, .seasons-list dd { margin: 0; color: var(--muted); }
details { border-top: 1px solid var(--line); }
summary { cursor: pointer; font-weight: 640; padding: .75rem 0; }
.site-footer { display: flex; justify-content: space-between; gap: 1rem; border-top: 1px solid var(--line); padding: 1rem 0 1.5rem; font-size: .875rem; color: var(--muted); }
.visually-hidden, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { position: fixed; z-index: 10; inset: 10px auto auto 10px; background: white; padding: .7rem; }
@media(max-width: 620px) {
  .site-header { min-height: 59px; }
  .site-header nav a { font-size: .8rem; }
  .brand { font-size: .92rem; }
  .brand img { width: 24px; height: 24px; }
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .stage { --photo-height-cap: 52vh; }
  .traits { grid-template-columns: repeat(2, 1fr); }
  .method-list > div, .seasons-list > div { grid-template-columns: 1fr; gap: .1rem; }
}
@media(max-width: 355px) { .site-header nav a:first-child { display: none; } }
@media(prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

.legal-links { display: flex; flex-wrap: wrap; gap: .25rem 1rem; }
.legal-links a { display: inline-flex; align-items: center; min-height: 36px; }
.legal-links a[aria-current="page"] { color: var(--ink); }
.legal-page { padding-block: clamp(3rem, 8vw, 6rem); }
.legal-page h1 { font-size: clamp(2.6rem, 6vw, 4.5rem); margin-bottom: 1.6rem; }
.legal-page h2 { margin: 2rem 0 .4rem; letter-spacing: -.035em; font-size: 1.35rem; }
.legal-page p { max-width: 68ch; margin: 0 0 1rem; }
@media (max-width: 620px) {
  .site-footer { flex-direction: column; gap: .4rem; }
}

.upload .upload-privacy { margin-top: -.45rem; font-size: .88rem; }
.upload-demo { font-weight: 640; }
.upload-formats { font-size: .78rem; }
.upload-palette { margin: 1.15rem auto 0; max-width: 24rem; text-align: center; }
.upload-palette figcaption { margin-bottom: .55rem; color: var(--muted); font-size: .86rem; font-weight: 640; }
.example-swatches, .trait-comparisons, .season-strip { display: grid; gap: var(--swatch-gap); margin: 0; padding: 0; list-style: none; }
.example-swatches { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.example-swatches li, .trait-comparisons li, .season-strip li { font-size: .82rem; line-height: 1.4; }
.example-swatches li > span:last-child, .trait-comparisons li > span:last-child { display: block; margin-top: .35rem; }
.trait-comparisons { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 16rem; }
.comparison-colors { display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; gap: var(--swatch-gap); }
.method-list dd > p { margin-bottom: .55rem; }
.season-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.season-strip strong { display: block; color: var(--ink); margin: .4rem 0 .2rem; }
