/* ==========================================================================
   Components: icons, logo, buttons, chips, header, search, phone, cards,
   accordion, controls, footer
   ========================================================================== */

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon--fill {
  fill: currentColor;
  stroke: none;
}

/* ---- Logo --------------------------------------------------------------- */

.logo {
  display: inline-flex;
  align-items: center;
  flex: none;
  border-radius: var(--r-sm);
}

.logo img {
  height: 40px;
  width: auto;
}

/* ---- Buttons ------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 2px 26px 0;
  border: 1.5px solid transparent;
  border-radius: var(--r-chip);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.005em;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease),
    border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}

.btn .icon {
  margin-top: -2px;
}

.btn--sm {
  min-height: 44px;
  padding-inline: 18px;
  font-size: 0.9375rem;
}

.btn--lg {
  min-height: 60px;
  padding-inline: 32px;
  font-size: 1.0625rem;
}

.btn--primary {
  background: var(--electric);
  color: #fff;
  box-shadow: 0 10px 24px -12px rgba(37, 99, 235, 0.8);
}

.btn--primary:hover {
  background: var(--electric-hover);
}

.btn--dark {
  background: var(--ink);
  color: #fff;
}

.btn--dark:hover {
  background: #183a57;
}

.btn--ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink);
}

.btn--ghost:hover {
  background: var(--surface-2);
}

.btn--light {
  background: #fff;
  color: var(--ink);
}

.btn--light:hover {
  background: #E6EEF6;
}

.btn--outline-light {
  border-color: rgba(255, 255, 255, 0.55);
  color: #fff;
}

.btn--outline-light:hover {
  background: rgba(255, 255, 255, 0.12);
}

[data-magnetic] {
  will-change: translate;
}

/* ---- Links and chips ------------------------------------------------------ */

.link {
  color: var(--electric-hover);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-decoration-color: rgba(37, 99, 235, 0.3);
  text-underline-offset: 5px;
  transition: text-decoration-color var(--fast) var(--ease);
}

.link:hover {
  text-decoration-color: currentColor;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 2px 11px 0;
  border-radius: var(--r-chip);
  background: var(--surface-2);
  color: var(--ink);
  font-size: var(--fs-tiny);
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.chip .icon {
  width: 14px;
  height: 14px;
  margin-top: -2px;
}

.chip--slow {
  background: var(--electric-tint);
  color: var(--electric-hover);
}

.chip--fast {
  background: var(--current-tint);
  color: var(--current-ink);
}

.chip--flash {
  background: var(--flash-tint);
  color: var(--flash-ink);
}

.chip--example {
  background: var(--ink);
  color: #fff;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: none;
  background: currentColor;
}

.dot--slow { background: var(--electric); }
.dot--fast { background: var(--current); }
.dot--flash { background: var(--flash); }

/* Parallax layer: moves with the pointer inside its [data-scope] section.
   --d is the depth in pixels at the edge of the section; --dx (optional)
   sets a different horizontal depth. */
.depth {
  translate: calc(var(--mx, 0) * var(--dx, var(--d, 0)) * 1px) calc(var(--my, 0) * var(--d, 0) * 1px);
}

/* ---- Lists -------------------------------------------------------------- */

.check-list {
  display: grid;
  gap: 14px;
}

.check-list li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 14px;
  align-items: start;
}

.check-list .icon {
  width: 28px;
  height: 28px;
  padding: 6px;
  border-radius: 50%;
  background: var(--flash-tint);
  color: var(--flash-ink);
  stroke-width: 2.4;
}

