/* Section 6 : day-by-day attribution view (overrides/attribution.html, drawn by k-attr.js).
   Same structure as our client attribution pages, in the site's language: straight on the page ground, cream ink (the section 2
   gradient never gets lighter than .39, so cream always reads), gold only for AI and our own work, hairlines instead of cards. */
.at { --cream: 255, 250, 240; --gold: 217, 168, 94; width: 100%; color: rgb(var(--cream)); font-family: var(--font-body); font-optical-sizing: auto; }
.at-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.at-who { display: flex; align-items: center; gap: 12px; }
.at-y { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: rgba(var(--cream), .1); color: rgb(var(--cream)); }
.at-y svg { width: auto; height: 20px; fill: currentColor; }   /* the Earleads mark (defined once in the header as #mark) */
.at-who b { display: block; font-size: 17px; font-weight: 500; line-height: 22px; letter-spacing: -.01em; }
.at-who small { display: block; font-size: 13px; line-height: 18px; color: rgba(var(--cream), .62); }

/* period switch: the cream thumb slides to the pressed button (critically damped, interruptible: it re-targets from where it is) */
.at-seg { position: relative; display: flex; padding: 3px; border-radius: 999px; box-shadow: inset 0 0 0 1px rgba(var(--cream), .28); }
.at-seg button { position: relative; z-index: 1; padding: 7px 16px; border: 0; border-radius: 999px; background: none; font: 500 13px/16px var(--font-body); color: rgba(var(--cream), .82); cursor: pointer; transition: color .3s var(--ease-spring); -webkit-tap-highlight-color: transparent; }
.at-seg button[aria-pressed="true"] { color: #2B2625; }
.at-seg button:focus-visible { outline: 2px solid rgba(var(--cream), .7); outline-offset: 2px; }
.at-seg button:active { transform: scale(.96); transition: transform .1s ease-out, color .3s var(--ease-spring); }
.at-thumb { position: absolute; top: 3px; bottom: 3px; left: 0; width: 0; border-radius: 999px; background: rgb(var(--cream)); box-shadow: 0 1px 2px rgba(20, 10, 6, .25); }
.at-seg.ready .at-thumb { transition: transform .45s var(--ease-spring), width .45s var(--ease-spring); }

.at-did { margin: 28px 0 0; font-size: 17px; line-height: 26px; letter-spacing: -.01em; color: rgba(var(--cream), .86); }
.at-did b { font-weight: 500; color: rgb(var(--cream)); }

.at-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 22px; box-shadow: inset 0 1px 0 rgba(var(--cream), .16), inset 0 -1px 0 rgba(var(--cream), .16); }
.at-kpi { display: flex; flex-direction: column; min-width: 0; padding: 28px 24px 30px; }
.at-kpi + .at-kpi { box-shadow: inset 1px 0 0 rgba(var(--cream), .16); }
.at-kpi:first-child { padding-left: 0; }
.at-kpi > b { font: 500 52px/56px var(--font-display); letter-spacing: -.04em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.at-kpi > span { margin-top: 10px; font-size: 15px; line-height: 21px; color: rgba(var(--cream), .8); }
.at-kpi small { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; line-height: 18px; color: rgba(var(--cream), .62); }
.at-kpi small i { font-style: normal; }
.at-chip { padding: 1px 7px; border-radius: 6px; font-style: normal; font-size: 12px; font-weight: 600; line-height: 16px; color: rgb(var(--cream)); box-shadow: inset 0 0 0 1px rgba(var(--cream), .3); font-variant-numeric: tabular-nums; }
.at-chip.up { background: rgba(var(--gold), .2); box-shadow: inset 0 0 0 1px rgba(var(--gold), .6); }
.at-chip:empty { display: none; }

.at-day { margin-top: 72px; }
.at-sh { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; }
.at-sh h3 { margin: 0; font: 500 32px/38px var(--font-display); letter-spacing: -.03em; color: rgb(var(--cream)); }
.at-readout { margin: 0; font-size: 13px; line-height: 18px; color: rgba(var(--cream), .62); text-align: right; }
.at-readout b { font-weight: 500; color: rgba(var(--cream), .92); }
.at-readout span:not(:empty)::before { content: " · "; }

.at-lanes { margin-top: 18px; box-shadow: inset 0 1px 0 rgba(var(--cream), .16); touch-action: pan-y; }
.at-lane { display: grid; grid-template-columns: 232px minmax(0, 1fr); box-shadow: inset 0 -1px 0 rgba(var(--cream), .12); }
.at-lab { display: flex; flex-direction: column; justify-content: center; gap: 3px; min-width: 0; padding: 16px 16px 16px 0; }
.at-lab b { font-size: 15px; font-weight: 400; line-height: 20px; }
.at-lab span { font-size: 12.5px; line-height: 17px; color: rgba(var(--cream), .6); }
.at-lab em { min-height: 18px; font-style: normal; font-size: 13px; font-weight: 500; line-height: 18px; color: rgb(var(--gold)); font-variant-numeric: tabular-nums; }
.at-key { display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 2px; background: rgba(var(--cream), .85); }
.at-key.gold { margin-left: 8px; background: rgb(var(--gold)); }
.at-plot { position: relative; height: 104px; cursor: crosshair; }
.at-lane[data-lane="earned"] .at-plot { height: 128px; }   /* the money lane closes the view, a little taller */
.at-lane[data-lane="earned"] .at-lab b { font-weight: 500; }
.at-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.at svg text { font: 400 10.5px/1 var(--font-body); fill: rgba(var(--cream), .5); font-variant-numeric: tabular-nums; }
.at svg .grid { stroke: rgba(var(--cream), .09); stroke-width: 1; shape-rendering: crispEdges; }
.at svg .rise { transform-box: fill-box; transform-origin: 50% 100%; }
.at svg .pop { transform-box: fill-box; transform-origin: 50% 50%; }
.at svg .rule { stroke: rgba(var(--cream), .55); stroke-width: 1; shape-rendering: crispEdges; opacity: 0; transition: opacity .15s; }
.at-lanes.hovering svg .rule { opacity: 1; }
.at-axis { position: relative; height: 26px; margin-left: 232px; }
.at-axis span { position: absolute; top: 8px; font-size: 11px; line-height: 14px; color: rgba(var(--cream), .5); white-space: nowrap; transform: translateX(-50%); font-variant-numeric: tabular-nums; }

@media (max-width: 1024px) {
  .at-kpi > b { font-size: 40px; line-height: 44px; }
  .at-lane { grid-template-columns: 180px minmax(0, 1fr); }
  .at-axis { margin-left: 180px; }
}
@media (max-width: 720px) {
  .at-head { flex-direction: column; align-items: flex-start; gap: 16px; }
  .at-did { margin-top: 22px; font-size: 16px; line-height: 24px; }
  .at-kpis { grid-template-columns: 1fr 1fr; }
  .at-kpi { padding: 20px 12px 22px 0; }
  .at-kpi:nth-child(even) { padding-left: 16px; box-shadow: inset 1px 0 0 rgba(var(--cream), .16); }
  .at-kpi:nth-child(odd) { box-shadow: none; }
  .at-kpi:nth-child(n + 3) { box-shadow: inset 0 1px 0 rgba(var(--cream), .16); }
  .at-kpi:nth-child(4) { box-shadow: inset 1px 0 0 rgba(var(--cream), .16), inset 0 1px 0 rgba(var(--cream), .16); }
  .at-kpi > b { font-size: 32px; line-height: 38px; }
  .at-kpi > span { font-size: 14px; line-height: 19px; }
  .at-day { margin-top: 48px; }
  .at-sh { flex-direction: column; gap: 6px; }
  .at-sh h3 { font-size: 26px; line-height: 32px; }
  .at-readout { text-align: left; }
  .at-lane { grid-template-columns: 1fr; }
  .at-lab { flex-direction: row; flex-wrap: wrap; justify-content: flex-start; align-items: baseline; gap: 2px 10px; padding: 14px 0 4px; }
  .at-lab em { margin-left: auto; }
  .at-plot { height: 76px; }
  .at-lane[data-lane="earned"] .at-plot { height: 92px; }
  .at-axis { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .at-seg.ready .at-thumb, .at-seg button { transition: none; }
}
