/* Shared button system. One source of truth for the portfolio (Astro) and the standalone survey.
   Requires the semantic tokens from tokens.css. Variants: primary, secondary, quiet, ghost. */
.button { --btn-ease: var(--ease-out-expo, cubic-bezier(.16, 1, .3, 1)); position: relative; display: inline-flex; min-height: var(--control-lg); align-items: center; justify-content: center; gap: var(--space-2); padding: 0 var(--space-6); overflow: hidden; border: var(--stroke-1) solid transparent; border-radius: var(--radius-md); background: none; color: inherit; font:var(--weight-semibold) 0.875rem/1rem var(--font-body); text-align: center; text-decoration: none; white-space: nowrap; cursor: pointer; isolation: isolate; appearance: none; transition: background-color var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard), box-shadow var(--duration-base) var(--ease-standard), transform var(--duration-base) var(--btn-ease); }
/* Soft light sweep on hover (filled variants only). */
.button--primary::before, .button--secondary::before { position: absolute; z-index: -1; inset: 0; background: linear-gradient(105deg, transparent 30%, rgb(255 255 255 / .18) 50%, transparent 70%); content: ''; transform: translateX(-110%); transition: transform 700ms var(--btn-ease); }
.button:hover:not(:disabled) { box-shadow: var(--shadow-primary); transform: translateY(-2px); }
.button:hover:not(:disabled)::before { transform: translateX(110%); }
.button:active:not(:disabled) { box-shadow: var(--shadow-sm); transform: translateY(0) scale(.98); }
.button:focus-visible { outline: var(--focus-ring-width) solid var(--focus-color); outline-offset: var(--focus-ring-offset); }
.button:disabled { opacity: .7; cursor: progress; }
.button__icon { width: 18px; height: 18px; flex: 0 0 auto; transition: transform var(--duration-slow) var(--btn-ease); }
.button:hover:not(:disabled) .button__icon { transform: translateX(3px); }
.button__icon--down { transform: rotate(90deg); }
.button:hover:not(:disabled) .button__icon--down { transform: rotate(90deg) translateX(3px); }
.button__icon--back { transform: rotate(180deg); }
.button:hover:not(:disabled) .button__icon--back { transform: rotate(180deg) translateX(3px); }

.button--primary { color: var(--text-on-primary); background: var(--surface-primary); }
.button--primary:hover:not(:disabled) { background: var(--surface-primary-hover); box-shadow: 0 10px 24px -10px color-mix(in srgb, var(--surface-primary) 70%, transparent); }
.button--primary:active:not(:disabled) { background: var(--surface-primary-pressed); }
.button--secondary { color: var(--text-on-secondary); background: var(--surface-secondary); }
.button--secondary:hover:not(:disabled) { background: var(--surface-secondary-hover); box-shadow: 0 10px 24px -10px color-mix(in srgb, var(--surface-secondary) 70%, transparent); }
.button--secondary:active:not(:disabled) { background: var(--surface-secondary-pressed); }
/* Text-only actions keep the arrow nudge but never lift or glow. */
.button--quiet, .button--ghost { padding-inline: 0; }
.button--quiet { color: var(--text-link); }
.button--ghost { padding-inline: var(--space-4); color: var(--text-neutral); }
.button--quiet:hover:not(:disabled), .button--ghost:hover:not(:disabled) { box-shadow: none; transform: none; }
.button--ghost:hover:not(:disabled) { color: var(--text-primary); }
.button--quiet:active:not(:disabled), .button--ghost:active:not(:disabled) { box-shadow: none; transform: scale(.98); }

/* Phones: filled buttons take the full width of their container. */
@media (max-width: 640px) { .button--primary, .button--secondary { width: 100%; } }

/* Labels are always one line. If a container is ever too narrow, the label is cut with an ellipsis instead of wrapping. */
.button > span:not(.sr-only) { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* Very small phones: slimmer side padding so one-line labels still fit. */
@media (max-width: 360px) { .button { padding-inline: var(--space-4); } .button--quiet, .button--ghost { padding-inline: 0; } }
