/* Round 17: three remaining visual corrections, layered over Round 16. */

@media (min-width:761px){
  /* Every onward control now resolves against the hero itself. Earlier pages
     used different positioned grid wrappers, which made identical bottom
     values appear at different heights. */
  body:not(.home-page) .subhero,
  body.portfolio-page .portfolio-hero-refresh{
    position:relative!important;
  }
  body:not(.home-page) .subhero .subhero-grid,
  body.portfolio-page .portfolio-hero-refresh .portfolio-hero-refresh-inner{
    position:static!important;
  }
  body:not(.home-page) .subhero .hero-corner-links,
  body.experience-page .subhero .portfolio-subhero-actions,
  body.portfolio-page .portfolio-hero-refresh .portfolio-hero-actions{
    position:absolute!important;
    top:auto!important;
    right:clamp(58px,4.5vw,92px)!important;
    bottom:clamp(76px,9vh,90px)!important;
    transform:none!important;
  }
  body:not(.home-page) .subhero .hero-corner-links .hero-crosslink,
  body.experience-page .subhero .portfolio-subhero-actions .hero-crosslink,
  body.portfolio-page .portfolio-hero-refresh .portfolio-hero-actions .hero-crosslink{
    height:35px!important;
    min-height:35px!important;
    padding:0 17px!important;
    font-size:.72rem!important;
    letter-spacing:.012em!important;
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,.34),
      inset 0 -1px 0 rgba(0,0,0,.26),
      0 2px 0 rgba(111,70,7,.30),
      0 6px 13px rgba(0,0,0,.18)!important;
  }
}

/* NEXT HOTFIX — PHONE SUDOKU USES THE AVAILABLE SCREEN WIDTH
   The outer 12px gutters protect the board from the screen edge; everything
   between them becomes playable grid instead of decorative whitespace. */
@media (max-width:760px){
  .sudoku-app:not(.is-simulated-fullscreen),
  .sudoku-app.is-simulated-fullscreen,
  .sudoku-app:fullscreen,
  .sudoku-app:-webkit-full-screen{
    --sudoku-phone-board:min(calc(100vw - 24px),390px)!important;
  }
  .sudoku-app:not(.is-simulated-fullscreen){
    box-sizing:border-box!important;
    width:100vw!important;
    max-width:100vw!important;
    margin-left:calc(50% - 50vw)!important;
    margin-right:calc(50% - 50vw)!important;
    padding-inline:8px!important;
    border-left:0!important;
    border-right:0!important;
    border-radius:0!important;
    --sudoku-phone-board:min(calc(100vw - 16px),400px)!important;
  }
  .sudoku-app:not(.is-simulated-fullscreen) .sudoku-board-pane,
  .sudoku-app.is-simulated-fullscreen .sudoku-board-pane,
  .sudoku-app:fullscreen .sudoku-board-pane,
  .sudoku-app:-webkit-full-screen .sudoku-board-pane{
    width:var(--sudoku-phone-board)!important;
    max-width:100%!important;
    margin-inline:auto!important;
  }
  .sudoku-app:not(.is-simulated-fullscreen) .sudoku-board-frame,
  .sudoku-app.is-simulated-fullscreen .sudoku-board-frame,
  .sudoku-app:fullscreen .sudoku-board-frame,
  .sudoku-app:-webkit-full-screen .sudoku-board-frame{
    box-sizing:border-box!important;
    width:100%!important;
    max-width:none!important;
    padding:4px!important;
  }
  .sudoku-app:not(.is-simulated-fullscreen) #sudoku-grid,
  .sudoku-app.is-simulated-fullscreen #sudoku-grid,
  .sudoku-app:fullscreen #sudoku-grid,
  .sudoku-app:-webkit-full-screen #sudoku-grid{
    width:100%!important;
    max-width:none!important;
  }
  .sudoku-app:not(.is-simulated-fullscreen) #sudoku-grid td,
  .sudoku-app.is-simulated-fullscreen #sudoku-grid td,
  .sudoku-app:fullscreen #sudoku-grid td,
  .sudoku-app:-webkit-full-screen #sudoku-grid td{
    height:calc((var(--sudoku-phone-board) - 8px) / 9)!important;
  }
}

/* NEXT HOTFIX — HOMEPAGE LOWER-PROOF SPACING
   Preserve the upper composition; open the two seams that were reading as a
   single block and let the final CTA pair settle lower in the viewport. */
@media (max-width:760px){
  .home-page .hero-executive-credentials .executive-credentials-row{
    margin-bottom:20px!important;
  }
  .home-page .compact-metrics-four{
    margin-bottom:17px!important;
  }
  .home-page .compact-metrics-four::before{
    opacity:.55!important;
  }

  /* Remove the legacy 8px first-metric gap and use the shared card rhythm. */
  .home-page .compact-metrics-four .profile-years-metric .metric-copy{
    gap:2px!important;
  }
  .home-page .compact-metrics-four .profile-years-metric .metric-headline,
  .home-page .compact-metrics-four .profile-years-metric .metric-descriptor{
    margin:0!important;
  }
}

