/* ==========================================================================
   RARITEX — base.css
   Reset, design token, doppio tema (dark/light), tipografia, utility
   ========================================================================== */

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

/* l'attributo hidden vince sempre, anche su elementi con display esplicito */
[hidden] { display: none !important; }

:root {
  /* Costanti brand (dal logo e dal pattern) */
  --brand-purple: #9f72ac;
  --brand-teal: #74cace;
  --grad-brand: linear-gradient(100deg, var(--brand-purple), var(--brand-teal));
  --grad-brand-soft: linear-gradient(100deg, rgba(159,114,172,.35), rgba(116,202,206,.35));

  --font-display: "Unbounded", "Segoe UI", system-ui, sans-serif;
  --font-body: "Sora", "Segoe UI", system-ui, sans-serif;

  --radius: 16px;
  --radius-sm: 10px;
  --container: 1200px;
  --header-h: 72px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e0c14;
  --surface: #171420;
  --surface-2: #1f1b2c;
  --surface-3: #292338;
  --text: #f2eff7;
  --text-muted: #a89fb8;
  --accent: #c9a6d6;
  --accent-2: #8fe0e4;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --glow-purple: rgba(159, 114, 172, 0.35);
  --glow-teal: rgba(116, 202, 206, 0.28);
  --pattern-opacity: 0.05;
  --header-bg: rgba(14, 12, 20, 0.72);
  --shadow-card: 0 10px 40px -12px rgba(0, 0, 0, 0.6);
  --shadow-pop: 0 24px 70px -18px rgba(0, 0, 0, 0.85);
  --btn-primary-text: #14101c;
  --vetrina: linear-gradient(165deg, #f6f4fa, #dfdce8);
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f6fa;
  --surface: #ffffff;
  --surface-2: #efedf4;
  --surface-3: #e5e2ee;
  --text: #241f2e;
  --text-muted: #5f5870;
  --accent: #7a5187;
  --accent-2: #1f7d85;
  --border: rgba(36, 31, 46, 0.12);
  --border-strong: rgba(36, 31, 46, 0.22);
  --glow-purple: rgba(159, 114, 172, 0.16);
  --glow-teal: rgba(116, 202, 206, 0.18);
  --pattern-opacity: 0.035;
  --header-bg: rgba(247, 246, 250, 0.8);
  --shadow-card: 0 10px 30px -12px rgba(60, 40, 80, 0.18);
  --shadow-pop: 0 24px 70px -18px rgba(60, 40, 80, 0.35);
  --btn-primary-text: #ffffff;
  --vetrina: linear-gradient(165deg, #ffffff, #eceef3);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  transition: background-color 0.35s ease, color 0.35s ease;
  min-height: 100vh;
  overflow-x: hidden;
}

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

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

p { margin: 0 0 1em; }

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection { background: var(--brand-purple); color: #fff; }

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

/* ------- Testo in gradiente brand ------- */
.grad-text {
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
[data-theme="dark"] .grad-text {
  background: linear-gradient(100deg, #c9a6d6, #8fe0e4);
  -webkit-background-clip: text;
  background-clip: text;
}

/* ------- Bottoni ------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: transform 0.18s ease, box-shadow 0.25s ease, background-color 0.25s ease, border-color 0.25s ease;
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--grad-brand);
  color: var(--btn-primary-text);
  box-shadow: 0 6px 24px -8px var(--glow-purple);
}
.btn-primary:hover {
  box-shadow: 0 8px 30px -6px var(--glow-purple), 0 4px 20px -6px var(--glow-teal);
  transform: translateY(-1px);
}

.btn-ghost {
  border-color: var(--border-strong);
  color: var(--text);
  background: transparent;
}
.btn-ghost:hover {
  border-color: var(--brand-teal);
  background: color-mix(in srgb, var(--brand-teal) 10%, transparent);
  transform: translateY(-1px);
}

.btn-lg { padding: 15px 30px; font-size: 1.02rem; }
.btn-block { width: 100%; }

/* ------- Icon button ------- */
.icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.15s ease;
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover { border-color: var(--brand-teal); transform: translateY(-1px); }
.icon-btn:active { transform: scale(0.94); }

/* ------- Utility ------- */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.section { padding: 84px 0; position: relative; }

.section-title {
  font-size: clamp(1.7rem, 3.6vw, 2.6rem);
  font-weight: 700;
  margin-bottom: 12px;
}

.section-sub {
  color: var(--text-muted);
  max-width: 56ch;
  margin-bottom: 28px;
}
