/* =====================================================================
   Quality Wood Carpentry — site styles
   Built on the AM Studio UI-KIT (spacing, type scale, motion, buttons,
   cards, inputs, RTL rules). Colours follow the client's round logo,
   which is wood-brown on white (sampled from their profile logo):
     white   #FEFEFE  background of the logo
     brown   #6C422A  main lettering / ring
     deep    #49230C  darkest grain
     grain   #7A4D36  / #8B6E60 lighter grain
   The UI-KIT only defines a dark stack; this light stack keeps its token
   names and structure, with every value taken from the logo's hue.
   ===================================================================== */

:root {
  /* Brand (from the client's round logo) */
  --color-primary:       #6C422A;
  --color-primary-light: #8A5536;
  --color-primary-dark:  #49230C;
  --color-primary-glow:  rgba(108, 66, 42, 0.18);
  --color-brass:         #B5855D; /* door handles and inlay only */

  /* Backgrounds (light, warm white like the logo) */
  --color-bg-base:     #FFFFFF;
  --color-bg-surface:  #FAF6F2;
  --color-bg-elevated: #F4EDE6;
  --color-bg-overlay:  #ECE2D8;

  /* Borders */
  --color-border:        #E6DACE;
  --color-border-subtle: #F0E8E0;

  /* Text */
  --color-text-primary:   #2B1A10;
  --color-text-secondary: #6B5444;
  --color-text-muted:     #9A8475;
  --color-text-inverse:   #FFFFFF;

  /* Semantic */
  --color-success:    #2F9E5B;
  --color-error:      #C2410C;
  --color-error-bg:   rgba(194, 65, 12, 0.08);

  /* Gradients: the wood of the logo, light grain to deep grain */
  --gradient-hero:  linear-gradient(135deg, #FFFFFF 0%, #FAF6F2 100%);
  --gradient-brand: linear-gradient(135deg, #8A5536 0%, #6C422A 50%, #49230C 100%);
  --gradient-card-border: linear-gradient(135deg, rgba(108,66,42,0.25), rgba(108,66,42,0.05));
  --gradient-fade-down: linear-gradient(to bottom, #FFFFFF, transparent);
  --gradient-fade-up:   linear-gradient(to top, #FFFFFF, transparent);

  /* Typography */
  --font-sans:   'Inter', 'Segoe UI', system-ui, sans-serif;
  --font-arabic: 'Cairo', 'Tajawal', 'Segoe UI', sans-serif;

  --text-xs:      0.75rem;
  --text-sm:      0.875rem;
  --text-base:    1rem;
  --text-lg:      1.125rem;
  --text-xl:      1.25rem;
  --text-2xl:     1.5rem;
  --text-3xl:     1.875rem;
  --text-4xl:     2.25rem;
  --text-5xl:     3rem;
  --text-display: 3.75rem;

  /* Spacing */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;

  /* Motion */
  --ease-default: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-in:      cubic-bezier(0.4, 0, 1, 1);
  --ease-out:     cubic-bezier(0, 0, 0.2, 1);
  --ease-spring:  cubic-bezier(0.34, 1.56, 0.64, 1);

  --duration-fast: 100ms;
  --duration-base: 200ms;
  --duration-slow: 300ms;
  --duration-lazy: 500ms;

  /* Site */
  --pad: var(--space-4);
  --nav-h: 64px;
  --wood-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='960'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.045 0.0024' numOctaves='4' seed='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.09 0 0 0 0 0.05 0 0 0 0 0.03 1.9 0 0 0 -0.72'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
}

@media (min-width: 640px)  { :root { --pad: var(--space-6); } }
@media (min-width: 1024px) { :root { --pad: var(--space-16); } }

/* Base reset (UI-KIT §12) */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  background-color: var(--color-bg-base);
}

body {
  background-color: var(--color-bg-base);
  color: var(--color-text-primary);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

img, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
ul, ol { list-style: none; }
fieldset { border: 0; }

.icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.sr-only a:focus { position: fixed; inset-block-start: 80px; inset-inline-start: 16px; width: auto; height: auto; clip: auto; padding: 8px 12px; background: var(--color-bg-overlay); }

.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: var(--space-4);
}
@media (min-width: 640px)  { .container { padding-inline: var(--space-6); } }
@media (min-width: 1024px) { .container { padding-inline: var(--space-8); } }

/* Arabic (UI-KIT §9 + ARABIC-RTL.md §2) */
:root[dir="rtl"] { font-size: 106%; }
[lang="ar"] body,
[dir="rtl"] body {
  font-family: var(--font-arabic);
  line-height: 1.9;
  letter-spacing: 0;
}
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3 { letter-spacing: 0; font-weight: 700; }
[dir="rtl"] .icon-flip { transform: scaleX(-1); }

/* Text gradient (UI-KIT brand signature) */
.text-gradient, em.gold {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-style: normal;
}

/* Film grain over everything */
.grain {
  position: fixed;
  inset: 0;
  z-index: 900;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

/* =====================================================================
   Buttons (UI-KIT §5): logo-brown fill with white text.
   ===================================================================== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 44px;
  padding: 0 var(--space-5);
  background: var(--gradient-brand);
  color: var(--color-text-inverse);
  font-size: var(--text-base);
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  white-space: nowrap;
}
.btn-primary:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px var(--color-primary-glow);
}
.btn-primary:active { transform: translateY(0); opacity: 1; }
.btn-primary:focus-visible, .btn-secondary:focus-visible, .lang-toggle:focus-visible, .tile:focus-visible {
  outline: 2px solid var(--color-primary-light);
  outline-offset: 3px;
}
.btn-lg { height: 52px; padding: 0 var(--space-8); font-size: var(--text-lg); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 44px;
  padding: 0 var(--space-5);
  background: transparent;
  color: var(--color-primary);
  font-size: var(--text-base);
  font-weight: 600;
  border: 1.5px solid var(--color-primary);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}
.btn-secondary:hover {
  background: rgba(108, 66, 42, 0.07);
  border-color: var(--color-primary-dark);
  transform: translateY(-1px);
}

/* =====================================================================
   Loader
   ===================================================================== */
.loader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  background: var(--color-bg-base);
}
html:not(.js) .loader { display: none; }
.loader__inner { display: grid; justify-items: center; gap: var(--space-6); }
.loader__logo { position: relative; width: 120px; }
.loader__logo img { width: 100%; height: auto; }
.loader__logo::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, 0.85) 50%, transparent 70%) no-repeat;
  background-size: 250% 100%;
  -webkit-mask: url("../logo-round.png") center / contain no-repeat;
          mask: url("../logo-round.png") center / contain no-repeat;
  animation: logo-sheen 1.8s var(--ease-default) infinite;
}
@keyframes logo-sheen {
  from { background-position: 130% 0; }
  to   { background-position: -30% 0; }
}
.loader__bar { width: 160px; height: 1px; background: var(--color-border); overflow: hidden; }
.loader__bar span {
  display: block;
  height: 100%;
  background: var(--gradient-brand);
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 0.4s var(--ease-out);
}
[dir="rtl"] .loader__bar span { transform-origin: right center; }
.loader__tag {
  font-size: var(--text-xs);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
}

