/* ============================================================
 * Arkhelix — pagina prodotto Company Hub (/company-hub)
 * Usa i token e i componenti di style.css (carta, inchiostro, azzurro,
 * Fraunces / Inter Tight / JetBrains Mono, .section, .steps, .foot).
 * Qui solo ciò che è proprio della pagina: finestre dell'app, demo,
 * moduli, schema del tenant, telefoni.
 * ============================================================ */

.ch {
  width: 100%;
  position: relative;
  z-index: 2;
  padding-bottom: 2rem;
}

/* ---------- Finestra dell'app (schermata con cornice) ---------- */
.ch-window {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #ebebeb;
  border: 1px solid var(--line-2);
  box-shadow:
    0 1px 2px rgba(13,19,22,0.06),
    0 12px 28px rgba(13,19,22,0.08),
    0 40px 80px -20px rgba(13,19,22,0.18);
}
.ch-window img {
  display: block;
  width: 100%;
  height: auto;
}
.ch-window-dark { background: #0a0a0a; border-color: rgba(13,19,22,0.4); }

/* ---------- Apertura ---------- */
.ch-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: clamp(2.5rem, 8vh, 5rem) 0 0;
  max-width: 1180px;
  margin: 0 auto;
}
.ch-eyebrow {
  font-family: var(--ff-mono);
  font-size: 0.7rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--azure);
  margin-bottom: 1.1rem;
  opacity: 0;
  animation: fadeUp 0.7s 0.1s forwards cubic-bezier(0.2, 0.7, 0.2, 1);
}
.ch-title {
  font-family: var(--ff-display);
  font-weight: 300;
  font-size: clamp(2.3rem, 5.6vw, 4.4rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
  color: var(--ink-900);
  margin-bottom: 1.4rem;
}
.ch-title .reveal { display: block; overflow: hidden; padding: 0.06em 0; }
.ch-title .reveal > span {
  display: block;
  transform: translateY(110%);
  animation: revealUp 0.95s forwards cubic-bezier(0.2, 0.85, 0.2, 1);
}
.ch-title .reveal:nth-of-type(1) > span { animation-delay: 0.25s; }
.ch-title .reveal:nth-of-type(2) > span { animation-delay: 0.4s; }
.ch-title em { font-style: italic; font-weight: 400; color: var(--azure); }
.ch-lede {
  max-width: 44rem;
  color: var(--ink-500);
  font-size: clamp(1rem, 1.4vw, 1.12rem);
  line-height: 1.65;
  opacity: 0;
  animation: fadeUp 0.8s 0.7s forwards cubic-bezier(0.2, 0.7, 0.2, 1);
}
.ch-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.8rem;
  opacity: 0;
  animation: fadeUp 0.8s 0.85s forwards cubic-bezier(0.2, 0.7, 0.2, 1);
}
.ch-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--ff-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.95rem 1.5rem;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  color: var(--ink-900);
  background: var(--paper-100);
  transition: background 0.3s, color 0.3s, border-color 0.3s, transform 0.3s;
}
.ch-btn:hover { border-color: var(--ink-700); transform: translateY(-1px); }
.ch-btn-primary { background: var(--ink-900); color: var(--paper-100); border-color: var(--ink-900); }
.ch-btn-primary:hover { background: var(--azure); border-color: var(--azure); color: #fff; }
.ch-note {
  margin-top: 1.1rem;
  font-family: var(--ff-mono);
  font-size: 0.64rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-300);
  opacity: 0;
  animation: fadeIn 0.8s 1s forwards;
}

