/* =========================================================
   QuickDesk — landing page
   ========================================================= */

:root {
  --bg: #000;
  --surface: #121214;
  --surface-2: #1a1a1d;
  --surface-3: #2a2a2e;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);

  --text: #f5f5f7;
  --text-2: #a1a1a6;
  --text-3: #6e6e73;

  --notes: #ffd60a;
  --clip: #0a84ff;
  --ports: #30d158;
  --ai: #bf5af2;
  --red: #ff453a;
  --blue: #0071e3;
  --link: #2997ff;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  /* The mock Ubuntu desktop uses Ubuntu's own font, like the app windows in it. */
  --shell: "Ubuntu Sans", Ubuntu, system-ui, sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --wrap: 1120px;
  --nav-h: 52px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.47 var(--font);
  letter-spacing: -.011em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main { overflow-x: clip; }

img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
::selection { background: rgba(10, 132, 255, .45); }

code {
  font-family: var(--mono);
  font-size: .88em;
}

kbd {
  display: inline-block;
  font: 500 .78em/1.5 var(--font);
  letter-spacing: 0;
  padding: .05em .55em;
  border-radius: 6px;
  color: var(--text);
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .12);
  border-bottom-width: 2px;
  vertical-align: .08em;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding-inline: 24px;
}
.wrap--narrow { max-width: 820px; }

.center { text-align: center; }
.muted { color: var(--text-3); }

/* ---------- Typography ---------- */

.eyebrow {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .01em;
  color: var(--text-2);
}
.eyebrow--accent { color: var(--accent); }

.section-title {
  margin: 0;
  font-size: clamp(38px, 6vw, 72px);
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -.035em;
  text-wrap: balance;
}

.lead {
  margin: 22px auto 0;
  max-width: 680px;
  font-size: clamp(18px, 2vw, 21px);
  line-height: 1.5;
  color: var(--text-2);
}
.lead code { color: var(--text); }

