/* Kalifa Architecture — site styles
   Concept: a drawing sheet. Cool detail-paper ground, graphite linework,
   and one signature element — the Kalifa red line (the demise line on a lease plan). */

:root {
  --paper: #eff1ee;
  --sheet: #f8f9f7;
  --ink: #1b1e21;
  --graphite: #565c61;
  --rule: rgba(27, 30, 33, 0.16);
  --rule-strong: rgba(27, 30, 33, 0.34);
  --red: #a50a1f;
  --red-deep: #82071a;
  --on-red: #ffffff;

  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;

  --gutter: clamp(16px, 3.2vw, 44px);
  --max: 1440px;
  --header-h: 68px;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  --step--1: 0.8125rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: clamp(1.5rem, 1.2rem + 1.1vw, 2.1rem);
  --step-3: clamp(1.9rem, 1.3rem + 2.3vw, 3.3rem);
  --step-4: clamp(2.35rem, 1.2rem + 4.3vw, 5.4rem);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 24px);
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.6;
  font-variation-settings: "wdth" 100;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

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

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }

button, input, select, textarea { font: inherit; color: inherit; }

::selection { background: var(--red); color: var(--on-red); }

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

.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: var(--gutter);
  top: -100px;
  z-index: 200;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  text-decoration: none;
}
.skip-link:focus { top: 10px; }

.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Type ---------- */

.display,
h1, h2, h3 {
  font-weight: 600;
  font-variation-settings: "wdth" 118;
  letter-spacing: -0.012em;
  text-transform: uppercase;
  margin: 0;
  text-wrap: balance;
}

h1 { font-size: var(--step-4); line-height: 0.98; }
h2 { font-size: var(--step-3); line-height: 1.02; }
h3 { font-size: var(--step-1); line-height: 1.2; letter-spacing: 0; }

p { margin: 0 0 1em; max-width: 64ch; }
p:last-child { margin-bottom: 0; }

.lead { font-size: var(--step-1); line-height: 1.5; color: var(--ink); max-width: 46ch; }
.muted { color: var(--graphite); }

/* Small structural label: sheet number + name. Sentence case, expanded, tabular numerals. */
.sheet-label {
  display: inline-flex;
  align-items: baseline;
  gap: 0.75em;
  font-size: var(--step--1);
  font-weight: 600;
  font-variation-settings: "wdth" 112;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--graphite);
}
.sheet-label b { color: var(--red); font-weight: 700; }

/* ---------- Buttons & links ---------- */

.btn {
  --h: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  min-height: var(--h);
  padding: 0 1.4em;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 600;
  font-variation-settings: "wdth" 112;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  transition: color 0.35s var(--ease), border-color 0.35s var(--ease);
}
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--ink);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.45s var(--ease);
}
.btn:hover { color: var(--paper); }
.btn:hover::before { transform: scaleY(1); }
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--red);
  border-color: var(--red);
  color: var(--on-red);
}
.btn--primary::before { background: var(--red-deep); }
.btn--primary:hover { color: var(--on-red); border-color: var(--red-deep); }

.btn[disabled] { opacity: 0.6; cursor: progress; }

.btn--wa .wa-icon { width: 19px; height: 19px; flex: none; transition: transform 0.4s var(--ease); }
.btn--wa:hover .wa-icon { transform: rotate(-8deg) scale(1.08); }

.btn .tick {
  width: 18px; height: 1px; background: currentColor;
  transition: width 0.35s var(--ease);
}
.btn:hover .tick { width: 28px; }

/* Text link with a red line that draws from the left */
.line-link {
  display: inline-block;
  position: relative;
  font-weight: 600;
  font-variation-settings: "wdth" 112;
  text-decoration: none;
  padding-bottom: 4px;
  background: linear-gradient(var(--rule-strong), var(--rule-strong)) left bottom / 100% 1px no-repeat;
}
.line-link::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  height: 2px; width: 100%;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s var(--ease);
}
.line-link:hover::after,
.line-link:focus-visible::after { transform: scaleX(1); }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}

.site-header__inner {
  height: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: stretch;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: clamp(16px, 2.5vw, 36px);
  text-decoration: none;
  color: var(--ink);
}
.brand svg { width: 30px; height: auto; flex: none; }
.brand__word { display: grid; line-height: 1; }
.brand__name {
  font-size: 1.06rem;
  font-weight: 600;
  font-variation-settings: "wdth" 125;
  letter-spacing: 0.42em;
  margin-right: -0.42em;
}
.brand__sub {
  margin-top: 5px;
  font-size: 0.56rem;
  font-weight: 500;
  font-variation-settings: "wdth" 125;
  letter-spacing: 0.44em;
  color: var(--graphite);
}