@media (max-width:760px){
  /* Keep Let's Connect attached to the paragraph while giving the credential
     marks their own clearly separated line. */
  .home-page .home-credential-connect{
    margin:-2px 0 20px!important;
  }
  .home-page .hero-executive-credentials .executive-credentials-row{
    margin:0 0 10px!important;
  }
  .home-page .compact-metrics-four{
    grid-auto-rows:minmax(50px,auto)!important;
    margin:0 0 11px!important;
  }
  .home-page .compact-metrics-four > .compact-metric{
    min-height:50px!important;
    padding:5px 9px!important;
  }

  /* The input and candidate layers—not the td—were enforcing a 44px row.
     Remove that floor so each row can honor the calculated square geometry. */
  #sudoku-grid td input,
  #sudoku-grid td .mini{
    min-height:0!important;
    height:100%!important;
  }

  /* Restore a playable square board. Vertical room comes from the utility and
     instruction redesign, not from shrinking the grid against viewport height. */
  .sudoku-app:not(.is-simulated-fullscreen){
    --sudoku-phone-board:min(80vw,312px);
  }
  .sudoku-app:not(.is-simulated-fullscreen) .sudoku-board-pane{
    width:var(--sudoku-phone-board)!important;
  }
  .sudoku-app:not(.is-simulated-fullscreen) #sudoku-grid td{
    height:calc((var(--sudoku-phone-board) - 16px) / 9)!important;
  }

  /* Full screen gets a little more board presence while retaining the same
     compact controls and a complete initial-viewport control set. */
  .sudoku-app.is-simulated-fullscreen,
  .sudoku-app:fullscreen,
  .sudoku-app:-webkit-full-screen{
    --sudoku-phone-board:min(86vw,340px);
  }
  .sudoku-app.is-simulated-fullscreen .sudoku-board-pane,
  .sudoku-app:fullscreen .sudoku-board-pane,
  .sudoku-app:-webkit-full-screen .sudoku-board-pane{
    width:var(--sudoku-phone-board)!important;
  }
  .sudoku-app.is-simulated-fullscreen #sudoku-grid td,
  .sudoku-app:fullscreen #sudoku-grid td,
  .sudoku-app:-webkit-full-screen #sudoku-grid td{
    height:calc((var(--sudoku-phone-board) - 16px) / 9)!important;
  }

  .sudoku-control-pane{
    gap:5px!important;
  }
  .sudoku-control-group{
    margin-bottom:5px!important;
    padding-bottom:5px!important;
  }
  .sudoku-control-label{
    margin-bottom:4px!important;
  }
  .sudoku-button-grid{
    gap:4px!important;
  }
  .sudoku-btn{
    min-height:30px!important;
    padding:4px 6px!important;
  }
  .sudoku-app,
  .sudoku-app:not(.is-simulated-fullscreen),
  .sudoku-app.is-simulated-fullscreen,
  .sudoku-app:fullscreen,
  .sudoku-app:-webkit-full-screen{
    gap:6px!important;
  }
  .sudoku-status{
    margin-top:6px!important;
    min-height:24px!important;
    padding:0!important;
    line-height:24px!important;
  }
}