/* =====================================================================
   Navigation (UI-KIT §8). Frosted white, solid once past the house.
   ===================================================================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: var(--space-6);
  padding-inline: var(--pad);
  background: rgba(255, 255, 255, 0.78);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 rgba(108, 66, 42, 0.08);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}
.navbar.scrolled {
  background: rgba(255, 255, 255, 0.96);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  box-shadow: 0 1px 0 var(--color-border-subtle);
}
.navbar__brand img { height: 48px; width: 48px; border-radius: 50%; }
.navbar nav { flex: 1; }
.navbar__links {
  display: none;
  gap: var(--space-6);
  justify-content: center;
}
@media (min-width: 900px) { .navbar__links { display: flex; } }
.navbar__link {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
  transition: color 0.2s ease;
}
.navbar__link:hover, .navbar__link.active { color: var(--color-text-primary); }
.navbar__actions { display: flex; align-items: center; gap: var(--space-3); margin-inline-start: auto; }
.navbar .btn-primary { height: 40px; padding: 0 var(--space-4); font-size: var(--text-sm); }
@media (max-width: 520px) {
  .navbar .btn-primary span { display: none; }
  .navbar .btn-primary { width: 44px; height: 44px; padding: 0; }
}

.lang-toggle {
  height: 40px;
  min-width: 64px;
  padding: 0 var(--space-4);
  border-radius: 99px;
  border: 1px solid var(--color-border);
  background: rgba(255, 255, 255, 0.7);
  font-family: var(--font-arabic);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-primary);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.lang-toggle:hover { border-color: var(--color-primary); background: rgba(108, 66, 42, 0.06); }
[dir="rtl"] .lang-toggle { font-family: var(--font-sans); }

/* =====================================================================
   THE TOUR
   Default (no JS / reduced motion): rooms stacked as a simple page.
   .is-live (added by main.js): one pinned stage you walk through.
   ===================================================================== */
.tour { position: relative; background: var(--color-bg-base); }

