/* ==========================================================================
   System: the shared layer every page loads after shop.css.
   One type scale, one link and button system, the rack label plate, the
   header, footer and phone counter bar. Page stylesheets build on these and
   should not restate them. See DESIGN.md, "System layer".
   ========================================================================== */

/* --- type ----------------------------------------------------------------- */

/* Geometr415 ships Light (400) and Medium (600) only, with synthesis off. */
h1, h2, h3, h4 { font-weight: var(--w-medium); }
h1, h2, h3, blockquote { text-wrap: balance; }
p, li, dd, figcaption { text-wrap: pretty; }
.nw { white-space: nowrap; }

.t-h2 {
  font-size: var(--type-section);
  font-weight: var(--w-medium);
  letter-spacing: -0.035em;
  line-height: 1.04;
}
.t-h3 { font-weight: var(--w-medium); }

/* Plex Mono labels: specs, readouts, eyebrows. Uppercase, never below 0.72rem. */
.spec {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}

/* --- the rack label plate --------------------------------------------------
   Lifted from the shop's own bin labels: a navy plate, a thin white keyline
   just inside the edge, the stock name and a smaller spec line. It is a
   physical object, so it stays brand navy in dark mode too. */
.plate {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.14em;
  padding: 0.5em 0.95em 0.55em;
  border-radius: var(--radius-small);
  background: #284080;
  color: #fff;
  box-shadow: inset 0 0 0 2px #284080, inset 0 0 0 3.5px rgb(255 255 255 / 0.9);
  font-family: var(--sans);
  font-weight: var(--w-medium);
  line-height: 1.08;
  letter-spacing: -0.005em;
  text-align: center;
}
.plate__name { font-size: 1em; }
.plate__spec {
  font-family: var(--mono);
  font-size: 0.72em;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: rgb(255 255 255 / 0.88);
}

/* --- interaction basics ---------------------------------------------------- */

a, button, summary { -webkit-tap-highlight-color: transparent; }
/* Focus and validation scrolling keep controls clear of the sticky header. Low specificity,
   so anchors and fields with their own tuned scroll-margin keep it. */
