.story {
  position: relative;
  background: var(--surface_inverse_color);
  border-bottom: 1px solid var(--border_subtle_color);
  overflow: clip;
}

.drift {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.drift_item {
  display: none;
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--size);
  height: var(--size);
  opacity: var(--o, .42);
  animation: drift_float var(--dur) ease-in-out var(--delay) infinite alternate;
}
.drift_item:nth-child(4n) {
  display: block;
}
@keyframes drift_float {
  from {
    transform: translate3d(0, 0, 0) rotate(var(--rot));
  }
  to {
    transform: translate3d(var(--dx), var(--dy), 0) rotate(calc(var(--rot) + var(--spin)));
  }
}

.story_grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(10px, calc(-13.86px + 7.95vw), 80px);
  align-items: center;
}

.story_intro {
  padding-block: clamp(40px, calc(24px + 5.33vw), 88px);
}

.story_title {
  font-size: clamp(16px, calc(2.36px + 4.55vw), 56px);
  letter-spacing: -.035em;
  line-height: 1.08;
  hyphens: auto;
  overflow-wrap: break-word;
}
.story_title_lead {
  font-size: clamp(19px, calc(2.3px + 5.57vw), 68px);
}
.story_lead {
  margin-top: 22px;
  max-width: 42ch;
  font-size: clamp(16px, calc(9.11px + 0.8vw), 18.5px);
  line-height: 1.65;
  hyphens: auto;
  overflow-wrap: break-word;
}
.story_fact {
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 16px;
  color: var(--text_tertiary_color);
}
.story_fact::before {
  content: "";
  flex: none;
  border-radius: 50%;
  width: clamp(16px, calc(15.32px + 0.23vw), 18px);
  height: clamp(16px, calc(15.32px + 0.23vw), 18px);
  background: var(--success_surface_color) center/10px no-repeat;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%234ade80' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 6.4l2.6 2.6L10 3'/%3E%3C/svg%3E");
}

.steps {
  --step_cycle: 5000ms;
  --step_fade: 350ms;
  --step_accent: var(--primary_color);

  align-self: center;
  padding-block: clamp(28px, calc(17.09px + 3.64vw), 60px);
  display: grid;
  justify-items: center;
  gap: 18px;
  cursor: pointer;
  touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
}

.steps_progress {
  display: flex;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 31em;
  font-size: var(--phone_base);
}
.steps_seg {
  flex: 1 1 0;
  min-width: 0;
  height: 22px;
  padding: 0;
  border: 0;
  background: none;
  display: grid;
  align-items: center;
  cursor: pointer;
}
.steps_seg_track {
  position: relative;
  height: 4px;
  border-radius: 999px;
  background: var(--border_strong_color);
  opacity: .45;
  overflow: hidden;
  transition: opacity .3s var(--ease);
}
.steps_seg[data-state="done"] .steps_seg_track,
.steps_seg[data-state="active"] .steps_seg_track {
  opacity: 1;
}

.steps_seg_fill {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--primary_color);
  transform: scaleX(0);
  transform-origin: left center;
  will-change: transform;
}

.steps_titles {
  display: grid;
  width: 100%;
  max-width: 31em;
  font-size: var(--phone_base);
}
.steps_title {
  grid-area: 1 / 1;
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity var(--step_fade) var(--ease),
    transform var(--step_fade) var(--ease);
  pointer-events: none;
}
.steps_title.is_current {
  opacity: 1;
  transform: none;
}

.steps_title_text {
  color: var(--step_accent);
  font-size: clamp(19px, calc(15.59px + 1.14vw), 29px);
  font-weight: 900;
  font-style: italic;
  letter-spacing: -.035em;
  line-height: 1.12;
  hyphens: auto;
  overflow-wrap: break-word;
}
.steps_title_lead {
  margin-top: 12px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text_secondary_color);
  hyphens: auto;
  overflow-wrap: break-word;
}

