/* ============================================================
   nyxisOS stylesheet
   black, editorial, terminal-flavored. one accent. no noise.
   ============================================================ */

:root {
  --bg: #0b0b0c;
  --bg-2: #101013;
  --bg-3: #15151a;
  --line: #202026;
  --line-soft: #1a1a1f;
  --ink: #ebe9e2;
  --muted: #8b8a82;
  --dim: #5c5b55;
  --accent: #a78bfa;
  --accent-ink: #0b0b0c;
  --accent-dim: rgba(167, 139, 250, 0.12);

  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", "SF Mono", monospace;

  --pad: clamp(20px, 5vw, 72px);
  --maxw: 1440px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.is-locked { overflow: hidden; }
img, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol { list-style: none; }
b { font-weight: 500; color: var(--ink); }

.mono { font-family: var(--font-mono); }
.dim { color: var(--dim); }
.is-hidden { display: none; }

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

/* thin scrollbar, on-theme */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #2a2a30; border: 3px solid var(--bg); border-radius: 8px; }

/* ---------- grain ---------- */
.grain {
  position: fixed;
  inset: -100%;
  width: 300%;
  height: 300%;
  pointer-events: none;
  z-index: 90;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 9s steps(10) infinite;
}
@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-4%, 3%); }
  40% { transform: translate(3%, -5%); }
  60% { transform: translate(-3%, -2%); }
  80% { transform: translate(5%, 4%); }
}

/* ============================================================
   PRELOADER
   ============================================================ */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  transition: transform 0.8s var(--ease) 0.1s;
}
.preloader.is-done {
  transform: translateY(-100%);
  pointer-events: none;
}
.preloader__logo {
  width: 176px;
  height: auto;
  display: block;
  animation: markIn 0.7s var(--ease) both;
}
@keyframes markIn {
  from { opacity: 0; transform: scale(0.82); }
  to { opacity: 1; transform: scale(1); }
}
.preloader__bar {
  width: 180px;
  height: 2px;
  border-radius: 2px;
  background: var(--line);
  overflow: hidden;
}
.preloader__bar span {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--accent);
}
.preloader__pct {
  position: absolute;
  right: 28px;
  bottom: 22px;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--dim);
}

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px var(--pad);
  transition: background 0.3s, border-color 0.3s, padding 0.3s;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(11, 11, 12, 0.85);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-color: var(--line-soft);
  padding-top: 12px;
  padding-bottom: 12px;
}
.nav__brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 21px;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 9px;
  white-space: nowrap;
}
.nav__logo {
  width: 148px;
  height: auto;
  display: block;
}
.nav__links {
  display: flex;
  gap: clamp(20px, 3vw, 44px);
}
.nav__links a {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  position: relative;
  transition: color 0.2s;
}
.nav__links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  height: 1px;
  width: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s var(--ease);
}
.nav__links a:hover { color: var(--ink); }
.nav__links a:hover::after { transform: scaleX(1); transform-origin: left; }
.nav__cta {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent-ink);
  background: var(--accent);
  padding: 9px 18px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.2s var(--ease), background 0.2s;
}
.nav__cta:hover { transform: translateY(-1px); background: #beb0ff; }
.nav__burger { display: none; flex-direction: column; gap: 6px; padding: 6px; }
.nav__burger span {
  width: 22px;
  height: 2px;
  background: var(--ink);
  transition: transform 0.3s var(--ease);
}
.nav__burger.is-open span:first-child { transform: translateY(4px) rotate(45deg); }
.nav__burger.is-open span:last-child { transform: translateY(-4px) rotate(-45deg); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 120px var(--pad) 96px;
  overflow: hidden;
  background:
    radial-gradient(900px 520px at 82% -10%, rgba(167, 139, 250, 0.05), transparent 60%),
    radial-gradient(700px 500px at 0% 100%, rgba(167, 139, 250, 0.035), transparent 60%),
    var(--bg);
}
#heroCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.9;
}
.hero__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--line-soft) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line-soft) 1px, transparent 1px);
  background-size: 72px 72px;
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 40%, black 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 90% 70% at 50% 40%, black 20%, transparent 75%);
  opacity: 0.5;
}
.hero__inner { position: relative; z-index: 2; max-width: 760px; }
.hero__eyebrow {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 28px;
  opacity: 0;
  animation: fadeUp 0.8s var(--ease) forwards;
}
.hero__eyebrow .d { color: var(--accent); }
.hero__title {
  font-family: var(--font-display);
  font-size: clamp(58px, 11vw, 148px);
  line-height: 0.95;
  font-weight: 700;
  letter-spacing: -0.045em;
}
.hero__title .line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.08em;
  margin-bottom: -0.08em;
}
.hero__title .w {
  display: inline-block;
  transform: translateY(110%);
  will-change: transform;
}
.hero.is-in .hero__title .w { animation: rise 1s var(--ease) forwards; }
.hero.is-in .hero__title .line:nth-child(2) .w:nth-child(1) { animation-delay: 0.14s; }
.hero.is-in .hero__title .line:nth-child(2) .w:nth-child(2) { animation-delay: 0.24s; }
.w--accent { color: var(--accent); }
@keyframes rise {
  to { transform: translateY(0); }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
.hero__sub {
  margin-top: 28px;
  max-width: 520px;
  color: var(--muted);
  font-size: clamp(15px, 1.5vw, 17px);
  opacity: 0;
  animation: fadeUp 0.8s var(--ease) 0.35s forwards;
}
.hero__cta {
  margin-top: 36px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp 0.8s var(--ease) 0.5s forwards;
}

/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 14px;
  padding: 15px 26px;
  border-radius: 8px;
  letter-spacing: 0.01em;
}
.btn--primary {
  background: var(--accent);
  color: var(--accent-ink);
  transition: transform 0.2s var(--ease), background 0.2s;
}
.btn--primary:hover { transform: translateY(-2px); background: #beb0ff; }
.btn--ghost {
  border: 1px solid var(--line);
  color: var(--ink);
  transition: border-color 0.2s, background 0.2s, transform 0.2s var(--ease);
}
.btn--ghost:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
  transform: translateY(-2px);
}

