/* ============================================================
   BinAref — project-detail & privacy page styles · design system v2
   (shared by project/projects/<id>.html and <id>/<id>-privacy.html;
    class names must match detail.js and privacy.js renderers)
   ============================================================ */
:root {
  --bg: #06060d;
  --panel: #0d0e18;
  --panel2: #11121e;
  --text: #f0f5fa;
  --dim: #8a95a5;
  --faint: #5b6574;
  --ice: #9fd6f5;
  --ice-hi: #d3ecff;
  --ice-deep: #67abd9;
  --ice-soft: rgba(159,214,245,0.09);
  --border: rgba(255,255,255,0.08);
  --border2: rgba(159,214,245,0.18);
  --glass: rgba(13,14,24,0.38);
  --glass-hi: rgba(18,20,33,0.55);
  --ink: #04141f;
  --ease: cubic-bezier(.22,.75,.25,1);
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
}
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Space Grotesk', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  min-height: 100vh;
}
/* Ambient glow field — sits beneath the PCB canvas */
body::before {
  content: ""; position: fixed; inset: -12%; z-index: 0; pointer-events: none;
  background:
    radial-gradient(44% 52% at 12% 4%,  rgba(159,214,245,.075), transparent 66%),
    radial-gradient(36% 44% at 88% 8%,  rgba(139,150,235,.05),  transparent 64%),
    radial-gradient(52% 60% at 50% 112%, rgba(159,214,245,.05),  transparent 62%);
}
/* Film grain — above canvas, below content */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
a { color: inherit; }
::selection { background: rgba(159,214,245,0.28); color: #fff; }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #1c1d2c; border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #262738; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--ice); outline-offset: 3px; border-radius: 6px; }

@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.25} }
[data-reveal] {
  opacity: 0; transform: translateY(22px); filter: blur(4px);
  transition: opacity .8s var(--ease), transform .8s var(--ease), filter .8s var(--ease);
}
[data-reveal].revealed { opacity: 1; transform: none; filter: none; }

#bg-canvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }

/* NAV */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 48px;
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  background: rgba(6,6,13,0.78);
  border-bottom: 1px solid var(--border);
}
.nav-logo { text-decoration: none; display: flex; align-items: center; }
.nav-logo img { height: 21px; width: auto; display: block; }
.nav-links { display: flex; align-items: center; gap: 32px; }
.nav-link {
  position: relative;
  font-family: var(--mono); font-size: 13px; letter-spacing: .04em;
  color: var(--dim); text-decoration: none; padding: 6px 1px; transition: color .25s;
}
.nav-link::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: 0; height: 1px;
  background: linear-gradient(90deg, var(--ice), rgba(159,214,245,.2));
  transition: right .35s var(--ease);
}
.nav-link:hover { color: var(--text); }
.nav-link:hover::after { right: 0; }
.nav-cta {
  font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--ink);
  background: linear-gradient(135deg, var(--ice-hi), var(--ice) 55%, var(--ice-deep));
  padding: 10px 20px; border-radius: 9px;
  box-shadow: inset 0 0 0 1px rgba(211,236,255,.35), 0 6px 22px -8px rgba(159,214,245,.4);
  text-decoration: none; transition: transform .25s var(--ease), box-shadow .25s, filter .25s;
}
.nav-cta:hover {
  transform: translateY(-1px); filter: brightness(1.06);
  box-shadow: inset 0 0 0 1px rgba(211,236,255,.4), 0 10px 30px -8px rgba(159,214,245,.5);
}

/* SHELL */
.wrap { position: relative; z-index: 2; max-width: 980px; margin: 0 auto; padding: 116px 48px 96px; }
.back-link {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 13px;
  color: var(--dim); text-decoration: none; margin-bottom: 34px;
  transition: color .2s, gap .2s;
}
.back-link:hover { color: var(--ice); gap: 12px; }

