/* Dreamscape Visual: micro interactions.
   Each block is self contained and switched on by one data attribute.
   Only transform and opacity animate, except the service heading fill (background-position on text). */

:root { --pour-ease: cubic-bezier(.16, 1, .3, 1); }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }


/* =========================================================
   1. POUR BUTTON  [data-pour]
   Gold rises inside the pill from wherever you touched it,
   with a curved surface, and drains back down on leave.
   ========================================================= */
[data-pour] {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
  /* the fill replaces the background swap from styles.css */
  transition: color .6s var(--pour-ease), border-color .6s var(--pour-ease), transform .35s var(--pour-ease);
  --pour: var(--gold);
  --pour-ink: var(--black);
}
[data-pour]::before {
  content: "";
  position: absolute; z-index: -1;
  top: 100%;
  left: calc(var(--px, 50%) - 120%);
  width: 240%;
  height: 300%;
  border-radius: 50%;
  background: var(--pour);
  transform: translate3d(0, 0, 0);
  transition: transform .9s var(--pour-ease);
  will-change: transform;
}
/* colors per button and section */
.btn-solid[data-pour] { --pour: var(--gold-light); }
.on-gold [data-pour] { --pour: var(--black); --pour-ink: var(--gold); }
.on-gold .btn-solid[data-pour] { --pour: var(--gold); --pour-ink: var(--black); }

/* filled: hover on a mouse, press on touch, focus from the keyboard */
@media (hover: hover) {
  .btn[data-pour]:hover { background: transparent; }
  .btn-solid[data-pour]:hover { background: var(--accent); }
  [data-pour]:hover::before { transform: translate3d(0, -60%, 0); }
  [data-pour]:hover { color: var(--pour-ink); border-color: var(--pour); }
}
[data-pour].is-pouring::before,
[data-pour]:focus-visible::before { transform: translate3d(0, -60%, 0); }
[data-pour].is-pouring,
[data-pour]:focus-visible { color: var(--pour-ink); border-color: var(--pour); }
.on-gold .btn-solid[data-pour]:hover,
.on-gold .btn-solid[data-pour].is-pouring { border-color: var(--black); background: var(--black); }

/* tactile press: the pill gives a little under the finger */
[data-pour]:active { transform: scale(.97); transition-duration: .6s, .6s, .12s; }


/* =========================================================
   2. SERVICE HEADINGS FILL  [data-fill-text]
   Like the intro: a brighter gold level rises through the
   letters. Hover or focus on desktop; on touch it pours once
   as each service settles into the middle of the screen.
   ========================================================= */
[data-fill-text] {
  /* resting a shade deeper so the rising level reads; on gold sections it rests black */
  --fill-rest: var(--gold-deep);
  --fill-full: var(--gold-light);
  color: var(--fill-rest);
  background-image: linear-gradient(to top, var(--fill-full) 50%, var(--fill-rest) 50%);
  background-size: 100% 200%;
  background-position: 0 0;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  padding-bottom: .12em;          /* room so italic descenders are not clipped in Safari */
  margin-bottom: -.12em;
  transition: background-position 1.4s var(--pour-ease);
}
[data-fill-list] li { cursor: default; }
.on-gold [data-fill-text] { --fill-rest: var(--black); --fill-full: var(--charcoal); }
[data-fill-list] li p { transition: color .8s var(--pour-ease); }
@media (hover: hover) {
  [data-fill-list] li:hover [data-fill-text] { background-position: 0 100%; }
  [data-fill-list] li:hover p { color: var(--fg); }
}
[data-fill-list] li:focus-visible [data-fill-text],
[data-fill-list] li.is-filled [data-fill-text] { background-position: 0 100%; }
[data-fill-list] li:focus-visible p,
[data-fill-list] li.is-filled p { color: var(--fg); }


/* =========================================================
   3. GOLD THREAD UNDERLINE  [data-thread]
   A hairline that drains away to the right and pours back in
   from the left. Used on contact lines and Back To Top.
   ========================================================= */
[data-thread] {
  position: relative;
  border-bottom: 0 !important;
  -webkit-tap-highlight-color: transparent;
}
[data-thread]::before {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -2px;
  height: 1px;
  background: currentColor;
  opacity: .35;
  transform-origin: right center;
  transition: transform .7s var(--pour-ease), opacity .7s var(--pour-ease);
}
@media (hover: hover) {
  [data-thread]:hover::before { animation: dv-thread 1s var(--pour-ease) both; }
}
[data-thread]:focus-visible::before,
[data-thread].is-copied::before { animation: dv-thread 1s var(--pour-ease) both; }
@keyframes dv-thread {
  0%   { transform: scaleX(1); transform-origin: right center; opacity: .35; }
  40%  { transform: scaleX(0); transform-origin: right center; opacity: .35; }
  41%  { transform: scaleX(0); transform-origin: left center; opacity: 1; }
  100% { transform: scaleX(1); transform-origin: left center; opacity: 1; }
}
.footer [data-thread] { color: rgba(255, 255, 255, .6); }
.footer [data-thread]::before { bottom: -6px; background: var(--gold); }