/* ---- Header ------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding-top: 12px;
  margin-bottom: calc(-1 * (var(--header-h) + 12px));
  pointer-events: none;
}

.site-header__bar {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 24px;
  height: var(--header-h);
  width: calc(100% - var(--gutter) * 2 + 24px);
  max-width: calc(var(--container) + 24px);
  margin-inline: auto;
  padding: 0 12px 0 20px;
  border-radius: var(--r-chip);
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  backdrop-filter: saturate(160%) blur(16px);
  box-shadow: 0 0 0 1px rgba(11, 33, 52, 0.06);
  transition: box-shadow var(--medium) var(--ease);
}

.site-header.is-scrolled .site-header__bar {
  box-shadow: 0 0 0 1px rgba(11, 33, 52, 0.06), var(--shadow-2);
}

.site-nav {
  display: none;
  margin-inline: auto;
}

.site-nav ul {
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: block;
  padding: 10px 14px 8px;
  border-radius: var(--r-chip);
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color var(--fast) var(--ease);
}

.site-nav a:hover {
  background: var(--surface-2);
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.site-header__find,
.site-header__list {
  display: none;
}

.menu-toggle {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--ink);
}

.menu-toggle .icon {
  width: 22px;
  height: 22px;
}

.menu-toggle .icon-close,
.menu-toggle[aria-expanded="true"] .icon-open {
  display: none;
}

.menu-toggle[aria-expanded="true"] .icon-close {
  display: block;
}

.mobile-menu {
  pointer-events: auto;
  position: fixed;
  inset: 0;
  z-index: -1;
  padding: calc(var(--header-h) + 24px) var(--gutter) 24px;
  background: rgba(11, 33, 52, 0.4);
}

.mobile-menu[hidden] {
  display: none;
}

.mobile-menu__panel {
  max-width: 560px;
  margin-inline: auto;
  padding: 12px;
  border-radius: var(--r-lg);
  background: #fff;
  box-shadow: var(--shadow-3);
}

.mobile-menu__links a {
  display: block;
  padding: 16px 16px 13px;
  border-radius: var(--r-md);
  color: var(--ink);
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.mobile-menu__links a:hover {
  background: var(--surface-2);
}

.mobile-menu__actions {
  display: grid;
  gap: 8px;
  padding: 12px 4px 4px;
}

@media (min-width: 480px) {
  .site-header__list {
    display: inline-flex;
  }
}

@media (min-width: 820px) {
  .site-header__find {
    display: inline-flex;
  }
}

@media (min-width: 1120px) {
  .site-nav {
    display: block;
  }

  .site-header__actions {
    margin-left: 0;
  }

  .menu-toggle {
    display: none;
  }
}

/* ---- Search ------------------------------------------------------------- */

.search {
  width: 100%;
  max-width: 560px;
}

.search__box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 20px;
  border-radius: var(--r-chip);
  background: #fff;
  box-shadow: var(--shadow-2), inset 0 0 0 1.5px var(--line);
  transition: box-shadow var(--fast) var(--ease);
}

.search__box:focus-within {
  box-shadow: var(--shadow-2), inset 0 0 0 2px var(--electric);
}

.search__box.is-invalid {
  box-shadow: var(--shadow-2), inset 0 0 0 2px var(--error);
}

.search__icon {
  color: var(--electric);
}

.search__input {
  flex: 1;
  min-width: 0;
  height: 48px;
  padding: 3px 0 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 1.0625rem;
}

.search__input::placeholder {
  color: var(--ink-3);
  opacity: 1;
}

.search__submit {
  flex: none;
}

.search__status {
  margin-top: 12px;
  padding: 12px 16px 10px;
  border-radius: var(--r-md);
  background: var(--electric-tint);
  color: var(--ink);
  font-size: var(--fs-small);
  line-height: 1.5;
}

.search__status[data-tone="error"] {
  background: var(--error-tint);
  color: var(--error);
}

