/* Polish layer, loaded last on every page.
   It refines the existing look (type, depth, edges, motion) without changing layout,
   so each page's own inline styles stay the source of truth for structure. */

:root{
  --ink:#15171B;
  --blue:#3D5AFE;
  --cream:#F7F3EA;
  --ease-out:cubic-bezier(.2,.8,.2,1);
  /* faint paper grain, drawn once and tiled */
  /* paper: a fine warm grain for the cream page */
  --grain:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .08 0 0 0 0 .07 0 0 0 0 .05 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.38'/%3E%3C/svg%3E");
  /* paper fibres: long, soft streaks at a larger scale, so the page reads as stock rather than as noise */
  --fibre:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='480' height='480'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.012 .18' numOctaves='2' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .28 0 0 0 0 .16 0 0 0 1.1 -.55'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)' opacity='.3'/%3E%3C/svg%3E");
  /* cards: the same grain, lighter, so cards stay a cleaner sheet than the page they sit on */
  --grain-soft:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .08 0 0 0 0 .07 0 0 0 0 .05 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.24'/%3E%3C/svg%3E");
  /* ink and blue: a light film grain, so dark and saturated surfaces stop looking digital-flat */
  --grain-light:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .7 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.22'/%3E%3C/svg%3E");
  /* the torn edge, same hand as the taped section headings */
  --torn:polygon(0 100%,0 48%,2% 64%,4.5% 30%,7% 58%,9% 38%,11.5% 70%,14% 26%,16.5% 54%,19% 40%,21% 66%,23.5% 22%,26% 56%,28.5% 36%,31% 62%,33% 30%,35.5% 68%,38% 34%,40.5% 52%,43% 24%,45.5% 60%,48% 40%,50% 70%,52.5% 28%,55% 56%,57.5% 34%,60% 64%,62% 26%,64.5% 50%,67% 38%,69.5% 68%,72% 30%,74.5% 58%,77% 22%,79% 54%,81.5% 40%,84% 66%,86.5% 28%,89% 52%,91% 36%,93.5% 64%,96% 30%,98% 56%,100% 40%,100% 100%);
}

/* ---------- type ---------- */
html{scroll-behavior:smooth;scroll-padding-top:24px}
@media (prefers-reduced-motion:reduce){html{scroll-behavior:auto}}
body{
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  text-rendering:optimizeLegibility;
  font-kerning:normal;
  background-image:var(--grain),var(--fibre);
  background-size:220px 220px,480px 480px;
}

/* ---------- textures on every surface ---------- */
/* paper cards and insets */
[style*="background:#FEFDFA"],
[style*="background:#F7F3EA"],
[style*="background:#F1EBDB"],
[style*="background:#F2EDE1"]{
  background-image:var(--grain-soft) !important;
  background-size:200px 200px !important;
}
/* ink sections, the taped headings and the blue chips */
[style*="background:#15171B"],
[style*="background:#1D2027"],
[style*="background:#3D5AFE"]:not(.band){
  background-image:var(--grain-light) !important;
  background-size:200px 200px !important;
}
h1,h2,h3{text-wrap:balance}
p,li,blockquote{text-wrap:pretty}
::selection{background:#FFC300;color:var(--ink)}

/* ---------- the blue bands ---------- */
.band{
  position:relative;
  isolation:isolate;
  /* a soft light from the top right and a little weight in the bottom left, so the blue has depth instead of reading flat */
  background-image:
    radial-gradient(900px 520px at 82% 8%,rgba(255,255,255,.16),transparent 62%),
    radial-gradient(760px 520px at 4% 104%,rgba(10,16,80,.22),transparent 64%),
    linear-gradient(180deg,rgba(255,255,255,.03),rgba(0,0,0,.04)),
    var(--grain-light) !important;
  background-size:auto,auto,auto,200px 200px !important;
}
.band::before{
  /* a quiet dot grid, masked so it fades out toward the text */
  content:"";position:absolute;inset:0;z-index:-1;pointer-events:none;
  background-image:radial-gradient(rgba(255,255,255,.22) 1px,transparent 1.4px);
  background-size:22px 22px;
  -webkit-mask-image:radial-gradient(700px 420px at 88% 30%,#000,transparent 72%);
          mask-image:radial-gradient(700px 420px at 88% 30%,#000,transparent 72%);
  opacity:.55;
}
/* blue gives way to cream along a torn edge rather than a ruler-straight line */
.band-top::after,
.band-foot::after{
  content:"";position:absolute;left:0;right:0;height:16px;pointer-events:none;
  background-color:var(--cream);background-image:var(--grain),var(--fibre);background-size:220px 220px,480px 480px;
}
.band-top::after{bottom:-1px;clip-path:var(--torn)}
.band-foot::after{top:-1px;clip-path:var(--torn);transform:scaleY(-1)}
@media (max-width:520px){.band-top::after,.band-foot::after{height:10px}}

/* ---------- cards ---------- */
/* softer, layered shadow in place of the single flat one, and a slower settle on hover */
[style*="box-shadow:0 6px 18px rgba(21,23,27,.07)"]{
  box-shadow:0 1px 0 rgba(21,23,27,.03),0 2px 4px rgba(21,23,27,.03),0 14px 30px -14px rgba(21,23,27,.20) !important;
  transition:transform .35s var(--ease-out),box-shadow .35s var(--ease-out),border-color .35s ease !important;
}
.hv6:hover,.hv8:hover,.hv6:focus-within,.hv8:focus-within{
  transform:translateY(-4px) !important;
  border-color:#D9D1BF !important;
  box-shadow:0 1px 0 rgba(21,23,27,.03),0 6px 10px rgba(21,23,27,.04),0 26px 44px -18px rgba(21,23,27,.30) !important;
}
/* a blue rule draws across the top of a card as you reach for it */
.hv6::before,.hv8::before{
  content:"";position:absolute;left:-1px;right:-1px;top:-1px;height:2px;z-index:3;pointer-events:none;
  background:var(--blue);transform:scaleX(0);transform-origin:0 50%;
  transition:transform .45s var(--ease-out);
}
.hv6:hover::before,.hv8:hover::before,.hv6:focus-within::before,.hv8:focus-within::before{transform:scaleX(1)}

/* ---------- small things ---------- */
/* the portrait gets a thin halo so it sits on the blue rather than being cut out of it */
.hero-portrait [data-flip] img{box-shadow:0 0 0 8px rgba(255,255,255,.08),0 18px 40px -16px rgba(10,16,80,.55) !important}
/* footer and inline text links underline from the left on hover */
p a:not([class]),li a:not([class]){
  background-image:linear-gradient(currentColor,currentColor);
  background-size:0 1px;background-position:0 100%;background-repeat:no-repeat;
  transition:background-size .3s var(--ease-out),color .18s ease;
}
p a:not([class]):hover,li a:not([class]):hover{background-size:100% 1px}

@media (prefers-reduced-motion:reduce){
  .hv6:hover,.hv8:hover,.hv6:focus-within,.hv8:focus-within{transform:none !important}
}
@media print{
  body,[style*="background:#"]{background-image:none !important}
  .band::before,.band-top::after,.band-foot::after{display:none}
}
