/* ============================================================================
   Blind Mike: the whole design system, for index.html and portfolio.html.

   This used to live in a <style> block inside each page, duplicated, so a
   token changed in one had to be changed in the other by hand. It is one file
   now. Both pages link it and neither carries any CSS of its own.

   PALETTE. Three colours, and every pairing below is measured.

     --blue        #4D7CFF   black on it 5.64:1, so a blue slab takes black type
                             at any size, headline and body alike. Blue type on
                             black is the same 5.64:1 the other way round.
     --blue-deep   #1B4DFF   white on it 5.91:1. For solid buttons and for blue
                             type sitting on white.
     --black       #000000
     --white       #FFFFFF   on black, 21:1.

   The one rule: white type never sits on --blue (3.72:1), and black type never
   sits on --blue-deep (3.55:1). Each has a partner that does the job.

   Sections below:
     1. Core system        both pages
     2. Carried over       both pages, the pieces that predate the revamp
     3. Home page only
     4. Portfolio only
   ========================================================================= */


/* ===== 1. CORE SYSTEM ==================================================== */
:root{
  --blue:#4D7CFF;
  --blue-deep:#1B4DFF;
  --black:#000;
  --white:#fff;
  --gut:clamp(20px,5vw,80px);
  --slab:clamp(68px,9vw,140px);
  --ease:cubic-bezier(.2,.7,.3,1);
}

*,*::before,*::after{ box-sizing:border-box; }
html{ -webkit-text-size-adjust:100%; scroll-behavior:smooth; overflow-x:clip; }
body{
  margin:0; background:var(--black); color:var(--black);
  font-family:Inter,system-ui,-apple-system,"Segoe UI",sans-serif;
  font-size:16px; line-height:1.6; overflow-x:hidden;
}
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior:auto; }
  *,*::before,*::after{ animation-duration:.001ms !important; animation-iteration-count:1 !important; transition-duration:.001ms !important; }
}
img,video{ display:block; max-width:100%; }

/* ---- Slabs: full bleed bands of flat colour, no radius anywhere ---------- */
.slab{ padding:var(--slab) var(--gut); position:relative; }
.slab-blue{ background:var(--blue); color:var(--black); }
.slab-black{ background:var(--black); color:var(--white); }
.slab-white{ background:var(--white); color:var(--black); }
/* min-width:0 matters: .wrap is a flex child inside the hero, and a flex
   child defaults to min-width:auto, so one unbreakable string (the email
   button) dragged the whole column wider than a 320px screen and the right
   edge of every line got clipped. */
.wrap{ max-width:1320px; margin-inline:auto; width:100%; min-width:0; }

/* ---- Display type -------------------------------------------------------- */
.giant{
  font-family:Anton,Impact,sans-serif; font-weight:400;
  text-transform:uppercase; line-height:.84; letter-spacing:-.01em;
  margin:0; font-size:clamp(2.9rem,9.2vw,8.4rem);
}
.giant-sm{ font-size:clamp(2.2rem,6vw,5rem); }
.giant-xs{ font-size:clamp(1.6rem,3.6vw,3rem); }
/* the reference's two weight headline: light condensed next to the heavy */
.thin{
  font-family:Inter,sans-serif; font-weight:300; letter-spacing:-.035em;
}
.on-blue{ color:var(--blue); }
.on-black{ color:var(--black); }
.on-white{ color:var(--white); }

/* ---- Micro labels -------------------------------------------------------- */
.micro{
  font-size:clamp(.62rem,.78vw,.74rem); font-weight:700;
  text-transform:uppercase; letter-spacing:.2em; line-height:1.5; margin:0;
}
.aside-note{
  font-size:clamp(.72rem,.9vw,.86rem); font-weight:600;
  text-transform:uppercase; letter-spacing:.09em; opacity:.72; margin:0;
}

/* ---- Tape: the black pill with an icon ---------------------------------- */
.tape{
  display:inline-flex; align-items:center; gap:.55rem;
  background:var(--black); color:var(--blue);
  padding:.5rem .9rem; font-size:clamp(.64rem,.8vw,.76rem);
  font-weight:700; text-transform:uppercase; letter-spacing:.14em;
}
.tape-invert{ background:var(--blue); color:var(--black); }
.tape-white{ background:var(--white); color:var(--black); }