:where(a, button, input, textarea, select, summary) { scroll-margin-top: calc(72px + 1rem); }
button.btn { line-height: inherit; }
:where(summary):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
}
/* Any solid navy or chrome surface takes a white focus ring. */
.band, .ftr, .cbar__quote, .is-navy { --focus: #fff; }

/* --- links and buttons ------------------------------------------------------ */

/* One inline link: medium weight, a 1px rule that thickens on hover. */
.tlink {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-weight: var(--w-medium);
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.28em;
  transition: text-decoration-thickness var(--fast) var(--ease);
}
.tlink:hover { text-decoration-thickness: 2px; }
.tlink svg { width: 1.1em; height: 1.1em; flex: none; }
@media (prefers-reduced-motion: no-preference) {
  .tlink svg { transition: transform 260ms var(--ease); }
  .tlink:is(:hover, :focus-visible) svg { transform: translateX(3px); }
}

/* Two sizes: default and large. Shine and progress effects are gone. */
.btn {
  min-height: 52px;
  font-size: 0.95rem;
  font-weight: var(--w-medium);
}
.btn--lg { min-height: 56px; padding-inline: 1.75rem; font-size: 1rem; }
.btn--light { background: #fff; color: #284080; border-color: #fff; }
.btn--light:hover { background: #e8ecf5; border-color: #e8ecf5; }
.btn--onchrome { color: #fff; }

/* --- breadcrumb ------------------------------------------------------------- */

.crumb {
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: var(--w-light);
  letter-spacing: 0;
  text-transform: none;
}
.crumb a { text-decoration: none; }
.crumb a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* --- header ------------------------------------------------------------------ */

/* The bar shares the content column, so logo, crumbs and headings share an edge. */
.hdr__bar { max-width: var(--page); }
.hdr__hours { display: none; }

@media (max-width: 980px) {
  .hdr__link { font-size: 1.25rem; font-weight: var(--w-light); padding-block: 1rem; }
  .hdr__link[aria-current='page'] { font-weight: var(--w-medium); }
  .hdr__link--cta,
  .hdr__link--cta:is(:hover, [aria-current='page']) {
    padding: 1rem 0;
    border-radius: 0;
    font-weight: var(--w-medium);
  }
  .hdr__tel { padding-block: 1rem 0.35rem; font-size: 1.05rem; }
  .hdr__hours {
    display: grid;
    gap: 0.2rem;
    padding-block: 0.15rem 0.25rem;
    font-family: var(--mono);
    font-size: 0.78rem;
    letter-spacing: 0.02em;
    color: var(--ink-2);
  }
  .hdr[data-nav-ready] .hdr__nav {
    border-bottom: 1px solid var(--rule-strong);
    box-shadow: 0 22px 34px -26px rgb(14 23 48 / 0.45);
  }
  html.nav-open { overflow: hidden; }
}
@media (max-width: 980px) and (prefers-reduced-motion: no-preference) {
  .hdr[data-nav-ready] .hdr__nav[data-open='true'] { animation: nav-drop 200ms var(--ease); }
}
@keyframes nav-drop { from { opacity: 0; translate: 0 -8px; } }

/* --- footer: the counter first, then the map of the site --------------------- */

.ftr { padding-block: clamp(2.5rem, 5vw, 4.5rem) 1.5rem; }
.ftr__counter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: var(--layout-gap);
  padding-bottom: clamp(2rem, 4vw, 3.25rem);
  margin-bottom: clamp(2rem, 4vw, 3rem);
  border-bottom: 1px solid var(--chrome-rule);
}
.ftr__reach { display: grid; justify-items: start; gap: 0.9rem; }
.ftr__plate { font-size: 0.8rem; }
.ftr .ftr__phone {
  font-size: clamp(2.4rem, 6vw, 5rem);
  font-weight: var(--w-medium);
  line-height: 1;
  letter-spacing: -0.04em;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.ftr .ftr__phone:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.12em; }
.ftr__status {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: var(--chrome-ink);
}
.ftr__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.ftr .btn--light { color: #284080; }
.ftr .btn--light:hover { text-decoration: none; }
.ftr .btn--onchrome:hover { text-decoration: none; }

.ftr__grid { grid-template-columns: 1.35fr 0.8fr 1.1fr 1fr; gap: var(--layout-gap); }
.ftr__about { display: grid; gap: 0.75rem; align-content: start; }
.ftr__about p { max-width: 34ch; color: var(--chrome-ink-dim); font-size: 0.92rem; }
.ftr__logo img { width: 86px; height: auto; margin-bottom: 0.5rem; }
.ftr .ftr__grid h2 {
  margin-bottom: 1rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--chrome-ink-dim);
}
.ftr__grid li { font-size: 0.95rem; color: var(--chrome-ink-dim); }
.ftr a[aria-current='page'] { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.ftr__meta { margin-top: clamp(2rem, 4vw, 3rem); }

@media (max-width: 980px) {
  .ftr__grid { grid-template-columns: 1fr 1fr; }
  .ftr__about { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
  .ftr__counter { grid-template-columns: 1fr; align-items: start; }
  .ftr__actions { display: grid; grid-template-columns: 1fr; }
  .ftr__actions .btn { width: 100%; }
  .ftr__grid { grid-template-columns: 1fr 1fr; gap: 2rem 1.25rem; }
  .ftr__grid > :last-child { grid-column: 1 / -1; }
  .ftr__grid li + li { margin-top: 0; }
  .ftr__legal { gap: 0 1.25rem; }
  .ftr__meta { flex-direction: column-reverse; }
}

@media (max-width: 980px), (pointer: coarse) {
  .ftr__grid li a, .ftr__legal a, .ftr .ftr__phone, .crumb a { display: inline-flex; align-items: center; min-height: 44px; }
  .ftr__grid li + li { margin-top: 0; }
}

/* --- phone counter bar ------------------------------------------------------- */

.cbar { display: none; }
@media (max-width: 700px) {
  .cbar {
    position: fixed;
    inset: auto 0 0;
    z-index: 35;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.5rem;
    padding: 0.6rem var(--gutter) calc(0.6rem + env(safe-area-inset-bottom));
    background: var(--paper-raised);
    border-top: 1px solid var(--rule);
    transform: translateY(105%);
    visibility: hidden;
    transition: transform 260ms var(--ease), visibility 0s linear 260ms;
  }
  .cbar[data-visible='true'] {
    transform: none;
    visibility: visible;
    transition: transform 260ms var(--ease), visibility 0s;
  }
  .cbar a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-height: 48px;
    padding-inline: 1rem;
    border-radius: var(--radius-control);
    font-size: 0.95rem;
    font-weight: var(--w-medium);
    text-decoration: none;
    white-space: nowrap;
  }
  .cbar svg { width: 19px; height: 19px; flex: none; }
  .cbar__call { border: 1px solid var(--rule-strong); color: var(--ink); }
  .cbar__quote { background: #284080; color: #fff; }
  .cbar__quote:active, .cbar__call:active { transform: translateY(1px); }
  /* Keyboard focus and validation scrolling keep controls clear of the bar. */
  html:has(.cbar[data-visible='true']) { scroll-padding-bottom: calc(4.25rem + env(safe-area-inset-bottom) + 0.75rem); }
}
@media (max-width: 379px) {
  .cbar__long { display: none; }
}
@media (prefers-color-scheme: dark) {
  .cbar__quote { background: var(--accent); color: var(--accent-ink); }
}

/* --- interior hero: the photo edge to edge, a navy plate cut into it --------
   The same geometry as the home door (photo full bleed, panel set into its
   bottom-left with one rounded corner), in brand navy instead of paper.
   Markup:
     <section class="bleed-hero">
       <figure class="bleed-hero__photo"><picture>...</picture></figure>
       <div class="bleed-hero__panel">crumb, h1, .bleed-hero__lead, .bleed-hero__actions</div>
     </section>
   --bleed-focus sets the photo's object-position per page. --compact gives a
   shorter band for pages whose first job sits right below (Contact). */
.bleed-hero {
  --focus: #fff;
  position: relative;
  display: grid;
  align-items: end;
  min-height: min(calc(100svh - 72px), 46rem);
  background: #182858;
  isolation: isolate;
}
.bleed-hero--compact { min-height: min(calc(78svh - 72px), 34rem); }
.bleed-hero__photo { position: absolute; inset: 0; z-index: -1; margin: 0; overflow: hidden; }
.bleed-hero__photo picture, .bleed-hero__photo img { width: 100%; height: 100%; }
.bleed-hero__photo img { object-fit: cover; object-position: var(--bleed-focus, 50% 50%); }
.bleed-hero__panel {
  width: min(100%, calc(var(--gutter) + 46rem));
  padding: clamp(1.75rem, 3.4vw, 3rem) clamp(1.5rem, 3vw, 3rem) clamp(1.75rem, 3.4vw, 3rem) var(--gutter);
  background: #284080;
  color: #fff;
  border-top-right-radius: var(--radius-photo);
}
@media (min-width: 1761px) {
  /* Past the page width the column is centred; keep the panel text on it. */
  .bleed-hero__panel {
    width: calc((100vw - var(--page)) / 2 + var(--gutter) + 46rem);
    padding-left: calc((100vw - var(--page)) / 2 + var(--gutter));
  }
}
.bleed-hero .crumb { margin-bottom: 1.1rem; color: #d8e0f3; }
.bleed-hero .crumb a { color: #fff; }
.bleed-hero h1 {
  max-width: 13ch;
  font-size: var(--type-hero);
  font-weight: var(--w-medium);
  line-height: 0.98;
  letter-spacing: -0.04em;
  color: #fff;
}
.bleed-hero__lead {
  max-width: 42ch;
  margin-top: 1.1rem;
  font-size: clamp(1.05rem, 1.35vw, 1.2rem);
  line-height: 1.55;
  color: #e0e6f5;
}
.bleed-hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  margin-top: 1.6rem;
}
.bleed-hero__actions .tlink { color: #fff; }
@media (min-width: 761px) and (max-width: 1199px) {
  /* Tablets: keep the photo visible beside the panel instead of a strip above it. */
  .bleed-hero__panel { width: min(100%, calc(var(--gutter) + 26rem + 10vw)); }
}
@media (max-width: 760px) {
  .bleed-hero { display: block; min-height: 0; background: #284080; }
  .bleed-hero__photo { position: relative; z-index: auto; aspect-ratio: 4 / 3; max-height: 62svh; }
  .bleed-hero--compact .bleed-hero__photo { aspect-ratio: 3 / 1; }
  .bleed-hero__panel { width: 100%; padding-inline: var(--gutter); border-radius: 0; }
  .bleed-hero h1 { font-size: clamp(2.6rem, 11vw, 4rem); }
  .bleed-hero__actions .btn { flex: 1 1 100%; }
}
