/* CPTED Advisory Group — site styles
   Palette drawn from the logo: eucalypt green, harbour blue, ochre. */

:root {
  --ink: #16262b;
  --ink-soft: #3d5158;
  --paper: #f6f8f5;
  --white: #ffffff;
  --mist: #e4ece7;
  --line: #c7d3cc;
  --eucalypt: #1e6a46;
  --eucalypt-dark: #144d32;
  --harbour: #0c4c86;
  --harbour-dark: #083763;
  --ochre: #c46f12;
  --light: #f4c95d;
  --ok: #1e6a46;
  --err: #b3261e;

  --font-head: "Archivo", "Arial Narrow", Arial, sans-serif;
  --font-body: "Atkinson Hyperlegible", "Segoe UI", Arial, sans-serif;

  --step--1: 0.889rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.6rem;
  --step-3: 2.2rem;
  --step-4: clamp(2.6rem, 6vw, 4.4rem);

  --wrap: 1180px;
  --gap: clamp(1rem, 3vw, 2rem);
  --radius: 6px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 88px; }

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

img { max-width: 100%; height: auto; display: block; }

a { color: var(--harbour); text-underline-offset: 3px; }
a:hover { color: var(--harbour-dark); }

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

h1, h2, h3 {
  font-family: var(--font-head);
  font-stretch: 112%;
  line-height: 1.12;
  margin: 0 0 0.6em;
  letter-spacing: -0.01em;
}
h1 { font-size: var(--step-4); font-weight: 800; letter-spacing: -0.025em; }
h2 { font-size: var(--step-3); font-weight: 750; }
h3 { font-size: var(--step-1); font-weight: 700; }

p { margin: 0 0 1em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gap); }
.narrow { max-width: 760px; }

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

.small { font-size: var(--step--1); }
.opt { font-weight: 400; color: var(--ink-soft); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-head);
  font-stretch: 105%;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.85rem 1.4rem;
  border-radius: var(--radius);
  border: 2px solid var(--eucalypt);
  background: var(--eucalypt);
  color: var(--white);
  text-decoration: none;
  cursor: pointer;
  line-height: 1.2;
}
.btn:hover { background: var(--eucalypt-dark); border-color: var(--eucalypt-dark); color: var(--white); }
.btn-quiet { background: transparent; color: var(--eucalypt); }
.btn-quiet:hover { background: var(--mist); color: var(--eucalypt-dark); }
.btn-line { background: var(--white); color: var(--eucalypt); }
.btn-line:hover { background: var(--eucalypt); color: var(--white); }
.btn-light { background: var(--white); border-color: var(--white); color: var(--harbour); }
.btn-light:hover { background: var(--mist); border-color: var(--mist); color: var(--harbour-dark); }
.btn-small { padding: 0.55rem 1rem; font-size: 0.95rem; }
.btn[disabled] { opacity: 0.6; cursor: wait; }

/* ---------- Header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 50;
  background: rgba(246, 248, 245, 0.96);
  border-bottom: 1px solid var(--line);
}
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 76px; }
.brand img { width: 220px; height: auto; }
.site-nav { display: flex; align-items: center; gap: 1.4rem; }
.site-nav a:not(.btn) { color: var(--ink); text-decoration: none; font-weight: 700; font-size: 0.98rem; }
.site-nav a:not(.btn):hover { color: var(--eucalypt); text-decoration: underline; }
.nav-toggle { display: none; }

@media (max-width: 960px) {
  .nav-toggle {
    display: inline-block; font: inherit; font-weight: 700;
    background: none; border: 2px solid var(--ink); border-radius: var(--radius);
    padding: 0.4rem 0.9rem; color: var(--ink); cursor: pointer;
  }
  .site-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--line);
    padding: 0.5rem var(--gap) 1rem;
    display: none;
  }
  .site-nav.open { display: flex; }
  .site-nav a:not(.btn) { padding: 0.8rem 0; border-bottom: 1px solid var(--mist); }
  .site-nav .btn { margin-top: 0.8rem; text-align: center; }
  .brand img { width: 160px; }
}

/* ---------- Hero ---------- */
.hero { padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(2.5rem, 5vw, 4rem); }
.hero-grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.hero h1 { max-width: 11ch; }
.lead { font-size: var(--step-1); line-height: 1.55; max-width: 34em; color: var(--ink-soft); }
.lead-sm { font-size: var(--step-1); line-height: 1.55; }
.actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin: 1.6rem 0 1.2rem; }
.hero-area { font-size: var(--step--1); color: var(--ink-soft); max-width: 34em; }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
}

