/* Dawn Designs "Measure your space" (/measure/). Colours and type come from /css/tokens.css (DM Serif Display +
   DM Sans, like the rest of the site); only the opening headline is Fraunces. Mirrors /ai-design/ai-design.css. */

:root {
  --gutter: clamp(16px, 4vw, 56px);
  --hair: color-mix(in srgb, var(--ink) 16%, transparent);
  --dawn-text: color-mix(in srgb, var(--dawn) 55%, var(--ink));
  --field: color-mix(in srgb, var(--linen) 55%, white);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--linen);
  color: var(--ink);
  font: 400 16px/1.6 var(--font-body);
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
[hidden] { display: none !important; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip { position: absolute; left: 12px; top: -60px; background: var(--ink); color: var(--linen); padding: 10px 14px; z-index: 10; }
.skip:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--dawn); outline-offset: 3px; }

/* ------------------------------------------------------------------ top bar */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px var(--gutter);
  border-bottom: 1px solid var(--hair);
}
.top__brand img { width: 96px; height: auto; }
.top__nav { display: flex; align-items: center; gap: clamp(12px, 3vw, 28px); font-weight: 600; font-size: 14px; }
.top__nav a { text-decoration: none; white-space: nowrap; }
.top__nav a:hover { color: var(--dawn-text); }
.top__cta { border: 1px solid var(--ink); border-radius: 999px; padding: 9px 18px; }
.top__cta:hover { background: var(--ink); color: var(--linen) !important; }
@media (max-width: 400px) {
  .top__brand img { width: 80px; }
  .top__nav { gap: 12px; font-size: 13px; }
  .top__cta { padding: 8px 14px; }
}

/* ------------------------------------------------------------------ type */
.eyebrow {
  display: flex; align-items: center; gap: 12px; margin: 0 0 18px;
  font-size: 12px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--dawn-text);
}
.eyebrow .rule { width: 32px; height: 1px; background: currentColor; }
.display {
  font-family: var(--font-display); font-weight: 400; letter-spacing: -.015em; line-height: 1.02; margin: 0;
  font-size: clamp(2.4rem, 6vw, 5rem);
}
.intro .display { font-family: 'Fraunces', Georgia, serif; font-weight: 340; font-variation-settings: 'opsz' 144; letter-spacing: -.025em; }
.intro .display em { font-weight: 300; }
.display em, .route__title em { font-style: italic; color: var(--dawn); }
.lede { max-width: 42rem; font-size: clamp(1rem, 1.3vw, 1.15rem); color: var(--ink-soft); margin: 22px 0 0; }

/* ------------------------------------------------------------------ layout */
main { padding: 0 var(--gutter); max-width: 1440px; margin: 0 auto; }
.intro { padding: clamp(40px, 7vw, 96px) 0 clamp(28px, 4vw, 48px); }

.routes {
  display: grid; grid-template-columns: minmax(0, 1fr);
  border-top: 1px solid var(--hair);
}
.route { padding: clamp(28px, 4vw, 48px) 0; min-width: 0; }
.route + .route { border-top: 1px solid var(--hair); }
@media (min-width: 980px) {
  .routes { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .route + .route { border-top: 0; border-left: 1px solid var(--hair); padding-left: clamp(28px, 4vw, 56px); }
  .route:first-child { padding-right: clamp(28px, 4vw, 56px); }
}
.route__num { margin: 0 0 6px; font-size: 12px; font-weight: 700; letter-spacing: .2em; color: var(--dawn-text); }
.route__title { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.8rem, 3.4vw, 2.6rem); line-height: 1.05; letter-spacing: -.01em; margin: 0 0 12px; }
.route__text { margin: 0 0 18px; color: var(--ink-soft); max-width: 34rem; }
.steps { margin: 0 0 4px; padding-left: 1.1em; display: grid; gap: 8px; max-width: 34rem; }
.steps li::marker { color: var(--dawn); }
.steps li.is-you { color: var(--ink); }
.steps li.is-you strong { color: var(--dawn-text); }
.steps li:not(.is-you) { color: var(--ink-soft); }