.nav { display: flex; align-items: stretch; border-left: 1px solid var(--rule); }
.nav a {
  display: flex;
  align-items: center;
  padding: 0 clamp(12px, 1.4vw, 22px);
  border-right: 1px solid var(--rule);
  font-size: 0.875rem;
  font-weight: 500;
  font-variation-settings: "wdth" 108;
  text-decoration: none;
  position: relative;
  transition: color 0.25s, background-color 0.25s;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease);
}
.nav a:hover { background: var(--sheet); }
.nav a:hover::after,
.nav a[aria-current="page"]::after { transform: scaleX(1); }

.header-phone {
  display: flex;
  align-items: center;
  padding: 0 clamp(14px, 1.6vw, 24px);
  font-size: 0.875rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
  border-right: 1px solid var(--rule);
}
.header-phone:hover { color: var(--red); }

.header-cta {
  display: flex;
  align-items: center;
  padding-left: clamp(12px, 1.6vw, 24px);
}
.header-cta .btn { --h: 44px; padding: 0 1.1em; font-size: 0.875rem; }

.menu-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  margin-left: 12px;
  padding: 0 4px 0 14px;
  border: 0;
  border-left: 1px solid var(--rule);
  background: none;
  font-size: 0.875rem;
  font-weight: 600;
  font-variation-settings: "wdth" 112;
  cursor: pointer;
  min-width: 44px;
}
.menu-toggle__lines { display: grid; gap: 5px; width: 20px; }
.menu-toggle__lines span {
  display: block; height: 1.5px; background: var(--ink);
  transition: transform 0.4s var(--ease), opacity 0.2s;
}
.menu-open .menu-toggle__lines span:first-child { transform: translateY(3.25px) rotate(45deg); }
.menu-open .menu-toggle__lines span:last-child { transform: translateY(-3.25px) rotate(-45deg); }

@media (max-width: 1100px) {
  .header-phone { display: none; }
}

@media (max-width: 900px) {
  :root { --header-h: 60px; }
  .nav { display: none; }
  .site-header__inner { grid-template-columns: auto 1fr auto auto; }
  .menu-toggle { display: inline-flex; grid-column: 4; }
  .header-cta { grid-column: 3; padding-left: 0; }
  .header-cta .btn { --h: 40px; font-size: 0.8125rem; padding: 0 0.9em; }
  .brand svg { width: 26px; }
  .brand__name { font-size: 0.95rem; letter-spacing: 0.34em; margin-right: -0.34em; }
  .brand__sub { font-size: 0.5rem; letter-spacing: 0.36em; }
}

@media (max-width: 420px) {
  .header-cta .btn .long { display: none; }
  .menu-toggle__text { display: none; }
}

/* Mobile menu panel */
.menu-panel {
  position: fixed;
  inset: var(--header-h) 0 0 0;
  z-index: 99;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  padding: 8px var(--gutter) max(24px, env(safe-area-inset-bottom));
  overflow-y: auto;
  clip-path: inset(0 0 100% 0);
  visibility: hidden;
  transition: clip-path 0.55s var(--ease-in-out), visibility 0s linear 0.55s;
}
.menu-open .menu-panel {
  clip-path: inset(0 0 0 0);
  visibility: visible;
  transition: clip-path 0.55s var(--ease-in-out), visibility 0s;
}
.menu-panel nav { display: grid; }
.menu-panel nav a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
  font-size: clamp(1.6rem, 7vw, 2.3rem);
  font-weight: 600;
  font-variation-settings: "wdth" 120;
  text-transform: uppercase;
  line-height: 1.05;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.4s var(--ease), transform 0.5s var(--ease), color 0.2s;
}
.menu-panel nav a small {
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--graphite);
  font-variant-numeric: tabular-nums;
  text-transform: none;
}
.menu-panel nav a[aria-current="page"] { color: var(--red); }
.menu-open .menu-panel nav a { opacity: 1; transform: none; }
.menu-open .menu-panel nav a:nth-child(1) { transition-delay: 0.12s; }
.menu-open .menu-panel nav a:nth-child(2) { transition-delay: 0.16s; }
.menu-open .menu-panel nav a:nth-child(3) { transition-delay: 0.2s; }
.menu-open .menu-panel nav a:nth-child(4) { transition-delay: 0.24s; }
.menu-open .menu-panel nav a:nth-child(5) { transition-delay: 0.28s; }
.menu-open .menu-panel nav a:nth-child(6) { transition-delay: 0.32s; }

