/* ==========================================================================
   Truelot / Dual Digital Network — motion + modernisation layer
   Loads AFTER styles.css (and after ddn.css on the parent page).

   Rules observed:
   - Additive only. No file is rewritten; delete this link to revert exactly.
   - Motion is opt-in via `js-motion` on <html>, added inline in <head>.
     Without JS or without IntersectionObserver, nothing is hidden.
   - prefers-reduced-motion disables every transform, transition and snap.
   - Two accent colours stay split: green = sell, teal = buy/source.
   ========================================================================== */

:root {
  --ease: cubic-bezier(.22,.61,.36,1);
  --ease-out: cubic-bezier(.16,1,.3,1);
  --rail-gap: 18px;
}

/* ---------- Fluid rhythm and type ---------- */
.section { padding: clamp(32px, 3.6vw, 56px) 0; scroll-margin-top: calc(var(--header-h) + 6px); }
.section__title {
  font-size: clamp(29px, 3.5vw, 46px);
  line-height: 1.08;
  letter-spacing: -0.025em;
  max-width: 22ch;
}
.section__lead {
  font-size: clamp(17px, 1.45vw, 20px);
  line-height: 1.6;
  max-width: 62ch;
}
.hero { padding: clamp(36px, 4.2vw, 64px) 0 clamp(28px, 3.2vw, 46px); }
.hero__title {
  font-size: clamp(34px, 5.4vw, 62px);
  line-height: 1.06;
  letter-spacing: -0.03em;
  max-width: 18ch;
}
.hero__sub { font-size: clamp(17px, 1.5vw, 20px); line-height: 1.62; }
.eyebrow { letter-spacing: .16em; }

/* ---------- Surfaces: hairline instead of boxy ---------- */
.pillar, .vcard, .vp, .door, .ddn-venture, .ddn-person, .placeholder-card, .formwrap {
  border-radius: 14px;
}
.pillar, .vcard, .vp, .door, .ddn-venture { transition: transform .35s var(--ease), box-shadow .35s var(--ease); }
.pillar:hover, .vcard:hover, .vp:hover, .ddn-venture:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.btn { transition: transform .22s var(--ease), box-shadow .22s var(--ease), background-color .22s var(--ease); }
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }

/* ---------- Hero: slow gradient drift (no photography, per brief) ---------- */
.hero { overflow: hidden; }
.hero::before {
  content: "";
  position: absolute;
  inset: -25%;
  background:
    radial-gradient(closest-side, rgba(73,174,84,.22), rgba(73,174,84,0) 72%) 18% 22%/58% 62% no-repeat,
    radial-gradient(closest-side, rgba(37,88,116,.38), rgba(37,88,116,0) 70%) 82% 76%/64% 58% no-repeat;
  animation: drift 26s var(--ease) infinite alternate;
  pointer-events: none;
  z-index: 0;
}
.hero__inner { position: relative; z-index: 1; }
@keyframes drift {
  from { transform: translate3d(-2%, -1%, 0) scale(1); }
  to   { transform: translate3d(3%, 2%, 0) scale(1.08); }
}

/* ---------- Entrance: hero children on load ---------- */
.js-motion .hero__inner > * {
  opacity: 0;
  transform: translateY(14px);
  animation: rise .7s var(--ease-out) forwards;
}
.js-motion .hero__inner > *:nth-child(1) { animation-delay: .05s; }
.js-motion .hero__inner > *:nth-child(2) { animation-delay: .13s; }
.js-motion .hero__inner > *:nth-child(3) { animation-delay: .21s; }
.js-motion .hero__inner > *:nth-child(4) { animation-delay: .29s; }
.js-motion .hero__inner > *:nth-child(5) { animation-delay: .37s; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ---------- Scroll reveal ---------- */
.js-motion .section__title,
.js-motion .section__lead,
.js-motion .pillar,
.js-motion .vp,
.js-motion .callout,
.js-motion .formwrap,
.js-motion .faq__item,
.js-motion .about__lead,
.js-motion .details > div,
.js-motion .ddn-person,
.js-motion .scope__col,
.js-motion .contact__lead {
  opacity: 0;
  transform: translateY(18px);
}
.js-motion .is-in {
  opacity: 1 !important;
  transform: none !important;
  transition: opacity .65s var(--ease-out), transform .65s var(--ease-out);
  transition-delay: calc(var(--d, 0) * 60ms);
}

/* ==========================================================================
   PROCESS — eight cards in one grid, all visible together
   ========================================================================== */
#process { padding-top: clamp(24px, 2.6vw, 40px); padding-bottom: clamp(24px, 2.6vw, 40px); }
#process .section__lead { margin-bottom: 14px; }
#process .steps--grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
/* The last step fills the third row so the grid closes cleanly. */
#process .steps--grid .step:last-child { grid-column: span 2; }
#process .steps--grid .step {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px;
  min-height: 128px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease);
}
#process .steps--grid .step:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: rgba(13,42,54,.16);
}
#process .steps--grid .step__num {
  width: 28px; height: 28px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 700;
}
#process .steps--grid .step--us .step__num { background: rgba(73,174,84,.15); color: var(--green-dark); }
#process .steps--grid .step:not(.step--us) .step__num { background: var(--navy); color: #fff; }
#process .steps--grid .step__body { gap: 4px; }
#process .steps--grid .step__title { font-size: 16px; margin: 0; line-height: 1.25; }
#process .steps--grid .step p { margin: 0; font-size: 14px; line-height: 1.4; color: #44555E; }
#process .steps--grid .step__party {
  margin-top: auto;
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Horizontal rails (verification, ventures) ---------- */
#ventures .ddn-ventures {
  display: flex;
  align-items: stretch;
  gap: var(--rail-gap);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 2px 2px 14px;
  scrollbar-width: thin;
  scrollbar-color: rgba(13,42,54,.28) transparent;
  cursor: grab;
}
#ventures .ddn-ventures::-webkit-scrollbar { height: 6px; }
#ventures .ddn-ventures::-webkit-scrollbar-thumb { background: rgba(13,42,54,.22); border-radius: 999px; }

