/* =========================================================
   Skills & Workflows — AI-First Mindset members' library.
   Matches the existing /hub design language:
   Mulish type, dark ink hero with grid texture + soft glows,
   cream surface, yellow CTA pills, blue secondary.
   --aifm-accent is driven by the Tweaks panel (defaults to yellow).
   ========================================================= */

.sw-root {
  --ink: #201600;
  --ink-70: rgba(32, 22, 0, 0.70);
  --ink-55: rgba(32, 22, 0, 0.55);
  --ink-40: rgba(32, 22, 0, 0.40);
  --yellow: #f3af00;
  --yellow-deep: #c78f00;
  --blue: #207796;
  --blue-deep: #155a73;
  --cream: #faf8f3;
  --cream-2: #f5f1e6;
  --line: #f0eee8;
  --line-2: #e7e3d8;
  --muted: #6b6557;
  --white: #ffffff;

  /* Accent — overridden inline by Tweaks. */
  --accent: var(--yellow);
  --accent-deep: var(--yellow-deep);
  --accent-ink: #201600;

  font-family: "Mulish", "Muli", -apple-system, system-ui, sans-serif;
  color: var(--ink);
  background: var(--cream);
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.sw-root *,
.sw-root *::before,
.sw-root *::after { box-sizing: border-box; }
.sw-root ::selection { background: color-mix(in oklab, var(--accent) 28%, white); color: var(--ink); }

.sw-eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ===================== Hero ===================== */
.sw-hero {
  position: relative;
  background:
    radial-gradient(46rem 28rem at 22% -10%, rgba(243,175,0,0.20) 0%, transparent 60%),
    radial-gradient(40rem 26rem at 92% 8%, rgba(32,119,150,0.22) 0%, transparent 62%),
    linear-gradient(180deg, #241a09 0%, #1a1206 48%, #140e05 100%);
  color: #fff;
  overflow: hidden;
}
.sw-hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(ellipse at 50% 24%, black 0%, transparent 78%);
  pointer-events: none;
}
.sw-hero-inner {
  position: relative;
  max-width: 1120px;
  margin: 0 auto;
  /* Top padding clears the fixed site nav (~84px at rest) with a small
     gap, matching the hub hero. */
  padding: 88px 40px 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 36px;
}
.sw-hero-text { flex: 1 1 auto; min-width: 0; }

/* Rotating Raj mascot on the right of the hero — varies per load. Soft
   yellow glow behind it, drop shadow to ground it on the dark band. */
.sw-hero-figure {
  flex: 0 0 auto;
  width: 172px; height: 172px;
  position: relative;
  display: grid; place-items: center;
}
.sw-hero-figure::before {
  content: ""; position: absolute; inset: -10px;
  background: radial-gradient(circle at 50% 55%, rgba(243,175,0,0.22), transparent 66%);
  pointer-events: none;
}
.sw-hero-figure img {
  position: relative; z-index: 1;
  width: 172px; height: 172px;
  object-fit: contain;
  filter: drop-shadow(0 8px 14px rgba(0,0,0,0.4));
}

/* top nav bar inside hero — dropped on the live page (shared site nav
   provides brand + links above). Style kept harmless in case it renders. */
.sw-topbar {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 16px;
  padding-bottom: 28px;
}
.sw-brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 13px; letter-spacing: 0.04em;
  text-transform: uppercase; color: #fff;
}
.sw-brand .reg { color: var(--yellow); font-size: 9px; vertical-align: super; }
.sw-brand-mark {
  width: 30px; height: 28px;
  display: grid; place-items: center;
}
.sw-crumbs {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 700;
  color: rgba(255,255,255,0.62);
}
.sw-crumbs .sep { color: rgba(255,255,255,0.3); }
.sw-crumbs .cur { color: #fff; }

.sw-hero-eyebrow {
  color: var(--yellow);
  margin-bottom: 18px;
}
.sw-hero h1 {
  margin: 0;
  font-weight: 900;
  font-size: clamp(38px, 6vw, 62px);
  line-height: 1.02;
  letter-spacing: -0.025em;
  max-width: 16ch;
}
.sw-hero h1 .accent { color: var(--yellow); }
.sw-hero-sub {
  margin: 20px 0 0;
  font-size: clamp(16px, 1.7vw, 19px);
  line-height: 1.5;
  font-weight: 500;
  color: rgba(255,255,255,0.78);
  max-width: 46ch;
}

.sw-stats {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 30px;
}
.sw-stat {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13.5px; font-weight: 700;
  color: rgba(255,255,255,0.9);
}
.sw-stat .n {
  font-weight: 900;
  color: var(--yellow);
}
.sw-stat .dot {
  width: 4px; height: 4px; border-radius: 999px;
  background: rgba(255,255,255,0.3);
}

/* ===================== Trust banner ===================== */
.sw-trust {
  position: relative;
  background: var(--ink);
  color: rgba(255,255,255,0.92);
  border-top: 1px solid rgba(255,255,255,0.07);
}
.sw-trust-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px 40px;
  display: flex; align-items: center; gap: 16px;
}
.sw-shield {
  flex-shrink: 0;
  width: 38px; height: 38px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: rgba(243,175,0,0.14);
  color: var(--yellow);
  border: 1px solid rgba(243,175,0,0.3);
}
.sw-shield svg { width: 20px; height: 20px; }
.sw-trust-text {
  font-size: 14px; line-height: 1.5; font-weight: 500;
  color: rgba(255,255,255,0.82);
  text-wrap: pretty;
}
.sw-trust-text b {
  font-weight: 800;
  color: #fff;
}

