/* The redesign's shared look: fonts, colors, the header (Arthur's "header-new"), the phone's
   bottom contact bar, and the quote form in its panel (desktop) or sheet (phones).
   Built from Paper "ISL-70 · Final redesign" for ISL-65. Every redesign page links this file
   and contact.js, and copies the header, bar and dialog markup from public/redesign.html.
   ISL-93 made the header float with no box, from Paper's "Header New" and "A3" boards. */

@font-face {
  font-family: 'Hanken Grotesk';
  src: url(/ui/fonts/hanken-grotesk-latin.woff2) format('woff2');
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: 'Linden Hill';
  src: url(/ui/fonts/linden-hill-latin.woff2) format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'Fanwood Text';
  src: url(/ui/fonts/fanwood-text-latin.woff2) format('woff2');
  font-display: swap;
}

:root {
  --ink: #23272B;
  --green: #6E907E; /* sampled from John's logo */
  --green-dark: #5D7C6B; /* hover */
  --muted: #5C564D;
  --paper: #F3EFE7;   /* the warm page ground, and the header's glow */
  --button-ink: #101214; /* Contact us text, on green */
  --line: #23272B26;
  --field-edge: #23272B99;
  --sans: 'Hanken Grotesk', system-ui, sans-serif;
  --display: 'Linden Hill', Georgia, serif;
  --serif: 'Fanwood Text', Georgia, serif;
  --ring: 0 0 0 3px var(--green);
  --bar-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
/* Keeps the scrollbar's space when Contact us locks the page, so nothing shifts sideways. */
html { scrollbar-gutter: stable; }
html.contact-locked { overflow: hidden; }
a { color: inherit; }
.nobreak { white-space: nowrap; }
:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

/* ---- Header (header-new, floating) ----
   At the top of the page: no card, bar or border. An edgeless sand glow sits behind the logo
   and links, and each of them carries its own sand halo, so they stay readable over photos as
   well as sand ("A3 · Header · Scrolled" and "A3 · States" in Paper). On desktop Contact us
   floats beside them as part of the header (Arthur, Nov 30); it's a solid button, so it needs
   no glow.
   Once the page scrolls, contact.js adds .is-scrolled and the whole header becomes one
   frosted-glass bar across the top, which takes over from the glow and halos (Arthur, Nov 30,
   11:56 PM). The glass fades in, or switches at once with reduce motion on. Nothing changes
   size. Without backdrop-filter, the bar is solid sand instead. */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  height: 96px;
  padding-inline: 48px;
  pointer-events: none; /* clicks pass through the empty parts; the links and button take them */
}
.site-nav::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: -1;
  width: 540px;
  height: 92px;
  translate: -50% -50%;
  border-radius: 50%;
  background: #F3EFE7F0;
  filter: blur(26px);
}
.site-header a { pointer-events: auto; }

