/* Elmotaheda Developer — prototype design system
   Direction: "Gilded Night" — ink black + brushed gold from the logo, ivory reading sections,
   Reem Kufi (geometric kufi echoing the logo letterforms) + Readex Pro body + Marcellus for Latin project names. */

:root {
  --ink: #0b0c0f;
  --ink-2: #13151a;
  --ink-3: #1c1f26;
  --line-d: rgba(232, 205, 132, .14);
  --ivory: #f5f0e6;
  --sand: #ebe3d3;
  --line-l: rgba(30, 24, 12, .12);
  --gold: #c8a04a;
  --gold-hi: #ecd28c;
  --gold-lo: #8a6824;
  --gold-grad: linear-gradient(120deg, #8a6824 0%, #e7cb82 38%, #c8a04a 55%, #f3dea0 72%, #9c7a2f 100%);
  --txt-d: #ece4d3;
  --mut-d: #a29a89;
  --txt-l: #1b1914;
  --mut-l: #6e665a;
  --ok: #2f9e6e;
  --ok-soft: rgba(47, 158, 110, .32);
  --no: #c4423a;
  --no-soft: rgba(196, 66, 58, .38);
  --r-s: 10px;
  --r-m: 18px;
  --r-l: 28px;
  --ease: cubic-bezier(.22, .8, .24, 1);
  --f-ar: 'Readex Pro', 'Segoe UI', Tahoma, sans-serif;
  --f-disp: 'Reem Kufi', 'Readex Pro', sans-serif;
  --f-lat: 'Marcellus', 'Reem Kufi', serif;
  --gutter: clamp(16px, 4vw, 56px);
  --maxw: 1240px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--ink); color: var(--txt-d);
  font-family: var(--f-ar); font-size: 16px; line-height: 1.75; overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 3px; border-radius: 6px; }
