/* The homepage after the Walk. Shared type, palette and controls stay in styles.css.
   Section headings are serif, each with its own hand-drawn mark; the titles inside
   cards, stages and jobs are sans, so the two levels never read as the same thing. */

:root { --home-ease: var(--ease-out); }

/* The kicker itself is the site's own (css/styles.css); here it only sits a little further from its title. */
.home-kicker { margin-bottom: 16px; }

:is(.home-intro, .home-work, .home-process, .home-questions, .home-talk) h2 {
  font-size: clamp(2.1rem, 4vw, 3.6rem);
  line-height: 1.1;
  text-wrap: balance;
}
:is(.home-intro, .home-work, .home-process, .home-questions, .home-talk) h2 em { font-style: italic; }
.home-intro h2 em { color: var(--green); }
.home-questions h2 em { color: var(--brick); }
:is(.home-intro, .home-work, .home-process, .home-questions, .home-talk) h2 .wd { padding: 0 0.08em 0.3em; margin: 0 -0.08em -0.3em; }

/* ---------- Hand-drawn marks on the headings ---------- */

.mk { position: relative; white-space: nowrap; }
.mk-svg { position: absolute; max-width: none; overflow: visible; pointer-events: none; }
.mk-svg path { fill: none; stroke-linecap: round; stroke-linejoin: round; }

/* An underline swash under "working day." */
.mk-swash .mk-svg { left: 0; right: 0; bottom: -0.34em; width: 100%; height: 0.32em; }
.mk-swash .mk-svg path { stroke: var(--mustard); stroke-width: 4; }

/* A highlighter pass behind "keeps coming back." */
h2 em.mk-hl {
  white-space: normal;
  color: var(--ink);
  background: linear-gradient(var(--mustard-wash), var(--mustard-wash)) no-repeat 0 82% / var(--hl, 100%) 46%;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  padding-inline: 0.06em;
}

/* "result." on a small tag, like a label stuck to the sheet below. */
h2 em.mk-tag {
  display: inline-block;
  padding: 0 0.2em 0.04em;
  margin-left: 0.04em;
  color: var(--ink);
  background: var(--sky);
  border: var(--line) solid var(--ink);
  border-radius: 12px;
  box-shadow: 3px 4px 0 var(--ink);
  transform: rotate(-2.5deg);
  transform-origin: 30% 60%;
}

/* A ring around "one", as on the Let's talk page. */
.mk-ring { display: inline-block; margin-inline: 0.14em 0.1em; }
.mk-ring .mk-svg { left: -13%; top: 2%; width: 126%; height: 108%; }
.mk-ring .mk-svg path { stroke: var(--mustard); stroke-width: 4.2; }

/* ---------- "Go deeper" links: the site's secondary button ---------- */

.home-btn { min-height: 48px; padding-inline: 22px; font-size: 1rem; }

/* ---------- Meet Millwright ---------- */

.home-intro {
  background: var(--paper-2);
  padding-block: clamp(56px, 6.5vw, 94px) clamp(44px, 5vw, 72px);
}
/* On a touch screen the walk can end with this section at the top of the screen
   ("Skip the street", or a swipe out of the office). The header then comes back over
   it (js/home.js), so the kicker starts clear of the header. */
html.walk-touch .home-intro { padding-block-start: max(clamp(56px, 6.5vw, 94px), calc(var(--head-h, 80px) + 12px)); }
.home-intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 88px);
  align-items: start;
}
.home-intro h2 { font-size: clamp(2.65rem, 5vw, 4rem); max-width: 10em; }
.home-intro-copy { padding-top: 4px; max-width: 32em; }
.home-intro-copy > p + p { margin-top: 16px; color: var(--ink-soft); }
.home-intro-copy > .home-btn { margin-top: 24px; }

.home-section-head {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(28px, 6vw, 88px);
  align-items: start;
  margin-bottom: 40px;
}

/* ---------- What we help with ---------- */

