/* Lawyer in motion: what moves, and the drawings that move. Every piece stands still and whole for a person who asked
   their device for less motion, and what a loop shows at its rest is its last word, so nothing waits hidden. */

/* ---- the hero: the words beside the scene ------------------------------ */

.la-front.is-scened {
  display: grid;
  gap: var(--la-space-7);
  align-items: center;
}

.la-front-words {
  position: relative;
  min-width: 0;
}

@container la-page (min-width: 56rem) {
  .la-front.is-scened {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  }
}

/* The marked words carry a stroke drawn once, as by hand. */
.la-hero-line em {
  position: relative;
  white-space: nowrap;
}

.la-hero-stroke {
  position: absolute;
  inset-inline-start: -2%;
  inset-block-end: -0.14em;
  width: 104%;
  height: 0.22em;
  overflow: visible;
}

.la-hero-stroke path {
  fill: none;
  stroke: var(--la-color-accent);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 120;
  stroke-dashoffset: 0;
  animation: la-draw calc(900ms * var(--la-motion)) 500ms var(--la-ease-out) backwards;
}

@keyframes la-draw {
  from {
    stroke-dashoffset: 120;
  }
}

/* ---- the scene: a term moved, stamped, and the phone told -------------- */

.la-scene {
  --la-loop: calc(11s * var(--la-motion));

  position: relative;
  padding: var(--la-space-7) 0 var(--la-space-4) var(--la-space-5);
}

.la-scene-record {
  position: relative;
  padding: var(--la-space-5);
  background: var(--la-color-bg-raised);
  border: 1px solid var(--la-color-border);
  border-radius: var(--la-radius-xl);
  box-shadow: var(--la-shadow-xl);
}

.la-scene-record::before {
  position: absolute;
  inset: 10px -10px -10px 10px;
  z-index: -1;
  content: '';
  background: var(--la-color-bg-sunken);
  border: 1px solid var(--la-color-border);
  border-radius: var(--la-radius-xl);
}

.la-scene-top {
  display: flex;
  gap: var(--la-space-4);
  align-items: center;
  justify-content: space-between;
}

.la-scene-number {
  color: var(--la-color-fg);
  font-family: var(--la-font-mono);
  font-size: var(--la-text-lg);
  font-weight: var(--la-weight-semi);
}

.la-scene-kind {
  padding: var(--la-space-05) var(--la-space-2);
  color: var(--la-color-fg-muted);
  font-family: var(--la-font-mono);
  font-size: var(--la-text-2xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--la-color-border-strong);
  border-radius: var(--la-radius-full);
}

.la-scene-court {
  margin-block-start: var(--la-space-1);
  color: var(--la-color-fg-muted);
  font-size: var(--la-text-sm);
}

.la-scene-term {
  position: relative;
  margin-block-start: var(--la-space-4);
  padding: var(--la-space-4);
  background: var(--la-color-accent-subtle);
  border: 1px solid var(--la-color-role-accent-soft, var(--la-color-border));
  border-radius: var(--la-radius-lg);
}

.la-scene-term .la-lbl {
  color: var(--la-color-link);
}

.la-scene-when {
  display: flex;
  flex-wrap: wrap;
  gap: var(--la-space-2) var(--la-space-3);
  align-items: baseline;
  margin-block-start: var(--la-space-1);
  color: var(--la-color-fg);
  font-size: var(--la-text-2xl);
  font-weight: var(--la-weight-bold);
  letter-spacing: -0.02em;
}

.la-scene-was {
  position: relative;
  color: var(--la-color-fg-subtle);
  font-weight: var(--la-weight-medium);
  text-decoration: none;
}

.la-scene-was::after {
  position: absolute;
  inset-inline: -3px;
  inset-block-start: 52%;
  height: 2px;
  content: '';
  background: var(--la-color-danger);
  transform-origin: left;
  animation: la-strike var(--la-loop) var(--la-ease-out) infinite;
}

.la-scene-now {
  display: inline-flex;
  gap: var(--la-space-1);
  align-items: center;
  animation: la-arrive var(--la-loop) var(--la-ease-out) infinite;
}

.la-scene-now svg {
  width: var(--la-icon-sm);
  height: var(--la-icon-sm);
  color: var(--la-color-link);
}

