/* KW RED design system, layer 2: scales and shared components.
 *
 * Colours stay in app.css (the published `themes` rows override them), so this
 * file defines no colour. It adds the type, space, radius, layout and depth
 * scales that pages should use instead of literal values, then the shared
 * components built on them. Every var() here falls back to a value that
 * works on pages that do not load app.css.
 *
 * docs/design/UI_UX_UPGRADE_PLAN.md is the plan; the kwred-ui-system skill is
 * the working rulebook. scripts/audit_ui_consistency.py counts drift. */

:root {
  /* Type. Display sizes scale with the viewport, running text does not. */
  --fs-xs: 12px;
  --fs-sm: 14px;
  --fs-md: 16px;
  --fs-lg: 18px;
  --fs-xl: 22px;
  --fs-2xl: 28px;
  --fs-3xl: 36px;
  --fs-4xl: clamp(34px, 5vw, 48px);
  --fs-5xl: clamp(44px, 8vw, 84px);

  /* Space, on a 4px base. */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-7: 32px;
  --s-8: 48px;
  --s-9: 64px;
  --s-10: 96px;

  /* Radius by role. Each role aliases a token a published theme can set. */
  --r-control: var(--r-sm, 10px);
  --r-card: var(--r-md, 18px);
  --r-media: var(--r-sm, 10px);
  --r-sheet: var(--r-lg, 28px);

  /* Layout. */
  --page-max: 1320px;
  --gutter: clamp(16px, 3vw, 40px);
  --section-y: clamp(40px, 6vw, 72px);

  /* Motion. Controls answer in 140 to 360ms; depth settles over about 500ms. */
  --ease-exit: cubic-bezier(.4, 0, 1, 1);
  --dur-depth: .5s;

  /* Depth layers: where each part of a 3D stack sits in front of the photo. */
  --z-floor: -60px;
  --z-back: -30px;
  --z-subject: 0px;
  --z-label: 28px;
  --z-float: 60px;
}