.grad {
  background: linear-gradient(90deg, #ffd60a, #ff9f0a 18%, #ff375f 40%, #bf5af2 62%, #0a84ff 82%, #30d158);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shine 9s ease-in-out infinite alternate;
}
@keyframes shine { to { background-position: 100% center; } }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 0;
  font-size: 17px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color .2s, transform .2s var(--ease), opacity .2s;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn--primary { background: var(--blue); color: #fff; }
.btn--primary:hover { background: #0077ed; }
.btn--secondary { background: rgba(255, 255, 255, .1); color: var(--text); }
.btn--secondary:hover { background: rgba(255, 255, 255, .16); }
.btn--link { background: none; color: var(--link); padding-inline: 8px; }
.btn--link:hover { text-decoration: underline; }
.btn--sm { padding: 6px 14px; font-size: 13px; }
.btn--lg { padding: 15px 30px; font-size: 18px; }

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

/* ---------- Nav ---------- */

.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: calc(var(--nav-h) + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  background: rgba(0, 0, 0, .72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.nav.is-scrolled { border-bottom-color: var(--line); }

.nav__inner {
  height: var(--nav-h);
  max-width: var(--wrap);
  margin: 0 auto;
  padding-inline: 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -.02em;
}
.nav__links {
  display: flex;
  gap: 28px;
  margin-left: auto;
  font-size: 13px;
  color: var(--text-2);
}
.nav__links a { transition: color .2s; }
.nav__links a:hover { color: var(--text); }

/* GitHub links */
.nav__gh { display: grid; place-items: center; margin-left: 24px; color: var(--text-2); transition: color .2s; }
.nav__gh:hover { color: var(--text); }
.nav__gh svg { width: 18px; height: 18px; }

.oss { padding-block: 120px; border-top: 1px solid var(--line); }
.oss__inner { text-align: center; }
.oss__mark { display: inline-grid; place-items: center; width: 64px; height: 64px; margin-bottom: 24px; border-radius: 18px; background: rgba(255, 255, 255, .07); }
.oss__mark svg { width: 34px; height: 34px; }
.oss__cta { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.oss__repo { margin: 22px 0 0; color: var(--text-3); font-size: 14px; }

/* Language switch (nav) */
.lang {
  display: inline-flex;
  gap: 2px;
  margin-left: 16px;
  margin-right: 12px;
  padding: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
}
.lang a {
  padding: 3px 9px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--text-2);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .02em;
  cursor: pointer;
}
.lang a[aria-current] { background: rgba(255, 255, 255, .16); color: var(--text); }
.lang a:hover { color: var(--text); }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding: calc(var(--nav-h) + 120px) 24px 40px;
  text-align: center;
}
.hero__glow {
  position: absolute;
  z-index: -1;
  left: 50%;
  top: 80px;
  width: min(1000px, 120vw);
  height: 560px;
  transform: translateX(-50%);
  background:
    radial-gradient(closest-side at 30% 50%, rgba(255, 214, 10, .16), transparent),
    radial-gradient(closest-side at 55% 45%, rgba(191, 90, 242, .18), transparent),
    radial-gradient(closest-side at 75% 55%, rgba(10, 132, 255, .2), transparent);
  filter: blur(40px);
  pointer-events: none;
}
.hero__title {
  margin: 0;
  font-size: clamp(46px, 9vw, 108px);
  line-height: 1.02;
  font-weight: 700;
  letter-spacing: -.045em;
  text-wrap: balance;
}
.hero__sub {
  margin: 28px auto 0;
  max-width: 700px;
  font-size: clamp(19px, 2.2vw, 24px);
  line-height: 1.42;
  color: var(--text-2);
}
.hero__cta {
  margin-top: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 20px;
}
.hero__meta {
  margin: 18px 0 0;
  font-size: 13px;
  color: var(--text-3);
}

/* ---------- Demo ---------- */

.demo {
  --mode: var(--notes);
  padding: 72px 24px 120px;
  text-align: center;
}

.combo {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin-bottom: 36px;
}
.plus {
  font-size: 22px;
  color: var(--text-3);
  font-weight: 300;
}
.key {
  position: relative;
  display: inline-flex;
  height: 76px;
  min-width: 76px;
  padding: 10px 14px;
  border-radius: 14px;
  font: 500 15px/1 var(--font);
  color: #d2d2d7;
  background: linear-gradient(180deg, #2c2c31 0%, #1b1b1e 100%);
  border: 1px solid rgba(255, 255, 255, .06);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .12),
    inset 0 -4px 0 rgba(0, 0, 0, .45),
    0 1px 0 #000,
    0 14px 28px -10px rgba(0, 0, 0, .9);
  transition: transform .12s ease, box-shadow .12s ease, color .25s;
  user-select: none;
}
.key--mod {
  min-width: 124px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
}
.key__icon { font-size: 17px; color: var(--text-2); }
.key--letter {
  justify-content: center;
  align-items: center;
  font-size: 32px;
  font-weight: 600;
  color: var(--mode);
  text-shadow: 0 0 18px color-mix(in srgb, var(--mode) 55%, transparent);
}
.key.is-down {
  transform: translateY(3px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .08),
    inset 0 -1px 0 rgba(0, 0, 0, .45),
    0 0 0 1px color-mix(in srgb, var(--mode) 55%, transparent),
    0 0 36px -6px var(--mode);
}

.switcher {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--line);
}
.switcher button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px 8px 10px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color .25s, color .25s;
}
.switcher button:hover { color: var(--text); }
.switcher button b {
  font: 600 11px/1 var(--mono);
  padding: 5px 7px;
  border-radius: 7px;
  background: rgba(255, 255, 255, .08);
  transition: background-color .25s, color .25s;
}
.switcher button[aria-selected="true"] { background: var(--surface-3); color: var(--text); }
.switcher [data-mode="notes"][aria-selected="true"] b { background: var(--notes); color: #000; }
.switcher [data-mode="clipboard"][aria-selected="true"] b { background: var(--clip); color: #fff; }
.switcher [data-mode="ports"][aria-selected="true"] b { background: var(--ports); color: #000; }
.switcher [data-mode="ai"][aria-selected="true"] b { background: var(--ai); color: #fff; }

.demo__hint {
  margin: 18px 0 44px;
  font-size: 14px;
  color: var(--text-3);
}

/* Desktop mock */
.desktop {
  position: relative;
  max-width: 1080px;
  margin: 0 auto;
  aspect-ratio: 16 / 10;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--line-2);
  box-shadow: 0 50px 120px -40px rgba(233, 84, 32, .35), 0 30px 80px -30px rgba(0, 0, 0, .9);
  background:
    radial-gradient(110% 90% at 88% 115%, #e95420 0%, transparent 55%),
    radial-gradient(80% 80% at 0% 0%, #6a2c5b 0%, transparent 60%),
    radial-gradient(70% 70% at 60% 25%, #3a0a2c 0%, transparent 70%),
    #1a0614;
  isolation: isolate;
}
.desktop::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(0, 0, 0, .3);
  opacity: 0;
  transition: opacity .35s;
  pointer-events: none;
}
/* No dimming: GNOME does not dim the desktop behind windows or menus. */

.desktop__bar {
  font-family: var(--shell);
  position: absolute;
  inset: 0 0 auto;
  z-index: 3;
  height: 30px;
  padding-inline: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, .78);
  font-size: 12.5px;
  font-weight: 600;
  color: #e8e8ea;
}
.desktop__clock { position: absolute; left: 50%; transform: translateX(-50%); }
.desktop__sys { display: inline-flex; gap: 10px; align-items: center; }
.desktop__sys svg { width: 15px; height: 15px; }

.desktop__dock {
  position: absolute;
  z-index: 2;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
  border-radius: 16px;
  background: rgba(0, 0, 0, .35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.desktop__dock i {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--c), color-mix(in srgb, var(--c) 60%, #000));
}
.desktop__dock i.is-qd { background: none; }
.desktop__dock i.is-qd img { width: 100%; height: 100%; }

.desktop__empty {
  position: absolute;
  inset: 0;
  margin: 0;
  display: grid;
  place-items: center;
  font-size: 15px;
  color: rgba(255, 255, 255, .55);
  transition: opacity .3s;
}
.desktop.has-panel .desktop__empty { opacity: 0; }

.desktop__stage { position: absolute; inset: 30px 0 0; z-index: 2; }

.desktop__toast {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 18px;
  transform: translate(-50%, 12px);
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 13px;
  white-space: nowrap;
  background: rgba(30, 30, 33, .92);
  border: 1px solid var(--line-2);
  opacity: 0;
  transition: opacity .3s, transform .4s var(--ease);
  pointer-events: none;
}
.desktop__toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Panel (shared by demo) ---------- */

.panel {
  --pc: var(--notes);
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(680px, 92%);
  max-height: calc(100% - 40px);
  display: flex;
  flex-direction: column;
  text-align: left;
  font-size: 13.5px;
  line-height: 1.4;
  border-radius: 16px;
  background: rgba(28, 28, 31, .86);
  backdrop-filter: blur(30px) saturate(160%);
  -webkit-backdrop-filter: blur(30px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: 0 40px 90px -20px rgba(0, 0, 0, .85), 0 0 0 .5px rgba(0, 0, 0, .6);
  overflow: hidden;
  opacity: 0;
  transform: translate(-50%, -46%) scale(.96);
  transition: opacity .28s ease, transform .45s var(--ease);
  pointer-events: none;
}
.panel.is-open {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
}
@keyframes blink { 50% { opacity: .35; } }

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

/* AI mode: the combo keys step back, the tray hint takes over */
.combo { transition: opacity .3s; }
.combo__tray {
  height: 0;
  margin: 0;
  overflow: visible;
  font-size: 17px;
  font-weight: 500;
  color: var(--ai);
  opacity: 0;
  transform: translateY(-50px);
  transition: opacity .3s;
  pointer-events: none;
}
#demo.is-tray .combo { opacity: 0; }
.demo.is-tray .combo__tray { opacity: 1; }

/* GNOME Shell: tray buttons and their menus (copied from the real thing) */
.desktop__tray {
  display: grid;
  place-items: center;
  width: 30px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: none;
  cursor: pointer;
  transition: background-color .15s;
}
.desktop__tray:hover { background: rgba(255, 255, 255, .17); }
.desktop__tray.is-active { background: #515151; }
.desktop__tray svg, .desktop__tray img { width: 16px; height: 16px; }
.desktop__ime { padding: 0 6px; font-weight: 500; }
.desktop__quick { display: inline-flex; gap: 10px; align-items: center; padding: 0 6px; }
.desktop__quick svg { width: 15px; height: 15px; }

.shell-menu {
  position: absolute;
  z-index: 3;
  top: 4px;
  left: 0;
  font: 400 14.5px/1.2 var(--shell);
  text-align: left;
  color: #f2f2f2;
  background: #1d1d1d;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .6);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .2s, transform .25s var(--ease);
  pointer-events: none;
}
.shell-menu.is-open { opacity: 1; transform: none; pointer-events: auto; }
.shell-menu ul { margin: 0; padding: 8px 0; list-style: none; }
.shell-menu li { margin: 0 6px; padding: 10px 14px; border-radius: 8px; white-space: nowrap; cursor: pointer; }
.shell-menu li:hover { background: rgba(255, 255, 255, .08); }
.shell-menu li.sep { height: 1px; margin: 6px 14px; padding: 0; background: rgba(255, 255, 255, .13); cursor: default; }
.shell-menu li.sub { display: flex; justify-content: space-between; gap: 40px; }
/* Disabled section titles, and the check ornament of toggle items */
.shell-menu li.head { color: rgba(255, 255, 255, .45); cursor: default; padding-block: 8px 6px; }
.shell-menu li.head:hover { background: none; }
.shell-menu ul:has(.check) li:not(.sep) { padding-left: 34px; position: relative; }
.shell-menu li.check.is-on::before { content: "✓"; position: absolute; left: 13px; }
.shell-menu li.sub::after { content: "›"; font-size: 18px; line-height: .8; }

/* Ports — story rows */
.ports__row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) 70px 100px 112px;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 4px 10px;
  border-radius: 9px;
  font-size: 13px;
  transition: opacity .3s, transform .35s var(--ease), background-color .2s;
}
.ports__row > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ports__row:not(.ports__row--head):not(.is-sel):hover { background: rgba(255, 255, 255, .04); }
.ports__row em { font-style: normal; color: var(--text-3); }
.port {
  justify-self: start;
  font: 500 12px/1 var(--mono);
  padding: 5px 8px;
  border-radius: 6px;
  color: var(--ports);
  background: rgba(48, 209, 88, .12);
}
.ports__act {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  transition: opacity .2s;
}
.ports__row.is-killing { opacity: 0; transform: translateX(24px); }

.mini {
  padding: 4px 11px;
  border: 0;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text);
  background: rgba(255, 255, 255, .1);
  cursor: pointer;
  transition: background-color .2s;
}
.mini:hover { background: rgba(255, 255, 255, .18); }
.mini--danger { color: #ff6961; background: rgba(255, 69, 58, .16); }
.mini--danger:hover { background: rgba(255, 69, 58, .3); }
.mini--pulse { animation: pulse 1.8s ease-out infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 69, 58, .55); }
  100% { box-shadow: 0 0 0 10px rgba(255, 69, 58, 0); }
}

/* ---------- Feature sections ---------- */

.feature { padding-block: 140px; border-top: 1px solid var(--line); }
.feature__head { text-align: center; max-width: 860px; margin: 0 auto 72px; }

.shortcut {
  display: inline-flex;
  gap: 6px;
  margin-bottom: 22px;
}
.shortcut kbd { font-size: 14px; padding: .25em .7em; border-radius: 8px; }
.shortcut kbd:last-child {
  color: #000;
  background: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 60%, #000);
  box-shadow: 0 0 24px -4px var(--accent);
}
.shortcut--sm { margin: 0; gap: 4px; }
.shortcut--sm kbd { font-size: 10.5px; padding: .1em .5em; border-radius: 5px; box-shadow: none; }

.points {
  list-style: none;
  margin: 72px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}
.points li { display: flex; flex-direction: column; gap: 6px; }
.points li::before {
  content: "";
  width: 28px;
  height: 3px;
  border-radius: 2px;
  margin-bottom: 10px;
  background: var(--accent);
}
.points strong { font-size: 19px; letter-spacing: -.02em; }
.points span { color: var(--text-2); font-size: 15px; }
.points code { color: var(--text); }

/* Notes — sync visual */
.sync {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}
.device {
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  overflow: hidden;
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .9);
}
.device__bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
}
.device__bar i, .term__bar i, .terminal__dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #3a3a3e;
}
.device__bar span { margin-left: auto; font-family: var(--mono); }
.device__body { padding: 22px 24px; min-height: 230px; }
.device__text {
  margin: 0;
  white-space: pre-wrap;
  font-size: 16px;
  line-height: 1.65;
}
.device__text::first-line { font-size: 21px; font-weight: 700; letter-spacing: -.02em; }
[data-sync-src].is-typing::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 1.1em;
  margin-left: 1px;
  vertical-align: -.18em;
  background: var(--notes);
  animation: caret 1s steps(1) infinite;
}

.sync__link {
  position: relative;
  width: 150px;
  height: 2px;
  margin-inline: 12px;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .22) 0 6px, transparent 6px 12px);
}
.sync__dot {
  position: absolute;
  top: 50%;
  left: 0;
  width: 10px;
  height: 10px;
  margin-top: -5px;
  border-radius: 50%;
  background: var(--notes);
  box-shadow: 0 0 14px var(--notes);
  opacity: 0;
}
.sync.is-syncing .sync__dot { animation: travel-x 1.1s var(--ease) infinite; }
@keyframes travel-x {
  0% { left: 0; opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { left: calc(100% - 10px); opacity: 0; }
}
.sync__badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
  color: var(--text-2);
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--line);
  transition: color .3s, border-color .3s;
}
.sync__badge svg { width: 11px; height: 11px; flex: none; }
.sync:not(.is-syncing) .sync__badge { color: var(--notes); border-color: color-mix(in srgb, var(--notes) 40%, transparent); }