/* Plan-view diagram */
.planview { margin: 0; }
.planview svg { width: 100%; height: auto; display: block; border-radius: var(--radius); background: var(--white); border: 1px solid var(--line); }
.pv-lot { fill: var(--mist); }
.pv-street { fill: #d5ddd8; }
.pv-lane { stroke: var(--white); stroke-width: 3; stroke-dasharray: 18 14; }
.pv-building { fill: var(--white); stroke: var(--ink); stroke-width: 2; }
.pv-window { fill: var(--harbour); }
.pv-path { stroke: #b9c6bf; stroke-width: 22; fill: none; }
.pv-carpark { fill: #d9e1dc; stroke: var(--ink-soft); stroke-width: 1.5; }
.pv-bays line { stroke: var(--white); stroke-width: 2; }
.pv-glow { mix-blend-mode: multiply; }
.pv-pole { fill: var(--ink); }
.pv-hedge { fill: var(--eucalypt); }
.pv-bins { fill: #c3ccc7; stroke: var(--ink-soft); stroke-width: 1.5; }
.pv-label { font-family: var(--font-body); font-size: 13px; fill: var(--ink-soft); }
.pv-label-strong { font-family: var(--font-head); font-weight: 700; font-size: 16px; fill: var(--ink); }
.pv-label-street { fill: var(--ink); font-weight: 700; }
.pv-cone { fill: var(--harbour); fill-opacity: 0.16; stroke: var(--harbour); stroke-opacity: 0.55; stroke-width: 1.5; }
.pv-shadow { fill: var(--ink); fill-opacity: 0.22; }
.pv-ring { fill: var(--white); stroke: var(--ochre); stroke-width: 3; }
.pv-num { font-family: var(--font-head); font-weight: 800; font-size: 17px; fill: var(--ochre); }

.planview figcaption { margin-top: 0.9rem; font-size: var(--step--1); }
.cap-lead { font-weight: 700; display: block; margin-bottom: 0.3rem; }
.findings { margin: 0; padding-left: 1.3rem; color: var(--ink-soft); }
.findings li::marker { color: var(--ochre); font-weight: 700; }

/* The one orchestrated moment: the sightline is drawn, then the findings appear. */
@media (prefers-reduced-motion: no-preference) {
  .pv-cone-wrap { transform-origin: 172px 194px; animation: sweep 1.4s cubic-bezier(.2,.7,.2,1) 0.3s both; }
  .pv-shadow { animation: fadein 0.6s ease 1.5s both; }
  .pv-find { animation: pop 0.45s cubic-bezier(.3,1.4,.5,1) both; transform-box: fill-box; transform-origin: center; }
  .pv-find-1 { animation-delay: 1.9s; }
  .pv-find-2 { animation-delay: 2.2s; }
  .pv-find-3 { animation-delay: 2.5s; }
}
@keyframes sweep { from { transform: scaleY(0); opacity: 0; } to { transform: scaleY(1); opacity: 1; } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { transform: scale(0.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---------- Bands ---------- */
.band { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.band-mist { background: var(--mist); }
.band-ink { background: var(--ink); color: #e9efec; }
.band-ink h2, .band-ink h3 { color: var(--white); }
.band-harbour { background: var(--harbour); color: #eaf2fa; }
.band-harbour h2, .band-harbour h3 { color: var(--white); }
.section-lead { font-size: var(--step-1); max-width: 40em; color: var(--ink-soft); margin-bottom: 2rem; }
.band-ink .section-lead { color: #c3d0ca; }
.page-top { padding-top: clamp(2.5rem, 5vw, 4rem); }
.page-h { font-size: var(--step-3); }

/* ---------- Who we work with ---------- */
.who-table { border-top: 2px solid var(--ink); }
.who-row {
  display: grid; grid-template-columns: 1fr 1.3fr 1.5fr; gap: 1.5rem;
  padding: 1.2rem 0; border-bottom: 1px solid var(--line);
}
.who-row strong { font-family: var(--font-head); font-stretch: 108%; font-size: 1.08rem; }
.who-head { font-size: var(--step--1); color: var(--ink-soft); font-weight: 700; padding: 0.7rem 0; }
@media (max-width: 760px) {
  .who-row { grid-template-columns: 1fr; gap: 0.4rem; }
  .who-head { display: none; }
}

/* ---------- Services ---------- */
.services { border-top: 2px solid var(--ink); }
.service {
  display: grid; grid-template-columns: minmax(200px, 0.9fr) minmax(0, 1.7fr) 220px;
  column-gap: clamp(1.5rem, 3vw, 2.5rem);
  padding: 2rem 0; border-bottom: 1px solid var(--line);
}
.svc-main { display: contents; }
.service h3 { font-size: var(--step-2); grid-column: 1; grid-row: 1 / span 2; margin: 0; }
.svc-main p { grid-column: 2; grid-row: 1; }
.svc-main .ticks { grid-column: 2; grid-row: 2; }
.svc-side { grid-column: 3; grid-row: 1 / span 2; display: flex; flex-direction: column; align-items: flex-start; gap: 0.8rem; padding-top: 0.2rem; }
.price { font-family: var(--font-head); font-stretch: 110%; font-weight: 800; font-size: var(--step-1); color: var(--eucalypt); margin: 0; }
.ticks { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.35rem; }
.ticks li { padding-left: 1.6rem; position: relative; }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: 0.5em;
  width: 0.75rem; height: 0.42rem; border-left: 3px solid var(--eucalypt); border-bottom: 3px solid var(--eucalypt);
  transform: rotate(-45deg);
}
@media (max-width: 960px) {
  .service { grid-template-columns: minmax(0, 1fr) 200px; }
  .service h3 { grid-column: 1; grid-row: 1; margin-bottom: 0.6rem; }
  .svc-main p { grid-row: 2; grid-column: 1; }
  .svc-main .ticks { grid-row: 3; grid-column: 1; }
  .svc-side { grid-column: 2; grid-row: 1 / span 3; }
}
@media (max-width: 640px) {
  .service { grid-template-columns: 1fr; }
  .svc-side { grid-column: 1; grid-row: 4; margin-top: 1rem; }
}

/* ---------- Principles ---------- */
.principles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
.principle { margin: 0; }
.principle img { aspect-ratio: 4 / 5; object-fit: cover; width: 100%; border-radius: var(--radius); }
.principle figcaption { padding-top: 1rem; }
.principle p { color: #c3d0ca; font-size: 0.98rem; }
.principle h3 { border-top: 3px solid var(--light); padding-top: 0.7rem; display: inline-block; }
@media (max-width: 960px) { .principles { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .principles { grid-template-columns: 1fr; } .principle img { aspect-ratio: 3 / 2; } }

/* ---------- Steps ---------- */
.steps { list-style: none; counter-reset: step; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 1.4rem; position: relative; }
.steps::before {
  content: ""; position: absolute; top: 1.3rem; left: 1.3rem; right: 1.3rem;
  height: 2px; background: var(--line); z-index: 0;
}
.steps li { counter-increment: step; position: relative; z-index: 1; }
.steps li::before {
  content: counter(step);
  display: grid; place-items: center;
  width: 2.6rem; height: 2.6rem; border-radius: 50%;
  background: var(--paper); border: 2px solid var(--eucalypt); color: var(--eucalypt);
  font-family: var(--font-head); font-weight: 800; margin-bottom: 1rem;
}
.steps p { font-size: 0.98rem; color: var(--ink-soft); }
@media (max-width: 900px) {
  .steps { grid-template-columns: 1fr; }
  .steps::before { top: 0; bottom: 0; left: 1.25rem; right: auto; width: 2px; height: auto; }
  .steps li { padding-left: 3.6rem; }
  .steps li::before { position: absolute; left: 0; top: 0; }
}

/* ---------- Conveyancers ---------- */
.conv-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(2rem, 5vw, 4rem); }
.script {
  margin: 1.6rem 0 0; padding: 1.4rem 1.6rem;
  background: rgba(255, 255, 255, 0.1); border-left: 4px solid var(--light); border-radius: 0 var(--radius) var(--radius) 0;
}
.script p { font-size: var(--step-1); line-height: 1.5; color: var(--white); }
.script footer { font-size: var(--step--1); color: #bcd2e8; }
.conv-side h3 { font-size: 1.1rem; margin-top: 1.2rem; }
.conv-side h3:first-child { margin-top: 0; }
.conv-side .btn { margin-top: 0.8rem; }
@media (max-width: 860px) { .conv-grid { grid-template-columns: 1fr; } }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(2rem, 5vw, 4rem); }
.creds { padding-left: 1.2rem; margin: 0; display: grid; gap: 0.4rem; }
.creds li::marker { color: var(--eucalypt); }
@media (max-width: 860px) { .about-grid { grid-template-columns: 1fr; } }

/* ---------- Forms ---------- */
.enquire-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
@media (max-width: 900px) { .enquire-grid { grid-template-columns: 1fr; } }

.form { display: grid; gap: 1.1rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
@media (max-width: 620px) { .field-row { grid-template-columns: 1fr; } }
.field label { display: block; font-weight: 700; margin-bottom: 0.35rem; }
.field input[type="text"], .field input[type="email"], .field input[type="tel"], .field input[type="password"],
.field select, .field textarea {
  width: 100%; font: inherit; color: var(--ink);
  padding: 0.7rem 0.8rem; background: var(--white);
  border: 2px solid var(--line); border-radius: var(--radius);
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--harbour); outline: 3px solid rgba(196, 111, 18, 0.45); outline-offset: 1px; }
.field.has-err input, .field.has-err select, .field.has-err textarea { border-color: var(--err); }
.field-err { color: var(--err); font-size: var(--step--1); margin: 0.3rem 0 0; min-height: 0; }
.field-err:empty { display: none; }
.check { display: grid; grid-template-columns: auto 1fr; gap: 0.6rem; align-items: start; }
.check input { width: 1.25rem; height: 1.25rem; margin-top: 0.2rem; accent-color: var(--eucalypt); }
.check label { font-weight: 400; margin: 0; }
.check .field-err { grid-column: 1 / -1; }
.form .btn { justify-self: start; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-result { margin-bottom: 1.4rem; }
.ok { background: #e1f0e7; border-left: 4px solid var(--ok); padding: 1rem 1.2rem; border-radius: 0 var(--radius) var(--radius) 0; }
.err { background: #fbe9e7; border-left: 4px solid var(--err); padding: 1rem 1.2rem; border-radius: 0 var(--radius) var(--radius) 0; }

.next { background: var(--mist); padding: 1.6rem; border-radius: var(--radius); }
.next ol { padding-left: 1.2rem; margin: 0 0 1.2rem; display: grid; gap: 0.4rem; }

/* ---------- Tracker ---------- */
.track-form { margin-bottom: 1.5rem; }
.track-result { margin-top: 2rem; padding-top: 1.5rem; border-top: 2px solid var(--ink); }
.status { display: inline-block; padding: 0.15rem 0.6rem; border-radius: 99px; font-weight: 700; font-size: 0.92rem; background: var(--mist); }
.s-new { background: #dfe9f5; color: var(--harbour-dark); }
.s-report-issued, .s-closed { background: #e1f0e7; color: var(--eucalypt-dark); }
.s-not-proceeding { background: #eee; color: #555; }
.timeline { list-style: none; padding: 0; margin: 1.5rem 0 0; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 1.4rem 1.4rem; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 0.45rem; width: 12px; height: 12px; border-radius: 50%; background: var(--eucalypt); }
.timeline time { display: block; font-size: var(--step--1); color: var(--ink-soft); }
.timeline p { margin: 0.2rem 0 0; }

.prose h2 { font-size: var(--step-1); margin-top: 1.8rem; }
.prose p { max-width: 40em; }

/* ---------- Footer ---------- */
.site-foot { background: var(--ink); color: #c8d4cf; padding: 3.5rem 0 1.5rem; }
.site-foot a { color: var(--white); }
.foot-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 2.5rem; }
.foot-mark { width: 56px; height: auto; margin-bottom: 1rem; }
.foot-h { font-size: 1rem; color: var(--white); margin-bottom: 0.6rem; }
.ack { max-width: 34em; }
.foot-links { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.3rem; }
.foot-base { margin-top: 2.5rem; padding-top: 1.2rem; border-top: 1px solid #2f4248; }
@media (max-width: 800px) { .foot-grid { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* Device history on tracker */
.device-history { margin: 1.5rem 0; padding: 1.2rem 1.4rem; background: var(--mist); border-radius: var(--radius); }
.linkish { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--harbour); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.linkish.small { font-weight: 400; margin-top: 0.6rem; }

/* ---------- Website assistant ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.chat { position: fixed; right: 1.2rem; bottom: 1.2rem; z-index: 80; }
.chat-open {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-head); font-stretch: 105%; font-weight: 700; font-size: 1rem;
  padding: 0.8rem 1.2rem; border-radius: 99px; border: 0;
  background: var(--harbour); color: var(--white); cursor: pointer;
  box-shadow: 0 6px 20px rgba(12, 76, 134, 0.35);
}
.chat-open:hover { background: var(--harbour-dark); }
.chat.is-open .chat-open { display: none; }
.chat-panel {
  width: min(400px, calc(100vw - 2rem)); height: min(620px, calc(100vh - 2.4rem));
  display: flex; flex-direction: column;
  background: var(--white); border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  box-shadow: 0 18px 50px rgba(22, 38, 43, 0.28);
}
.chat-panel[hidden] { display: none; }
.chat-head { display: flex; gap: 0.8rem; align-items: flex-start; justify-content: space-between; padding: 1rem 1.1rem; background: var(--harbour); color: #eaf2fa; }
.chat-head h2 { font-size: 1.05rem; margin: 0 0 0.2rem; color: var(--white); }
.chat-head p { font-size: 0.82rem; margin: 0; line-height: 1.4; }
.chat-close { background: none; border: 0; color: var(--white); font-size: 1.8rem; line-height: 1; cursor: pointer; padding: 0 0.2rem; }
.chat-log { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 0.7rem; background: var(--paper); }
.msg { max-width: 88%; padding: 0.65rem 0.9rem; border-radius: 12px; font-size: 0.97rem; line-height: 1.5; }
.msg p { margin: 0 0 0.4em; } .msg p:last-child { margin: 0; }
.msg ul { margin: 0.2em 0 0.4em; padding-left: 1.2rem; }
.msg.bot { background: var(--white); border: 1px solid var(--line); align-self: flex-start; border-bottom-left-radius: 4px; }
.msg.me { background: var(--eucalypt); color: var(--white); align-self: flex-end; border-bottom-right-radius: 4px; }
.typing p { display: flex; gap: 4px; padding: 0.3rem 0; }
.typing span:not(.sr-only) { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-soft); opacity: 0.4; }
@media (prefers-reduced-motion: no-preference) {
  .typing span:not(.sr-only) { animation: blink 1s infinite; }
  .typing span:nth-child(2) { animation-delay: 0.15s; } .typing span:nth-child(3) { animation-delay: 0.3s; }
}
@keyframes blink { 50% { opacity: 1; } }
.chips { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.chip {
  font: inherit; font-size: 0.9rem; padding: 0.4rem 0.8rem; border-radius: 99px; cursor: pointer;
  background: var(--white); color: var(--harbour); border: 1.5px solid var(--harbour);
}
.chip:hover { background: var(--harbour); color: var(--white); }
.slots .chip { color: var(--eucalypt); border-color: var(--eucalypt); }
.slots .chip:hover { background: var(--eucalypt); color: var(--white); }
.chat-form { display: flex; gap: 0.5rem; padding: 0.7rem; border-top: 1px solid var(--line); background: var(--white); }
.chat-form textarea { flex: 1; resize: none; font: inherit; font-size: 0.97rem; padding: 0.55rem 0.7rem; border: 2px solid var(--line); border-radius: 8px; max-height: 120px; }
.chat-form textarea:focus { border-color: var(--harbour); outline: none; }
.chat-send { font: inherit; font-weight: 700; padding: 0 1rem; border: 0; border-radius: 8px; background: var(--eucalypt); color: var(--white); cursor: pointer; }
.chat-send[disabled] { opacity: 0.5; cursor: wait; }
.chat-foot { margin: 0; padding: 0 0.9rem 0.7rem; font-size: 0.75rem; color: var(--ink-soft); background: var(--white); }
@media (max-width: 520px) {
  .chat { right: 0.8rem; bottom: 0.8rem; }
  .chat.is-open { inset: 0; }
  .chat.is-open .chat-panel { width: 100vw; height: 100dvh; border-radius: 0; }
}