.menu-panel__contact {
  margin-top: auto;
  padding-top: 28px;
  display: grid;
  gap: 12px;
}
.menu-panel__contact .btn { width: 100%; }
.menu-panel__contact p { margin: 8px 0 0; font-size: var(--step--1); color: var(--graphite); }

@media (min-width: 901px) {
  .menu-panel { display: none; }
}

body.menu-locked { overflow: hidden; }

/* ---------- Hero ---------- */

.hero {
  border-bottom: 1px solid var(--rule);
}
.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  min-height: calc(100svh - var(--header-h));
  max-height: 1000px;
}
.hero__copy {
  display: flex;
  flex-direction: column;
  padding: clamp(32px, 6vh, 72px) clamp(20px, 3vw, 48px) 0 0;
  border-right: 1px solid var(--rule);
}
/* Sized so the longest line ("lease plans") always fits its column */
.hero__copy h1 { margin: 22px 0 26px; font-size: clamp(2.4rem, 5.3vw, 5.6rem); }
.hero__copy .lead { margin-bottom: 32px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Drawing title block — real practice data, laid out like a sheet's title block */
.title-block {
  margin-top: auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--rule);
  margin-right: calc(-1 * clamp(20px, 3vw, 48px));
}
.title-block div {
  padding: 14px 14px 18px 0;
  border-right: 1px solid var(--rule);
}
.title-block div + div { padding-left: 14px; }
.title-block div:last-child { border-right: 0; }
.title-block dt {
  font-size: 0.72rem;
  font-weight: 600;
  font-variation-settings: "wdth" 112;
  color: var(--graphite);
  margin-bottom: 6px;
}
.title-block dd {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
}
.title-block a { text-decoration: none; }
.title-block a:hover { color: var(--red); }

.hero__drawing {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(36px, 5vw, 64px) clamp(28px, 4vw, 64px);
  overflow: hidden;
}

.plan-frame {
  position: relative;
  height: min(100%, 820px);
  max-height: calc(100svh - var(--header-h) - 96px);
  aspect-ratio: 2284 / 3313;
  max-width: 100%;
  cursor: crosshair;
}
.plan-frame picture,
.plan-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.plan-frame img { display: block; }

.redline-box { position: absolute; inset: -12px; pointer-events: none; }
.redline-box i { position: absolute; background: var(--red); }
.redline-box i:nth-child(1) { top: 0; left: 0; right: 0; height: 1.5px; transform-origin: left; }
.redline-box i:nth-child(2) { top: 0; bottom: 0; right: 0; width: 1.5px; transform-origin: top; }
.redline-box i:nth-child(3) { bottom: 0; left: 0; right: 0; height: 1.5px; transform-origin: right; }
.redline-box i:nth-child(4) { top: 0; bottom: 0; left: 0; width: 1.5px; transform-origin: bottom; }

/* Grid references along the frame — the hover detail reads them */
.grid-refs {
  position: absolute;
  font-size: 0.68rem;
  font-weight: 600;
  font-variation-settings: "wdth" 112;
  color: var(--graphite);
  display: flex;
  pointer-events: none;
}
.grid-refs span { flex: 1; text-align: center; transition: color 0.2s; }
.grid-refs span.is-active { color: var(--red); }
.grid-refs--x { left: 0; right: 0; top: -40px; }
.grid-refs--y { top: 0; bottom: 0; left: -40px; flex-direction: column; width: 14px; }
.grid-refs--y span { display: flex; align-items: center; justify-content: center; }

.crosshair {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s;
}
.crosshair.is-on { opacity: 1; }
.crosshair::before,
.crosshair::after {
  content: "";
  position: absolute;
  background: var(--red);
  opacity: 0.55;
}
.crosshair::before { left: 0; right: 0; top: var(--y, 50%); height: 1px; }
.crosshair::after { top: 0; bottom: 0; left: var(--x, 50%); width: 1px; }
/* Autopilot: lines glide between grid references; pointer tracking stays instant */
.crosshair.is-auto::before { transition: top 1.9s var(--ease-in-out); }
.crosshair.is-auto::after { transition: left 1.9s var(--ease-in-out); }
.crosshair.is-auto .crosshair__tag { transition: left 1.9s var(--ease-in-out), top 1.9s var(--ease-in-out); }
.crosshair__tag {
  position: absolute;
  left: var(--x, 50%);
  top: var(--y, 50%);
  transform: translate(10px, -130%);
  background: var(--ink);
  color: var(--paper);
  font-size: 0.7rem;
  font-weight: 600;
  font-variation-settings: "wdth" 112;
  padding: 3px 7px;
  white-space: nowrap;
}