/* BADGES */
.badge {
  font-family: var(--mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: .06em; text-transform: uppercase;
  padding: 5px 11px; border-radius: 100px; white-space: nowrap; border: 1px solid;
}
.badge-live     { color: #7fe0a8; background: rgba(127,224,168,.12); border-color: rgba(127,224,168,.3); }
.badge-published{ color: #9fd6f5; background: rgba(159,214,245,.14); border-color: rgba(159,214,245,.35); }
.badge-active   { color: #9fd6f5; background: rgba(159,214,245,.10); border-color: rgba(159,214,245,.25); }
.badge-beta     { color: #e6c989; background: rgba(230,201,137,.12); border-color: rgba(230,201,137,.3); }
.badge-dev      { color: #b6a8e6; background: rgba(182,168,230,.12); border-color: rgba(182,168,230,.3); }
.badge-concept  { color: #8a95a5; background: rgba(124,136,150,.12); border-color: rgba(124,136,150,.3); }

/* HERO */
.p-hero { margin-bottom: 42px; }
.p-banner {
  width: 100%; aspect-ratio: 16 / 7; border-radius: 20px; overflow: hidden;
  border: 1px solid var(--border2); margin-bottom: 30px; background: #0a0a14;
  box-shadow: 0 40px 90px -40px rgba(0,0,0,.65);
}
.p-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.p-head { display: flex; align-items: center; gap: 20px; margin-bottom: 20px; }
.p-avatar {
  width: 76px; height: 76px; border-radius: 18px; flex: none; overflow: hidden;
  border: 1px solid var(--border2); background: #0a0a14;
  box-shadow: inset 0 1px 0 rgba(211,236,255,.12), 0 14px 34px -16px rgba(0,0,0,.7);
}
.p-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.p-titles { min-width: 0; }
.p-title {
  font-size: clamp(30px,4.4vw,46px); line-height: 1.05; letter-spacing: -.032em; font-weight: 700;
  background: linear-gradient(180deg, #ffffff 60%, #c2d5e4);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.p-tagline { font-size: 16px; color: var(--ice); margin-top: 10px; font-family: var(--mono); }
.p-meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 8px; }
.p-cat {
  font-family: var(--mono); font-size: 11px;
  color: var(--ice); background: var(--ice-soft); border: 1px solid var(--border2);
  padding: 5px 11px; border-radius: 100px;
}

/* BODY SECTIONS */
.p-detail { font-size: 17.5px; line-height: 1.8; color: var(--text); margin: 8px 0 44px; max-width: 72ch; }
.sec-lbl {
  font-family: var(--mono); font-size: 12px; letter-spacing: .1em;
  color: var(--dim); margin-bottom: 18px; text-transform: uppercase;
}
.p-section { margin-bottom: 44px; }
.hl { display: flex; gap: 14px; padding: 14px 0; border-top: 1px solid var(--border); }
.hl:last-child { border-bottom: 1px solid var(--border); }
.hl-arr { color: var(--ice); font-family: var(--mono); font-size: 14px; margin-top: 2px; flex: none; }
.hl-txt { font-size: 15.5px; line-height: 1.6; color: var(--dim); }
.p-stack { display: flex; flex-wrap: wrap; gap: 9px; }
.stack-chip {
  font-family: var(--mono); font-size: 12px; letter-spacing: .02em;
  color: var(--dim); background: var(--glass); border: 1px solid var(--border);
  padding: 8px 14px; border-radius: 8px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  transition: color .25s, border-color .25s, transform .25s var(--ease);
}
.stack-chip:hover { color: var(--ice); border-color: var(--border2); transform: translateY(-2px); }

/* LINKS / DOWNLOADS */
.p-actions { display: flex; flex-direction: column; gap: 12px; max-width: 460px; }
.dl-btn {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px; border-radius: 13px; text-decoration: none;
  border: 1px solid var(--border2); background: var(--glass); color: var(--text);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: transform .22s var(--ease), border-color .22s, box-shadow .22s, background .22s;
}
.dl-btn:hover {
  transform: translateY(-3px); border-color: var(--ice); background: var(--glass-hi);
  box-shadow: 0 20px 46px -22px rgba(0,0,0,.7), 0 0 0 1px rgba(159,214,245,.06);
}
.dl-ico { width: 26px; height: 26px; flex: none; display: flex; align-items: center; justify-content: center; color: var(--ice); }
.dl-ico svg { width: 24px; height: 24px; }
.dl-txt { display: flex; flex-direction: column; line-height: 1.25; }
.dl-label { font-size: 15px; font-weight: 600; }
.dl-sub { font-family: var(--mono); font-size: 11px; color: var(--dim); margin-top: 2px; }
.dl-primary {
  background: linear-gradient(135deg, var(--ice-hi), var(--ice) 55%, var(--ice-deep));
  color: var(--ink); border-color: transparent;
  box-shadow: inset 0 0 0 1px rgba(211,236,255,.35), 0 14px 38px -16px rgba(159,214,245,.45);
}
.dl-primary .dl-ico { color: var(--ink); }
/* the sub-line inherits the button's ink so it stays readable in
   every design/skin (was a hardcoded d1 navy) */
.dl-primary .dl-sub { color: inherit; opacity: .72; }
.dl-primary:hover {
  filter: brightness(1.05); border-color: transparent;
  box-shadow: inset 0 0 0 1px rgba(211,236,255,.45), 0 20px 48px -16px rgba(159,214,245,.55);
}
.dl-apk { border-left: 3px solid #7bd88f; }
.dl-apk .dl-ico { color: #7bd88f; }
.dl-apk.dl-primary { background: linear-gradient(135deg,#8ce6a0,#7bd88f 55%,#56c08a); color:#06120b; }
.dl-apk.dl-primary .dl-ico { color:#06120b; }
.dl-apk.dl-primary .dl-sub { color: rgba(6,18,11,0.62); }
.dl-apk.dl-primary:hover { box-shadow: inset 0 0 0 1px rgba(214,255,224,.4), 0 20px 48px -16px rgba(123,216,143,0.45); }

/* MORE PROJECTS */
.more { border-top: 1px solid var(--border); margin-top: 20px; padding-top: 40px; }
.more-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin-top: 20px; }
.more-card {
  display: flex; align-items: center; gap: 13px; text-decoration: none;
  background: var(--glass); border: 1px solid var(--border);
  border-radius: 14px; padding: 14px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: border-color .3s, transform .3s var(--ease), background .3s, box-shadow .3s;
}
.more-card:hover {
  border-color: var(--border2); transform: translateY(-3px); background: var(--glass-hi);
  box-shadow: 0 22px 50px -26px rgba(0,0,0,.7);
}
.more-thumb { width: 40px; height: 40px; border-radius: 11px; overflow: hidden; flex: none; border: 1px solid var(--border2); background: #0a0a14; }
.more-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.more-title { font-size: 14px; font-weight: 600; }
.more-sub { font-family: var(--mono); font-size: 10.5px; color: var(--faint); margin-top: 3px; }

/* FOOTER */
.footer {
  position: relative; z-index: 2;
  border-top: 1px solid var(--border);
  padding: 22px 48px; display: flex; align-items: center;
  justify-content: space-between; flex-wrap: wrap; gap: 16px;
}
.footer::before {
  content: ""; position: absolute; top: -1px; left: 50%; transform: translateX(-50%);
  width: min(560px, 70%); height: 1px;
  background: linear-gradient(90deg, transparent, rgba(159,214,245,.35), transparent);
}
.footer img { height: 19px; width: auto; display: block; opacity: .9; }
.footer-copy { font-family: var(--mono); font-size: 12px; letter-spacing: .04em; color: var(--faint); }
.footer-right { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.footer-privacy {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 12px;
  color: var(--dim); text-decoration: none;
  border: 1px solid var(--border2); border-radius: 100px; padding: 8px 15px;
  transition: color .2s, border-color .2s, background .2s;
}
.footer-privacy svg { width: 14px; height: 14px; }
.footer-privacy:hover { color: var(--ice); border-color: var(--ice); background: var(--ice-soft); }

/* PRIVACY POLICY CONTENT (rendered by privacy.js) */
.pp { color: var(--dim); font-size: 15.5px; line-height: 1.75; margin-bottom: 12px; max-width: 74ch; }
.pp:last-child { margin-bottom: 0; }
.pp strong { color: var(--text); font-weight: 600; }
.pp-lead { font-size: 17.5px; line-height: 1.8; color: var(--text); margin: 8px 0 30px; max-width: 74ch; }
.pp-lead em { font-style: normal; color: var(--ice); }
.pp-note {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, var(--glass-hi), var(--glass));
  border: 1px solid var(--border2);
  border-radius: 16px; padding: 20px 24px; margin: 0 0 40px; max-width: 74ch;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.pp-note::before {
  content: ""; position: absolute; top: 0; left: 8%; right: 8%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(211,236,255,.4), transparent);
}
.pp-note .pp { color: var(--text); margin: 0; }
.pp-chip {
  display: inline-block; font-family: var(--mono); font-size: 11px;
  color: var(--ice); background: var(--ice-soft); border: 1px solid var(--border2);
  border-radius: 100px; padding: 3px 10px; margin-right: 6px;
}
.pp-mail { font-family: var(--mono); font-size: 15px; color: var(--ice); text-decoration: none; }
.pp-mail:hover { text-decoration: underline; }

/* RESPONSIVE */
@media (max-width: 640px) {
  .nav { padding: 10px 20px; }
  .nav-links { display: none; }
  .wrap { padding: 96px 20px 68px; }
  .p-head { gap: 14px; }
  .p-avatar { width: 60px; height: 60px; border-radius: 14px; }
  .p-banner { border-radius: 16px; aspect-ratio: 16 / 9; }
  .p-detail { font-size: 16px; }
  .more-grid { grid-template-columns: 1fr; }
  .footer { padding: 20px; flex-direction: column; align-items: flex-start; gap: 12px; }
}
@media (min-width: 641px) and (max-width: 1023px) {
  .nav { padding: 10px 28px; }
  .wrap { padding: 104px 32px 84px; }
  .more-grid { grid-template-columns: repeat(2,1fr); }
}

/* Respect reduced-motion */
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
  [data-reveal] { opacity: 1 !important; transform: none !important; filter: none !important; transition: none !important; }
}

/* ===== LIGHT THEME ===== */
[data-theme="light"] {
  --bg: #eef1f7;
  --panel: #ffffff;
  --panel2: #f3f6fb;
  --text: #0f1622;
  --dim: #4b5670;
  --faint: #8792a8;
  --ice: #2e7fbf;
  --ice-hi: #57a6de;
  --ice-deep: #1f5f96;
  --ice-soft: rgba(46,127,191,0.08);
  --border: rgba(20,32,56,0.10);
  --border2: rgba(46,127,191,0.24);
  --glass: rgba(255,255,255,0.60);
  --glass-hi: rgba(255,255,255,0.85);
  --ink: #ffffff;
}
[data-theme="light"] body::before {
  background:
    radial-gradient(44% 52% at 12% 4%,  rgba(46,127,191,.06), transparent 66%),
    radial-gradient(36% 44% at 88% 8%,  rgba(255,122,47,.05), transparent 64%),
    radial-gradient(52% 60% at 50% 112%, rgba(46,127,191,.05), transparent 62%);
}
[data-theme="light"] body::after { opacity: .03; }
[data-theme="light"] .p-title { background: linear-gradient(180deg,#0f1622,#39506e); -webkit-background-clip: text; background-clip: text; }
[data-theme="light"] .p-detail { color: #23303f; }
[data-theme="light"] ::-webkit-scrollbar-thumb { background: #c4ccdb; border-color: var(--bg); }
[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: #aab4c8; }

/* THEME TOGGLE BUTTON */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 10px; cursor: pointer; flex: none;
  background: var(--glass); border: 1px solid var(--border2); color: var(--ice);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: color .25s, border-color .25s, background .25s, transform .2s var(--ease);
}
.theme-toggle:hover { color: var(--text); border-color: var(--ice); transform: translateY(-1px); }
.theme-toggle svg { width: 17px; height: 17px; }
[data-theme="dark"] .theme-toggle .ic-moon { display: none; }
[data-theme="light"] .theme-toggle .ic-sun { display: none; }

/* ===== LAVA-GLASS ACCENTS (match the molten background) ===== */
:root { --lava: #ff8436; --lava2: #ff4a2b; --lava-soft: rgba(255,132,54,0.14); --lava-line: rgba(255,132,54,0.34); }
[data-theme="light"] { --lava: #e2661c; --lava2: #d63c22; --lava-soft: rgba(226,102,28,0.12); --lava-line: rgba(226,102,28,0.32); }
.nav { box-shadow: 0 1px 0 var(--lava-soft), 0 14px 36px -26px rgba(255,90,40,0.45); }
.footer::before { background: linear-gradient(90deg, transparent, var(--lava-line), var(--ice), transparent); }
.back-link:hover { color: var(--lava); }
.hl-arr { color: var(--lava); }
.p-cat { color: var(--lava); background: var(--lava-soft); border-color: var(--lava-line); }
.pp-lead em { color: var(--lava); }
.pp-note::before { background: linear-gradient(90deg, transparent, var(--lava-line), transparent); }
.dl-btn:hover { border-color: var(--lava-line); box-shadow: 0 20px 46px -22px rgba(0,0,0,0.7), 0 0 0 1px var(--lava-soft), 0 0 36px -10px rgba(255,90,40,0.28); }
.dl-btn:hover .dl-ico { color: var(--lava); }
.more-card:hover { border-color: var(--lava-line); box-shadow: 0 22px 50px -26px rgba(0,0,0,0.7), 0 0 30px -12px rgba(255,90,40,0.22); }
.stack-chip:hover { color: var(--lava); border-color: var(--lava-line); }
.theme-toggle:hover { color: var(--lava); border-color: var(--lava-line); }
.footer-privacy:hover { color: var(--lava); border-color: var(--lava-line); background: var(--lava-soft); }

/* ===== v3 tuning: light nav fix · transparent lava-through cards · speed · logo ===== */
[data-theme="light"] .nav { background: rgba(244,246,251,0.72); }
[data-theme="light"] .nav.scrolled { background: rgba(244,246,251,0.9); }
/* more transparent so the molten background shows through the cards */
:root { --glass: rgba(14,16,26,0.16); --glass-hi: rgba(20,22,36,0.26); }
[data-theme="light"] { --glass: rgba(255,255,255,0.40); --glass-hi: rgba(255,255,255,0.58); }
/* drop the expensive backdrop-blur behind the animating canvas (big speed win;
   also lets the lava read crisply "through" the cards) — keep blur only on the nav */
.dl-btn, .more-card, .stack-chip, .theme-toggle, .footer-privacy, .pp-note,
.p-avatar { backdrop-filter: none; -webkit-backdrop-filter: none; }
.nav { backdrop-filter: blur(10px) saturate(1.25); -webkit-backdrop-filter: blur(10px) saturate(1.25); }
/* the dark logo PNG has padding — show it larger in light theme */

/* ===== v4: monogram fallback icons + lava frame on large media ===== */
.p-avatar.mono, .more-thumb.mono {
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-weight: 700; color: var(--ice); letter-spacing: .02em;
  background: linear-gradient(155deg, rgba(159,214,245,.16), rgba(255,122,47,.12));
}
.p-avatar.mono { font-size: 26px; }
.more-thumb.mono { font-size: 14px; }
/* warm "lava frame" on the large project image + avatar */
.p-banner, .p-avatar {
  border-color: var(--lava-line);
  box-shadow: 0 40px 90px -40px rgba(0,0,0,.65), 0 0 34px -6px rgba(255,90,40,.28), inset 0 0 22px rgba(255,90,40,.06);
}

/* ===== v5 fixes: nav distribution, logo size, primary-button hover ===== */
/* nav: logo hard against the left edge, everything else grouped on the right */
.nav { justify-content: flex-start; gap: 22px; }
.nav-logo { margin-inline-end: auto; }
.nav-logo img { height: 40px; }        /* ~double size */
.footer img { height: 26px; }
/* keep the primary download buttons opaque on hover (they were turning
   transparent because .dl-btn:hover set a translucent glass background) */
.dl-primary:hover {
  background: linear-gradient(135deg, var(--ice-hi), var(--ice) 55%, var(--ice-deep));
  color: var(--ink);
}
.dl-primary:hover .dl-sub { color: inherit; opacity: .72; }
.dl-apk.dl-primary:hover { background: linear-gradient(135deg,#8ce6a0,#7bd88f 55%,#56c08a); color: #06120b; }
.dl-apk.dl-primary:hover .dl-sub { color: inherit; opacity: .72; }

/* logo B sits close to the screen edge — nav + footer (overrides all breakpoints) */
.nav { padding-left: 26px; }
.footer { padding-left: 28px; }
@media (max-width: 640px) { .nav { padding-left: 15px; } .footer { padding-left: 18px; } }

/* ===== language switcher ===== */
.lang-toggle {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  height: 38px; padding: 0 11px; border-radius: 10px; cursor: pointer;
  background: var(--glass); border: 1px solid var(--border2); color: var(--ice);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font-weight: 600; font-size: 12.5px; letter-spacing: .04em;
  transition: color .25s, border-color .25s, background .25s, transform .2s var(--ease);
}
.lang-toggle:hover { color: var(--text); border-color: var(--ice); transform: translateY(-1px); }
.lang-toggle svg { width: 16px; height: 16px; }
.lang-code { min-width: 1.4em; text-align: center; }
[data-theme="light"] .lang-toggle:hover { color: var(--lava); border-color: var(--lava-line); }

/* ===== RTL (Arabic) ===== */
[dir="rtl"] .nav { padding-left: 48px; padding-right: 26px; }
[dir="rtl"] .footer { padding-left: 48px; padding-right: 28px; }
[dir="rtl"] .wrap, [dir="rtl"] .p-detail, [dir="rtl"] .p-tagline,
[dir="rtl"] .hl-txt, [dir="rtl"] .pp, [dir="rtl"] .pp-lead { text-align: right; }
[dir="rtl"] .hl-arr { transform: scaleX(-1); }
[dir="rtl"] .sec-lbl, [dir="rtl"] .p-cat { letter-spacing: 0; }
@media (max-width: 640px) {
  [dir="rtl"] .nav { padding-left: 20px; padding-right: 15px; }
  [dir="rtl"] .footer { padding-left: 20px; padding-right: 18px; }
}

/* ===== readability: less transparent cards + clearer text ===== */
:root { --glass: rgba(14,16,26,0.62); --glass-hi: rgba(20,22,36,0.74); --dim: #cbd4e2; }
[data-theme="light"] { --glass: rgba(255,255,255,0.82); --glass-hi: rgba(255,255,255,0.92); --dim: #333d52; }

/* ---- project media shown as-is, no frame / no background ----
   (ported from the old site's ui.css, which loaded AFTER the page
   stylesheet so these win — same cascade reproduced by appending) */
.proj-thumb, .p-avatar, .p-banner, .more-thumb {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  overflow: visible;
}
.proj-thumb img, .p-avatar img, .p-banner img, .more-thumb img {
  object-fit: contain;
}
.proj-thumb.mono, .p-avatar.mono, .more-thumb.mono {
  background: linear-gradient(155deg, rgba(159,214,245,.16), rgba(255,122,47,.12)) !important;
}

/* ---- video cover: big image doubles as a play button ---- */
.p-banner { position: relative; }
.p-banner.has-video { cursor: pointer; }
.p-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 78px; height: 78px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10,12,20,.5); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border: 1.5px solid rgba(255,255,255,.55);
  box-shadow: 0 12px 40px -8px rgba(0,0,0,.6), 0 0 32px -6px rgba(159,214,245,.5);
  color: #fff; transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
  pointer-events: none;
}
.p-play svg { width: 34px; height: 34px; margin-left: 4px; }
.p-banner.has-video:hover .p-play { transform: translate(-50%, -50%) scale(1.08); background: rgba(159,214,245,.35); }

/* ---- BinAref Player lightbox (ported verbatim from ui.css) ---- */
.bap {
  position: fixed; inset: 0; z-index: 4000; display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .28s ease;
  padding: max(18px, env(safe-area-inset-top)) 18px;
}
.bap.bap-open { opacity: 1; pointer-events: auto; }
.bap-back { position: absolute; inset: 0; background: rgba(4,6,12,.78); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.bap-shell {
  position: relative; width: min(1100px, 96vw); max-height: 92vh; display: flex; flex-direction: column;
  border-radius: 18px; overflow: hidden;
  background: linear-gradient(180deg, rgba(18,20,30,.92), rgba(10,11,18,.94));
  border: 1px solid rgba(159,214,245,.16);
  box-shadow: 0 50px 130px -30px rgba(0,0,0,.8), 0 0 60px -20px rgba(255,90,40,.25);
  transform: translateY(12px) scale(.98); transition: transform .28s cubic-bezier(.2,.7,.2,1);
}
.bap-open .bap-shell { transform: none; }
.bap-shell:fullscreen { width: 100vw; max-height: 100vh; border-radius: 0; border: none; }

.bap-top { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,.06); }
.bap-brand { display: inline-flex; align-items: center; gap: 8px; font: 600 13px/1 "JetBrains Mono", ui-monospace, monospace; letter-spacing: .04em; color: #cfe6f6; }
.bap-dot { width: 8px; height: 8px; border-radius: 50%; background: #ff7a2f; box-shadow: 0 0 10px 1px rgba(255,122,47,.8); }
.bap-title { flex: 1; min-width: 0; color: #9fb2c4; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bap-x { width: 34px; height: 34px; border-radius: 9px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.04); color: #dbe7f1; font-size: 20px; line-height: 1; cursor: pointer; transition: background .2s, border-color .2s; }
.bap-x:hover { background: rgba(255,90,40,.18); border-color: rgba(255,122,47,.5); }

.bap-stage { position: relative; background: #05060a; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.bap-video { width: 100%; max-height: 74vh; display: block; background: #05060a; }
.bap-shell:fullscreen .bap-video { max-height: none; height: 100%; }
/* YouTube mode: the embed replaces the custom deck inside the shell */
.bap-yt .bap-video, .bap-yt .bap-big, .bap-yt .bap-bar { display: none; }
.bap-iframe { width: 100%; aspect-ratio: 16 / 9; max-height: 74vh; border: 0; display: block; background: #05060a; }
.bap-shell:fullscreen .bap-iframe { max-height: none; height: 100%; aspect-ratio: auto; }
.bap-big {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: transparent; border: 0; cursor: pointer; color: #fff; transition: opacity .2s ease;
}
.bap-big svg { width: 74px; height: 74px; padding: 20px; border-radius: 50%; background: rgba(10,12,20,.5); border: 1.5px solid rgba(255,255,255,.5); box-shadow: 0 0 40px -6px rgba(255,90,40,.5); }
.bap-playing .bap-big { opacity: 0; pointer-events: none; }

.bap-bar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: rgba(8,9,15,.7); border-top: 1px solid rgba(255,255,255,.06); }
.bap-idle .bap-bar { opacity: 0; transition: opacity .5s ease; }
.bap-bar button { width: 34px; height: 34px; flex: none; display: inline-flex; align-items: center; justify-content: center; border: 0; background: transparent; color: #dbe7f1; cursor: pointer; border-radius: 8px; transition: color .2s, background .2s; }
.bap-bar button:hover { color: #fff; background: rgba(255,255,255,.07); }
.bap-bar svg { width: 20px; height: 20px; }
.bap-play .i-pause, .bap-playing .bap-play .i-play { display: none; }
.bap-playing .bap-play .i-pause { display: block; }
.bap-mute .i-mute, .bap-muted .bap-mute .i-vol { display: none; }
.bap-muted .bap-mute .i-mute { display: block; }
.bap-time { font: 500 12px/1 "JetBrains Mono", ui-monospace, monospace; color: #9fb2c4; flex: none; min-width: 38px; text-align: center; }
.bap-seek { position: relative; flex: 1; height: 20px; display: flex; align-items: center; }
.bap-buff { position: absolute; left: 0; top: 50%; transform: translateY(-50%); height: 4px; width: 0; background: rgba(255,255,255,.16); border-radius: 3px; pointer-events: none; }
.bap-range { -webkit-appearance: none; appearance: none; width: 100%; height: 4px; border-radius: 3px; background: linear-gradient(90deg, #ff7a2f, #ffb04a); background-size: var(--p,0%) 100%; background-repeat: no-repeat; box-shadow: none; outline: none; }
.bap-range { background-color: rgba(255,255,255,.14); }
.bap-range::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 0 8px rgba(255,122,47,.9); cursor: pointer; }
.bap-range::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 0 8px rgba(255,122,47,.9); cursor: pointer; }

