/* Projects page. Loaded after style.css. */
body.projects-page { display: block; padding: 0; }
/* Dim + blur the photo so content reads cleanly; snow still falls on top. */
body.projects-page::before {
  background: rgba(8, 12, 20, .52);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
}
.pj-wrap { position: relative; z-index: 1; max-width: 1080px; margin: 0 auto; padding: 48px 24px 72px; }

.pj-panel {
  background: rgba(22, 28, 40, .55);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  box-shadow: var(--rim), 0 10px 30px rgba(0, 0, 0, .28);
}

/* header */
.pj-top { display: flex; align-items: center; gap: 18px; margin-bottom: 28px; }
.pj-back {
  flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  color: var(--text); text-decoration: none; transition: transform .2s, background .2s;
}
.pj-back:hover { transform: translateX(-2px); background: rgba(40, 48, 64, .7); }
.pj-back svg { width: 20px; height: 20px; }
.pj-eyebrow { margin: 0; font-size: .8rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.55); }
.pj-top h1 { margin: 2px 0 4px; font-size: clamp(2rem, 5vw, 2.8rem); letter-spacing: -0.04em; line-height: 1; }
.pj-sub { margin: 0; color: rgba(255,255,255,.65); font-size: .95rem; }

/* search + chips */
.pj-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 22px; }
.pj-search {
  display: flex; align-items: center; gap: 10px; flex: 1 1 260px; max-width: 340px;
  height: 44px; padding: 0 16px; border-radius: 999px;
}
.pj-search svg { width: 17px; height: 17px; flex: none; opacity: .6; }
.pj-search input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--text);
  font: 500 .95rem var(--font);
}
.pj-search input::placeholder { color: rgba(255,255,255,.5); }
.pj-search:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.pj-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pj-chip {
  height: 36px; padding: 0 14px; border: 0; border-radius: 999px; cursor: pointer;
  color: rgba(255,255,255,.8); font: 600 .85rem var(--font);
  transition: background .2s, color .2s;
}
.pj-chip:hover { color: #fff; }
.pj-chip[aria-pressed="true"] { background: rgba(255,255,255,.92); color: #0d1220; box-shadow: none; }

/* table */
.pj-tablewrap { border-radius: 24px; overflow: hidden; }
.pj-table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.pj-table th {
  padding: 14px 18px; text-align: left; font-size: .72rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: rgba(255,255,255,.5); background: rgba(255,255,255,.04);
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.pj-table td { padding: 14px 18px; vertical-align: middle; border-bottom: 1px solid rgba(255,255,255,.07); }
.pj-table tbody tr:last-child td { border-bottom: 0; }
.pj-table tbody tr { cursor: pointer; transition: background .2s; animation: pj-in .4s cubic-bezier(.2,.8,.2,1) backwards; }
.pj-table tbody tr:hover, .pj-table tbody tr:focus-within { background: rgba(255,255,255,.07); }
.pj-table tr[hidden] { display: none; }
.pj-c-name { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.pj-c-name .pj-mono { width: 36px; height: 36px; border-radius: 11px; font-size: .82rem; }
.pj-open {
  padding: 0; border: 0; background: none; cursor: pointer; color: var(--text); text-decoration: none;
  font: 700 1rem var(--font); letter-spacing: -0.02em;
}
.pj-c-desc { color: rgba(255,255,255,.75); }
.pj-c-status { white-space: nowrap; }
.pj-c-status .pj-pill { margin: 0; }
.pj-c-go { width: 1%; text-align: right; }
.pj-c-go .pj-arrow { display: block; }
.pj-table tbody tr:hover .pj-arrow { transform: translateX(3px); opacity: .9; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pj-open:focus-visible, .pj-chip:focus-visible, .pj-back:focus-visible, .pj-x:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px;
}
@keyframes pj-in { from { opacity: 0; transform: translateY(6px); } }

.pj-row { display: flex; align-items: center; gap: 14px; width: 100%; }
.pj-mono {
  flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px;
  font: 700 1rem var(--font); letter-spacing: -0.02em; color: #fff;
  background: linear-gradient(135deg, hsl(var(--h) 70% 58%), hsl(calc(var(--h) + 40) 70% 42%));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 4px 12px hsl(var(--h) 70% 30% / .45);
}
.pj-titlebox { min-width: 0; flex: 1; }
.pj-name { display: block; font-size: 1.08rem; font-weight: 700; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pj-pill {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 4px;
  font-size: .75rem; font-weight: 600; color: rgba(255,255,255,.75);
}
.pj-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--tone); box-shadow: 0 0 8px var(--tone); }
.tone-live { --tone: #34d399; } .tone-progress { --tone: #fbbf24; } .tone-active { --tone: #60a5fa; }
.tone-todo { --tone: #a78bfa; } .tone-archived { --tone: #94a3b8; }

.pj-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.pj-tag { padding: 3px 9px; border-radius: 999px; font-size: .72rem; font-weight: 600; background: rgba(255,255,255,.1); color: rgba(255,255,255,.75); }
.pj-arrow { flex: none; width: 18px; height: 18px; opacity: .45; transition: transform .25s, opacity .25s; }

.pj-none { margin: 40px 0; text-align: center; color: rgba(255,255,255,.6); }

/* details dialog */
.pj-dialog {
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 0;
  border-radius: 28px; color: var(--text); overflow: auto;
  background: rgba(22, 28, 40, .78);
  backdrop-filter: blur(30px) saturate(160%); -webkit-backdrop-filter: blur(30px) saturate(160%);
  box-shadow: var(--rim), 0 30px 80px rgba(0,0,0,.5);
}
.pj-dialog[open] { animation: pj-pop .3s cubic-bezier(.2,.8,.2,1); }
.pj-dialog::backdrop { background: rgba(4, 6, 12, .45); backdrop-filter: blur(4px); }
@keyframes pj-pop { from { opacity: 0; transform: scale(.96) translateY(8px); } }
.pj-d { padding: 26px; }
.pj-d .pj-row { margin-bottom: 22px; }
.pj-d .pj-name { white-space: normal; font-size: 1.35rem; }
.pj-x {
  flex: none; align-self: flex-start; width: 34px; height: 34px; border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(255,255,255,.1); color: #fff; font-size: 1.1rem; line-height: 1;
}
.pj-x:hover { background: rgba(255,255,255,.2); }
.pj-sec { margin: 0 0 18px; }
.pj-sec h3 { margin: 0 0 6px; font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.5); }
.pj-sec p { margin: 0; line-height: 1.6; font-size: .95rem; color: rgba(255,255,255,.88); overflow-wrap: anywhere; }
.pj-d code {
  font: .85em "JetBrains Mono", ui-monospace, monospace; padding: 1px 6px; border-radius: 6px;
  background: rgba(255,255,255,.1); color: #e2e8f0;
}

@media (max-width: 600px) {
  .pj-wrap { padding: 28px 16px 56px; }
  .pj-top { margin-bottom: 20px; }
  .pj-search { max-width: none; }
  /* table rows become stacked blocks: name + status, then description */
  .pj-table thead, .pj-c-go { display: none; }
  .pj-table tbody tr { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; padding: 14px 16px; border-bottom: 1px solid rgba(255,255,255,.07); }
  .pj-table tbody tr:last-child { border-bottom: 0; }
  .pj-table td { padding: 0; border: 0; }
  .pj-c-desc { grid-column: 1 / -1; }
  .pj-c-status { grid-row: 1; grid-column: 2; align-self: center; }
}
@media (max-width: 900px) { .pj-c-tags, .pj-table th:nth-child(3) { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .pj-table tbody tr, .pj-dialog[open] { animation: none; }
}
