/* FM Digital Tools: same palette as StarLight (deep dark theme with fluorescent accents). */
:root {
  --bg-0: #070910;
  --bg-1: #0b0f1a;
  --bg-2: #111726;
  --bg-3: #18202f;
  --line: #1e283b;
  --line-strong: #2c3a53;
  --text: #eaf1ff;
  --text-2: #a9b6cc;
  --text-3: #7d8aa3;
  --cyan: #22e8ff;
  --blue: #2f6bff;
  --magenta: #ff3dd0;
  --violet: #9d7bff;
  --lime: #46ffa6;
  --amber: #ffc247;
  --font: "Segoe UI Variable Text", "Segoe UI", Inter, system-ui, -apple-system, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", Inter, system-ui, sans-serif;
  --radius: 14px;
  --wrap: 1120px;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  margin: 0;
  background: var(--bg-0);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Fixed background: soft nebula glows; the twinkling stars are drawn on the .sky canvas */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(900px 600px at 85% -10%, rgba(157, 123, 255, 0.12), transparent 70%),
    radial-gradient(800px 600px at -10% 30%, rgba(34, 232, 255, 0.08), transparent 70%),
    radial-gradient(700px 500px at 100% 90%, rgba(255, 61, 208, 0.05), transparent 70%),
    var(--bg-0);
}

.sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

a {
  color: var(--cyan);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  display: block;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  line-height: 1.2;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.6rem, 3.2vw, 2.2rem);
}

h3 {
  font-size: 1.1rem;
}

p {
  margin: 0 0 1em;
  /* Left-aligned, never hyphenated, with balanced line breaks */
  hyphens: manual;
  -webkit-hyphens: manual;
  text-wrap: pretty;
}

.wrap {
  width: min(var(--wrap), 100% - 32px);
  margin-inline: auto;
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 16px;
  top: 16px;
  z-index: 10;
  background: var(--bg-2);
  padding: 8px 12px;
  border-radius: 8px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(7, 9, 16, 0.78);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}

.brand:hover {
  text-decoration: none;
}

.brand img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
}

.nav {
  display: flex;
  gap: 22px;
  margin-left: auto;
  font-size: 0.95rem;
}

.nav a {
  color: var(--text-2);
}

.nav a:hover {
  color: var(--text);
  text-decoration: none;
}

/* Language switch: highlighted with the theme cyan so it stands apart from the section links */
.nav a.lang {
  color: var(--cyan);
  border: 1px solid rgba(34, 232, 255, 0.55);
  background: rgba(34, 232, 255, 0.08);
  border-radius: 999px;
  padding: 3px 14px;
  font-weight: 600;
  box-shadow: 0 0 14px rgba(34, 232, 255, 0.12);
}

.nav a.lang:hover {
  color: var(--bg-0);
  background: var(--cyan);
}

/* Hero */
.hero {
  padding: 88px 0 72px;
}

.hero .wrap {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 56px;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--cyan);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 18px;
}

.eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
}

.hero h1 {
  font-size: clamp(2.8rem, 7vw, 4.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  /* background-clip: text clips at the box edge: room for the descender of the "g" */
  padding-bottom: 0.14em;
  margin-bottom: 0;
  background: linear-gradient(100deg, #8ffbe0, var(--cyan) 30%, var(--violet) 70%, var(--magenta));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tagline {
  font-size: clamp(1.2rem, 2.4vw, 1.5rem);
  color: var(--text);
  font-family: var(--font-display);
  margin-bottom: 18px;
}

.lead {
  color: var(--text-2);
  max-width: 34em;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 22px 0 30px;
  padding: 0;
  list-style: none;
}

.badges li {
  font-size: 0.85rem;
  color: var(--text-2);
  border: 1px solid var(--line-strong);
  background: rgba(17, 23, 38, 0.6);
  border-radius: 999px;
  padding: 4px 12px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 1rem;
  border-radius: 10px;
  padding: 12px 22px;
  border: 1px solid transparent;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(100deg, var(--cyan), var(--blue));
  color: #04070d;
  box-shadow: 0 0 24px rgba(34, 232, 255, 0.28);
}

.btn-primary:hover {
  box-shadow: 0 0 32px rgba(34, 232, 255, 0.45);
}

.btn-pending {
  background: rgba(17, 23, 38, 0.8);
  color: var(--text-2);
  border-color: var(--line-strong);
  cursor: default;
}

.btn-ghost {
  color: var(--text);
  border-color: var(--line-strong);
}

.btn-ghost:hover {
  border-color: var(--magenta);
  box-shadow: 0 0 18px rgba(255, 61, 208, 0.22);
}

.version {
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--text-3);
}

.hero-art {
  position: relative;
  justify-self: center;
  width: min(380px, 80vw);
  aspect-ratio: 1;
}

.hero-art img {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 22%;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--line-strong);
  animation: breathe 4.5s ease-in-out infinite;
}

