/**
 * Open-source software catalog (.alg-oss) — /software/ listing.
 * Detail pages continue to use plugins-v2 / store.css.
 */

  /* ---------- template ---------- */
  .alg-oss {
    --navy: #0e2742; --navy-2: #0a1d33; --blue: #3b7ddd; --blue-d: #2a6aa8; --ink: #122a40;
    --muted: #5a6578; --line: #e6edf5; --soft: #f4f8fd; --white: #fff;
    --green: #2fbf71; --mint: #8fd0a8;
    --radius: 20px; --shadow-lg: 0 24px 60px rgb(14 39 66 / .16);
    --font: "Manrope", "Plus Jakarta Sans", system-ui, sans-serif;
    --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    font-family: var(--font); color: var(--ink); line-height: 1.6;
    -webkit-font-smoothing: antialiased;
  }
  .alg-oss *, .alg-oss *::before, .alg-oss *::after { box-sizing: border-box; }
  .alg-oss .wrap { max-width: 1180px; margin: 0 auto; padding-inline: 16px; }
  .alg-oss h1, .alg-oss h2, .alg-oss h3 { color: var(--navy); line-height: 1.15; margin: 0; letter-spacing: -.02em; text-wrap: balance; }
  .alg-oss p { margin: 0; }
  .alg-oss a { color: inherit; }
  .alg-oss :focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 8px; }

  /* hero: dark, code-flavoured, so it never reads as the paid catalogue */
  .alg-oss .hero {
    position: relative; overflow: hidden; isolation: isolate; color: #c9d6e6;
    padding: clamp(56px, 9vw, 112px) 0 clamp(56px, 8vw, 96px);
    background: radial-gradient(55% 70% at 90% 0%, rgb(59 125 221 / .35), transparent 65%),
                radial-gradient(40% 50% at 0% 100%, rgb(47 191 113 / .16), transparent 70%),
                linear-gradient(180deg, var(--navy), var(--navy-2));
  }
  .alg-oss .hero::after {
    content: ""; position: absolute; inset: 0; z-index: -1; opacity: .35;
    background-image: radial-gradient(rgb(255 255 255 / .18) 1px, transparent 1px);
    background-size: 22px 22px;
    mask-image: radial-gradient(70% 80% at 60% 30%, #000, transparent 80%);
  }
  .alg-oss .hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; }
  @media (max-width: 900px) { .alg-oss .hero-grid { grid-template-columns: 1fr; } }
  .alg-oss .eyebrow {
    display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px;
    background: rgb(255 255 255 / .06); border: 1px solid rgb(255 255 255 / .14); color: var(--mint);
    font: 600 13px/1.4 var(--mono);
  }
  .alg-oss .eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgb(47 191 113 / .25); }
  .alg-oss .hero h1 { margin-top: 20px; color: var(--white); font-size: clamp(34px, 5.4vw, 60px); font-weight: 800; max-width: 15ch; }
  .alg-oss .hero h1 em { font-style: normal; background: linear-gradient(90deg, #7fb2f5, var(--mint)); -webkit-background-clip: text; background-clip: text; color: transparent; }
  .alg-oss .hero .lede { margin-top: 18px; max-width: 54ch; font-size: clamp(16px, 1.6vw, 19px); }
  .alg-oss .hero .actions { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 12px; }

  /* terminal */
  .alg-oss .term {
    border-radius: 16px; overflow: hidden; background: #071526; border: 1px solid rgb(255 255 255 / .1);
    box-shadow: 0 30px 70px rgb(0 0 0 / .35); font: 500 14px/1.75 var(--mono); color: #c9d6e6;
  }
  .alg-oss .term-bar { display: flex; align-items: center; gap: 7px; padding: 12px 14px; background: rgb(255 255 255 / .04); border-bottom: 1px solid rgb(255 255 255 / .06); }
  .alg-oss .term-bar i { width: 11px; height: 11px; border-radius: 50%; background: #3a4a5e; }
  .alg-oss .term-bar i:nth-child(1) { background: #ff6159; } .alg-oss .term-bar i:nth-child(2) { background: #ffbd2e; } .alg-oss .term-bar i:nth-child(3) { background: #28c941; }
  .alg-oss .term-bar span { margin-left: 8px; font-size: 12px; color: #6f8197; }
  .alg-oss .term pre { margin: 0; padding: 18px 20px 22px; white-space: pre-wrap; word-break: break-word; }
  .alg-oss .term .p { color: var(--mint); } .alg-oss .term .c { color: #6f8197; } .alg-oss .term .k { color: #7fb2f5; }
  .alg-oss .term .cursor { display: inline-block; width: 8px; height: 1.1em; vertical-align: -2px; background: var(--mint); animation: alg-blink 1.1s steps(1) infinite; }
  @keyframes alg-blink { 50% { opacity: 0; } }

  /* buttons */
  .alg-oss .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 46px; padding: 0 22px; border-radius: 999px; border: 1px solid transparent;
    font: 700 15px/1 var(--font); text-decoration: none; cursor: pointer; white-space: nowrap;
    transition: transform .2s ease, background-color .2s ease, border-color .2s ease, color .2s ease;
  }
  .alg-oss .btn svg { width: 16px; height: 16px; flex: none; }
  .alg-oss .btn:hover { transform: translateY(-2px); }
  .alg-oss .btn-light { background: var(--white); color: var(--navy); }
  .alg-oss .btn-outline-light { color: var(--white); border-color: rgb(255 255 255 / .28); }
  .alg-oss .btn-outline-light:hover { border-color: var(--white); }
  .alg-oss .btn-dark { background: var(--navy); color: var(--white); }
  .alg-oss .btn-dark:hover { background: #163a60; }
  .alg-oss .btn-ghost { background: var(--white); color: var(--navy); border-color: var(--line); }
  .alg-oss .btn-ghost:hover { border-color: var(--blue); color: var(--blue-d); }
  .alg-oss .btn-sm { min-height: 38px; padding: 0 14px; font-size: 13.5px; }

  /* toolbar */
  .alg-oss section.block { padding: clamp(48px, 7vw, 88px) 0 0; }
  .alg-oss .sec-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px 32px; margin-bottom: 28px; }
  .alg-oss .sec-head h2 { font-size: clamp(26px, 3.2vw, 36px); font-weight: 800; }
  .alg-oss .kicker { display: block; margin-bottom: 8px; color: var(--blue-d); font: 600 13px/1 var(--mono); }
  .alg-oss .filters { display: flex; flex-wrap: wrap; gap: 8px; }
  .alg-oss .chip {
    min-height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--white);
    font: 700 14px/1 var(--font); color: var(--muted); cursor: pointer; transition: all .2s ease;
  }
  .alg-oss .chip:hover { border-color: var(--blue); color: var(--blue-d); }
  .alg-oss .chip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: var(--white); }
  .alg-oss .chip span { margin-left: 6px; opacity: .6; font-family: var(--mono); font-size: 12px; }

  /* cards */
  .alg-oss .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 22px; }
  .alg-oss .card {
    --accent: var(--blue);
    position: relative; display: flex; flex-direction: column; gap: 16px; padding: 26px;
    border-radius: var(--radius); background: var(--white); border: 1px solid var(--line);
    transition: transform .3s cubic-bezier(.2,.8,.2,1), box-shadow .3s ease, border-color .3s ease, opacity .3s ease;
  }
  .alg-oss .card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
  .alg-oss .card[hidden] { display: none; }
  .alg-oss .card-top { display: flex; align-items: center; gap: 14px; }
  .alg-oss .icon {
    display: grid; place-items: center; flex: none; width: 52px; height: 52px; border-radius: 14px;
    color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, white);
  }
  .alg-oss .icon svg { width: 26px; height: 26px; }
  .alg-oss .card h3 { font-size: 21px; font-weight: 800; }
  .alg-oss .kind { font: 600 12.5px/1.3 var(--mono); color: var(--muted); }
  .alg-oss .status { margin-left: auto; align-self: flex-start; padding: 4px 10px; border-radius: 999px; font: 600 12px/1.4 var(--mono); border: 1px solid; white-space: nowrap; }
  .alg-oss .status.live { color: #137a45; background: #e8f8ef; border-color: #b6e8cb; }
  .alg-oss .status.beta { color: #8a5a00; background: #fff4dc; border-color: #f5d995; }
  .alg-oss .status.soon { color: var(--muted); background: var(--soft); border-color: var(--line); }
  .alg-oss .card .desc { color: var(--muted); font-size: 15px; }
  .alg-oss .meta { display: flex; flex-wrap: wrap; gap: 6px; }
  .alg-oss .meta span { padding: 4px 10px; border-radius: 8px; background: var(--soft); border: 1px solid var(--line); font: 600 12px/1.4 var(--mono); color: var(--ink); }
  .alg-oss .meta .lic { background: #eef9f2; border-color: #c9ecd7; color: #137a45; }
  .alg-oss .meta .tbc { background: transparent; border-style: dashed; color: #b0533a; border-color: #e7b3a5; }
  .alg-oss .card-foot { margin-top: auto; padding-top: 16px; border-top: 1px dashed var(--line); display: flex; flex-wrap: wrap; gap: 8px; }

  /* contribute */
  .alg-oss .steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 18px; counter-reset: s; }
  .alg-oss .step { position: relative; padding: 24px; border-radius: var(--radius); background: var(--soft); border: 1px solid var(--line); counter-increment: s; }
  .alg-oss .step::before { content: "0" counter(s); display: block; margin-bottom: 14px; font: 600 13px/1 var(--mono); color: var(--blue-d); }
  .alg-oss .step h3 { font-size: 18px; font-weight: 800; }
  .alg-oss .step p { margin-top: 6px; color: var(--muted); font-size: 15px; }

  /* cross-link back to paid */
  .alg-oss .xlink { margin: clamp(48px, 7vw, 88px) 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px;
    padding: clamp(24px, 4vw, 36px); border-radius: var(--radius); background: linear-gradient(135deg, var(--soft), #e9f2fd); border: 1px solid var(--line); }
  .alg-oss .xlink h2 { font-size: clamp(20px, 2.4vw, 26px); }
  .alg-oss .xlink p { margin-top: 6px; color: var(--muted); }

  @media (prefers-reduced-motion: no-preference) {
    .alg-oss .alg-oss-reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s cubic-bezier(.2,.8,.2,1); }
    .alg-oss .alg-oss-reveal.in { opacity: 1; transform: none; }
  }
  @media (prefers-reduced-motion: reduce) {
    .alg-oss *, .alg-oss *::before { transition: none !important; animation: none !important; }
  }
