body.theme-light {
  --stt-quizzes: #e0405c;
  --stt-quizzes-soft: #ffe8ec;
  --stt-quizzes-deep: #b42442;
  --stt-flashcards: #149c7c;
  --stt-flashcards-soft: #dcf4ec;
  --stt-flashcards-deep: #0d6650;
  --stt-summaries: #c98a0c;
  --stt-summaries-soft: #fcf1d6;
  --stt-summaries-deep: #7a5200;
  --stt-podcasts: #2f74e0;
  --stt-podcasts-soft: #e2edfd;
  --stt-podcasts-deep: #1b4fa3;
  --stt-anki: #a82d47;
  --stt-anki-soft: #f8e2e7;
  --stt-anki-deep: #861f37;
  --stt-pomodoro: #d9571f;
  --stt-pomodoro-soft: #fde7d9;
  --stt-pomodoro-deep: #9c3d12;
  --stt-bubble-bg: #ffffff;
  --stt-tile-shadow: rgba(120, 30, 50, 0.5);
  --stt-bubble-shadow: rgba(150, 50, 70, 0.45);
}

body.theme-dark {
  --stt-quizzes: #fb596e;
  --stt-quizzes-soft: #3a2126;
  --stt-quizzes-deep: #ff9aa8;
  --stt-flashcards: #2cc2a0;
  --stt-flashcards-soft: #1b3129;
  --stt-flashcards-deep: #7fe3cb;
  --stt-summaries: #e6a430;
  --stt-summaries-soft: #352a15;
  --stt-summaries-deep: #f5c979;
  --stt-podcasts: #5b95f2;
  --stt-podcasts-soft: #1d2940;
  --stt-podcasts-deep: #a9c8ff;
  --stt-anki: #d65672;
  --stt-anki-soft: #37202a;
  --stt-anki-deep: #f5a3b5;
  --stt-pomodoro: #ec7a45;
  --stt-pomodoro-soft: #3a261c;
  --stt-pomodoro-deep: #ffb58f;
  --stt-bubble-bg: #2d2c29;
  --stt-tile-shadow: rgba(0, 0, 0, 0.6);
  --stt-bubble-shadow: rgba(0, 0, 0, 0.5);
}

.stt-tile--quizzes {
  --stt-accent: var(--stt-quizzes);
  --stt-soft: var(--stt-quizzes-soft);
  --stt-deep: var(--stt-quizzes-deep);
  --stt-px: 0px;
  --stt-py: 0px;
}

.stt-tile--flashcards {
  --stt-accent: var(--stt-flashcards);
  --stt-soft: var(--stt-flashcards-soft);
  --stt-deep: var(--stt-flashcards-deep);
  --stt-px: -610px;
  --stt-py: 0px;
}

.stt-tile--summaries {
  --stt-accent: var(--stt-summaries);
  --stt-soft: var(--stt-summaries-soft);
  --stt-deep: var(--stt-summaries-deep);
  --stt-px: 0px;
  --stt-py: -740px;
}

.stt-tile--podcasts {
  --stt-accent: var(--stt-podcasts);
  --stt-soft: var(--stt-podcasts-soft);
  --stt-deep: var(--stt-podcasts-deep);
  --stt-px: -305px;
  --stt-py: -740px;
}

.stt-tile--anki {
  --stt-accent: var(--stt-anki);
  --stt-soft: var(--stt-anki-soft);
  --stt-deep: var(--stt-anki-deep);
  --stt-px: -610px;
  --stt-py: -740px;
}

.stt-tile--pomodoro {
  --stt-accent: var(--stt-pomodoro);
  --stt-soft: var(--stt-pomodoro-soft);
  --stt-deep: var(--stt-pomodoro-deep);
  --stt-px: -915px;
  --stt-py: -740px;
}

.stt-hint {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin: 8px auto 18px;
}

.stt-hint__loo {
  width: 96px;
  height: 96px;
  flex-shrink: 0;
}

