/* Keyserver Storefront v2 ------------------------------------------------
   The rules below intentionally form a complete presentation layer over the
   SellAuth utility markup. Data behavior stays native; the interface does not. */
:root {
  --ks-bg: #070707;
  --ks-surface: #0e0e0f;
  --ks-surface-raised: #141415;
  --ks-panel: #101011;
  --ks-ink: #f4f4f5;
  --ks-muted: #8b8b90;
  --ks-dim: #5c5c61;
  --ks-border: rgba(255, 255, 255, .085);
  --ks-border-strong: rgba(255, 255, 255, .15);
  --ks-accent-soft: rgba(var(--cl-accent), .11);
  --ks-mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
}

html { scroll-padding-top: 2rem; }
body {
  font-size: 16px;
  background:
    radial-gradient(circle at 50% -15%, rgba(var(--cl-accent), .13), transparent 28rem),
    var(--ks-bg) !important;
}
body::before {
  height: 100%;
  opacity: .22;
  background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, #000, transparent 45rem);
}

#app.ks-site { width: 100%; max-width: none; margin: 0; padding: 0; }
.ks-site > div:first-child { flex: 1; }
.ks-main { width: min(calc(100% - 4rem), 82rem); margin: 0 auto; }
.announcement { width: min(calc(100% - 4rem), 82rem); margin-right: auto; margin-left: auto; }
.template-shop .ks-main { margin-top: 0; }

