/* ===== PCnet templates gallery ===== */
:root {
  --navy: #0b3a82;      /* deep brand blue (was dark navy) */
  --navy-2: #12305e;
  --blue: #2784fc;      /* exact PCnet header / logo blue */
  --blue-soft: #e8f1fe;
  --yellow: #ffe000;
  --bg: #f4f7fc;
  --card: #ffffff;
  --text: #102a50;
  --muted: #5b6f8e;
  --line: #e2e9f3;
  --radius: 20px;
  --shadow: 0 1px 2px rgba(16, 42, 80, .05), 0 12px 32px -12px rgba(16, 42, 80, .18);
  --shadow-up: 0 2px 4px rgba(16, 42, 80, .06), 0 28px 56px -18px rgba(16, 42, 80, .32);
  --ease: cubic-bezier(.2, .8, .2, 1);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; } /* the hidden lightbox must not cover the page and swallow clicks */
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: Cairo, Tahoma, "Segoe UI", Arial, sans-serif; font-size: 16px; line-height: 1.7;
  overflow-x: clip;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.3; margin: 0; text-wrap: balance; }
p { margin: 0; }
.wrap { width: min(1200px, 100%); margin-inline: auto; padding-inline: 20px; }
.skip { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 100; background: var(--yellow); color: var(--navy); padding: 8px 16px; border-radius: 10px; font-weight: 800; }
.skip:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; border-radius: 6px; }
#main:focus { outline: none; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* ----- buttons ----- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border-radius: 12px; border: 0;
  font: inherit; font-weight: 800; font-size: 15px; text-decoration: none; cursor: pointer;
  transition: transform .25s var(--ease), background .25s, box-shadow .25s, color .25s;
}
.btn svg { width: 18px; height: 18px; fill: currentColor; flex: none; }
.btn-yellow { background: var(--yellow); color: var(--navy); }
.btn-yellow:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -8px rgba(255, 224, 0, .7); }
.btn-blue { background: var(--blue); color: #fff; }
.btn-blue:hover { background: #1a6fd8; transform: translateY(-2px); }
.btn-ghost { background: var(--blue-soft); color: #1d5fb8; }
.btn-ghost:hover { background: #d8e8fd; }
.btn[aria-disabled="true"] { background: #eef2f7; color: #98a6ba; pointer-events: none; }
.btn-lg { min-height: 54px; padding: 0 28px; font-size: 16px; }

/* ----- header ----- */
.top {
  position: sticky; top: 0; z-index: 50;
  background: var(--blue); color: #fff;
  box-shadow: 0 6px 24px -10px rgba(11, 58, 130, .55);
  padding-top: env(safe-area-inset-top, 0px);
}
.top-in { display: flex; align-items: center; gap: 28px; min-height: 92px; }
.brand { display: flex; align-items: center; text-decoration: none; flex: none; }
.brand img { height: 70px; width: auto; }
.top-nav { display: flex; gap: 4px; margin-inline-start: auto; }
.top-nav a { text-decoration: none; padding: 8px 16px; border-radius: 10px; font-weight: 700; font-size: 16px; transition: background .2s; }
.top-nav a:hover { background: rgba(255, 255, 255, .14); }
.top-cta { min-height: 52px; padding: 0 28px; font-size: 17px; border-radius: 14px; }

/* ----- hero ----- */
.hero {
  position: relative; overflow: hidden; color: #fff;
  background:
    radial-gradient(45% 70% at 8% 100%, rgba(255, 224, 0, .22), transparent 65%),
    radial-gradient(60% 80% at 90% 0%, rgba(255, 255, 255, .16), transparent 60%),
    linear-gradient(165deg, var(--blue) 0%, #1a63d6 55%, var(--navy) 100%);
}
.hero::before {
  content: ""; position: absolute; inset: 0; opacity: .5;
  background-image: radial-gradient(rgba(255, 255, 255, .14) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(to bottom, #000 30%, transparent);
}
.hero-in { position: relative; padding-block: clamp(48px, 8vw, 96px) clamp(56px, 8vw, 104px); display: grid; gap: 22px; max-width: 760px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; width: fit-content;
  padding: 6px 14px; border-radius: 30px; font-size: 13px; font-weight: 800;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16);
}
.eyebrow i { width: 8px; height: 8px; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 0 4px rgba(255, 224, 0, .2); }
.hero h1 { font-size: clamp(32px, 5.4vw, 58px); font-weight: 900; letter-spacing: -.5px; }
.hero h1 em { font-style: normal; color: var(--yellow); }
.hero p { font-size: clamp(16px, 1.8vw, 19px); opacity: .82; max-width: 620px; }
.stats { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.stat { padding: 12px 18px; border-radius: 14px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); min-width: 120px; }
.stat b { display: block; font-size: 26px; font-weight: 900; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; opacity: .75; }

/* ----- sections ----- */
.section { padding-block: clamp(40px, 6vw, 72px); }
.sec-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.sec-head h2 { font-size: clamp(24px, 3vw, 34px); font-weight: 900; }
.sec-head p { color: var(--muted); margin-top: 4px; }
.lift { margin-top: -48px; position: relative; padding-top: 0; }

/* ----- category cards ----- */
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 24px; }
.cat {
  --accent: var(--blue);
  display: flex; flex-direction: column; text-decoration: none; background: var(--card);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--line);
  transition: transform .45s var(--ease), box-shadow .45s var(--ease);
}
.cat:hover { transform: translateY(-6px); box-shadow: var(--shadow-up); }
.cat-visual {
  position: relative; aspect-ratio: 16 / 10; overflow: hidden;
  background:
    radial-gradient(80% 90% at 80% 10%, color-mix(in srgb, var(--accent) 55%, transparent), transparent 70%),
    linear-gradient(160deg, color-mix(in srgb, var(--accent) 22%, var(--navy)), var(--navy));
}
.cat-visual::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, .1) 1px, transparent 1px); background-size: 18px 18px; }
.stack { position: absolute; inset: 0; z-index: 1; }
.stack .mock { position: absolute; width: 58%; top: 18%; transition: transform .6s var(--ease); }
.stack .mock:nth-child(1) { inset-inline-start: 21%; z-index: 3; top: 16%; }
.stack .mock:nth-child(2) { inset-inline-start: 6%; z-index: 2; transform: rotate(6deg) scale(.86); opacity: .9; }
.stack .mock:nth-child(3) { inset-inline-start: 36%; z-index: 1; transform: rotate(-6deg) scale(.86); opacity: .9; }
.cat:hover .stack .mock:nth-child(1) { transform: translateY(-6px); }
.cat:hover .stack .mock:nth-child(2) { transform: rotate(10deg) scale(.86) translateX(-14px); }
.cat:hover .stack .mock:nth-child(3) { transform: rotate(-10deg) scale(.86) translateX(14px); }
.cat-count {
  position: absolute; top: 14px; inset-inline-start: 14px; z-index: 4;
  background: rgba(255, 255, 255, .95); color: var(--navy); font-size: 13px; font-weight: 800;
  padding: 4px 12px; border-radius: 20px; font-variant-numeric: tabular-nums;
}
.cat-count.soon { background: var(--yellow); }
.cat-body { padding: 22px 24px 24px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.cat-sub { color: var(--accent); font-weight: 800; font-size: 13px; letter-spacing: .2px; }
.cat-body h3 { font-size: 23px; font-weight: 900; }
.cat-body p { color: var(--muted); font-size: 15px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cat-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 14px; font-weight: 800; font-size: 14px; color: var(--accent); }
.arrow { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 12%, #fff); transition: background .3s, color .3s, transform .3s var(--ease); }
.arrow svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.cat:hover .arrow { background: var(--accent); color: #fff; transform: translateX(-4px); }

/* ----- browser mockup (shared) ----- */
.mock { background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .45); }
.mock-bar { height: 22px; display: flex; align-items: center; gap: 5px; padding-inline: 9px; background: #eef2f7; border-bottom: 1px solid #e1e7ef; }
.mock-bar i { width: 7px; height: 7px; border-radius: 50%; background: #cfd8e3; }
.mock-bar i:nth-child(1) { background: #ff6159; } .mock-bar i:nth-child(2) { background: #ffbd2e; } .mock-bar i:nth-child(3) { background: #28c941; }
.mock-url { flex: 1; height: 12px; margin-inline-start: 8px; border-radius: 6px; background: #fff; font-size: 8px; line-height: 12px; color: #8b99ad; padding-inline: 6px; overflow: hidden; white-space: nowrap; direction: ltr; text-align: left; }
.mock-screen { aspect-ratio: 16 / 10; background: #f3f6fa center top / cover no-repeat; position: relative; overflow: hidden; }
.mock-screen img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
/* skeleton page when there is no screenshot yet */
.skel { position: absolute; inset: 0; padding: 9% 8%; display: grid; grid-template-rows: auto auto 1fr; gap: 7%; background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 16%, #fff), #fff 60%); }
.skel b { display: block; height: 9%; min-height: 6px; width: 46%; border-radius: 4px; background: color-mix(in srgb, var(--accent) 70%, var(--navy)); }
.skel span { display: block; height: 6px; width: 70%; border-radius: 4px; background: #d9e1ec; }
.skel div { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6%; }
.skel div i { border-radius: 6px; background: color-mix(in srgb, var(--accent) 18%, #eef2f7); }

/* ----- category page ----- */
.band {
  --accent: var(--blue);
  position: relative; overflow: hidden; color: #fff;
  background:
    radial-gradient(60% 90% at 90% 0%, color-mix(in srgb, var(--accent) 60%, transparent), transparent 65%),
    linear-gradient(160deg, color-mix(in srgb, var(--accent) 18%, var(--navy)), var(--navy));
}
.band::before { content: ""; position: absolute; inset: 0; opacity: .5; background-image: radial-gradient(rgba(255, 255, 255, .13) 1px, transparent 1px); background-size: 22px 22px; mask-image: linear-gradient(to bottom, #000 20%, transparent); }
.band-in { position: relative; padding-block: clamp(32px, 5vw, 56px) clamp(72px, 9vw, 104px); display: grid; gap: 14px; max-width: 760px; }
.crumbs { display: flex; gap: 8px; align-items: center; font-size: 14px; font-weight: 700; opacity: .85; flex-wrap: wrap; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.band h1 { font-size: clamp(30px, 4.6vw, 50px); font-weight: 900; }
.band p { opacity: .85; font-size: clamp(15px, 1.6vw, 18px); }
.band .stat { width: fit-content; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 24px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; box-shadow: var(--shadow); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { min-height: 38px; padding: 0 16px; border-radius: 30px; border: 1px solid var(--line); background: #fff; color: var(--muted); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; transition: .2s; }
.chip:hover { border-color: #c9d6e8; color: var(--text); }
.chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.toolbar .muted { color: var(--muted); font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }

.tpls { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 26px; }
.tpl { --accent: var(--blue); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; transition: transform .45s var(--ease), box-shadow .45s var(--ease); animation: rise .6s var(--ease) both; }
.tpl:hover { transform: translateY(-5px); box-shadow: var(--shadow-up); }
@keyframes rise { from { opacity: .001; transform: translateY(14px); } }
.tpl-shot { position: relative; padding: 16px 16px 0; background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 14%, #fff), #fff); }
.tpl-shot .mock { box-shadow: 0 10px 30px -14px rgba(16, 42, 80, .45); border: 1px solid var(--line); border-bottom: 0; border-radius: 12px 12px 0 0; }
.tpl-shot .mock-bar { height: 26px; }
.tpl-shot .mock-url { height: 14px; line-height: 14px; font-size: 9.5px; }
.tpl-shot button.mock-screen { display: block; width: 100%; border: 0; padding: 0; cursor: zoom-in; }
/* long screenshots glide down on hover to reveal the whole page */
.tpl-shot .mock-screen img { transition: object-position 5s ease-in-out; }
.tpl:hover .mock-screen img { object-position: bottom; }
.badge-feat { position: absolute; top: 54px; inset-inline-end: 28px; z-index: 2; background: var(--yellow); color: var(--navy); font-size: 12px; font-weight: 900; padding: 3px 10px; border-radius: 20px; box-shadow: 0 6px 14px -6px rgba(0, 0, 0, .4); }
.tpl-body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; border-top: 1px solid var(--line); }
.tpl-body h3 { font-size: 21px; font-weight: 900; }
.tpl-body p { color: var(--muted); font-size: 15px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags span { font-size: 12.5px; font-weight: 700; padding: 3px 11px; border-radius: 20px; background: color-mix(in srgb, var(--accent) 10%, #fff); color: color-mix(in srgb, var(--accent) 75%, var(--navy)); }
.tpl-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: auto; padding-top: 8px; }
.tpl-actions .btn { min-height: 46px; font-size: 14px; padding: 0 12px; }

/* empty / error / loading */
.empty { text-align: center; padding: 56px 20px; background: var(--card); border: 1px dashed #c9d6e8; border-radius: var(--radius); }
.empty b { display: block; font-size: 22px; margin-bottom: 6px; }
.empty p { color: var(--muted); margin-bottom: 18px; }
.ld { background: linear-gradient(90deg, #e9eef6 25%, #f4f7fb 50%, #e9eef6 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite linear; border-radius: var(--radius); min-height: 360px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ----- CTA + footer ----- */
.cta-band { padding-block: 0 56px; }
.cta-in { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; background: linear-gradient(135deg, var(--blue), #1557b8); color: #fff; border-radius: 24px; padding: clamp(26px, 4vw, 44px); box-shadow: var(--shadow-up); position: relative; overflow: hidden; }
.cta-in::after { content: ""; position: absolute; width: 280px; height: 280px; border-radius: 50%; inset-inline-start: -80px; bottom: -150px; background: rgba(255, 224, 0, .18); }
.cta-in > * { position: relative; z-index: 1; }
.cta-in h2 { font-size: clamp(22px, 3vw, 30px); font-weight: 900; }
.cta-in p { opacity: .88; max-width: 560px; margin-top: 4px; }
.foot { border-top: 1px solid var(--line); background: #fff; color: var(--muted); font-size: 14px; padding-bottom: env(safe-area-inset-bottom, 0px); }
.foot-in { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding-block: 22px; }
.foot a { font-weight: 800; color: var(--blue); text-decoration: none; }

/* ----- lightbox ----- */
.lb { position: fixed; inset: 0; z-index: 200; background: rgba(5, 16, 36, .92); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 64px 16px 16px; opacity: 0; transition: opacity .3s; }
.lb.open { opacity: 1; }
.lb-scroll { width: min(1100px, 100%); max-height: 100%; overflow-y: auto; border-radius: 14px; background: #fff; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); overscroll-behavior: contain; }
.lb-scroll img { width: 100%; height: auto; }
.lb-close { position: fixed; top: 14px; inset-inline-start: 14px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: #fff; color: var(--navy); display: grid; place-items: center; cursor: pointer; transition: transform .25s, background .25s; }
.lb-close:hover { background: var(--yellow); transform: rotate(90deg); }
.lb-close svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; fill: none; }

/* ----- tablet: links fold away, logo + CTA stay ----- */
@media (max-width: 1060px) { .top-nav { display: none; } .top-cta { margin-inline-start: auto; } }

/* ----- mobile ----- */
@media (max-width: 760px) {
  .wrap { padding-inline: 16px; }
  .top-in { gap: 10px; min-height: 72px; }
  .top-nav { display: none; }
  .top-cta { margin-inline-start: auto; }
  .brand img { height: 52px; }
  .top-cta { min-height: 44px; padding: 0 16px; font-size: 15px; border-radius: 12px; }
  .stat { min-width: 0; flex: 1; padding: 10px 12px; }
  .stat b { font-size: 22px; }
  .cats, .tpls { gap: 18px; }
  .toolbar { padding: 10px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -4px; padding-inline: 4px; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
  .cta-in .btn { width: 100%; }
}
@media (max-width: 380px) { .brand img { height: 44px; } .top-cta { padding: 0 12px; font-size: 14px; } }
