/* ============================================================
   ARKADIA STUDIOS — Ecosystem CD V1
   ecosystem-cdv1.css
   ============================================================ */

:root {
  --bg: #000000;
  --fg: #ffffff;
  --fg-dim: #bbbbbb;
  --fg-faint: #6a6a6a;

  --c-prod: #9C0404;
  --c-post: #00A8FF;
  --c-rent: #E8640A;
  --c-serv: #E8C30A;
  --c-lab:  #00C896;

  --font-display: "Bebas Neue", "Arial Narrow", Impact, sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
}

/* background/color only — no overflow-x:hidden (breaks position:fixed su Safari) */
html, body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

/* ---------- viewport switch ---------- */
/* Layout statico mobile sempre nascosto — 3D attivo su tutti gli schermi */
.ecosystem-mobile { display: none; }

/* @media (max-width: 1024px) {
  .ecosystem-desktop { display: none; }
  .ecosystem-mobile { display: block; }
} */

/* ============================================================
   DESKTOP SHELL
   ============================================================ */

.ecosystem-desktop {
  position: relative;
  width: 100%;
}

/* ---------- WebGL stage ---------- */
#scene-stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: #000;
  pointer-events: none;
}
#scene-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* vignette + grain overlays sit on top of WebGL */
.vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center,
      rgba(0,0,0,0) 30%,
      rgba(0,0,0,0.55) 80%,
      rgba(0,0,0,0.9) 100%);
  mix-blend-mode: multiply;
}
.grain {
  position: absolute;
  inset: -50%;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='matrix' values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 1.2 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain-shift 1.2s steps(6) infinite;
}
@keyframes grain-shift {
  0%   { transform: translate(0,0); }
  20%  { transform: translate(-3%, 2%); }
  40%  { transform: translate(2%, -3%); }
  60%  { transform: translate(-2%, -1%); }
  80%  { transform: translate(3%, 2%); }
  100% { transform: translate(0,0); }
}

/* ============================================================
   SCROLL STACK — 7 sections, each 100vh
   ============================================================ */

.scroll-stack {
  position: relative;
  z-index: 10;
}

.scene-section {
  position: relative;
  height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  pointer-events: none;
}
.scene-section > * { pointer-events: auto; }

/* ---------- intro ---------- */
.scene-intro {
  justify-content: flex-start;
  padding: 0 60px;
}

.intro-block {
  position: relative;
  width: 720px;
  max-width: 50vw;
  padding: 64px 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 28px;
  --c: #9C0404;
  --c-rgb: 156 4 4;
  border-radius: 28px;
  border: 1px solid rgba(255,255,255,0.07);
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%,
      rgba(255,255,255,0.05) 0%, transparent 70%),
    radial-gradient(ellipse 60% 90% at 50% 110%,
      rgb(var(--c-rgb) / 0.12) 0%, transparent 60%),
    linear-gradient(180deg,
      rgba(16,14,20,0.86) 0%,
      rgba(8, 7, 12,0.94) 100%);
  box-shadow:
    0 40px 90px rgba(0,0,0,0.65),
    inset 0 1px 0 rgba(255,255,255,0.06);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  isolation: isolate;
}

/* hairline accents */
.intro-block::before {
  content: "";
  position: absolute;
  left: 22%; right: 22%; top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--c), transparent);
  opacity: 0.75;
}
.intro-block::after {
  content: "";
  position: absolute;
  left: 22%; right: 22%; bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--c), transparent);
  opacity: 0.75;
}

/* unified small eyebrow style shared by intro / pillars / finale */
.panel-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #d6d6d6;
}
.panel-eyebrow .dash {
  color: #6a6a6a;
  font-family: var(--font-body);
  letter-spacing: 0;
}

.intro-title {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 0.92;
  letter-spacing: -0.005em;
}
.intro-title .line {
  display: block;
  font-size: clamp(48px, 6.4vw, 92px);
}
.intro-title .line-2 {
  color: var(--c-prod);
}

.intro-tag {
  font-size: 17px;
  color: #d6d6d6;
  letter-spacing: 0.01em;
  max-width: 540px;
}

.intro-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 60px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.scroll-hint {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--fg-dim);
  text-transform: uppercase;
  animation: cdv1-pulse 2.4s ease-in-out infinite;
}
.scroll-hint-arrow {
  width: 12px; height: 16px;
  position: relative;
}
.scroll-hint-arrow::before,
.scroll-hint-arrow::after {
  content: "";
  position: absolute;
  background: currentColor;
}
.scroll-hint-arrow::before {
  left: 50%; top: 0;
  width: 1px; height: 12px;
  transform: translateX(-50%);
}
.scroll-hint-arrow::after {
  left: 50%; bottom: 0;
  width: 8px; height: 8px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: translate(-50%, 4px) rotate(45deg);
  background: transparent;
}
@keyframes cdv1-pulse {
  0%, 100% { opacity: 0.45; }
  50%      { opacity: 1; }
}

