/* Exact Nexa palette: tailwind.config.js brand.600/700 and magenta.500.
   Scoped to the requested creation action and topbar controls. */
:root {
  --nexa-brand-pink: #d946ef;
  --nexa-brand-purple: #9333ea;
  --nexa-brand-deep: #7e22ce;
}

.topbar { background-color: rgb(12 16 16); }

.hero h1 { position: relative; }
.title-film-canvas,
.title-film-source {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  user-select: none;
}
.title-film-source { opacity: 0; }
.title-film-canvas { visibility: hidden; }
.has-title-film .title-film-canvas { visibility: visible; }

.button.nexa-creation-button {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  align-items: center;
  line-height: 1;
  background-color: var(--nexa-brand-purple);
  /* A thin ink veil keeps white copy readable at the pink end of the palette. */
  background-image:
    linear-gradient(rgb(8 8 15 / .12), rgb(8 8 15 / .12)),
    linear-gradient(110deg, var(--nexa-brand-pink), var(--nexa-brand-purple) 35%,
      var(--nexa-brand-pink) 68%, var(--nexa-brand-deep));
  background-size: 100% 100%, 240% 100%;
  background-position: 0 0, 0% 50%;
  color: #fff;
  animation: nexa-creation-colors 6s ease-in-out infinite;
}
.button.nexa-creation-button::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background: var(--nexa-brand-purple);
  clip-path: circle(0px at var(--creation-entry-x, 50%) var(--creation-entry-y, 50%));
  opacity: 0;
  transition: clip-path 300ms cubic-bezier(.4, 0, .2, 1), opacity 180ms ease-out;
}
.button.nexa-creation-button::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(circle 42px at var(--creation-focus-x, 50%) var(--creation-focus-y, 50%),
    var(--nexa-brand-pink) 0%, rgb(217 70 239 / .85) 22%,
    rgb(217 70 239 / .35) 55%, rgb(147 51 234 / 0) 100%);
  opacity: 0;
  transition: opacity 180ms ease-out;
}
.button.nexa-creation-button > [data-icon] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.button.nexa-creation-button > [data-icon] > .icon { display: block; }
.button.nexa-creation-button:is(.is-creation-hovered, :focus-visible) {
  animation-play-state: paused;
}
.button.nexa-creation-button:is(.is-creation-hovered, :focus-visible)::before {
  clip-path: circle(var(--creation-wave-radius, 240px) at var(--creation-entry-x, 50%) var(--creation-entry-y, 50%));
  opacity: 1;
  transition: clip-path 380ms cubic-bezier(.2, .7, .3, 1), opacity 80ms ease-out;
}
.button.nexa-creation-button:is(.is-creation-hovered, :focus-visible)::after {
  opacity: 1;
  transition: opacity 260ms ease-out 100ms;
}
.button.nexa-creation-button.creation-pointer-reset::before {
  clip-path: circle(0px at var(--creation-entry-x, 50%) var(--creation-entry-y, 50%));
  transition: none;
}
.button.nexa-creation-button.creation-pointer-reset::after {
  opacity: 0;
  transition: none;
}
.button.nexa-creation-button:focus-visible { outline-color: var(--nexa-brand-purple); }
.projects-button .projects-brand-icon { stroke: url(#nexa-projects-gradient); }

@property --nexa-orbit-angle {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}

.creation-form {
  border: 1.5px solid transparent;
  background:
    linear-gradient(#fff, #fff) padding-box,
    conic-gradient(from var(--nexa-orbit-angle),
      rgb(147 51 234 / .25) 0deg,
      var(--nexa-brand-purple) 95deg,
      rgb(147 51 234 / .25) 175deg,
      rgb(147 51 234 / .25) 360deg) border-box;
  animation: nexa-border-orbit 3.6s linear infinite;
}

.top-actions > .button.small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding-block: 0;
  line-height: 1;
  border: 1.5px solid transparent;
  background:
    linear-gradient(var(--paper), var(--paper)) padding-box,
    conic-gradient(from var(--nexa-orbit-angle),
      rgb(147 51 234 / .25) 0deg,
      var(--nexa-brand-purple) 95deg,
      rgb(147 51 234 / .25) 175deg,
      rgb(147 51 234 / .25) 360deg) border-box;
  color: var(--ink);
  animation: nexa-border-orbit 3.6s linear infinite;
}
.top-actions > .button.small:focus-visible { outline-color: var(--nexa-brand-purple); }
.top-actions > .button.small > span {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.top-actions > .button.small .start-arrow { width: 24px; height: 20px; }
.top-actions > .button.small .icon {
  display: block;
  width: 24px;
  height: 20px;
  color: var(--nexa-brand-purple);
  animation: nexa-arrow-idle 4.6s cubic-bezier(.16, 1, .3, 1) infinite;
}
.start-arrow-shaft {
  transform-box: view-box;
  transform-origin: 21px 12px;
  transition: transform 240ms cubic-bezier(.16, 1, .3, 1);
}
.top-actions > .button.small:is(:hover, :focus-visible) .icon {
  animation: none;
  transform: none;
  opacity: 1;
}
.top-actions > .button.small:is(:hover, :focus-visible) .start-arrow-shaft {
  transform: scaleX(1.4);
}
@keyframes nexa-border-orbit { to { --nexa-orbit-angle: 360deg; } }
@keyframes nexa-arrow-idle {
  0%, 80% { transform: translateX(0); opacity: 1; }
  87% { transform: translateX(7px); opacity: 0; }
  88% { transform: translateX(-7px); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}
@keyframes nexa-creation-colors {
  0%, 100% { background-position: 0 0, 0% 50%; }
  50% { background-position: 0 0, 100% 50%; }
}

@media (prefers-reduced-motion: reduce) {
  .top-actions > .button.small,
  .top-actions > .button.small .icon,
  .creation-form,
  .button.nexa-creation-button { animation: none; }
  .button.nexa-creation-button::before,
  .button.nexa-creation-button:is(.is-creation-hovered, :focus-visible)::before,
  .button.nexa-creation-button:is(.is-creation-hovered, :focus-visible)::after { transition: none; }
  .start-arrow-shaft { transition: none; }
}
.reading .top-actions > .button.small,
.reading .top-actions > .button.small .icon,
.reading .creation-form,
.reading .button.nexa-creation-button { animation: none; }
.reading .button.nexa-creation-button::before,
.reading .button.nexa-creation-button:is(.is-creation-hovered, :focus-visible)::before,
.reading .button.nexa-creation-button:is(.is-creation-hovered, :focus-visible)::after { transition: none; }
.reading .start-arrow-shaft { transition: none; }
