/* Maap landing page. The page is a flat: each section is a room (one colour
   field), separated by an ink wall with a door gap. Colours name a layer,
   material or severity. */

:root {
  --ink: #1B2A3A;
  --ink-muted: #5B6572;
  --paper: #F4EFE4;
  --paper-raised: #FFFDF8;
  --terracotta: #C8553D;
  --terracotta-deep: #B5482F; /* hero ground: paper text clears 4.5:1 on it */
  --marigold: #F2B33D;
  --peacock: #0E7C7B;
  --rani: #B8336A;
  --rani-bright: #F07BA8;     /* rani carried light enough to draw on ink */

  --display: 'Bricolage Grotesque', 'IBM Plex Sans', system-ui, sans-serif;
  --sans: 'IBM Plex Sans', 'Segoe UI', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;

  --wall-h: 16px;
  --gutter: clamp(20px, 4vw, 56px);
  --hard: 12px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 400 1.0625rem/1.6 var(--sans);
  color: var(--ink);
  background: var(--terracotta-deep);
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; }
[hidden] { display: none !important; }
.mono { font-family: var(--mono); font-weight: 500; font-size: .94em; }

:focus-visible { outline: 3px solid var(--marigold); outline-offset: 3px; border-radius: 2px; }
.room-marigold :focus-visible { outline-color: var(--ink); }

.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 10px 16px; z-index: 10; }
.skip:focus { left: 8px; }

.wrap { width: min(100% - 2 * var(--gutter), 1240px); margin-inline: auto; }

/* type */
h1, h2, .final-h {
  font-family: var(--display);
  font-weight: 700;
  font-stretch: 82%;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.9rem, 6.4vw, 5.9rem); line-height: .94; }
h2 { font-size: clamp(2.1rem, 4.2vw, 3.6rem); line-height: 1; }
h3 { font: 600 1.3rem/1.25 var(--display); letter-spacing: -0.01em; }
p { max-width: 62ch; }

/* rooms */
.room { position: relative; padding-block: clamp(88px, 11vw, 150px) clamp(72px, 9vw, 120px); }
.room-hero { background: var(--terracotta-deep); color: var(--paper); padding-top: 0; overflow: hidden; }
.room-ink { background: var(--ink); color: var(--paper); --wall: var(--paper); }
.room-paper { background: var(--paper); --wall: var(--ink); }
.room-marigold { background: var(--marigold); --wall: var(--ink); }
.room-rani { background: var(--rani); color: var(--paper); --wall: var(--ink); }
.room-peacock { background: var(--peacock); color: var(--paper); --wall: var(--ink); }
.room-last { padding-bottom: 0; }

/* the wall between rooms, with a door gap and a door leaf */
.wall {
  --gap: 96px;
  position: absolute; inset: 0 0 auto 0; height: var(--wall-h);
  background: linear-gradient(to right,
    var(--wall) 0 var(--door),
    transparent var(--door) calc(var(--door) + var(--gap)),
    var(--wall) calc(var(--door) + var(--gap)));
}
.wall svg { position: absolute; left: var(--door); top: 0; width: var(--gap); height: var(--gap); overflow: visible; }
.wall path { fill: none; stroke: var(--wall); stroke-width: 4; }
.wall .arc { stroke-width: 1.5; stroke-dasharray: 5 5; }

.section-head { display: grid; gap: 24px; margin-bottom: clamp(48px, 6vw, 80px); max-width: 920px; }
.section-head p { font-size: 1.2rem; line-height: 1.55; }

/* nav */
.nav { display: flex; align-items: center; gap: 32px; padding-block: 22px; }
.logo { color: var(--paper); --logo-room: var(--marigold); display: inline-block; }
.logo-footer { --logo-room: var(--terracotta); }
.logo svg { height: 38px; width: auto; }
.nav-links { display: flex; gap: 28px; margin-left: auto; font-weight: 500; font-size: 1rem; }
.nav-links a { text-decoration: none; padding: 6px 0; border-bottom: 2px solid transparent; }
.nav-links a:hover { border-bottom-color: currentColor; }