.steps_nav {
  display: flex;
  gap: 8px;
}
.steps_nav_btn:focus-visible {
  position: static;
  width: auto;
  height: auto;
  margin: 0;
  padding: 10px 18px;
  overflow: visible;
  clip: auto;
  white-space: normal;
  border-radius: 999px;
  background: var(--surface_container_color);
  border: 1px solid var(--border_color);
  color: var(--text_primary_color);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.phone {
  font-size: var(--phone_base);
  position: relative;
  width: 31em;
  padding: 1.1em;
  border-radius: 4.6em;
  background: linear-gradient(160deg, #3a3a3a, #1a1a1a 42%);
  box-shadow:
    0 4.4em 9em -3em rgba(0, 0, 0, .85),
    0 0 0 1px rgba(255, 255, 255, .06) inset;
}
.phone_notch {
  position: absolute;
  top: 1.1em;
  left: 50%;
  transform: translateX(-50%);
  width: 10.8em;
  height: 2.6em;
  border-radius: 0 0 1.5em 1.5em;
  background: #0d0d0d;
  z-index: 3;
}
.phone_screen {
  position: relative;
  height: 55.6em;
  overflow: hidden;
  padding: 4.6em 1.6em 1.8em;
  border-radius: 3.6em;
  background: var(--surface_color);
}

.phone_tabs {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: .9em .6em 1.2em;
  border-top: 1px solid var(--border_subtle_color);
  background: var(--surface_container_color);
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35em;
  font-size: .85em;
  letter-spacing: .02em;
  color: var(--text_tertiary_color);
}
.tab .material-symbols-outlined {
  font-size: 2.24em;
}
.phone[data-tab="uebersicht"] .tab[data-for="uebersicht"],
.phone[data-tab="abrechnungen"] .tab[data-for="abrechnungen"],
.phone[data-tab="kalender"] .tab[data-for="kalender"],
.phone[data-tab="einstellungen"] .tab[data-for="einstellungen"] {
  color: var(--primary_color);
}

.scene {
  position: absolute;
  inset: 0;
  padding: 4.6em 1.6em 7.4em;
  display: flex;
  flex-direction: column;
  gap: 1em;
  opacity: 0;
  visibility: hidden;
  transform: translateY(1.4em) scale(.985);
  transition:
    opacity var(--step_fade) var(--ease),
    transform var(--step_fade) var(--ease),
    visibility var(--step_fade);
}
.scene.is_active {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.scene > * {
  opacity: 0;
  transform: translateY(1.2em);
  transition: opacity .45s var(--ease), transform .45s var(--ease);
}
.scene.is_active > * {
  opacity: 1;
  transform: none;
}
.scene.is_active > *:nth-child(1) {
  transition-delay: .10s;
}
.scene.is_active > *:nth-child(2) {
  transition-delay: .18s;
}
.scene.is_active > *:nth-child(3) {
  transition-delay: .26s;
}
.scene.is_active > *:nth-child(4) {
  transition-delay: .34s;
}
.scene.is_active > *:nth-child(5) {
  transition-delay: .42s;
}

.scene_head {
  padding: .2em .2em .6em;
}
.scene_head span {
  display: block;
  font-size: 1.05em;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text_tertiary_color);
}
.scene_head strong {
  font-size: 2em;
  font-weight: 900;
  font-style: italic;
  letter-spacing: -.02em;
  color: var(--text_primary_color);
}

.tile,
.calc,
.shift,
.sum,
.mini,
.scan {
  border-radius: 1.6em;
  background: var(--surface_container_color);
  border: 1px solid var(--border_subtle_color);
}
.tile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.3em 1.5em;
}
.tile span {
  font-size: 1.25em;
  color: var(--text_secondary_color);
}
.tile b {
  font-size: 1.5em;
  font-weight: 900;
  font-style: italic;
  color: var(--text_primary_color);
}
.tile_diff {
  border-color: rgba(216, 35, 47, .55);
  background: var(--secondary_surface_color);
}
.tile_diff b {
  color: var(--secondary_text_color);
}
.tile_short b {
  color: var(--secondary_text_color);
}

.cal {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: .5em;
  padding: 1.2em 1.1em;
}
.cal_dow {
  font-size: .9em;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text_tertiary_color);
  text-align: center;
  padding-bottom: .2em;
}
.cal_cell {
  display: grid;
  place-items: center;
  height: 2.83em;
  border-radius: .83em;
  font-size: 1.2em;
  font-weight: 700;
  color: var(--text_secondary_color);
  background: var(--surface_color);
  border: 1px solid transparent;
}
.cal_cell.is_picked {
  color: var(--on_primary_color);
  background: var(--primary_color);
}
.cal_cell.is_free {
  color: var(--success_color);
}
.shift {
  padding: .4em 1.4em 1.2em;
}
.shift_row,
.shift_sum {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .9em 0;
}
.shift_row + .shift_row,
.shift_sum {
  border-top: 1px solid var(--border_subtle_color);
}
.shift span {
  font-size: 1.2em;
  color: var(--text_secondary_color);
}
.shift b {
  font-size: 1.4em;
  font-weight: 900;
  font-style: italic;
  color: var(--text_primary_color);
}
.shift_sum b {
  color: var(--primary_color);
}

