/* home.css - homepage redesign 2026-10-03 (only linked from index.html) */

/* ---------- service cards: whole card clickable ---------- */
#service-cards .card.home-card {
  cursor: pointer;
  align-items: stretch;
}
#service-cards .card.home-card:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
#service-cards .card.home-card:hover {
  transform: none;
  box-shadow: none;
}
@media (hover: hover) {
  #service-cards .card.home-card:hover {
    z-index: 5;
    transform: scale(1.035);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.32);
  }
}
#service-cards .home-card .card-body {
  display: flex;
  flex-direction: column;
  align-content: initial;
  justify-content: flex-start;
  gap: 8px;
  min-width: 0;
}
#service-cards .home-card .card-note {
  font-size: 0.86rem;
}
#service-cards .home-card .card-badge-price {
  color: var(--accent);
}
#service-cards .home-card-actions {
  margin-top: auto;
  padding-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
#service-cards .home-card-actions .btn {
  margin-top: 0;
  justify-self: auto;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
#service-cards .home-card .home-card-details,
#home-dialogs .btn-line {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}
#service-cards .home-card .home-card-details:hover,
#service-cards .home-card .home-card-details:focus-visible {
  border-color: var(--accent);
  color: var(--text);
}

/* image motion: 3.6 s, mirrored in RTL */
#service-cards .card.home-card .card-media img {
  animation: home-ken 3.6s ease-in-out infinite alternate;
}
#service-cards .card.home-card:nth-child(2) .card-media img { animation-delay: -0.9s; }
#service-cards .card.home-card:nth-child(3) .card-media img { animation-delay: -1.8s; }
#service-cards .card.home-card:nth-child(4) .card-media img { animation-delay: -2.7s; }
[dir="rtl"] #service-cards .card.home-card .card-media img {
  animation-name: home-ken-rtl;
}
@keyframes home-ken {
  0% { transform: scale(1.02) translate(0, 0); }
  100% { transform: scale(1.08) translate(-1.5%, -1%); }
}
@keyframes home-ken-rtl {
  0% { transform: scale(1.02) translate(0, 0); }
  100% { transform: scale(1.08) translate(1.5%, -1%); }
}
@media (prefers-reduced-motion: reduce) {
  #service-cards .card.home-card .card-media img,
  [dir="rtl"] #service-cards .card.home-card .card-media img {
    animation: none;
    transform: none;
  }
  #service-cards .card.home-card,
  #service-cards .card.home-card:hover {
    transition: none;
    transform: none;
  }
}

/* desktop: image left, equal heights */
@media (min-width: 861px) {
  #service-cards.cards {
    grid-auto-rows: 1fr;
  }
  #service-cards .card.home-card {
    height: 100%;
  }
}

/* mobile: 2 columns, vertical card */
@media (max-width: 860px) {
  #service-cards.cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 10px 0;
  }
  #service-cards .card.home-card {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
  }
  #service-cards .card.home-card .card-media {
    min-height: 0;
    height: auto;
    aspect-ratio: 4 / 3;
    flex: 0 0 auto;
  }
  #service-cards .home-card .card-body {
    flex: 1 1 auto;
    padding: 10px 10px 12px;
    gap: 6px;
  }
  #service-cards .home-card h3 {
    font-size: clamp(0.92rem, 3.6vw, 1.08rem);
    line-height: 1.25;
    overflow-wrap: anywhere;
  }
  #service-cards .home-card .card-body > p:not(.card-badge) {
    font-size: 0.84rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
  }
  #service-cards .home-card .card-badge {
    font-size: 0.74rem;
  }
  #service-cards .home-card-actions {
    flex-direction: column;
    gap: 6px;
  }
  #service-cards .home-card-actions .btn {
    width: 100%;
    padding: 8px 10px;
    font-size: 0.86rem;
  }
}

/* ---------- steps ---------- */
#process .steps li {
  padding: 0;
  display: flex;
}
#process .step-card {
  width: 100%;
  min-height: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 6px 10px;
  padding: 18px;
  font: inherit;
  text-align: start;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
