/* Shared colors/fonts/ease/mx come from /tokens.css. Only this
   page's own overrides live here. */
:root {
  --sp: clamp(64px, 12vw, 160px);
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  background: var(--ombra);
  color: var(--luce);
  font-family: var(--text);
  padding-top: 116px;
  -webkit-font-smoothing: antialiased;
}
@media (max-width: 900px) {
  body {
    padding-top: 96px;
  }
}
body.page-leaving {
  animation: page-fade-out 260ms ease forwards;
}
@keyframes page-fade-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}
.wrap {
  max-width: 2200px;
  margin: 0 auto;
  padding: 0 var(--mx);
  width: 100%;
}
.eyebrow {
  font-family: var(--mono);
  font-size: 15px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--oro);
}
.h1 {
  font-family: var(--display-xl);
  /* 60% of the browser's default 2em heading, like every big title */
  font-size: 19.2px;
  text-transform: uppercase;
  overflow-wrap: anywhere;
  hyphens: auto;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.05;
}
.studio-body {
  font-family: var(--text);
  color: var(--cenere);
}

#services {
  background: var(--notte);
  padding: var(--sp) 0;
}
.svc-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--grafite);
  border: 1px solid var(--grafite);
  margin-top: clamp(28px, 4vw, 48px);
}
.svc-tab {
  background: var(--notte);
  color: var(--cenere);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 18px 16px;
  text-align: center;
  cursor: pointer;
  border: 0;
  transition:
    background 200ms var(--ease),
    color 200ms var(--ease);
  line-height: 1.35;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
}
@media (hover: hover) {
  .svc-tab:hover {
    color: var(--luce);
  }
}
.svc-tab.active {
  background: var(--luce);
  color: var(--notte);
}
.svc-panel {
  background: var(--ombra);
  border: 1px solid var(--grafite);
  border-top: 0;
  min-height: 480px;
  padding: clamp(28px, 4vw, 56px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.svc-panel-eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--cenere);
  text-transform: uppercase;
}
.svc-panel-title {
  font-family: var(--display);
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1.1;
  color: var(--luce);
  margin-top: 16px;
  font-weight: 400;
}
.svc-panel-body {
  font-family: var(--text);
  font-size: 16px;
  line-height: 1.6;
  color: var(--cenere);
  margin-top: 20px;
  max-width: 55%;
}
.svc-panel-body a {
  color: var(--luce);
  border-bottom: 1px solid var(--cenere);
}
@media (max-width: 768px) {
  .svc-panel {
    min-height: 320px;
    padding: 24px;
  }
  .svc-panel-body {
    max-width: 100%;
  }
  .svc-tab {
    font-size: 10px;
    padding: 14px 8px;
    min-height: 56px;
    letter-spacing: 0.12em;
    min-width: 0;
  }
}

@media (max-width: 520px) {
  .svc-tabs {
    grid-template-columns: repeat(2, 1fr);
  }
  .svc-tab {
    font-size: 11px;
    letter-spacing: 0.1em;
  }
}

#certifications {
  background: var(--ombra);
  /* svh, vh as the fallback: vh measures the screen with the browser toolbars
     retracted, so on a phone this floor was taller than the visible page and
     forced a scroll past the section even when its content fit. */
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: clamp(64px, 6vw, 120px) 0;
}
.cert-table {
  width: 100%;
  border-collapse: collapse;
}
.cert-table th,
.cert-table td {
  padding: clamp(18px, 1.8vw, 30px) clamp(14px, 1.4vw, 24px);
  vertical-align: top;
  text-align: left;
}
@media (min-width: 768px) {
  .cert-table th,
  .cert-table td {
    padding: clamp(10px, 0.9vw, 18px) clamp(14px, 1.4vw, 24px);
  }
  .cert-table tbody td {
    font-size: clamp(14px, 1.1vw, 17px);
  }
}
.cert-table thead th {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cenere);
  font-weight: 400;
  border-bottom: 1px solid var(--grafite);
  padding-bottom: 18px;
}
.cert-table tbody tr {
  border-bottom: 1px solid rgba(34, 34, 34, 0.6);
  transition:
    background 0.35s ease,
    border-color 0.35s ease;
}
@media (hover: hover) {
  .cert-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.25);
  }
}
@media (hover: hover) {
  .cert-table tbody tr:hover td {
    color: var(--luce);
  }
}
.cert-table tbody td {
  font-family: var(--text);
  font-size: clamp(16px, 1.3vw, 20px);
  line-height: 1.5;
  color: var(--nebbia);
  transition: color 0.35s ease;
}
.cert-table .cert-code {
  font-family: var(--mono);
  font-size: clamp(20px, 1.8vw, 30px);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--luce);
  display: block;
  margin-bottom: 4px;
}
.cert-table .cert-sub {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--cenere);
}
.cert-table .cert-benefit {
  font-family: var(--mono);
  font-size: clamp(15px, 1.2vw, 18px);
  line-height: 1.5;
  color: var(--nebbia);
}
.cert-table .cert-benefit strong {
  color: var(--luce);
  font-weight: 600;
}
@media (max-width: 768px) {
  .cert-table thead {
    display: none;
  }
  .cert-table,
  .cert-table tbody,
  .cert-table tr,
  .cert-table td {
    display: block;
    width: 100%;
  }
  .cert-table tbody tr {
    border: 1px solid var(--grafite);
    margin-bottom: 16px;
    padding: 24px;
    border-radius: 2px;
  }
  @media (hover: hover) {
    .cert-table tbody tr:hover {
      border-color: rgba(255, 255, 255, 0.25);
    }
  }
  .cert-table tbody td {
    border: none;
    padding: 0 0 16px 0;
  }
  .cert-table tbody td:last-child {
    padding-bottom: 0;
  }
  .cert-table tbody td::before {
    display: block;
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--cenere);
    margin-bottom: 6px;
    content: attr(data-label);
  }
}

