/* ============ Petxy · base ============ */
:root {
  --bg: #FFF7EE;
  --bg-2: #FFEFDD;
  --card: #FFFFFF;
  --card-2: #FFFBF6;
  --ink: #2A2140;
  --ink-2: #544A6E;
  --muted: #8C84A3;
  --line: #F1E4D3;
  --line-2: #E8D6BF;

  --brand: #FF7A45;
  --brand-dark: #E2571F;
  --brand-soft: #FFE4D6;
  --grape: #8E6CFF;
  --grape-dark: #6C49E6;
  --grape-soft: #EEE8FF;
  --mint: #25B472;
  --mint-dark: #178A55;
  --mint-soft: #DBF5E8;
  --sun: #FFC23D;
  --sun-dark: #E09E0B;
  --sun-soft: #FFF2CC;
  --sky: #3DA5F4;
  --sky-dark: #1F83D1;
  --sky-soft: #DFF0FD;
  --pink: #FF6FA8;
  --pink-dark: #E24C88;
  --pink-soft: #FFE2EE;
  --red: #FF5470;
  --red-dark: #D9344F;
  --red-soft: #FFE1E6;

  --radius: 22px;
  --radius-sm: 14px;
  --radius-lg: 32px;
  --shadow: 0 14px 34px -16px rgba(42, 33, 64, .22);
  --shadow-sm: 0 5px 14px -8px rgba(42, 33, 64, .22);
  --shadow-lg: 0 30px 60px -24px rgba(42, 33, 64, .35);
  --ring: 0 0 0 4px rgba(255, 122, 69, .22);

  --font: 'Nunito', ui-rounded, 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-display: 'Fredoka', 'Nunito', ui-rounded, 'Segoe UI', system-ui, sans-serif;
  --paw-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cg fill='%23F6E6D2'%3E%3Cg transform='rotate(-18 40 40)'%3E%3Cellipse cx='40' cy='46' rx='10' ry='8'/%3E%3Ccircle cx='29' cy='33' r='4'/%3E%3Ccircle cx='36' cy='27' r='4'/%3E%3Ccircle cx='44' cy='27' r='4'/%3E%3Ccircle cx='51' cy='33' r='4'/%3E%3C/g%3E%3Cg transform='rotate(22 118 118)'%3E%3Cellipse cx='118' cy='124' rx='10' ry='8'/%3E%3Ccircle cx='107' cy='111' r='4'/%3E%3Ccircle cx='114' cy='105' r='4'/%3E%3Ccircle cx='122' cy='105' r='4'/%3E%3Ccircle cx='129' cy='111' r='4'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #17122A;
  --bg-2: #1E1836;
  --card: #231C3D;
  --card-2: #2A2247;
  --ink: #F4EFFF;
  --ink-2: #CFC6EA;
  --muted: #9A90BC;
  --line: #352C57;
  --line-2: #43386B;
  --brand-soft: #4A2A2A;
  --grape-soft: #332A5C;
  --mint-soft: #1D3E35;
  --sun-soft: #43391F;
  --sky-soft: #1C3450;
  --pink-soft: #45253A;
  --red-soft: #4A2230;
  --shadow: 0 14px 34px -16px rgba(0, 0, 0, .6);
  --shadow-sm: 0 5px 14px -8px rgba(0, 0, 0, .6);
  --shadow-lg: 0 30px 60px -24px rgba(0, 0, 0, .7);
  --paw-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cg fill='%23201A38'%3E%3Cg transform='rotate(-18 40 40)'%3E%3Cellipse cx='40' cy='46' rx='10' ry='8'/%3E%3Ccircle cx='29' cy='33' r='4'/%3E%3Ccircle cx='36' cy='27' r='4'/%3E%3Ccircle cx='44' cy='27' r='4'/%3E%3Ccircle cx='51' cy='33' r='4'/%3E%3C/g%3E%3Cg transform='rotate(22 118 118)'%3E%3Cellipse cx='118' cy='124' rx='10' ry='8'/%3E%3Ccircle cx='107' cy='111' r='4'/%3E%3Ccircle cx='114' cy='105' r='4'/%3E%3Ccircle cx='122' cy='105' r='4'/%3E%3Ccircle cx='129' cy='111' r='4'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font: 500 15px/1.55 var(--font);
  color: var(--ink);
  background: var(--bg) var(--paw-pattern);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: clamp(30px, 4.6vw, 56px); }