#process .step-card .num {
  margin-inline-end: 0;
}
#process .step-card .step-text {
  align-self: center;
  font-weight: 600;
}
#process .step-card .step-more {
  grid-column: 2;
  color: var(--accent);
  font-size: 0.84rem;
  font-weight: 700;
}
#process .step-card .step-more::after {
  content: " →";
}
[dir="rtl"] #process .step-card .step-more::after {
  content: " ←";
}
#process .step-card:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
@media (hover: hover) {
  #process .step-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
  }
}
@media (max-width: 860px) {
  #process .steps {
    grid-template-columns: 1fr;
  }
}
@media (min-width: 520px) and (max-width: 860px) {
  #process .steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---------- contact CTA box ---------- */
#contact .contact-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px 28px;
  max-width: 980px;
  padding: clamp(18px, 4vw, 34px);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line));
  border-radius: calc(var(--radius) + 6px);
  background:
    radial-gradient(600px 240px at 0% 0%, color-mix(in srgb, var(--accent-2) 16%, transparent), transparent 70%),
    radial-gradient(500px 220px at 100% 100%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
    var(--card);
  color: var(--text);
  cursor: pointer;
  box-shadow: 0 16px 36px -22px rgba(0, 0, 0, 0.5);
}
#contact .contact-box h2 {
  margin: 0 0 8px;
}
#contact .contact-box p {
  margin: 0 0 12px;
  color: var(--muted);
}
#contact .contact-box-points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
#contact .contact-box-points li {
  position: relative;
  padding-inline-start: 26px;
  font-weight: 600;
}
#contact .contact-box-points li::before {
  content: "✓";
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  color: var(--accent-2);
  font-weight: 800;
}
#contact .contact-box-cta {
  min-height: 48px;
  padding-inline: 26px;
  font-size: 1.02rem;
}
@media (hover: hover) {
  #contact .contact-box:hover {
    border-color: var(--accent);
  }
}
@media (max-width: 640px) {
  #contact .contact-box {
    grid-template-columns: 1fr;
  }
  #contact .contact-box-cta {
    width: 100%;
  }
}

/* ---------- glass dialogs ---------- */
#home-dialogs .service-dialog {
  width: min(640px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
}
html body #home-dialogs .service-dialog > .service-dialog-card,
html body #service-dialogs .service-dialog > .service-dialog-card,
html body #review-drawer > .service-dialog-card,
html body #checkout-dialog > .service-dialog-card {
  background: rgba(18, 26, 22, 0.78) !important;
  -webkit-backdrop-filter: blur(18px) saturate(1.3) !important;
  backdrop-filter: blur(18px) saturate(1.3) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 24px 60px -18px rgba(0, 0, 0, 0.6);
  max-height: calc(100dvh - 24px);
}
html:not([data-theme="dark"]) body #home-dialogs .service-dialog > .service-dialog-card,
html:not([data-theme="dark"]) body #service-dialogs .service-dialog > .service-dialog-card,
html:not([data-theme="dark"]) body #review-drawer > .service-dialog-card,
html:not([data-theme="dark"]) body #checkout-dialog > .service-dialog-card,
html.ak-light body #home-dialogs .service-dialog > .service-dialog-card,
html.ak-light body #service-dialogs .service-dialog > .service-dialog-card,
html.ak-light body #review-drawer > .service-dialog-card,
html.ak-light body #checkout-dialog > .service-dialog-card {
  background: rgba(255, 253, 248, 0.86) !important;
  border-color: rgba(185, 140, 40, 0.55) !important;
  box-shadow: 0 24px 60px -20px rgba(20, 32, 28, 0.35);
}
#home-dialogs .service-dialog::backdrop,
#service-dialogs .service-dialog::backdrop,
#review-drawer::backdrop,
#checkout-dialog::backdrop {
  background: rgba(6, 10, 8, 0.5);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  html body #home-dialogs .service-dialog > .service-dialog-card,
  html body #service-dialogs .service-dialog > .service-dialog-card,
  html body #review-drawer > .service-dialog-card,
  html body #checkout-dialog > .service-dialog-card {
    background: rgba(18, 26, 22, 0.97) !important;
  }
  html:not([data-theme="dark"]) body #home-dialogs .service-dialog > .service-dialog-card,
  html:not([data-theme="dark"]) body #service-dialogs .service-dialog > .service-dialog-card,
  html:not([data-theme="dark"]) body #review-drawer > .service-dialog-card,
  html:not([data-theme="dark"]) body #checkout-dialog > .service-dialog-card,
  html.ak-light body #home-dialogs .service-dialog > .service-dialog-card,
  html.ak-light body #service-dialogs .service-dialog > .service-dialog-card,
  html.ak-light body #review-drawer > .service-dialog-card,
  html.ak-light body #checkout-dialog > .service-dialog-card {
    background: rgba(255, 253, 248, 0.97) !important;
  }
}
@media (prefers-reduced-transparency: reduce) {
  html body #home-dialogs .service-dialog > .service-dialog-card,
  html body #service-dialogs .service-dialog > .service-dialog-card,
  html body #review-drawer > .service-dialog-card,
  html body #checkout-dialog > .service-dialog-card {
    background: rgba(18, 26, 22, 0.97) !important;
  }
  html:not([data-theme="dark"]) body #home-dialogs .service-dialog > .service-dialog-card,
  html:not([data-theme="dark"]) body #service-dialogs .service-dialog > .service-dialog-card,
  html:not([data-theme="dark"]) body #review-drawer > .service-dialog-card,
  html:not([data-theme="dark"]) body #checkout-dialog > .service-dialog-card,
  html.ak-light body #home-dialogs .service-dialog > .service-dialog-card,
  html.ak-light body #service-dialogs .service-dialog > .service-dialog-card,
  html.ak-light body #review-drawer > .service-dialog-card,
  html.ak-light body #checkout-dialog > .service-dialog-card {
    background: rgba(255, 253, 248, 0.97) !important;
  }
}