/* ---- static fallback ---- */
.tour:not(.is-live) .stage { display: flex; flex-direction: column; gap: var(--space-6); padding: calc(var(--nav-h) + var(--space-12)) var(--pad) var(--space-16); }
.tour:not(.is-live) .captions { display: contents; }
.tour:not(.is-live) .entry-wall,
.tour:not(.is-live) .entry-door,
.tour:not(.is-live) .portal-rim,
.tour:not(.is-live) .plan,
.tour:not(.is-live) .room__shade,
.tour:not(.is-live) .spot,
.tour:not(.is-live) .hero-cap__cue { display: none; }
.tour:not(.is-live) .room { position: relative; border-radius: 16px; overflow: hidden; }
.tour:not(.is-live) .room img { width: 100%; height: auto; }
.tour:not(.is-live) .hero-cap { order: 0; margin-bottom: var(--space-8); }
.tour:not(.is-live) [data-cap="living"]   { order: 1; } .tour:not(.is-live) [data-room="living"]   { order: 2; }
.tour:not(.is-live) [data-cap="dining"]   { order: 3; } .tour:not(.is-live) [data-room="dining"]   { order: 4; }
.tour:not(.is-live) [data-cap="kitchen"]  { order: 5; } .tour:not(.is-live) [data-room="kitchen"]  { order: 6; }
.tour:not(.is-live) [data-cap="bedroom"]  { order: 7; } .tour:not(.is-live) [data-room="bedroom"]  { order: 8; }
.tour:not(.is-live) [data-cap="dressing"] { order: 9; } .tour:not(.is-live) [data-room="dressing"] { order: 10; }
.tour:not(.is-live) .cap { margin-top: var(--space-8); }

/* ---- live stage ---- */
.tour.is-live .stage {
  position: relative;
  height: 100vh;
  overflow: hidden;
  background: #F7F2EC;
}
.tour.is-live .room {
  position: absolute;
  inset: 0;
  overflow: hidden;
  visibility: hidden;
  contain: strict;
}
.tour.is-live .room::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to top, rgba(43, 26, 16, 0.32) 0%, rgba(43, 26, 16, 0) 40%);
}
.tour.is-live .room__media {
  /* main.js positions and scales it with one transform from the top-left corner */
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  will-change: transform;
}
.tour.is-live .room__media img { width: 100%; height: 100%; object-fit: cover; }
.room__shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 75% 65% at 50% 45%, rgba(9, 7, 5, 0.72), rgba(9, 7, 5, 0.94));
  opacity: 0;
}

/* Hotspots sit in image coordinates, so they use physical left/top
   (the photo never mirrors in RTL). */
.spot {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 0;
  height: 0;
  z-index: 2;
}
/* Dot panned off the edge of a phone screen: hide its label too */
.spot--off { filter: opacity(0); transition: filter 0.25s ease; }
.spot__dot {
  position: absolute;
  left: -8px;
  top: -8px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-primary);
  box-shadow: 0 0 0 4px #FFFFFF, 0 0 0 9px rgba(255, 255, 255, 0.35), 0 4px 16px rgba(0, 0, 0, 0.35);
}
.spot__dot::after {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 1px solid #FFFFFF;
  animation: spot-pulse 2.2s var(--ease-out) infinite;
}
@keyframes spot-pulse {
  from { transform: scale(1); opacity: 0.9; }
  to   { transform: scale(2.6); opacity: 0; }
}
.spot__line {
  position: absolute;
  left: 12px;
  top: 0;
  width: 44px;
  height: 2px;
  background: #FFFFFF;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  transform-origin: left center;
}
.spot__label {
  position: absolute;
  left: 60px;
  top: 0;
  translate: 0 -50%;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 9px 14px;
  background: rgba(255, 255, 255, 0.94);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(108, 66, 42, 0.16);
  border-radius: 12px;
  white-space: nowrap;
  box-shadow: 0 12px 32px rgba(43, 26, 16, 0.28);
}
.spot__label b { font-size: var(--text-sm); font-weight: 600; color: var(--color-text-primary); line-height: 1.4; }
.spot__label small { font-size: var(--text-xs); color: var(--color-text-secondary); line-height: 1.4; }
.spot--flip .spot__line { left: auto; right: 12px; transform-origin: right center; }
.spot--flip .spot__label { left: auto; right: 60px; }
@media (max-width: 640px) {
  .spot__line { width: 22px; }
  .spot__label { left: 38px; padding: 7px 10px; }
  .spot--flip .spot__label { right: 38px; }
  .spot__label b { font-size: var(--text-xs); }
  .spot__label small { display: none; }
}

/* ---- Entrance: white fluted wall, light marble floor, walnut door ---- */
.entry-wall, .entry-door {
  position: absolute;
  inset: 0;
  will-change: transform;
}
.entry-wall { z-index: 1; }
.entry-door { z-index: 3; perspective: 1600px; pointer-events: none; }
.tour:not(.is-live) .entry-wall, .tour:not(.is-live) .entry-door { display: none; }