h2 { font-size: clamp(24px, 3vw, 36px); }
h3 { font-size: 20px; }
h4 { font-size: 16px; }
p { margin: 0 0 1em; }
a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
:where([data-theme="dark"]) a { color: var(--brand); }
img, svg { max-width: 100%; }
.ic { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: var(--sun); color: #2A2140; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 8px; }
hr { border: 0; border-top: 2px dashed var(--line); margin: 18px 0; }
code, .mono { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: .92em; }
[hidden] { display: none !important; }

/* ---------- utility ---------- */
.row { display: flex; align-items: center; gap: 12px; }
.row.wrap { flex-wrap: wrap; }
.row.top { align-items: flex-start; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.col { display: flex; flex-direction: column; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.grid { display: grid; gap: 18px; }
.grid.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid.g3, .grid.g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .grid.g2, .grid.g3, .grid.g4 { grid-template-columns: minmax(0, 1fr); } }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.big { font-size: 18px; }
.bold { font-weight: 800; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt0 { margin-top: 0; } .mt1 { margin-top: 8px; } .mt2 { margin-top: 16px; } .mt3 { margin-top: 28px; }
.mb0 { margin-bottom: 0; } .mb1 { margin-bottom: 8px; } .mb2 { margin-bottom: 16px; } .mb3 { margin-bottom: 28px; }
.display { font-family: var(--font-display); }
.emoji { font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif; font-style: normal; line-height: 1; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- animazioni ---------- */
@keyframes float { 0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); } 50% { transform: translateY(-12px) rotate(var(--r, 0deg)); } }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-10deg); } 75% { transform: rotate(10deg); } }
@keyframes wag { 0%, 100% { transform: rotate(-18deg); } 50% { transform: rotate(22deg); } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.06); opacity: 1; } 100% { transform: scale(1); } }
@keyframes rise { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 122, 69, .5); } 50% { box-shadow: 0 0 0 10px rgba(255, 122, 69, 0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes blink { 0%, 90%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes pawstep { 0%, 100% { opacity: .15; transform: scale(.8); } 50% { opacity: 1; transform: scale(1); } }
@keyframes ring { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(18deg); } 30% { transform: rotate(-16deg); } 45% { transform: rotate(10deg); } 60% { transform: rotate(-6deg); } 75% { transform: rotate(2deg); } }
@keyframes shimmer { from { background-position: -400px 0; } to { background-position: 400px 0; } }
.anim-rise { animation: rise .45s cubic-bezier(.2, .8, .3, 1) both; }
.anim-pop { animation: pop .45s cubic-bezier(.2, .8, .3, 1) both; }
.stagger > * { animation: rise .5s cubic-bezier(.2, .8, .3, 1) both; }
.stagger > *:nth-child(2) { animation-delay: .04s; } .stagger > *:nth-child(3) { animation-delay: .08s; }
.stagger > *:nth-child(4) { animation-delay: .12s; } .stagger > *:nth-child(5) { animation-delay: .16s; }
.stagger > *:nth-child(6) { animation-delay: .2s; } .stagger > *:nth-child(7) { animation-delay: .24s; }
.stagger > *:nth-child(8) { animation-delay: .28s; } .stagger > *:nth-child(n+9) { animation-delay: .32s; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- boot / loader ---------- */
.boot { min-height: 100vh; display: grid; place-content: center; text-align: center; color: var(--muted); font-family: var(--font-display); }
.boot-paws, .loader-paws { display: flex; gap: 10px; justify-content: center; font-size: 30px; margin-bottom: 10px; }
.boot-paws span, .loader-paws span { animation: pawstep 1.2s infinite; }
.boot-paws span:nth-child(2), .loader-paws span:nth-child(2) { animation-delay: .2s; transform: translateY(-8px); }
.boot-paws span:nth-child(3), .loader-paws span:nth-child(3) { animation-delay: .4s; }
.loader { padding: 60px 20px; text-align: center; color: var(--muted); font-family: var(--font-display); }
.loader-paws { font-size: 24px; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 3px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; display: inline-block; vertical-align: -3px; }
.skeleton { border-radius: 12px; background: linear-gradient(90deg, var(--line) 0, var(--card-2) 50%, var(--line) 100%); background-size: 800px 100%; animation: shimmer 1.3s infinite linear; min-height: 16px; }
