@font-face {
  font-family: "Nunito Home";
  src: url("assets/assets/fonts/Nunito-Latin.ttf") format("truetype");
  font-weight: 400 900;
  font-display: swap;
}

#mate-home[hidden] { display: none; }
html[data-mate-home] #mate-loading { display: none; }
html[data-mate-home] flutter-view { visibility: hidden; }
#mate-home {
  --ink: #f9fbff;
  --muted: #bed1ed;
  --navy: #071530;
  --cyan: #60e4ff;
  position: fixed;
  z-index: 1;
  inset: 0;
  overflow: auto;
  overscroll-behavior: contain;
  isolation: isolate;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 77% -5%, #163c83 0, transparent 50%),
    radial-gradient(ellipse at 10% 86%, #103378 0, transparent 53%), var(--navy);
  font: 1rem/1.45 "Nunito Home", system-ui, sans-serif;
  scrollbar-color: #4166a5 #08172f;
}
#mate-home *, #mate-home *::before, #mate-home *::after { box-sizing: border-box; }
#mate-home button { font: inherit; cursor: pointer; }
#mate-home :focus-visible { outline: 3px solid var(--cyan); outline-offset: 4px; }

.home-header {
  position: sticky;
  z-index: 2;
  top: 0;
  background: #071530d9;
  border-bottom: 1px solid #a2cdff29;
}
.home-container {
  width: min(72rem, 100% - 3.5rem);
  margin-inline: auto;
}
.home-nav {
  min-height: 4.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.home-brand, .home-nav-actions {
  display: flex;
  align-items: center;
  gap: .65rem;
}
#mate-home .home-brand {
  border: 0;
  padding: 0;
  min-height: 44px;
  background: none;
  color: var(--ink);
  letter-spacing: -.055em;
  font-size: clamp(1.25rem, 4.5vw, 1.75rem);
  font-weight: 900;
  white-space: nowrap;
}
.home-brand em, .home-hero em { color: var(--cyan); font-style: normal; }
#mate-home .home-nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  min-height: 44px;
  padding: .5rem .95rem;
  border: 1px solid transparent;
  border-radius: .85rem;
  background: none;
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}
#mate-home .home-ranking {
  border-color: #f8ca6c66;
  background: #f8ca6c12;
  color: #ffdf93;
}
.home-ranking span { font-size: 1.12em; }
#mate-home .home-fullscreen {
  width: 44px;
  padding: 0;
  border-color: #89c6fe4d;
  background: #4286ca23;
  color: var(--ink);
}
.home-fullscreen-icon {
  width: 1.2rem;
  aspect-ratio: 1;
  background:
    linear-gradient(currentColor, currentColor) top left / 35% 2px,
    linear-gradient(currentColor, currentColor) top left / 2px 35%,
    linear-gradient(currentColor, currentColor) top right / 35% 2px,
    linear-gradient(currentColor, currentColor) top right / 2px 35%,
    linear-gradient(currentColor, currentColor) bottom left / 35% 2px,
    linear-gradient(currentColor, currentColor) bottom left / 2px 35%,
    linear-gradient(currentColor, currentColor) bottom right / 35% 2px,
    linear-gradient(currentColor, currentColor) bottom right / 2px 35%;
  background-repeat: no-repeat;
}
.home-fullscreen[data-fullscreen] .home-fullscreen-icon {
  background-position:
    29% 30%, 30% 29%, 71% 30%, 70% 29%,
    29% 70%, 30% 71%, 71% 70%, 70% 71%;
  background-size: 25% 2px, 2px 25%;
}
#mate-home .home-nav-link:hover { background: #ffffff1a; color: white; }