/* ------------------------------------------------------------------ fields, chips, buttons */
.choice { border: 0; margin: 0 0 22px; padding: 0; min-width: 0; }
.choice legend, .field > label {
  display: block; margin-bottom: 10px; padding: 0;
  font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
}
.opt { font-weight: 500; letter-spacing: .04em; text-transform: none; color: var(--ink-soft); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips label { position: relative; cursor: pointer; }
.chips input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chips span {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 15px; border: 1px solid var(--hair); border-radius: 999px;
  font-size: 14px; font-weight: 600; background: color-mix(in srgb, var(--linen) 70%, white);
  transition: background .2s, border-color .2s, color .2s;
}
.chips label:hover span { border-color: var(--ink); }
.chips input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--linen); }
.chips input:focus-visible + span { outline: 2px solid var(--dawn); outline-offset: 2px; }

.field { display: grid; }
textarea, input:not([type=radio]):not([type=file]), select {
  width: 100%; font: inherit; color: inherit;
  background: var(--field);
  border: 1px solid var(--hair); border-radius: 10px; padding: 12px 14px;
}
textarea { resize: vertical; min-height: 80px; }
textarea:focus, input:focus, select:focus { outline: none; border-color: var(--ink); }
.note { margin: 10px 0 0; font-size: 13px; color: var(--ink-soft); }
.left { margin: 8px 0 0; font-size: 13px; color: var(--ink-soft); }

.drop { position: relative; border: 1px dashed color-mix(in srgb, var(--ink) 35%, transparent); border-radius: 12px; }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop.is-over { border-color: var(--dawn); background: color-mix(in srgb, var(--dawn) 6%, transparent); }
.drop__empty { display: flex; align-items: center; gap: 14px; padding: 20px 18px; cursor: pointer; font-size: 14px; }
.drop__empty svg { width: 30px; height: 30px; flex: none; color: var(--dawn-text); }
.drop__hint { color: var(--ink-soft); font-size: 13px; }
.drop__full { display: flex; align-items: center; gap: 16px; padding: 12px; flex-wrap: wrap; }
.drop__full img { width: 132px; height: 100px; object-fit: contain; border-radius: 8px; background: white; border: 1px solid var(--hair); }
.drop__side { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 26px; border-radius: 999px; border: 1px solid var(--ink);
  font: 700 15px/1 var(--font-body); text-decoration: none; cursor: pointer; text-align: center;
  transition: background .2s, color .2s, opacity .2s;
}
.btn--solid { background: var(--ink); color: var(--linen); }
.btn--solid:hover { background: var(--dawn); border-color: var(--dawn); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--linen); }
.btn--small { min-height: 40px; padding: 0 18px; font-size: 14px; }
.btn[disabled] { opacity: .5; cursor: wait; }
.link { background: none; border: 0; padding: 0; font: 600 14px var(--font-body); color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

.busy { display: flex; align-items: center; gap: 14px; margin-top: 16px; color: var(--ink-soft); }
.busy p { margin: 0; }
.spinner {
  display: inline-block; flex: none; width: 32px; height: 32px; border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--ink) 18%, transparent); border-top-color: var(--dawn);
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }
.error { margin: 14px 0 0; padding: 12px 14px; border-radius: 10px; background: color-mix(in srgb, var(--dawn) 12%, var(--linen)); }

/* ------------------------------------------------------------------ rooms */
.rooms { border-top: 1px solid var(--hair); padding: clamp(40px, 6vw, 80px) 0; }
.rooms__head { margin-bottom: 24px; }
.rooms .display { font-size: clamp(2rem, 4.4vw, 3.6rem); }
.reading {
  margin: 0 0 24px; padding: 16px 18px; max-width: 52rem;
  border-left: 2px solid var(--dawn); background: color-mix(in srgb, var(--sand) 55%, var(--linen)); font-size: 15px;
}
.reading p { margin: 0; }
.reading p + p { margin-top: 8px; }
.reading__notes { color: var(--ink-soft); }
.reading__notes:empty { display: none; }
.reading__key { font-size: 13px; color: var(--ink-soft); display: flex; flex-wrap: wrap; gap: 8px 18px; }
.reading__key:empty { display: none; }
.reading__key .key { display: inline-flex; align-items: center; gap: 8px; }

