/* Colour Guide: a fan of swatches, application tabs, filters and drawdown cards */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cg-hero { padding: 130px 0 40px; overflow: hidden; }
.cg-hero__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 30px; align-items: center; min-height: 560px; }
.cg-hero__copy { display: grid; gap: 22px; justify-items: start; position: relative; z-index: 2; }

/* the fan: one card per grade, fanned out from a pivot below */
.fan { position: relative; height: 520px; }
.fan__card { position: absolute; left: 50%; bottom: 40px; width: 92px; height: 300px; margin-left: -46px; border-radius: 14px; overflow: hidden; transform-origin: 50% 115%; box-shadow: 0 18px 30px -18px rgba(13, 20, 36, .55), inset 0 0 0 1px rgba(255, 255, 255, .25);
  transform: rotate(var(--a)) translateY(var(--lift, 0)); transition: transform .7s var(--ease), box-shadow .3s; transition-delay: var(--delay, 0s); display: grid; grid-template-rows: 62% 38%; }
.fan__card:hover { --lift: -26px; transition-delay: 0s; }
.fan:not(.is-open) .fan__card { transform: rotate(0deg); }
.fan__card b { display: block; }
.fan__card span { position: absolute; left: 0; right: 0; bottom: 10px; text-align: center; font-size: 10px; font-weight: 500; color: rgba(13, 20, 36, .7); letter-spacing: .02em; }

.finder { padding: 20px 0 clamp(60px, 8vw, 110px); scroll-margin-top: 80px; }
.fam { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.fam__tab { display: grid; grid-template-columns: 96px 1fr; gap: 16px; align-items: center; padding: 14px 18px 14px 14px; text-align: left; border-radius: 20px; border: 1px solid var(--line); background: #fff; cursor: pointer; transition: border-color .3s, box-shadow .3s, transform .3s var(--ease); }
.fam__tab img { width: 96px; height: 72px; object-fit: contain; }
.fam__tab b { display: block; font-weight: 500; font-size: 18px; }
.fam__tab small { display: block; margin-top: 4px; font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.fam__tab:hover { transform: translateY(-2px); }
.fam__tab[aria-selected="true"] { border-color: transparent; box-shadow: 0 0 0 2px var(--blue), var(--shadow); }

.filters { display: grid; gap: 14px; padding: 22px; border-radius: 22px; background: var(--bg-soft); margin-bottom: 26px; }
.filters__row { display: grid; grid-template-columns: 130px 1fr; gap: 14px; align-items: center; }
.filters__label { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.filters__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.filters .chip { cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.filters .chip[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.filters .chip i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.filters__foot { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; padding-top: 6px; border-top: 1px solid var(--line); }
.filters__count { margin-left: auto; color: var(--muted); font-size: 14px; }
.filters__count b { color: var(--ink); font-weight: 500; font-size: 18px; }
.filters__reset { border: 0; background: none; color: var(--blue); cursor: pointer; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.switch { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch span { width: 40px; height: 24px; border-radius: 999px; background: var(--line-2); position: relative; transition: background .25s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); transition: transform .25s var(--ease); }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }

.grades { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.grade { display: grid; grid-template-rows: auto 1fr; border-radius: 22px; overflow: hidden; background: #fff; border: 1px solid var(--line); animation: cg-in .5s var(--ease) both; animation-delay: calc(var(--n, 0) * 35ms); }
@keyframes cg-in { from { opacity: 0; transform: translateY(12px); } }
.grade:hover .drawdown { transform: scale(1.02); }
/* a drawdown: masstone on the left, tint on the right, with the ragged edge of a real one */
.drawdown { position: relative; height: 130px; display: grid; grid-template-columns: 1fr 1fr; transition: transform .5s var(--ease); }
.drawdown b, .drawdown i { position: relative; display: block; }
.drawdown b { background: linear-gradient(180deg, rgba(255, 255, 255, .14), transparent 30%), var(--m); }
.drawdown i { background: linear-gradient(180deg, rgba(255, 255, 255, .2), transparent 30%), var(--t); }
.drawdown::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 14px; background: #fff; -webkit-mask: radial-gradient(10px 8px at 10px 0, transparent 98%, #000) 0 0 / 20px 14px repeat-x; mask: radial-gradient(10px 8px at 10px 0, transparent 98%, #000) 0 0 / 20px 14px repeat-x; }
.drawdown small { position: absolute; top: 10px; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: rgba(255, 255, 255, .85); }
.drawdown small:first-of-type { left: 12px; } .drawdown small:last-of-type { right: 12px; color: rgba(13, 20, 36, .6); }
.grade__body { display: grid; gap: 10px; align-content: start; padding: 16px 20px 20px; }
.grade__top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.grade h3 { font-size: 20px; }
.grade__ci { font-size: 12px; font-weight: 500; padding: 4px 9px; border-radius: 999px; background: var(--bg-soft); color: var(--ink-2); white-space: nowrap; }
.grade__remark { font-size: 14px; color: var(--muted); }
.rates { display: grid; gap: 6px; margin: 4px 0 0; padding: 12px 0 0; border-top: 1px solid var(--line); }
.rates div { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--ink-2); }
.rates div.is-hit { font-weight: 500; color: var(--ink); }
.rates dd { margin: 0; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--green); }
.dot--r { background: var(--green); }
.dot--s { background: linear-gradient(90deg, var(--green) 50%, transparent 50%); }
.dot--ns { border-color: #c9cfd8; }
.dot--na { border-style: dashed; border-color: #c9cfd8; }
.grades__empty { padding: 50px 0; text-align: center; color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 10px 26px; align-items: center; margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend p { flex-basis: 100%; color: var(--muted); font-size: 13px; }

@media (max-width: 1000px) {
  .cg-hero__grid { grid-template-columns: 1fr; min-height: 0; }
  .fan { height: 380px; transform: scale(.75); transform-origin: 50% 100%; margin-top: -40px; }
  .fam { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .filters__row { grid-template-columns: 1fr; gap: 8px; }
  .fan { height: 300px; transform: scale(.55); margin: -90px 0 -40px; }
}
@media (prefers-reduced-motion: reduce) {
  .fan__card { transition: none; }
  .grade { animation: none; }
}
