/* Neon design: page-specific rules for the features pages (shared design system: /static/site.css).
   Pages: /features, /compare, /modules. This file loads on every page, so every rule is scoped:
     /features  main:has(> .feat-nav)   (only the features page has the category bar)
     /compare   #compare                (the comparison section)
     /modules   .group-h + .grid        (the module groups) */

/* ---------- /features ---------- */

/* Title: keep "layer-7" in one piece on phones. */
main:has(> .feat-nav) .page-head h1 .grad { white-space: nowrap; }

/* Category bar: a HUD index under the page head. */
main > .feat-nav { padding-top: 0.875rem; padding-bottom: 0.875rem; }
main > .feat-nav a { transition: color 0.2s, border-color 0.2s, background-color 0.2s; }
main > .feat-nav a:hover, main > .feat-nav a:focus-visible { background-color: rgba(24, 224, 255, 0.08); }

/* Plain sections that follow each other get a hairline between them. */
main:has(> .feat-nav) section:not(.band) + section:not(.band) { border-top: 1px solid var(--line-soft); }

/* Long feature lists: a masonry of panels (columns), so a long entry never
   stretches its neighbours into empty boxes. */
main:has(> .feat-nav) .feat-list { display: block; columns: 3 18.75rem; column-gap: 0.75rem; }
main:has(> .feat-nav) .feat-list > div { break-inside: avoid; margin: 0 0 0.75rem; transition: border-color 0.2s; }
main:has(> .feat-nav) .feat-list > div:hover { border-color: var(--line-strong); }

/* The screenshot sections have no eyebrow: a neon bar marks their titles. */
main:has(> .feat-nav) #rule-builder h2, main:has(> .feat-nav) #status-panels h2 { position: relative; padding-left: 1.125rem; }
main:has(> .feat-nav) #rule-builder h2::before, main:has(> .feat-nav) #status-panels h2::before {
  content: ""; position: absolute; left: 0; top: 0.16em; bottom: 0.16em; width: 0.25rem;
  background: linear-gradient(180deg, var(--cyan), var(--magenta)); box-shadow: 0 0 0.75rem rgba(24, 224, 255, 0.35); }
main:has(> .feat-nav) #publish { margin-top: 2.5rem; }
main:has(> .feat-nav) #publish h3 { font-size: clamp(1.15rem, 2vw, 1.4rem); text-transform: uppercase; letter-spacing: 0.04em; }

/* Screenshots: a chamfered HUD frame with a neon edge. */
main:has(> .feat-nav) .fig { margin: 1.375rem 0; }
main:has(> .feat-nav) .fig > a { --cut: 1.125rem; display: block; padding: 0.5rem; clip-path: var(--chamfer); transition: background 0.25s;
  background: linear-gradient(135deg, rgba(24, 224, 255, 0.3), rgba(24, 224, 255, 0.06) 40%, rgba(255, 47, 180, 0.06) 60%, rgba(255, 47, 180, 0.26)); }
main:has(> .feat-nav) .fig > a:hover { background: linear-gradient(135deg, rgba(24, 224, 255, 0.5), rgba(24, 224, 255, 0.1) 40%, rgba(255, 47, 180, 0.1) 60%, rgba(255, 47, 180, 0.4)); }
main:has(> .feat-nav) .fig > a:focus-visible { outline-offset: -0.3125rem; }
main:has(> .feat-nav) .fig img, main:has(> .feat-nav) .fig a:hover img { --cut: 0.75rem; clip-path: var(--chamfer); border: 0; background: var(--void); }
main:has(> .feat-nav) .fig figcaption { padding: 0.625rem 0.25rem 0; }
main:has(> .feat-nav) .fig figcaption::before { content: "▸ "; content: "▸ " / ""; color: var(--cyan); }

/* Numbered steps: chamfered mono counters. */
main:has(> .feat-nav) ol.steps { list-style: none; padding-left: 0; margin: 1.125rem 0 1.375rem; counter-reset: step; max-width: 52rem; }
main:has(> .feat-nav) ol.steps li { counter-increment: step; position: relative; padding: 0.3125rem 0 0.3125rem 2.875rem; margin: 0.375rem 0; }
main:has(> .feat-nav) ol.steps li::before { content: counter(step, decimal-leading-zero); --cut: 0.375rem; position: absolute; left: 0; top: 0.375rem; width: 2rem; height: 1.625rem;
  display: grid; place-items: center; font: 500 0.72rem/1 var(--mono); letter-spacing: 0.04em; color: var(--cyan);
  background: rgba(24, 224, 255, 0.08); box-shadow: inset 0 0 0 1px var(--line-hot); clip-path: var(--chamfer); }
