/* ============================================================================
   VELA REAL ESTATE — concept demo for Swiss Web Bureau
   World: the concierge key board of a grand lakeside hotel. Oxblood lacquer,
   brass, bone enamel. Every property is a key on a hook; taking the key IS
   requesting a private viewing, and the hook's state is the property's state.
   Self-contained: local fonts, no CDN, no framework, no third-party script.
   ========================================================================== */

@font-face {
  font-family: "Bodoni Moda";
  src: url("../_fonts/bodonimoda-var.woff2") format("woff2-variations");
  font-weight: 400 900;
  font-display: swap;
}
@font-face {
  font-family: "Karla";
  src: url("../_fonts/karla-var.woff2") format("woff2-variations");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --lacquer-950: #150708;
  --lacquer-900: #230d10;
  --lacquer-850: #2e1215;
  --lacquer-800: #3a171b;
  --lacquer-700: #4d2126;

  --brass: #c69a5c;
  --brass-lo: #8d6a3a;
  --brass-hi: #e8cd9a;

  --bone: #ece2d0;
  --bone-2: #d8c9b2;

  --ink: #f2e9dd;
  --ink-2: #c8b3a3;
  --ink-3: #9c8477;

  --line: rgba(198, 154, 92, 0.24);
  --line-strong: rgba(198, 154, 92, 0.52);

  --sp: clamp(20px, 4.4vw, 72px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  /* a tag hanging on a hook really does overswing before it settles; kept to a
     single gentle pendulum return rather than a spring bounce */
  --swing: cubic-bezier(0.28, 1.18, 0.52, 1);
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--lacquer-900);
  color: var(--ink);
  font-family: "Karla", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.66;
  font-weight: 400;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* the lacquer itself: a deep polished ground with a slow sheen across it */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 80% at 15% -10%, rgba(198, 154, 92, 0.11), transparent 60%),
    radial-gradient(90% 70% at 95% 105%, rgba(120, 30, 34, 0.42), transparent 62%);
}
main, header, footer { position: relative; z-index: 1; }

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--brass-hi); outline-offset: 3px; }

.wrap { width: 100%; max-width: 1400px; margin-inline: auto; padding-inline: var(--sp); }

/* --- typography ---------------------------------------------------------- */

.display {
  font-family: "Bodoni Moda", Georgia, serif;
  font-weight: 500;
  /* Bodoni is a didone: at display size its optical-size axis must be driven to
     the high end, or the variable font renders the text-grade instance and the
     engraved hairlines never appear. */
  font-optical-sizing: auto;
  font-variation-settings: "opsz" 88;
  letter-spacing: -0.012em;
  line-height: 0.98;
  text-wrap: balance;
}
h3, .ledger th { font-variation-settings: "opsz" 40; }
h1.display { font-size: clamp(2.8rem, 7.6vw, 6rem); }
h2.display { font-size: clamp(2rem, 4.8vw, 3.8rem); }
h3 { font-family: "Bodoni Moda", Georgia, serif; font-weight: 500; font-size: clamp(1.35rem, 2.3vw, 1.9rem); line-height: 1.12; }

.lede { font-size: clamp(1.05rem, 1.5vw, 1.25rem); line-height: 1.6; color: var(--ink-2); max-width: 46ch; }
p { max-width: 64ch; }
.dim { color: var(--ink-2); }

/* the engraved voice of a brass plate */
.plate-text {
  font-size: 0.7rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--brass);
  font-weight: 600;
}
.meta { font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }
.tab { font-variant-numeric: tabular-nums; }

/* --- header -------------------------------------------------------------- */

.site-head {
  position: fixed; inset: 0 0 auto 0; z-index: 60;
  background: linear-gradient(to bottom, var(--lacquer-900) 44%, transparent);
  border-bottom: 1px solid transparent;
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease);
}
.site-head.is-stuck {
  background: rgba(35, 13, 16, 0.94);
  backdrop-filter: blur(10px) saturate(150%);
  border-bottom-color: var(--line);
}
.head-bar { display: flex; align-items: center; justify-content: space-between; gap: 22px; height: 86px; }

.brand {
  font-family: "Bodoni Moda", Georgia, serif;
  font-size: 1.55rem; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase;
}
.brand b { color: var(--brass); font-weight: 600; }

