/* Solution pages (Who it is for / Products): each page has its own device. Prefix nx-sx-.
   Partials: app/Views/pages/solutions/. Script: assets/js/solutions.js. */

/* ---- poster hero (kit page_hero heroAlign=poster): the page's own H1, set very large ---- */
.nx-page-hero--poster { padding-block: clamp(2.25rem, 4vw, 3.5rem) calc(clamp(1.75rem, 3vw, 2.5rem) + 5vw); }
.nx-page-hero--poster .nx-page-hero__title {
  max-width: 22ch;
  font-size: clamp(2.5rem, 1rem + 4vw, 4.75rem);
  line-height: .98;
  letter-spacing: -.05em;
  font-weight: 800;
  text-wrap: balance;
}
.nx-page-hero__foot {
  display: grid;
  grid-template-columns: minmax(0, 40rem) auto;
  justify-content: space-between;
  align-items: end;
  gap: 1.75rem 3rem;
  margin-top: clamp(1.75rem, 3.5vw, 2.75rem);
}
.nx-page-hero--poster .nx-page-hero__lead { margin: 0; max-width: none; }
.nx-page-hero--poster .nx-actions { margin: 0; }
@media (max-width: 900px) { .nx-page-hero__foot { grid-template-columns: 1fr; } }

/* ---- product crop ---- */
.nx-sx-crop { display: block; width: 100%; height: 100%; object-fit: cover; }

