/* ============================
   Skills Page
   ============================ */

:root {
  /* Subtle off-black surfaces (the global --bg-card is green) */
  --sk-surface: #151817;
  --sk-surface-hover: #1c201e;
  --sk-border: #272b29;
}

/* ---- Intro (full-bleed dotted hero, left-aligned content) ---- */
/* The section spans the full viewport width so the interactive dot grid
   can run edge to edge; the inner wrapper caps content at --max-width
   (1300px) plus the 24px side gutters, matching the header's .nav-inner. */
.sk-intro {
  position: relative;
  overflow: hidden;
  min-height: 80vh;
}
.sk-dots {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}
/* Fade the dotted grid into the page background at the bottom of the hero. */
.sk-intro::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 260px;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(13, 16, 15, 0) 0%, var(--bg-primary) 100%);
}
.sk-intro-inner {
  position: relative;
  z-index: 1;
  max-width: calc(var(--max-width) + 48px);
  margin: 0 auto;
  padding: 220px 24px 180px;
  text-align: center;
}
.sk-eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green-100);
  margin-bottom: 20px;
}
.sk-title {
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin: 0;
}

/* ---- Layout: categories (col 1) + sources (cols 2-4) ---- */
.sk-layout {
  max-width: calc(var(--max-width) + 48px);
  margin: 0 auto;
  padding: 48px 24px 88px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  align-items: start;
}
.sk-cats {
  grid-column: 1;
  position: sticky;
  top: 90px;
}
.sk-main {
  grid-column: 2 / -1;
  min-width: 0;
}

/* ---- Category list ---- */
.sk-cats-title {
  margin: 0 0 24px;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--text-primary);
}
/* Right-column variant sits above the source grid */
.sk-grid-title {
  margin-top: 4px;
  scroll-margin-top: 90px;
}
.sk-cat-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sk-cat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 6px 0;
  font-size: 14px;
  font-weight: 400;
  font-family: inherit;
  color: var(--text-primary);
  opacity: 0.6;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  transition: opacity 0.15s;
}
.sk-cat:hover { opacity: 1; }
.sk-cat.active { opacity: 1; }