main:has(> .feat-nav) ol.steps li b { color: var(--text); }

/* Lead-in line under "Built on current technology". */
main:has(> .feat-nav) .lead-in { color: var(--read); padding-left: 0.875rem; border-left: 2px solid var(--magenta); max-width: 52rem; }

/* "Port-based firewall vs Korthveil": the layer-7 column is lit. */
main:has(> .feat-nav) #layer7 table.compare th:last-child { color: var(--cyan); }
main:has(> .feat-nav) #layer7 table.compare td.yes { background: rgba(24, 224, 255, 0.045); }
main:has(> .feat-nav) #layer7 table.compare td:first-child { color: var(--text); }

/* Icon tiles glow a little on the card grids. */
main:has(> .feat-nav) .card .icon { box-shadow: 0 0 1.125rem rgba(24, 224, 255, 0.12); }

/* WireGuard enrollment card, the A/B/C copies and their flow chart. */
main:has(> .feat-nav) .wg-enroll { padding: 1.75rem 1.625rem; }
main:has(> .feat-nav) .abc-box { background: linear-gradient(180deg, rgba(255, 47, 180, 0.06), transparent 55%), var(--deck-2); }
main:has(> .feat-nav) .abc-box.c { background: linear-gradient(180deg, rgba(61, 242, 154, 0.06), transparent 55%), var(--deck-2); }
main:has(> .feat-nav) .abc-box b { text-shadow: 0 0 1.125rem rgba(255, 47, 180, 0.45); }
main:has(> .feat-nav) .abc-box.c b { text-shadow: 0 0 1.125rem rgba(61, 242, 154, 0.45); }

/* Small laptops: the twelve layer-7 cards in three columns of four rows. */
@media (min-width: 961px) and (max-width: 1180px) {
  main:has(> .feat-nav) .grid.g4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
/* Tablets: the twelve layer-7 cards in two columns, the platform cards in three. */
@media (min-width: 601px) and (max-width: 960px) {
  main:has(> .feat-nav) .grid.g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  main:has(> .feat-nav) #platform .grid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Tablets and phones: the category bar is one row that scrolls sideways and
   stays under the top bar while reading. */
@media (max-width: 1000px) {
  main > .feat-nav { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 4.0625rem); z-index: 40; flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain;
    scrollbar-width: none; background: rgba(5, 6, 12, 0.92); -webkit-backdrop-filter: blur(0.625rem); backdrop-filter: blur(0.625rem);
    border-bottom: 1px solid var(--line); padding-top: 0.625rem; padding-bottom: 0.625rem; }
  main > .page-head + .feat-nav { margin-top: 0; }
  main > .feat-nav::-webkit-scrollbar { display: none; }
  main > .feat-nav a { flex: none; white-space: nowrap; }
  main:has(> .feat-nav) [id] { scroll-margin-top: 8.25rem; }
}
/* Landscape phones: too little height for a second sticky bar. */
@media (max-width: 1000px) and (max-height: 500px) {
  main > .feat-nav { position: static; }
  main:has(> .feat-nav) [id] { scroll-margin-top: 5.25rem; }
}

/* Phones: the small comparison table stacks, one question per block. */
@media (max-width: 640px) {
  main:has(> .feat-nav) #layer7 .card { padding: 1.25rem 1rem 1.375rem; }
  main:has(> .feat-nav) #layer7 .table-wrap { border: 0; background: none; overflow: visible; }
  main:has(> .feat-nav) #layer7 table.compare, main:has(> .feat-nav) #layer7 table.compare tbody { display: block; }
  main:has(> .feat-nav) #layer7 table.compare thead { display: none; }
  main:has(> .feat-nav) #layer7 table.compare tr { display: block; padding: 0.75rem 0; border-top: 1px solid var(--line); }
  main:has(> .feat-nav) #layer7 table.compare tr:first-child { border-top: 0; padding-top: 0.25rem; }
  main:has(> .feat-nav) #layer7 table.compare td { display: grid; grid-template-columns: 6.8rem minmax(0, 1fr); gap: 0.625rem; padding: 0.25rem 0; border: 0; background: none; }
  main:has(> .feat-nav) #layer7 table.compare td:first-child { display: block; padding: 0 0 0.375rem; font: 600 1rem/1.35 var(--display); letter-spacing: 0.02em; }
  main:has(> .feat-nav) #layer7 table.compare td::before { font: 500 0.66rem/1.7 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }
  main:has(> .feat-nav) #layer7 table.compare td:nth-child(2)::before { content: "Ports only"; }
  main:has(> .feat-nav) #layer7 table.compare td:nth-child(3)::before { content: "Korthveil (L7)"; color: var(--cyan); }
  main:has(> .feat-nav) #layer7 table.compare tbody tr:hover td { background: none; }
  main:has(> .feat-nav) .wg-enroll { padding: 1.375rem 1rem; }
  main:has(> .feat-nav) .fig > a { --cut: 0.75rem; padding: 0.3125rem; }
  main:has(> .feat-nav) .fig img, main:has(> .feat-nav) .fig a:hover img { --cut: 0.5rem; }
  main:has(> .feat-nav) ol.steps li { padding-left: 2.625rem; }
}

/* ---------- /compare ---------- */

/* Wide screens: the whole table fits; Korthveil's column is lit. */
#compare .table-wrap { --cut: 1rem; clip-path: var(--chamfer); }
#compare table.compare-wide { min-width: 0; }
#compare table.compare-wide th:first-child { width: 26%; }
#compare table.compare-wide th, #compare table.compare-wide td { padding-left: 0.6875rem; padding-right: 0.6875rem; }
#compare table.compare-wide td:not(:first-child) { font-size: 0.84rem; }
#compare table.compare-wide td:first-child { color: var(--text); }
#compare table.compare-wide th:nth-child(2) { color: var(--cyan); box-shadow: inset 0 2px 0 var(--cyan);
  background: linear-gradient(180deg, rgba(24, 224, 255, 0.16), rgba(24, 224, 255, 0.06)), var(--deck-2); }