/* buttons */
.btn {
  display: inline-block; font: 600 1.125rem/1 var(--sans); text-decoration: none;
  padding: 19px 30px; border: 3px solid var(--ink); border-radius: 0;
  transition: transform 120ms ease-out, box-shadow 120ms ease-out;
}
.btn-ink { background: var(--ink); color: var(--paper); box-shadow: 6px 6px 0 var(--marigold); }
.btn-terracotta { background: var(--terracotta); color: #fff; border-color: var(--paper); box-shadow: 6px 6px 0 var(--marigold); font-size: 1.25rem; padding: 22px 36px; }
.btn:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--marigold); }
.btn:active { transform: translate(4px, 4px); box-shadow: 2px 2px 0 var(--marigold); }
.btn-small { font-size: .95rem; padding: 12px 18px; box-shadow: 4px 4px 0 var(--marigold); }

/* hero */
.hero-grid {
  display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 6fr);
  gap: clamp(32px, 4vw, 64px); align-items: center;
  padding-block: clamp(16px, 2vw, 32px) clamp(72px, 9vw, 120px);
}
.hero-copy { display: grid; gap: 28px; }
.lede { font-size: 1.25rem; line-height: 1.55; max-width: 52ch; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 26px; margin-top: 6px; }
.hero-note { font-size: .98rem; font-weight: 500; }

/* the drawing sheet */
.sheet {
  position: relative; background: var(--paper); color: var(--ink);
  border: 3px solid var(--ink); box-shadow: var(--hard) var(--hard) 0 var(--ink);
  width: 100%; max-width: 690px; justify-self: end;
}
.sheet-tabs { display: flex; border-bottom: 3px solid var(--ink); }
.tab {
  flex: 1; font: 600 1rem/1 var(--sans); color: var(--ink); background: transparent;
  border: 0; border-right: 3px solid var(--ink); padding: 15px 10px; cursor: pointer;
}
.tab:last-child { border-right: 0; }
.tab:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); }
.tab[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.tab[data-set="electrical"][aria-pressed="true"] { background: var(--marigold); color: var(--ink); }
.tab[data-set="problems"][aria-pressed="true"] { background: var(--rani); color: var(--paper); }
.tab:focus-visible { outline-offset: -5px; }

.plan { width: 100%; height: auto; }
.plan .furn, .plan .elec, .plan .prob, .plan .floors, .plan .links { transition: opacity 260ms ease-out; }
.sheet[data-layer="furniture"] .elec,
.sheet[data-layer="furniture"] .prob,
.sheet[data-layer="electrical"] .prob { opacity: 0; }
.sheet[data-layer="electrical"] .furn { opacity: .16; }
.sheet[data-layer="electrical"] .floors { opacity: .4; }
.sheet[data-layer="problems"] .links { opacity: 0; }
.sheet[data-layer="problems"] .furn { opacity: .8; }

.titleblock { display: grid; grid-template-columns: minmax(150px, 1fr) 2.4fr; border-top: 3px solid var(--ink); min-height: 118px; }
.tb-name { display: grid; align-content: center; gap: 4px; padding: 14px 18px; border-right: 3px solid var(--ink); font-weight: 600; line-height: 1.3; }
.tb-name .mono { color: var(--ink-muted); font-size: .85rem; }
.tb-note { padding: 14px 18px; font-size: .98rem; line-height: 1.5; display: grid; align-content: center; }
.tb-note ol { counter-reset: p; display: grid; gap: 5px; }
.tb-note li { counter-increment: p; display: grid; grid-template-columns: 24px 1fr; gap: 9px; }
.tb-note li::before {
  content: counter(p); width: 22px; height: 22px; margin-top: 1px; border-radius: 50%;
  background: var(--rani); color: var(--paper); font: 600 .8rem/22px var(--sans); text-align: center;
}

/* the one motion moment: the plan draws itself */
@media (prefers-reduced-motion: no-preference) {
  .walls path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.1s cubic-bezier(.6, 0, .2, 1) forwards; }
  .walls path:nth-child(2) { animation-delay: .25s; }
  .walls path:nth-child(3) { animation-delay: .4s; }
  .walls path:nth-child(4) { animation-delay: .5s; }
  .walls path:nth-child(5) { animation-delay: .65s; }
  .walls path:nth-child(6) { animation-delay: .75s; }
  .walls path:nth-child(7) { animation-delay: .85s; }
  .plan .floors, .plan .openings, .plan .labels, .plan .dims, .plan .f { animation: appear .5s ease-out both; }
  .plan .dims { animation-delay: .2s; }
  .plan .floors { animation-delay: 1.2s; }
  .plan .openings { animation-delay: 1.5s; }
  .plan .labels { animation-delay: 2.6s; }
  .plan .f { animation-name: drop; transform-box: fill-box; transform-origin: center; }
  .plan .f1 { animation-delay: 1.75s; } .plan .f2 { animation-delay: 1.85s; }
  .plan .f3 { animation-delay: 1.95s; } .plan .f4 { animation-delay: 2.05s; }
  .plan .f5 { animation-delay: 2.15s; } .plan .f6 { animation-delay: 2.25s; }
  .plan .f7 { animation-delay: 2.35s; }
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes appear { from { opacity: 0; } }
@keyframes drop { from { opacity: 0; transform: scale(.92); } }

/* why: mistakes */
.mistakes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(28px, 3.5vw, 56px); }
.mistake { display: grid; gap: 22px; align-content: start; }
.mistake svg { width: 100%; border: 2px solid color-mix(in srgb, var(--paper) 35%, transparent); background: color-mix(in srgb, var(--paper) 5%, transparent); }
.mistake .w { fill: none; stroke: var(--paper); stroke-width: 10; stroke-linecap: square; }
.mistake .l { fill: none; stroke: var(--paper); stroke-width: 2.5; }
.mistake .dash { stroke-dasharray: 6 5; stroke-width: 1.5; }
.mistake .fl { fill: color-mix(in srgb, var(--paper) 14%, transparent); stroke: var(--paper); stroke-width: 2.5; }
.mistake .pt { fill: var(--marigold); stroke: var(--ink); stroke-width: 1.5; }
.mistake .hl { fill: none; stroke: var(--rani-bright); stroke-width: 3; stroke-linecap: round; }
.mistake .hl-fill { fill: var(--rani-bright); fill-opacity: .42; }
.mistake .hl-t, .mistake .t { font: 500 15px var(--mono); fill: var(--rani-bright); }
.mistake .t { fill: var(--paper); }
.mistake figcaption { display: grid; gap: 10px; }
.mistake p { color: color-mix(in srgb, var(--paper) 86%, var(--ink)); }

