/* Skills Pack: page-specific styles. Builds on /styles.css tokens and /tools/shared/learn.css. */

/* Hero */
.sp-hero { padding-bottom: clamp(110px, 12vw, 170px); }
.sp-hero .phero__title { max-width: 17ch; }
.sp-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.sp-btn-line { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1px #c9ccd2; }
.sp-btn-line:hover { box-shadow: inset 0 0 0 1px var(--blue); color: var(--blue); }
.sp-actions .ar, .sp-actions .btn:hover .ar, .sp-real .ar, .sp-real:hover .ar { transform: none; }
.sp-actions .btn:hover .ar, .sp-real:hover .ar { transform: translateY(2px); }
.sp-meta { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 22px; font-family: var(--mono); font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: #646973; }
.sp-meta span { display: inline-flex; align-items: center; gap: 10px; }
.sp-meta span::before { content: ""; width: 5px; height: 5px; background: var(--blue); }
.sp-meta a { color: var(--blue); border-bottom: 1px solid currentColor; }

/* Section heads */
.sp-head { display: grid; grid-template-columns: 1.1fr 1fr; gap: 24px 64px; align-items: end; margin-bottom: 48px; }
.sp-head h2 { margin-top: 14px; font-size: clamp(34px, 4.2vw, 56px); max-width: 18ch; }
.sp-head > p { color: var(--text); max-width: 32em; }
.sp-head strong { color: var(--ink); font-weight: 600; }
.sp-link { color: var(--blue); border-bottom: 1px solid currentColor; }
.sp-link:hover { color: var(--blue-deep); }
code { font-family: var(--mono); font-size: .92em; }

/* Skill cards */
.sp-skills { padding: clamp(96px, 12vw, 160px) 0; }
.sp-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.sp-card { display: flex; flex-direction: column; padding: 28px; background: #fff; border: 1px solid var(--line); transition: border-color .3s ease, transform .4s var(--ease); }
.sp-card:hover { border-color: var(--blue); transform: translateY(-3px); }
.sp-card__n { color: var(--blue); }
.sp-card h3 { margin-top: 16px; font-size: 26px; letter-spacing: -.03em; }
.sp-card > p:not(.mono) { margin-top: 10px; color: var(--text); font-size: 15.5px; }
.sp-card__out { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); color: #646973; }
.sp-list { display: grid; gap: 8px; margin: 12px 0 24px; }
.sp-list li { position: relative; padding-left: 18px; font-size: 15px; color: var(--ink); }
.sp-list li::before { content: ""; position: absolute; left: 0; top: .62em; width: 6px; height: 6px; background: var(--blue); }
.sp-dl { margin-top: auto; display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-family: var(--mono); font-size: 12px; letter-spacing: .04em; color: var(--blue); word-break: break-all; }
.sp-dl svg { flex: none; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.sp-dl:hover { color: var(--blue-deep); }

/* Try it */
.sp-try { background: var(--bg-2); padding: clamp(96px, 12vw, 160px) 0; }
.sp-stage { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 20px; align-items: start; }
.sp-form, .sp-out { background: #fff; border: 1px solid var(--line); min-width: 0; }
.sp-form { padding: 24px; display: grid; gap: 22px; position: sticky; top: 88px; }
.sp-field { display: grid; gap: 10px; border: 0; padding: 0; margin: 0; min-width: 0; }
.sp-field > label.mono, .sp-field > legend.mono { font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: #3c4047; padding: 0; margin-bottom: 10px; }
.sp-field > label.mono { margin-bottom: 0; }
.sp-field output { color: var(--blue); }
.sp-samples { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.sp-sample { min-height: 44px; padding: 8px 10px; text-align: left; font: 500 14px var(--sans); color: var(--ink); background: var(--bg-2); border: 1px solid transparent; cursor: pointer; transition: background-color .2s ease, border-color .2s ease, color .2s ease; }
.sp-sample:hover { border-color: var(--blue); }
.sp-sample[aria-checked="true"] { background: var(--blue); color: #fff; }
.sp-form textarea, .sp-form input[type="text"] { width: 100%; padding: 12px 14px; font: 15px/1.5 var(--sans); color: var(--ink); background: #fff; border: 1px solid #c9ccd2; border-radius: 0; resize: vertical; }
.sp-form input[type="text"] { min-height: 44px; }
.sp-form textarea:focus, .sp-form input[type="text"]:focus { outline: 2px solid var(--blue); outline-offset: -1px; border-color: var(--blue); }
.sp-checks { display: grid; gap: 4px; }
.sp-check { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 4px 0; font-size: 14.5px; color: var(--ink); cursor: pointer; }
.sp-check input { flex: none; width: 20px; height: 20px; accent-color: var(--blue); }
.sp-form input[type="range"] { width: 100%; height: 44px; accent-color: var(--blue); }
.sp-go { width: 100%; justify-content: space-between; }

.sp-out { padding: 24px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
.sp-out__top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.sp-out__top > .mono { color: #646973; }
.sp-tag { padding: 4px 8px; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
.sp-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); }
.sp-kpis > div { padding: 18px 20px; display: grid; gap: 6px; }
.sp-kpis > div + div { border-left: 1px solid var(--line); }
.sp-kpis b { font-size: clamp(34px, 4vw, 48px); font-weight: 500; letter-spacing: -.04em; line-height: 1; color: var(--blue); }
.sp-kpis span { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: #646973; }
.sp-ready > .mono { color: #646973; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; }
.sp-checklist { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 20px; margin-top: 18px; }
.sp-checklist li { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; line-height: 1.45; }
.sp-checklist svg { flex: none; width: 16px; height: 16px; margin-top: 2px; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sp-checklist .is-ok { color: var(--ink); }
.sp-checklist .is-ok svg { stroke: #0f7b45; }
.sp-checklist .is-gap { color: #8a4b00; }
.sp-checklist .is-gap svg { stroke: #b86200; }

/* The assembled document */
.sp-doc { border: 1px solid var(--line); border-top: 3px solid var(--blue); padding: 24px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; min-width: 0; }
.sp-doc__head .mono { color: var(--blue); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; }
.sp-doc__head h3 { margin-top: 8px; font-size: clamp(26px, 3vw, 34px); letter-spacing: -.03em; }
.sp-doc dl > div { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 4px 18px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.sp-doc dt { font-family: var(--mono); font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase; color: #646973; padding-top: 3px; }
.sp-doc dd { margin: 0; font-size: 15px; color: var(--ink); }
.sp-sec { min-width: 0; transition: opacity .5s var(--ease) var(--d, 0ms), transform .5s var(--ease) var(--d, 0ms); }
.sp-doc.is-building .sp-sec { opacity: 0; transform: translateY(10px); transition: none; }
.sp-sec h4 { display: flex; align-items: center; gap: 12px; font-size: 18px; letter-spacing: -.02em; margin-bottom: 10px; }
.sp-sec h4 .mono { display: grid; place-items: center; width: 26px; height: 26px; font-size: 12px; color: #fff; background: var(--blue); }
.sp-sec p { color: var(--text); font-size: 15px; }
.sp-tw { overflow-x: auto; border: 1px solid var(--line); -webkit-overflow-scrolling: touch; }
.sp-tw table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 14px; }
.sp-tw th { text-align: left; padding: 9px 12px; font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .05em; text-transform: uppercase; color: #3c4047; background: var(--bg-2); border-bottom: 1px solid var(--line); }
.sp-tw td { padding: 9px 12px; vertical-align: top; color: var(--ink); border-bottom: 1px solid var(--line); }
.sp-tw tr:last-child td { border-bottom: 0; }
.is-open, .sp-open { color: #8a4b00; font-style: italic; }
.sp-never { display: grid; gap: 6px; }
.sp-never li { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; color: var(--ink); }
.sp-never svg { flex: none; width: 16px; height: 16px; margin-top: 3px; fill: none; stroke: #b42318; stroke-width: 1.7; }
.sp-flag { display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; padding: 2px 8px; font-family: var(--mono); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; font-style: normal; }
.sp-flag svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.sp-flag--warn { color: #8a4b00; background: #fff4e5; }
.sp-means { padding: 20px 22px; background: #f3f5ff; border-left: 2px solid var(--blue); }
.sp-means p:not(.mono) { margin-top: 10px; font-size: 15.5px; color: var(--ink); }
.sp-means strong { font-weight: 600; }
.sp-real { justify-self: start; white-space: normal; text-align: left; height: auto; min-height: 48px; padding-top: 12px; padding-bottom: 12px; }

/* Install */
.sp-install { padding: clamp(96px, 12vw, 160px) 0; }
.sp-ibox { background: #fff; border: 1px solid var(--line); }
.sp-tabs { display: flex; gap: 4px; padding: 12px; border-bottom: 1px solid var(--line); }
.sp-tabs [role="tab"] { height: 44px; padding: 0 20px; font-family: var(--mono); font-size: 13px; letter-spacing: .05em; text-transform: uppercase; color: #3c4047; background: var(--bg-2); transition: background-color .25s ease, color .25s ease; }
.sp-tabs [role="tab"]:hover { color: var(--blue); background: #eceef4; }
.sp-tabs [role="tab"][aria-selected="true"] { background: var(--blue); color: #fff; }
.sp-panel { padding: 36px; }
.js .sp-panel.is-in { animation: spPanelIn .45s var(--ease) both; }
@keyframes spPanelIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.sp-steps { display: grid; gap: 32px; max-width: 760px; }
.sp-steps li { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: 20px; }
.sp-steps li > div { min-width: 0; }
.sp-steps .num { font-size: 32px; margin: 0; }
.sp-steps h3, .sp-opt h3 { font-size: 22px; letter-spacing: -.025em; }
.sp-steps p, .sp-opt p:not(.mono) { margin-top: 8px; color: var(--text); font-size: 15.5px; }
.sp-steps strong { color: var(--ink); font-weight: 600; }
.sp-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.sp-opt { display: flex; flex-direction: column; min-width: 0; }
.sp-opt > .mono { color: var(--blue); margin-bottom: 12px; }
.sp-code { position: relative; margin-top: 14px; background: var(--navy-2); color: #e6e9f5; }
.sp-code pre { margin: 0; padding: 16px 18px; padding-right: 84px; overflow-x: auto; font-family: var(--mono); font-size: 13px; line-height: 1.6; }
.sp-copy { position: absolute; top: 7px; right: 8px; height: 44px; min-width: 64px; padding: 0 12px; font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: #fff; background: rgba(255, 255, 255, .1); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); transition: background-color .25s ease; z-index: 1; }
.sp-copy:hover { background: rgba(255, 255, 255, .2); }
.sp-copy.is-ok { background: var(--blue); box-shadow: none; }

/* Guide extras */
.sp-myth { margin-top: 40px; }
.sp-note { margin-top: 20px; }

/* Lead band */
.sp-lead { background: var(--navy); color: #fff; padding: clamp(80px, 9vw, 120px) 0; }
.sp-lead__in { display: grid; grid-template-columns: 1.2fr auto; gap: 40px 64px; align-items: end; }
.sp-lead .mono { opacity: .7; }
.sp-lead h2 { margin-top: 14px; font-size: clamp(32px, 3.8vw, 50px); max-width: 16ch; }
.sp-lead p:not(.mono) { margin-top: 18px; max-width: 34em; color: rgba(255, 255, 255, .8); }
.sp-btn-white { background: #fff; color: var(--navy); justify-content: space-between; }
.sp-btn-white:hover { background: #e9edff; }

/* Focus */
.sp-sample:focus-visible, .sp-tabs [role="tab"]:focus-visible, .sp-copy:focus-visible, .sp-dl:focus-visible, .sp-check input:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

@media (max-width: 1100px) {
  .sp-stage { grid-template-columns: minmax(0, 1fr); }
  .sp-form { position: static; }
}
@media (max-width: 1000px) {
  .sp-head { grid-template-columns: 1fr; align-items: start; }
  .sp-cards { grid-template-columns: 1fr; }
  .sp-opts { grid-template-columns: 1fr; gap: 48px; }
  .sp-lead__in { grid-template-columns: 1fr; align-items: start; }
}
@media (max-width: 760px) {
  .sp-actions .btn { width: 100%; justify-content: space-between; }
  .sp-form, .sp-out, .sp-doc { padding: 18px; }
  .sp-card { padding: 22px; }
  .sp-kpis { grid-template-columns: 1fr; }
  .sp-kpis > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .sp-kpis > div { grid-template-columns: auto 1fr; align-items: center; gap: 14px; padding: 12px 16px; }
  .sp-kpis b { font-size: 32px; }
  .sp-checklist { grid-template-columns: 1fr; }
  .sp-doc dl > div { grid-template-columns: 1fr; }
  .sp-out__top .lx-actions { width: 100%; }
  .sp-out__top .lx-act { flex: 1 1 calc(50% - 5px); justify-content: center; padding: 0 10px; }
  .sp-tabs { padding: 10px; }
  .sp-tabs [role="tab"] { flex: 1 1 0; padding: 0 8px; font-size: 11.5px; line-height: 1.2; }
  .sp-panel { padding: 24px 18px; }
  .sp-steps li { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .sp-code pre { font-size: 12px; padding: 60px 16px 16px; }
  .sp-real { width: 100%; justify-content: space-between; }
  .sp-lead__row .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .sp-sec, .sp-card { transition: none; }
  .sp-card:hover { transform: none; }
  .js .sp-panel.is-in { animation: none; }
}
@media print {
  .sp-hero .lx-fig, .sp-actions, .sp-meta, .sp-skills, .sp-form, .sp-install, .sp-faq, .sp-lead, .sp-real, .sp-try .sp-head > p { display: none !important; }
  .sp-try { padding: 0; background: #fff; }
  .sp-stage { display: block; }
  .sp-out { border: 0; padding: 0; }
  .sp-sec { break-inside: avoid; opacity: 1 !important; transform: none !important; }
  .sp-tw { overflow: visible; }
  .sp-tw table { min-width: 0; }
}

/* Fieldsets default to min-content width; let them shrink on very narrow screens */
fieldset.sp-field, .sp-field { min-width: 0; }
.sp-samples { grid-template-columns: repeat(auto-fit, minmax(min(130px, 100%), 1fr)); }
.sp-sample { min-width: 0; white-space: normal; }
.sp-form { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 360px) { .sp-lead__in { grid-template-columns: minmax(0, 1fr); } .sp-lead__in > * { min-width: 0; } .sp-lead__row .btn { white-space: normal; height: auto; min-height: 44px; padding-top: 10px; padding-bottom: 10px; } }
@media (max-width: 360px) { .btn--lg { white-space: normal; height: auto; min-height: 44px; padding-top: 10px; padding-bottom: 10px; max-width: 100%; } }
