/* Rellact polish layer.
   Loaded after the main bundle on every page. Small, additive refinements only:
   nothing here changes layout, copy or the existing animations. */

:root {
  --polish-brand: 45 215 156;      /* brand-600 */
  --polish-brand-soft: 63 224 169; /* brand-500 */
  --polish-ease: cubic-bezier(0.23, 1, 0.32, 1);
  --polish-shadow: 0 1px 1px 0 rgba(38, 38, 43, 0.10), 0 0 0 1px rgba(38, 38, 43, 0.04), 0 2px 12px -4px rgba(38, 38, 43, 0.16);
}

/* Smooth in-page navigation is handled in polish.js (clicks only), so page-load
   hash jumps and the site's own scroll code are left untouched. */

/* ---------- Typography ---------- */
::selection { background: rgb(var(--polish-brand-soft) / 0.28); color: inherit; }
p, li { text-wrap: pretty; }

/* Quiet scrollbar that matches the gray scale */
html { scrollbar-color: #d4d4d4 transparent; }

/* Fallback focus ring; :where() keeps it below every existing focus style */
:where(a, button, [tabindex]):focus-visible {
  outline: 2px solid rgb(var(--polish-brand));
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Arrows pick up the link's colour on hover ---------- */
.icon-arrow path { transition: stroke 180ms var(--polish-ease); }
a:hover .icon-arrow path,
a:focus-visible .icon-arrow path { stroke: currentColor; }

/* ---------- Hero: a faint brand glow under the plan chooser ---------- */
.hero__chooser {
  box-shadow:
    0 0 0 1px rgba(38, 38, 43, 0.06),
    0 24px 60px -24px rgba(38, 38, 43, 0.25),
    0 40px 90px -40px rgb(var(--polish-brand) / 0.35);
}
.hero__chooser > a { position: relative; }
.hero__chooser > a::before {
  content: "";
  position: absolute;
  left: 0; top: 14px; bottom: 14px;
  width: 2px;
  border-radius: 0 2px 2px 0;
  background: rgb(var(--polish-brand));
  transform: scaleY(0);
  transition: transform 220ms var(--polish-ease);
}
.hero__chooser > a:hover::before,
.hero__chooser > a:focus-visible::before { transform: scaleY(1); }

/* ---------- Grid link cards (home, solutions, help, blog...): brand edge on hover ---------- */
a.group.border-b.border-r { position: relative; }
a.group.border-b.border-r::after {
  content: "";
  position: absolute;
  left: -1px; right: -1px; top: -1px;
  height: 2px;
  background: rgb(var(--polish-brand));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 260ms var(--polish-ease);
  pointer-events: none;
}
a.group.border-b.border-r:hover::after,
a.group.border-b.border-r:focus-visible::after { transform: scaleX(1); }

/* ---------- Desktop nav: slightly firmer once the page has scrolled ---------- */
header[data-controller="website-nav"] > nav {
  transition: box-shadow 240ms var(--polish-ease), background-color 240ms var(--polish-ease);
}
html.polish-scrolled header[data-controller="website-nav"] > nav {
  background-color: rgb(255 255 255 / 0.94);
  box-shadow: 0 1px 1px 0 rgba(38, 38, 43, 0.10), 0 0 0 1px rgba(38, 38, 43, 0.05), 0 8px 24px -8px rgba(38, 38, 43, 0.20);
}

/* ---------- Back to top ---------- */
.polish-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  background: rgb(255 255 255 / 0.9);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  box-shadow: var(--polish-shadow);
  color: #404040;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px) scale(0.96);
  transition: opacity 220ms var(--polish-ease), transform 220ms var(--polish-ease), visibility 0s linear 220ms, color 160ms ease, background-color 160ms ease;
}
.polish-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0s;
}
.polish-top:hover { color: #0a0a0a; background: #fff; }
.polish-top:active { transform: scale(0.94); }
.polish-top svg { transition: transform 220ms var(--polish-ease); }
.polish-top:hover svg { transform: translateY(-2px); }
@media (max-width: 767px) {
  .polish-top { right: 16px; bottom: 16px; }
}

/* ---------- Flags (Apple emoji set, loaded from jsDelivr by polish.js) ---------- */
.polish-flag {
  display: inline-block;
  flex: none;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}
.polish-flag--inline {
  width: 16px;
  height: 16px;
  margin-right: 6px;
  vertical-align: -3px;
}
.polish-flag-row { display: inline-flex; align-items: center; }
.polish-flag-row .polish-flag--inline { vertical-align: 0; }

/* ---------- /locations/ city cards ---------- */
.polish-flag--card {
  width: 24px;
  height: 24px;
  margin-bottom: 6px;
  transition: transform 260ms var(--polish-ease);
}
.polish-loc-card {
  transition: background-color 200ms var(--polish-ease), box-shadow 200ms var(--polish-ease), transform 260ms var(--polish-ease);
}
.polish-loc-card:hover {
  background-color: #fff;
  box-shadow: inset 0 0 0 1px #ededed, 0 10px 24px -14px rgba(38, 38, 43, 0.22);
  transform: translateY(-2px);
}
.polish-loc-card:hover .polish-flag--card { transform: scale(1.08); }
.polish-loc-time {
  margin-top: 2px;
  font-size: 11px;
  line-height: 16px;
  letter-spacing: -0.01em;
  color: #a3a3a3;
  white-space: nowrap;
}
@media (max-width: 767px) {
  .polish-flag--card { width: 20px; height: 20px; margin-bottom: 4px; }
}

/* ---------- FAQ accordion ----------
   polish.js tags every FAQ <details> with .polish-faq (+ --card or --row), wraps the
   answer in .polish-faq__body and animates its height. .is-open drives the visuals so
   they react the moment you click, not after the close animation finishes. */
.polish-faq > summary {
  position: relative;
  -webkit-tap-highlight-color: transparent;
  transition: color 180ms ease;
}
.polish-faq > summary::-webkit-details-marker { display: none; }
.polish-faq > summary:hover { color: #000; }
.polish-faq > summary:focus-visible { outline: 2px solid rgb(var(--polish-brand)); outline-offset: -2px; }

/* Chevron sits in a small round button that turns brand green when open */
.polish-faq > summary > svg {
  box-sizing: content-box;
  padding: 6px;
  margin: -6px -6px -6px 0;
  border-radius: 999px;
  background: #f5f5f5;
  color: #737373;
  transition:
    transform 480ms cubic-bezier(0.34, 1.56, 0.64, 1),
    background-color 220ms ease,
    color 220ms ease,
    box-shadow 220ms ease;
}
.polish-faq > summary:hover > svg { background: #ededed; color: #0a0a0a; }
.polish-faq.is-open > summary > svg {
  transform: rotate(180deg);
  background: rgb(var(--polish-brand));
  color: #04140e;
  box-shadow: 0 4px 12px -4px rgb(var(--polish-brand) / 0.7);
}
.polish-faq__body > * { transition: opacity 260ms ease, transform 360ms var(--polish-ease); }
.polish-faq:not(.is-open) .polish-faq__body > * { opacity: 0; transform: translateY(-6px); }

/* Card layout (product and solution pages) */
.polish-faq--card {
  position: relative;
  isolation: isolate;
  transition:
    border-color 220ms ease,
    box-shadow 280ms var(--polish-ease),
    transform 280ms var(--polish-ease);
}
.polish-faq--card::before {
  content: "";
  position: absolute;
  left: -1px; top: 14px; bottom: 14px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: rgb(var(--polish-brand));
  transform: scaleY(0);
  transition: transform 360ms var(--polish-ease);
  pointer-events: none;
}
.polish-faq--card > summary:focus-visible { border-radius: 16px; }
.polish-faq--card:hover {
  border-color: #e5e5e5;
  box-shadow: 0 1px 2px rgba(38, 38, 43, 0.04), 0 10px 28px -18px rgba(38, 38, 43, 0.35);
  transform: translateY(-1px);
}
.polish-faq--card.is-open {
  border-color: rgb(var(--polish-brand) / 0.45);
  box-shadow:
    0 0 0 4px rgb(var(--polish-brand) / 0.08),
    0 18px 40px -26px rgb(var(--polish-brand) / 0.6);
  transform: none;
}
.polish-faq--card.is-open::before { transform: scaleY(1); }

/* Row layout (home page) */
.polish-faq--row { position: relative; }
.polish-faq--row::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: -1px;
  height: 2px;
  background: rgb(var(--polish-brand));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 480ms var(--polish-ease);
  pointer-events: none;
}
.polish-faq--row.is-open::before { transform: scaleX(1); }
.polish-faq--row > summary { transition: color 180ms ease, padding-left 300ms var(--polish-ease); }
.polish-faq--row > summary:hover,
.polish-faq--row.is-open > summary { padding-left: 8px; }
.polish-faq--row > summary:focus-visible { border-radius: 8px; }
.polish-faq--row > summary > svg { margin-right: 0; }
.polish-faq--row .polish-faq__body > * { transition-delay: 40ms; }
.polish-faq--row .polish-faq__body > p { padding-left: 8px; }

/* ---------- Legal pages (/terms/, /privacy/) ----------
   Markup comes from legal-src/build.ps1. Header with a dotted backdrop, document on the
   left, sticky "On this page" list on the right (a collapsible box above the text on
   narrow screens). polish.js highlights the section you're reading. */
.legal-hero {
  padding: calc(var(--header-h) + 72px) var(--page-gutter) 56px;
  border-bottom: 1px dashed rgb(38 38 43 / 0.16);
  overflow: hidden;
}
.legal-hero__dots {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgb(38 38 43 / 0.2) 1px, transparent 1.3px);
  background-size: 14px 14px;
  -webkit-mask-image: linear-gradient(to right, #000, transparent 22%, transparent 78%, #000);
  mask-image: linear-gradient(to right, #000, transparent 22%, transparent 78%, #000);
  pointer-events: none;
}
.legal-hero__inner { position: relative; z-index: 1; max-width: 1120px; margin: 0 auto; }
.legal-eyebrow { font-size: 12px; line-height: 20px; font-weight: 500; color: #1b8f67; }
.legal-title {
  margin-top: 8px;
  font-family: "Mona Sans Variable", sans-serif;
  font-weight: 500;
  font-size: clamp(40px, 6.2vw, 68px);
  line-height: 1.04;
  letter-spacing: -0.035em;
  color: #0a0a0a;
  text-wrap: balance;
}
.legal-updated { margin-top: 18px; font-size: 16px; line-height: 24px; letter-spacing: -0.1px; color: #525252; }
.legal-switch {
  display: inline-flex;
  gap: 2px;
  margin-top: 28px;
  padding: 4px;
  border-radius: 999px;
  background: #f5f5f5;
  box-shadow: inset 0 0 0 1px #ededed;
}
.legal-switch a {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  line-height: 20px;
  font-weight: 500;
  color: #525252;
  text-decoration: none;
  transition: color 150ms ease, background-color 150ms ease, box-shadow 200ms var(--polish-ease);
}
.legal-switch a:hover { color: #0a0a0a; }
.legal-switch a[aria-current="page"] { background: #fff; color: #0a0a0a; box-shadow: var(--polish-shadow); }

.legal-body { padding: 64px var(--page-gutter) var(--section-space); }
.legal-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 680px) 232px;
  justify-content: space-between;
  align-items: start;
  column-gap: 64px;
  max-width: 1120px;
  margin: 0 auto;
}

/* Document */
.legal-doc > :first-child { margin-top: 0; }
.legal-doc > p { font-size: 16px; line-height: 28px; }
.legal-doc h2 { margin-top: 52px; font-size: 22px; }
.legal-doc h3 { margin-top: 26px; }
.legal-doc strong { color: #0a0a0a; font-weight: 600; }
.legal-doc ul { padding-left: 22px; }
.legal-doc li::marker { color: #c4c4c4; }
.legal-doc li { padding-left: 4px; }
.legal-doc ul ul { margin-top: 4px; }
.legal-doc li li { margin-top: 6px; }
.legal-contact {
  margin-top: 18px;
  padding: 22px 24px;
  border-radius: 16px;
  background: #fafafa;
  box-shadow: inset 0 0 0 1px #ededed;
}
.legal-doc .legal-contact > p:first-child { margin-top: 0; }
.legal-doc .legal-contact ul { list-style: none; padding-left: 0; }
.legal-doc .legal-contact li { margin-top: 8px; padding-left: 0; }

/* On this page */
.legal-aside {
  position: sticky;
  top: calc(var(--header-h) + 32px);
  max-height: calc(100vh - var(--header-h) - 64px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.legal-toc__title {
  display: block;
  margin-bottom: 12px;
  font-size: 13px;
  line-height: 20px;
  font-weight: 500;
  color: #1b8f67;
  list-style: none;
  cursor: default;
}
.legal-toc__title::-webkit-details-marker { display: none; }
.legal-toc ol { margin: 0; padding: 0; list-style: none; border-left: 1px solid #ededed; }
.legal-toc li { margin: 0; }
.legal-toc a {
  display: block;
  margin-left: -1px;
  padding: 4px 0 4px 14px;
  border-left: 1px solid transparent;
  font-size: 13px;
  line-height: 18px;
  color: #737373;
  text-decoration: none;
  transition: color 150ms ease, border-color 200ms var(--polish-ease);
}
.legal-toc a:hover { color: #0a0a0a; }
.legal-toc a.is-active { color: #0a0a0a; font-weight: 500; border-left-color: rgb(var(--polish-brand)); }

@media (max-width: 1023px) {
  .legal-layout { grid-template-columns: minmax(0, 1fr); }
  .legal-body { padding-top: 32px; }
  .legal-aside { position: static; order: -1; max-height: none; overflow: visible; margin-bottom: 36px; }
  .legal-toc {
    border-radius: 16px;
    background: #fafafa;
    box-shadow: inset 0 0 0 1px #ededed;
  }
  .legal-toc__title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0;
    padding: 14px 18px;
    color: #0a0a0a;
    cursor: pointer;
  }
  .legal-toc__title::after {
    content: "";
    width: 8px;
    height: 8px;
    border-right: 1.5px solid #737373;
    border-bottom: 1.5px solid #737373;
    transform: translateY(-2px) rotate(45deg);
    transition: transform 220ms var(--polish-ease);
  }
  .legal-toc[open] .legal-toc__title::after { transform: translateY(2px) rotate(-135deg); }
  .legal-toc ol { margin: 0 18px 16px; }
}
@media (max-width: 767px) {
  .legal-hero { padding-top: calc(var(--header-h) + 40px); padding-bottom: 40px; }
  .legal-hero__dots { -webkit-mask-image: linear-gradient(to bottom, #000, transparent 70%); mask-image: linear-gradient(to bottom, #000, transparent 70%); opacity: 0.6; }
}

.legal-note {
  margin-top: 14px;
  max-width: 640px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #fafafa;
  box-shadow: inset 0 0 0 1px #ededed;
  font-size: 13px;
  line-height: 20px;
  color: #525252;
}
.legal-note a { color: #1b8f67; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Language picker (footer, every page; markup from i18n/build.mjs) ---------- */
.lang-picker { position: relative; }
.lang-picker__button {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 142px;
  height: 30px;
  padding: 0 8px 0 9px;
  border-radius: 8px;
  background: #fff;
  box-shadow: inset 0 0 0 1px #e5e5e5, 0 1px 2px rgba(38, 38, 43, 0.04);
  font-size: 13px;
  line-height: 18px;
  font-weight: 500;
  color: #171717;
  white-space: nowrap;
  list-style: none;
  cursor: pointer;
  user-select: none;
  transition: box-shadow 150ms ease, background-color 150ms ease;
}
.lang-picker__button::-webkit-details-marker { display: none; }
.lang-picker__button > span { flex: 1; }
.lang-picker__button:hover { background: #fafafa; box-shadow: inset 0 0 0 1px #d4d4d4, 0 1px 2px rgba(38, 38, 43, 0.06); }
.lang-picker[open] > .lang-picker__button { box-shadow: inset 0 0 0 1px #d4d4d4, 0 0 0 3px #f0f0f0; }
.lang-picker__button:focus-visible { outline: 2px solid rgb(var(--polish-brand)); outline-offset: 2px; }
.lang-picker__globe { width: 14px; height: 14px; color: #8a8a8a; flex: none; }
.lang-picker__updown { width: 12px; height: 12px; color: #a3a3a3; flex: none; }

/* Opens below the button; polish.js adds .is-up when there isn't room below. */
.lang-picker__menu {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 50;
  min-width: max(100%, 164px);
  margin: 0;
  padding: 4px;
  list-style: none;
  border-radius: 12px;
  background: #fff;
  box-shadow:
    0 0 0 1px rgba(38, 38, 43, 0.07),
    0 0 0 4px rgba(38, 38, 43, 0.03),
    0 12px 28px -12px rgba(38, 38, 43, 0.22);
  transform-origin: top left;
  animation: lang-pop 160ms var(--polish-ease);
}
.lang-picker.is-up .lang-picker__menu { top: auto; bottom: calc(100% + 6px); transform-origin: bottom left; }
@keyframes lang-pop {
  from { opacity: 0; transform: translateY(-3px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.lang-picker__menu a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 8px;
  border-radius: 8px;
  font-size: 13.5px;
  line-height: 20px;
  color: #262626;
  text-decoration: none;
  white-space: nowrap;
  outline: none;
  transition: background-color 100ms ease;
}
.lang-picker__menu a:hover,
.lang-picker__menu a:focus-visible { background: #f4f4f4; color: #0a0a0a; }
.lang-picker__menu a[aria-current] { font-weight: 600; color: #0a0a0a; }
.lang-picker__check { width: 13px; height: 13px; flex: none; color: #0a0a0a; visibility: hidden; }
.lang-picker__menu a[aria-current] .lang-picker__check { visibility: visible; }
@media (prefers-reduced-motion: reduce) {
  .lang-picker__menu { animation: none; }
}

/* ---------- Scroll reveal (classes added and removed by polish.js) ---------- */
.polish-reveal {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 600ms var(--polish-ease) var(--polish-delay, 0ms),
    transform 700ms var(--polish-ease) var(--polish-delay, 0ms),
    background-color 150ms ease;
}
.polish-reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .polish-loc-card, .polish-flag--card,
  .polish-faq, .polish-faq::before, .polish-faq > summary, .polish-faq > summary > svg, .polish-faq__body > *,
  .polish-top, .polish-top svg,
  .hero__chooser > a::before, a.group.border-b.border-r::after,
  header[data-controller="website-nav"] > nav { transition: none; }
}

@media print {
  .polish-top { display: none !important; }
}