.home-work { padding-block: clamp(56px, 6vw, 86px); }
.home-work .home-section-head { display: block; }
.home-work h2 { max-width: 18em; }
.home-work .home-section-head > .lead { margin-top: 20px; max-width: 39em; }
.home-work-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.home-work-list > li { display: grid; }
.home-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  gap: 14px 16px;
  align-items: center;
  align-content: start;
  padding: 22px;
  color: var(--ink);
  text-decoration: none;
  background: var(--paper-2);
  border: var(--line) solid var(--ink);
  border-radius: var(--r-md);
  box-shadow: 0 4px 0 var(--ink);
  transition: transform 0.3s var(--home-ease), box-shadow 0.3s var(--home-ease), background-color 0.25s ease;
}
/* While GSAP brings a card in, CSS mustn't ease its transform as well. */
.home-card.is-arriving { transition-property: box-shadow, background-color; }
.home-talk-action > .is-arriving { transition: none; }
.home-card-icon { width: 44px; transition: transform 0.4s var(--home-ease); }
.home-card h3 {
  justify-self: start;
  font-family: var(--sans);
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0;
}
.home-card-t {
  padding-bottom: 2px;
  background: linear-gradient(var(--ink), var(--ink)) no-repeat 0 100% / 100% 1px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  transition: background-size 0.45s var(--home-ease);
}
.home-card p { grid-column: 1 / -1; align-self: start; color: var(--ink-soft); line-height: 1.5; }
.home-card:is(:hover, :focus-visible) { transform: translateY(-4px); box-shadow: 0 7px 0 var(--ink); background: var(--paper); }
.home-card:is(:hover, :focus-visible) .home-card-t { background-image: linear-gradient(var(--green), var(--green)); background-size: 100% 2px; }
.home-card:is(:hover, :focus-visible) .home-card-icon { transform: rotate(-8deg) scale(1.08); }
.home-card:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); transition-duration: 0.08s; }
.home-section-tail { margin-top: 32px; }

/* ---------- How working together goes: five stages on one sheet ---------- */

.home-process { background: var(--paper-2); padding-block: clamp(56px, 6vw, 86px); }
.home-process-intro > .home-btn { margin-top: 20px; }
.home-stages {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 28px;
  padding: 30px 30px 32px;
  background: var(--paper);
  border: var(--line) solid var(--ink);
  border-radius: var(--r-lg);
  box-shadow: 5px 6px 0 var(--ink);
}
.home-stages > li { display: grid; grid-row: span 4; grid-template-rows: subgrid; row-gap: 10px; }
.home-stages > li > .home-stage-n { margin-bottom: 4px; }
.home-stage-n {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--mustard);
  border: var(--line) solid var(--ink);
  font-family: var(--serif);
  font-weight: 600;
  font-variation-settings: "SOFT" 100;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--ink);
  transition: background-color 0.35s ease;
}
.home-stages.is-waiting > li:not(.is-lit) .home-stage-n { background: var(--paper); }
.home-stage-text { display: contents; }
.home-stages h3 { align-self: end; font-family: var(--sans); font-size: 1.08rem; font-weight: 700; line-height: 1.3; letter-spacing: 0; }
.home-stage-body { color: var(--ink-soft); font-size: 0.98rem; line-height: 1.5; text-wrap: pretty; }
.home-stage-get { font-size: 0.98rem; line-height: 1.5; text-wrap: pretty; }
.home-stage-get strong { color: var(--green-deep); }

/* ---------- A few questions first ---------- */

.home-questions { padding-block: clamp(56px, 6vw, 86px); }
.home-questions-grid { display: grid; grid-template-columns: minmax(0, 0.65fr) minmax(0, 1.35fr); grid-template-rows: auto 1fr; column-gap: clamp(32px, 6vw, 88px); }
.home-questions .faq { grid-column: 2; grid-row: 1 / span 2; }
.home-questions-more { grid-column: 1; grid-row: 2; margin-top: 24px; }
.home-questions .answer { color: var(--ink-soft); padding-right: 42px; }
.home-questions .faq summary::after { transition: background-size 0.2s ease, background-color 0.2s ease; }
.home-questions .faq summary:is(:hover, :focus-visible)::after { background-color: var(--mustard); }
.home-questions .faq summary:focus-visible { color: var(--green); }

/* ---------- Let's talk ---------- */