/* Logo animation, as in the app splash screen: rotating halo, breathing icon, sparkles */
@property --angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

.halo {
  position: absolute;
  inset: -9%;
  border-radius: 50%;
  background: conic-gradient(from var(--angle), transparent 0deg, rgba(34, 232, 255, 0.55) 70deg,
    transparent 140deg, rgba(255, 61, 208, 0.5) 230deg, transparent 300deg);
  filter: blur(36px);
  animation: rotate-ring 6s linear infinite;
}

@keyframes rotate-ring {
  to {
    --angle: 360deg;
  }
}

@keyframes breathe {
  0%,
  100% {
    transform: scale(1);
    filter: drop-shadow(0 0 16px rgba(157, 123, 255, 0.4));
  }

  50% {
    transform: scale(1.03);
    filter: drop-shadow(0 0 36px rgba(34, 232, 255, 0.5));
  }
}

.sparkle {
  position: absolute;
  width: 26px;
  height: 26px;
  background: #fff;
  clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
  opacity: 0;
  animation: twinkle 3s ease-in-out infinite;
}

.sparkle.s1 {
  top: -4%;
  right: 4%;
  filter: drop-shadow(0 0 6px var(--cyan));
}

.sparkle.s2 {
  bottom: 8%;
  left: -6%;
  width: 18px;
  height: 18px;
  filter: drop-shadow(0 0 6px var(--magenta));
  animation-delay: 1s;
}

.sparkle.s3 {
  top: 28%;
  right: -7%;
  width: 21px;
  height: 21px;
  filter: drop-shadow(0 0 6px var(--violet));
  animation-delay: 2s;
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0;
    transform: scale(0.2) rotate(0deg);
  }

  30% {
    opacity: 1;
    transform: scale(1.1) rotate(45deg);
  }

  60% {
    opacity: 0;
    transform: scale(0.4) rotate(90deg);
  }
}

/* Sections */
section {
  padding: 72px 0;
}

.section-head {
  max-width: 44em;
  margin-bottom: 36px;
}

.section-head p {
  color: var(--text-2);
}

.alt {
  background: linear-gradient(180deg, rgba(11, 15, 26, 0.55), rgba(11, 15, 26, 0.35));
  border-block: 1px solid var(--line);
}

/* Steps */
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.steps li {
  --accent: var(--cyan);
  --accent-rgb: 34, 232, 255;
  background: rgba(17, 23, 38, 0.75);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.steps li:nth-child(4n + 2) {
  --accent: var(--violet);
  --accent-rgb: 157, 123, 255;
}

.steps li:nth-child(4n + 3) {
  --accent: var(--magenta);
  --accent-rgb: 255, 61, 208;
}

.steps li:nth-child(4n + 4) {
  --accent: var(--lime);
  --accent-rgb: 70, 255, 166;
}

.steps li:hover {
  border-color: rgba(var(--accent-rgb), 0.45);
  box-shadow: 0 0 24px rgba(var(--accent-rgb), 0.1);
}

/* Step icons, the same drawings as in the StarLight workflow bar */
.step-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.1);
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.35), 0 0 18px rgba(var(--accent-rgb), 0.18);
  margin-bottom: 14px;
}

.step-icon .icon {
  width: 24px;
  height: 24px;
  filter: drop-shadow(0 0 4px rgba(var(--accent-rgb), 0.6));
}

.steps h3 {
  margin-bottom: 6px;
}

.steps p {
  color: var(--text-2);
  font-size: 0.95rem;
  margin: 0;
}

/* Feature cards */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.card {
  background: rgba(17, 23, 38, 0.75);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 0 24px rgba(34, 232, 255, 0.08);
}