.wall {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(108, 66, 42, 0.06), rgba(108, 66, 42, 0) 35%),
    linear-gradient(90deg, rgba(108, 66, 42, 0.10), rgba(108, 66, 42, 0) 22%, rgba(108, 66, 42, 0) 78%, rgba(108, 66, 42, 0.10)),
    repeating-linear-gradient(90deg, #E2D6C9 0px, #E2D6C9 1.5px, #F4EEE7 3px, #FFFFFF 6px, #FBF8F4 10px, #EFE7DE 14px, #E6DBCF 15.5px, #E2D6C9 16px),
    #F8F3EE;
}
.wall::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--wood-grain);
  background-size: 160px 960px;
  opacity: 0.07;
  mix-blend-mode: multiply;
}
/* Warm light from recessed downlights grazing the white flutes */
.wall__lights {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70px 34% at 14% 0%, rgba(214, 160, 105, 0.20), transparent 70%),
    radial-gradient(ellipse 70px 34% at 30% 0%, rgba(214, 160, 105, 0.16), transparent 70%),
    radial-gradient(ellipse 70px 34% at 70% 0%, rgba(214, 160, 105, 0.16), transparent 70%),
    radial-gradient(ellipse 70px 34% at 86% 0%, rgba(214, 160, 105, 0.20), transparent 70%),
    radial-gradient(ellipse 30% 45% at 50% 32%, rgba(214, 160, 105, 0.10), transparent 70%);
  mix-blend-mode: multiply;
}
.floor {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  top: 88%;
  background:
    radial-gradient(ellipse 22% 55% at 50% 0%, rgba(73, 35, 12, 0.14), transparent 70%),
    linear-gradient(to bottom, #EDE5DB, #F7F2EC 70%);
  border-top: 1px solid rgba(108, 66, 42, 0.14);
}
.floor__spill {
  position: absolute;
  inset: 0;
  opacity: 0;
  background: linear-gradient(to bottom, rgba(255, 205, 140, 0.55), rgba(255, 214, 160, 0.18) 60%, rgba(255, 214, 160, 0));
  filter: blur(6px);
  pointer-events: none;
}
.door-frame {
  position: absolute;
  border-radius: 4px 4px 0 0;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.5), rgba(255, 255, 255, 0.04) 40%, rgba(0, 0, 0, 0.5)),
    var(--wood-grain),
    linear-gradient(#5E3922, #49230C);
  background-size: auto, 320px 960px, auto;
  box-shadow:
    inset 0 0 0 1px rgba(181, 133, 93, 0.5),
    0 30px 60px rgba(73, 35, 12, 0.22),
    0 2px 6px rgba(73, 35, 12, 0.18);
}
.door-frame::after {
  /* Thin gold reveal right around the opening */
  content: '';
  position: absolute;
  inset: var(--frame) var(--frame) 0 var(--frame);
  border: 2px solid var(--color-brass);
  border-bottom: 0;
  box-shadow: 0 0 10px rgba(181, 133, 93, 0.25);
}
.plaque {
  position: absolute;
  filter: drop-shadow(0 8px 18px rgba(73, 35, 12, 0.18));
}
.plaque img { width: 100%; height: auto; border-radius: 50%; }

