/*
|--------------------------------------------------------------------------
| Public site design system
|--------------------------------------------------------------------------
| Corporate-advisory look: deep blue diagonal gradients, angled section
| edges, triangle-cropped photography, link-buttons with animated arrows
| and scroll-triggered reveals. Brand colours come from Site Settings via
| the --c-* custom properties set in layouts/public.blade.php.
*/

:root {
    --ease-out: cubic-bezier(0.215, 0.61, 0.355, 1); /* easeOutCubic */
    --ease-in-out: cubic-bezier(0.645, 0.045, 0.355, 1);
    --angle: 9vw;
}

/* ---------------------------------------------------------------
   Backgrounds & angled edges
   --------------------------------------------------------------- */
.hx-gradient {
    background-color: var(--c-ink);
    background-image: linear-gradient(14deg, var(--c-ink) 0%, var(--c-navy) 50%, var(--c-brand) 100%);
}
.hx-gradient-reverse {
    background-color: var(--c-ink);
    background-image: linear-gradient(166deg, var(--c-brand) 0%, var(--c-navy) 50%, var(--c-ink) 100%);
}
.hx-angle-bottom { clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--angle)), 0 100%); }
.hx-angle-bottom-r { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 calc(100% - var(--angle))); }
.hx-angle-top { clip-path: polygon(0 var(--angle), 100% 0, 100% 100%, 0 100%); }

/* Decorative outline triangles floating in gradient sections */
.hx-shape {
    position: absolute; pointer-events: none;
    border: 1px solid rgba(255, 255, 255, .12);
    clip-path: polygon(100% 0, 0 32%, 72% 100%);
    animation: hx-float 9s ease-in-out infinite;
}
.hx-shape--fill { border: 0; background: linear-gradient(160deg, rgba(255,255,255,.08), rgba(255,255,255,0)); }
@keyframes hx-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 14px; } }

/* ---------------------------------------------------------------
   Triangle-cropped hero media
   --------------------------------------------------------------- */
.hx-tri-wrap { position: relative; }
/* On desktop the frame grows past its column (left + up) so more of the photo shows */
@media (min-width: 1024px) {
    .hx-tri-wrap--bleed { width: calc(100% + 5rem); margin-left: -5rem; margin-top: -3rem; }
    .hx-tri-wrap--bleed-sm { width: calc(100% + 3rem); margin-left: -3rem; margin-top: -2rem; }
}
.hx-tri {
    position: relative; width: 100%; aspect-ratio: 1 / 1.08; overflow: hidden;
    clip-path: polygon(100% 0, 0 20%, 82% 100%);
}
.hx-tri__img {
    position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
    /* The triangle's visual centre sits right of the box centre; nudging
       the photo left keeps the subject inside the bright frame. */
    object-position: 38% 50%;
    transition: opacity 1.2s var(--ease-in-out), scale 1.4s var(--ease-out);
}
.hx-tri-wrap:hover .hx-tri__img { scale: 1.04; }

/* The triangle only shows ~half the photo. The rest stays visible as a
   brand-blue "ghost" behind it, feathered into the background so there's
   no hard rectangle — the triangle remains the full-colour focal frame. */
