/* MAN website: the look of a GNOME app (libadwaita / Adwaita) in MAN navy glass.
   Colours, sizes and shapes follow libadwaita; light or dark follows the computer. */

@font-face {
  font-family: "Adwaita Sans";
  src: url("../fonts/AdwaitaSans-Regular.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  /* MAN navy glass: the same colours as the MAN Bar, the launcher and the
     window frames on the desktop. Always dark, like MAN's desktop. */
  --accent: #3584e4;
  --accent-fg: #ffffff;
  --accent-text: #8cc8ff;
  --navy: 14, 22, 40;
  --glass: rgba(var(--navy), 0.50);
  --glass-strong: rgba(var(--navy), 0.72);
  --glass-blur: blur(22px) saturate(1.6);
  --rim: rgba(255, 255, 255, 0.14);
  --rim-top: rgba(255, 255, 255, 0.22);
  --window-bg: #0b1222;
  --view-bg: var(--glass);
  --headerbar-bg: var(--glass-strong);
  --headerbar-border: var(--rim);
  --card-bg: var(--glass);
  --card-shadow: inset 0 1px 0 var(--rim-top), 0 0 0 1px var(--rim), 0 10px 30px rgba(0, 0, 0, 0.35);
  --fg: #ffffff;
  --fg-dim: rgba(255, 255, 255, 0.68);
  --border: rgba(255, 255, 255, 0.09);
  --button-bg: rgba(255, 255, 255, 0.12);
  --button-hover: rgba(255, 255, 255, 0.18);
  --button-active: rgba(255, 255, 255, 0.28);
  --flat-hover: rgba(255, 255, 255, 0.08);
  --tile-blue: #3584e4; --tile-green: #2ec27e; --tile-yellow: #e5a50a; --tile-orange: #ff7800;
  --tile-red: #e01b24; --tile-purple: #9141ac; --tile-slate: #5e5c64; --tile-teal: #2190a4;
  --man-green: #26ea75;
  --radius: 18px;
  --size: 17px;
  color-scheme: dark;
}
html.big-text { --size: 21px; }

* { box-sizing: border-box; }
html { font-size: var(--size); }
body {
  margin: 0;
  background: var(--window-bg);
  color: var(--fg);
  font-family: "Adwaita Sans", "Cantarell", "Inter", system-ui, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid color-mix(in srgb, var(--accent) 50%, transparent); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 99; background: var(--accent); color: #fff; padding: .4rem .8rem; border-radius: 6px; }

/* Symbolic icons: Adwaita SVGs drawn in the text colour. */
.icon {
  display: inline-block;
  width: 16px; height: 16px;
  flex: none;
  background-color: currentColor;
  -webkit-mask-position: center; mask-position: center;
  -webkit-mask-size: contain; mask-size: contain;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  vertical-align: -3px;
}

/* ---- Header bar with view switcher ---- */
.headerbar {
  position: sticky; top: 0; z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: .5rem;
  min-height: 47px;
  padding: 0 .4rem;
  background: var(--headerbar-bg);
  box-shadow: 0 1px var(--headerbar-border);
}
.brand { display: inline-flex; align-items: center; gap: .55rem; padding: .3rem .5rem; color: var(--fg); font-weight: 800; font-size: 1rem; }
.brand:hover { text-decoration: none; }
.brand img { width: 26px; height: 26px; }
.viewswitcher { display: flex; gap: 2px; justify-self: center; }
.viewswitcher a {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .32rem .85rem;
  border-radius: 6px;
  color: var(--fg);
  font-weight: 700; font-size: .82rem;
}
.viewswitcher a:hover { background: var(--flat-hover); text-decoration: none; }
.viewswitcher a[aria-current="page"] { background: var(--button-bg); }
.hb-end { justify-self: end; display: flex; gap: 6px; align-items: center; }

/* View switcher at the bottom on narrow screens (like a phone app). */
.switcherbar { display: none; }
@media (max-width: 860px) {
  .viewswitcher { display: none; }
  .headerbar { grid-template-columns: 1fr auto; }
  .switcherbar {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    position: sticky; bottom: 0; z-index: 10;
    background: var(--headerbar-bg);
    box-shadow: 0 -1px var(--headerbar-border);
    padding: 4px;
  }
  .switcherbar a {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 6px 2px; border-radius: 6px; color: var(--fg); font-size: .66rem; font-weight: 700;
  }
  .switcherbar a[aria-current="page"] { background: var(--button-bg); }
  .switcherbar a:hover { text-decoration: none; }
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 34px; padding: .3rem .9rem;
  border: 0; border-radius: 6px;
  background: var(--button-bg); color: var(--fg);
  font: inherit; font-weight: 700; font-size: .88rem;
  cursor: pointer;
}
.btn:hover { background: var(--button-hover); text-decoration: none; }
.btn:active { background: var(--button-active); }
.btn.flat { background: transparent; }
.btn.flat:hover { background: var(--flat-hover); }
.btn.suggested { background: var(--accent); color: var(--accent-fg); }
.btn.suggested:hover { background: color-mix(in srgb, var(--accent) 88%, #fff); }
.btn.pill { border-radius: 9999px; padding: .55rem 1.7rem; min-height: 44px; font-size: .95rem; }
.btn.circular { border-radius: 9999px; width: 34px; padding: 0; }

/* ---- Page layout ---- */
main { display: block; }
.clamp { max-width: 960px; margin: 0 auto; padding: 0 18px; }
.clamp.narrow { max-width: 640px; }
section { padding: 2.6rem 0 1rem; }

.statuspage { text-align: center; padding: 3.2rem 0 1.8rem; }
.statuspage .logo { width: 128px; height: 128px; margin-bottom: 1.2rem; }
.statuspage h1 { font-size: 2.3rem; font-weight: 800; margin: 0 0 .35rem; letter-spacing: -.01em; }
.statuspage .tagline { font-size: 1.25rem; font-weight: 700; margin: 0 0 .8rem; }
.statuspage p.desc { max-width: 34rem; margin: 0 auto 1.6rem; color: var(--fg); }
.actions { display: flex; flex-wrap: wrap; gap: .8rem; justify-content: center; }

.title-1 { font-size: 1.85rem; font-weight: 800; margin: 0 0 .4rem; }
.title-2 { font-size: 1.4rem; font-weight: 800; margin: 0 0 .3rem; }
.heading { font-size: .88rem; font-weight: 700; margin: 0 0 .55rem; }
.dim { color: var(--fg-dim); }
.caption { font-size: .8rem; color: var(--fg-dim); }
.center { text-align: center; }

/* ---- Cards ---- */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
}
.screenshot { padding: 0; overflow: hidden; margin: 1rem auto 0; max-width: 900px; }
.screenshot img { display: block; width: 100%; }
.screenshot video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.screenshot.video { max-width: 1000px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.feature { padding: 1.2rem 1.2rem 1.1rem; }
.feature h3 { font-size: 1rem; font-weight: 800; margin: .75rem 0 .3rem; }
.feature p { margin: 0; font-size: .9rem; color: var(--fg-dim); }

/* App-icon style tiles holding a symbolic icon (like GNOME's settings rows). */
.tile {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; border-radius: 12px;
  color: #fff; background: var(--c, var(--tile-blue));
  box-shadow: inset 0 -2px rgba(0, 0, 0, .18);
}
.tile .icon { width: 22px; height: 22px; }
.tile.small { width: 32px; height: 32px; border-radius: 8px; }
.tile.small .icon { width: 16px; height: 16px; }

/* ---- Boxed list (AdwPreferencesGroup) ---- */
.group { margin: 0 0 1.8rem; }
.group > .heading { padding: 0 .4rem; }
.group > .desc { padding: 0 .4rem; margin: -.3rem 0 .7rem; font-size: .85rem; color: var(--fg-dim); }
.boxed-list { list-style: none; margin: 0; padding: 0; background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--card-shadow); overflow: hidden; }
.row {
  display: flex; align-items: center; gap: .9rem;
  min-height: 56px; padding: .6rem .9rem;
  color: var(--fg);
}
.boxed-list > li + li > .row, .boxed-list > .row + .row, .boxed-list > li + li > details > summary { border-top: 1px solid var(--border); }
a.row:hover, summary.row:hover { background: var(--flat-hover); text-decoration: none; }
.row .text { flex: 1; min-width: 0; }
.row .title { display: block; font-weight: 600; }
.row .subtitle { display: block; font-size: .82rem; color: var(--fg-dim); }
.row > .icon { color: var(--fg); opacity: .85; }
.row .suffix { display: flex; gap: 6px; align-items: center; flex: none; }
.row .arrow { opacity: .55; }

/* Expander rows for questions. */
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
details > summary .chev { transition: transform 200ms ease; opacity: .7; }
details[open] > summary .chev { transform: rotate(180deg); }
details .answer { padding: .2rem .9rem 1rem 3.1rem; font-size: .92rem; color: var(--fg); }
details .answer p { margin: .4rem 0; }

/* Small pills (tags) */
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill-tag { display: inline-flex; align-items: center; gap: .35rem; padding: .18rem .65rem; border-radius: 9999px; background: var(--button-bg); font-size: .78rem; font-weight: 600; }
.pill-tag.accent { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent-text); }
.pill-tag.warning { background: color-mix(in srgb, #e5a50a 22%, transparent); color: #f8e45c; }

/* Banner (AdwBanner) */
.banner { display: flex; align-items: center; justify-content: center; gap: 1rem; flex-wrap: wrap; padding: .55rem 1rem; background: color-mix(in srgb, var(--accent) 16%, var(--window-bg)); font-size: .88rem; font-weight: 600; text-align: center; }

/* Two columns: text and picture */
.split { display: grid; grid-template-columns: 1.1fr 1fr; gap: 2rem; align-items: center; }
@media (max-width: 760px) { .split { grid-template-columns: 1fr; } }

/* Wallpapers */
.wallpapers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.wallpapers img { border-radius: 8px; aspect-ratio: 16/10; object-fit: cover; width: 100%; box-shadow: var(--card-shadow); }
@media (max-width: 600px) { .wallpapers { grid-template-columns: repeat(2, 1fr); } }

/* Apps page */
.search {
  display: flex; align-items: center; gap: .5rem;
  height: 40px; padding: 0 .8rem;
  border-radius: 9999px; background: var(--button-bg);
  max-width: 480px; margin: 0 auto 1rem;
}
.search:focus-within { outline: 2px solid color-mix(in srgb, var(--accent) 50%, transparent); }
.search input { flex: 1; border: 0; background: transparent; font: inherit; color: var(--fg); outline: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-bottom: 1.4rem; }
.chips button { border: 0; border-radius: 9999px; padding: .3rem .9rem; background: var(--button-bg); color: var(--fg); font: inherit; font-size: .82rem; font-weight: 700; cursor: pointer; }
.chips button:hover { background: var(--button-hover); }
.chips button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.appgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.app { display: flex; gap: .9rem; align-items: center; padding: .8rem .9rem; }
.app img { width: 48px; height: 48px; flex: none; }
.app .name { font-weight: 700; }
.app .sum { font-size: .82rem; color: var(--fg-dim); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Footer */
footer { padding: 2.4rem 0 3rem; font-size: .8rem; color: var(--fg-dim); text-align: center; }
footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: .3rem 1.2rem; margin-bottom: .8rem; font-weight: 600; }
footer nav a { color: var(--fg-dim); }
footer p { max-width: 44rem; margin: .3rem auto; }

[hidden] { display: none !important; }
@media (max-width: 560px) {
  .row { flex-wrap: wrap; }
  .row .text { flex-basis: calc(100% - 4rem); }
  .row .suffix { width: 100%; justify-content: flex-end; }
}

section[id] { scroll-margin-top: 72px; }

/* ---- MAN navy glass ---- */
/* The MAN galaxy behind every page, dimmed to navy so text stays easy to read. */
body { background: var(--window-bg); }
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(var(--navy), 0.55) 0%, rgba(var(--navy), 0.78) 55%, rgba(var(--navy), 0.92) 100%),
    url("../images/galaxy.webp") center / cover no-repeat;
}
.headerbar, .switcherbar, .card, .boxed-list, .banner, .search, .chips button, .btn:not(.suggested):not(.flat), .pill-tag:not(.accent):not(.warning) {
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
}
/* The header bar floats like the MAN Bar: a rounded glass pill with a bright rim. */
.headerbar {
  top: 10px; margin: 10px auto 0; width: calc(100% - 20px); max-width: 1200px;
  border-radius: 20px; padding: 0 .5rem;
  box-shadow: inset 0 1px 0 var(--rim-top), 0 0 0 1px var(--rim), 0 8px 24px rgba(0, 0, 0, 0.35);
}
.viewswitcher a { border-radius: 9999px; }
.viewswitcher a[aria-current="page"] { background: var(--accent); color: #fff; }
@media (max-width: 860px) {
  .switcherbar {
    bottom: 10px; margin: 0 10px 10px; border-radius: 20px;
    box-shadow: inset 0 1px 0 var(--rim-top), 0 0 0 1px var(--rim), 0 8px 24px rgba(0, 0, 0, 0.35);
  }
  .switcherbar a { border-radius: 14px; }
  .switcherbar a[aria-current="page"] { background: var(--accent); color: #fff; }
}
/* Buttons are glass capsules; the main button is glossy MAN blue. */
.btn { border-radius: 9999px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 0 0 1px rgba(255, 255, 255, 0.08); }
.btn.flat { box-shadow: none; }
.btn.suggested {
  background: linear-gradient(180deg, #4a95ec, #2a72d0);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.12), 0 6px 18px rgba(53, 132, 228, 0.35);
}
.btn.suggested:hover { background: linear-gradient(180deg, #5aa2f0, #3580dc); }
.banner {
  max-width: 1200px; margin: 12px auto 0; width: calc(100% - 20px); border-radius: 16px;
  background: rgba(53, 132, 228, 0.22);
  box-shadow: inset 0 1px 0 var(--rim-top), 0 0 0 1px var(--rim);
}
.boxed-list > li + li > .row, .boxed-list > .row + .row, .boxed-list > li + li > details > summary { border-top-color: rgba(255, 255, 255, 0.08); }
.search { box-shadow: inset 0 1px 0 var(--rim-top), 0 0 0 1px var(--rim); }
.chips button { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 0 0 1px rgba(255, 255, 255, 0.08); }
.screenshot { border-radius: 20px; }
.statuspage .logo { filter: drop-shadow(0 0 28px rgba(38, 234, 117, 0.35)); }
.statuspage h1, .title-1 { text-shadow: 0 2px 18px rgba(0, 0, 0, 0.45); }
footer { color: var(--fg-dim); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root { --glass: rgba(var(--navy), 0.88); --glass-strong: rgba(var(--navy), 0.94); }
}