/* The glass bar, hidden until the page scrolls. */
.site-header::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: #F3EFE7A6;
  -webkit-backdrop-filter: blur(18px) saturate(170%);
  backdrop-filter: blur(18px) saturate(170%);
  border-bottom: 1px solid #FFFFFF99;
  box-shadow: inset 0 1px 0 #FFFFFF73, 0 1px 0 #23272B14;
  opacity: 0;
  transition: opacity 280ms ease;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-header::before { background: var(--paper); }
}
.site-nav::before { transition: opacity 280ms ease; }
.site-nav__logo img { transition: filter 280ms ease; }
.site-nav__link { transition: text-decoration-color 150ms, text-shadow 280ms ease; }
.site-header.is-scrolled { pointer-events: auto; } /* a visible bar takes its own clicks */
.site-header.is-scrolled::before { opacity: 1; }
.site-header.is-scrolled .site-nav::before { opacity: 0; }
.site-header.is-scrolled .site-nav__link { text-shadow: 0 0 0 transparent, 0 0 0 transparent, 0 0 0 transparent; }
.site-header.is-scrolled .site-nav__logo img { filter: drop-shadow(0 0 0 transparent) drop-shadow(0 0 0 transparent); }
@media (prefers-reduced-motion: reduce) {
  .site-header::before,
  .site-nav::before,
  .site-nav__link,
  .site-nav__logo img { transition: none; }
}
.site-nav { position: relative; display: flex; align-items: center; gap: 16px; }
.site-nav__link {
  font-size: 15px;
  font-weight: 500;
  line-height: 20px;
  text-decoration: underline 3px transparent;
  text-underline-offset: 10px;
  text-shadow: 0 0 3px var(--paper), 0 0 8px var(--paper), 0 0 16px #F3EFE7E6;
}
.site-nav__link:hover,
.site-nav__link[aria-current='page'] { text-decoration-color: var(--green); }
.site-nav__link[aria-current='page'] { font-weight: 700; }
.site-nav__logo { display: block; flex-shrink: 0; }
.site-nav__logo img {
  display: block;
  width: 204px;
  height: 60px;
  object-fit: contain;
  filter: drop-shadow(0 0 4px var(--paper)) drop-shadow(0 0 12px #F3EFE7E6);
}

.contact-button {
  display: inline-block;
  padding: 13px 22px;
  border: 0;
  border-radius: 2px;
  background: var(--green);
  color: var(--button-ink);
  font: 700 15px/20px var(--sans);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms;
}
@media (hover: hover) { .contact-button:hover { background: var(--green-dark); } }

/* The phone's bottom bar: the number to tap and Contact us. Hidden on desktop. */
.contact-bar { display: none; }

@media (max-width: 799px) {
  .site-header { height: 68px; padding-inline: 12px; }
  .site-nav { position: static; } /* the glow spans the screen, as on the phone boards */
  .site-nav::before { width: 100%; height: 70px; filter: blur(20px); }
  .site-header .contact-button { display: none; }
  .site-nav__link { font-size: 14px; padding-block: 12px; white-space: nowrap; }
  .site-nav__logo img { width: 124px; height: 38px; }
  body { padding-bottom: var(--bar-h); }

  .contact-bar {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--bar-h);
    padding-inline: 16px;
    background: #FFFFFF;
    border-top: 1px solid var(--line);
    box-shadow: 0 -6px 16px #23272B14;
    transition: translate 240ms ease-out;
  }
  .contact-bar.is-hidden { translate: 0 calc(100% + 16px); transition: translate 200ms ease-in; }
  .contact-bar .contact-button { padding-inline: 20px; }
}
/* The narrowest phones (320px): the nav needs 326px at the size above but only 296px fit, so the
   page scrolled sideways (ISL-113). Tighter edges, gaps and logo bring it to 294px. 375px and
   wider keep the size above. */
@media (max-width: 359px) {
  .site-header { padding-inline: 8px; }
  .site-nav { gap: 10px; }
  .site-nav__logo img { width: 104px; height: 31px; }
}
.phone-link {
  font: 700 19px/24px var(--sans);
  color: var(--ink);
  text-decoration: underline 2px var(--green);
  text-underline-offset: 6px;
  white-space: nowrap;
}

/* ---- Contact panel (desktop) and sheet (phones) ---- */

.contact-dialog {
  position: fixed;
  inset: 0 0 0 auto;
  width: 600px;
  max-width: 100vw;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #FFFFFF;
  color: var(--ink);
  box-shadow: -12px 0 40px #23272B33;
  overflow: hidden;
  z-index: 21;
  translate: 100% 0;
  transition: translate 200ms ease-in;
}
.contact-dialog[open] { display: flex; flex-direction: column; }
.contact-dialog.is-open { translate: 0 0; transition: translate 280ms cubic-bezier(0.32, 0.72, 0, 1); }
/* The dimmed page behind the dialog. contact.js adds it. */
.contact-dim {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: #23272B8C;
  opacity: 0;
  visibility: hidden;
  transition: opacity 200ms, visibility 0s 200ms;
}
.contact-dim.is-open { opacity: 1; visibility: visible; transition: opacity 200ms; }

.contact-dialog__scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 48px 40px;
}
.contact-dialog__handle { display: none; }
.contact-dialog__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-shrink: 0;
  padding: 40px 48px 18px;
}
.contact-dialog__title { margin: 0; font: 400 44px/50px var(--display); }
.contact-dialog__close {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid #23272B33;
  border-radius: 2px;
  background: #FFFFFF;
  color: var(--ink);
  font: 600 14px/18px var(--sans);
  cursor: pointer;
}
@media (hover: hover) { .contact-dialog__close:hover { border-color: var(--ink); } }
.contact-dialog__call {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}
.contact-dialog__number {
  font: 700 28px/34px var(--sans);
  color: var(--green);
  text-decoration: none;
  white-space: nowrap;
}
.contact-dialog__hours { font-size: 15px; line-height: 20px; color: var(--muted); }
.contact-dialog__fade { display: none; }

