@layer reset, base, layout, components, utilities;

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  html { -webkit-text-size-adjust: 100%; }
  body, h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
  ul, ol { padding-left: 1.25rem; }
  img, svg { display: block; max-width: 100%; }
  img { height: auto; }
  input, select, textarea, button { font: inherit; color: inherit; }
}

@layer base {
  :root {
    --ink: #141B2C;
    --paper: #FBF9FE;
    --blue: #0A58B6;
    --blue-deep: #08498F;
    --lilac: #E8E6F8;
    --olive: #686138;
    --white: #FFFFFF;
    --muted: #4A5163;
    --head: "Archivo", "Helvetica Neue", Arial, sans-serif;
    --body: "Sarabun", "Segoe UI", Tahoma, sans-serif;
    --gap: clamp(1rem, 2.4vw, 1.6rem);
    --frame: 1080px;
  }
  html { scroll-behavior: smooth; }
  body {
    background: var(--paper);
    color: var(--ink);
    font-family: var(--body);
    font-size: 1.075rem;
    line-height: 1.65;
    overflow-wrap: break-word;
  }
  h1, h2, h3 { font-family: var(--head); line-height: 1.15; letter-spacing: -0.01em; }
  h1 { font-size: clamp(2rem, 4.6vw, 3.1rem); font-weight: 700; }
  h2 { font-size: clamp(1.5rem, 3vw, 2.05rem); font-weight: 700; max-width: 30ch; }
  h3 { font-size: 1.18rem; font-weight: 600; }
  a { color: var(--blue); text-underline-offset: 0.18em; }
  a:hover { color: var(--blue-deep); }
  :focus-visible { outline: 3px solid var(--olive); outline-offset: 2px; }
}

@layer layout {
  .bo-frame { width: 100%; max-width: var(--frame); margin-inline: auto; padding-inline: 1.25rem; }
  .bo-stack { display: flex; flex-direction: column; gap: var(--gap); }
  .bo-stack > * { margin: 0; }
  .bo-cluster { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
  .bo-sidebar { display: flex; flex-wrap: wrap; gap: clamp(1.5rem, 4vw, 3rem); align-items: flex-start; }
  .bo-sidebar > :first-child { flex: 999 1 26rem; min-width: 0; }
  .bo-sidebar > :last-child { flex: 1 1 18rem; min-width: 0; }
  .bo-sidebar-flip > :last-child { flex-basis: 20rem; }
  .bo-sidebar-wide > :first-child { flex-basis: 34rem; }
  .bo-switcher { display: flex; flex-wrap: wrap; gap: var(--gap); }
  .bo-switcher > * { flex-grow: 1; flex-basis: calc((44rem - 100%) * 999); min-width: 0; }
  .bo-switcher-cards > * { flex-basis: calc((52rem - 100%) * 999); }
  .bo-switcher-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }
  .bo-switcher-two > * { flex-basis: calc((38rem - 100%) * 999); }
  .bo-measure { max-width: 68ch; }
}

