/* ==========================================================================
   ICE v3. Depth and gradient on the approved near-black, gold-accent ground.

   v2 borrowed igloo.inc's feel with floating objects behind the portrait. Tim
   did not want objects around his face, and wanted more depth, more gradient
   and some 3D. So this version:

   - layered light instead of objects: warm and cool lights behind the hero,
     a rim light over the photo's right edge, atmosphere in every band
   - surfaces with a lit edge, a gradient border and a stacked shadow, so
     cards, tiles and buttons sit above the page instead of on it
   - 3D where it is useful: cards tilt a few degrees toward the pointer, and
     a gold TA shield (three.js, lazy, away from the face) turns in the work
     orders section. Both are optional layers over a finished static page.

   Rules this file keeps:
   - Near-black ground, gold the only accent. Cool tones are low alpha light,
     never a new brand colour.
   - Static depth (gradients, shadows, edges) needs no JavaScript. Anything
     that hides or moves content is gated on html.ice, which ice.js only adds
     when motion is allowed. Reduced-motion readers, crawlers and print get
     the finished page.
   - transform and opacity for motion, no transition:all, controls under
     300ms, hover only where hover exists.
   - Nothing blends or promotes a layer over the masked portrait (that is how
     an image can blank on some Windows GPU drivers).
   - Delete the <link> and <script> and the site is exactly as it was.
   ========================================================================== */