/* Due finestre sovrapposte, la davanti si raddrizza scorrendo */
.ch-stage {
  position: relative;
  width: 100%;
  max-width: 1100px;
  margin-top: clamp(2.5rem, 6vh, 4rem);
  padding: 0 0 6% 0;
  perspective: 1800px;
  opacity: 0;
  animation: fadeUp 1.1s 0.95s forwards cubic-bezier(0.2, 0.7, 0.2, 1);
}
.ch-window-front {
  position: relative;
  z-index: 2;
  width: 88%;
  margin: 0 auto;
  transform-origin: 50% 100%;
  transform: rotateX(var(--tilt, 10deg)) scale(var(--scala, 0.96));
  transition: transform 0.12s linear;
  will-change: transform;
}
.ch-phone.ch-stage-phone {
  position: absolute;
  justify-self: auto;
  z-index: 3;
  right: 0;
  bottom: 0;
  width: 17%;
  max-width: 200px;
  transform: rotate(3deg);
  animation: ch-flotta 7s ease-in-out infinite;
}
@keyframes ch-flotta {
  0%, 100% { transform: rotate(3deg) translateY(0); }
  50%      { transform: rotate(3deg) translateY(-10px); }
}
.ch-stage::after {
  content: "";
  position: absolute;
  left: 10%; right: 10%; bottom: 2%;
  height: 40px;
  background: radial-gradient(ellipse at center, rgba(43,108,176,0.18), transparent 70%);
  filter: blur(20px);
  z-index: 0;
}
@media (max-width: 720px) {
  .ch-window-front { width: 100%; }
  .ch-phone.ch-stage-phone { width: 26%; right: -2%; bottom: -4%; padding: 5px; border-radius: 20px; }
}
.ch .section-title { max-width: 52rem; }

/* ---------- Striscia «dove vive» ---------- */
.ch-strip {
  max-width: 1080px;
  margin: clamp(2.5rem, 6vh, 4rem) auto 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper-200);
  overflow: hidden;
}
@media (min-width: 900px) { .ch-strip { grid-template-columns: repeat(4, 1fr); } }
.ch-strip-item {
  padding: 1.3rem 1.25rem 1.2rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  text-align: left;
}
.ch-strip-k {
  font-family: var(--ff-display);
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--ink-900);
}
.ch-strip-v { font-size: 0.84rem; line-height: 1.45; color: var(--ink-500); }