/* Icon-only search button where the field would otherwise cut off its placeholder */
@media (max-width: 519px), (min-width: 1080px) and (max-width: 1279px) {
  .search__box {
    padding-left: 16px;
  }

  .search__submit {
    width: 52px;
    padding: 0;
  }

  .search__submit .search__label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

/* ---- Phone -------------------------------------------------------------- */

.phone {
  position: relative;
  width: 300px;
  aspect-ratio: 300 / 624;
  padding: 10px;
  border-radius: 48px;
  background: #0E1C2A;
  box-shadow: var(--shadow-3), inset 0 0 0 1.5px rgba(255, 255, 255, 0.14);
  transform-style: preserve-3d;
}

.phone__screen {
  position: relative;
  height: 100%;
  overflow: hidden;
  border-radius: 38px;
  background: var(--paper);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.35;
}

.phone__island {
  position: absolute;
  top: 9px;
  left: 50%;
  z-index: 5;
  width: 88px;
  height: 25px;
  border-radius: 20px;
  background: #0E1C2A;
  transform: translateX(-50%);
}

.phone__status {
  position: absolute;
  inset: 0 0 auto;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  padding: 13px 26px 0 30px;
  font-size: 12px;
  font-weight: 800;
}

/* Soft highlight that follows the pointer across the glass */
.phone__glare {
  position: absolute;
  inset: 0;
  z-index: 6;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(
    circle at calc(50% + var(--mx, 0) * 60%) calc(30% + var(--my, 0) * 50%),
    rgba(255, 255, 255, 0.28),
    rgba(255, 255, 255, 0) 45%
  );
  mix-blend-mode: soft-light;
}

/* ---- Floating cards --------------------------------------------------------- */

.float-chip {
  position: absolute;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px 10px;
  border-radius: var(--r-md);
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow-2);
  font-size: var(--fs-small);
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.float-chip .icon {
  margin-top: -2px;
  color: var(--electric);
}

/* ---- Accordion ------------------------------------------------------------ */

.accordion__item {
  border-bottom: 1px solid var(--line);
}

.accordion__item:first-child {
  border-top: 1px solid var(--line);
}

.accordion__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  padding: 24px 0 21px;
  border: 0;
  background: none;
  color: var(--ink);
  font-size: 1.1875rem;
  font-weight: 700;
  line-height: 1.35;
  text-align: left;
}

.accordion__icon {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  margin-top: -3px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--ink);
  transition: background-color var(--fast) var(--ease), transform var(--medium) var(--ease);
}

.accordion__trigger:hover .accordion__icon {
  background: var(--electric-tint);
}

.accordion__trigger[aria-expanded="true"] .accordion__icon {
  transform: rotate(45deg);
  background: var(--ink);
  color: #fff;
}

.accordion__panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--medium) var(--ease);
}

.accordion__panel.is-open {
  grid-template-rows: 1fr;
}

.accordion__panel > div {
  overflow: hidden;
}

.accordion__panel p {
  max-width: 40em;
  padding: 0 52px 24px 0;
  color: var(--ink-2);
}

/* ---- Segmented control and range (used on dark panels) -------------------- */

.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 0 0 1px var(--night-line);
}

.segmented button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 2px 18px 0;
  border: 0;
  border-radius: var(--r-chip);
  background: transparent;
  color: var(--on-night-2);
  font-size: var(--fs-small);
  font-weight: 700;
  transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease);
}

.segmented button:hover {
  color: #fff;
}

.segmented button[aria-checked="true"] {
  background: #fff;
  color: var(--ink);
}

.range {
  --p: 50%;
  width: 100%;
  height: 32px;
  margin: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.range::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, var(--accent, var(--electric)) var(--p), rgba(255, 255, 255, 0.18) var(--p));
}

.range::-moz-range-track {
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.18);
}

.range::-moz-range-progress {
  height: 6px;
  border-radius: 3px;
  background: var(--accent, var(--electric));
}

.range::-webkit-slider-thumb {
  width: 24px;
  height: 24px;
  margin-top: -9px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.16);
  -webkit-appearance: none;
  appearance: none;
}

.range::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.16);
}

/* ---- Footer ----------------------------------------------------------------- */

.site-footer {
  padding: var(--s-8) 0 var(--s-6);
  background: #fff;
  border-top: 1px solid var(--line);
}

.footer__top {
  display: grid;
  gap: 40px;
}

.footer__brand p {
  max-width: 30em;
  margin: 18px 0 14px;
  color: var(--ink-3);
  font-size: var(--fs-small);
}

.footer__nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 32px;
}

.footer__heading {
  margin-bottom: 12px;
  color: var(--ink);
  font-size: var(--fs-small);
  font-weight: 800;
}

.footer__links {
  display: grid;
  gap: 8px;
}

.footer__links a {
  color: var(--ink-2);
  font-size: var(--fs-small);
  text-decoration: none;
}

.footer__links a:hover {
  color: var(--electric-hover);
  text-decoration: underline;
}

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  margin-top: var(--s-8);
  padding-top: var(--s-5);
  border-top: 1px solid var(--line);
  color: var(--ink-3);
  font-size: var(--fs-tiny);
}

.footer__bottom a {
  color: var(--ink-2);
  text-decoration: none;
}

.footer__bottom a:hover {
  text-decoration: underline;
}

@media (min-width: 900px) {
  .footer__top {
    grid-template-columns: 5fr 7fr;
    gap: 64px;
  }
}