.plan-caption {
  position: absolute;
  right: clamp(16px, 2vw, 28px);
  bottom: 14px;
  font-size: 0.75rem;
  color: var(--graphite);
}

/* Hero load sequence — only when JS is running and motion is allowed */
.js .hero h1 .line { display: block; overflow: hidden; padding-bottom: 0.04em; }
.js .hero h1 .line > span { display: block; }

@media (prefers-reduced-motion: no-preference) {
  .js .hero h1 .line > span {
    transform: translateY(105%);
    animation: rise 0.9s var(--ease) forwards;
  }
  .js .hero h1 .line:nth-child(2) > span { animation-delay: 0.08s; }
  .js .hero h1 .line:nth-child(3) > span { animation-delay: 0.16s; }
  .js .hero h1 .line:nth-child(4) > span { animation-delay: 0.24s; }

  .js .hero .fade-in { opacity: 0; animation: fade 0.8s var(--ease) 0.35s forwards; }

  .js .plan-frame picture {
    clip-path: inset(0 0 100% 0);
    animation: wipe 1.3s var(--ease-in-out) 0.25s forwards;
  }
  .js .redline-box i:nth-child(odd) { transform: scaleX(0); animation: grow 0.45s var(--ease-in-out) forwards; }
  .js .redline-box i:nth-child(even) { transform: scaleY(0); animation: grow 0.6s var(--ease-in-out) forwards; }
  .js .redline-box i:nth-child(1) { animation-delay: 0.9s; }
  .js .redline-box i:nth-child(2) { animation-delay: 1.32s; }
  .js .redline-box i:nth-child(3) { animation-delay: 1.9s; }
  .js .redline-box i:nth-child(4) { animation-delay: 2.32s; }
  .js .grid-refs { opacity: 0; animation: fade 0.6s ease 1.6s forwards; }
}

/* Failsafe: site.js adds .hero-settled after the sequence so content can never stay hidden */
.hero-settled .hero h1 .line > span,
.hero-settled .hero .fade-in,
.hero-settled .plan-frame picture,
.hero-settled .redline-box i,
.hero-settled .grid-refs {
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
  clip-path: none !important;
}

@keyframes rise { to { transform: none; } }
@keyframes fade { to { opacity: 1; } }
@keyframes wipe { to { clip-path: inset(0 0 0 0); } }
@keyframes grow { to { transform: none; } }

@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; min-height: 0; max-height: none; }
  .hero__copy { border-right: 0; padding: 36px 0 0; }
  .hero__copy h1 { font-size: clamp(2.3rem, 10.4vw, 4.6rem); }
  .title-block { margin-right: 0; grid-template-columns: 1fr 1fr; margin-top: 36px; }
  .title-block div:nth-child(2) { border-right: 0; }
  .title-block div:nth-child(3) { padding-left: 0; }
  .title-block div:nth-child(n+3) { border-top: 1px solid var(--rule); }
  .hero__drawing {
    border-top: 1px solid var(--rule);
    padding: 56px 40px 52px;
    margin-inline: calc(-1 * var(--gutter));
  }
  .plan-frame { height: auto; width: min(100%, 520px); max-height: none; cursor: default; }
}

/* Small screens: keep the drawing on the first screen — copy, actions, drawing, then title block */
@media (max-width: 900px) {
  .hero__grid { display: flex; flex-direction: column; }
  .hero__copy { display: contents; }
  .hero__copy .sheet-label { padding-top: 28px; align-self: flex-start; }
  .hero__copy h1 { margin: 16px 0 18px; }
  .hero__drawing { order: 1; margin-top: 32px; }
  .title-block { order: 2; margin-top: 0; }
}

@media (max-width: 480px) {
  .hero__copy .lead { font-size: 1.06rem; margin-bottom: 22px; }
  .hero__actions { gap: 10px; }
  .hero__actions .btn { flex: 1 1 100%; --h: 50px; }
  .hero__drawing { margin-top: 28px; padding: 48px 34px 46px; }
}

/* ---------- Sections ---------- */

.section { padding-block: clamp(72px, 10vw, 136px); }
.section + .section { border-top: 1px solid var(--rule); }
.section--sheet { background: var(--sheet); }

.sec-head {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 22px var(--gutter);
  align-items: end;
  padding-top: 18px;
  margin-bottom: clamp(40px, 6vw, 72px);
  position: relative;
}
.sec-head::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 1px;
  background: var(--ink);
  transform-origin: left;
}
/* Number label on top, title on the left, intro set against the title's baseline on the right */
.sec-head .sheet-label { grid-column: 1; grid-row: 1; align-self: start; }
.sec-head h2 { grid-column: 1; grid-row: 2; }
.sec-head .sec-intro { grid-column: 2; grid-row: 2; color: var(--graphite); max-width: 46ch; margin: 0; padding-bottom: 0.3em; }

