/* SmartyNetwork's site: the homepage and its policy pages. Light and dark
   follow the viewer's Theme (site.js puts `dark` on <html>). Dark is the
   apps' neutral palette: Google's greys, cards lifted by tone, no outlines. */
:root {
  --bg: #FFFFFF;
  --card: #FFFFFF;
  --line: #E3E3E3;
  --ink: 31, 31, 31;
  --text: rgb(var(--ink));
  --muted: #5F6368;
  --spark: #2F5BFF;
  --segments: #F1F3F4;
  --segment-on: #FFFFFF;
  --tip: #303134;
  --tip-text: #FFFFFF;
  color-scheme: light;
}
.dark {
  --bg: #131315;
  --card: #1E1F20;
  --line: transparent;
  --ink: 227, 227, 227;
  --muted: #B1B3B2;
  --spark: #6E8BFF;
  --segments: #26282A;
  --segment-on: #36383A;
  --tip: #E3E3E3;
  --tip-text: #1F1F1F;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
a {
  color: inherit;
}
:focus-visible {
  outline: 1px solid #94A3B8;
  outline-offset: 2px;
}

/* The logo in each theme: the other one is hidden. */
.dark .on-light,
:root:not(.dark) .on-dark {
  display: none;
}

/* Homepage: the logo and the products, with slow outline shapes behind
   them (the same family as the sign-in page's panel). */
.hero {
  position: relative;
  isolation: isolate;
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 72px 20px;
  overflow: clip;
}
.brand {
  margin: 0 0 72px;
  line-height: 0;
}
.brand img {
  display: block;
  width: 360px;
  max-width: 78vw;
  height: auto;
}

/* Three across, then two, then one; a card alone on its row is centred. */
.apps {
  --cols: 3;
  --gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--gap);
  width: 100%;
  max-width: 960px;
}
.apps > li {
  flex: 0 0 calc((100% - (var(--cols) - 1) * var(--gap)) / var(--cols));
  min-width: 0;
}
.app {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  height: 100%;
  min-height: 148px;
  padding: 28px 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  text-decoration: none;
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}
.app:hover {
  border-color: var(--brand, #1F1F1F);
  box-shadow: 0 4px 24px rgba(12, 13, 26, 0.08);
}
.dark .app:hover {
  border-color: transparent;
  box-shadow: none;
  background: color-mix(in srgb, var(--card), #FFFFFF 10%);
}
.app-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
}
.app-logo img {
  display: block;
  height: var(--logo-h, 32px);
  width: auto;
  max-width: 100%;
}
.app-desc {
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
  color: var(--muted);
  text-align: center;
  text-wrap: balance;
}

@media (max-width: 900px) {
  .apps {
    --cols: 2;
    max-width: 640px;
  }
}
@media (max-width: 600px) {
  .hero {
    padding: 56px 16px;
  }
  .brand {
    margin-bottom: 36px;
  }
  .apps {
    --cols: 1;
    --gap: 14px;
    max-width: 420px;
  }
  .app {
    min-height: 0;
  }
}

/* Outline shapes: a circle, a rounded square in the brand blue, a pill and a
   small filled circle, drifting and turning slowly at the edges.
   Transform-only; still for people who ask for reduced motion. */
.shapes {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.shapes span {
  position: absolute;
  border: 1px solid rgba(var(--ink), 0.1);
  will-change: transform;
}
.shapes span:nth-child(1) {
  top: -160px;
  left: -180px;
  width: 520px;
  height: 520px;
  border-radius: 9999px;
  animation: shape-a 22s ease-in-out infinite alternate;
}
.shapes span:nth-child(2) {
  right: -110px;
  bottom: -120px;
  width: 400px;
  height: 400px;
  border-radius: 104px;
  border-color: color-mix(in srgb, var(--spark) 40%, transparent);
  animation: shape-b 26s ease-in-out infinite alternate;
}
.shapes span:nth-child(3) {
  top: 68%;
  left: -220px;
  width: 560px;
  height: 220px;
  border-radius: 9999px;
  animation: shape-c 30s ease-in-out infinite alternate;
}
.shapes span:nth-child(4) {
  top: 10%;
  right: 8%;
  width: 180px;
  height: 180px;
  border-radius: 9999px;
  background-color: rgba(var(--ink), 0.03);
  animation: shape-a 20s ease-in-out infinite alternate-reverse;
}
@media (max-width: 600px) {
  .shapes span:nth-child(1) {
    width: 340px;
    height: 340px;
  }
  .shapes span:nth-child(2) {
    width: 260px;
    height: 260px;
    border-radius: 72px;
  }
  .shapes span:nth-child(4) {
    width: 110px;
    height: 110px;
  }
}
@keyframes shape-a {
  to {
    transform: translate3d(40px, 50px, 0) rotate(20deg);
  }
}
@keyframes shape-b {
  to {
    transform: translate3d(-44px, -56px, 0) rotate(-28deg);
  }
}
@keyframes shape-c {
  to {
    transform: translate3d(60px, -24px, 0) rotate(10deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .shapes span {
    animation: none !important;
  }
  .app {
    transition: none;
  }
}

/* Policy pages. */
.page-header {
  padding: 28px 24px 0;
}
.page-header .home {
  display: inline-block;
  line-height: 0;
  border-radius: 6px;
}
.page-header img {
  display: block;
  width: 190px;
  height: auto;
}
.doc {
  flex: 1 0 auto;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 24px 72px;
}
.doc h1 {
  margin: 32px 0 8px;
  font-size: 32px;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.doc h2 {
  margin: 36px 0 0;
  font-size: 20px;
  line-height: 1.3;
}
.doc p,
.doc ul {
  margin: 14px 0 0;
  font-size: 16px;
  line-height: 1.7;
  color: var(--muted);
}
.doc ul {
  padding-left: 22px;
}

/* Footer: the policies on the left, Theme on the right. */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  padding: 20px 24px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--muted);
}
.dark .site-footer {
  border-top-color: rgba(255, 255, 255, 0.08);
}
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
}
.site-footer a {
  text-decoration: none;
  border-radius: 4px;
}
.site-footer a:hover {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Theme: Auto / Light / Dark as icons, the apps' footer switch. */
.theme-switch {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border-radius: 8px;
  background: var(--segments);
}
.theme-switch button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color .15s ease, background-color .15s ease;
}
.theme-switch button:hover {
  color: var(--text);
}
.theme-switch button[aria-checked="true"] {
  background: var(--segment-on);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}
.theme-switch svg {
  width: 16px;
  height: 16px;
}
.theme-switch button::after {
  content: attr(aria-label);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--tip);
  color: var(--tip-text);
  font-size: 12px;
  line-height: 16px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
}
.theme-switch button::before {
  content: "";
  position: absolute;
  bottom: calc(100% + 3px);
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-bottom: 0;
  border-top-color: var(--tip);
  pointer-events: none;
  opacity: 0;
}
.theme-switch button:hover::after,
.theme-switch button:hover::before,
.theme-switch button:focus-visible::after,
.theme-switch button:focus-visible::before {
  opacity: 1;
}
