/* (the device's tilt, 0 to 1: registered and not inherited, so the story changing it every frame restyles the device
   alone, not every element inside it) */
@property --t { syntax: '<number>'; inherits: false; initial-value: 0; }

/* The overview's hero (Faiq, 3 Dec 2026). After TMV's AI-readiness lockup ("AI / ENHANCES / designers"): "Travel
   insurance" small at the top left, AUDIT huge and muted (fitted to the bar's ends by overview.js), "and redesign" in
   italic at the foot right in Great Eastern's red. A landscape iPad rises in front of the word's lower half, seen from a
   low, Apple-like angle (as Apple shows the iPhone 18 Pro's back close up, but the front: Great Eastern's splash on its
   screen; the redesign is kept for later in the scroll), cut off by the screen's foot, standing up as the page scrolls.
   TMV's seal, two circles round its words and its mark in its own colours, at the bottom right.
   Colour 60 / 30 / 10: the page, Great Eastern's red (the italic, the glow), the blue button. */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.ahero {
  position: relative;
  isolation: isolate;
  height: calc(100svh - var(--nav-h));
  min-height: 560px;
  overflow: clip;
}
/* ---------- the lockup (TMV's .ag-lock) ---------- */
.ahero-lock {
  position: absolute;
  z-index: 0;
  /* (first places only, unseen until placed: overview.js sets left and top in pixels from the bar's ends and the
     window's middle. No centring translate: an animation library reading it once baked a -50% into the word, Faiq,
     3 Dec 2026) */
  left: var(--gutter);
  top: calc(50svh - var(--nav-h) - 0.5 * clamp(80px, 26vw, 520px));
  display: grid;
  margin: 0;
  line-height: 0.8;
  white-space: nowrap;
  pointer-events: none;
}

/* "The Mighty Victorian" signed over the foot of the IT, as an auditor signs off at the bottom right of a page (Faiq,
   3 Dec 2026), in a signature face (Allison; one weight only, so a hairline of its own colour round each letter gives
   it a firmer pen). On its own layer, above the device, so it can be big enough to read and cross the iPad's corner.
   overview.js sizes and places it from the big word; the heading keeps the words for screen readers. */
.ahero-sig {
  position: absolute;
  z-index: 3;
  font: 400 40px / 1 'Allison', 'Mrs Saint Delafield', 'Brush Script MT', cursive;
  white-space: nowrap;
  color: var(--fg);
  -webkit-text-stroke: 0.022em currentColor;
  paint-order: stroke fill;
  rotate: -15deg;
  transform-origin: 100% 100%;
  pointer-events: none;
}
.ahero:not(.is-placed) .ahero-sig {
  visibility: hidden;
}
.lk-big {
  /* (a first size only: overview.js fits it to the bar's ends) */
  font: 800 clamp(80px, 26vw, 520px) / 0.8 var(--sans);
  letter-spacing: -0.05em;
  text-transform: uppercase;
  color: rgb(243 238 227 / 0.14);
}
:root[data-theme='light'] .lk-big {
  color: rgb(21 22 26 / 0.1);
}
/* (in front of the iPad: the device covers the word's lower half, not this) */
/* the subject: plain, the same face and weight as the credit, in the page's own ink (not italic, not red) */

/* ---------- the iPad (iPad Pro 13, landscape, space black: 281.6 x 215.5 mm, screen 2752 x 2064) ---------- */
.ahero-device {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: var(--device-top, 37%);
  translate: -50% 0;
  perspective: 1600px;
  perspective-origin: 50% 20%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s var(--ease);
}
/* (Faiq, 3 Dec 2026: "on refresh the hero section moves up slightly, I don't want this": the device only fades in, it
   never moves on load; its one movement is with the scroll, standing up and, as on Tammi, on into the next section) */