/* ---- hosting: revenue calculator ---- */
.nx-sx-calc__lead { max-width: 40rem; margin-top: 1rem; }
.nx-sx-calc__inputs {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 2rem clamp(2rem, 5vw, 4.5rem);
  margin-top: clamp(2.5rem, 5vw, 4rem);
  align-items: start;
}
.nx-sx-field { display: grid; gap: .5rem; margin: 0; padding: 0; border: 0; min-width: 0; }
.nx-sx-field__label { font-size: 1rem; font-weight: 600; padding: 0; }
.nx-sx-field__value { font-size: clamp(2rem, 1.4rem + 2vw, 3rem); font-weight: 750; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.nx-sx-range { width: 100%; accent-color: var(--nx-accent); height: 2rem; cursor: pointer; }
.nx-sx-plans { display: flex; flex-wrap: wrap; gap: .5rem; align-content: start; }
.nx-sx-plans legend { width: 100%; margin-bottom: .5rem; float: none; }
.nx-sx-plan { position: relative; cursor: pointer; }
.nx-sx-plan input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.nx-sx-plan span {
  display: inline-block;
  padding: .7rem 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--nx-line-strong);
  font-size: 1rem;
  transition: background .15s var(--nx-ease), color .15s var(--nx-ease);
}
.nx-sx-plan input:checked + span { background: var(--nx-accent); color: var(--nx-accent-fg); border-color: var(--nx-accent); }
.nx-sx-plan input:focus-visible + span { outline: 2px solid var(--nx-accent); outline-offset: 3px; }
.nx-sx-calc__result {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2rem;
  margin: clamp(3rem, 6vw, 5rem) 0 0;
}
.nx-sx-calc__result dt { font-size: 1rem; font-weight: 500; }
.nx-sx-calc__result dd {
  margin: .5rem 0 0;
  font-size: clamp(2.25rem, 1.4rem + 2.6vw, 4rem);
  font-weight: 800;
  letter-spacing: -.05em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.nx-sx-calc__main dd { color: var(--nx-accent); }
.nx-sx-calc__note { margin: 2rem 0 0; font-size: .9375rem; }

/* ---- homelab: the board ---- */
.nx-sx-board {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-rows: clamp(4.5rem, 7vw, 6.25rem);
  gap: .625rem;
}
.nx-sx-tile {
  position: relative;
  margin: 0;
  overflow: hidden;
  border-radius: var(--nx-radius-lg);
  background: var(--nx-paper);
  border: 1px solid var(--nx-line);
}
.nx-sx-tile--12x4 { grid-column: span 12; grid-row: span 4; }
.nx-sx-tile--8x3 { grid-column: span 8; grid-row: span 3; }
.nx-sx-tile--4x2 { grid-column: span 4; grid-row: span 2; }
.nx-sx-tile--4x3 { grid-column: span 4; grid-row: span 3; }
.nx-sx-tile--6x3 { grid-column: span 6; grid-row: span 3; }
.nx-sx-tile--6x2 { grid-column: span 6; grid-row: span 2; }
.nx-sx-tile .nx-sx-crop { transition: transform .6s var(--nx-ease); }
.nx-sx-tile:hover .nx-sx-crop { transform: scale(1.025); }
.nx-sx-tile__label {
  position: absolute;
  left: .875rem;
  bottom: .875rem;
  padding: .4rem .8rem;
  border-radius: 999px;
  background: var(--nx-paper);
  color: var(--nx-ink);
  font-size: .875rem;
  font-weight: 650;
}
.nx-sx-tile--type { background: var(--nx-ink); border: 0; display: flex; flex-direction: column; justify-content: flex-end; padding: clamp(1.25rem, 2.4vw, 2rem); color: var(--nx-paper); }
.nx-sx-tile--accent { background: var(--nx-accent); color: var(--nx-accent-fg); }
.nx-sx-tile__big { margin: 0; font-size: clamp(1.5rem, 1rem + 1.6vw, 2.5rem); font-weight: 800; letter-spacing: -.04em; line-height: 1.02; }
.nx-sx-tile__small { margin: .5rem 0 0; font-size: 1rem; line-height: 1.45; }
.nx-band--ink .nx-sx-tile--type:not(.nx-sx-tile--accent) { background: var(--nx-paper); color: var(--nx-ink); }

/* ---- homelab: install terminal ---- */
.nx-sx-term {
  max-width: 64rem;
  margin: clamp(2.5rem, 5vw, 4rem) auto 0;
  border: 1px solid var(--nx-line-strong);
  border-radius: var(--nx-radius-lg);
  background: #000;
  color: #fff;
  overflow: hidden;
}
.nx-sx-term__bar { display: flex; align-items: center; gap: 1rem; padding: .75rem 1rem; border-bottom: 1px solid var(--nx-line); }
/* macOS traffic lights in the terminal bar */
.nx-sx-term .nx-window__dots i { border: 0; }
.nx-sx-term .nx-window__dots i:nth-child(1) { background: #FF5F57; }
.nx-sx-term .nx-window__dots i:nth-child(2) { background: #FEBC2E; }
.nx-sx-term .nx-window__dots i:nth-child(3) { background: #28C840; }
.nx-sx-term__title { flex: 1; text-align: center; font-family: var(--nx-mono); font-size: .8125rem; opacity: .75; }
.nx-sx-term__copy {
  padding: .35rem .9rem;
  border-radius: 999px;
  border: 1px solid var(--nx-line-strong);
  background: transparent;
  color: inherit;
  font-size: .8125rem;
  font-weight: 600;
  cursor: pointer;
}
.nx-sx-term__copy:hover { background: var(--nx-accent); color: var(--nx-accent-fg); border-color: var(--nx-accent); }
.nx-sx-term__body {
  margin: 0;
  padding: clamp(1.25rem, 3vw, 2rem);
  min-height: 24rem;
  font-family: var(--nx-mono);
  font-size: clamp(.8125rem, .75rem + .25vw, .9375rem);
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
  background: transparent;
  color: inherit;
}
.nx-sx-term__prompt { color: var(--nx-accent); }
.nx-sx-term__lvl { font-weight: 700; }
.nx-sx-term__lvl--info { color: #60A5FA; }
.nx-sx-term__lvl--ok { color: #4ADE80; }
.nx-sx-term__line { transition: opacity .25s var(--nx-ease); }
.nx-sx-term__line.is-waiting { opacity: 0; }
.nx-sx-term.is-typing .js-sx-cmd::after { content: "\2588"; animation: nx-sx-caret 1s steps(1) infinite; margin-left: .1em; }
@keyframes nx-sx-caret { 50% { opacity: 0; } }

/* ---- narrow screens ---- */
@media (max-width: 900px) {
  .nx-sx-calc__inputs { grid-template-columns: 1fr; }
  .nx-sx-calc__result { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nx-sx-board { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: auto; }
  .nx-sx-board .nx-sx-tile { grid-column: span 2; grid-row: auto; aspect-ratio: 16 / 10; }
  .nx-sx-board .nx-sx-tile--type { aspect-ratio: auto; min-height: 9rem; grid-column: span 1; }
}

/* dark mode: type tiles become raised surfaces instead of white blocks */
[data-bs-theme="dark"] .nx-sx-tile--type:not(.nx-sx-tile--accent) { background: var(--nx-raised); color: #fff; }
[data-bs-theme="dark"] .nx-sx-tile:not(.nx-sx-tile--accent) { background: var(--nx-raised); }

/* ---- screenshot carousel (pages/solutions/_coverflow): active capture flat in the middle, neighbours
   turned away in perspective. Without script: a scroll-snap row with every caption. ---- */
.nx-band:has(.nx-cf) { overflow-x: clip; }
.nx-cf__head { max-width: 46rem; margin: 0 auto clamp(2.5rem, 5vw, 4rem); text-align: center; }
.nx-cf__head .nx-lead { margin-top: 1rem; }
.nx-cf__stage { display: flex; gap: 1.25rem; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 1rem; }
.nx-cf__slide { flex: 0 0 85%; margin: 0; scroll-snap-align: center; }
.nx-cf__img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
  border: 1px solid var(--nx-line);
  box-shadow: 0 1.5rem 3.5rem -1.25rem color-mix(in srgb, #000 35%, transparent);
  background: var(--nx-bg);
}
.nx-cf__caption {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 1.5rem 3rem;
  margin-top: 2rem;
  text-align: left;
}
.nx-cf__title { margin: 0; font-size: clamp(1.375rem, 1.1rem + .9vw, 1.875rem); letter-spacing: -.03em; font-weight: 750; }
.nx-cf__lead { margin: .75rem 0 1rem; font-size: 1.0625rem; line-height: 1.6; }
.nx-cf__points { display: grid; grid-template-columns: 1fr 1fr; gap: .875rem 2rem; margin: 0; padding: 0; list-style: none; align-content: start; }
.nx-cf__points li { display: flex; gap: .75rem; font-size: 1.0625rem; line-height: 1.5; }

/* with script: the 3D carousel */
.nx-cf.is-ready .nx-cf__stage {
  position: relative;
  display: block;
  overflow: visible;
  padding: 0;
  aspect-ratio: 100 / 38.25;
  perspective: 1800px;
  perspective-origin: 50% 40%;
}
.nx-cf.is-ready .nx-cf__slide {
  position: absolute;
  top: 0;
  left: 16%;
  width: 68%;
  transition: transform .7s var(--nx-ease), opacity .7s var(--nx-ease), filter .7s var(--nx-ease);
  transform-style: preserve-3d;
  cursor: pointer;
}
.nx-cf.is-ready .nx-cf__slide[data-pos="0"] { transform: none; z-index: 3; opacity: 1; cursor: default; }
.nx-cf.is-ready .nx-cf__slide[data-pos="1"] { transform: translateX(72%) rotateY(-38deg) scale(.84); z-index: 2; opacity: .75; }
.nx-cf.is-ready .nx-cf__slide[data-pos="-1"] { transform: translateX(-72%) rotateY(38deg) scale(.84); z-index: 2; opacity: .75; }
.nx-cf.is-ready .nx-cf__slide[data-pos="2"] { transform: translateX(120%) rotateY(-50deg) scale(.7); z-index: 1; opacity: 0; pointer-events: none; }
.nx-cf.is-ready .nx-cf__slide[data-pos="-2"] { transform: translateX(-120%) rotateY(50deg) scale(.7); z-index: 1; opacity: 0; pointer-events: none; }
.nx-cf.is-ready .nx-cf__slide[data-pos="far"] { transform: scale(.6); z-index: 0; opacity: 0; pointer-events: none; }
.nx-cf__nav { display: flex; justify-content: center; align-items: center; gap: 1.25rem; margin-top: clamp(1.75rem, 3vw, 2.5rem); }
.nx-cf__dots { display: flex; gap: .5rem; }
.nx-cf__dot { width: .625rem; height: .625rem; padding: 0; border: 0; border-radius: 999px; background: color-mix(in srgb, var(--nx-fg) 22%, transparent); cursor: pointer; transition: width .3s var(--nx-ease), background .3s; }
.nx-cf__dot[aria-current="true"] { width: 1.75rem; background: var(--nx-accent); }
.nx-cf__arrow { display: inline-flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem; border-radius: 999px; border: 1px solid var(--nx-line-strong); background: transparent; color: inherit; cursor: pointer; }
.nx-cf__arrow:hover { background: var(--nx-fg); color: var(--nx-bg); }
.nx-cf__current { display: grid; max-width: 64rem; margin: 2rem auto 0; }
.nx-cf__current > .nx-cf__caption { grid-area: 1 / 1; margin: 0; visibility: hidden; opacity: 0; transition: opacity .35s var(--nx-ease); }
.nx-cf__current > .nx-cf__caption.is-active { visibility: visible; opacity: 1; }

/* lead carousel: right under the poster hero, starting just below the slant */
.nx-cf-band { padding-top: clamp(1.5rem, 3vw, 2.5rem); }
@media (max-width: 900px) {
  .nx-cf__caption { grid-template-columns: 1fr; }
  .nx-cf.is-ready .nx-cf__stage { aspect-ratio: 100 / 50; }
  .nx-cf.is-ready .nx-cf__slide { left: 6%; width: 88%; }
  .nx-cf.is-ready .nx-cf__slide[data-pos="1"] { transform: translateX(60%) rotateY(-35deg) scale(.8); opacity: .5; }
  .nx-cf.is-ready .nx-cf__slide[data-pos="-1"] { transform: translateX(-60%) rotateY(35deg) scale(.8); opacity: .5; }
}
@media (prefers-reduced-motion: reduce) { .nx-cf.is-ready .nx-cf__slide { transition: none; } }

/* ---- view switcher (pages/solutions/_switcher): radios choose which screenshot shows, CSS only ---- */
.nx-sw__choices { display: flex; flex-wrap: wrap; justify-content: center; gap: .625rem; margin: 0 0 clamp(2rem, 4vw, 3rem); padding: 0; border: 0; }
.nx-sw__choice { position: relative; cursor: pointer; }
.nx-sw__choice input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.nx-sw__choice span {
  display: inline-block;
  padding: .75rem 1.375rem;
  border-radius: 999px;
  border: 1px solid var(--nx-line-strong);
  font-size: 1.0625rem;
  font-weight: 600;
  transition: background .2s var(--nx-ease), color .2s var(--nx-ease), border-color .2s;
}
.nx-sw__choice input:checked + span { background: var(--nx-accent); border-color: var(--nx-accent); color: var(--nx-accent-fg); }
.nx-sw__choice input:focus-visible + span { outline: 2px solid var(--nx-accent); outline-offset: 3px; }
.nx-sw--quotes .nx-sw__choices { gap: .875rem; }
.nx-sw--quotes .nx-sw__choice span { padding: 1rem 1.5rem; border-radius: var(--nx-radius-lg); font-size: clamp(1.0625rem, .95rem + .4vw, 1.375rem); font-weight: 650; letter-spacing: -.01em; }
.nx-sw--quotes .nx-sw__choice span::before { content: "\201C"; }
.nx-sw--quotes .nx-sw__choice span::after { content: "\201D"; }
.nx-sw__panels { display: grid; max-width: 68rem; margin-inline: auto; }
.nx-sw__panel { grid-area: 1 / 1; margin: 0; visibility: hidden; opacity: 0; transition: opacity .35s var(--nx-ease); }
.nx-sw__caption { margin-top: 1.25rem; text-align: center; font-size: 1.125rem; line-height: 1.55; }
.nx-sw:not(:has(input:checked)) .nx-sw__panel[data-i="0"],
.nx-sw:has(input[value="0"]:checked) .nx-sw__panel[data-i="0"],
.nx-sw:has(input[value="1"]:checked) .nx-sw__panel[data-i="1"],
.nx-sw:has(input[value="2"]:checked) .nx-sw__panel[data-i="2"],
.nx-sw:has(input[value="3"]:checked) .nx-sw__panel[data-i="3"],
.nx-sw:has(input[value="4"]:checked) .nx-sw__panel[data-i="4"],
.nx-sw:has(input[value="5"]:checked) .nx-sw__panel[data-i="5"] { visibility: visible; opacity: 1; }

/* ---- product builder (VPS panel) ---- */
.nx-pb__grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
.nx-pb__inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem 2.5rem; }
.nx-pb__value { font-size: clamp(1.5rem, 1.2rem + 1vw, 2.125rem); font-weight: 750; letter-spacing: -.035em; line-height: 1; font-variant-numeric: tabular-nums; }
.nx-pb__card {
  padding: clamp(1.5rem, 3vw, 2.25rem);
  border-radius: var(--nx-radius-lg);
  background: var(--nx-paper);
  color: #0b0b0c;
  box-shadow: 0 2rem 4rem -1.5rem color-mix(in srgb, #000 45%, transparent);
}
[data-bs-theme="dark"] .nx-pb__card { background: #1c1c20; color: #fff; border: 1px solid color-mix(in srgb, #fff 14%, transparent); }
.nx-pb__name { margin: 0; font-size: 1.75rem; font-weight: 800; letter-spacing: -.03em; }
.nx-pb__specs { margin: .375rem 0 1.5rem; font-size: 1rem; opacity: .75; }
.nx-pb__label { margin: 0 0 .5rem; font-size: .8125rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; opacity: .6; }
.nx-pb__periods { margin: 0; padding: 0; list-style: none; }
.nx-pb__periods li { display: flex; justify-content: space-between; gap: 1rem; padding: .875rem 0; border-bottom: 1px solid color-mix(in srgb, currentColor 12%, transparent); font-size: 1.0625rem; }
.nx-pb__periods li.is-on b { color: var(--nx-blue-600); }
.nx-pb__periods em { margin-left: .5rem; padding: .125rem .5rem; border-radius: 999px; background: color-mix(in srgb, #16a34a 16%, transparent); color: #15803d; font-size: .8125rem; font-style: normal; font-weight: 650; }
[data-bs-theme="dark"] .nx-pb__periods em { color: #4ade80; }
.nx-pb__order { display: block; margin-top: 1.5rem; padding: .875rem 1rem; border-radius: 999px; background: var(--nx-blue-600); color: #fff; text-align: center; font-weight: 650; }

/* ---- readiness (VPS hosting) ---- */
.nx-rd__choices { display: flex; flex-wrap: wrap; gap: .625rem; margin: 0; padding: 0; border: 0; }
.nx-rd .nx-sw__choice input:checked + span { background: var(--nx-fg); border-color: var(--nx-fg); color: var(--nx-bg); }
.nx-rd .nx-sw__choice span::before { content: "+ "; }
.nx-rd .nx-sw__choice input:checked + span::before { content: "\2713  "; }
.nx-rd__sum { margin: clamp(2rem, 4vw, 3rem) 0 1.5rem; font-size: clamp(1.375rem, 1.1rem + .9vw, 2rem); font-weight: 750; letter-spacing: -.03em; line-height: 1.25; }
.nx-rd__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem 3rem; margin: 0; padding: 0; list-style: none; }
.nx-rd__list li { display: grid; gap: .375rem; }
.nx-rd__label { font-size: 1.1875rem; font-weight: 700; }
.nx-rd__how { font-size: 1.0625rem; line-height: 1.55; }
@media (max-width: 900px) {
  .nx-pb__grid, .nx-pb__inputs, .nx-rd__list { grid-template-columns: 1fr; }
}
.nx-sx-gap { height: clamp(4rem, 8vw, 7rem); }

/* a note under the poster hero (kit callout via heroAfter): left, on the hero's grid */
.nx-page-hero--poster .nx-callout { max-width: 52rem; margin-top: clamp(1.75rem, 3vw, 2.5rem); text-align: left; }
.nx-page-hero--poster .nx-callout__body p { margin: 0; }
.nx-page-hero--poster .nx-callout__body p + p { margin-top: .625rem; }

/* the sentence under every slide's text (cfNote) */
.nx-cf__aside {
  margin: .25rem 0 1.25rem;
  padding: .875rem 1.125rem;
  border-radius: 14px;
  background: color-mix(in srgb, var(--nx-accent) 12%, transparent);
  color: inherit;
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.45;
}
