/* ATLED — stili. Mobile-first: la base è il telefono, i media query aggiungono.
 *
 * 1. Font e variabili      4. Sezioni
 * 2. Base                  5. Modalità CLI
 * 3. Barra e switch        6. Stati e accessibilità
 */

/* 1. Font e variabili ---------------------------------------------------- */

@font-face {
  font-family: "Albert Sans";
  src: url("../fonts/albert-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/JetBrainsMonoNL-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/JetBrainsMonoNL-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #080b12;
  --ink: #eef3f5;
  --soft: #b6c2cc;
  --muted: #8593a1;
  --line: rgba(238, 243, 245, 0.14);
  --accent: #7fe0d4;

  --sans: "Albert Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --pad: clamp(1.25rem, 5vw, 4.5rem);
  --bar-h: 3.5rem;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
}

/* 2. Base ---------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color: var(--ink);
  scroll-behavior: smooth;
  scroll-padding-top: var(--bar-h);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.5;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
p,
ol,
ul,
dl,
dd {
  margin: 0;
  padding: 0;
}

ol,
ul {
  list-style: none;
}

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

svg {
  display: block;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: fixed;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 50;
  padding: 0.5rem 0.75rem;
  background: var(--ink);
  color: var(--bg);
  transform: translateY(-200%);
}

.skip:focus {
  transform: none;
}

#field {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100vw;
  height: 100vh;
  height: 100lvh;
  pointer-events: none;
}

#gui {
  position: relative;
  z-index: 1;
  transition: opacity 0.35s ease, filter 0.35s ease, transform 0.5s var(--ease);
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

/* 3. Barra e switch ------------------------------------------------------ */

.bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: var(--bar-h);
  padding: 0 var(--pad);
}

.bar::before {
  content: "";
  position: absolute;
  inset: 0 0 -1.5rem;
  z-index: -1;
  background: linear-gradient(var(--bg) 35%, transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.bar.is-scrolled::before {
  opacity: 1;
}

.bar__logo {
  flex: none;
  margin-right: auto;
  color: var(--ink);
}

.bar__logo svg {
  width: 6rem;
  height: 1.18rem;
}

.logo-mark {
  color: var(--accent);
}

.bar__title {
  display: none;
}

.bar__nav {
  display: flex;
  gap: 1.75rem;
  font-size: 0.9375rem;
}

.bar__nav a {
  position: relative;
  padding: 0.5rem 0;
  color: var(--soft);
  transition: color 0.2s ease;
}

.bar__nav a:not(:last-child) {
  display: none;
}

.bar__nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.25rem;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}

.bar__nav a:hover,
.bar__nav a[aria-current] {
  color: var(--ink);
}

.bar__nav a:hover::after,
.bar__nav a[aria-current]::after {
  transform: scaleX(1);
}

.switch {
  display: none;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
}

.switch__label {
  color: var(--muted);
  transition: color 0.2s ease;
}

.switch__label:first-child,
.switch[aria-checked="true"] .switch__label:last-child {
  color: var(--ink);
}

.switch[aria-checked="true"] .switch__label:first-child {
  color: var(--muted);
}

.switch__track {
  position: relative;
  width: 2.125rem;
  height: 1.125rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.switch:hover .switch__track {
  border-color: var(--accent);
}

.switch__thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background: var(--ink);
  transition: transform 0.3s var(--ease), border-radius 0.3s ease, background-color 0.2s ease;
}

/* Nel terminale il pallino diventa un cursore a blocco. */
.switch[aria-checked="true"] .switch__thumb {
  transform: translateX(1rem);
  border-radius: 1px;
  background: var(--accent);
}

@media (min-width: 768px) {
  .bar__nav a:not(:last-child) {
    display: block;
  }

  .bar__logo svg {
    width: 7rem;
    height: 1.375rem;
  }
}

/* Lo switch esiste solo con schermo grande e mouse. */
@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
  .switch {
    display: inline-flex;
  }
}

/* 4. Sezioni ------------------------------------------------------------- */

/* Hero */

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 100vh;
  min-height: 100svh;
  padding: 0 var(--pad) 4.5rem;
}

.hero__fallback {
  display: none;
  position: absolute;
  top: 16%;
  left: 50%;
  width: 56vw;
  height: 49vw;
  color: var(--accent);
  transform: translateX(-50%);
}

.hero__body {
  position: relative;
}

