/* ============================================================
   Nick's Patch Collection — site styles
   Hand-written, framework-free. Light & bright.
   ============================================================ */

:root {
  --bg:        #f5f7fb;
  --bg-soft:   #eef1f8;
  --surface:   #ffffff;
  --ink:       #0f172a;
  --ink-soft:  #475569;
  --ink-mute:  #8a97ab;
  --line:      #e6eaf2;
  --line-soft: #eef1f7;
  --brand:     #3457ff;
  --brand-dk:  #2440d9;
  --brand-soft:#eaefff;
  --accent:    #7c3aed;
  --ok:        #16a34a;
  --radius:    18px;
  --radius-sm: 12px;
  --shadow:    0 1px 2px rgba(16,24,40,.04), 0 8px 24px rgba(16,24,40,.06);
  --shadow-lg: 0 12px 40px rgba(16,24,40,.12);
  --maxw:      1180px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  background-image:
    radial-gradient(1100px 500px at 80% -200px, rgba(124,58,237,.10), transparent 60%),
    radial-gradient(1000px 480px at 0% -220px, rgba(52,87,255,.12), transparent 60%);
  background-repeat: no-repeat;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dk); }

h1, h2, h3, h4, h5 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.02em; font-weight: 700; }
h1 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
h3 { font-size: 1.35rem; }
p  { margin: 0 0 1rem; color: var(--ink-soft); }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.section   { padding: 56px 0; }
.section-sm{ padding: 36px 0; }
.muted     { color: var(--ink-mute); }
.center    { text-align: center; }
.lead      { font-size: 1.15rem; color: var(--ink-soft); }

/* ---- Buttons --------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: .5em;
  font: inherit; font-weight: 600; font-size: .95rem;
  padding: .62em 1.15em; border-radius: var(--radius-sm);
  border: 1px solid transparent; cursor: pointer; transition: .15s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dk); color: #fff; transform: translateY(-1px); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-sm { padding: .45em .85em; font-size: .85rem; }

/* ---- Header / nav ---------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.82);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; gap: 18px; height: 68px; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 800; color: var(--ink); letter-spacing: -.02em; font-size: 1.08rem; }
.brand:hover { color: var(--ink); }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  display: grid; place-items: center; color: #fff;
  box-shadow: 0 6px 16px rgba(52,87,255,.35);
}
.brand-mark svg { width: 20px; height: 20px; }
.nav-links { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.nav-links a {
  color: var(--ink-soft); font-weight: 500; font-size: .95rem;
  padding: .5em .8em; border-radius: 9px;
}
.nav-links a:hover, .nav-links a.active { color: var(--ink); background: var(--bg-soft); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.nav-dropdown { position: relative; }
.nav-dropdown > a::after { content: "▾"; font-size: .7em; margin-left: .35em; color: var(--ink-mute); }
.nav-menu {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 220px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-lg); padding: 8px; opacity: 0; visibility: hidden;
  transform: translateY(6px); transition: .16s ease;
}
.nav-dropdown:hover .nav-menu, .nav-dropdown:focus-within .nav-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.nav-menu a { display: flex; align-items: center; gap: 10px; padding: .55em .7em; border-radius: 9px; color: var(--ink-soft); font-weight: 500; }
.nav-menu a:hover { background: var(--bg-soft); color: var(--ink); }
.nav-menu .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }

.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 8px; color: var(--ink); }
.nav-toggle svg { width: 26px; height: 26px; }

/* ---- Hero ------------------------------------------------- */
.hero { padding: 64px 0 40px; }
.hero h1 { margin-bottom: .35em; }
.hero p { font-size: 1.2rem; max-width: 640px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: .5em; font-size: .82rem; font-weight: 600;
  color: var(--brand-dk); background: var(--brand-soft); padding: .4em .85em; border-radius: 999px;
  margin-bottom: 18px; letter-spacing: .01em;
}
.eyebrow .pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px rgba(22,163,74,.18); }

/* ---- Stats ------------------------------------------------ */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 44px; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
}
.stat .num { font-size: 2rem; font-weight: 800; letter-spacing: -.03em; color: var(--ink); }
.stat .lbl { font-size: .85rem; color: var(--ink-mute); font-weight: 500; }

/* ---- Category chips -------------------------------------- */
.chip {
  display: inline-flex; align-items: center; gap: .4em;
  font-size: .76rem; font-weight: 600; padding: .32em .7em; border-radius: 999px;
  line-height: 1;
}
.chip svg { width: 14px; height: 14px; }

/* Filter bar */
.filterbar { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 28px; }
.filter {
  display: inline-flex; align-items: center; gap: .5em; font-size: .9rem; font-weight: 600;
  padding: .5em 1em; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-soft); transition: .15s ease;
}
.filter svg { width: 16px; height: 16px; }
.filter:hover { border-color: var(--brand); color: var(--brand); }
.filter.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---- Patch grid & cards ---------------------------------- */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