.wrap { width: min(100% - 2 * var(--gutter), var(--maxw)); margin-inline: auto; }
.lat { font-family: var(--f-lat); letter-spacing: .04em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* grain overlay for depth */
body::after {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 100; 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='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- typography ---------- */
.kicker {
  display: inline-flex; align-items: center; gap: 10px; font-size: .82rem; letter-spacing: .08em;
  color: var(--gold); font-weight: 500;
}
.kicker::before { content: ''; width: 28px; height: 1px; background: var(--gold); }
.h-disp { font-family: var(--f-disp); font-weight: 600; line-height: 1.25; margin: 0; }
.h1 { font-size: clamp(2.4rem, 7vw, 5.4rem); }
.h2 { font-size: clamp(1.9rem, 4.4vw, 3.2rem); }
.h3 { font-size: clamp(1.25rem, 2.4vw, 1.6rem); }
.gold-text { background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; background-size: 200% 100%; animation: sheen 8s linear infinite; }
@keyframes sheen { to { background-position: -200% 0; } }
.lead { color: var(--mut-d); font-size: clamp(1rem, 1.6vw, 1.15rem); max-width: 56ch; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px;
  padding: 0 22px; border-radius: 999px; font-weight: 500; font-size: .95rem; white-space: nowrap;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), background .3s, color .3s;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-gold { background: var(--gold-grad); background-size: 160% 100%; color: #1a1406; box-shadow: 0 10px 30px -12px rgba(200, 160, 74, .7); }
.btn-gold:hover { transform: translateY(-2px); background-position: 100% 0; box-shadow: 0 16px 40px -14px rgba(200, 160, 74, .9); }
.btn-ghost { border: 1px solid var(--line-d); color: var(--txt-d); background: rgba(255, 255, 255, .02); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-hi); }
.btn-wa { background: #1faa59; color: #fff; box-shadow: 0 10px 28px -12px rgba(31, 170, 89, .8); }
.btn-wa:hover { transform: translateY(-2px); background: #22bb62; }
.btn-dark { background: var(--ink); color: var(--ivory); }
.btn-dark:hover { background: var(--ink-3); transform: translateY(-2px); }
.btn-block { width: 100%; }

/* ---------- header ---------- */
.hdr {
  position: fixed; inset-inline: 0; top: 0; z-index: 50; transition: background .4s, backdrop-filter .4s, border-color .4s;
  border-bottom: 1px solid transparent;
}
.hdr.solid { background: rgba(11, 12, 15, .78); backdrop-filter: blur(14px) saturate(140%); border-color: var(--line-d); }
.hdr .wrap { display: flex; align-items: center; gap: 18px; height: 76px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 54px; height: 54px; object-fit: contain; }
.brand b { font-family: var(--f-disp); font-size: 1.1rem; font-weight: 600; line-height: 1.1; display: block; }
.brand small { color: var(--mut-d); font-size: .72rem; letter-spacing: .06em; }
.nav { display: flex; gap: 4px; margin-inline-start: auto; }
.nav a { padding: 8px 14px; border-radius: 999px; font-size: .92rem; color: var(--mut-d); transition: color .25s, background .25s; }
.nav a:hover, .nav a.on { color: var(--txt-d); background: rgba(255, 255, 255, .05); }
.hdr-act { display: flex; align-items: center; gap: 8px; }
.lang { min-width: 44px; height: 40px; border-radius: 999px; border: 1px solid var(--line-d); font-size: .85rem; padding: 0 12px; }
.lang:hover { border-color: var(--gold); color: var(--gold-hi); }
.hdr .btn-wa { min-height: 40px; padding: 0 16px; font-size: .88rem; }
.burger { display: none; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line-d); }
.burger span { display: block; width: 18px; height: 1.5px; background: var(--txt-d); margin: 4px auto; transition: transform .3s; }
@media (max-width: 960px) {
  .nav { position: fixed; inset: 76px 0 auto; flex-direction: column; padding: 12px var(--gutter) 24px; background: rgba(11, 12, 15, .96);
         backdrop-filter: blur(14px); border-bottom: 1px solid var(--line-d); transform: translateY(-120%); transition: transform .45s var(--ease); margin: 0; }
  .nav.open { transform: none; }
  .nav a { padding: 14px; font-size: 1.05rem; }
  .burger { display: block; }
  .hdr .btn-wa span { display: none; }
  .hdr .btn-wa { width: 40px; padding: 0; }
  .brand small { display: none; }
}

/* ---------- hero (home) ---------- */
.hero { position: relative; min-height: 100svh; display: grid; align-items: center; overflow: hidden; isolation: isolate;
  background: radial-gradient(70% 60% at 22% 55%, rgba(200, 160, 74, .16), transparent 70%),
              radial-gradient(60% 50% at 85% 10%, rgba(80, 96, 130, .18), transparent 70%), var(--ink); }
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 32px; padding-block: 120px 140px; }
.hero-copy { display: flex; flex-direction: column; gap: 22px; }
.hero-copy .h1 { line-height: 1.15; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.hero-stats { position: absolute; inset-inline: 0; bottom: 0; border-top: 1px solid var(--line-d); background: linear-gradient(transparent, rgba(11, 12, 15, .7)); }
.hero-stats .wrap { display: grid; grid-template-columns: repeat(4, 1fr); padding-block: 18px; }
.stat { display: flex; flex-direction: column; padding-inline: 12px; border-inline-start: 1px solid var(--line-d); }
.stat:first-child { border: 0; padding-inline-start: 0; }
.stat b { font-family: var(--f-disp); font-size: clamp(1.4rem, 3vw, 2.1rem); color: var(--gold-hi); line-height: 1.2; }
.stat span { font-size: .8rem; color: var(--mut-d); }
.scroll-cue { position: absolute; bottom: 104px; inset-inline-start: 50%; transform: translateX(50%); width: 22px; height: 36px; border: 1px solid var(--line-d); border-radius: 12px; }
[dir=ltr] .scroll-cue { transform: translateX(-50%); }
.scroll-cue::after { content: ''; position: absolute; top: 7px; left: 50%; width: 3px; height: 7px; margin-left: -1.5px; border-radius: 2px; background: var(--gold); animation: cue 1.8s var(--ease) infinite; }
@keyframes cue { 50% { transform: translateY(10px); opacity: .2; } }
@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; padding-block: 110px 170px; }
  .hero canvas { opacity: .55; }
  .hero-stats .wrap { grid-template-columns: repeat(2, 1fr); row-gap: 12px; }
  .stat:nth-child(3) { border: 0; padding-inline-start: 0; }
  .scroll-cue { display: none; }
}

/* ---------- sections ---------- */
.sec { padding-block: clamp(72px, 11vw, 140px); position: relative; }
.sec-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 18px 40px; margin-bottom: clamp(32px, 5vw, 56px); }
.sec-head > div { display: flex; flex-direction: column; gap: 14px; max-width: 640px; }
.light { background: var(--ivory); color: var(--txt-l); }
.light .lead, .light .mut { color: var(--mut-l); }
.light .kicker { color: var(--gold-lo); }
.light .kicker::before { background: var(--gold-lo); }