/* Announcement */
.announcement { padding-top: .75rem; }
.ks-announcement {
  min-height: 2.3rem; display: flex; align-items: center; justify-content: center; gap: .75rem;
  padding: .45rem .85rem; border: 1px solid rgba(var(--cl-accent), .22) !important;
  border-radius: .55rem; background: rgba(var(--cl-accent), .075) !important;
}
.ks-announcement__label { display: inline-flex; align-items: center; gap: .4rem; color: var(--ks-accent); font: 650 .7rem/1 var(--ks-mono); letter-spacing: .08em; text-transform: uppercase; }
.ks-announcement__label i, .ks-system-state i, .ks-mobile-menu__meta i { width: .38rem; height: .38rem; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px rgba(var(--cl-accent), .12); }
.ks-announcement__track { height: 1.2rem; overflow: hidden; color: #c9c9cc; font-size: .8rem; }

/* Navigation — mirrors the keyserver application's flat top bar. */
.ks-header { position: sticky; top: 0; z-index: 20; width: 100%; margin: 0; padding: 0; border-bottom: 1px solid rgba(255, 255, 255, .07); background: rgba(10, 10, 10, .9); box-shadow: 0 1px 0 rgba(255, 255, 255, .025); backdrop-filter: blur(20px); }
header.component.ks-header > .ks-header__bar {
  width: min(calc(100% - 4rem), 80rem); min-height: 4rem; margin: 0 auto; grid-template-columns: minmax(12rem, 1fr) auto minmax(12rem, 1fr); padding: 0;
  border: 0 !important; border-radius: 0; background: transparent !important; box-shadow: none; backdrop-filter: none;
}
.ks-brand__copy { display: flex; min-width: 0; flex-direction: column; gap: .16rem; }
.ks-brand__name { font-size: 1.08rem; }
.ks-brand__logo { width: 2.5rem; height: 2.5rem; filter: drop-shadow(0 4px 12px rgba(var(--cl-accent), .22)); transition: transform 180ms ease; }
.ks-brand:hover .ks-brand__logo { transform: scale(1.045); }
.ks-nav--desktop { justify-content: center; overflow: visible; }
.ks-nav a { padding: .58rem .72rem; color: #77777c; font-size: .79rem; }
.ks-nav a.is-active { background: rgba(255,255,255,.045); }
.ks-nav a.is-active::after { right: 50%; bottom: -.77rem; left: auto; width: 1rem; transform: translateX(50%); }
.ks-header__actions { gap: .4rem; }
.ks-icon-button { width: 2.35rem; height: 2.35rem; border-radius: .5rem; background: #0d0d0e; }
.ks-menu-button { display: none; }
.ks-mobile-menu { display: none; }

/* Hero */
.ks-hero { position: relative; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(22rem, .9fr); align-items: center; gap: clamp(3rem, 8vw, 8rem); min-height: 34rem; padding: clamp(4.5rem, 9vw, 8rem) 2.5rem; }
.ks-hero::before { content: ""; position: absolute; top: 14%; left: -2rem; width: 1px; height: 54%; background: linear-gradient(transparent, rgba(var(--cl-accent), .55), transparent); }
.ks-kicker { display: flex; align-items: center; gap: .55rem; margin-bottom: 1.15rem; color: #85858a; font: 650 .72rem/1 var(--ks-mono); letter-spacing: .11em; text-transform: uppercase; }
.ks-kicker span { width: 1.65rem; height: 1px; background: var(--ks-accent); box-shadow: 0 0 8px rgba(var(--cl-accent), .5); }
.ks-hero h1 { margin: 0; color: var(--ks-ink); font-size: clamp(3rem, 6vw, 5.8rem); font-weight: 720; line-height: .97; letter-spacing: -.072em; }
.ks-hero h1 em { color: var(--ks-muted); font-style: normal; font-weight: 420; }
.ks-hero__content > p { max-width: 35rem; margin-top: 1.65rem; color: #929297; font-size: .95rem; line-height: 1.75; }
.ks-hero__actions { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: 2rem; }
.ks-button { min-height: 2.75rem; display: inline-flex; align-items: center; justify-content: center; gap: .65rem; padding: .7rem 1rem; border: 1px solid var(--ks-border); border-radius: .55rem; color: #d4d4d6; background: #111112; font-size: .83rem; font-weight: 650; transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease; }
.ks-button svg { width: 1rem; height: 1rem; }
.ks-button:hover { transform: translateY(-1px); border-color: var(--ks-border-strong); background: #171718; }
.ks-button--primary { color: #fff; border-color: rgb(var(--cl-accent)); background: rgb(var(--cl-accent)); box-shadow: 0 10px 30px rgba(var(--cl-accent), .2), inset 0 1px rgba(255,255,255,.2); }
.ks-button--primary:hover { border-color: rgb(var(--cl-accent)); background: rgb(var(--cl-accent)); filter: brightness(1.08); }

.ks-hero__visual { position: relative; overflow: hidden; aspect-ratio: 3 / 2; border: 1px solid var(--ks-border-strong); border-radius: .75rem; background-color: #050505; background-position: center; background-size: cover; }

.ks-trustbar { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--ks-border); border-radius: .7rem; background: rgba(13,13,14,.72); }
.ks-trustbar > div { display: flex; align-items: center; justify-content: center; gap: .8rem; padding: 1.15rem 1rem; border-right: 1px solid var(--ks-border); }
.ks-trustbar > div:last-child { border: 0; }
.ks-trustbar svg { width: 1.25rem; height: 1.25rem; color: var(--ks-accent); }
.ks-trustbar span, .ks-trustbar b, .ks-trustbar small { display: block; }
.ks-trustbar b { color: #c9c9cc; font-size: .79rem; font-weight: 650; }
.ks-trustbar small { margin-top: .18rem; color: #77777d; font: .72rem var(--ks-mono); }

/* Catalog */
.ks-section { position: relative; padding: 6rem 0 3rem; }
.ks-section-anchor { position: absolute; top: 0; }
.ks-section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; margin-bottom: 1.75rem; }
.ks-section-heading .ks-kicker { margin-bottom: .7rem; }
.ks-section-title { margin: 0; color: var(--ks-ink); font-size: clamp(1.7rem, 3vw, 2.35rem); font-weight: 680; letter-spacing: -.05em; }
.ks-section-heading > div > p { margin-top: .55rem; color: #7c7c82; font-size: .9rem; line-height: 1.55; }
.ks-catalog__search { width: min(100%, 21rem); margin: 0; }
.ks-search-field { min-height: 2.8rem; border-radius: .55rem; }
.ks-search-field kbd { min-width: 1.35rem; height: 1.35rem; display: grid; place-items: center; border: 1px solid var(--ks-border); border-radius: .25rem; color: #66666c; background: #171718; font: .66rem var(--ks-mono); }
.ks-search-field input { font-size: .84rem !important; }
.ks-catalog > .ks-section > .flex { gap: 1rem; }
.ks-product-grid__item { width: calc((100% - 2rem) / 3); }
.ks-product-card { min-height: 100%; border-radius: .65rem; background: #0d0d0e; }
.ks-product-card:hover { transform: translateY(-4px); border-color: rgba(var(--cl-accent), .42); background: #111112; box-shadow: 0 18px 50px rgba(0,0,0,.3); }
.ks-product-card__media { margin: .38rem; border-radius: .4rem; }
.ks-product-card__media::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(0,0,0,.08), transparent 55%, rgba(0,0,0,.38)); }
.ks-product-card__type { position: absolute; z-index: 2; bottom: .55rem; left: .6rem; padding: .3rem .42rem; border: 1px solid rgba(255,255,255,.12); border-radius: .3rem; color: #b7b7ba; background: rgba(8,8,9,.72); backdrop-filter: blur(8px); font: 550 .68rem var(--ks-mono); letter-spacing: .06em; text-transform: uppercase; }
.ks-product-card__badges { z-index: 3; }
.ks-product-card__body { gap: .38rem; padding: .68rem .8rem .78rem; }
.ks-product-card__index { color: #606066; font: 550 .6rem var(--ks-mono); letter-spacing: .1em; }
.ks-product-card__heading h3 { font-size: 1.04rem; }
.ks-product-card__arrow { width: 1.75rem; height: 1.75rem; display: grid; flex: none; place-items: center; border: 1px solid var(--ks-border); border-radius: .38rem; color: #65656a; transition: color 160ms ease, border-color 160ms ease, transform 160ms ease; }
.ks-product-card__arrow svg { width: .85rem; height: .85rem; }
.ks-product-card:hover .ks-product-card__arrow { color: #fff; border-color: rgba(var(--cl-accent), .45); transform: translateX(2px); }
.ks-product-card__meta { margin-top: .4rem; padding-top: .7rem; border-top: 1px solid var(--ks-border); }
.ks-product-card__meta span, .ks-product-card__meta strong { font-size: .78rem; }
.ks-product-card__meta span { display: inline-flex; align-items: center; gap: .4rem; }
.ks-product-card__meta span::before { content: ""; width: .36rem; height: .36rem; border-radius: 50%; background: #5aa76d; }

/* SellAuth inner surfaces */
.template-products .component > .py-6, .template-product .component > .py-6, .template-cart .component > .py-6,
.template-feedback .component > .py-6, .template-faq .component > .py-6, .template-status .component > .py-6,
.template-blog .component > .py-6, body[class*="template-customer-"] .container > .relative { padding-top: 4rem !important; padding-bottom: 4rem !important; }
.template-products h1, .template-feedback .component h2, .template-faq .component h2, .template-status .component h2,
.template-blog .component h2 { margin-bottom: 2rem !important; font-size: 2.15rem !important; letter-spacing: -.05em; }
.template-products aside > div { border-radius: .65rem !important; background: #0d0d0e !important; }
.template-products aside label { color: #78787d; font: 600 .7rem var(--ks-mono); letter-spacing: .06em; text-transform: uppercase; }
.template-products aside a { border-radius: .4rem !important; }
.ks-product-content, .ks-product-purchase > div, .ks-cart-page .bg-card,
body[class*="template-customer-"] .bg-card { border-radius: .65rem !important; background: #0d0d0e !important; }
.ks-product-content > div:first-child, .ks-product-purchase > div > div:first-child { background: #121213 !important; }
.ks-product-content .editor { padding: 0 !important; }
.ks-product-purchase .bg-accent-500, .ks-cart-page .bg-accent-500 { border-radius: .5rem !important; }
.ks-review-card { position: relative; overflow: hidden; border-radius: .6rem !important; background: #0d0d0e !important; }
.ks-review-card::before { content: "\201C"; position: absolute; top: -.45rem; right: .65rem; color: rgba(var(--cl-accent), .12); font: 5rem Georgia, serif; }
.ks-review-card__quote { position: relative; line-height: 1.65; }
.ks-category-card { overflow: hidden; border-radius: .65rem !important; background: #0d0d0e !important; transition: transform 180ms ease, border-color 180ms ease !important; }
.ks-category-card:hover { transform: translateY(-4px); border-color: rgba(var(--cl-accent), .35) !important; }
.ks-category-card > div > div:first-child { margin-bottom: .75rem !important; padding: .4rem !important; background: #09090a; }
.ks-category-card img { border-radius: .4rem !important; }
.ks-category-card__body h3 { font-size: 1rem; }
.ks-category-card__body { padding-right: 1rem !important; padding-bottom: 1rem !important; padding-left: 1rem !important; }
.ks-category-card__body p { min-height: 2.5rem; color: #77777c !important; font-size: .84rem !important; line-height: 1.55; }
.ks-category-card__body > span { display: inline-flex; align-items: center; gap: .4rem; font: 600 .73rem var(--ks-mono); text-transform: uppercase; letter-spacing: .04em; }
.ks-faq .bg-card { border-radius: .55rem !important; }
.ks-faq .bg-card:hover { border-color: var(--ks-border-strong) !important; }
.ks-status-card { min-height: 3.75rem; padding: .85rem 1rem; transition: border-color 160ms ease, background-color 160ms ease; }
.ks-status-card:hover { border-color: var(--ks-border-strong) !important; background: #141415 !important; }
.ks-status-card__name { min-width: 0; flex: 1; overflow: hidden; margin: 0; padding: 0; color: rgb(var(--cl-t-primary)); font-size: 1.125rem; font-weight: 600; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.ks-status-card .status { flex: none; }
.ks-product-card__badges span, .ks-account-nav__identity span, .component th { font-size: .72rem; }

/* Footer */
.ks-footer { width: min(calc(100% - 4rem), 82rem); display: block; margin: 5rem auto 0; padding: 0; border: 1px solid var(--ks-border); border-right: 0; border-left: 0; }
.ks-footer__top { display: flex; align-items: center; justify-content: space-between; gap: 3rem; padding: 2.1rem .25rem; }
.ks-footer__brand > a { align-items: flex-start; flex-direction: column; gap: .25rem; }
.ks-footer__brand strong { color: #e3e3e5; font-size: .95rem; }
.ks-footer__brand span { color: #707076; font-size: .76rem; }
.ks-footer__right { flex-direction: row; align-items: center; gap: 1.5rem; }
.ks-footer__bottom { min-height: 3.3rem; display: flex; align-items: center; justify-content: space-between; padding: 0 .25rem; border-top: 1px solid var(--ks-border); color: #65656b; font: .68rem var(--ks-mono); }
.ks-system-state { display: inline-flex; align-items: center; gap: .45rem; color: #75ad82; text-transform: uppercase; letter-spacing: .06em; }

@media (max-width: 1050px) {
  header.component.ks-header > .ks-header__bar { grid-template-columns: minmax(0,1fr) auto; }
  .ks-nav--desktop { display: none; }
  .ks-menu-button { display: grid; }
  .ks-mobile-menu { width: min(calc(100% - 4rem), 80rem); display: block; margin: 0 auto; padding: .55rem 0 .7rem; border: 0; border-top: 1px solid var(--ks-border); border-radius: 0; background: transparent; }
  .ks-mobile-menu .ks-nav { display: grid; grid-template-columns: repeat(3,1fr); }
  .ks-mobile-menu .ks-nav a { text-align: center; }
  .ks-mobile-menu .ks-nav a.is-active::after { display: none; }
  .ks-mobile-menu__meta { display: flex; justify-content: space-between; margin-top: .45rem; padding: .65rem .7rem .1rem; border-top: 1px solid var(--ks-border); color: #68686e; font: .7rem var(--ks-mono); }
  .ks-mobile-menu__meta span:first-child { display: inline-flex; align-items: center; gap: .4rem; color: #75ad82; }
  .ks-hero { grid-template-columns: 1fr 20rem; gap: 3rem; padding-right: 1rem; padding-left: 1rem; }
  .ks-product-grid__item { width: calc((100% - 1rem) / 2); }
}

@media (max-width: 767px) {
  #app.ks-site { padding: 0; }
  .ks-main, .announcement, .ks-footer { width: calc(100% - 2rem); }
  .announcement { padding-top: .5rem; }
  .ks-announcement { justify-content: flex-start; }
  .ks-announcement__track { min-width: 0; }
  .ks-header { width: 100%; margin-left: 0; padding-top: 0; }
  header.component.ks-header > .ks-header__bar { width: calc(100% - 2rem); min-height: 4rem; padding: 0; }
  .ks-brand__name { max-width: 8rem; font-size: .95rem; }
  .ks-header__actions { gap: .3rem; }
  .ks-icon-button { width: 2.15rem; height: 2.15rem; }
  .ks-mobile-menu { width: calc(100% - 2rem); }
  .ks-mobile-menu .ks-nav { grid-template-columns: repeat(2, 1fr); }
  .ks-mobile-menu__meta { display: none; }
  .ks-hero { display: block; min-height: 0; padding: 5rem .25rem 3.5rem; }
  .ks-hero::before { display: none; }
  .ks-hero h1 { font-size: clamp(2.75rem, 14vw, 4.1rem); }
  .ks-hero__content > p { font-size: .85rem; }
  .ks-hero__actions { align-items: stretch; flex-direction: column; }
  .ks-hero__visual { margin-top: 3rem; }
  .ks-terminal__line { grid-template-columns: 2.25rem 1fr; padding: 0 .75rem; }
  .ks-terminal__prompt { padding-left: 3rem; }
  .ks-trustbar { grid-template-columns: 1fr; }
  .ks-trustbar > div { justify-content: flex-start; padding-left: 1.3rem; border-right: 0; border-bottom: 1px solid var(--ks-border); }
  .ks-section { padding: 4.5rem 0 2rem; }
  .ks-section-heading { align-items: stretch; flex-direction: column; gap: 1.3rem; }
  .ks-catalog__search { width: 100%; max-width: none; }
  .ks-product-grid__item { width: 100%; }
  .template-products .component > .py-6, .template-product .component > .py-6, .template-cart .component > .py-6,
  .template-feedback .component > .py-6, .template-faq .component > .py-6, .template-status .component > .py-6,
  .template-blog .component > .py-6, body[class*="template-customer-"] .container > .relative { padding-top: 2.75rem !important; padding-bottom: 2.75rem !important; }
  .ks-footer__top { align-items: flex-start; flex-direction: column; padding: 1.6rem .25rem; }
  .ks-footer__right { align-items: flex-start; flex-direction: column; }
  .ks-footer__bottom { align-items: flex-start; flex-direction: column; justify-content: center; gap: .35rem; padding: .8rem .25rem; }
}