.cost { margin-top: clamp(64px, 8vw, 104px); border-top: 2px solid color-mix(in srgb, var(--paper) 35%, transparent); padding-top: 36px; }
.cost h3 { font-size: 1.5rem; margin-bottom: 36px; }
.cost-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3vw, 48px); align-items: start; }
.cost-steps li { display: grid; gap: 6px; align-content: start; }
.cost-steps strong { font-weight: 600; font-size: 1.1rem; }
.cost-steps span:last-child { color: color-mix(in srgb, var(--paper) 86%, var(--ink)); }
.barbox { display: flex; align-items: flex-end; height: 150px; margin-bottom: 12px; border-bottom: 2px solid color-mix(in srgb, var(--paper) 35%, transparent); }
.bar { display: block; }
.b1 { height: 10px; background: var(--peacock); width: 18%; }
.b2 { height: 64px; background: var(--marigold); width: 60%; }
.b3 { height: 150px; background: var(--rani-bright); width: 100%; }

/* screenshots */
.shot { border: 3px solid var(--ink); background: var(--paper-raised); box-shadow: var(--hard) var(--hard) 0 var(--shade, var(--ink)); }
.shot img { width: 100%; }
.shot-peacock { --shade: var(--peacock); }
.shot-terracotta { --shade: var(--terracotta); }
.shot-marigold { --shade: var(--marigold); }
.shot-ink { --shade: var(--ink); }
.shot-paper { --shade: var(--ink); }

.feature { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: clamp(32px, 5vw, 80px); align-items: center; }
.feature + .feature { margin-top: clamp(72px, 9vw, 128px); }
.feature.flip .shot { order: 2; }
.feature.flip { grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); }
.feature-copy { display: grid; gap: 16px; }
.feature-copy h3 { font-size: clamp(1.5rem, 2.4vw, 2rem); line-height: 1.12; font-weight: 700; font-stretch: 88%; }

/* electrical */
.duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(32px, 4vw, 64px); align-items: start; }
.duo figure { display: grid; }
.duo figcaption { padding: 18px 20px 20px; border-top: 3px solid var(--ink); background: var(--paper); font-size: 1rem; line-height: 1.5; }