@media (prefers-reduced-motion: no-preference) {
  .js .sec-head::before { transform: scaleX(0); transition: transform 1.2s var(--ease-in-out); }
  .js .sec-head.is-visible::before { transform: scaleX(1); }
}

/* Scroll fade-ins — the class is only added by site.js when motion is allowed */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.9s var(--ease) var(--d, 0ms), transform 1s var(--ease) var(--d, 0ms);
}
.reveal.is-in { opacity: 1; transform: none; }

@media (max-width: 760px) {
  .sec-head { grid-template-columns: 1fr; }
  .sec-head h2, .sec-head .sec-intro, .sec-head .sheet-label { grid-column: 1; grid-row: auto; }
}

/* Practice */
.practice {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: 40px var(--gutter);
}
.practice__statement {
  font-size: var(--step-2);
  line-height: 1.2;
  font-weight: 500;
  font-variation-settings: "wdth" 104;
  letter-spacing: -0.01em;
  max-width: 30ch;
  margin: 0 0 32px;
}
.practice__body { grid-column: 2; columns: 2 300px; column-gap: var(--gutter); }
.practice__body p { break-inside: avoid; }
.practice__aside { grid-column: 1; grid-row: 1 / span 2; }

.commitments {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: clamp(32px, 5vw, 64px);
  border-top: 1px solid var(--rule);
}
.commitments div { padding: 24px 24px 8px 0; }
.commitments div + div { padding-left: 24px; border-left: 1px solid var(--rule); }
.commitments h3 { font-size: 1rem; margin-bottom: 10px; font-variation-settings: "wdth" 115; }
.commitments p { font-size: 0.95rem; color: var(--graphite); }

@media (max-width: 900px) {
  .practice { grid-template-columns: 1fr; }
  .practice__body, .practice__aside { grid-column: 1; grid-row: auto; }
  .commitments { grid-template-columns: 1fr 1fr; }
  .commitments div:nth-child(3) { padding-left: 0; border-left: 0; }
  .commitments div:nth-child(n+3) { border-top: 1px solid var(--rule); }
}
@media (max-width: 560px) {
  .commitments { grid-template-columns: 1fr; }
  .commitments div, .commitments div + div { padding: 20px 0 6px; border-left: 0; }
  .commitments div + div { border-top: 1px solid var(--rule); }
}

/* Services — numbered schedule */
.schedule { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule-strong); counter-reset: svc; }
.schedule li { border-bottom: 1px solid var(--rule); }
.service-row {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 4.2fr) minmax(0, 5fr) minmax(0, 2.6fr);
  gap: 12px var(--gutter);
  align-items: baseline;
  padding: clamp(22px, 2.6vw, 34px) 0;
  position: relative;
  text-decoration: none;
  color: inherit;
}
.service-row::before {
  content: "";
  position: absolute;
  left: 0; top: -1px; bottom: -1px;
  width: 2px;
  background: var(--red);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.5s var(--ease);
}
.service-row__no {
  font-size: var(--step--1);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--red);
  padding-left: 14px;
}
.service-row h3 {
  font-size: clamp(1.25rem, 1rem + 1vw, 1.85rem);
  font-variation-settings: "wdth" 118;
  transition: transform 0.45s var(--ease);
}
.service-row p { margin: 0; color: var(--graphite); max-width: 52ch; }
.service-row__action { justify-self: end; font-size: 0.9rem; }
.service-row:hover::before,
.service-row:focus-within::before { transform: scaleY(1); }
.service-row:hover h3 { transform: translateX(8px); }
.service-row:hover .line-link::after { transform: scaleX(1); }

@media (max-width: 900px) {
  .service-row { grid-template-columns: 3rem minmax(0, 1fr); }
  .service-row p, .service-row__action { grid-column: 2; }
  .service-row__action { justify-self: start; margin-top: 6px; }
  .service-row__no { padding-left: 10px; }
}

.package {
  margin-top: clamp(48px, 6vw, 80px);
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: 20px var(--gutter);
}
.package ul { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.package li { padding: 14px 0; border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: 2.5rem 1fr; }
.package li span { color: var(--red); font-weight: 700; font-size: var(--step--1); font-variant-numeric: tabular-nums; padding-top: 3px; }
@media (max-width: 760px) { .package { grid-template-columns: 1fr; } }

/* Drawings */
.drawings {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gutter);
  align-items: start;
}
.drawing { margin: 0; }
.drawing--lead { grid-column: 1 / span 7; }
.drawing--side { grid-column: 8 / span 5; }
.drawing--wide { grid-column: span 4; }
.drawing--half { grid-column: span 6; }
.drawings__stack { grid-column: 8 / span 5; display: grid; gap: var(--gutter); }

