/* Sito di ArakCode (Fase 12). Palette Araknet: notte e rosso, carta per le sezioni chiare. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/static/fonts/bricolage-grotesque.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("/static/fonts/ibm-plex-sans.woff2") format("woff2");
  font-weight: 100 700;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/static/fonts/jetbrains-mono.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}

:root {
  --night: #0b1624;
  --abyss: #070f1a;
  --night-line: #1b3047;
  --red: #e63329;
  --red-hover: #f04237;
  --ember: #ff6b5f;
  --spark: #ffd9d5;
  --paper: #f6f7f9;
  --white: #ffffff;
  --ink: #14171c;
  --slate: #5b6573;
  --mist: #8fa1b6;
  --frost: #e7e9ee;
  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --text: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", Consolas, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --gutter: clamp(16px, 4vw, 40px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.6 var(--text);
  text-rendering: optimizeLegibility;
}
img,
svg {
  display: block;
  max-width: 100%;
}
a {
  color: inherit;
}
:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 3px;
  border-radius: 4px;
}
.skip {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 10;
  background: var(--white);
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 999px;
}
.skip:focus {
  left: 8px;
}
.wrap {
  width: min(1200px, 100% - 2 * var(--gutter));
  margin-inline: auto;
}
.narrow {
  max-width: 680px;
}

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0;
  text-wrap: balance;
}
h2 {
  font-size: clamp(32px, 4.2vw, 52px);
}
h3 {
  font-size: 21px;
  letter-spacing: -0.015em;
  line-height: 1.2;
}
p {
  margin: 0;
}

/* --- Pulsanti --- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 24px;
  border-radius: 999px;
  font: 600 16px/1 var(--text);
  text-decoration: none;
  border: 1px solid transparent;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.button.primary {
  background: var(--red);
  color: var(--white);
}
.button.primary:hover {
  background: var(--red-hover);
}
.button.quiet {
  color: var(--white);
  border-color: var(--night-line);
}
.button.quiet:hover {
  border-color: var(--mist);
}
.button.quiet.dark {
  color: var(--ink);
  border-color: var(--frost);
}
.button.quiet.dark:hover {
  border-color: var(--slate);
}
.button.ghost {
  min-height: 38px;
  padding: 0 18px;
  font-size: 15px;
  color: var(--white);
  border-color: var(--night-line);
}
.button.ghost:hover {
  border-color: var(--mist);
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* --- Testata --- */
.top {
  position: absolute;
  inset: 0 0 auto;
  z-index: 5;
  color: var(--white);
}
.page .top {
  position: static;
  background: var(--night);
}
.top-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 76px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.brand .mark {
  width: 32px;
  height: 32px;
  color: var(--red);
}
.wordmark {
  font: 800 24px/1 var(--display);
  letter-spacing: -0.035em;
}
.wordmark span {
  color: var(--red);
}
.nav {
  display: flex;
  align-items: center;
  gap: 26px;
  font-size: 15px;
}
.nav a:not(.button) {
  text-decoration: none;
  color: var(--mist);
}
.nav a:not(.button):hover {
  color: var(--white);
}

/* --- Prima schermata --- */
.hero {
  position: relative;
  overflow: hidden;
  background: radial-gradient(70vmax 60vmax at 72% 46%, #13263d 0%, var(--night) 48%, var(--abyss) 100%);
  color: var(--white);
  padding: clamp(120px, 14vw, 160px) 0 clamp(72px, 9vw, 120px);
}
.field {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(143, 161, 182, 0.14) 1px, transparent 1.4px);
  background-size: 32px 32px;
  mask-image: radial-gradient(closest-side at 70% 48%, #000 10%, transparent 100%);
  pointer-events: none;
}
.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  align-items: center;
  gap: clamp(24px, 5vw, 80px);
}
.hero h1 {
  font-size: clamp(38px, 4.4vw, 62px);
  letter-spacing: -0.035em;
  line-height: 1.02;
}
.lead {
  margin-top: 24px;
  max-width: 34em;
  font-size: clamp(17px, 1.5vw, 19px);
  color: #c9d3df;
}
.hero .actions {
  margin-top: 34px;
}
.note {
  margin-top: 18px;
  font-size: 14px;
  color: var(--mist);
}