.hero__title {
  margin-top: 0.75rem;
  font-size: clamp(3rem, 14.6vw, 8.5rem);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.04em;
}

.line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.1em;
  margin-bottom: -0.1em;
}

.line > span {
  display: block;
}

.accent {
  color: var(--accent);
}

.js .line > span {
  transform: translateY(110%);
  transition: transform 1.1s var(--ease);
}

.js .line:nth-child(2) > span {
  transition-delay: 0.08s;
}

.js .line:nth-child(3) > span {
  transition-delay: 0.16s;
}

.js.is-ready .line > span {
  transform: none;
}

.hero__lead {
  max-width: 26em;
  margin-top: 1.25rem;
  font-size: clamp(1.0625rem, 4.4vw, 1.375rem);
  line-height: 1.4;
  color: var(--soft);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  min-height: 3rem;
  padding: 0 1.375rem;
  border: 1px solid var(--line);
  border-radius: 3rem;
  font-size: 1rem;
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.btn:hover {
  border-color: var(--ink);
}

/* Sul telefono basta un'azione: la freccia ∇ porta già ai contenuti. */
.btn:not(.btn--solid) {
  display: none;
}

@media (min-width: 480px) {
  .btn:not(.btn--solid) {
    display: inline-flex;
  }
}

.btn--solid {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

.btn--solid:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 1.5rem;
  padding: 0.5rem;
  color: var(--muted);
  transform: translateX(-50%);
}

.scroll-cue svg {
  width: 0.875rem;
  height: 0.75rem;
  animation: cue 2.4s var(--ease) infinite;
}

@keyframes cue {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50% { transform: translateY(7px); opacity: 1; }
}

/* Manifesto */

.manifesto {
  display: grid;
  place-items: center;
  min-height: 120vh;
  min-height: 120svh;
  padding: 0 var(--pad);
}

.manifesto__text {
  max-width: 19em;
  font-size: clamp(2rem, 8.4vw, 5rem);
  font-weight: 300;
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.word {
  transition: opacity 0.25s linear;
}

/* Servizi */

.service {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 100vh;
  min-height: 100svh;
  padding: 0 var(--pad) 12vh;
}

.service h3 {
  font-size: clamp(3rem, 15vw, 8rem);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.04em;
}

.service p:last-child {
  max-width: 24em;
  margin-top: 1rem;
  font-size: clamp(1.125rem, 4.8vw, 1.625rem);
  line-height: 1.35;
  color: var(--soft);
}

.js .reveal {
  opacity: 0;
  transform: translateY(1.75rem);
  transition: opacity 0.9s ease, transform 1.1s var(--ease);
}

.js .reveal.in {
  opacity: 1;
  transform: none;
}

/* Approccio */

.approach {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3rem;
  min-height: 100vh;
  min-height: 100svh;
  padding: 6rem var(--pad);
}

.approach h2 {
  font-size: clamp(2.75rem, 13vw, 7rem);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.04em;
}

.nowrap {
  white-space: nowrap;
}

/* "atled" che diventa "delta" (setupSwap in site.js). Senza crenatura, così la
 * parola intera e le lettere staccate occupano esattamente gli stessi punti. */
.swap {
  font-kerning: none;
  transition: color 0.8s ease;
}

.swap.is-split {
  display: inline-flex;
  align-items: baseline;
  color: var(--accent);
}

.steps {
  display: grid;
  gap: 1.75rem;
  counter-reset: step;
}

.steps li {
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  counter-increment: step;
}

.steps li::before {
  content: "0" counter(step);
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent);
}

.steps h3 {
  margin-top: 0.5rem;
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: -0.015em;
}

.steps p {
  margin-top: 0.25rem;
  color: var(--soft);
}

.steps li:nth-child(2) {
  transition-delay: 0.1s;
}

.steps li:nth-child(3) {
  transition-delay: 0.2s;
}

.approach__lead {
  max-width: 30em;
  margin-top: 1.25rem;
  font-size: clamp(1.0625rem, 4.4vw, 1.375rem);
  line-height: 1.4;
  color: var(--soft);
}

/* Chi siamo */

.team {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: 6rem var(--pad);
}

.team h2 {
  margin-top: 0.625rem;
  font-size: clamp(2.75rem, 13vw, 7rem);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.04em;
}

.team__lead {
  max-width: 28em;
  margin-top: 1.25rem;
  font-size: clamp(1.125rem, 4.8vw, 1.5rem);
  line-height: 1.4;
  color: var(--soft);
}

.skills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 2rem;
}