.drawing__open {
  display: block;
  width: 100%;
  padding: clamp(14px, 2vw, 26px);
  border: 1px solid var(--rule);
  background: var(--paper); /* matches the paper baked into the drawing images */
  cursor: zoom-in;
  position: relative;
  overflow: hidden;
}
.drawing__open img { width: 100%; transition: transform 0.9s var(--ease); }
.drawing__open:hover img { transform: scale(1.015); }

/* Red frame traces itself once the sheet scrolls into view */
.drawing__open::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1.5px solid var(--red);
  clip-path: inset(0 100% 100% 0);
  transition: clip-path 1.4s var(--ease-in-out) 0.6s;
  pointer-events: none;
}
.is-visible .drawing__open::after,
.drawing__open:hover::after,
.drawing__open:focus-visible::after { clip-path: inset(0 0 0 0); }

/* Survey scan line that sweeps down each sheet on a loop */
.drawing__open::before {
  content: "";
  position: absolute;
  left: 0; right: 0;
  top: -70px;
  height: 70px;
  background: linear-gradient(to bottom, transparent, rgba(165, 10, 31, 0.07));
  border-bottom: 1.5px solid rgba(165, 10, 31, 0.75);
  pointer-events: none;
  z-index: 1;
  opacity: 0;
}
@media (prefers-reduced-motion: no-preference) {
  .is-visible .drawing__open::before { animation: scan 7s var(--ease-in-out) 1.6s infinite; }
  .is-visible + .is-visible .drawing__open::before,
  .drawings__stack .is-visible + .is-visible .drawing__open::before { animation-delay: 3.4s; }
}
@keyframes scan {
  0% { top: -70px; opacity: 0; }
  8% { opacity: 1; }
  55% { top: 100%; opacity: 1; }
  60%, 100% { top: 100%; opacity: 0; }
}

.drawing figcaption {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 14px;
  padding-top: 12px;
  font-size: 0.9rem;
  color: var(--graphite);
}
.drawing figcaption b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: no-preference) {
  .js .reveal-img .drawing__open picture { clip-path: inset(0 0 100% 0); transition: clip-path 1.1s var(--ease-in-out); }
  .js .reveal-img.is-visible .drawing__open picture { clip-path: inset(0 0 0 0); }
}

@media (max-width: 900px) {
  .drawing--lead, .drawing--side, .drawings__stack, .drawing--wide { grid-column: 1 / -1; }
  .drawings__stack { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .drawings__stack { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .drawing--half { grid-column: 1 / -1; }
}

.note {
  margin-top: 28px;
  font-size: 0.9rem;
  color: var(--graphite);
  max-width: 70ch;
}

/* Process */
.stages {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  position: relative;
}
.stages::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 7px;
  height: 1.5px;
  background: var(--red);
  transform-origin: left;
}
@media (prefers-reduced-motion: no-preference) {
  .js .stages::before { transform: scaleX(0); transition: transform 1.6s var(--ease-in-out) 0.2s; }
  .js .stages.is-visible::before { transform: scaleX(1); }
}
.stages li { padding: 40px var(--gutter) 0 0; position: relative; }
.stages li::before {
  content: "";
  position: absolute;
  left: 0; top: 0;
  width: 15px; height: 15px;
  background: var(--paper);
  border: 1.5px solid var(--red);
}
.section--sheet .stages li::before { background: var(--sheet); }
.stages .stage-no { font-size: var(--step--1); font-weight: 700; color: var(--red); font-variant-numeric: tabular-nums; }
.stages h3 { margin: 8px 0 12px; font-size: clamp(1.15rem, 1rem + 0.6vw, 1.45rem); }
.stages .time {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  font-variation-settings: "wdth" 110;
  border-top: 1px solid var(--rule-strong);
  padding-top: 10px;
}
.stages p { color: var(--graphite); }

@media (max-width: 860px) {
  .stages { grid-template-columns: 1fr; padding-left: 34px; }
  .stages::before { left: 7px; right: auto; top: 0; bottom: 0; width: 1.5px; height: auto; transform-origin: top; }
  @media (prefers-reduced-motion: no-preference) {
    .js .stages::before { transform: scaleY(0); }
    .js .stages.is-visible::before { transform: scaleY(1); }
  }
  .stages li { padding: 0 0 40px; }
  .stages li::before { left: -34px; top: 4px; }
}

.fee-note {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: 12px var(--gutter);
}
.fee-note p { margin: 0; }
@media (max-width: 760px) { .fee-note { grid-template-columns: 1fr; } }

/* Accreditation */
.accreditations { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--rule-strong); }
.accreditation {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 24px;
  padding: 32px var(--gutter) 32px 0;
  align-items: start;
}
.accreditation + .accreditation { border-left: 1px solid var(--rule); padding-left: var(--gutter); }
.accreditation img { width: 100%; height: auto; }
.accreditation .kind { font-size: var(--step--1); font-weight: 600; color: var(--graphite); margin-bottom: 6px; }
.accreditation h3 { font-size: 1.15rem; margin-bottom: 10px; }
.accreditation p { color: var(--graphite); font-size: 0.95rem; }
.accreditation ul { margin: 14px 0 0; padding: 0; list-style: none; }
.accreditation li { padding: 8px 0; border-top: 1px solid var(--rule); font-size: 0.92rem; }

