/* k-hole site: page layout and scroll scenes on top of Quiet Glass UI (vendor/quiet-glass).
   Components come from the library unchanged; this file only places them, with its tokens.
   Unlayered on purpose: it sits above the library's @layer qg.* rules. */

:root {
  --site-max: 1400px;
  --site-gutter: max(16px, 4vw);
  --site-bar: 64px;
}

html {
  scroll-padding-top: calc(var(--site-bar) + 16px);
}
body {
  background: var(--q-bg);
  color: var(--q-ink);
  overflow-x: clip;
}

/* Screenshots never distort: width follows the column, height follows the ratio. */
img {
  height: auto;
}

.site-skip {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: calc(var(--q-z-topbar) + 1);
}
.site-skip:focus {
  top: 12px;
}

/* ---- the top bar (qg-topbar is fixed glass; the site only sets its content) -------------- */
.site-bar {
  --q-bar-h: var(--site-bar);
}
.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--q-ink);
  text-decoration: none;
  font-size: 22px;
}
.site-brand svg {
  width: 26px;
  height: 26px;
  color: var(--q-ink);
}
.site-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--q-space-1);
}
.site-nav a:not(.qg-btn) {
  color: var(--q-ink-2);
  text-decoration: none;
  font-size: var(--q-text-md);
  font-weight: var(--q-weight-medium);
  padding: 8px 12px;
  border-radius: var(--q-radius-sm);
  transition: color var(--q-dur-fast), background var(--q-dur-fast);
}
.site-nav a:not(.qg-btn):hover {
  color: var(--q-ink);
  background: hsl(var(--q-hue) 20% 90% / 0.06);
}
.site-nav a[aria-current='page'] {
  color: var(--q-ink);
}
@media (max-width: 560px) {
  .site-nav .site-nav__extra {
    display: none;
  }
  .site-nav a:not(.qg-btn) {
    padding: 8px;
  }
}

/* ---- page frame ------------------------------------------------------------------------ */
.site-main {
  position: relative;
  z-index: 1;
  padding-top: var(--site-bar);
}
.wrap {
  width: min(100% - 2 * var(--site-gutter), var(--site-max));
  margin-inline: auto;
}
.site-section {
  padding-block: clamp(72px, 11vw, 140px) 0;
}
.site-head {
  display: grid;
  gap: var(--q-space-4);
  max-width: 68ch;
}
.site-head.is-center {
  margin-inline: auto;
  text-align: center;
  justify-items: center;
}

h1, h2, h3 {
  text-wrap: balance;
}
.site-h1 {
  font-size: clamp(2.5rem, 6.4vw, 4.75rem);
  font-weight: var(--q-weight-medium);
  line-height: 1.04;
  letter-spacing: -0.035em;
}
.site-h2 {
  font-size: clamp(1.875rem, 3.8vw, 3rem);
  font-weight: var(--q-weight-medium);
  line-height: 1.1;
  letter-spacing: -0.025em;
}
.site-h1 b,
.site-h2 b {
  font-weight: var(--q-weight-semibold);
  color: var(--q-accent);
}
.site-lede {
  font-size: clamp(1.0625rem, 1.5vw, 1.25rem);
  line-height: 1.55;
  color: var(--q-ink-2);
  max-width: 62ch;
  text-wrap: pretty;
}
.site-body {
  font-size: var(--q-text-lg);
  line-height: 1.6;
  color: var(--q-ink-2);
  text-wrap: pretty;
}
.site-note {
  font-size: var(--q-text-sm);
  color: var(--q-ink-muted);
}

/* keyboard chips */
kbd {
  display: inline-block;
  font: var(--q-weight-medium) 0.8125rem/1 var(--q-font-mono);
  padding: 4px 7px 5px;
  border-radius: 6px;
  border: 1px solid var(--q-line-2);
  border-bottom-width: 2px;
  background: var(--q-surface-3);
  color: var(--q-ink);
  white-space: nowrap;
  vertical-align: 0.08em;
}
.keys {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

/* ---- screenshot frames ----------------------------------------------------------------- */
.shot {
  display: block;
  border-radius: var(--q-radius-md);
  overflow: hidden;
  border: 1px solid var(--q-glass-edge);
  box-shadow: var(--q-glass-inset), var(--q-elev-3);
  background: var(--q-surface-1);
}
.shot img {
  display: block;
  width: 100%;
  height: auto;
}
a.shot {
  transition: border-color var(--q-dur-base) var(--q-ease);
}
a.shot:hover {
  border-color: var(--q-accent-line);
}
figure.site-fig {
  display: grid;
  gap: var(--q-space-3);
  margin: 0;
}
/* ---- k-chain: a screen in a small graphite body (both pages) ------------------------------ */
.kc-mini {
  position: relative;
  aspect-ratio: 410 / 503;
  border-radius: 13%/ 10.6%;
  overflow: hidden;
  background: #000;
  box-shadow:
    0 0 0 5px hsl(var(--q-hue) 8% 9%),
    0 0 0 6px hsl(0 0% 100% / 0.1),
    0 24px 50px -26px rgb(0 0 0 / 0.9);
  margin: 6px;
}
.kc-mini img {
  display: block;
  width: 100%;
  height: 100%;
}
.kc-row--feat {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(30%, 150px), 1fr));
  gap: clamp(12px, 1.6vw, 20px);
}

