/* 3D building experience — hero + explorer UI (no Tailwind dependency) */
.s3d { position: relative; isolation: isolate; background: radial-gradient(120% 90% at 70% 10%, #e9f1ec 0%, #cfdcd4 45%, #a9bfb2 100%); transition: background 1s; }
.s3d.s3d-night { background: radial-gradient(120% 90% at 70% 0%, #1d3a4a 0%, #0c1f1b 50%, #050d0b 100%); }
.s3d.s3d-night .s3d-hero-fade { background: linear-gradient(90deg, rgba(2,20,14,.9) 0%, rgba(2,20,14,.65) 34%, rgba(2,20,14,.05) 62%, rgba(2,20,14,0) 100%); }
.s3d-canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; display: block; z-index: 0; opacity: 0; transition: opacity .9s ease; }
.s3d.s3d-ready .s3d-canvas { opacity: 1; }
.s3d-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: .6rem; color: #0f3b2c; font-size: .85rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; z-index: 1; pointer-events: none; transition: opacity .4s; }
.s3d-loading i { width: 10px; height: 10px; border-radius: 50%; background: #d4a83a; animation: s3dPulse 1s infinite alternate; }
@keyframes s3dPulse { to { transform: scale(1.8); opacity: .3; } }
.s3d.s3d-ready .s3d-loading, .s3d.s3d-fallback .s3d-loading { opacity: 0; }
.s3d-fallback-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; z-index: 0; pointer-events: none; }
.s3d-canvas { z-index: 1; }
.s3d-hero-fade, .s3d-loading { z-index: 1; }
.s3d.s3d-fallback .s3d-fallback-img { opacity: 1; }
.s3d.s3d-fallback .s3d-canvas { display: none; }

/* fallback message (explorer only) */
.s3d-fallback-msg { display: none; position: absolute; inset: 0; z-index: 5; align-items: center; justify-content: center; padding: 1rem; background: rgba(2,43,30,.55); }
.s3d.s3d-fallback .s3d-fallback-msg { display: flex; }
.s3d-fallback-msg > div { background: #fff; border-radius: 16px; padding: 1.2rem 1.4rem; max-width: 420px; text-align: center; display: flex; flex-direction: column; gap: .4rem; }
.s3d-fallback-msg b { color: #0f3b2c; font-size: 1.05rem; } .s3d-fallback-msg span { color: #5b6b63; font-size: .85rem; } .s3d-fallback-msg a { margin-top: .4rem; color: #0f3b2c; font-weight: 700; }
.s3d.s3d-fallback .s3d-ui { display: none; }

/* hero */
.s3d-hero { min-height: 82vh; }
.s3d-hero-overlay { position: relative; z-index: 2; pointer-events: none; }
.s3d-hero-overlay a, .s3d-hero-overlay button { pointer-events: auto; }
.s3d-hero-fade { position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(90deg, rgba(2,43,30,.92) 0%, rgba(2,43,30,.72) 34%, rgba(2,43,30,.08) 62%, rgba(2,43,30,0) 100%); }
@media (max-width: 767px) { .s3d-hero-fade { background: linear-gradient(180deg, rgba(2,43,30,.94) 0%, rgba(2,43,30,.82) 45%, rgba(2,43,30,.15) 100%); } }
.s3d-hint { position: absolute; right: 1rem; bottom: 1rem; z-index: 2; display: inline-flex; align-items: center; gap: .5rem; padding: .45rem .8rem; border-radius: 999px; background: rgba(255,255,255,.85); color: #0f3b2c; font-size: .75rem; font-weight: 600; backdrop-filter: blur(6px); pointer-events: none; }
.s3d-hint svg { width: 16px; height: 16px; animation: s3dNudge 2.4s ease-in-out infinite; }
@keyframes s3dNudge { 0%, 100% { transform: translateX(-3px); } 50% { transform: translateX(3px); } }
.s3d.s3d-fallback .s3d-hint { display: none; }

/* progress page */
.s3d-progress { height: min(72vh, 640px); min-height: 420px; }
.s3d-progress-legend { position: absolute; left: 1rem; top: 1rem; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .9rem; padding: .5rem .9rem; border-radius: 12px; background: rgba(255,255,255,.9); backdrop-filter: blur(6px); font-size: .74rem; color: #35463f; box-shadow: 0 6px 20px rgba(2,43,30,.1); }
.s3d-progress-legend b { color: #0f3b2c; font-size: .8rem; margin-right: .3rem; }
.s3d-progress-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; box-sizing: border-box; }
.s3d-toggle { display: inline-flex; align-items: center; gap: .45rem; border: 0; padding: .55rem .8rem; font: inherit; font-size: .78rem; font-weight: 700; color: #0f3b2c; cursor: pointer; }
.s3d-toggle .s3d-dot { width: 10px; height: 10px; border-radius: 50%; background: #c9cfcc; transition: background .2s; }
.s3d-toggle.is-active { background: #0f3b2c; color: #f3d27a; } .s3d-toggle.is-active .s3d-dot { background: #e6b422; box-shadow: 0 0 0 3px rgba(230,180,34,.3); }
.pr-ring { transition: stroke-dashoffset 1.2s cubic-bezier(.2,.8,.2,1); }

/* explorer */
.s3d-explore { height: calc(100dvh - 68px); min-height: 520px; overflow: hidden; }
.s3d-ui { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.s3d-ui > * { pointer-events: auto; }
.s3d-top { position: absolute; left: 1rem; top: 1rem; right: 1rem; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.s3d-card { background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border: 1px solid rgba(15,59,44,.12); border-radius: 14px; box-shadow: 0 8px 30px rgba(2,43,30,.12); }
.s3d-title { padding: .6rem .9rem; display: flex; flex-direction: column; gap: .1rem; }
.s3d-title b { font-family: 'Cormorant Garamond', serif; font-size: 1.35rem; line-height: 1.1; color: #0f3b2c; }
.s3d-title span { font-size: .72rem; color: #5b6b63; }
.s3d-select { padding: .55rem .8rem; border-radius: 12px; border: 1px solid rgba(15,59,44,.15); background: rgba(255,255,255,.92); font: inherit; font-size: .85rem; font-weight: 600; color: #0f3b2c; }
.s3d-views { display: flex; gap: .25rem; padding: .25rem; }
.s3d-plancount:empty { display: none; } .s3d-plancount { padding: .5rem .8rem; font-size: .78rem; font-weight: 700; color: #7a5a10; }
.s3d-views button, .s3d-reset { border: 0; background: transparent; padding: .45rem .7rem; border-radius: 10px; font: inherit; font-size: .78rem; font-weight: 600; color: #0f3b2c; cursor: pointer; }
.s3d-views button:hover, .s3d-reset:hover { background: rgba(15,59,44,.08); }
.s3d-side { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; align-items: stretch; gap: .35rem; padding: .5rem; max-height: calc(100% - 9rem); }
.s3d-side small { text-align: center; font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; color: #5b6b63; padding: .2rem 0 .1rem; }
.s3d-floors { display: flex; flex-direction: column; gap: 3px; overflow: auto; scrollbar-width: thin; }
.s3d-floor { min-width: 40px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: #0f3b2c; font: inherit; font-size: .78rem; font-weight: 700; cursor: pointer; }
.s3d-floor:hover { background: rgba(15,59,44,.08); }
.s3d-floor.is-active { background: #0f3b2c; color: #f3d27a; }
.s3d-bottom { position: absolute; left: 50%; bottom: 1rem; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: .5rem; width: min(92%, 720px); }
.s3d-caption { padding: .5rem .9rem; font-size: .8rem; color: #0f3b2c; text-align: center; }
.s3d-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: .35rem .9rem; padding: .45rem .8rem; font-size: .72rem; color: #35463f; }
.s3d-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; border: 1px solid rgba(0,0,0,.08); }
.s3d-tip { position: absolute; left: 0; top: 0; z-index: 3; pointer-events: none; padding: .5rem .7rem; border-radius: 10px; background: #0f3b2c; color: #fff; font-size: .78rem; line-height: 1.3; box-shadow: 0 6px 20px rgba(0,0,0,.25); max-width: 260px; }
.s3d-tip b { display: block; font-size: .85rem; } .s3d-tip span { display: block; opacity: .8; }
.s3d-st { display: inline-block; margin-top: .3rem; padding: .15rem .5rem; border-radius: 999px; font-size: .68rem; font-weight: 700; font-style: normal; letter-spacing: .04em; text-transform: uppercase; }
.s3d-st-available { background: #f3d27a; color: #4a3a05; } .s3d-st-hold { background: #f7d8a5; color: #6a3f00; } .s3d-st-sold { background: #3b6b58; color: #fff; } .s3d-st-blocked { background: #c9cfcc; color: #333; } .s3d-st-unlisted { background: #e9e3d5; color: #4d4a42; }
.s3d-panel { position: absolute; right: 1rem; top: 1rem; bottom: 1rem; width: min(380px, calc(100% - 2rem)); overflow: auto; padding: 1.1rem 1.2rem; z-index: 4; }
.s3d-panel h3 { font-family: 'Cormorant Garamond', serif; font-size: 2rem; line-height: 1; color: #0f3b2c; margin: .2rem 0 .6rem; }
.s3d-p-kicker { font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: #a67c1c; font-weight: 700; }
.s3d-p-plan { display: flex; gap: .8rem; align-items: center; margin: .5rem 0 .8rem; }
.s3d-p-plan img { width: 96px; height: 72px; object-fit: contain; background: #f6f5f1; border-radius: 10px; border: 1px solid #e8e6df; }
.s3d-p-plan b { display: block; color: #0f3b2c; } .s3d-p-plan span { font-size: .78rem; color: #5b6b63; }
.s3d-panel dl { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin: 0; }
.s3d-panel dl div { background: #f6f5f1; border-radius: 10px; padding: .5rem .7rem; } .s3d-panel dt { font-size: .65rem; text-transform: uppercase; letter-spacing: .08em; color: #7a857f; } .s3d-panel dd { margin: 0; font-weight: 700; color: #1d2a24; font-size: .95rem; }
.s3d-p-actions { display: flex; flex-direction: column; gap: .5rem; margin-top: .9rem; }
.s3d-btn { display: block; text-align: center; padding: .7rem 1rem; border-radius: 12px; background: #0f3b2c; color: #fff; font-weight: 700; font-size: .85rem; text-decoration: none; }
.s3d-btn-ghost { background: #fff; color: #0f3b2c; border: 1px solid rgba(15,59,44,.25); } .s3d-btn-wa { background: #25d366; color: #063; }
.s3d-close { position: absolute; right: .7rem; top: .7rem; width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(15,59,44,.08); font-size: 1.1rem; cursor: pointer; color: #0f3b2c; }
@media (max-width: 767px) {
  .s3d-explore { height: calc(100dvh - 60px); }
  .s3d-top { flex-direction: column; align-items: stretch; right: auto; width: calc(100% - 2rem); } .s3d-title { display: none; }
  .s3d-top .s3d-views { display: none; }
  .s3d-top .s3d-toggle { justify-content: center; }
  .s3d-side { left: .5rem; padding: .3rem; } .s3d-floor { min-width: 34px; height: 26px; font-size: .7rem; }
  .s3d-legend { display: none; }
  .s3d-panel { left: .5rem; right: .5rem; top: auto; bottom: .5rem; width: auto; max-height: 62%; border-radius: 18px 18px 14px 14px; }
  .s3d-bottom { bottom: .6rem; width: calc(100% - 5rem); left: auto; right: .5rem; transform: none; }
}

/* plan page: locate on floor + 3D tilt card */
.s3d-locate { position: relative; border-radius: 16px; overflow: hidden; border: 1px solid #e6e4dc; background: #f8f7f3; }
.s3d-locate img { display: block; width: 100%; }
.s3d-locate svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.s3d-locate rect.dim { fill: rgba(2,43,30,.45); }
.s3d-locate rect.hit { fill: rgba(212,168,58,.35); stroke: #d4a83a; stroke-width: 12; animation: s3dGlow 1.4s ease-in-out infinite alternate; }
@keyframes s3dGlow { from { stroke-opacity: .5; fill-opacity: .4; } to { stroke-opacity: 1; fill-opacity: 1; } }
.tilt { transform-style: preserve-3d; transition: transform .25s ease, box-shadow .25s ease; will-change: transform; }
.tilt-wrap { perspective: 1200px; }
.tilt.is-tilting { transition: none; }