.la-scene-panel {
  margin-block-start: var(--la-space-1);
  color: var(--la-color-fg-muted);
  font-size: var(--la-text-sm);
}

.la-scene-stamp {
  position: absolute;
  inset-inline-end: var(--la-space-3);
  inset-block-start: calc(-1 * var(--la-space-4));
  padding: var(--la-space-1) var(--la-space-3);
  color: var(--la-color-danger);
  font-family: var(--la-font-mono);
  font-size: var(--la-text-2xs);
  font-weight: var(--la-weight-bold);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: var(--la-color-bg-raised);
  border: 2px solid currentcolor;
  border-radius: var(--la-radius-md);
  transform: rotate(-9deg);
  animation: la-stamp var(--la-loop) var(--la-ease-out) infinite;
}

.la-scene-road {
  display: block;
  width: 100%;
  height: auto;
  margin-block-start: var(--la-space-4);
  overflow: visible;
}

.la-scene-road line {
  stroke: var(--la-color-border-strong);
  stroke-width: 2;
}

.la-scene-road .la-scene-run {
  stroke: var(--la-color-accent);
  stroke-dasharray: 190;
  stroke-dashoffset: 0;
  animation: la-run var(--la-loop) var(--la-ease-in-out) infinite;
}

.la-scene-road circle {
  fill: var(--la-color-bg-raised);
  stroke: var(--la-color-border-strong);
  stroke-width: 2;
}

.la-scene-road circle.is-on {
  fill: var(--la-color-accent);
  stroke: var(--la-color-accent);
}

.la-scene-road circle.is-now {
  stroke: var(--la-color-accent);
  stroke-width: 2.5;
}

.la-scene-road text {
  fill: var(--la-color-fg-muted);
  font-family: var(--la-font-mono);
  font-size: 10.5px;
}

.la-scene-toast {
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: 0;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--la-control-sm) 1fr;
  gap: var(--la-space-2);
  width: min(19rem, 86%);
  padding: var(--la-space-3);
  color: var(--la-color-role-on-emphasis);
  background: var(--la-color-role-emphasis-raised, var(--la-color-role-emphasis));
  border: 1px solid var(--la-color-role-emphasis-border, transparent);
  border-radius: var(--la-radius-xl);
  box-shadow: var(--la-shadow-xl);
  animation: la-toast var(--la-loop) var(--la-ease-out) infinite;
}

.la-scene-toast .la-notif-head {
  color: var(--la-color-role-on-emphasis-muted);
}

.la-scene-toast .la-notif-title {
  color: var(--la-color-role-on-emphasis);
}

.la-scene-toast .la-notif-body {
  color: var(--la-color-role-on-emphasis-muted);
}

@keyframes la-strike {
  0%,
  16% {
    transform: scaleX(0);
  }
  22%,
  100% {
    transform: scaleX(1);
  }
}

@keyframes la-arrive {
  0%,
  22% {
    opacity: 0;
    transform: translateY(8px);
  }
  28%,
  100% {
    opacity: 1;
    transform: none;
  }
}

@keyframes la-stamp {
  0%,
  30% {
    opacity: 0;
    transform: rotate(-9deg) scale(1.7);
  }
  34% {
    opacity: 1;
    transform: rotate(-9deg) scale(0.94);
  }
  37%,
  100% {
    opacity: 1;
    transform: rotate(-9deg);
  }
}

@keyframes la-toast {
  0%,
  42% {
    opacity: 0;
    transform: translateY(-18px) scale(0.96);
  }
  48%,
  100% {
    opacity: 1;
    transform: none;
  }
}

@keyframes la-run {
  0%,
  6% {
    stroke-dashoffset: 190;
  }
  18%,
  100% {
    stroke-dashoffset: 0;
  }
}

/* ---- the phone: the notices arrive one by one ------------------------- */

.la-phone-stack .la-notif {
  animation: la-notice calc(10s * var(--la-motion)) var(--la-ease-out) infinite;
}

.la-phone-stack .la-notif:nth-child(2) {
  animation-name: la-notice-2;
}