.tag {
  display: inline-block; padding: 3px 9px; border-radius: 999px; white-space: nowrap;
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  border: 1px solid var(--hair); color: var(--ink-soft); background: var(--field);
}
.tag--plan { border-color: color-mix(in srgb, var(--oak) 60%, transparent); color: var(--walnut); background: color-mix(in srgb, var(--oak) 14%, var(--linen)); }
.tag--est { border-color: color-mix(in srgb, var(--dawn) 55%, transparent); color: var(--dawn-text); background: color-mix(in srgb, var(--dawn) 9%, var(--linen)); }
.tag--phone { border-color: color-mix(in srgb, var(--night) 40%, transparent); color: var(--night); }

/* table: a real table on wide screens, one card per room on phones */
.table-wrap { max-width: 100%; }
.rt { width: 100%; border-collapse: collapse; }
.rt th { text-align: left; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; padding: 0 8px 10px; border-bottom: 1px solid var(--hair); }
.rt th.num, .rt td.num { text-align: right; }
.rt .unit { font-weight: 500; letter-spacing: .04em; text-transform: none; color: var(--ink-soft); }
.rt td { padding: 10px 8px; border-bottom: 1px solid var(--hair); vertical-align: middle; }
.rt input, .rt select { padding: 9px 11px; border-radius: 8px; min-width: 0; }
.rt input[type=number] { text-align: right; font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield; }
.rt input::-webkit-outer-spin-button, .rt input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.rt input[aria-invalid=true] { border-color: var(--dawn); }
.rt__pick { width: 40px; }
.rt__pick input { width: 18px; height: 18px; accent-color: var(--dawn); cursor: pointer; }
.rt__area { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.rt__end { white-space: nowrap; text-align: right; }
.rt__x {
  width: 32px; height: 32px; margin-left: 6px; border-radius: 50%; border: 1px solid var(--hair); background: transparent;
  font: 400 18px/1 var(--font-body); color: var(--ink-soft); cursor: pointer; vertical-align: middle;
}
.rt__x:hover { border-color: var(--ink); color: var(--ink); }
.rt tr.is-picked td { background: color-mix(in srgb, var(--dawn) 6%, transparent); }
.rt .lbl { display: none; }

@media (max-width: 759px) {
  .rt thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .rt, .rt tbody { display: block; }
  .rt tr {
    display: grid; gap: 8px 10px; padding: 12px 14px; margin-bottom: 10px;
    grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: "pick name name" "type type type" "w w l" "area area end";
    border: 1px solid var(--hair); border-radius: 14px; background: color-mix(in srgb, var(--linen) 60%, white);
  }
  .rt tr.is-picked { border-color: var(--dawn); }
  .rt tr.is-picked td { background: none; }
  .rt td { display: block; padding: 0; border: 0; min-width: 0; }
  .rt td.num { text-align: left; }
  .rt td:nth-child(1) { grid-area: pick; align-self: center; }
  .rt td:nth-child(2) { grid-area: name; }
  .rt td:nth-child(3) { grid-area: type; }
  .rt td:nth-child(4) { grid-area: w; }
  .rt td:nth-child(5) { grid-area: l; }
  .rt td:nth-child(6) { grid-area: area; align-self: center; }
  .rt td:nth-child(7) { grid-area: end; align-self: center; }
  .rt .lbl { display: block; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 4px; }
  .rt td:nth-child(2) .lbl, .rt td:nth-child(3) .lbl { display: none; } /* the name and type fields speak for themselves */
  .rt input, .rt select { padding: 8px 11px; }
  .rt td:nth-child(2) input { font-weight: 700; }
  .rt td:nth-child(6) .lbl { display: inline; margin-right: 8px; }
}
.empty { margin: 18px 0 0; color: var(--ink-soft); }
.rooms__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 18px; }
.total { margin: 18px 0 0; font-size: 15px; }
.total strong { font-family: var(--font-display); font-weight: 400; font-size: 1.6rem; margin-right: 6px; }
.total span { color: var(--ink-soft); }

