/* Student-friendly visual layer: softer type, calmer green, and mascot accents. */

:root {
  --student-green: #0b8059;
  --student-green-deep: #07543d;
  --student-green-soft: #edf8f2;
  --student-line: rgba(7, 84, 61, 0.13);
  --student-radius-control: 13px;
  --student-radius-card: 18px;
  --student-shadow: 0 10px 30px rgba(7, 84, 61, 0.07);
}

body {
  background-image: radial-gradient(circle at 10% 0%, rgba(91, 203, 141, 0.055), transparent 28rem);
}

:where(h1, h2, h3, .brand-title, .workspace-kicker, .eyebrow, button, .badge, .chip) {
  font-family: var(--font-friendly, var(--font-ui));
}

:where(h1, h2, h3, .brand-title) {
  letter-spacing: -0.035em;
}

:where(button, input, select, textarea, summary) {
  border-radius: var(--student-radius-control);
}

.app-shell:not([data-view="admin"]) :where(
  .workspace-head,
  .panel,
  .home-ask-hero,
  .home-search-panel,
  .home-school-life,
  .school-calendar-shell,
  .school-day-panel,
  .community-hero,
  .festival-stamp-board
) {
  border-radius: var(--student-radius-card);
}

.app-shell:not([data-view="admin"]) :where(.workspace-head, .home-ask-hero, .community-hero.no-banner) {
  border-color: var(--student-line);
  box-shadow: var(--student-shadow);
}

.workspace-kicker,
.eyebrow {
  color: var(--student-green-deep);
  font-weight: 800;
}