@media (max-width: 860px) {
  .accreditations { grid-template-columns: 1fr; }
  .accreditation + .accreditation { border-left: 0; padding-left: 0; border-top: 1px solid var(--rule); }
}
@media (max-width: 480px) {
  .accreditation { grid-template-columns: 84px minmax(0, 1fr); gap: 16px; }
}

/* Questions */
.faq { border-top: 1px solid var(--rule-strong); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary {
  list-style: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  gap: 20px;
  align-items: center;
  padding: 22px 0;
  cursor: pointer;
  font-size: clamp(1.02rem, 0.95rem + 0.35vw, 1.2rem);
  font-weight: 500;
  font-variation-settings: "wdth" 104;
  line-height: 1.35;
  transition: color 0.2s;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: var(--red); }
.faq .plus { position: relative; width: 28px; height: 28px; border: 1px solid var(--rule-strong); transition: background-color 0.3s, border-color 0.3s; }
.faq .plus::before,
.faq .plus::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 11px; height: 1.5px;
  background: currentColor;
  transform: translate(-50%, -50%);
  transition: transform 0.4s var(--ease);
}
.faq .plus::after { transform: translate(-50%, -50%) rotate(90deg); }
.faq details[open] .plus { background: var(--red); border-color: var(--red); color: var(--on-red); }
.faq details[open] .plus::after { transform: translate(-50%, -50%) rotate(0deg); }
.faq .answer { overflow: hidden; }
.faq .answer > div { padding: 0 48px 26px 0; color: var(--graphite); max-width: 70ch; }

/* Enquiry */
.enquiry {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 48px var(--gutter);
}
.enquiry h2 { margin-bottom: 24px; }
.contact-list { list-style: none; margin: 32px 0 0; padding: 0; border-top: 1px solid var(--rule); }
.contact-list li {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 0.95rem;
}
.contact-list span:first-child { color: var(--graphite); }
.contact-list a { text-decoration: none; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.contact-list a:hover { color: var(--red); text-decoration: underline; }

.coverage { margin-top: 28px; font-size: 0.9rem; color: var(--graphite); }
.coverage strong { color: var(--ink); font-weight: 600; display: block; margin-bottom: 6px; }
.coverage ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.coverage li { border: 1px solid var(--rule); padding: 3px 9px; }

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

/* Form */
.form {
  background: var(--sheet);
  border: 1px solid var(--rule);
  padding: clamp(22px, 3vw, 40px);
  position: relative;
}
.section--sheet .form { background: var(--paper); }
.form__title { font-size: var(--step-1); margin-bottom: 6px; }
.form__intro { color: var(--graphite); font-size: 0.95rem; margin-bottom: 26px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 20px; }
.field { display: grid; gap: 7px; min-width: 0; }
.field--full { grid-column: 1 / -1; }
.field label { font-size: 0.875rem; font-weight: 600; font-variation-settings: "wdth" 108; }
.field label .opt { font-weight: 400; color: var(--graphite); }
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border: 1px solid var(--rule-strong);
  border-radius: 0;
  background: #fff;
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
  appearance: none;
}
.field select {
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  padding-right: 40px;
}
.field textarea { min-height: 130px; resize: vertical; line-height: 1.5; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--red);
}
.field input::placeholder,
.field textarea::placeholder { color: #8a9095; }
.field[data-invalid] input,
.field[data-invalid] select,
.field[data-invalid] textarea { border-color: var(--red); box-shadow: inset 0 -2px 0 var(--red); }
.field .error { font-size: 0.85rem; color: var(--red); font-weight: 500; min-height: 0; }
.field .error:empty { display: none; }

.form__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
  margin-top: 26px;
}
.form__footer small { font-size: 0.82rem; color: var(--graphite); max-width: 42ch; line-height: 1.45; }
.form__footer small button { background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; font-size: inherit; color: inherit; }