/* reveal on scroll */
.rv { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: var(--d, 0s); }
.rv.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .rv { opacity: 1; transform: none; transition: none; } .gold-text { animation: none; } }

/* ---------- project cards ---------- */
.proj-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(16px, 2.4vw, 28px); }
.pcard { position: relative; border-radius: var(--r-l); overflow: hidden; background: var(--ink-2); border: 1px solid var(--line-d);
  display: flex; flex-direction: column; text-align: start; transition: transform .6s var(--ease), border-color .4s; }
.pcard:hover { transform: translateY(-6px); border-color: rgba(232, 205, 132, .4); }
.pcard-media { position: relative; aspect-ratio: 16 / 11; overflow: hidden; }
.pcard-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.4s var(--ease); }
.pcard:hover .pcard-media img { transform: scale(1.06); }
.pcard-media::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(11, 12, 15, .92)); }
.pcard-tag { position: absolute; top: 16px; inset-inline-start: 16px; z-index: 2; display: inline-flex; gap: 8px; align-items: center;
  padding: 6px 12px; border-radius: 999px; font-size: .78rem; background: rgba(11, 12, 15, .6); backdrop-filter: blur(8px); border: 1px solid var(--line-d); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); }
.pcard-title { position: absolute; bottom: 18px; inset-inline: 22px; z-index: 2; }
.pcard-title .lat { font-size: clamp(1.6rem, 3.4vw, 2.5rem); display: block; line-height: 1.1; color: var(--gold-hi); }
.pcard-title small { color: var(--mut-d); }
.pcard-body { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line-d); border-top: 1px solid var(--line-d); }
.pcard-body div { background: var(--ink-2); padding: 14px 16px; display: flex; flex-direction: column; }
.pcard-body span { font-size: .74rem; color: var(--mut-d); }
.pcard-body b { font-weight: 500; font-size: .98rem; }
.pcard-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px; }
.pcard-foot .arrow { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-d); transition: background .3s, transform .4s var(--ease); }
.pcard:hover .arrow { background: var(--gold); color: var(--ink); transform: rotate(-45deg); }
[dir=ltr] .pcard:hover .arrow { transform: rotate(45deg); }
@media (max-width: 760px) { .proj-grid { grid-template-columns: 1fr; } }

