/* =====================================================================
   Naykum — glass layer (round 2)
   1. Frosted-glass headings: a translucent white body, a bright glint that
      sweeps across (lighter than the body, never darker), a soft steel rim and
      a halo layer behind. The sweep runs only while the heading is on screen
      (.glass-live toggled by IntersectionObserver). Only transform, opacity and
      background-position are animated; no parent filter.
   2. Frosted-glass hero panels on inner pages, one composition per page.
   Palette D-01 only (Ink / Slate / Steel / white + opacity tints).
   ===================================================================== */

/* ---------- 1. glass headings ---------- */
.glass {
  --g1: #FFFFFF; --g2: rgba(216,223,236,.98); --glint: #FFFFFF;
  --rim: rgba(255,255,255,.55); --halo: rgba(141,153,174,.16);
  position: relative; isolation: isolate;
}
/* ink glass on Paper sections (crisp, near-opaque) */
.light .glass { --g1: rgba(26,26,46,1); --g2: rgba(43,45,66,.96); --glint: rgba(141,153,174,1); --rim: rgba(255,255,255,.55); --halo: rgba(141,153,174,0); }
/* white glass on dark panels that sit inside light sections */
.tile .glass, .zoom .zoom-after.glass { --g1: #FFFFFF; --g2: rgba(216,223,236,.98); --glint: #FFFFFF; --rim: rgba(255,255,255,.55); --halo: rgba(141,153,174,.16); }

/* halo layer behind the words: one tight 7 px shadow, none on small screens */
.glass::before {
  content: attr(data-text); position: absolute; inset: 0; z-index: -1; pointer-events: none;
  color: transparent; -webkit-text-fill-color: transparent;
  text-shadow: 0 0 7px var(--halo);
  opacity: 0; transition: opacity 1.2s var(--ease-out) .2s;
}
@media (max-width: 760px) { .glass::before { display: none; } }
.glass.glass-in::before, .hero.in .glass-hero::before { opacity: 1; }
.glass .gw,
.glass-hero .w {
  position: relative;
  background-image:
    linear-gradient(110deg, transparent 0%, transparent 30%, var(--glint) 46%, var(--glint) 54%, transparent 70%, transparent 100%),
    linear-gradient(180deg, var(--g1) 0%, var(--g1) 55%, var(--g2) 100%);
  background-size: 300% 100%, 100% 100%;
  background-position: 100% 0, 0 0;
  background-repeat: no-repeat;
  -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
}
/* rim: thin steel/white stroke duplicate over the translucent body */
.glass .gw::after,
.glass-hero .w::after {
  content: attr(data-text); position: absolute; inset: 0; padding: inherit; pointer-events: none;
  color: transparent; -webkit-text-fill-color: transparent; -webkit-text-stroke: .5px var(--rim);
}
.glass .gw {
  display: inline-block; opacity: 0; transform: translateY(.42em);
  transition: opacity .95s var(--ease-out), transform .95s var(--ease-out);
  transition-delay: calc(var(--d) * 55ms);
}
.glass.glass-in .gw { opacity: 1; transform: none; }
/* sheen: first pass on reveal, then every ~8 s, only while on screen */
.glass.glass-in.glass-live .gw,
.hero.in .glass-hero.glass-live .w {
  animation: glassSheen 8s var(--ease-in-out) infinite;
  animation-delay: calc(min(var(--d), 10) * 80ms + .5s);
  will-change: background-position;
}
.hero.in .glass-hero.glass-live .w { animation-delay: calc(min(var(--d), 10) * 90ms + .7s); }
@keyframes glassSheen {
  0%       { background-position: 100% 0, 0 0; }
  20%,100% { background-position: 0% 0, 0 0; }
}
.zoom-after {
  position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%);
  text-align: center; padding: 0 24px; opacity: 0; pointer-events: none; z-index: 3;
  font-size: var(--fs-display); line-height: 1.02; letter-spacing: var(--tracking-display); font-weight: 600;
}
.zoom-after small {
  display: block; margin-top: 18px; font-size: var(--fs-label); letter-spacing: var(--tracking-label);
  text-transform: uppercase; color: var(--steel); font-weight: 600;
}
@media (prefers-reduced-motion: no-preference) {
  .zoom { height: 170vh; }
  .zoom + .cta { padding-top: clamp(64px, 10vh, 110px); }
}
.tile .mono { text-align: center; }

/* ---------- 2. frosted-glass hero panels (inner pages) ---------- */
.page-hero .layers { width: min(470px, 40vw); aspect-ratio: 1.05; top: 54%; margin-top: 0; translate: 0 -50%; }
.page-hero .layers::before,
.page-hero .layers::after {
  content: ""; position: absolute; border-radius: 50%; pointer-events: none;
  animation: orbDrift 15s var(--ease-in-out) infinite alternate;
}
.page-hero .layers::before { width: 64%; height: 64%; left: 2%; top: 4%;
  background: radial-gradient(circle, rgba(141,153,174,.62), rgba(141,153,174,0) 70%); }
.page-hero .layers::after { width: 54%; height: 54%; right: -2%; bottom: 4%;
  background: radial-gradient(circle, rgba(255,255,255,.30), rgba(255,255,255,0) 70%);
  animation-duration: 19s; animation-direction: alternate-reverse; }
