/* Visual polish layer for the MJK Global Associates site.
   Pure CSS: no content or layout changes, safe to remove. Motion respects prefers-reduced-motion. */

html { scroll-behavior: smooth; }
::selection { background: #C9A45C; color: #0B1F3A; }
:focus-visible { outline: 2px solid #C9A45C; outline-offset: 3px; }

/* ---------- header: frosted glass + gold underline sweep ---------- */
header[style*="position: sticky"] {
  background: rgba(255, 255, 255, .88) !important;
  -webkit-backdrop-filter: saturate(1.5) blur(14px);
  backdrop-filter: saturate(1.5) blur(14px);
}
header[style*="position: sticky"] nav a, header[style*="position: sticky"] nav button { position: relative; }

/* ---------- hero: slow cinematic zoom + staggered entrance ---------- */
@keyframes mjk-kenburns { from { transform: scale(1.02); } to { transform: scale(1.12); } }
@keyframes mjk-up { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
@keyframes mjk-shine { to { background-position: 200% center; } }
@keyframes mjk-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes mjk-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

[data-screen-label="Home"] > img { animation: mjk-kenburns 28s ease-in-out infinite alternate; transform-origin: 60% 40%; }
[data-screen-label="Home"] div[style*="letter-spacing"] { animation: mjk-up .8s ease both; }
[data-screen-label="Home"] h1 { animation: mjk-up 1s .15s cubic-bezier(.2, .7, .2, 1) both; }
[data-screen-label="Home"] h1 ~ p { animation: mjk-up 1s .3s cubic-bezier(.2, .7, .2, 1) both; }
[data-screen-label="Home"] h1 ~ div { animation: mjk-up 1s .45s cubic-bezier(.2, .7, .2, 1) both; }

/* ---------- gold shimmer on the italic accent words in headings ---------- */
h1 span[style*="italic"], h2 span[style*="italic"] {
  background: linear-gradient(100deg, #86672A 0%, #D9B76A 35%, #86672A 70%, #D9B76A 100%);
  background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent !important;
  animation: mjk-shine 7s linear infinite;
}

/* ---------- eyebrow rules draw in ---------- */
span[style*="width: 28px"][style*="height: 2px"] { transform-origin: left center; animation: mjk-grow .9s .2s cubic-bezier(.2, .7, .2, 1) both; }

/* ---------- buttons: lift + glow ---------- */
a[style*="display: inline-flex"], button[style*="cursor: pointer"] {
  transition: transform .25s ease, box-shadow .25s ease, background .15s, border-color .15s, color .15s !important;
}
a[style*="display: inline-flex"]:hover, button[style*="cursor: pointer"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px -14px rgba(11, 31, 58, .55);
}
a[style*="background: rgb(201, 164, 92)"]:hover { box-shadow: 0 14px 30px -12px rgba(201, 164, 92, .75); }

/* ---------- image cards: slow zoom on hover ---------- */
a[style*="min-height: 420px"] img, a[style*="aspect-ratio"] img, div[style*="min-height: 560px"] img { transition: transform 1.1s cubic-bezier(.2, .7, .2, 1), opacity .4s; }
a[style*="min-height: 420px"]:hover img { transform: scale(1.09); }

/* ---------- service / article / generic link cards: soft lift ---------- */
a[style*="padding: 28px"][style*="border-color: rgb(221, 225, 231)"] { transition: transform .35s ease, box-shadow .35s ease, background .2s, border-color .2s !important; }
a[style*="padding: 28px"][style*="border-color: rgb(221, 225, 231)"]:hover { transform: translateY(-6px); box-shadow: 0 26px 44px -28px rgba(11, 31, 58, .5); }

/* ---------- footer logo gentle float ---------- */
footer svg[viewBox="140 20 230 260"] { animation: mjk-float 6s ease-in-out infinite; }

/* ---------- scroll-driven effects (Chrome / Edge; ignored elsewhere) ---------- */
@supports (animation-timeline: view()) {
  @keyframes mjk-reveal { from { opacity: 0; transform: translateY(44px); } to { opacity: 1; transform: none; } }
  main > section:not([data-screen-label="Home"]):not(:first-child),
  main > div > section:not(:first-child) {
    animation: mjk-reveal linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 32%;
  }
  @keyframes mjk-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
  body::before {
    content: ""; position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 200;
    background: linear-gradient(90deg, #9C7A36, #E2C88A, #9C7A36);
    transform-origin: 0 50%;
    animation: mjk-progress linear both; animation-timeline: scroll(root);
  }
}

/* ---------- accessibility ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  h1 span[style*="italic"], h2 span[style*="italic"] { -webkit-text-fill-color: initial; background: none; color: #86672A !important; }
}

/* =====================================================================
   Page-type looks (v2): each kind of page gets its own signature style
   ===================================================================== */

/* ---- Service & training pages: aurora hero, framed image with gold offset ---- */
@keyframes mjk-aurora { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
@keyframes mjk-sweep { from { transform: translateX(-120%) skewX(-18deg); } to { transform: translateX(260%) skewX(-18deg); } }
[data-screen-label="Service"] {
  position: relative; overflow: hidden;
  background:
    radial-gradient(900px 420px at 88% -10%, rgba(201, 164, 92, .22), transparent 60%),
    radial-gradient(760px 420px at -5% 110%, rgba(31, 111, 209, .14), transparent 60%),
    linear-gradient(120deg, #F7F8FA, #EEF1F6, #F7F8FA) !important;
  background-size: auto, auto, 220% 220% !important;
  animation: mjk-aurora 18s ease-in-out infinite;
}
[data-screen-label="Service"] > div { position: relative; z-index: 1; }
[data-screen-label="Service"] img {
  border: 1px solid rgba(11, 31, 58, .08);
  box-shadow: 18px 18px 0 -2px rgba(201, 164, 92, .9), 0 40px 70px -34px rgba(11, 31, 58, .65);
  transition: transform .8s cubic-bezier(.2, .7, .2, 1), box-shadow .8s;
}
[data-screen-label="Service"] img:hover { transform: translate(-6px, -6px); box-shadow: 26px 26px 0 -2px rgba(201, 164, 92, .95), 0 50px 80px -34px rgba(11, 31, 58, .7); }
[data-screen-label="Service"] h1 { background: linear-gradient(90deg, #0B1F3A 0%, #16407A 60%, #0B1F3A 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

/* ---- Dark editorial heroes (About, Leadership, Approach...): light beam + blueprint dots ---- */
[data-screen-label="About"]::before, [data-screen-label="About"]::after { content: ""; position: absolute; pointer-events: none; z-index: 1; }
[data-screen-label="About"]::before { inset: 0; background-image: radial-gradient(rgba(201, 164, 92, .28) 1px, transparent 1.4px); background-size: 28px 28px; -webkit-mask-image: linear-gradient(90deg, transparent 30%, #000 100%); mask-image: linear-gradient(90deg, transparent 30%, #000 100%); }
[data-screen-label="About"]::after { top: 0; bottom: 0; width: 22%; background: linear-gradient(90deg, transparent, rgba(226, 200, 138, .16), transparent); animation: mjk-sweep 9s ease-in-out infinite; }
[data-screen-label="About"] > div:last-of-type { z-index: 2; }

/* ---- Leadership: monochrome portraits that bloom into colour, gold halo ---- */
div[style*="margin: -28px -28px 10px"] img { filter: grayscale(.85) contrast(1.04); transition: filter .6s ease, transform 1.1s cubic-bezier(.2, .7, .2, 1); }
div:has(> div[style*="margin: -28px -28px 10px"]):hover div[style*="margin: -28px -28px 10px"] img { filter: none; transform: scale(1.06); }
div:has(> div[style*="margin: -28px -28px 10px"]) { position: relative; }
div:has(> div[style*="margin: -28px -28px 10px"])::after {
  content: ""; position: absolute; inset: -1px; pointer-events: none; opacity: 0; transition: opacity .4s;
  background: linear-gradient(135deg, rgba(201, 164, 92, .9), transparent 40%, transparent 60%, rgba(201, 164, 92, .9)) border-box;
  -webkit-mask: linear-gradient(#000 0 0) padding-box exclude, linear-gradient(#000 0 0); mask: linear-gradient(#000 0 0) padding-box exclude, linear-gradient(#000 0 0);
  padding: 1px;
}
div:has(> div[style*="margin: -28px -28px 10px"]):hover::after { opacity: 1; }

/* ---- Service-area cards (AREA_01...): neon-blueprint edge on hover ---- */


/* ---- Insight / training carousels & article cards ---- */
a[style*="scroll-snap-align"] img { transition: transform 1s cubic-bezier(.2, .7, .2, 1); }
a[style*="scroll-snap-align"]:hover img { transform: scale(1.06); }
a[style*="scroll-snap-align"] { overflow: hidden; }

/* ---- Contact page: glowing enquiry card ---- */
section[style*="margin: -112px auto 0"] > div:first-child { box-shadow: 0 50px 90px -40px rgba(11, 31, 58, .6), 0 0 0 1px rgba(201, 164, 92, .25) !important; }
input:focus, textarea:focus, select:focus { box-shadow: 0 0 0 4px rgba(201, 164, 92, .28) !important; border-color: #0B1F3A !important; }

/* ---- Light sections get a faint blueprint grid for depth ---- */
section[style*="background: rgb(244, 245, 247)"]:not([data-screen-label]) {
  background-image: linear-gradient(rgba(11, 31, 58, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(11, 31, 58, .035) 1px, transparent 1px);
  background-size: 36px 36px;
}

/* ---- Footer: gold crown line ---- */
footer { position: relative; }
footer::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, transparent, #C9A45C, #E2C88A, #C9A45C, transparent); }

@media (prefers-reduced-motion: reduce) {
  [data-screen-label="Service"], [data-screen-label="About"]::after { animation: none !important; }
  [data-screen-label="Service"] h1 { -webkit-text-fill-color: initial; background: none; color: #0B1F3A; }
}
@media (max-width: 700px) {
  [data-screen-label="Service"] img { box-shadow: 10px 10px 0 -2px rgba(201, 164, 92, .9), 0 30px 50px -30px rgba(11, 31, 58, .6); }
}

/* ---- Leadership org tree: lead on top, team branching below ---- */
[data-tree="root"]::after { content: ""; position: absolute; left: 50%; top: 100%; width: 2px; height: 18px; margin-left: -1px; background: linear-gradient(#C9A45C, #9C7A36); }
[data-tree="branch"]::before { content: ""; position: absolute; left: 50%; top: -18px; width: 2px; height: 18px; margin-left: -1px; background: #C9A45C; }
[data-tree="branch"]::after { content: ""; position: absolute; top: -18px; left: -9px; right: -9px; height: 2px; background: #C9A45C; }
[data-tree="branch"]:first-child::after { left: 50%; }
[data-tree="branch"]:last-child::after { right: 50%; }
[data-tree="branch"]:only-child::after { display: none; }
[data-tree="row"]::before { content: ""; position: absolute; left: 50%; top: -18px; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: #C9A45C; box-shadow: 0 0 0 5px rgba(201, 164, 92, .25); z-index: 1; opacity: 0; }
[data-tree="branch"] > div, [data-tree="root"] > div { height: 100%; }
[data-tree="root"] > div { box-shadow: 0 30px 60px -30px rgba(11, 31, 58, .6), 0 0 0 1px rgba(201, 164, 92, .35); }
@media (max-width: 899px) {
  [data-tree="branch"]::after { display: none; }
  [data-tree="branch"]::before { top: -16px; height: 16px; }
  [data-tree="row"] { row-gap: 32px !important; }
}

/* ---- Org tree: compact sizing so the whole team fits comfortably on screen ---- */
[data-tree="root"] { width: 250px !important; }
[data-tree="row"] { max-width: 1060px; margin-left: auto; margin-right: auto; gap: 14px !important; }
[data-tree] img { aspect-ratio: 5 / 4 !important; object-position: center 12% !important; }
[data-tree] div[style*="padding: 28px"] { padding: 22px !important; gap: 8px !important; }
[data-tree] div[style*="margin: -28px -28px 10px"], [data-tree] div[style*="margin: -28px -28px 8px"] { margin: -22px -22px 6px !important; }
[data-tree] div[style*="margin: -28px -28px 8px"] > div { aspect-ratio: 5 / 4 !important; }
[data-tree] span[style*="font-size: 23px"] { font-size: 19px !important; }
[data-tree] span[style*="font-size: 14.5px"] { font-size: 13.5px !important; }
[data-tree] span[style*="font-size: 12.5px"] { font-size: 11.5px !important; }
@media (max-width: 899px) {
  [data-tree="row"] { max-width: 520px; margin-top: 24px !important; }
  [data-tree="root"]::after, [data-tree="branch"]::before { display: none; }
}
@media (max-width: 519px) {
  [data-tree="root"], [data-tree="row"] { max-width: 300px; width: 100% !important; }
}