/* ── TOUCH ─────────────────────────────────────────────────────────
   A tap leaves :hover latched on the element it landed on, so the
   hover styles read as a second "selected" state next to .active. */
@media (hover: none) {
  a,
  button {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
  .svc-tab:hover {
    color: var(--cenere);
  }
  .svc-tab:active {
    color: var(--luce);
  }
  .svc-tab.active:hover {
    color: var(--notte);
  }
  .cert-table tbody tr:hover {
    background: none;
    border-color: var(--grafite);
  }
  .cert-table tbody tr:hover td {
    color: var(--nebbia);
  }
}
@media (max-width: 768px) {
  #certifications {
    min-height: 0;
  }
  .svc-panel {
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  }
}

/*
 * Legibility floor: nothing below 12px on a small screen.
 *
 * These labels are set at 10-11px mono, which reads as a quiet register on a
 * desktop and as unreadable on a phone. 12px is the smallest mono size the
 * site already uses elsewhere, so this borrows a value rather than inventing
 * one. Gated on width rather than pointer: it is a typographic scale, and
 * above 900px a tablet shows the desktop composition and keeps its type.
 */
@media (max-width: 900px) {
  .svc-tab {
    font-size: 12px;
  }
}

/* Big titles are wide capitals: on phones keep them to ~8% of the
   screen width so long words (MONTERIGGIONI, COLLABORAZIONI) still fit. */
@media (max-width: 600px) {
}

/* ── Services: frosted-glass tabs and panel (2026-10-27) ──────────────────
   Glass only reads as glass when there is light behind it, so the section
   gets two soft glows (warm gold, cool blue) for the panels to blur. */
#services {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
#services::before,
#services::after {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(60px);
}
#services::before {
  top: 4%;
  right: -12%;
  width: min(62vw, 900px);
  aspect-ratio: 1;
  background: radial-gradient(circle, rgba(201, 169, 98, 0.26) 0%, rgba(201, 169, 98, 0) 62%);
}
#services::after {
  bottom: -18%;
  left: -14%;
  width: min(52vw, 760px);
  aspect-ratio: 1;
  background: radial-gradient(circle, rgba(110, 140, 255, 0.14) 0%, rgba(110, 140, 255, 0) 62%);
}
.svc-shell {
  display: grid;
  grid-template-columns: minmax(260px, 380px) minmax(0, 1fr);
  gap: clamp(16px, 2vw, 28px);
  margin-top: clamp(28px, 4vw, 48px);
  align-items: stretch;
}
.svc-tabs,
.svc-panel {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.085) 0%, rgba(255, 255, 255, 0.02) 100%);
  border: 1px solid rgba(255, 255, 255, 0.13);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  backdrop-filter: blur(22px) saturate(140%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 30px 80px rgba(0, 0, 0, 0.45);
  border-radius: 24px;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .svc-tabs,
  .svc-panel {
    background: rgba(22, 22, 24, 0.92);
  }
}
.svc-tabs {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  margin-top: 0;
}
.svc-tab {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 16px;
  justify-content: flex-start;
  text-align: left;
  gap: 14px;
  padding: 16px 18px;
  min-height: 0;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--cenere);
  transition:
    background 0.25s var(--ease),
    border-color 0.25s var(--ease),
    color 0.25s var(--ease),
    box-shadow 0.25s var(--ease);
}
.svc-num {
  flex: 0 0 auto;
  min-width: 22px;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.35);
  transition: color 0.25s var(--ease);
}
@media (hover: hover) {
  .svc-tab:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--luce);
  }
}
.svc-tab:focus-visible {
  outline: 2px solid var(--oro);
  outline-offset: 2px;
}
.svc-tab.active {
  background: linear-gradient(135deg, rgba(201, 169, 98, 0.3) 0%, rgba(201, 169, 98, 0.08) 100%);
  border-color: rgba(201, 169, 98, 0.5);
  color: var(--luce);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 10px 28px rgba(201, 169, 98, 0.16);
}
.svc-tab.active .svc-num {
  color: var(--oro);
}
.svc-panel {
  position: relative;
  overflow: hidden;
  min-height: 420px;
  padding: clamp(28px, 4vw, 64px);
  justify-content: flex-end;
}
/* a lit corner, like light falling on the glass */
.svc-panel::before {
  content: "";
  position: absolute;
  top: -30%;
  left: -20%;
  width: 70%;
  aspect-ratio: 1;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0) 60%);
  pointer-events: none;
}
.svc-ghost {
  position: absolute;
  top: clamp(12px, 2vw, 28px);
  right: clamp(16px, 3vw, 40px);
  font-family: var(--display-xl);
  font-size: clamp(110px, 15vw, 220px);
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.14);
  pointer-events: none;
  user-select: none;
}
.svc-panel-eyebrow {
  color: var(--oro);
}
.svc-panel-title {
  position: relative;
  font-size: clamp(28px, 3.4vw, 46px);
  max-width: 16ch;
}
.svc-panel-body {
  position: relative;
  max-width: 58ch;
  font-size: clamp(15px, 1.15vw, 17px);
  color: var(--nebbia);
}
.svc-panel.swap .svc-panel-title,
.svc-panel.swap .svc-panel-body,
.svc-panel.swap .svc-ghost {
  animation: svc-in 0.55s var(--ease) both;
}
.svc-panel.swap .svc-panel-body {
  animation-delay: 0.06s;
}
@keyframes svc-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .svc-panel.swap .svc-panel-title,
  .svc-panel.swap .svc-panel-body,
  .svc-panel.swap .svc-ghost {
    animation: none;
  }
}
/* phones and small tablets: the six services become a row of glass chips
   you swipe sideways, with the panel underneath */