/* ---------- Dimostrazione ---------- */
.ch-demo { width: 100%; }
.ch-demo-tabs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  margin-bottom: 1.1rem;
}
@media (min-width: 820px) { .ch-demo-tabs { grid-template-columns: repeat(3, 1fr); } }
.ch-demo-tab {
  font: inherit;
  font-size: 0.86rem;
  text-align: left;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--paper-100);
  color: var(--ink-500);
  cursor: pointer;
  transition: border-color 0.3s, color 0.3s, background 0.3s;
}
.ch-demo-tab:hover { border-color: var(--line-2); color: var(--ink-900); }
.ch-demo-tab.is-active { border-color: var(--ink-900); color: var(--ink-900); background: var(--paper-200); }
.ch-demo-tab-n {
  font-family: var(--ff-mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  color: var(--azure);
  margin-right: 0.4rem;
}
.ch-demo-screen {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #ebebeb;
  border: 1px solid var(--line-2);
  box-shadow: 0 12px 28px rgba(13,19,22,0.08), 0 40px 80px -24px rgba(13,19,22,0.2);
  aspect-ratio: 1280 / 800;
}
.ch-demo-frames { position: absolute; inset: 0; }
.ch-demo-frames img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.55s ease;
}
.ch-demo-frames img.is-on { opacity: 1; }
.ch-demo-focus {
  position: absolute;
  border-radius: 8px;
  box-shadow: 0 0 0 2px var(--azure), 0 0 0 8px rgba(43,108,176,0.18);
  opacity: 0;
  transition: opacity 0.35s ease, left 0.6s cubic-bezier(0.3, 0.7, 0.2, 1), top 0.6s cubic-bezier(0.3, 0.7, 0.2, 1), width 0.6s, height 0.6s;
  pointer-events: none;
}
.ch-demo-focus.is-on { opacity: 1; }
.ch-demo-cursor {
  position: absolute;
  width: clamp(18px, 2.2vw, 26px);
  height: clamp(18px, 2.2vw, 26px);
  left: 60%;
  top: 60%;
  pointer-events: none;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.35));
  transition: left 0.9s cubic-bezier(0.45, 0, 0.2, 1), top 0.9s cubic-bezier(0.45, 0, 0.2, 1), transform 0.15s;
  z-index: 3;
}
.ch-demo-cursor path { fill: #111; stroke: #fff; stroke-width: 1.5; stroke-linejoin: round; }
.ch-demo-cursor.is-press { transform: scale(0.82); }
.ch-demo-ripple {
  position: absolute;
  width: 44px; height: 44px;
  margin: -22px 0 0 -22px;
  border-radius: 50%;
  border: 2px solid var(--azure);
  opacity: 0;
  pointer-events: none;
  z-index: 2;
}
.ch-demo-ripple.is-on { animation: ch-ripple 0.6s ease-out; }
@keyframes ch-ripple {
  from { opacity: 0.9; transform: scale(0.3); }
  to   { opacity: 0;   transform: scale(1.4); }
}
.ch-demo-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
}
.ch-demo-ctl {
  flex-shrink: 0;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: var(--paper-100);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.3s, background 0.3s;
}
.ch-demo-ctl:hover { border-color: var(--ink-700); }
.ch-demo-ctl svg { width: 16px; height: 16px; fill: none; stroke: var(--ink-900); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ch-demo-ctl [data-icona-play] path { fill: var(--ink-900); stroke: none; }
.ch-demo-caption {
  flex: 1;
  min-width: 0;
  margin-left: 0.5rem;
  text-align: left;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--ink-700);
}
.ch-demo-step {
  flex-shrink: 0;
  font-family: var(--ff-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: var(--ink-300);
}
.ch-demo-progress {
  display: flex;
  gap: 4px;
  margin-top: 0.9rem;
}
.ch-demo-progress span {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: var(--line-2);
  overflow: hidden;
  position: relative;
}
.ch-demo-progress span::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--azure);
  transform: scaleX(0);
  transform-origin: left;
}
.ch-demo-progress span.is-done::after { transform: scaleX(1); }
.ch-demo-progress span.is-now::after { animation: ch-fill var(--durata, 4s) linear forwards; }
.ch-demo.is-paused .ch-demo-progress span.is-now::after { animation-play-state: paused; }
@keyframes ch-fill { to { transform: scaleX(1); } }
@media (max-width: 600px) {
  .ch-demo-bar { flex-wrap: wrap; }
  .ch-demo-caption { order: 5; flex-basis: 100%; margin: 0.4rem 0 0; font-size: 0.9rem; }
  .ch-demo-step { margin-left: auto; }
}

/* ---------- Moduli ---------- */
.ch-feature {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: center;
  margin-bottom: clamp(3rem, 8vh, 5.5rem);
  text-align: left;
}
@media (min-width: 960px) {
  .ch-feature { grid-template-columns: 5fr 7fr; gap: 3rem; }
  .ch-feature-rev { grid-template-columns: 7fr 5fr; }
  .ch-feature-rev .ch-feature-text { order: 2; }
}
.ch-feature-num {
  display: block;
  font-family: var(--ff-mono);
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--azure);
  margin-bottom: 0.8rem;
}
.ch-feature-title {
  font-family: var(--ff-display);
  font-weight: 400;
  font-size: clamp(1.45rem, 2.4vw, 1.9rem);
  line-height: 1.18;
  letter-spacing: -0.015em;
  color: var(--ink-900);
  margin-bottom: 0.9rem;
}
.ch-feature-text p { color: var(--ink-500); font-size: 0.96rem; line-height: 1.65; }
.ch-list {
  list-style: none;
  margin-top: 1.1rem;
  display: grid;
  gap: 0.55rem;
}
.ch-list li {
  position: relative;
  padding-left: 1.4rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--ink-700);
}
.ch-list li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.62em;
  width: 0.7rem; height: 1px;
  background: var(--azure);
}