.door {
  position: absolute;
  transform-style: preserve-3d;
}
/* The door is a physical object: physical left/right on purpose. */
.leaf {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.32), rgba(0, 0, 0, 0) 14%, rgba(255, 236, 210, 0.05) 50%, rgba(0, 0, 0, 0) 86%, rgba(0, 0, 0, 0.32)),
    var(--wood-grain),
    linear-gradient(180deg, #8A5536 0%, #6C422A 45%, #573420 100%); /* the logo's wood brown */
  background-size: auto, 320px 960px, auto;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.5);
  backface-visibility: visible;
}
.leaf::after {
  content: '';
  position: absolute;
  inset: 0;
  background: #000;
  opacity: var(--shade, 0);
  pointer-events: none;
}
.leaf--l { left: 0; transform-origin: left center; }
.leaf--r { right: 0; transform-origin: right center; }
.leaf__panel {
  position: absolute;
  left: 16%;
  right: 16%;
  top: 7%;
  height: 40%;
  border: 1px solid rgba(217, 170, 116, 0.5);
  border-radius: 2px;
  box-shadow:
    inset 0 0 0 6px rgba(0, 0, 0, 0.14),
    inset 1px 1px 0 7px rgba(255, 236, 210, 0.05),
    0 1px 0 rgba(255, 236, 210, 0.06);
}
.leaf__panel--b { top: 53%; }
.leaf__handle {
  position: absolute;
  top: 34%;
  height: 32%;
  width: 7px;
  border-radius: 4px;
  background: linear-gradient(90deg, #7a5536, #F8E0BC 45%, #B5855D 70%, #6b4a2e);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6), 0 0 14px rgba(248, 224, 188, 0.25);
}
.leaf--l .leaf__handle { right: 9%; }
.leaf--r .leaf__handle { left: 9%; }
.door__gap {
  position: absolute;
  left: 50%;
  top: 2%;
  bottom: 0;
  width: 2px;
  margin-left: -1px;
  background: linear-gradient(to bottom, rgba(248, 224, 188, 0), rgba(248, 224, 188, 0.95) 30%, rgba(248, 224, 188, 0.95) 85%, rgba(248, 224, 188, 0.3));
  box-shadow: 0 0 14px 2px rgba(248, 224, 188, 0.55);
  transform: translateZ(1px);
}
.door__sill {
  position: absolute;
  left: 4%;
  right: 4%;
  bottom: -2px;
  height: 3px;
  border-radius: 2px;
  background: rgba(248, 224, 188, 0.9);
  box-shadow: 0 0 18px 6px rgba(248, 224, 188, 0.35);
  filter: blur(1px);
}

/* ---- Portal between rooms ---- */
.portal-rim {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 35;
  border: 7px solid #FFFFFF;
  border-bottom: 0;
  visibility: hidden;
  pointer-events: none;
  box-shadow:
    0 0 0 1px rgba(108, 66, 42, 0.25),
    0 24px 60px rgba(43, 26, 16, 0.35),
    inset 0 0 0 1px rgba(108, 66, 42, 0.25);
}

/* ---- Words over the scene ---- */
.tour.is-live .captions {
  position: absolute;
  inset: 0 0 auto 0;
  height: 100vh;
  height: 100svh;
  z-index: 40;
  pointer-events: none;
}
.hero-cap {
  max-width: 560px;
}
.tour.is-live .hero-cap {
  position: absolute;
  inset-inline-start: var(--pad);
  top: calc(var(--nav-h) + 3svh);
  max-width: min(560px, 100% - 2 * var(--pad));
}
.hero-cap__eyebrow, .cap__eyebrow, .section__label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.18em;
}
[dir="rtl"] .hero-cap__eyebrow, [dir="rtl"] .cap__eyebrow, [dir="rtl"] .section__label { letter-spacing: 0; text-transform: none; }
.hero-cap__title {
  margin-top: var(--space-3);
  font-size: var(--text-4xl);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--color-text-primary);
}
.hero-cap__title em {
  font-style: normal;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-cap__sub {
  margin-top: var(--space-4);
  max-width: 420px;
  font-size: var(--text-base);
  color: var(--color-text-secondary);
}
.hero-cap__cue {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-8);
  font-size: var(--text-xs);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
}
[dir="rtl"] .hero-cap__cue { letter-spacing: 0; }
.mouse {
  position: relative;
  width: 22px;
  height: 34px;
  border: 1.5px solid var(--color-primary);
  border-radius: 12px;
}
.mouse::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 7px;
  width: 3px;
  height: 7px;
  margin-left: -1.5px;
  border-radius: 2px;
  background: var(--color-primary);
  animation: wheel 1.6s var(--ease-default) infinite;
}
@keyframes wheel {
  0%   { transform: translateY(0); opacity: 1; }
  70%  { transform: translateY(10px); opacity: 0; }
  100% { transform: translateY(0); opacity: 0; }
}
@media (min-width: 768px) {
  .hero-cap__title { font-size: var(--text-5xl); }
  .tour.is-live .hero-cap { top: 50%; translate: 0 -50%; max-width: min(480px, 34vw); }
}
@media (min-width: 1024px) {
  .hero-cap__title { font-size: var(--text-display); }
}
@media (max-width: 767px) {
  .tour.is-live .hero-cap {
    top: 0;
    bottom: 0;
    inset-inline: var(--pad);
    max-width: none;
    padding-top: calc(var(--nav-h) + 2svh);
  }
  .tour.is-live .hero-cap__cue {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 2.5svh;
    justify-content: center;
    margin: 0;
  }
  .tour.is-live .hero-cap__sub { font-size: var(--text-sm); }
}

.tour.is-live .cap {
  position: absolute;
  inset-inline-start: var(--pad);
  bottom: calc(var(--pad) + 8px);
  max-width: min(600px, 100% - 2 * var(--pad));
  visibility: hidden;
  padding: var(--space-5) var(--space-6);
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(108, 66, 42, 0.14);
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(43, 26, 16, 0.28);
}
@media (max-width: 640px) {
  .tour.is-live .cap { padding: var(--space-4); }
}
.cap__eyebrow { display: flex; align-items: center; gap: var(--space-3); }
.cap__num {
  padding: 2px 10px;
  border: 1px solid rgba(108, 66, 42, 0.35);
  border-radius: 99px;
  letter-spacing: 0.05em;
  font-variant-numeric: tabular-nums;
}
.cap__title {
  margin-top: var(--space-3);
  font-size: var(--text-3xl);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--color-text-primary);
}
.cap__text { margin-top: var(--space-3); color: var(--color-text-secondary); max-width: 460px; }
@media (min-width: 768px) {
  .cap__title { font-size: var(--text-5xl); }
  .tour.is-live .cap { bottom: var(--space-12); }
}