/* scroll hint */
.hero__scroll {
  position: absolute;
  left: var(--pad);
  bottom: 34px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  color: var(--dim);
  transition: color 0.2s;
}
.hero__scroll:hover { color: var(--ink); }
.hero__mouse {
  width: 18px;
  height: 30px;
  border: 1.5px solid currentColor;
  border-radius: 10px;
  position: relative;
}
.hero__wheel {
  position: absolute;
  top: 5px;
  left: 50%;
  width: 2px;
  height: 6px;
  margin-left: -1px;
  background: var(--accent);
  border-radius: 2px;
  animation: wheel 1.8s var(--ease) infinite;
}
@keyframes wheel {
  0% { transform: translateY(0); opacity: 1; }
  70% { transform: translateY(9px); opacity: 0; }
  100% { transform: translateY(0); opacity: 0; }
}

/* ============================================================
   MARQUEE
   ============================================================ */
.marquee {
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  overflow: hidden;
  padding: 16px 0;
  background: var(--bg-2);
}
.marquee__track {
  display: flex;
  width: max-content;
  animation: marquee 26s linear infinite;
  will-change: transform;
}
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__group {
  display: flex;
  align-items: center;
  gap: 44px;
  padding-right: 44px;
  flex: none;
}
.marquee__group > span {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: 0.22em;
  color: var(--muted);
  text-transform: uppercase;
  white-space: nowrap;
}
.marquee__group > span:nth-child(even) { color: var(--accent); font-size: 9px; }
@keyframes marquee {
  to { transform: translateX(-50%); }
}

/* ============================================================
   SECTIONS
   ============================================================ */
#what, #features, #download { scroll-margin-top: 72px; }
.sec {
  position: relative;
  padding: clamp(90px, 11vw, 170px) var(--pad);
  max-width: var(--maxw);
  margin: 0 auto;
}
.sec__head { display: flex; align-items: baseline; gap: 18px; margin-bottom: clamp(48px, 6vw, 92px); }
.sec__num { color: var(--accent); font-size: 13px; letter-spacing: 0.12em; }
.sec__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(30px, 4.6vw, 58px);
  letter-spacing: -0.03em;
  line-height: 1;
}
.sec__sub {
  margin-left: auto;
  max-width: 300px;
  text-align: right;
  color: var(--muted);
  font-size: 14px;
}
@media (max-width: 720px) {
  .sec__sub { display: none; }
}

/* reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.reveal.is-in { opacity: 1; transform: none; }

/* ============================================================
   WHAT
   ============================================================ */
.what { background: var(--bg); }
.what__lead {
  font-family: var(--font-display);
  font-size: clamp(24px, 3.4vw, 42px);
  line-height: 1.22;
  letter-spacing: -0.02em;
  max-width: 900px;
  margin-bottom: clamp(56px, 7vw, 110px);
}
.what__body { display: grid; grid-template-columns: 300px 1fr; gap: clamp(28px, 4vw, 80px); }
.what__tabs {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-self: start;
}
.what__tabs button {
  font-family: var(--font-mono);
  font-size: 13px;
  text-align: left;
  color: var(--dim);
  padding: 12px 14px 12px 20px;
  border-left: 2px solid var(--line-soft);
  transition: color 0.2s, border-color 0.2s;
}
.what__tabs button:hover { color: var(--ink); }
.what__tabs button.is-on {
  color: var(--accent);
  border-left-color: var(--accent);
  background: linear-gradient(90deg, var(--accent-dim), transparent 80%);
}
.what__panel {
  font-size: clamp(14px, 1.4vw, 16px);
  line-height: 1.9;
  color: var(--muted);
  max-width: 620px;
  animation: fadeUp 0.5s var(--ease);
}
.what__panel b { color: var(--ink); }
.what__panel .dim { margin-top: 18px; }
.what__giant {
  margin-top: clamp(80px, 10vw, 150px);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(64px, 13vw, 190px);
  line-height: 0.92;
  letter-spacing: -0.05em;
  text-align: center;
  color: transparent;
  -webkit-text-stroke: 1px #2c2c33;
  user-select: none;
}
.what__giant .giant__line { display: block; }
.what__giant .giant__line:last-child { color: var(--accent); -webkit-text-stroke: 0; }

@media (max-width: 860px) {
  .what__body { grid-template-columns: 1fr; }
  .what__tabs { flex-direction: row; overflow-x: auto; border-bottom: 1px solid var(--line-soft); }
  .what__tabs button { border-left: 0; border-bottom: 2px solid transparent; padding: 10px 16px; white-space: nowrap; }
  .what__tabs button.is-on { border-bottom-color: var(--accent); }
}

/* ============================================================
   FEATURES
   ============================================================ */
.feats { background: var(--bg-2); border-top: 1px solid var(--line-soft); }
.feats__list { counter-reset: feat; }
.feat { border-top: 1px solid var(--line-soft); }
.feat:last-child { border-bottom: 1px solid var(--line-soft); }
.feat a {
  display: grid;
  grid-template-columns: 90px 1fr 1.2fr 44px;
  align-items: baseline;
  gap: clamp(16px, 3vw, 48px);
  padding: clamp(34px, 4vw, 56px) clamp(10px, 1.5vw, 26px);
  position: relative;
  transition: background 0.35s, padding 0.35s var(--ease);
}
.feat__num { color: var(--dim); font-size: 13px; transition: color 0.3s; }
.feat__title {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.6vw, 34px);
  font-weight: 500;
  letter-spacing: -0.02em;
  transition: transform 0.35s var(--ease);
}
.feat__desc { color: var(--muted); font-size: 14.5px; line-height: 1.7; }
.feat__arrow {
  font-size: 22px;
  color: var(--dim);
  transition: color 0.3s, transform 0.35s var(--ease);
  justify-self: end;
}
.feat a:hover { background: var(--bg-3); padding-left: 34px; }
.feat a:hover .feat__num { color: var(--accent); }
.feat a:hover .feat__title { transform: translateX(6px); }
.feat a:hover .feat__arrow { color: var(--accent); transform: translate(3px, -3px); }
@media (max-width: 860px) {
  .feat a { grid-template-columns: 50px 1fr 28px; }
  .feat__desc { grid-column: 2 / 3; }
}

/* ============================================================
   DOWNLOAD
   ============================================================ */