.home-talk { background: var(--paper-2); padding-block: clamp(56px, 6vw, 86px); }
.home-talk-panel {
  padding: clamp(32px, 5vw, 64px);
  color: var(--paper);
  background: var(--green-deep);
  border: var(--line) solid var(--ink);
  border-radius: var(--r-lg);
  box-shadow: 0 6px 0 var(--ink);
}
.home-talk .home-kicker { color: var(--lit); }
.home-talk h2 { color: var(--paper); }
.home-talk .lead { color: var(--paper-2); }
.home-talk-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); grid-template-areas: "copy jobs" "action jobs"; column-gap: clamp(32px, 5vw, 72px); align-content: center; }
.home-talk-copy { grid-area: copy; align-self: end; }
.home-recognize { grid-area: jobs; align-self: center; }
.home-talk-action { grid-area: action; align-self: start; margin-top: 30px; }
.home-talk h2 { font-size: clamp(2.4rem, 4.6vw, 4.3rem); white-space: nowrap; }
.home-talk h2 + p { margin-top: 22px; max-width: 25em; }
.home-recognize { padding: 20px 16px 16px; color: var(--ink); background: var(--paper); border: var(--line) solid var(--ink); border-radius: var(--r-md); box-shadow: 6px 7px 0 var(--mustard); }
.home-recognize-label { padding-inline: 10px; margin-bottom: 10px; font-size: 0.76rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--green-deep); }
.home-recognize ul { display: grid; gap: 2px; }
.home-recognize a {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 12px 10px;
  border-radius: var(--r-sm);
  color: var(--ink);
  text-decoration: none;
  transition: background-color 0.2s ease, transform 0.3s var(--home-ease);
}
.home-recognize a:is(:hover, :focus-visible) { background: var(--paper-2); transform: translateX(3px); }
.home-recognize a:focus-visible { outline-offset: 0; }
.home-recognize a:active { transform: translateX(1px); transition-duration: 0.08s; }
.home-job-icon { width: 40px; transition: transform 0.4s var(--home-ease); }
.home-recognize a:is(:hover, :focus-visible) .home-job-icon { transform: rotate(-8deg) scale(1.08); }
.home-job { display: grid; gap: 2px; min-width: 0; }
/* The underline redraws from the left when you point at a job. */
.home-job-name {
  justify-self: start;
  font-size: 1.08rem;
  font-weight: 700;
  padding-bottom: 2px;
  background: linear-gradient(var(--mustard), var(--mustard)) no-repeat 0 100% / 100% 3px;
}
.home-recognize a:is(:hover, :focus-visible) .home-job-name { animation: home-redraw 0.55s var(--home-ease); }
@keyframes home-redraw { 0% { background-position: 100% 100%; background-size: 100% 3px; } 45% { background-position: 100% 100%; background-size: 0% 3px; } 46% { background-position: 0 100%; background-size: 0% 3px; } 100% { background-position: 0 100%; background-size: 100% 3px; } }
.home-job-desc { font-size: 0.95rem; line-height: 1.45; color: var(--ink-soft); text-wrap: pretty; }

.home-cta { min-height: 58px; padding-inline: 30px; font-size: 1.15rem; }
.home-reassurance { margin-top: 22px; font-size: 1rem; color: var(--paper); }
.home-reassurance strong { display: block; }
.home-talk .home-reassurance strong { color: var(--mustard-wash); }
.home-talk :focus-visible { outline-color: var(--mustard); }

/* ---------- Layout steps ---------- */

@media (max-width: 1279px) {
  .home-stages { grid-template-columns: minmax(0, 1fr); gap: 22px; padding: 26px 26px 28px; }
  .home-stages > li { grid-row: auto; grid-template-rows: none; grid-template-columns: 40px minmax(0, 1fr); gap: 18px; }
  .home-stages > li > .home-stage-n { margin-bottom: 0; }
  .home-stage-text { display: grid; align-content: start; gap: 4px; max-width: 40em; }
  .home-stages h3 { align-self: start; }
  .home-stage-text .home-stage-get { margin-top: 4px; }
}

@media (max-width: 1100px) {
  .home-intro-grid, .home-section-head { gap: 36px; }
  .home-work-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 961px) and (max-width: 1279px) {
  .home-stages { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 28px 32px; padding: 28px 30px 30px; }
  .home-stages > li { grid-column: span 2; }
  .home-stages > li:nth-child(4) { grid-column: 2 / span 2; }
  .home-stages > li:nth-child(5) { grid-column: 4 / span 2; }
  .home-stage-text { max-width: none; }
}

@media (max-width: 820px) {
  .home-intro-grid { grid-template-columns: 1fr; gap: 26px; }
  .home-intro h2 { max-width: 13em; }
  .home-intro-copy { max-width: 36em; }
  .home-section-head { grid-template-columns: 1fr; gap: 22px; margin-bottom: 30px; }
  .home-section-head .lead { max-width: 34em; }
  .home-work-list { gap: 20px; }
  .home-card { grid-template-columns: 40px minmax(0, 1fr); gap: 12px 14px; padding: 20px; }
  .home-card-icon { width: 40px; }
  .home-questions-grid { grid-template-columns: 1fr; grid-template-rows: none; }
  .home-questions .faq { grid-column: 1; grid-row: auto; margin-top: 24px; }
  .home-questions-more { grid-column: 1; grid-row: auto; margin-top: 18px; }
  .home-questions h2 br { display: none; }
  .home-talk-grid { grid-template-columns: 1fr; grid-template-areas: "copy" "jobs" "action"; row-gap: 32px; }
  .home-talk-action { margin-top: 0; }
  .home-recognize { max-width: 36em; }
  .home-talk h2 + p { max-width: 30em; }
}