.skills li {
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 2rem;
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--soft);
}

/* Il box dove il campo disegna il logo; i nomi orbitano attorno (site.js). */
.team__stage {
  position: relative;
  order: -1;
  height: 40vh;
  height: 40svh;
  margin-bottom: 1rem;
}

.team__fallback {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 70%;
  height: 14%;
  color: var(--accent);
  transform: translate(-50%, -50%);
}

.no-webgl .team__fallback {
  display: block;
}

.people li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1rem;
}

/* Senza JS (o con meno movimento) i nomi restano una griglia sotto al logo. */
.orbit {
  position: absolute;
  inset: auto 0 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 1.25rem;
}

/* Con JS la lista va in <body> e segue il logo del campo (site.js). */
.orbit.is-orbiting {
  position: fixed;
  inset: 0;
  z-index: 2;
  display: block;
  visibility: hidden;
  pointer-events: none;
}

.cli-on .orbit {
  display: none;
}

.orbit.is-orbiting li {
  position: absolute;
  top: 0;
  left: 0;
  will-change: transform, opacity;
}

.people svg {
  flex: none;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0.5rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--bg);
  color: var(--accent);
}

/* Contatti */

.contact {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 100vh;
  min-height: 100svh;
  padding: 6rem var(--pad) 3rem;
}

.contact h2 {
  margin-top: 0.625rem;
  font-size: clamp(1.625rem, 6.4vw, 2.75rem);
  font-weight: 300;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--soft);
}

.contact__lead {
  max-width: 30em;
  margin-top: 0.75rem;
  font-size: 1.125rem;
  line-height: 1.4;
  color: var(--soft);
}

.contact__cta {
  display: flex;
  width: max-content;
  margin-top: 1.5rem;
}

.contact__mail {
  display: inline-block;
  margin-top: 1.5rem;
  font-size: clamp(2.5rem, 13.4vw, 8rem);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.04em;
  background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 2px no-repeat;
  transition: background-size 0.5s var(--ease), color 0.25s ease;
}

.contact__mail:hover {
  color: var(--accent);
  background-size: 100% 2px;
}

.contact__list {
  display: grid;
  gap: 1rem;
  margin-top: 2.5rem;
}

.contact__list dt {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.contact__list dd {
  margin-top: 0.125rem;
  font-size: 1.0625rem;
}

.contact__list a:hover {
  color: var(--accent);
}

/* Footer */

.foot {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.5rem var(--pad) calc(1.5rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
}

.foot ul {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.foot a {
  transition: color 0.2s ease;
}

.foot a:hover {
  color: var(--ink);
}

/* Da tablet orizzontale in su il testo sta a sinistra, la forma a destra. */
@media (min-width: 900px) and (min-aspect-ratio: 23/20) {
  .hero {
    justify-content: center;
    padding-bottom: 0;
  }

  .hero__fallback {
    top: 50%;
    left: 74%;
    width: 30vw;
    height: 26vw;
    transform: translate(-50%, -50%);
  }

  .hero__title {
    font-size: clamp(4rem, min(8.6vw, 16.5vh), 9.5rem);
  }

  .hero__lead {
    font-size: 1.375rem;
  }

  .manifesto__text {
    font-size: clamp(2.75rem, 5.2vw, 5.5rem);
  }

  .service {
    justify-content: center;
    padding-bottom: 0;
  }

  .service__body {
    max-width: 46vw;
  }

  .service h3 {
    font-size: clamp(4rem, 8vw, 8.5rem);
  }

  .service p:last-child {
    font-size: 1.5rem;
  }

  .approach {
    justify-content: flex-start;
    gap: 4rem;
    padding-top: 22vh;
  }

  .approach h2 {
    font-size: clamp(4rem, 8vw, 8.5rem);
  }

  .steps {
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
  }

  .team {
    flex-direction: row;
    align-items: center;
    gap: 3vw;
  }

  .team__body {
    flex: 0 0 46vw;
    max-width: 46vw;
  }

  .team__stage {
    order: 1;
    flex: 1;
    height: 70vh;
    margin-bottom: 0;
  }

  .team h2 {
    font-size: clamp(4rem, 7vw, 7.5rem);
  }

  .contact {
    justify-content: center;
    padding-bottom: 0;
  }

  .contact__mail {
    font-size: clamp(4rem, 7.4vw, 8rem);
  }

  .contact__list {
    grid-template-columns: repeat(3, auto);
    justify-content: start;
    gap: 3.5rem;
  }

  /* Tre colonne uguali ai lati: i link restano al centro qualunque sia la lunghezza dei testi. */
  .foot {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 2rem;
  }

  .foot__made {
    text-align: right;
  }
}

/* 5. Modalità CLI -------------------------------------------------------- */

#cli {
  --t-fg: #d6e4e6;
  --t-dim: #74838f;
  --t-acc: #7fe0d4;
  --t-ok: #8fe3a8;
  --t-err: #ff8a80;
  --t-arg: #a9c9ff;
  --t-flag: #ffd479;

  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  padding-top: var(--bar-h);
  background: linear-gradient(90deg, rgba(5, 8, 12, 0.72), rgba(5, 8, 12, 0.5) 60%, rgba(5, 8, 12, 0));
  color: var(--t-fg);
  font-family: var(--mono);
  font-size: 0.875rem;
  line-height: 1.6;
  animation: crt-on 0.45s ease-out both;
}

#cli[hidden] {
  display: none;
}

#cli[data-theme="phosphor"] {
  --t-fg: #c8f5d0;
  --t-dim: #5f8a6a;
  --t-acc: #6dff9b;
  --t-ok: #6dff9b;
  --t-arg: #b6ffcf;
  --t-flag: #e5ff8a;
}