/* ---- Floor plan ---- */
.plan {
  position: absolute;
  z-index: 45;
  inset-inline-end: var(--pad);
  top: calc(var(--nav-h) + 8px);
  width: 128px;
  padding: 10px 10px 8px;
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(108, 66, 42, 0.16);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(43, 26, 16, 0.2);
  opacity: 0;
  visibility: hidden;
}
.plan svg { width: 100%; height: auto; display: block; overflow: visible; }
.plan__rooms rect {
  fill: rgba(108, 66, 42, 0.03);
  stroke: rgba(108, 66, 42, 0.35);
  stroke-width: 1.2;
  transition: fill 0.4s ease, stroke 0.4s ease;
  cursor: pointer;
}
.plan__rooms rect:hover { fill: rgba(108, 66, 42, 0.08); }
.plan__rooms rect.is-active { fill: rgba(108, 66, 42, 0.18); stroke: var(--color-primary); }
.plan__door { stroke: #FFFFFF; stroke-width: 3; }
.plan__path { fill: none; stroke: rgba(108, 66, 42, 0.4); stroke-width: 1; stroke-dasharray: 2 3; }
.plan__you { fill: var(--color-primary); filter: drop-shadow(0 0 3px rgba(108, 66, 42, 0.6)); }
.plan__label {
  margin-top: 6px;
  font-size: 10px;
  line-height: 1.4;
  color: var(--color-text-secondary);
  text-align: center;
}
.plan__label b { color: var(--color-text-primary); font-weight: 600; }
@media (min-width: 768px) {
  .plan { top: auto; bottom: var(--space-12); width: 190px; padding: 14px 14px 10px; }
  .plan__label { font-size: var(--text-xs); }
}

/* =====================================================================
   Sections (UI-KIT §11)
   ===================================================================== */
.section { padding-block: var(--space-16); position: relative; }
@media (min-width: 768px)  { .section { padding-block: var(--space-20); } }
@media (min-width: 1024px) { .section { padding-block: var(--space-24); } }

.section__header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto var(--space-12);
}
.section__label { margin: 0 0 var(--space-3); }
.section__title {
  font-size: var(--text-3xl);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--color-text-primary);
  margin: 0 0 var(--space-4);
}
@media (min-width: 768px) { .section__title { font-size: var(--text-5xl); } }
.section__desc {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  line-height: 1.7;
}

/* Scroll-triggered fade (UI-KIT §10) — hidden only when JS can reveal it */
.js .fade-in-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--duration-lazy) var(--ease-out), transform var(--duration-lazy) var(--ease-out);
}
.js .fade-in-up.visible { opacity: 1; transform: translateY(0); }
.js .stagger > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
}
.js .stagger.visible > *:nth-child(1) { transition-delay: 0ms; }
.js .stagger.visible > *:nth-child(2) { transition-delay: 80ms; }
.js .stagger.visible > *:nth-child(3) { transition-delay: 160ms; }
.js .stagger.visible > *:nth-child(4) { transition-delay: 240ms; }
.js .stagger.visible > *:nth-child(5) { transition-delay: 320ms; }
.js .stagger.visible > *:nth-child(6) { transition-delay: 400ms; }
.js .stagger.visible > * { opacity: 1; transform: translateY(0); }

/* ---- Statement ---- */
.statement {
  padding: 22vh var(--pad);
  display: grid;
  place-items: center;
  text-align: center;
  background:
    radial-gradient(ellipse 50% 40% at 50% 50%, rgba(108, 66, 42, 0.05), transparent 70%),
    var(--color-bg-base);
}
.statement__text {
  max-width: 15ch;
  font-size: clamp(2.4rem, 8vw, 6.5rem);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.03em;
}
[dir="rtl"] .statement__text { letter-spacing: 0; line-height: 1.4; font-weight: 700; }
.statement__text .w { opacity: 0.16; }
.statement__text .w.gold {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---- Real work ---- */
.work { position: relative; padding-block: var(--space-16); background: var(--color-bg-surface); border-block: 1px solid var(--color-border); }
.work__head { margin-bottom: var(--space-10); }
.work__head .section__title, .work__head .section__desc { max-width: 620px; }
.work__viewport {
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.work__viewport::-webkit-scrollbar { display: none; }
.work__track {
  display: flex;
  gap: var(--space-4);
  padding-inline: var(--pad);
  width: max-content;
}
.work__item { width: 76vw; scroll-snap-align: center; }
.work__img {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  border-radius: 16px;
  border: 1px solid var(--color-border);
  background: var(--color-bg-elevated);
}
.work__img img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.12); will-change: transform; }
.work__item figcaption {
  margin-top: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}
@media (min-width: 768px) {
  .work { padding-block: 0; }
  .work__pin { height: 100vh; display: flex; flex-direction: column; justify-content: center; }
  .work__head { margin-bottom: var(--space-8); }
  .work__viewport { overflow: visible; scroll-snap-type: none; }
  .work__track { gap: var(--space-6); will-change: transform; }
  .work__item { width: min(40vh, 30vw); }
}
@media (min-width: 768px) and (max-height: 760px) {
  .work__head .section__desc { display: none; }
  .work__item { width: min(34vh, 28vw); }
}

