/* gemel.la: fondamenta condivise da sito, accesso e applicazione. */

@font-face {
  font-family: "Outfit";
  src: url("../fonts/outfit-var.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Serif";
  src: url("../fonts/instrument-serif-italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}

:root {
  --ink: #0a0a0b;
  --ink-2: #16161a;
  --ink-3: #26262c;
  --paper: #ffffff;
  --paper-2: #f6f5f2;
  --paper-3: #eceae5;
  --violet: #7131f8;
  --violet-deep: #5a1fd6;
  --violet-soft: #efe9ff;
  --muted: #6c6c75;
  --muted-on-ink: #a3a3ad;
  --line: #e4e2dc;
  --line-on-ink: #2c2c33;
  --danger: #d92c3f;
  --success: #12825a;
  --sans: "Outfit", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", ui-serif, Georgia, serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.65, 0, 0.35, 1);
  --radius: 20px;
  --radius-lg: 32px;
  --gutter: clamp(16px, 4vw, 48px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* I display dei componenti non devono mai battere l'attributo hidden. */
[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
figure,
blockquote {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

img,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

::selection {
  background: var(--violet);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 3px;
  border-radius: 6px;
}

em,
.serif {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.logo {
  height: 30px;
  width: auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  transform: translateY(-200%);
  transition: transform 0.2s;
}

.skip-link:focus {
  transform: none;
}

/* Bottoni */

.btn {
  --btn-bg: var(--ink);
  --btn-fg: #fff;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 26px;
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 500;
  font-size: 17px;
  letter-spacing: -0.005em;
  white-space: nowrap;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.35s var(--ease-out), opacity 0.2s, color 0.3s;
}

/* Un disco viola cresce dal punto: e' il punto del logo che riempie il bottone. */
.btn::before {
  content: "";
  position: absolute;
  z-index: -1;
  right: 24px;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-top: -4px;
  border-radius: 50%;
  background: var(--violet);
  transition: transform 0.6s var(--ease-out);
}

.btn:hover::before {
  transform: scale(60);
}

.btn:hover {
  color: #fff;
}

.btn:active {
  transform: scale(0.97);
}

.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn[disabled]::before {
  transform: none;
}

.btn--dot {
  padding-right: 48px;
}

.btn--light {
  --btn-bg: #fff;
  --btn-fg: var(--ink);
}

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: inherit;
  box-shadow: inset 0 0 0 1px currentColor;
}

.btn--ghost::before {
  display: none;
}

.btn--ghost:hover {
  color: inherit;
  background: color-mix(in srgb, currentColor 8%, transparent);
}

.btn--small {
  min-height: 40px;
  padding: 0 18px;
  font-size: 15px;
}

.btn--danger {
  --btn-bg: var(--danger);
}

.btn--danger::before {
  background: #a3121f;
}

.btn--wide {
  width: 100%;
}

.btn.is-loading {
  color: transparent;
  pointer-events: none;
}

.btn.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: spin 0.7s linear infinite;
}

.btn--light.is-loading::after {
  border-color: rgba(0, 0, 0, 0.2);
  border-top-color: var(--ink);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Avvisi */

.toasts {
  position: fixed;
  z-index: 90;
  right: 20px;
  bottom: 20px;
  display: grid;
  gap: 10px;
  max-width: min(420px, calc(100vw - 40px));
}

.toast {
  padding: 14px 18px;
  border-radius: 16px;
  background: var(--ink);
  color: #fff;
  font-size: 15px;
  box-shadow: 0 18px 50px -18px rgba(0, 0, 0, 0.5);
  animation: toast-in 0.45s var(--ease-out);
}

.toast--error {
  background: var(--danger);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