/* ===================== Body shell ===================== */
.sw-body {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 40px 80px;
}

/* ===================== Explainer ===================== */
.sw-explainer {
  display: flex; align-items: flex-start; gap: 14px;
  margin-top: 28px;
  padding: 16px 18px;
  background: var(--white);
  border: 1px solid var(--line-2);
  border-radius: 14px;
}
.sw-explainer .ic {
  flex-shrink: 0;
  width: 34px; height: 34px;
  border-radius: 9px;
  display: grid; place-items: center;
  background: var(--cream-2);
  color: var(--blue);
}
.sw-explainer .ic svg { width: 18px; height: 18px; }
.sw-explainer .x-copy { flex: 1; }
.sw-explainer .x-title {
  font-weight: 800; font-size: 14.5px;
  margin-bottom: 3px;
}
.sw-explainer .x-body {
  font-size: 13.5px; line-height: 1.5;
  color: var(--muted); font-weight: 500;
  text-wrap: pretty;
}
.sw-explainer .x-dismiss {
  flex-shrink: 0;
  width: 30px; height: 30px;
  border-radius: 8px;
  display: grid; place-items: center;
  background: transparent; border: 0;
  color: var(--ink-40);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.sw-explainer .x-dismiss:hover { background: var(--cream-2); color: var(--ink); }
.sw-explainer .x-dismiss svg { width: 15px; height: 15px; }

/* ===================== Sticky category nav ===================== */
.sw-nav {
  position: sticky;
  /* Sticks just below the fixed site nav (~72px when scrolled), matching
     the hub's filter-bar pattern. */
  top: 72px;
  z-index: 20;
  margin-top: 28px;
  padding: 14px 0;
  background: color-mix(in oklab, var(--cream) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line-2);
}
.sw-nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 40px;
  display: flex; align-items: center; gap: 8px;
  overflow-x: auto;
  -ms-overflow-style: none; scrollbar-width: none;
}
.sw-nav-inner::-webkit-scrollbar { display: none; }
.sw-chip {
  flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 7px;
  height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--white);
  border: 1px solid var(--line-2);
  color: var(--ink-70);
  font-family: inherit;
  font-size: 13.5px; font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background .14s, color .14s, border-color .14s, transform .08s;
}
.sw-chip:hover { border-color: var(--ink-40); color: var(--ink); }
.sw-chip:active { transform: scale(0.97); }
.sw-chip.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.sw-chip.active .chip-count { color: rgba(255,255,255,0.6); }
.sw-chip .chip-count {
  font-size: 12px; font-weight: 800;
  color: var(--ink-40);
}