.stt-hint__bubble {
  position: relative;
  margin: 0;
  padding: 14px 20px;
  border-radius: 20px;
  background: var(--stt-bubble-bg);
  color: var(--on-surface);
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.4;
  box-shadow: 0 12px 28px -16px var(--stt-bubble-shadow);
}

.stt-hint__bubble::before {
  content: '';
  position: absolute;
  inset-inline-start: -7px;
  top: 50%;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  border-radius: 3px;
  background: var(--stt-bubble-bg);
  transform: rotate(45deg);
}

.stt-bento {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.stt-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  margin: 0;
  padding: 34px 16px 12px;
  box-sizing: border-box;
  border-radius: 34px;
  background: var(--stt-soft);
  color: var(--on-surface);
  text-decoration: none;
  overflow: hidden;
  isolation: isolate;
  transition:
    transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 0.35s;
}

.stt-tile::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--stt-accent);
  -webkit-mask: url('/assets/img/study-tools/pattern-desktop.svg') no-repeat;
  mask: url('/assets/img/study-tools/pattern-desktop.svg') no-repeat;
  -webkit-mask-size: 1200px 1300px;
  mask-size: 1200px 1300px;
  -webkit-mask-position: var(--stt-px) var(--stt-py);
  mask-position: var(--stt-px) var(--stt-py);
  pointer-events: none;
}

.stt-tile--big {
  grid-column: span 2;
  height: 720px;
}

.stt-tile--small {
  height: 560px;
}

.stt-tile:hover {
  color: var(--on-surface);
  text-decoration: none;
  transform: translateY(-6px);
  box-shadow: 0 34px 50px -30px var(--stt-tile-shadow);
}

.stt-tile:active {
  transform: translateY(-2px) scale(0.985);
}

.stt-tile:focus-visible {
  outline: 3px solid var(--on-surface);
  outline-offset: 3px;
}

.stt-tile__label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--stt-deep);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0;
}

.stt-tile__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--stt-accent);
  color: #ffffff;
  font-size: 15px;
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.stt-tile__title {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 14px 0 0;
  padding: 0;
  border: 0;
  color: var(--on-surface);
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.6px;
  text-align: center;
  --stt-mark-h: 10px;
}

.stt-tile--small .stt-tile__title {
  font-size: 15px;
  letter-spacing: -0.3px;
  --stt-mark-h: 5px;
}

.stt-mark {
  position: relative;
  display: inline-block;
  color: var(--stt-deep);
}

.stt-mark::after {
  content: '';
  position: absolute;
  inset-inline-start: -3%;
  bottom: calc(var(--stt-mark-h) * -1);
  width: 106%;
  height: var(--stt-mark-h);
  background: currentColor;
  opacity: 0.4;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 10' preserveAspectRatio='none'%3E%3Cpath d='M2 7 C 30 1, 70 1, 98 5' stroke='%23000' stroke-width='3' fill='none' stroke-linecap='round'/%3E%3C/svg%3E")
    no-repeat 0 0 / 100% 100%;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 10' preserveAspectRatio='none'%3E%3Cpath d='M2 7 C 30 1, 70 1, 98 5' stroke='%23000' stroke-width='3' fill='none' stroke-linecap='round'/%3E%3C/svg%3E")
    no-repeat 0 0 / 100% 100%;
}