.scan {
  display: flex;
  align-items: center;
  gap: .9em;
  padding: 1.1em 1.3em;
}
.scan .material-symbols-outlined {
  font-size: 1.8em;
  color: var(--primary_color);
}
.scan_name {
  flex: 1;
  min-width: 0;
  font-size: 1.15em;
  color: var(--text_secondary_color);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.scan_state {
  flex: none;
  font-size: .95em;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--success_color);
}
.calc {
  padding: .6em 1.4em 1.2em;
}
.calc_row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: .8em 0;
}
.calc_row span {
  font-size: 1.2em;
  color: var(--text_secondary_color);
}
.calc_row b {
  font-size: 1.4em;
  font-weight: 900;
  font-style: italic;
  color: var(--text_primary_color);
}
.calc_rule {
  height: 1px;
  margin: .6em 0 .2em;
  background: var(--border_color);
}
.calc_row_sum b {
  font-size: 2.1em;
  color: var(--primary_color);
}
.calc_note {
  font-size: 1.1em;
  color: var(--text_tertiary_color);
  padding: 0 .3em;
}

.sum {
  padding: 1.4em 1.5em;
}
.sum span {
  display: block;
  font-size: 1.1em;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text_tertiary_color);
}
.sum b {
  display: block;
  margin-top: .15em;
  font-size: 2.7em;
  font-weight: 900;
  font-style: italic;
  letter-spacing: -.02em;
  color: var(--primary_color);
}
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1em;
}
.mini {
  padding: 1.1em 1.3em;
}
.mini span {
  display: block;
  font-size: 1.05em;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text_tertiary_color);
}
.mini b {
  display: block;
  margin-top: .2em;
  white-space: nowrap;
  font-size: 1.5em;
  font-weight: 900;
  font-style: italic;
  color: var(--text_primary_color);
}
.mini b .unit {
  display: inline;
  text-transform: none;
  letter-spacing: 0;
  font-size: .66em;
  font-style: normal;
  font-weight: 700;
  color: var(--text_tertiary_color);
  margin-left: .1em;
}

@media (max-width: 900px) {
  .drift_item:nth-child(8n) {
    display: none;
  }
  .drift_item {
    width: calc(var(--size) * .72);
    height: calc(var(--size) * .72);
    opacity: calc(var(--o, .42) * .82);
  }

  .story_lead {
    margin-top: 16px;
    max-width: 54ch;
  }
  .story_fact {
    margin-top: 16px;
  }
  .steps_title_lead {
    margin-top: 10px;
  }
}

@media (max-width: 767px) {
  .story_grid {
    grid-template-columns: 1fr;
  }
  .story_intro {
    padding-bottom: 0;
  }
}

@media (min-width: 901px) and (max-height: 860px) {
  .story_title_lead {
    font-size: clamp(34px, 4vw, 52px);
  }
  .story_lead {
    margin-top: 18px;
    font-size: 16.5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .steps_title {
    transition: none;
  }
  .steps_seg_track {
    transition: none;
  }
  .scene {
    transition: none;
  }
  .scene > * {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .scene.is_active > * {
    transition-delay: 0s;
  }
  .drift_item {
    animation: none;
    transform: rotate(var(--rot));
  }
}