#cli[data-theme="amber"] {
  --t-fg: #ffe2b0;
  --t-dim: #9a7b4f;
  --t-acc: #ffb547;
  --t-ok: #ffcf70;
  --t-arg: #ffd9a0;
  --t-flag: #ffe9b8;
}

#cli[data-theme="mono"] {
  --t-fg: #e6e6e6;
  --t-dim: #7d7d7d;
  --t-acc: #ffffff;
  --t-ok: #ffffff;
  --t-arg: #c9c9c9;
  --t-flag: #c9c9c9;
}

/* Scanline e vignettatura, tenute appena percettibili. */
#cli::before,
#cli::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

#cli::before {
  background: radial-gradient(ellipse at center, transparent 62%, rgba(0, 0, 0, 0.42));
}

#cli::after {
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.022) 0 1px, transparent 1px 3px);
}

#cli.crt-off::before,
#cli.crt-off::after {
  display: none;
}

#cli:not(.crt-off) .cli__log,
#cli:not(.crt-off) .cli__row,
#cli:not(.crt-off) .cli__menu {
  text-shadow: 0 0 12px color-mix(in srgb, var(--t-acc) 22%, transparent);
}

@keyframes crt-on {
  0% { opacity: 0; filter: brightness(2.2); }
  40% { opacity: 1; }
  100% { opacity: 1; filter: none; }
}

.cli__scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1.25rem var(--pad) 1.75rem;
  scrollbar-width: thin;
  scrollbar-color: var(--t-dim) transparent;
}

.cli__probe {
  position: absolute;
  visibility: hidden;
  white-space: pre;
}

.ln {
  min-height: 1.6em;
  max-width: 92ch;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  animation: ln-in 0.16s ease-out both;
  animation-delay: calc(var(--i, 0) * 13ms);
}

.ln--plain {
  animation: none;
}

.ln--art {
  min-height: 0;
  line-height: 1.16;
  white-space: pre;
}

.cmdline {
  margin-top: 0.25rem;
  animation: none;
}

@keyframes ln-in {
  from { opacity: 0; transform: translateX(-4px); }
  to { opacity: 1; transform: none; }
}

.banner {
  display: inline-block;
  font-size: 1.2em;
  color: var(--t-acc);
  /* Il tratto chiude le fessure tra un blocco e l'altro. */
  -webkit-text-stroke: 0.6px var(--t-acc);
}