.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  padding: 10px 16px; font-size: 0.76rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-2); position: relative;
  transition: color 0.3s var(--ease);
}
.nav a::after {
  content: ""; position: absolute; left: 16px; right: 16px; bottom: 4px; height: 1px;
  background: var(--brass); transform: scaleX(0); transform-origin: left;
  transition: transform 0.5s var(--ease);
}
.nav a:hover { color: var(--ink); }
.nav a:hover::after { transform: scaleX(1); }
.nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"]::after { transform: scaleX(1); }

.menu-btn {
  display: none; width: 46px; height: 46px; align-items: center; justify-content: center;
  background: none; border: 1px solid var(--line-strong); color: var(--ink); cursor: pointer;
}
.menu-btn svg { width: 20px; height: 20px; }
.menu-btn .x { display: none; }
.menu-btn[aria-expanded="true"] .x { display: block; }
.menu-btn[aria-expanded="true"] .b { display: none; }

@media (max-width: 940px) {
  .nav {
    position: fixed; inset: 86px 0 auto 0; flex-direction: column; align-items: stretch; gap: 0;
    background: rgba(21, 7, 8, 0.985); border-block: 1px solid var(--line);
    padding: 10px var(--sp) 26px;
    opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: opacity 0.32s var(--ease), transform 0.32s var(--ease), visibility 0.32s;
  }
  .nav.is-open { opacity: 1; visibility: visible; transform: none; }
  .nav a { padding: 16px 0; font-size: 0.92rem; border-bottom: 1px solid var(--line); }
  .nav a::after { display: none; }
  .menu-btn { display: inline-flex; }
}

/* --- hero ---------------------------------------------------------------- */

.hero { position: relative; min-height: 100svh; display: flex; align-items: flex-end; padding-bottom: clamp(40px, 6vw, 84px); overflow: hidden; }
.hero-media { position: absolute; inset: 0; z-index: 0; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; }
/* the lacquer scrim: the view seen from inside a dark panelled room */
.hero-media::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(to top, rgba(21, 7, 8, 0.96) 4%, rgba(21, 7, 8, 0.34) 46%, rgba(21, 7, 8, 0.72) 100%),
    linear-gradient(to right, rgba(35, 13, 16, 0.7), transparent 55%);
}
.hero-inner { position: relative; z-index: 2; width: 100%; padding-top: 140px; }
.hero-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; flex-wrap: wrap; margin-top: clamp(26px, 3.4vw, 44px); }

/* --- the key board ------------------------------------------------------- */

.board { margin-top: clamp(30px, 4vw, 54px); }

/* One continuous brass rail runs the full width above each row of the board.
   This is the photographed rail, not a drawn approximation of one. */
.rail {
  height: 30px;
  background-image: url("img/rail.webp");
  background-size: auto 100%;
  background-repeat: repeat-x;
  background-position: center;
  margin-bottom: 36px;
  box-shadow: 0 12px 22px -16px rgba(0, 0, 0, 0.95);
}
.rail + .rack { margin-bottom: clamp(34px, 4.4vw, 62px); }

.rack { display: grid; gap: clamp(20px, 2.6vw, 34px); }
@media (min-width: 760px) { .rack { grid-template-columns: repeat(2, 1fr); } }

/* a pigeonhole: a recessed compartment in the rack */
.hole {
  position: relative;
  background-color: var(--lacquer-850);
  /* the lacquered panel the compartment is cut into */
  background-image: url("img/lacquer.webp");
  background-size: 620px auto;
  background-blend-mode: overlay;
  border: 1px solid var(--line);
  padding: 16px 16px 22px;
  box-shadow: inset 0 2px 14px rgba(0, 0, 0, 0.6), inset 0 -1px 0 rgba(198, 154, 92, 0.14);
  transition: border-color 0.45s var(--ease), transform 0.55s var(--ease);
}
.hole:hover { border-color: var(--line-strong); }
@media (hover: hover) { .hole:hover { transform: translateY(-3px); } }

.hole-img { position: relative; overflow: hidden; aspect-ratio: 4 / 3; background: var(--lacquer-950); }
.hole-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease), filter 0.6s var(--ease); }
.hole:hover .hole-img img { transform: scale(1.045); }

