@import url("https://fonts.googleapis.com/css2?family=Anton&family=Space+Mono:wght@400;700&display=swap");

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --dark-bg: #1c1814;
  --dark-fg: #ede8df;
  --dark-muted: #8a7b6e;

  --light-bg: #f0ece3;
  --light-fg: #0d0d14;
  --light-muted: #7e7e88;
  --yellow: #ffcc00;
  --blue: #1a56db;

  --accent-dark: #d4a84b;
  --accent-light: #1a56db;

  --bg: var(--light-bg);
  --fg: var(--light-fg);
  --muted: var(--light-muted);
  --accent: var(--blue);

  --gold: #d4a84b;

    --font-display: "Anton", sans-serif;
  --font-mono: "Space Mono", monospace;


  --hairline: 0.0625rem;
  --card-bg: rgba(240, 236, 227, 0.18);
  --card-border: rgba(26, 86, 219, 0.16);
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-mono);
}

html.is-embedded,
html.is-embedded body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  background:
    radial-gradient(circle at 16% 18%, rgba(26, 86, 219, 0.10), transparent 28%),
    radial-gradient(circle at 84% 14%, rgba(251, 255, 22, 0.08), transparent 30%),
    radial-gradient(circle at 50% 90%, rgba(212, 168, 75, 0.13), transparent 36%),
    linear-gradient(180deg, #f0ece3 0%, #ebe2d5 58%, #e4d8c6 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.34;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(13, 13, 20, 0.035) 0,
      rgba(13, 13, 20, 0.035) 1px,
      transparent 1px,
      transparent 48px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(13, 13, 20, 0.035) 0,
      rgba(13, 13, 20, 0.035) 1px,
      transparent 1px,
      transparent 48px
    );
  mask-image: radial-gradient(circle at 50% 48%, black 0%, transparent 78%);
}

/* PAGE */

.services-page {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  padding: clamp(1.25rem, 2vw, 2rem);
}

/* HEADING */

.services-heading-wrap {
  position: relative;
  z-index: 20;
  width: min(100%, 1400px);
  margin: 0 auto;
  pointer-events: none;
}

.services-heading {
  max-width: 1040px;
}

.services-heading::before {
  content: "";
  display: block;
  width: clamp(3rem, 5vw, 4.5rem);
  height: var(--hairline);
  margin-bottom: 0.7rem;
  background: var(--accent);
}

.services-heading span {
  display: inline-block;
  margin-bottom: 0.85rem;
  font-family: var(--font-mono);
  font-size: clamp(0.56rem, 0.7vw, 0.68rem);
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--accent);
}

.services-heading h1 {
  white-space: nowrap;
  font-family: var(--font-display);
  font-size: clamp(4rem, 8vw, 7.2rem);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  color: var(--fg);
}

.services-heading h1 em {
  font-style: normal;
  color: var(--yellow);
}

.services-heading p {
  margin-top: 1.1rem;
  max-width: 820px;
  font-family: var(--font-mono);
  font-size: clamp(0.88rem, 0.95vw, 0.95rem);
  line-height: 1.7;
  color: color-mix(in srgb, var(--fg) 62%, transparent);
}

/* GALLERY */

.services-gallery {
  position: absolute;
  inset: 0;
  z-index: 5;
  overflow: hidden;
}

.services-cards {
  position: absolute;
  top: 58%;
  left: 50%;
  width: min(24vw, 360px);
  height: min(64vh, 600px);
  transform: translate(-50%, -50%);
  list-style: none;
  perspective: 1200px;
}

/* CARD */

.service-card {
  position: absolute;
  inset: 0;
  overflow: hidden;
  padding: 0;

  display: flex;
  flex-direction: column;

  border: var(--hairline) solid rgba(26, 86, 219, 0.16);
  border-top-color: rgba(255, 255, 255, 0.55);

  background:
    radial-gradient(circle at 18% 16%, rgba(26, 86, 219, 0.12), transparent 34%),
    linear-gradient(
      180deg,
      rgba(240, 236, 227, 0.82),
      rgba(240, 236, 227, 0.48)
    );

  box-shadow:
    0 38px 100px rgba(13, 13, 20, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.58);

  backdrop-filter: blur(14px) saturate(115%);
  -webkit-backdrop-filter: blur(14px) saturate(115%);

  transform-origin: center center;
  will-change: transform, opacity;
}

.service-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.16;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(26, 86, 219, 0.08) 0,
      rgba(26, 86, 219, 0.08) 1px,
      transparent 1px,
      transparent 42px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(26, 86, 219, 0.07) 0,
      rgba(26, 86, 219, 0.07) 1px,
      transparent 1px,
      transparent 42px
    );
}

.service-card::after {
  content: "";
  position: absolute;
  inset: 1rem;
  z-index: 1;
  pointer-events: none;
  border-top: var(--hairline) solid rgba(26, 86, 219, 0.22);
}

/* LOGO BOARD */

