:root {
  --bg: #f9f7f4;
  --fg: #1a1a1a;
  --muted: #5a5a5a;
  --link: #1a1a1a;
  --link-hover: #555;
  --border: #e0ddd8;
  --max: 960px;
  --font: system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Fira Code", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111110;
    --fg: #e8e6e1;
    --muted: #888;
    --link: #e8e6e1;
    --link-hover: #aaa;
    --border: #2a2a28;
  }
}

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

a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 2px;
  border-radius: 2px;
}

html { font-size: 17px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.7;
  padding: 3rem 1.5rem 6rem;
}

hr {
  border-top: 1px solid var(--border);
  border-bottom: none;
}

.wrap { max-width: var(--max); margin: 0 auto; }

.site-header {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.25rem;
  margin-bottom: 3.5rem;
}

.nav {
  display: flex;
  gap: 1.25rem;
  align-items: baseline;
  margin-left: auto;
}

.nav a {
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color 0.15s;
}

.nav a:hover { color: var(--fg); }
.nav a[aria-current="page"] { color: var(--fg); font-weight: 600; }

.wordmark {
  display: inline-flex;
  align-self: center;
  text-decoration: none;
}

.wordmark img {
  display: block;
  height: 1.25rem;
  width: auto;
}

.lang-switcher {
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
  padding-left: 1.25rem;
  border-left: 1px solid var(--border);
}

.lang-switcher a {
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 0.15s;
}

.lang-switcher a:hover { color: var(--fg); }
.lang-switcher a[aria-current="page"] { color: var(--fg); font-weight: 600; }

.hero { margin-bottom: 4rem; }

.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.hero p { color: var(--muted); font-size: 1rem; max-width: 480px; }

.hero-cta {
  display: inline-block;
  margin-top: 1.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid var(--fg);
  padding-bottom: 2px;
  transition: color 0.15s, border-color 0.15s;
}

.hero-cta:hover { color: var(--link-hover); border-color: var(--link-hover); }

.products { margin-bottom: 4.5rem; }

.product { border-top: 1px solid var(--border); padding-top: 1.75rem; }

.product-meta {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.product-name {
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 700;
  color: var(--fg);
}

.product-tag {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}

.product h2 {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.product h2 a {
  color: var(--fg);
  text-decoration: none;
  transition: color 0.15s;
}

.product h2 a:hover {
  color: var(--link-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.product:hover .product-link { color: var(--link-hover); border-color: var(--link-hover); }

.product p {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 1rem;
  max-width: 420px;
}

.product-link {
  font-size: 0.85rem;
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1px;
  transition: border-color 0.15s, color 0.15s;
  font-weight: 500;
}

.product-link:hover { color: var(--link-hover); border-color: var(--link-hover); }

.section-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.plugins { margin-bottom: 4.5rem; }

.feature-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.6rem;
  margin-bottom: 1rem;
  max-width: 420px;
}

.feature-list li {
  list-style: none;
  font-size: 0.72rem;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
  white-space: nowrap;
}

.contact-email {
  font-family: var(--mono);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  padding-bottom: 2px;
  transition: border-color 0.15s, color 0.15s;
}

.contact-email:hover { color: var(--link-hover); border-color: var(--link-hover); }

.contact-block { margin-bottom: 4.5rem; }

/* Contact form (reuses .plugin-field controls) */
.contact-form {
  display: grid;
  gap: 1.1rem;
  max-width: 520px;
  margin-bottom: 1.75rem;
}
.contact-form button { border: none; cursor: pointer; justify-self: start; }
.contact-fallback { color: var(--muted); font-size: 0.92rem; }
.contact-fallback .contact-email { font-size: 0.92rem; }

/* Honeypot — hidden from users, tempting to bots */
.form-hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  opacity: 0;
}

/* Inline submit status */
.form-status { font-size: 0.9rem; margin: 0; min-height: 1.2em; }
.form-status:empty { display: none; }
.form-status--ok { color: var(--link); }
.form-status--err { color: #c0392b; }

footer a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  transition: color 0.15s, border-color 0.15s;
}

footer a:hover { color: var(--fg); border-color: var(--fg); }

footer {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ---- Product / plugin detail pages ---- */

.back-link {
  margin-bottom: 2rem;
  font-size: 0.8rem;
}

.back-link a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}

.back-link a:hover { color: var(--fg); }

.product-detail { margin-bottom: 4.5rem; }

.product-detail .product-meta { margin-bottom: 0.85rem; }

.detail-heading {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.detail-lede {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 480px;
  margin-bottom: 2rem;
}

.cta-button {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--bg);
  background: var(--fg);
  text-decoration: none;
  padding: 0.6rem 1.1rem;
  border-radius: 6px;
  transition: opacity 0.15s;
}

.cta-button:hover { opacity: 0.85; }

.detail-body {
  margin-top: 3rem;
  border-top: 1px solid var(--border);
  padding-top: 2rem;
}

.detail-body p {
  color: var(--fg);
  font-size: 0.98rem;
  max-width: 540px;
  margin-bottom: 1.25rem;
}

.detail-body p:last-child { margin-bottom: 0; }

.detail-features {
  margin-top: 2.5rem;
  border-top: 1px solid var(--border);
  padding-top: 2rem;
}

.detail-features .section-label { margin-bottom: 1rem; }

/* ---- Adit sales page ---- */

/* .wrap.wide is retained for markup compatibility; width now matches the default container */
.wrap.wide { max-width: var(--max); }

.plugin { margin-bottom: 4rem; }

.plugin-category {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
}

.plugin-hero { margin-bottom: 3.5rem; }
.plugin-hero .detail-lede { max-width: 620px; font-size: 1.1rem; }

.plugin-cta-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }

/* Floating section navigation (built by plugin-nav.js) */
.plugin-toc {
  position: fixed;
  top: 12rem;
  right: max(1.25rem, calc((100vw - var(--max)) / 2 - 15rem));
  width: 11rem;
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
  z-index: 20;
  display: none;
}

.plugin-toc ul { list-style: none; }

.plugin-toc li { margin: 0; }

.plugin-toc a {
  display: block;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  line-height: 1.3;
  padding: 0.45rem 0 0.45rem 0.85rem;
  border-left: 2px solid var(--border);
  transition: color 0.15s ease, border-color 0.15s ease;
}

.plugin-toc a:hover { color: var(--fg); }

.plugin-toc-top { margin-bottom: 0.35rem; }

.plugin-toc a[aria-current="true"] {
  color: var(--fg);
  font-weight: 600;
  border-left-color: var(--fg);
}

/* Only float the nav when there is gutter room beside the content column. */
@media (min-width: 1240px) {
  .plugin-toc { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  .plugin-toc a { transition: none; }
}

.plugin-section {
  padding-top: 2.25rem;
  margin-top: 3rem;
  scroll-margin-top: 2rem;
}

.plugin-section > h2 {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
  margin-bottom: 0.85rem;
}

.plugin-body { color: var(--fg); font-size: 1rem; max-width: 640px; margin-bottom: 0.5rem; }

.plugin-note { color: var(--muted); font-size: 0.85rem; margin-top: 1.25rem; }
.plugin-subtle-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 1.5rem 0 0.6rem;
}

/* Feature grid */
.plugin-feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.75rem 2rem;
}