#compare table.compare-wide td:nth-child(2) { background: rgba(24, 224, 255, 0.05); box-shadow: inset 1px 0 0 var(--line), inset -1px 0 0 var(--line); }
#compare table.compare-wide tr.group td { background: linear-gradient(90deg, rgba(24, 224, 255, 0.09), rgba(255, 47, 180, 0.04) 60%, transparent), var(--deck-2); box-shadow: none; }
#compare table.compare-wide tr.group b::before { content: "// "; content: "// " / ""; color: var(--magenta); }
#compare table.compare-wide tbody tr:not(.group):hover td { background: rgba(24, 224, 255, 0.035); }
#compare table.compare-wide tbody tr:not(.group):hover td:nth-child(2) { background: rgba(24, 224, 255, 0.09); }
#compare .compare-why-h { position: relative; padding-left: 1.125rem; }
#compare .compare-why-h::before { content: ""; position: absolute; left: 0; top: 0.16em; bottom: 0.16em; width: 0.25rem;
  background: linear-gradient(180deg, var(--cyan), var(--magenta)); box-shadow: 0 0 0.75rem rgba(24, 224, 255, 0.35); }

/* Laptops and tablets: the table scrolls inside its frame with the capability
   column pinned, wide enough that no word is cut. */
@media (max-width: 1279px) {
  #compare .compare-swipe { display: block; }
  #compare .table-wrap { clip-path: none; }
  #compare table.compare-wide { min-width: 72.5rem; }
  #compare table.compare-wide th:first-child { width: 14.5rem; }
  #compare table.compare-wide th:first-child, #compare table.compare-wide td:first-child { position: sticky; left: 0; z-index: 1; background: var(--deck-2);
    box-shadow: inset -1px 0 0 var(--line-strong), 0.75rem 0 0.875rem -0.75rem rgba(0, 0, 0, 0.95); }
  #compare table.compare-wide tr.group td:first-child { position: static; box-shadow: none; }
}