.hx-tri-ghost {
    position: absolute; inset: 0; overflow: hidden; pointer-events: none; opacity: .32;
    -webkit-mask-image: radial-gradient(ellipse 72% 70% at 58% 46%, #000 38%, transparent 100%);
            mask-image: radial-gradient(ellipse 72% 70% at 58% 46%, #000 38%, transparent 100%);
}
.hx-tri-ghost .hx-tri__img { filter: grayscale(1) contrast(1.1); }
.hx-tri-ghost::after { content: ''; position: absolute; inset: 0; background: var(--c-brand); mix-blend-mode: color; }

/* Thin accent line tracing the triangle so it still reads over the ghost. */
.hx-tri-outline { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.hx-tri-outline polygon { fill: none; stroke: var(--c-accent); stroke-opacity: .55; stroke-width: 1.5; vector-effect: non-scaling-stroke; }

/* Intro: the triangle and the photo inside it slide in from opposite
   sides, so the image appears to stay put while its frame arrives. */
.hx-tri-intro { opacity: 0; }
.hx-tri-intro .hx-tri { translate: -45% 0; }
.hx-tri-intro .hx-tri__img { translate: 45% 0; }
.hx-tri-intro.is-in { opacity: 1; transition: opacity 2s var(--ease-in-out); }
.hx-tri-intro.is-in .hx-tri,
.hx-tri-intro.is-in .hx-tri__img { translate: 0 0; transition: translate 2.2s var(--ease-out), opacity 1.2s var(--ease-in-out), scale 1.4s var(--ease-out); }
/* The ghost has no moving frame, so its photo must not slide — it simply
   fades in with the wrap, lining up with the photo inside the triangle. */
.hx-tri-intro .hx-tri-ghost .hx-tri__img,
.hx-tri-intro.is-in .hx-tri-ghost .hx-tri__img { translate: 0 0; }

/* ---------------------------------------------------------------
   Scroll reveal  — [data-reveal="up|left|right|fade|zoom"] [data-delay="1..8"]
   --------------------------------------------------------------- */
.js-motion [data-reveal] {
    opacity: 0;
    transition: opacity 1s var(--ease-out), translate 1.1s var(--ease-out), scale 1.1s var(--ease-out);
    transition-delay: calc(var(--d, 0) * 110ms);
}
.js-motion [data-reveal="up"], .js-motion [data-reveal=""] { translate: 0 2rem; }
.js-motion [data-reveal="left"] { translate: -4rem 0; }
.js-motion [data-reveal="right"] { translate: 4rem 0; }
.js-motion [data-reveal="zoom"] { scale: .94; }
.js-motion [data-reveal].is-in { opacity: 1; translate: 0 0; scale: 1; }
[data-delay="1"] { --d: 1; } [data-delay="2"] { --d: 2; } [data-delay="3"] { --d: 3; } [data-delay="4"] { --d: 4; }
[data-delay="5"] { --d: 5; } [data-delay="6"] { --d: 6; } [data-delay="7"] { --d: 7; } [data-delay="8"] { --d: 8; }

/* Accent rule that draws itself in */
.hx-rule { display: block; height: 3px; width: 3.5rem; background: var(--c-accent); transform-origin: left; }
.js-motion .hx-rule { scale: 0 1; transition: scale 1s var(--ease-out) .2s; }
.js-motion .is-in .hx-rule, .js-motion .hx-rule.is-in { scale: 1 1; }

/* ---------------------------------------------------------------
   Typography helpers
   --------------------------------------------------------------- */
.hx-eyebrow {
    display: inline-flex; align-items: center; gap: .75rem;
    font-size: .75rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
}
.hx-eyebrow::before { content: ''; width: 1.75rem; height: 2px; background: var(--c-accent); }

/* ---------------------------------------------------------------
   Link button — label + arrow in a circle; arrow nudges on hover
   --------------------------------------------------------------- */
.hx-link {
    display: inline-flex; align-items: center; gap: .85rem;
    font-weight: 700; font-size: .95rem; color: var(--c-ink);
}
.hx-link__icon {
    position: relative; flex: none; width: 2.75rem; height: 2.75rem; border-radius: 9999px;
    display: grid; place-items: center; overflow: hidden;
    background: var(--c-accent); color: var(--c-ink);
    transition: background-color .3s var(--ease-out), color .3s var(--ease-out);
}
.hx-link__icon svg { width: 1.1rem; height: 1.1rem; transition: translate .45s var(--ease-out); }
.hx-link:hover .hx-link__icon svg, .group:hover .hx-link__icon svg { animation: hx-nudge .9s var(--ease-out); }
@keyframes hx-nudge { 0% { translate: 0 0; } 45% { translate: 150% 0; } 46% { translate: -150% 0; } 100% { translate: 0 0; } }
.hx-link__label { background: linear-gradient(currentColor, currentColor) 0 100% / 0 1.5px no-repeat; transition: background-size .45s var(--ease-out); padding-bottom: 2px; }
.hx-link:hover .hx-link__label, .group:hover .hx-link__label { background-size: 100% 1.5px; }
.hx-link--light { color: #fff; }
.hx-link--outline .hx-link__icon { background: transparent; color: currentColor; box-shadow: inset 0 0 0 1.5px currentColor; }
.hx-link--outline:hover .hx-link__icon { background: var(--c-accent); color: var(--c-ink); box-shadow: none; }

/* Solid button */
.hx-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
    padding: .95rem 1.75rem; font-weight: 700; font-size: .9rem;
    background: var(--c-accent); color: var(--c-ink);
    transition: background-color .3s var(--ease-out), color .3s var(--ease-out), translate .3s var(--ease-out);
}
.hx-btn:hover { background: #fff; translate: 0 -2px; }
.hx-btn--brand { background: var(--c-brand); color: #fff; }
.hx-btn--brand:hover { background: var(--c-navy); color: #fff; }

/* ---------------------------------------------------------------
   Cards
   --------------------------------------------------------------- */
.hx-card { position: relative; display: flex; flex-direction: column; background: #fff; }
.hx-card__media { position: relative; overflow: hidden; background: var(--c-mist); }
.hx-card__media img { width: 100%; height: 100%; object-fit: cover; transition: scale .8s var(--ease-out); }
.hx-card:hover .hx-card__media img { scale: 1.06; }
.hx-card__bar { position: absolute; left: 0; bottom: 0; height: 4px; width: 100%; background: var(--c-accent); transform-origin: left; scale: 0 1; transition: scale .6s var(--ease-out); }
.hx-card:hover .hx-card__bar { scale: 1 1; }

/* Slanted image corner, echoing the triangle motif */
.hx-cut { clip-path: polygon(0 0, 100% 0, 100% 82%, 0 100%); }

/* ---------------------------------------------------------------
   Navigation
   --------------------------------------------------------------- */
.hx-nav { color: #fff; background: transparent; transition: background-color .4s var(--ease-out), box-shadow .4s var(--ease-out), color .4s var(--ease-out), translate .45s var(--ease-out); }
.hx-nav.is-solid { color: var(--c-ink); background: #fff; box-shadow: 0 1px 0 rgba(1,30,65,.08), 0 10px 30px -18px rgba(1,30,65,.35); }
.hx-nav.is-hidden { translate: 0 -100%; }
.hx-nav[data-menu-open] { color: #fff; background: transparent; box-shadow: none; }
.hx-nav .hx-nav-cta { background: var(--c-accent); color: var(--c-ink); }
.hx-nav .hx-nav-cta:hover { background: #fff; }
.hx-nav.is-solid .hx-nav-cta:hover { background: var(--c-ink); color: #fff; }
.hx-overlay { opacity: 0; visibility: hidden; transition: opacity .5s var(--ease-out), visibility .5s; }
.hx-overlay.is-open { opacity: 1; visibility: visible; }
.hx-overlay a { opacity: 0; translate: 0 1.25rem; transition: opacity .6s var(--ease-out), translate .6s var(--ease-out); transition-delay: calc(var(--d, 0) * 70ms + 120ms); }
.hx-overlay.is-open a { opacity: 1; translate: 0 0; }
.hx-nav-link { position: relative; padding: .5rem 0; }
.hx-nav-link::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--c-accent); scale: 0 1; transform-origin: right; transition: scale .4s var(--ease-out); }
.hx-nav-link:hover::after, .hx-nav-link.is-active::after { scale: 1 1; transform-origin: left; }

/* ---------------------------------------------------------------
   Slider progress ring (SVG circle, r=20 → circumference ≈ 125.66)
   --------------------------------------------------------------- */
.hx-ring { width: 2.75rem; height: 2.75rem; rotate: -90deg; }
.hx-ring circle { fill: none; stroke-width: 2; }
.hx-ring .hx-ring__track { stroke: currentColor; opacity: .25; }
.hx-ring .hx-ring__bar { stroke: var(--c-accent); stroke-dasharray: 0 125.66; }
.hx-ring.is-running .hx-ring__bar { animation: hx-ring var(--ring-ms, 6000ms) linear forwards; }
@keyframes hx-ring { from { stroke-dasharray: 0 125.66; } to { stroke-dasharray: 125.66 0; } }

/* Back to top */
.hx-top { opacity: 0; pointer-events: none; translate: 0 1rem; transition: opacity .4s var(--ease-out), translate .4s var(--ease-out), background-color .3s; }
.hx-top.is-visible { opacity: 1; pointer-events: auto; translate: 0 0; }

/* ---------------------------------------------------------------
   World clocks (home → Travels & tours). Brand tokens only.
   .hx-clocks gets .is-in from the scroll reveal; each card carries
   --i (its position) for the stagger.
   --------------------------------------------------------------- */
.hx-clock-card { position: relative; overflow: hidden; isolation: isolate; }

/* Slow drifting sheen — alternate cards drift the opposite way. */
.hx-clock-card::before {
    content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background-image: linear-gradient(297deg, rgb(255 255 255 / .09), transparent 55%),
                      linear-gradient(119deg, rgb(var(--c-accent-rgb) / .07), transparent 56%);
    background-size: 200% 200%;
    animation: hx-sheen 10s ease-in-out infinite;
}
.hx-clock-card:nth-child(even)::before { animation-direction: reverse; }
@keyframes hx-sheen { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

/* Lagos (the benchmark): accent frame with a soft breathing glow. */
.hx-clock-card.is-base { background: rgb(255 255 255 / .1); }
.hx-clock-card.is-base::after {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    box-shadow: inset 0 0 0 2px var(--c-accent), inset 0 0 24px rgb(var(--c-accent-rgb) / .25);
    animation: hx-base-glow 3.2s ease-in-out infinite;
}
@keyframes hx-base-glow { 50% { box-shadow: inset 0 0 0 2px var(--c-accent), inset 0 0 42px rgb(var(--c-accent-rgb) / .45); } }

/* Staggered entrance + one 3D turn of the face when scrolled into view. */
.js-motion .hx-clocks .hx-clock-card { opacity: 0; translate: 0 14px; scale: .96; }
.js-motion .hx-clocks.is-in .hx-clock-card {
    opacity: 1; translate: 0 0; scale: 1;
    transition: opacity .7s var(--ease-out), translate .7s var(--ease-out), scale .7s var(--ease-out);
    transition-delay: calc(var(--i, 0) * 90ms + 250ms);
}
.js-motion .hx-clocks.is-in .hx-clock-face { animation: hx-face-turn 1.1s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 90ms + 350ms); }
@keyframes hx-face-turn { from { transform: perspective(600px) rotateY(-180deg); } to { transform: perspective(600px) rotateY(0); } }

/* Hover: the face turns once (on the inner svg so it never replays the entrance). */
.hx-clock-face svg { display: block; }
@media (hover: hover) {
    .hx-clock-card:hover .hx-clock-face svg { animation: hx-face-spin .9s var(--ease-out); }
}
@keyframes hx-face-spin { from { transform: perspective(600px) rotateY(0); } to { transform: perspective(600px) rotateY(360deg); } }

/* Sweeping second hand — JS sets a negative delay so it matches real seconds. */
.hx-clock-sec { transform-box: view-box; transform-origin: 50px 50px; animation: hx-sweep 60s linear infinite; }
@keyframes hx-sweep { to { transform: rotate(360deg); } }

/* Digital time rises into place whenever the minute changes. */
.hx-pop { display: inline-block; animation: hx-pop .45s var(--ease-out) both; transform-origin: bottom; }
@keyframes hx-pop { from { opacity: 0; transform: translateY(8px) scale(.8); } to { opacity: 1; transform: none; } }

/* "Live" dot beside the section label. */
.hx-live { position: relative; display: inline-block; width: .5rem; height: .5rem; border-radius: 9999px; background: var(--c-accent); vertical-align: middle; }
.hx-live::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: var(--c-accent); animation: hx-ping 2s cubic-bezier(0, 0, .2, 1) infinite; }
@keyframes hx-ping { 75%, 100% { transform: scale(2.6); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .hx-clock-sec { display: none; }
    .js-motion .hx-clocks .hx-clock-card { opacity: 1 !important; translate: none !important; scale: none !important; }
    .js-motion [data-reveal], .hx-tri-intro, .hx-tri-intro .hx-tri, .hx-tri-intro .hx-tri__img { opacity: 1 !important; translate: none !important; scale: none !important; }
    .js-motion .hx-rule { scale: 1 1 !important; }
}
