/* Screens. Author: Michigan AI Dev Team. Date: 2026-11-24. Type sizes live in tokens.css; this file is layout, plus the home hero's own fluid sizes (section 1).
   The header plus the whole hero are the first screen on every device. Viewport height (svh) sets room and artwork here, never a font size,
   so browser zoom always enlarges the words; when they no longer fit, the hero simply grows and the page scrolls. */
:root{--lk-h:clamp(56px,56px + (100vw - 900px) * 0.07,64px);--hdr-pad:clamp(0.5rem,0.5rem + (100vw - 900px) * 0.07,1rem);--header-h:calc(var(--lk-h) * 1.394 + 2 * var(--hdr-pad));--hero-h:calc(100vh - var(--header-h));
  --content-max:clamp(76rem,31.2rem + 44vw,120rem)} /* 1216 px up to 1600 wide, 1344 at 1920, about 1650 at 2560, about 2110 at 3840 */
@supports(height:1svh){:root{--hero-h:calc(100svh - var(--header-h))}}
#brand{--lockup-h:var(--lk-h)}
.site-header{padding-block:var(--hdr-pad)}
.lead{font-size:var(--step-lead)}
.home-hero .hero{box-sizing:border-box;min-height:var(--hero-h)}

/* 1. Home hero, 600 px and wider: one arrangement at every size. The logo on the left, the headline on its right, then the paragraph,
   the buttons and the note under both. Nothing switches from one layout to another: every size follows the window, so dragging the
   window changes the hero little by little.
   --hu is the text unit for the paragraph, buttons and note: 1rem in a short or narrow window, rising to 2rem in a tall window
   900 to 945 px wide, then easing back so that from 1024 px wide the hero has its desktop sizes (1rem) at any height.
   The logo and headline share the height that is left over, so the first screen holds everything whenever it can; when it cannot,
   the hero grows and the page scrolls. That height (--hpair) is worked out from the window alone: --hrl and --hrn are how many lines
   the paragraph and the note need (their length over their width, plus a line to spare), --hbtn is one row of buttons or two.
   Nothing in it depends on where a line happens to break, so the logo and headline never jump when the paragraph rewraps. The headline is as large as fits beside the logo
   in five, four, three or two lines, and wraps by itself as the room changes. A phone in "Desktop site" mode keeps section 2. */
