/* Spriteria – stile del sito, con gli stessi token del tema Grafite dell'app
   (components/theme/UThemeTokens.pas): grigi neutri, un solo accento blu per gli
   stati attivi, bordi di 1 px, raggi piccoli, Inter per il testo e JetBrains Mono per i numeri. */

@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("/assets/fonts/Inter-Regular.ttf") format("truetype"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("/assets/fonts/Inter-SemiBold.ttf") format("truetype"); }
@font-face { font-family: "Inter"; font-weight: 700; font-display: swap; src: url("/assets/fonts/Inter-Bold.ttf") format("truetype"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 400; font-display: swap; src: url("/assets/fonts/JetBrainsMono-Regular.ttf") format("truetype"); }

:root {
  --bg: #1F1F1F;          /* BgApp */
  --bg-alt: #1A1A1A;      /* BgInput */
  --panel: #272727;       /* BgPanel */
  --raised: #303030;      /* BgRaised */
  --hover: #3A3A3A;       /* BgHover */
  --pressed: #242424;     /* BgPressed */
  --line: #3A3A3A;        /* Line */
  --surround: #333333;    /* CanvasSurround */
  --checker-a: #3D3D3D;
  --checker-b: #4A4A4A;
  --text: #E8E8E8;
  --muted: #A6A6A6;
  --accent: #2F6BD8;
  --accent-fg: #7AAAFF;
  --on-accent: #FFFFFF;
  --selection: #2B3A55;
  --r-field: 2px;
  --r-btn: 4px;
  --r-panel: 6px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --wrap: 1180px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent-fg); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--selection); }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .6em; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: clamp(26px, 3.2vw, 34px); }