.intro-stats {
  display: flex;
  gap: 36px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-faint);
}
.intro-stats > div {
  display: flex; flex-direction: column; gap: 6px;
  line-height: 1;
}
.intro-stats span {
  font-family: var(--font-display);
  font-size: 36px;
  color: var(--fg);
  letter-spacing: 0;
}

/* ---------- pillar panels — premium card material ---------- */
.scene-pillar { padding: 0 60px; }

.panel {
  position: relative;
  width: 520px;
  max-width: 42vw;
  padding: 64px 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 700ms cubic-bezier(.2,.7,.2,1),
              transform 700ms cubic-bezier(.2,.7,.2,1);
  --c: #ffffff;
  --c-rgb: 255 255 255;
  border-radius: 28px;
  border: 1px solid rgba(255,255,255,0.07);
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%,
      rgba(255,255,255,0.05) 0%, transparent 70%),
    radial-gradient(ellipse 60% 90% at 50% 110%,
      rgb(var(--c-rgb) / 0.12) 0%, transparent 60%),
    linear-gradient(180deg,
      rgba(16,14,20,0.86) 0%,
      rgba(8, 7, 12,0.94) 100%);
  box-shadow:
    0 40px 90px rgba(0,0,0,0.65),
    inset 0 1px 0 rgba(255,255,255,0.06);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  isolation: isolate;
}

.scene-pillar.is-active .panel {
  opacity: 1;
  transform: translateY(0);
}

.panel-left  { margin-right: auto; margin-left: 0; }
.panel-right { margin-left: auto;  margin-right: 0; }

/* top + bottom hairlines in the node color */
.panel::before {
  content: "";
  position: absolute;
  left: 22%; right: 22%; top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--c), transparent);
  opacity: 0.75;
}
.panel::after {
  content: "";
  position: absolute;
  left: 22%; right: 22%; bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--c), transparent);
  opacity: 0.75;
}

.panel-claim {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(40px, 3.8vw, 60px);
  line-height: 0.98;
  letter-spacing: 0.005em;
  color: #ffffff;
}

.panel-body {
  font-size: 15px;
  line-height: 1.7;
  color: #c8c8c8;
  max-width: 440px;
}

.panel-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--c);
  width: fit-content;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--c);
  transition: gap 200ms ease;
}
.panel-cta:hover { gap: 16px; }
.panel-cta .cta-arrow { transition: transform 200ms ease; }
.panel-cta:hover .cta-arrow { transform: translateX(4px); }

/* ---------- finale ---------- */
.scene-finale {
  justify-content: center;
  padding: 0 28px;
}
.finale-block {
  position: relative;
  max-width: 720px;
  width: 100%;
  padding: 72px 64px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  --c: #9C0404;
  --c-rgb: 156 4 4;
  border-radius: 28px;
  border: 1px solid rgba(255,255,255,0.07);
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%,
      rgba(255,255,255,0.05) 0%, transparent 70%),
    radial-gradient(ellipse 60% 90% at 50% 110%,
      rgba(156,4,4,0.10) 0%, transparent 60%),
    linear-gradient(180deg,
      rgba(16,14,20,0.86) 0%,
      rgba(8, 7, 12,0.94) 100%);
  box-shadow:
    0 40px 90px rgba(0,0,0,0.65),
    0 0 0 1px rgba(255,255,255,0.02),
    inset 0 1px 0 rgba(255,255,255,0.06);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.finale-block::before {
  content: "";
  position: absolute;
  left: 22%; right: 22%; top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.28), transparent);
}
.finale-block::after {
  content: "";
  position: absolute;
  left: 22%; right: 22%; bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.28), transparent);
}
.finale-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(56px, 6.4vw, 96px);
  line-height: 0.95;
  letter-spacing: 0.005em;
  color: #ffffff;
}
.finale-body {
  font-size: 16px;
  line-height: 1.7;
  color: #c8c8c8;
  max-width: 500px;
}
.finale-cta {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-top: 10px;
  padding: 18px 30px;
  border: 1px solid var(--c-prod);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg);
  background: transparent;
  transition: background 300ms ease, gap 300ms ease;
}
.finale-cta:hover {
  background: var(--c-prod);
  gap: 22px;
}
.finale-cta .cta-arrow { transition: transform 300ms ease; }
.finale-cta:hover .cta-arrow { transform: translateX(4px); }

