/* Web version of the portfolio: reflows the A4 pages for any screen width.
   build_site.py loads this into site/index.html only. Printing the site still gives the A4 pages.
   Sizes inside .page are multiplied by --z (zoom), because the A4 sizes are too small to read on a screen. */
.site{display:none}
@media screen{
html{background:#fff;-webkit-text-size-adjust:100%;scroll-behavior:smooth}
body{--z:1.2;font-family:"Avenir Next","Segoe UI Variable Text","Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif}
.rs{font-family:-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif}
a:focus-visible{outline:2px solid #7FA2FF;outline-offset:2px;border-radius:2px}

/* site nav: a bar on top, a rail on the left on wide screens */
.site{display:grid;grid-template-columns:auto 1fr auto;align-items:baseline;column-gap:12px;position:sticky;top:0;z-index:10;background:var(--ink);color:#fff;padding:12px 16px 0}
.site .who{font-weight:600;font-size:17px}
.site .role{font-size:13px;color:#AAB4C8;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.site .pdf{font-size:13px;font-weight:600;border:1px solid #4A5B85;border-radius:5px;padding:6px 11px;white-space:nowrap}
.site .pdf:hover{border-color:#7FA2FF}
.site ol{grid-column:1/-1;display:flex;list-style:none;overflow-x:auto;position:relative;margin:6px -8px 0;scrollbar-width:none}
.site ol::-webkit-scrollbar{display:none}
.site li a{display:block;padding:10px 9px 9px;font-size:14px;color:#AAB4C8;white-space:nowrap;border-bottom:3px solid transparent}
.site li a:hover{color:#fff}
.site li a[aria-current]{color:#fff;font-weight:600;border-bottom-color:#7FA2FF}

/* pages become sections of one scrolling page */
.page{width:auto;height:auto;overflow:visible;margin:0;zoom:var(--z);scroll-margin-top:80px}
.page:not(.cover){display:block}
.page>.rail{display:none}
.page+.page{border-top:1px solid var(--rule)}
main{max-width:1000px;margin:0 auto;padding:52px 40px 56px}
svg{max-width:100%;height:auto}
.lead{margin-top:20px}
.lead .r{gap:16px}
.also{margin-top:14px}
.defs{margin-top:28px}
.close{margin-top:20px}
.threads{margin-top:20px}
q{margin-top:18px}
.contact a,.panel a{text-decoration:underline;text-underline-offset:3px}
.flow{grid-template-columns:minmax(0,104fr) 14px minmax(0,116fr) 14px minmax(0,104fr) 14px minmax(0,100fr)}
.hbar i{min-width:3px;flex:none}
.since{position:static;grid-column:1/-1;width:auto;max-width:560px;margin-bottom:4px}
.ladder{margin-top:20px}
.worked,.worked .row{flex-wrap:wrap}
.cover{padding:72px max(40px,calc(50% - 500px)) 44px}
.cover .stairs{right:max(40px,calc(50% - 500px));top:72px}
.cover .at{margin-top:64px}

/* below this width the lead case is one column and the scoreboard rows are blocks */
@media (max-width:1151px){
 .lead{grid-template-columns:1fr}
 .lead .l{border-right:0;border-bottom:1px solid var(--rule);border-radius:8px 8px 0 0;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.15fr);column-gap:28px;align-content:start}
 .lead .l>*{grid-column:1}
 .lead .l>.bottom{grid-column:2;grid-row:1/span 4;margin-top:0;align-self:center}
 .close{grid-template-columns:1fr}
 .panel{columns:3 190px;column-gap:28px}
 .panel h2{break-after:avoid}
 .panel p{break-inside:avoid}
 table,tbody,td{display:block}
 tr{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px 22px;padding:22px 0;border-bottom:1px solid var(--rule)}
 tr:first-child{display:none}
 td{padding:0;border:0}
 td.who{grid-column:1/-1}
 td[colspan]{grid-column:span 2}
 td[data-h]::before{content:attr(data-h);display:block;font-size:11px;color:var(--slate);margin-bottom:4px}
 td>b{white-space:normal}
 .cover h1{font-size:76px}
 .cover .stairs{width:230px;height:230px}
}

@media (max-width:899px){
 main{padding:44px 32px 48px}
 .also,.cover .also,.tiles.four,tr{grid-template-columns:1fr 1fr}
 .also .card:last-child:nth-child(odd),.card.span2,.card.span2+.card{grid-column:1/-1}
 td[colspan]{grid-column:auto}
 .panel{columns:2 200px}
 /* the ladder becomes a list, earliest job first, with each step wider than the last */
 .ladder{display:block}
 .rung{margin-top:22px}
 .rung .txt{padding:0 0 10px}
 .step{height:auto!important;border-radius:4px}
 .rung:nth-child(2) .step{width:52%}
 .rung:nth-child(3) .step{width:64%}
 .rung:nth-child(4) .step{width:76%}
 .rung:nth-child(5) .step{width:88%}
 .cover{padding:56px 32px 40px}
 .cover h1{font-size:64px}
 .cover .stairs{right:32px;top:56px;width:170px;height:170px}
}

@media (max-width:699px){
 main{padding:36px 15px 40px}
 h1{font-size:26px}
 .sub{font-size:13px}
 .site .role{display:none}
 .site{grid-template-columns:1fr auto}
 .lead .l{display:flex}
 .lead .l>.bottom{margin-top:16px;align-self:auto}
 .lead .l,.lead .r{padding:16px 14px}
 .moves{grid-template-columns:1fr;gap:10px}
 .moves div{display:grid;grid-template-columns:20px 1fr;column-gap:10px}
 .moves i{margin:0}
 .tiles{grid-template-columns:1fr 1fr}
 .tile b{font-size:19px}
 .tiles:not(.four) .tile:last-child:nth-child(odd){grid-column:1/-1}
 .tiles.four .tile b{white-space:normal}
 .also,.stats,.pillars,.threads,.defs,tr{grid-template-columns:1fr}
 .stats,.threads,.defs{gap:12px}
 .panel{columns:auto}
 .worked{flex-direction:column;align-items:flex-start;gap:10px}
 .worked .row{flex-wrap:wrap}
 /* the AI diagram runs top to bottom, each caption above its block */
 .flow{grid-template-columns:1fr;row-gap:6px}
 .flow>svg{transform:rotate(90deg)}
 .flow>div:empty{display:none}
 .flow>:nth-child(8){order:1}.flow>:nth-child(1){order:2}.flow>:nth-child(2){order:3}
 .flow>:nth-child(10){order:4}.flow>:nth-child(3){order:5}.flow>:nth-child(4){order:6}
 .flow>:nth-child(12){order:7}.flow>:nth-child(5){order:8}.flow>:nth-child(6){order:9}
 .flow>:nth-child(14){order:10}.flow>:nth-child(7){order:11}
 .cover{padding:40px 18px 32px}
 .cover h1{font-size:54px;letter-spacing:-1.6px}
 .cover .stairs{right:18px;top:40px;width:96px;height:96px}
 .cover .line{font-size:20px;margin-top:22px}
 .cover .at{flex-wrap:wrap;margin-top:36px}
 .cover .prev{margin-left:0;width:100%;flex-wrap:wrap}
 .cover .card .n{font-size:21px}
 .cover .contact{flex-direction:column;gap:6px}
 .cover .foot{margin-top:22px}
}

/* the renewal chart's labels are too small to read on a phone; the list beside it gives the same numbers */
@media (max-width:479px){.lead .r>svg{display:none}}

/* wide screens: the nav is the navy rail on the left, as in the PDF */
@media (min-width:1272px){
 body{padding-left:216px}
 .page{scroll-margin-top:0}
 .site{position:fixed;inset:0 auto 0 0;width:216px;display:flex;flex-direction:column;align-items:stretch;padding:36px 18px 28px 20px}
 .site .role{white-space:normal;margin-top:6px;line-height:1.4}
 .site ol{display:block;margin:44px 0 0;overflow:visible}
 .site li a{padding:10px 0 10px 12px;white-space:normal;border-bottom:0;border-left:2px solid #2B3A5E}
 .site li a[aria-current]{border-left-color:#7FA2FF}
 .site .pdf{order:1;margin-top:auto;align-self:flex-start}
 .cover{border-left:1px solid #2B3A5E}
}
@media (min-width:1272px) and (max-width:1367px){body{--z:1.1}}
@media (prefers-reduced-motion:reduce){html{scroll-behavior:auto}}
}