/* ===================== Section ===================== */
.sw-section { margin-top: 46px; scroll-margin-top: 88px; }
.sw-section-head {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 20px;
}
.sw-section-dot {
  width: 11px; height: 11px; border-radius: 4px;
  flex-shrink: 0;
}
.sw-section-head h2 {
  margin: 0;
  font-weight: 900; font-size: 22px;
  letter-spacing: -0.01em;
}
.sw-section-head .count {
  font-size: 13.5px; font-weight: 800;
  color: var(--ink-40);
}
.sw-section-head .rule {
  flex: 1; height: 1px; background: var(--line-2);
}

/* ===================== Grid + cards ===================== */
.sw-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  align-items: start;
}
.sw-card {
  display: flex; flex-direction: column;
  background: var(--white);
  border: 1px solid var(--line-2);
  border-radius: 16px;
  padding: 18px 18px 16px;
  transition: border-color .16s, box-shadow .16s, transform .16s;
}
.sw-card:hover {
  border-color: color-mix(in oklab, var(--ink) 22%, var(--line-2));
  box-shadow: 0 12px 30px -18px rgba(32,22,0,0.35);
  transform: translateY(-2px);
}
/* Deep-link arrival flash — when the feed's "Get the skill" lands here. */
.sw-card.sw-card-flash { animation: swCardFlash 2.4s ease-out; }
@keyframes swCardFlash {
  0%   { box-shadow: 0 0 0 4px rgba(243,175,0,0.70); border-color: #f3af00; }
  60%  { box-shadow: 0 0 0 4px rgba(243,175,0,0.35); border-color: #f3af00; }
  100% { box-shadow: 0 0 0 4px rgba(243,175,0,0.00); }
}
.sw-card.open {
  border-color: color-mix(in oklab, var(--ink) 30%, var(--line-2));
  box-shadow: 0 16px 36px -20px rgba(32,22,0,0.4);
}

.sw-cat-chip {
  align-self: flex-start;
  display: inline-flex; align-items: center;
  height: 24px; padding: 0 10px;
  border-radius: 999px;
  font-size: 11px; font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sw-card-name {
  margin: 12px 0 0;
  font-weight: 800; font-size: 18px;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.sw-card-does {
  margin: 6px 0 0;
  font-size: 13.5px; line-height: 1.45;
  color: var(--muted); font-weight: 500;
  text-wrap: pretty;
}

.sw-card-get {
  display: flex; align-items: baseline; gap: 6px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line-2);
  font-size: 12.5px; line-height: 1.4;
}
.sw-card-get .label {
  font-weight: 800; color: var(--ink);
  white-space: nowrap;
}
.sw-card-get .val {
  color: var(--muted); font-weight: 600;
}

.sw-card-actions {
  display: flex; align-items: center; gap: 8px;
  margin-top: 14px;
}
.sw-dl {
  flex: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  border: 0;
  font-family: inherit;
  font-size: 13.5px; font-weight: 800;
  cursor: pointer;
  transition: filter .14s, transform .08s;
}
.sw-dl:hover { filter: brightness(0.95); }
.sw-dl:active { transform: scale(0.98); }
.sw-dl svg { width: 15px; height: 15px; }
.sw-dl .mono { font-family: "JetBrains Mono", ui-monospace, monospace; font-weight: 600; font-size: 12.5px; }

.sw-how {
  display: inline-flex; align-items: center; gap: 6px;
  height: 40px; padding: 0 14px;
  border-radius: 999px;
  background: var(--white);
  border: 1px solid var(--line-2);
  color: var(--ink-70);
  font-family: inherit;
  font-size: 13px; font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .14s, color .14s, background .14s;
}
.sw-how:hover { border-color: var(--ink-40); color: var(--ink); }
.sw-how svg { width: 13px; height: 13px; transition: transform .2s; }
.sw-how.open svg { transform: rotate(180deg); }

/* inline 3-step guide */
.sw-steps {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .26s ease;
}
.sw-steps.open { grid-template-rows: 1fr; }
.sw-steps-clip { overflow: hidden; }
.sw-steps-inner {
  margin-top: 14px;
  padding: 14px;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.sw-step {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 13px; line-height: 1.45;
  color: var(--ink);
  font-weight: 600;
}
.sw-step + .sw-step { margin-top: 10px; }
.sw-step .num {
  flex-shrink: 0;
  width: 20px; height: 20px;
  border-radius: 6px;
  display: grid; place-items: center;
  background: var(--ink); color: var(--accent);
  font-size: 11px; font-weight: 800;
}
.sw-step code {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px; font-weight: 600;
  background: var(--cream-2);
  padding: 1px 6px; border-radius: 5px;
}

/* ===================== Custom CTA ===================== */
.sw-custom {
  margin-top: 64px;
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  background:
    radial-gradient(34rem 20rem at 88% -20%, rgba(32,119,150,0.28) 0%, transparent 60%),
    linear-gradient(180deg, #241a09 0%, #160f06 100%);
  color: #fff;
  padding: 44px 44px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 28px; flex-wrap: wrap;
}
.sw-custom::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.045) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 30% 50%, black 0%, transparent 80%);
  pointer-events: none;
}
.sw-custom-copy { position: relative; max-width: 52ch; }
.sw-custom-copy .eyebrow { color: var(--yellow); margin-bottom: 12px; }
.sw-custom-copy h3 {
  margin: 0;
  font-weight: 900; font-size: 28px; letter-spacing: -0.02em;
  line-height: 1.1;
}
.sw-custom-copy p {
  margin: 12px 0 0;
  font-size: 15px; line-height: 1.5; font-weight: 500;
  color: rgba(255,255,255,0.74);
  text-wrap: pretty;
}
.sw-custom-btn {
  position: relative;
  flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 9px;
  height: 50px; padding: 0 26px;
  border-radius: 999px;
  background: var(--accent); color: var(--accent-ink);
  border: 0;
  font-family: inherit; font-size: 15px; font-weight: 800;
  cursor: pointer;
  transition: filter .14s, transform .08s;
}
.sw-custom-btn:hover { filter: brightness(0.95); }
.sw-custom-btn:active { transform: scale(0.98); }
.sw-custom-btn svg { width: 17px; height: 17px; }

/* ===================== Footer ===================== */
.sw-footer {
  border-top: 1px solid var(--line-2);
  background: var(--cream);
}
.sw-footer-inner {
  max-width: 1120px; margin: 0 auto;
  padding: 28px 40px 40px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; flex-wrap: wrap;
}
.sw-footer .f-brand {
  display: flex; align-items: center; gap: 9px;
  font-weight: 800; font-size: 12.5px; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--ink);
}
.sw-footer .f-note {
  font-size: 12.5px; color: var(--ink-55); font-weight: 600;
}
.sw-footer .f-links {
  display: flex; align-items: center; gap: 20px;
}
.sw-footer .f-links a {
  font-size: 13px; font-weight: 700; color: var(--ink-70);
  text-decoration: none;
}
.sw-footer .f-links a:hover { color: var(--blue); }

/* ===================== Download toast ===================== */
.sw-toast {
  position: fixed;
  left: 50%; bottom: 28px; transform: translateX(-50%);
  z-index: 60;
  display: inline-flex; align-items: center; gap: 9px;
  padding: 11px 18px;
  background: var(--ink); color: #fff;
  border-radius: 999px;
  font-size: 13.5px; font-weight: 700;
  box-shadow: 0 16px 40px -16px rgba(32,22,0,0.6);
  animation: sw-toast-in .22s ease;
}
.sw-toast svg { width: 15px; height: 15px; color: var(--accent); }
@keyframes sw-toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ===================== Responsive ===================== */
@media (max-width: 1000px) {
  .sw-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .sw-hero-inner { padding: 80px 22px 44px; flex-direction: column; align-items: flex-start; gap: 24px; }
  .sw-hero-figure { display: none; }
  .sw-topbar { padding-bottom: 40px; }
  .sw-crumbs { display: none; }
  .sw-trust-inner { padding: 16px 22px; align-items: flex-start; }
  .sw-body { padding: 0 22px 64px; }
  .sw-nav-inner { padding: 0 22px; }
  .sw-grid { grid-template-columns: 1fr; }
  .sw-custom { padding: 32px 26px; }
  .sw-custom-btn { width: 100%; justify-content: center; }
  .sw-footer-inner { padding: 24px 22px 36px; flex-direction: column; align-items: flex-start; }
}

/* ===================== Search (in sticky nav) ===================== */
/* The search box is a fixed leading affordance; the chips flow after it and
   wrap onto extra rows so none get cut off. overflow:visible keeps the search
   focus ring from being clipped. */
.sw-nav-inner { overflow: visible; flex-wrap: wrap; }

.sw-search {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 8px;
  height: 38px;
  width: 248px; max-width: 42vw;
  padding: 0 10px 0 12px;
  border-radius: 999px;
  background: var(--white);
  border: 1px solid var(--line-2);
  transition: border-color .14s, box-shadow .14s;
}
.sw-search:focus-within {
  border-color: var(--ink-40);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 22%, transparent);
}
.sw-search-ic {
  flex-shrink: 0;
  display: grid; place-items: center;
  color: var(--ink-40);
}
.sw-search-ic svg { width: 15px; height: 15px; }
.sw-search:focus-within .sw-search-ic { color: var(--ink-70); }