/* Clipboard — card stack */
.stack {
  position: relative;
  height: 440px;
  --k: 1;
}
.card {
  --x: 0px; --y: 0px; --r: 0deg;
  position: absolute;
  left: 50%;
  top: 50%;
  width: 340px;
  max-width: 82%;
  padding: 18px 20px;
  border-radius: 20px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .85);
  transform: translate(-50%, -50%) translate(calc(var(--x) * var(--k)), calc(var(--y) * var(--k))) rotate(calc(var(--r) * var(--k)));
  transition: transform 1.2s var(--ease) .15s;
}
.card:nth-child(1) { --x: -190px; --y: -70px; --r: -9deg; }
.card:nth-child(2) { --x: 200px;  --y: -90px; --r: 7deg; }
.card:nth-child(3) { --x: -150px; --y: 110px; --r: -4deg; }
.card:nth-child(4) { --x: 60px;   --y: 30px;  --r: 1.5deg; }
.card p { margin: 0; font-size: 15px; color: var(--link); word-break: break-all; }
.card code { font-size: 14px; color: var(--text); }
.card__type {
  display: block;
  margin-bottom: 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-3);
}
.card__meta { display: block; margin-top: 12px; font-size: 12px; color: var(--text-3); }
.card__thumb {
  height: 110px;
  border-radius: 12px;
  background:
    radial-gradient(60% 80% at 80% 100%, #e95420, transparent 60%),
    radial-gradient(60% 80% at 10% 0%, #6a2c5b, transparent 70%),
    #1a0614;
}
.card__swatch { height: 64px; border-radius: 12px; background: var(--clip); }
.card--top {
  border-color: color-mix(in srgb, var(--clip) 60%, transparent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--clip) 18%, transparent), 0 40px 80px -20px rgba(0, 0, 0, .9);
}
.card--top .card__type { color: var(--clip); }
.card__pin { position: absolute; top: 16px; right: 18px; color: var(--notes); }

/* Ports — story */
.story {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 24px;
  align-items: stretch;
}
.term {
  border-radius: 20px;
  background: #0b0b0d;
  border: 1px solid var(--line-2);
  overflow: hidden;
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .9);
}
.term__bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  color: var(--text-3);
}
.term__bar span { margin-left: auto; margin-right: auto; padding-right: 48px; font-family: var(--mono); }
.term__body {
  margin: 0;
  padding: 20px 22px;
  min-height: 250px;
  font: 13.5px/1.7 var(--mono);
  color: #d2d2d7;
  white-space: pre-wrap;
  word-break: break-word;
}
.term__body .p { color: var(--ports); }
.term__body .err { color: #ff6961; }
.term__body .ok { color: var(--ports); }
.term__body .dim { color: var(--text-3); }
.term__body .line-in { display: inline-block; animation: line-in .4s var(--ease) both; }
@keyframes line-in { from { opacity: 0; transform: translateY(6px); } }

.mini-panel {
  position: relative;
  padding: 10px;
  border-radius: 20px;
  background: rgba(28, 28, 31, .9);
  border: 1px solid var(--line-2);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .9);
}
.mini-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px 14px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
  font-size: 15px;
}
.ports__row--story { grid-template-columns: 70px minmax(0, 1fr) 56px 54px; }
.ports__row--story[data-story-row] { background: rgba(255, 69, 58, .08); }
.story__replay {
  position: absolute;
  right: 12px;
  bottom: 10px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}