/* La squadra: il logo di Araknet con gli agenti ai nodi. */
.team {
  position: relative;
  margin: 0;
  aspect-ratio: 640 / 560;
}
.team-net {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.team-net * {
  transform-box: fill-box;
  transform-origin: center;
}
.orbit {
  fill: none;
  stroke: rgba(143, 161, 182, 0.2);
  stroke-width: 1;
  stroke-dasharray: 2 9;
  animation: spin 70s linear infinite;
}
.orbit.inner {
  stroke: rgba(230, 51, 41, 0.3);
  stroke-dasharray: 1 6;
  animation-direction: reverse;
  animation-duration: 50s;
}
.edge,
.spoke,
.comet {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.edge {
  stroke: var(--red);
  stroke-width: 5;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  filter: drop-shadow(0 0 6px rgba(230, 51, 41, 0.55));
  animation: draw 1.1s 0.5s var(--ease) forwards;
}
.spoke {
  stroke: rgba(230, 51, 41, 0.55);
  stroke-width: 4;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: draw 0.6s calc(1.2s + var(--i) * 0.08s) var(--ease) forwards;
}
.comet {
  stroke: var(--spark);
  stroke-width: 5;
  stroke-dasharray: 14 100;
  stroke-dashoffset: 14;
  opacity: 0;
  filter: drop-shadow(0 0 4px #fff) drop-shadow(0 0 10px var(--red));
}
.node {
  fill: var(--red);
  transform: scale(0);
  filter: drop-shadow(0 0 8px rgba(230, 51, 41, 0.9));
  animation: pop 0.55s calc(0.05s + var(--i) * 0.11s) var(--spring) forwards;
  transition: fill 0.25s;
}
.node.lit {
  fill: var(--spark);
}
.ring {
  fill: none;
  stroke: var(--ember);
  stroke-width: 1.5;
  opacity: 0;
}
.ring.wave {
  animation: wave 1s var(--ease);
}
.hub {
  fill: var(--red);
  transform: scale(0);
  filter: drop-shadow(0 0 14px rgba(230, 51, 41, 1));
  animation: pop 0.6s 1.6s var(--spring) forwards;
}
.hub-eye {
  fill: var(--white);
  transform: scale(0);
  animation: pop 0.45s 1.85s var(--spring) forwards;
}
.hub-wave {
  fill: none;
  stroke: var(--red);
  stroke-width: 2;
  opacity: 0;
}
.hub-wave.wave {
  animation: wave-hub 1.2s var(--ease);
}
.hub-label {
  position: absolute;
  left: 50%;
  top: calc(50% + 7%);
  transform: translateX(-50%);
  font: 700 15px/1 var(--display);
  letter-spacing: -0.01em;
  color: var(--white);
  background: rgba(7, 15, 26, 0.85);
  border: 1px solid var(--night-line);
  border-radius: 999px;
  padding: 6px 12px;
  opacity: 0;
  animation: fade 0.6s 2s forwards;
}

.agent {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: max-content;
  max-width: 230px;
  display: grid;
  gap: 4px;
  opacity: 0;
  animation: fade 0.6s calc(2.1s + var(--i) * 0.1s) forwards;
}
.agent.top {
  transform: translate(-50%, calc(-100% - 30px));
  text-align: center;
  justify-items: center;
}
/* Le etichette dei nodi di lato stanno sopra il nodo: di fianco toccherebbero il titolo. */
.agent.right,
.agent.left {
  transform: translate(-50%, calc(-100% - 28px));
  text-align: center;
  justify-items: center;
}
.agent.below {
  transform: translate(-50%, 30px);
  text-align: center;
  justify-items: center;
}
.who {
  font-size: 15px;
  line-height: 1.3;
}
.who strong {
  font-weight: 600;
}
.cli {
  color: var(--mist);
  margin-left: 2px;
}
.doing {
  font: 400 13px/1.4 var(--mono);
  color: var(--spark);
  background: rgba(7, 15, 26, 0.72);
  border: 1px solid var(--night-line);
  border-radius: 8px;
  padding: 5px 9px;
  transition: opacity 0.25s;
}
.doing.swap {
  opacity: 0;
}

@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}
@keyframes pop {
  to {
    transform: scale(1);
  }
}
@keyframes fade {
  to {
    opacity: 1;
  }
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes wave {
  0% {
    opacity: 0.9;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(2.4);
  }
}
@keyframes wave-hub {
  0% {
    opacity: 0.8;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(4.5);
  }
}
.hero-copy > * {
  opacity: 0;
  transform: translateY(14px);
  animation: rise 0.8s var(--ease) forwards;
}
.hero-copy > :nth-child(2) {
  animation-delay: 0.12s;
}
.hero-copy > :nth-child(3) {
  animation-delay: 0.24s;
}
.hero-copy > :nth-child(4) {
  animation-delay: 0.36s;
}
@keyframes rise {
  to {
    opacity: 1;
    transform: none;
  }
}

/* --- Come funziona: una sequenza vera, quindi numerata --- */
.how {
  padding: clamp(80px, 10vw, 128px) 0;
}
.steps {
  list-style: none;
  counter-reset: step;
  margin: 48px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px;
}
.steps li {
  counter-increment: step;
  position: relative;
  padding-top: 64px;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  top: 0;
  left: 0;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--white);
  border: 1.5px solid var(--red);
  color: var(--red);
  font: 800 18px/1 var(--display);
}
.steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 22px;
  left: 56px;
  right: -20px;
  height: 1.5px;
  background: linear-gradient(90deg, var(--red), rgba(230, 51, 41, 0.15));
}
.steps p {
  margin-top: 10px;
  color: var(--slate);
}

/* --- La finestra dell'app --- */
.shot {
  background: var(--white);
  padding: clamp(80px, 10vw, 128px) 0;
  border-block: 1px solid var(--frost);
}
.shot-inner {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: center;
}
.shot-copy p {
  margin-top: 18px;
  color: var(--slate);
}
.window {
  border-radius: 14px;
  overflow: hidden;
  background: var(--night);
  border: 1px solid var(--night-line);
  box-shadow: 0 30px 60px -30px rgba(11, 22, 36, 0.45);
}
.window-bar {
  display: flex;
  gap: 7px;
  padding: 11px 14px;
  background: var(--abyss);
}
.window-bar span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--night-line);
}
.window img {
  width: 100%;
  height: auto;
}

