/* Software & AI page only (loaded through page meta "css": "software"). Shared components live in styles.css.
   Parts: hero index · 01 builds on the platform bar · 02 AI cards and the rule-based panel ·
   03 integrations grid · 04 hosting rack · 06 FAQ. */

.sw-lead { max-width: 31em; }

/* ---------- hero: "on this page" index, drawn as a terminal --help ---------- */
.sw-index { margin-top: clamp(2.25rem, 5.5vh, 3.5rem); }
.sw-index__list { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); }
@media (min-width: 1100px) { .sw-index__list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.sw-index__link {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .85rem;
  height: 100%; min-height: 52px; padding: .8rem 1.1rem;
  background: var(--panel); color: var(--bone); text-decoration: none;
  transition: background-color .25s var(--ease), color .2s;
}
.sw-index__num { font-family: var(--font-dot); font-weight: 800; font-size: .86rem; letter-spacing: .14em; color: var(--accent); }
.sw-index__text { display: grid; gap: .15rem; min-width: 0; }
.sw-index__cmd { font-family: var(--font-mono); font-size: .84rem; font-weight: 600; letter-spacing: .06em; }
.sw-index__desc { font-size: .88rem; line-height: 1.4; color: var(--mute); }
.sw-index__go { width: 1.05rem; height: 1.05rem; color: var(--dim); transform: rotate(90deg); transition: color .2s, transform .25s var(--ease); }
.sw-index__link:hover { background: var(--panel-2); color: var(--accent); }
.sw-index__link:hover .sw-index__desc { color: var(--bone); }
.sw-index__link:hover .sw-index__go { color: var(--accent); transform: rotate(90deg) translateX(3px); }
.sw-index__link:focus-visible { outline-offset: -3px; border-radius: 0; }
@media (max-width: 599.98px) {
  .sw-index__desc, .sw-index__go { display: none; }
  .sw-index__link { gap: .6rem; padding: .7rem .9rem; min-height: 48px; }
  .sw-index__cmd { font-size: .8rem; letter-spacing: .03em; }
}

/* ---------- 01 builds: four cards standing on one platform bar ---------- */
.sw-builds { list-style: none; --grid-gap: clamp(1rem, 2vw, 1.5rem); }
.sw-build { position: relative; display: flex; min-width: 0; }
.sw-build > .term { flex: 1; }
.sw-build .term__body { gap: .9rem; }
.sw-build__top { display: flex; align-items: center; justify-content: space-between; gap: .75rem; min-height: 28px; }
.sw-badge { min-height: 26px; padding: .2rem .7rem; font-size: .64rem; gap: .5rem; }
.sw-badge .dot-live { width: 7px; height: 7px; }
.sw-build--next .term { border-style: dashed; border-color: var(--line-strong); background: transparent; }
.sw-build--next .term__bar { background: rgba(20, 20, 19, .6); }

.sw-platform {
  position: relative; display: grid; gap: .6rem 2rem; align-items: center;
  margin-top: clamp(1rem, 2vw, 1.5rem);
  padding: clamp(1.15rem, 2vw, 1.5rem) clamp(1.25rem, 2.4vw, 1.9rem);
  border: 1px solid var(--accent-line); border-radius: var(--r-card);
  background: linear-gradient(90deg, rgba(245, 165, 36, .14), rgba(245, 165, 36, .03) 55%, transparent), var(--panel);
}
.sw-platform__name {
  display: inline-flex; align-items: center; gap: .8rem;
  font-family: var(--font-mono); font-weight: 600; font-size: .8rem; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); white-space: nowrap;
}
.sw-platform__name::before { content: ""; width: 9px; height: 9px; flex: none; background: var(--accent); transform: rotate(45deg); box-shadow: 0 0 12px rgba(245, 165, 36, .8); }
.sw-platform__text { font-family: var(--font-mono); font-size: .92rem; line-height: 1.55; color: var(--bone); }
@media (min-width: 900px) { .sw-platform { grid-template-columns: auto minmax(0, 1fr); } }
/* four narrow cards are too tight below 1280px: stay two by two until there is room */
@media (min-width: 1180px) and (max-width: 1279.98px) { .sw-builds { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* on four columns, each card is wired down to the bar */
@media (min-width: 1280px) {
  .sw-build .chips { gap: .4rem; }
  .sw-build .chip { font-size: .68rem; padding: .28rem .68rem; }
  .sw-platform { margin-top: 2.75rem; }
  .sw-build::after {
    content: ""; position: absolute; left: 50%; top: 100%; width: 1px; height: 2.75rem;
    background: linear-gradient(var(--line-strong), var(--accent));
  }
  .sw-build::before {
    content: ""; position: absolute; left: 50%; top: calc(100% + 2.75rem); z-index: 1;
    width: 9px; height: 9px; margin: -5px 0 0 -4px; border: 1.5px solid var(--accent); background: var(--ink); transform: rotate(45deg);
  }
}

/* ---------- 02 AI: four cards, then what is rule-based ---------- */
.sw-ai { list-style: none; }
.sw-ai .term__body { gap: .9rem; }
.sw-ai__log { margin-top: auto; padding-top: 1.1rem; border-top: 1px dashed var(--line-strong); }
.sw-ai__log li { grid-template-columns: minmax(8.5rem, 10rem) minmax(0, 1fr); }
.sw-ai__log .k::before { content: "> "; color: var(--accent); }
/* a narrow card (phones, and the 2-up grid on tablets) puts each value under its key */
@container (max-width: 26rem) { .sw-ai__log li { grid-template-columns: 1fr; gap: .1rem; } }

.sw-rules {
  display: grid; gap: 1.5rem 3rem; align-items: start;
  margin-top: clamp(1rem, 2vw, 1.5rem);
  padding: clamp(1.4rem, 2.6vw, 2.2rem);
  border: 1px dashed var(--line-strong); border-radius: var(--r-card);
}
@media (min-width: 960px) { .sw-rules { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); } }
.sw-rules__tag {
  display: inline-flex; align-items: center; gap: .6rem; min-height: 30px; padding: .3rem .85rem;
  border: 1px solid var(--line-strong); border-radius: var(--r-pill);
  font-family: var(--font-mono); font-size: .68rem; letter-spacing: .18em; text-transform: uppercase; color: var(--bone);
}
.sw-rules__tag::before { content: ""; width: 7px; height: 7px; flex: none; border: 1.5px solid var(--mute); }
.sw-rules__title { margin-top: 1rem; font-family: var(--font-display); font-size: var(--fs-h3); line-height: 1.22; }
.sw-rules__text { margin-top: .75rem; color: var(--mute); max-width: 30em; }
.sw-rules__list { list-style: none; display: grid; border-top: 1px solid var(--line); }
@media (min-width: 640px) { .sw-rules__list { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 2rem; } }
.sw-rules__list li {
  display: flex; align-items: flex-start; gap: .85rem; padding: 1rem 0; border-bottom: 1px solid var(--line);
  font-family: var(--font-mono); font-size: .88rem; line-height: 1.5; color: var(--bone);
}
.sw-rules__list li::before { content: ""; width: 8px; height: 8px; margin-top: .42em; flex: none; border: 1.5px solid var(--mute); }

/* ---------- 03 integrations: one panel, hairline cells ---------- */
.sw-ints {
  list-style: none; display: grid; gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden;
}
@media (min-width: 700px) { .sw-ints { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 700px) and (max-width: 1079.98px) { .sw-int:last-child { grid-column: 1 / -1; } }
@media (min-width: 1080px) { .sw-ints { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* the product chip sits top right; in the DOM it comes last, so it is read after the name and text */
.sw-int {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "id where" "name name" "text text";
  align-content: start; column-gap: 1rem; row-gap: .7rem; min-width: 0;
  padding: clamp(1.15rem, 2.2vw, 1.75rem); background: var(--panel); transition: background-color .25s var(--ease);
}
.sw-int:hover { background: var(--panel-2); }
.sw-int__id { grid-area: id; align-self: center; font-family: var(--font-mono); font-size: .74rem; letter-spacing: .02em; color: var(--accent); overflow-wrap: anywhere; }
.sw-int__id::before { content: "~/"; color: var(--mute); }
.sw-int__name { grid-area: name; margin-top: .2rem; font-family: var(--font-mono); font-size: .88rem; font-weight: 600; line-height: 1.4; letter-spacing: .1em; text-transform: uppercase; color: var(--bone); }
.sw-int__text { grid-area: text; color: var(--mute); font-size: .96rem; }
.sw-int__where { grid-area: where; align-self: center; }
.sw-int__where .chip { font-size: .66rem; min-height: 26px; padding: .22rem .7rem; white-space: nowrap; }

/* ---------- 04 hosting: two server units in a terminal window ---------- */
.sw-host { margin-bottom: 0; }
.sw-host__row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem 3rem; align-items: center; }
@media (min-width: 1080px) { .sw-host__row { grid-template-columns: minmax(0, 1fr) minmax(0, 31rem); } }
.sw-host__tag { margin-top: 1.6rem; }
.sw-where { width: 100%; }
@media (min-width: 640px) and (max-width: 1079.98px) { .sw-rack { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sw-where .term__body { gap: 1.25rem; }
.sw-rack { list-style: none; display: grid; gap: .6rem; }
.sw-rack__unit {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "leds name vent" "leds where vent"; align-items: center; column-gap: 1rem; row-gap: .1rem;
  padding: .85rem 1rem; border: 1px solid var(--line-strong); border-radius: 8px;
  background: linear-gradient(180deg, rgba(242, 240, 235, .04), transparent), var(--ink);
  box-shadow: inset 0 1px 0 rgba(242, 240, 235, .05);
}
.sw-rack__leds { grid-area: leds; display: flex; flex-direction: column; align-items: center; gap: 5px; padding-right: .2rem; }
.sw-rack__leds i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); opacity: .85; box-shadow: 0 0 6px rgba(245, 165, 36, .7); }
.sw-rack__leds i:last-child { background: var(--dim); box-shadow: none; }
.sw-rack__leds .dot-live { width: 7px; height: 7px; }
.sw-rack__name { grid-area: name; font-family: var(--font-mono); font-size: .8rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--bone); }
.sw-rack__where { grid-area: where; font-family: var(--font-mono); font-size: .82rem; color: var(--accent); }
.sw-rack__vent {
  grid-area: vent; width: clamp(2.5rem, 9vw, 4.5rem); height: 26px; border-radius: 3px;
  background: repeating-linear-gradient(90deg, rgba(242, 240, 235, .16) 0 2px, transparent 2px 6px);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 30%); mask-image: linear-gradient(90deg, transparent, #000 30%);
}
@media (max-width: 379.98px) {
  .sw-rack__vent { display: none; }
  .sw-rack__unit { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "leds name" "leds where"; }
}

/* ---------- 06 FAQ ---------- */
.sw-faq__lead { margin-top: 1.4rem; }
.sw-faq__ask { margin-top: 1.25rem; }
