/* Outfit (SIL Open Font License), self-hosted so visitors' browsers don't contact Google. */
@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../assets/fonts/outfit-latin.woff2") format("woff2");
}

/* HVN Security — brand palette from brand/hvn-color-palette.png */
:root {
  --teal: #048a81;
  --teal-strong: #036e67; /* darker teal for text and buttons (meets 4.5:1 with white) */
  --sky: #99e6ff;
  --ink: #161627;
  --ink-soft: #2a2a40;
  --paper: #f5f5f5;
  --white: #ffffff;
  --text: #161627;
  --muted: #4a4a5c;
  --line: #dcdce2;

  --radius: 14px;
  --container: 1120px;
  --font: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 112px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
h1, h2, h3 { line-height: 1.15; margin: 0; }
p { margin: 0; }
a { color: var(--teal-strong); }

:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 3px;
  border-radius: 4px;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 12px; top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--white);
  border-radius: 8px;
}
.skip-link:focus { top: 12px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border: 2px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s, transform .35s cubic-bezier(.2, .7, .2, 1), box-shadow .35s cubic-bezier(.2, .7, .2, 1);
}
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.btn-primary { background: var(--teal-strong); color: var(--white); }
.btn-primary:hover { background: var(--ink); }
.btn-ghost { border-color: rgba(153, 230, 255, .5); color: var(--white); }
.btn-ghost:hover { border-color: var(--sky); background: rgba(153, 230, 255, .1); }
/* A slight lift on hover gives the buttons some depth. */
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 24px -10px rgba(3, 110, 103, .7); }
.btn-ghost:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); box-shadow: none; }
.hero .btn-ghost { background: rgba(255, 255, 255, .06); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.btn-lg { min-height: 52px; padding: 12px 26px; font-size: 1.0625rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .65; cursor: wait; }

/* Header: a frosted bar that floats over the hero instead of sitting above it. */
.site-header {
  position: fixed;
  top: 14px;
  left: 0;
  right: 0;
  z-index: 50;
  pointer-events: none;
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  width: calc(100% - 28px);
  max-width: calc(var(--container) + 40px);
  min-height: 84px;
  margin: 0 auto;
  padding: 6px 12px 6px 22px;
  background: rgba(255, 255, 255, .78);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: 22px;
  box-shadow: 0 18px 40px -20px rgba(0, 0, 0, .45);
  pointer-events: auto;
  transition: background-color .4s ease, box-shadow .4s ease, min-height .4s ease;
}
.site-header.is-scrolled .header-inner {
  min-height: 72px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 14px 34px -18px rgba(0, 0, 0, .5);
}
/* Header uses assets/hvn-logo-transparent.png: the original logo with its white background made transparent. */
.brand img { width: 172px; height: auto; transition: width .4s ease; }
.site-header.is-scrolled .brand img { width: 150px; }
.site-nav { display: flex; gap: 28px; margin-left: auto; }
.site-nav a {
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
  padding: 6px 0;
}
.site-nav a:hover { color: var(--teal-strong); }
.btn-header { min-width: 104px; }

@media (max-width: 640px) {
  .site-header { top: 10px; }
  .header-inner { gap: 12px; width: calc(100% - 20px); min-height: 68px; padding: 6px 8px 6px 16px; border-radius: 18px; }
  .site-header.is-scrolled .header-inner { min-height: 60px; }
  .brand img, .site-header.is-scrolled .brand img { width: 128px; }
  .site-nav { display: none; }
  .btn-header { margin-left: auto; padding: 8px 22px; font-size: .9375rem; }
}
@media (prefers-reduced-motion: reduce) {
  .header-inner, .brand img { transition: none; }
}

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  color: var(--white);
  background:
    radial-gradient(60% 80% at 85% 10%, rgba(4, 138, 129, .45), transparent 70%),
    radial-gradient(40% 60% at 10% 100%, rgba(153, 230, 255, .12), transparent 70%),
    var(--ink);
}
/* Full-bleed photo behind the hero copy; the fade keeps the text readable. */
.hero-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 70% 60%;
}
/* The photo keeps the van and team on the right, so the fade darkens the open left side for the text. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(to right, rgba(22, 22, 39, .92) 0%, rgba(22, 22, 39, .78) 30%, rgba(22, 22, 39, .2) 58%, transparent 75%),
    linear-gradient(to top, var(--ink) 0%, rgba(22, 22, 39, .6) 12%, transparent 40%);
}
.hero-inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: min(100vh, 900px);
  padding-top: clamp(140px, 14vw, 180px);
  padding-bottom: clamp(56px, 8vw, 96px);
}
.hero-copy { max-width: 500px; }
@media (max-width: 760px) {
  /* Phones: the photo becomes a band at the top that fades into the text below it. */
  .hero-media { height: 420px; inset: 0 0 auto 0; object-position: 80% 70%; }
  .hero::before {
    background: linear-gradient(to bottom, transparent 0, transparent 270px, var(--ink) 420px);
  }
  .hero-inner { min-height: 0; padding-top: 380px; padding-bottom: 56px; }
}
.hero h1 {
  max-width: 16ch;
  margin-top: 16px;
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -.02em;
}
.lede {
  max-width: 54ch;
  margin-top: 20px;
  font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
  color: rgba(245, 245, 245, .85);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

.eyebrow {
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--sky);
}
.eyebrow-dark { color: var(--teal-strong); }