.service-logo-board {
  position: relative;
  z-index: 2;
  width: calc(100% - 2rem);
  height: 34%;
  min-height: 132px;
  margin: 1rem auto 0;
  padding: 0.8rem;

  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
  justify-items: center;
  gap: 0.6rem;

  background:
    radial-gradient(circle at 50% 50%, rgba(26, 86, 219, 0.08), transparent 62%),
    rgba(240, 236, 227, 0.28);

  border-bottom: var(--hairline) solid rgba(26, 86, 219, 0.22);
}

.service-logo-board::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(26, 86, 219, 0.08) 0,
      rgba(26, 86, 219, 0.08) 1px,
      transparent 1px,
      transparent 32px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(26, 86, 219, 0.07) 0,
      rgba(26, 86, 219, 0.07) 1px,
      transparent 1px,
      transparent 32px
    );
  opacity: 0.45;
}

.service-logo-board img {
  width: clamp(34px, 3vw, 54px);
  height: clamp(34px, 3vw, 54px);
  object-fit: contain;
  opacity: 0.7;
  filter: grayscale(1) contrast(0.9);
  transition:
    transform 0.25s ease,
    opacity 0.25s ease,
    filter 0.25s ease;
}

.service-card:hover .service-logo-board img {
  opacity: 1;
  filter: grayscale(0);
}

.service-card:hover .service-logo-board img:nth-child(1) {
  transform: translateY(-6px) rotate(-5deg);
}

.service-card:hover .service-logo-board img:nth-child(2) {
  transform: translateY(-10px) scale(1.08);
}

.service-card:hover .service-logo-board img:nth-child(3) {
  transform: translateY(-6px) rotate(5deg);
}

.service-card.dark .service-logo-board {
  border-bottom-color: rgba(212, 168, 75, 0.28);
  background:
    radial-gradient(circle at 50% 50%, rgba(212, 168, 75, 0.10), transparent 58%),
    rgba(28, 24, 20, 0.32);
}

.service-card.dark .service-logo-board::before {
  background:
    repeating-linear-gradient(
      0deg,
      rgba(212, 168, 75, 0.08) 0,
      rgba(212, 168, 75, 0.08) 1px,
      transparent 1px,
      transparent 32px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(212, 168, 75, 0.06) 0,
      rgba(212, 168, 75, 0.06) 1px,
      transparent 1px,
      transparent 32px
    );
}

/* CARD CONTENT */

.service-number {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  z-index: 3;
  font-family: var(--font-display);
  font-size: clamp(3rem, 4.4vw, 4.35rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.02em;
  color: rgba(13, 13, 20, 0.10);
}

.service-tag {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 3;
  width: fit-content;
  padding: 0.34rem 0.72rem;
  border: var(--hairline) solid rgba(26, 86, 219, 0.35);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: clamp(0.5rem, 0.6vw, 0.6rem);
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-light);
  background: rgba(240, 236, 227, 0.72);
  backdrop-filter: blur(6px);
}

.service-card h2,
.service-card p,
.service-card ul {
  position: relative;
  z-index: 2;
  margin-inline: 1.15rem;
}

.service-card h2 {
  margin-top: 0.95rem;
  margin-bottom: 0.55rem;
  font-family: var(--font-display);
  font-size: clamp(2rem, 2.75vw, 2.85rem);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  color: var(--fg);
}

.service-card p {
  max-width: 31ch;
  font-family: var(--font-mono);
  font-size: clamp(0.68rem, 0.78vw, 0.78rem);
  line-height: 1.55;
  color: rgba(13, 13, 20, 0.66);
}

.service-card ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.32rem;
  margin-top: auto;
  margin-bottom: 1rem;
  list-style: none;
}

.service-card li {
  padding: 0.24rem 0.48rem;
  border: var(--hairline) solid rgba(126, 126, 136, 0.25);
  border-radius: 999px;
  font-size: clamp(0.48rem, 0.58vw, 0.58rem);
  letter-spacing: 0.04em;
  color: rgba(13, 13, 20, 0.58);
  background: rgba(240, 236, 227, 0.52);
}

/* VARIANTS */

.service-card.featured {
  background:
    radial-gradient(circle at 18% 14%, rgba(26, 86, 219, 0.14), transparent 34%),
    linear-gradient(
      180deg,
      rgba(240, 236, 227, 0.90),
      rgba(240, 236, 227, 0.54)
    );
  border-color: rgba(26, 86, 219, 0.18);
}

.service-card.accent {
  background:
    radial-gradient(circle at 16% 14%, rgba(26, 86, 219, 0.14), transparent 34%),
    linear-gradient(
      180deg,
      rgba(240, 236, 227, 0.90),
      rgba(240, 236, 227, 0.54)
    );
  border-color: rgba(26, 86, 219, 0.18);
}

.service-card.accent .service-tag {
  color: var(--accent-light);
  border-color: rgba(26, 86, 219, 0.35);
}

.service-card.dark {
  background:
    radial-gradient(circle at 16% 14%, rgba(212, 168, 75, 0.16), transparent 35%),
    linear-gradient(135deg, rgba(28, 24, 20, 0.98), rgba(50, 43, 35, 0.96));
  border-color: rgba(212, 168, 75, 0.26);
  box-shadow:
    0 42px 110px rgba(13, 13, 20, 0.32),
    inset 0 1px 0 rgba(237, 232, 223, 0.12);
}