.finale-legend {
  display: flex;
  gap: 18px;
  margin-top: 16px;
  flex-wrap: wrap;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-faint);
}
.legend-item { display: flex; align-items: center; gap: 8px; }
.legend-item span {
  width: 8px; height: 8px;
  display: inline-block;
  box-shadow: 0 0 8px currentColor;
}
.legend-item:nth-child(1) span { box-shadow: 0 0 8px #9C0404; }
.legend-item:nth-child(2) span { box-shadow: 0 0 8px #00A8FF; }
.legend-item:nth-child(3) span { box-shadow: 0 0 8px #E8640A; }
.legend-item:nth-child(4) span { box-shadow: 0 0 8px #E8C30A; }
.legend-item:nth-child(5) span { box-shadow: 0 0 8px #00C896; }

/* ============================================================
   RESPONSIVE — panel adattivi per tablet e mobile
   (il layout desktop 3D gira su tutti gli schermi)
   ============================================================ */

/* Tablet — 768px–1024px */
@media (max-width: 1024px) {
  .scene-intro  { padding: 0 32px; }
  .intro-block  { max-width: 72vw; padding: 44px 36px; gap: 22px; }

  .scene-pillar { padding: 0 32px; }
  .panel        { max-width: 64vw; padding: 44px 36px; gap: 18px; }
  .panel-claim  { font-size: clamp(34px, 4.6vw, 52px); }

  .finale-block { padding: 52px 44px; }
}

/* Mobile — ≤ 767px */
@media (max-width: 767px) {
  /* intro */
  .scene-intro { padding: 0 16px; }
  .intro-block {
    width: 100%;
    max-width: 100%;
    padding: 28px 22px;
    gap: 18px;
    border-radius: 20px;
  }
  .intro-title .line { font-size: clamp(38px, 10vw, 58px); }
  .intro-tag         { font-size: 14px; }
  .intro-foot        { flex-direction: column; gap: 20px; margin-top: 12px; }
  .intro-stats       { gap: 20px; }
  .intro-stats span  { font-size: 28px; }

  /* pillar panels */
  .scene-pillar { padding: 0 16px; }
  .panel {
    width: 100%;
    max-width: 100%;
    padding: 28px 22px;
    gap: 14px;
    border-radius: 20px;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  .panel-claim { font-size: clamp(30px, 8.5vw, 46px); }
  .panel-body  { font-size: 14px; line-height: 1.65; max-width: 100%; }
  .panel-cta   { font-size: 11px; }

  /* finale */
  .scene-finale { padding: 0 16px; }
  .finale-block {
    padding: 32px 22px;
    gap: 16px;
    border-radius: 20px;
  }
  .finale-title  { font-size: clamp(38px, 10vw, 60px); }
  .finale-body   { font-size: 14px; }
  .finale-legend { gap: 12px; }
}

/* ============================================================
   MOBILE (layout statico — ora nascosto, tenuto per riferimento)
   ============================================================ */
.ecosystem-mobile {
  padding: 0 22px 80px;
  color: var(--fg);
}
.m-intro {
  padding: 56px 0;
}
.m-eyebrow {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--fg-faint);
  text-transform: uppercase;
  margin-bottom: 20px;
}
.m-eyebrow span {
  width: 24px; height: 1px;
  background: var(--fg-faint);
}
.m-intro h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(48px, 12vw, 80px);
  line-height: 0.92;
  letter-spacing: 0.005em;
  margin-bottom: 20px;
}
.m-intro h1 em { font-style: normal; }
.m-tag {
  font-size: 14px;
  color: var(--fg-dim);
  letter-spacing: 0.01em;
}

.m-cards {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 0;
  margin: 0;
}
.m-cards li {
  position: relative;
  padding: 28px 22px;
  border: 1px solid rgba(255,255,255,0.10);
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(0,0,0,0));
  overflow: hidden;
}
.m-cards li::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--c);
  box-shadow: 0 0 14px var(--c);
}
.m-num {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.22em;
  color: var(--c);
  margin-bottom: 14px;
}
.m-cards h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 20px;
  line-height: 1.1;
  color: var(--fg);
  margin-bottom: 14px;
}
.m-cards p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--fg-dim);
  margin-bottom: 16px;
}
.m-cards a {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c);
  border-bottom: 1px solid var(--c);
  padding-bottom: 2px;
}

.m-finale {
  margin-top: 56px;
  padding: 40px 0;
  text-align: center;
}
.m-finale h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 44px;
  line-height: 0.95;
  margin-bottom: 14px;
}
.m-finale p {
  font-size: 14px;
  color: var(--fg-dim);
  margin-bottom: 24px;
}
.m-cta {
  display: inline-block;
  padding: 16px 22px;
  border: 1px solid var(--c-prod);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg);
  transition: background 300ms ease;
}
.m-cta:hover { background: var(--c-prod); }