.ch-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  text-align: left;
}
@media (min-width: 760px) { .ch-grid { grid-template-columns: repeat(3, 1fr); } }
.ch-card, .ch-mode {
  padding: 1.1rem 1.1rem 1.4rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper-200);
  text-align: left;
}
.ch-card-shot { margin: 0 0 1.2rem; border-radius: 10px; }
.ch-card .ch-feature-num, .ch-mode .ch-feature-num { margin-bottom: 0.5rem; }
.ch-card-title {
  font-family: var(--ff-display);
  font-weight: 500;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
  color: var(--ink-900);
  margin-bottom: 0.45rem;
}
.ch-card p, .ch-mode p { color: var(--ink-500); font-size: 0.88rem; line-height: 1.55; }

/* ---------- Dati nel tenant ---------- */
.ch-tenant {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  align-items: center;
  text-align: left;
}
@media (min-width: 960px) { .ch-tenant { grid-template-columns: 1fr 1fr; gap: 3.5rem; } }
.ch-diagram svg { width: 100%; height: auto; display: block; }
.ch-diagram .d-tenant { fill: var(--paper-200); stroke: var(--line-2); stroke-dasharray: 5 6; }
.ch-diagram .d-label { font-family: var(--ff-mono); font-size: 11px; letter-spacing: 0.18em; fill: var(--azure); }
.ch-diagram .d-node { fill: var(--paper-100); stroke: var(--line-2); }
.ch-diagram .d-name { font-family: var(--ff-display); font-size: 18px; fill: var(--ink-900); }
.ch-diagram .d-sub { font-family: var(--ff-body); font-size: 12px; fill: var(--ink-400); }
.ch-diagram .d-link { fill: none; stroke: var(--azure); stroke-width: 1.4; stroke-dasharray: 4 5; opacity: 0.7; animation: ch-flow 1.6s linear infinite; }
.ch-diagram .d-core { fill: var(--ink-900); }
.ch-diagram .d-core-t { font-family: var(--ff-body); font-size: 15px; font-weight: 500; fill: var(--paper-100); }
.ch-diagram .d-out { font-family: var(--ff-mono); font-size: 10.5px; letter-spacing: 0.08em; fill: var(--ink-400); }
@keyframes ch-flow { to { stroke-dashoffset: -18; } }
.ch-points { display: grid; gap: 1.2rem; }
.ch-point {
  display: grid;
  gap: 0.3rem;
  padding-left: 1.1rem;
  border-left: 2px solid var(--azure-soft);
  transition: border-color 0.4s;
}
.ch-point:hover { border-left-color: var(--azure); }
.ch-point strong { font-family: var(--ff-display); font-weight: 500; font-size: 1.08rem; color: var(--ink-900); }
.ch-point span { font-size: 0.9rem; line-height: 1.55; color: var(--ink-500); }
.ch-fine { font-size: 0.78rem; color: var(--ink-300); }

/* ---------- Due modi ---------- */
.ch-modes {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}
@media (min-width: 860px) { .ch-modes { grid-template-columns: 1fr 1fr; } }
.ch-mode { padding: 1.6rem 1.5rem 1.5rem; display: flex; flex-direction: column; }
.ch-mode p { margin-bottom: 1.3rem; flex-grow: 1; }
.ch-mode .ch-card-shot { margin: 0; }