@media (max-width: 799px) {
  /* The sheet rises from the bottom and stops 44px below the top of the screen. */
  .contact-dialog {
    inset: auto 0 0 0;
    top: auto;
    width: 100%;
    height: auto;
    max-height: calc(var(--sheet-space, 100dvh) - 44px);
    bottom: var(--sheet-bottom, 0px);
    border-radius: 14px 14px 0 0;
    box-shadow: none;
    translate: 0 100%;
    /* Closing keeps the opening curve, so a flick carries on at the finger's speed. */
    transition: translate 240ms cubic-bezier(0.32, 0.72, 0, 1);
  }
  .contact-dialog.is-open { transition: translate 320ms cubic-bezier(0.32, 0.72, 0, 1), height 320ms cubic-bezier(0.32, 0.72, 0, 1); }
  .contact-dialog.is-dragging { transition: none; }
  .contact-dialog__handle {
    display: block;
    flex-shrink: 0;
    width: 100%;
    padding: 10px 0 4px;
    border: 0;
    background: none;
    touch-action: none;
    cursor: grab;
  }
  .contact-dialog__handle::before {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    margin: 0 auto;
    border-radius: 2px;
    background: #23272B33;
  }
  .contact-dialog__top {
    align-items: center;
    padding: 4px 16px 14px;
    touch-action: none; /* the title row drags the sheet too (contact.js) */
    border-bottom: 1px solid transparent;
    transition: border-color 150ms;
  }
  .contact-dialog.is-scrolled .contact-dialog__top { border-bottom-color: var(--line); }
  .contact-dialog__title { font-size: 34px; line-height: 40px; }
  .contact-dialog__close { width: 44px; height: 44px; justify-content: center; padding: 0; }
  .contact-dialog__close-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .contact-dialog__close svg { width: 14px; height: 14px; }
  .contact-dialog__scroll { padding: 0 16px 32px; }
  /* The hours sit on their own line under the number. */
  .contact-dialog__call { flex-direction: column; align-items: flex-start; gap: 6px; padding: 4px 0 16px; margin-bottom: 14px; }
  .contact-dialog__number {
    font-size: 22px;
    line-height: 28px;
    text-decoration: underline 2px var(--green);
    text-underline-offset: 6px;
  }
  .contact-dialog__hours { font-size: 14px; line-height: 18px; }
  .contact-dialog__fade {
    display: block;
    position: absolute;
    inset: auto 0 0 0;
    height: 96px;
    background: linear-gradient(#FFFFFF00, #FFFFFF);
    pointer-events: none;
    opacity: 0;
    transition: opacity 150ms;
  }
  .contact-dialog.has-more .contact-dialog__fade { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .contact-dialog,
  .contact-dialog.is-open {
    translate: 0 0;
    opacity: 0;
    transition: opacity 150ms;
  }
  .contact-dialog.is-open { opacity: 1; }
  .contact-dim, .contact-dim.is-open { transition-duration: 150ms; }
  .contact-bar, .contact-bar.is-hidden { transition: none; }
  .quote-done { animation: none; }
}

/* ---- The quote form ---- */

.quote-intro { margin: 0 0 18px; font: 400 18px/26px var(--serif); }
.quote-form { position: relative; margin: 0; }
/* reCAPTCHA's own badge stays hidden, as on the live form; the note below names it. */
.quote-form .g-recaptcha { position: absolute; visibility: hidden; }
.quote-form fieldset { display: flex; flex-direction: column; gap: 18px; margin: 0; padding: 0; border: 0; min-width: 0; }
.quote-row { display: flex; gap: 14px; }
.quote-row > .quote-field { flex: 1 1 0; min-width: 0; }
.quote-field { display: flex; flex-direction: column; gap: 6px; }
.quote-field label { font: 600 14px/18px var(--sans); }
.quote-input {
  position: relative;
  display: flex;
  align-items: center;
}
.quote-input input,
.quote-input select,
.quote-input textarea {
  width: 100%;
  height: 48px;
  margin: 0;
  padding: 0 14px;
  border: 1px solid var(--field-edge);
  border-radius: 0;
  background: #FFFFFF;
  color: var(--ink);
  font: 400 16px/20px var(--sans);
  appearance: none;
}
.quote-input textarea { height: 112px; padding-block: 13px; resize: vertical; }
.quote-input select {
  padding-right: 40px;
  background: #FFFFFF url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2323272B' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 14px center;
  cursor: pointer;
}
.quote-input select:invalid,
.quote-input select.is-empty { color: var(--muted); }
.quote-input input:focus,
.quote-input select:focus,
.quote-input textarea:focus { outline: none; border-color: var(--ink); box-shadow: var(--ring); }
.quote-field.is-invalid input,
.quote-field.is-invalid textarea { border: 2px solid var(--ink); padding-right: 42px; }
.quote-field.is-invalid .quote-input::after {
  content: '';
  position: absolute;
  right: 14px;
  top: 15px;
  width: 18px;
  height: 18px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 18 18'%3E%3Ccircle cx='9' cy='9' r='8.2' fill='%2323272B'/%3E%3Crect x='8' y='4' width='2' height='6.5' fill='%23fff'/%3E%3Crect x='8' y='12' width='2' height='2' fill='%23fff'/%3E%3C/svg%3E");
  pointer-events: none;
}
.quote-error { display: none; margin: 0; font: 600 14px/20px var(--sans); }
.quote-field.is-invalid .quote-error:not(:empty) { display: block; }
/* Over Phone and Email: that either one will do. Under them: the error when both are left
   empty (contact.js). */
.quote-hint { margin: 0 0 -10px; font: 400 14px/20px var(--sans); color: var(--muted); }
.quote-pair-error:not(:empty) { display: block; margin-top: -10px; }

.quote-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 15px 24px;
  border: 0;
  border-radius: 2px;
  background: var(--ink);
  color: #FFFFFF;
  font: 700 16px/20px var(--sans);
  cursor: pointer;
}
@media (hover: hover) { .quote-submit:hover { background: #3A3F44; } }
/* In the white Contact us panel and sheet the send button is green, like Contact us. The
   page's own form keeps black, since it sits on the green band. */
.contact-dialog .quote-submit { background: var(--green); color: #000000; }
@media (hover: hover) { .contact-dialog .quote-submit:hover { background: var(--green-dark); } }
.quote-submit:focus-visible { outline: none; box-shadow: var(--ring); }
.quote-submit__spinner { display: none; width: 16px; height: 16px; animation: quote-spin 800ms linear infinite; }
.quote-form.is-sending .quote-submit { background: #4A4E52; cursor: default; }
.quote-form.is-sending .quote-submit__spinner { display: block; }
@keyframes quote-spin { to { rotate: 360deg; } }
@media (prefers-reduced-motion: reduce) { .quote-submit__spinner { animation-duration: 2400ms; } }

.quote-actions { display: flex; flex-direction: column; gap: 12px; padding-top: 4px; }
.quote-note { margin: 0; font-size: 13px; line-height: 18px; color: var(--muted); }

.quote-failed { display: none; gap: 10px; align-items: flex-start; margin: 0; font: 400 18px/26px var(--serif); }
.quote-failed svg { flex-shrink: 0; margin-top: 4px; }
.quote-failed a {
  font: 700 19px/26px var(--sans);
  text-decoration: underline 2px var(--green);
  text-underline-offset: 5px;
  white-space: nowrap;
}
.quote-form.is-failed .quote-failed { display: flex; }

.quote-done { animation: quote-fade 200ms ease-out; }
.quote-done h3 { margin: 0 0 18px; font: 400 32px/38px var(--display); }
.quote-done h3:focus { outline: none; }
.quote-done p { margin: 0; font: 400 18px/27px var(--serif); }
.quote-done .quote-done__call { margin-top: 16px; }
@keyframes quote-fade { from { opacity: 0; } }

@media (max-width: 799px) {
  .quote-intro { font-size: 17px; line-height: 25px; margin-bottom: 14px; }
  .quote-row { flex-direction: column; gap: 18px; }
  .quote-form fieldset { gap: 14px; }
  .quote-input textarea { height: 120px; }
  .quote-actions { padding-top: 6px; }
}