.story.is-fixed .story__replay { opacity: 1; pointer-events: auto; }

/* Clipboard — files card */
.card .card__text { color: var(--text); word-break: normal; }
.card__files { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 14.5px; }

/* Real app windows: iframes of the demo build (npm run build:demo), so the
   page always shows the UI that ships. JS sets --s to fit the space. */
.appwin {
  position: absolute;
  font-family: var(--shell);
  left: 50%;
  top: 50%;
  width: var(--w);
  height: var(--h);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 12px;
  background: #161618;
  box-shadow: 0 40px 90px -20px rgba(0, 0, 0, .85), 0 0 0 1px rgba(255, 255, 255, .12);
  opacity: 0;
  transform: translate(-50%, -50%) scale(calc(var(--s, 1) * .96));
  transition: opacity .28s ease, transform .45s var(--ease);
  pointer-events: none;
}
.appwin.is-open {
  opacity: 1;
  transform: translate(-50%, -50%) scale(var(--s, 1));
  pointer-events: auto;
}
.appwin iframe { display: block; flex: 1; width: 100%; border: 0; background: #161618; color-scheme: dark; }
/* GNOME (libadwaita) header bar, measured from the real window */
.appwin__bar {
  position: relative;
  flex: none;
  height: 40px;
  display: grid;
  place-items: center;
  background: #222;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}
.appwin__btns { position: absolute; right: 9px; top: 8px; display: flex; gap: 10px; }
.appwin__btns > * {
  width: 24px;
  height: 24px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #373737;
  color: #f5f5f5;
  cursor: pointer;
}
.appwin__btns > *:hover { background: #454545; }
.appwin__btns svg { width: 16px; height: 16px; }
/* Popups are undecorated windows. */
.appwin--popup { border-radius: 4px; }

/* A window shown inline in a feature section, scaled to the column width */
.shot {
  position: relative;
  width: 100%;
  max-width: 980px;
  aspect-ratio: 903 / 643;
  margin: 0 auto;
}
.shot .appwin {
  left: 0;
  top: 0;
  opacity: 1;
  transform: scale(var(--s, 1));
  transform-origin: top left;
  transition: none;
  pointer-events: auto;
  box-shadow: 0 50px 120px -40px rgba(191, 90, 242, .35), 0 30px 80px -30px rgba(0, 0, 0, .9), 0 0 0 1px rgba(255, 255, 255, .12);
}

/* ---------- Bento ---------- */

.bento-section { padding-block: 140px; border-top: 1px solid var(--line); }
.bento {
  margin-top: 64px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.tile {
  padding: 32px;
  min-height: 230px;
  border-radius: 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.tile--wide { grid-column: span 2; }
.tile h3 { margin: 0 0 8px; font-size: 22px; letter-spacing: -.025em; }
.tile p { margin: 0; color: var(--text-2); font-size: 15px; }
.tile__icon {
  width: 44px;
  height: 44px;
  margin-bottom: auto;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--text);
  background: rgba(255, 255, 255, .07);
}
.tile__icon svg { width: 22px; height: 22px; }
.tile__keys { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: auto; padding-bottom: 28px; }
.tile__keys kbd { font-size: 18px; padding: .35em .8em; border-radius: 10px; }
.tile__keys .k-n { color: var(--notes); }
.tile__keys .k-v { color: var(--clip); }
.tile__keys .k-p { color: var(--ports); }

/* ---------- Download ---------- */

.download {
  padding-block: 140px;
  border-top: 1px solid var(--line);
  background: radial-gradient(60% 50% at 50% 0%, rgba(10, 132, 255, .12), transparent 70%);
}
.download__head { margin-bottom: 56px; }
.download__logo {
  margin: 0 auto 28px;
  border-radius: 22px;
  box-shadow: 0 20px 60px -10px rgba(10, 132, 255, .35);
}

/* Release notes */
.whatsnew {
  max-width: 1040px;
  margin: 0 auto 28px;
  padding: 26px 30px;
  text-align: left;
  border-radius: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.whatsnew h3 { margin: 0 0 6px; font-size: 20px; letter-spacing: -.02em; }
.whatsnew h4 { margin: 18px 0 8px; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.whatsnew ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; color: var(--text-2); font-size: 15px; }
.whatsnew code { color: var(--text); }
.whatsnew__all { margin: 16px 0 0; }
.whatsnew .btn--link { padding: 0; font-size: 14px; }

.dl-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 1040px;
  margin: 0 auto;
}
.dl-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 40px 28px 30px;
  border-radius: 26px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.dl-card--primary {
  border-color: color-mix(in srgb, var(--blue) 55%, transparent);
  background: linear-gradient(180deg, rgba(0, 113, 227, .1), var(--surface) 60%);
}
.dl-card__icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  background: rgba(255, 255, 255, .07);
}
.dl-card__icon svg { width: 26px; height: 26px; }
.dl-card h3 { margin: 0 0 6px; font-size: 24px; letter-spacing: -.025em; }
.dl-card p { flex: 1; margin: 0 0 26px; color: var(--text-2); font-size: 15px; }
.dl-card__meta { margin-top: 14px; font-size: 12px; color: var(--text-3); }

.terminal {
  max-width: 1040px;
  margin: 20px auto 0;
  border-radius: 20px;
  background: #0b0b0d;
  border: 1px solid var(--line);
  overflow: hidden;
}
.terminal__bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 10px 16px;
  border-bottom: 1px solid var(--line);
}
.terminal__dots { display: inline-flex; gap: 6px; }
.terminal__title { flex: 1; font-size: 12.5px; color: var(--text-3); }
.terminal__copy {
  padding: 5px 12px;
  border: 0;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
  background: rgba(255, 255, 255, .08);
  cursor: pointer;
  transition: background-color .2s;
}
.terminal__copy:hover { background: rgba(255, 255, 255, .15); }
.terminal pre {
  margin: 0;
  padding: 20px 22px;
  overflow-x: auto;
  font: 14px/1.75 var(--mono);
}
.terminal .p { color: var(--ports); user-select: none; }
.terminal .c { color: var(--text-3); }

.soon { margin: 36px 0 0; text-align: center; font-size: 14px; line-height: 1.9; color: var(--text-3); }
.soon a, .faq details a { color: var(--link); }
.soon a:hover, .faq details a:hover { text-decoration: underline; }

/* ---------- FAQ ---------- */

.faq { padding-block: 140px; border-top: 1px solid var(--line); }
.faq__list { margin-top: 56px; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  position: relative;
  padding: 24px 44px 24px 0;
  list-style: none;
  cursor: pointer;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -.02em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 26px;
  font-weight: 300;
  color: var(--text-2);
  transition: transform .3s var(--ease);
}
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details p { margin: -6px 0 26px; max-width: 680px; color: var(--text-2); }
.faq details code { color: var(--text); }

/* ---------- Footer ---------- */

.footer { border-top: 1px solid var(--line); padding-block: 36px 48px; font-size: 13px; color: var(--text-3); }
.footer__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px; }
.footer .brand { color: var(--text); font-size: 15px; }
.footer__links { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.footer__links a:hover { color: var(--text); }
.footer__copy { margin: 0 0 0 auto; }

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
  .bento { grid-template-columns: repeat(2, 1fr); }
  .dl-grid { grid-template-columns: 1fr; max-width: 520px; }
  .story { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .feature, .bento-section, .download, .faq { padding-block: 96px; }
  .feature__head { margin-bottom: 48px; }
  .points { grid-template-columns: 1fr; gap: 28px; margin-top: 56px; }

  .key { height: 60px; min-width: 60px; font-size: 13px; border-radius: 12px; }
  .key--mod { min-width: 92px; }
  .key--letter { font-size: 26px; }
  .combo { gap: 8px; }
  .plus { font-size: 18px; }

  .desktop { aspect-ratio: auto; height: 500px; border-radius: 18px; }
  .desktop__dock { display: none; }
  .desktop__clock { display: none; }
  .ports__row { grid-template-columns: 64px minmax(0, 1fr) 54px 50px; }
  .ports__row .ports__act .mini:not(.mini--danger) { display: none; }
  .hide-sm { display: none; }
  .combo__tray { transform: translateY(-42px); font-size: 15px; padding-inline: 16px; }

  .sync { grid-template-columns: 1fr; }
  .sync__link {
    width: 2px;
    height: 80px;
    margin: 8px auto;
    background: repeating-linear-gradient(180deg, rgba(255, 255, 255, .22) 0 6px, transparent 6px 12px);
  }
  .sync__dot { left: 50%; top: 0; margin: 0 0 0 -5px; }
  .sync.is-syncing .sync__dot { animation-name: travel-y; }
  .sync__badge { top: 50%; left: 18px; transform: translateY(-50%); }
  .device__body { min-height: 190px; }

  .stack { height: 400px; }
  .card { width: 260px; }
  .card:nth-child(1) { --x: -30px; --y: -120px; --r: -6deg; }
  .card:nth-child(2) { --x: 30px;  --y: -60px;  --r: 5deg; }
  .card:nth-child(3) { --x: -30px; --y: 40px;   --r: -3deg; }
  .card:nth-child(4) { --x: 10px;  --y: 110px;  --r: 1deg; }

  .footer__copy { margin-left: 0; width: 100%; }
}

@keyframes travel-y {
  0% { top: 0; opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { top: calc(100% - 10px); opacity: 0; }
}

@media (max-width: 640px) {
  .nav__links { display: none; }
  .nav__gh { margin-left: auto; }
  .bento { grid-template-columns: 1fr; }
  .tile--wide { grid-column: auto; }
  .tile { min-height: 0; }
  .tile__icon { margin-bottom: 28px; }
  .switcher button { padding: 7px 12px 7px 8px; font-size: 13px; }
  .switcher { display: inline-grid; grid-template-columns: repeat(2, 1fr); border-radius: 22px; }
  .switcher button { justify-content: flex-start; }
  .hero { padding-top: calc(var(--nav-h) + 80px); }
}

@media (max-width: 400px) {
  .key--mod { min-width: 76px; padding: 8px 10px; }
  .key { height: 54px; min-width: 54px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    transition-delay: 0s !important;
  }
}