/* ---- Rules and connectors ----------------------------------------------- */
.rule{ height:2px; background:currentColor; opacity:.22; border:0; margin:0; }
.dotted{ height:34px; width:2px; margin:0 auto; background:repeating-linear-gradient(to bottom,currentColor 0 5px,transparent 5px 10px); opacity:.5; }

/* ---- Duotone. Greyscale art multiplied over blue: highlights go blue,
        shadows go black. One rule, no new image files. ------------------- */
.duo{ background:var(--blue); overflow:hidden; }
.duo > img, .duo > video{ filter:grayscale(1) contrast(1.12); mix-blend-mode:multiply; width:100%; height:100%; object-fit:cover; }
.duo-dark{ background:var(--blue-deep); }
.plain{ overflow:hidden; background:var(--black); }
.plain > img, .plain > video{ width:100%; height:100%; object-fit:cover; }
/* .bw was a hard black and white treatment for photos on a blue slab. Nothing
   uses it any more: Bryce Canyon and the Content cards both went back to full
   colour, and the Embrace Series gets its greyscale from .embrace-tile instead.
   Kept here because it is the right answer if a future photo fights the blue. */
.bw{ overflow:hidden; background:var(--black); }
.bw > img, .bw > video{ width:100%; height:100%; object-fit:cover; filter:grayscale(1) contrast(1.16); }

/* ---- Marquee ------------------------------------------------------------- */
.marquee{ overflow:hidden; border-block:2px solid currentColor; padding:.85rem 0; }
.marquee-track{ display:flex; width:max-content; animation:slide 34s linear infinite; }
.marquee-track > span{
  font-family:Anton,Impact,sans-serif; text-transform:uppercase;
  font-size:clamp(1.1rem,2.4vw,2rem); letter-spacing:.02em; padding-inline:1.1rem; white-space:nowrap;
}
@keyframes slide{ to{ transform:translateX(-50%); } }
@media (prefers-reduced-motion: reduce){ .marquee-track{ animation:none; } }

/* ---- Numbered service blocks -------------------------------------------- */
.svc-grid{ grid-template-columns:1fr; }
@media (min-width:860px){ .svc-grid{ grid-template-columns:1fr 1fr; column-gap:clamp(28px,4vw,72px); } }
.idx{ font-family:Anton,Impact,sans-serif; font-size:clamp(2.4rem,5vw,4.4rem); line-height:.8; opacity:.26; }
.tick{ display:flex; gap:.6rem; align-items:flex-start; font-size:.92rem; font-weight:500; }
.tick svg{ flex:none; margin-top:.28rem; }

/* ---- Links and buttons --------------------------------------------------- */
a{ color:inherit; }
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:.6rem;
  min-height:56px; padding:.7rem 1.6rem; font-weight:700; font-size:.92rem;
  text-transform:uppercase; letter-spacing:.1em; text-decoration:none;
  border:2px solid currentColor; max-width:100%; text-align:center;
  overflow-wrap:anywhere;
  transition:background-color .2s var(--ease), color .2s var(--ease);
}
/* A long address like blindmikephotos@gmail.com cannot fit one line on a small
   phone, so give it room to wrap rather than letting it push the layout. */
@media (max-width:430px){
  .btn{ padding:.7rem 1rem; letter-spacing:.04em; font-size:.8rem; }
}
.btn-solid{ background:var(--black); color:var(--blue); border-color:var(--black); }
.btn-solid:hover{ background:transparent; color:var(--black); }
.btn-ghost:hover{ background:var(--black); color:var(--blue); }
.btn-on-dark{ background:var(--blue-deep); color:var(--white); border-color:var(--blue-deep); }
.btn-on-dark:hover{ background:transparent; color:var(--blue); border-color:var(--blue); }
a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{
  outline:4px solid var(--blue-deep); outline-offset:3px;
}
.slab-black a:focus-visible,.slab-black button:focus-visible{ outline-color:var(--blue); }