/* ---------- request form inside the dialog ---------- */
html body #contact-dialog .form {
  max-width: none;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
#contact-dialog .service-dialog-head .service-dialog-intro {
  margin: 6px 0 0;
  color: var(--muted);
  font-weight: 400;
}

/* ---------- chips ---------- */
.home-chips-wrap {
  display: grid;
  gap: 6px;
}
.home-chips-wrap[hidden] {
  display: none;
}
.home-chips-label {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--muted);
}
.home-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.home-chip {
  min-height: 34px;
  padding: 6px 12px;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 500;
  line-height: 1.3;
  text-align: start;
  color: var(--text);
  background: color-mix(in srgb, var(--card) 70%, transparent);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}
.home-chip:hover,
.home-chip:focus-visible {
  border-color: var(--accent);
  outline: none;
}
.home-chip:focus-visible {
  box-shadow: 0 0 0 2px var(--accent);
}
.home-chip.is-used {
  opacity: 0.6;
}
.home-chip.is-active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 20%, transparent);
}

/* ---------- details / step dialog content ---------- */
.home-info-card .card-badge {
  margin-bottom: 4px;
}
.home-info-card .service-dialog-intro {
  margin: 0;
  color: var(--text);
  line-height: 1.55;
}
.home-detail-block h4 {
  margin: 0 0 6px;
  font-size: 0.95rem;
  color: var(--accent);
}
.home-detail-block p,
.home-detail-block ul,
.home-step-points {
  margin: 0;
  color: var(--text);
  line-height: 1.5;
}
.home-detail-block ul,
.home-step-points {
  padding-inline-start: 1.2rem;
  display: grid;
  gap: 4px;
}
.home-detail-price p {
  font-weight: 600;
}
.home-detail-price bdi {
  white-space: nowrap;
}
.home-info-card .service-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
@media (max-width: 480px) {
  .home-info-card .service-dialog-actions .btn {
    flex: 1 1 100%;
  }
}

/* ---------- Google Maps: how it works / try it ---------- */
.maps-how-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.maps-how-list li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}
.maps-how-list strong {
  display: block;
}
.maps-how-list em {
  display: block;
  font-style: normal;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}
.maps-how-num {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-2);
  color: #042422;
  font-weight: 800;
  font-size: 0.86rem;
}
.maps-how-price {
  margin: 12px 0 0;
  font-weight: 700;
  color: var(--accent);
}
.maps-try-chips {
  margin: 6px 0 10px;
}
.maps-try-chip span {
  letter-spacing: 1px;
  color: var(--accent);
}
.maps-try-label {
  margin: 0 0 6px;
  font-size: 0.84rem;
  color: var(--muted);
}
.maps-try-stars {
  color: var(--accent);
  letter-spacing: 1px;
}

/* the pinned × (auth.js) must stay above the dialog head (head is a grid item with z-index 25) */
html body .service-dialog > .service-dialog-card > .overlay-close-bar {
  z-index: 40;
}

/* ======================================================================
   Theme-safe colours for the homepage (2026-10-03 b)
   The site sets the theme on <html>: data-theme="light|dark" plus class
   "ak-light" (theme.js / auth.js applyTheme). No attribute = light, so
   light rules use html:not([data-theme="dark"]) and html.ak-light,
   dark rules use html[data-theme="dark"]. prefers-color-scheme is not
   used by the site (light is the default), so it is not used here either.
   ====================================================================== */
html:not([data-theme="dark"]),
html.ak-light {
  --home-gold-text: #6f4d05;
  --home-gold-line: rgba(185, 140, 40, 0.55);
  --home-box: rgba(255, 255, 255, 0.66);
  --home-box-strong: rgba(255, 255, 255, 0.88);
  --home-btn-bg: #d6a93a;
  --home-btn-border: #b88a1c;
  --home-btn-text: #1a1404;
  --home-placeholder: #56625b;
  --home-num-text: #ffffff;
}
html[data-theme="dark"] {
  --home-gold-text: #e6c36a;
  --home-gold-line: rgba(230, 195, 106, 0.42);
  --home-box: rgba(11, 15, 13, 0.55);
  --home-box-strong: rgba(11, 15, 13, 0.78);
  --home-btn-bg: #d4a017;
  --home-btn-border: #d4a017;
  --home-btn-text: #1a1404;
  --home-placeholder: #a3ada7;
  --home-num-text: #042422;
}

