/* ==========================================================================
   MadeVisible Portfolio / Featured showcase (builds on styles.css tokens)
   Cards with real-looking previews, case-study detail modal, add-project wizard
   ========================================================================== */

/* ---------- Project grid ---------- */
.pf-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 560px) { .pf-grid { grid-template-columns: repeat(2, 1fr); } }
.pf-grid.cols-3 { }
@media (min-width: 960px) { .pf-grid.cols-3 { grid-template-columns: repeat(3, 1fr); } }
.pf-grid > * { min-width: 0; }

/* ---------- Project card ---------- */
.pf-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--r-lg);
  overflow: hidden; cursor: pointer; text-align: left; padding: 0; display: flex; flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
@media (hover: hover) {
  .pf-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: #d5dce6; }
  .pf-card:hover .pf-thumb-inner { transform: scale(1.035); }
}
.pf-thumb { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: #EEF1F6; }
.pf-thumb-inner { position: absolute; inset: 0; transition: transform .35s ease; }
.pf-thumb img.pf-cover { width: 100%; height: 100%; object-fit: cover; display: block; }
.pf-badge-pin {
  position: absolute; top: 10px; left: 10px; z-index: 3;
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px;
  border-radius: var(--r-pill); background: rgba(11,16,38,.82); backdrop-filter: blur(4px);
  color: #fff; font-size: 11px; font-weight: 700;
}
.pf-badge-pin svg { width: 12px; height: 12px; }
/* The pin badge overlays the browser chrome bar on website cards —
   hide the traffic dots and indent the URL pill so the domain stays readable */
.pf-badge-pin ~ .pf-thumb-inner .pv-dots { display: none; }
.pf-badge-pin ~ .pf-thumb-inner .pv-chrome { padding-left: 92px; }
.pf-type {
  position: absolute; top: 10px; right: 10px; z-index: 3;
  display: inline-flex; align-items: center; height: 24px; padding: 0 10px;
  border-radius: var(--r-pill); background: rgba(255,255,255,.92); backdrop-filter: blur(4px);
  color: var(--navy); font-size: 11px; font-weight: 700; letter-spacing: .02em;
}
.pf-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1 1 auto; }
.pf-title { font-size: 15.5px; font-weight: 700; letter-spacing: -0.01em; color: var(--text); line-height: 1.3; }
.pf-sum { font-size: 13px; color: var(--text-2); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pf-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.pf-tag { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 7px; background: var(--blue-soft); color: var(--navy); font-size: 11px; font-weight: 650; }
.pf-meta { display: flex; align-items: center; gap: 14px; margin-top: auto; padding-top: 6px; font-size: 12px; color: var(--text-3); }
.pf-meta .m { display: inline-flex; align-items: center; gap: 5px; }
.pf-meta svg { width: 13px; height: 13px; }
.pf-ctas { display: flex; gap: 8px; padding: 0 16px 16px; }
.pf-ctas .btn { flex: 1 1 0; }

/* Add-project tile */
.pf-add {
  border: 1.5px dashed #C6D2E6; border-radius: var(--r-lg); background: var(--blue-soft);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  min-height: 220px; color: var(--navy); cursor: pointer; transition: background .15s ease, border-color .15s ease;
}
.pf-add:hover { background: var(--blue-soft-2); border-color: var(--blue); }
.pf-add .plus { width: 46px; height: 46px; border-radius: 50%; background: #fff; color: var(--blue); display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-sm); }
.pf-add .plus svg { width: 22px; height: 22px; }
.pf-add b { font-size: 14px; }
.pf-add span { font-size: 12px; color: var(--text-2); padding: 0 16px; text-align: center; }

/* ---------- Composed previews (look like real work, no backend needed) ---------- */
/* Browser frame (website projects) */
.pv-browser { position: absolute; inset: 10px 10px 0 10px; border-radius: 10px 10px 0 0; background: #fff; box-shadow: 0 6px 24px rgba(11,16,38,.18); overflow: hidden; display: flex; flex-direction: column; }
.pv-chrome { height: 26px; flex: 0 0 26px; background: #F1F3F7; border-bottom: 1px solid var(--border-2); display: flex; align-items: center; gap: 8px; padding: 0 10px; }
.pv-dots { display: flex; gap: 4px; }
.pv-dots i { width: 7px; height: 7px; border-radius: 50%; }
.pv-dots i:nth-child(1) { background: #F26D5F; } .pv-dots i:nth-child(2) { background: #F5BE4F; } .pv-dots i:nth-child(3) { background: #5FC969; }
.pv-url { flex: 1 1 auto; min-width: 0; height: 15px; border-radius: 8px; background: #fff; border: 1px solid var(--border-2); font-size: 8.5px; line-height: 13px; color: var(--text-3); padding: 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-page { flex: 1 1 auto; position: relative; overflow: hidden; }
/* composed mini-site */
.pv-site { position: absolute; inset: 0; padding: 10px 12px; }
.pv-nav { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.pv-logo { width: 34px; height: 8px; border-radius: 3px; }
.pv-nav i { width: 16px; height: 5px; border-radius: 2px; background: rgba(120,130,150,.35); margin-left: 6px; }
.pv-nav .pv-cta { margin-left: auto; width: 26px; height: 10px; border-radius: 5px; }
.pv-hero-t { height: 11px; width: 72%; border-radius: 4px; margin-bottom: 5px; }
.pv-hero-t2 { height: 11px; width: 46%; border-radius: 4px; margin-bottom: 8px; }
.pv-hero-s { height: 5px; width: 84%; border-radius: 2px; background: rgba(120,130,150,.30); margin-bottom: 3px; }
.pv-hero-s2 { height: 5px; width: 62%; border-radius: 2px; background: rgba(120,130,150,.22); margin-bottom: 10px; }
.pv-btns { display: flex; gap: 6px; margin-bottom: 12px; }
.pv-btns i { width: 40px; height: 13px; border-radius: 6px; }
.pv-cards { display: flex; gap: 8px; }
.pv-cards i { flex: 1; height: 34px; border-radius: 6px; background: #fff; box-shadow: 0 2px 8px rgba(16,24,40,.10); }

/* Phone frame (app projects) */
.pv-phone-wrap { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center; gap: 14px; padding-top: 12px; }
.pv-phone { width: 34%; max-width: 96px; height: 92%; border-radius: 14px 14px 0 0; background: #0B1026; padding: 5px 5px 0; box-shadow: 0 8px 24px rgba(11,16,38,.28); }
.pv-phone.alt { height: 76%; opacity: .92; }
.pv-screen { width: 100%; height: 100%; border-radius: 10px 10px 0 0; overflow: hidden; position: relative; background: #fff; padding: 8px 7px; }
.pv-screen .s-head { height: 8px; width: 60%; border-radius: 3px; margin-bottom: 6px; }
.pv-screen .s-line { height: 4px; border-radius: 2px; background: rgba(120,130,150,.28); margin-bottom: 4px; }
.pv-screen .s-tile { height: 24px; border-radius: 6px; margin: 6px 0; }
.pv-screen .s-row { display: flex; gap: 4px; margin-top: 6px; }
.pv-screen .s-row i { flex: 1; height: 16px; border-radius: 5px; background: #EEF1F6; }

/* Dashboard preview */
.pv-dash { position: absolute; inset: 12px 12px 0; border-radius: 10px 10px 0 0; background: #fff; box-shadow: 0 6px 24px rgba(11,16,38,.16); padding: 10px; display: grid; grid-template-columns: 44px 1fr; gap: 8px; overflow: hidden; }
.pv-side { border-radius: 6px; background: #0B1026; }
.pv-main { display: flex; flex-direction: column; min-width: 0; }
.pv-main .row-kpi { display: flex; gap: 6px; margin-bottom: 8px; }
.pv-main .row-kpi i { flex: 1; height: 22px; border-radius: 5px; background: #F1F4F9; border: 1px solid var(--border-2); }
.pv-chart { height: 44px; flex: 1 1 auto; border-radius: 6px; background: linear-gradient(180deg, rgba(37,99,255,.14), rgba(37,99,255,.02)); position: relative; overflow: hidden; }
.pv-chart::after { content: ""; position: absolute; left: 0; right: 0; bottom: 8px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--blue) 20%, var(--blue-bright) 60%, var(--blue) 100%);
  clip-path: polygon(0 100%, 8% 40%, 22% 70%, 38% 20%, 55% 55%, 70% 10%, 85% 45%, 100% 0, 100% 100%); height: 62%; min-height: 30px; bottom: 0; opacity: .8; }

/* Video preview */
.pv-video { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.pv-video .pvv-play { width: 46px; height: 46px; border-radius: 50%; background: rgba(255,255,255,.92); color: var(--navy); display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-md); }
.pv-video .pvv-play svg { width: 20px; height: 20px; margin-left: 2px; }
.pv-video .pvv-bar { position: absolute; left: 12px; right: 12px; bottom: 10px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.35); }
.pv-video .pvv-bar::after { content: ""; display: block; width: 38%; height: 100%; border-radius: 2px; background: #fff; }

/* Document preview */
.pv-doc { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.pv-doc .sheet { width: 46%; height: 74%; background: #fff; border-radius: 8px; box-shadow: 0 8px 24px rgba(11,16,38,.18); padding: 12px 10px; position: relative; }
.pv-doc .sheet.b1 { transform: rotate(-6deg) translateX(-26%); position: absolute; opacity: .8; }
.pv-doc .sheet i { display: block; height: 5px; border-radius: 2px; background: rgba(120,130,150,.3); margin-bottom: 5px; }
.pv-doc .sheet i.t { height: 8px; width: 66%; margin-bottom: 8px; }

/* Design collage */
.pv-collage { position: absolute; inset: 10px; display: grid; grid-template-columns: 1.4fr 1fr; grid-template-rows: 1fr 1fr; gap: 7px; }
.pv-collage i { border-radius: 8px; box-shadow: 0 3px 12px rgba(11,16,38,.14); }
.pv-collage i:first-child { grid-row: span 2; }

/* Preview color themes */
.pvt-blue   { --pv-a: #2563FF; --pv-b: #0B2E73; --pv-bg: linear-gradient(140deg, #DCE9FF, #E6F0FF); }
.pvt-orange { --pv-a: #E8552B; --pv-b: #8E2413; --pv-bg: linear-gradient(140deg, #FFE3D6, #FFF3EC); }
.pvt-green  { --pv-a: #169B72; --pv-b: #0B5637; --pv-bg: linear-gradient(140deg, #D8F3E8, #EFFBF5); }
.pvt-violet { --pv-a: #7C4DD6; --pv-b: #4B2A9E; --pv-bg: linear-gradient(140deg, #E9DFFF, #F5F0FF); }
.pvt-navy   { --pv-a: #0B1026; --pv-b: #2F6BFF; --pv-bg: linear-gradient(140deg, #D8E2F5, #EDF2FB); }
.pf-thumb-inner.themed { background: var(--pv-bg); }
.pv-fill-a { background: var(--pv-a); } .pv-fill-b { background: var(--pv-b); }
.pv-grad { background: linear-gradient(135deg, var(--pv-a), var(--pv-b)); }

/* ---------- Detail modal (case study) ---------- */
.pfd-scrim { position: fixed; inset: 0; z-index: 400; background: rgba(11,16,38,.5); backdrop-filter: blur(3px); animation: fadeIn .18s ease; }
.pfd-panel {
  position: fixed; z-index: 401; inset: 0; background: var(--page-bg); overflow-y: auto;
  animation: sheetUp .28s cubic-bezier(.2,.8,.2,1);
}
@media (min-width: 760px) {
  .pfd-panel { inset: 4vh auto auto 50%; transform: translateX(-50%); width: min(860px, 92vw); max-height: 92vh; border-radius: var(--r-xl); box-shadow: var(--shadow-lg); animation: fadeIn .2s ease; }
}
.pfd-close { position: sticky; top: 12px; margin-left: auto; margin-right: 12px; z-index: 5; width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.95); box-shadow: var(--shadow-sm); color: var(--text); display: flex; align-items: center; justify-content: center; }
.pfd-close svg { width: 19px; height: 19px; }
.pfd-hero { position: relative; aspect-ratio: 16 / 8; margin: -38px 0 0; overflow: hidden; background: #EEF1F6; }
@media (min-width: 760px) { .pfd-hero { border-radius: var(--r-xl) var(--r-xl) 0 0; } }
.pfd-hero .pf-thumb-inner { position: absolute; inset: 0; }
.pfd-hero img { width: 100%; height: 100%; object-fit: cover; }
.pfd-body { padding: 22px 20px 32px; max-width: 720px; margin: 0 auto; }
.pfd-title { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; margin: 0; }
.pfd-sub { font-size: 14px; color: var(--text-2); margin-top: 6px; }
.pfd-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.pfd-facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 20px; }
@media (min-width: 560px) { .pfd-facts { grid-template-columns: repeat(4, 1fr); } }
.pfd-fact { background: #fff; border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px; }
.pfd-fact .k { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); }
.pfd-fact .v { font-size: 13.5px; font-weight: 650; color: var(--text); margin-top: 4px; overflow-wrap: anywhere; }
.pfd-section { margin-top: 24px; }
.pfd-section h3 { font-size: 16px; font-weight: 700; margin: 0 0 10px; }
.pfd-section p { font-size: 14.5px; line-height: 1.65; color: var(--text); margin: 0; white-space: pre-line; }
.pfd-gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pfd-gallery img { width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: var(--r-md); border: 1px solid var(--border); }
.pfd-outcome { background: var(--green-soft); border: 1px solid #CBEBD9; border-radius: var(--r-md); padding: 14px 16px; font-size: 14px; color: #0B5637; line-height: 1.55; display: flex; gap: 10px; }
.pfd-outcome svg { width: 18px; height: 18px; flex: 0 0 18px; margin-top: 1px; }
.pfd-stats { display: flex; gap: 18px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-2); flex-wrap: wrap; }
.pfd-stats .m { display: inline-flex; align-items: center; gap: 6px; }
.pfd-stats svg { width: 15px; height: 15px; }
.pfd-actions { position: sticky; bottom: 0; background: linear-gradient(180deg, rgba(247,249,252,0), var(--page-bg) 30%); padding: 14px 20px calc(14px + var(--safe-bottom)); display: flex; flex-wrap: wrap; gap: 10px; max-width: 720px; margin: 0 auto; }
.pfd-actions .btn { flex: 1 0 auto; }
.pfd-domain { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: var(--r-pill); background: #fff; border: 1px solid var(--border); font-size: 12.5px; font-weight: 650; color: var(--navy); }
.pfd-domain svg { width: 13px; height: 13px; color: var(--green); }

/* ---------- Wizard (add / edit project) ---------- */
.pfw-panel {
  position: fixed; z-index: 401; left: 0; right: 0; bottom: 0; top: 8vh; background: #fff;
  border-radius: 24px 24px 0 0; overflow-y: auto; animation: sheetUp .28s cubic-bezier(.2,.8,.2,1);
  box-shadow: 0 -12px 40px rgba(11,16,38,.24);
}
@media (min-width: 700px) {
  .pfw-panel { top: 50%; bottom: auto; left: 50%; transform: translate(-50%,-50%); width: min(640px, 94vw); max-height: 90vh; border-radius: var(--r-xl); animation: fadeIn .2s ease; }
}
.pfw-head { position: sticky; top: 0; background: #fff; z-index: 4; display: flex; align-items: center; gap: 12px; padding: 18px 20px 12px; border-bottom: 1px solid var(--border-2); }
.pfw-head h2 { font-size: 18px; font-weight: 750; margin: 0; flex: 1; }
.pfw-steps { display: flex; gap: 5px; padding: 12px 20px 0; }
.pfw-steps i { flex: 1; height: 4px; border-radius: 2px; background: var(--border); }
.pfw-steps i.done { background: var(--blue); }
.pfw-body { padding: 18px 20px 8px; }
.pfw-body .step-label { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--blue); margin-bottom: 4px; }
.pfw-body h3 { font-size: 19px; font-weight: 750; margin: 0 0 16px; letter-spacing: -0.01em; }
.pfw-field { margin-bottom: 14px; }
.pfw-field label { display: block; font-size: 13px; font-weight: 650; color: var(--text); margin-bottom: 6px; }
.pfw-field input[type=text], .pfw-field input[type=url], .pfw-field input[type=month], .pfw-field textarea, .pfw-field select {
  width: 100%; border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; font: inherit; font-size: 14.5px; color: var(--text); background: #fff; outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.pfw-field input:focus, .pfw-field textarea:focus, .pfw-field select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,255,.12); }
.pfw-field textarea { min-height: 90px; resize: vertical; }
.pfw-field .hint { font-size: 12px; color: var(--text-3); margin-top: 5px; }
.pfw-types { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 560px) { .pfw-types { grid-template-columns: repeat(3, 1fr); } }
.pfw-type { border: 1.5px solid var(--border); border-radius: var(--r-md); padding: 14px 12px; display: flex; flex-direction: column; gap: 8px; cursor: pointer; transition: border-color .15s, background .15s; }
.pfw-type:hover { border-color: #C7D9FF; }
.pfw-type.sel { border-color: var(--blue); background: var(--blue-soft); }
.pfw-type .ti { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.pfw-type .ti svg { width: 18px; height: 18px; }
.pfw-type b { font-size: 13.5px; }
.pfw-type span { font-size: 11.5px; color: var(--text-2); line-height: 1.4; }
.pfw-cover { border: 1.5px dashed #C6D2E6; border-radius: var(--r-md); background: var(--blue-soft); padding: 20px; text-align: center; cursor: pointer; }
.pfw-cover:hover { background: var(--blue-soft-2); }
.pfw-cover img { max-height: 140px; margin: 0 auto 10px; border-radius: 10px; }
.pfw-vis { display: grid; gap: 10px; }
.pfw-vis .pfw-type { flex-direction: row; align-items: center; }
.pfw-foot { position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--border-2); padding: 14px 20px calc(14px + var(--safe-bottom)); display: flex; gap: 10px; }
.pfw-foot .btn { flex: 1; }

/* skill input chips */
.pfw-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.pfw-chips .pf-tag { height: 26px; font-size: 12px; gap: 6px; }
.pfw-chips .pf-tag button { width: 15px; height: 15px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--navy); opacity: .55; padding: 0; font-size: 13px; line-height: 1; }
.pfw-chips .pf-tag button:hover { opacity: 1; }

/* profile section header count */
.pf-count { font-size: 12.5px; color: var(--text-3); font-weight: 600; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheetUp { from { transform: translateY(60px); opacity: .4; } to { transform: translateY(0); opacity: 1; } }
@media (min-width: 700px) {
  @keyframes sheetUp { from { transform: translate(-50%,-46%); opacity: 0; } to { transform: translate(-50%,-50%); opacity: 1; } }
}