.schematic { margin: 32px 0 0; max-width: 760px; }
.schematic__svg svg { width: 100%; height: auto; display: block; }
.schematic figcaption { margin-top: 12px; font-size: 13px; color: var(--ink-soft); }
.schematic .box { fill: color-mix(in srgb, var(--sand) 70%, white); stroke: var(--ink); stroke-width: 1.2; }
.schematic .box.is-picked { fill: color-mix(in srgb, var(--dawn) 22%, var(--linen)); stroke: var(--dawn-text); }
.schematic .box.is-est { stroke-dasharray: 5 3; }
.schematic text { font-family: var(--font-body); fill: var(--ink); }
.schematic .t-name { font-weight: 700; }
.schematic .t-size { fill: var(--ink-soft); }
.schematic .tag-s { font-weight: 700; letter-spacing: .14em; fill: var(--dawn-text); }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; margin-top: 32px; }
.actions .note { flex-basis: 100%; margin: 0; }

/* ------------------------------------------------------------------ enquiry */
.enquire {
  display: grid; gap: clamp(24px, 4vw, 56px); padding: clamp(48px, 7vw, 96px) 0;
  border-top: 1px solid var(--hair);
}
@media (min-width: 980px) { .enquire { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); } }
.enquire__head p:last-child { color: var(--ink-soft); max-width: 30rem; }
.enquire__head a, .status { overflow-wrap: anywhere; }
.enquire__head a[href^="tel:"] { white-space: nowrap; }
.enquire .display { font-size: clamp(2rem, 4.4vw, 3.6rem); margin-bottom: 18px; }
.enquiry { display: grid; gap: 18px; min-width: 0; }
.enquiry .btn { justify-self: start; }
.enquiry .note { margin: 0; }
.status { margin: 0; font-size: 15px; }
.status:empty { display: none; }
.fallback { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }

.foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  padding: 22px var(--gutter); border-top: 1px solid var(--hair); font-size: 13px; color: var(--ink-soft);
}
.foot p { margin: 0; }

/* ------------------------------------------------------------------ AR overlay (WebXR dom-overlay) */
.ar {
  position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; justify-content: space-between;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  color: var(--linen); font-family: var(--font-body);
  background: rgb(18 22 31 / .94); /* over the page: while AR starts, or a length is left to add after it ends */
}
/* over the camera view: see-through (kept as its own rule so browsers without :xr-overlay just skip it) */
.ar:xr-overlay { background: transparent; pointer-events: none; }
.ar:xr-overlay .ar__top, .ar:xr-overlay .ar__panel { pointer-events: auto; }
.ar:not(:xr-overlay) .ar__dot { display: none; }
.ar__top { text-align: center; text-shadow: 0 1px 6px rgb(0 0 0 / .6); }
.ar__value { margin: 0; font-family: var(--font-display); font-size: clamp(2.4rem, 11vw, 3.6rem); line-height: 1; }
.ar__hint { margin: 8px auto 0; max-width: 22rem; font-size: 15px; }
.ar__dot { position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--dawn); box-shadow: 0 0 0 2px rgb(255 255 255 / .8); }
.ar__panel { display: grid; gap: 12px; background: rgb(18 22 31 / .78); backdrop-filter: blur(8px); border-radius: 18px; padding: 14px; }
.ar__assign { display: grid; gap: 10px; }
.ar__row { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; gap: 10px; font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.ar .ar__row input, .ar .ar__row select { background: rgb(255 255 255 / .94); color: var(--ink); border-color: transparent; padding: 10px 12px; font-size: 16px; font-weight: 500; letter-spacing: 0; text-transform: none; }
.ar__sides { display: flex; gap: 8px; grid-template-columns: none; }
.ar__sides label { position: relative; flex: 1; }
.ar__sides input { position: absolute; opacity: 0; inset: 0; margin: 0; }
.ar__sides span { display: block; text-align: center; padding: 10px; border-radius: 999px; border: 1px solid rgb(255 255 255 / .5); }
.ar__sides input:checked + span { background: var(--linen); color: var(--ink); }
.ar__buttons { display: flex; gap: 10px; }
.ar__buttons .btn { flex: 1; min-height: 46px; padding: 0 14px; }
.ar .btn--solid { background: var(--dawn); border-color: var(--dawn); color: white; }
.btn--glass { background: rgb(255 255 255 / .12); border-color: rgb(255 255 255 / .55); color: var(--linen); }
.ar__added { margin: 0; font-size: 14px; text-align: center; }
.ar__added:empty { display: none; }
