/* MADDHOUSE Technologies — site styles v5.0 (multi-page, immersive homepage)
   Dark premium base, magenta/cyan identity from the original artwork.
   No external fonts or assets (CSP: same-origin only). */

:root {
  --bg: #07080f;
  --bg-2: #0b0c17;
  --surface: #10121f;
  --surface-2: #151729;
  --border: rgba(226, 214, 255, .085);
  --border-strong: rgba(226, 214, 255, .16);
  --text: #f4f2fb;
  --body: #bfbdd2;
  --muted: #8f8ea6;
  --magenta: #ec4fbd;
  --magenta-soft: #f59bdc;
  --cyan: #2fd8f8;
  --violet: #a277ff;
  --orange: #f6a04d;
  --brand-sub: #e39ad8;
  --grad: linear-gradient(100deg, #ff74d2 0%, #c792ff 48%, #62d8ff 100%);
  --btn-grad: linear-gradient(115deg, #e23aa9 0%, #9a45e8 100%);
  --radius: 20px;
  --max: 1160px;
  --header-h: 72px;
  --font: "Avenir Next", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, system-ui, sans-serif;
  /* Code-rain backdrop: one fixed layer for the whole page; sections dim it with scrims. */
  --rain-opacity: .5;
  --scrim: rgba(7, 8, 15, .8);
  --scrim-tint: rgba(11, 12, 23, .86);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
/* Fixed, never repeated or animated: the original rain columns stay put while content scrolls.
   100lvh keeps mobile browsers from resizing it as their toolbars collapse. */
body::before {
  content: ""; position: fixed; top: 0; left: 0; z-index: -1; width: 100%; height: 100vh; height: 100lvh;
  pointer-events: none;
  background: url("/assets/maddhouse-rain-field.webp") center top / cover no-repeat;
  opacity: var(--rain-opacity);
}
@media (max-aspect-ratio: 4 / 5) {
  body::before { background-image: url("/assets/maddhouse-rain-field-portrait.webp"); }
}
body:has(.privacy-page)::before { opacity: .14; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { color: var(--text); }
::selection { background: rgba(236, 79, 189, .4); color: #fff; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }
.skip-link { position: absolute; z-index: 1000; top: -100px; left: 12px; padding: 10px 18px; border-radius: 8px; background: #fff; color: #000; font-weight: 600; }
.skip-link:focus { top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.container { width: min(100% - 48px, var(--max)); margin-inline: auto; }

.gradient-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.icon { width: 16px; height: 16px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 50px; padding: 0 24px; border-radius: 12px; border: 1px solid transparent;
  font-size: 15px; font-weight: 600; letter-spacing: .005em; white-space: nowrap;
  transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease, border-color .2s ease;
}
.btn-primary { color: #fff; background: var(--btn-grad); box-shadow: 0 10px 30px -10px rgba(226, 58, 169, .6); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 14px 36px -10px rgba(226, 58, 169, .75); }
.btn-ghost { color: var(--text); background: rgba(255, 255, 255, .04); border-color: var(--border-strong); }
.btn-ghost:hover { background: rgba(255, 255, 255, .08); }
.btn-outline { color: var(--text); background: rgba(236, 79, 189, .08); border-color: rgba(236, 79, 189, .5); }
.btn-outline:hover { background: rgba(236, 79, 189, .16); border-color: rgba(236, 79, 189, .8); }
.btn-small { height: 40px; padding: 0 18px; border-radius: 10px; font-size: 14px; }
.btn-block { width: 100%; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(7, 8, 15, .84);
  -webkit-backdrop-filter: saturate(140%) blur(16px);
  backdrop-filter: saturate(140%) blur(16px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 32px; height: var(--header-h); }

.brand { display: inline-flex; align-items: center; gap: 12px; flex-shrink: 0; }
.brand-emblem { width: 37px; height: 40px; flex-shrink: 0; }
.brand-type { display: flex; flex-direction: column; gap: 7px; width: 232px; }
.brand-wordmark { width: 100%; height: auto; }
.brand-sub { display: flex; justify-content: space-between; padding: 0 1px 0 2px; font-size: 10px; font-weight: 600; line-height: 1; color: var(--brand-sub); }

.primary-nav { display: flex; align-items: center; gap: 30px; }
.primary-nav a:not(.btn) { font-size: 14.5px; font-weight: 500; color: var(--body); white-space: nowrap; transition: color .2s; }
.primary-nav a:not(.btn):hover { color: var(--text); }
.primary-nav a:not(.btn)[aria-current="page"] { color: var(--text); text-decoration: underline; text-decoration-color: var(--magenta); text-decoration-thickness: 2px; text-underline-offset: 8px; }
.nav-cta[aria-current="page"] { background: rgba(236, 79, 189, .2); border-color: rgba(236, 79, 189, .85); }
.nav-cta { margin-left: 4px; }
.menu-toggle { display: none; }

/* ---------- Home hero ---------- */
/* The looping hero video is the hero's full-width background. It sits in the page's root stacking
   context (the hero is deliberately not isolated) so `screen` blending lets its black read as the
   fixed code rain behind the page, and its edges are feathered so it dissolves into that rain.
   The neon house in the footage (x 12-57%, centre 34.5% of the frame) is centred on the left grid
   column (desktop) or the page (mobile). The poster still has the same box, so the static fallback
   and reduced-motion view match the first video frame exactly. */
.hero {
  --hero-h: clamp(560px, min(50vw, 100svh - var(--header-h) - 48px), 760px);
  /* Centre of the left grid column (.95fr of the container, minus the gap share). */
  --house-x: calc((100% - min(100% - 48px, var(--max))) / 2 + (min(100% - 48px, var(--max)) - clamp(28px, 4vw, 64px)) * .2375);
  position: relative; overflow: hidden; display: grid; align-items: center; min-height: var(--hero-h);
  padding: clamp(28px, 4vw, 56px) 0 clamp(24px, 3vw, 40px);
}
.hero-grid { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); align-items: center; gap: clamp(28px, 4vw, 64px); }
.hero-copy { grid-column: 2; }
.hero-visual { position: absolute; inset: 0; pointer-events: none; }
.hero-visual > picture, .hero-media-video {
  position: absolute; z-index: -1; top: 0; left: var(--house-x); height: var(--hero-h); aspect-ratio: 16 / 9; width: auto;
  transform: translateX(-34.5%); mix-blend-mode: screen; transition: opacity .6s ease;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 88%, transparent), linear-gradient(180deg, #000 86%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, transparent, #000 7%, #000 88%, transparent), linear-gradient(180deg, #000 86%, transparent);
  mask-composite: intersect;
}
.hero-visual picture, .hero-media-still { display: block; }
.hero-media-still { width: 100%; height: 100%; object-fit: cover; }
.hero-media-video { object-fit: cover; opacity: 0; }
.hero-visual.is-playing .hero-media-video { opacity: 1; }
.hero-visual.is-playing .hero-media-still { opacity: 0; }
.hero-visual.is-playing > picture { opacity: 0; }
/* Permanent readability gradient: clear over the house, dark behind the text column, and a soft
   fade at the bottom into the next section. Painted after the media, beneath the text. */
.hero-visual::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, rgba(7, 8, 15, 0) 36%, rgba(7, 8, 15, .5) 49%, rgba(7, 8, 15, .78) 62%, rgba(7, 8, 15, .84) 100%),
    linear-gradient(180deg, rgba(7, 8, 15, .12), transparent 14%, transparent 84%, rgba(7, 8, 15, .55));
}
.hero-media-toggle {
  position: absolute; z-index: 2; right: max(24px, (100% - var(--max)) / 2); bottom: 16px; pointer-events: auto;
  padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: rgba(7, 8, 15, .7); font-size: 13px; font-weight: 600; color: var(--text);
}
.hero-media-toggle[hidden] { display: none; }
.hero-title { margin: 0 0 22px; font-size: clamp(36px, 3.7vw, 56px); line-height: 1.06; letter-spacing: -.035em; font-weight: 700; text-wrap: balance; }
.hero-title .h1-line { display: block; color: #fff; }
.hero-title .gradient-text { display: block; padding-bottom: .05em; }
.hero-subhead { margin: 0 0 10px; font-size: clamp(19px, 1.6vw, 23px); line-height: 1.35; font-weight: 650; letter-spacing: -.01em; color: var(--text); }
.hero-copy .hero-lead { margin-bottom: 30px; }
.btn-cyan { color: #04121a; background: linear-gradient(115deg, #4fe3ff 0%, #7aa8ff 100%); box-shadow: 0 10px 30px -10px rgba(47, 216, 248, .55); }
.btn-cyan:hover { transform: translateY(-1px); box-shadow: 0 14px 36px -10px rgba(47, 216, 248, .7); }

/* ---------- Home: photographic gateways ---------- */
.gateways { padding: clamp(8px, 1.5vw, 16px) 0 0; }
.gateways-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; width: min(100% - 24px, 1440px); margin-inline: auto; }
.gateway, .specialty { position: relative; overflow: hidden; isolation: isolate; display: flex; align-items: flex-end; background: #05060c; border-radius: 4px; }
.gateway { min-height: clamp(320px, 33vw, 480px); }
.gateway-img, .specialty-img {
  position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; object-position: var(--focus, 50% 50%);
  transition: transform .9s cubic-bezier(.2, .7, .2, 1), filter .6s ease;
}
.gateway::before, .specialty::before {
  content: ""; position: absolute; inset: 0; z-index: -1; transition: opacity .5s ease;
  background:
    radial-gradient(60% 45% at 0% 100%, rgba(var(--tone-rgb), .16), transparent 70%),
    linear-gradient(0deg, rgba(5, 6, 12, .3) 0%, rgba(5, 6, 12, 0) 45%);
}
/* Readability scrim tied to the text block, so it darkens only behind the words and follows them
   at every width; the artwork above stays at full brightness. */
.gateway-body, .specialty-body { position: relative; }
.gateway-body::before, .specialty-body::before {
  content: ""; position: absolute; z-index: -1; inset: -64px 0 0; pointer-events: none;
  background: linear-gradient(0deg, rgba(5, 6, 12, .88) 0%, rgba(5, 6, 12, .7) 50%, rgba(5, 6, 12, .42) 76%, rgba(5, 6, 12, 0) 100%);
}
.gateway::after, .specialty::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: linear-gradient(90deg, rgba(var(--tone-rgb), 1), rgba(var(--tone-rgb), 0) 75%);
  box-shadow: 0 0 18px 1px rgba(var(--tone-rgb), .7); transform-origin: left; transform: scaleX(.35); transition: transform .6s ease;
}
.gateway:hover .gateway-img, .gateway:focus-visible .gateway-img,
.specialty:hover .specialty-img, .specialty:focus-visible .specialty-img { transform: scale(1.04); filter: brightness(1.06); }
.gateway:hover::after, .gateway:focus-visible::after, .specialty:hover::after, .specialty:focus-visible::after { transform: scaleX(1); }
.gateway:focus-visible, .specialty:focus-visible { outline-offset: -3px; }
.gateway-residential .gateway-img { --focus: 62% 50%; }
.gateway-body { flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: clamp(24px, 3.4vw, 48px); }
.gateway h2 { font-size: clamp(30px, 3.2vw, 46px); text-shadow: 0 2px 24px rgba(0, 0, 0, .6); }
.gateway-tag { font-size: clamp(17px, 1.4vw, 20px); font-weight: 500; color: rgba(var(--tone-rgb), 1); text-shadow: 0 1px 12px rgba(0, 0, 0, .8); }
.gateway-link, .specialty-link { display: inline-flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 15px; font-weight: 650; color: var(--text); }
.gateway-link .icon, .specialty-link .icon { color: var(--tone); transition: transform .25s ease; }
.gateway:hover .gateway-link .icon, .specialty:hover .specialty-link .icon { transform: translateX(4px); }

/* ---------- Home: featured specialties ---------- */
.specialties { container-type: inline-size; padding: clamp(48px, 6vw, 80px) 0 clamp(56px, 7vw, 96px); background: linear-gradient(180deg, transparent, var(--scrim) 30%); }
.specialties-head { margin-bottom: clamp(24px, 3vw, 36px); }
/* Each card spans four shared rows (artwork, heading, description, link) through subgrid, so
   headings, descriptions and links line up across a row of cards whatever their text length.
   The artwork row is sized from the card width (--art), keeping cards close to the art's 3:4. */
.specialties-grid {
  --cols: 4; --art: .72;
  display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  grid-auto-rows: calc((min(100cqw - 24px, 1440px) - (var(--cols) - 1) * 6px) / var(--cols) * var(--art)) auto auto auto;
  gap: 6px; width: min(100% - 24px, 1440px); margin-inline: auto;
}
.specialty { display: grid; grid-row: span 4; grid-template-rows: subgrid; row-gap: 0; align-items: stretch; }
.specialty-body { grid-row: 2 / span 3; display: grid; grid-template-rows: subgrid; row-gap: 8px; justify-items: start; padding: 0 clamp(20px, 2vw, 28px) clamp(20px, 2vw, 28px); }
.specialty h3 { margin: 0; font-size: clamp(20px, 1.7vw, 24px); line-height: 1.2; letter-spacing: -.015em; font-weight: 700; text-wrap: balance; text-shadow: 0 2px 18px rgba(0, 0, 0, .7); }
.specialty-text { font-size: 15px; line-height: 1.55; color: var(--body); text-shadow: 0 1px 10px rgba(0, 0, 0, .9); }
.specialty-link { align-self: end; }

/* ---------- Subpage hero ---------- */
.page-hero { position: relative; isolation: isolate; padding: clamp(56px, 7vw, 96px) 0 clamp(48px, 6vw, 72px); }
.page-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(90deg, rgba(7, 8, 15, .86) 0%, rgba(7, 8, 15, .62) 55%, rgba(7, 8, 15, .3)),
    linear-gradient(180deg, transparent 60%, var(--scrim));
}
.page-hero h1, .page-title { margin: 0 0 24px; font-size: clamp(36px, 4.2vw, 58px); line-height: 1.06; letter-spacing: -.035em; font-weight: 700; text-wrap: balance; }
.page-hero h1 .h1-line, .page-hero h1 .gradient-text, .page-title .gradient-text { display: block; padding-bottom: .04em; }
.page-first { padding-top: clamp(56px, 7vw, 96px); }
.kicker {
  display: inline-flex; align-items: center; gap: 10px; margin: 0 0 26px; padding: 7px 14px 7px 12px;
  border: 1px solid var(--border-strong); border-radius: 999px; background: rgba(255, 255, 255, .03);
  font-size: 12.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--magenta-soft);
}
.kicker-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.hero-lead { margin: 0 0 34px; max-width: 36em; font-size: clamp(17px, 1.35vw, 19px); line-height: 1.65; color: var(--body); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-note { display: flex; align-items: center; gap: 8px; margin: 22px 0 0; font-size: 14px; color: var(--muted); }
.icon-check { color: var(--cyan); }

/* ---------- Sections ---------- */
.section, .statement { background-color: var(--scrim); }
.section { padding: clamp(72px, 9vw, 116px) 0; }
.section-tint { background: var(--scrim-tint); border-block: 1px solid var(--border); }
.section-head { max-width: 680px; margin-bottom: clamp(40px, 5vw, 56px); }
.section-head-center { margin-inline: auto; text-align: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 16px; font-size: 12.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--magenta-soft); }
.eyebrow::before { content: ""; width: 22px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--cyan), var(--magenta)); }
h2 { margin: 0; font-size: clamp(30px, 3.5vw, 44px); line-height: 1.12; letter-spacing: -.03em; font-weight: 700; text-wrap: balance; }
h2 .gradient-text { display: block; padding-bottom: .04em; }
.section-sub { margin: 18px 0 0; max-width: 36em; font-size: 17px; line-height: 1.65; color: var(--body); }
.section-head-center .section-sub { margin-inline: auto; }

.tone-cyan { --tone: var(--cyan); --tone-rgb: 47, 216, 248; }
.tone-magenta { --tone: var(--magenta); --tone-rgb: 236, 79, 189; }
.tone-violet { --tone: var(--violet); --tone-rgb: 162, 119, 255; }
.tone-orange { --tone: var(--orange); --tone-rgb: 246, 160, 77; }

/* ---------- Services ---------- */
#services { padding-top: clamp(56px, 7vw, 88px); padding-bottom: clamp(48px, 6vw, 72px); }
.services { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.service {
  position: relative; overflow: hidden; display: flex; flex-direction: column;
  padding: 32px 30px 34px; border-radius: var(--radius); border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(var(--tone-rgb), .07), rgba(var(--tone-rgb), 0) 50%), var(--surface);
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.service::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(var(--tone-rgb), .8), transparent); }
.service:hover { transform: translateY(-3px); border-color: rgba(var(--tone-rgb), .35); box-shadow: 0 22px 44px -24px rgba(var(--tone-rgb), .45); }
.service-icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 28px; border-radius: 14px; background: rgba(var(--tone-rgb), .12); color: var(--tone); }
.service-icon svg, .principle-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.service-num { position: absolute; top: 32px; right: 30px; font-size: 13px; font-weight: 600; letter-spacing: .08em; color: var(--muted); }
.service h3 { margin: 0 0 12px; font-size: 21px; line-height: 1.25; letter-spacing: -.015em; font-weight: 650; text-wrap: balance; }
.service p { margin: 0; font-size: 16px; line-height: 1.65; color: var(--body); }

/* ---------- Brand statement ---------- */
.statement { padding-bottom: clamp(72px, 9vw, 116px); }
.statement-card {
  position: relative; overflow: hidden; isolation: isolate;
  padding: clamp(36px, 5vw, 56px) clamp(28px, 5vw, 64px);
  border-radius: 24px; border: 1px solid var(--border-strong); background: var(--surface);
}
.statement-card::before {
  content: ""; position: absolute; inset: 0 0 0 30%; z-index: -1;
  background: url("/assets/maddhouse-rain.webp") center / cover no-repeat; opacity: .5;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 65%);
  mask-image: linear-gradient(90deg, transparent, #000 65%);
}
.statement-card::after { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(55% 130% at 0% 50%, rgba(236, 79, 189, .16), transparent 70%); }
.statement-text { margin: 0; max-width: 21em; font-size: clamp(24px, 2.8vw, 36px); line-height: 1.22; letter-spacing: -.025em; font-weight: 650; }
.statement-text .gradient-text { display: block; }

/* ---------- Process ---------- */
.process { position: relative; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 20px; margin: 0; padding: 0; list-style: none; }
.process::before {
  content: ""; position: absolute; top: 23px; left: calc((100% - 80px) / 10); right: calc((100% - 80px) / 10); height: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--magenta) 50%, var(--violet)); opacity: .5;
}
.step { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; }
.step-node {
  display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 22px; border-radius: 50%;
  background: var(--bg-2); border: 1px solid rgba(236, 79, 189, .6);
  box-shadow: 0 0 0 6px var(--bg-2), 0 0 24px -4px rgba(236, 79, 189, .65);
  font-size: 16px; font-weight: 700; color: var(--text);
}
.step h3 { margin: 0 0 8px; font-size: 17.5px; line-height: 1.3; font-weight: 650; text-wrap: balance; }
.step p { margin: 0; max-width: 17em; font-size: 15px; line-height: 1.6; color: var(--body); }
.chip { display: inline-block; margin-top: 14px; padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 600; letter-spacing: .04em; }
.chip-cyan { color: var(--cyan); background: rgba(47, 216, 248, .1); border: 1px solid rgba(47, 216, 248, .3); }
.chip-violet { color: #c6aaff; background: rgba(162, 119, 255, .1); border: 1px solid rgba(162, 119, 255, .32); }

/* ---------- Managed care tiers ---------- */
.tiers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.tier {
  --c: var(--cyan); --c-rgb: 47, 216, 248;
  position: relative; overflow: hidden; display: flex; flex-direction: column;
  padding: 28px 26px 26px; border-radius: var(--radius); border: 1px solid var(--border);
  background: radial-gradient(120% 55% at 50% 0%, rgba(var(--c-rgb), .11), transparent 65%), var(--surface);
  transition: transform .25s ease, border-color .25s ease;
}
.tier::before { content: ""; position: absolute; top: 0; left: 20%; right: 20%; height: 2px; border-radius: 0 0 2px 2px; background: var(--c); box-shadow: 0 0 18px 2px rgba(var(--c-rgb), .6); }
.tier:hover { transform: translateY(-3px); border-color: rgba(var(--c-rgb), .35); }
.tier-1 { --c: var(--cyan); --c-rgb: 47, 216, 248; }
.tier-2 { --c: var(--orange); --c-rgb: 246, 160, 77; }
.tier-3 { --c: var(--magenta); --c-rgb: 236, 79, 189; }
.tier-4 { --c: var(--violet); --c-rgb: 162, 119, 255; }
.tier-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.tier-star { width: 30px; height: 30px; fill: var(--c); filter: drop-shadow(0 0 8px rgba(var(--c-rgb), .85)); }
.tier-level { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--c); }
.tier h3 { margin: 0 0 10px; font-size: 20px; line-height: 1.25; letter-spacing: -.01em; font-weight: 650; }
.tier p { margin: 0 0 26px; font-size: 15px; line-height: 1.6; color: var(--body); }
.tier-meter { display: flex; gap: 6px; margin-top: auto; }
.tier-meter i { flex: 1; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .08); }
.tier-1 .tier-meter i:nth-child(-n+1),
.tier-2 .tier-meter i:nth-child(-n+2),
.tier-3 .tier-meter i:nth-child(-n+3),
.tier-4 .tier-meter i { background: var(--c); box-shadow: 0 0 10px rgba(var(--c-rgb), .5); }
.care-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  margin-top: 20px; padding: 16px 16px 16px 22px; border-radius: 16px;
  border: 1px solid var(--border); background: rgba(255, 255, 255, .02);
}
.care-foot p { display: flex; align-items: center; gap: 14px; margin: 0; font-size: 15px; line-height: 1.55; color: var(--body); }
.care-foot p span { text-wrap: balance; }
.icon-shield { width: 24px; height: 24px; color: var(--cyan); stroke-width: 1.6; }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(40px, 6vw, 96px); align-items: start; }
.about-intro { position: sticky; top: calc(var(--header-h) + 40px); }
.principles { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.principles li { display: grid; grid-template-columns: 44px 1fr; align-items: center; gap: 18px; padding: 18px 22px 18px 18px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); }
.principle-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: rgba(var(--tone-rgb), .12); color: var(--tone); }
.principle-icon svg { width: 22px; height: 22px; }
.principles h3 { margin: 0 0 2px; font-size: 16.5px; line-height: 1.35; font-weight: 650; }
.principles p { margin: 0; font-size: 15px; line-height: 1.5; color: var(--body); }