/* --- Perché --- */
.why {
  padding: clamp(80px, 10vw, 128px) 0;
}
.why-inner {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: clamp(24px, 4vw, 64px);
}
.why h2 {
  position: sticky;
  top: 32px;
  align-self: start;
}
.reasons {
  margin: 0;
  display: grid;
  gap: 0;
}
.reasons div {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 24px;
  padding: 26px 0;
  border-top: 1px solid var(--frost);
}
.reasons div:last-child {
  border-bottom: 1px solid var(--frost);
}
.reasons dt {
  font: 700 21px/1.25 var(--display);
  letter-spacing: -0.015em;
  padding-left: 22px;
  position: relative;
}
.reasons dt::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.42em;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(230, 51, 41, 0.14);
}
.reasons dd {
  margin: 0;
  color: var(--slate);
}

/* --- Scarica --- */
.get {
  background: var(--night);
  color: var(--white);
  padding: clamp(72px, 9vw, 112px) 0;
  position: relative;
  overflow: hidden;
}
.get::after {
  content: "";
  position: absolute;
  right: -120px;
  top: 50%;
  width: 520px;
  height: 520px;
  transform: translateY(-50%);
  background: radial-gradient(circle, rgba(230, 51, 41, 0.22), transparent 62%);
  pointer-events: none;
}
.get-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 6fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: center;
}
.get p {
  margin-top: 18px;
  color: #c9d3df;
  max-width: 36em;
}
.get .actions {
  margin-top: 30px;
}
.facts {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--night-line);
  border-radius: 18px;
  overflow: hidden;
}
.facts div {
  padding: 22px 24px;
  border-bottom: 1px solid var(--night-line);
}
.facts div:nth-child(odd) {
  border-right: 1px solid var(--night-line);
}
.facts div:nth-last-child(-n + 2) {
  border-bottom: 0;
}
.facts dt {
  font-size: 14px;
  color: var(--mist);
}
.facts dd {
  margin: 6px 0 0;
  font: 700 19px/1.3 var(--display);
  letter-spacing: -0.01em;
}

