/* Why Use STPA-Sec?: the evidence page for STPA-Sec, built from the owner's Figma mockup.
   Everything is scoped to .ss-section. The evidence filter, the "show all" button and the
   control-loop picker are radio buttons and a checkbox read with :has(), so they need no script. */

/* One reading column, as wide as the other Why Use pages. */
.ss-section .ss-col { max-width: calc(1024px + 2 * var(--gutter)); }
.ss-section .ss-h2 { margin: 0 0 18px; font-family: var(--font-head); font-size: clamp(28px, 3.4vw, 40px); line-height: 1.2; letter-spacing: -.01em; }
.ss-section .ss-h3 { margin: 0 0 12px; font-family: var(--font-head); font-size: clamp(21px, 2.2vw, 25px); line-height: 1.3; }
.ss-section p { font-size: 17px; line-height: 1.7; }
.ss-section .ss-lead { margin-bottom: 32px; font-size: 18px; color: #4a5a72; }
.ss-section .ss-src { margin: 0 0 10px; font-size: 14px; line-height: 1.5; color: #56687f; }
.ss-section .ss-src a { color: var(--steel-text); text-decoration: none; }
.ss-section .ss-src a:hover { text-decoration: underline; }

/* Links to the sections, under the banner. */
.ss-jump { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 48px; }
.ss-jump a { padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg-tint); color: var(--navy-text); font-size: 14px; font-weight: 500; text-decoration: none; }
.ss-jump a:hover { border-color: var(--steel); color: var(--steel-text); }

/* The three reasons. */
.ss-reasons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 0 0 24px; padding: 0; list-style: none; }
.ss-reason { display: flex; flex-direction: column; padding: 24px; border: 1px solid var(--line); }
.ss-reason p { flex: 1; margin: 12px 0 16px; font-size: 16px; line-height: 1.6; color: var(--navy-text); }
.ss-num { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--navy-btn); color: #fff; font-weight: 700; }
.ss-section .ss-strong { margin: 0 0 56px; font-weight: 600; color: var(--navy-text); }

/* One picture of security for each team. */
.ss-teams { margin-bottom: 8px; }
.ss-team-grid { margin-top: 24px; }
.ss-team { padding: 22px; border-radius: var(--radius); background: var(--bg-tint); }
.ss-team h4 { margin: 14px 0 6px; font-size: 17px; font-weight: 700; color: var(--navy-text); }
.ss-section .ss-team p { margin: 0; font-size: 15px; line-height: 1.6; }
.ss-section .ss-quote { margin-top: 48px; }
.ss-section .ss-quote figcaption { font-size: 15px; }