.card {
  position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: #dbe2f0; }
.card-media {
  position: relative; aspect-ratio: 1 / 1; display: grid; place-items: center;
  padding: 22px;
  background:
    radial-gradient(120% 120% at 50% 0%, #fbfcff 0%, #eef2fa 100%);
  border-bottom: 1px solid var(--line-soft);
}
.card-media img { max-height: 100%; width: auto; object-fit: contain; filter: drop-shadow(0 8px 16px rgba(16,24,40,.12)); }
.card-verified {
  position: absolute; top: 12px; right: 12px; width: 30px; height: 30px; border-radius: 50%;
  background: #fff; color: var(--ok); display: grid; place-items: center;
  box-shadow: var(--shadow); border: 1px solid var(--line-soft);
}
.card-verified svg { width: 18px; height: 18px; }
.card-body { padding: 16px 18px 18px; }
.card-title { font-size: 1.02rem; font-weight: 700; margin: 0 0 .3em; letter-spacing: -.01em; }
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--brand); }
.card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .82rem; color: var(--ink-mute); }
.card-meta .loc { font-weight: 500; }
.stretched::after { content: ""; position: absolute; inset: 0; }

/* ---- Page header band ------------------------------------ */
.pagehead { padding: 40px 0 8px; }
.breadcrumb { display: flex; gap: 8px; font-size: .85rem; color: var(--ink-mute); margin-bottom: 10px; }
.breadcrumb a { color: var(--ink-mute); }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb span { color: var(--line); }

/* ---- Patch detail ---------------------------------------- */
.detail { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; align-items: start; }
.detail-media {
  position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line);
  background: radial-gradient(120% 120% at 50% 0%, #fbfcff 0%, #eaf0fa 100%);
  padding: 44px; display: grid; place-items: center; box-shadow: var(--shadow);
}
.detail-media img { max-height: 460px; width: auto; filter: drop-shadow(0 14px 28px rgba(16,24,40,.18)); }
.detail-badge {
  position: absolute; top: 16px; right: 16px;
  display: inline-flex; align-items: center; gap: .4em; background: var(--ink); color: #fff;
  font-size: .8rem; font-weight: 600; padding: .45em .8em; border-radius: 999px;
}
.detail-badge svg { width: 15px; height: 15px; color: #6ee7a8; }
.detail h1 { font-size: 2rem; margin-bottom: .1em; }
.detail .sub { color: var(--ink-mute); font-weight: 500; margin-bottom: 20px; }

.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line);
         border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 22px 0; }
.fact { background: var(--surface); padding: 15px 18px; }
.fact .k { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-mute); font-weight: 600; }
.fact .v { font-size: .98rem; color: var(--ink); font-weight: 600; margin-top: 2px; }
.fact.full { grid-column: 1 / -1; }

.social-row { display: flex; gap: 10px; margin-top: 18px; }
.social-row a {
  width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
  display: grid; place-items: center; color: var(--ink-soft);
}
.social-row a:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-2px); }
.social-row svg { width: 20px; height: 20px; }