@layer components {
  .bo-skip { position: absolute; left: -9999px; top: 0; background: var(--ink); color: var(--white); padding: 0.5rem 1rem; z-index: 100; }
  .bo-skip:focus { left: 1rem; }

  /* header: logo, phone, Menu drawer at every width */
  .bo-ceiling { background: var(--paper); border-bottom: 4px solid var(--ink); position: relative; }
  .bo-ceiling-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 0.7rem; }
  .bo-sign { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--ink); min-width: 0; }
  .bo-sign-mark { flex: none; width: 36px; height: 36px; }
  .bo-sign-board { fill: var(--blue); }
  .bo-sign-patch { fill: var(--paper); }
  .bo-sign-x { stroke: var(--olive); stroke-width: 2; fill: none; }
  .bo-sign-words { display: flex; flex-direction: column; line-height: 1.05; font-family: var(--head); }
  .bo-sign-town { font-weight: 700; font-size: 1rem; }
  .bo-sign-trade { font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--blue); }
  .bo-ceiling-tools { display: flex; align-items: center; gap: 0.9rem; }
  .bo-ring { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
  .bo-ring-num { display: inline-flex; align-items: center; gap: 0.35rem; font-family: var(--head); font-weight: 700; color: var(--ink); text-decoration: none; white-space: nowrap; }
  .bo-ring-num .bo-glyph { width: 18px; height: 18px; fill: var(--blue); }
  .bo-ring-hours { font-size: 0.82rem; color: var(--muted); }
  .bo-hatch-pull {
    list-style: none; cursor: pointer; font-family: var(--head); font-weight: 600;
    border: 2px solid var(--ink); padding: 0.4rem 0.95rem; position: relative; z-index: 61; background: var(--paper);
  }
  .bo-hatch-pull::-webkit-details-marker { display: none; }
  .bo-hatch-shut { display: none; }
  .bo-hatch[open] .bo-hatch-shut { display: inline; }
  .bo-hatch[open] .bo-hatch-open { display: none; }
  .bo-hall {
    position: fixed; top: 0; right: 0; bottom: 0; width: min(380px, 100vw); z-index: 60;
    background: var(--ink); color: var(--white); padding: 5rem 2rem 2rem; overflow-y: auto;
    box-shadow: -12px 0 0 var(--blue);
  }
  .bo-hall-head { text-transform: uppercase; letter-spacing: 0.16em; font-size: 0.78rem; color: var(--lilac); margin-bottom: 1rem; }
  .bo-hall-list { list-style: none; padding: 0; display: flex; flex-direction: column; }
  .bo-hall-list a { display: block; padding: 0.7rem 0; color: var(--white); text-decoration: none; font-family: var(--head); font-size: 1.15rem; border-bottom: 1px solid rgba(255,255,255,0.18); }
  .bo-hall-list a:hover { color: var(--lilac); }

  /* hero with angled photo edge */
  .bo-porch { background: var(--blue); color: var(--white); overflow: hidden; }
  .bo-porch-row { display: flex; flex-wrap: wrap; align-items: stretch; padding-inline: 0; }
  .bo-porch-copy { flex: 1 1 32rem; min-width: 0; padding: clamp(2rem, 5vw, 3.5rem) 1.25rem; }
  .bo-porch-copy h1 { color: var(--white); }
  .bo-porch-line { font-size: 1.15rem; max-width: 46ch; }
  .bo-porch-photo { flex: 1 1 24rem; min-width: 0; position: relative; min-height: 18rem; }
  .bo-porch-img {
    position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
    clip-path: polygon(24% 0, 100% 0, 100% calc(100% - 44px), calc(100% - 44px) 100%, 0 100%);
  }
  .bo-porch-form { background: var(--paper); color: var(--ink); padding: 1.25rem; border-top: 6px solid var(--olive); }
  .bo-hours { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 600; }
  .bo-hours .bo-glyph { width: 20px; height: 20px; fill: currentColor; }
  .bo-hours-ink { color: var(--ink); }

  /* buttons */
  .bo-door {
    display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.8rem 1.25rem; min-height: 48px;
    font-family: var(--head); font-weight: 700; text-decoration: none; border: 2px solid transparent; cursor: pointer;
  }
  .bo-door .bo-glyph { width: 20px; height: 20px; fill: currentColor; }
  .bo-door-light { background: var(--white); color: var(--blue); }
  .bo-door-light:hover { background: var(--lilac); color: var(--blue-deep); }
  .bo-door-ghost { border-color: currentColor; color: inherit; background: transparent; }
  .bo-door-ghost:hover { background: rgba(255,255,255,0.12); color: inherit; }
  .bo-door-ink { color: var(--ink); }
  .bo-door-solid { background: var(--blue); color: var(--white); }
  .bo-door-solid:hover { background: var(--blue-deep); color: var(--white); }
  .bo-final .bo-door-ghost { color: var(--ink); }
  .bo-micro { font-size: 0.92rem; color: var(--muted); max-width: 60ch; }
  .bo-micro-light { color: var(--lilac); }
  .bo-consent { font-size: 0.88rem; color: var(--muted); margin-top: 0.6rem; }

  /* forms */
  .bo-latch-head { font-family: var(--head); font-weight: 700; font-size: 1.1rem; margin-bottom: 0.6rem; }
  .bo-latch-fields { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 0.9rem; }
  .bo-field { display: flex; flex-direction: column; gap: 0.25rem; flex: 1 1 12rem; font-weight: 600; font-size: 0.95rem; }
  .bo-field-wide { flex-basis: 100%; }
  .bo-field input, .bo-field select, .bo-field textarea {
    width: 100%; border: 2px solid #9EA3B8; background: var(--white); padding: 0.65rem 0.75rem; font-weight: 400; border-radius: 0;
  }
  .bo-field input:focus, .bo-field select:focus, .bo-field textarea:focus { border-color: var(--blue); outline: none; }

  /* sections: heavy rules + kicker labels */
  .bo-room { border-top: 10px solid var(--ink); padding-block: clamp(2.5rem, 6vw, 4.5rem); }
  .bo-room-tint { background: var(--lilac); }
  .bo-room-head { border-top: 0; padding-bottom: 1.5rem; }
  .bo-room-flat { border-top: 4px solid var(--ink); }
  .bo-porch + .bo-room { border-top-color: var(--olive); }
  .bo-kicker {
    display: inline-flex; align-items: center; gap: 0.4rem; align-self: flex-start;
    font-family: var(--head); font-weight: 700; font-size: 0.78rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--olive);
  }
  .bo-kicker .bo-glyph { width: 16px; height: 16px; fill: currentColor; }
  .bo-kicker-light { color: var(--lilac); }
  .bo-lede { font-size: 1.2rem; }

  /* cards with coloured header band */
  .bo-panel { background: var(--white); border: 2px solid var(--blue); display: flex; flex-direction: column; }
  .bo-panel-band {
    background: var(--blue); color: var(--white); padding: 0.75rem 1rem; display: flex; align-items: center; gap: 0.55rem;
    font-size: 1.1rem; max-width: none;
  }
  .bo-panel-body { padding: 1rem; display: flex; flex-direction: column; gap: 0.75rem; flex: 1; }
  .bo-panel-foot { margin-top: auto; }
  .bo-panel-solo { max-width: 44rem; }
  .bo-glyph { width: 22px; height: 22px; flex: none; fill: var(--blue); }
  .bo-glyph-light { fill: var(--white); }
  .bo-glyph-accent { fill: var(--olive); }
  .bo-glyph-sm { width: 18px; height: 18px; fill: currentColor; }
  .bo-glyph-big { width: 56px; height: 56px; fill: var(--blue); }
  .bo-arrowlink { display: inline-flex; align-items: center; gap: 0.35rem; font-weight: 600; }
  .bo-textlink { font-weight: 600; }

  .bo-note h3 { margin-bottom: 0.35rem; padding-left: 0.75rem; border-left: 5px solid var(--olive); }
  .bo-tally { background: var(--white); border-top: 6px solid var(--blue); padding: 1.1rem 1.25rem; }
  .bo-tally h3 { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.6rem; }
  .bo-tally li + li { margin-top: 0.4rem; }

  .bo-ledger { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); gap: 0.9rem 1.6rem; }
  .bo-ledger > div { border-top: 3px solid var(--ink); padding-top: 0.6rem; }
  .bo-ledger dt { font-family: var(--head); font-weight: 700; }

  .bo-shot { margin: 0; }
  .bo-pane { width: 100%; clip-path: polygon(0 0, calc(100% - 52px) 0, 100% 52px, 100% 100%, 0 100%); }
  .bo-shot figcaption { font-size: 0.9rem; color: var(--muted); margin-top: 0.5rem; }
  .bo-shot-wide { max-width: 100%; }

  .bo-townlist { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 0.45rem; }
  .bo-plan-wrap { background: var(--paper); border: 2px solid var(--ink); padding: 0.5rem; }
  .bo-sidebar > .bo-plan-wrap { flex-basis: 27rem; }
  .bo-plan-wrap-big { max-width: 46rem; }
  .bo-plan { width: 100%; height: auto; }
  .bo-plan-tie { stroke: var(--blue); stroke-width: 1.5; stroke-dasharray: 4 5; opacity: 0.55; }
  .bo-plan-dot { fill: var(--olive); }
  .bo-plan-home { fill: var(--blue); }
  .bo-plan-leader { stroke: var(--blue); stroke-width: 1.5; }
  .bo-plan-name { font-family: var(--body); font-size: 15px; font-weight: 600; fill: var(--ink); }
  .bo-plan-name-home { font-family: var(--head); font-size: 17px; fill: var(--blue); }
  .bo-plan-north path { fill: var(--ink); }
  .bo-plan-north text { font-family: var(--head); font-size: 13px; fill: var(--ink); }

  .bo-teaser { display: flex; gap: 1.25rem; align-items: flex-start; max-width: 52rem; }

  /* service page parts */
  .bo-copy { min-width: 0; }
  .bo-chunk { padding-top: 1.6rem; border-top: 6px solid var(--ink); }
  .bo-chunk h2 { font-size: clamp(1.35rem, 2.6vw, 1.75rem); }
  .bo-flag { display: flex; gap: 0.8rem; background: var(--lilac); border-left: 8px solid var(--olive); padding: 1rem 1.2rem; }
  .bo-flag-title { font-family: var(--head); font-weight: 700; margin-bottom: 0.3rem; }
  .bo-run li + li { margin-top: 0.5rem; }
  .bo-run-links { list-style: square; }
  .bo-tablewrap { overflow-x: auto; }
  .bo-grid { border-collapse: collapse; width: 100%; min-width: 30rem; background: var(--white); }
  .bo-grid th { background: var(--blue); color: var(--white); text-align: left; font-family: var(--head); padding: 0.6rem 0.8rem; }
  .bo-grid td { border-bottom: 1px solid #C9C6DE; padding: 0.6rem 0.8rem; vertical-align: top; }
  .bo-ask { border-bottom: 2px solid var(--ink); padding-block: 0.6rem; }
  .bo-ask summary { cursor: pointer; font-weight: 600; font-family: var(--head); }
  .bo-ask p { margin-top: 0.5rem; }
  .bo-post { background: var(--white); border: 2px solid var(--ink); border-top: 10px solid var(--blue); padding: 1.25rem; position: sticky; top: 1rem; }
  .bo-post-head { font-family: var(--head); font-weight: 700; font-size: 1.2rem; }
  .bo-post-phone a { display: inline-flex; align-items: center; gap: 0.4rem; font-family: var(--head); font-weight: 700; font-size: 1.35rem; text-decoration: none; }
  .bo-post-phone .bo-glyph { fill: currentColor; }

  .bo-steps { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: var(--gap); }
  .bo-step { display: flex; gap: 0.8rem; align-items: flex-start; border-top: 4px solid var(--blue); padding-top: 0.8rem; }
  .bo-step-num { flex: none; width: 2.2rem; height: 2.2rem; display: grid; place-items: center; background: var(--olive); color: var(--white); font-family: var(--head); font-weight: 700; }
  .bo-step h3 { margin-bottom: 0.3rem; }

  .bo-qa { border-left: 4px solid var(--blue); padding-left: 1rem; max-width: 70ch; }
  .bo-qa-q { font-family: var(--head); font-weight: 700; margin-bottom: 0.25rem; }
  .bo-jump { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
  .bo-jump a { display: inline-block; border: 2px solid var(--blue); padding: 0.3rem 0.8rem; text-decoration: none; font-weight: 600; }

  /* footer */
  .bo-sill { background: var(--ink); color: #D8DAE6; border-top: 10px solid var(--blue); padding-top: 2.5rem; font-size: 0.95rem; }
  .bo-sill a { color: var(--white); }
  .bo-sill-row { display: flex; flex-wrap: wrap; gap: 2rem; }
  .bo-sill-left { flex: 1 1 18rem; gap: 0.7rem; }
  .bo-sill-right { flex: 1 1 22rem; }
  .bo-sill-brand { font-family: var(--head); font-weight: 700; font-size: 1.15rem; color: var(--white); }
  .bo-sill-tag { color: var(--lilac); font-style: italic; }
  .bo-sill-head { font-family: var(--head); font-weight: 700; color: var(--white); margin-bottom: 0.6rem; }
  .bo-sill-cols { display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; }
  .bo-sill-cols ul { list-style: none; padding: 0; flex: 1 1 10rem; display: flex; flex-direction: column; gap: 0.35rem; }
  .bo-sill-base { border-top: 1px solid rgba(255,255,255,0.2); margin-top: 2rem; padding-block: 1.2rem 1.5rem; display: flex; flex-direction: column; gap: 0.4rem; font-size: 0.95rem; }

  /* mobile call bar */
  .bo-stoop { display: none; }
}

@layer utilities {
  @media (max-width: 767px) {
    body { padding-bottom: 4.25rem; }
    .bo-stoop {
      display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: var(--ink);
      border-top: 3px solid var(--blue);
    }
    .bo-stoop a {
      flex: 1 1 50%; display: flex; align-items: center; justify-content: center; gap: 0.4rem; min-height: 3.5rem;
      color: var(--white); text-decoration: none; font-family: var(--head); font-weight: 700; font-size: 0.95rem;
    }
    .bo-stoop .bo-glyph { width: 20px; height: 20px; fill: currentColor; }
    .bo-stoop-call { background: var(--blue); }
    .bo-ring-hours { display: none; }
    .bo-sign-town { font-size: 0.88rem; }
    .bo-sign-trade { font-size: 0.68rem; }
    .bo-sign-mark { width: 30px; height: 30px; }
    .bo-ring-num { font-size: 0.92rem; }
    .bo-ring-num .bo-glyph { display: none; }
    .bo-hatch-pull { padding: 0.35rem 0.6rem; font-size: 0.92rem; }
    .bo-ceiling-tools { gap: 0.5rem; }
    .bo-porch-photo { flex-basis: 100%; min-height: 0; height: 17rem; }
    .bo-porch-img { clip-path: polygon(0 20%, 100% 0, 100% 100%, 0 100%); object-position: center 40%; }
    .bo-post { position: static; }
    .bo-teaser { flex-direction: column; }
  }
  @media (max-width: 400px) {
    .bo-sign-words { display: none; }
  }
}
