/* The day dial (components/site/day.blade.php): the apps of the customer app around a 24-hour clock, noon at the top and
   midnight at the bottom, with the assistant in the middle. Loaded by the public site and by the entry screens; every
   colour is a token of the customer app's design system (praca-tokens.css). */

/* Each app's own two colours, the ones its tile wears in the launcher */
:where([data-app="food"]) { --st-from: var(--pr-app-comida-from); --st-to: var(--pr-app-comida-to); }
:where([data-app="groceries"]) { --st-from: var(--pr-app-mercado-from); --st-to: var(--pr-app-mercado-to); }
:where([data-app="shops"]) { --st-from: var(--pr-app-shopping-from); --st-to: var(--pr-app-shopping-to); }
:where([data-app="rides"]) { --st-from: var(--pr-app-corridas-from); --st-to: var(--pr-app-corridas-to); }
:where([data-app="travel"]) { --st-from: var(--pr-app-viagens-from); --st-to: var(--pr-app-viagens-to); }
:where([data-app="events"]) { --st-from: var(--pr-app-eventos-from); --st-to: var(--pr-app-eventos-to); }
:where([data-app="health"]) { --st-from: var(--pr-app-saude-from); --st-to: var(--pr-app-saude-to); }
:where([data-app="beauty"]) { --st-from: var(--pr-app-beleza-from); --st-to: var(--pr-app-beleza-to); }
:where([data-app="pets"]) { --st-from: var(--pr-app-pets-from); --st-to: var(--pr-app-pets-to); }
:where([data-app="condo"]) { --st-from: var(--pr-app-condominio-from); --st-to: var(--pr-app-condominio-to); }
:where([data-app="homes"]) { --st-from: var(--pr-app-imoveis-from); --st-to: var(--pr-app-imoveis-to); }
:where([data-app="pros"]) { --st-from: var(--pr-app-servicos-from); --st-to: var(--pr-app-servicos-to); }
:where([data-app="jobs"]) { --st-from: var(--pr-app-empregos-from); --st-to: var(--pr-app-empregos-to); }
:where([data-app="learning"]) { --st-from: var(--pr-app-educacao-from); --st-to: var(--pr-app-educacao-to); }
:where([data-app="bank"]) { --st-from: var(--pr-app-banco-from); --st-to: var(--pr-app-banco-to); }
:where([data-app="games"]) { --st-from: var(--pr-app-jogos-from); --st-to: var(--pr-app-jogos-to); }
:where([data-app="giving"]) { --st-from: var(--pr-app-doacoes-from); --st-to: var(--pr-app-doacoes-to); }
:where([data-app="messages"]) { --st-from: var(--pr-app-mensagens-from); --st-to: var(--pr-app-mensagens-to); }
:where([data-app="family"]) { --st-from: var(--pr-app-familia-from); --st-to: var(--pr-app-familia-to); }
:where([data-app="assistant"]) { --st-from: var(--pr-app-alineza-from); --st-to: var(--pr-app-alineza-to); }