/* lighter backdrop in light mode, so the frosted card stays light */
html:not([data-theme="dark"]) #home-dialogs .service-dialog::backdrop,
html:not([data-theme="dark"]) #service-dialogs .service-dialog::backdrop,
html.ak-light #home-dialogs .service-dialog::backdrop,
html.ak-light #service-dialogs .service-dialog::backdrop {
  background: rgba(30, 36, 32, 0.32);
}

/* dialog titles, badges, accent text */
html body #home-dialogs .service-dialog .service-dialog-head h3,
html body #service-dialogs .service-dialog .service-dialog-head h3,
html body #home-dialogs .card-badge,
html body #home-dialogs .home-detail-block h4,
html body #service-dialogs .maps-how-price,
html body #service-dialogs .maps-try-stars,
html body #service-dialogs .maps-try-chip span,
html body #service-dialogs .maps-audit-score em,
html body #service-dialogs .maps-audit-facts a,
html body #service-dialogs summary,
html body #process .step-card .step-more,
html body #service-cards .home-card .card-badge-price {
  color: var(--home-gold-text);
  text-shadow: none;
}
html body #home-dialogs .service-dialog .overlay-close-pin,
html body #service-dialogs .service-dialog .overlay-close-pin {
  color: var(--home-gold-text) !important;
  border-color: var(--home-gold-line) !important;
}

/* primary buttons in the homepage dialogs and the request box */
html body #home-dialogs .btn:not(.btn-ghost),
html body #service-dialogs .btn:not(.btn-ghost),
html body #contact .contact-box .btn {
  background: var(--home-btn-bg);
  border-color: var(--home-btn-border);
  color: var(--home-btn-text);
}
html body #home-dialogs .btn:not(.btn-ghost):hover,
html body #service-dialogs .btn:not(.btn-ghost):hover,
html body #contact .contact-box .btn:hover {
  filter: brightness(1.05);
}

/* round step numbers */
html body #process .steps .num,
html body #service-dialogs .maps-how-num {
  color: var(--home-num-text);
}

/* sample review + agent reply (Try stage) and the live audit report */
html body #service-dialogs .maps-audit-reply blockquote {
  background: var(--home-box-strong);
  color: var(--text);
  border: 1px solid var(--home-gold-line);
}
html body #service-dialogs .maps-audit-reply blockquote.is-agent {
  border-color: var(--home-gold-line);
  border-inline-start: 3px solid var(--home-btn-border);
}
html body #service-dialogs .maps-audit-reply span,
html body #service-dialogs .maps-audit-note,
html body #service-dialogs .maps-audit-facts dt,
html body #service-dialogs .maps-audit-block li em {
  color: var(--muted);
}
html body #service-dialogs .maps-audit {
  background: var(--home-box);
  border: 1px solid var(--home-gold-line);
  color: var(--text);
}
html body #service-dialogs .maps-audit-lock {
  background: var(--home-box-strong);
  border-color: var(--home-gold-line);
  color: var(--home-gold-text);
}

/* inputs: readable placeholders in both modes */
html body #home-dialogs input::placeholder,
html body #home-dialogs textarea::placeholder,
html body #service-dialogs input::placeholder,
html body #service-dialogs textarea::placeholder {
  color: var(--home-placeholder);
  opacity: 1;
}

/* used chips: no fading (kept readable), dashed border + tick instead */
.home-chip.is-used {
  opacity: 1;
  border-style: dashed;
}
.home-chip.is-used::before {
  content: "✓ ";
  color: var(--home-gold-text);
  font-weight: 700;
}

/* ======================================================================
   Service cards, round 2 (2026-10-03 b): equal heights, mobile motion,
   gold border sweep. No page-background animation here.
   ====================================================================== */

/* equal structure on every card: title, summary (3 lines), price line, buttons */
#service-cards .home-card h3 {
  line-height: 1.25;
}
#service-cards .home-card .card-body > p.card-summary {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  overflow: hidden;
  line-height: 1.45;
  min-height: calc(3 * 1.45em);
}
#service-cards .home-card .card-body > p.card-price {
  display: block;
  margin: 0;
  min-height: 1.4em;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--home-gold-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#service-cards .home-card .card-price bdi {
  unicode-bidi: isolate;
}
@media (max-width: 860px) {
  #service-cards.cards {
    grid-auto-rows: 1fr;
  }
  #service-cards .home-card h3 {
    min-height: calc(2 * 1.25em);
  }
  #service-cards .home-card .card-body > p.card-summary {
    -webkit-line-clamp: 3;
    line-clamp: 3;
    line-height: 1.4;
    min-height: calc(3 * 1.4em);
  }
  #service-cards .home-card .card-body > p.card-price {
    font-size: 0.82rem;
  }
}