h3 { font-size: 17px; font-weight: 600; }
p { margin: 0 0 1em; }
code, .mono { font-family: var(--mono); font-size: .92em; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; margin: 0 0 .3em; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -40px; z-index: 50; background: var(--accent); color: var(--on-accent); padding: 6px 12px; border-radius: var(--r-btn); }
.skip:focus { top: 8px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.narrow > * { max-width: 820px; }
.px { display: inline-block; flex: none; vertical-align: -3px; }

/* ------------------------------------------------------------ pulsanti */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px;
  background: var(--raised); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--r-btn);
  font: 600 15px/1.3 var(--font);
  cursor: pointer; text-decoration: none;
  transition: background-color .12s, border-color .12s;
}
.btn:hover { background: var(--hover); text-decoration: none; }
.btn:active { background: var(--pressed); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: #3A78E6; border-color: #3A78E6; }
.btn-primary:active { background: #285FC2; }
.btn-small { padding: 6px 12px; font-size: 14px; }
.btn-large { padding: 13px 22px; font-size: 16px; }
.btn .mono { font-weight: 400; opacity: .85; }

/* ------------------------------------------------------------ intestazione */
.top {
  position: sticky; top: 0; z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.top-row { display: flex; align-items: center; gap: 20px; height: 56px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 18px; }
.brand:hover { text-decoration: none; }
.logo { image-rendering: pixelated; display: block; }
.nav { display: flex; gap: 22px; margin-left: auto; }
.nav a { color: var(--muted); font-size: 15px; }
.nav a:hover { color: var(--text); text-decoration: none; }
/* selettore della lingua: una tendina come le combo dell'app */
.langs { position: relative; }
.langs summary {
  display: flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 10px 0 8px;
  background: var(--raised); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--r-btn);
  font-size: 14px; cursor: pointer; list-style: none; user-select: none;
  transition: background-color .12s, border-color .12s;
}
.langs summary::-webkit-details-marker { display: none; }
.langs summary:hover { background: var(--hover); }
.langs[open] summary { border-color: var(--accent); }
.lang-code {
  display: inline-grid; place-items: center;
  min-width: 26px; height: 18px; padding: 0 4px;
  font-size: 11px; font-weight: 400; letter-spacing: .04em;
  color: var(--muted); background: var(--bg-alt);
  border: 1px solid var(--line); border-radius: var(--r-field);
}
.lang-chevron { color: var(--muted); transition: transform .12s; }
.langs[open] .lang-chevron { transform: rotate(180deg); color: var(--accent-fg); }
.lang-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 40;
  min-width: 190px; padding: 4px;
  display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-panel);
  box-shadow: 0 14px 36px rgba(0,0,0,.5);
}
.lang-menu a {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: var(--r-btn);
  color: var(--text); font-size: 14px;
}
.lang-menu a:hover { background: var(--hover); text-decoration: none; }
.lang-menu a[aria-current] { background: var(--selection); }
.lang-menu a[aria-current] .lang-code { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
.lang-menu a[aria-current]::after {
  content: ""; margin-left: auto; width: 6px; height: 6px; background: var(--accent-fg);
}

/* ------------------------------------------------------------ hero */
.hero {
  padding: 72px 0 80px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(31,31,31,.6), var(--bg) 85%),
    repeating-conic-gradient(#232323 0 25%, #1F1F1F 0 50%) 0 0 / 32px 32px;
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 56px; align-items: center; }
.eyebrow { color: var(--accent-fg); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; margin-bottom: 14px; }
.hero-title { display: flex; align-items: flex-end; gap: 14px; font-size: clamp(48px, 7vw, 76px); letter-spacing: -.03em; margin-bottom: 18px; }
.slime {
  display: inline-block; flex: none;
  width: 96px; height: 96px;
  background: url("/assets/img/slime.png") 0 0 / 576px 96px no-repeat;
  image-rendering: pixelated;
  animation: slime .72s steps(6) infinite;
  margin: 0 -6px -.02em -10px;
}
@keyframes slime { to { background-position: -576px 0; } }
.lead { font-size: 19px; color: #CFCFCF; max-width: 34em; }
.pills { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 22px 0 28px; }
.pills li {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 12px; font-size: 14px; font-weight: 600;
  background: var(--panel); border: 1px solid var(--line); border-radius: 999px;
}
.pills li::before { content: ""; width: 6px; height: 6px; background: var(--accent-fg); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* finestra dell'app attorno alle schermate */
.window {
  margin: 0;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,.45), 0 2px 6px rgba(0,0,0,.3);
}
.window > a { display: block; line-height: 0; }
.window > a img { display: block; width: 100%; }
.window-bar .logo { width: 14px; height: 14px; }
.window-bar {
  display: flex; align-items: center; gap: 8px;
  height: 30px; padding: 0 0 0 10px;
  background: var(--bg); border-bottom: 1px solid var(--line);
  color: var(--muted); font-size: 12px;
}
.window-bar span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.window-bar i { position: relative; width: 40px; height: 30px; flex: none; }
.window-bar i::before { content: ""; position: absolute; left: 15px; top: 14px; width: 10px; height: 1px; background: var(--muted); }
.window-bar i:nth-of-type(2)::before { top: 10px; height: 10px; background: none; border: 1px solid var(--muted); width: 10px; box-sizing: border-box; }
.window-bar i:nth-of-type(3)::before, .window-bar i:nth-of-type(3)::after {
  content: ""; position: absolute; left: 14px; top: 14px; width: 12px; height: 1px; background: var(--muted); transform: rotate(45deg);
}
.window-bar i:nth-of-type(3)::after { transform: rotate(-45deg); }
.window figcaption { padding: 10px 14px; font-size: 14px; color: var(--muted); border-top: 1px solid var(--line); background: var(--panel); }

/* ------------------------------------------------------------ sezioni */
.section { padding: 80px 0; }
.section.alt { background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-lead { color: var(--muted); font-size: 18px; margin-bottom: 32px; }
.about-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.about-grid p { color: #CFCFCF; font-size: 17px; }

/* pannelli come quelli della colonna destra dell'app */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-panel); }
.panel-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.panel-head h2, .panel-head h3 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: 0; }
.panel-head .px { color: var(--text); }
.panel-body { padding: 14px; color: var(--muted); font-size: 15px; }
.panel-body > :last-child { margin-bottom: 0; }
.panel-accent { border-color: var(--accent); }
.panel-accent .panel-head { background: var(--selection); }
.panel-accent .panel-body { color: var(--text); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 16px; }
.cards .panel-head .px {
  box-sizing: content-box; padding: 7px;
  background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-btn);
}
.cards .panel:hover .panel-head .px { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

.shots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }

.teaser { display: flex; align-items: center; justify-content: space-between; gap: 32px; }
.teaser > div { max-width: 640px; }
.teaser .mono { color: var(--accent-fg); }

.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 4px; cursor: pointer; list-style: none;
  font-weight: 600; font-size: 17px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: #fff; }
.faq .chevron { color: var(--muted); transition: transform .12s; }
.faq details[open] .chevron { transform: rotate(90deg); color: var(--accent-fg); }
.faq details p { padding: 0 4px 18px 32px; color: var(--muted); margin: 0; }

.support { padding: 48px 0; border-top: 1px solid var(--line); }
.support-row { display: flex; align-items: center; justify-content: space-between; gap: 32px; }
.support h2 { font-size: 22px; margin-bottom: .4em; }
.support p { margin: 0; max-width: 680px; }