.la-phone-stack .la-notif:nth-child(3),
.la-phone-stack .la-notif:nth-child(4) {
  animation-name: la-notice-3;
}

@keyframes la-notice {
  0%,
  6% {
    opacity: 0;
    transform: translateY(-14px) scale(0.96);
  }
  12%,
  100% {
    opacity: 1;
    transform: none;
  }
}

@keyframes la-notice-2 {
  0%,
  26% {
    opacity: 0;
    transform: translateY(-14px) scale(0.96);
  }
  32%,
  100% {
    opacity: 1;
    transform: none;
  }
}

@keyframes la-notice-3 {
  0%,
  48% {
    opacity: 0;
    transform: translateY(-14px) scale(0.96);
  }
  54%,
  100% {
    opacity: 1;
    transform: none;
  }
}

/* ---- the glyphs: each change, each reader, each reason ---------------- */

.la-point-num.is-glyph svg {
  width: var(--la-icon-md);
  height: var(--la-icon-md);
}

.la-point-num {
  transition: transform var(--la-duration-normal) var(--la-ease-out);
}

.la-point:hover .la-point-num {
  transform: translateY(-2px) rotate(-4deg);
}

.la-type-glyph,
.la-persona-glyph {
  display: block;
  flex: none;
  width: var(--la-icon-lg, 1.5rem);
  height: var(--la-icon-lg, 1.5rem);
  color: var(--la-color-link);
  transition: transform var(--la-duration-slow) var(--la-ease-out);
}

.la-type-glyph {
  box-sizing: content-box;
  margin-block-end: var(--la-space-3);
  padding: var(--la-space-2);
  background: var(--la-color-accent-subtle);
  border-radius: var(--la-radius-md);
}

.la-type-glyph.is-tone-success {
  color: var(--la-color-success);
  background: var(--la-color-success-subtle);
}

.la-type-glyph.is-tone-danger {
  color: var(--la-color-danger);
  background: var(--la-color-danger-subtle);
}

.la-type-glyph.is-tone-warning {
  color: var(--la-color-warning);
  background: var(--la-color-warning-subtle);
}

.la-type,
.la-persona {
  transition:
    transform var(--la-duration-normal) var(--la-ease-out),
    box-shadow var(--la-duration-normal) var(--la-ease-out),
    border-color var(--la-duration-fast) var(--la-ease-out);
}

.la-type:hover {
  border-color: var(--la-color-border-strong);
  box-shadow: var(--la-shadow-lg);
  transform: translateY(-3px);
}

.la-type:hover .la-type-glyph {
  transform: scale(1.08) rotate(-6deg);
}

.la-persona {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--la-space-3);
  align-items: start;
}

.la-persona:hover {
  background: var(--la-color-accent-subtle);
}

/* ---- the themes: three glyphs, a thumb sliding to the one pressed ----- */

.la-themes {
  position: relative;
  padding: 2px;
  background: var(--la-color-bg-sunken);
  border: 1px solid var(--la-color-border);
  border-radius: var(--la-radius-full);
}

.la-themes:has(.is-glyph) {
  gap: 0;
}

.la-choice.is-glyph {
  position: relative;
  z-index: 1;
  justify-content: center;
  width: max(var(--la-control-md), var(--la-tap-target));
  padding: 0;
  transition: color var(--la-duration-normal) var(--la-ease-out);
}

.la-choice.is-glyph svg {
  width: var(--la-icon-sm);
  height: var(--la-icon-sm);
  transition: transform var(--la-duration-slow) var(--la-ease-out);
}

.la-choice.is-glyph[aria-pressed='true'] {
  background: transparent;
}

.la-choice.is-glyph[aria-pressed='true'] svg {
  transform: scale(1.08);
}

.la-choice-thumb {
  display: none;
}

.la-themes:has(.is-glyph[aria-pressed='true']) .la-choice-thumb {
  position: absolute;
  inset-block: 2px;
  inset-inline-start: 2px;
  display: block;
  width: max(var(--la-control-md), var(--la-tap-target));
  background: var(--la-color-bg-raised);
  border-radius: var(--la-radius-full);
  box-shadow: var(--la-shadow-md);
  transition: transform var(--la-duration-slow) var(--la-ease-out);
}

