/* ==========================================================================
   Niwas Interior brand layer
   Animated brand hero, 3D-to-reality story, guarantee band, reels, portfolio,
   Google profile section, media viewer and the redesigned chat assistant.
   Loaded after site.css and experience.css.
   ========================================================================== */

:root {
  --niwas-plum: #2b1d29;
  --niwas-plum-2: #453342;
  --niwas-gold: #d4a75f;
  --niwas-gold-2: #f3d9a4;
  --niwas-coral: #ef5b62;
  --niwas-cream: #fbf6ef;
  --niwas-gradient: linear-gradient(100deg, #f3d9a4 0%, #d4a75f 35%, #ef5b62 75%, #f08a6b 100%);
  --niwas-ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- shared brand helpers ---------- */
.brand-gradient-text {
  background: var(--niwas-gradient);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: niwasShimmer 6s ease-in-out infinite;
}
@keyframes niwasShimmer { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

.brand-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  color: #9a6a35;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.brand-eyebrow::before { content: ""; width: 28px; height: 2px; background: var(--niwas-gradient); border-radius: 2px; }
.brand-heading { max-width: 760px; margin: 0 auto 40px; text-align: center; }
.brand-heading h2 { margin: 0 0 14px; font-family: var(--font-heading); font-size: clamp(1.9rem, 3.6vw, 3rem); line-height: 1.12; letter-spacing: -.03em; color: var(--niwas-plum); }
.brand-heading p { margin: 0 auto; max-width: 62ch; color: var(--muted); font-size: 1.05rem; }
.brand-heading--light h2 { color: #fff; }
.brand-heading--light p { color: #e9dfe6; }
.brand-heading--light .brand-eyebrow { color: var(--niwas-gold-2); }
.brand-heading--split { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; max-width: none; text-align: left; }
.brand-heading--split p { margin: 0; }

/* ---------- animated hero ---------- */
.brand-hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: radial-gradient(120% 120% at 0% 0%, #4a3247 0%, var(--niwas-plum) 48%, #1b1219 100%);
  color: #fff;
}
.brand-hero__bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.brand-orb { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; animation: niwasFloat 18s ease-in-out infinite; }
.brand-orb--a { width: 520px; height: 520px; left: -140px; top: -160px; background: #ef5b62; opacity: .35; }
.brand-orb--b { width: 460px; height: 460px; right: -120px; top: 10%; background: #d4a75f; opacity: .32; animation-delay: -6s; }
.brand-orb--c { width: 380px; height: 380px; left: 35%; bottom: -220px; background: #8a4f86; opacity: .4; animation-delay: -12s; }
.brand-grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 30% 40%, #000 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 30% 40%, #000 0%, transparent 70%);
  animation: niwasGrid 30s linear infinite;
}
@keyframes niwasFloat { 0%, 100% { transform: translate(0, 0) scale(1); } 33% { transform: translate(60px, 40px) scale(1.08); } 66% { transform: translate(-40px, 30px) scale(.95); } }
@keyframes niwasGrid { to { background-position: 56px 56px, 56px 56px; } }

.brand-hero__inner { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(28px, 5vw, 72px); align-items: center; padding: clamp(48px, 7vw, 96px) 0 clamp(40px, 5vw, 72px); }
.brand-pill { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 22px; padding: 8px 14px; border: 1px solid rgba(243,217,164,.35); border-radius: 999px; background: rgba(255,255,255,.06); color: var(--niwas-gold-2); font-size: .82rem; font-weight: 700; backdrop-filter: blur(6px); animation: niwasRise .8s var(--niwas-ease) both; }
.brand-pill__dot { width: 8px; height: 8px; border-radius: 50%; background: #3ddc84; box-shadow: 0 0 0 0 rgba(61,220,132,.6); animation: niwasPing 2s infinite; }
@keyframes niwasPing { 70% { box-shadow: 0 0 0 10px rgba(61,220,132,0); } 100% { box-shadow: 0 0 0 0 rgba(61,220,132,0); } }

.brand-title { margin: 0 0 22px; font-family: var(--font-heading); font-weight: 800; letter-spacing: -.035em; line-height: 1.04; font-size: clamp(2.4rem, 5.6vw, 4.6rem); }
.brand-title__kicker { display: block; margin-bottom: 14px; font-size: clamp(.95rem, 1.4vw, 1.1rem); font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--niwas-gold); animation: niwasRise .8s .05s var(--niwas-ease) both; }
.brand-title__line { display: block; animation: niwasRise .9s var(--niwas-ease) both; }
.brand-title__line:nth-child(2) { animation-delay: .12s; }
.brand-title__line:nth-child(3) { animation-delay: .24s; }
.brand-rotator { display: inline-block; min-width: 1ch; }
.brand-rotator__word { display: inline-block; background: var(--niwas-gradient); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: niwasShimmer 6s ease-in-out infinite; transition: opacity .3s ease, transform .32s var(--niwas-ease), filter .3s ease; }
.brand-rotator__word.is-leaving { opacity: 0; transform: translateY(-0.4em); filter: blur(6px); }
.brand-rotator__word.is-entering { animation: niwasWordIn .45s var(--niwas-ease) both, niwasShimmer 6s ease-in-out infinite; }
@keyframes niwasWordIn { from { opacity: 0; transform: translateY(.45em); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes niwasRise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

.brand-hero__lead { max-width: 56ch; margin: 0 0 30px; color: #eadfe7; font-size: clamp(1rem, 1.3vw, 1.15rem); line-height: 1.7; animation: niwasRise .9s .32s var(--niwas-ease) both; }
.brand-hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-bottom: 34px; animation: niwasRise .9s .42s var(--niwas-ease) both; }
.brand-btn { position: relative; overflow: hidden; padding: 16px 26px; border-radius: 999px; background: var(--niwas-gradient) !important; background-size: 200% 100% !important; color: #2b1d29 !important; font-weight: 800; box-shadow: 0 14px 34px rgba(239,91,98,.35); animation: niwasShimmer 5s ease-in-out infinite; }
.brand-btn::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.55) 50%, transparent 70%); transform: translateX(-120%); animation: niwasSweep 3.4s ease-in-out infinite; }
@keyframes niwasSweep { 60%, 100% { transform: translateX(120%); } }
.brand-ghost { display: inline-flex; align-items: center; gap: 12px; color: #fff; font-weight: 700; }
.brand-ghost__play { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.08); font-size: .8rem; transition: transform .25s var(--niwas-ease), background .25s; }
.brand-ghost:hover .brand-ghost__play { transform: scale(1.08); background: rgba(255,255,255,.18); }
.brand-chips { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; animation: niwasRise .9s .52s var(--niwas-ease) both; }
.brand-chips li { padding: 12px 12px 10px; border: 1px solid rgba(255,255,255,.12); border-radius: 16px; background: rgba(255,255,255,.05); color: #d9ccd6; font-size: .78rem; line-height: 1.35; }
.brand-chips strong { display: block; color: #fff; font-family: var(--font-heading); font-size: 1.35rem; }

.brand-hero__stage { position: relative; min-height: 460px; perspective: 1400px; }
.brand-stack { position: relative; height: 100%; min-height: 460px; transform-style: preserve-3d; animation: niwasRise 1s .2s var(--niwas-ease) both; }
.brand-stack__card { position: absolute; overflow: hidden; border-radius: 26px; border: 1px solid rgba(255,255,255,.18); background: #1b1219; box-shadow: 0 30px 70px rgba(0,0,0,.45); transition: transform 1s var(--niwas-ease), opacity 1s ease, z-index 0s .5s; }
.brand-stack__card img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.04); animation: niwasKen 14s ease-in-out infinite alternate; }
@keyframes niwasKen { to { transform: scale(1.14) translate(-2%, -1%); } }
.brand-stack__card span { position: absolute; left: 14px; bottom: 14px; padding: 7px 12px; border-radius: 999px; background: rgba(27,18,25,.72); color: #fff; font-size: .78rem; font-weight: 700; backdrop-filter: blur(6px); }
.brand-stack__card--1 { inset: 0 8% 14% 0; transform: rotateY(-8deg) rotateX(3deg); z-index: 3; }
.brand-stack__card--2 { inset: 22% 0 0 34%; transform: rotateY(-8deg) translateZ(-60px); z-index: 2; opacity: .9; }
.brand-stack__card--3 { inset: 46% 52% -4% -4%; transform: rotateY(-8deg) translateZ(-120px); z-index: 1; opacity: .85; }
.brand-stack__card.is-active { z-index: 4; opacity: 1; box-shadow: 0 40px 90px rgba(0,0,0,.55), 0 0 0 2px rgba(212,167,95,.55); }
.brand-stack__badge { position: absolute; right: -6px; top: 8%; z-index: 6; display: grid; gap: 2px; padding: 14px 18px; border-radius: 18px; background: #fff; color: var(--niwas-plum); box-shadow: 0 20px 40px rgba(0,0,0,.3); animation: niwasBob 5s ease-in-out infinite; }
.brand-stack__badge strong { font-family: var(--font-heading); font-size: 1.15rem; }
.brand-stack__badge span { color: var(--muted); font-size: .78rem; }
@keyframes niwasBob { 50% { transform: translateY(-10px); } }

.brand-marquee { overflow: hidden; border-top: 1px solid rgba(255,255,255,.1); background: rgba(0,0,0,.18); }
.brand-marquee__track { display: flex; align-items: center; gap: 26px; width: max-content; padding: 16px 0; animation: niwasMarquee 38s linear infinite; }
.brand-marquee__track span { color: #f1e6ee; font-family: var(--font-heading); font-size: clamp(1rem, 1.6vw, 1.25rem); font-weight: 700; white-space: nowrap; }
.brand-marquee__track i { color: var(--niwas-gold); font-style: normal; }
@keyframes niwasMarquee { to { transform: translateX(-50%); } }

/* ---------- consultation tweaks ---------- */
.consult-points { display: grid; gap: 10px; margin: 18px 0; padding: 0; list-style: none; }
.consult-points li { position: relative; padding-left: 30px; color: var(--muted-strong); font-weight: 600; }
.consult-points li::before { content: "✓"; position: absolute; left: 0; top: 1px; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #e7f6ec; color: #138a46; font-size: .72rem; font-weight: 900; }

/* ---------- vision → 3D → reality ---------- */
.vision-real { background: linear-gradient(180deg, var(--niwas-cream) 0%, #fff 100%); }
.vision-steps { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; gap: 18px; align-items: stretch; margin: 0 0 48px; padding: 0; list-style: none; }
.vision-step { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--border); border-radius: 24px; background: #fff; box-shadow: var(--shadow-soft); transition: transform .35s var(--niwas-ease), box-shadow .35s; }
.vision-step:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.vision-step__media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; }
.vision-step__media img, .vision-step__media picture { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--niwas-ease); }
.vision-step:hover .vision-step__media img { transform: scale(1.06); }
.vision-step__tag { position: absolute; left: 12px; top: 12px; padding: 6px 12px; border-radius: 999px; background: rgba(43,29,41,.82); color: #fff; font-size: .75rem; font-weight: 700; }
.vision-step__body { padding: 20px 22px 24px; }
.vision-step__n { display: inline-block; margin-bottom: 6px; font-family: var(--font-heading); font-size: 2rem; font-weight: 800; line-height: 1; background: var(--niwas-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.vision-step h3 { margin: 0 0 8px; color: var(--niwas-plum); font-size: 1.25rem; }
.vision-step p { margin: 0; color: var(--muted); }
.vision-arrow { display: grid; place-items: center; color: var(--niwas-gold); font-size: 1.8rem; animation: niwasNudge 2s ease-in-out infinite; }
@keyframes niwasNudge { 50% { transform: translateX(6px); } }
.vision-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-bottom: 28px; }
.vision-compare__col { padding: 20px; border-radius: 24px; background: #fff; border: 1px solid var(--border); }
.vision-compare__col h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 1.05rem; color: var(--niwas-plum); }
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot--3d { background: var(--niwas-gold); }
.dot--site { background: #2fb36a; }
.vision-compare__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.vision-compare__grid .work-tile figcaption em { display: none; }

/* ---------- work tiles & gallery ---------- */
.work-tile { position: relative; margin: 0; overflow: hidden; border-radius: 18px; background: #eee; }
.work-tile__open { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.work-tile img, .work-tile picture { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .7s var(--niwas-ease); }
.work-tile:hover img { transform: scale(1.07); }
.work-tile figcaption { position: absolute; inset: auto 0 0 0; display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; padding: 28px 12px 10px; background: linear-gradient(180deg, transparent, rgba(27,18,25,.82)); color: #fff; font-size: .82rem; font-weight: 700; pointer-events: none; }
.work-tile figcaption em { flex: none; padding: 3px 8px; border-radius: 999px; background: rgba(255,255,255,.18); font-style: normal; font-size: .68rem; letter-spacing: .04em; }
.work-tile[data-work-cat="site"] figcaption em { background: #2fb36a; }
.work-filters { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 26px; }
.work-filter { padding: 9px 16px; border: 1px solid var(--border); border-radius: 999px; background: #fff; color: var(--muted-strong); font-weight: 700; cursor: pointer; transition: all .2s; }
.work-filter:hover { border-color: var(--niwas-gold); }
.work-filter.is-active { border-color: var(--niwas-plum); background: var(--niwas-plum); color: #fff; }
.work-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.work-grid .work-tile:nth-child(7n + 1) { grid-column: span 2; grid-row: span 2; }
.work-grid .work-tile:nth-child(7n + 1) img { aspect-ratio: auto; height: 100%; }
.work-grid .work-tile[hidden] { display: none; }
.work-marquee { margin-top: 44px; overflow: hidden; }
.work-marquee__track { display: flex; gap: 14px; width: max-content; animation: niwasMarquee 60s linear infinite; }
.work-marquee__track img, .work-marquee__track picture { width: 280px; height: 190px; object-fit: cover; border-radius: 16px; }
.work-marquee:hover .work-marquee__track { animation-play-state: paused; }

/* ---------- guarantee band ---------- */
.guarantee-band { position: relative; overflow: hidden; isolation: isolate; padding: clamp(56px, 8vw, 104px) 0; background: radial-gradient(120% 120% at 100% 0%, #4a3247 0%, var(--niwas-plum) 55%, #1b1219 100%); color: #fff; }
.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 26px; }
.stat { padding: 22px; border: 1px solid rgba(255,255,255,.12); border-radius: 22px; background: rgba(255,255,255,.05); backdrop-filter: blur(6px); text-align: center; }
.stat strong { display: block; font-family: var(--font-heading); font-size: clamp(2rem, 3.4vw, 2.9rem); line-height: 1.1; background: var(--niwas-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat > span { color: #d9ccd6; font-size: .9rem; }
.promise-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.promise-card { padding: 24px; border-radius: 22px; background: #fff; color: var(--text); transition: transform .3s var(--niwas-ease); }
.promise-card:hover { transform: translateY(-6px); }
.promise-card__icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 14px; border-radius: 14px; background: linear-gradient(135deg, #fbe9d0, #fde1e2); color: var(--niwas-plum-2); }
.promise-card__icon svg { width: 24px; height: 24px; }
.promise-card h3 { margin: 0 0 6px; color: var(--niwas-plum); font-size: 1.1rem; }
.promise-card p { margin: 0; color: var(--muted); font-size: .94rem; }

/* ---------- scale cards ---------- */
.scale-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.scale-card { position: relative; display: block; overflow: hidden; min-height: 360px; border-radius: 24px; color: #fff; }
.scale-card img, .scale-card picture { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .9s var(--niwas-ease); }
.scale-card:hover img { transform: scale(1.08); }
.scale-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(27,18,25,0) 30%, rgba(27,18,25,.9) 100%); }
.scale-card__body { position: absolute; inset: auto 0 0 0; z-index: 1; display: grid; gap: 6px; padding: 22px; }
.scale-card__body strong { font-family: var(--font-heading); font-size: 1.3rem; }
.scale-card__body span { color: #eadfe7; font-size: .92rem; }
.scale-card__body em { color: var(--niwas-gold-2); font-style: normal; font-weight: 700; font-size: .88rem; }

/* ---------- reels ---------- */
.reels-section { overflow: hidden; background: linear-gradient(180deg, #fff 0%, var(--niwas-cream) 100%); }
.reels-controls { display: flex; gap: 8px; }
.reels-btn { display: grid; place-items: center; width: 46px; height: 46px; border: 1px solid var(--border); border-radius: 50%; background: #fff; color: var(--niwas-plum); font-weight: 800; cursor: pointer; transition: all .2s; }
.reels-btn:hover { background: var(--niwas-plum); color: #fff; }
.reels-track { display: flex; gap: 16px; overflow-x: auto; padding: 8px max(16px, calc((100vw - 1180px) / 2)) 26px; scrollbar-width: none; scroll-snap-type: none; }
.reels-track::-webkit-scrollbar { display: none; }
.reel-card { position: relative; flex: 0 0 auto; width: clamp(200px, 22vw, 260px); aspect-ratio: 9 / 16; overflow: hidden; border-radius: 22px; background: #1b1219; box-shadow: 0 18px 40px rgba(43,29,41,.22); transition: transform .35s var(--niwas-ease); }
.reel-card:hover { transform: translateY(-6px) scale(1.01); }
.reel-card__video, .reel-card__thumb, .reel-card picture { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.reel-card--yt .reel-card__thumb { transform: scale(1.35); }
.reel-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.05) 50%, rgba(0,0,0,.78) 100%); pointer-events: none; }
.reel-card__open { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; border: 0; background: transparent; cursor: pointer; }
.reel-card__play { display: grid; place-items: center; width: 56px; height: 56px; padding-left: 4px; border-radius: 50%; background: rgba(255,255,255,.22); color: #fff; font-size: 1.1rem; backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.4); transition: transform .25s var(--niwas-ease), background .25s; }
.reel-card:hover .reel-card__play { transform: scale(1.12); background: var(--niwas-coral); }
.reel-card__meta { position: absolute; inset: auto 0 0 0; z-index: 1; display: grid; gap: 6px; padding: 14px; color: #fff; pointer-events: none; }
.reel-card__meta strong { font-size: .95rem; line-height: 1.3; }
.reel-card__badge { justify-self: start; padding: 4px 9px; border-radius: 999px; background: var(--niwas-gold); color: var(--niwas-plum); font-size: .68rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.reel-card__badge--yt { background: #ff0033; color: #fff; }
.yt-block { margin-top: 18px; padding: clamp(20px, 3vw, 32px); border: 1px solid var(--border); border-radius: 26px; background: #fff; }
.yt-block__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.yt-block__head h3 { margin: 0; color: var(--niwas-plum); font-size: 1.3rem; }
.yt-subscribe { background: #ff0033 !important; border-color: #ff0033 !important; color: #fff !important; }
.yt-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.yt-card { display: grid; gap: 10px; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; }
.yt-card__thumb { position: relative; display: grid; place-items: center; overflow: hidden; aspect-ratio: 16 / 9; border-radius: 16px; background: #000; }
.yt-card__thumb img, .yt-card__thumb picture { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--niwas-ease); }
.yt-card:hover .yt-card__thumb img { transform: scale(1.06); }
.yt-card__thumb .reel-card__play { position: relative; z-index: 1; background: rgba(255,0,51,.9); border: 0; }
.yt-card__title { color: var(--niwas-plum); font-weight: 700; line-height: 1.35; }

/* ---------- Google profile ---------- */
.gbp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 4vw, 56px); align-items: center; }
.gbp-grid h2 { margin: 0 0 12px; font-family: var(--font-heading); font-size: clamp(1.8rem, 3vw, 2.6rem); line-height: 1.15; color: var(--niwas-plum); }
.gbp-list { display: grid; gap: 8px; margin: 18px 0 22px; padding: 0; list-style: none; }
.gbp-list li { position: relative; padding-left: 28px; color: var(--muted-strong); }
.gbp-list li::before { content: "📍"; position: absolute; left: 0; }
.gbp-map { overflow: hidden; min-height: 360px; border-radius: 26px; border: 1px solid var(--border); box-shadow: var(--shadow-soft); }
.gbp-map iframe { width: 100%; height: 100%; min-height: 360px; border: 0; display: block; }

/* ---------- media viewer ---------- */
.media-modal[hidden] { display: none; }
.media-modal { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 16px; }
.media-modal__backdrop { position: absolute; inset: 0; background: rgba(15,10,14,.86); backdrop-filter: blur(6px); }
.media-modal__box { position: relative; z-index: 1; display: grid; gap: 12px; width: min(960px, 100%); max-height: calc(100dvh - 32px); animation: niwasRise .35s var(--niwas-ease) both; }
.media-modal__stage { overflow: hidden; border-radius: 20px; background: #000; aspect-ratio: 16 / 9; }
.media-modal__stage.is-portrait { width: min(420px, 100%); justify-self: center; aspect-ratio: 9 / 16; max-height: calc(100dvh - 180px); }
.media-modal__stage video, .media-modal__stage iframe, .media-modal__stage img { display: block; width: 100%; height: 100%; border: 0; object-fit: contain; background: #000; }
.media-modal__stage:has(img) { aspect-ratio: auto; max-height: calc(100dvh - 180px); }
.media-modal__caption { margin: 0; color: #fff; text-align: center; font-weight: 700; }
.media-modal__cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.media-modal__cta .btn-outline { color: #fff; border-color: rgba(255,255,255,.5); }
.media-modal__close { position: absolute; right: -6px; top: -48px; width: 42px; height: 42px; border: 0; border-radius: 50%; background: #fff; color: var(--niwas-plum); font-size: 1.6rem; line-height: 1; cursor: pointer; }
html.has-media-modal { overflow: hidden; }

/* ---------- chat assistant ---------- */
.chat-teaser { position: relative; display: flex; align-items: center; max-width: 300px; border-radius: 18px; background: #fff; box-shadow: 0 16px 40px rgba(43,29,41,.22); border: 1px solid var(--border); opacity: 0; transform: translateY(10px) scale(.96); transition: opacity .3s ease, transform .35s var(--niwas-ease); }
.chat-teaser.is-visible { opacity: 1; transform: none; }
.chat-teaser[hidden] { display: none; }
.chat-teaser__open { display: flex; align-items: center; gap: 10px; padding: 12px 34px 12px 12px; border: 0; background: none; text-align: left; cursor: pointer; color: var(--text); }
.chat-teaser__open strong { display: block; color: var(--niwas-plum); font-size: .92rem; }
.chat-teaser__open span span { display: block; color: var(--muted); font-size: .8rem; line-height: 1.35; }
.chat-teaser__avatar { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: var(--niwas-gradient); color: var(--niwas-plum); font-weight: 900; }
.chat-teaser__close { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border: 0; border-radius: 50%; background: var(--surface-soft); color: var(--muted-strong); font-size: 1rem; line-height: 1; cursor: pointer; }
.fab--chat { position: relative; background: linear-gradient(135deg, #453342, #2b1d29); }

.niwas-chat.support-drawer--chat { width: min(400px, calc(100% - 24px)); height: min(620px, calc(100dvh - 120px)); bottom: 96px; z-index: 1400; }
.niwas-chat .chat-avatar { overflow: visible; background: #fff; }
.niwas-chat .chat-avatar img { width: 100%; height: 100%; object-fit: contain; border-radius: 50%; padding: 4px; }
.niwas-chat .chat-header__name { font-size: 1rem; }
.niwas-chat .chat-header__role { font-size: .72rem; opacity: .85; }
.niwas-chat .chat-messages { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px; background: #faf6f2; }
.niwas-chat .chat-msg__avatar { background: var(--niwas-gradient); color: var(--niwas-plum); font-weight: 900; }
.niwas-chat .chat-msg__bubble { font-size: .92rem; line-height: 1.55; }
.niwas-chat .chat-options { flex-wrap: wrap; gap: 6px; max-height: 132px; overflow-y: auto; padding: 10px 12px; border-top: 1px solid var(--border); background: #fff; }
.niwas-chat .chat-options[hidden] { display: none; }
.niwas-chat .chat-chip { padding: 7px 12px; font-size: .8rem; }
.niwas-chat .chat-quick-strip { padding: 8px 12px; }
.chat-privacy { margin: 0; padding: 0 12px 10px; color: var(--muted); font-size: .68rem; text-align: center; }
.chat-privacy a { text-decoration: underline; }
.chat-typing { display: inline-flex; gap: 4px; padding: 4px 2px; }
.chat-typing span { width: 7px; height: 7px; border-radius: 50%; background: #b9a7b5; animation: niwasTyping 1s infinite ease-in-out; }
.chat-typing span:nth-child(2) { animation-delay: .15s; }
.chat-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes niwasTyping { 0%, 80%, 100% { transform: translateY(0); opacity: .5; } 40% { transform: translateY(-5px); opacity: 1; } }
.chat-inline-link { color: #b2453f; font-weight: 700; text-decoration: underline; }
.chat-lead-card { display: grid; gap: 6px; }
.chat-lead-card > strong { color: var(--niwas-plum); }
.chat-lead-card > span { color: var(--muted); font-size: .82rem; }
.chat-lead-card form { display: grid; gap: 8px; margin-top: 6px; }
.chat-lead-card input { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; font: inherit; font-size: 16px; background: #fff; }
.chat-lead-card input:focus { outline: 2px solid var(--niwas-gold); border-color: transparent; }
.chat-lead-card__btn { padding: 11px 14px; border: 0; border-radius: 12px; background: var(--niwas-plum-2); color: #fff; font-weight: 800; cursor: pointer; }
.chat-lead-card__btn:disabled { opacity: .6; }
.chat-lead-card__error { margin: 0; color: #b42318; font-size: .8rem; }

/* ---------- admin visitors ---------- */
.admin-visitors { margin-top: 40px; }
.visitor-table td { vertical-align: top; font-size: .85rem; }
.visitor-table tr.is-contact { background: #fff8e8; }
.visitor-table .muted { color: var(--muted); }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .brand-hero__inner { grid-template-columns: 1fr; }
  .brand-hero__stage { min-height: 380px; }
  .brand-stack { min-height: 380px; }
  .vision-steps { grid-template-columns: 1fr; }
  .vision-arrow { transform: rotate(90deg); animation: none; }
  .stat-row, .promise-grid, .scale-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .work-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .yt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .brand-hero__inner { padding-top: 36px; }
  .brand-title { font-size: clamp(2.1rem, 9.5vw, 2.8rem); }
  .brand-rotator { display: block; }
  .brand-chips { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .brand-hero__stage, .brand-stack { min-height: 300px; }
  .brand-stack__card--3 { display: none; }
  .brand-stack__badge { right: 4px; top: auto; bottom: 2%; padding: 10px 14px; }
  .brand-heading { margin-bottom: 28px; text-align: left; }
  .brand-heading--split { flex-direction: column; align-items: flex-start; }
  .vision-compare { grid-template-columns: 1fr; }
  .stat-row { gap: 10px; }
  .stat { padding: 16px 10px; }
  .promise-grid, .scale-grid { grid-template-columns: 1fr; }
  .scale-card { min-height: 260px; }
  .work-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .work-grid .work-tile:nth-child(7n + 1) { grid-row: auto; }
  .work-grid .work-tile:nth-child(7n + 1) img { aspect-ratio: 4 / 3; }
  .work-filters { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; margin-inline: -16px; padding: 0 16px 6px; scrollbar-width: none; }
  .work-filter { flex: none; }
  .reel-card { width: 62vw; max-width: 240px; }
  .yt-grid { grid-template-columns: 1fr; }
  .gbp-grid { grid-template-columns: 1fr; }
  .gbp-map, .gbp-map iframe { min-height: 280px; }
  .media-modal__close { top: -46px; right: 0; }

  /* Chat becomes a bottom sheet that sits above the contact bar and never covers the whole page. */
  .niwas-chat.support-drawer--chat { left: 0; right: 0; bottom: 0; width: 100%; max-width: none; height: min(78dvh, 640px); border-radius: 22px 22px 0 0; padding-bottom: env(safe-area-inset-bottom); transform: translateY(100%); }
  .niwas-chat.support-drawer--chat.is-open { transform: translateY(0); }
  html.has-chat-open .floating-stack, html.has-chat-open .brand-scroll { display: none; }
  .chat-teaser { max-width: calc(100vw - 96px); }
  .chat-teaser__open { padding: 10px 32px 10px 10px; }
  .chat-teaser__open span span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .brand-orb, .brand-grid, .brand-marquee__track, .work-marquee__track, .brand-stack__card img, .brand-stack__badge, .brand-btn, .brand-btn::after, .brand-gradient-text, .brand-rotator__word, .vision-arrow { animation: none !important; }
  .brand-pill, .brand-title__kicker, .brand-title__line, .brand-hero__lead, .brand-hero__actions, .brand-chips, .brand-stack { animation: none !important; }
}

/* ---------- fixes after visual QA ---------- */
.brand-hero .brand-title, .brand-hero .brand-title__line { color: #fff; }
.niwas-chat .chat-cta-btn { display: inline-flex; align-items: center; gap: 8px; }
.niwas-chat .chat-cta-btn svg { flex: none; width: 18px; height: 18px; }
.niwas-chat .chat-success-actions { margin-top: 10px; }
/* Portfolio: fixed row heights so every tile crops consistently. */
.work-grid { grid-auto-rows: clamp(150px, 15vw, 210px); grid-auto-flow: dense; }
.work-tile, .work-tile__open, .work-tile picture { height: 100%; }
.work-tile img, .work-grid .work-tile:nth-child(7n + 1) img { width: 100%; height: 100%; aspect-ratio: auto; object-fit: cover; }
.vision-compare__grid .work-tile { aspect-ratio: 4 / 3; }
@media (max-width: 760px) {
  .brand-rotator { min-height: 2.15em; }
  .work-grid { grid-auto-rows: 150px; }
  .work-grid .work-tile:nth-child(7n + 1) { grid-row: span 2; }
}

/* ==========================================================================
   Inner-page brand hero (applies to every service, area, guide and project page)
   ========================================================================== */
.page-hero__panel { position: relative; isolation: isolate; background: radial-gradient(120% 140% at 0% 0%, #4a3247 0%, var(--niwas-plum) 55%, #1b1219 100%); color: #fff; box-shadow: 0 30px 70px rgba(43,29,41,.28); }
.page-hero__panel::before, .page-hero__panel::after { content: ""; position: absolute; z-index: -1; border-radius: 50%; filter: blur(60px); pointer-events: none; animation: niwasFloat 18s ease-in-out infinite; }
.page-hero__panel::before { width: 360px; height: 360px; left: -120px; top: -140px; background: rgba(239,91,98,.45); }
.page-hero__panel::after { width: 320px; height: 320px; left: 38%; bottom: -200px; background: rgba(212,167,95,.4); animation-delay: -8s; }
.page-hero__content h1 { color: #fff; letter-spacing: -.03em; animation: niwasRise .8s var(--niwas-ease) both; }
.page-hero__content .lead { color: #eadfe7; animation: niwasRise .8s .1s var(--niwas-ease) both; }
.page-hero__content .eyebrow { color: var(--niwas-gold-2); }
.page-hero__actions { animation: niwasRise .8s .2s var(--niwas-ease) both; }
.page-hero__actions .btn { background: var(--niwas-gradient); background-size: 200% 100%; color: var(--niwas-plum); border: 0; font-weight: 800; animation: niwasShimmer 6s ease-in-out infinite; }
.page-hero__actions .btn-outline { color: #fff; border-color: rgba(255,255,255,.45); background: transparent; }
.page-hero__actions .btn-outline:hover { background: rgba(255,255,255,.1); }
.page-hero__media { position: relative; overflow: hidden; }
.page-hero__media img { animation: niwasKen 16s ease-in-out infinite alternate; }
.page-hero__media--contain { background: rgba(255,255,255,.06); }
.page-hero__media--contain img { animation: none; }

/* ---------- intent chooser ---------- */
.intent-chooser { padding: clamp(40px, 6vw, 72px) 0; background: #fff; }
.intent-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.intent-card { display: grid; align-content: start; gap: 8px; padding: 22px 18px; border: 1px solid var(--border); border-radius: 22px; background: linear-gradient(180deg, #fff, var(--niwas-cream)); color: var(--text); transition: transform .3s var(--niwas-ease), box-shadow .3s, border-color .3s; }
.intent-card:hover { transform: translateY(-6px); border-color: var(--niwas-gold); box-shadow: var(--shadow-soft); }
.intent-card__icon { font-size: 1.8rem; }
.intent-card strong { color: var(--niwas-plum); font-family: var(--font-heading); font-size: 1.1rem; }
.intent-card span:not(.intent-card__icon) { color: var(--muted); font-size: .9rem; line-height: 1.45; }
.intent-card em { margin-top: 6px; color: #b2453f; font-style: normal; font-weight: 800; font-size: .88rem; }
.intent-card--primary { background: linear-gradient(140deg, #4a3247, var(--niwas-plum)); border-color: transparent; }
.intent-card--primary strong { color: #fff; }
.intent-card--primary span:not(.intent-card__icon) { color: #e3d6df; }
.intent-card--primary em { color: var(--niwas-gold-2); }

/* ---------- smarter forms ---------- */
.hp-field { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-field { display: grid; gap: 4px; font-size: .78rem; font-weight: 700; color: var(--muted-strong); }
.form-field input, .form-field select { width: 100%; }
.consult-card--appointment .consult-card__step { background: #e8f0ff; color: #1f4fb8; }
.consult-card--partnership .consult-card__step { background: #f2e9ff; color: #6b3fb0; }
.consult-card--vendor .consult-card__step { background: #fff3dc; color: #8a5a12; }
.consult-card--career .consult-card__step { background: #dcf5f1; color: #0f6b62; }
.form-status:not(.is-error) { border-left: 4px solid #2fb36a; }
.check-list { display: grid; gap: 10px; margin: 14px 0; padding: 0; list-style: none; }
.check-list li { position: relative; padding-left: 30px; color: var(--muted-strong); }
.check-list li::before { content: "✓"; position: absolute; left: 0; top: 1px; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #e7f6ec; color: #138a46; font-size: .72rem; font-weight: 900; }
.appointment-info { display: grid; gap: 16px; align-content: start; }
.appointment-steps { display: grid; gap: 12px; margin: 14px 0 0; padding-left: 20px; color: var(--muted-strong); }

/* ---------- admin: sorted submissions ---------- */
.mail-banner { margin: 6px 0 16px; padding: 12px 16px; border-radius: 14px; font-size: .9rem; }
.mail-banner.is-ok { background: #e7f6ec; color: #135c32; }
.mail-banner.is-warn { background: #fff4e0; color: #8a5a12; }
.lead-cats { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.lead-cat { display: grid; justify-items: start; gap: 2px; padding: 14px; border: 1px solid var(--border); border-radius: 16px; background: #fff; cursor: pointer; text-align: left; transition: all .2s; }
.lead-cat strong { font-family: var(--font-heading); font-size: 1.6rem; color: var(--niwas-plum); line-height: 1.1; }
.lead-cat span { font-size: .8rem; color: var(--muted-strong); font-weight: 700; }
.lead-cat em { font-style: normal; font-size: .72rem; color: #138a46; font-weight: 800; }
.lead-cat.is-active { border-color: var(--niwas-plum); background: var(--niwas-plum); }
.lead-cat.is-active strong, .lead-cat.is-active span { color: #fff; }
.lead-cat.is-active em { color: var(--niwas-gold-2); }
.lead-filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.lead-filters input { flex: 1 1 260px; }
.lead-badge { display: inline-block; padding: 3px 9px; border-radius: 999px; color: #fff; font-size: .74rem; font-weight: 800; white-space: nowrap; }
.lead-badge--customer { background: #138a46; }
.lead-badge--appointment { background: #1f6feb; }
.lead-badge--partnership { background: #8a4fd1; }
.lead-badge--vendor { background: #b7791f; }
.lead-badge--career { background: #0f766e; }
.lead-badge--spam { background: #9ca3af; }
.lead-hot { color: #d92d20; font-weight: 800; font-size: .78rem; }
.lead-warm { color: #dc6803; font-weight: 800; font-size: .78rem; }
.lead-table--smart td { vertical-align: top; font-size: .86rem; }
.lead-table--smart .lead-msg { max-width: 280px; }
.lead-row--spam { opacity: .6; }
.mail-ok { color: #138a46; font-weight: 800; }
.mail-fail { color: #d92d20; font-weight: 800; cursor: help; }

@media (max-width: 1080px) {
  .intent-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lead-cats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .intent-grid { grid-template-columns: 1fr 1fr; }
  .intent-card--primary { grid-column: 1 / -1; }
  .lead-cats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-hero__content { padding: 32px 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .page-hero__panel::before, .page-hero__panel::after, .page-hero__media img, .page-hero__actions .btn { animation: none !important; }
}
.lead-filters input, .lead-filters select { width: auto; min-height: 44px; }
.lead-filters select { flex: 0 0 180px; }
.lead-table--smart select[data-lead-mark] { min-width: 170px; width: 170px; font-size: .82rem; padding: 6px 8px; }
body[data-page="admin-leads"] .floating-stack, body[data-page="admin-leads"] .niwas-chat { display: none; }
.consult-card .consult-card__step { position: static; display: inline-flex; width: auto; height: auto; margin-bottom: 10px; padding: 6px 12px; border-radius: 999px; font-size: .74rem; font-weight: 800; letter-spacing: .04em; }
.consult-card .consult-card__step::after { display: none; }
.consult-card h3 { padding-right: 0; }