/* ---- a picture you can open whole (assets/lightbox.js) ---------------------------------- */
.is-zoomable {
  position: relative;
  cursor: zoom-in;
}
.is-zoomable::after {   /* the expand mark, shown on hover and keyboard focus */
  content: "";
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e8eeec' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 4h6v6M10 20H4v-6M20 4l-7 7M4 20l7-7'/%3E%3C/svg%3E") center / 16px no-repeat,
    hsl(var(--q-hue) 14% 8% / 0.72);
  border: 1px solid hsl(0 0% 100% / 0.14);
  backdrop-filter: blur(10px);
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 220ms var(--q-ease), transform 220ms var(--q-ease);
  pointer-events: none;
  z-index: 5;
}
.is-zoomable:hover::after,
.is-zoomable:focus-visible::after {
  opacity: 1;
  transform: none;
}
.is-zoomable:focus-visible {
  outline: 2px solid var(--q-accent);
  outline-offset: 3px;
}
html.lb-open {
  overflow: hidden;
}
.lb {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--q-ink);
  overflow: hidden;
}
.lb::backdrop {
  background: hsl(var(--q-hue) 16% 4% / 0.9);
  backdrop-filter: blur(14px);
}
.lb__fig {
  position: absolute;
  inset: 0;
  margin: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  padding: 64px max(16px, 5vw) 40px;
}
.lb__img {
  display: block;
  max-width: min(100%, 2400px);
  max-height: calc(100dvh - 150px);
  width: auto;
  height: auto;
  border-radius: 12px;
  border: 1px solid hsl(0 0% 100% / 0.1);
  box-shadow: 0 40px 120px -30px rgb(0 0 0 / 0.85);
  opacity: 0;
  transform: scale(0.985);
  transition: opacity 260ms var(--q-ease), transform 360ms var(--q-ease);
}
.lb__img.is-in {
  opacity: 1;
  transform: none;
}
.lb__cap {
  max-width: 72ch;
  text-align: center;
  color: var(--q-ink-2);
  font-size: var(--q-text-sm);
  line-height: 1.5;
}
.lb__btn {
  position: absolute;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid hsl(0 0% 100% / 0.14);
  background: hsl(var(--q-hue) 14% 12% / 0.8);
  color: var(--q-ink);
  cursor: pointer;
  z-index: 2;
}
.lb__btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.lb__btn:hover {
  background: hsl(var(--q-hue) 14% 18% / 0.9);
}
.lb__btn:focus-visible {
  outline: 2px solid var(--q-accent);
  outline-offset: 2px;
}
.lb__close { top: 14px; right: 14px; }
.lb__prev, .lb__next { top: 50%; translate: 0 -50%; }
.lb__prev { left: 14px; }
.lb__next { right: 14px; }
.lb__count {
  position: absolute;
  top: 24px;
  left: 50%;
  translate: -50% 0;
  margin: 0;
  color: var(--q-ink-muted);
  font-size: var(--q-text-sm);
  font-variant-numeric: tabular-nums;
}
@media (prefers-reduced-motion: reduce) {
  .lb__img, .is-zoomable::after { transition: none; }
}
figure.site-fig figcaption {
  font-size: var(--q-text-sm);
  color: var(--q-ink-muted);
}

/* ---- reveal: only once a script has marked what's already on screen -------------------- */
@media (prefers-reduced-motion: no-preference) {
  .has-motion .rise {
    transition: opacity 520ms var(--q-ease), transform 520ms var(--q-ease);
  }
  .has-motion .rise:not(.is-in) {
    opacity: 0;
    transform: translateY(16px);
  }
}

/* ---- tiers and install ----------------------------------------------------------------- */
.tiers {
  margin-top: var(--q-space-7);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: var(--q-space-4);
  align-items: stretch;
}
.tier {
  padding: var(--q-space-6);
  gap: var(--q-space-4);
}
.tier.is-lead {
  border-color: var(--q-accent-line);
  box-shadow: inset 0 0 0 1px var(--q-accent-line);
}
.tier__name {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--q-space-3);
}
.tier__name h3 {
  font-size: var(--q-text-2xl);
  font-weight: var(--q-weight-medium);
}
.tier ul {
  margin: 0;
  padding-left: 1.1em;
  display: grid;
  gap: 6px;
  color: var(--q-ink-2);
  font-size: var(--q-text-md);
}
.pkgs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ways {
  margin-top: var(--q-space-7);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
  gap: var(--q-space-4);
}
.way {
  padding: var(--q-space-6);
  gap: var(--q-space-4);
}
.way h3 {
  font-size: var(--q-text-xl);
  font-weight: var(--q-weight-medium);
}
.term {
  position: relative;
}
.term .qg-code {
  padding-right: 88px;
}
.term .qg-btn {
  position: absolute;
  top: 8px;
  right: 8px;
}
.qg-code .p {
  color: var(--q-ink-muted);
  user-select: none;
}
.qg-code .c {
  color: var(--q-ink-muted);
}