@keyframes orbDrift {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(16%, 12%) scale(1.14); }
  100% { transform: translate(-10%, 18%) scale(.94); }
}
.page-hero .layers i {
  z-index: 1; height: 26%; display: flex; align-items: center; gap: 14px; padding: 0 22px; font-style: normal; clip-path: inset(0 round 18px);
  background: linear-gradient(135deg, rgba(255,255,255,.17), rgba(255,255,255,.04));
  -webkit-backdrop-filter: blur(18px) saturate(150%); backdrop-filter: blur(18px) saturate(150%);
  border: 1px solid rgba(255,255,255,.2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.28), inset 0 -1px 0 rgba(255,255,255,.04), 0 26px 60px rgba(0,0,0,.36);
}
.page-hero .layers i::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 34%, rgba(255,255,255,.24) 48%, transparent 62%);
  transform: translateX(-130%); animation: paneSheen 7.5s var(--ease-in-out) infinite;
}
.page-hero .layers i:nth-child(2)::after { animation-delay: .22s; }
.page-hero .layers i:nth-child(3)::after { animation-delay: .44s; }
@keyframes paneSheen { 0% { transform: translateX(-130%); } 32%, 100% { transform: translateX(130%); } }
.page-hero .layers em { font-style: normal; font-size: 11px; letter-spacing: .14em; color: var(--steel); font-weight: 700; }
.page-hero .layers b { font-size: 16px; font-weight: 600; color: rgba(255,255,255,.95); letter-spacing: -.005em; white-space: nowrap; }
.page-hero .layers .ln { flex: 1; height: 2px; min-width: 24px; border-radius: 2px; background: rgba(255,255,255,.12); position: relative; overflow: hidden; }
.page-hero .layers .ln::after { content: ""; position: absolute; inset: 0; background: var(--steel); transform-origin: left;
  transform: scaleX(0); transition: transform 1.4s var(--ease-out); }
.page-hero.pane-live .layers .ln::after { transform: scaleX(var(--w, .6)); }
.page-hero .layers i:nth-child(2) .ln::after { transition-delay: .15s; }
.page-hero .layers i:nth-child(3) .ln::after { transition-delay: .3s; }

/* service visuals: static glass gradient (no backdrop-filter), soft orb */
.vis::before { content: ""; position: absolute; width: 70%; height: 70%; left: 10%; top: 6%; border-radius: 50%;
  background: radial-gradient(circle, rgba(141,153,174,.4), rgba(141,153,174,0) 70%); filter: blur(28px);
  animation: orbDrift 16s var(--ease-in-out) infinite alternate; }

/* ---------- fixes ---------- */
/* keep descenders inside the clipped glass fill */
.glass .gw, .glass-hero .w { padding: .04em .02em .16em; margin: -.04em -.02em -.16em; }
@media (min-width: 1041px) {
  .page-hero h1 { max-width: min(860px, 56%); }
  .page-hero .lead { max-width: min(600px, 52%); }
  .page-hero .layers { width: min(480px, 33vw); }
  .page-hero { min-height: 0; padding-bottom: clamp(56px, 8vh, 90px); }
}

/* page-title choreography: heading leads, eyebrow and lead follow */
.page-hero .glass .gw { transition-duration: .8s; transition-delay: calc(var(--d) * 42ms); }
.js .page-hero .eyebrow { animation: heroIn .7s var(--ease-out) both; }
.js .page-hero .lead { animation: heroIn .9s var(--ease-out) .55s both; }
@keyframes heroIn { from { opacity: 0; transform: translateY(14px); } }

/* mobile: pills follow the lead in normal flow instead of sitting behind the title */
@media (max-width: 760px) {
  .page-hero { display: flex; flex-direction: column; padding-bottom: 56px; }
  .page-hero .container { order: 1; }
  .page-hero .layers {
    order: 2; position: relative; inset: auto; right: auto; top: auto; translate: none; align-self: center;
    width: min(320px, calc(100% - 48px)); height: 168px; aspect-ratio: auto; margin: 36px 0 0; opacity: 1;
  }
  .page-hero .layers i { height: 30%; padding: 0 16px; gap: 10px; }
  .page-hero .layers i:nth-child(1) { top: 0; }
  .page-hero .layers i:nth-child(2) { top: 35%; }
  .page-hero .layers i:nth-child(3) { top: 70%; }
  .page-hero .layers b { font-size: 13px; }
  .page-hero .layers .ln { display: none; }
  [data-page="industries"] .layers i { flex-direction: row; align-items: center; justify-content: flex-start; gap: 10px; padding: 0 16px; width: auto; height: 30%; left: 0; right: 0; }
  [data-page="industries"] .layers i:nth-child(2), [data-page="industries"] .layers i:nth-child(3) { left: 0; }
  [data-page="industries"] .layers i:nth-child(1) { top: 0; } [data-page="industries"] .layers i:nth-child(2) { top: 35%; } [data-page="industries"] .layers i:nth-child(3) { top: 70%; }
  [data-page="case-studies"] .layers::before { display: none; }
  [data-page="case-studies"] .layers i { left: 0; right: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .glass .gw { opacity: 1; transform: none; }
  .glass .gw, .glass-hero .w, .page-hero .layers::before, .page-hero .layers::after, .page-hero .layers i::after, .vis::before, .halo, .n-ring {
    animation: none !important; }
  .glass .gw, .glass-hero .w { background-position: 0 0, 0 0; }
}
