/* Taylor Group Plumbing — site styles that sit beside the compiled Tailwind file. */

@font-face { font-family: 'Bricolage Grotesque'; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url('../fonts/bricolage-grotesque-latin-wght-normal.woff2') format('woff2'); }
@font-face { font-family: 'Figtree'; font-style: normal; font-weight: 300 900; font-display: swap;
  src: url('../fonts/figtree-latin-wght-normal.woff2') format('woff2'); }

:root { --header-h: 84px; }
@media (max-width: 1023px) { :root { --header-h: 72px; } }

/* ---------- Accessibility basics ---------- */
.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 200; padding: .75rem 1.25rem; border-radius: .75rem;
  background: #fff; color: #182888; font-weight: 700; box-shadow: 0 6px 24px rgba(0,0,0,.3); transition: top .15s; }
.skip-link:focus { top: 1rem; }
:focus-visible { outline: 3px solid #ffb703; outline-offset: 3px; border-radius: 6px; }
html[data-theme='dark'] :focus-visible { outline-color: #ffd166; }
.sr-only-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hp-field { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
a, button, summary, input, select, textarea { touch-action: manipulation; }

/* ---------- Header ---------- */
.site-header { position: fixed; inset: 0 0 auto 0; z-index: 90; height: var(--header-h); color: #fff;
  background: transparent; transition: background-color .3s, box-shadow .3s, height .3s; }
.site-header a:not([class*='btn-']) { color: inherit; }
.site-header.is-solid { background: rgb(var(--brand)); box-shadow: 0 8px 28px -12px rgba(0,0,0,.45); }
html[data-theme='dark'] .site-header.is-solid { background: #101a52; }
.site-header .logo-img { height: calc(var(--header-h) - 14px); width: auto; transition: transform .3s; filter: drop-shadow(0 4px 10px rgba(0,0,0,.35)); }
.site-header.is-solid .logo-img { height: calc(var(--header-h) - 22px); }
.nav-link { display: inline-flex; align-items: center; gap: .3rem; min-height: 44px; padding: .4rem .8rem; border-radius: 9999px;
  font-weight: 600; font-size: .95rem; transition: background-color .2s; }
.nav-link:hover, .nav-link[aria-expanded='true'], .nav-link[aria-current='page'] { background: rgba(255,255,255,.16); }
.nav-link[aria-current='page'] { box-shadow: inset 0 -2px 0 #ff7d9c; }

.mega { position: absolute; left: 50%; top: calc(100% - 6px); width: min(1040px, 94vw); transform: translate(-50%, 8px);
  opacity: 0; visibility: hidden; transition: opacity .2s, transform .2s, visibility .2s; color: rgb(var(--ink));
  background: rgb(var(--surface)); border: 1px solid rgb(var(--line)); border-radius: 1.25rem; box-shadow: 0 30px 70px -20px rgba(15,22,51,.55); padding: 1.25rem; }
.mega a { color: rgb(var(--ink)); }
.has-menu.is-open > .mega, .has-menu:focus-within > .mega { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.has-menu.is-open > .mega { pointer-events: auto; }
.mega-link { display: flex; align-items: center; gap: .6rem; padding: .45rem .6rem; border-radius: .6rem; font-size: .92rem; font-weight: 500; min-height: 40px; }
.mega-link:hover { background: rgb(var(--surface2)); color: rgb(var(--brand-text)); }
.dropdown { position: absolute; left: 0; top: calc(100% - 6px); min-width: 260px; opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .2s, transform .2s, visibility .2s; color: rgb(var(--ink)); background: rgb(var(--surface));
  border: 1px solid rgb(var(--line)); border-radius: 1rem; box-shadow: 0 30px 70px -20px rgba(15,22,51,.55); padding: .5rem; }
.dropdown a { color: rgb(var(--ink)); }
.has-menu.is-open > .dropdown, .has-menu:focus-within > .dropdown { opacity: 1; visibility: visible; transform: none; }

.drawer { position: fixed; inset: 0; z-index: 120; visibility: hidden; }
.drawer.is-open { visibility: visible; }
.drawer-bg { position: absolute; inset: 0; background: rgba(0,0,0,.5); opacity: 0; transition: opacity .25s; }
.drawer.is-open .drawer-bg { opacity: 1; }
.drawer-panel { position: absolute; right: 0; top: 0; height: 100%; width: min(92vw, 380px); overflow-y: auto; background: rgb(var(--surface));
  color: rgb(var(--ink)); transform: translateX(100%); transition: transform .3s ease; padding: 1rem 1.25rem 2rem; }
.drawer.is-open .drawer-panel { transform: none; }

/* ---------- Hero (home + inner banners) ---------- */
.hero { position: relative; isolation: isolate; overflow: hidden; color: #fff; background: #182888; }
.hero--home { height: 100svh; min-height: 620px; display: flex; flex-direction: column; }
.hero-photo { position: absolute; inset: 0; z-index: -3; }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.hero-shade { position: absolute; inset: 0; z-index: -2; background: rgb(0 0 0 / .5); }      /* solid 50% black — no gradient */
.hero-pipes { position: absolute; inset: 0; z-index: -2; }
.hero canvas.fx { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.hero h1, .hero h2, .hero p, .hero li { color: #fff; }
.hero a:not([class*='btn-']) { color: #fff; }
.hero--inner { padding-top: calc(var(--header-h) + 1.25rem); padding-bottom: 1.75rem; }
.crumbs { color: rgba(255,255,255,.9); }
.crumbs a { color: #fff; }

/* animated pipe lines (SVG stroke-dash flow) */
.pipe { fill: none; stroke: rgba(255,255,255,.35); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 6 14; animation: flow 3.2s linear infinite; }
.pipe.slow { animation-duration: 6s; stroke: rgba(255,125,156,.55); }
@keyframes flow { to { stroke-dashoffset: -200; } }

/* 3D tilt deck */
.tilt-scene { perspective: 1100px; }
.tilt { transform-style: preserve-3d; transition: transform .25s ease-out; will-change: transform; }
.tilt > .layer { transform: translateZ(var(--z, 0px)); }
.glass { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.3); backdrop-filter: blur(8px); border-radius: 1.25rem; }
.ring-pulse { position: relative; }
.ring-pulse::after { content: ''; position: absolute; inset: -6px; border-radius: 9999px; border: 2px solid #ff7d9c; animation: pulse 2s ease-out infinite; }
@keyframes pulse { 0% { transform: scale(.9); opacity: .9; } 100% { transform: scale(1.35); opacity: 0; } }

/* marquee */
.marquee { overflow: hidden; }
.marquee-track { display: flex; width: max-content; gap: 2.5rem; animation: marquee 38s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* scroll reveal */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s ease; transition-delay: var(--d, 0s); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* service / area cards with soft 3D lift */
.lift { transition: transform .25s ease, box-shadow .25s ease, border-color .25s; }
.lift:hover, .lift:focus-within { transform: translateY(-4px); box-shadow: 0 22px 50px -18px rgb(24 40 136 / .45); border-color: rgb(var(--brand-text) / .5); }
.icon-tile { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: .9rem; background: rgb(var(--brand)); color: #fff; flex: none; }
.lift:hover .icon-tile { background: rgb(var(--accent)); }

/* scroll progress "pipe gauge" */
.gauge { position: fixed; left: 0; top: 0; height: 4px; width: 100%; z-index: 150; background: transparent; pointer-events: none; }
.gauge i { display: block; height: 100%; width: 100%; transform-origin: left; transform: scaleX(0); background: #ff7d9c; }

/* FAQ */
details.faq { border: 1px solid rgb(var(--line)); border-radius: 1rem; background: rgb(var(--surface)); }
details.faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .9rem 1.1rem; min-height: 48px; font-weight: 700; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq[open] summary { color: rgb(var(--brand-text)); }
details.faq[open] .chev { transform: rotate(180deg); }
.chev { transition: transform .2s; flex: none; }

/* video facade */
.video-facade { position: relative; display: block; width: 100%; aspect-ratio: 16/9; border-radius: 1.25rem; overflow: hidden; background: #0b1020; cursor: pointer; border: 0; padding: 0; }
.video-facade img { width: 100%; height: 100%; object-fit: cover; }
.video-facade .play { position: absolute; inset: 0; display: grid; place-items: center; background: rgb(0 0 0 / .35); }
.video-facade .play span { display: grid; place-items: center; width: 76px; height: 76px; border-radius: 9999px; background: rgb(var(--accent)); color: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.4); transition: transform .2s; }
.video-facade:hover .play span { transform: scale(1.08); }
iframe.embed { width: 100%; aspect-ratio: 16/9; border: 0; border-radius: 1.25rem; }

/* ---------- Floating widgets ---------- */
.fab { position: fixed; z-index: 140; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 9999px; border: 2px solid #fff;
  background: #182888; color: #fff; box-shadow: 0 10px 28px -8px rgba(0,0,0,.6); transition: transform .2s, background-color .2s; cursor: pointer; }
.fab:hover { transform: translateY(-3px) scale(1.05); }
.fab.accent { background: #c2335c; }
.fab-ada { left: 14px; bottom: 14px; }
.fab-theme { left: 74px; bottom: 14px; background: #101a52; }
.fab-chat { right: 14px; bottom: 14px; width: 58px; height: 58px; background: #c2335c; }
.fab-top { right: 14px; bottom: 84px; width: 46px; height: 46px; opacity: 0; visibility: hidden; transform: translateY(10px); }
.fab-top.show { opacity: 1; visibility: visible; transform: none; }

.panel { position: fixed; z-index: 160; background: rgb(var(--surface)); color: rgb(var(--ink)); border: 1px solid rgb(var(--line)); border-radius: 1.25rem;
  box-shadow: 0 30px 70px -20px rgba(15,22,51,.6); }
.ada-panel { left: 14px; bottom: 78px; width: min(92vw, 340px); padding: 1rem; }
.ada-panel[hidden], .chat-panel[hidden] { display: none; }
.ada-btn { display: flex; align-items: center; gap: .5rem; width: 100%; min-height: 44px; padding: .5rem .75rem; border-radius: .75rem; border: 1px solid rgb(var(--line));
  background: rgb(var(--surface2)); font-weight: 600; font-size: .92rem; text-align: left; color: rgb(var(--ink)); cursor: pointer; }
.ada-btn[aria-pressed='true'] { background: rgb(var(--brand)); color: #fff; border-color: rgb(var(--brand)); }

.chat-panel { right: 14px; bottom: 84px; width: min(94vw, 380px); height: min(70vh, 540px); display: flex; flex-direction: column; overflow: hidden; }
.chat-head { background: #182888; color: #fff; padding: .85rem 1rem; display: flex; align-items: center; gap: .6rem; }
.chat-log { flex: 1; overflow-y: auto; padding: .9rem; display: flex; flex-direction: column; gap: .6rem; background: rgb(var(--bg)); }
.msg { max-width: 88%; padding: .6rem .85rem; border-radius: 1rem; font-size: .95rem; line-height: 1.45; }
.msg.bot { background: rgb(var(--surface)); border: 1px solid rgb(var(--line)); align-self: flex-start; border-bottom-left-radius: .3rem; }
.msg.me { background: #182888; color: #fff; align-self: flex-end; border-bottom-right-radius: .3rem; }
.msg a { font-weight: 700; text-decoration: underline; }
.quick { display: flex; flex-wrap: wrap; gap: .4rem; }
.quick button, .quick a { min-height: 36px; padding: .3rem .75rem; border-radius: 9999px; border: 1px solid rgb(var(--brand-text)); background: transparent; color: rgb(var(--brand-text)); font-size: .85rem; font-weight: 600; cursor: pointer; }
.quick button:hover, .quick a:hover { background: rgb(var(--brand)); color: #fff; }
.chat-form { display: flex; gap: .5rem; padding: .6rem; border-top: 1px solid rgb(var(--line)); background: rgb(var(--surface)); }
.typing span { display: inline-block; width: 6px; height: 6px; margin: 0 1.5px; border-radius: 50%; background: rgb(var(--muted)); animation: blink 1s infinite; }
.typing span:nth-child(2) { animation-delay: .15s; } .typing span:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

/* ---------- Accessibility modes (set on <html> by the panel) ---------- */
html.a11y-contrast { --bg: 0 0 0; --surface: 0 0 0; --surface2: 20 20 20; --ink: 255 255 255; --muted: 255 255 255; --line: 255 255 255; --brand-text: 255 235 59; --accent-text: 255 235 59; }
html.a11y-contrast .btn-primary, html.a11y-contrast .btn-brand { background: #ffeb3b; color: #000; }
html.a11y-contrast .site-header.is-solid { background: #000; border-bottom: 2px solid #fff; }
html.a11y-underline a { text-decoration: underline !important; text-underline-offset: 3px; }
html.a11y-readable body, html.a11y-readable h1, html.a11y-readable h2, html.a11y-readable h3, html.a11y-readable h4 { font-family: Verdana, Arial, sans-serif !important; letter-spacing: .02em; }
html.a11y-spacing body { line-height: 1.95; word-spacing: .12em; }
html.a11y-pause *, html.a11y-pause *::before, html.a11y-pause *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
html.a11y-pause .js .reveal { opacity: 1; transform: none; }
html.a11y-pause canvas.fx { display: none; }
html.a11y-cursor, html.a11y-cursor * { cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='40' height='40'><path d='M4 2l28 14-12 4-4 12z' fill='black' stroke='white' stroke-width='2'/></svg>") 4 2, auto !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; transform: none; }
  canvas.fx { display: none; }
}
@media print {
  .site-header, .fab, .panel, .gauge, .drawer, canvas.fx { display: none !important; }
  .hero { background: none; color: #000; }
}

/* keep decorative pipes subtle so text is never crossed by a bright line */
.hero--inner .pipe { stroke: rgba(255,255,255,.09); }
.hero--inner .pipe.slow { stroke: rgba(255,125,156,.14); }
.hero--home .pipe { stroke: rgba(255,255,255,.13); }
.hero--home .pipe.slow { stroke: rgba(255,125,156,.2); }

/* Equal-height photos everywhere: one fixed ratio, cropped to fit */
.media-frame { aspect-ratio: 16 / 10; width: 100%; overflow: hidden; border-radius: .85rem; box-shadow: 0 6px 20px -10px rgb(0 0 0 / .35); }
.media-frame picture { display: block; width: 100%; height: 100%; }
.media-frame img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; }

/* ---- animated footer: sliding waves, faint flowing pipes, rising bubbles, hover motion (CSS only, pauses with reduced motion) ---- */
.site-footer { position: relative; margin-top: 40px; }
.site-footer > div:not(.foot-fx) { position: relative; z-index: 1; }
.foot-wave { position: absolute; left: 0; top: -39px; width: 100%; height: 40px; overflow: hidden; pointer-events: none; }
.foot-wave g { animation: wave-slide 14s linear infinite; }
.foot-wave .wave-a { animation-duration: 22s; animation-direction: reverse; }
@keyframes wave-slide { to { transform: translateX(-720px); } }
.foot-fx { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.foot-fx .hero-pipes { z-index: 0; }
.foot-fx .pipe { stroke: rgba(255,255,255,.07); }
.foot-fx .pipe.slow { stroke: rgba(255,125,156,.12); }
.foot-fx .bubble { position: absolute; bottom: -20px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.35); background: rgba(255,255,255,.06); animation: bubble-rise linear infinite; }
@keyframes bubble-rise { 0% { transform: translateY(0) translateX(0); opacity: 0; } 12% { opacity: .9; } 50% { transform: translateY(-160px) translateX(10px); } 100% { transform: translateY(-340px) translateX(-8px); opacity: 0; } }
.site-footer li a { transition: transform .2s ease; }
.site-footer li a:hover { transform: translateX(5px); }
.site-footer ul[aria-label="Social media"] a { transition: transform .25s ease, background-color .2s ease; }
.site-footer ul[aria-label="Social media"] a:hover { transform: translateY(-4px) rotate(-6deg); }
.site-footer .btn-primary { position: relative; }
.site-footer .btn-primary::after { content: ""; position: absolute; inset: -2px; border-radius: 9999px; border: 2px solid rgb(255 125 156 / .8); animation: pulse 2.4s ease-out infinite; pointer-events: none; }

/* header logo text: shown on every screen size (smaller on phones) */
.logo-text { display: block; font-family: 'Bricolage Grotesque', 'Figtree', sans-serif; font-weight: 800; line-height: 1.15; font-size: clamp(.8rem, 3.6vw, .95rem); white-space: nowrap; }
.logo-sub { display: block; font-size: clamp(.5rem, 2.3vw, .7rem); font-weight: 600; letter-spacing: .1em; text-transform: uppercase; opacity: .92; }
@media (min-width: 640px) { .logo-sub { letter-spacing: .14em; } }