.service-card.dark::after {
  border-top-color: rgba(212, 168, 75, 0.26);
}

.service-card.dark .service-logo-board {
  background:
    radial-gradient(circle at 50% 50%, rgba(212, 168, 75, 0.10), transparent 62%),
    rgba(28, 24, 20, 0.36);
  border-bottom-color: rgba(212, 168, 75, 0.30);
}

.service-card.dark .service-logo-board img {
  opacity: 0.72;
  filter: grayscale(1) invert(1) contrast(0.85);
}

.service-card.dark:hover .service-logo-board img {
  opacity: 1;
  filter: grayscale(0) invert(0) contrast(1);
}

.service-card.dark .service-number {
  color: rgba(237, 232, 223, 0.10);
}

.service-card.dark .service-tag {
  color: var(--gold);
  border-color: rgba(212, 168, 75, 0.42);
  background: rgba(28, 24, 20, 0.48);
}

.service-card.dark h2 {
  color: var(--dark-fg);
}

.service-card.dark p {
  color: rgba(237, 232, 223, 0.74);
}

.service-card.dark li {
  color: rgba(237, 232, 223, 0.72);
  border-color: rgba(237, 232, 223, 0.16);
  background: rgba(237, 232, 223, 0.06);
}

/* NAV TOP-RIGHT — freccia e contatore per scorrere */
.services-nav-top {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: var(--hairline) solid color-mix(in srgb, var(--accent-light) 30%, transparent);
  border-radius: 999px;
  background: rgba(240, 236, 227, 0.5);
  backdrop-filter: blur(8px);
  cursor: pointer;
  pointer-events: auto;
  transition: background 0.2s ease;
  font-family: var(--font-mono);
}

.services-nav-top:hover {
  background: rgba(240, 236, 227, 0.85);
}

.services-nav-arrow {
  font-size: 1rem;
  line-height: 1;
  color: var(--accent-light);
}

.services-nav-label {
  font-size: clamp(0.56rem, 0.7vw, 0.68rem);
  font-weight: 500;
  letter-spacing: 0.08em;
  color: color-mix(in srgb, var(--fg) 60%, transparent);
}

/* LOW HEIGHT */

@media (max-height: 760px) and (min-width: 901px) {
  .services-cards {
    top: 60%;
    width: min(23vw, 335px);
    height: min(63vh, 535px);
  }

  .service-logo-board {
    height: 31%;
    min-height: 116px;
  }

  .service-card h2 {
    font-size: clamp(1.7rem, 2.45vw, 2.35rem);
    margin-top: 0.75rem;
  }

  .service-card p {
    font-size: clamp(0.58rem, 0.66vw, 0.66rem);
    line-height: 1.42;
  }

  .service-card li {
    font-size: clamp(0.42rem, 0.48vw, 0.48rem);
    padding: 0.18rem 0.34rem;
  }

  .service-number {
    font-size: clamp(2.45rem, 3.7vw, 3.5rem);
  }
}

/* MOBILE / TABLET */

@media (max-width: 900px) {
  html,
  body,
  html.is-embedded,
  html.is-embedded body {
    height: auto;
    min-height: 100%;
    overflow-y: auto;
  }

  .services-page {
    min-height: 100vh;
    height: auto;
    padding: 2rem 1rem;
    overflow: visible;
  }

  .services-heading h1 {
    white-space: normal;
    font-size: clamp(3.2rem, 16vw, 5.5rem);
  }

  .services-heading p {
    font-size: 0.82rem;
  }

  .services-gallery {
    position: relative;
    inset: auto;
    height: auto;
    margin-top: 2rem;
    overflow: visible;
  }

  .services-cards {
    position: relative;
    top: auto;
    left: auto;
    width: 100%;
    height: auto;
    transform: none;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .service-card {
    position: relative;
    min-height: 480px;
    border-radius: 0;
  }

  .service-logo-board {
    height: 170px;
    min-height: 170px;
  }

  .service-card h2 {
    font-size: clamp(2rem, 12vw, 3rem);
  }

  .service-card p {
    max-width: 36ch;
    font-size: clamp(0.66rem, 2.5vw, 0.78rem);
  }

  .service-card li {
    font-size: clamp(0.48rem, 2vw, 0.58rem);
  }

  .services-nav-top {
    display: none;
  }
}

/* HOVER PIÙ PULITO */

.service-card:hover {
  box-shadow:
    0 48px 120px rgba(13, 13, 20, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.60);
}

.service-card:hover .service-logo-board img {
  opacity: 1;
  filter: grayscale(0);
}

.service-card:hover .service-logo-board img:nth-child(1) {
  transform: translateY(-4px) rotate(-3deg);
}

.service-card:hover .service-logo-board img:nth-child(2) {
  transform: translateY(-7px) scale(1.05);
}

.service-card:hover .service-logo-board img:nth-child(3) {
  transform: translateY(-4px) rotate(3deg);
}