@property --ang { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

:root {
  --bg: #ffffff;
  --fg: #0e0e10;
  --muted: rgba(14, 14, 16, 0.5);
  --border: rgba(0, 0, 0, 0.1);
  --pill-bg: #fafbfc;
  --night: #141214;
  --gold: #c9a57c;
  --gold-hi: #f6e7d6;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body { margin: 0; background: var(--bg); }

body {
  color: var(--fg);
  font-family: "Inter", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }

.page {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: max(80px, env(safe-area-inset-top)) 92px max(80px, env(safe-area-inset-bottom));
}

.page > * { animation: enter 700ms var(--ease) both; }
.page > :nth-child(2) { animation-delay: 120ms; }
.page > :nth-child(3) { animation-delay: 200ms; }

/* ── Header ────────────────────────────────────────────── */
.head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 28px;
  align-items: start;
  margin-bottom: 96px;
}

.avatar {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  transition: transform 380ms var(--ease);
}
/* Anello oro animato: stessa luce che gira sulla pillola. */
.avatar::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1.5px;
  border-radius: 50%;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  animation: spin 4s linear infinite;
  pointer-events: none;
}
.avatar:hover { transform: scale(1.03); }
.avatar img { display: block; width: auto; height: 50px; margin-left: 2px; }

.who { padding-top: 4px; }

h1 {
  margin: 0 0 12px;
  font-size: 32px;
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.025em;
}

.pill {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: var(--pill-bg);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.005em;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 2px 0 rgba(15, 15, 15, 0.04), 0 4px 10px rgba(15, 15, 15, 0.06);
  transition: transform 360ms cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 280ms ease, border-color 220ms ease;
}
.pill::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: 2;
  padding: 1.5px;
  border-radius: 10px;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  animation: spin 4s linear infinite;
  pointer-events: none;
}
.pill:hover {
  transform: translateY(-3px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.95) inset, 0 4px 0 rgba(15, 15, 15, 0.06), 0 14px 28px rgba(15, 15, 15, 0.09);
}

.role {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.5;
  letter-spacing: -0.005em;
}

/* ── Booking ───────────────────────────────────────────── */
h2 {
  margin: 0 0 18px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.calendar {
  position: relative;
  height: 78vh;
  min-height: 620px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 40px rgba(15, 15, 15, 0.08);
  overflow: hidden;
}
.calendar iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  opacity: 0;
  transition: opacity 400ms ease;
}
.calendar.is-loaded iframe { opacity: 1; }

.loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  pointer-events: none;
}
.is-loaded .loader,
.is-empty .loader { display: none; }
.loader span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  animation: pulse 900ms ease-in-out infinite;
}
.loader span:nth-child(2) { animation-delay: 120ms; }
.loader span:nth-child(3) { animation-delay: 240ms; }

.calendar.is-empty {
  display: grid;
  place-items: center;
  height: 280px;
  min-height: 0;
  color: var(--muted);
  font-size: 14px;
}

/* Stesso anello oro, stessa velocità, su logo e pillola. */
.avatar::before,
.pill::before {
  background: conic-gradient(from var(--ang), rgba(201, 165, 124, 0.22) 0deg, rgba(201, 165, 124, 0.22) 200deg,
    rgba(201, 165, 124, 0.95) 290deg, var(--gold-hi) 320deg, rgba(201, 165, 124, 0.95) 345deg, rgba(201, 165, 124, 0.22) 360deg);
}

@keyframes spin { to { --ang: 360deg; } }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%, 100% { opacity: 0.25; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1); } }

@media (max-width: 760px) {
  .page { padding: max(48px, env(safe-area-inset-top)) 20px max(40px, env(safe-area-inset-bottom)); }
  .head { gap: 18px; margin-bottom: 52px; }
  .avatar { width: 88px; height: 88px; }
  .avatar img { height: 42px; }
  h1 { font-size: 28px; }
  .calendar { height: 75vh; min-height: 600px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
