/*
  ═══════════════════════════════════════════════════
  DESIGN SYSTEM — Dott.ssa Mariella Casa
  ═══════════════════════════════════════════════════

  COLORS
  ──────
  Primary:       #22b8cf   (teal)
  Primary dark:  #1098ad
  Primary light: #e0f7fa
  Surface:       #f0fbfd
  Background:    #ffffff
  Text:          #2d3748   (warm slate)
  Muted:         #718096
  Footer bg:     #1a3c47   (deep teal)
  Footer text:   #cce9ef

  SPACING  (rem)
  ──────────────
  0.4 / 0.8 / 1.2 / 1.6 / 2.4 / 3.2 / 4.8 / 6.4 / 8.0 / 9.6 / 12.8

  FONT SIZES  (rem)
  ──────────────────
  1.2 / 1.4 / 1.6 / 1.8 / 2.0 / 2.4 / 3.2 / 4.0 / 5.2
  ═══════════════════════════════════════════════════
*/

/* ─── Custom Properties ──────────────────────────── */
:root {
  --clr-primary:      #22b8cf;
  --clr-primary-dk:   #0d9db8;
  --clr-primary-lt:   #cff5fb;
  --clr-primary-xlt:  #e8fafd;
  --clr-accent:       #0891b2;
  --clr-surface:      #f2fbfd;
  --clr-surface-2:    #e4f7fc;
  --clr-bg:           #ffffff;
  --clr-text:         #1e3a44;
  --clr-muted:        #5a7a85;
  --clr-footer-bg:    #0f2a35;
  --clr-footer-text:  #b8dde8;
  --clr-footer-muted: #7eb5c5;

  --radius-sm:   10px;
  --radius-md:   18px;
  --radius-lg:   28px;
  --radius-xl:   40px;
  --radius-full: 9999px;

  --shadow-sm:   0 1px 6px rgba(0,0,0,.05);
  --shadow-md:   0 4px 20px rgba(0,0,0,.08);
  --shadow-lg:   0 12px 40px rgba(0,0,0,.11);
  --shadow-card: 0 2px 16px rgba(var(--clr-primary-rgb),.09);
  --shadow-card-hover: 0 16px 48px rgba(var(--clr-primary-rgb),.18);

  --transition:      0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);

  --clr-primary-rgb: 34, 184, 207;
  --clr-star:  #f5b731;
  --clr-error: #e53e3e;

  --font: 'Josefin Sans', system-ui, -apple-system, sans-serif;
  --container-max: 120rem;
  --header-h: 8rem;
}

/* ─── Reset ──────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden] { display: none !important; }

html {
  font-size: 10px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  font-size: 1.6rem;
  line-height: 1.6;
  color: var(--clr-text);
  background: var(--clr-bg);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a {
  text-decoration: none;
  color: inherit;
}

ul, ol { list-style: none; }

h1, h2, h3, h4, h5, h6 { line-height: 1.2; }

button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  background: none;
}

address { font-style: normal; }

section { scroll-margin-top: var(--header-h); }

/* ─── Focus visible (global) ─────────────────────── */
:focus-visible {
  outline: 2px solid var(--clr-primary);
  outline-offset: 3px;
}

/* ─── Skip link ──────────────────────────────────── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1.6rem;
  background: var(--clr-primary);
  color: #fff;
  padding: 0.8rem 1.6rem;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-size: 1.6rem;
  z-index: 9999;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 0;
}

/* ─── Container ──────────────────────────────────── */
.container {
  width: min(var(--container-max), 100% - 4.8rem);
  margin-inline: auto;
}

/* ─── Section labels & titles ────────────────────── */
.section-label {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--clr-primary-dk);
  margin-bottom: 1.2rem;
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
}

.section-label::before {
  content: '';
  display: inline-block;
  width: 2.4rem;
  height: 2px;
  background: var(--clr-primary);
  border-radius: 2px;
  flex-shrink: 0;
}

.section-label--right {
  text-align: right;
  flex-direction: row-reverse;
  display: flex;
  justify-content: flex-end;
}

.section-title {
  font-size: clamp(3rem, 4vw, 4.6rem);
  font-weight: 300;
  color: var(--clr-text);
  margin-bottom: 4.8rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.section-title strong {
  font-weight: 500;
  color: var(--clr-primary-dk);
}

.section-title--right { text-align: right; }

/* ─── Buttons ────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 1.3rem 3rem;
  border-radius: var(--radius-full);
  font-size: 1.7rem;
  font-family: var(--font);
  font-weight: 400;
  letter-spacing: 0.02em;
  transition: background var(--transition), color var(--transition),
              border-color var(--transition), transform var(--transition),
              box-shadow var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.btn--primary {
  background: linear-gradient(135deg, var(--clr-primary) 0%, var(--clr-primary-dk) 100%);
  color: #fff;
  border: 2px solid transparent;
  box-shadow: 0 4px 20px rgba(var(--clr-primary-rgb), .35);
}

.btn--primary:hover {
  background: linear-gradient(135deg, var(--clr-primary-dk) 0%, var(--clr-accent) 100%);
  box-shadow: 0 8px 28px rgba(var(--clr-primary-rgb), .45);
  transform: translateY(-3px);
}

.btn--outline {
  background: transparent;
  color: var(--clr-primary-dk);
  border: 2px solid var(--clr-primary);
}

.btn--outline:hover {
  background: var(--clr-primary);
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(var(--clr-primary-rgb), .3);
}

/* ─── Scroll-triggered animations ───────────────── */
[data-animate] {
  opacity: 0;
  transform: translateY(2.8rem);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-animate].animate--visible {
  opacity: 1;
  transform: none;
}

/* Hero entry animations */
.animate-fade-up   { animation: fadeUp 0.9s cubic-bezier(0.4, 0, 0.2, 1) both; }
.animate-fade-left { animation: fadeLeft 1s cubic-bezier(0.4, 0, 0.2, 1) both; }
.animate-delay-1   { animation-delay: 0.1s; }
.animate-delay-2   { animation-delay: 0.24s; }
.animate-delay-3   { animation-delay: 0.4s; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(3.6rem); }
  to   { opacity: 1; transform: none; }
}

@keyframes fadeLeft {
  from { opacity: 0; transform: translateX(5rem) scale(0.97); }
  to   { opacity: 1; transform: none; }
}

@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}

@keyframes rotateSlow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes pulseRing {
  0%   { transform: scale(0.8); opacity: 0.8; }
  70%  { transform: scale(1.4); opacity: 0; }
  100% { transform: scale(1.4); opacity: 0; }
}

/* Disable CSS transitions on [data-animate] when GSAP is active */
.gsap-active [data-animate] {
  transition: none;
}

/* Respect motion preferences */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
  [data-animate] { opacity: 1; transform: none; }
}