.plugin-feature h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  letter-spacing: -0.01em;
}

.plugin-feature p { color: var(--muted); font-size: 0.92rem; }

/* Screenshot placeholders */
.plugin-shot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.plugin-shot figcaption {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.5rem;
}

.plugin-shot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color 0.15s, transform 0.15s;
}

.plugin-shot a:hover img { border-color: var(--link-hover); transform: translateY(-2px); }

.plugin-shot-link { cursor: zoom-in; }

/* Lightbox overlay */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: clamp(1rem, 4vw, 3rem);
  background: rgba(0, 0, 0, 0.85);
  opacity: 0;
  transition: opacity 0.2s ease;
}

/* The `hidden` attribute must win over `display: flex` above, otherwise the
   transparent overlay stays on top of the page and swallows every click. */
.lightbox[hidden] { display: none; }

.lightbox.is-open { opacity: 1; }

.lightbox-figure {
  margin: 0;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.lightbox-img {
  display: block;
  max-width: 100%;
  max-height: 82vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.lightbox-caption {
  color: #f2f0ec;
  font-size: 0.85rem;
  text-align: center;
  max-width: 60ch;
}

.lightbox-close,
.lightbox-nav {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  cursor: pointer;
  line-height: 1;
  transition: background 0.15s, border-color 0.15s;
}

.lightbox-close:hover,
.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.5);
}

.lightbox-close {
  position: absolute;
  top: clamp(0.75rem, 2vw, 1.5rem);
  right: clamp(0.75rem, 2vw, 1.5rem);
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1.6rem;
}

.lightbox-nav {
  width: 3rem;
  height: 3rem;
  font-size: 2rem;
}

@media (max-width: 640px) {
  .lightbox-nav {
    position: absolute;
    bottom: clamp(0.75rem, 3vw, 1.5rem);
    width: 2.75rem;
    height: 2.75rem;
  }
  .lightbox-prev { left: clamp(0.75rem, 4vw, 2rem); }
  .lightbox-next { right: clamp(0.75rem, 4vw, 2rem); }
}

@media (prefers-reduced-motion: reduce) {
  .lightbox { transition: none; }
}