/* the bone enamel key tag, hanging from the rail above its compartment */
.tag {
  position: absolute;
  top: -21px; right: 26px; z-index: 4;
  min-width: 54px;
  padding: 9px 11px 10px;
  /* real vitreous enamel, not a gradient pretending to be one: the photograph
     carries the crazing and sheen, the gradient only supplies the vertical falloff */
  background-color: var(--bone);
  background-image: url("img/enamel.webp"), linear-gradient(180deg, var(--bone) 0%, var(--bone-2) 100%);
  background-size: 150px 150px, auto;
  background-blend-mode: multiply, normal;
  color: var(--lacquer-900);
  text-align: center;
  transform-origin: 50% -14px;
  box-shadow: 0 10px 20px -10px rgba(0, 0, 0, 0.9);
  transition: transform 0.7s var(--swing), box-shadow 0.5s var(--ease);
}
.tag::before {
  /* the eyelet the hook passes through */
  content: "";
  position: absolute; top: 4px; left: 50%; transform: translateX(-50%);
  width: 9px; height: 9px; border-radius: 50%;
  border: 1px solid rgba(35, 13, 16, 0.45);
  background: var(--lacquer-850);
}
.tag .n {
  display: block; margin-top: 11px;
  font-family: "Bodoni Moda", Georgia, serif; font-weight: 700; font-size: 1.05rem; line-height: 1;
  letter-spacing: 0.02em;
}
.tag .u { display: block; font-size: 0.5rem; letter-spacing: 0.2em; text-transform: uppercase; color: #6b4a3f; margin-top: 3px; }

@media (hover: hover) {
  .hole:hover .tag { transform: rotate(-7deg) translateY(3px); box-shadow: 0 16px 26px -12px rgba(0, 0, 0, 0.95); }
}

.hole-body { padding-top: 20px; }
.hole-body h3 { transition: color 0.35s var(--ease); }
.hole:hover .hole-body h3 { color: var(--brass-hi); }
.hole-line {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line);
}
.hole a.cover::after { content: ""; position: absolute; inset: 0; z-index: 5; }

/* --- the three real states of a key on the board ------------------------- */

.hole[data-state="trattativa"] .tag { transform: rotate(-13deg); background: linear-gradient(180deg, #e3d3b6, #cdb894); }
.hole[data-state="trattativa"] .hole-img img { filter: saturate(0.82); }

/* sold: the tag is gone and the hook is bare — the empty state is designed.
   The photograph carries the whole "retired" signal; never fade the container,
   because compositing the text at partial opacity drops it below AA. */
.hole[data-state="venduto"] .tag { display: none; }
.hole[data-state="venduto"] .hole-img img { filter: saturate(0.18) brightness(0.58); }
.hole[data-state="venduto"] .hole-img::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(21, 7, 8, 0.34), rgba(21, 7, 8, 0.52));
}
.hole[data-state="venduto"]:hover { transform: none; }
.hole[data-state="venduto"]:hover .hole-img img { transform: none; }