/* ---- Nav ----------------------------------------------------------------- */
.topbar{
  position:sticky; top:0; z-index:60; background:var(--black); color:var(--white);
  display:flex; align-items:center; justify-content:space-between; gap:1rem;
  padding:.85rem var(--gut); border-bottom:2px solid var(--blue);
}
.topbar nav{ display:none; gap:1.6rem; }
@media (min-width:900px){ .topbar nav{ display:flex; } }
.topbar nav a{ font-size:.74rem; font-weight:700; text-transform:uppercase; letter-spacing:.16em; text-decoration:none; padding:.5rem 0; }
.topbar nav a:hover{ color:var(--blue); }

/* ---- Reveal -------------------------------------------------------------- */
.js .rev{ opacity:0; transform:translateY(22px); transition:opacity .7s var(--ease), transform .7s var(--ease); }
.js .rev.in{ opacity:1; transform:none; }
@media (prefers-reduced-motion: reduce){ .js .rev{ opacity:1; transform:none; } }

/* ---- Forms --------------------------------------------------------------- */
.field{
  width:100%; padding:.95rem 1rem; font:inherit; font-size:1rem;
  background:var(--white); color:var(--black); border:2px solid var(--black);
}
.slab-black .field{ background:var(--black); color:var(--white); border-color:var(--white); }
.field::placeholder{ opacity:.5; }
.lbl{ display:block; font-size:.7rem; font-weight:700; text-transform:uppercase; letter-spacing:.16em; margin-bottom:.5rem; }

/* ---- Small helpers ------------------------------------------------------- */
.grid{ display:grid; }
/* Same reason as .wrap above: a grid item defaults to min-width:auto, so its
   intrinsic content can inflate the track past the container and clip the right
   edge on a narrow phone. Nothing here needs that behaviour. */
.grid > *{ min-width:0; }
.lede{ font-size:clamp(1.02rem,1.5vw,1.26rem); line-height:1.58; font-weight:400; }
.body{ font-size:clamp(.95rem,1.1vw,1.05rem); line-height:1.72; }
.stat-n{ font-family:Anton,Impact,sans-serif; font-size:clamp(2.4rem,5.4vw,4.6rem); line-height:.82; }


/* ===== 2. CARRIED OVER FROM THE OLD BUILD ================================ */
.sr-only{ position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0; }
.skip-link{
  position:absolute; left:-9999px; top:0; z-index:200;
  background:var(--blue-deep); color:var(--white); padding:.9rem 1.3rem;
  font-weight:700; text-transform:uppercase; letter-spacing:.12em; font-size:.8rem; text-decoration:none;
}
.skip-link:focus{ left:0; }