/* ---- Lookup: container that holds the input + hint and expands to show the result ---- */
.sk-lookup-bar {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 44px auto 0;
  padding: 20px;
  border: 1px solid var(--sk-border);
  border-radius: 18px;
  background: rgba(20, 24, 23, 0.55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  text-align: left;
  box-shadow: 0 22px 70px -28px rgba(253, 250, 195, 0.18);
  transition: box-shadow 0.4s ease, border-color 0.4s ease;
}
/* Soft yellow halo that gently breathes behind the container. */
.sk-lookup-bar::after {
  content: "";
  position: absolute;
  inset: -36px;
  z-index: -1;
  border-radius: 44px;
  background: radial-gradient(
    58% 58% at 50% 50%,
    rgba(253, 250, 195, 0.26),
    rgba(253, 250, 195, 0) 72%
  );
  filter: blur(16px);
  opacity: 0.6;
  pointer-events: none;
}
/* Focus brings the magic forward: stronger, tighter glow + warm border. */
.sk-lookup-bar:focus-within {
  box-shadow: 0 26px 80px -26px rgba(253, 250, 195, 0.4);
}
.sk-lookup-bar:focus-within::after {
  opacity: 0.85;
  filter: blur(10px);
}
.sk-lookup-form { display: block; position: relative; }
.sk-input-xl {
  box-sizing: border-box;
  width: 100%;
  padding: 16px 20px;
  border: 1px solid var(--sk-border);
  border-radius: 12px;
  background: var(--bg-primary, #0d100f);
  font-family: inherit;
  font-size: clamp(15px, 1.4vw, 18px);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  caret-color: #fff;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.sk-input-xl::placeholder {
  color: var(--text-muted);
  opacity: 0.4;
}
.sk-input-xl:focus {
  box-shadow: none;
}
/* Animated faux-placeholder that slides up as it rotates through examples. */
.sk-input-ghost {
  position: absolute;
  left: 21px;
  right: 21px;
  top: 1px;
  bottom: 1px;
  display: flex;
  align-items: center;
  overflow: hidden;
  pointer-events: none;
  color: var(--text-muted);
  font-size: clamp(15px, 1.4vw, 18px);
  font-weight: 500;
  letter-spacing: -0.01em;
  opacity: 0.4;
  transition: opacity 0.15s ease;
}
.sk-input-ghost.is-hidden { opacity: 0; }
.sk-input-ghost-text {
  display: block;
  transition: transform 0.24s ease, opacity 0.24s ease;
}
.sk-input-ghost.is-leaving .sk-input-ghost-text {
  transform: translateY(-110%);
  opacity: 0;
}
.sk-input-ghost.is-entering .sk-input-ghost-text {
  transform: translateY(110%);
  opacity: 0;
  transition: none;
}
/* Hint and result share one grid cell (stacked). The cell's height is driven by
   whichever child is taller, so swapping hint -> result can never shrink the
   container — it only grows down as the result expands. */
.sk-lookup-extra {
  display: grid;
}
.sk-lookup-extra > * {
  grid-area: 1 / 1;
}
.sk-lookup-hint {
  margin: 20px 4px 2px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--text-muted);
  opacity: 1;
  transition: opacity 0.25s ease;
}
.sk-lookup-hint.is-collapsed {
  opacity: 0;
  pointer-events: none;
}
/* Submit happens on Enter; keep an accessible, visually hidden button. */
.sk-lookup-submit {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Lookup result (revealed inside the lookup container) ---- */
.sk-result[hidden] { display: none; }
/* Result reveal: the container animates its height open, then the content fades in. */
.sk-result {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.42s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.sk-result.is-open { grid-template-rows: 1fr; }
.sk-result-inner {
  overflow: hidden;
  min-height: 0;
  padding-top: 20px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s ease 0.16s, transform 0.3s ease 0.16s;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "head actions"
    "desc desc";
  column-gap: 12px;
}
.sk-result-row { grid-area: head; }
.sk-result-actions { grid-area: actions; }
.sk-result-desc { grid-area: desc; }
.sk-result.is-open .sk-result-inner {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .sk-result { transition: none; }
  .sk-result-inner { transition: none; }
  .sk-lookup-hint { transition: none; }
}

.sk-result-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.sk-result-headings { min-width: 0; flex: 1; }
.sk-result-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sk-result-cat {
  margin-top: 2px;
  font-size: 13px;
  color: var(--text-muted);
}
.sk-result-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  align-self: center;
}
.sk-result-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  white-space: nowrap;
  transition: background 0.18s ease, opacity 0.18s ease, border-color 0.18s ease;
}
.sk-result-btn-secondary {
  color: var(--text-primary);
  background: var(--sk-surface-hover);
  border: 1px solid var(--sk-border);
}
.sk-result-btn-secondary:hover { background: #262b29; }
.sk-result-view:hover {
  background: var(--sk-surface-hover);
  border-color: rgba(255, 255, 255, 0.8);
}
.sk-result-btn-primary {
  color: var(--bg-primary);
  background: var(--accent);
}
.sk-result-btn-primary:hover { opacity: 0.9; }
.sk-result-desc {
  margin: 20px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-muted);
  text-wrap: pretty;
}
.sk-result-busy { animation: skPulse 1.1s ease-in-out infinite; }
@keyframes skPulse { 0%, 100% { opacity: 0.45; } 50% { opacity: 0.85; } }

/* ---- Source grid (3 columns within the main area) ---- */
.sk-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.sk-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin: 0;
  padding: 22px;
  background: var(--sk-surface);
  border: 1px solid var(--sk-border);
  border-radius: 16px;
  font: inherit;
  text-align: left;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: transform 0.18s, border-color 0.18s, background 0.18s;
}
.sk-card:hover {
  transform: translateY(-2px);
  border-color: #34403b;
  background: var(--sk-surface-hover);
}
.sk-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}
.sk-card-headings {
  min-width: 0;
  flex: 1;
}
.sk-card-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sk-card-cat {
  margin-top: 2px;
  font-size: 13px;
  color: var(--text-muted);
}
.sk-card-desc {
  margin: auto 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-muted);
  text-wrap: pretty;
}