/* ---------- Contact ---------- */
.contact { background: radial-gradient(45% 55% at 92% 8%, rgba(162, 74, 255, .1), transparent 70%), var(--scrim); }
.contact-grid { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: clamp(40px, 6vw, 88px); align-items: center; }
.contact-intro { padding-top: 8px; }
.checklist { display: grid; gap: 14px; margin: 30px 0 0; padding: 0; list-style: none; }
.checklist li { display: flex; align-items: center; gap: 12px; font-size: 16px; color: var(--text); }
.checklist .icon { width: 22px; height: 22px; padding: 4px; border-radius: 50%; background: rgba(47, 216, 248, .12); }
.contact-place { display: flex; align-items: center; gap: 10px; margin: 30px 0 0; padding-top: 24px; border-top: 1px solid var(--border); font-size: 14.5px; color: var(--muted); }
.contact-place .icon { color: var(--magenta-soft); }

.form-card {
  padding: clamp(24px, 3.5vw, 40px); border-radius: 24px; border: 1px solid var(--border-strong);
  background: linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, .01)), var(--surface);
  box-shadow: 0 40px 90px -50px rgba(0, 0, 0, .9);
}
.form-head h2 { margin: 0 0 6px; font-size: 22px; line-height: 1.3; font-weight: 650; }
.form-head p { margin: 0 0 26px; font-size: 14.5px; color: var(--muted); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-split { grid-template-columns: minmax(0, .7fr) minmax(0, 1.3fr); }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; margin-bottom: 18px; }
.field label { font-size: 14px; font-weight: 600; color: var(--text); }
.req { color: var(--magenta-soft); }
.optional { font-weight: 400; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%; min-height: 50px; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--border-strong); background-color: #0a0b16; color: var(--text);
  font-size: 16px; line-height: 1.4; outline: none; transition: border-color .2s, box-shadow .2s;
}
.field textarea { min-height: 128px; resize: vertical; line-height: 1.55; }
.field select {
  appearance: none; -webkit-appearance: none; padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23bfbdd2' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 16px;
}
.field select option { background: #0a0b16; color: var(--text); }
.field input::placeholder, .field textarea::placeholder { color: #6f6e86; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: rgba(236, 79, 189, .75); box-shadow: 0 0 0 4px rgba(236, 79, 189, .15); }
.field .invalid { border-color: #ff7a8a; }
.bot-field { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.form-submit { margin-top: 6px; border: 0; }
.form-submit:disabled { cursor: wait; opacity: .65; }
.form-status { margin: 14px 0 0; font-size: 14.5px; color: #7ff0c4; }
.form-status:empty { display: none; }
.form-status.error { color: #ff9aa6; }
.privacy-caption { margin: 14px 0 0; font-size: 13px; line-height: 1.55; color: var(--muted); }
.privacy-caption a { color: var(--body); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Residential pricing ---------- */
.price-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.price-card {
  display: flex; flex-direction: column; padding: 26px 26px 22px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface); transition: transform .25s ease, border-color .25s ease;
}
.price-card:hover { transform: translateY(-3px); border-color: rgba(236, 79, 189, .35); }
.price-icon { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 20px; border-radius: 12px; background: rgba(47, 216, 248, .1); color: var(--cyan); }
.price-card:nth-child(3n+2) .price-icon { background: rgba(236, 79, 189, .12); color: var(--magenta); }
.price-card:nth-child(3n) .price-icon { background: rgba(162, 119, 255, .12); color: var(--violet); }
.price-icon svg, .mini-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.price-card h3 { margin: 0 0 8px; font-size: 19px; line-height: 1.3; font-weight: 650; letter-spacing: -.01em; }
.price-card > p { margin: 0 0 22px; font-size: 15px; line-height: 1.6; color: var(--body); }
.price-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 18px; border-top: 1px solid var(--border); }
.price { margin: 0; display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.price-from { font-size: 13px; font-weight: 600; letter-spacing: .04em; color: var(--muted); }
.price-value { font-size: 24px; font-weight: 700; letter-spacing: -.02em; color: var(--text); }
.price-quote { font-size: 18px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.price-link { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--magenta-soft); white-space: nowrap; }
.price-link:hover { color: var(--text); }
.terms { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; margin-top: 18px; }
.terms-cards { display: grid; gap: 12px; }
.term-card {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 18px;
  padding: 18px 22px 18px 18px; border-radius: 16px; border: 1px solid rgba(var(--tone-rgb), .3);
  background: linear-gradient(90deg, rgba(var(--tone-rgb), .08), transparent 60%), var(--surface);
}
.term-card .price-icon { margin: 0; background: rgba(var(--tone-rgb), .12); color: var(--tone); }
.term-card h3 { margin: 0 0 2px; font-size: 16.5px; line-height: 1.35; font-weight: 650; }
.term-card p { margin: 0; font-size: 14.5px; line-height: 1.5; color: var(--body); }
.term-card .price-value { font-size: 22px; }
.terms-list { display: grid; align-content: center; gap: 12px; margin: 0; padding: 22px 24px; list-style: none; border-radius: 16px; border: 1px solid var(--border); background: rgba(255, 255, 255, .02); }
.terms-list li { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; line-height: 1.5; color: var(--body); }
.terms-list .icon { margin-top: 3px; }
.principles li[class^="tone-"] .principle-icon { background: rgba(var(--tone-rgb), .12); color: var(--tone); }
.principles-title { margin: 0 0 18px; font-size: 14px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

/* ---------- Specialized services ---------- */
.mini-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.mini-card { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 18px; align-items: start; padding: 20px 22px 20px 18px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); }
.mini-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: rgba(236, 79, 189, .12); color: var(--magenta); }
.mini-card:nth-child(even) .mini-icon { background: rgba(47, 216, 248, .1); color: var(--cyan); }
.mini-card h3 { margin: 2px 0 4px; font-size: 17px; line-height: 1.35; font-weight: 650; }
.mini-card p { margin: 0; font-size: 15px; line-height: 1.55; color: var(--body); }

/* ---------- CTA band ---------- */
.cta-band { background-color: var(--scrim); padding: clamp(56px, 7vw, 96px) 0; }
.statement + .cta-band { padding-top: 0; }
.cta-card {
  display: flex; align-items: center; justify-content: space-between; gap: 32px;
  padding: clamp(28px, 4vw, 44px) clamp(24px, 4vw, 52px); border-radius: 24px; border: 1px solid var(--border-strong);
  background: radial-gradient(60% 140% at 0% 50%, rgba(236, 79, 189, .16), transparent 70%), var(--surface);
}
.cta-card h2 { font-size: clamp(24px, 2.6vw, 32px); }
.cta-card p { margin: 10px 0 0; max-width: 36em; font-size: 16.5px; line-height: 1.6; color: var(--body); }

/* ---------- Footer ---------- */
.site-footer { padding: 48px 0 28px; border-top: 1px solid var(--border); background: #05060c; }
.footer-main { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 28px; padding-bottom: 32px; border-bottom: 1px solid var(--border); }
.footer-nav { display: flex; flex-wrap: wrap; gap: 12px 28px; }
.footer-nav a { font-size: 14.5px; color: var(--muted); transition: color .2s; }
.footer-nav a:hover { color: var(--text); }
.footer-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-top: 24px; font-size: 13.5px; color: var(--muted); }

/* ---------- Privacy page ---------- */
.privacy-page { max-width: 760px; padding: clamp(56px, 7vw, 88px) 0 clamp(72px, 9vw, 110px); }
.privacy-page h1 { margin: 0 0 28px; font-size: clamp(32px, 4.2vw, 48px); line-height: 1.1; letter-spacing: -.03em; }
.privacy-page p:not(.eyebrow) { margin: 0 0 20px; font-size: 16.5px; line-height: 1.75; color: var(--body); }
.not-found .hero-actions { margin-top: 28px; }
.privacy-page .back-link { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; font-weight: 600; color: var(--magenta-soft); }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .tiers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .specialties-grid { --cols: 2; --art: .74; }
  .price-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .terms { grid-template-columns: 1fr; }
  .primary-nav { gap: 24px; }
}

@media (max-width: 980px) {
  .menu-toggle {
    display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
    width: 42px; height: 42px; flex-shrink: 0; border-radius: 10px;
    border: 1px solid var(--border-strong); background: rgba(255, 255, 255, .03);
  }
  .menu-toggle span { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--text); transition: transform .2s ease, opacity .2s ease; }
  .menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .primary-nav {
    position: absolute; top: 100%; left: 0; right: 0; display: none;
    flex-direction: column; align-items: stretch; gap: 0; padding: 8px 24px 24px;
    background: #0a0b15; border-bottom: 1px solid var(--border);
    box-shadow: 0 24px 40px -20px rgba(0, 0, 0, .8);
  }
  .primary-nav.open { display: flex; }
  .primary-nav a:not(.btn) { padding: 14px 4px; font-size: 16px; border-bottom: 1px solid var(--border); }
  .nav-cta { margin: 16px 0 0; height: 48px; }

  /* Stacked: the house is centred at the top and the copy starts just below its wordmark. */
  .hero { --hero-h: clamp(260px, 72vw, 420px); --house-x: 50%; display: block; min-height: 0; }
  .hero-grid { grid-template-columns: 1fr; gap: 8px; padding-top: calc(var(--hero-h) * .9); }
  .hero-copy { grid-column: 1; text-align: center; max-width: 640px; margin-inline: auto; }
  .hero-actions { justify-content: center; }
  .hero-visual > picture, .hero-media-video {
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent), linear-gradient(180deg, #000 92%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent), linear-gradient(180deg, #000 92%, transparent);
  }
  .hero-visual::after {
    background: linear-gradient(180deg, rgba(7, 8, 15, .08), transparent 10%, transparent calc(var(--hero-h) * .9), rgba(7, 8, 15, .72) calc(var(--hero-h) * 1.08), rgba(7, 8, 15, .8));
  }
  .hero-media-toggle { top: 12px; bottom: auto; right: 12px; }
  .page-hero::before { background: linear-gradient(180deg, rgba(7, 8, 15, .7), rgba(7, 8, 15, .6) 60%, var(--scrim)); }
  .mini-grid { grid-template-columns: 1fr; }
  .cta-card { flex-direction: column; align-items: flex-start; }

  .process { grid-template-columns: 1fr; gap: 0; max-width: 560px; margin-inline: auto; }
  .process::before { top: 24px; bottom: 24px; left: 23px; right: auto; width: 2px; height: auto; background: linear-gradient(180deg, var(--cyan), var(--magenta) 50%, var(--violet)); }
  .step { display: grid; grid-template-columns: 48px 1fr; column-gap: 20px; align-items: start; padding-bottom: 30px; text-align: left; }
  .step:last-child { padding-bottom: 0; }
  .step > :not(.step-node) { grid-column: 2; }
  .step-node { grid-row: 1 / span 3; margin: 0; }
  .step h3 { margin-top: 12px; }
  .step p { max-width: none; }
  .chip { justify-self: start; }

  .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .about-intro { position: static; }
}

@media (max-width: 860px) {
  .services, .gateways-grid { grid-template-columns: 1fr; }
  .gateway { min-height: clamp(300px, 80vw, 400px); }
}

@media (max-width: 640px) {
  .tiers { grid-template-columns: 1fr; }
  .form-row, .form-row-split { grid-template-columns: 1fr; gap: 0; }
  .care-foot { flex-direction: column; align-items: stretch; padding: 20px; }
  .hero-actions .btn { flex: 1 1 auto; }
  .price-grid { grid-template-columns: 1fr; }
  .term-card { grid-template-columns: 44px minmax(0, 1fr); }
  .term-card .price { grid-column: 2; }
  .hero-actions { flex-direction: column; }
  .specialties-grid { --cols: 1; --art: .62; }
  .cta-card .btn { width: 100%; }
  .statement-card::before { inset: 0 0 0 50%; opacity: .3; }
  .service-icon { margin-bottom: 20px; }
}

@media (max-width: 560px) {
  :root { --header-h: 64px; }
  .container { width: min(100% - 36px, var(--max)); }
  .brand { gap: 10px; }
  .brand-emblem { width: 32px; height: 35px; }
  .brand-type { width: 196px; gap: 6px; }
  .brand-sub { font-size: 8.5px; }
  .primary-nav { padding-inline: 18px; }
  .kicker { font-size: 11.5px; letter-spacing: .1em; }
  .page-hero h1, .page-title { font-size: clamp(32px, 9vw, 40px); text-wrap: balance; }
  .page-hero h1 .h1-line, .page-hero h1 .gradient-text { display: inline; }
  .hero-title { font-size: clamp(30px, 8.4vw, 38px); }
  .hero-subhead { font-size: 18px; }
  .price-card { padding: 22px 20px 18px; }
  .service { padding: 28px 24px 30px; }
  .service-num { top: 28px; right: 24px; }
  .principles li { padding: 16px; gap: 14px; }
  .footer-base { flex-direction: column; }
}

@media (max-width: 380px) {
  .kicker { font-size: 10.5px; letter-spacing: .07em; padding-inline: 11px; }
  .brand-type { width: 168px; }
  .brand-sub { font-size: 7.5px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