/* reveal: cards rise in once when they scroll into view (JS adds .home-reveal only with IntersectionObserver) */
#service-cards.home-reveal .home-card {
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.3s ease;
}
#service-cards.home-reveal .home-card:not(.is-inview) {
  opacity: 0;
  transform: translateY(18px) scale(0.96);
}
#service-cards.home-reveal .home-card.is-inview:not(.is-settled):nth-child(even) {
  transition-delay: 90ms;
}
#service-cards.home-reveal .home-card.is-settled {
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

/* touch: soft lift once visible, gentle press on tap, livelier image motion */
@media (hover: none) {
  #service-cards .home-card.is-inview {
    box-shadow: 0 12px 26px -16px rgba(0, 0, 0, 0.42);
  }
  #service-cards .home-card:active {
    transform: scale(0.97);
    transition: transform 0.12s ease;
  }
}
@media (max-width: 860px) {
  #service-cards .card.home-card .card-media img {
    animation-name: home-ken-m;
  }
  [dir="rtl"] #service-cards .card.home-card .card-media img {
    animation-name: home-ken-m-rtl;
  }
}
@keyframes home-ken-m {
  0% { transform: scale(1.04) translate(0, 0); }
  100% { transform: scale(1.15) translate(-3%, -2%); }
}
@keyframes home-ken-m-rtl {
  0% { transform: scale(1.04) translate(0, 0); }
  100% { transform: scale(1.15) translate(3%, -2%); }
}

/* gold shine travelling around the card border (only while the card is on screen) */
@property --home-sweep {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}
#service-cards .card.home-card {
  position: relative;
  isolation: isolate;
  --home-shine: rgba(214, 169, 58, 0.95);
  --home-shine-hi: #fff4cf;
}
html:not([data-theme="dark"]) #service-cards .card.home-card,
html.ak-light #service-cards .card.home-card {
  --home-shine: rgba(176, 128, 22, 0.95);
  --home-shine-hi: #f6d77e;
}
#service-cards .card.home-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  padding: 1.5px;
  border-radius: inherit;
  pointer-events: none;
  background: conic-gradient(
    from var(--home-sweep),
    transparent 0deg 290deg,
    var(--home-shine) 335deg,
    var(--home-shine-hi) 348deg,
    transparent 360deg
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.5s ease;
}
#service-cards .card.home-card.is-shining::after {
  opacity: 1;
  animation: home-sweep 6s linear infinite;
}
#service-cards .card.home-card:nth-child(2)::after { animation-delay: -1.5s; }
#service-cards .card.home-card:nth-child(3)::after { animation-delay: -3s; }
#service-cards .card.home-card:nth-child(4)::after { animation-delay: -4.5s; }
@keyframes home-sweep {
  to { --home-sweep: 360deg; }
}

@media (prefers-reduced-motion: reduce) {
  #service-cards.home-reveal .home-card:not(.is-inview) {
    opacity: 1;
    transform: none;
  }
  #service-cards .home-card:active {
    transform: none;
  }
  #service-cards .card.home-card .card-media img,
  [dir="rtl"] #service-cards .card.home-card .card-media img {
    animation: none;
    transform: none;
  }
  #service-cards .card.home-card::after,
  #service-cards .card.home-card.is-shining::after {
    animation: none;
    opacity: 1;
    background: linear-gradient(var(--home-gold-line), var(--home-gold-line));
  }
}

/* mobile buttons: same box for <a> and <button>, label up to 2 lines, same height on every card */
@media (max-width: 860px) {
  html body #service-cards .home-card-actions .btn {
    box-sizing: border-box;
    min-height: 42px;
    padding: 6px 8px;
    font-size: 0.84rem;
    line-height: 1.2;
    white-space: normal;
    overflow-wrap: anywhere;
    hyphens: auto;
  }
}
/* card-video.css — append to the END of home.css (homepage service cards with animated clips) */
#service-cards .card-media.card-media-video {
  background: #0f1412;            /* dark while the poster/clip loads (both themes: the clips are dark) */
  overflow: hidden;
}
#service-cards .card-media .card-video {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  object-fit: cover;
  object-position: center;
  pointer-events: none;           /* the whole card stays clickable */
}
@media print {
  #service-cards .card-media .card-video { display: none; }
}

/* ======================================================================
   Readability over the gold background layer (2026-10-03 c)
   Text that sits directly on the page (not on a card or in a dialog) gets a
   soft halo in the page colour, so the moving gold thread/rain passes
   "behind" the letters instead of through them. On plain background the
   halo is invisible. Cards and dialogs have their own surface: no halo.
   ====================================================================== */