.state {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.66rem; letter-spacing: 0.18em; text-transform: uppercase; font-weight: 600;
}
.state::before { content: ""; width: 6px; height: 6px; border-radius: 50%; flex: none; }
.state.libero { color: var(--brass-hi); }
.state.libero::before { background: var(--brass-hi); box-shadow: 0 0 8px 1px rgba(232, 205, 154, 0.6); }
.state.trattativa { color: #e0a06c; }
.state.trattativa::before { background: #e0a06c; }
.state.venduto { color: var(--ink-3); }
.state.venduto::before { background: var(--ink-3); }

/* --- sections ------------------------------------------------------------ */

section { padding-block: clamp(70px, 9.5vw, 148px); }
.sec-head { margin-bottom: clamp(32px, 4.4vw, 60px); }
/* .plate-text is a column label in the footer and the aside, never an eyebrow
   above a heading — headings carry their own weight. */

.duo { display: grid; gap: clamp(30px, 4.4vw, 68px); align-items: center; }
@media (min-width: 940px) { .duo { grid-template-columns: 1fr 1fr; } }

.figure { position: relative; overflow: hidden; border: 1px solid var(--line); }
.figure img { width: 100%; height: 100%; object-fit: cover; }
.figure figcaption { padding-top: 14px; }

/* --- the service list, engraved as plate lines --------------------------- */

.services { border-top: 1px solid var(--line-strong); }
.service {
  display: grid; gap: 10px 44px; padding: clamp(24px, 3vw, 38px) 0;
  border-bottom: 1px solid var(--line);
}
@media (min-width: 880px) { .service { grid-template-columns: 60px minmax(0, 1fr) minmax(0, 1.25fr); align-items: start; } }
/* below the desktop grid the numeral rides beside its heading rather than
   stacking above it, which would read as an eyebrow */
@media (min-width: 620px) and (max-width: 879px) {
  .service { grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; }
  .service > .num { grid-column: 2; grid-row: 1; text-align: right; }
  .service > h3 { grid-column: 1; grid-row: 1; }
  .service > p { grid-column: 1 / -1; grid-row: 2; }
}
/* on a narrow phone the numeral gets its own line UNDER the heading: beside it
   would crush the heading measure, above it would be an eyebrow */
@media (max-width: 619px) {
  .service { grid-template-columns: minmax(0, 1fr); }
  .service > h3 { order: 1; }
  .service > .num { order: 2; }
  .service > p { order: 3; }
}
.service .num { font-family: "Bodoni Moda", Georgia, serif; font-size: 1.4rem; color: var(--brass); line-height: 1; }

/* --- the ledger: how an agency actually records its mandates ------------- */

.ledger { width: 100%; border-collapse: collapse; margin-top: 44px; text-align: left; }
.ledger caption { text-align: left; padding-bottom: 14px; }
.ledger th, .ledger td { padding: 13px 0; border-bottom: 1px solid var(--line); vertical-align: baseline; }
.ledger td:first-child { color: var(--brass); font-size: 0.86rem; width: 4.5rem; }
.ledger th { font-family: "Bodoni Moda", Georgia, serif; font-weight: 500; font-size: 1.05rem; color: var(--ink); padding-right: 22px; }
.ledger td:last-child { color: var(--ink-2); font-size: 0.84rem; letter-spacing: 0.1em; text-transform: uppercase; text-align: right; white-space: nowrap; }
@media (max-width: 620px) {
  .ledger tr { display: grid; grid-template-columns: 4.5rem 1fr; gap: 0 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
  .ledger th, .ledger td { border: 0; padding: 0; }
  .ledger td:first-child { grid-row: 1; }
  .ledger th { grid-column: 2; grid-row: 1; }
  .ledger td:last-child { grid-column: 2; grid-row: 2; text-align: left; margin-top: 5px; white-space: normal; }
}

/* --- buttons ------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 11px;
  min-height: 52px; padding: 14px 30px;
  font-size: 0.76rem; letter-spacing: 0.18em; text-transform: uppercase; font-weight: 600;
  border: 1px solid var(--brass); color: var(--lacquer-950); background: var(--brass);
  cursor: pointer;
  transition: background 0.35s var(--ease), color 0.35s var(--ease), border-color 0.35s var(--ease), transform 0.2s var(--ease);
}
.btn:hover { background: var(--brass-hi); border-color: var(--brass-hi); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn.ghost:hover { background: rgba(198, 154, 92, 0.12); border-color: var(--brass); color: var(--ink); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; transform: none; }

.link {
  display: inline-flex; align-items: center; gap: 11px;
  font-size: 0.74rem; letter-spacing: 0.18em; text-transform: uppercase; font-weight: 600;
  color: var(--brass); padding-bottom: 5px; border-bottom: 1px solid var(--line-strong);
  transition: gap 0.4s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.link:hover { gap: 17px; color: var(--brass-hi); border-color: var(--brass); }
.link svg { width: 15px; flex: none; }

/* --- form (private viewing request) -------------------------------------- */

.form-grid { display: grid; gap: clamp(28px, 4vw, 60px); align-items: start; }
@media (min-width: 1000px) { .form-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.9fr); } }

.field { margin-bottom: 20px; }
.field label { display: block; font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 9px; font-weight: 600; }
.field .req { color: #e0785c; }
.field input, .field textarea, .field select {
  width: 100%; min-height: 52px; padding: 14px 16px;
  font: inherit; font-size: 1rem; color: var(--ink);
  background: rgba(21, 7, 8, 0.6); border: 1px solid var(--line-strong);
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease);
}
.field textarea { min-height: 118px; resize: vertical; }
.field select { appearance: none; background-image: none; cursor: pointer; }
.field option { background: var(--lacquer-850); color: var(--ink); }
.field input:focus, .field textarea:focus, .field select:focus { outline: 0; border-color: var(--brass); background: rgba(21, 7, 8, 0.85); }
.field input::placeholder, .field textarea::placeholder { color: var(--ink-3); }
.field .hint { display: block; color: var(--ink-3); font-size: 0.84rem; margin-top: 7px; }
.field .err { display: none; color: #e0785c; font-size: 0.86rem; margin-top: 8px; }
.field.is-bad input, .field.is-bad textarea, .field.is-bad select { border-color: #e0785c; }
.field.is-bad .err { display: block; }
.field-2 { display: grid; gap: 0 20px; }
@media (min-width: 640px) { .field-2 { grid-template-columns: 1fr 1fr; } }

.alert {
  display: none; gap: 12px; align-items: flex-start;
  padding: 15px 17px; margin-bottom: 24px;
  background: rgba(224, 120, 92, 0.12); border: 1px solid rgba(224, 120, 92, 0.5);
  color: #f0b4a2; font-size: 0.93rem;
}
.alert.is-on { display: flex; }
.alert svg { width: 19px; flex: none; margin-top: 2px; }

.aside-card { border: 1px solid var(--line); background: var(--lacquer-850); padding: 26px; }
.aside-card dl { display: grid; gap: 15px; margin-top: 20px; }
.aside-card dt { font-size: 0.66rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-3); }
.aside-card dd { margin-top: 3px; }

.done { display: none; }
.done.is-on { display: block; }
form.is-sent { display: none; }
.done-mark {
  width: 60px; height: 60px; display: grid; place-items: center; margin-bottom: 24px;
  border: 1px solid var(--brass); color: var(--brass);
}
.done-mark svg { width: 26px; }

/* --- footer -------------------------------------------------------------- */

.site-foot { padding-block: clamp(58px, 7vw, 100px) 42px; border-top: 1px solid var(--line); }
.foot-grid { display: grid; gap: 38px; }
@media (min-width: 820px) { .foot-grid { grid-template-columns: 1.7fr 1fr 1fr; gap: 46px; } }
.foot-grid a.block, .foot-grid span.block { display: block; color: var(--ink-2); margin-top: 9px; font-size: 0.95rem; }
.foot-grid a.block:hover { color: var(--brass-hi); }
.foot-fine { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: clamp(46px, 6vw, 80px); padding-top: 22px; border-top: 1px solid var(--line); }

/* --- concept provenance badge ------------------------------------------- */

.concept-badge {
  position: fixed; left: 14px; bottom: 14px; z-index: 70;
  display: inline-flex; align-items: center; gap: 9px; padding: 9px 13px;
  background: var(--lacquer-950); border: 1px solid var(--line-strong);
  font-size: 0.55rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-2);
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease);
}
.concept-badge:hover { color: var(--ink); border-color: var(--brass); }
.concept-badge b { color: var(--brass-hi); font-weight: 600; }
.concept-badge .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--brass); flex: none; }
@media (max-width: 560px) { .concept-badge { font-size: 0.5rem; padding: 7px 10px; } }

/* --- motion: the key is taken down from the board ----------------------- */

/* Content is visible by default. Script arms the hidden state only once it is
   running, so a JS failure leaves a complete readable page rather than a blank one. */
[data-take] { transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
[data-take].is-armed { opacity: 0; transform: translateY(22px); }
/* the tags settle with a swing rather than a fade */
.hole[data-take] .tag { transition: transform 1.1s var(--swing) 0.15s; }
.hole[data-take].is-armed .tag { transform: rotate(-15deg); transition: none; }

@media (prefers-reduced-motion: reduce) {
  [data-take], [data-take].is-armed { opacity: 1 !important; transform: none !important; transition: none; }
  .hole[data-take] .tag, .hole[data-take].is-armed .tag { transition: none; }
  .hole[data-state="trattativa"] .tag { transform: rotate(-13deg); }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

.skip { position: absolute; left: -9999px; top: 0; z-index: 100; padding: 12px 18px; background: var(--brass); color: var(--lacquer-950); font-weight: 700; }
.skip:focus { left: 12px; top: 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