.student-mascot {
  display: block;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.topbar .brand .tutor-logo {
  border-radius: 12px;
  filter: drop-shadow(0 4px 8px rgba(7, 84, 61, 0.12));
  object-fit: contain;
}

.brand-title.tutor-brand-title {
  display: flex;
  width: 96px;
  min-width: 96px;
  height: 46px;
  align-items: center;
  justify-content: center;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.tutor-wordmark {
  display: block;
  width: 92px;
  height: 46px;
  object-fit: contain;
  filter: none;
}

.topbar .site-brand {
  width: 104px !important;
  min-width: 104px !important;
  justify-content: flex-start;
  padding-inline: 0 !important;
}

.topbar .site-brand .brand-title.tutor-brand-title {
  display: flex !important;
  flex: 0 0 96px !important;
  width: 96px !important;
  min-width: 96px !important;
  max-width: 96px !important;
  height: 46px !important;
  overflow: visible !important;
}

@media (max-width: 1180px) {
  .topbar .topbar-inner {
    grid-template-columns: 104px minmax(0, 1fr) minmax(72px, auto);
  }
}

@media (max-width: 760px) {
  .topbar .topbar-inner {
    box-sizing: border-box;
    width: 100%;
    grid-template-columns: 104px minmax(0, 1fr) auto;
    padding-right: max(12px, env(safe-area-inset-right));
    padding-left: max(12px, env(safe-area-inset-left));
  }

  .topbar .site-brand {
    grid-column: 1;
    justify-self: start;
  }

  .topbar .topbar-right {
    grid-column: 3 !important;
    width: max-content;
    max-width: none;
    justify-self: end;
    margin-left: auto;
  }

  .topbar .account {
    width: max-content;
    justify-content: flex-end;
    margin-left: auto;
  }
}

.auth-brand .brand-title.tutor-brand-title {
  width: 94px;
  min-width: 94px;
  height: 58px;
}

.auth-brand .tutor-wordmark {
  width: 90px;
  height: 56px;
}

.home-ask-hero {
  background: linear-gradient(128deg, #f2fbf6 0%, #e5f7ed 100%);
  color: var(--student-green-deep);
  overflow: hidden;
}

.home-workspace .home-ask-copy small {
  color: #236b54;
}

.home-workspace .home-ask-copy strong {
  color: #064a36;
}

.home-workspace .home-ask-copy em {
  color: #3e6f60;
}

.home-ask-hero .home-welcome-mascot {
  width: clamp(160px, 22vw, 230px);
  height: clamp(160px, 22vw, 230px);
  filter: drop-shadow(0 14px 18px rgba(7, 84, 61, 0.15));
}

.home-workspace .home-school-life-grid > button {
  position: relative;
  overflow: hidden;
}

.home-meal-mascot {
  position: absolute;
  right: 22px;
  bottom: -14px;
  z-index: 0;
  width: 78px;
  height: 78px;
  opacity: 0.2;
}

.home-workspace .home-school-life-grid > button:nth-child(2) > :not(.home-meal-mascot) {
  position: relative;
  z-index: 1;
}

.school-calendar-mascot {
  position: static;
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  margin: -14px 4px -12px 0;
  filter: drop-shadow(0 7px 10px rgba(7, 84, 61, 0.12));
}

.community-hero.no-banner {
  position: relative;
  overflow: hidden;
  background: linear-gradient(132deg, #ffffff 0%, #f0faf5 100%);
}

.community-hero-mascot {
  position: absolute;
  right: clamp(124px, 18vw, 226px);
  bottom: -36px;
  width: 156px;
  height: 156px;
  opacity: 0.38;
  filter: drop-shadow(0 8px 12px rgba(7, 84, 61, 0.12));
}

.community-hero.no-banner > :not(.community-hero-mascot) {
  position: relative;
  z-index: 1;
}

.festival-stamp-board > header {
  position: relative;
  overflow: hidden;
}

.festival-cheer-mascot {
  position: absolute;
  right: 116px;
  bottom: -48px;
  width: 136px;
  height: 136px;
  opacity: 0.34;
}

.festival-stamp-board > header > :not(.festival-cheer-mascot) {
  position: relative;
  z-index: 1;
}

@media (max-width: 760px) {
  .school-calendar-mascot {
    flex-basis: 48px;
    width: 48px;
    height: 48px;
    margin: -6px 0 -4px;
    opacity: 0.9;
  }

  .community-hero-mascot {
    right: -18px;
    bottom: -20px;
    width: 124px;
    height: 124px;
    opacity: 0.16;
  }

  .festival-cheer-mascot {
    right: 62px;
    width: 104px;
    height: 104px;
    opacity: 0.2;
  }
}

@media (max-width: 420px) {
  .home-ask-hero .home-welcome-mascot {
    width: 132px;
    height: 132px;
    margin-right: -24px;
  }

  .home-meal-mascot {
    right: 14px;
    width: 66px;
    height: 66px;
  }

  .school-calendar-mascot {
    flex-basis: 40px;
    width: 40px;
    height: 40px;
    margin-inline: -4px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .topbar .brand .tutor-logo {
    transform-origin: 48% 78%;
    animation: student-brand-wave 8s ease-in-out infinite;
  }

  .home-welcome-mascot,
  .community-hero-mascot,
  .festival-cheer-mascot {
    animation: student-mascot-breathe 5.5s ease-in-out infinite;
  }
}

@keyframes student-brand-wave {
  0%, 76%, 100% { transform: translateY(0) rotate(0deg); }
  80% { transform: translateY(-1px) rotate(-8deg); }
  84% { transform: translateY(-1px) rotate(7deg); }
  88% { transform: translateY(-1px) rotate(-6deg); }
  92% { transform: translateY(0) rotate(3deg); }
  96% { transform: translateY(0) rotate(0deg); }
}

@keyframes student-mascot-breathe {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-4px) rotate(-0.6deg); }
}

.woogle-loading {
  display: grid;
  min-width: min(320px, calc(100vw - 40px));
  justify-items: center;
  gap: 8px;
  color: #173e31;
  text-align: center;
}

.woogle-loading-character {
  display: grid;
  width: 104px;
  height: 104px;
  place-items: center;
  filter: drop-shadow(0 12px 16px rgba(21, 91, 66, 0.15));
  transform-origin: 50% 90%;
}

.woogle-loading-character img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.woogle-loading-copy {
  display: grid;
  gap: 4px;
}

.woogle-loading-copy strong {
  font-size: 17px;
  line-height: 1.35;
}

.woogle-loading-copy small {
  color: #6c7e76;
  font-size: 12px;
  line-height: 1.45;
}

.woogle-loading-dots {
  display: flex;
  height: 14px;
  align-items: center;
  gap: 5px;
}

.woogle-loading-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #0c815e;
  animation: woogle-loading-dot 1.1s ease-in-out infinite;
}

.woogle-loading-dots i:nth-child(2) { animation-delay: 120ms; }
.woogle-loading-dots i:nth-child(3) { animation-delay: 240ms; }

.woogle-long-task-overlay {
  position: fixed;
  z-index: 10050;
  inset: 0;
  display: grid;
  place-items: center;
  padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
  background: rgba(247, 251, 249, 0.9);
  backdrop-filter: blur(14px) saturate(1.08);
  -webkit-backdrop-filter: blur(14px) saturate(1.08);
  animation: woogle-loading-overlay-in 180ms ease-out both;
}

.woogle-loading.is-overlay {
  width: min(390px, 100%);
  border: 1px solid rgba(17, 112, 80, 0.12);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.88);
  padding: 24px 22px 22px;
  box-shadow: 0 24px 70px rgba(22, 72, 55, 0.14);
}

.woogle-loading.is-compact {
  min-width: 0;
  padding: 18px;
}

.woogle-loading.is-compact .woogle-loading-character {
  width: 76px;
  height: 76px;
}

@keyframes woogle-loading-overlay-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes woogle-loading-dot {
  0%, 70%, 100% { opacity: 0.35; transform: translateY(0) scale(0.86); }
  35% { opacity: 1; transform: translateY(-4px) scale(1); }
}

@media (prefers-reduced-motion: no-preference) {
  .woogle-loading-character { animation: woogle-loading-hop 1.8s cubic-bezier(.22, 1, .36, 1) infinite; }
}

@keyframes woogle-loading-hop {
  0%, 60%, 100% { transform: translateY(0) rotate(0deg); }
  28% { transform: translateY(-8px) rotate(-2deg); }
  42% { transform: translateY(-2px) rotate(2deg); }
}

@media (prefers-reduced-motion: reduce) {
  .woogle-loading-dots i { animation: none; opacity: 0.7; }
}