.card p {
  color: var(--text-2);
  font-size: 0.95rem;
  margin: 0;
}

.card.highlight {
  grid-column: span 3;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  align-items: center;
  border-color: rgba(157, 123, 255, 0.45);
  background: linear-gradient(110deg, rgba(157, 123, 255, 0.14), rgba(34, 232, 255, 0.06) 60%, rgba(17, 23, 38, 0.75));
}

.wand {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  color: var(--violet);
  background: rgba(157, 123, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(157, 123, 255, 0.45), 0 0 22px rgba(157, 123, 255, 0.25);
}

.wand .icon {
  width: 30px;
  height: 30px;
  filter: drop-shadow(0 0 5px rgba(157, 123, 255, 0.7));
}

/*
 * Abracadabra card, animated as the button in the app: the gradient border scrolls, a glow
 * rotates behind the card, a reflection crosses the title and three sparks light up in turn
 * around the tip of the wand, which sways slightly.
 */
.card.magic {
  position: relative;
  isolation: isolate;
  border: 1px solid transparent;
  background:
    linear-gradient(110deg, rgba(26, 20, 52, 0.96), rgba(14, 14, 32, 0.96) 60%, rgba(17, 23, 38, 0.96)) padding-box,
    linear-gradient(92deg, var(--cyan), var(--violet), var(--magenta), var(--violet), var(--cyan)) border-box;
  background-size: 100% 100%, 300% 100%;
  animation: magic-frame 6s linear infinite;
}

.card.magic:hover {
  box-shadow: 0 0 22px rgba(157, 123, 255, 0.45), 0 0 44px rgba(255, 61, 208, 0.2);
}

@property --halo-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

.magic-halo {
  position: absolute;
  inset: -4px;
  z-index: -1;
  border-radius: calc(var(--radius) + 4px);
  background: conic-gradient(from var(--halo-angle), transparent 0deg, rgba(34, 232, 255, 0.5) 60deg,
    transparent 120deg, rgba(255, 61, 208, 0.45) 220deg, transparent 290deg);
  filter: blur(14px);
  opacity: 0.7;
  animation: magic-halo 4s linear infinite;
  pointer-events: none;
}

.magic-text {
  font-size: 1.35rem;
  background:
    linear-gradient(100deg, transparent 35%, rgba(255, 255, 255, 0.95) 50%, transparent 65%) 0 0 / 250% 100% no-repeat,
    linear-gradient(92deg, var(--cyan), var(--violet) 55%, var(--magenta));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-bottom: 0.1em;
  animation: magic-glint 3.2s ease-in-out infinite;
}

.card.magic .wand {
  position: relative;
}

.card.magic .wand .icon {
  animation: wand-ready 3.2s ease-in-out infinite;
}

.spark {
  position: absolute;
  width: 10px;
  height: 10px;
  background: #fff;
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  opacity: 0;
  pointer-events: none;
  animation: spark 2.4s ease-in-out infinite;
}

.spark-1 {
  top: 2px;
  right: 2px;
  filter: drop-shadow(0 0 4px var(--cyan));
}

.spark-2 {
  top: 12px;
  right: -6px;
  width: 7px;
  height: 7px;
  filter: drop-shadow(0 0 4px var(--magenta));
  animation-delay: 0.8s;
}

.spark-3 {
  top: -5px;
  right: 14px;
  width: 8px;
  height: 8px;
  filter: drop-shadow(0 0 4px var(--violet));
  animation-delay: 1.6s;
}

@keyframes magic-frame {
  from {
    background-position: 0 0, 0% 0;
  }

  to {
    background-position: 0 0, 300% 0;
  }
}

@keyframes magic-halo {
  to {
    --halo-angle: 360deg;
  }
}

@keyframes magic-glint {
  0%,
  55% {
    background-position: 150% 0, 0 0;
  }

  100% {
    background-position: -100% 0, 0 0;
  }
}

@keyframes wand-ready {
  0%,
  100% {
    transform: rotate(0deg);
  }

  50% {
    transform: rotate(-12deg) translateY(-1px);
  }
}

@keyframes spark {
  0%,
  100% {
    opacity: 0;
    transform: scale(0.2) rotate(0deg);
  }

  30% {
    opacity: 1;
    transform: scale(1.15) rotate(45deg);
  }

  60% {
    opacity: 0;
    transform: scale(0.4) rotate(90deg);
  }
}

/* Plugin gallery: before and after, switched on hover or tap */
.gallery-group {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cyan);
  margin: 8px 0 16px;
}