/* Cap the bottom CTA heading width on the skills page. */
.deck-cta-heading {
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

/* ---- Skill detail modal ---- */
.sk-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.sk-modal[hidden] { display: none; }
.sk-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(6, 8, 7, 0.66);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.22s ease;
}
.sk-modal.is-open .sk-modal-overlay { opacity: 1; }
.sk-modal-dialog {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: min(86vh, 760px);
  display: flex;
  flex-direction: column;
  padding: 28px;
  background: var(--sk-surface);
  border: 1px solid var(--sk-border);
  border-radius: 20px;
  box-shadow: 0 30px 90px -30px rgba(0, 0, 0, 0.7);
  outline: none;
  opacity: 0;
  transform: translateY(8px) scale(0.985);
  transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.sk-modal.is-open .sk-modal-dialog {
  opacity: 1;
  transform: none;
}
.sk-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.sk-modal-close:hover { background: var(--sk-surface-hover); color: var(--text-primary); }
.sk-modal-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-right: 36px;
  margin-bottom: 20px;
}
.sk-modal-headings { min-width: 0; }
.sk-modal-name {
  margin: 0;
  font-size: 20px;
  font-weight: 500;
  color: var(--text-primary);
}
.sk-modal-cat {
  margin-top: 2px;
  font-size: 13px;
  color: var(--text-muted);
}
.sk-modal-body {
  overflow-y: auto;
  margin: 0 -28px;
  padding: 4px 28px 28px;
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 40px), transparent 100%);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 40px), transparent 100%);
}
.sk-modal-section { margin-bottom: 34px; }
.sk-modal-section:last-child { margin-bottom: 0; }
.sk-modal-section-title {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-primary);
}
.sk-modal-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary, #b9c2bd);
  text-wrap: pretty;
}
.sk-modal-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.sk-modal-list li {
  position: relative;
  padding: 0 0 0 20px;
  margin-bottom: 8px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary, #b9c2bd);
  text-wrap: pretty;
}
.sk-modal-list li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 9px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent, #FDFAC3);
}
.sk-modal-links li::before { display: none; }
.sk-modal-links li { padding-left: 0; }
.sk-modal-links a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(255, 255, 255, 0.25);
  transition: color 0.15s, text-decoration-color 0.15s;
}
.sk-modal-links a:hover {
  color: var(--text-primary);
  text-decoration-color: var(--text-primary);
}
.sk-modal-steps {
  margin: 0;
  padding: 0;
  list-style: none;
}
.sk-modal-steps li {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
}
.sk-modal-step-n {
  flex-shrink: 0;
  margin-top: 2px;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 500;
}
.sk-modal-step-c {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-muted);
  text-wrap: pretty;
}
.sk-modal-step-c strong {
  display: block;
  color: var(--text-primary);
  font-weight: 500;
}
.sk-modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--sk-border);
}
.sk-modal-actions .sk-result-btn { flex: 1; }
body.sk-modal-open { overflow: hidden; }
@media (prefers-reduced-motion: reduce) {
  .sk-modal-overlay,
  .sk-modal-dialog { transition: none; }
}

/* ---- Logos ---- */
.sk-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: transparent;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}
.sk-logo img { width: 100%; height: 100%; object-fit: contain; }
.sk-logo-md { width: 40px; height: 40px; }
.sk-logo-lg { width: 52px; height: 52px; }
/* Monogram fallback when the favicon fails to load */
.sk-logo-fallback {
  background: var(--sk-surface-hover);
}
.sk-logo-fallback::after {
  content: attr(data-initial);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--text-primary);
}
.sk-logo-md.sk-logo-fallback::after { font-size: 18px; }
.sk-logo-lg.sk-logo-fallback::after { font-size: 22px; }

/* ---- "Don't see your source?" find block ---- */
/* "Don't see your source?" card — matches a grid card and links to the hero input. */
.sk-find-card {
  display: flex;
  flex-direction: column;
  cursor: default;
}
.sk-find-card:hover {
  transform: none;
  border-color: var(--sk-border);
  background: var(--sk-surface);
}
.sk-find-title {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
}
.sk-find-sub {
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-muted);
  text-wrap: pretty;
}
.sk-find-cta {
  align-self: flex-start;
  margin-top: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  border: 1px solid var(--sk-border);
  border-radius: 8px;
  background: var(--sk-surface-hover);
  color: var(--text-primary);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}
.sk-find-cta:hover { background: #262b29; }
.sk-empty {
  margin-top: 8px;
  padding: 40px 0;
  text-align: center;
  font-size: 15px;
  color: var(--text-muted);
}

/* ============================
   Responsive
   ============================ */
@media (max-width: 1024px) {
  .sk-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .sk-layout {
    grid-template-columns: minmax(0, 1fr);
    padding-top: 36px;
    gap: 20px;
  }
  .sk-cats { position: static; grid-column: 1 / -1; min-width: 0; }
  .sk-main { grid-column: 1 / -1; min-width: 0; }
  .sk-cats-title { margin-bottom: 14px; }
  /* Categories become a single horizontal, scrollable row of chips */
  .sk-cat-list {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin: 0 -24px;
    padding: 2px 24px;
  }
  .sk-cat-list::-webkit-scrollbar { display: none; }
  .sk-cat {
    flex-shrink: 0;
    width: auto;
    white-space: nowrap;
    opacity: 0.6;
    border: 1px solid var(--sk-border);
    border-radius: 100px;
    padding: 7px 14px;
  }
  .sk-cat.active { opacity: 1; border-color: rgba(255, 255, 255, 0.5); }
}
@media (max-width: 768px) {
  .sk-intro { min-height: 90vh; }
  .sk-intro-inner { padding: 150px 24px 90px; }
  .sk-lookup-bar { margin-top: 36px; padding: 12px; }
  /* Result stacks: logo + name, then description under it, then buttons */
  .sk-result-inner {
    grid-template-columns: 1fr;
    grid-template-areas:
      "head"
      "desc"
      "actions";
  }
  .sk-result-actions { width: 100%; margin-top: 16px; }
  .sk-result-btn { flex: 1; }
  /* Skill blocks stack one on top of another */
  .sk-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .sk-intro-inner { padding: 150px 24px 80px; }
}