/* ---------- map ---------- */
.map-sec { padding: 0; position: relative; }
.map-box { position: relative; height: min(84svh, 780px); min-height: 520px; background: #0f1216; }
#map { position: absolute; inset: 0; }
.map-veil { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, var(--ink) 0%, transparent 18%, transparent 78%, var(--ink) 100%); }
.map-head { position: absolute; top: 28px; inset-inline: 0; z-index: 3; pointer-events: none; }
.map-head .wrap > * { pointer-events: auto; }
.map-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.chip { padding: 8px 14px; border-radius: 999px; font-size: .85rem; background: rgba(11, 12, 15, .72); border: 1px solid var(--line-d); backdrop-filter: blur(8px); transition: .3s; }
.chip:hover, .chip.on { border-color: var(--gold); color: var(--gold-hi); }
.map-panel {
  position: absolute; z-index: 4; inset-inline-end: var(--gutter); bottom: 48px; width: min(400px, calc(100% - 2 * var(--gutter)));
  background: rgba(13, 14, 18, .9); backdrop-filter: blur(16px); border: 1px solid var(--line-d); border-radius: var(--r-l); overflow: hidden;
  transform: translateY(24px) scale(.98); opacity: 0; pointer-events: none; transition: .6s var(--ease);
}
.map-panel.show { transform: none; opacity: 1; pointer-events: auto; }
.map-panel img { aspect-ratio: 16 / 9; width: 100%; object-fit: cover; }
.map-panel .in { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 12px; }
.map-panel .lat { font-size: 1.6rem; color: var(--gold-hi); line-height: 1.1; }
.avail-bar { height: 6px; border-radius: 4px; background: var(--no-soft); overflow: hidden; }
.avail-bar i { display: block; height: 100%; background: var(--ok); border-radius: 4px; }
.mk { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; } /* keep MapLibre's position:absolute */
.mk::before { content: ''; position: absolute; inset: 0; border-radius: 50%; background: rgba(200, 160, 74, .35); animation: pulse 2.4s ease-out infinite; }
.mk i { width: 18px; height: 18px; border-radius: 50%; background: var(--gold-grad); border: 3px solid #fff; box-shadow: 0 4px 14px rgba(0, 0, 0, .5); position: relative; }
.mk em { position: absolute; bottom: 100%; white-space: nowrap; font-style: normal; font-family: var(--f-lat); font-size: .86rem; color: #fff;
  background: rgba(11, 12, 15, .82); padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line-d); margin-bottom: 4px; }
@keyframes pulse { 0% { transform: scale(.5); opacity: 1; } 100% { transform: scale(1.8); opacity: 0; } }
.maplibregl-ctrl-attrib { font-size: 10px; }
@media (max-width: 640px) { .map-panel { bottom: 16px; } .map-panel img { aspect-ratio: 21 / 9; } }