/* Slightly wider so the third card peeks — the cue that the row scrolls. */
#ventures .ddn-venture {
  flex: 0 0 clamp(268px, 34vw, 420px);
  scroll-snap-align: start;
  margin: 0;
}

/* Rail controls */
.rail-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 4px;
}
.rail-nav__hint {
  margin-right: auto;
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.rail-nav button {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 999px;
  cursor: pointer;
  color: var(--navy);
  transition: background-color .2s var(--ease), border-color .2s var(--ease), opacity .2s var(--ease);
}
.rail-nav button:hover:not(:disabled) { border-color: var(--navy); }
.rail-nav button:disabled { opacity: .35; cursor: default; }
.rail-nav svg { width: 16px; height: 16px; display: block; }

/* Drag affordance */
.is-dragging { cursor: grabbing; scroll-snap-type: none; }

/* ---------- Cards inside the rails: staggered deal-in ---------- */
.js-motion #ventures .ddn-venture {
  opacity: 0;
  transform: translateY(26px) scale(.975);
  transition: opacity .6s var(--ease-out), transform .6s var(--ease-out);
}
.js-motion #ventures .ddn-ventures.is-in .ddn-venture {
  opacity: 1;
  transform: none;
  transition-delay: calc(var(--i, 0) * 70ms);
}

/* ---------- Scroll progress ---------- */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: var(--green);
  z-index: 200;
  pointer-events: none;
}
.ddn-page .scroll-progress { background: var(--teal); }

/* ---------- Parent page: teal drift ---------- */
.ddn-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(40px, 4.6vw, 76px) 0 clamp(32px, 3.6vw, 56px);
}
.ddn-hero::before {
  content: "";
  position: absolute;
  inset: -25%;
  background: radial-gradient(closest-side, rgba(143,196,222,.20), rgba(143,196,222,0) 70%) 70% 20%/60% 60% no-repeat;
  animation: drift 30s var(--ease) infinite alternate;
  pointer-events: none;
  z-index: 0;
}
.ddn-hero__inner { position: relative; z-index: 1; }
.ddn-page .section__title { max-width: 26ch; }

/* ---------- Mobile ---------- */
@media (max-width: 1000px) {
  #process .steps--grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #process .steps--grid .step:last-child { grid-column: auto; }
}
@media (max-width: 560px) {
  #process .steps--grid { grid-template-columns: 1fr; }
  #process .steps--grid .step { min-height: 0; }
}
@media (max-width: 720px) {
  #ventures .ddn-venture { flex-basis: min(84vw, 340px); }
  .rail-nav__hint { display: none; }
  .section__title { max-width: none; }
  .hero__title { max-width: none; }
}

/* ---------- Reduced motion: nothing moves, nothing hides ---------- */
@media (prefers-reduced-motion: reduce) {
  .js-motion .hero__inner > *,
  .js-motion .section__title,
  .js-motion .section__lead,
  .js-motion .pillar,
  .js-motion .vp,
  .js-motion .callout,
  .js-motion .formwrap,
  .js-motion .faq__item,
  .js-motion .about__lead,
  .js-motion .details > div,
  .js-motion .ddn-person,
  .js-motion .scope__col,
  .js-motion .contact__lead,
  .js-motion #ventures .ddn-venture,
  .js-motion .is-in {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
    transition: none !important;
  }
  .hero::before, .ddn-hero::before { animation: none; }
  #ventures .ddn-ventures { scroll-behavior: auto; }
  .pillar:hover, .vcard:hover, .vp:hover, .ddn-venture:hover, .btn:hover,
  #process .steps--grid .step:hover { transform: none; }
}

/* ---------- Checks section: plain 2x2 grid, every card visible ---------- */
.checks-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: stretch; }
.checks-grid .vcard { opacity: 1 !important; transform: none !important; }
@media (max-width: 720px) { .checks-grid { grid-template-columns: 1fr; } }