.field-label{ display:block; font-size:.7rem; font-weight:700; text-transform:uppercase; letter-spacing:.16em; margin-bottom:.5rem; }
.field-help{ font-size:.78rem; margin:.5rem 0 0; opacity:.68; }
.field-error{ display:none; gap:.4rem; align-items:flex-start; font-size:.82rem; font-weight:600; margin:.5rem 0 0; color:#FF9A9A; }
.field-error.is-shown{ display:flex; }
.slab-blue .field-error{ color:#7A0C0C; }
.field[aria-invalid="true"]{ border-color:#FF6B6B; }
.slab-blue .field[aria-invalid="true"]{ border-color:#7A0C0C; }

.icon-btn{
  display:inline-grid; place-items:center; width:44px; height:44px;
  border:2px solid currentColor; background:transparent; color:inherit; cursor:pointer;
}
.icon-btn:hover{ background:currentColor; }
.icon-btn:hover svg{ color:var(--black); }

/* Social row */
.social{ display:flex; flex-wrap:wrap; gap:.5rem; list-style:none; margin:0; padding:0; }
.social a{ display:grid; place-items:center; width:44px; height:44px; border:2px solid currentColor; text-decoration:none; }
.social a:hover{ background:var(--black); color:var(--blue); }

/* Embrace tiles become buttons so the gallery is keyboard reachable */
#embraceGrid{ display:grid; grid-template-columns:repeat(3,1fr); gap:2px; list-style:none; margin:0; padding:0; }
.embrace-tile{
  display:block; width:100%; aspect-ratio:1; padding:0; border:0; background:var(--black);
  cursor:pointer; overflow:hidden;
}
.embrace-tile img{ width:100%; height:100%; object-fit:cover; filter:grayscale(1) contrast(1.06); transition:transform .4s var(--ease); }
.embrace-tile:hover img{ transform:scale(1.04); }
.embrace-tile:focus-visible{ outline:4px solid var(--blue); outline-offset:-4px; }

/* Lightbox */
.lightbox{
  position:fixed; inset:0; z-index:120; display:grid; place-items:center;
  background:rgba(0,0,0,.94); padding:clamp(16px,4vw,48px);
}
.lightbox[hidden]{ display:none; }
.lightbox img{ max-width:100%; max-height:76vh; object-fit:contain; }
.lightbox .icon-btn{ color:var(--white); position:absolute; }
.lb-close{ top:clamp(12px,2vw,26px); right:clamp(12px,2vw,26px); }
.lb-prev{ left:clamp(10px,2vw,26px); top:50%; transform:translateY(-50%); }
.lb-next{ right:clamp(10px,2vw,26px); top:50%; transform:translateY(-50%); }

/* Mobile nav */
#mobileNav{ background:var(--black); border-bottom:2px solid var(--blue); padding:.6rem var(--gut) 1.2rem; }
#mobileNav[hidden]{ display:none; }
#mobileNav a{
  display:block; padding:.85rem 0; font-size:.86rem; font-weight:700;
  text-transform:uppercase; letter-spacing:.14em; text-decoration:none; color:var(--white);
  border-bottom:1px solid rgba(255,255,255,.16);
}
#mobileNav a:hover{ color:var(--blue); }
@media (min-width:900px){ #navToggle{ display:none; } }


/* ===== 3. THE HERO, BOTH PAGES ===========================================
   The figure is a cut out, not a photo in a box, so the blue runs behind him
   with no rectangle edge. Produced by tools/cutout from the full resolution
   original; see the README. Driven by .hero so index.html and portfolio.html
   share one set of rules rather than drifting apart.
   ======================================================================== */
/* Fluid while the hero is stacked. Above 1040px it is pinned to a fixed size
   instead: the figure sits at a near constant distance from the left, so a
   viewport scaled headline made the overlap swing from none at 1100px to two
   whole letters at 1680px. Fixed here means the tuck is the same everywhere. */
.hero h1{ font-size:clamp(2.9rem,8.8vw,7.6rem); }
@media (min-width:1040px){ .hero h1{ font-size:7.4rem; } }


.hero{
  position:relative; overflow:hidden;
  padding-block:clamp(44px,6vw,86px); min-height:88vh;
  display:flex; flex-direction:column; justify-content:center;
}
/* The figure is a JPEG plus a separate greyscale mask, not one transparent
   PNG. A PNG has to store the photograph losslessly and came to 1.3 MB at this
   size; the pair is 249 KB at a higher resolution. Browsers without mask-image
   fall back to the JPEG, which is flattened onto the slab colour, so the worst
   case is the rectangle we had before rather than a broken image. */
.hero-cut{
  display:block; width:auto; height:auto; max-width:100%;
  margin:0;
  -webkit-mask-image:url(../img/mike-cut-mask.png);
          mask-image:url(../img/mike-cut-mask.png);
  -webkit-mask-size:100% 100%;  mask-size:100% 100%;
  -webkit-mask-repeat:no-repeat; mask-repeat:no-repeat;
}

/* ---- Phone and tablet: same frame as desktop, not a stack ----------------
   He bleeds off the right beside the headline and the copy begins below him,
   the way the reference crops its figure against an edge with the type running
   across it. Split into two ranges because the headline and the figure have to
   scale together: anchored one way across the whole range, the tuck swung from
   95px of a word eaten at 320px to no overlap at all on a tablet. */
@media (max-width:1039px){
  /* In the flow, immediately after the headline, pulled up over it by a
     negative margin. The copy follows him, so it cannot run underneath, and
     the overlap is measured from the headline's own end rather than a margin
     hand tuned to one page's line count. */
  .hero-cut{
    position:relative; display:block; width:auto; max-width:none;
    z-index:2; pointer-events:none;
  }
  /* The eyebrow runs full width and would slide under him, so cap it and let
     it wrap rather than be cut off mid name. */
  .hero > .wrap > .micro{ max-width:62%; }
}

/* Phones: both the headline and the figure scale with the viewport at matched
   rates, which keeps the tuck steady without pinning either one. */
@media (max-width:599px){
  .hero h1{ font-size:clamp(2.1rem,11.2vw,4.2rem); }
  .hero-cut{ height:78vw; margin:-46vw calc(-1 * var(--gut) - 2vw) 0 auto; }
}

/* Tablets: the same trick as desktop. Pin the headline and anchor him to the
   text column, so the tuck cannot drift as the window widens. */
@media (min-width:600px) and (max-width:1039px){
  .hero h1{ font-size:5.2rem; }
  /* Anchored from the left here, not right aligned: a tablet is wide enough
     that hugging the right edge leaves him nowhere near the headline. */
  .hero-cut{ height:clamp(340px,48vw,440px); margin:clamp(-300px,-30vw,-200px) auto 0 28.5rem; }
  /* 62% of a tablet is wide enough to reach him, so cap the eyebrow just
     short of his anchor instead. */
  .hero > .wrap > .micro{ max-width:27rem; }
}

@media (min-width:1040px){
  .hero{ flex-direction:row; align-items:center; }
  /* Overlapping the headline from the right, bleeding off the bottom edge. */
  /* Anchored to the right edge of the text column, not to the viewport. The
     body copy is a fixed 40rem, so a viewport based offset drifted across him
     as the window narrowed and buried the lede at 1100 and 1280. This keeps a
     half rem of air past the copy at every width; the headline lines are
     broken by hand so they do not reflow, and the long one runs on under him,
     which is where the overlap comes from. */
  .hero-cut{
    /* .wrap is capped at 1320px and centres itself, so past about 1480px its
       left edge is no longer the page gutter. max() tracks whichever it is. */
    position:absolute; left:calc(max(var(--gut), 50% - 660px) + 40.5rem);
    right:auto; bottom:0; margin:0;
    height:min(94%, 840px); width:auto; max-width:none;
    z-index:2; pointer-events:none;
  }
}

@media (min-width:1500px){
  .hero-cut{ height:min(96%, 920px); }
}

/* The portfolio headline's longest line, "and the results", runs about 9.6%
   wider than the home page's longest for the same type size, so it reaches the
   figure sooner and was losing a whole letter. Same tuck, smaller type. */
.hero-pf h1{ font-size:clamp(1.95rem,10.2vw,3.8rem); }
@media (min-width:600px) and (max-width:1039px){ .hero-pf h1{ font-size:4.75rem; } }
@media (min-width:1040px){ .hero-pf h1{ font-size:6.8rem; } }


/* Back to top. Flat and square like everything else, sat above the sticky top
   bar's z-index. 44px is the floor, not a preference: it is the site's touch
   target minimum, the same one the footer links were just held to. Going
   smaller would make this the one control on the site that breaks it.
   visibility, not just opacity, so it is not a focus trap while hidden. */
.to-top{
  position:fixed; z-index:70;
  right:clamp(14px,3vw,32px); bottom:clamp(14px,3vw,32px);
  width:44px; height:44px; display:grid; place-items:center;
  background:var(--blue-deep); color:var(--white);   /* 5.91:1 */
  border:0; cursor:pointer;
  opacity:0; visibility:hidden; transform:translateY(8px);
  transition:opacity .2s var(--ease), transform .2s var(--ease),
             visibility .2s var(--ease), background-color .2s var(--ease), color .2s var(--ease);
}
.to-top.is-in{ opacity:1; visibility:visible; transform:none; }
.to-top:hover{ background:var(--black); color:var(--blue); }
.to-top:focus-visible{ outline:4px solid var(--blue); outline-offset:3px; }
@media (prefers-reduced-motion: reduce){
  .to-top{ transition:none; }
}


/* Footer section links. The site holds a 44px minimum touch target
   everywhere else and these were 26px, which got worse once the list grew
   from six links to eight. The height comes from the links themselves so
   the column does not also gain eight gaps. */
.footer-nav a{
  display:flex; align-items:center; min-height:44px;
}


/* ===== 4. PORTFOLIO PAGE ONLY ============================================ */
/* Sticky jump bar */
.jumpbar{ position:sticky; top:62px; z-index:50; background:var(--black); border-bottom:2px solid var(--blue); }
.jumpbar ul{ display:flex; gap:0; list-style:none; margin:0; padding:0; overflow-x:auto; width:100%; }
.jump{
  display:inline-flex; align-items:center; white-space:nowrap; min-height:46px;
  padding:0 1rem; font-size:.7rem; font-weight:700; text-transform:uppercase;
  letter-spacing:.14em; color:var(--white); text-decoration:none;
  border-right:1px solid rgba(255,255,255,.14);
}
.jump:hover{ background:var(--blue); color:var(--black); }
main section[id]{ scroll-margin-top:124px; }

/* Slots still waiting on real content, deliberately obvious */
.slot{
  display:grid; place-items:center; text-align:center; gap:.5rem; padding:1.6rem;
  border:2px dashed currentColor; min-height:220px;
  font-size:.7rem; font-weight:700; text-transform:uppercase; letter-spacing:.16em;
  opacity:.5;
}
.needs-input{
  display:block; border:2px dashed currentColor; padding:.7rem .9rem;
  font-size:.72rem; font-weight:700; text-transform:uppercase; letter-spacing:.1em;
  line-height:1.6; opacity:.62;
}

/* Before / after colour grade comparison */
.ba{
  position:relative; margin:0; overflow:hidden; background:var(--black);
  isolation:isolate; --pos:50%;
}
.ba img{ display:block; width:100%; height:100%; object-fit:cover; aspect-ratio:3/2; }
.ba-before{ position:absolute; inset:0; clip-path:inset(0 calc(100% - var(--pos)) 0 0); will-change:clip-path; }
.ba-divider{
  position:absolute; top:0; bottom:0; left:var(--pos); width:3px;
  background:var(--blue); transform:translateX(-1.5px); pointer-events:none; z-index:3;
}
.ba-handle{
  position:absolute; top:50%; left:50%; transform:translate(-50%,-50%);
  width:44px; height:44px; display:grid; place-items:center;
  background:var(--blue); color:var(--black);
}
.ba-range{
  position:absolute; inset:0; width:100%; height:100%; margin:0; opacity:0;
  cursor:ew-resize; z-index:4; -webkit-appearance:none; appearance:none; background:transparent;
}
.ba-range:focus-visible{ outline:4px solid var(--blue); outline-offset:-4px; opacity:1; }
.ba-tag{
  position:absolute; bottom:0; z-index:3; background:var(--black); color:var(--blue);
  padding:.45rem .7rem; font-size:.6rem; font-weight:700;
  text-transform:uppercase; letter-spacing:.14em;
}
.ba-tag-l{ left:0; }
.ba-tag-r{ right:0; background:var(--blue); color:var(--black); }

/* Case study dialog */
.case-open{ all:unset; cursor:pointer; color:inherit; display:inline; }
.case-open::after{ content:''; position:absolute; inset:0; }
.case-open:focus-visible{ outline:4px solid var(--blue); outline-offset:3px; }
.case-dialog{
  width:min(62rem, calc(100vw - 2rem)); max-height:min(86vh, 56rem);
  padding:0; border:2px solid var(--black); overflow:auto;
  background:var(--white); color:var(--black);
}
.case-dialog::backdrop{ background:rgba(0,0,0,.86); }
.case-dialog-inner{ position:relative; padding:clamp(22px,4vw,46px); }
.case-close{
  position:absolute; top:clamp(12px,1.6vw,18px); right:clamp(12px,1.6vw,18px);
  width:44px; height:44px; display:grid; place-items:center;
  border:2px solid var(--black); background:var(--white); color:var(--black); cursor:pointer;
}
.case-close:hover{ background:var(--black); color:var(--blue); }
.case-close:focus-visible{ outline:4px solid var(--blue-deep); outline-offset:3px; }

/* A metric block */
.metric-n{ font-family:Anton,Impact,sans-serif; font-size:clamp(1.9rem,4vw,3.2rem); line-height:.86; font-variant-numeric:tabular-nums; }