/* ---- Services bento ---- */
.bento {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: 170px;
  grid-template-areas:
    "k k"
    "k k"
    "w a"
    "w a"
    "c c"
    "v t";
}
@media (min-width: 1024px) {
  .bento {
    gap: var(--space-6);
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 230px;
    grid-template-areas:
      "k k w a"
      "k k w a"
      "c c v t";
  }
}
.tile--kitchen  { grid-area: k; }
.tile--wardrobe { grid-area: w; }
.tile--arch     { grid-area: a; }
.tile--closet   { grid-area: c; }
.tile--vanity   { grid-area: v; }
.tile--tv       { grid-area: t; }
.tile {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--color-border);
  background: var(--color-bg-elevated);
  display: flex;
  align-items: flex-end;
  isolation: isolate;
  color: #FFFFFF;
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}
.tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
  transform: scale(1.03);
  transition: transform 0.9s var(--ease-out);
}
.tile::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to top, rgba(30, 18, 10, 0.86) 0%, rgba(30, 18, 10, 0.22) 55%, rgba(30, 18, 10, 0) 80%);
}
.tile:hover {
  border-color: rgba(108, 66, 42, 0.35);
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(43, 26, 16, 0.18), 0 0 0 1px rgba(108, 66, 42, 0.08);
}
.tile:hover img { transform: scale(1.09); }
.tile__body { padding: var(--space-4); }
.tile__body h3 { font-size: var(--text-lg); font-weight: 600; line-height: 1.3; }
.tile__body p { margin-top: 2px; font-size: var(--text-sm); color: rgba(255, 255, 255, 0.82); line-height: 1.5; }
@media (min-width: 1024px) {
  .tile__body { padding: var(--space-6); }
  .tile--kitchen .tile__body h3 { font-size: var(--text-3xl); font-weight: 700; }
}
@media (max-width: 400px) {
  .tile--wardrobe .tile__body p, .tile--arch .tile__body p, .tile--vanity .tile__body p, .tile--tv .tile__body p { display: none; }
}

.spaces {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3);
  margin-top: var(--space-12);
}
.spaces li {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 10px 18px;
  border: 1px solid rgba(108, 66, 42, 0.2);
  border-radius: 99px;
  background: rgba(108, 66, 42, 0.04);
  font-size: var(--text-sm);
  font-weight: 500;
}
.spaces .icon { color: var(--color-primary); }

/* ---- Marquee ---- */
.marquee {
  overflow: hidden;
  padding-block: var(--space-12);
  border-block: 1px solid var(--color-border-subtle);
  background: var(--color-bg-base);
}
.marquee__row {
  display: flex;
  width: max-content;
  will-change: transform;
}
.marquee__set {
  flex-shrink: 0;
  padding-inline-end: 0.4em;
  font-size: clamp(2.6rem, 8vw, 7rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  white-space: nowrap;
  color: transparent;
  -webkit-text-stroke: 1px rgba(108, 66, 42, 0.45);
}
[dir="rtl"] .marquee__set { letter-spacing: 0; }
.marquee__set i {
  font-style: normal;
  font-size: 0.45em;
  vertical-align: middle;
  margin-inline: 0.5em;
  color: var(--color-primary);
  -webkit-text-stroke: 0;
}

/* ---- Process ---- */
.steps-wrap { position: relative; }
.steps {
  display: grid;
  gap: var(--space-10);
  padding-inline-start: var(--space-10);
}
.steps__line {
  position: absolute;
  inset-inline-start: 10px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--color-border);
}
.steps__line span {
  position: absolute;
  inset: 0;
  background: var(--gradient-brand);
  transform-origin: top center;
  transform: scaleY(0);
}
.step { position: relative; }
.step::before {
  content: '';
  position: absolute;
  inset-inline-start: calc(-1 * var(--space-10) + 5px);
  top: 8px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--color-bg-base);
  border: 1.5px solid var(--color-primary);
}
.step__num {
  display: block;
  font-size: var(--text-5xl);
  font-weight: 800;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px var(--color-primary);
  margin-bottom: var(--space-3);
}
.step h3 { font-size: var(--text-xl); font-weight: 600; }
.step p { margin-top: var(--space-2); color: var(--color-text-secondary); font-size: var(--text-sm); line-height: 1.7; }
@media (min-width: 900px) {
  .steps { grid-template-columns: repeat(4, 1fr); gap: var(--space-8); padding-inline-start: 0; padding-top: var(--space-10); }
  .steps__line { inset-inline: 0; top: 13px; bottom: auto; width: auto; height: 1px; }
  .steps__line span { transform-origin: left center; transform: scaleX(0); }
  [dir="rtl"] .steps__line span { transform-origin: right center; }
  .step::before { inset-inline-start: 0; top: calc(-1 * var(--space-10) + 8px); }
}