/* Phones: every capability is its own panel, one line per firewall. */
@media (max-width: 640px) {
  #compare .compare-swipe { display: none; }
  #compare .table-wrap { border: 0; background: none; overflow: visible; }
  #compare table.compare-wide, #compare table.compare-wide tbody { display: block; min-width: 0; }
  #compare table.compare-wide thead { display: none; }
  #compare table.compare-wide tr { --cut: 0.75rem; display: block; margin: 0 0 0.625rem; background: var(--deck); clip-path: var(--chamfer); box-shadow: inset 0 0 0 1px var(--line); }
  #compare table.compare-wide td, #compare table.compare-wide td:first-child { position: static; display: grid; grid-template-columns: 9.2rem minmax(0, 1fr); gap: 0.625rem;
    align-items: baseline; padding: 0.4375rem 0.875rem; border-top: 1px solid var(--line-soft); background: none; box-shadow: none; font-size: 0.88rem; }
  #compare table.compare-wide td:first-child { display: block; padding: 0.875rem 0.875rem 0.625rem; border-top: 0; font: 600 1.02rem/1.35 var(--display); letter-spacing: 0.02em; }
  #compare table.compare-wide td:first-child small { font: 400 0.84rem/1.5 var(--body); letter-spacing: 0; margin-top: 0.25rem; }
  #compare table.compare-wide td:nth-child(2) { background: rgba(24, 224, 255, 0.07); box-shadow: inset 2px 0 0 var(--cyan); }
  #compare table.compare-wide tbody tr:not(.group):hover td { background: none; }
  #compare table.compare-wide tbody tr:not(.group):hover td:nth-child(2) { background: rgba(24, 224, 255, 0.07); }
  #compare table.compare-wide td:not(:first-child)::before { font: 400 0.8rem/1.5 var(--body); color: var(--dim); }
  #compare table.compare-wide td:nth-child(2)::before { content: "Korthveil"; color: var(--cyan); font-weight: 600; }
  #compare table.compare-wide td:nth-child(3)::before { content: "pfSense"; }
  #compare table.compare-wide td:nth-child(4)::before { content: "OPNsense"; }
  #compare table.compare-wide td:nth-child(5)::before { content: "Fortinet FortiGate"; }
  #compare table.compare-wide td:nth-child(6)::before { content: "Palo Alto Networks"; }
  #compare table.compare-wide td:nth-child(7)::before { content: "Sophos Firewall"; }
  #compare table.compare-wide td:nth-child(8)::before { content: "Ubiquiti UniFi gateways"; }
  #compare table.compare-wide tr.group { margin: 1.75rem 0 0.75rem; background: none; clip-path: none; box-shadow: none; }
  #compare table.compare-wide tr.group:first-child { margin-top: 0; }
  #compare table.compare-wide tr.group td, #compare table.compare-wide tr.group td:first-child { display: block; padding: 0 0 0 0.875rem; border: 0; background: none; box-shadow: inset 0.1875rem 0 0 var(--magenta); }
  #compare table.compare-wide tr.group b { font-size: 1.08rem; }
}
@media (max-width: 380px) {
  #compare table.compare-wide td:not(:first-child) { grid-template-columns: 7.8rem minmax(0, 1fr); }
}

/* ---------- /modules ---------- */

/* Group label with a hairline running to the right edge. */
.group-h:has(+ .grid) { display: flex; align-items: center; margin: 2.75rem 0 1rem; }
.group-h:has(+ .grid)::after { content: ""; flex: 1; height: 1px; margin-left: 0.875rem; background: linear-gradient(90deg, var(--line-mag), var(--line) 40%, transparent); }
.group-h:has(+ .grid)::before { white-space: pre; }
section > .wrap > .group-h:first-child:has(+ .grid) { margin-top: 0; }

/* Module cards: the plan pill sits on the bottom edge, aligned along a row;
   included modules get a green edge, premium ones the neon one. */
.group-h + .grid > .card { display: flex; flex-direction: column; transition: background 0.25s; }
.group-h + .grid > .card:hover { background: var(--deck-2); }
.group-h + .grid > .card > p:last-child { margin-top: auto; padding-top: 0.875rem; }
.group-h + .grid > .card h3 { font-size: 1.16rem; }
.group-h + .grid > .card:has(.pill.ok)::before { background: linear-gradient(135deg, rgba(61, 242, 154, 0.6), rgba(61, 242, 154, 0.08) 38%, rgba(24, 224, 255, 0.08) 62%, var(--line-mag)); }
.group-h + .grid > .card:has(.pill.warn)::before { background: linear-gradient(135deg, rgba(255, 177, 92, 0.6), rgba(255, 177, 92, 0.08) 38%, rgba(24, 224, 255, 0.08) 62%, var(--line-mag)); }
main:has(.group-h + .grid) .cta-band { margin-top: 3.5rem; }

/* Tablets: two cards per row instead of one. */
@media (min-width: 601px) and (max-width: 960px) {
  .group-h + .grid.g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .group-h + .grid > .card { padding: 1.25rem 1.125rem 1.375rem; }
}

/* ---------- Motion and print ---------- */
@media (prefers-reduced-motion: reduce) {
  main > .feat-nav a, main:has(> .feat-nav) .feat-list > div, main:has(> .feat-nav) .fig > a, .group-h + .grid > .card { transition: none; }
}
@media print {
  main > .feat-nav { position: static; }
  main:has(> .feat-nav) .fig > a, main:has(> .feat-nav) .fig img, #compare .table-wrap, #compare table.compare-wide tr { clip-path: none; background: none; }
}

/* ---------- Polish (site-fit-check, 2026-11-24) ---------- */
/* Touch screens: the section bar's links and the "What is inside" opener are 40 px to tap (were 30 and 26 px). */
@media (pointer: coarse), (max-width: 760px) {
  main > .feat-nav a { display: inline-flex; align-items: center; min-height: 2.5rem; }
  main:has(> .feat-nav) .wg-how details > summary { padding-top: 0.4375rem; padding-bottom: 0.4375rem; }
}