/* Board utilities occupy a shallow, non-playable row above the grid. */
.sudoku-board-utilities{
  position:relative;
  z-index:6;
  display:flex;
  justify-content:flex-end;
  align-items:center;
  gap:6px;
  width:min(100%,524px);
  min-height:30px;
  margin:0 auto 5px;
}
.sudoku-help-control{position:relative}
.sudoku-utility-btn,
.sudoku-fullscreen-quick.sudoku-utility-btn{
  position:static!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  width:28px!important;
  height:28px!important;
  min-width:28px!important;
  min-height:28px!important;
  padding:0!important;
  border:1px solid rgba(223,168,47,.92)!important;
  border-radius:7px!important;
  background:#082844!important;
  color:#efb334!important;
  font:800 .78rem/1 "Manrope",sans-serif!important;
  transform:none!important;
  box-shadow:0 3px 8px rgba(0,0,0,.16)!important;
}
.sudoku-help-popover{
  position:absolute;
  top:34px;
  right:0;
  z-index:12;
  display:flex;
  flex-direction:column;
  gap:4px;
  width:min(240px,76vw);
  padding:10px 12px;
  border:1px solid rgba(223,168,47,.68);
  border-radius:8px;
  background:#fff;
  color:#5f6b78;
  font-size:.68rem;
  line-height:1.4;
  text-align:left;
  opacity:0;
  visibility:hidden;
  transform:translateY(-3px);
  pointer-events:none;
  box-shadow:0 9px 24px rgba(7,25,43,.18);
  transition:opacity .15s ease,transform .15s ease,visibility .15s ease;
}
.sudoku-help-popover strong{color:#07192b;text-transform:uppercase;letter-spacing:.06em}
.sudoku-help-control:hover .sudoku-help-popover,
.sudoku-help-control:focus-within .sudoku-help-popover,
.sudoku-help-popover.is-open{
  opacity:1;
  visibility:visible;
  transform:none;
  pointer-events:auto;
}

/* The directory reads as a compact navigation list instead of centered copy. */
#portfolio-case-directory{scroll-margin-top:88px}
.portfolio-case-directory{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  align-items:start!important;
  justify-content:stretch!important;
  gap:5px 24px!important;
  width:min(calc(100% - 48px),620px)!important;
  margin:10px auto 0!important;
  padding:2px 0 2px 16px!important;
  border-left:2px solid rgba(214,168,79,.72)!important;
  text-align:left!important;
}
.portfolio-case-directory a{
  display:block!important;
  position:relative;
  padding-left:12px;
  color:#5f7182!important;
  font-size:.68rem!important;
  line-height:1.45!important;
  white-space:normal!important;
}
.portfolio-case-directory a::before{
  content:"›";
  position:absolute;
  left:0;
  color:#c28d27;
  font-weight:800;
}
.portfolio-case-directory a::after{display:none!important}

@media (max-width:760px){
  .sudoku-board-utilities{width:100%;min-height:28px;margin-bottom:4px}
  .portfolio-case-directory{
    grid-template-columns:1fr!important;
    gap:4px!important;
    width:min(calc(100% - 54px),310px)!important;
    padding-left:13px!important;
  }
  .portfolio-case-directory a{font-size:.65rem!important;line-height:1.42!important}
}

/* ROUND 19 — HOMEPAGE PHONE RHYTHM AND METRIC READING ORDER
   Reallocate existing vertical space; do not increase the landing hero. */
@media (max-width:760px){
  .home-page .compact-hero-name{
    transform:translateY(-2px)!important;
  }
  .home-page .compact-hero h1{
    margin-bottom:12px!important;
  }

  /* Keep the invitation attached to the paragraph, then give the proof rows
     distinct separation without adding net height to the hero. */
  .home-page .home-credential-connect{
    margin:-2px 0 22px!important;
  }
  .home-page .hero-executive-credentials .executive-credentials-row{
    margin:0 0 14px!important;
  }

  /* Visual order: leadership + cross-industry proof, then the two degrees. */
  .home-page .compact-metrics-four > .compact-metric:nth-child(1){order:1!important}
  .home-page .compact-metrics-four > .compact-metric:nth-child(4){order:2!important}
  .home-page .compact-metrics-four > .compact-metric:nth-child(2){order:3!important}
  .home-page .compact-metrics-four > .compact-metric:nth-child(3){order:4!important}

  /* Borders follow the visual positions above rather than DOM odd/even order. */
  .home-page .compact-metrics-four > .compact-metric{
    border:0!important;
  }
  .home-page .compact-metrics-four > .compact-metric:nth-child(1),
  .home-page .compact-metrics-four > .compact-metric:nth-child(2){
    border-right:1px solid rgba(255,255,255,.18)!important;
  }
  .home-page .compact-metrics-four > .compact-metric:nth-child(1),
  .home-page .compact-metrics-four > .compact-metric:nth-child(4){
    border-bottom:1px solid rgba(255,255,255,.18)!important;
  }

  /* Cross-industry supporting text now shares the common descriptor scale. */
  .home-page .compact-metrics-four > .compact-metric:nth-child(4) .metric-descriptor{
    font-size:.59rem!important;
    font-weight:600!important;
    line-height:1.16!important;
  }
}

/* ROUND 19 — EMBEDDED SUDOKU PHONE BOARD
   Use the available width reclaimed by the compact utilities. Full-screen
   geometry remains unchanged. */
@media (max-width:760px){
  .sudoku-app:not(.is-simulated-fullscreen){
    --sudoku-phone-board:min(92vw,340px)!important;
  }
  .sudoku-app:not(.is-simulated-fullscreen) .sudoku-board-pane{
    width:var(--sudoku-phone-board)!important;
    max-width:100%!important;
  }
  .sudoku-app:not(.is-simulated-fullscreen) .sudoku-board-frame,
  .sudoku-app:not(.is-simulated-fullscreen) #sudoku-grid{
    width:100%!important;
    max-width:none!important;
  }
  .sudoku-app:not(.is-simulated-fullscreen) #sudoku-grid td{
    height:calc((var(--sudoku-phone-board) - 20px) / 9)!important;
  }
}