/* ---------- about ---------- */
.vm { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(16px, 3vw, 40px); }
.vm article { padding: clamp(24px, 4vw, 44px); border-radius: var(--r-l); background: #fff; border: 1px solid var(--line-l); position: relative; overflow: hidden; }
.vm article::before { content: attr(data-n); position: absolute; inset-inline-end: 20px; top: -8px; font-family: var(--f-lat); font-size: 7rem; color: rgba(200, 160, 74, .12); line-height: 1; }
.vm h3 { margin: 0 0 12px; }
.vm p { margin: 0; color: var(--mut-l); }
@media (max-width: 760px) { .vm { grid-template-columns: 1fr; } }

/* ---------- portfolio ---------- */
.folio { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.fcard { border-radius: var(--r-m); overflow: hidden; background: #fff; border: 1px solid var(--line-l); display: flex; flex-direction: column; }
.fcard .ph { aspect-ratio: 4 / 5; overflow: hidden; position: relative; }
.fcard .ph img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.fcard:hover .ph img { transform: scale(1.05); }
.fcard .badge { position: absolute; top: 12px; inset-inline-start: 12px; background: var(--ink); color: var(--gold-hi); font-size: .74rem; padding: 4px 10px; border-radius: 999px; }
.fcard .in { padding: 16px 18px; }
.fcard .lat { font-size: 1.25rem; display: block; }
.fcard .mut { font-size: .82rem; }
@media (max-width: 960px) { .folio { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .folio { grid-template-columns: 1fr; } .fcard .ph { aspect-ratio: 4 / 3; } }

/* ---------- founders ---------- */
.founders { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.fd { padding: 26px 20px; border-radius: var(--r-m); border: 1px solid var(--line-d); background: linear-gradient(160deg, var(--ink-2), var(--ink)); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.fd .av { width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 10px; font-family: var(--f-lat); font-size: 1.7rem; color: var(--ink); background: var(--gold-grad); box-shadow: 0 0 0 6px rgba(200, 160, 74, .12); }
.fd .av img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.fd b { font-weight: 500; }
.fd span { font-size: .82rem; color: var(--mut-d); }
@media (max-width: 860px) { .founders { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- contact / footer ---------- */
.contact { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(24px, 4vw, 56px); align-items: start; }
.clist { display: grid; gap: 10px; }
.clist a, .clist div { display: flex; gap: 14px; align-items: center; padding: 16px 18px; border-radius: var(--r-m); border: 1px solid var(--line-d); background: var(--ink-2); transition: border-color .3s; }
.clist a:hover { border-color: var(--gold); }
.clist svg { width: 20px; height: 20px; color: var(--gold); flex: none; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.socials { display: flex; gap: 10px; margin-top: 8px; }
.socials a { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-d); }
.socials a:hover { border-color: var(--gold); color: var(--gold-hi); }
.socials svg { width: 18px; height: 18px; }
.ftr { border-top: 1px solid var(--line-d); padding-block: 28px; color: var(--mut-d); font-size: .85rem; }
.ftr .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: center; }
@media (max-width: 860px) { .contact { grid-template-columns: 1fr; } }

/* floating whatsapp */
.fab-wa { position: fixed; inset-inline-start: 18px; bottom: 18px; z-index: 45; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: #1faa59; color: #fff; box-shadow: 0 12px 30px -8px rgba(0, 0, 0, .6); transition: transform .3s var(--ease), opacity .4s; opacity: 0; pointer-events: none; }
body.past-hero .fab-wa { opacity: 1; pointer-events: auto; }
.fab-wa:hover { transform: scale(1.08); }
.fab-wa svg { width: 28px; height: 28px; }

/* =================================================================== project page */
.phero { position: relative; min-height: 92svh; display: flex; align-items: end; overflow: hidden; isolation: isolate; }
.phero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transform: scale(1.08); animation: kb 18s var(--ease) forwards; }
@keyframes kb { to { transform: scale(1); } }
.phero::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(11, 12, 15, .55) 0%, rgba(11, 12, 15, .1) 35%, rgba(11, 12, 15, .85) 78%, var(--ink) 100%); }
.phero .wrap { padding-block: 120px 48px; display: flex; flex-direction: column; gap: 18px; }
.phero .lat.big { font-size: clamp(2.8rem, 10vw, 7.5rem); line-height: .95; color: var(--gold-hi); text-shadow: 0 10px 50px rgba(0, 0, 0, .5); }
.crumbs { font-size: .85rem; color: var(--txt-d); display: flex; gap: 8px; text-shadow: 0 1px 8px rgba(0, 0, 0, .8); }
.phero h1 { text-shadow: 0 2px 14px rgba(0, 0, 0, .9); }
.crumbs a:hover { color: var(--gold-hi); }
.facts { display: flex; flex-wrap: wrap; gap: 8px; }
.fact { padding: 10px 16px; border-radius: var(--r-m); background: rgba(11, 12, 15, .6); backdrop-filter: blur(10px); border: 1px solid var(--line-d); display: flex; flex-direction: column; line-height: 1.4; }
.fact span { font-size: .72rem; color: var(--mut-d); }
.fact b { font-weight: 500; }
.fact.hl b { color: var(--gold-hi); }

/* explorer */
.explorer { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 24px; align-items: start; }
.ex-side { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 16px; }
.bldg { position: relative; aspect-ratio: 1 / 1.05; border-radius: var(--r-l); border: 1px solid var(--line-d); background: radial-gradient(80% 70% at 50% 40%, rgba(200, 160, 74, .1), transparent 70%), var(--ink-2); overflow: hidden; }
.bldg canvas { width: 100% !important; height: 100% !important; display: block; cursor: pointer; }
.bldg .hint { position: absolute; bottom: 10px; inset-inline: 0; text-align: center; font-size: .75rem; color: var(--mut-d); pointer-events: none; }
.floors { display: flex; flex-direction: column; gap: 6px; }
.fl-btn { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: var(--r-s); border: 1px solid var(--line-d); background: var(--ink-2); text-align: start; transition: .3s; }
.fl-btn:hover { border-color: rgba(232, 205, 132, .4); }
.fl-btn.on { border-color: var(--gold); background: linear-gradient(90deg, rgba(200, 160, 74, .16), transparent); }
.fl-btn small { color: var(--mut-d); font-size: .78rem; }
.fl-btn .cnt { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--ok); }
.fl-btn .cnt.zero { color: var(--no); }

.ex-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.seg { display: inline-flex; padding: 4px; border-radius: 999px; border: 1px solid var(--line-d); background: var(--ink-2); }
.seg button { padding: 7px 14px; border-radius: 999px; font-size: .85rem; color: var(--mut-d); }
.seg button.on { background: var(--gold); color: var(--ink); }
select.sel { appearance: none; background: var(--ink-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23c8a04a' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat left 14px center;
  color: var(--txt-d); border: 1px solid var(--line-d); border-radius: 999px; padding: 9px 16px 9px 36px; font: inherit; font-size: .85rem; }
[dir=ltr] select.sel { background-position: right 14px center; padding: 9px 36px 9px 16px; }
.legend { display: flex; gap: 14px; font-size: .8rem; color: var(--mut-d); margin-inline-start: auto; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-inline-end: 6px; vertical-align: -1px; }

.plan-card { position: relative; border-radius: var(--r-l); background: #fbf8f1; border: 1px solid var(--line-d); overflow: hidden; }
.plan-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; background: var(--ink-2); border-bottom: 1px solid var(--line-d); }
.plan-head b { font-family: var(--f-disp); font-weight: 500; font-size: 1.1rem; }
.zoom { display: flex; gap: 6px; }
.zoom button { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-d); font-size: 1.1rem; line-height: 1; }
.zoom button:hover { border-color: var(--gold); color: var(--gold-hi); }
.plan-vp { overflow: auto; max-height: 78svh; overscroll-behavior: contain; touch-action: pan-x pan-y; }
.plan-stage { position: relative; width: 100%; margin: auto; transition: width .4s var(--ease); }
.plan-stage img { width: 100%; user-select: none; -webkit-user-drag: none; filter: contrast(1.05); }
.plan-stage svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.u-poly { cursor: pointer; transition: fill .25s, stroke-width .25s; stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.u-poly.av { fill: var(--ok-soft); stroke: var(--ok); }
.u-poly.rs { fill: var(--no-soft); stroke: var(--no); }
.u-poly.dim { fill: rgba(120, 120, 120, .12); stroke: rgba(120, 120, 120, .4); }
.u-poly:hover, .u-poly.sel { stroke-width: 3; fill-opacity: 1; }
.u-poly.av:hover, .u-poly.av.sel { fill: rgba(47, 158, 110, .55); }
.u-poly.rs:hover, .u-poly.rs.sel { fill: rgba(196, 66, 58, .58); }
.u-poly.sel { stroke: var(--gold-lo); }
.u-lbl { font-family: var(--f-ar); font-weight: 600; font-size: 13px; fill: #10120f; pointer-events: none; paint-order: stroke; stroke: rgba(255, 255, 255, .85); stroke-width: 3px; }
.x-poly { fill: rgba(28, 31, 38, .07); stroke: rgba(28, 31, 38, .3); stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; }
.x-lbl { font-size: 12px; fill: #6e665a; pointer-events: none; }
.plan-tip { position: absolute; z-index: 5; pointer-events: none; padding: 8px 12px; border-radius: 10px; background: rgba(11, 12, 15, .92); color: var(--txt-d); font-size: .8rem; line-height: 1.5; white-space: nowrap; opacity: 0; transform: translate(-50%, -110%); transition: opacity .15s; }
.plan-tip.show { opacity: 1; }

/* unit cards grid (floors without hotspots + mobile list) */
.ugrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ucard { position: relative; padding: 14px; border-radius: var(--r-m); border: 1px solid var(--line-d); background: var(--ink-2); text-align: start; display: flex; flex-direction: column; gap: 2px; transition: .3s var(--ease); }
.ucard::before { content: ''; position: absolute; inset-block: 14px; inset-inline-start: 0; width: 3px; border-radius: 3px; background: var(--ok); }
.ucard.rs::before { background: var(--no); }
.ucard:hover { border-color: var(--gold); transform: translateY(-2px); }
.ucard b { font-family: var(--f-disp); font-size: 1.25rem; font-weight: 600; }
.ucard span { font-size: .78rem; color: var(--mut-d); }
.ucard .pr { color: var(--gold-hi); font-size: .88rem; font-weight: 500; margin-top: 4px; }
.ucard.rs .pr { color: var(--no); }

/* unit table */
.tbl-wrap { overflow-x: auto; border-radius: var(--r-m); border: 1px solid var(--line-d); }
table.units { width: 100%; border-collapse: collapse; font-size: .88rem; min-width: 680px; }
table.units th, table.units td { padding: 12px 14px; text-align: start; border-bottom: 1px solid var(--line-d); white-space: nowrap; }
table.units th { font-weight: 500; color: var(--mut-d); background: var(--ink-2); position: sticky; top: 0; cursor: pointer; }
table.units tbody tr { cursor: pointer; transition: background .2s; }
table.units tbody tr:hover { background: rgba(200, 160, 74, .07); }
.st { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; }
.st::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.st.rs { color: var(--no); }
.st.rs::before { background: var(--no); }

/* drawer */
.scrim { position: fixed; inset: 0; z-index: 60; background: rgba(5, 6, 8, .55); backdrop-filter: blur(3px); opacity: 0; pointer-events: none; transition: opacity .4s; }
.scrim.show { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; z-index: 61; top: 0; bottom: 0; inset-inline-end: 0; width: min(520px, 100%); background: var(--ink); border-inline-start: 1px solid var(--line-d);
  transform: translateX(-104%); transition: transform .55s var(--ease); display: flex; flex-direction: column; }
[dir=ltr] .drawer { transform: translateX(104%); }
.drawer.show { transform: none !important; }
.dr-scroll { overflow-y: auto; flex: 1; overscroll-behavior: contain; }
.dr-media { position: relative; background: #fff; aspect-ratio: 4 / 3; cursor: zoom-in; }
.dr-media img { width: 100%; height: 100%; object-fit: contain; }
.dr-media .noimg { height: 100%; display: grid; place-items: center; color: var(--mut-l); font-size: .9rem; background: repeating-linear-gradient(45deg, #f3eee3, #f3eee3 10px, #efe8da 10px, #efe8da 20px); }
.dr-close { position: absolute; top: 14px; inset-inline-start: 14px; z-index: 2; width: 42px; height: 42px; border-radius: 50%; background: rgba(11, 12, 15, .8); display: grid; place-items: center; font-size: 1.3rem; color: #fff; }
.dr-body { padding: 22px; display: flex; flex-direction: column; gap: 18px; }
.dr-title { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.dr-title h3 { margin: 0; font-family: var(--f-disp); font-size: 1.9rem; font-weight: 600; line-height: 1.2; }
.pill { padding: 6px 12px; border-radius: 999px; font-size: .8rem; display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
.pill.av { background: rgba(47, 158, 110, .16); color: #5bd39e; }
.pill.rs { background: rgba(196, 66, 58, .18); color: #ff8b82; }
.specs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line-d); border-radius: var(--r-m); overflow: hidden; border: 1px solid var(--line-d); }
.specs div { background: var(--ink-2); padding: 12px 14px; display: flex; flex-direction: column; }
.specs span { font-size: .74rem; color: var(--mut-d); }
.price-box { padding: 18px; border-radius: var(--r-m); background: linear-gradient(135deg, rgba(200, 160, 74, .16), rgba(200, 160, 74, .02)); border: 1px solid rgba(232, 205, 132, .3); }
.price-box span { font-size: .8rem; color: var(--mut-d); }
.price-box b { display: block; font-family: var(--f-disp); font-size: 2rem; color: var(--gold-hi); line-height: 1.3; }
.price-box small { color: var(--mut-d); font-size: .78rem; }
.plans-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.plans-tabs button { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line-d); font-size: .84rem; }
.plans-tabs button.on { border-color: var(--gold); background: rgba(200, 160, 74, .14); color: var(--gold-hi); }
.plan-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.plan-sum div { padding: 12px; border-radius: var(--r-s); background: var(--ink-2); border: 1px solid var(--line-d); display: flex; flex-direction: column; }
.plan-sum span { font-size: .72rem; color: var(--mut-d); }
.plan-sum b { font-weight: 500; font-size: .95rem; }
details.sched summary { cursor: pointer; color: var(--gold); font-size: .88rem; list-style: none; }
details.sched summary::-webkit-details-marker { display: none; }
details.sched ol { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; max-height: 240px; overflow: auto; }
details.sched li { display: flex; justify-content: space-between; padding: 8px 12px; border-radius: 8px; background: var(--ink-2); font-size: .85rem; }
.reserved-note { padding: 18px; border-radius: var(--r-m); border: 1px dashed rgba(196, 66, 58, .5); color: #ffb1ab; background: rgba(196, 66, 58, .06); }
.dr-foot { padding: 14px 22px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line-d); display: flex; gap: 10px; background: var(--ink); }
.dr-foot .btn { flex: 1; }
.similar { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.similar .ucard { min-width: 132px; }
@media (max-width: 640px) {
  .drawer { top: auto; height: 92svh; width: 100%; border-radius: 24px 24px 0 0; border: 0; border-top: 1px solid var(--line-d); transform: translateY(104%) !important; }
  .drawer.show { transform: none !important; }
  .drawer .dr-scroll { border-radius: 24px 24px 0 0; }
}

/* gallery + lightbox */
.gal { columns: 3 260px; column-gap: 12px; }
.gal button { display: block; width: 100%; margin-bottom: 12px; border-radius: var(--r-m); overflow: hidden; break-inside: avoid; }
.gal img { width: 100%; transition: transform 1s var(--ease); }
.gal button:hover img { transform: scale(1.04); }
.lb { position: fixed; inset: 0; z-index: 80; background: rgba(5, 6, 8, .94); display: grid; place-items: center; opacity: 0; pointer-events: none; transition: opacity .35s; }
.lb.show { opacity: 1; pointer-events: auto; }
.lb img { max-width: 94vw; max-height: 86svh; object-fit: contain; border-radius: 8px; }
.lb .x { position: absolute; top: 16px; inset-inline-end: 16px; width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line-d); color: #fff; font-size: 1.4rem; }
.lb .nv { position: absolute; top: 50%; width: 50px; height: 50px; border-radius: 50%; border: 1px solid var(--line-d); color: #fff; font-size: 1.4rem; transform: translateY(-50%); background: rgba(11, 12, 15, .6); }
.lb .pv { inset-inline-start: 16px; } .lb .nx { inset-inline-end: 16px; }

.loc { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: stretch; }
.loc #pmap { min-height: 380px; border-radius: var(--r-l); overflow: hidden; border: 1px solid var(--line-d); }
@media (max-width: 860px) { .loc { grid-template-columns: 1fr; } }

@media (max-width: 960px) {
  .explorer { grid-template-columns: 1fr; }
  .ex-side { position: static; display: grid; grid-template-columns: 180px 1fr; align-items: start; }
  .bldg { aspect-ratio: 1 / 1.25; }
}
@media (max-width: 560px) {
  .ex-side { grid-template-columns: 1fr; }
  .bldg { display: none; }
  .floors { flex-direction: row; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .fl-btn { flex: none; flex-direction: column; align-items: start; gap: 0; padding: 10px 14px; }
  .legend { margin: 0; width: 100%; }
  .plan-sum { grid-template-columns: 1fr 1fr; }
}
