/* ============================================================
   Portfolio — projects.pdxtechs.com
   Design system: dark, glassy, accent-per-category.
   ============================================================ */

:root {
  --bg:            #07080c;
  --bg-soft:       #0c0e15;
  --surface:       rgba(255, 255, 255, 0.025);
  --surface-2:     rgba(255, 255, 255, 0.04);
  --border:        rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text:          #eef1f7;
  --text-dim:      #aab2c5;
  --text-faint:    #6b7488;

  --accent:        #6ea8ff;
  --accent-2:      #a78bfa;
  --accent-3:      #38e0c8;

  /* category accents */
  --c-saas:   #6ea8ff;
  --c-ai:     #a78bfa;
  --c-infra:  #38e0c8;
  --c-web:    #f4a261;
  --c-mobile: #ff6b9d;
  --c-game:   #ffd166;
  --c-other:  #8f9bb3;

  --radius:    18px;
  --radius-sm: 12px;
  --maxw:      1180px;
  --ease:      cubic-bezier(0.22, 1, 0.36, 1);

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", "Cascadia Code", ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Animated gradient mesh backdrop */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(60% 50% at 15% 0%, rgba(110, 168, 255, 0.10), transparent 60%),
    radial-gradient(55% 45% at 85% 10%, rgba(167, 139, 250, 0.10), transparent 60%),
    radial-gradient(70% 60% at 50% 100%, rgba(56, 224, 200, 0.06), transparent 60%),
    var(--bg);
}
.backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='3' height='3'%3E%3Ccircle cx='1' cy='1' r='0.5' fill='%23ffffff' fill-opacity='0.02'/%3E%3C/svg%3E");
  opacity: 0.5;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

a { color: inherit; text-decoration: none; }

/* ============================================================
   Top nav
   ============================================================ */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px) saturate(160%);
  background: rgba(7, 8, 12, 0.6);
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s var(--ease), background 0.4s var(--ease);
}
.nav.scrolled { border-bottom-color: var(--border); background: rgba(7, 8, 12, 0.82); }
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 11px; font-weight: 650; letter-spacing: -0.01em; }
.brand .dot {
  width: 11px; height: 11px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 16px rgba(110, 168, 255, 0.7);
}
.nav-links { display: flex; gap: 28px; font-size: 0.92rem; color: var(--text-dim); }
.nav-links a { transition: color 0.2s; }
.nav-links a:hover { color: var(--text); }
@media (max-width: 720px) { .nav-links { display: none; } }

/* ============================================================
   Hero
   ============================================================ */