#mate-home .home-about {
  border-color: #89c6fe4d;
  background: #4286ca23;
  color: #d7efff;
}
#mate-home .home-about:hover {
  border-color: var(--cyan);
  background: #54bdff2e;
  color: white;
}
#mate-home[data-ranking-open] .home-about { display: none; }
.home-info-icon {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 1.15rem;
  height: 1.15rem;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  font: 900 .77rem/1 "Nunito Home", system-ui, sans-serif;
}
.home-about-dialog {
  width: min(36rem, calc(100% - 1.5rem));
  max-height: calc(100vh - 1.5rem);
  max-height: calc(100dvh - 1.5rem);
  margin: auto;
  padding: 0;
  border: 1px solid #92d5ff80;
  border-radius: 1.15rem;
  background: #10264c;
  box-shadow: 0 1.5rem 4.5rem #020a22ae;
  color: var(--ink);
  overscroll-behavior: contain;
}
.home-about-dialog::backdrop { background: #030c24bc; }
.home-about-header {
  position: sticky;
  z-index: 1;
  top: 0;
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .85rem clamp(.85rem, 4vw, 1.5rem);
  border-bottom: 1px solid #92d5ff36;
  background: linear-gradient(115deg, #194876, #142d58 72%);
}
.home-about-emblem {
  width: 2.15rem;
  height: 2.15rem;
  background: #58dfff1a;
  color: var(--cyan);
  font-size: 1.2rem;
}
.home-about-header h2 {
  flex: 1;
  margin: 0;
  font-size: clamp(1.2rem, 3.75vw, 1.75rem);
  font-weight: 900;
  line-height: 1.15;
}
#mate-home .home-about-close {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #92d5ff71;
  border-radius: .75rem;
  background: #0a1d40;
  color: var(--ink);
  font-size: 1.5rem;
  line-height: 1;
}
#mate-home .home-about-close:hover { background: #244b78; }
.home-about-body {
  display: grid;
  gap: .75rem;
  padding: .95rem clamp(.85rem, 4vw, 1.5rem) 1.15rem;
  color: #e0edff;
}
.home-about-body p { margin: 0; }
.home-about-credits {
  display: grid;
  gap: .45rem;
  padding-top: .7rem;
  border-top: 1px solid #92d5ff36;
}
.home-about-credits strong { color: var(--ink); }
.home-about-credits a {
  color: var(--cyan);
  text-underline-offset: .18em;
  overflow-wrap: anywhere;
}
html[data-mate-phone] #mate-home .home-about { width: 44px; padding: 0; }
html[data-mate-phone] .home-about-label { display: none; }
@media (max-width: 560px) {
  #mate-home .home-about { width: 44px; padding: 0; }
  .home-about-label { display: none; }
}
@media (orientation: landscape) and (max-height: 440px) {
  .home-about-header { padding-block: .35rem; }
  .home-about-body { gap: .5rem; padding-block: .55rem .7rem; line-height: 1.35; }
  .home-about-credits { gap: .25rem; padding-top: .45rem; }
}

.home-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(1rem, 4vw, 3.5rem);
  min-height: 15.5rem;
  padding-block: 1.2rem;
}
.home-hero h1 {
  max-width: 13ch;
  margin: 0;
  font-size: clamp(2.65rem, 5.5vw, 4.85rem);
  font-weight: 900;
  letter-spacing: -.061em;
  line-height: .98;
  text-wrap: balance;
}
.home-art {
  position: relative;
  min-height: 14.75rem;
  isolation: isolate;
}
.home-art::before {
  content: "";
  position: absolute;
  inset: 4% 0;
  border-radius: 44%;
  background:
    radial-gradient(circle, #adccff6e 1px, transparent 1.7px) 0 0 / 21px 21px,
    radial-gradient(ellipse, #3b86ed78, transparent 70%);
  mask-image: radial-gradient(ellipse, black 30%, transparent 75%);
}
.home-orbit {
  position: absolute;
  inset: 21% 6% 18%;
  border: 1px solid #57d7fd6b;
  border-radius: 50%;
  transform: rotate(-17deg);
  box-shadow: 0 0 24px #3fabff21, inset 0 0 24px #3fabff21;
}
.home-orbit::before, .home-orbit::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: #63e9ff;
}
.home-orbit::before { top: 19%; left: 6%; width: .5rem; height: .5rem; }
.home-orbit::after { bottom: 12%; right: 12%; width: .37rem; height: .37rem; background: #ffcb68; }
.home-tile {
  position: absolute;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  width: var(--tile-size);
  top: var(--top);
  left: var(--left);
  border: 1px solid #ffffff95;
  border-radius: 24%;
  box-shadow: 0 5px 0 var(--edge), 0 13px 26px #020b2980, inset 0 2px 0 #ffffff59;
  background: var(--face);
  color: #122352;
  font-size: calc(var(--tile-size) * .5);
  font-weight: 900;
  line-height: 1;
  transform: rotate(var(--turn));
  animation: home-bob var(--period) ease-in-out infinite alternate;
}
.home-tile--divide {
  --tile-size: clamp(3.7rem, 7.5vw, 6.15rem);
  --top: 31%; --left: 12%; --turn: -15deg; --period: 4.3s;
  --face: linear-gradient(150deg, #ffc0b4, #ff6d94); --edge: #b13668;
}
.home-tile--fx {
  --tile-size: clamp(5.3rem, 11vw, 8.8rem);
  --top: 19%; --left: 34%; --turn: 9deg; --period: 5.2s;
  --face: linear-gradient(145deg, #d2fbff, #61d9fa 72%, #3ca0ef); --edge: #235fb9;
  font-size: calc(var(--tile-size) * .37);
  letter-spacing: -.075em;
}
.home-tile--pi {
  --tile-size: clamp(3.2rem, 6vw, 5.1rem);
  --top: 41%; --left: 71%; --turn: -11deg; --period: 3.8s;
  --face: linear-gradient(150deg, #fff5ad, #ffc35e); --edge: #b87130;
}

.home-areas { padding-bottom: 2.5rem; }
.home-areas h2 {
  margin: 0 0 .8rem;
  color: var(--ink);
  font-size: clamp(1.25rem, 2.6vw, 1.65rem);
  font-weight: 900;
  letter-spacing: -.026em;
}
.home-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .85rem;
}
#mate-home .home-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: .7rem;
  min-height: 9.75rem;
  isolation: isolate;
  overflow: hidden;
  padding: 1.25rem clamp(.9rem, 2.2vw, 1.55rem);
  border: 1px solid var(--border);
  border-radius: 1.3rem;
  box-shadow: inset 0 1px 0 #ffffff43, 0 7px 22px #020d3370;
  background: linear-gradient(125deg, var(--start), var(--end));
  color: white;
  text-align: left;
  transition: transform .2s, box-shadow .2s, border-color .2s;
  touch-action: manipulation;
}
.home-card::before {
  position: absolute;
  z-index: -1;
  inset: -100% -29% -95% 50%;
  content: "";
  border: 1px solid #ffffff3d;
  border-radius: 48%;
  background: #ffffff16;
  transform: rotate(30deg);
}
.home-card--numbers { --start: #a82b55; --end: #ed5577; --border: #ff99ac; --accent: #ffd4dc; }
.home-card--algebra { --start: #0a6055; --end: #1ca987; --border: #65e5bf; --accent: #aff8df; }
.home-card--geometry { --start: #53329b; --end: #9961df; --border: #c49cff; --accent: #efdeff; }
.home-card--data { --start: #105386; --end: #168eca; --border: #69caff; --accent: #c5efff; }
#mate-home .home-card--challenges {
  grid-column: 1 / -1;
  min-height: 6.3rem;
  padding-block: .9rem;
  color: #18284b;
  --start: #ffe29a;
  --end: #ffb845;
  --border: #ffdfa0;
  --accent: #293f69;
}
.home-card-text { display: grid; gap: .2rem; }
.home-card-title {
  font-size: clamp(1.18rem, 2.25vw, 1.68rem);
  line-height: 1.06;
  letter-spacing: -.027em;
  font-weight: 900;
  text-wrap: balance;
}
.home-card-sub {
  max-width: 34ch;
  color: var(--accent);
  font-size: .95rem;
  line-height: 1.25;
  font-weight: 750;
}
.home-card-action {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: .45rem;
  margin-top: .5rem;
  font-size: .88rem;
  font-weight: 900;
}
.home-card-action::after { content: "→"; transition: transform .2s; }
.home-card-art {
  display: block;
  width: clamp(6.3rem, 14vw, 11.3rem);
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border: 1px solid #fff9;
  border-radius: .85rem;
  box-shadow: 0 7px 15px #020a3450;
  transform: rotate(4deg);
  transition: transform .25s;
}
.home-card--algebra img, .home-card--data img { transform: rotate(-4deg); }
.home-card--challenges img {
  width: clamp(9.5rem, 23vw, 16rem);
  aspect-ratio: 3.2;
  object-position: center 54%;
  transform: none;
}
@media (hover: hover) {
  #mate-home .home-card:hover {
    transform: translateY(-3px);
    border-color: white;
    box-shadow: inset 0 1px 0 #ffffff50, 0 12px 24px #020d337d;
  }
  .home-card:hover img { transform: scale(1.04); }
  .home-card:hover .home-card-action::after { transform: translateX(.3rem); }
}
#mate-home .home-card:active { transform: translateY(1px); }
.home-status {
  position: fixed;
  z-index: 1;
  left: 50%;
  bottom: max(1rem, env(safe-area-inset-bottom));
  width: max-content;
  max-width: calc(100% - 2rem);
  margin: 0;
  transform: translateX(-50%);
  padding: .55rem .9rem;
  border: 1px solid #537fc2;
  border-radius: .75rem;
  box-shadow: 0 5px 16px #020d3380;
  background: #102b56;
  color: white;
  font-weight: 800;
  text-align: center;
}
.home-status:empty { display: none; }
@keyframes home-bob {
  from { transform: translateY(-3px) rotate(var(--turn)); }
  to { transform: translateY(6px) rotate(var(--turn)); }
}

@media (max-width: 740px) {
  .home-container { width: calc(100% - 2rem); }
  .home-hero { min-height: 13.5rem; }
  .home-art { min-height: 11rem; }
  #mate-home .home-card { min-height: 8rem; }
  #mate-home .home-card--challenges { min-height: 6.3rem; }
}
@media (max-width: 560px) {
  .home-container { width: calc(100% - 1.5rem); }
  .home-nav { min-height: 3.75rem; }
  .home-brand, .home-nav-actions { gap: .4rem; }
  #mate-home .home-nav-link { padding-inline: .65rem; font-size: .85rem; }
  .home-hero {
    grid-template-columns: minmax(0, 1fr) clamp(3.7rem, 20vw, 7rem);
    gap: .35rem;
    min-height: auto;
    padding-block: 1.5rem 1.3rem;
  }
  .home-hero h1 { font-size: clamp(2.13rem, 9.1vw, 3rem); }
  .home-art { min-height: 7.5rem; }
  .home-art::before { inset: 0 -8% 0 -30%; }
  .home-orbit { inset: 15% 3% 10% -12%; }
  .home-tile--divide { --tile-size: 1.8rem; --top: 9%; --left: 5%; }
  .home-tile--fx { --tile-size: 3.2rem; --top: 31%; --left: 12%; }
  .home-tile--pi { --tile-size: 1.75rem; --top: 73%; --left: 30%; }
  .home-grid { grid-template-columns: minmax(0, 1fr); gap: .58rem; }
  #mate-home .home-card, #mate-home .home-card--challenges {
    min-height: 5rem;
    padding: .65rem .8rem;
    border-radius: 1rem;
  }
  .home-card-title { text-wrap: wrap; }
  .home-card-sub { font-size: .78rem; }
  .home-card-action { display: none; }
  .home-card-art, .home-card--challenges img { width: 5.45rem; aspect-ratio: 16 / 10; }
  .home-areas { padding-bottom: 1.25rem; }
}
@media (max-height: 540px) and (orientation: landscape) {
  .home-nav { min-height: 3.1rem; }
  .home-hero { min-height: 0; padding-block: .85rem; }
  .home-hero h1 { font-size: clamp(2.2rem, 5.4vw, 3.2rem); }
  .home-art { min-height: 8rem; }
  .home-tile--divide { --tile-size: 3.4rem; }
  .home-tile--fx { --tile-size: 5rem; }
  .home-tile--pi { --tile-size: 2.65rem; }
  .home-areas h2 { margin-bottom: .45rem; }
  #mate-home .home-card { min-height: 5.8rem; padding-block: .7rem; }
  .home-card-art { width: min(13vw, 6rem); }
}
@media (prefers-reduced-motion: reduce) {
  #mate-home *, #mate-home *::before, #mate-home *::after {
    animation: none;
    transition: none;
  }
}