/* The dial: --d is its width, --orb the size of each app, --st-ground the colour it sits on */
.st-day { --d: 600px; --orb: 60px; --st-ground: var(--pr-canvas); position: relative; flex: none; width: var(--d); height: var(--d); margin: 0; color: var(--pr-ink); font-family: var(--pr-font-sans); }
.st-day__face { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.st-day__track { fill: none; stroke: var(--pr-hairline-strong); stroke-width: .4; }
.st-day__night { fill: none; stroke: var(--pr-surface-3); stroke-width: 2; stroke-linecap: round; }
.st-day__tick { fill: none; stroke: var(--pr-ink-3); stroke-width: .5; stroke-linecap: round; }
.st-day__tick--main { stroke: var(--pr-ink-2); stroke-width: .9; }
.st-day__hand { opacity: 0; transform: rotate(calc((var(--now, 12) - 12) * 15deg)); transform-box: view-box; transform-origin: 100px 100px; transition: opacity var(--pr-dur-base) var(--pr-ease-out); }
.st-day[data-live] .st-day__hand { opacity: 1; }
.st-day__hand line { fill: none; stroke: var(--pr-brand); stroke-width: 1.4; stroke-linecap: round; }
.st-day__hand circle { fill: var(--pr-brand); stroke: none; }

/* The four hours written inside the ticks */
.st-day__mark { --a: 0deg; position: absolute; left: 50%; top: 50%; font: 600 12px/16px var(--pr-font-sans); color: var(--pr-ink-3); font-variant-numeric: tabular-nums; transform: translate(-50%, -50%) rotate(var(--a)) translateY(calc(var(--d) * -.29)) rotate(calc(var(--a) * -1)); }
.st-day__mark[data-at="0"] { --a: 180deg; }
.st-day__mark[data-at="6"] { --a: -90deg; }
.st-day__mark[data-at="18"] { --a: 90deg; }

/* The apps, each at its hour on the track */
.st-day__apps { position: absolute; inset: 0; margin: 0; padding: 0; list-style: none; }
.st-day__app { --h: 12; --a: calc((var(--h) - 12) * 15deg); position: absolute; left: 50%; top: 50%; width: var(--orb); height: var(--orb); margin: calc(var(--orb) / -2) 0 0 calc(var(--orb) / -2); transform: rotate(var(--a)) translateY(calc(var(--d) * -.43)) rotate(calc(var(--a) * -1)); }
.st-day__app[data-hour="0"] { --h: 0; }
.st-day__app[data-hour="6"] { --h: 6; }
.st-day__app[data-hour="7"] { --h: 7; }
.st-day__app[data-hour="8"] { --h: 8; }
.st-day__app[data-hour="9"] { --h: 9; }
.st-day__app[data-hour="10"] { --h: 10; }
.st-day__app[data-hour="11"] { --h: 11; }
.st-day__app[data-hour="13"] { --h: 13; }
.st-day__app[data-hour="14"] { --h: 14; }
.st-day__app[data-hour="15"] { --h: 15; }
.st-day__app[data-hour="16"] { --h: 16; }
.st-day__app[data-hour="17"] { --h: 17; }
.st-day__app[data-hour="18"] { --h: 18; }
.st-day__app[data-hour="19"] { --h: 19; }
.st-day__app[data-hour="20"] { --h: 20; }
.st-day__app[data-hour="21"] { --h: 21; }
.st-day__app[data-hour="22"] { --h: 22; }
.st-day__app[data-hour="23"] { --h: 23; }
.st-day__orb { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 999px; background: linear-gradient(160deg, var(--st-from), var(--st-to)); box-shadow: 0 0 0 4px var(--st-ground); transition: transform var(--pr-dur-base) var(--pr-ease-out), box-shadow var(--pr-dur-base) var(--pr-ease-out); }
.st-day__orb img { width: 74%; height: 74%; }
.st-day__app:hover .st-day__orb { transform: scale(1.12); }
.st-day__app.is-now .st-day__orb { transform: scale(1.12); box-shadow: 0 0 0 4px var(--st-ground), 0 0 0 6px var(--pr-brand); }
.st-day__sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* The middle: the assistant, the hour and what people do now */
.st-day__now { position: absolute; left: 50%; top: 50%; display: grid; justify-items: center; width: calc(var(--d) * .5); transform: translate(-50%, -50%); text-align: center; }
.st-day__core { width: 40px; height: 40px; margin-bottom: 4px; }
.st-day__clock { font: 800 96px/96px var(--pr-font-sans); letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.st-day__name { margin-top: 8px; font: 700 20px/24px var(--pr-font-sans); }
.st-day__text { margin-top: 4px; font: 400 16px/24px var(--pr-font-sans); color: var(--pr-ink-2); text-wrap: balance; }

/* The entry screens' dial: smaller, on the side's own ground */
.st-day--gate { --d: 420px; --orb: 44px; --st-ground: var(--pr-surface); }
.st-day--gate .st-day__core { width: 32px; height: 32px; }
.st-day--gate .st-day__clock { font-size: 64px; line-height: 64px; }
.st-day--gate .st-day__name { font-size: 18px; line-height: 24px; }
.st-day--gate .st-day__text { font-size: 14px; line-height: 20px; }

@media (max-width: 1279px) {
    .st-day--hero { --d: 520px; --orb: 52px; }
    .st-day--hero .st-day__clock { font-size: 72px; line-height: 72px; }
}
@media (min-width: 1280px) and (min-height: 860px) {
    .st-day--gate { --d: 480px; --orb: 48px; }
}
@media (max-width: 1023px), (max-height: 760px) {
    .st-day--gate { --d: 340px; --orb: 36px; }
    .st-day--gate .st-day__mark { font-size: 10px; line-height: 12px; }
    .st-day--gate .st-day__core { width: 28px; height: 28px; }
    .st-day--gate .st-day__clock { font-size: 48px; line-height: 48px; }
    .st-day--gate .st-day__name { font-size: 16px; line-height: 20px; }
    .st-day--gate .st-day__text { font-size: 13px; line-height: 18px; }
}
@media (max-width: 1023px) {
    .st-day--gate { --d: 300px; --orb: 32px; }
    .st-day--gate .st-day__core { width: 24px; height: 24px; }
    .st-day--gate .st-day__clock { font-size: 40px; line-height: 40px; }
}
@media (max-width: 640px) {
    .st-day--hero { --d: min(340px, calc(100vw - 40px)); --orb: 34px; }
    .st-day--hero .st-day__mark { font-size: 10px; line-height: 12px; }
    .st-day--hero .st-day__core { width: 28px; height: 28px; }
    .st-day--hero .st-day__clock { font-size: 48px; line-height: 48px; }
    .st-day--hero .st-day__name { font-size: 16px; line-height: 20px; }
    .st-day--hero .st-day__text { font-size: 13px; line-height: 18px; }
    .st-day__orb { box-shadow: 0 0 0 3px var(--st-ground); }
}
@media (prefers-reduced-motion: reduce) {
    .st-day__hand, .st-day__orb { transition: none; }
}