.gallery + .gallery-group {
  margin-top: 40px;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}

.plugin {
  background: rgba(17, 23, 38, 0.75);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.plugin:hover {
  border-color: var(--line-strong);
  box-shadow: 0 0 24px rgba(34, 232, 255, 0.08);
}

.ba {
  position: relative;
  margin: 0;
  aspect-ratio: 1;
  background: #000;
  cursor: pointer;
  outline: none;
}

.ba img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ba .after {
  opacity: 0;
  transition: opacity 0.45s ease;
}

.ba:hover .after,
.ba:focus .after {
  opacity: 1;
}

.ba:focus-visible {
  box-shadow: inset 0 0 0 2px var(--cyan);
}

.ba-label {
  position: absolute;
  left: 10px;
  bottom: 10px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text);
  background: rgba(7, 9, 16, 0.75);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 2px 10px;
}

.ba-label::after {
  content: attr(data-before);
}

.ba:hover .ba-label::after,
.ba:focus .ba-label::after {
  content: attr(data-after);
}

.ba:hover .ba-label,
.ba:focus .ba-label {
  border-color: var(--cyan);
  color: var(--cyan);
}

.plugin-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px 6px;
}

.plugin-head img {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  flex: none;
}

.plugin-head h4 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1rem;
  line-height: 1.25;
}

.plugin p {
  margin: 0;
  padding: 0 18px 18px;
  color: var(--text-2);
  font-size: 0.9rem;
}

/* Two columns: formats, privacy, requirements */
.columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.columns ul {
  margin: 0;
  padding-left: 1.1em;
  color: var(--text-2);
}

.columns li {
  margin-bottom: 4px;
}

.columns li::marker {
  color: var(--cyan);
}

.note {
  font-size: 0.9rem;
  color: var(--text-3);
  margin-top: 12px;
}

/* Coming soon */
.soon {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.soon + .note {
  margin-top: 20px;
}

.soon .card {
  border-style: dashed;
}

.soon .tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 8px;
}

/* Support */
.support {
  text-align: center;
}

.support .section-head {
  margin-inline: auto;
}

.support .actions {
  justify-content: center;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 40px 0 48px;
  color: var(--text-3);
  font-size: 0.9rem;
}

.site-footer .wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
}

.site-footer p {
  margin: 0 0 6px;
}

.site-footer .links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  align-items: start;
}

/* Responsive */
@media (max-width: 900px) {
  .hero .wrap {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .hero-art {
    width: min(260px, 70vw);
    order: -1;
  }

  .steps {
    grid-template-columns: repeat(2, 1fr);
  }

  .features,
  .columns {
    grid-template-columns: 1fr 1fr;
  }

  .card.highlight {
    grid-column: span 2;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 16px;
  }

  .nav a:not(.lang) {
    display: none;
  }

  .hero {
    padding: 48px 0 40px;
  }

  section {
    padding: 52px 0;
  }

  .steps,
  .features,
  .columns,
  .soon {
    grid-template-columns: 1fr;
  }

  .card.highlight {
    grid-column: auto;
    grid-template-columns: 1fr;
  }

  .site-footer .wrap {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .halo,
  .hero-art img,
  .sparkle,
  .card.magic,
  .magic-halo,
  .magic-text,
  .card.magic .wand .icon,
  .spark {
    animation: none;
  }
}

/* Code signing policy and privacy page */
.policy .wrap {
  max-width: 46em;
}

.policy h1 {
  font-size: clamp(2rem, 4.5vw, 2.8rem);
}

.policy h2 {
  margin-top: 1.6em;
}

.policy h3 {
  margin-top: 1.4em;
}

.policy ul {
  padding-left: 1.2em;
  margin: 0 0 1em;
}

.policy li {
  margin-bottom: 0.5em;
}

.policy li::marker {
  color: var(--cyan);
}

.policy code {
  font-size: 0.92em;
  overflow-wrap: anywhere;
}