.hero { position: relative; padding: 120px 0 70px; }
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.04em;
  color: var(--text-dim);
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: var(--surface);
  margin-bottom: 26px;
}
.hero .eyebrow .pulse {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent-3);
  box-shadow: 0 0 0 0 rgba(56, 224, 200, 0.6);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(56, 224, 200, 0.5); }
  70%  { box-shadow: 0 0 0 10px rgba(56, 224, 200, 0); }
  100% { box-shadow: 0 0 0 0 rgba(56, 224, 200, 0); }
}
.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4.3rem);
  line-height: 1.04;
  letter-spacing: -0.035em;
  font-weight: 720;
  max-width: 16ch;
  margin-bottom: 22px;
}
.hero h1 .grad {
  background: linear-gradient(110deg, var(--accent) 10%, var(--accent-2) 55%, var(--accent-3) 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero .sub { font-size: clamp(1.05rem, 2vw, 1.28rem); color: var(--text-dim); max-width: 56ch; margin-bottom: 36px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 13px 22px; border-radius: 12px; font-weight: 560; font-size: 0.95rem;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #060810;
  box-shadow: 0 10px 30px -10px rgba(110, 168, 255, 0.6);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 40px -12px rgba(110, 168, 255, 0.75); }
.btn-ghost { border: 1px solid var(--border-strong); color: var(--text); background: var(--surface); }
.btn-ghost:hover { background: var(--surface-2); transform: translateY(-2px); }

/* stats strip */
.stats {
  margin-top: 58px;
  display: flex; flex-wrap: wrap; gap: 14px;
}
.stat {
  flex: 1 1 170px;
  padding: 20px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  backdrop-filter: blur(6px);
}
.stat .n {
  font-size: 1.7rem; font-weight: 700; letter-spacing: -0.02em;
  background: linear-gradient(120deg, var(--text), var(--text-dim));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.stat .l { font-size: 0.82rem; color: var(--text-faint); margin-top: 3px; }

/* ============================================================
   Section headers
   ============================================================ */
.section { padding: 56px 0; }
.section-head { margin-bottom: 34px; display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.section-head h2 {
  font-size: clamp(1.5rem, 3.2vw, 2.1rem); letter-spacing: -0.025em; font-weight: 680;
}
.section-head .count {
  font-family: var(--mono); font-size: 0.8rem; color: var(--text-faint);
  padding: 4px 10px; border: 1px solid var(--border); border-radius: 8px;
}
.section-head .bar {
  flex: 1; height: 1px; background: linear-gradient(90deg, var(--border), transparent);
  align-self: center; min-width: 40px;
}

/* about */
.about p { color: var(--text-dim); font-size: 1.1rem; max-width: 72ch; }
.about .chips { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  font-family: var(--mono); font-size: 0.8rem; color: var(--text-dim);
  padding: 7px 13px; border: 1px solid var(--border); border-radius: 9px;
  background: var(--surface); transition: border-color 0.25s, color 0.25s, transform 0.25s;
}
.chip:hover { border-color: var(--border-strong); color: var(--text); transform: translateY(-1px); }

/* ============================================================
   Featured cards (large)
   ============================================================ */
.featured-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
@media (max-width: 860px) { .featured-grid { grid-template-columns: 1fr; } }

.fcard {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  overflow: hidden;
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.fcard::before {
  content: ""; position: absolute; inset: 0; border-radius: var(--radius);
  padding: 1px; background: linear-gradient(135deg, var(--cat, var(--accent)), transparent 45%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity 0.4s;
  pointer-events: none; /* decorative — must not intercept clicks on the card */
}
.fcard:hover { transform: translateY(-5px); box-shadow: 0 30px 60px -30px rgba(0,0,0,0.8); }
.fcard:hover::before { opacity: 1; }

.fcard .shot {
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  border-bottom: 1px solid var(--border);
  position: relative; overflow: hidden;
}
.fcard .shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fcard .fbody { padding: 24px 26px 28px; }
.fcard .ftop { display: flex; align-items: center; gap: 11px; margin-bottom: 13px; }
.fcard h3 { font-size: 1.35rem; letter-spacing: -0.02em; font-weight: 660; }
.fcard .ftag { color: var(--text-dim); font-size: 0.98rem; margin-bottom: 16px; }
.fcard .fdesc { color: var(--text-faint); font-size: 0.92rem; line-height: 1.62; margin-bottom: 18px; }
.fcard .stack { display: flex; flex-wrap: wrap; gap: 7px; }

/* ============================================================
   Standard project cards
   ============================================================ */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 980px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid { grid-template-columns: 1fr; } }

.card {
  position: relative;
  display: flex; flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  transition: transform 0.35s var(--ease), border-color 0.35s var(--ease), background 0.35s;
}
.card:hover { transform: translateY(-4px); border-color: var(--border-strong); background: var(--surface-2); }
.card:hover .shot::after { opacity: 1; }

.card .shot {
  aspect-ratio: 16 / 10;
  border-bottom: 1px solid var(--border);
  position: relative; overflow: hidden;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,0.012) 0 12px, transparent 12px 24px),
    linear-gradient(135deg, rgba(255,255,255,0.03), transparent);
}
.card .shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .shot::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(0,0,0,0.35));
  opacity: 0; transition: opacity 0.35s;
  pointer-events: none; /* decorative — must not intercept clicks */
}

/* screenshot placeholder when no image */
.shot.empty { display: grid; place-items: center; }
.shot.empty .ph {
  text-align: center; color: var(--text-faint); font-family: var(--mono); font-size: 0.74rem;
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 16px;
}
.shot.empty .ph svg { opacity: 0.4; }
.shot.empty .ph .fname { color: var(--text-faint); opacity: 0.7; word-break: break-all; }

.card .body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.card .ctop { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; }
.card h3 { font-size: 1.08rem; letter-spacing: -0.015em; font-weight: 620; }
.card .ctag { color: var(--text-dim); font-size: 0.88rem; line-height: 1.5; margin-bottom: 13px; flex: 1; }
.card .stack { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 13px; }

.tag {
  font-family: var(--mono); font-size: 0.7rem; color: var(--text-dim);
  padding: 4px 8px; border: 1px solid var(--border); border-radius: 7px;
  background: rgba(255,255,255,0.015);
}

/* category dot + status pill */
.cat-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cat, var(--accent)); flex: none; box-shadow: 0 0 10px var(--cat, var(--accent)); }
.status {
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.02em;
  padding: 3px 9px; border-radius: 100px; border: 1px solid var(--border);
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.live   { color: #4ade80; border-color: rgba(74,222,128,0.25); background: rgba(74,222,128,0.06); }
.status.work   { color: #6ea8ff; border-color: rgba(110,168,255,0.25); background: rgba(110,168,255,0.06); }
.status.proto  { color: #fbbf24; border-color: rgba(251,191,36,0.25); background: rgba(251,191,36,0.06); }
.status.arch   { color: #8f9bb3; border-color: rgba(143,155,179,0.25); background: rgba(143,155,179,0.06); }

.card-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 6px; }
.card-meta .role { font-size: 0.76rem; color: var(--text-faint); }

/* highlights list (featured) */
.hl { list-style: none; margin: 0 0 18px; display: grid; gap: 7px; }
.hl li { position: relative; padding-left: 20px; font-size: 0.87rem; color: var(--text-dim); }
.hl li::before {
  content: ""; position: absolute; left: 0; top: 8px;
  width: 9px; height: 9px; border-radius: 2px;
  background: var(--cat, var(--accent)); opacity: 0.85;
  transform: rotate(45deg);
}

/* ============================================================
   Scroll-reveal
   ============================================================ */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: 0.06s; }
.reveal.d2 { transition-delay: 0.12s; }
.reveal.d3 { transition-delay: 0.18s; }
.reveal.d4 { transition-delay: 0.24s; }
.reveal.d5 { transition-delay: 0.30s; }
.reveal.d6 { transition-delay: 0.36s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* category filter bar */
.filters { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 34px; }
.filter {
  font-size: 0.85rem; color: var(--text-dim); cursor: pointer;
  padding: 8px 15px; border: 1px solid var(--border); border-radius: 100px;
  background: var(--surface); transition: all 0.25s var(--ease);
  display: inline-flex; align-items: center; gap: 8px;
}
.filter:hover { color: var(--text); border-color: var(--border-strong); }
.filter.active { color: #060810; background: var(--text); border-color: var(--text); font-weight: 560; }
.filter .fdot { width: 7px; height: 7px; border-radius: 50%; }

.card.hidden, .fcard.hidden { display: none; }

/* ============================================================
   Footer
   ============================================================ */
.footer { padding: 60px 0 50px; border-top: 1px solid var(--border); margin-top: 50px; color: var(--text-faint); }
.footer .frow { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 18px; }
.footer a { color: var(--text-dim); transition: color 0.2s; }
.footer a:hover { color: var(--text); }
.footer .contact { display: flex; gap: 18px; font-size: 0.9rem; }

/* tiny helper */
.mono { font-family: var(--mono); }

/* view-code link on cards */
.card-actions { margin-top: 16px; }
.code-link {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.85rem; font-weight: 550; color: var(--text);
  padding: 8px 15px; border: 1px solid var(--border-strong); border-radius: 10px;
  background: var(--surface); transition: background 0.2s, border-color 0.2s, transform 0.2s, color 0.2s;
}
.code-link:hover { background: var(--accent); color: #060810; border-color: var(--accent); transform: translateY(-1px); }
.code-link svg { flex: none; }
/* standard card: code link sits in the meta row */
.card-meta .code-link { padding: 5px 11px; font-size: 0.78rem; }

/* ============================================================
   Edit mode
   ============================================================ */
.edit-banner {
  position: sticky; top: 0; z-index: 100;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #060810; font-size: 0.9rem; font-weight: 500;
  padding: 10px 20px; text-align: center;
}
.edit-banner code { background: rgba(0,0,0,0.15); padding: 1px 6px; border-radius: 5px; font-family: var(--mono); font-size: 0.85em; }
.edit-banner .eb-hint { opacity: 0.8; margin-left: 8px; font-weight: 400; }
body.edit-mode .nav { top: 0; }

/* make slots obviously clickable in edit mode */
body.edit-mode .shot[data-dir] { cursor: pointer; position: relative; }
body.edit-mode .shot.empty[data-dir]:hover {
  background: rgba(110, 168, 255, 0.06);
  outline: 2px dashed var(--accent); outline-offset: -6px;
}
body.edit-mode .shot.empty[data-dir]:hover .ph { color: var(--accent); }

.edit-overlay {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(6, 8, 16, 0.55); color: #fff; font-size: 0.85rem; font-weight: 500;
  opacity: 0; transition: opacity 0.2s; pointer-events: none;
  font-family: var(--mono);
}
body.edit-mode .shot.has-img[data-dir]:hover .edit-overlay { opacity: 1; }

/* armed slot — the paste target */
body.edit-mode .shot.armed {
  outline: 2px solid var(--accent-3) !important; outline-offset: -3px;
  box-shadow: 0 0 0 4px rgba(56, 224, 200, 0.18);
}
body.edit-mode .shot.armed::before {
  content: "ready — press Ctrl/⌘V to paste";
  position: absolute; top: 8px; left: 8px; z-index: 3;
  font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.02em;
  color: #061013; background: var(--accent-3);
  padding: 3px 8px; border-radius: 6px; font-weight: 600;
}

/* "paste here" pill */
.paste-tab {
  position: absolute; bottom: 8px; right: 8px; z-index: 4;
  font-family: var(--mono); font-size: 0.7rem; font-weight: 600;
  color: var(--text); background: rgba(8, 10, 18, 0.82);
  border: 1px solid var(--border-strong); border-radius: 8px;
  padding: 5px 9px; cursor: pointer; backdrop-filter: blur(6px);
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}
.paste-tab:hover { background: var(--accent-3); color: #061013; border-color: var(--accent-3); transform: translateY(-1px); }
.edit-banner kbd, .edit-banner code {
  background: rgba(0,0,0,0.18); padding: 1px 6px; border-radius: 5px;
  font-family: var(--mono); font-size: 0.85em;
}
.banner-btn {
  background: #061013; color: var(--accent-3); border: 1px solid rgba(0,0,0,0.25);
  font-family: var(--mono); font-size: 0.8rem; font-weight: 600;
  padding: 3px 10px; border-radius: 7px; cursor: pointer; margin: 0 4px;
}
.banner-btn:hover { background: #08161a; }

/* remove (X) button on each card in edit mode */
body.edit-mode .fcard, body.edit-mode .card { position: relative; }
.card-x {
  position: absolute; top: 10px; right: 10px; z-index: 6;
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(8, 10, 18, 0.78); color: #fff;
  border: 1px solid var(--border-strong); cursor: pointer;
  font-size: 1.15rem; line-height: 1; backdrop-filter: blur(6px);
  opacity: 0; transform: scale(0.85);
  transition: opacity 0.18s, transform 0.18s, background 0.18s, border-color 0.18s;
}
body.edit-mode .fcard:hover .card-x,
body.edit-mode .card:hover .card-x,
.card-x:focus { opacity: 1; transform: scale(1); }
.card-x:hover { background: #ff5470; border-color: #ff5470; color: #fff; }

.card-restore {
  position: absolute; top: 10px; right: 10px; z-index: 6;
  font-family: var(--mono); font-size: 0.74rem; font-weight: 600;
  padding: 5px 10px; border-radius: 8px; cursor: pointer;
  background: var(--accent-3); color: #061013; border: none;
}
.card-restore:hover { filter: brightness(1.1); }

/* a removed card, shown dimmed while "Show removed" is on */
.hidden-card { opacity: 0.42; filter: grayscale(0.6); }
.hidden-card::after {
  content: "removed"; position: absolute; top: 12px; left: 12px; z-index: 5;
  font-family: var(--mono); font-size: 0.66rem; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; color: #ff5470;
  background: rgba(8,10,18,0.8); padding: 3px 8px; border-radius: 6px;
}

/* exit animation when removing */
.removing {
  animation: cardOut 0.26s var(--ease) forwards;
  pointer-events: none;
}
@keyframes cardOut {
  to { opacity: 0; transform: scale(0.92) translateY(8px); }
}

.shot.uploading { pointer-events: none; }
.shot .spin {
  width: 26px; height: 26px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.15); border-top-color: var(--accent);
  animation: spin 0.7s linear infinite; margin: 0 auto 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
  background: #11141d; color: var(--text); border: 1px solid var(--border-strong);
  padding: 11px 18px; border-radius: 11px; font-size: 0.9rem; z-index: 200;
  opacity: 0; pointer-events: none; transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
  box-shadow: 0 16px 40px -16px rgba(0,0,0,0.8); max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.bad { border-color: rgba(255,107,157,0.5); color: #ffb3cd; }
