/* Replacements for the behaviour the original page runtime used to add to the pre-rendered pages
   (reveal-on-scroll, marquee tickers, drag carousels). Scripts: reveal.js, ticker.js. */

/* marquee: ticker.js clones the items and sets --am-w (width of one set, px) and --am-d (duration) */
@keyframes am-tick { to { transform: translateX(calc(-1 * var(--am-w))); } }
.am-tick { animation: am-tick var(--am-d, 30s) linear infinite; will-change: transform; }
.am-tick.am-off { animation-play-state: paused; }

/* drag carousels */
[data-am-carousel] { cursor: grab; touch-action: pan-y; -webkit-user-select: none; user-select: none; }
[data-am-carousel].am-drag { cursor: grabbing; }
[data-am-carousel] img { -webkit-user-drag: none; }
[data-am-carousel]:focus-visible { outline: 2px solid var(--ink, #201f1d); outline-offset: 4px; }

@media (prefers-reduced-motion: reduce) { .am-tick { animation: none; } }

/* ---- "See bio" bottom sheet (bio.js) ---- */
.am-bio-scrim { position: fixed; inset: 0; z-index: 9; background: #201f1dcc; animation: am-bio-fade .25s ease both; }
.am-bio-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 9; box-sizing: border-box; display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 200px; padding: 40px; max-height: calc(100vh/var(--z,1)); overflow: auto; outline: none; background: var(--color-bg-warm, #fff); color: var(--color-text-primary, #201f1d); animation: am-bio-up .38s cubic-bezier(.22, 1, .36, 1) both; }
.am-bio-img { position: relative; flex: none; width: min(max((100vw - 280px) * .375, 1px), 350px); height: 420px; }
.am-bio-img img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.am-bio-img::after { content: ""; position: absolute; inset: 0; border: 1px solid var(--color-border-subtle, rgba(32, 31, 29, .2)); pointer-events: none; }
.am-bio-text { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 80px; }
.am-bio-head { display: flex; flex-direction: column; gap: 8px; }
.am-bio-text > p { max-width: 600px; }
.am-bio .ui-text { margin: 0; }
.am-bio-name { margin: 0; font: 300 42px/110% "Ortica Linear", "Ortica Linear Fallback", serif; letter-spacing: -.02em; color: var(--color-text-primary, #201f1d); }
@media (max-width: 1199px) and (min-width: 1000px) { .am-bio-name { font-size: 36px; } }
@media (max-width: 999px) and (min-width: 810px) { .am-bio-name { font-size: 30px; } }
@media (max-width: 809px) { .am-bio-name { font-size: 24px; line-height: 120%; } }
.am-bio-x { position: absolute; top: 12px; right: 16px; width: 40px; height: 40px; display: grid; place-items: center; padding: 0; border: 1px solid var(--color-text-primary, #201f1d); border-radius: 50%; background: transparent; color: inherit; cursor: pointer; }
.am-bio-x:hover, .am-bio-x:focus-visible { background: var(--color-accent-yellow, #bce8d2); }
.am-bio-x:focus-visible { outline: 2px solid var(--color-text-primary, #201f1d); outline-offset: 2px; }
.am-bio-out .am-bio-scrim { animation: am-bio-fade .2s ease reverse both; }
.am-bio-out .am-bio-sheet { animation: am-bio-up .2s ease reverse both; }
html.am-bio-open { overflow: hidden; }
@keyframes am-bio-fade { from { opacity: 0; } }
@keyframes am-bio-up { from { transform: translateY(40px); opacity: 0; } }
@media (max-width: 809.98px) {
  .am-bio-sheet { height: calc(70vh/var(--z,1)); flex-direction: column; align-items: center; justify-content: flex-start; gap: 16px; padding: 16px; }
  .am-bio-img { display: none; }
  .am-bio-text { flex: none; width: 100%; gap: 40px; justify-content: flex-start; }
  .am-bio-x { top: 8px; right: 8px; }
}
@media (prefers-reduced-motion: reduce) { .am-bio-scrim, .am-bio-sheet, .am-bio-out .am-bio-scrim, .am-bio-out .am-bio-sheet { animation: none; } }

/* floating contact pill (connect.js): "copied" state */
a[data-am-connect].am-done, a[data-am-connect].am-done:hover { background: var(--bg, #fefcfa) !important; color: var(--ink, #201f1d) !important; box-shadow: inset 0 0 0 1px var(--ink, #201f1d); }
a[data-am-connect]:hover:not(.am-done) { background: #000 !important; color: #fff !important; }
html[data-theme="dark"] a[data-am-connect]:hover:not(.am-done) { color: var(--am-text, #f3f1ec); }

/* Headline letters paint above the green highlight (<mark>) of the next line, so it never covers descenders (g, y, p…).
   The original runtime got this from will-change:transform on every letter; position:relative gives the same order without extra layers. */
.ui-text span[style*="inline-block"], .am-de .am-w { position: relative; }

/* ---- Home: "Services" rows. On hover (mouse) a dark bar grows to fill the row, the title fades out and the
   scrolling image/text ticker fades in (this was driven by the original runtime). ---- */
.ui-ohti69 { transition: top .5s cubic-bezier(.22, 1, .36, 1), height .5s cubic-bezier(.22, 1, .36, 1); }
.ui-12nc2b7 { transition: opacity .35s ease; }
.ui-1r7yerk { transition: opacity .3s ease; }
@media (hover: hover) {
  .ui-hkFZG:hover .ui-ohti69 { top: 0 !important; height: 100% !important; }
  .ui-hkFZG:hover .ui-12nc2b7 { opacity: 1 !important; }
  .ui-hkFZG:hover .ui-1r7yerk { opacity: 0 !important; }
}
@media (prefers-reduced-motion: reduce) { .ui-ohti69, .ui-12nc2b7, .ui-1r7yerk { transition: none; } }