/* site-shell:css:start */
header.kw-header{position:sticky;top:0;z-index:50;display:block;height:auto;gap:0;padding:env(safe-area-inset-top) 0 0;background:var(--paper);color:var(--ink);border:0;border-block-end:1px solid var(--line)}
.site-header-inner{max-width:1440px;margin:0 auto;height:64px;display:flex;align-items:center;gap:16px;padding-inline:16px}
.site-logo{display:inline-flex;align-items:center;flex:none;min-block-size:44px;min-inline-size:44px;padding:.4em;margin-inline-start:-.4em;color:inherit;text-decoration:none}.site-logo img{height:36px;width:auto;background:none}
[data-theme="dark"] .kw-header .site-logo img[src*="kwred-dark"]{content:url(/assets/brand/kwred-white.svg)}
.site-nav{display:none}.site-cta{display:none}
.kw-header .header-actions{display:contents}
.lang-switch{margin-inline-start:auto;min-width:44px;min-height:44px;display:inline-grid;place-items:center;font-weight:700;font-size:13px;letter-spacing:.08em;color:var(--ink);text-decoration:none}
.lang-switch:hover{color:var(--brand-ink);text-decoration:none}
/* One header: every theme toggle is a flat 44px icon button, whichever page shell drew it. */
.kw-header :is(.seo-iconbtn,.theme-trigger,.mi-iconbtn){border:0;border-radius:0;background:transparent}
.menu-button{min-width:44px;min-height:44px;display:inline-grid;place-items:center;padding:0;background:none;border:1.5px solid var(--ink);border-radius:0;color:var(--ink);cursor:pointer}
.menu-button svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}
.site-sheet{position:fixed;inset:0;z-index:900;background:var(--paper);color:var(--ink);padding:calc(16px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom));overflow-y:auto;overscroll-behavior:contain}
.site-sheet[hidden]{display:none}
.kw-header :focus-visible,.site-sheet :focus-visible{outline:2px solid var(--focus,var(--brand-ink));outline-offset:2px}
.sheet-top{display:flex;align-items:center;justify-content:space-between;height:48px;margin-bottom:16px}
.site-sheet a{display:flex;align-items:center;min-height:48px;border-block-end:1px solid var(--line);font-size:16px;color:var(--ink);text-decoration:none}
.site-sheet .sheet-top a{border:0}
.site-sheet a.sheet-hub{min-height:56px;font-size:20px;font-weight:700}
.site-sheet a.sheet-sub{padding-inline-start:16px;color:var(--ink-soft)}
.site-sheet a.sheet-lang{justify-content:space-between;font-weight:600}
.site-sheet a.sheet-cta{justify-content:center;gap:10px;margin-top:24px;min-height:52px;border:0;background:var(--kw-red);color:#fff;font-size:13px;font-weight:700;letter-spacing:.06em;text-transform:uppercase}
html[lang=ar] .site-sheet a.sheet-cta,html[lang=ar] .site-cta{letter-spacing:0;font-size:15px}
html[lang=ar] .lang-switch{letter-spacing:0}
.kw-header .theme-trigger{min-width:44px;min-height:44px}
.kw-header .account-trigger{min-width:44px;min-height:44px}
body.sheet-open{overflow:hidden}
body.sheet-open :is(.re-bar,.rsa-launcher,#assistant-launcher,.kwred-follow,.kwred-consent-revise,#public-lead-cta,.public-contact-dock,.rsa-root){display:none!important}
header.kw-header[data-variant="on-red"]{background:var(--kw-red);color:#fff;border-color:var(--kw-red)}
header.kw-header.is-scrolled{border:0;border-block-end:1px solid var(--line)}
.kw-header[data-variant="on-red"] .lang-switch,.kw-header[data-variant="on-red"] .menu-button,.kw-header[data-variant="on-red"] :is(.seo-iconbtn,.theme-trigger,.mi-iconbtn){color:#fff;border-color:#fff}
.kw-header[data-variant="on-red"] .site-cta{background:#fff;color:var(--kw-red)}
.kw-header[data-variant="on-red"] .re-nav-item>a{color:#fff}
.kw-header[data-variant="on-red"] .site-sheet{color:var(--ink)}
.re-nav a[hidden]{display:none!important}
@media (min-width:768px){.site-header-inner{padding-inline:24px}}
@media (min-width:1024px){
.site-header-inner{padding-inline:clamp(32px,4vw,72px)}
.site-logo img{height:44px}
.site-sheet{display:none}
.site-nav{display:flex;flex:0 1 auto;align-items:center;gap:2px;min-width:0;margin-inline-start:16px}
.site-cta{display:inline-flex;align-items:center;gap:8px;min-height:44px;padding-inline:16px;background:var(--kw-red);color:#fff;font-weight:700;font-size:12px;letter-spacing:.06em;text-transform:uppercase;text-decoration:none;white-space:nowrap}
.site-cta:hover{background:var(--kw-charcoal);color:#fff;text-decoration:none}
.menu-button{display:none}
.re-nav-item{position:relative}
.re-nav-item>a{display:inline-flex;align-items:center;gap:6px;min-height:44px;padding:0 12px;color:var(--ink);font:600 14px/1 var(--font-latin);letter-spacing:.02em;text-decoration:none;white-space:nowrap}
html[lang=ar] .re-nav-item>a{font-family:var(--font-arabic);letter-spacing:0}
.re-nav-item>a::after{content:"";width:6px;height:6px;margin-top:-3px;border:solid currentColor;border-width:0 1.5px 1.5px 0;transform:rotate(45deg);opacity:.55}
.re-nav-item:hover>a,.re-nav-item:focus-within>a,.re-nav-item>a[aria-current=true]{color:var(--brand-ink);text-decoration:none}
.re-nav-fly{position:absolute;z-index:60;inset-inline-start:0;top:100%;display:none;gap:2px;min-width:230px;padding:8px;border:1px solid var(--line);background:var(--paper)}
.re-nav-item:hover .re-nav-fly,.re-nav-item:focus-within .re-nav-fly{display:grid}
.re-nav-item[data-dismissed] .re-nav-fly{display:none}
.re-nav-fly a{display:flex;align-items:center;min-height:44px;padding:0 12px;color:var(--ink);font:600 14px/1.2 var(--font-latin);text-decoration:none}
html[lang=ar] .re-nav-fly a{font-family:var(--font-arabic)}
.re-nav-fly a:hover,.re-nav-fly a:focus-visible,.re-nav-fly a[aria-current=true]{background:var(--surface-inset);color:var(--brand-ink);text-decoration:none}
}
/* Phones: a 48px lockup keeps the KELLERWILLIAMS line at least 9px tall (owner fix 2026-11-08). */
@media(max-width:767px){.site-logo{padding:0;margin-inline-start:0}.site-logo img{height:48px}}
@media(max-width:360px){.site-header-inner{gap:6px;padding-inline:10px}}
.re-bar{display:none}
@media(max-width:767px){
:root:has(.re-bar){--bar-h:calc(58px + env(safe-area-inset-bottom,0px))}
body:has(.re-bar){padding-bottom:var(--bar-h)}
.re-bar{position:fixed;z-index:62;inset:auto 0 0 0;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));padding:0 max(4px,env(safe-area-inset-right,0px)) env(safe-area-inset-bottom,0px) max(4px,env(safe-area-inset-left,0px));border-top:1px solid var(--line);background: var(--paper);}
.re-bar-item{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-height:57px;padding:6px 2px;color:var(--muted);font:600 11px/1.1 var(--font-latin);text-decoration:none;-webkit-tap-highlight-color:transparent}
.re-bar-item svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.re-bar-item[aria-current=page]{color:var(--brand-ink)}
.re-bar-item:hover{color:var(--ink);text-decoration:none}
.re-bar-item:focus-visible{outline:2px solid var(--focus,var(--brand-ink));outline-offset:-4px;border-radius:12px}
body:has(.re-bar) .rsa-launcher{display:none}
body:has(.re-bar) .kwred-consent-revise{bottom:calc(var(--bar-h) + 12px)}
body:has(.re-bar) .kwred-follow{bottom:calc(var(--bar-h) + 84px)}
body:has(.sticky-cta.is-visible,.pc-dock[data-show="true"][data-ready="true"],dialog[open],input:focus,textarea:focus,select:focus) .re-bar{display:none}
}
@media(max-height:480px){.re-bar{display:none!important}}
@media print{.re-bar{display:none!important}}
/* site-shell:css:end */

/* Depth stack: a perspective stage whose layers keep their own depth.
   The stage carries data-depth (kwred-depth.js writes --depth-x/--depth-y);
   this class says what rotates. */
.re-stack {
  position: relative;
  perspective: 1500px;
}
.re-stack-plane {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform: rotateX(var(--depth-y, 0deg)) rotateY(var(--depth-x, -4deg));
  transition: transform .55s var(--ease, cubic-bezier(.2, .8, .2, 1));
}
.re-stack.is-moving .re-stack-plane { transition-duration: 140ms; }
[dir="rtl"] .re-stack-plane { transform: rotateX(var(--depth-y, 0deg)) rotateY(calc(var(--depth-x, -4deg) * -1)); }
.re-layer { transform: translateZ(var(--z-subject)); }
.re-layer[data-layer="floor"] { transform: translateZ(var(--z-floor)); }
.re-layer[data-layer="back"] { transform: translateZ(var(--z-back)); }
.re-layer[data-layer="label"] { transform: translateZ(var(--z-label)); }
.re-layer[data-layer="float"] { transform: translateZ(var(--z-float)); }

@media (prefers-reduced-motion: reduce) {
  .re-stack-plane, .re-stack.is-moving .re-stack-plane { transform: none; transition: none; }
  .re-layer { transform: none !important; }
}

/* Card: one anatomy for every catalog tile (price, title, details, action).
   The photo rests on a tilted plane and flattens on hover or focus; the whole
   card tilts with the pointer through the depth engine (data-depth="card");
   a phone has no pointer, so the resting plane and shadow carry the depth. */
.re-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  transform: perspective(1000px) rotateX(calc(var(--depth-y, 0deg) + var(--rv-rx, 0deg))) rotateY(var(--depth-x, 0deg));
  transition: transform .4s var(--ease, cubic-bezier(.2, .8, .2, 1)), box-shadow .4s var(--ease, cubic-bezier(.2, .8, .2, 1)), border-color .2s;
}
.re-card.is-moving { transition: box-shadow .4s, border-color .2s; will-change: transform; }
.re-card::after {
  content: ""; position: absolute; inset: -1px -1px auto; height: 3px; pointer-events: none;
  border-radius: var(--r-card) var(--r-card) 0 0; background: var(--brand);
  transform: scaleX(0); transform-origin: left center; transition: transform .45s var(--ease, cubic-bezier(.2, .8, .2, 1));
}
[dir="rtl"] .re-card::after { transform-origin: right center; }
.re-card:focus-visible { outline: 3px solid var(--focus, var(--brand)); outline-offset: 3px; }
.re-card-media {
  --plane: -5deg;
  position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden;
  margin: var(--s-3) var(--s-3) 0;
  border-radius: var(--r-media); border-start-start-radius: 26px;
  background: var(--surface-inset);
  transform: translateZ(20px) perspective(900px) rotateY(var(--plane)) rotateX(1.5deg);
  transition: transform .5s var(--ease, cubic-bezier(.2, .8, .2, 1)), box-shadow .5s;
}
[dir="rtl"] .re-card-media { --plane: 5deg; }
.re-card-media img { display: block; width: 100%; height: 100%; aspect-ratio: auto; object-fit: cover; transition: transform .4s; }
.re-card-empty {
  display: grid; place-items: center; height: 100%; padding: var(--s-4); text-align: center;
  color: var(--muted); font: 700 var(--fs-sm) / 1.3 var(--font-latin);
  background: var(--surface-inset);
}
.re-card-body { display: flex; flex-direction: column; gap: var(--s-2); min-width: 0; padding: var(--s-4) var(--s-4) var(--s-5); }
.re-card-price {
  display: block; overflow-wrap: anywhere; font-variant-numeric: tabular-nums;
  font: 700 var(--fs-2xl) / 1.05 var(--font-latin); letter-spacing: -.02em;
}
.re-card-price.is-none { font-size: var(--fs-xl); }
.re-card-label { display: block; margin-bottom: var(--s-1); color: var(--muted); letter-spacing: 0; font: 500 var(--fs-xs) / 1.4 var(--font-latin); }
.re-card-title {
  margin: 0; overflow-wrap: anywhere; color: var(--ink); letter-spacing: -.02em;
  font: 700 var(--fs-lg) / 1.25 var(--font-latin);
}
.re-card-sub { margin: 0; color: var(--muted); font-size: var(--fs-sm); line-height: 1.45; }
.re-card-action {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); margin-top: var(--s-1);
  color: var(--brand-ink); font: 800 var(--fs-sm) / 1 var(--font-latin);
}
.re-card-action > span { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--line-strong); border-radius: 50%; font-size: 17px; transition: transform .2s, border-color .2s; }
@media (hover: hover) and (pointer: fine) {
  .re-card:hover { translate: 0 -4px; border-color: var(--brand); text-decoration: none; }
  .re-card:hover::after { transform: scaleX(1); }
  .re-card:hover .re-card-action > span { transform: translateY(-2px); border-color: var(--brand); }
}
.re-card:is(:focus-visible, :hover) .re-card-media { transform: translateZ(20px) perspective(900px) rotateY(0) rotateX(0); outline: 2px solid var(--focus); outline-offset: 2px; }
.re-card:is(:focus-visible, :hover) .re-card-media img { transform: scale(1.04); }
@media (hover: none) { .re-card:hover .re-card-media { transform: translateZ(20px) perspective(900px) rotateY(var(--plane)) rotateX(1.5deg); } .re-card:hover .re-card-media img { transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .re-card, .re-card-media, .re-card:hover, .re-card:is(:focus-visible, :hover) .re-card-media { transform: none !important; translate: none !important; transition: none !important; }
  .re-card-media img, .re-card::after, .re-card-action > span { transition: none !important; }
}

/* Card parts used by the hub tiles and the landing-page listings. */
li > .re-card { flex: 1 1 auto; width: 100%; height: 100%; }
.re-card-body { flex: 1 1 auto; }
.re-card-title { display: block; }
.re-card-body > small { margin: 0; color: var(--muted); font-size: var(--fs-sm); line-height: 1.45; }
.re-card-badge {
  position: absolute; top: var(--s-2); inset-inline-start: var(--s-2); max-width: calc(100% - var(--s-4));
  padding: 4px 10px; border-radius: 99px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  background: var(--contrast, #18181b); color: var(--on-contrast, #fff);
  font: 700 var(--fs-xs) / 1.3 var(--font-latin);
}
/* Developer logos are drawn for a light ground, so their tile stays white in both themes (--paper turns
   charcoal in dark mode and hid dark logos); a logo file named *-on-dark.* is drawn for charcoal instead. */
.re-card-media--logo img { object-fit: contain; padding: var(--s-5); background: var(--gray-0); }
.re-card-media--logo img[src*="-on-dark."] { background: var(--kw-charcoal); }
.re-card-stats { display: flex; flex-wrap: wrap; gap: 6px; }
.re-card-stats span {
  padding: 3px 9px; border-radius: 99px; background: var(--surface-inset); color: var(--ink-soft);
  font: 600 var(--fs-xs) / 1.4 var(--font-latin);
}
.re-card-text {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  color: var(--ink-soft); font-size: var(--fs-sm); line-height: 1.6;
}
.re-card-action { margin-top: auto; }
/* The hub's list view is a flat row: tilted photos floating in rows were a past bug. */
.hub-cards[data-view="list"] { grid-template-columns: 1fr; gap: var(--s-3); }
.hub-cards[data-view="list"] .re-card { flex-direction: row; transform: none; }
.hub-cards[data-view="list"] .re-card-media {
  flex: 0 0 190px; aspect-ratio: auto; min-height: 130px; margin: 0; transform: none;
  border-radius: 0; border-start-start-radius: var(--r-card); border-end-start-radius: var(--r-card);
}
.hub-cards[data-view="list"] .re-card-body { justify-content: center; }
@media (max-width: 640px) {
  .hub-cards[data-view="list"] .re-card { flex-direction: column; }
  .hub-cards[data-view="list"] .re-card-media {
    flex: none; aspect-ratio: 16 / 9; min-height: 0; border-radius: 0; border-start-start-radius: var(--r-card); border-start-end-radius: var(--r-card);
  }
}

/* Homepage launch card: a photo as a background, an article with its own buttons. */
.re-card-media--bg { background-size: cover; background-position: center; }
.re-card-media--bg.is-empty {
  display: grid; place-items: center;
  background-image: none;
}
.re-card-eyebrow { color: var(--brand-ink); font: 700 var(--fs-xs) / 1.3 var(--font-latin); text-transform: uppercase; letter-spacing: .06em; }
[dir="rtl"] .re-card-eyebrow { letter-spacing: 0; text-transform: none; }
.re-card-actions { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: auto; padding-top: var(--s-2); }
.re-card-actions .button { flex: 1 1 auto; min-height: 44px; padding: 0 16px; border-radius: 9px; font-size: 13px; text-align: center; justify-content: center; }
.re-card-link { align-self: flex-start; }
.re-card.is-active::after { transform: scaleX(1); }

/* Homepage project card: developer line, the "See units" row, and the flat list view. */
.re-card-dev { display: flex; align-items: center; gap: 8px; min-width: 0; }
.re-card-dev .re-card-sub { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.re-card-devlogo { flex: none; width: 56px; height: 24px; object-fit: contain; border-radius: 4px; background: #fff; padding: 2px; }
.re-card-devlogo[src*="-on-dark."] { background: #1b1b1b; }
.re-card-title a { color: inherit; text-decoration: none; }
.re-card-title a:hover { color: var(--brand-ink); }
.re-card .tile-ctas { margin-top: auto; padding-top: var(--s-2); }
.project-grid[data-view="list"] .re-card { flex-direction: row; transform: none; translate: none; }
.project-grid[data-view="list"] .re-card-media {
  flex: 0 0 min(300px, 38%); aspect-ratio: auto; min-height: 176px; margin: 0; transform: none;
  border-radius: 0; border-start-start-radius: var(--r-card); border-end-start-radius: var(--r-card);
}
.project-grid[data-view="list"] .re-card-body { justify-content: center; }
@media (max-width: 640px) {
  .project-grid[data-view="list"] .re-card { flex-direction: column; }
  .project-grid[data-view="list"] .re-card-media { flex: none; aspect-ratio: 16 / 10; min-height: 0; border-radius: 0; border-start-start-radius: var(--r-card); border-start-end-radius: var(--r-card); }
}

/* Homepage unit card: badges and buttons on the photo, monthly beside the price, icon facts. */
.re-card-badges { position: absolute; z-index: 1; top: var(--s-2); inset-inline-start: var(--s-2); display: flex; flex-wrap: wrap; gap: 6px; max-width: calc(100% - 110px); pointer-events: none; }
.re-card-badges .re-card-badge { position: static; max-width: 100%; }
.re-card-badge--use { background: var(--ink); color: var(--paper, #fff); }
.re-card-badge--offer { background: var(--brand); color: var(--on-brand); }
.re-card-media-actions { position: absolute; z-index: 3; top: var(--s-2); inset-inline-end: var(--s-2); display: flex; gap: 7px; }
.re-card-monthly { display: block; margin-top: var(--s-1); color: var(--muted); font: 500 var(--fs-xs) / 1.4 var(--font-latin); }
.re-card-monthly b { color: var(--brand-ink); font-weight: 750; font-variant-numeric: tabular-nums; }
.re-card-eyebrow svg { width: 13px; height: 13px; margin-inline-end: 4px; vertical-align: -2px; }
.re-card-eyebrow a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.re-card-stats--icons span { display: inline-flex; align-items: center; gap: 5px; }
.re-card-stats--icons svg { width: 14px; height: 14px; color: var(--muted); }
.re-card-fresh { color: var(--muted); font: 500 var(--fs-xs) / 1.5 var(--font-latin); }
.unit-image-link { z-index: 1; }
.unit-grid[data-view="list"] .re-card { flex-direction: row; transform: none; translate: none; }
.unit-grid[data-view="list"] .re-card-media {
  flex: 0 0 min(300px, 38%); aspect-ratio: auto; min-height: 176px; margin: 0; transform: none;
  border-radius: 0; border-start-start-radius: var(--r-card); border-end-start-radius: var(--r-card);
}
.unit-grid[data-view="list"] .re-card-body { justify-content: center; }
@media (max-width: 640px) {
  .unit-grid[data-view="list"] .re-card { flex-direction: column; }
  .unit-grid[data-view="list"] .re-card-media { flex: none; aspect-ratio: 16 / 10; min-height: 0; border-radius: 0; border-start-start-radius: var(--r-card); border-start-end-radius: var(--r-card); }
}

/* Depth layers: the price, the badges and the chips stand off the card on their own planes, so
   the pointer tilt (or a phone's resting plane) separates them from the flat reading text.
   Layer scale: badges 28px, price 24px, chips and buttons 14px; hover raises one step.
   The unit and project price sits on a glass panel over the photo that floats highest. Flat in list view,
   under reduced motion and where a transform would trap something (the photo's contents). */
.re-card { transform-style: preserve-3d; --ex: 1; }
[dir="rtl"] .re-card { --ex: -1; }
.re-card-body { transform-style: preserve-3d; }
.re-card-price {
  transform: translateZ(24px); transform-origin: left center;
  transition: transform .35s var(--ease, cubic-bezier(.2, .8, .2, 1)), text-shadow .35s var(--ease, cubic-bezier(.2, .8, .2, 1));
}
[dir="rtl"] .re-card-price { transform-origin: right center; }
.re-card-price .re-card-label, .re-card-price .re-card-monthly { }
.re-card-badge, .re-card-stats span, .re-card-eyebrow, .re-card-actions .button, .re-card .tile-cta {
  transition: transform .25s var(--ease, cubic-bezier(.2, .8, .2, 1)), box-shadow .25s;
}
.re-card-stats span {
  transform: translateZ(14px);
}
.re-card-badge {
  transform: translateZ(28px);
}
.re-card-badges .re-card-badge { pointer-events: auto; }
.re-card-actions .button, .re-card .tile-cta { transform: translateZ(14px); }
@media (hover: hover) and (pointer: fine) {
  .re-card:hover .re-card-price { transform: translateZ(40px) scale(1.03); }
  .re-card-stats span:hover, .re-card-badge:hover { transform: translateZ(40px) translateY(-2px) scale(1.07); }
  .re-card-actions .button:hover, .re-card .tile-cta:hover { transform: translateZ(30px) translateY(-2px); }
}
.re-card-stats span:active, .re-card-badge:active, .re-card .tile-cta:active { transform: translateZ(6px) scale(.96); }
.hub-cards[data-view="list"] .re-card, .project-grid[data-view="list"] .re-card, .unit-grid[data-view="list"] .re-card,
.hub-cards[data-view="list"] .re-card-body, .project-grid[data-view="list"] .re-card-body, .unit-grid[data-view="list"] .re-card-body { transform-style: flat; }
.hub-cards[data-view="list"] :is(.re-card-price, .re-card-badge, .re-card-stats span, .tile-cta, .button),
.project-grid[data-view="list"] :is(.re-card-price, .re-card-badge, .re-card-stats span, .tile-cta, .button),
.unit-grid[data-view="list"] :is(.re-card-price, .re-card-badge, .re-card-stats span, .tile-cta, .button) { transform: none !important; }
@media (prefers-reduced-motion: reduce) {
  .re-card, .re-card-body { transform-style: flat; }
  .re-card :is(.re-card-price, .re-card-badge, .re-card-stats span, .tile-cta, .button) { transform: none !important; transition: none !important; }
}

/* The price panel on the photo (unit and project cards). The stage holds the tilted photo and the
   panel, so the panel floats in front of the plane instead of being clipped inside it. */
.re-card-stage { position: relative; margin: var(--s-3) var(--s-3) 0; transform-style: preserve-3d; }
.re-card-stage .re-card-media { margin: 0; }
.re-card--unit .re-card-badge { padding: 7px 12px; background: var(--glass, rgba(255, 255, 255, .92)); color: var(--ink); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.re-card--unit .re-card-badge--use { background: var(--ink); color: var(--paper, #fff); }
.re-card--unit .re-card-badge--offer { background: var(--brand); color: var(--on-brand); }
.project-grid[data-view="list"] .re-card-stage, .unit-grid[data-view="list"] .re-card-stage { flex: 0 0 min(300px, 38%); margin: 0; transform-style: flat; }
.project-grid[data-view="list"] .re-card-stage .re-card-media, .unit-grid[data-view="list"] .re-card-stage .re-card-media { height: 100%; flex: none; }
@media (max-width: 640px) {
  .project-grid[data-view="list"] .re-card-stage, .unit-grid[data-view="list"] .re-card-stage { flex: none; }
}
@media (prefers-reduced-motion: reduce) { .re-card-stage { transform-style: flat; } }

/* Homepage developer list view (legacy .re-card markup). */
.re-card-media--plate { aspect-ratio: 16 / 9; display: grid; place-items: center; background: var(--surface-inset); }
.developer-list[data-view="list"] .re-card { flex-direction: row; align-items: center; transform: none; translate: none; }
.developer-list[data-view="list"] .re-card-media { flex: 0 0 150px; aspect-ratio: auto; min-height: 96px; margin: var(--s-3); transform: none; }
.developer-list[data-view="list"] .re-card-body { flex-direction: row; align-items: center; flex-wrap: wrap; gap: var(--s-4); }
.developer-list[data-view="list"] .re-card-body, .developer-list[data-view="list"] .tile-cta { transform-style: flat; transform: none !important; }
@media (max-width: 640px) { .developer-list[data-view="list"] .re-card { flex-direction: column; align-items: stretch; } .developer-list[data-view="list"] .re-card-body { flex-direction: column; align-items: stretch; } }

/* Homepage market-watch card (news): thumbnail on the plane, source chip, excerpt, stretched link. */
.re-card-media--news { aspect-ratio: 16 / 9; }
.re-card-meta { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); min-width: 0; }
.re-card-meta .re-card-stats span { max-width: 14em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.re-card-meta time { flex: none; font-variant-numeric: tabular-nums; }
.re-card--news .re-card-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.re-card-stretch::before { content: ""; position: absolute; inset: 0; z-index: 2; }
.re-card-action svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
[dir="rtl"] .re-card-action svg { scale: -1 1; }
.re-card:focus-within { outline: 3px solid var(--focus, var(--brand)); outline-offset: 2px; }

/* Homepage destination tile: a photo with its caption on top. It keeps its mosaic layout and gets the
   card's pointer tilt, a lift on hover and a raised arrow button; the caption stays flat inside the photo. */
#main .destination-card {
  transform: perspective(1000px) rotateX(calc(var(--depth-y, 0deg) + var(--rv-rx, 0deg))) rotateY(var(--depth-x, 0deg));
  transition: transform .4s var(--ease, cubic-bezier(.2, .8, .2, 1)), box-shadow .4s var(--ease, cubic-bezier(.2, .8, .2, 1));
}
#main .destination-card.is-moving { transition: box-shadow .4s; will-change: transform; }
#main .destination-card:hover { transform: perspective(1000px) rotateX(var(--depth-y, 0deg)) rotateY(var(--depth-x, 0deg)); translate: 0 -4px; }
#main .destination-card i { }
#main .destination-grid[data-view="list"] .destination-card { transform: none; translate: none; }
@media (prefers-reduced-motion: reduce) { #main .destination-card, #main .destination-card:hover { transform: none; translate: none; transition: none; } }
/* Depth without shadows: an edge for raised surfaces, and a 2 px ink outline where a border would change the box size. */
.kw-outline { border: 1px solid var(--line); }
.kw-lift { outline: 2px solid var(--ink); outline-offset: 0; }

/* == KW cards (Figma 32-41) == */
.kc { position: relative; display: block; min-height: 480px; color: var(--ink); text-decoration: none; isolation: isolate; }
.kc-out { position: absolute; inset: 0; z-index: -1; border: 2px solid var(--brand); border-radius: 20px; opacity: 0; transform: translateZ(-30px); transition: transform .35s ease, opacity .2s; pointer-events: none; }
/* The photo is decoration: pointer-events none lets a click reach the card's link (.kc-hit, or the card itself on
   listing pages), so the photo opens the unit, project or developer like the title does (owner, 14 November). */
.kc-photo { position: absolute; inset: 0; overflow: hidden; border-radius: 20px; background: var(--kw-sand) center / cover no-repeat; transition: transform .35s ease; pointer-events: none; }
.kc-photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s ease; }
.kc-photo.is-empty { display: grid; place-items: center; color: var(--muted); }
.kc-top { position: absolute; z-index: 2; top: 16px; inset-inline: 16px; display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; pointer-events: none; transition: transform .35s ease; }
.kc-top > * { pointer-events: auto; }
.kc-devchip { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding-block: 0; padding-inline: 6px 16px; max-width: 70%; border-radius: 999px; background: var(--gray-0); color: var(--kw-charcoal); font: 700 14px / 1.2 var(--font-latin); }
.kc-devchip i { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--kw-charcoal); color: var(--gray-0); font-style: normal; font-size: 10px; }
.kc-devchip img { flex: none; width: 28px; height: 28px; border-radius: 50%; object-fit: contain; background: var(--gray-0); }
.kc-devchip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kc-rbadge { min-height: 36px; display: inline-flex; align-items: center; padding-inline: 16px; border-radius: 999px; background: var(--brand); color: var(--on-brand); font: 700 12px / 1 var(--font-latin); letter-spacing: .14em; text-transform: uppercase; }
.kc-logo { width: 44px; height: 44px; border-radius: 12px; background: var(--gray-0); color: var(--kw-charcoal); display: grid; place-items: center; font-weight: 700; overflow: hidden; }
/* The page-wide image placeholder (img { background: var(--surface-inset) }) is charcoal in dark mode and
   covered the white tile, so dark logos vanished on dark cards: the logo itself is transparent over its tile. */
.kc-logo img { width: 100%; height: 100%; object-fit: contain; padding: 4px; background: transparent; }
.kc-logo:has(img[src*="-on-dark."]) { background: var(--kw-charcoal); }
.kc-count { border-radius: 12px; padding: 6px 14px; background: var(--brand); color: var(--on-brand); text-align: center; line-height: 1; }
.kc-count b { display: block; font-size: 22px; }
.kc-count small { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; }
.kc-acts { display: flex; gap: 8px; }
.kc-round { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--gray-0); color: var(--kw-charcoal); display: grid; place-items: center; cursor: pointer; }
.kc-round[aria-pressed="true"] { color: var(--brand); }
.kc-round[aria-pressed="true"] svg { fill: currentColor; }
.kc-panel { position: absolute; z-index: 1; inset-inline: 14px; bottom: 14px; border-radius: 14px; background: var(--gray-0); color: var(--kw-charcoal); padding: 20px; transition: transform .35s ease; }
.kc-panel::before { content: ""; position: absolute; top: 0; inset-inline: 20px; height: 4px; background: var(--brand); transform: scaleX(0); transform-origin: var(--kc-origin, left); transition: transform .3s; }
[dir="rtl"] .kc-panel::before { --kc-origin: right; }
.kc-title { margin: 0; font: 700 24px / 1.15 var(--font-latin); letter-spacing: -.02em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kc-title a { color: inherit; text-decoration: none; }
.kc-title a:focus-visible { outline-offset: -3px; border-radius: 6px; } /* the clamp clips overflow, so the ring sits inside the box */
.kc-hit { position: absolute; inset: 0; z-index: 0; border-radius: 20px; } /* whole-card link on home article cards; the panel is positioned, so a ::after on the title would only cover the panel */
.kc-loc, .kc-sub, .kc-eyebrow { display: flex; align-items: center; gap: 6px; margin: 4px 0 0; color: var(--kw-grey-3); font-size: 14px; line-height: 1.4; }
.kc-eyebrow { margin: 0 0 6px; font-size: 13px; }
.kc-loc svg, .kc-eyebrow svg { flex: none; width: 16px; height: 16px; color: var(--brand); }
.kc-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.kc-tags span { min-height: 30px; display: inline-flex; align-items: center; padding-inline: 12px; border: 1px solid var(--kw-sand); border-radius: 999px; background: var(--paper-warm); font-size: 13px; }
.kc-pay { margin-top: 16px; }
.kc-bar { height: 6px; border-radius: 999px; background: var(--kw-sand); overflow: hidden; }
.kc-bar i { display: block; height: 100%; border-radius: 999px; background: var(--brand); }
.kc-pay-l { display: flex; justify-content: space-between; margin-top: 6px; color: var(--kw-grey-3); font-size: 13px; }
.kc--project .kc-pay { display: none; }
.kc-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-top: 16px; }
.kc-price small { display: block; color: var(--kw-grey-3); font: 700 11px / 1.3 var(--font-latin); letter-spacing: .14em; text-transform: uppercase; }
.kc-price b { font-size: 24px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kc-foot .kc-price { flex: 1 1 auto; min-width: 0; }
.kc-foot .kc-price b { display: block; } /* wraps at the space between EGP and the figure, never inside it */
.kc-price b bdi { white-space: nowrap; }
.kc-foot > :is(.kc-go, .kc-gos) { flex: none; }
.kc-price em { display: block; margin-top: 2px; color: var(--kw-grey-3); font-style: normal; font-size: 13px; }
.kc-go { position: relative; z-index: 2; flex: none; width: 48px; height: 48px; border-radius: 12px; background: var(--kw-charcoal); color: var(--gray-0); display: grid; place-items: center; transition: background .2s; }
.kc-go--ghost { background: var(--gray-0); color: var(--kw-charcoal); border: 1px solid var(--kw-sand); }
/* generated pages do not load app.css, so the card's own icons carry the stroke style */
.kc svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.kc-go svg { width: 18px; height: 18px; }
[dir="rtl"] .kc-go:not(.kc-go--ghost) svg { transform: scaleX(-1); }
.kc-gos { display: flex; gap: 8px; }
/* hover and keyboard focus: lift, red top line, red arrow, step-out, payment bar */
.kc:is(:hover, :focus-within) .kc-out { opacity: 1; transform: translateZ(-30px) translate(16px, 16px); }
[dir="rtl"] .kc:is(:hover, :focus-within) .kc-out { transform: translateZ(-30px) translate(-16px, 16px); }
.kc:is(:hover, :focus-within) .kc-photo, .kc:is(:hover, :focus-within) .kc-panel { transform: translateY(-12px); }
.kc:is(:hover, :focus-within) .kc-panel::before { transform: scaleX(1); }
.kc:is(:hover, :focus-within) .kc-go:not(.kc-go--ghost) { background: var(--brand); }
.kc--project:is(:hover, :focus-within) .kc-pay { display: block; }
/* Layered 3D (spec §4.3, mockup cards-motion-v3): the card is one 3D scene, so on hover the photo stays at the
   back, the white panel rises to Z 46, the chips to Z 60 and the red outline sits at Z -30, and the pointer tilt
   (kwred-depth.js, up to 10° by 8°) shows the layers apart. The card's own transform makes it a stacking
   context, which isolation used to provide; isolation would flatten the 3D, so it comes back only for reduced motion. */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .re-card.kc { isolation: auto; transform-style: preserve-3d; }
  .kc:is(:hover, :focus-within) .kc-panel { transform: translateY(-12px) translateZ(46px); }
  .kc:is(:hover, :focus-within) .kc-top { transform: translateZ(60px); }
  .kc:is(:hover, :focus-within) .kc-photo img { transform: scale(1.06); }
}
.kc--developer:is(:hover, :focus-within) .kc-panel::before { inset-inline-end: 45%; }
.kc:focus-visible, .kc :focus-visible { outline: 3px solid var(--focus, var(--brand)); outline-offset: 3px; }
/* dark theme sets --focus to warm white, ~1.1:1 on the white panel: panel controls use fixed charcoal. The round buttons sit on the photo, so their ring goes inside the white circle. */
/* The panel stays white in both themes, so its focus ring is charcoal. Set through --focus too, because the
   page-wide #main / .ce focus rules outrank this selector and read var(--focus). */
.kc-panel { --focus: var(--kw-charcoal); }
.kc-panel :focus-visible { outline-color: var(--kw-charcoal); }
.kc-round:focus-visible { outline-color: var(--kw-charcoal); outline-offset: -4px; }
/* unit card: 3:2 photo on top, panel overlaps its lower edge by 28px (owner fix 6e953fa64) */
.kc--unit { min-height: 0; border: 1px solid var(--line); border-radius: 20px; background: var(--gray-0); }
.kc--unit .kc-photo { position: relative; inset: auto; aspect-ratio: 3 / 2; border-radius: 20px 20px 0 0; }
.kc--unit .kc-panel { position: relative; inset: auto; margin: -28px 12px 12px; }
.kc--unit .kc-pay { display: block; }
/* developer card */
.kc--developer .kc-title { font-size: 22px; }
/* dark theme: page is charcoal, panels stay white (Figma 34) */
:root[data-theme="dark"] .kc--unit { border-color: var(--gray-0); }
/* touch: no tilt, no step-out, nothing hover-only */
@media (hover: none) {
  .kc-out { display: none; }
  .kc:is(:hover, :focus-within) .kc-photo, .kc:is(:hover, :focus-within) .kc-panel { transform: none; }
  .kc--project .kc-pay { display: block; }
}
@media (max-width: 599px) {
  .kc { min-height: 440px; }
  .kc-panel { padding: 16px; }
  .kc-title { font-size: 21px; }
}
@media (prefers-reduced-motion: reduce) {
  .kc-out, .kc-photo, .kc-photo img, .kc-top, .kc-panel, .kc-panel::before, .kc-go { transition: none; }
  .kc:is(:hover, :focus-within) .kc-photo, .kc:is(:hover, :focus-within) .kc-panel { transform: none; }
  .kc { isolation: isolate; }
}
/* Arabic joins letters: no tracking, no case folding */
[dir="rtl"] .kc :is(.kc-rbadge, .kc-count small, .kc-price small, .kc-title, .kc-price b, .kc-eyebrow) { letter-spacing: 0; text-transform: none; }

/* unit card: badges on the photo, light and dark chips, dated freshness line */
.kc-badges { display: flex; flex-wrap: wrap; gap: 8px; max-width: calc(100% - 104px); }
.kc-rbadge--light { background: var(--gray-0); color: var(--kw-charcoal); }
.kc-rbadge--dark { background: var(--kw-charcoal); color: var(--gray-0); }
.kc-fresh { margin: 10px 0 0; color: var(--kw-grey-3); font-size: 13px; line-height: 1.4; }

/* listing pages: the whole card is one anchor, so the panel parts are spans */
span.kc-photo, span.kc-panel, span.kc-pay, span.kc-bar, span.kc-price { display: block; }
span.kc-title { display: -webkit-box; } /* keeps the 2-line clamp on generated pages */
span.kc-tags, span.kc-foot, span.kc-pay-l { display: flex; }
.kc-photo--logo { background: var(--gray-0); }
.kc-photo--logo img { object-fit: contain; padding: 48px 48px 160px; }
.kc-price.is-none b { font-size: 18px; letter-spacing: 0; }
.kc--hub .kc-tags, .kc--developer .kc-tags { margin-top: 10px; }