/* --- Domande --- */
.faq {
  padding: clamp(80px, 10vw, 128px) 0;
}
.faq-inner {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: clamp(24px, 4vw, 64px);
}
.answers details {
  border-top: 1px solid var(--frost);
}
.answers details:last-child {
  border-bottom: 1px solid var(--frost);
}
.answers summary {
  cursor: pointer;
  list-style: none;
  padding: 22px 40px 22px 0;
  position: relative;
  font: 700 19px/1.35 var(--display);
  letter-spacing: -0.01em;
}
.answers summary::-webkit-details-marker {
  display: none;
}
.answers summary::after {
  content: "";
  position: absolute;
  right: 6px;
  top: 50%;
  width: 11px;
  height: 11px;
  border-right: 2px solid var(--red);
  border-bottom: 2px solid var(--red);
  transform: translateY(-70%) rotate(45deg);
  transition: transform 0.2s var(--ease);
}
.answers details[open] summary::after {
  transform: translateY(-30%) rotate(225deg);
}
.answers p {
  padding: 0 0 22px;
  color: var(--slate);
  max-width: 62ch;
}

/* --- Pagine semplici --- */
.plain {
  padding: clamp(72px, 10vw, 120px) 0;
}
.plain h1 {
  font-size: clamp(36px, 5vw, 56px);
}
.plain .lead {
  color: var(--slate);
}
.plain p + p {
  margin-top: 16px;
}
.plain .actions {
  margin-top: 32px;
}

/* --- Piede --- */
.foot {
  background: var(--abyss);
  color: var(--mist);
  padding: 40px 0;
  font-size: 15px;
}
.foot-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px 32px;
}
.foot-brand {
  margin-right: auto;
  color: var(--white);
}
.foot a {
  text-decoration: none;
}
.foot a:hover {
  color: var(--white);
}

/* --- Schermi stretti --- */
@media (max-width: 980px) {
  .hero-inner,
  .shot-inner,
  .why-inner,
  .get-inner,
  .faq-inner {
    grid-template-columns: minmax(0, 1fr);
  }
  .team {
    max-width: 620px;
    width: 100%;
    margin: 24px auto 0;
  }
  .steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .steps li:nth-child(2)::after {
    display: none;
  }
  .why h2 {
    position: static;
  }
}
@media (max-width: 720px) {
  .nav a:not(.button):not(.lang) {
    display: none;
  }
  .nav {
    gap: 16px;
  }
  .steps {
    grid-template-columns: minmax(0, 1fr);
  }
  .steps li::after {
    display: none;
  }
  .reasons div {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }
  /* Le etichette intorno al logo non ci stanno: diventano un elenco sotto. */
  .team {
    aspect-ratio: auto;
  }
  .team-net {
    height: auto;
    aspect-ratio: 640 / 560;
  }
  .hub-label {
    top: calc((100vw - 2 * var(--gutter)) * 560 / 640 / 2 + 22px);
  }
  .agent,
  .agent.top,
  .agent.right,
  .agent.left,
  .agent.below {
    position: static;
    transform: none;
    text-align: left;
    justify-items: start;
    max-width: none;
    margin-top: 12px;
  }
  .facts {
    grid-template-columns: minmax(0, 1fr);
  }
  .facts div:nth-child(odd) {
    border-right: 0;
  }
  .facts div:nth-last-child(2) {
    border-bottom: 1px solid var(--night-line);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* --- Area personale --- */
.area h2 {
  font-size: 24px;
  margin: 48px 0 14px;
}
.download {
  margin-top: 32px;
  padding: 28px;
  border-radius: 18px;
  background: var(--night);
  color: var(--white);
}
.button.big {
  min-height: 54px;
  padding: 0 28px;
  font-size: 17px;
}
.download .meta {
  margin-top: 14px;
  color: var(--mist);
  font-size: 15px;
}
.notice {
  margin-top: 32px;
  padding: 18px 22px;
  border-radius: 12px;
  background: var(--white);
  border: 1px solid var(--frost);
}
.install {
  margin: 0;
  padding-left: 22px;
  color: var(--slate);
}
.install li + li {
  margin-top: 8px;
}
.notes {
  white-space: pre-line;
  color: var(--slate);
  font-size: 16px;
}