@media (max-width: 560px) {
  :is(.home-intro, .home-work, .home-process, .home-questions, .home-talk) { padding-block: 44px; }
  .home-kicker { margin-bottom: 12px; }
  .home-intro h2 { font-size: clamp(2.65rem, 10vw, 3.5rem); }
  .home-intro-copy > .home-btn { margin-top: 18px; }
  .home-section-head { gap: 16px; margin-bottom: 24px; }
  .home-work .home-section-head > .lead { margin-top: 16px; }
  .home-work-list { grid-template-columns: 1fr; gap: 12px; }
  .home-card { grid-template-columns: 36px minmax(0, 1fr); gap: 10px 12px; padding: 16px; }
  .home-card-icon { width: 36px; }
  .home-card p { font-size: 1rem; }
  .home-section-tail { margin-top: 24px; }
  .home-questions .faq { margin-top: 20px; }
  .home-questions .faq summary { font-size: 1.2rem; gap: 16px; }
  .home-questions .answer { padding-right: 4px; font-size: 1rem; }
  .home-talk h2 { font-size: clamp(2.3rem, 10.5vw, 3.2rem); white-space: normal; }
  .home-talk-panel { padding: 28px 20px 30px; }
  .home-talk h2 + p { margin-top: 16px; }
  .home-talk-grid { row-gap: 28px; }
  .home-stages { gap: 20px; padding: 20px 18px 22px; }
  .home-stages > li { grid-template-columns: 32px minmax(0, 1fr); gap: 12px; }
  .home-stage-n { width: 32px; height: 32px; font-size: 1.05rem; border-width: 2px; }
  .home-stage-body, .home-stage-get { font-size: 0.95rem; }
  .home-recognize { padding: 18px 10px 12px; }
  .home-recognize a { grid-template-columns: 34px minmax(0, 1fr); gap: 8px 12px; }
  .home-recognize a:is(:hover, :focus-visible) { transform: none; }
  .home-job-icon { width: 34px; }
  .home-job-desc { font-size: 0.92rem; }
  .home-cta { width: 100%; justify-content: center; padding-inline: 20px; font-size: 1.05rem; }
}

@media (prefers-reduced-motion: reduce) {
  .home-card, .home-card-t, .home-card-icon, .home-recognize a, .home-job-icon, .home-stage-n,
  .home-questions .faq summary::after { transition: none; }
  .home-card:is(:hover, :focus-visible, :active), .home-recognize a:is(:hover, :focus-visible, :active),
  .home-card:is(:hover, :focus-visible) .home-card-icon, .home-recognize a:is(:hover, :focus-visible) .home-job-icon,
  .home-cta:is(:hover, :active) { transform: none; }
  .home-recognize a:is(:hover, :focus-visible) .home-job-name { animation: none; }
}

/* ---------- The header comes back after the Walk ----------
   js/home.js adds .head-back once the street has scrolled off the top. The header
   leaves the flow then, so the body keeps its place with matching padding.
   .head-hide tucks it away while the page is scrolling; it returns when scrolling stops. */
html.head-back body { padding-top: var(--head-h, 0px); }
html.head-back { scroll-padding-top: var(--head-h, 0px); }
html.head-back .site-head {
  position: fixed; top: 0; left: 0; right: 0;
  background: var(--paper);
  box-shadow: 0 6px 18px rgba(34, 50, 44, 0.08);
  transition: transform 0.35s var(--home-ease), box-shadow 0.35s ease;
}
/* Hidden applies a frame before the bar becomes fixed, with no transition of its own,
   so the bar never flashes on its way out of the flow. */
/* Some phone browsers (Arc and others built on the system web view) let the page scroll
   on under the status bar, above the top of the window. The bar covers that strip too, so
   the page does not show above it. Elsewhere the strip is off screen. */
html.head-back .site-head::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 50vh;
  background: var(--paper); pointer-events: none;
}
html.head-hide .site-head { transform: translateY(-100%); box-shadow: none; }
html.head-back.head-hide .site-head { transition-duration: 0.2s; }
@media (prefers-reduced-motion: reduce) { html.head-back .site-head { transition: none; } }