@keyframes ahero-rise {
  from {
    opacity: 0;
  }
}
.ipad {
  --w: min(58vw, 860px);
  --t: 0;
  position: relative;
  width: var(--w);
  padding: calc(var(--w) * 0.024);
  border: calc(var(--w) * 0.0055) solid transparent;
  border-radius: calc(var(--w) * 0.046);
  /* the screen's black, inside an aluminium band with a lit chamfer along its top */
  background:
    linear-gradient(#050506, #050506) padding-box,
    linear-gradient(178deg, #9a9aa1 0%, #3b3b40 6%, #232327 40%, #2c2c31 85%, #55555c 100%) border-box;
  /* straight on, its chin up (Faiq, 3 Dec 2026: "donggak", no turn left or right): the top leans back and the screen
     tips up towards the light; it stands up as the page scrolls */
  transform: rotateX(calc(42deg * (1 - var(--t))));
  transform-origin: 50% 100%;
  will-change: transform;
  /* its thickness (the band's lower edge, stacked) and its shadow */
  box-shadow:
    0 1px 0 #48484e, 0 2px 0 #3f3f45, 0 3px 0 #37373c, 0 4px 0 #303035, 0 5px 0 #2a2a2e, 0 6px 0 #252529,
    0 7px 0 #202024, 0 8px 1px #1b1b1f,
    inset 0 1px 0 rgb(255 255 255 / 0.22),
    0 50px 90px -20px rgb(0 0 0 / 0.65);
}
:root[data-theme='light'] .ipad {
  box-shadow:
    0 1px 0 #48484e, 0 2px 0 #3f3f45, 0 3px 0 #37373c, 0 4px 0 #303035, 0 5px 0 #2a2a2e, 0 6px 0 #252529,
    0 7px 0 #202024, 0 8px 1px #1b1b1f,
    0 50px 90px -20px rgb(40 30 10 / 0.35);
}
/* the front camera and its sensor, on the long edge (landscape), as on iPad Pro */
.ipad-cam {
  position: absolute;
  top: calc(var(--w) * 0.0105);
  left: 50%;
  translate: -50% 0;
  display: flex;
  gap: calc(var(--w) * 0.006);
  align-items: center;
}
.ipad-cam i {
  display: block;
  width: calc(var(--w) * 0.0065);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #3a4a66 0 22%, #0d1118 50%, #050607 100%);
}
.ipad-cam i + i {
  width: calc(var(--w) * 0.0035);
  background: #111318;
}
/* the screen: Great Eastern's splash, its logo alone on white, under glass that catches the light */
.ipad-screen {
  position: relative;
  aspect-ratio: 2752 / 2064;
  border-radius: calc(var(--w) * 0.024);
  background: #fff;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.ipad-screen img {
  width: 38%;
  height: auto;
  translate: 0 -12%;
}
.ipad-screen::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(112deg, rgb(255 255 255 / 0.5) 0%, rgb(255 255 255 / 0) 28%, rgb(0 0 0 / 0) 62%, rgb(0 0 0 / 0.06) 100%);
  mix-blend-mode: soft-light;
}

@media (max-width: 899px) {
  .ipad {
    --w: min(96vw, 760px);
  }
}
@media (max-width: 699px) {
  /* (a phone: a shorter hero, the iPad tucked under the word's foot, the glow behind it) */
  .ahero {
    height: calc(100svh - var(--nav-h));
    min-height: 0;
  }
  /* (the word stays near the top on a phone, above the iPad) */
  .ahero-lock {
    top: clamp(20px, 5vh, 56px);
  }
  /* a phone shows a phone: a portrait iPhone instead of the iPad (Faiq, 3 Dec 2026) */
  .ahero-device {
    display: none;
  }
  .ahero-phone {
    display: block;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ahero-device,
  .ahero-phone {
    animation: none;
  }
}
/* the lockup is unseen until overview.js has sized and placed it for the web font, then fades in (no jump on load) */
.ahero-lock {
  opacity: 0;
  transition: opacity 0.6s var(--ease);
}
.ahero.is-placed .ahero-lock {
  opacity: 1;
}

/* ---------- the iPhone, on phones only (iPhone 17 Pro, portrait: 71.9 x 150 mm, screen 1206 x 2622) ----------
   Rising from the foot of the screen under the lockup, cut off by it, its chin up like the iPad's; Great Eastern's
   splash on its screen. It stands up as the page scrolls (--t, overview.js) */
.ahero-phone {
  display: none;
  position: absolute;
  z-index: 1;
  left: 50%;
  top: var(--phone-top, 29%);
  translate: -50% 0;
  perspective: 1400px;
  perspective-origin: 50% 0%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s var(--ease);
}
.phone {
  --w: min(64vw, 300px);
  --t: 0;
  position: relative;
  width: var(--w);
  padding: calc(var(--w) * 0.032);
  border: calc(var(--w) * 0.014) solid transparent;
  border-radius: calc(var(--w) * 0.19);
  background:
    linear-gradient(#050506, #050506) padding-box,
    linear-gradient(178deg, #9a9aa1 0%, #3b3b40 6%, #232327 40%, #2c2c31 85%, #55555c 100%) border-box;
  transform: rotateX(calc(26deg * (1 - var(--t))));
  transform-origin: 50% 100%;
  will-change: transform;
  box-shadow:
    0 1px 0 #48484e, 0 2px 0 #3f3f45, 0 3px 0 #37373c, 0 4px 0 #303035, 0 5px 0 #2a2a2e, 0 6px 0 #252529,
    inset 0 1px 0 rgb(255 255 255 / 0.22),
    0 40px 70px -20px rgb(0 0 0 / 0.6);
}
:root[data-theme='light'] .phone {
  box-shadow:
    0 1px 0 #48484e, 0 2px 0 #3f3f45, 0 3px 0 #37373c, 0 4px 0 #303035, 0 5px 0 #2a2a2e, 0 6px 0 #252529,
    0 40px 70px -20px rgb(40 30 10 / 0.32);
}
/* (site.css gives every .phone an island and a side button of its own: the hero's phone has these, so they go,
   or it showed two islands, Faiq, 3 Dec 2026) */
.ahero .phone::before,
.ahero .phone::after {
  content: none;
}
/* the Dynamic Island */
.phone-island {
  position: absolute;
  z-index: 2;
  top: calc(var(--w) * 0.062);
  left: 50%;
  width: calc(var(--w) * 0.3);
  height: calc(var(--w) * 0.088);
  translate: -50% 0;
  border-radius: 999px;
  background: #000;
}
.phone-screen {
  position: relative;
  aspect-ratio: 1206 / 2622;
  border-radius: calc(var(--w) * 0.155);
  background: #fff;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.phone-screen img {
  width: 72%;
  height: auto;
  translate: 0 -8%;
}
.phone-screen::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(112deg, rgb(255 255 255 / 0.5) 0%, rgb(255 255 255 / 0) 30%, rgb(0 0 0 / 0) 62%, rgb(0 0 0 / 0.05) 100%);
  mix-blend-mode: soft-light;
}
/* (after the iPhone's own rules, so a phone shows it) */
@media (max-width: 699px) {
  .ahero-phone {
    display: block;
  }
}

/* the devices show once overview.js has placed them on the word's foot */
.ahero.is-placed .ahero-device,
.ahero.is-placed .ahero-phone {
  opacity: 1;
}

/* ---------- the entrance (Faiq, 3 Dec 2026) ----------
   The word settles (the camera pulls back); the device is pushed into the screen from below with its screen dark; the
   screen lights up to the splash and a sheen crosses the glass; the board clatters (overview.js, at 1.5 s); and last
   the signature writes itself across the IT and the iPad's corner, as an auditor signs off: all of it in about 3.7 s,
   so it is done before a visitor scrolls (Faiq, 3 Dec 2026). Every part ends where it
   rests, so a refresh never jumps. The ending (#play) plays the same entrance when it is reached. */
/* (Faiq, 3 Dec 2026: "not cinematic enough"; then "the ipad move in and audit text seems like the same animation")
   1 · the word does not travel, it settles: it starts large, as if the camera were close, and the camera pulls back
   until it sits at its size (the iPad, next, is the one that moves). Scale and opacity only, so it costs no layout */
.ahero.is-placed .lk-big {
  transform-origin: 50% 55%;
  animation: ahero-word 1.1s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes ahero-word {
  from {
    opacity: 0;
    scale: 1.45;
  }
  35% {
    opacity: 1;
  }
}
/* 2 · the device is pushed into the screen: it comes from below the window, nearer and lying back, as if slid from the
   keyboard, and settles where it rests (its tilt, --t, from flatter than at rest to rest). It ends exactly where it
   rests, so nothing jumps after. The story's own movement starts only after it (review.js) */
.ahero.is-placed .ahero-device .ipad,
.ahero.is-placed .ahero-phone .phone {
  animation: ahero-push 1.2s cubic-bezier(0.2, 0.9, 0.25, 1) 0.3s backwards;
}
@keyframes ahero-push {
  from {
    translate: 0 85vh;
    scale: 1.22;
    --t: -0.95;
  }
  to {
    translate: 0 0;
    scale: 1;
    --t: 0;
  }
}
/* once played (overview.js adds is-entered when it is over), the word's and the devices' entrances are off: they end
   exactly where they rest, so nothing moves, and switching between phone and desktop widths, which re-pins the hero
   and restarts CSS animations, can no longer replay them under the scroll story's measurements (Faiq, 4 Dec 2026: the
   iPad sat half off the screen after going from a phone's width to a desktop's) */
.ahero.is-entered .lk-big,
.ahero.is-entered .ahero-device .ipad,
.ahero.is-entered .ahero-phone .phone {
  animation: none;
}
/* (during a ScrollTrigger refresh the entrance is lifted, so everything is measured at rest; overview.js puts it back
   where it had got to straight after, before anything is painted) */
.ahero.is-measuring .lk-big,
.ahero.is-measuring .ahero-sig,
.ahero.is-measuring .ahero-device .ipad,
.ahero.is-measuring .ahero-phone .phone,
.ahero.is-measuring .ipad-screen.splash::before,
.ahero.is-measuring .phone-screen.splash::before,
.ahero.is-measuring .ipad-screen.splash::after,
.ahero.is-measuring .phone-screen.splash::after {
  animation: none !important;
}
/* the signature, written: a soft-edged mask sweeps from its first letter to its last, like a pen moving */
.ahero .ahero-sig {
  -webkit-mask: linear-gradient(90deg, #000 0 44%, transparent 56% 100%) 100% 0 / 260% 100% no-repeat;
  mask: linear-gradient(90deg, #000 0 44%, transparent 56% 100%) 100% 0 / 260% 100% no-repeat;
}
.ahero.is-placed .ahero-sig {
  animation: ahero-write 1.2s cubic-bezier(0.45, 0.05, 0.35, 1) 2.5s forwards;
}
@keyframes ahero-write {
  to {
    -webkit-mask-position: 0 0;
    mask-position: 0 0;
  }
}
.ahero.is-placed .ahero-device,
.ahero.is-placed .ahero-phone {
  /* (it starts below the window, so it is simply there as it slides in) */
  transition-duration: 0.2s;
  transition-delay: 0.3s;
}
/* the screen, dark until it powers on */
.ahero .ipad-screen.splash::before,
.ahero .phone-screen.splash::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 6;
  border-radius: inherit;
  background: #050506;
  pointer-events: none;
}
.ahero.is-placed .ipad-screen.splash::before,
.ahero.is-placed .phone-screen.splash::before {
  animation: ahero-on 0.6s ease-out 1.3s forwards;
}
@keyframes ahero-on {
  to {
    opacity: 0;
  }
}
/* a sheen of light across the glass, once */
.ahero.is-placed .ipad-screen.splash::after,
.ahero.is-placed .phone-screen.splash::after {
  content: '';
  display: block;
  position: absolute;
  inset: 0;
  z-index: 7;
  border-radius: inherit;
  background: linear-gradient(105deg, transparent 38%, rgb(255 255 255 / 0.34) 50%, transparent 62%) 130% 0 / 300% 100% no-repeat;
  mix-blend-mode: normal;
  pointer-events: none;
  animation: ahero-sheen 1.2s cubic-bezier(0.2, 0.7, 0.2, 1) 1.6s forwards;
}
@keyframes ahero-sheen {
  to {
    background-position: -40% 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ahero.is-placed .lk-big,
  .ahero.is-placed .ahero-device .ipad,
  .ahero.is-placed .ahero-phone .phone,
  .ahero.is-placed .ahero-sig,
  .ahero.is-placed .ipad-screen.splash::after,
  .ahero.is-placed .phone-screen.splash::after {
    animation: none;
  }
  .ahero.is-placed .ipad-screen.splash::after,
  .ahero.is-placed .phone-screen.splash::after {
    display: none;
  }
  .ahero .ipad-screen.splash::before,
  .ahero .phone-screen.splash::before {
    display: none;
  }
  /* (the signature is simply there) */
  .ahero .ahero-sig {
    -webkit-mask: none;
    mask: none;
  }
}