/* Evidence filter: pill labels for hidden radio buttons. */
.ss-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; padding: 0; border: 0; }
.ss-filter label { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--navy-text); font-size: 15px; font-weight: 500; cursor: pointer; }
.ss-filter label:hover { border-color: var(--steel); }
.ss-filter input:checked + label { border-color: var(--navy-btn); background: var(--navy-btn); color: #fff; }
.ss-filter input:focus-visible + label, .ss-loop-pick input:focus-visible + label { outline: 3px solid var(--steel); outline-offset: 2px; }
.ss-count { display: inline-grid; place-items: center; min-width: 24px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--steel-soft); color: var(--navy-btn); font-size: 12px; font-weight: 700; }
.ss-filter input:checked + label .ss-count { background: rgb(255 255 255 / 18%); color: #fff; }

/* Each theme's opening paragraph shows only while its filter is on. */
.ss-section .ss-intro { display: none; margin: 0 0 24px; padding: 18px 22px; border-left: 3px solid var(--steel); border-radius: 0 12px 12px 0; background: #fff; font-size: 16px; }
.ss-ev:has(#ev-func:checked) .ss-intro[data-for="func"],
.ss-ev:has(#ev-early:checked) .ss-intro[data-for="early"] { display: block; }

.ss-ev:has(#ev-func:checked) .ss-card:not([data-tags~="func"]),
.ss-ev:has(#ev-early:checked) .ss-card:not([data-tags~="early"]),
.ss-ev:has(#ev-use:checked) .ss-card:not([data-tags~="use"]),
.ss-ev:has(#ev-std:checked) .ss-card:not([data-tags~="std"]),
.ss-ev:has(#ev-effort:checked) .ss-card:not([data-tags~="effort"]) { display: none; }

/* With "All" on, the first cards show and the rest (.ss-later) open with the button. */
.ss-ev:has(#ev-all:checked) .ss-more-toggle:not(:checked) ~ .ss-cards .ss-later { display: none; }
.ss-ev:not(:has(#ev-all:checked)) .ss-more-btn { display: none; }
.ss-more-toggle:checked ~ .ss-more-btn .ss-more-show,
.ss-more-toggle:not(:checked) ~ .ss-more-btn .ss-more-hide { display: none; }
.ss-more-toggle:focus-visible ~ .ss-more-btn { outline: 3px solid var(--steel); outline-offset: 2px; }
.ss-ev .ss-more-btn { display: flex; width: max-content; margin: 28px auto 0; cursor: pointer; }

/* Evidence cards. */
.ss-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.ss-card { padding: 24px 26px; border: 1px solid var(--line); }
.ss-card-wide { grid-column: 1 / -1; border-top: 4px solid var(--steel); }
.ss-claim { margin: 0 0 8px; font-size: 13px !important; font-weight: 600; letter-spacing: .06em; line-height: 1.4 !important; text-transform: uppercase; color: var(--steel-text); }
.ss-card h3 { margin: 0 0 6px; font-size: 19px; font-weight: 700; line-height: 1.35; color: var(--navy-text); }
.ss-section .ss-card p { margin: 0 0 10px; font-size: 15.5px; line-height: 1.6; }
.ss-section .ss-card > :last-child { margin-bottom: 0; }
.ss-card blockquote { margin: 4px 0 12px; padding: 0; }
.ss-section .ss-card blockquote p { font-family: var(--font-head); font-style: italic; font-size: 17px; line-height: 1.5; color: var(--navy-text); }
.ss-card details.ss-more { margin-top: 6px; }
.ss-card details.ss-more > summary { display: inline-flex; color: var(--steel-text); font-weight: 600; font-size: 15px; cursor: pointer; list-style: none; }
.ss-card details.ss-more > summary::-webkit-details-marker { display: none; }
.ss-card details.ss-more > summary::after { content: "+"; margin-left: 6px; }
.ss-card details.ss-more[open] > summary::after { content: "–"; }
.ss-card details.ss-more[open] > summary { margin-bottom: 12px; }
.ss-card details ul { margin: 0 0 12px; padding-left: 1.2em; list-style: disc; font-size: 15.5px; line-height: 1.6; }
.ss-card details li { margin-bottom: 6px; }
.ss-section .ss-card .ss-effort { padding: 12px 14px; border-radius: 10px; background: var(--steel-soft); font-size: 14.5px; }
.ss-effort-grid { display: flex; gap: 12px; margin: 6px 0 14px; }
.ss-effort-grid div { flex: 1; padding: 10px 14px; border-radius: 10px; background: var(--bg-tint); }
.ss-effort-grid dt { font-size: 13px; color: #56687f; }
.ss-effort-grid dd { margin: 0; font-size: 22px; font-weight: 700; color: var(--navy-text); }
.ss-effort-grid div:last-child { background: var(--steel-soft); }

/* Security as a control problem: the loop picker. */
.ss-loop-wrap { display: grid; grid-template-columns: 1fr 1.15fr; gap: 40px; align-items: start; margin-bottom: 32px; }
.ss-loop { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-tint); }
.ss-loop-pick { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; padding: 0; border: 0; }
.ss-loop-legend { display: flex; align-items: center; gap: 8px; width: 100%; margin-bottom: 10px; font-size: 15px; font-weight: 600; color: var(--navy-text); }
.ss-loop-legend .icon { width: 18px; height: 18px; color: var(--steel); }
.ss-loop-pick label { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--navy-text); font-size: 14px; cursor: pointer; }
.ss-loop-pick label:hover { border-color: #d2671d; }
.ss-loop-pick input:checked + label { border-color: #b35714; background: #b35714; color: #fff; }
.ss-loop-svg { display: block; width: 100%; max-width: 460px; height: auto; margin: 0 auto; }
.ss-loop-svg text { fill: var(--navy-text); font-family: var(--font-body); }
.ss-loop-svg .ss-t-name { font-size: 17px; font-weight: 700; text-anchor: middle; }
.ss-loop-svg .ss-t-small { font-size: 13px; text-anchor: middle; }
.ss-loop-svg .ss-t-label { font-size: 15px; font-weight: 600; fill: #4a6a96; }
.ss-loop-svg .ss-box { fill: #d6e4f5; stroke: #7fa7d7; stroke-width: 2; }
.ss-loop-svg .ss-part rect { fill: #eef3f9; stroke: #b9c9dd; stroke-width: 2; transition: fill .2s, stroke .2s; }
.ss-loop-svg .ss-ghost { stroke-dasharray: 6 4; }
.ss-loop-svg .ss-wire { fill: none; stroke: #8aa0bd; stroke-width: 3; marker-end: url(#ss-arrow); transition: stroke .2s; }
.ss-loop-svg .ss-p-auth { opacity: .5; }
.ss-loop:has(#lp-fb:checked) .ss-p-fb,
.ss-loop:has(#lp-ca:checked) .ss-p-ca,
.ss-loop:has(#lp-pm:checked) .ss-p-pm,
.ss-loop:has(#lp-auth:checked) .ss-p-auth,
.ss-loop:has(#lp-org:checked) .ss-p-org { opacity: 1; }
.ss-loop:has(#lp-fb:checked) .ss-p-fb .ss-wire,
.ss-loop:has(#lp-ca:checked) .ss-p-ca .ss-wire,
.ss-loop:has(#lp-auth:checked) .ss-p-auth .ss-wire,
.ss-loop:has(#lp-org:checked) .ss-p-org .ss-wire { stroke: #d2671d; stroke-width: 5; marker-end: url(#ss-arrow-on); }
.ss-loop:has(#lp-fb:checked) .ss-p-fb text,
.ss-loop:has(#lp-ca:checked) .ss-p-ca text { fill: #b4530f; }
.ss-loop:has(#lp-pm:checked) .ss-p-pm rect,
.ss-loop:has(#lp-auth:checked) .ss-p-auth rect,
.ss-loop:has(#lp-org:checked) .ss-p-org rect { fill: #fde9d9; stroke: #d2671d; }
.ss-loop-notes { min-height: 96px; margin-top: 12px; }
.ss-section .ss-loop-notes p { display: none; margin: 0; font-size: 15.5px; line-height: 1.6; color: var(--navy-text); text-wrap: pretty; }
.ss-loop:has(#lp-fb:checked) .ss-loop-notes [data-for="fb"],
.ss-loop:has(#lp-ca:checked) .ss-loop-notes [data-for="ca"],
.ss-loop:has(#lp-pm:checked) .ss-loop-notes [data-for="pm"],
.ss-loop:has(#lp-auth:checked) .ss-loop-notes [data-for="auth"],
.ss-loop:has(#lp-org:checked) .ss-loop-notes [data-for="org"] { display: block; }
@media (prefers-reduced-motion: reduce) {
  .ss-loop-svg .ss-part rect, .ss-loop-svg .ss-wire { transition: none; }
}

/* Comparison: one method against STPA-Sec per tab, or all six. */
.ss-tabs .tab-list { justify-content: flex-start; margin-bottom: 20px; }
.ss-cmp { width: 100%; table-layout: fixed; border-radius: var(--radius-sm); overflow: hidden; background: #fff; box-shadow: var(--shadow); }
.ss-cmp th, .ss-cmp td { vertical-align: top; }
.ss-cmp thead th:first-child { width: 22%; }
.ss-cmp tbody th, .ss-cmp-all tbody th { padding: 14px 16px; border-top: 1px solid var(--line); background: #fff; color: var(--navy-text); font-weight: 600; vertical-align: top; }
.ss-cmp tbody tr:nth-child(even) th, .ss-cmp-all tbody tr:nth-child(even) th { background: var(--bg-tint); }
.ss-cmp tbody td:first-of-type { font-weight: 400; color: var(--text); }
.ss-cmp td:last-child, .ss-cmp tbody tr:nth-child(even) td:last-child { background: var(--steel-soft); color: var(--navy-text); }
.ss-cmp thead th:last-child { background: var(--steel-text); }
.ss-cmp-all tbody td:first-of-type { font-weight: 400; color: var(--text); }
.ss-cmp-all .ss-row-us th, .ss-cmp-all tbody .ss-row-us td { background: var(--steel-soft); color: var(--navy-text); }

/* Working with existing methods: three stages. */
.ss-flow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px; margin: 0 0 48px; padding: 0; list-style: none; }
.ss-stage { position: relative; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.ss-stage-us { border-color: #c9dcf2; background: var(--steel-soft); }
.ss-stage:not(:last-child)::after { content: ""; position: absolute; top: 50%; right: -27px; width: 14px; height: 14px; border-top: 3px solid var(--steel); border-right: 3px solid var(--steel); transform: translateY(-50%) rotate(45deg); }
.ss-section .ss-stage-step { margin: 0 0 4px; font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--steel-text); }
.ss-stage h3 { margin: 0 0 14px; font-size: 18px; font-weight: 700; color: var(--navy-text); }
.ss-stage .chips li { padding: 4px 11px; font-size: 13.5px; }
.ss-section .ss-stage-note { margin: 12px 0 0; font-size: 14.5px; }
.ss-two { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-bottom: 32px; }
.ss-section .ss-position { margin: 0; font-size: 18px; font-weight: 600; text-align: center; }

/* Leadership briefing and references. */
.ss-briefing { display: flex; align-items: center; justify-content: space-between; gap: 32px; }
.ss-briefing p { margin: 0; }
.ss-refs { margin: 0; padding-left: 1.2em; list-style: disc; }
.ss-refs li { margin-bottom: 10px; font-size: 15.5px; line-height: 1.6; }
.ss-refs li::marker { color: var(--steel); }
.ss-refs a { color: var(--steel-text); }

@media (max-width: 1000px) {
  .ss-reasons { grid-template-columns: 1fr; }
  .ss-loop-wrap { grid-template-columns: 1fr; gap: 24px; }
  .ss-flow { grid-template-columns: 1fr; gap: 28px; }
  .ss-stage:not(:last-child)::after { top: auto; right: auto; bottom: -22px; left: 50%; transform: translateX(-50%) rotate(135deg); }
}
@media (max-width: 760px) {
  .ss-jump { margin-bottom: 32px; }
  .ss-cards, .ss-two { grid-template-columns: 1fr; }
  .ss-card { padding: 20px; }
  .ss-briefing { flex-direction: column; align-items: flex-start; gap: 20px; }
  .ss-loop { padding: 16px; }
  .ss-cmp thead th:first-child { width: 28%; }
  .ss-cmp th, .ss-cmp td { padding: 10px; font-size: 14px; }
}


/* ---- Dark mode, generated by tools/darkmode.py when the site is built. Don't edit this part in site/; change the light rule in src/, or add a hand-written dark rule. ---- */
@media (prefers-color-scheme: dark) {
  .ss-section .ss-lead { color: #b7c9e5; }
  .ss-section .ss-src { color: #b1c5df; }
  .ss-jump a:hover { border-color: #4892dc; }
  .ss-num { color: #ffffff; }
  .ss-filter label { background-color: #111620; }
  .ss-filter label:hover { border-color: #4892dc; }
  .ss-filter input:checked + label { border-color: #8ba5d4; color: #ffffff; }
  .ss-filter input:focus-visible + label, .ss-loop-pick input:focus-visible + label { outline-color: #4892dc; }
  .ss-count { color: #bbd6ff; }
  .ss-filter input:checked + label .ss-count { background-color: rgb(17 22 32 / 18%); color: #ffffff; }
  .ss-section .ss-intro { border-left-color: #4892dc; background-color: #111620; }
  .ss-more-toggle:focus-visible ~ .ss-more-btn { outline-color: #4892dc; }
  .ss-card-wide { border-top-color: #4892dc; }
  .ss-effort-grid dt { color: #b1c5df; }
  .ss-loop-legend .icon { color: #7ebaf9; }
  .ss-loop-pick label { background-color: #111620; }
  .ss-loop-pick input:checked + label { background-color: #b35714; color: #ffffff; }
  .ss-cmp { background-color: #111620; }
  .ss-cmp tbody th, .ss-cmp-all tbody th { background-color: #111620; }
  .ss-cmp thead th:last-child { background-color: #2f6fb5; }
  .ss-stage { background-color: #111620; }
  .ss-stage-us { border-color: #333e4c; }
  .ss-stage:not(:last-child)::after { border-top-color: #4892dc; border-right-color: #4892dc; }
  .ss-refs li::marker { color: #7ebaf9; }
}