@media(min-width:600px){@media not all and (min-width:900px) and (max-width:1100px) and (max-aspect-ratio:3/5) and (pointer:coarse){
  :root{--hu:clamp(1rem,min(1rem + (100vw - 600px) * 0.05334,var(--hero-h) * 0.0228,1.32rem + max(0px,var(--hero-h) - var(--hcw) * 0.62) * 0.0125,2rem - max(0px,100vw - 945px) * 0.2026),2rem);
    --hcw:min(100vw - 2 * var(--gutter),var(--content-max));--hpad:clamp(1.25rem,var(--hero-h) * 0.065,4.5rem);
    --hrl:6;--hrn:3; /* a safe guess where tan() and atan2() are missing; the real counts follow below */
    --hbtn:clamp(var(--hu) * 3.5,var(--hu) * 7.75 - (var(--hcw) - var(--hu) * 39.5) * 0.25,var(--hu) * 7.75); /* two rows, easing down to one slowly after the buttons go side by side, so the logo never spurts */
    --hopen:max(0px,var(--hcw) - var(--hu) * 44.5); /* above 0 a little after the buttons go side by side */
    --hg4:max(100vw - 251px - var(--hero-h) * 0.47 - max(0px,var(--hero-h) - 1215px) * 30,var(--hcw) - 107.2rem);--hg4p:max(0px,var(--hg4)); /* above 0 from the width where four lines first beat five; it only ever rises with the width */
    --hbelow:calc(var(--hu) * 1.75 * var(--hrl) + var(--hu) * 1.6 * var(--hrn) + var(--hbtn) + var(--hu) * 4);
    --hpair:max(9rem,min(var(--hero-h) - 2 * var(--hpad) - var(--hbelow),46rem,var(--hcw) * 0.557,16.5rem + (100vw - 600px) * 1.25))}
  @supports(width:calc(1px * tan(atan2(1px,1px)))){:root{--hrl:calc(tan(atan2(var(--hu) * 125.75,min(var(--hcw),var(--hu) * 50))) * 1.06 + 0.95);--hrn:calc(tan(atan2(var(--hu) * 59.4,var(--hcw))) * 1.06 + 0.95)}}
  .hero-band{overflow:clip}
  .hero-band::before{display:none}
  .home-hero .hero{display:flex;flex-direction:column;justify-content:flex-start;align-items:stretch;gap:0;
    padding-block:max(var(--hpad),(var(--hero-h) - var(--hpair) - var(--hbelow)) / 2) var(--hpad)} /* centred by the same sums, so the logo's place never depends on a line break either */
  .home-hero .hero-pair{flex:none;block-size:var(--hpair);display:flex;align-items:center;container-type:size}
  .home-hero .hero-plate,.home-hero h1{--L:min(100cqh,100cqw * 0.557);--R:calc(100cqw - var(--L) * 0.873)} /* the logo's height, and the width left for the headline */
  .home-hero .hero-plate{flex:none;display:block;align-self:center;inline-size:calc(var(--L) * 0.783);block-size:var(--L);margin:0;padding:0}
  .home-hero .hero-plate .hero-lockup{inline-size:100%;block-size:100%;max-inline-size:none}
  /* the faint blueprint grid around the logo only, sized with it */
  .home-hero .hero-plate::before{content:"";position:absolute;z-index:-1;inset:calc(var(--L) * -0.25) calc(var(--L) * -0.36);pointer-events:none;
    background-image:linear-gradient(var(--color-sketch-on-navy) 1px,transparent 1px),linear-gradient(90deg,var(--color-sketch-on-navy) 1px,transparent 1px);background-size:var(--grid-cell) var(--grid-cell);background-position:center;
    -webkit-mask-image:radial-gradient(closest-side,rgb(0 0 0 / 0.7) 0,rgb(0 0 0 / 0.5) 55%,transparent 100%);mask-image:radial-gradient(closest-side,rgb(0 0 0 / 0.7) 0,rgb(0 0 0 / 0.5) 55%,transparent 100%)}
  .home-hero .lk-flash{left:50%;inline-size:min(100%,46rem)}
  #mad-wordmark path:nth-of-type(1){transform:translateX(-16px)} /* the wordmark's two lines start on the logo's left edge, which is the paragraph's edge too */
  #mad-wordmark path:nth-of-type(n+2){transform:translateX(-4px)}
  /* five lines need 4.7 times the letter size, four 7.4, three 9.5, two 12.4 (the fallback font is the wider one, so these are its numbers).
     The headline starts at five lines and moves to four at one width only (--hg4), to three only after the buttons sit side by side,
     and to two only once two lines are also its largest size. Each move eases the letter size across, so the line count only ever
     goes down as the window widens and the size never jumps. */
  .home-hero h1{flex:1 1 0;min-inline-size:0;inline-size:auto;margin:0 0 0 calc(var(--L) * 0.09);text-wrap:balance;
    max-inline-size:max(6.8em,min(8.6em,var(--hg4) * 9999),min(11.5em,var(--hopen) * 9999,var(--hg4) * 9999),min((var(--R) - var(--L) * 4.052) * 9999,var(--hg4) * 9999));
    font-size:max(2rem,min(var(--hu) * 5.5,9rem,max(
      min(var(--L) / 5.1,min(var(--L) / 4.08,var(--R) / 7.4) + max(0px,80px - var(--hg4))),
      min(var(--L) / 4.08,var(--R) / 7.4,var(--L) / 5.1 + var(--hg4p) * 0.15),
      min(var(--L) / 3.06,var(--R) / 9.5,var(--L) / 4.08 + var(--hopen) * 0.5,var(--L) / 5.1 + var(--hg4p) * 0.15),
      min(var(--L) / 2.04,var(--R) / 12.4,var(--L) / 4.08 + var(--hopen) * 0.5,var(--L) / 5.1 + var(--hg4p) * 0.15))))}
  .home-hero .hero-copy{display:block;align-self:stretch;max-width:none;margin:0;padding:0}
  .home-hero .lead{margin:calc(var(--hu) * 1.5) 0 0;font-size:calc(var(--hu) * 1.25);line-height:1.4;letter-spacing:0.04em;max-width:40em}
  /* buttons: side by side at their own width when both fit, otherwise one under the other at full width, as on a phone */
  .home-hero .cta-group{display:flex;flex-flow:row wrap;gap:calc(var(--hu) * 0.75) var(--hu);margin:calc(var(--hu) * 1.5) 0 0}
  .home-hero .cta-group .btn.btn{flex:1 1 calc((var(--hu) * 39.5 - 100%) * 999);max-inline-size:max(var(--hu) * 19,(var(--hu) * 39.5 - 100%) * 999);
    min-height:calc(var(--hu) * 3.5);padding-block:calc(var(--hu) * 0.75);padding-left:calc(var(--hu) * 1.5);padding-right:calc(var(--cap) + var(--hu));
    gap:calc(var(--hu) * 0.75);font-size:calc(var(--hu) * 1.1875);letter-spacing:0.04em;--radius-field:calc(var(--hu) * 0.25)}
  .home-hero .cta-group .btn.btn:has(>.btn-icon){gap:calc(var(--hu) * 0.5)}
  .home-hero .cta-group .btn-icon{inline-size:calc(var(--hu) * 1.25);block-size:calc(var(--hu) * 1.25)}
  .home-hero .mockup-note{max-width:none;margin:var(--hu) 0 0;font-size:var(--hu);line-height:1.6}
}}
/* short windows: a slimmer header makes room; the words keep their size */
@media(min-width:600px) and (max-height:715px){:root{--lk-h:52px;--hdr-pad:var(--space-2)}}
/* wide and ultrawide: more columns instead of longer lines */
@media(min-width:2200px){.why-list,.svc-list{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:1023px){.site-header{flex-direction:row;align-items:center}.site-header nav{width:auto}}

/* 2. Phones, and a phone in "Desktop site" mode (about 980 px wide, very tall, and a touch screen; tokens.css doubles the root size there.
   A tall, narrow window on a desktop monitor has a mouse, so it gets section 1):
   logo and headline side by side, then the words and full-width buttons. With very large text the headline drops under the logo by itself. */
@media(max-width:599px),(min-width:900px) and (max-width:1100px) and (max-aspect-ratio:3/5) and (pointer:coarse){
  :root{--lk-h:2.75rem;--hdr-pad:0px;--pg:clamp(0.625rem,1.9svh,1.375rem)}
  .home-hero .hero{display:flex;flex-flow:row wrap;align-items:center;align-content:center;justify-content:flex-start;gap:var(--pg) clamp(0.75rem,3vw,1.25rem);padding-block:clamp(0.75rem,2.4svh,2rem)}
  .home-hero .hero-pair,.home-hero .hero-copy{display:contents}
  .home-hero .hero-plate{flex:1 1 5.5rem;inline-size:auto;min-inline-size:0;max-inline-size:12.5rem;align-self:center;margin:0;padding:0}
  .home-hero .hero-plate .hero-lockup{block-size:auto;inline-size:100%;max-inline-size:none;aspect-ratio:648.9/828.7}
  .home-hero h1{flex:0 0 auto;inline-size:4.62em;max-inline-size:100%;margin:0}
  .home-hero .lead,.home-hero .mockup-note,.home-hero .cta-group{flex:0 0 100%;max-inline-size:100%;margin:0}
  .home-hero .lead{line-height:1.4}
  .home-hero .mockup-note{line-height:1.4;letter-spacing:0.03em}
  .home-hero .cta-group{flex-direction:column;flex-wrap:nowrap;gap:var(--space-3)}
  .home-hero .cta-group .btn{inline-size:100%}
}
@media(max-width:599px) and (max-height:760px){
  :root{--lk-h:2.5rem}
  .home-hero .hero{padding-block:0.375rem}
  .home-hero .lead,.home-hero .mockup-note{line-height:1.35}
  .home-hero .cta-group{gap:var(--space-2)}
  .home-hero .cta-group .btn.btn{min-height:3rem;padding-block:var(--space-2)}
}
/* phones: the headline is a little smaller so the menu and the words below get room; the logo shrinks with it to keep the pair even */
@media(max-width:599px){
  .home-hero h1{font-size:min(calc(var(--step-4) * 0.88),18vw)}
  .home-hero .hero-plate{max-inline-size:min(12.5rem,calc(min(calc(var(--step-4) * 0.88),18vw) * 4.3))}
}

/* Phone hero: room to breathe between the mark and headline, the paragraph and the buttons. The small note under the buttons steps
   aside on phones (the same promise is in "How it works" and on each service page). It stays in the hero's draw-in sequence, unseen,
   so the sequence still finishes on time. */
@media(max-width:599px){
  .home-hero .hero{row-gap:clamp(1.25rem,3.6svh,2.25rem)}
  .home-hero .mockup-note{position:absolute;inline-size:1px;block-size:1px;overflow:hidden;clip-path:inset(50%);visibility:hidden!important}
}

/* 3. Menu: below 1024 px the header shows the Menu button. Without the script the links just show in rows. */
.nav-toggle{display:none}
@media(max-width:1023px),(min-width:900px) and (max-width:1100px) and (max-aspect-ratio:3/5) and (pointer:coarse){
  .nav-js .nav-toggle{display:inline-flex;align-items:center;gap:var(--space-3);min-height:var(--tap-min);min-width:var(--tap-min);padding:0 var(--space-4);border:var(--border-strong) solid var(--color-ink);border-radius:var(--radius-field);background:none;color:var(--color-ink);font:var(--weight-strong) var(--step-0)/1 var(--font-body);letter-spacing:0.04em;cursor:pointer}
  .nav-toggle svg{inline-size:1.1em;block-size:1.1em;fill:none;stroke:currentColor;stroke-width:2.2;overflow:visible}
  .nav-toggle svg circle{fill:var(--color-canvas)}
  .nav-toggle[aria-expanded="true"]{background:var(--color-ink);color:var(--color-canvas)}
  .nav-js .nav-toggle[aria-expanded="true"]{background:var(--color-ink);color:var(--color-canvas)}
  .nav-toggle[aria-expanded="true"] svg circle{fill:var(--color-ink)}
  .nav-js .site-header nav{display:none;position:absolute;z-index:6;top:100%;left:calc(var(--gutter) * -1);right:calc(var(--gutter) * -1);width:auto;flex-direction:column;padding:var(--space-2) var(--gutter) var(--space-4);background:var(--color-surface);border-bottom:var(--rule-sheet) solid var(--color-ink);box-shadow:var(--shadow-sheet)}
  .nav-js .site-header nav.is-open{display:flex}
  .site-header nav>a,.site-header nav summary{display:flex;inline-size:100%;min-height:3.25rem;padding-inline:0;font-size:var(--step-0)}
  .site-header nav summary:focus-visible,.site-header nav a:focus-visible{outline-offset:-3px}
  .site-header nav>a{border-top:var(--border-thin) solid var(--color-tint)}
  .site-header nav .nav-sub{position:static;margin:0 0 var(--space-3);padding:0 0 0 var(--space-4);border:0;border-left:var(--rule-sheet) solid var(--color-ink);border-radius:0;box-shadow:none}
  .site-header nav .nav-sub a{font-size:var(--step-0)}
}
@media(forced-colors:active){.nav-toggle{border-color:ButtonText}}

/* 4. Sign-in: the card sits in the middle of the screen */
.sign-in-page{box-sizing:border-box;min-height:100vh;display:flex;flex-direction:column;justify-content:safe center}
.sign-in-page>*{flex:none}
.sign-in-page>.sign-in-card{inline-size:100%;margin:0 auto}
@media(min-width:1920px){.sign-in-page>.sign-in-card,.sign-in-brand{max-width:32rem}}

/* 5. Very large text on a phone (text doubled): blocks wrap or tighten, so the page never scrolls sideways */
@media(max-width:1100px){
  .site-header{flex-wrap:wrap;row-gap:var(--space-2)}
  .nav-toggle{flex:none}
  .service-card{min-width:0;padding:min(var(--space-6),9vw)}
  .service-card h3,.svc-hero-copy,.svc-hero-copy h1{min-width:0;overflow-wrap:break-word;hyphens:manual}
  .process-grid li,.process-grid li:first-child{grid-template-columns:var(--tap-min) minmax(0,1fr)}
  .process-grid h3{overflow-wrap:break-word}
    .svc-hero h1{font-size:min(var(--step-4),14vw)}
  .sec-label{flex-wrap:wrap}
  .password-toggle{max-width:100%;padding-inline:min(var(--space-5),5vw)}
}
@media(max-width:1023px){.service-cards,.svc-hero{grid-template-columns:minmax(0,1fr)}}
@media(max-width:599px),(min-width:900px) and (max-width:1100px) and (max-aspect-ratio:3/5) and (pointer:coarse){:root{--lk-h:min(2.75rem,14vw)}}
@media(max-width:599px) and (max-height:760px){:root{--lk-h:min(2.5rem,14vw)}}
@media(max-width:599px){main h1:not(#hero-title),main h2,main h3,main p,main dt,main dd,main li,.process-grid li>div{overflow-wrap:anywhere;min-width:0}} /* only a word wider than the whole column breaks */

/* 6. Ultrawide: from about 3000 px up the header grows with the hero.
   Blended in from 2800 px; type sizes are in tokens.css. Nothing here applies at 2799 px or less. */
@media(min-width:2800px) and (min-height:960px){
  :root{--measure:55ch; /* at most about 75 characters a line */
    --content-max:calc(min(31.2rem + 44vw,120rem) + min(var(--uw) * 0.15,160px));--lk-h:clamp(64px,64px + var(--uw) * 0.04,96px)}
  .site-header nav{gap:var(--space-5)}
  .site-header nav>a,.site-header nav summary,.site-header .nav-sub a{font-size:var(--step-nav)}
  [data-btn="c"] .home-hero .btn{--cap:84px;--jog:9px;--gap:6px;--bx:32.4px;--spread:1.2;padding-left:var(--space-6)}
  [data-btn="c"] .home-hero .btn .btn-trace{right:16px;scale:1.2!important}
}

/* 7. Phone portrait: every section is one column, on every page. Same two cases as section 2: a normal phone, and a phone in
   "Desktop site" mode, where the page is about 980 px wide at double text size, so two-column rules written for 900 px desktops squeezed the words.
   The hero is owner-approved and is not touched here. Nothing here applies to tablets or desktops. */
@media(max-width:599px),(min-width:900px) and (max-width:1100px) and (max-aspect-ratio:3/5) and (pointer:coarse){
  .why-list,.services-list,.svc-list,.svc-steps,.service-cards,.svc-hero,.sheet-row,.sheet-label,.contact-sheet{grid-template-columns:minmax(0,1fr)}
  .sheet-label span:last-child{display:none}
  .process-grid,.flow-hero.hero{display:block}
  .process-grid h2{margin-bottom:var(--space-6)}
  .flow-hero .sheet-field{margin-top:var(--space-6)}
  .svc-hero .svc-icon-lg{grid-row:1;width:5.5rem;height:5.5rem}
  /* shorter: one column is longer, so the gaps tighten; the words keep their size */
  .why-list,.services-list,.svc-list,.svc-steps,.service-cards{gap:var(--space-6)}
  .process-grid li,.process-grid li:first-child{padding-bottom:var(--space-6)}
  .process-grid li:last-child{padding-bottom:0}
  .sheet-field{padding:var(--space-3)}
  .sheet-row{gap:var(--space-2)}
  .stamp{max-width:none}
  .svc-list li p,.svc-steps li p,.services-list p{margin-bottom:0}
  .flow-hero.hero{padding-bottom:0}
  .crumbs{justify-content:flex-start}
  .crumbs a{padding-inline-start:0}
  .others ul{display:grid;grid-template-columns:minmax(0,1fr)}
  .others a{width:100%}
  /* contact: heading, email, button, help, checklist, back to the top (the page order) */
  .contact-sheet{grid-template-rows:none;row-gap:var(--space-5)}
  .contact-sheet h2,.contact-note,.contact-prep{grid-column:1;grid-row:auto}
  .contact-sheet>.trace{display:none}
  .contact-note{container-type:inline-size}
  .contact-note #managed-email{overflow-wrap:normal;word-break:normal;font-size:min(clamp(1.0625rem,0.62rem + 1.6vw,1.75rem),9.4cqi)} /* one line, or a break after the @; never inside a word */
  .contact-note .btn.btn.cta{min-height:4rem;max-inline-size:none;margin-bottom:var(--space-4)}
  .contact-note,.contact-prep{min-width:0}
  /* footers */
  .footer-grid{flex-direction:column;align-items:flex-start}
  .footer-links,.sign-in-footer nav{display:grid;grid-template-columns:minmax(0,1fr);justify-items:start}
  .sign-in-footer{flex-direction:column;gap:var(--space-2)}
  .sign-in-footer nav{justify-items:center;width:auto}
}
@media (min-width:900px) and (max-width:1100px) and (max-aspect-ratio:3/5) and (pointer:coarse){
  .contact-note #managed-email{font-size:min(var(--step-1),9.4cqi)}
}
@media(max-width:767px){.sheet-row,.sheet-label{grid-template-columns:minmax(0,1fr)}.sheet-label span:last-child{display:none}} /* small phones turned sideways: each side would be under 280 px */

/* 8. Demo login in the menu: a quiet link in the secondary text colour */
.nav-quiet.nav-quiet{color:var(--color-ink-muted)}
.client-sign-in{min-width:max(var(--tap-min),6.3985em)} /* the old label's width, so the shorter label moves nothing else in the footer (r5 match) */
.sign-in-card .demo-who{margin-bottom:var(--space-3)}
/* 9. the phone link in the sign-in footer, on one line */
.sign-in-footer .footer-phone{color:var(--color-ink);text-decoration:none}.sign-in-footer .footer-phone:hover{text-decoration:underline}.sign-in-footer .call-text span{white-space:nowrap}
@media(max-width:15em){.sign-in-footer .call-text{font-size:min(var(--step--1),8vw)}}
/* 10. Email for demo access, on the sign-in card */
.demo-email{container-type:inline-size;margin-block:var(--space-3) var(--space-5)}.sign-in-card .demo-email .btn.btn{gap:var(--space-2);inline-size:100%}
.sign-in-card .btn-icon{flex:none;inline-size:1.25rem;block-size:1.25rem;fill:none;stroke:currentColor;stroke-width:2;stroke-linejoin:round} /* as in contact_band.css, which this page does not load */
@media(max-width:27em){.sign-in-card .demo-email .btn.btn{font-size:1.0625rem}}