.stt-tile__stage {
  position: relative;
  display: flex;
  flex-grow: 1;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.stt-tile__blob {
  position: absolute;
  width: 331px;
  height: 331px;
  border-radius: 50%;
  background: var(--stt-accent);
  opacity: 0.16;
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.stt-tile--small .stt-tile__blob {
  width: 280px;
  height: 280px;
}

.stt-tile__phone {
  position: relative;
  display: block;
  width: 241px;
  height: 499px;
  max-width: none;
  margin: 0;
  filter: drop-shadow(0 26px 30px rgba(120, 30, 50, 0.28));
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.stt-tile--small .stt-tile__phone {
  width: 190px;
  height: 394px;
}

.stt-tile:hover .stt-tile__phone {
  transform: translateY(-12px) rotate(-2deg);
}

.stt-tile:hover .stt-tile__blob {
  transform: scale(1.15);
}

@media (max-width: 1239px) {
  .stt-bento {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 800px;
  }

  .stt-tile--big {
    grid-column: span 1;
  }

  .stt-tile--big,
  .stt-tile--small {
    height: 640px;
  }

  .stt-tile::before {
    -webkit-mask-position: 0 0;
    mask-position: 0 0;
  }

  .stt-tile--big .stt-tile__title,
  .stt-tile--small .stt-tile__title {
    font-size: 22px;
    letter-spacing: -0.6px;
    --stt-mark-h: 7px;
  }

  .stt-tile--small .stt-tile__title {
    font-size: 15px;
  }

  .stt-tile--big .stt-tile__phone,
  .stt-tile--small .stt-tile__phone {
    width: 230px;
    height: 476px;
  }

  .stt-tile--big .stt-tile__blob,
  .stt-tile--small .stt-tile__blob {
    width: 310px;
    height: 310px;
  }
}

@media (max-width: 767px) {
  .stt-hint {
    margin: 4px auto 14px;
  }

  .stt-hint__loo {
    width: 72px;
    height: 72px;
  }

  .stt-hint__bubble {
    padding: 11px 16px;
    font-size: 15px;
  }

  .stt-bento {
    gap: 12px 12px;
    max-width: 358px;
  }

  .stt-tile::before {
    -webkit-mask-image: url('/assets/img/study-tools/pattern-mobile.svg');
    mask-image: url('/assets/img/study-tools/pattern-mobile.svg');
    -webkit-mask-size: 358px 1872px;
    mask-size: 358px 1872px;
  }

  .stt-tile--big {
    grid-column: span 2;
    height: 720px;
  }

  .stt-tile--flashcards::before {
    -webkit-mask-position: 0 -734px;
    mask-position: 0 -734px;
  }

  .stt-tile--big .stt-tile__phone {
    width: 241px;
    height: 499px;
  }

  .stt-tile--big .stt-tile__blob {
    width: 331px;
    height: 331px;
  }

  .stt-tile--small {
    height: 196px;
    padding: 16px 12px 12px;
    border-radius: 26px;
  }

  .stt-tile--summaries::before {
    -webkit-mask-position: 0 -1468px;
    mask-position: 0 -1468px;
  }

  .stt-tile--podcasts::before {
    -webkit-mask-position: -185px -1468px;
    mask-position: -185px -1468px;
  }

  .stt-tile--anki::before {
    -webkit-mask-position: 0 -1676px;
    mask-position: 0 -1676px;
  }

  .stt-tile--pomodoro::before {
    -webkit-mask-position: -185px -1676px;
    mask-position: -185px -1676px;
  }

  .stt-tile--small .stt-tile__label {
    flex-direction: column;
    gap: 8px;
    color: var(--on-surface);
    font-size: 13px;
  }

  .stt-tile--small .stt-tile__icon {
    width: 40px;
    height: 40px;
    border-radius: 13px;
    font-size: 17px;
  }

  .stt-tile--small .stt-tile__title {
    display: block;
    margin-top: 8px;
    color: var(--on-surface-variant);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0;
  }

  .stt-tile--small .stt-mark {
    display: inline;
    color: inherit;
  }

  .stt-tile--small .stt-mark::after,
  .stt-tile--small .stt-tile__stage {
    display: none;
  }

  .stt-tile--small:hover .stt-tile__icon {
    transform: translateY(-4px) rotate(-4deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .stt-tile,
  .stt-tile__phone,
  .stt-tile__blob,
  .stt-tile__icon {
    transition: none;
  }

  .stt-tile:hover,
  .stt-tile:active,
  .stt-tile:hover .stt-tile__phone,
  .stt-tile:hover .stt-tile__blob,
  .stt-tile:hover .stt-tile__icon {
    transform: none;
  }
}