/* ---- footer ---------------------------------------------------------------------------- */
.site-foot {
  position: relative;
  z-index: 1;
  margin-top: clamp(96px, 12vw, 160px);
  border-top: 1px solid var(--q-line);
  padding-block: var(--q-space-7) calc(var(--q-space-7) + var(--q-safe-bottom));
  color: var(--q-ink-muted);
  font-size: var(--q-text-sm);
}
.site-foot .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: var(--q-space-4);
  justify-content: space-between;
  align-items: center;
}
.site-foot nav {
  display: flex;
  gap: var(--q-space-4);
}
.site-foot a {
  color: var(--q-ink-2);
}

/* ---- features page --------------------------------------------------------------------- */
.feat-intro {
  padding-block: clamp(48px, 8vw, 96px) 0;
  display: grid;
  gap: var(--q-space-5);
}
.feat-layout {
  margin-top: clamp(40px, 6vw, 72px);
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
}
.feat-index {
  position: sticky;
  top: calc(var(--site-bar) + 20px);
  max-height: calc(100vh - var(--site-bar) - 40px);
  overflow: auto;
  padding-bottom: var(--q-space-4);
}
.feat-index .qg-navlist a {
  min-height: 34px;
}
.feat-index .qg-navlist .n {
  margin-left: auto;
  font: var(--q-text-xs) var(--q-font-mono);
  color: var(--q-ink-muted);
}
.feat-group {
  display: grid;
  gap: var(--q-space-6);
  padding-block: 0 clamp(56px, 8vw, 96px);
  scroll-margin-top: calc(var(--site-bar) + 16px);
}
.feat-group + .feat-group {
  border-top: 1px solid var(--q-line);
  padding-top: clamp(48px, 7vw, 80px);
}
.feat-group__head {
  display: grid;
  gap: var(--q-space-3);
  max-width: 70ch;
}
.feat-group__head .site-h2 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
}
.feat-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr));
  gap: var(--q-space-3);
}
.feat-item h3 {
  font-size: var(--q-text-lg);
  font-weight: var(--q-weight-semibold);
  line-height: 1.3;
}
.feat-item p {
  font-size: var(--q-text-md);
  line-height: 1.55;
  color: var(--q-ink-2);
  text-wrap: pretty;
}
.feat-item .keys {
  margin-top: auto;
}
.feat-figs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: var(--q-space-4);
  align-items: start;
}
.feat-sub {
  display: grid;
  gap: var(--q-space-2);
  max-width: 70ch;
  padding-top: var(--q-space-6);
  border-top: 1px solid var(--q-line);
}
.feat-sub h3 {
  font-size: var(--q-text-2xl);
  font-weight: var(--q-weight-semibold);
  line-height: 1.25;
}
.sample-note {
  font-size: var(--q-text-sm);
  color: var(--q-ink-muted);
  max-width: 70ch;
}
.feat-figs.is-one {
  grid-template-columns: minmax(0, 1fr);
}
.keytable {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 0 var(--q-space-6);
  margin: 0;
  padding: 0;
  list-style: none;
}
.keytable li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--q-space-3);
  padding: 10px 0;
  border-bottom: 1px solid var(--q-line);
  color: var(--q-ink-2);
  font-size: var(--q-text-md);
}
@media (max-width: 900px) {
  .feat-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .feat-index {
    position: sticky;
    top: var(--site-bar);
    z-index: 5;
    max-height: none;
    margin-inline: calc(-1 * var(--site-gutter));
    padding: 8px var(--site-gutter);
    background: color-mix(in srgb, var(--q-bg) 92%, transparent);
    -webkit-backdrop-filter: var(--q-glass-filter);
    backdrop-filter: var(--q-glass-filter);
    border-bottom: 1px solid var(--q-line);
    overflow-x: auto;
    scrollbar-width: none;
  }
  .feat-index .qg-navlist {
    flex-direction: row;
    gap: 4px;
    width: max-content;
  }
  .feat-index .qg-navlist a {
    white-space: nowrap;
    min-height: 36px;
  }
  .feat-index .qg-navlist .n,
  .feat-index .qg-navlist svg,
  .feat-index .qg-eyebrow {
    display: none;
  }
  .feat-group {
    scroll-margin-top: calc(var(--site-bar) + 72px);
  }
}

/* the mark's animations beside its card (animated WebP, rendered by tests/quickshell/mark_sheet.py) */
.mark-demos { display: flex; gap: 8px; margin-top: 12px; }
.mark-demos img { width: 56px; height: 56px; border-radius: 12px; }