html body {
  --home-halo: var(--bg);
}
html body .section-alt,
html body .site-footer {
  --home-halo: var(--bg-soft);
}
html body :where(main, .site-footer) :where(h1, h2, h3, h4, p, li, span, a, strong, em, small, dt, dd, label, blockquote) {
  text-shadow:
    0 0 1px var(--home-halo),
    0 0 2px var(--home-halo),
    0 0 4px var(--home-halo),
    0 0 8px color-mix(in srgb, var(--home-halo) 70%, transparent);
}
html body :where(main, .site-footer) :where(.card, .reasons li, .step-card, .contact-box, .proof-card, .review-card, .review-form, .pay-marks li, dialog, .btn, button, input, select, textarea, .assistant) :where(*),
html body :where(main, .site-footer) :where(.card, .reasons li, .step-card, .contact-box, .proof-card, .review-card, .review-form, .pay-marks li, .btn, button) {
  text-shadow: none;
}
/* surfaces that had no background of their own get a near-solid page-colour plate */
html body #home .hero-actions .btn-ghost {
  background-color: color-mix(in srgb, var(--bg) 88%, transparent);
}
html body .site-footer .btn-ghost {
  background-color: color-mix(in srgb, var(--bg-soft) 90%, transparent);
}
/* hero primary button and review stars: same AA-safe gold as the dialogs */
html body #home .hero-actions .btn:not(.btn-ghost) {
  background: var(--home-btn-bg);
  border-color: var(--home-btn-border);
  color: var(--home-btn-text);
}
html body #community .review-card em {
  color: var(--home-gold-text);
}

/* hero ticker title: gold text, so it gets the halo explicitly (its own rules set the colour) */
html body #home .hero-ribbon .ticker-title,
html body #home .hero-ribbon .ticker-title span {
  text-shadow:
    0 0 1px var(--home-halo),
    0 0 2px var(--home-halo),
    0 0 4px var(--home-halo),
    0 0 8px color-mix(in srgb, var(--home-halo) 70%, transparent);
}

/* ======================================================================
   round 4 — home-fx.js: sound toggle, dialog materialize, AI typing, gold shimmer
   ====================================================================== */