/* ROUND 19 — ONE DESKTOP HERO ANCHOR
   All onward buttons share the same inset from the hero's lower-right edge. */
@media (min-width:761px){
  body:not(.home-page) .subhero .hero-corner-links,
  body.experience-page .subhero .portfolio-subhero-actions,
  body.portfolio-page .portfolio-hero-refresh .portfolio-hero-actions{
    position:absolute!important;
    inset:auto clamp(58px,4.5vw,92px) 105px auto!important;
    margin:0!important;
    transform:none!important;
  }
}

/* ROUND 20 — FINAL CASCADE
   Keep the reviewed fixes last so earlier Round 19 safeguards cannot restore
   the superseded dimensions or spacing. */
@media (max-width:760px){
  .sudoku-app:not(.is-simulated-fullscreen),
  .sudoku-app.is-simulated-fullscreen,
  .sudoku-app:fullscreen,
  .sudoku-app:-webkit-full-screen{
    --sudoku-phone-board:min(calc(100vw - 24px),390px)!important;
  }
  .sudoku-app:not(.is-simulated-fullscreen){
    box-sizing:border-box!important;
    width:100vw!important;
    max-width:100vw!important;
    margin-left:calc(50% - 50vw)!important;
    margin-right:calc(50% - 50vw)!important;
    padding-inline:8px!important;
    border-left:0!important;
    border-right:0!important;
    border-radius:0!important;
    --sudoku-phone-board:min(calc(100vw - 16px),400px)!important;
  }
  .sudoku-app:not(.is-simulated-fullscreen) .sudoku-board-pane,
  .sudoku-app.is-simulated-fullscreen .sudoku-board-pane,
  .sudoku-app:fullscreen .sudoku-board-pane,
  .sudoku-app:-webkit-full-screen .sudoku-board-pane{
    width:var(--sudoku-phone-board)!important;
    max-width:100%!important;
    margin-inline:auto!important;
  }
  .sudoku-app:not(.is-simulated-fullscreen) .sudoku-board-frame,
  .sudoku-app.is-simulated-fullscreen .sudoku-board-frame,
  .sudoku-app:fullscreen .sudoku-board-frame,
  .sudoku-app:-webkit-full-screen .sudoku-board-frame{
    box-sizing:border-box!important;
    width:100%!important;
    max-width:none!important;
    padding:4px!important;
  }
  .sudoku-app:not(.is-simulated-fullscreen) #sudoku-grid,
  .sudoku-app.is-simulated-fullscreen #sudoku-grid,
  .sudoku-app:fullscreen #sudoku-grid,
  .sudoku-app:-webkit-full-screen #sudoku-grid{
    width:100%!important;
    max-width:none!important;
  }
  .sudoku-app:not(.is-simulated-fullscreen) #sudoku-grid td,
  .sudoku-app.is-simulated-fullscreen #sudoku-grid td,
  .sudoku-app:fullscreen #sudoku-grid td,
  .sudoku-app:-webkit-full-screen #sudoku-grid td{
    height:calc((var(--sudoku-phone-board) - 8px) / 9)!important;
  }

  .home-page .hero-executive-credentials .executive-credentials-row{
    margin-bottom:20px!important;
  }
  .home-page .compact-metrics-four{
    margin-bottom:17px!important;
  }
  .home-page .compact-metrics-four::before{
    opacity:.55!important;
  }
  .home-page .compact-metrics-four .profile-years-metric .metric-copy{
    gap:2px!important;
  }
  .home-page .compact-metrics-four .profile-years-metric .metric-headline,
  .home-page .compact-metrics-four .profile-years-metric .metric-descriptor{
    margin:0!important;
  }
}

@media (min-width:761px){
  body:not(.home-page) .subhero .hero-corner-links,
  body.experience-page .subhero .portfolio-subhero-actions,
  body.portfolio-page .portfolio-hero-refresh .portfolio-hero-actions{
    position:absolute!important;
    inset:clamp(165px,18vh,185px) clamp(58px,4.5vw,92px) auto auto!important;
    margin:0!important;
    transform:none!important;
  }
}

/* NEXT HOTFIX — DESKTOP HERO DIRECTIONAL BUTTONS SHARE ONE TOP ANCHOR
   Hero heights vary by page, so a common bottom inset could not produce a
   consistent visual line. Preserve the approved right edge and button style. */
@media (min-width:761px){
  body:not(.home-page) .subhero .hero-corner-links,
  body.experience-page .subhero .portfolio-subhero-actions,
  body.portfolio-page .portfolio-hero-refresh .portfolio-hero-actions{
    position:absolute!important;
    inset:clamp(165px,18vh,185px) clamp(58px,4.5vw,92px) auto auto!important;
    margin:0!important;
    transform:none!important;
  }
}
