/* PeOS website: Starlight's Soft UI on the web (design/sito-peos).
   Pearl grey raised surfaces, night and neon for what belongs to the
   system, one accent. */
:root {
  --bg: #e3e6ec;
  --ink: #1a1d26;
  --muted: #5a606e;
  --body: #4f5665;
  --line: #c9ced8;
  --navy: #111626;
  --navy2: #18264c;
  --navy3: #0d1631;
  --deep: #080d1b;
  --blue: #59d0ff;
  --pale: #eaf4ff;
  --code: #c9e8ff;
  --night-muted: #9fb4d8;
  --link: #0b6f99;
  --label: #1f6f93;
  --raised: 9px 9px 20px #b9bec9, -9px -9px 20px #fff;
  --raised-sm: 5px 5px 12px #bcc1cb, -5px -5px 12px #fff;
  --inset: inset 5px 5px 10px #c2c6d0, inset -5px -5px 10px #fff;
  --inset-sm: inset 4px 4px 8px #c2c6d0, inset -4px -4px 8px #fff;
  --bar: rgba(227, 230, 236, .92);
  --nav-ink: #424957;
  --link-hover: #06506f;
  --ok-bg: #d7f1e4; --ok-ink: #15583a;
  --todo-bg: #f7e7cf; --todo-ink: #6d4407;
  --sans: "Outfit", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

/* Night: Starlight's night palette (starlight/src/ui_sdk.c). The night
   panels go a step darker than the page, as in Starlight. */
:root[data-theme="night"] {
  color-scheme: dark;
  --bg: #1a2136;
  --ink: #eaf4ff;
  --muted: #9fb4d8;
  --body: #c3d0e6;
  --line: #2b3352;
  --navy: #0b1020;
  --navy2: #141b30;
  --navy3: #0b1020;
  --deep: #070a16;
  --link: #59d0ff;
  --label: #59d0ff;
  --raised: 9px 9px 20px #0c1020, -9px -9px 20px #2a3354;
  --raised-sm: 5px 5px 12px #0c1020, -5px -5px 12px #2a3354;
  --inset: inset 5px 5px 10px #0c1020, inset -5px -5px 10px #2a3354;
  --inset-sm: inset 4px 4px 8px #0c1020, inset -4px -4px 8px #2a3354;
  --bar: rgba(26, 33, 54, .92);
  --nav-ink: #c3d0e6;
  --link-hover: #9be4ff;
  --ok-bg: #173b2d; --ok-ink: #7fe8bb;
  --todo-bg: #3d2e14; --todo-ink: #ffcf86;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); line-height: 1.6; }
img { max-width: 100%; }
a { color: var(--link); }
a:hover { color: var(--link-hover); }
a:focus-visible, button:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }
code, pre { font-family: var(--mono); }

.wrap { width: min(1160px, calc(100% - 40px)); margin: 0 auto; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 20; padding: 10px 16px; border-radius: 999px; background: var(--navy); color: var(--blue); }
.skip:focus { left: 16px; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 10; background: var(--bar); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.nav { position: relative; min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--ink); }
.brand-mark { width: 38px; height: 38px; border-radius: 13px; background: linear-gradient(145deg, var(--navy2), var(--navy3)); box-shadow: var(--raised-sm); display: grid; place-items: center; color: #fff; }
.brand-name { font-weight: 600; letter-spacing: .08em; line-height: 1.2; }
.brand-name small { display: block; color: var(--muted); font-weight: 400; letter-spacing: .02em; font-size: 12px; }
.navlinks { display: flex; gap: 26px; }
.navlinks a { color: var(--nav-ink); text-decoration: none; font-size: 14px; }
.navlinks a:hover { color: var(--link); }
.menu-toggle { display: none; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--bg); box-shadow: var(--raised-sm); color: var(--ink); cursor: pointer; }
.nav-tools { display: flex; align-items: center; gap: 14px; }
/* Day / night: the moon in the day, the sun at night. */
.theme-toggle { width: 44px; height: 44px; flex: 0 0 44px; border: 0; border-radius: 50%; background: var(--bg); box-shadow: var(--raised-sm); color: var(--ink); cursor: pointer; display: grid; place-items: center; }
.theme-toggle:hover { color: var(--link); }
.theme-toggle .sun, :root[data-theme="night"] .theme-toggle .moon { display: none; }
:root[data-theme="night"] .theme-toggle .sun { display: block; }
/* IT / EN: a segmented control as Starlight's, the language shown on night with the neon. */
.lang-switch { display: flex; gap: 2px; padding: 4px; border-radius: 999px; background: var(--bg); box-shadow: var(--inset-sm); }
.lang-switch a { min-width: 36px; height: 36px; padding: 0 8px; box-sizing: border-box; border-radius: 999px; display: grid; place-items: center; font: 500 12px var(--mono); letter-spacing: .06em; color: var(--muted); text-decoration: none; }
.lang-switch a:hover { color: var(--ink); }
.lang-switch a[aria-current="true"] { background: var(--navy); color: var(--blue); box-shadow: var(--raised-sm); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 46px; padding: 0 20px; border: 0; border-radius: 999px; font: 500 14px var(--sans); text-decoration: none; cursor: pointer; transition: transform .2s; }
.btn:hover { transform: translateY(-2px); }
.btn-dark { background: var(--navy); color: var(--blue); box-shadow: var(--raised-sm); }
.btn-dark:hover { color: #9be4ff; }
.btn-light { background: var(--bg); color: var(--ink); box-shadow: var(--raised-sm); }
.btn-light:hover { color: var(--ink); }
.btn-neon { background: var(--blue); color: var(--navy3); }
.btn-neon:hover { color: var(--navy3); }
.actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* Text */
.eyebrow { display: flex; align-items: center; gap: 10px; font: 500 12px var(--mono); letter-spacing: .13em; text-transform: uppercase; color: var(--label); }
.dot { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 12px var(--blue); }
h1 { font-size: clamp(46px, 6vw, 76px); line-height: .99; letter-spacing: -.055em; font-weight: 400; margin: 22px 0; }
h1 strong { font-weight: 600; }
.lead { font-size: 18px; line-height: 1.75; color: var(--body); max-width: 560px; margin: 0; }
.section { padding: 90px 0; }
.section-head { max-width: 680px; margin-bottom: 34px; }
.section-head h2 { font-size: clamp(32px, 4vw, 46px); line-height: 1.1; letter-spacing: -.04em; font-weight: 400; margin: 14px 0; }
.section-head p { color: var(--muted); font-size: 16px; margin: 0; }
.meta { display: flex; flex-wrap: wrap; gap: 10px 20px; margin-top: 28px; font: 12px var(--mono); color: var(--muted); }
.mono { font-family: var(--mono); }

/* Hero */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 56px; align-items: center; padding: 80px 0 72px; }
.hero .actions { margin-top: 30px; }
.hero-visual { position: relative; }
.shell { padding: 16px; border-radius: 34px; background: var(--bg); box-shadow: var(--raised); transform: rotate(1deg); }
.shot { display: block; width: 100%; height: auto; border-radius: 18px; }
.orbit-card { position: absolute; left: -22px; bottom: -30px; width: 270px; padding: 14px 16px; border-radius: 17px; background: var(--navy); border: 1px solid rgba(159, 180, 216, .22); box-shadow: 0 14px 34px rgba(8, 13, 27, .45); }
.win-head { display: flex; gap: 5px; align-items: center; color: var(--night-muted); font: 10px var(--mono); margin-bottom: 10px; }
.win-head i { width: 7px; height: 7px; border-radius: 50%; background: #2b3352; }
.win-head span { margin-left: auto; }
.term { margin: 0; font: 11px/1.8 var(--mono); color: var(--code); white-space: pre-wrap; overflow-wrap: anywhere; }
.term b { color: var(--blue); font-weight: 400; }
.term .c { color: var(--night-muted); }

/* Cards */
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.card { padding: 28px; border-radius: 28px; box-shadow: var(--raised-sm); }
.card h3 { margin: 0 0 8px; font-size: 19px; font-weight: 500; }
.card p { margin: 0; color: var(--muted); font-size: 14px; }
.icon { width: 48px; height: 48px; border-radius: 16px; background: var(--navy); color: var(--blue); display: grid; place-items: center; margin-bottom: 22px; }
.stats { margin-top: 20px; }
.stat { padding: 22px 24px; border-radius: 23px; box-shadow: var(--raised-sm); display: flex; align-items: center; gap: 15px; }
.stat-no { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 15px; background: var(--navy); display: grid; place-items: center; color: var(--blue); font: 15px var(--mono); }
.stat strong { display: block; font-size: 16px; font-weight: 500; }
.stat small { color: var(--muted); font-size: 13px; }

/* Gallery */
.gallery { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 20px; }
.gallery figure { margin: 0; padding: 12px; border-radius: 26px; box-shadow: var(--raised-sm); }
.gallery figcaption { padding: 12px 6px 4px; font: 12px var(--mono); color: var(--muted); }

/* Night sections */
.night { background: var(--navy); color: var(--pale); }
.night .eyebrow { color: var(--blue); }
.night .section-head p { color: var(--night-muted); }
.night a { color: var(--blue); }
.step { border: 1px solid rgba(159, 180, 216, .2); border-radius: 24px; padding: 26px; background: linear-gradient(145deg, var(--navy2), var(--navy3)); }
.step-no { font: 12px var(--mono); color: var(--blue); letter-spacing: .12em; }
.step h3 { font-weight: 500; font-size: 19px; margin: 12px 0 6px; }
.step p { font-size: 14px; color: var(--night-muted); margin: 0 0 16px; }
.code { margin: 0; font: 12px/1.8 var(--mono); color: var(--code); background: var(--deep); border: 1px solid rgba(159, 180, 216, .18); border-radius: 16px; padding: 14px 16px; white-space: pre-wrap; overflow-wrap: anywhere; }
.note { margin-top: 22px; padding: 16px 20px; border-radius: 16px; background: rgba(89, 208, 255, .08); border: 1px solid rgba(89, 208, 255, .25); color: #b7d8ec; font-size: 14px; }
.note strong { color: var(--pale); font-weight: 500; }

/* Download */
.dl { display: grid; grid-template-columns: 1.1fr .9fr; gap: 30px; align-items: center; padding: 34px; border-radius: 30px; box-shadow: var(--raised); }
.dl h3 { font-size: 28px; font-weight: 500; letter-spacing: -.02em; margin: 0 0 8px; }
.dl p { color: var(--muted); font-size: 15px; margin: 0 0 22px; }
.file { padding: 20px; border-radius: 20px; background: var(--navy); color: var(--pale); display: flex; gap: 16px; align-items: center; }
.file-icon { width: 50px; height: 50px; flex: 0 0 auto; border-radius: 15px; background: var(--navy2); display: grid; place-items: center; color: #fff; }
.file strong { display: block; font-weight: 500; }
.file small { display: block; color: var(--night-muted); font: 11px var(--mono); overflow-wrap: anywhere; }

/* Developers */
.dev { display: grid; grid-template-columns: .9fr 1.1fr; gap: 40px; align-items: center; }
.dev .section-head { margin-bottom: 22px; }
.terminal { border-radius: 24px; background: var(--navy); padding: 22px 24px; box-shadow: var(--raised); }
.terminal .term { font-size: 13px; line-height: 1.9; }

.placeholder { display: inline-block; border: 1px dashed #8f98a9; border-radius: 8px; padding: 3px 9px; color: var(--body); font: 12px var(--mono); }

/* Download page */
.page-hero { padding: 70px 0 40px; }
.page-hero h1 { font-size: clamp(44px, 5.4vw, 64px); line-height: 1; margin: 20px 0 16px; }
.files { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.file-card { padding: 24px; border-radius: 26px; box-shadow: var(--raised-sm); display: flex; flex-direction: column; gap: 14px; }
.file-card.primary { background: var(--navy); color: var(--pale); box-shadow: var(--raised); }
.file-card h3 { margin: 0; font-size: 19px; font-weight: 500; }
.file-card p { margin: 0; color: var(--muted); font-size: 14px; }
.file-card.primary p { color: var(--night-muted); }
.file-card .btn { margin-top: auto; }
.file-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; font: 11px var(--mono); color: var(--muted); }
.file-top span:first-child { letter-spacing: .12em; color: var(--label); }
.primary .file-top { color: var(--night-muted); }
.primary .file-top span:first-child { color: var(--blue); }
.fname { font: 13px var(--mono); color: var(--body); overflow-wrap: anywhere; }
.primary .fname { color: var(--code); }
.sum { padding: 12px 14px; border-radius: 14px; box-shadow: var(--inset-sm); font: 11px/1.7 var(--mono); color: var(--body); overflow-wrap: anywhere; }

/* Older versions: one raised row per release, newest on top */
.versions { display: flex; flex-direction: column; gap: 14px; }
.version { display: flex; align-items: center; justify-content: space-between; gap: 18px 24px; flex-wrap: wrap; padding: 18px 22px; border-radius: 24px; box-shadow: var(--raised-sm); }
.version-id { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.version-id strong { font: 500 20px var(--mono); color: var(--ink); }
.version-id span { color: var(--muted); font-size: 14px; }
.version-files { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-sm { min-height: 38px; padding: 0 16px; font-size: 13px; }
.btn small { font: 11px var(--mono); color: var(--muted); }

.tabs { display: flex; gap: 8px; flex-wrap: wrap; padding: 6px; border-radius: 999px; box-shadow: var(--inset); width: max-content; max-width: 100%; }
.tab { min-height: 40px; padding: 0 18px; border: 0; border-radius: 999px; background: transparent; color: var(--body); font: 500 14px var(--sans); cursor: pointer; }
.tab[aria-selected="true"] { background: var(--navy); color: var(--blue); }
.vm { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 24px; }
.vm[hidden] { display: none; }
.vm-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.vm-head h3 { margin: 0; font-size: 22px; }
.card .vm-host { margin: 0 0 18px; }
.badge { padding: 3px 12px; border-radius: 999px; font: 11px var(--mono); letter-spacing: .08em; white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok-ink); }
.badge.todo { background: var(--todo-bg); color: var(--todo-ink); }
.rows { margin: 0; }
.rows div { display: flex; gap: 16px; padding: 11px 0; border-top: 1px solid var(--line); font-size: 14px; }
.rows dt { flex: 0 0 120px; color: var(--muted); }
.rows dd { flex: 1 1 auto; min-width: 0; margin: 0; }
.vm-code { padding: 24px; border-radius: 26px; background: var(--navy); color: var(--pale); display: flex; flex-direction: column; gap: 14px; }
.vm-code .term { font-size: 13px; line-height: 1.85; flex: 1 1 auto; }
.vm-code .note { margin: 0; font-size: 13px; }
.limit { border: 1px solid rgba(159, 180, 216, .2); border-radius: 20px; padding: 20px 22px; background: linear-gradient(145deg, var(--navy2), var(--navy3)); }
.limit h3 { margin: 0 0 6px; font-size: 16px; font-weight: 500; }
.limit p { margin: 0; color: var(--night-muted); font-size: 13.5px; }

footer { padding: 28px 0 38px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer-inner span:last-child { font-family: var(--mono); }

@media (max-width: 900px) {
  .hero, .dl, .dev, .vm { grid-template-columns: 1fr; }
  .grid3, .files { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery { grid-template-columns: 1fr 1fr; }
  .gallery .big { grid-column: 1 / -1; }
  .navlinks { gap: 16px; }
}
/* The links into the menu button as soon as they do not fit beside the
   download button, the language and the theme (on one line each). */
.navlinks a, .nav .btn { white-space: nowrap; }
@media (max-width: 1080px) {
  .navlinks { display: none; position: absolute; top: 76px; left: 0; right: 0; padding: 14px; border-radius: 20px; background: var(--bg); box-shadow: var(--raised); flex-direction: column; gap: 0; }
  .navlinks.open { display: flex; }
  .navlinks a { padding: 10px; }
  .menu-toggle { display: grid; place-items: center; }
}
@media (max-width: 720px) {
  .wrap { width: calc(100% - 32px); }
  .nav { min-height: 66px; }
  .navlinks { display: none; position: absolute; top: 66px; left: 0; right: 0; padding: 14px; border-radius: 20px; background: var(--bg); box-shadow: var(--raised); flex-direction: column; gap: 0; }
  .navlinks.open { display: flex; }
  .navlinks a { padding: 10px; }
  .nav .btn { display: none; }
  .menu-toggle { display: grid; place-items: center; }
  .nav-tools { gap: 10px; }
  .lang-switch a { min-width: 32px; height: 32px; padding: 0 6px; }
  .hero { padding: 44px 0 64px; gap: 36px; }
  .orbit-card { left: 8px; bottom: -40px; width: 230px; }
  .grid3, .grid2, .gallery, .files { grid-template-columns: 1fr; }
  .section { padding: 56px 0; }
  .dl { padding: 22px; }
  .tabs { width: auto; }
  .rows dt { flex-basis: 96px; }
  .version { flex-direction: column; align-items: stretch; }
  .version-files { display: grid; grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