.la-themes:has(.la-choice:nth-child(3)[aria-pressed='true']) .la-choice-thumb {
  transform: translateX(100%);
}

.la-themes:has(.la-choice:nth-child(4)[aria-pressed='true']) .la-choice-thumb {
  transform: translateX(200%);
}

/* ---- the price counted ------------------------------------------------- */

.la-count {
  display: grid;
  gap: var(--la-space-5);
  align-items: center;
  margin-block-start: var(--la-space-5);
  padding: var(--la-space-5);
  border: 1px dashed var(--la-color-border-strong);
  border-radius: var(--la-radius-xl);
}

.la-count-pick {
  margin: 0;
  padding: 0;
  border: 0;
}

.la-count-title {
  padding: 0;
  margin-block-end: var(--la-space-3);
  color: var(--la-color-fg);
  font-weight: var(--la-weight-semi);
}

.la-count-choices {
  display: flex;
  flex-wrap: wrap;
  gap: var(--la-space-2);
}

.la-count-choice {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: max(var(--la-control-lg), var(--la-tap-target));
  min-height: max(var(--la-control-lg), var(--la-tap-target));
  padding-inline: var(--la-space-3);
  color: var(--la-color-fg);
  font-family: var(--la-font-mono);
  font-weight: var(--la-weight-semi);
  background: var(--la-color-bg-raised);
  border: 1px solid var(--la-color-border-strong);
  border-radius: var(--la-radius-md);
  cursor: pointer;
  transition:
    background var(--la-duration-fast) var(--la-ease-out),
    transform var(--la-duration-fast) var(--la-ease-out);
}

.la-count-choice input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}

.la-count-choice:hover {
  background: var(--la-color-bg-raised-hover);
}

.la-count-choice:active {
  transform: scale(0.96);
}

.la-count-choice:has(:checked) {
  color: var(--la-color-fg-on-accent);
  background: var(--la-color-accent);
  border-color: var(--la-color-accent);
}

.la-count-choice:has(:focus-visible) {
  outline: 2px solid var(--la-color-border-focus);
  outline-offset: 2px;
}

.la-count-sums {
  min-width: 0;
}

.la-count-sum {
  display: none;
  gap: var(--la-space-2);
}

.la-count:has(.la-count-choice:nth-child(1) :checked) .la-count-sum:nth-child(1),
.la-count:has(.la-count-choice:nth-child(2) :checked) .la-count-sum:nth-child(2),
.la-count:has(.la-count-choice:nth-child(3) :checked) .la-count-sum:nth-child(3),
.la-count:has(.la-count-choice:nth-child(4) :checked) .la-count-sum:nth-child(4),
.la-count:has(.la-count-choice:nth-child(5) :checked) .la-count-sum:nth-child(5),
.la-count:has(.la-count-choice:nth-child(6) :checked) .la-count-sum:nth-child(6) {
  display: grid;
}

.la-count-folders {
  display: flex;
  flex-wrap: wrap;
  gap: var(--la-space-1);
}

.la-count-folder {
  width: var(--la-control-sm);
  height: calc(var(--la-control-sm) * 0.78);
  background: var(--la-color-accent-subtle);
  border: 1.5px solid var(--la-color-link);
  border-radius: 2px var(--la-radius-sm) var(--la-radius-sm) var(--la-radius-sm);
  animation: la-pop var(--la-duration-slow) var(--la-ease-out) both;
}

.la-count-folder.is-free {
  background: var(--la-color-success-subtle);
  border-color: var(--la-color-success);
}