.form-status {
  margin-top: 20px;
  padding: 14px 16px;
  border-left: 3px solid var(--red);
  background: #fff;
  font-size: 0.95rem;
}
.form-status:empty { display: none; }
.form-status a { font-weight: 600; }

.form-success { display: none; }
.form.is-sent .form-body { display: none; }
.form.is-sent .form-success { display: block; }
.form-success h3 { font-size: var(--step-2); margin: 10px 0 14px; }
.form-success .redline-mark { width: 48px; height: 2px; background: var(--red); }

@media (max-width: 600px) {
  .form-grid { grid-template-columns: 1fr; }
  .form__footer .btn { width: 100%; }
}

/* Page intro (inner pages) */
.page-intro {
  padding-block: clamp(48px, 8vw, 110px) clamp(40px, 6vw, 80px);
  border-bottom: 1px solid var(--rule);
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: 20px var(--gutter);
}
.page-intro .sheet-label { padding-top: 0.5em; }
.page-intro h1 { font-size: clamp(2.2rem, 1.2rem + 3.8vw, 4.6rem); margin-bottom: 24px; max-width: 16ch; }
@media (max-width: 760px) { .page-intro { grid-template-columns: 1fr; } }

.cta-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px var(--gutter);
  align-items: end;
}
.cta-band h2 { font-size: var(--step-3); max-width: 18ch; }
.cta-band .actions { display: flex; flex-wrap: wrap; gap: 12px; }
@media (max-width: 760px) { .cta-band { grid-template-columns: 1fr; } }

.figure-plain { margin: 0; border: 1px solid var(--rule); background: var(--paper); padding: 20px; }
.figure-plain img { width: 100%; }
.figure-plain figcaption { font-size: 0.85rem; color: var(--graphite); margin-top: 10px; }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--ink);
  color: #d6dad7;
  padding-block: clamp(56px, 7vw, 96px) 28px;
  margin-top: 0;
}
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-top {
  display: grid;
  grid-template-columns: minmax(0, 5fr) repeat(3, minmax(0, 2.4fr));
  gap: 36px var(--gutter);
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}
.footer-brand { color: #fff; }
.footer-brand .brand { color: #fff; padding: 0; }
.footer-brand .brand__sub { color: #aeb4b1; }
.footer-brand p { margin-top: 22px; color: #aeb4b1; max-width: 36ch; font-size: 0.95rem; }
.footer-col h2 {
  font-size: 0.78rem;
  font-variation-settings: "wdth" 112;
  letter-spacing: 0.02em;
  text-transform: none;
  color: #8f9693;
  margin-bottom: 14px;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; font-size: 0.95rem; }
.footer-coverage { padding: 24px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.14); font-size: 0.9rem; color: #aeb4b1; }
.footer-coverage b { color: #fff; font-weight: 600; margin-right: 10px; }
.footer-base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
  padding-top: 22px;
  font-size: 0.82rem;
  color: #8f9693;
}
.footer-base button {
  background: none; border: 0; padding: 0; color: inherit; cursor: pointer; font-size: inherit; text-decoration: underline; margin-left: 18px;
}
.footer-base button:first-child { margin-left: 0; }
.footer-base button:hover { color: #fff; }

@media (max-width: 900px) {
  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .footer-top { grid-template-columns: 1fr; }
}

/* ---------- Dialogs (legal + drawing viewer) ---------- */

dialog {
  border: 1px solid var(--rule-strong);
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  max-width: min(720px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  width: 100%;
}
dialog::backdrop { background: rgba(27, 30, 33, 0.55); }
dialog[open] { animation: dialog-in 0.4s var(--ease); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(12px); } }

.dialog__bar {
  position: sticky; top: 0;
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px;
  padding: 12px 12px 12px 24px;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  z-index: 1;
}
.dialog__bar h2 { font-size: 1rem; font-variation-settings: "wdth" 115; }
.dialog__close {
  min-width: 44px; min-height: 44px;
  border: 1px solid var(--rule-strong); background: none; cursor: pointer;
  font-weight: 600; padding: 0 14px;
}
.dialog__close:hover { background: var(--ink); color: var(--paper); }
.dialog__body { padding: 24px; }
.dialog__body h3 { font-size: 0.95rem; margin: 22px 0 8px; }

dialog.viewer { max-width: min(1100px, calc(100vw - 24px)); }
dialog.viewer .dialog__body { padding: 16px; background: #fff; }
dialog.viewer img { width: 100%; height: auto; max-height: calc(100dvh - 140px); object-fit: contain; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

