/* YF ADS homepage 3D hero (theme 1.8.3) — loaded only on the homepage.
   CSS transforms only. Animated properties: transform + opacity. */
.d3 {
  --top: 69px;                                  /* sticky site header height */
  --sh: calc(100svh - var(--top));              /* stage height */
  --ph: clamp(360px, calc(var(--sh) - 150px), 600px);   /* phone height */
  --pw: calc(var(--ph) * 0.49);
  --gl: rgba(232, 201, 138, 0.34);
  position: relative;
  height: 520vh; height: 520svh;
  background: #12100d;
  color: #fff;
}
.d3-stage {
  position: sticky; top: var(--top);
  height: 100vh; height: var(--sh);
  min-height: 520px;
  overflow: hidden; isolation: isolate;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center;
  column-gap: 2rem;
  padding: 0 max(var(--pad), calc((100vw - var(--max)) / 2));
}
.d3-bg {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(ellipse 46% 62% at 74% 50%, rgba(232, 201, 138, 0.30), rgba(232, 201, 138, 0.08) 52%, transparent 74%),
    radial-gradient(ellipse 60% 50% at 8% 108%, rgba(196, 164, 107, 0.14), transparent 70%),
    linear-gradient(180deg, #1b1713 0%, #100e0b 100%);
}

/* ---- copy ---- */
.d3-copy { position: relative; z-index: 3; display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.d3-steps { display: grid; width: 100%; max-width: 36rem; }
.d3-step { grid-area: 1 / 1; min-width: 0; opacity: 0; visibility: hidden; transform: translate3d(0, 10px, 0); transition: opacity 0.22s ease, transform 0.22s ease, visibility 0s linear 0.22s; }
.d3-step.is-on { opacity: 1; visibility: visible; transform: none; transition: opacity 0.4s ease 0.2s, transform 0.4s ease 0.2s, visibility 0s linear 0.2s; }
/* type scale (1.8.3): one family, one heading size for every step, one body size; variables are overridden for phones */
.d3 { --t-h: clamp(1.7rem, 1.1rem + 1.4vw, 2.4rem); --t-body: 1.0625rem; --t-lh: 1.75; --t-small: 0.8rem; --t-gap: 1rem; font-family: inherit; }
.d3-eyebrow, .d3-kick { margin: 0 0 0.75rem; font-size: var(--t-small); line-height: 1.4; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--yellow); }
.d3-h1, .d3-step-t { margin: 0; font-size: var(--t-h); line-height: 1.25; font-weight: 800; letter-spacing: 0; color: #fff; text-wrap: balance; }
.d3-h1 .nowrap { white-space: nowrap; }
.d3-lead, .d3-step-d, .d3-tagline { margin: var(--t-gap) 0 0; font-size: var(--t-body); line-height: var(--t-lh); font-weight: 400; color: rgba(255, 255, 255, 0.86); max-width: 34rem; text-wrap: pretty; }
.d3-lead a { color: var(--yellow); font-weight: 650; text-decoration: underline; text-decoration-color: rgba(232, 201, 138, 0.6); text-underline-offset: 3px; white-space: nowrap; }
.d3-lead a::after { content: " →"; }
.d3-tagline { margin-top: 0.5rem; color: rgba(255, 255, 255, 0.66); }
.d3-list { display: none; margin: 1.4rem 0 0; padding: 0; list-style: none; gap: 0.6rem; color: rgba(255, 255, 255, 0.85); font-size: 0.98rem; line-height: 1.5; }
.d3-list strong { color: var(--yellow); }
.d3-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }
.d3 .hero-tags { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.1rem; }
.d3 .hero-tags a { display: inline-flex; align-items: center; box-sizing: border-box; min-height: 2.125rem; padding: 0 0.85rem; font-size: 0.82rem; line-height: 1; background: transparent; color: rgba(255, 255, 255, 0.82); border: 1px solid rgba(232, 201, 138, 0.38); border-radius: 999px; text-decoration: none; }
.d3 .hero-tags a:hover, .d3 .hero-tags a:focus-visible { background: rgba(232, 201, 138, 0.14); border-color: var(--yellow); color: #fff; }
.d3-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 2.9rem; min-width: 10.5rem; padding: 0 1.4rem; box-sizing: border-box; line-height: 1; border-radius: 999px; font-weight: 700; font-size: 0.95rem; text-decoration: none; border: 1.5px solid transparent; transition: transform 0.2s ease, background-color 0.2s ease; }
.d3-btn--gold { background: var(--yellow); color: var(--ink) !important; }
.d3-btn--gold:hover { background: #f0d6a2; }
.d3-btn--line { border-color: rgba(232, 201, 138, 0.7); color: #fff !important; }
.d3-btn--line:hover { background: rgba(232, 201, 138, 0.12); }
.d3-btn:focus-visible, .d3-dot:focus-visible { outline: 2px solid var(--yellow); outline-offset: 3px; }

/* ---- visual ---- */
.d3-visual { position: relative; z-index: 2; height: 100%; min-width: 0; }
.d3-inner { position: absolute; inset: 0 0 56px 0; display: flex; align-items: center; justify-content: center; }
.d3-scene { position: relative; width: var(--pw); height: var(--ph); perspective: 1300px; }
.d3-phone { position: absolute; inset: 0; transform-style: preserve-3d; will-change: transform; transform: rotateX(8deg) rotateY(-16deg); }
.d3-front, .d3-back { position: absolute; inset: 0; border-radius: calc(var(--pw) * 0.15); }
.d3-front {
  font-size: calc(var(--pw) * 0.047);
  transform: translateZ(9px);
  background: #0b0a09;
  box-shadow: 0 0 0 calc(var(--pw) * 0.012) #cdb17a, inset 0 0 0 calc(var(--pw) * 0.03) #1a1612, 0 0 calc(var(--pw) * 0.3) var(--gl);
  overflow: hidden;
}
.d3-back { transform: translateZ(-9px) rotateY(180deg); background: linear-gradient(135deg, #3a3126, #17130f); }
.d3-side { position: absolute; top: 5%; bottom: 5%; width: 18px; background: linear-gradient(180deg, #d8bd86, #8f7440 60%, #cdb17a); }
.d3-side--l { left: -9px; transform: rotateY(-90deg); }
.d3-side--r { right: -9px; transform: rotateY(90deg); }
.d3-notch { position: absolute; z-index: 6; top: calc(var(--pw) * 0.045); left: 50%; width: 26%; height: 3.4%; margin-left: -13%; background: #000; border-radius: 99px; }
.d3-screen {
  position: absolute; inset: calc(var(--pw) * 0.034);
  border-radius: calc(var(--pw) * 0.12);
  overflow: hidden; background: #fff; color: #1c1916;
  opacity: 0; transition: opacity 0.5s ease;
}
.d3-screen.is-on { opacity: 1; }
.d3-screen img { display: block; }
.d3-post-h { display: flex; align-items: center; gap: 0.5em; padding: 2.6em 0.7em 0.55em; }
.d3-post-h img { width: 2.1em; height: 2.1em; border-radius: 50%; object-fit: cover; background: #f5f0e6; }
.d3-post-h b { font-size: 0.82em; line-height: 1.2; }
.d3-post-h em { margin-left: auto; font-style: normal; font-size: 0.66em; color: #6b645a; }
.d3-post-i { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; background: #e8dfd0; }
.d3-skel { display: grid; gap: 0.45em; padding: 0.8em 0.8em 0; }
.d3-skel i { display: block; height: 0.6em; border-radius: 99px; background: #e8dfd0; }
.d3-skel i:nth-child(2) { width: 78%; }
.d3-skel i:nth-child(3) { width: 52%; }
.d3-skel--cta i { height: 1.9em; background: #e8c98a; width: 100%; border-radius: 0.6em; margin-top: 0.2em; }
.d3-screen--1 { background: #f5f0e6; }
.d3-canvas { position: relative; margin: 0.4em 0.9em 0; outline: 1px dashed #c4a46b; outline-offset: 0.35em; }
.d3-canvas s { position: absolute; width: 0.7em; height: 0.7em; background: #fff; border: 1.5px solid #9a7b45; }
.d3-canvas s:nth-of-type(1) { left: -0.35em; top: -0.35em; } .d3-canvas s:nth-of-type(2) { right: -0.35em; top: -0.35em; }
.d3-canvas s:nth-of-type(3) { left: -0.35em; bottom: -0.35em; } .d3-canvas s:nth-of-type(4) { right: -0.35em; bottom: -0.35em; }
.d3-swatch { display: flex; gap: 0.5em; padding: 1em 0.9em 0; }
.d3-swatch i { width: 1.5em; height: 1.5em; border-radius: 50%; border: 1px solid #ddd4c5; }
.d3-swatch i:nth-child(1) { background: #1c1916; } .d3-swatch i:nth-child(2) { background: #e8c98a; }
.d3-swatch i:nth-child(3) { background: #c4a46b; } .d3-swatch i:nth-child(4) { background: #fffcf6; }
.d3-screen--2 { background: #000; }
.d3-vid { width: 100%; height: 100%; object-fit: cover; }
.d3-bar { position: absolute; left: 9%; right: 9%; bottom: 6%; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, 0.35); }
.d3-bar i { display: block; width: 38%; height: 100%; background: #e8c98a; border-radius: 3px; }
.d3-play { position: absolute; left: 50%; top: 50%; width: 2.6em; height: 2.6em; margin: -1.3em 0 0 -1.3em; border-radius: 50%; background: rgba(0, 0, 0, 0.45); border: 1.5px solid rgba(255, 255, 255, 0.9); }
.d3-play::after { content: ""; position: absolute; left: 50%; top: 50%; margin: -0.55em 0 0 -0.3em; border-style: solid; border-width: 0.55em 0 0.55em 0.9em; border-color: transparent transparent transparent #fff; }
.d3-play--lg { width: 3.6em; height: 3.6em; margin: -1.8em 0 0 -1.8em; }
.d3-cover { height: 20%; margin-top: 0; background: linear-gradient(120deg, #e8c98a, #c4a46b); }
.d3-prof { display: flex; align-items: flex-end; gap: 0.5em; padding: 0 0.8em; margin-top: -1.6em; }
.d3-prof img { width: 3.4em; height: 3.4em; border-radius: 50%; border: 2px solid #fff; object-fit: cover; background: #f5f0e6; }
.d3-prof b { font-size: 0.86em; padding-bottom: 0.2em; }
.d3-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; margin-top: 0.9em; }
.d3-grid img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; background: #e8dfd0; }

/* rings: SVG light trails, rotated by JS (transform only; no masks / filters) */
.d3-ring {
  position: absolute; left: 50%; top: 50%; pointer-events: none; overflow: visible;
  width: calc(var(--ph) * 1.12); height: calc(var(--ph) * 1.12); margin: calc(var(--ph) * -0.56) 0 0 calc(var(--ph) * -0.56);
  will-change: transform;
}
.d3-ring--b { width: calc(var(--ph) * 0.9); height: calc(var(--ph) * 0.9); margin: calc(var(--ph) * -0.45) 0 0 calc(var(--ph) * -0.45); opacity: 0.6; }

/* floating glass cards */
.d3-card-wrap { position: absolute; z-index: 4; will-change: transform; }
.d3-card-wrap--ad { right: calc(50% + var(--pw) * 0.30); top: 14%; }
.d3-card-wrap--video { left: calc(50% + var(--pw) * 0.28); top: 9%; }
.d3-card-wrap--design { left: calc(50% + var(--pw) * 0.34); bottom: 12%; }
.d3-card {
  width: 9.4rem; padding: 0.4rem; font-size: 0.78rem;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.05));
  border: 1px solid rgba(232, 201, 138, 0.55);
  box-shadow: 0 0 22px rgba(232, 201, 138, 0.18), 0 10px 26px rgba(0, 0, 0, 0.35);
  opacity: 0; transform: translate3d(0, 16px, 0) scale(0.94);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.d3-card img { display: block; width: 100%; height: auto; border-radius: 10px; background: #2c2824; }
.d3-card--video img { aspect-ratio: 16 / 10; object-fit: cover; }
.d3-thumb { position: relative; display: block; font-size: 0.78rem; }
.d3-card-l { display: block; padding: 0.35rem 0.2rem 0.1rem; color: var(--yellow); font-weight: 700; font-size: 0.8rem; }
.d3-stage[data-step="0"] .d3-card--ad,
.d3-stage[data-step="1"] .d3-card--design,
.d3-stage[data-step="2"] .d3-card--video,
.d3-stage[data-step="3"] .d3-card { opacity: 1; transform: none; }
.d3-stage:not([data-step="0"]):not([data-step="3"]) .d3-card--ad,
.d3-stage:not([data-step="1"]):not([data-step="3"]) .d3-card--design,
.d3-stage:not([data-step="2"]):not([data-step="3"]) .d3-card--video { opacity: 0.22; transform: translate3d(0, 6px, 0) scale(0.92); }
.d3-stage[data-step="0"] .d3-card--design, .d3-stage[data-step="0"] .d3-card--video { opacity: 0.22; transform: translate3d(0, 6px, 0) scale(0.92); }

/* progress dots */
.d3-dots { position: absolute; z-index: 5; bottom: 14px; right: max(var(--pad), calc((100vw - var(--max)) / 2)); width: calc(50% - max(var(--pad), calc((100vw - var(--max)) / 2)) - 1rem); max-width: 34rem; display: grid; grid-template-columns: repeat(4, 1fr); }
.d3-track { position: absolute; left: 12.5%; right: 12.5%; top: 21px; height: 2px; background: rgba(255, 255, 255, 0.2); pointer-events: none; }
.d3-fill { display: block; height: 100%; background: var(--yellow); transform-origin: 0 50%; transform: scaleX(0); box-shadow: 0 0 10px rgba(232, 201, 138, 0.6); }
.d3-dot { position: relative; display: flex; flex-direction: column; align-items: center; gap: 0.3rem; min-height: 44px; padding: 8px 0 0; background: none; border: 0; cursor: pointer; color: rgba(255, 255, 255, 0.55); font: inherit; -webkit-tap-highlight-color: transparent; }
.d3-dot-n { width: 14px; height: 14px; border-radius: 50%; background: #1b1713; border: 2px solid rgba(232, 201, 138, 0.6); transition: background-color 0.3s ease, box-shadow 0.3s ease; }
.d3-dot-l { font-size: 0.82rem; font-weight: 600; transition: color 0.3s ease; }
.d3-dot.is-on .d3-dot-n { background: var(--yellow); box-shadow: 0 0 0 4px rgba(232, 201, 138, 0.25), 0 0 14px rgba(232, 201, 138, 0.7); }
.d3-dot.is-on .d3-dot-l { color: var(--yellow); }
.d3-hint { display: none; }

/* gold hairline between the dark hero and the cream sections below */
.d3::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--gold); }

/* ---- mobile: text on top, phone fills the remaining height, no ring b, 1 card max, no glow blur ---- */
@media (max-width: 700px) {
  .d3 { height: 580vh; height: 580svh; }
  .d3-stage { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; padding: 0.6rem var(--pad) max(4px, env(safe-area-inset-bottom, 0px)); min-height: 0; row-gap: 0; }
  .d3-copy { display: contents; }
  .d3-steps { order: 1; max-width: none; position: relative; z-index: 3; }
  .d3 { --t-h: clamp(1.25rem, 5.7vw, 1.5rem); --t-body: 0.84rem; --t-lh: 1.55; --t-small: 0.68rem; --t-gap: 0.5rem; }
  .d3-eyebrow, .d3-kick { margin-bottom: 0.4rem; }
  .d3-h1, .d3-step-t { max-width: none; }
  .d3-tagline { display: none; }
  .d3-actions { order: 2; position: relative; z-index: 3; flex-wrap: nowrap; gap: 0.55rem; margin: 0.65rem 0 0; }
  .d3-btn { flex: 1 1 0; min-width: 0; min-height: 2.6rem; padding: 0 0.6rem; font-size: 0.88rem; white-space: nowrap; }
  .d3 .hero-tags, .d3-list { display: none; }
  .d3-visual { order: 3; flex: 1 1 auto; min-height: 0; height: auto; container-type: size; }
  .d3-inner { inset: 0 0 26px 0; }
  .d3-dots { order: 4; position: relative; left: auto; right: auto; bottom: auto; transform: none; width: 100%; max-width: none; margin: 0.2rem auto 0; }
  .d3-step:not(:first-child) { align-self: center; }
  .d3-ring--b, .d3-card-wrap--ad { display: none; }
  .d3-ring { width: calc(var(--ph) * 1.05); height: calc(var(--ph) * 1.05); margin: calc(var(--ph) * -0.525) 0 0 calc(var(--ph) * -0.525); }
  .d3-bg { background: radial-gradient(ellipse 80% 42% at 50% 66%, rgba(232, 201, 138, 0.26), transparent 72%), linear-gradient(180deg, #1b1713, #100e0b); }
  .d3-front { box-shadow: 0 0 0 1.5px #cdb17a, inset 0 0 0 3px #1a1612, 0 0 22px var(--gl); }
  .d3-card { width: 5.6rem; padding: 0.28rem; font-size: 0.68rem; border-radius: 11px; box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35); }
  .d3-card-l { font-size: 0.7rem; padding-top: 0.25rem; }
  .d3-card-wrap--video { left: calc(50% + var(--pw) * 0.30); top: auto; bottom: 8%; }
  .d3-card-wrap--design { left: auto; right: calc(50% + var(--pw) * 0.3); bottom: 14%; }
  /* one card at a time on mobile */
  .d3 .d3-stage[data-step] .d3-card { opacity: 0; transform: translate3d(0, 10px, 0) scale(0.94); }
  .d3 .d3-stage[data-step="1"] .d3-card--design, .d3 .d3-stage[data-step="2"] .d3-card--video { opacity: 1; transform: none; }
  .d3-dot-l { font-size: 0.78rem; }
  .d3-hint { display: block; position: absolute; z-index: 5; left: 50%; transform: translateX(-50%); bottom: -24px; margin: 0; padding: 0.1rem 0.65rem; border-radius: 99px; font-size: 0.68rem; line-height: 1.3; color: var(--yellow); background: rgba(0, 0, 0, 0.45); opacity: 0; transition: opacity 0.4s ease; pointer-events: none; white-space: nowrap; }
  .d3-stage[data-step="0"]:not(.is-started) .d3-hint { opacity: 1; }
  /* the sticky WhatsApp/Telegram bar steps aside while the pinned hero is on screen, then returns */
  body.d3-live .dock { opacity: 0; pointer-events: none; transform: translateY(100%); }
}
/* phone height follows the space that is really left (container query); older browsers keep the calc() fallback */
@media (max-width: 700px) {
  .d3 { --ph: clamp(190px, calc(var(--sh) - 400px), 420px); }
}
@supports (height: 1cqh) {
  @media (max-width: 700px) {
    .d3-inner { --ph: clamp(150px, calc(100cqh - 38px), 440px); --pw: calc(var(--ph) * 0.49); }
  }
}

/* short screens (landscape phones, small laptops): keep the stage inside the viewport */
@media (min-width: 701px) and (max-height: 700px) {
  .d3 { --ph: clamp(190px, calc(var(--sh) - 100px), 600px); }
  .d3-stage { min-height: 0; }
  .d3 { --t-h: 1.55rem; --t-body: 0.9rem; --t-lh: 1.6; --t-gap: 0.6rem; }
  .d3 .hero-tags, .d3-tagline { display: none; }
  .d3-actions { margin-top: 0.9rem; }
  .d3-eyebrow { margin-bottom: 0.4rem; }
}

/* ---- static layout: reduced motion / low-end device / no JS ---- */
html.d3-lite .d3 { height: auto; }
html.d3-lite .d3-stage { position: relative; top: auto; height: auto; min-height: 0; overflow: hidden; padding-top: 3rem; padding-bottom: 3rem; }
html.d3-lite .d3-step:not(:first-child), html.d3-lite .d3-dots, html.d3-lite .d3-hint, html.d3-lite .d3-card-wrap, html.d3-lite .d3-ring { display: none !important; }
html.d3-lite .d3-list { display: grid; }
html.d3-lite .d3-visual { height: auto; min-height: calc(var(--ph) + 90px); }
html.d3-lite .d3-phone { will-change: auto; transform: rotateX(6deg) rotateY(-12deg); }
@media (max-width: 700px) {
  html.d3-lite .d3-stage { padding-top: 1.4rem; padding-bottom: 1.6rem; }
  html.d3-lite .d3-list { display: grid; order: 5; margin: 1rem 0 0; font-size: 0.88rem; }
  html.d3-lite .d3-visual { order: 3; margin-top: 1rem; height: 420px; }
  html.d3-lite .d3-inner { inset: 0; }
  html.d3-lite .d3 { --ph: 380px; }
}