.la-count-total {
  color: var(--la-color-fg);
  font-size: var(--la-text-3xl);
  font-weight: var(--la-weight-bold);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

.la-count-how {
  color: var(--la-color-fg-muted);
}

@keyframes la-pop {
  from {
    opacity: 0;
    transform: scale(0.5) rotate(-12deg);
  }
}

@container la-page (min-width: 48rem) {
  .la-count {
    grid-template-columns: 1fr auto;
  }
}

/* ---- the calendar: the map fills, the courts' bars grow --------------- */

.la-judet {
  animation: la-tile calc(600ms * var(--la-motion)) var(--la-ease-out) both;
}

.la-judet:nth-child(9n + 2) {
  animation-delay: calc(40ms * var(--la-motion));
}

.la-judet:nth-child(9n + 3) {
  animation-delay: calc(80ms * var(--la-motion));
}

.la-judet:nth-child(9n + 4) {
  animation-delay: calc(120ms * var(--la-motion));
}

.la-judet:nth-child(9n + 5) {
  animation-delay: calc(160ms * var(--la-motion));
}

.la-judet:nth-child(9n + 6) {
  animation-delay: calc(200ms * var(--la-motion));
}

.la-judet:nth-child(9n + 7) {
  animation-delay: calc(240ms * var(--la-motion));
}

.la-judet:nth-child(9n + 8) {
  animation-delay: calc(280ms * var(--la-motion));
}

.la-judet:nth-child(9n) {
  animation-delay: calc(320ms * var(--la-motion));
}

@keyframes la-tile {
  from {
    opacity: 0;
    transform: scale(0.82);
  }
}

/* ---- the hand: sections rise, questions open, the search lifts, a press presses ---- */

@supports (animation-timeline: view()) {
  .la-page > .la-band:not(.la-emphasis),
  .la-type,
  .la-persona {
    animation: la-rise linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 38%;
  }
}

@keyframes la-rise {
  from {
    opacity: 0.25;
    transform: translateY(22px);
  }
}

.la-shell {
  interpolate-size: allow-keywords;
}

.la-faq::details-content {
  block-size: 0;
  overflow: clip;
  transition:
    block-size var(--la-duration-slow) var(--la-ease-out),
    content-visibility var(--la-duration-slow) allow-discrete;
}

.la-faq[open]::details-content {
  block-size: auto;
}

.la-faq summary svg {
  transition: transform var(--la-duration-slow) var(--la-ease-out);
}

.la-ss-input-wrap {
  transition:
    box-shadow var(--la-duration-normal) var(--la-ease-out),
    transform var(--la-duration-normal) var(--la-ease-out);
}

.la-ss-input-wrap:focus-within {
  box-shadow:
    0 0 0 5px color-mix(in oklab, var(--la-color-accent) 22%, transparent),
    var(--la-shadow-lg);
  transform: translateY(-1px);
}

.la-button:active,
.la-ss-cta:active {
  transform: scale(0.97);
}

.la-ss-cta svg,
.la-button svg {
  transition: transform var(--la-duration-normal) var(--la-ease-out);
}

.la-ss-cta:hover svg,
.la-button:hover svg {
  transform: translateX(3px);
}

/* A link of the bar and the foot underlines itself under the pointer; in the folded menu a line reads as a row. */
.la-foot-links a {
  background: linear-gradient(var(--la-color-accent), var(--la-color-accent)) no-repeat 50% 92% / 0 2px;
  transition:
    background-size var(--la-duration-normal) var(--la-ease-out),
    color var(--la-duration-fast) var(--la-ease-out);
}

.la-foot-links a:hover {
  background-size: 100% 2px;
}

@container la-page (min-width: 64rem) {
  .la-nav-links a {
    background: linear-gradient(var(--la-color-accent), var(--la-color-accent)) no-repeat 50% 92% / 0 2px;
    transition:
      background-size var(--la-duration-normal) var(--la-ease-out),
      color var(--la-duration-fast) var(--la-ease-out);
  }

  .la-nav-links a:hover,
  .la-nav-links a[aria-current='page'] {
    background-size: calc(100% - 2 * var(--la-space-2)) 2px;
  }
}

.la-places-row {
  transition:
    background var(--la-duration-fast) var(--la-ease-out),
    padding var(--la-duration-normal) var(--la-ease-out);
}

/* The mark opens its brackets under the pointer. */
.la-nav-mark .la-mark-glyph {
  transition: transform var(--la-duration-normal) var(--la-ease-out);
}

.la-nav-mark:hover .la-mark-glyph:nth-of-type(1) {
  transform: translateX(-3px);
}

.la-nav-mark:hover .la-mark-glyph:nth-of-type(2) {
  transform: translateX(3px);
}

@media (prefers-reduced-motion: reduce) {
  .la-shell *,
  .la-shell *::before,
  .la-shell *::after {
    animation: none !important;
  }
}