/* ------------------------------------------------------------ piè di pagina */
.foot { background: var(--bg-alt); border-top: 1px solid var(--line); padding: 48px 0 24px; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.foot nav { display: flex; flex-direction: column; gap: 6px; }
.foot nav a, .foot-langs a { color: var(--muted); }
.foot nav a:hover, .foot-langs a:hover { color: var(--text); }
.foot-langs { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.foot .brand { margin-bottom: 12px; }
.foot-bottom { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); }

.cookie {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; align-items: center; justify-content: center; gap: 16px;
  padding: 10px 20px;
  background: var(--panel); border-top: 1px solid var(--line);
  font-size: 14px; color: var(--muted);
}
.cookie p { margin: 0; }

/* ------------------------------------------------------------ download */
.page-head { padding: 48px 0 32px; border-bottom: 1px solid var(--line); }
.page-head h1 { font-size: clamp(36px, 5vw, 52px); letter-spacing: -.02em; }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0 0 18px; font-size: 14px; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--line); }
.crumbs a { color: var(--muted); }
.badge {
  display: inline-block; margin: 0 0 16px;
  padding: 3px 10px; font-size: 13px;
  color: var(--accent-fg); border: 1px solid var(--accent); border-radius: var(--r-btn);
  background: rgba(47,107,216,.12);
}
.note { padding: 10px 14px; background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--accent-fg); border-radius: var(--r-btn); width: fit-content; margin-top: 0; }
.packages { padding-top: 40px; padding-bottom: 40px; }
.platform { font-size: 20px; margin: 8px 0 16px; color: var(--muted); font-weight: 600; }
.pkg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 16px; margin-bottom: 24px; }
.pkg .panel-body { display: flex; flex-direction: column; gap: 14px; height: calc(100% - 45px); }
.pkg .panel-body p { margin: 0; flex: 1; }
.pkg .btn { align-self: flex-start; }
.pkg-main { border-color: var(--accent); }
.file-info { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; font-size: 12px; }
.file-info dt { color: var(--muted); }
.file-info dd { margin: 0; color: var(--text); word-break: break-all; }
.hash { color: var(--muted) !important; }
.store { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 20px 22px; margin-bottom: 24px; }
.store h2, .store h3 { margin: 0 0 .3em; font-size: 20px; }
.store p { margin: 0; color: var(--muted); }
.mac-soon { display: flex; align-items: center; gap: 10px; }
.info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.steps, .ticks { margin: 0; padding-left: 20px; }
.steps li, .ticks li { margin-bottom: 8px; }
.code { margin: 0; padding: 10px 12px; background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--r-field); overflow-x: auto; color: var(--text); font-size: 13px; }

.changelog { color: #CFCFCF; }
.changelog h3 { font-size: 18px; margin-top: 1.4em; color: var(--text); }
.changelog h4 { font-size: 15px; margin-top: 1.2em; color: var(--accent-fg); text-transform: uppercase; letter-spacing: .06em; }
.changelog ul, .prose ul { list-style: none; padding: 0; margin: 0 0 1em; }
.changelog li { position: relative; padding-left: 18px; margin-bottom: 6px; }
.changelog li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 6px; height: 6px; background: var(--accent-fg); }
.changelog code { background: var(--panel); padding: 1px 5px; border-radius: var(--r-field); }

.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-panel); }
.versions { width: 100%; border-collapse: collapse; font-size: 15px; }
.versions th, .versions td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.versions thead th { background: var(--panel); color: var(--muted); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
.versions tbody tr:last-child > * { border-bottom: 0; }
.versions tbody tr:hover { background: var(--panel); }
.tag { display: inline-block; padding: 1px 8px; margin: 2px 0; font-size: 12px; font-weight: 600; color: var(--text); background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-btn); }
.tag:hover { background: var(--hover); text-decoration: none; }

.prose h2 { font-size: 22px; margin-top: 1.6em; }
.prose p { color: #CFCFCF; }
.prose .table-scroll { margin: 0 0 1em; }

.notfound { padding: 96px 0; border: 0; }
.big-code { font-size: 96px; line-height: 1; color: var(--line); margin-bottom: 12px; }

/* ------------------------------------------------------------ lightbox */
.lightbox {
  max-width: min(1320px, 96vw); max-height: 96vh; padding: 0;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--r-panel);
  overflow: hidden;
}
.lightbox::backdrop { background: rgba(0,0,0,.8); }
.lightbox img { display: block; max-width: 100%; max-height: calc(96vh - 64px); width: auto; margin: 0 auto; }
.lightbox-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 8px 8px 14px; font-size: 14px; color: var(--muted); border-top: 1px solid var(--line); }

/* ------------------------------------------------------------ schermi piccoli */
@media (max-width: 960px) {
  .hero-grid, .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .nav { display: none; }
  .langs { margin-left: auto; }
  .info-grid, .foot-grid, .shots { grid-template-columns: minmax(0, 1fr); }
  .teaser, .support-row, .store { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 640px) {
  .section { padding: 56px 0; }
  .hero { padding: 48px 0 56px; }
  .top-row { gap: 12px; }
  .top .btn { display: none; }
  .lang-name { display: none; }
  .brand span { font-size: 17px; }
  .cookie { flex-direction: column; align-items: flex-start; gap: 8px; }
  .slime { width: 64px; height: 64px; background-size: 384px 64px; animation-name: slime-small; }
  @keyframes slime-small { to { background-position: -384px 0; } }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .slime { animation: none; }
}
