/* Nova Dilijan — shared styles for index, project and contact pages */
:root {
  --forest: #102b25;
  --forest-2: #1d3d33;
  --cream: #f3efe7;
  --paper: #fbf9f4;
  --stage: #eeeae1;
  --ink: #1d2923;
  --muted: #5f675e;
  --line: #d6d3c8;
  --copper: #a66e55;
  --sand: #d8b08d;
  --serif: 'Noto Serif Armenian', Georgia, serif;
  --sans: 'Noto Sans Armenian', Arial, sans-serif;
  --gutter: clamp(16px, 4.5vw, 72px);
  --header: 76px;
  --room-2: #9fb89a;
  --room-3: #e2c07f;
  --room-4: #d99873;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.6 var(--sans); }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; letter-spacing: -.03em; line-height: 1.1; margin: 0; }
h1 em, h2 em { font-style: normal; color: var(--copper); }
.eyebrow { margin: 0 0 12px; font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
:focus-visible { outline: 2px solid var(--copper); outline-offset: 3px; }

/* ---------- header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 20; height: var(--header);
  display: flex; align-items: center; gap: 24px; padding: 0 var(--gutter);
  background: rgba(251, 249, 244, .86); backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid rgba(29, 41, 35, .08);
}
.wordmark { display: flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 700; letter-spacing: .14em; font-size: 14px; line-height: 1.15; color: var(--forest); }
.wordmark small { display: block; font-size: 10px; font-weight: 500; letter-spacing: .3em; }
.mark { display: grid; place-items: center; width: 38px; height: 38px; background: var(--forest); color: var(--cream); font: 500 20px var(--serif); letter-spacing: 0; }
.nav { display: flex; gap: clamp(16px, 2.6vw, 40px); margin-left: auto; }
.nav a { text-decoration: none; font-size: 14px; font-weight: 500; padding: 8px 0; border-bottom: 1px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { border-color: var(--copper); }
.header-call { text-decoration: none; font-size: 14px; font-weight: 600; padding: 10px 16px; border: 1px solid var(--forest); color: var(--forest); white-space: nowrap; }
.header-call:hover { background: var(--forest); color: #fff; }

/* ---------- buttons ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 48px; padding: 0 22px;
  border: 0; background: var(--sand); color: var(--forest); font: 700 14px var(--sans); text-decoration: none; cursor: pointer;
  transition: background .2s;
}
.button:hover { background: #e6c3a3; }
.button.ghost { background: transparent; color: inherit; border: 1px solid currentColor; }
.button.ghost:hover { background: rgba(255, 255, 255, .1); }
.chip {
  min-height: 40px; padding: 0 14px; border: 1px solid var(--line); background: #fff; color: var(--ink);
  font: 500 13px var(--sans); cursor: pointer; transition: background .2s, color .2s, border-color .2s;
}
.chip:hover { border-color: var(--forest); }
.chip.active { background: var(--forest); border-color: var(--forest); color: #fff; }

/* ---------- home: 3D stage ---------- */
.page-home { height: 100vh; height: 100svh; overflow: hidden; background: var(--stage); }
.stage { position: fixed; inset: 0; overflow: hidden; }
.stage canvas { display: block; width: 100%; height: 100%; touch-action: none; opacity: 0; transition: opacity .8s ease; }
.stage.ready canvas { opacity: 1; }
.stage-fallback { display: none; }
.no-webgl .stage-fallback { display: block; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .35; }

.stage-intro { position: absolute; top: calc(var(--header) + 28px); left: var(--gutter); max-width: 420px; pointer-events: none; }
.stage-intro h1 { font-size: clamp(34px, 4.2vw, 60px); color: var(--forest); }
.stage-intro p:last-child { margin: 14px 0 0; font-size: 15px; color: var(--muted); }

.floor-rail { position: absolute; left: var(--gutter); bottom: 72px; display: flex; flex-direction: column; gap: 6px; }
.rail-floor {
  display: grid; grid-template-columns: 34px auto; align-items: center; gap: 10px; min-height: 42px; padding: 0 14px 0 6px;
  border: 1px solid transparent; background: rgba(255, 255, 255, .94); color: var(--ink); font: 13px var(--sans); text-align: left; cursor: pointer;
  transition: background .2s, border-color .2s;
}
.rail-floor b { font: 400 22px/1 var(--serif); color: var(--forest); text-align: center; }
.rail-floor span { color: var(--muted); }
.rail-floor:hover { border-color: var(--forest); }
.rail-floor.active { background: var(--forest); }
.rail-floor.active b, .rail-floor.active span { color: #fff; }

.floor-panel {
  position: absolute; top: calc(var(--header) + 20px); right: var(--gutter); bottom: 24px; width: min(400px, 36vw);
  overflow: auto; overscroll-behavior: contain; background: rgba(251, 249, 244, .96); box-shadow: 0 20px 60px rgba(16, 43, 37, .14);
  padding: 24px; display: flex; flex-direction: column; gap: 16px;
}
.floor-panel[hidden], .floor-panel [hidden] { display: none !important; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.panel-head h2 { font-size: 34px; color: var(--forest); }
.panel-head p { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.panel-close { width: 40px; height: 40px; flex: none; border: 1px solid var(--line); background: #fff; font-size: 22px; line-height: 1; cursor: pointer; }
.room-filter { display: flex; flex-wrap: wrap; gap: 6px; }
.apt-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.apt-item {
  display: grid; grid-template-columns: auto 1fr; gap: 0 10px; align-items: center; padding: 9px 12px;
  border: 1px solid var(--line); background: #fff; color: var(--ink); font: 12px var(--sans); text-align: left; cursor: pointer;
  transition: border-color .2s, opacity .2s;
}
.apt-item b { grid-row: span 2; font: 400 24px/1 var(--serif); color: var(--forest); }
.apt-item em { font-style: normal; font-weight: 700; }
.apt-item:hover { border-color: var(--forest); }
.apt-item.active { border-color: var(--copper); box-shadow: inset 0 0 0 1px var(--copper); }
.apt-item.dim { opacity: .35; }
.apt-item.sold { opacity: .45; cursor: not-allowed; text-decoration: line-through; }
.apt-card { background: var(--forest); color: #fff; padding: 22px; }
.apt-card .eyebrow { color: #d8c8b3; }
.apt-card h3 { font-size: 30px; }
.apt-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin: 18px 0 20px; }
.apt-card dt { font-size: 12px; color: #c9d3cc; }
.apt-card dd { margin: 2px 0 0; font-weight: 600; }
.apt-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.apt-actions .button { flex: 1 1 140px; }
.floor-note p { margin: 0 0 16px; line-height: 1.7; }
.panel-disclaimer { margin: auto 0 0; font-size: 12px; color: var(--muted); }

.stage-legend { position: absolute; left: var(--gutter); bottom: 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; font-size: 13px; color: var(--muted); pointer-events: none; }
.stage-legend i { display: inline-block; width: 12px; height: 12px; margin-right: 6px; vertical-align: -1px; }
.sw-2 { background: var(--room-2); } .sw-3 { background: var(--room-3); } .sw-4 { background: var(--room-4); } .sw-c { background: #8fb0c4; }
.stage-tip {
  position: absolute; left: 0; top: 0; z-index: 5; max-width: 280px; padding: 8px 12px; background: var(--forest); color: #fff;
  font-size: 13px; line-height: 1.4; pointer-events: none; white-space: nowrap;
}

.plan-dialog { width: min(1100px, 94vw); padding: 48px 16px 16px; border: 0; background: #fff; }
.plan-dialog::backdrop { background: rgba(7, 22, 19, .8); }
.plan-view { position: relative; }
.plan-view svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.plan-other { fill: rgba(251, 249, 244, .55); stroke: none; }
.plan-active { fill: rgba(166, 110, 85, .3); stroke: var(--copper); stroke-width: 6; }
.plan-dialog p { margin: 12px 0 0; font-weight: 600; }
.plan-dialog > button { position: absolute; top: 10px; right: 12px; min-height: 36px; border: 0; background: none; font: 600 14px var(--sans); cursor: pointer; }

/* ---------- content pages ---------- */
.page { padding-top: var(--header); }
.section { padding: clamp(56px, 8vw, 110px) var(--gutter); }
.page-hero h1 { font-size: clamp(40px, 6vw, 88px); max-width: 14ch; color: var(--forest); }
.page-hero .lead { max-width: 60ch; margin: 24px 0 0; font-size: 17px; line-height: 1.8; color: var(--muted); }
.hero-image { margin-top: clamp(32px, 5vw, 64px); aspect-ratio: 16 / 7; width: 100%; object-fit: cover; }

.facts { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.fact { padding: 28px 20px 28px 0; border-bottom: 1px solid var(--line); }
.fact strong { display: block; font: 400 clamp(38px, 4.5vw, 64px)/1 var(--serif); color: var(--forest); letter-spacing: -.04em; }
.fact span { display: block; margin-top: 10px; font-size: 14px; color: var(--muted); }

.details { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(28px, 5vw, 80px); align-items: start; }
.details h2 { font-size: clamp(32px, 4vw, 54px); color: var(--forest); }
.spec { margin: 0; border-top: 1px solid var(--line); }
.spec div { display: grid; grid-template-columns: 200px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.spec dt { font-size: 14px; color: var(--muted); }
.spec dd { margin: 0; font-weight: 500; }

.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(12px, 2vw, 24px); }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

.cta { background: var(--forest); color: #fff; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 24px; }
.cta h2 { font-size: clamp(30px, 4vw, 52px); }
.cta h2 em { color: var(--sand); }

.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.contact-list { list-style: none; margin: 32px 0 0; padding: 0; border-top: 1px solid var(--line); }
.contact-list li { padding: 16px 0; border-bottom: 1px solid var(--line); }
.contact-list span { display: block; font-size: 13px; color: var(--muted); }
.contact-list a, .contact-list strong { font: 500 20px var(--sans); text-decoration: none; }
.contact-list a:hover { color: var(--copper); }
.form { background: var(--forest); color: #fff; padding: clamp(24px, 3.5vw, 44px); display: grid; gap: 18px; }
.form label { display: grid; gap: 8px; font-size: 14px; color: #dbe3de; }
.form input, .form select {
  width: 100%; min-height: 50px; padding: 0 14px; border: 1px solid rgba(255, 255, 255, .3); background: rgba(255, 255, 255, .06);
  color: #fff; font: 16px var(--sans);
}
.form select option { color: var(--ink); }
.form input::placeholder { color: rgba(255, 255, 255, .45); }
.form .button { width: 100%; margin-top: 6px; }
.form-note { margin: 0; font-size: 13px; color: #c9d3cc; }

.footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding: 28px var(--gutter); background: var(--forest); color: #c9d3cc; font-size: 13px; }
.footer a { text-decoration: none; }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .facts { grid-template-columns: repeat(2, 1fr); }
  .details, .contact-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  :root { --header: 64px; }
  .site-header { gap: 12px; }
  .wordmark > span:last-child { display: none; }
  .mark { width: 32px; height: 32px; font-size: 17px; }
  .nav { gap: 14px; } .nav a { font-size: 13px; }
  .header-call { display: none; }

  .stage-intro { top: calc(var(--header) + 16px); right: var(--gutter); }
  .stage-intro h1 { font-size: 32px; }
  .stage-intro p:last-child { font-size: 14px; }
  .floor-rail { left: 0; right: 0; bottom: 16px; flex-direction: row; overflow-x: auto; padding: 0 var(--gutter); scrollbar-width: none; }
  .rail-floor { grid-template-columns: auto; justify-items: center; gap: 2px; min-width: 64px; padding: 6px 8px; flex: none; }
  .rail-floor span { font-size: 11px; white-space: nowrap; }
  .stage-legend { display: none; }
  .has-floor .stage-intro { display: none; }
  .has-floor .floor-rail { display: none; }
  .floor-panel { top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 46svh; padding: 18px 16px; box-shadow: 0 -12px 40px rgba(16, 43, 37, .18); }
  .panel-head h2 { font-size: 28px; }

  .spec div { grid-template-columns: 1fr; gap: 2px; }
  .gallery { grid-template-columns: 1fr; }
  .fact strong { font-size: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}
.contact-title { font-size: clamp(40px, 5vw, 72px); color: var(--forest); }
.form .eyebrow { color: #d8c8b3; }
.page-hero + .section { padding-top: 0; }
.has-floor .stage-intro { opacity: 0; transition: opacity .3s; }

/* view controls on the 3D stage */
.view-controls { position: absolute; right: var(--gutter); bottom: 24px; display: flex; gap: 6px; transition: right .3s ease; }
.view-controls button {
  min-width: 44px; min-height: 44px; padding: 0 14px; border: 1px solid rgba(29, 41, 35, .12); background: rgba(255, 255, 255, .86);
  color: var(--forest); font: 600 13px var(--sans); cursor: pointer; transition: background .2s, color .2s;
}
.view-controls button:hover { background: var(--forest); color: #fff; }
.view-controls button[data-view="left"], .view-controls button[data-view="right"] { font-size: 20px; padding: 0; }
.has-floor .view-controls { right: calc(var(--gutter) + min(400px, 36vw) + 16px); }
@media (max-width: 760px) {
  .view-controls { top: calc(var(--header) + 12px); bottom: auto; right: 12px; flex-direction: column; }
  .view-controls button { min-width: 44px; padding: 0 8px; font-size: 11px; }
  .has-floor .view-controls { right: 12px; }
  .stage-intro { right: 72px; }
}

/* apartment letters projected from 3D */
.stage-pins { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.apt-pin {
  position: absolute; left: 0; top: 0; width: 30px; height: 30px; border: 2px solid #fff; border-radius: 50%;
  display: grid; place-items: center; background: var(--forest); color: #fff; font: 700 14px/1 var(--sans);
  box-shadow: 0 4px 12px rgba(16, 43, 37, .25); pointer-events: auto; cursor: pointer; padding: 0;
  transition: background .2s, opacity .2s, width .2s, height .2s;
}
.apt-pin:hover { background: var(--forest-2); }
.apt-pin.active { width: 38px; height: 38px; background: var(--copper); font-size: 17px; }
.apt-pin.dim { opacity: .25; pointer-events: none; }
.apt-pin[hidden] { display: none; }

.floor-panel, .floor-rail, .view-controls, .stage-intro { z-index: 2; }

/* loading screen on the 3D stage (pure HTML/CSS, shown before model.js arrives) */
.stage-loader {
  position: absolute; inset: 0; z-index: 5; display: grid; place-content: center; justify-items: center; gap: 18px;
  background: var(--stage); color: var(--forest); transition: opacity .7s ease, visibility .7s;
}
.stage-loader .mark { width: 56px; height: 56px; font-size: 28px; animation: loader-pulse 1.6s ease-in-out infinite; }
.stage-loader p { margin: 0; font-size: 14px; font-weight: 500; color: var(--muted); }
.loader-bar { width: 200px; height: 3px; background: rgba(16, 43, 37, .12); overflow: hidden; }
.loader-bar i { display: block; height: 100%; width: 8%; background: var(--copper); transition: width .4s ease; }
.stage.ready .stage-loader, .no-webgl .stage-loader { opacity: 0; visibility: hidden; }
@keyframes loader-pulse { 50% { transform: scale(.92); opacity: .75; } }
@media (prefers-reduced-motion: reduce) { .stage-loader .mark { animation: none; } }
@media (prefers-reduced-motion: reduce) { .view-controls { transition: none; } }