@media (max-width: 900px) {
  .svc-shell {
    grid-template-columns: minmax(0, 1fr);
  }
  .svc-tabs {
    flex-direction: row;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    border-radius: 999px;
    padding: 6px;
    gap: 4px;
  }
  .svc-tabs::-webkit-scrollbar {
    display: none;
  }
  .svc-tab {
    flex: 0 0 auto;
    scroll-snap-align: start;
    white-space: nowrap;
    border-radius: 999px;
    padding: 12px 16px;
    min-height: 44px;
    font-size: 11px;
    letter-spacing: 0.1em;
    gap: 8px;
  }
  .svc-panel {
    min-height: 320px;
    padding: 28px 24px;
    border-radius: 20px;
  }
  .svc-panel-body {
    max-width: 100%;
  }
}

/* ── 2026-10-29: soft panels ──────────────────────────────────────────
   No drawn outlines. Each panel is a blurred plate of light behind the
   content, so its edges fade out instead of ending in a sharp glass line. */
.svc-tabs,
.svc-panel {
  position: relative;
  background: none;
  border: 0;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  isolation: isolate;
}
.svc-panel {
  overflow: visible;
}
.svc-tabs::after,
.svc-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 32px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.075) 0%, rgba(255, 255, 255, 0.025) 100%);
  filter: blur(14px);
  pointer-events: none;
}
.svc-panel::after {
  background:
    radial-gradient(90% 80% at 85% 10%, rgba(201, 169, 98, 0.14), rgba(201, 169, 98, 0) 60%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.025) 100%);
}
.svc-panel::before {
  display: none;
}
.svc-tab {
  border: 0;
  border-radius: 18px;
}
.svc-tab.active {
  border: 0;
  background: linear-gradient(90deg, rgba(201, 169, 98, 0.26) 0%, rgba(201, 169, 98, 0.06) 70%, rgba(201, 169, 98, 0) 100%);
  box-shadow: none;
}
.svc-ghost {
  -webkit-text-stroke: 0;
  color: rgba(255, 255, 255, 0.045);
}
.svc-panel-title {
  max-width: 18ch;
}
/* a short gold line under the title */
.svc-panel-body::before {
  content: "";
  display: block;
  width: 56px;
  height: 2px;
  margin-bottom: 22px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--oro), rgba(201, 169, 98, 0));
}
/* certifications: rows divided by lines that fade at both ends */
.cert-table thead th,
.cert-table tbody tr {
  border-bottom: 0;
}
.cert-table thead tr,
.cert-table tbody tr {
  background-image: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.14) 50%, rgba(255, 255, 255, 0));
  background-size: 100% 1px;
  background-position: bottom;
  background-repeat: no-repeat;
}
@media (max-width: 900px) {
  .svc-tabs::after {
    border-radius: 999px;
    filter: blur(8px);
  }
  .svc-panel::after {
    border-radius: 24px;
    filter: blur(10px);
  }
}
@media (max-width: 768px) {
  .cert-table tbody tr {
    border: 0 !important;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    box-shadow: 0 0 22px 6px rgba(255, 255, 255, 0.02);
  }
}