.sw-search-input {
  flex: 1 1 auto; min-width: 0;
  height: 100%;
  border: 0; outline: 0; background: transparent;
  font-family: inherit;
  font-size: 13.5px; font-weight: 700;
  color: var(--ink);
}
.sw-search-input::placeholder { color: var(--ink-40); font-weight: 600; }
/* Hide the browser's native clear control — we render our own. */
.sw-search-input::-webkit-search-decoration,
.sw-search-input::-webkit-search-cancel-button,
.sw-search-input::-webkit-search-results-button,
.sw-search-input::-webkit-search-results-decoration { -webkit-appearance: none; appearance: none; }

.sw-search-clear {
  flex-shrink: 0;
  width: 24px; height: 24px;
  border-radius: 999px;
  display: grid; place-items: center;
  background: transparent; border: 0;
  color: var(--ink-40);
  cursor: pointer;
  transition: background .14s, color .14s;
}
.sw-search-clear:hover { background: var(--cream-2); color: var(--ink); }
.sw-search-clear svg { width: 13px; height: 13px; }
.sw-search-clear[hidden] { display: none; }

/* Card / section hidden by an active query. */
.sw-card.sw-hidden,
.sw-section.sw-hidden { display: none !important; }

/* ===================== No results ===================== */
.sw-no-results {
  display: flex; align-items: flex-start; gap: 14px;
  margin-top: 40px;
  padding: 22px 22px;
  background: var(--white);
  border: 1px solid var(--line-2);
  border-radius: 16px;
}
.sw-no-results .sw-nr-ic {
  flex-shrink: 0;
  width: 38px; height: 38px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: var(--cream-2);
  color: var(--muted);
}
.sw-no-results .sw-nr-ic svg { width: 19px; height: 19px; }
.sw-no-results .sw-nr-copy { flex: 1; min-width: 0; }
.sw-no-results .sw-nr-title {
  font-weight: 800; font-size: 15px;
  letter-spacing: -0.01em;
  color: var(--ink);
  word-break: break-word;
}
.sw-no-results .sw-nr-body {
  margin-top: 4px;
  font-size: 13.5px; line-height: 1.5;
  color: var(--muted); font-weight: 500;
  text-wrap: pretty;
}
.sw-no-results .sw-nr-clear {
  padding: 0; border: 0; background: transparent;
  font-family: inherit; font-size: inherit; font-weight: 800;
  color: var(--blue);
  cursor: pointer;
  text-decoration: underline; text-underline-offset: 2px;
}
.sw-no-results .sw-nr-clear:hover { color: var(--blue-deep); }

/* Search responsive — full-width search on its own row, chips wrap beneath. */
@media (max-width: 760px) {
  .sw-search { width: 100%; max-width: none; }
}