/* mute button in the header bar (round 5; replaces the corner toggle) */
html body .header-tools button.fx-sound-btn {
  position: relative;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  margin: 0;
  border: 1px solid var(--home-gold-line);
  border-radius: 50%;
  background: var(--bg-soft);
  color: var(--home-gold-text);
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
html body .header-tools button.fx-sound-btn:hover {
  border-color: var(--home-gold-text);
}
html body .header-tools button.fx-sound-btn:focus-visible {
  outline: 2px solid var(--home-gold-text);
  outline-offset: 2px;
}
html body .header-tools button.fx-sound-btn.is-off {
  color: var(--muted);
  border-color: var(--line);
}
html body .header-tools button.fx-sound-btn[hidden] {
  display: none;
}
html body .header-tools button.fx-sound-btn svg {
  display: block;
  width: 18px;
  height: 18px;
}
@media (max-width: 480px) {
  html body .header-tools button.fx-sound-btn {
    width: 36px;
    height: 36px;
  }
}

/* dialog materialize: scanlines/grid + gold beam + particles assemble the panel (home-fx.js adds .fx-materialize) */
.service-dialog > .fx-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  overflow: hidden;
  pointer-events: none;
  border-radius: var(--radius, 16px);
}
.fx-layer .fx-grid {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(0deg, rgba(212, 160, 23, 0.22) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(90deg, rgba(212, 160, 23, 0.16) 0 1px, transparent 1px 26px);
  animation: fx-grid 0.9s ease-out both;
}
/* the beam layer spans the whole panel and moves with transform only; the line is its top edge */
.fx-layer .fx-beam {
  position: absolute;
  inset: 0;
  will-change: transform, opacity;
  animation: fx-beam 0.58s cubic-bezier(0.3, 0.6, 0.2, 1) both;
}
.fx-layer .fx-beam::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #f3d27a 18%, #fff4cf 50%, #f3d27a 82%, transparent);
  box-shadow: 0 0 12px 2px rgba(240, 196, 80, 0.75), 0 0 34px 8px rgba(212, 160, 23, 0.32);
}
.fx-layer .fx-p {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #f3d27a;
  box-shadow: 0 0 6px 1px rgba(240, 196, 80, 0.85);
  animation: fx-particle 0.72s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.service-dialog.fx-materialize > .service-dialog-card {
  animation: fx-reveal 0.58s cubic-bezier(0.3, 0.6, 0.2, 1) both;
}
@keyframes fx-grid {
  0% { opacity: 0; }
  20% { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes fx-beam {
  0% { transform: translateY(0); opacity: 0; }
  10% { opacity: 1; }
  88% { opacity: 1; }
  100% { transform: translateY(calc(100% - 2px)); opacity: 0; }
}
@keyframes fx-particle {
  0% { transform: translate(var(--fx-dx, 0), var(--fx-dy, 0)) scale(0.3); opacity: 0; }
  55% { opacity: 1; }
  80% { transform: translate(0, 0) scale(1); opacity: 0.9; }
  100% { transform: translate(0, 0) scale(0.2); opacity: 0; }
}
@keyframes fx-reveal {
  0% { clip-path: inset(0 0 100% 0); opacity: 0.4; }
  100% { clip-path: inset(0 0 0 0); opacity: 1; }
}
/* phones / touch: opacity + transform only, fewer particles (JS), no backdrop blur while animating */
.service-dialog.fx-materialize.fx-lite > .service-dialog-card {
  animation: fx-reveal-lite 0.42s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  will-change: transform, opacity;
}
html body :is(#home-dialogs, #service-dialogs) .service-dialog.fx-materialize.fx-lite > .service-dialog-card {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  background: rgba(18, 26, 22, 0.96) !important;
}
html:not([data-theme="dark"]) body :is(#home-dialogs, #service-dialogs) .service-dialog.fx-materialize.fx-lite > .service-dialog-card,
html.ak-light body :is(#home-dialogs, #service-dialogs) .service-dialog.fx-materialize.fx-lite > .service-dialog-card {
  background: rgba(255, 253, 248, 0.97) !important;
}
.service-dialog.fx-lite > .fx-layer .fx-p {
  box-shadow: none;
}
.service-dialog.fx-lite > .fx-layer .fx-beam::before {
  box-shadow: 0 0 10px 2px rgba(240, 196, 80, 0.6);
}
@keyframes fx-reveal-lite {
  0% { opacity: 0; transform: translateY(10px) scale(0.985); }
  100% { opacity: 1; transform: none; }
}

/* dialog header clips (same animated clips as the cards; poster first) */
.service-dialog-media.service-dialog-media-video {
  background: #0f1412;
}
.service-dialog-media .dialog-video {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
}

/* AI typing: the real text stays in the DOM (for screen readers) and is only made invisible;
   an aria-hidden copy on top types out. */
.fx-typing {
  position: relative;
  -webkit-text-fill-color: transparent;
}
.fx-typing > .fx-type {
  position: absolute;
  inset: 0;
  padding: inherit;
  pointer-events: none;
  -webkit-text-fill-color: currentColor;
  white-space: inherit;
}
.fx-typing > .fx-type * {
  -webkit-text-fill-color: currentColor;
}
.fx-type.fx-cursor::after {
  content: "";
  display: inline-block;
  width: 0.5em;
  height: 1em;
  margin-inline-start: 2px;
  vertical-align: -0.12em;
  background: var(--home-gold-text);
  opacity: 0.8;
  animation: fx-caret 0.5s steps(1) infinite;
}
@keyframes fx-caret {
  50% { opacity: 0; }
}

/* gold shimmer on dialog titles and prices (light band blended over the text; colour itself stays AA) */
#home-info-dialog .service-dialog-head h3,
#contact-dialog .service-dialog-head h3,
#service-dialogs .service-dialog-head h3,
#home-info-dialog .home-detail-price p,
#service-cards .home-card .card-body > p.card-price {
  position: relative;
}
#home-info-dialog .service-dialog-head h3::after,
#contact-dialog .service-dialog-head h3::after,
#service-dialogs .service-dialog-head h3::after,
#home-info-dialog .home-detail-price p::after,
#service-cards .home-card .card-body > p.card-price::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 236, 170, 0.9) 48%, rgba(255, 255, 255, 0.95) 50%, rgba(255, 236, 170, 0.9) 52%, transparent 62%) no-repeat;
  background-size: 260% 100%;
  background-position: 130% 0;
  mix-blend-mode: overlay;
  animation: fx-shimmer 5.5s ease-in-out 0.5s infinite;
}
html:not([data-theme="dark"]) #home-info-dialog .service-dialog-head h3::after,
html:not([data-theme="dark"]) #service-dialogs .service-dialog-head h3::after,
html:not([data-theme="dark"]) #contact-dialog .service-dialog-head h3::after,
html:not([data-theme="dark"]) #home-info-dialog .home-detail-price p::after,
html:not([data-theme="dark"]) #service-cards .home-card .card-body > p.card-price::after {
  mix-blend-mode: soft-light;
}
#service-cards .home-card .card-body > p.card-price::after {
  animation-duration: 7s;
  animation-delay: 1.2s;
}
@keyframes fx-shimmer {
  0% { background-position: 130% 0; }
  28% { background-position: -30% 0; }
  100% { background-position: -30% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .service-dialog > .fx-layer { display: none; }
  .service-dialog.fx-materialize > .service-dialog-card { animation: none; }
  .fx-typing { -webkit-text-fill-color: inherit; }
  .fx-typing > .fx-type { display: none; }
  #home-info-dialog .service-dialog-head h3::after,
  #contact-dialog .service-dialog-head h3::after,
  #service-dialogs .service-dialog-head h3::after,
  #home-info-dialog .home-detail-price p::after,
  #service-cards .home-card .card-body > p.card-price::after { animation: none; display: none; }
  html body .header-tools button.fx-sound-btn { display: none; }
}

/* home6: reserved media column — title/intro never paint under the thumbnail (RTL-aware).
   aspect-ratio alone was not expanding the shared grid row, so text started mid-image. */
/* once media lives inside .service-dialog-hero, drop the old 2-col scroll track
   (otherwise auto-column collapses to 0px + gap and body text stays indented under the thumb) */
html body :is(#home-dialogs, #service-dialogs) .service-dialog-scroll:has(> .service-dialog-hero) {
  grid-template-columns: minmax(0, 1fr);
}
html body :is(#home-dialogs, #service-dialogs) .service-dialog-scroll > .service-dialog-hero,
html body :is(#home-dialogs, #service-dialogs) .service-dialog-card > .service-dialog-hero {
  --service-dialog-media-size: 96px;
  grid-column: 1 / -1;
  grid-row: auto;
  display: grid;
  grid-template-columns: var(--service-dialog-media-size) minmax(0, 1fr);
  gap: 12px 14px;
  align-items: start;
}
html body :is(#home-dialogs, #service-dialogs) .service-dialog-hero > .service-dialog-media {
  grid-column: 1;
  grid-row: 1;
  width: var(--service-dialog-media-size);
  height: var(--service-dialog-media-size);
  min-width: var(--service-dialog-media-size);
  min-height: var(--service-dialog-media-size);
  max-width: var(--service-dialog-media-size);
  aspect-ratio: 1;
  align-self: start;
  justify-self: start;
  margin: 0;
}
html body :is(#home-dialogs, #service-dialogs) .service-dialog-hero-text {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: start;
}
html body :is(#home-dialogs, #service-dialogs) .service-dialog-hero .service-dialog-head {
  grid-column: auto;
  grid-row: auto;
  position: static;
  padding-inline: 0;
  margin: 0;
  border: 0;
  box-shadow: none;
  background: transparent !important;
}
html body :is(#home-dialogs, #service-dialogs) .service-dialog-hero .service-dialog-intro {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: start;
}
html body :is(#home-dialogs, #service-dialogs) .service-dialog-hero .service-dialog-head h3 {
  overflow-wrap: anywhere;
  text-align: start;
}
/* safety net for any leftover bare media (non-hero) still inside the scroll grid */
html body :is(#home-dialogs, #service-dialogs) .service-dialog-scroll > .service-dialog-media {
  width: var(--service-dialog-media-size, 96px);
  height: var(--service-dialog-media-size, 96px);
  min-height: var(--service-dialog-media-size, 96px);
  aspect-ratio: 1;
}
@media (max-width: 560px) {
  html body :is(#home-dialogs, #service-dialogs) .service-dialog-scroll > .service-dialog-hero,
  html body :is(#home-dialogs, #service-dialogs) .service-dialog-card > .service-dialog-hero,
  html body :is(#home-dialogs, #service-dialogs) .service-dialog-scroll {
    --service-dialog-media-size: 76px;
  }
}
/* mobile keeps the reserved media column; text wraps only in the copy column (never under the thumb).
   Only fall back to a stacked hero when the dialog is extremely narrow. */
@media (max-width: 320px) {
  html body :is(#home-dialogs, #service-dialogs) .service-dialog-scroll > .service-dialog-hero,
  html body :is(#home-dialogs, #service-dialogs) .service-dialog-card > .service-dialog-hero {
    grid-template-columns: minmax(0, 1fr);
  }
  html body :is(#home-dialogs, #service-dialogs) .service-dialog-hero > .service-dialog-media {
    grid-column: 1;
    grid-row: auto;
    justify-self: start;
  }
  html body :is(#home-dialogs, #service-dialogs) .service-dialog-hero-text {
    grid-column: 1;
    grid-row: auto;
  }
}

/* pinned × gets its own header strip, so it never covers dialog content (both text directions).
   auth.js wraps the card content into .service-dialog-scroll and puts the × bar beside it. */
html body .service-dialog > .service-dialog-card:has(> .service-dialog-scroll) {
  display: flex;
  flex-direction: column;
  padding: 52px 0 0;
}
html body .service-dialog > .service-dialog-card > .service-dialog-scroll {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  padding-top: 14px;
  border-top: 1px solid color-mix(in srgb, var(--home-gold-line) 55%, transparent);
}
html body .service-dialog > .service-dialog-card > .overlay-close-bar {
  top: 7px;
  inset-inline-end: 10px;
}
html body .service-dialog > .service-dialog-card:has(> .service-dialog-scroll) .service-dialog-head {
  padding-inline-end: 0.35rem;
}