.dl { background: var(--bg); }
.dl__card {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg-2);
  box-shadow: 0 50px 100px -60px rgba(0, 0, 0, 0.9);
}
.dl__main { padding: clamp(28px, 4vw, 56px); }
.dl__tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.06em;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
}
.dl__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(34px, 5vw, 62px);
  letter-spacing: -0.04em;
  line-height: 1;
  margin-top: 26px;
}
.dl__ver { color: var(--accent); font-size: 0.5em; letter-spacing: 0; }
.dl__meta {
  margin-top: 40px;
  border-top: 1px solid var(--line-soft);
  padding: 0;
  font-size: 13px;
}
.dl__meta li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 14px 2px;
  border-bottom: 1px solid var(--line-soft);
}
.dl__meta .m-label { color: var(--dim); flex: none; }
.dl__meta .m-value { color: var(--ink); flex: none; }
.dl__meta .dots {
  flex: 1;
  border-bottom: 1px dotted #3a3a42;
  transform: translateY(-4px);
}
.dl__side {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
  padding: clamp(28px, 4vw, 56px);
  background: var(--bg-3);
  border-left: 1px solid var(--line-soft);
}
.btn--soon {
  justify-content: center;
  border: 1px solid var(--line);
  color: var(--dim);
  cursor: not-allowed;
  position: relative;
}
.btn--soon::after {
  content: "iso not published yet";
  position: absolute;
  top: -36px;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--bg-3);
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 6px 10px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.btn--soon:hover::after { opacity: 1; transform: translateX(-50%) translateY(0); }
.dl__note { color: var(--muted); font-size: 13.5px; line-height: 1.7; }
.dl__checksum { font-size: 11.5px; color: var(--ink); letter-spacing: 0.04em; }
@media (max-width: 860px) {
  .dl__card { grid-template-columns: 1fr; }
  .dl__side { border-left: 0; border-top: 1px solid var(--line-soft); }
}

/* ============================================================
   FOOTER
   ============================================================ */
.foot {
  border-top: 1px solid var(--line);
  padding: clamp(56px, 7vw, 100px) var(--pad) 36px;
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  gap: clamp(20px, 4vw, 60px);
}
.foot__brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.02em;
}
.foot__logo {
  width: 184px;
  height: auto;
  display: block;
}
.foot__socials {
  display: flex;
  align-items: center;
  gap: 16px;
  /* allinea le icone sotto la scritta del lockup, non sotto il marchio:
     la wordmark parte a x=74 (viewBox 320), il logo è largo 184px */
  margin-left: calc(184px * 74 / 320);
}
.soc {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  transition: color 0.2s;
}
.soc svg {
  width: 18px;
  height: 18px;
  flex: none;
  transition: transform 0.2s var(--ease);
}
.soc:hover { color: var(--accent); }
.soc:hover svg { transform: translateY(-1px); }
.foot__tagline { color: var(--muted); font-size: 14px; line-height: 1.8; }
.foot__right {
  display: flex;
  align-items: center;
  gap: 13px;
  font-size: 12.5px;
  color: var(--dim);
}
.foot__right a { color: var(--muted); transition: color 0.2s; }
.foot__right a:hover { color: var(--accent); }
.foot__credit {
  color: var(--dim);
  white-space: nowrap;
}
.foot__credit a {
  color: var(--muted);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  transition: color 0.2s, text-decoration-color 0.2s;
}
.foot__credit a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}
.foot__legal { grid-column: 1 / -1; text-align: center; font-size: 11px; letter-spacing: 0.05em; }
@media (max-width: 820px) {
  .foot { grid-template-columns: 1fr; }
  .foot__right { flex-wrap: wrap; }
}

/* ============================================================
   MOBILE NAV
   ============================================================ */
@media (max-width: 860px) {
  .nav__burger { display: flex; }
  .nav__links {
    position: fixed;
    inset: 0;
    background: var(--bg);
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 10px;
    padding: 0 var(--pad);
    transform: translateY(-102%);
    transition: transform 0.5s var(--ease);
    z-index: -1;
  }
  .nav__links.is-open { transform: translateY(0); }
  .nav__links a { font-size: clamp(28px, 8vw, 40px); font-family: var(--font-display); color: var(--ink); }
  .nav__links a::after { display: none; }
  .nav__cta { display: none; }
  .hero { flex-direction: column; align-items: flex-start; justify-content: center; gap: 40px; }
  .hero__scroll { display: none; }
  .what__giant { -webkit-text-stroke-width: 0.75px; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }
  .hero__title .w,
  .reveal { opacity: 1; transform: none; }
  .preloader { display: none; }
  body.is-locked { overflow: auto; }
}