/* Sections */
.section { padding: clamp(64px, 9vw, 104px) 0; }
.section-head { margin-bottom: 40px; }
.section h2 {
  margin-top: 10px;
  font-size: clamp(1.875rem, 3.5vw, 2.625rem);
  font-weight: 700;
  letter-spacing: -.015em;
}

/* Services: a dark band that continues straight on from the hero. */
.services {
  position: relative;
  color: var(--paper);
  background:
    radial-gradient(55% 30% at 85% 38%, rgba(4, 138, 129, .2), transparent 70%),
    radial-gradient(45% 30% at 5% 72%, rgba(153, 230, 255, .06), transparent 70%),
    var(--ink);
  padding-bottom: clamp(104px, 13vw, 152px); /* room for the contact sheet to overlap */
}
.services h2 { color: var(--white); }
.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.section-intro { margin-top: 10px; color: var(--muted); }
.services .section-intro { color: rgba(245, 245, 245, .7); }
.section-tagline { margin-top: 8px; font-size: clamp(1.125rem, 1.8vw, 1.375rem); font-weight: 500; color: var(--sky); }

/* Maintenance: a small note under the service cards, not a card of its own. */
.maintenance-note {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 22px;
  padding: 16px 20px;
  background: rgba(4, 138, 129, .06);
  border: 1px solid rgba(4, 138, 129, .22);
  border-left: 4px solid var(--teal);
  border-radius: var(--radius);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.maintenance-note p { color: rgba(245, 245, 245, .75); }
.maintenance-note strong { margin-right: 6px; color: var(--white); font-weight: 600; }
.maintenance-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: 10px;
  background: rgba(4, 138, 129, .25);
}
.maintenance-icon svg {
  width: 22px; height: 22px;
  fill: none; stroke: var(--sky); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

/* Flip cards: photo on the front, description on the back.
   --rx/--ry come from the pointer tilt in js/main.js; --flip turns the card over. */
.flip-card {
  position: relative;
  height: 360px;
  perspective: 1100px;
}
.flip-inner {
  position: relative;
  height: 100%;
  transform-style: preserve-3d;
  transform: rotateX(var(--rx, 0deg)) rotateY(calc(var(--ry, 0deg) + var(--flip, 0deg)));
  /* Symmetric ease-in-out: the card is edge-on at exactly half the duration (.3s),
     which is when the faces swap below, so there's never a blank frame. */
  transition: transform .6s cubic-bezier(.45, .05, .55, .95);
}
.flip-card.is-tilting .flip-inner { transition: transform .18s ease-out; }
.flip-card.is-flipped { --flip: 180deg; }
.flip-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(4, 138, 129, .22);
  border-radius: 18px;
  background: linear-gradient(180deg, #212139, #1a1a2e);
  box-shadow: 0 30px 60px -28px rgba(0, 0, 0, .75), inset 0 1px 0 rgba(153, 230, 255, .04);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transition: border-color .3s, box-shadow .4s;
}
/* iOS Safari can show a face's photo through the card mid-flip, so each face gets its own
   3D layer and the hidden face is also switched to visibility: hidden halfway through the turn. */
.flip-front { padding: 0 0 20px; transform: rotateY(0deg) translateZ(1px); transition: border-color .3s, box-shadow .4s, visibility 0s linear .3s; }
.flip-card.is-flipped .flip-front { visibility: hidden; }
.flip-back { visibility: hidden; transition: border-color .3s, box-shadow .4s, visibility 0s linear .3s; }
.flip-card.is-flipped .flip-back { visibility: visible; }
.card-media picture, .card-media img { backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.flip-back {
  justify-content: center;
  padding: 28px;
  background:
    radial-gradient(90% 70% at 100% 0%, rgba(153, 230, 255, .14), transparent 70%),
    linear-gradient(160deg, var(--teal-strong), #0b3f45 70%, #10213a);
  border-color: rgba(4, 138, 129, .45);
  color: var(--white);
  transform: rotateY(180deg) translateZ(1px);
}
.flip-card:hover .flip-front { border-color: rgba(4, 138, 129, .55); box-shadow: 0 40px 70px -28px rgba(0, 0, 0, .85), 0 0 32px -8px rgba(4, 138, 129, .35); }

.card-media {
  position: relative;
  flex: 1;
  margin-bottom: 18px;
  overflow: visible;
}
.card-media picture { position: absolute; inset: 0; overflow: hidden; border-radius: 17px 17px 0 0; }
.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  transition: transform 1.1s cubic-bezier(.2, .7, .2, 1);
}
.card-media::after {
  /* fade the photo into the card surface */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, #1d1d32 0%, rgba(29, 29, 50, 0) 45%);
  border-radius: 17px 17px 0 0;
}
.flip-card:hover .card-media img { transform: scale(1.08); }
.card-badge {
  position: absolute;
  left: 20px;
  bottom: -14px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  border-radius: 12px;
  background: var(--ink);
  border: 1px solid rgba(4, 138, 129, .45);
  box-shadow: 0 10px 20px -8px rgba(0, 0, 0, .8);
}
.card-badge svg {
  width: 24px; height: 24px;
  fill: none; stroke: var(--sky); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.flip-front h3 { padding: 14px 20px 0; font-size: 1.25rem; font-weight: 600; color: var(--white); }
.back-title { font-size: 1.25rem; font-weight: 600; color: var(--sky); }
.flip-back p:not(.back-title) { margin-top: 10px; color: rgba(245, 245, 245, .9); }
.flip-hint { margin-top: 4px; padding: 0 20px; font-size: .9375rem; font-weight: 500; color: var(--sky); }
.flip-back .flip-hint { margin-top: auto; padding: 16px 0 0; }
.flip-toggle {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  border: 0;
  border-radius: 18px;
  background: transparent;
  cursor: pointer;
}
.flip-toggle:focus-visible { outline-color: var(--sky); outline-offset: 4px; }

@media (prefers-reduced-motion: reduce) {
  /* Swap faces without the 3D turn. */
  .flip-inner { transition: none; transform: none; }
  .flip-back { transform: none; visibility: hidden; }
  .flip-card.is-flipped .flip-back { visibility: visible; }
  .flip-card.is-flipped .flip-front { visibility: hidden; }
  .card-media img, .flip-card:hover .card-media img { transition: none; transform: none; }
}

/* Without JavaScript the cards can't flip, so show the description under the front. */
html:not(.js) .flip-card { height: auto; }
html:not(.js) .flip-face { position: static; transform: none; min-height: 0; visibility: visible; }
html:not(.js) .card-media { min-height: 180px; }
html:not(.js) .flip-toggle,
html:not(.js) .flip-hint { display: none; }

/* Contact */
.contact {
  position: relative;
  z-index: 1;
  margin-top: clamp(-72px, -6vw, -48px);
  background: var(--white);
  border-radius: 32px 32px 0 0;
  box-shadow: 0 -30px 60px -30px rgba(0, 0, 0, .55);
}
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: clamp(32px, 6vw, 80px);
  align-items: start;
}
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-info > p { margin-top: 16px; color: var(--muted); max-width: 44ch; }
.steps {
  display: grid;
  gap: 20px;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.steps li {
  display: grid;
  grid-template-columns: 40px 1fr;
  column-gap: 16px;
  counter-increment: step;
}
.steps li::before {
  content: counter(step);
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--sky);
  font-weight: 600;
}
.steps strong { font-weight: 600; font-size: 1.0625rem; }
.steps span { color: var(--muted); }

.contact-form {
  display: grid;
  gap: 18px;
  padding: clamp(24px, 4vw, 36px);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 520px) { .field-row { grid-template-columns: 1fr; } }
.field { display: grid; gap: 6px; }
.field label { font-weight: 500; }
.form-required { font-size: .9375rem; color: var(--muted); }
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--white);
  border: 1.5px solid #b9b9c6;
  border-radius: 10px;
}
.field textarea { resize: vertical; }
.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible { outline-offset: 0; border-color: var(--teal); }
.field [aria-invalid="true"] { border-color: #b3261e; }

/* Services: a checkbox list so visitors can pick one or more. */
.choice-group { margin: 0; padding: 0; border: 0; min-width: 0; }
.choice-group legend { padding: 0; font-weight: 500; }
.field-hint { margin-top: -2px; font-size: .875rem; color: var(--muted); }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
@media (max-width: 520px) { .choice-grid { grid-template-columns: 1fr; } }
.choice {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 14px;
  background: var(--white);
  border: 1.5px solid #b9b9c6;
  border-radius: 10px;
  font-weight: 400;
  cursor: pointer;
  transition: border-color .2s, background-color .2s;
}
.choice:hover { border-color: var(--teal); }
.choice:has(input:checked) { border-color: var(--teal-strong); background: #e8f5f3; }
.choice:has(input:focus-visible) { outline: 3px solid var(--teal); outline-offset: 2px; }
.field .choice input {
  flex: none;
  width: 20px;
  height: 20px;
  min-height: 0;
  margin: 0;
  padding: 0;
  accent-color: var(--teal-strong);
  cursor: pointer;
}
.field .choice input:focus-visible { outline: none; }
.choice-group[aria-invalid="true"] .choice { border-color: #b3261e; }

.form-status:empty { display: none; }
.form-status { padding: 12px 14px; border-radius: 10px; font-weight: 500; }
.form-status.is-success { background: #e3f5f3; color: var(--teal-strong); }
.form-status.is-error { background: #fdecea; color: #8c1d18; }

/* Footer */
.site-footer {
  padding: 40px 0;
  background: var(--white); /* logo PNG has a white background */
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .9375rem;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 40px;
}
.footer-brand { display: block; border-radius: 6px; transition: opacity .2s; }
.footer-brand:hover { opacity: .75; }
.footer-inner img { width: 112px; height: auto; }
.footer-nav { display: flex; gap: 24px; }
.footer-nav a { color: var(--text); font-weight: 500; text-decoration: none; }
.footer-nav a:hover { color: var(--teal-strong); }

.form-note { font-size: .875rem; color: var(--muted); text-align: center; }
.footer-legal { margin-left: auto; display: grid; gap: 4px; text-align: right; }
.footer-legal a { color: var(--muted); }
.todo { padding: 0 4px; border-radius: 4px; background: #fff3c4; color: #5c4400; font-weight: 600; }
@media (max-width: 640px) { .footer-legal { margin-left: 0; text-align: left; } }

/* Legal pages */
.legal { background: var(--white); padding-top: calc(clamp(64px, 9vw, 104px) + 100px); }
.legal-inner { max-width: 760px; }
.legal h1 { font-size: clamp(2rem, 4vw, 2.75rem); font-weight: 700; letter-spacing: -.015em; }
.legal h2 { margin-top: 36px; font-size: 1.375rem; font-weight: 600; letter-spacing: 0; }
.legal p, .legal ul { margin-top: 12px; }
.legal ul { padding-left: 1.25rem; }
.legal li + li { margin-top: 4px; }
.legal-meta { color: var(--muted); }
.nowrap { white-space: nowrap; }

/* Motion: hero entrance, parallax layers (moved by js/main.js) and scroll reveals. */
.hero picture { position: absolute; inset: 0; animation: photo-in 1.6s cubic-bezier(.2, .7, .2, 1) both; }
.hero-media, .hero-heading, .hero-actions { will-change: transform; }
.hero-heading > *, .hero-actions > .btn { animation: rise-in .9s cubic-bezier(.2, .7, .2, 1) both; }
.hero-heading > :nth-child(1) { animation-delay: .15s; }
.hero-heading > :nth-child(2) { animation-delay: .28s; }
.hero-heading > :nth-child(3) { animation-delay: .42s; }
.hero-actions > :nth-child(1) { animation-delay: .58s; }
.hero-actions > :nth-child(2) { animation-delay: .68s; }
@keyframes rise-in { from { opacity: 0; transform: translateY(28px); } }
@keyframes photo-in { from { opacity: 0; transform: scale(1.06); } }

.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity .8s ease, transform .9s cubic-bezier(.2, .7, .2, 1);
}
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .hero picture, .hero-heading > *, .hero-actions > .btn { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn:hover { transform: none; }
}
