/* ============================================================
   Sagar Software — Work showcase (shared by / and /work/)
   Uses the site brand tokens: --brand, --brand-dark, --brand-light,
   --ink, --ink-2, --ink-3, --surface, --border, --white, --shadow-*
============================================================ */
:root {
  --ws-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --ws-d-a: #1EC8A0; --ws-d-b: #F2994A; --ws-d-c: #6C63FF; --ws-d-d: #E0598B;
  --ws-d-e: #2D9CDB; --ws-d-f: #8BC34A; --ws-d-g: #C9A227;
}

/* ── Project card ──────────────────────────────────────── */
.ws-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 18px; }
.ws-card {
  position: relative; display: flex; flex-direction: column; gap: 14px; text-align: left; width: 100%;
  background: var(--white); border: 1px solid var(--border); border-radius: 16px; padding: 20px;
  box-shadow: var(--shadow-sm); transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
  cursor: pointer; overflow: hidden; font: inherit; color: inherit; min-width: 0;
}
.ws-card::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--brand-dark));
  transform: scaleX(0); transform-origin: left; transition: transform .3s ease;
}
.ws-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: rgba(30,200,160,.3); }
.ws-card:hover::after { transform: scaleX(1); }
.ws-card:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.ws-card-top { display: flex; align-items: center; gap: 12px; }
.ws-logo {
  width: 52px; height: 52px; border-radius: 12px; border: 1px solid var(--border); background: var(--white);
  display: grid; place-items: center; overflow: hidden; flex-shrink: 0;
}
.ws-logo img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.ws-logo.mono { background: var(--brand-light); border-color: rgba(30,200,160,.25); color: var(--brand-dark); font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 1.05rem; }
.ws-code { font-family: var(--ws-mono); font-size: .72rem; color: var(--ink-3); display: flex; align-items: center; gap: 6px; letter-spacing: .02em; }
.ws-code i { width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--brand)); flex-shrink: 0; }
.ws-card-top .ws-code { margin-right: auto; min-width: 0; }
.ws-live {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 100px; white-space: nowrap;
  background: rgba(30,200,160,.12); color: var(--brand-dark); font-size: .68rem; font-weight: 700; font-family: 'Space Grotesk', sans-serif;
}
.ws-live::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 3px rgba(30,200,160,.2); animation: ws-ping 2s ease-in-out infinite; }
@keyframes ws-ping { 50% { box-shadow: 0 0 0 5px rgba(30,200,160,0); } }
.ws-shipped { display: inline-flex; padding: 3px 10px; border-radius: 100px; background: var(--surface); color: var(--ink-3); font-size: .68rem; font-weight: 600; border: 1px solid var(--border); white-space: nowrap; }
.ws-card h3 { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 1.15rem; line-height: 1.25; color: var(--ink); margin: 0; }
.ws-card h3 small { display: block; font-family: 'Inter', sans-serif; font-weight: 500; font-size: .84rem; color: var(--ink-3); margin-top: 4px; }
.ws-card p { margin: 0; font-size: .875rem; line-height: 1.6; color: #666; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ws-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.ws-tag { font-family: var(--ws-mono); font-size: .7rem; padding: 3px 8px; border-radius: 6px; background: var(--surface); border: 1px solid var(--border); color: var(--ink-2); white-space: nowrap; }
.ws-tag mark, .ws-card mark { background: rgba(30,200,160,.25); color: inherit; border-radius: 2px; padding: 0 1px; }
.ws-card-foot { margin-top: auto; padding-top: 14px; border-top: 1px dashed var(--border); display: flex; justify-content: space-between; align-items: center; font-size: .82rem; font-weight: 600; color: var(--ink); font-family: 'Space Grotesk', sans-serif; }
.ws-card-foot span:first-child { color: var(--ink-3); font-weight: 500; font-family: 'Inter', sans-serif; font-size: .78rem; }
.ws-card-foot b { color: var(--brand-dark); transition: transform .25s; display: inline-block; }
.ws-card:hover .ws-card-foot b { transform: translateX(4px); }

/* ── Drawer ────────────────────────────────────────────── */
.ws-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(17,17,17,.42); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); opacity: 0; transition: opacity .3s ease; }
.ws-backdrop.show { opacity: 1; }
.ws-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 91; width: min(600px, 100vw);
  background: var(--white); border-left: 1px solid var(--border); box-shadow: -24px 0 80px rgba(0,0,0,.14);
  display: flex; flex-direction: column; transform: translateX(100%); transition: transform .38s cubic-bezier(.22,.8,.24,1);
}
.ws-drawer.show { transform: none; }
.ws-dbar { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,.95); flex-shrink: 0; }
.ws-dbar .ws-code { font-size: .76rem; color: var(--ink-2); margin-right: auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-ibtn { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--border); background: var(--white); display: grid; place-items: center; color: var(--ink); cursor: pointer; transition: all .2s; flex-shrink: 0; }
.ws-ibtn:hover { border-color: var(--ink); }
.ws-ibtn svg { width: 16px; height: 16px; }
.ws-dscroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.ws-banner { position: relative; height: 200px; background: var(--surface); border-bottom: 1px solid var(--border); overflow: hidden; }
.ws-banner > img.shot { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.ws-banner.plain { background:
  radial-gradient(420px 200px at 85% 0%, rgba(30,200,160,.22), transparent 70%),
  radial-gradient(300px 160px at 0% 100%, rgba(30,200,160,.12), transparent 70%), var(--surface);
  display: grid; place-items: center; }
.ws-banner.plain::before { content: ''; position: absolute; inset: 0; background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px); background-size: 28px 28px; opacity: .55; mask-image: radial-gradient(closest-side, #000, transparent); -webkit-mask-image: radial-gradient(closest-side, #000, transparent); }
.ws-banner .ws-blogo { position: relative; width: 96px; height: 96px; border-radius: 22px; background: var(--white); border: 1px solid var(--border); box-shadow: var(--shadow-md); display: grid; place-items: center; overflow: hidden; }
.ws-banner.shot-wrap .ws-blogo { position: absolute; left: 24px; bottom: 16px; width: 64px; height: 64px; border-radius: 14px; }
.ws-banner .ws-blogo img { width: 100%; height: 100%; object-fit: contain; padding: 10px; }
.ws-banner .ws-blogo.mono { background: var(--brand-light); color: var(--brand-dark); font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 1.8rem; }
.ws-dbody { padding: 26px 28px 36px; }
.ws-dbody h2 { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: clamp(1.6rem, 4.4vw, 2.1rem); line-height: 1.12; letter-spacing: -.02em; color: var(--ink); margin: 0 0 6px; }
.ws-dsub { color: #666; font-size: 1rem; margin: 0; }
.ws-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 22px 0 6px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.ws-meta div { padding: 12px 14px; background: var(--surface); min-width: 0; }
.ws-meta div + div { border-left: 1px solid var(--border); }
.ws-meta span { display: block; font-family: var(--ws-mono); font-size: .64rem; letter-spacing: .1em; color: var(--ink-3); font-weight: 500; }
.ws-meta b { display: block; margin-top: 4px; font-size: .84rem; font-weight: 600; color: var(--ink); line-height: 1.35; }
.ws-sec { margin-top: 26px; }
.ws-sec-h { display: flex; align-items: center; gap: 10px; font-family: var(--ws-mono); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; margin: 0 0 12px; }
.ws-sec-h::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.ws-ps { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ws-ps > div { border: 1px solid var(--border); border-radius: 12px; padding: 16px; background: var(--white); min-width: 0; }
.ws-ps > div.sol { border-color: rgba(30,200,160,.3); background: linear-gradient(180deg, var(--brand-light), var(--white) 70%); }
.ws-ps h4 { display: flex; align-items: center; gap: 8px; font-family: 'Space Grotesk', sans-serif; font-size: .86rem; font-weight: 700; color: var(--ink); margin: 0 0 8px; }
.ws-ps h4 i { width: 8px; height: 8px; border-radius: 50%; background: #F2994A; box-shadow: 0 0 0 3px rgba(242,153,74,.18); }
.ws-ps .sol h4 i { background: var(--brand); box-shadow: 0 0 0 3px rgba(30,200,160,.2); }
.ws-ps p { margin: 0; font-size: .86rem; line-height: 1.6; color: var(--ink-2); }
.ws-arch { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); padding: 14px 12px 10px; overflow-x: auto; }
.ws-arch svg { display: block; width: 100%; min-width: 500px; height: auto; }
.ws-arch .col { font-family: var(--ws-mono); font-size: 9px; letter-spacing: .12em; fill: var(--ink-3); }
.ws-arch .nd rect { fill: var(--white); stroke: var(--border); stroke-width: 1.2; transition: stroke .2s, fill .2s; }
.ws-arch .nd.c0 rect { fill: var(--brand-light); stroke: rgba(30,200,160,.55); }
.ws-arch .nd text { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 10px; font-weight: 500; fill: var(--ink); pointer-events: none; }
.ws-arch .nd { cursor: default; }
.ws-arch .wire { fill: none; stroke: #D5D9DF; stroke-width: 1.3; transition: stroke .2s; }
.ws-arch .flow { fill: none; stroke: var(--brand); stroke-width: 1.6; stroke-dasharray: 4 8; stroke-linecap: round; animation: ws-flow 1.1s linear infinite; opacity: .85; transition: opacity .2s; }
@keyframes ws-flow { to { stroke-dashoffset: -24; } }
.ws-arch svg.hl .flow { opacity: .15; }
.ws-arch svg.hl .flow.on { opacity: 1; stroke-width: 2.2; }
.ws-arch svg.hl .nd.on rect { stroke: var(--brand-dark); fill: var(--brand-light); }
.ws-arch-cap { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: .74rem; color: var(--ink-3); margin-top: 8px; }
.ws-hl { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ws-hl li { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; color: var(--ink-2); padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--white); }
.ws-hl .chk { width: 18px; height: 18px; border-radius: 50%; background: var(--brand-light); color: var(--brand-dark); display: flex; align-items: center; justify-content: center; font-size: .6rem; flex-shrink: 0; margin-top: 2px; font-weight: 700; }
.ws-stack { display: flex; flex-wrap: wrap; gap: 6px; }
.ws-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.ws-actions a { flex: 1 1 180px; justify-content: center; }
.ws-btn-play { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 10px; background: var(--ink); color: #fff; font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: .88rem; text-decoration: none; transition: all .25s; white-space: nowrap; }
.ws-btn-play:hover { background: #222; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(17,17,17,.2); }
.ws-btn-play svg, .ws-actions svg { width: 16px; height: 16px; flex-shrink: 0; }
.ws-dnav { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--border); }
.ws-dnav button { text-align: left; border: 1px solid var(--border); border-radius: 12px; background: var(--white); padding: 12px 14px; cursor: pointer; transition: all .2s; min-width: 0; font: inherit; color: inherit; }
.ws-dnav button:last-child { text-align: right; }
.ws-dnav button:hover { border-color: var(--brand); background: var(--brand-light); }
.ws-dnav span { display: block; font-size: .72rem; color: var(--ink-3); font-weight: 600; }
.ws-dnav b { display: block; font-family: 'Space Grotesk', sans-serif; font-size: .9rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }

@media (max-width: 640px) {
  .ws-dbody { padding: 22px 18px 30px; }
  .ws-ps { grid-template-columns: 1fr; }
  .ws-meta { grid-template-columns: 1fr; }
  .ws-meta div + div { border-left: 0; border-top: 1px solid var(--border); }
  .ws-banner { height: 160px; }
}
@media (prefers-reduced-motion: reduce) {
  .ws-arch .flow, .ws-live::before { animation: none; }
  .ws-drawer, .ws-backdrop, .ws-card { transition: none; }
}