/* ---------- Schermi ---------- */
.ch-screens {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  align-items: end;
}
.ch-screens-wide { grid-column: 1 / -1; }
@media (min-width: 900px) {
  .ch-screens { grid-template-columns: 6fr 1.6fr 1.6fr; }
  .ch-screens-wide { grid-column: auto; }
}
.ch-phone {
  position: relative;
  border-radius: 34px;
  padding: 9px;
  background: var(--ink-900);
  box-shadow: 0 30px 60px -20px rgba(13,19,22,0.35), inset 0 0 0 1px rgba(255,255,255,0.08);
  max-width: 240px;
  justify-self: center;
}
.ch-phone img { display: block; width: 100%; height: auto; border-radius: 26px; border-top: 30px solid #fafafa; background: #fafafa; }
.ch-phone.ch-stage-phone img { border-top-width: 22px; }
.ch-phone::before {
  content: "";
  position: absolute;
  top: 16px; left: 50%;
  width: 26%; height: 14px;
  margin-left: -13%;
  border-radius: 10px;
  background: var(--ink-900);
  z-index: 1;
}

/* ---------- Chiusura ---------- */
.ch-cta {
  max-width: 1080px;
  margin: clamp(4rem, 10vh, 6rem) auto 0;
  padding: clamp(2.5rem, 6vh, 4rem) 1.5rem;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    radial-gradient(ellipse 60% 80% at 50% 0%, rgba(43,108,176,0.07), transparent 70%),
    var(--paper-200);
}
.ch-cta .ch-actions { opacity: 1; animation: none; }
.ch-cta-title {
  font-family: var(--ff-display);
  font-weight: 300;
  font-size: clamp(1.8rem, 3.6vw, 2.8rem);
  letter-spacing: -0.02em;
  color: var(--ink-900);
}
.ch-cta-title em { font-style: italic; font-weight: 400; color: var(--azure); }
.ch-cta-text { margin-top: 0.7rem; color: var(--ink-500); }
.ch-legal {
  margin: 2.2rem auto 0;
  max-width: 44rem;
  font-size: 0.72rem;
  line-height: 1.6;
  color: var(--ink-300);
}

/* ---------- Comparsa allo scorrimento ---------- */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.js [data-reveal].is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] { opacity: 1; transform: none; }
  .ch-window-front { transform: none; }
  .ch-diagram .d-link { animation: none; }
  .ch-title .reveal > span { transform: none; }
  .ch-stage-phone { animation: none; }
}

/* ---------- Home: sezione del prodotto ---------- */
.home-product {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: center;
  text-align: left;
  padding: clamp(1.5rem, 3vw, 2.2rem);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper-200);
}
@media (min-width: 900px) { .home-product { grid-template-columns: 5fr 6fr; gap: 2.5rem; } }
.home-product-title {
  font-family: var(--ff-display);
  font-weight: 400;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--ink-900);
  margin-bottom: 0.8rem;
}
.home-product-title em { font-style: italic; color: var(--azure); }
.home-product p { color: var(--ink-500); font-size: 0.95rem; line-height: 1.6; }
.home-product .ch-actions { justify-content: flex-start; opacity: 1; animation: none; }
.home-product .ch-window { display: block; border-radius: 12px; transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1); }
.home-product .ch-window:hover { transform: translateY(-4px); }

/* ---------- Ingrandimento ---------- */
.ch-zoomabile { cursor: zoom-in; }
.ch-zoomabile:focus-visible { outline: 2px solid var(--azure); outline-offset: 4px; }
.ch-zoom {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(0.75rem, 3vw, 2.5rem);
  background: rgba(13,19,22,0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.25s ease;
  cursor: zoom-out;
}
.ch-zoom[hidden] { display: none; }
.ch-zoom.is-on { opacity: 1; }
.ch-zoom img {
  max-width: min(100%, 1920px);
  max-height: 100%;
  width: auto;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
  transform: scale(0.97);
  transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1);
  cursor: default;
}
.ch-zoom.is-on img { transform: none; }
.ch-zoom img.is-telefono { border-radius: 22px; }
.ch-zoom-chiudi {
  position: absolute;
  top: 14px; right: 16px;
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}
.ch-bloccato, .ch-bloccato body { overflow: hidden; }
@media (max-width: 720px) {
  /* Sul telefono la schermata intera si legge ruotandola: la si mostra a tutta larghezza e si scorre */
  .ch-zoom { align-items: flex-start; overflow: auto; }
}

/* ---------- Riga per i fornitori IT ---------- */
.ch-partner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 1rem;
  margin-top: 1.5rem;
  padding: 0.95rem 1.25rem;
  border: 1px dashed var(--line-2);
  border-radius: 12px;
  font-size: 0.9rem;
  color: var(--ink-500);
  text-align: center;
}
.ch-partner-k {
  font-family: var(--ff-mono);
  font-size: 0.64rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--azure);
}
.ch-partner a { color: var(--ink-900); border-bottom: 1px solid var(--line-2); transition: color 0.3s, border-color 0.3s; }
.ch-partner a:hover { color: var(--azure); border-color: var(--azure); }