/* =========================================================
   4. COPY CONTACT LINES  [data-copy]
   Desktop only: a click copies the line and a quiet caption
   says so. Touch keeps the normal call or email action.
   ========================================================= */
.contact-lines [data-copy] { display: inline-block; }
.has-copy [data-copy] { cursor: copy; }
[data-copy]::after {
  content: attr(data-copy-hint);
  position: absolute; left: 50%; top: calc(100% + 14px);
  font: 500 10px/1 var(--sans);
  font-style: normal;
  letter-spacing: .26em; text-transform: uppercase;
  white-space: nowrap;
  color: var(--label);
  opacity: 0;
  transform: translate3d(-50%, -4px, 0);
  transition: opacity .6s var(--pour-ease), transform .6s var(--pour-ease);
  pointer-events: none;
}
.has-copy [data-copy]:hover::after,
.has-copy [data-copy]:focus-visible::after,
[data-copy].is-copied::after { opacity: 1; transform: translate3d(-50%, 0, 0); }


/* =========================================================
   5. PROJECT DEPTH  [data-depth]
   The phone inset floats a little above the desktop shot and
   drifts against the pointer, settling slowly like something
   heavy. On touch, a press gives a soft settle instead.
   ========================================================= */
[data-depth] { -webkit-tap-highlight-color: transparent; --dx: 0; --dy: 0; }
[data-depth] > img,
[data-depth] .inset {
  transition: transform 1.4s var(--pour-ease);
  will-change: transform;
}
[data-depth] > img,
.project-media[data-depth]:hover > img {
  transform: translate3d(calc(var(--dx) * 5px), calc(var(--dy) * 4px), 0) scale(1.01);
}
[data-depth] .inset {
  transform: translate3d(calc(var(--dx) * -14px), calc(var(--dy) * -12px), 0);
}
[data-depth].is-pressed > img { transform: scale(.985); transition-duration: .5s; }
[data-depth].is-pressed .inset { transform: translate3d(0, -6px, 0); transition-duration: .5s; }


/* =========================================================
   6. CONTEXT CURSOR  [data-cursor="Label"]
   Fine pointers only. Over the project image a gold disc
   with a word follows the pointer with weight. No cursor
   anywhere else, so it never becomes ambient noise.
   ========================================================= */
.dv-cursor {
  position: fixed; left: 0; top: 0; z-index: 90;
  width: 0; height: 0;
  pointer-events: none;
  will-change: transform;
}
.dv-cursor span {
  position: absolute; left: -46px; top: -46px;
  width: 92px; height: 92px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--gold);
  color: var(--black);
  font: 500 11px/1 var(--sans); letter-spacing: .24em; text-transform: uppercase;
  padding-left: .24em;
  opacity: 0;
  transform: scale(.2);
  transition: opacity .5s var(--pour-ease), transform .8s var(--pour-ease);
}
.dv-cursor.is-on span { opacity: 1; transform: scale(1); }
.has-dv-cursor [data-cursor] { cursor: none; }


/* =========================================================
   7. FOCUS RING  (no attribute: global)
   A hairline in the section's accent that settles in toward
   the element instead of snapping on.
   ========================================================= */
:where(a, button, [tabindex]) { outline: 1px solid transparent; outline-offset: 14px; }
:where(a, button, [tabindex]):focus-visible {
  outline-color: var(--accent);
  outline-offset: 6px;
  transition: outline-offset .6s var(--pour-ease), outline-color .3s;
}
.btn:focus-visible { outline-offset: 5px; }
.footer :focus-visible { outline-color: var(--gold); }


/* =========================================================
   8. BACK TO TOP  [data-rise]
   The arrow lifts away and a new one rises in from below.
   ========================================================= */
[data-rise] .rise-arrow { display: inline-block; }
@media (hover: hover) {
  [data-rise]:hover .rise-arrow { animation: dv-rise .9s var(--pour-ease) both; }
}
[data-rise].is-rising .rise-arrow,
[data-rise]:focus-visible .rise-arrow { animation: dv-rise .9s var(--pour-ease) both; }
@keyframes dv-rise {
  0%   { transform: translate3d(0, 0, 0); opacity: 1; }
  45%  { transform: translate3d(0, -100%, 0); opacity: 0; }
  46%  { transform: translate3d(0, 100%, 0); opacity: 0; }
  100% { transform: translate3d(0, 0, 0); opacity: 1; }
}


/* ---------- Reduced motion: states still change, nothing travels ---------- */
@media (prefers-reduced-motion: reduce) {
  [data-pour], [data-pour]::before,
  [data-fill-text], [data-fill-list] li p,
  [data-depth] > img, [data-depth] .inset,
  .dv-cursor span, [data-copy]::after { transition-duration: .01s !important; }
  [data-thread]::before, [data-rise] .rise-arrow { animation: none !important; }
  [data-thread]:hover::before, [data-thread].is-copied::before { opacity: 1; }
  [data-pour]:active { transform: none; }
  :where(a, button, [tabindex]):focus-visible { transition: none; }
}

/* service titles rest white and fill with gold, like the intro */
.on-black [data-fill-text], .on-charcoal [data-fill-text] { --fill-rest: var(--white); --fill-full: var(--gold); }