.dim { color: var(--t-dim); }
.acc { color: var(--t-acc); }
.ok { color: var(--t-ok); }
.err { color: var(--t-err); }
.h { color: #fff; font-weight: 700; }
.rule { color: var(--t-dim); opacity: 0.5; }

.kbd {
  padding: 0 0.35em;
  border: 1px solid var(--t-dim);
  border-radius: 3px;
  color: var(--t-fg);
}

.lnk {
  color: var(--t-acc);
  white-space: pre;
  cursor: pointer;
  text-decoration: underline transparent;
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s ease;
}

.lnk:hover {
  text-decoration-color: currentColor;
}

.ps {
  flex: none;
  white-space: pre;
}

.ps__user { color: var(--t-acc); font-weight: 700; }
.ps__at { color: var(--t-dim); }
.ps__path { color: var(--t-arg); }
.ps__arrow { color: var(--t-acc); }
.ps__ask { color: var(--t-flag); }

.tok-ok { color: var(--t-ok); }
.tok-err { color: var(--t-err); }
.tok-arg { color: var(--t-arg); }
.tok-flag { color: var(--t-flag); }

.cli__row {
  display: flex;
  gap: 1ch;
  margin-top: 0.25rem;
}

/* Opacità, non visibility: l'input deve tenere il focus per ricevere ctrl+c. */
.cli__row.is-busy {
  opacity: 0;
  pointer-events: none;
}

.cli__edit {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 1.6em;
}

.cli__mirror {
  display: block;
  white-space: pre;
  pointer-events: none;
}

.ghost {
  color: var(--t-dim);
  opacity: 0.75;
}

.cli__caret {
  position: absolute;
  top: 0.12em;
  left: calc(var(--col, 0) * 1ch);
  width: 1ch;
  height: 1.36em;
  background: var(--t-acc);
  opacity: 0.85;
  mix-blend-mode: screen;
  pointer-events: none;
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

#cli-input {
  position: absolute;
  inset: 0;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: none;
  color: transparent;
  caret-color: transparent;
  font: inherit;
  line-height: inherit;
}

#cli-input::selection {
  background: color-mix(in srgb, var(--t-acc) 35%, transparent);
  color: transparent;
}

.cli__menu {
  max-width: 72ch;
  margin-top: 0.625rem;
}

.cli__menu[hidden] {
  display: none;
}

.cli__opt {
  display: grid;
  grid-template-columns: 2ch 20ch minmax(0, 1fr);
  padding: 0.0625rem 0.5rem;
  margin-left: -0.5rem;
  border-radius: 3px;
  color: var(--t-dim);
  cursor: pointer;
}

.cli__opt.is-active {
  background: color-mix(in srgb, var(--t-acc) 13%, transparent);
  color: var(--t-fg);
}

.cli__mark {
  color: var(--t-acc);
}

.cli__name {
  color: var(--t-fg);
}

.cli__name b {
  color: var(--t-acc);
}

.cli__status {
  flex: none;
  display: flex;
  align-items: center;
  gap: 1.5ch;
  height: 1.75rem;
  border-top: 1px solid var(--line);
  background: rgba(5, 8, 12, 0.6);
  font-size: 0.75rem;
  color: var(--t-dim);
  padding-right: var(--pad);
}

.st--brand {
  align-self: stretch;
  display: flex;
  align-items: center;
  padding: 0 1.5ch;
  background: var(--t-acc);
  color: #06120f;
  font-weight: 700;
}

.st[data-path] {
  color: var(--t-arg);
}

.st--keys {
  margin-left: auto;
}

.st--keys kbd {
  margin-left: 1.5ch;
  font: inherit;
  color: var(--t-fg);
}

.st--right {
  margin-left: 2ch;
}

.cli__matrix {
  position: absolute;
  inset: 0;
  z-index: 6;
  width: 100%;
  height: 100%;
  background: #05080c;
}

/* La barra resta visibile sopra al terminale, senza la navigazione. */
.cli-on {
  overflow: hidden;
}

.cli-on body {
  overflow: hidden;
}

.cli-on #gui {
  visibility: hidden;
}

.cli-on .bar__nav {
  display: none;
}

.cli-on .bar::before {
  opacity: 0;
}

.cli-on .bar {
  border-bottom: 1px solid var(--line);
}

.cli-on .bar__logo {
  margin-right: 0;
}

.cli-on .bar__title {
  display: block;
  flex: 1;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.is-switching #gui {
  opacity: 0;
  filter: blur(8px);
  transform: scale(0.985);
}

.is-switching .bar__nav {
  opacity: 0;
  transition: opacity 0.3s ease;
}

@media (min-width: 1600px) {
  #cli {
    font-size: 0.9375rem;
  }
}

/* 6. Stati e accessibilità ----------------------------------------------- */

.no-webgl #field {
  display: none;
}

.no-webgl .hero__fallback,
html:not(.js) .hero__fallback {
  display: block;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .js .line > span,
  .js .reveal {
    opacity: 1;
    transform: none;
  }
}