.note { padding: 14px 16px; border-radius: var(--radius-sm); font-size: .92rem; margin: 10px 0; }
.note-warn { background: #fff4ed; color: #9a3412; border: 1px solid #fed7aa; }

/* ---- Prose / FAQ ----------------------------------------- */
.prose { max-width: 760px; }
.prose p { font-size: 1.02rem; }
.prose h3 { margin-top: 1.6em; }
.prose ul { color: var(--ink-soft); padding-left: 1.2em; }
.prose li { margin: .3em 0; }
.callout { background: #fff6f6; border: 1px solid #ffd9d9; color: #b42318; padding: 14px 16px; border-radius: var(--radius-sm); font-weight: 500; }

/* ---- Cards/panels for content pages ---------------------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); }

/* ---- Departments ----------------------------------------- */
.dept-state { margin: 26px 0; }
.dept-state h3 { display: flex; align-items: center; gap: 10px; }
.dept-state .count { font-size: .8rem; font-weight: 600; color: var(--brand-dk); background: var(--brand-soft); padding: .2em .6em; border-radius: 999px; }
.dept-list { list-style: none; padding: 0; margin: 10px 0 0; columns: 2; column-gap: 32px; }
.dept-list li { break-inside: avoid; padding: 7px 0; border-bottom: 1px solid var(--line-soft); color: var(--ink-soft); }

/* ---- Forms ----------------------------------------------- */
.form { display: grid; gap: 12px; }
.input, .select, .textarea {
  font: inherit; width: 100%; padding: .75em .9em; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); transition: .15s ease;
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.textarea { min-height: 120px; resize: vertical; }
label.field-label { font-size: .85rem; font-weight: 600; color: var(--ink-soft); }
.alert { padding: 18px 20px; border-radius: var(--radius); margin-bottom: 20px; }
.alert-success { background: #ecfdf3; border: 1px solid #abefc6; color: #067647; }

/* ---- Coming soon ----------------------------------------- */
.comingsoon { text-align: center; padding: 70px 0; }
.comingsoon .badge-cs { display: inline-block; background: var(--brand-soft); color: var(--brand-dk); font-weight: 600; padding: .4em 1em; border-radius: 999px; margin-bottom: 18px; }

/* ---- Footer ---------------------------------------------- */
.site-footer { background: #0f1526; color: #c3cbdd; margin-top: 70px; padding: 54px 0 28px; }
.site-footer a { color: #c3cbdd; }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 40px; }
.footer-brand { display: flex; align-items: center; gap: 11px; font-weight: 800; color: #fff; font-size: 1.1rem; margin-bottom: 14px; }
.footer-col h5 { color: #fff; font-size: .95rem; margin-bottom: 14px; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin: .45em 0; }
.footer-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.footer-tags a { font-size: .82rem; padding: .35em .75em; border-radius: 999px; border: 1px solid rgba(255,255,255,.14); }
.footer-tags a:hover { border-color: rgba(255,255,255,.4); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 36px; padding-top: 20px; font-size: .85rem; color: #8b96ad; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

/* ---- Back to top ----------------------------------------- */
.back-top {
  position: fixed; bottom: 24px; right: 24px; width: 46px; height: 46px; border-radius: 50%;
  background: var(--ink); color: #fff; display: grid; place-items: center; cursor: pointer;
  box-shadow: var(--shadow-lg); opacity: 0; visibility: hidden; transform: translateY(10px); transition: .2s ease; z-index: 40;
}
.back-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.back-top svg { width: 22px; height: 22px; }

.empty { text-align: center; padding: 60px 20px; color: var(--ink-mute); }

/* ---- Pending / queue list -------------------------------- */
.plist { display: flex; flex-direction: column; }
.plist-row {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 16px 22px; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap;
}
.plist-row:last-child { border-bottom: 0; }
.plist-row:hover { background: var(--bg-soft); }
.plist-dept { font-weight: 700; color: var(--ink); display: block; }
.plist-abb { font-weight: 500; color: var(--ink-mute); }
.plist-loc { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px; font-size: .85rem; color: var(--ink-mute); margin-top: 3px; }
.plist-meta { text-align: right; display: flex; flex-direction: column; gap: 2px; align-items: flex-end; font-size: .88rem; color: var(--ink-soft); }
.plist-date { font-size: .78rem; color: var(--ink-mute); }
@media (max-width: 600px) {
  .plist-meta { text-align: left; align-items: flex-start; margin-top: 4px; }
}

/* Make a stat tile act as a link */
a.stat { text-decoration: none; transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease; }
a.stat:hover { border-color: var(--brand); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
a.stat .num { color: var(--ink); }

/* ---- Pagination ------------------------------------------ */
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin-top: 40px; }
.pager-num, .pager-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 42px; height: 42px; padding: 0 12px; border-radius: 11px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft);
  font-weight: 600; font-size: .92rem; transition: .15s ease;
}
.pager-num:hover, .pager-btn:hover { border-color: var(--brand); color: var(--brand); }
.pager-num.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.pager-btn.disabled { opacity: .4; pointer-events: none; }
.pager-gap { min-width: 24px; text-align: center; color: var(--ink-mute); }

.demo-banner {
  background: #fffbeb; border-bottom: 1px solid #fde68a; color: #92670a;
  font-size: .85rem; text-align: center; padding: 8px 16px;
}
.demo-banner b { color: #78350f; }

/* ---- Responsive ------------------------------------------ */
@media (max-width: 1000px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .nav-links, .nav-right .desk { display: none; }
  .nav-toggle { display: block; }
  .nav.open .nav-links {
    display: flex; flex-direction: column; align-items: stretch; gap: 2px;
    position: absolute; top: 68px; left: 0; right: 0; background: var(--surface);
    border-bottom: 1px solid var(--line); padding: 12px 20px 18px; box-shadow: var(--shadow-lg);
  }
  .nav.open .nav-menu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; padding: 4px 0 4px 14px; }
  .grid, .grid-3 { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .detail { grid-template-columns: 1fr; gap: 24px; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .dept-list { columns: 1; }
  .card-media { padding: 16px; }
  .section { padding: 40px 0; }
}
@media (max-width: 440px) {
  .grid, .grid-3 { grid-template-columns: 1fr 1fr; gap: 12px; }
  .facts { grid-template-columns: 1fr; }
}