/* ---- Contact ---- */
.contact { overflow: hidden; isolation: isolate; }
.contact__bg { position: absolute; inset: 0; z-index: -1; }
.contact__bg img { width: 100%; height: 100%; object-fit: cover; opacity: 0.35; transform: scale(1.1); }
.contact__bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, var(--color-bg-base), rgba(255, 255, 255, 0.55) 30%, rgba(255, 255, 255, 0.7) 70%, var(--color-bg-base)),
    linear-gradient(90deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.35));
}
.contact__grid { display: grid; gap: var(--space-12); align-items: center; }
@media (min-width: 1024px) { .contact__grid { grid-template-columns: 1.05fr 1fr; gap: var(--space-16); } }
.contact__title {
  font-size: clamp(2.6rem, 7vw, 5.25rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-6);
}
[dir="rtl"] .contact__title { letter-spacing: 0; line-height: 1.35; font-weight: 700; }
.contact__lines { display: grid; gap: var(--space-3); margin-top: var(--space-8); }
.contact__lines li { display: flex; align-items: center; gap: var(--space-3); font-size: var(--text-lg); }
.contact__lines .icon { color: var(--color-primary); width: 20px; height: 20px; }
.contact__lines a:hover { color: var(--color-primary); }

/* Glass card (UI-KIT §6) */
.card-glass {
  background: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(108, 66, 42, 0.14);
  box-shadow: 0 24px 60px rgba(43, 26, 16, 0.12);
  border-radius: 16px;
  padding: var(--space-6);
}
@media (min-width: 640px) { .quote { padding: var(--space-8); } }
.quote { display: grid; gap: var(--space-6); }

/* Forms (UI-KIT §7) */
.label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-2);
}
.optional { color: var(--color-text-muted); font-weight: 400; }
.input {
  width: 100%;
  height: 48px;
  padding: 0 var(--space-4);
  background: #FFFFFF;
  color: var(--color-text-primary);
  font-size: var(--text-base);
  font-family: inherit;
  border: 1.5px solid var(--color-border);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.input::placeholder { color: var(--color-text-muted); }
.input:hover { border-color: rgba(108, 66, 42, 0.35); }
.input:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--color-primary-glow); }
textarea.input { height: auto; min-height: 104px; padding: var(--space-3) var(--space-4); resize: vertical; }

.choices { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 var(--space-4);
  border-radius: 99px;
  border: 1.5px solid var(--color-border);
  background: #FFFFFF;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.choice:hover span { border-color: rgba(108, 66, 42, 0.4); }
.choice input:checked + span {
  border-color: var(--color-primary);
  background: rgba(108, 66, 42, 0.08);
  color: var(--color-primary);
}
.choice input:focus-visible + span { box-shadow: 0 0 0 3px var(--color-primary-glow); }
.quote__submit { width: 100%; }
.quote__note { font-size: var(--text-xs); color: var(--color-text-muted); text-align: center; margin-top: calc(-1 * var(--space-3)); }

/* ---- Footer ---- */
.footer {
  padding-block: var(--space-16) var(--space-12);
  border-top: 1px solid var(--color-border-subtle);
  text-align: center;
}
.footer__grid { display: grid; justify-items: center; gap: var(--space-3); }
.footer__logo { width: 110px; height: auto; border-radius: 50%; margin-bottom: var(--space-3); }
.footer__tag { font-size: var(--text-xs); letter-spacing: 0.32em; text-transform: uppercase; color: var(--color-primary); }
[dir="rtl"] .footer__tag { letter-spacing: 0; }
.footer__meta { font-size: var(--text-sm); color: var(--color-text-muted); }

/* Respect user preferences (UI-KIT §10) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* AM Studio footer credit (UI-KIT.md §13): Designed & built by [AM] Studio · email. Copied as-is. */
.credit { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; margin-top: var(--space-8, 32px); padding-top: var(--space-6, 24px); border-top: 1px solid var(--color-border-subtle, rgba(127, 127, 160, 0.18)); font-size: var(--text-sm, 0.875rem); color: var(--color-text-muted, #75738f); }
.credit .credit-brand { display: inline-flex; align-items: center; gap: 8px; color: var(--color-text-primary, inherit); font-weight: 800; letter-spacing: -0.01em; text-decoration: none; transition: color 200ms; direction: ltr; }
.credit a.credit-brand:hover { color: #7f77dd; }
.credit .am-icon { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 10px; background: linear-gradient(160deg, #fffaf3, #fdf1e3); box-shadow: 0 6px 16px rgba(10, 20, 48, 0.18), inset 0 0 0 1px rgba(10, 20, 48, 0.06); transition: transform 300ms cubic-bezier(0.34, 1.56, 0.64, 1); }
.credit a.credit-brand:hover .am-icon { transform: rotate(-6deg) scale(1.06); }
.credit .am-icon img { display: block; width: 27px; height: auto; }
.credit-mail { color: var(--color-text-muted, #75738f); direction: ltr; unicode-bidi: isolate; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; transition: color 200ms, text-decoration-color 200ms; }
.credit-mail::before { content: '·'; margin-inline-end: 10px; color: var(--color-text-muted, #75738f); display: inline-block; }
.credit-mail:hover { color: var(--color-text-primary, inherit); text-decoration-color: currentColor; }
@media (prefers-reduced-motion: reduce) { .credit .am-icon { transition: none; } }
/* Inside the centred footer: full width, and the darker brown for the label (the light grey is too faint for small text on white) */
.footer .credit { width: 100%; --color-text-muted: var(--color-text-secondary); }