:root{
  --ice:#E9F1FA;
  --ice-edge:rgba(233,241,250,.07);
  --ice-edge-hi:rgba(233,241,250,.14);
  --ice-ease:cubic-bezier(.23,1,.32,1);

  /* gold, as a surface and as a metal */
  --g-gold:linear-gradient(180deg,#F6E2AE 0%,#D8B46F 50%,#A98238 100%);
  --g-gold-btn:linear-gradient(180deg,#F3DAA0 0%,#D8B46F 46%,#B58B3E 100%);
  /* surfaces that catch light from the top left */
  --g-card:linear-gradient(158deg,#1C1F26 0%,#15171C 44%,#101216 100%);
  --g-edge:linear-gradient(150deg,rgba(240,208,150,.62) 0%,rgba(212,175,106,.17) 34%,rgba(212,175,106,.05) 60%,rgba(240,208,150,.32) 100%);
  /* lit top edge, dark bottom edge, near shadow, far shadow */
  --sh-depth:inset 0 1px 0 rgba(255,255,255,.075),inset 0 -1px 0 rgba(0,0,0,.5),0 2px 4px rgba(0,0,0,.5),0 24px 46px -24px rgba(0,0,0,.95);
  --sh-depth-hi:inset 0 1px 0 rgba(255,255,255,.12),inset 0 -1px 0 rgba(0,0,0,.5),0 4px 8px rgba(0,0,0,.55),0 34px 60px -26px rgba(0,0,0,1);
  color-scheme:dark;
}

/* ---- type -------------------------------------------------------------- */
/* Headings were set tight (-.025em on the name, -.015em on h2). Opened a
   little: the serif breathes and the letters have room to be read. */
h1{letter-spacing:-.014em}
h2{letter-spacing:-.006em}
h3{letter-spacing:0}
h1,h2,h3,h4{
  font-kerning:normal;
  font-optical-sizing:auto;
  font-feature-settings:"kern","liga","calt";
  text-wrap:balance;
}
p,li,dd{text-wrap:pretty}
.kicker{letter-spacing:.16em}
::selection{background:rgba(212,175,106,.30);color:var(--ink)}
html{scrollbar-color:rgba(212,175,106,.34) var(--paper)}

/* Gold type that is lit from above instead of flat. Only on text that is never
   split into letters or fringed (the animated hero name stays plain). */
h1.carve>.grad,
.hero h1 .roles .grad,
.metric dt.grad,
.band-deep .metric dt.grad{
  background:var(--g-gold);
  -webkit-background-clip:text;background-clip:text;
  -webkit-text-fill-color:transparent;color:transparent;
  /* a text-shadow would paint over the clipped gradient, so depth comes from a
     filter on these few elements instead */
  text-shadow:none;
  filter:drop-shadow(0 2px 0 rgba(0,0,0,.6)) drop-shadow(0 12px 22px rgba(0,0,0,.5));
}

/* The name and the section headings: cream at the top falling to gold, so
   the letters read as lit from above. Same technique and same caveat as above. */
.hero h1 .name,
main h2.grad{
  background:linear-gradient(180deg,#FFFFFF 0%,#FBEFD0 40%,#E3BF74 100%);
  -webkit-background-clip:text;background-clip:text;
  -webkit-text-fill-color:transparent;color:transparent;
  text-shadow:none;
  filter:drop-shadow(0 2px 0 rgba(0,0,0,.65)) drop-shadow(0 12px 24px rgba(0,0,0,.5));
}

/* Inline links: a quiet gold underline that fills in on hover. */
p a:not(.btn):not(.tlink),li a:not(.btn):not(.tlink),dd a:not(.btn):not(.tlink){
  text-decoration-color:rgba(212,175,106,.38);
  transition:color .18s var(--ease), text-decoration-color .18s var(--ease);
}
p a:not(.btn):not(.tlink):hover,li a:not(.btn):not(.tlink):hover,dd a:not(.btn):not(.tlink):hover{
  text-decoration-color:currentColor;
}

/* ---- atmosphere: every band has light in it ---------------------------- */
/* The inverted band: a warm light from the top right, a cool one from the
   bottom left, falling into black. The plain band is the lifted one. */
.band-deep{
  background:
    radial-gradient(1100px 460px at 88% -14%,rgba(212,175,106,.12),transparent 68%),
    radial-gradient(900px 520px at -6% 114%,rgba(86,116,170,.12),transparent 70%),
    linear-gradient(180deg,#0A0B0E 0%,#06070A 100%);
}
.band{
  background:
    radial-gradient(900px 380px at 10% -12%,rgba(212,175,106,.075),transparent 70%),
    radial-gradient(800px 360px at 100% 112%,rgba(86,116,170,.07),transparent 70%),
    linear-gradient(180deg,#12151A 0%,#0E1015 100%);
}
main>section.reveal:not(.band):not(.band-deep){
  background:radial-gradient(900px 300px at 50% -10%,rgba(255,255,255,.035),transparent 70%);
}

/* ---- header: a material, lit from above -------------------------------- */
header{
  box-shadow:inset 0 1px 0 var(--ice-edge),0 1px 0 rgba(0,0,0,.6);
  transition:background-color 240ms var(--ice-ease), box-shadow 240ms var(--ice-ease);
}
/* Once the page has moved, the bar thickens and drops a soft shadow so the
   content sliding under it reads as sliding under glass. */
header.ice-scrolled{
  background:rgba(10,11,13,.94);
  box-shadow:inset 0 1px 0 var(--ice-edge), 0 16px 34px -22px rgba(0,0,0,.95);
}
.ice-bar{
  position:absolute;left:0;bottom:-1px;width:100%;height:1px;
  background:linear-gradient(90deg,rgba(212,175,106,0),rgba(240,208,150,.9));
  transform:scaleX(0);transform-origin:0 50%;
  pointer-events:none;
}
@media (prefers-reduced-transparency:reduce){
  header{background:#0A0B0D;-webkit-backdrop-filter:none;backdrop-filter:none}
}

/* ---- navigation: a gold line draws under the link under the cursor ----- */
@media (hover:hover) and (pointer:fine) and (prefers-reduced-motion:no-preference){
  nav.top a{position:relative}
  nav.top a::after{
    content:"";position:absolute;
    left:.7rem;right:.7rem;bottom:.5rem;height:1px;
    background:var(--gold);
    transform:scaleX(0);transform-origin:left center;
    transition:transform 220ms var(--ice-ease);
    pointer-events:none;
  }
  [dir="rtl"] nav.top a::after{transform-origin:right center}
  nav.top a:hover::after,nav.top a:focus-visible::after{transform:scaleX(1)}
}

/* ---- text links: the arrow leans into the direction it points ---------- */
/* .tlink is a flex container, so the space before the arrow collapses once
   the arrow is its own item; the margin puts it back. */
.ice-arrow{display:inline-block;margin-inline-start:.3em}
@media (hover:hover) and (pointer:fine) and (prefers-reduced-motion:no-preference){
  .ice-arrow{transition:transform 200ms var(--ice-ease)}
  .tlink:hover .ice-arrow{transform:translateX(4px)}
  [dir="rtl"] .tlink:hover .ice-arrow{transform:translateX(-4px)}
}

/* ---- cards and tiles: raised, with a gradient edge --------------------- */
/* The fill is opaque on purpose: it sits in the padding box, and the edge
   gradient shows through the transparent border around it. Photo cards keep
   their own picture. */
.card:not(.card--photo),
.band-deep .card:not(.card--photo){
  border:1px solid transparent;
  background:var(--g-card) padding-box,var(--g-edge) border-box;
  box-shadow:var(--sh-depth);
}
.metric,
.band-deep .metric{
  border:1px solid transparent;
  border-top:3px solid var(--gold);
  background:var(--g-card) padding-box,var(--g-edge) border-box;
  box-shadow:var(--sh-depth);
}
.note{
  box-shadow:inset 0 1px 0 rgba(255,255,255,.05),0 18px 36px -24px rgba(0,0,0,.9);
  background-image:linear-gradient(100deg,rgba(212,175,106,.08),transparent 60%);
}
@media (hover:hover) and (pointer:fine){
  .card:not(.card--photo):hover,.metric:hover{box-shadow:var(--sh-depth-hi)}
}

/* ---- buttons: struck gold, with a gloss, a bevel and a glow ------------ */
/* Bigger and bolder than before: the label is the point. The primary is a
   gold bar lit from above (bright top, glossy upper half, a dark lower lip
   for thickness, a gold glow underneath). The ghost is dark glass inside a
   gold gradient edge. Both were plain; Tim said so. */
.btn{
  min-height:54px;
  padding:.8rem 1.6rem;
  font-size:1.0625rem;
  font-weight:700;
  letter-spacing:.012em;
  border-radius:10px;
}
.btn-lg{min-height:60px;padding:.95rem 1.9rem;font-size:1.125rem}
.btn-primary,
.band-deep .btn-primary{
  position:relative;overflow:hidden;isolation:isolate;
  background:linear-gradient(180deg,#FDECBE 0%,#EFCD88 16%,#D9AD58 54%,#B0802F 100%);
  color:#1A1208;
  text-shadow:0 1px 0 rgba(255,255,255,.6);
  border:1px solid #F6DDA1;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.85),
    inset 0 -3px 0 rgba(104,70,18,.5),
    0 0 0 1px rgba(0,0,0,.4),
    0 16px 30px -10px rgba(212,175,106,.7),
    0 4px 8px rgba(0,0,0,.6);
}
/* the gloss: a clear lighter top half */
.btn-primary::before{
  content:"";position:absolute;left:0;right:0;top:0;height:52%;z-index:-1;
  background:linear-gradient(180deg,rgba(255,255,255,.6),rgba(255,255,255,.1));
  border-radius:inherit;pointer-events:none;
}
/* the sweep: one bright diagonal that crosses the bar on hover */
.btn-primary::after{
  content:"";position:absolute;top:0;bottom:0;left:0;width:60%;z-index:-1;
  background:linear-gradient(105deg,transparent 30%,rgba(255,255,255,.7) 50%,transparent 70%);
  transform:translateX(-140%);pointer-events:none;
}
@media (hover:hover) and (pointer:fine) and (prefers-reduced-motion:no-preference){
  .btn-primary:hover::after{transform:translateX(230%);transition:transform 700ms var(--ice-ease)}
  .btn-primary:hover{
    transform:translateY(-2px);
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,.9),
      inset 0 -3px 0 rgba(104,70,18,.5),
      0 0 0 1px rgba(0,0,0,.4),
      0 22px 38px -10px rgba(235,203,144,.85),
      0 6px 10px rgba(0,0,0,.6);
  }
}
.btn-primary:active,.band-deep .btn-primary:active{
  transform:translateY(0) scale(.98);
  box-shadow:inset 0 2px 5px rgba(80,52,10,.5),0 0 0 1px rgba(0,0,0,.4),0 6px 12px -6px rgba(212,175,106,.5);
}
.btn-ghost,
.band-deep .btn-ghost{
  color:#F6DDA1;
  text-shadow:0 0 20px rgba(212,175,106,.45);
  border:1.5px solid transparent;
  background:
    linear-gradient(180deg,#22252C 0%,#14161B 100%) padding-box,
    linear-gradient(160deg,rgba(246,221,161,.95),rgba(212,175,106,.28) 50%,rgba(246,221,161,.65)) border-box;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.12),0 14px 26px -14px rgba(0,0,0,1),0 0 0 1px rgba(0,0,0,.4);
}
@media (hover:hover) and (pointer:fine){
  .btn-ghost:hover,.band-deep .btn-ghost:hover{
    color:#FFF1CC;
    background:
      linear-gradient(180deg,#2B2F37 0%,#191C22 100%) padding-box,
      linear-gradient(160deg,#FBE6B0,rgba(212,175,106,.5) 50%,#F6DDA1) border-box;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.18),0 18px 30px -14px rgba(212,175,106,.35),0 0 0 1px rgba(0,0,0,.4);
  }
}
.chip{
  border:1.5px solid transparent;
  background:
    linear-gradient(180deg,#22252C,#15171C) padding-box,
    linear-gradient(160deg,rgba(246,221,161,.7),rgba(212,175,106,.18) 55%,rgba(246,221,161,.45)) border-box;
  color:#F3EBD6;font-weight:600;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 10px 18px -12px rgba(0,0,0,1);
}
@media (hover:hover) and (pointer:fine){
  .chip:hover{color:#FFF1CC;box-shadow:inset 0 1px 0 rgba(255,255,255,.16),0 14px 24px -12px rgba(212,175,106,.4)}
}
@media (prefers-reduced-motion:no-preference){
  .btn{
    transition:background-color .18s var(--ease), color .18s var(--ease),
               border-color .18s var(--ease), box-shadow .22s var(--ease),
               transform 160ms var(--ice-ease);
  }
}

/* ---- lettering: lit, with depth under it ------------------------------- */
/* Headings are brighter and carry a shadow stack (a hard 1px, a soft drop, a
   faint gold halo) so they stand off the page. Done with text-shadow, not a
   filter, so the letters stay crisp and the thaw can animate their shadow. */
h1,h2,h3{
  text-shadow:0 1px 0 rgba(0,0,0,.7),0 10px 26px rgba(0,0,0,.55),0 0 38px rgba(212,175,106,.14);
}
h2,.sec-head h2{color:#FFF8E8}
h3{color:#F8F0DA}
.band-deep h2,.band-deep h3{color:#FFF8E8}
.lede,.card p,.metric dd,.sec-head p{color:#D6D0C3}
.band-deep .lede,.band-deep .card p,.band-deep .metric dd{color:#D6D0C3}
.kicker{color:#EBCB90;text-shadow:0 0 18px rgba(212,175,106,.4)}
nav.top a{font-weight:600;text-shadow:0 1px 0 rgba(0,0,0,.6)}
.brand .bname{text-shadow:0 1px 0 rgba(0,0,0,.7),0 0 24px rgba(212,175,106,.25)}

/* ---- section dividers: a still hairline with a bright centre ----------- */
.reveal{position:relative}
.reveal::before{
  content:"";position:absolute;top:-1px;left:0;right:0;z-index:2;
  width:min(var(--wrap),calc(100% - 2*var(--gut)));
  margin-inline:auto;height:1px;
  background:linear-gradient(90deg,transparent,rgba(212,175,106,.5) 22%,rgba(233,241,250,.85) 50%,rgba(212,175,106,.5) 78%,transparent);
  pointer-events:none;
}

/* ---- the hero: layers of light ----------------------------------------- */
.hero{
  background:
    radial-gradient(1000px 720px at 84% 16%,rgba(212,175,106,.11),transparent 66%),
    radial-gradient(820px 620px at -4% 0%,rgba(80,108,160,.14),transparent 70%),
    linear-gradient(180deg,#0D0F13 0%,#0A0B0D 58%,#08090B 100%);
}
/* A rim light over the photograph's right edge and a warm floor under the
   shoulders. Plain alpha gradients: no blend mode, nothing near the face. */
.hero:has(.portrait)::after{
  content:"";position:absolute;inset:0;z-index:1;pointer-events:none;
  background:
    radial-gradient(40% 54% at 100% 26%,rgba(244,212,154,.24),rgba(212,175,106,.07) 48%,transparent 72%),
    radial-gradient(58% 26% at 72% 100%,rgba(212,175,106,.12),transparent 70%);
}
/* Parallax lights, made by ice.js. They sit behind the photo, so they show in
   its faded edges and around it, and drift against the pointer and the
   scroll at different rates: that difference is the depth. */
/* A fixed height, not inset on all four sides: if it followed the hero's height,
   a late font swap that re-wraps the text would move this big box and count as
   layout shift. It only needs to cover the photo's part of the hero. */
.ice-depth{position:absolute;left:-6%;right:-6%;top:-40px;height:820px;z-index:0;pointer-events:none}
.ice-depth i{position:absolute;display:block;border-radius:50%}
.ice-depth .d1{right:-2%;top:-14%;width:60%;aspect-ratio:1;background:radial-gradient(circle,rgba(240,208,150,.24) 0,rgba(212,175,106,.08) 40%,transparent 68%)}
.ice-depth .d2{left:-10%;top:4%;width:50%;aspect-ratio:1;background:radial-gradient(circle,rgba(100,132,190,.22) 0,rgba(80,108,160,.07) 42%,transparent 70%)}
.ice-depth .d3{right:4%;bottom:-8%;width:56%;aspect-ratio:1.5;background:radial-gradient(ellipse,rgba(212,175,106,.16) 0,transparent 66%)}
@media (max-width:760px){.ice-depth .d2,.ice-glow{display:none}}

/* ---- cards tilt toward the pointer (only where a pointer exists) ------- */
@media (hover:hover) and (pointer:fine) and (prefers-reduced-motion:no-preference){
  .ice .card:not(.card--photo),.ice .metric{position:relative}
  .ice .card:not(.card--photo):hover,.ice .metric:hover{
    transform:perspective(900px) rotateX(var(--rx,0deg)) rotateY(var(--ry,0deg));
  }
  .ice .card:not(.card--photo),.ice .metric{
    transition:transform 160ms var(--ice-ease),box-shadow .2s var(--ease);
  }
  /* a soft specular that follows the pointer across the face of the card */
  .ice .card:not(.card--photo)::after,.ice .metric::after{
    content:"";position:absolute;inset:0;border-radius:inherit;pointer-events:none;
    background:radial-gradient(260px circle at var(--mx,50%) var(--my,0%),rgba(255,240,205,.13),transparent 70%);
    opacity:0;transition:opacity 200ms var(--ice-ease);
  }
  .ice .card:not(.card--photo):hover::after,.ice .metric:hover::after{opacity:1}
}

/* ---- the seal: a gold TA shield, flat for everyone, 3D where it can run -- */
.wrap:has(>.seal){position:relative}
.seal{
  position:absolute;right:0;top:-6px;
  width:clamp(190px,20vw,280px);aspect-ratio:11/13.5;
  display:none;pointer-events:none;
}
@media (min-width:1000px){.seal{display:block}}
/* the light the shield sits in */
.seal::before{
  content:"";position:absolute;inset:-22%;
  background:radial-gradient(circle at 50% 46%,rgba(240,208,150,.30),rgba(212,175,106,.09) 42%,transparent 68%);
}
.seal-svg,.seal canvas{position:absolute;inset:0;width:100%;height:100%;display:block}
.seal-svg text{font-family:var(--serif);font-weight:700}
.seal canvas{opacity:0;transition:opacity 800ms var(--ice-ease)}
.seal-svg{transition:opacity 800ms var(--ice-ease)}
.seal.on canvas{opacity:1}
.seal.on .seal-svg{opacity:0}

/* ==========================================================================
   Everything below hides or moves content, so it only exists when ice.js has
   run and the reader has not asked for less motion.
   ========================================================================== */

/* Marked by ice.js only for things that start below the fold, so nothing
   visible ever blinks. ice.js clears it as the element arrives. */
.ice .ice-wait{opacity:0}

/* Heading letters. Words stay whole (they are the line-break unit), letters
   stay inline so kerning survives. Animated by ice.js, nothing here moves. */
.iw{display:inline-block;white-space:nowrap;transform-origin:50% 90%}

/* The name arrives a touch tighter and a touch fringed, then opens and
   settles in about a second. The text is painted at once, so the largest
   paint is never delayed. */
@keyframes ice-settle{
  from{
    letter-spacing:-.04em;
    text-shadow:-1.5px 0 0 rgba(255,96,96,.42), 1.5px 0 0 rgba(96,170,255,.42);
  }
  to{
    /* ends with no shadow: the name is clipped gold-on-cream gradient text, and a
       text-shadow would paint over it. Its depth comes from a filter instead. */
    text-shadow:0 0 0 rgba(255,96,96,0), 0 0 0 rgba(96,170,255,0);
  }
}
.ice .hero h1 .name{animation:ice-settle 1100ms var(--ice-ease) 100ms 1 both}

/* One pass of light across the portrait, once, after the image has landed. */
@keyframes ice-pass{to{transform:translateX(130%)}}
.ice .portrait.ice-pass::after{
  content:"";position:absolute;inset:0;pointer-events:none;
  background:linear-gradient(105deg,transparent 34%,rgba(233,241,250,.07) 46%,rgba(255,255,255,.13) 50%,rgba(233,241,250,.07) 54%,transparent 66%);
  transform:translateX(-130%);
  animation:ice-pass 1500ms var(--ice-ease) 1 forwards;
}
/* No will-change: the photo sits under a two-way mask, and a promoted layer
   plus a mask is a known way to blank an image on some Windows GPU drivers. */
.ice .portrait img{transform-origin:50% 40%}

/* A cool light that follows the pointer across the hero, eased so it trails
   the cursor like light on a surface rather than sticking to it. */
.ice-glow{
  position:absolute;left:0;top:0;z-index:3;
  width:640px;height:640px;margin:-320px 0 0 -320px;
  border-radius:50%;pointer-events:none;
  background:radial-gradient(circle,rgba(233,241,250,.085) 0,rgba(233,241,250,.03) 38%,transparent 66%);
  /* Plain alpha, no mix-blend-mode: a blend mode over a masked photo is the
     other half of the GPU blanking bug, and at this alpha it looks the same. */
  opacity:0;transition:opacity 500ms var(--ice-ease);
}
.ice-glow.on{opacity:1}

@media print{
  .ice .ice-wait{opacity:1!important}
  .ice-bar,.ice-depth,.ice-glow,.ice-light,.seal,.reveal::before{display:none}
  .hero:has(.portrait)::after{display:none}
}

/* ---- the live light (ice-light.js) ------------------------------------
   One fixed canvas under everything: body>* sits at z-index 1, body::before
   (the CSS light) and this canvas at 0, the canvas later in the DOM so it
   paints over the CSS light. html.ice-lit is set only once the shader has
   drawn, then the two crossfade. Sections are transparent to the field,
   so the light reads through the whole page, as the CSS one does. */
.ice-light{position:fixed;inset:0;width:100%;height:100%;z-index:0;pointer-events:none;opacity:0;transition:opacity 1.4s var(--ice-ease)}
html.ice-lit .ice-light{opacity:1}
html.ice-lit body::before{opacity:0;transition:opacity 1.4s var(--ice-ease)}
