/* TOP BAR (region x 5..1581, y 5..111) — pure-CSS refinements layered over styles.css. Tuned against ../Sample.png. */

/* ---------- bar body: warm dark→light metal (dark at the logo, flat/bright in the middle), no vertical fall-off ---------- */
.topbar {
  top: 5px; height: 107px;                       /* body runs to y=111 like the mockup */
  border-radius: 10px 10px 13px 13px;
  background:
    /* row y=5: top highlight — none at the logo end, strong in the middle (mockup's lit edge is tilted ~½px) */
    linear-gradient(90deg, rgba(255,255,255,0) 0 20.6%, rgba(255,255,255,.14) 23%, rgba(255,255,255,.2) 29%, rgba(255,255,255,.2) 33%,
      rgba(255,255,255,.3) 38%, rgba(255,255,255,.35) 41%, rgba(255,255,255,.43) 43.5%, rgba(255,255,255,.43) 79%, rgba(255,255,255,.2) 81.5%,
      rgba(255,255,255,.19) 84%, rgba(255,255,255,.3) 89%, rgba(255,255,255,.26) 92%, rgba(255,255,255,.45) 94%, rgba(255,255,255,.4) 97%, rgba(255,255,255,.35) 100%) 0 0 / 100% 1px no-repeat,
    var(--blotch) 20px 0 / 420px 420px,
    linear-gradient(90deg,
      #c2b39f 0%, #c5b6a2 1.6%, #c8bba8 2.9%, #cec1b1 5.4%, #cfc4b5 9.2%, #d1c7b7 13%,
      #d5cbbc 16.8%, #d9d0c2 20.6%, #e0d7ca 24.4%, #e5ddd1 28.2%, #e8e0d4 32%, #e9e2d6 35.9%,
      #ebe4d9 39.7%, #f0e9e0 43.5%, #f1eae0 47.3%, #f1eae0 79%, #ede6db 85.3%, #ece5da 91.7%,
      #eee7dc 98%, #ebe4d9 100%);
  background-blend-mode: normal, multiply, normal;
  box-shadow:
    inset -1px 0 0 #dfd9d0,                       /* lit right edge (x=1580) */
    inset -2px 0 0 #f1eee8,                       /* rim highlight (x=1579) */
    inset 1px 0 0 rgba(0,0,0,.28),                /* shaded left edge (x=5) */
    -1px 0 0 rgba(255,255,255,.10),               /* faint spill left/right of the bar */
    1px 0 0 rgba(255,255,255,.16);
}
.topbar::before {                                 /* grain + the bar's real top edge (row y=4: bright at the left, half-covered in the middle) */
  --grain-soft: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n' x='0' y='0'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.45  0 0 0 0 0.45  0 0 0 0 0.45  0 0 0 0.06 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  inset: -2px 0 -3px 0; opacity: 1; mix-blend-mode: normal;
  border-radius: 10px 10px 13px 13px;
  background:
    /* rows y=110/111: bottom rim — the bar's lower edge sits ~1px lower at the logo end (no rim there) */
    linear-gradient(90deg, rgba(0,0,0,0) 0 15.5%, rgba(0,0,0,.03) 19.4%, rgba(0,0,0,.18) 23%, rgba(0,0,0,.18) 42%, rgba(0,0,0,.16) 46%,
      rgba(0,0,0,.16) 54%, rgba(0,0,0,.2) 57.5%, rgba(0,0,0,.2) 69%, rgba(0,0,0,.11) 73%, rgba(0,0,0,.11) 76.5%, rgba(0,0,0,.09) 80%,
      rgba(0,0,0,.06) 84%, rgba(0,0,0,.06) 92%, rgba(0,0,0,.07) 95.5%, rgba(0,0,0,.2) 100%) 0 calc(100% - 4px) / 100% 1px no-repeat,
    linear-gradient(90deg, rgba(0,0,0,0) 0 15.5%, rgba(0,0,0,.23) 19.4%, rgba(0,0,0,.42) 23%, rgba(0,0,0,.42) 42%, rgba(0,0,0,.41) 46%,
      rgba(0,0,0,.41) 76.5%, rgba(0,0,0,.29) 80%, rgba(0,0,0,.2) 84%, rgba(0,0,0,.2) 92%, rgba(0,0,0,.24) 95.5%, rgba(0,0,0,.4) 100%) 0 calc(100% - 3px) / 100% 1px no-repeat,
    /* rows y=112..114: soft fall-off below the bar */
    linear-gradient(90deg, #4a4845 0, #6a6864 .5%, #6a6864 8%, #8a8783 11.7%, #8a8783 15.5%, #7e7c78 19.4%, #6c6a66 23%, #6c6a66 76.5%,
      #656461 80%, #6c6a66 88%, #7d7b77 95.5%, #3a3937 100%) 0 calc(100% - 2px) / 100% 1px no-repeat,
    linear-gradient(90deg, #141312 0, #1e1d1b .5%, #1e1d1b 15.5%, #6e6c68 19.4%, #4c4a47 23%, #4c4a47 76.5%, #2c2b29 80%, #2c2b29 95.5%, #1a1918 100%) 0 calc(100% - 1px) / 100% 1px no-repeat,
    linear-gradient(90deg, #1a1918 0, #373634 .5%, #373634 15.5%, #646260 19.4%, #525150 23%, #525150 76.5%, #2c2b29 80%, #2c2b29 95.5%, #1a1918 100%) 0 100% / 100% 1px no-repeat,
    /* row y=3: faint spill above the edge */
    linear-gradient(90deg, #060505 0, #201e1b .8%, #2e2b27 2.9%, #37342f 10.5%, #2e2b27 15.5%, #26231f 20.6%, #1f1d1a 29%,
      #1a1816 41%, #0d0c0b 43.5%, #0a0908 47%, #0a0908 79%, #1f1d1a 81.5%, #1a1816 92%, #0c0b0a 94%, #0a0908 100%) 0 0 / 100% 1px no-repeat,
    /* row y=4: the bar's real top edge (bright at the left, half-covered in the middle) */
    linear-gradient(90deg, #1a1816 0 .3%, #6f695f .5%, #d3c9ba .75%, #d3c9ba 2.9%, #ddd3c4 10.5%, #d3c9ba 15.5%, #d2c9bb 20.6%, #cdc4b6 23%, #cec5b7 29%,
      #c9c0b2 41%, #b0a89c 43.5%, #a89f93 47%, #a89f93 79%, #d3cabd 81.5%, #d9d0c3 84%, #d7cec1 89%, #d2c9bc 92%, #c0b7aa 94%,
      #b7aea2 97%, #c0b7aa 99.3%, #7a7369 99.5%, #1a1816 99.7% 100%) 0 1px / 100% 1px no-repeat,
    var(--grain-soft) 0 2px / 220px 220px;
  background-color: transparent;
}

/* ---------- engraved divider: dark groove + light lip on the right, y 28..93 ---------- */
.top-divider {
  right: 338px; top: 23px; width: 3px; height: 66px;
  background: linear-gradient(90deg, #c7beb1 0 1px, #dbd3c7 1px 2px, #f5f2ec 2px 3px);
  box-shadow: none;
}

/* ---------- "Get a quote": chamfered chrome plate, black glossy face, 4 rivets, cast shadow ---------- */
.btn-quote {
  right: 99px; top: 27px; width: 170px; height: 55px;   /* x 1312..1481, y 32..86 */
  border-radius: 7px;
  background: none;
  box-shadow:
    -3px 3px 4px -2px rgba(20,15,10,.55),
    0 5px 5px -4px rgba(20,15,10,.8),
    0 -2px 0 0 rgba(20,15,10,.09);
  z-index: 1;
}
/* chrome frame with 6px chamfered corners */
.btn-quote::before {
  content: ""; position: absolute; inset: 0; border-radius: 0;
  clip-path: polygon(6px 0, calc(100% - 6px) 0, 100% 6px, 100% calc(100% - 6px), calc(100% - 6px) 100%, 6px 100%, 0 calc(100% - 6px), 0 6px);
  background:
    /* chamfer corners: dark on the left (shadow side), bright chrome on the right */
    linear-gradient(135deg, #34322e 0 6.4px, #c2bdb5 6.4px 7.4px, transparent 7.4px),
    linear-gradient(45deg,  #d8d4cc 0 5.2px, #2a2825 5.2px 6.6px, #b0aba3 6.6px 7.4px, transparent 7.4px),
    linear-gradient(225deg, #f2f0ec 0 6.8px, #6a665f 6.8px 7.4px, transparent 7.4px),
    linear-gradient(315deg, #e9e7e2 0 5.6px, #3a3835 5.6px 7.4px, transparent 7.4px),
    /* top band: 2px bright, 1px mid */
    linear-gradient(180deg, #f7f5f1 0 2px, #8c877e 2px 3px, transparent 3px),
    /* left strip (in shadow) */
    linear-gradient(90deg, #5a5650 0 1px, #333230 1px 3px, #4c4944 3px 4px, #b6b1a9 4px 5px, #8a857d 5px 6px, #0c0c0b 6px 7px, transparent 7px),
    /* right strip (lit chrome) */
    linear-gradient(270deg, #a19d96 0 1px, #504d48 1px 2px, #aeaaa2 2px 3px, #97938c 3px 4px, transparent 4px),
    /* bottom strip */
    linear-gradient(0deg, #1d1d1b 0 1px, #2a2926 1px 2px, #48463f 2px 3px, #383632 3px 4px, #6f6c67 4px 5px, #4d4b47 5px 6px, transparent 6px),
    /* base: dark left corners → bright right corners */
    linear-gradient(90deg, #4a4742 0%, #6c6963 30%, #b8b4ad 70%, #dedbd5 100%);
  box-shadow: none;
}
.btn-quote::after {                       /* soft cast shadow directly below the plate (tight core + long faint tail) */
  content: ""; position: absolute; z-index: -1;
  left: 2px; width: 164px; top: 52px; height: 8px; border-radius: 4px;
  background: rgba(20,14,8,.5);
  box-shadow: 0 10px 8px 2px rgba(20,14,8,.18);   /* long faint tail */
  filter: blur(6px);
  clip-path: none;
}
/* black glossy face on the label span (inset inside the frame), rivets above it */
.btn-quote span {
  left: 7px; right: 4px; top: 3px; bottom: 6px;
  clip-path: polygon(4px 0, calc(100% - 3px) 0, 100% 3px, 100% calc(100% - 3px), calc(100% - 3px) 100%, 4px 100%, 0 calc(100% - 4px), 0 4px);
  background:
    radial-gradient(16px 17px at 50% 0%, rgba(255,255,255,.17), rgba(255,255,255,0) 100%),   /* specular spot */
    radial-gradient(44px 24px at 50% 0%, rgba(255,255,255,.06), rgba(255,255,255,0) 100%),
    linear-gradient(180deg, rgba(255,255,255,.04) 0, rgba(255,255,255,0) 4px),
    linear-gradient(90deg, rgba(255,255,255,.03) 0 45%, rgba(255,255,255,0) 60%),
    linear-gradient(90deg, rgba(0,0,0,.35) 0 1px, rgba(0,0,0,0) 1px),
    #1d1d1b;
  padding-top: 1px; padding-left: 0; padding-right: 1px;
}
.btn-quote .rv { z-index: 1; }
.btn-quote .rv-tl { left: 8px; top: 4px; }
.btn-quote .rv-tr { right: 4px; top: 4px; }
.btn-quote .rv-bl { left: 8px; bottom: 7px; }
.btn-quote .rv-br { right: 4px; bottom: 7px; }

/* logo weight: the mockup serif is a touch heavier */
.logo-name { -webkit-text-stroke: .35px #0a0a0a; }

/* nav word spacing: measured 3px drift of "Reverse Engineering" (-3) and "3D Printing" (+3) vs the mockup */
.topnav-list li:nth-child(2)::before { width: 23px; }
.topnav-list li:nth-child(3)::before { width: 17px; }
.topnav-list li:nth-child(5)::before { width: 17px; }
/* "COQUITLAM  BC": the double space is 3px wider in the mockup */
.topnav-loc { word-spacing: 1.5px; }

/* interaction states: the base uses .btn-quote::after as its hover overlay — that pseudo is now the cast shadow,
   so keep it fixed and move the hover/pressed feedback onto the face (span::after) */
.btn-quote:hover::after, .btn-quote:active::after {
  background: rgba(20,14,8,.5);
  box-shadow: 0 10px 8px 2px rgba(20,14,8,.18);
}
.btn-quote span::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: rgba(255,255,255,0); transition: background .15s, box-shadow .15s;
}
.btn-quote:hover span::after { background: rgba(255,255,255,.09); }
.btn-quote:active span::after {
  background: rgba(0,0,0,.14);
  box-shadow: inset 0 2px 5px rgba(0,0,0,.45), inset 0 -1px 0 rgba(255,255,255,.08);
}
.btn-quote:focus-visible {
  box-shadow:
    -3px 3px 4px -2px rgba(20,15,10,.55),
    0 5px 5px -4px rgba(20,15,10,.8),
    0 -2px 0 0 rgba(20,15,10,.09),
    0 0 0 4px rgba(184,115,51,.25);
}
/* optional ?skin=tex (baked mockup textures): keep this skin's CSS button parts out of the way there too */
.tex .btn-quote::after { display: none; }                      /* shadow blob is baked in the texture; keep span::after so hover works */
.tex .btn-quote span { background: none; clip-path: none; }

/* ?skin=tex guard: the photo texture already contains the bar — no blend, original height */
.tex .topbar { background-blend-mode: normal; height: 106px; }
.tex .topbar::before { display: none; }


/* ==== Get a quote: chamfer is the only silhouette ==== */
.btn-quote { box-shadow: none !important; border-radius: 0;
  filter: drop-shadow(0 1px 1px rgba(20,15,10,.55)) drop-shadow(-1px 2px 2px rgba(20,15,10,.35)) drop-shadow(0 7px 8px rgba(20,15,10,.22)); }
.btn-quote::after { display: none; }                      /* rectangular blur blob → replaced by the drop-shadow above */
/* thinner chamfer bevels (the solid corner wedges read as bright triangles) */
.btn-quote::before {
  background:
    linear-gradient(135deg, #34322e 0 1.2px, #9d988f 1.2px 2.6px, rgba(0,0,0,0) 2.6px),
    linear-gradient(45deg,  #d8d4cc 0 1.4px, #4a4743 1.4px 2.6px, rgba(0,0,0,0) 2.6px),
    linear-gradient(225deg, #f2f0ec 0 2.4px, #8a867f 2.4px 3.2px, rgba(0,0,0,0) 3.2px),
    linear-gradient(315deg, #e9e7e2 0 1.8px, #6a675f 1.8px 3px, rgba(0,0,0,0) 3px),
    linear-gradient(180deg, #f7f5f1 0 2px, #8c877e 2px 3px, transparent 3px),
    linear-gradient(90deg, #5a5650 0 1px, #333230 1px 3px, #4c4944 3px 4px, #b6b1a9 4px 5px, #8a857d 5px 6px, #0c0c0b 6px 7px, transparent 7px),
    linear-gradient(270deg, #a19d96 0 1px, #504d48 1px 2px, #aeaaa2 2px 3px, #97938c 3px 4px, transparent 4px),
    linear-gradient(0deg, #1d1d1b 0 1px, #2a2926 1px 2px, #48463f 2px 3px, #383632 3px 4px, #6f6c67 4px 5px, #4d4b47 5px 6px, transparent 6px),
    linear-gradient(90deg, #4a4742 0%, #6c6963 30%, #b8b4ad 70%, #dedbd5 100%);
}
.tex .btn-quote { filter: none; }

/* ==========================================================================
   Mail button: the 50x50 PNG was resolution-bound and blurred on any HiDPI
   screen. Rebuilt as inline SVG so it is resolution-independent, with the
   geometry measured off Sample.png (ring d=38.2 stroke 1.7; envelope 18x13.2
   with the flap apex 42% down) and the engraved two-tone ink of the original.
   ========================================================================== */
.btn-mail { right: 23px; top: 23px; width: 64px; height: 64px; }
.btn-mail .mail-svg {
  display: block; width: 100%; height: 100%; overflow: visible;
}
.btn-mail .mail-svg circle,
.btn-mail .mail-svg rect,
.btn-mail .mail-svg path {
  fill: none;
  stroke: #3b3733;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.btn-mail .mail-svg rect,
.btn-mail .mail-svg path { stroke-width: 1.42; }
/* engraved: a hairline light edge under the ink, exactly as the panel labels */
.btn-mail .mail-svg { filter: drop-shadow(0 0.6px 0 rgba(255,255,255,.5)); }
.btn-mail:hover .mail-svg circle,
.btn-mail:hover .mail-svg rect,
.btn-mail:hover .mail-svg path { stroke: #7a4520; }