/* SCIM highlight block */
.plugin-highlight {
  background: color-mix(in srgb, var(--fg) 4%, transparent);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2rem;
  margin-top: 3rem;
}

/* Pricing */
.plugin-launch {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  margin: 1.25rem 0 1.5rem;
}

.plugin-plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.plugin-plan {
  border: 1px solid #e0ddd8;
  border-radius: 10px;
  padding: 1.5rem 1.35rem;
  display: flex;
  flex-direction: column;
  position: relative;
  color: #1a1a1a;
  background: #fff;
}

.plugin-plan--featured {
  border-color: #1a1a1a;
  border-width: 2px;
}

.plugin-plan-badge {
  position: absolute;
  top: -0.7rem;
  left: 1.35rem;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: #1a1a1a;
  color: #fff;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
}

.plugin-plan-name {
  font-family: var(--mono);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.plugin-plan-users { font-size: 0.82rem; color: #5a5a5a; margin-bottom: 1rem; }

.plugin-plan-price { margin-bottom: 1.1rem; line-height: 1.35; }
.plugin-plan-amount { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; }
.plugin-plan-period { font-size: 0.8rem; color: #5a5a5a; margin-left: 0.35rem; }
.plugin-plan-renews { display: block; font-size: 0.75rem; color: #5a5a5a; margin-top: 0.25rem; }

.plugin-plan-features { list-style: none; margin-bottom: 1.25rem; }
.plugin-plan-features li {
  font-size: 0.86rem;
  padding: 0.35rem 0 0.35rem 1.1rem;
  position: relative;
  border-top: 1px solid #e0ddd8;
}
.plugin-plan-features li:first-child { border-top: none; }
.plugin-plan-features li::before {
  content: "·";
  position: absolute;
  left: 0.15rem;
  color: #5a5a5a;
  font-weight: 700;
}

.plugin-plan-cta { margin-top: auto; text-align: center; }
.plugin-plan-cta.cta-button { background: #1a1a1a; color: #fff; }

/* Add-ons */
.plugin-addons { list-style: none; margin-top: 1.25rem; }
.plugin-addons li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--border);
  font-size: 0.95rem;
}
.plugin-addons li:first-child { border-top: none; }
.plugin-addon-price { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Form */
.plugin-form {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.1rem;
  margin-top: 1.5rem;
  max-width: 680px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.75rem;
}
.plugin-field { display: flex; flex-direction: column; gap: 0.4rem; }
.plugin-field--full { grid-column: 1 / -1; }
.plugin-field label, .plugin-field legend {
  font-size: 0.8rem;
  font-weight: 600;
  color: #1a1a1a;
}
.plugin-field input:not([type="checkbox"]):not([type="radio"]), .plugin-field textarea {
  font-family: var(--font);
  font-size: 0.92rem;
  color: #1a1a1a;
  background: #fff;
  border: 1px solid #d8d5d0;
  border-radius: 6px;
  padding: 0.55rem 0.7rem;
  width: 100%;
}
.plugin-field input:not([type="checkbox"]):not([type="radio"]):focus, .plugin-field textarea:focus {
  outline: none;
  border-color: #1a1a1a;
}
.plugin-field textarea { resize: vertical; }
fieldset.plugin-field { border: none; padding: 0; margin: 0; min-width: 0; }
.plugin-checks { display: flex; flex-wrap: wrap; gap: 0.5rem 1.1rem; margin-top: 0.5rem; }
.plugin-check {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.88rem;
  font-weight: 400;
  color: #5a5a5a;
}
.plugin-check input { flex: 0 0 auto; width: auto; margin: 0; }
.plugin-form button { grid-column: 1 / -1; justify-self: start; border: none; cursor: pointer; }

/* FAQ */
.plugin-faq { margin-top: 1.25rem; }
.plugin-faq-item { border-top: 1px solid var(--border); padding: 0.9rem 0; }
.plugin-faq-item:first-child { border-top: none; }
.plugin-faq-item summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.98rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
.plugin-faq-item summary::-webkit-details-marker { display: none; }
.plugin-faq-item summary::after { content: "+"; color: var(--muted); font-weight: 400; }
.plugin-faq-item[open] summary::after { content: "–"; }
.plugin-faq-item p { color: var(--muted); font-size: 0.92rem; margin-top: 0.65rem; max-width: 640px; }

/* Final CTA */
.plugin-final {
  border-top: 1px solid var(--border);
  margin-top: 3rem;
  padding-top: 3rem;
  text-align: center;
}
.plugin-final h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}
.plugin-final p { color: var(--muted); margin-bottom: 1.5rem; }

@media (max-width: 560px) {
  .plugin-form { grid-template-columns: 1fr; }
  .lang-switcher { padding-left: 0; border-left: none; }
}