/* problems */
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(36px, 5vw, 80px); align-items: center; }
.split > div:first-child { display: grid; gap: 24px; }
.lede-s { font-size: 1.15rem; }
.issues { display: grid; border: 3px solid var(--ink); background: var(--paper); color: var(--ink); }
.issues li { display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: baseline; padding: 12px 16px; font-size: 1rem; line-height: 1.4; }
.issues li + li { border-top: 1px solid #D9D2C3; }
.sev { font-weight: 600; font-size: .9rem; display: inline-flex; align-items: center; gap: 8px; }
.sev::before { content: ''; width: 11px; height: 11px; flex: none; }
.sev-e { color: #A3261D; } .sev-e::before { background: #C9362B; transform: rotate(45deg); }
.sev-w { color: #7A4E0D; } .sev-w::before { background: #B9791F; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.sev-i { color: #44546A; } .sev-i::before { background: #5A6B80; border-radius: 50%; }

/* handover */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); counter-reset: s; border: 3px solid var(--ink); background: var(--paper); color: var(--ink); box-shadow: var(--hard) var(--hard) 0 var(--ink); }
.steps li { counter-increment: s; padding: 28px 28px 32px; display: grid; gap: 12px; align-content: start; }
.steps li + li { border-left: 3px solid var(--ink); }
.steps li::before { content: counter(s); font: 700 3.4rem/1 var(--display); font-stretch: 80%; color: var(--peacock); }
.aside-row { margin-top: clamp(64px, 8vw, 104px); display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.aside-row > div:last-child { display: grid; gap: 14px; }
.aside-row h3 { font-size: 1.6rem; }

/* facts */
.facts-h { margin-bottom: 40px; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 2px solid color-mix(in srgb, var(--paper) 35%, transparent); }
.facts > div { padding: 24px 28px 28px 0; border-bottom: 2px solid color-mix(in srgb, var(--paper) 35%, transparent); display: grid; gap: 6px; align-content: start; }
.facts dt { font: 600 1.25rem/1.2 var(--display); color: var(--marigold); }
.facts dd { color: color-mix(in srgb, var(--paper) 90%, var(--ink)); }
.final { margin-top: clamp(80px, 10vw, 140px); display: grid; gap: 36px; justify-items: start; }
.final-h { font-size: clamp(2.4rem, 5.4vw, 4.8rem); line-height: 1; max-width: 16ch; }
.final-h [lang="hi"] { font-family: 'Kohinoor Devanagari', 'Noto Sans Devanagari', var(--sans); font-stretch: 100%; color: var(--marigold); letter-spacing: 0; }
.footer { display: flex; justify-content: space-between; align-items: center; margin-top: clamp(80px, 10vw, 128px); padding-block: 28px; border-top: 2px solid color-mix(in srgb, var(--paper) 35%, transparent); font-size: .95rem; }
.logo-footer svg { height: 30px; }

/* smaller screens */
@media (max-width: 960px) {
  .hero-grid, .feature, .feature.flip, .split, .aside-row { grid-template-columns: minmax(0, 1fr); }
  .feature.flip .shot { order: 0; }
  .sheet { max-width: none; }
  .mistakes, .steps { grid-template-columns: minmax(0, 1fr); }
  .mistake { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); align-items: center; }
  .steps li + li { border-left: 0; border-top: 3px solid var(--ink); }
  .duo { grid-template-columns: minmax(0, 1fr); }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav-links { display: none; }
  .nav .btn { margin-left: auto; }
}
@media (max-width: 600px) {
  :root { --hard: 8px; }
  .wall { --gap: 64px; }
  .mistake { grid-template-columns: minmax(0, 1fr); }
  .cost-steps { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .barbox { height: auto; border: 0; } .b2 { height: 36px; } .b3 { height: 72px; }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .titleblock { grid-template-columns: minmax(0, 1fr); }
  .tb-name { border-right: 0; border-bottom: 3px solid var(--ink); grid-auto-flow: column; justify-content: space-between; }
  .plan .sizes, .plan .lbl-hide { display: none; }
  .issues li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .tab { font-size: .92rem; padding: 13px 4px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .plan * { transition: none; }
}

/* the two electrical figures share one frame shape so their captions line up */
.duo .shot img { aspect-ratio: 2096 / 1872; object-fit: cover; object-position: center; background: #fff; }
