/* HomePlanner website: the Classic Villa (DESIGN.md). Lime-plaster ground, paper sheets carrying the plan, wall ink,
   shutter green for the action, the current step and dimension lines. Gilda Display for names and numerals, Hanken
   Grotesk for the rest. */
@font-face { font-family: "Gilda Display"; src: url(/fonts/gilda-display-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Hanken Grotesk"; src: url(/fonts/hanken-grotesk-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Hanken Grotesk"; src: url(/fonts/hanken-grotesk-latin-500-normal.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Hanken Grotesk"; src: url(/fonts/hanken-grotesk-latin-600-normal.woff2) format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --bg: #eeeae1; --chrome: #fbfaf6; --sheet: #fdfcf8; --ink: #2b2e30; --ink-2: #464a4d; --ink-3: #5e6266; --rule: #ded8cc; --rule-2: #c9c2b4;
  --wall: #2b2e30; --pen: #44564c; --pen-soft: rgba(68, 86, 76, .10); --pen-ink: #fbfaf6; --warn: #9a3b24;
  --win: #e2e8e4; --fx: #8b8d88; --fx-fill: #f1eee7; --cornice: #cfc8ba; --water: #3c6e9e; --power: #a8721b;
  --oak: #c9a77c; --oak-line: #b48b5e;
  --serif: "Gilda Display", "Iowan Old Style", Georgia, serif;
  --sans: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --float: 0 2px 4px rgba(30, 28, 24, .06), 0 10px 26px -10px rgba(30, 28, 24, .24);
  --gutter: clamp(16px, 4vw, 48px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171918; --chrome: #1e2120; --sheet: #1b1d1c; --ink: #ece9e1; --ink-2: #c6c8c3; --ink-3: #a7aaa6; --rule: #2e3230; --rule-2: #464b48;
    --wall: #e6e3da; --pen: #a9bbae; --pen-soft: rgba(169, 187, 174, .14); --pen-ink: #1e2120; --warn: #e39a80;
    --win: #26302c; --fx: #8f938f; --fx-fill: #242826; --cornice: #3a3e3c; --water: #86b2dc; --power: #e0b566;
    --oak: #8a6f4f; --oak-line: #a5845d;
    --float: 0 2px 4px rgba(0, 0, 0, .3), 0 10px 26px -10px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; scrollbar-color: var(--rule-2) var(--bg); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.6 var(--sans); font-feature-settings: "lnum", "tnum"; }
::selection { background: var(--pen-soft); color: var(--ink); }
:focus-visible { outline: 2px solid var(--pen); outline-offset: 3px; border-radius: 2px; }
a { color: var(--pen); text-underline-offset: .2em; text-decoration-thickness: 1px; }
h1, h2, h3 { margin: 0; font-family: var(--serif); font-weight: 400; line-height: 1.08; letter-spacing: .003em; text-wrap: balance; color: var(--ink); }
p { margin: 0; text-wrap: pretty; }
img { max-width: 100%; height: auto; display: block; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 30; padding: 10px 16px; background: var(--pen); color: var(--pen-ink); border-radius: 4px; }
.skip:focus { top: 12px; }

/* ---------- top bar: trim over the cornice ---------- */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 24px; min-height: 64px; padding: env(safe-area-inset-top) var(--gutter) 0;
  background: var(--chrome); border-bottom: 3px double var(--cornice); }
.brand { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; color: var(--ink); text-decoration: none; font: 24px/1 var(--serif); }
.brand img { border-radius: 6px; }
.top-nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.top-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; color: var(--ink-3); font-weight: 500; font-size: 15.5px; text-decoration: none; border-radius: 4px; }
.top-nav a:hover { color: var(--ink); }
.top-nav .signin { margin-left: 8px; color: var(--pen); font-weight: 600; border: 1px solid var(--rule-2); }
.top-nav .signin:hover { border-color: var(--pen); background: var(--pen-soft); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px; border-radius: 4px; border: 1px solid var(--rule-2);
  background: var(--sheet); color: var(--ink); font: 500 16px/1 var(--sans); text-decoration: none; transition: background-color .15s ease-out, border-color .15s ease-out; }
.btn:hover { border-color: var(--ink-3); }
.btn.primary { min-height: 54px; padding: 0 28px; background: var(--pen); border-color: var(--pen); color: var(--pen-ink); font-weight: 600; font-size: 17px; }
.btn.primary:hover { background: color-mix(in srgb, var(--pen) 88%, var(--ink)); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.aside { color: var(--ink-3); font-size: 15px; }

/* ---------- the sheet: paper carrying the plan ---------- */
.sheet { position: relative; background: var(--sheet); border: 1px solid var(--rule); border-radius: 6px; }
.plan svg, .layer svg, .callout-art svg { display: block; width: 100%; height: auto; overflow: visible; }

/* ---------- hero ---------- */
.hero { padding: 20px clamp(12px, 1.6vw, 24px) 0; }
.hero-sheet { display: grid; grid-template-columns: minmax(300px, 27rem) minmax(0, 1fr) 8.5rem; gap: 24px 40px; align-items: start;
  max-width: 1560px; margin: 0 auto; padding: clamp(28px, 3.5vw, 52px) clamp(20px, 3vw, 44px) 20px; border-bottom-left-radius: 0; border-bottom-right-radius: 0; border-bottom: 0; }
.hero-copy { padding-top: clamp(4px, 2vw, 28px); }
.hero h1 { font-size: clamp(2.6rem, 1.5rem + 2.6vw, 3.75rem); line-height: 1.02; margin-bottom: 24px; }
.lead { font-size: clamp(17px, 15px + .45vw, 20px); color: var(--ink-2); max-width: 34ch; margin-bottom: 32px; }
.hero-plan { margin: 0; }
.plan-frame { position: relative; padding-top: 26px; }
/* the overall width, in the plan's own dimension green */
.dim-string { position: absolute; top: 0; left: 3.27%; right: 3.27%; height: 18px; border-left: 1px solid var(--pen); border-right: 1px solid var(--pen); color: var(--pen); font-size: 13px; text-align: center; }
.dim-string::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid var(--pen); }
.dim-string span { position: relative; padding: 0 8px; background: var(--sheet); line-height: 18px; font-weight: 500; }
.plan.sm { display: none; }
.hero-plan figcaption { margin-top: 6px; color: var(--ink-3); font-size: 14px; text-align: center; }
.pin { position: absolute; left: var(--x); top: var(--y); display: flex; align-items: center; gap: 10px; padding: 7px 12px 7px 7px; max-width: 15rem;
  background: var(--chrome); border: 1px solid var(--rule); border-radius: 6px; box-shadow: var(--float); }
.pin-text { display: grid; line-height: 1.25; }
/* a Dreambook idea: the idea named in the villa's serif, as the app's idea tiles do */
.pin.idea { display: grid; gap: 2px; padding: 10px 14px; max-width: 13.5rem; }
.idea-title { font: 400 17px/1.15 var(--serif); color: var(--ink); }
.pin-room { color: var(--ink-3); font-size: 12.5px; }
.chosen { font-style: normal; color: var(--pen); font-weight: 600; }
.pin.idea.colour { grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; align-items: center; }
.pin.idea.colour .swatch { grid-row: span 2; }
.stage-pins { position: absolute; inset: 0; z-index: 2; }
.stage-pins .pin { opacity: 0; transform: translateY(6px); transition: opacity .4s ease-out .5s, transform .4s ease-out .5s; }
.stage-pins.shown .pin { opacity: 1; transform: none; }
.stage-pins .pin:nth-child(2) { transition-delay: .62s; } .stage-pins .pin:nth-child(3) { transition-delay: .74s; }
.pin-text b { font-weight: 600; font-size: 14px; }
.pin-text span { color: var(--ink-3); font-size: 12.5px; }
.swatch { flex: none; width: 34px; height: 34px; border-radius: 3px; background: var(--c, var(--fx-fill)); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.swatch.oak { background: repeating-linear-gradient(90deg, var(--oak) 0 7px, var(--oak-line) 7px 8px), var(--oak); }

.step-index ol { list-style: none; margin: 0; padding: clamp(4px, 2vw, 28px) 0 0; display: grid; gap: 6px; border-left: 1px solid var(--rule); }
.step-index a { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 0 0 14px; color: var(--ink-3); font-size: 13.5px; line-height: 1.25; text-decoration: none; }
.step-index a:hover { color: var(--ink); }
.step-index b { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border: 1px solid var(--rule-2); border-radius: 4px; font: 400 17px/1 var(--serif); color: var(--ink); }
.step-index .now a { color: var(--ink); font-weight: 600; }
.step-index .now b { background: var(--pen); border-color: var(--pen); color: var(--pen-ink); }

/* ---------- the steps ---------- */
.steps { max-width: 1440px; margin: 0 auto; padding: clamp(64px, 9vw, 120px) var(--gutter) clamp(48px, 6vw, 88px); border-top: 3px double var(--cornice); }
.steps-head { max-width: 40rem; margin-bottom: clamp(32px, 5vw, 56px); }
.steps-head h2 { font-size: clamp(2rem, 1.3rem + 2vw, 3.1rem); margin-bottom: 14px; }
.steps-head p { color: var(--ink-2); font-size: 18px; }
.steps-body { display: grid; grid-template-columns: minmax(0, 1fr); }
.step-list { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(56px, 8vw, 96px); }
.step { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 20px; align-content: center; }
.step .num { grid-row: span 2; font: 400 clamp(3rem, 2rem + 3vw, 4.5rem)/.9 var(--serif); color: color-mix(in srgb, var(--ink-3) 80%, var(--bg)); transition: color .3s ease-out; }
.step.on .num { color: var(--pen); }
.step h3 { font-size: clamp(1.55rem, 1.2rem + 1vw, 2.1rem); margin: 4px 0 12px; }
.step p { color: var(--ink-2); max-width: 36rem; }
.step-fig { grid-column: 1 / -1; margin: 24px 0 0; }
.step-fig .sheet { padding: 10px; }
.callout { display: flex; align-items: center; gap: 16px; margin-top: 12px; padding: 12px 14px; font-size: 14.5px; color: var(--ink-2); line-height: 1.4;
  background: var(--chrome); border: 1px solid var(--rule); border-radius: 6px; position: relative; }
.callout b { display: block; color: var(--ink); font-weight: 600; font-size: 15px; }
/* the 1:1 call-out's cornered frame, as on a drawing */
.callout::before { content: ""; position: absolute; inset: 5px; pointer-events: none;
  background: linear-gradient(var(--rule-2), var(--rule-2)) top left / 10px 1px no-repeat, linear-gradient(var(--rule-2), var(--rule-2)) top left / 1px 10px no-repeat,
    linear-gradient(var(--rule-2), var(--rule-2)) bottom right / 10px 1px no-repeat, linear-gradient(var(--rule-2), var(--rule-2)) bottom right / 1px 10px no-repeat; }
.callout-art { flex: none; width: 88px; }
.callout-art.wide { width: 132px; }
.callout-tag { flex: none; padding: 4px 12px; border-radius: 4px; border: 1px solid var(--rule-2); color: var(--ink); font-weight: 600; font-size: 14px; background: var(--sheet); }
.callout-swatches { flex: none; display: flex; gap: 6px; }
.callout-idea { flex: none; display: grid; gap: 8px; width: 9.5rem; padding: 10px; background: var(--sheet); border: 1px solid var(--rule); border-radius: 3px; }
.callout-idea .idea-title { font-size: 15px; }
.callout-swatches .swatch { width: 30px; height: 30px; }
.dot { display: inline-block; width: 9px; height: 9px; margin: 0 4px 0 8px; border-radius: 50%; vertical-align: 0; }
.dot.water { background: var(--water); } .dot.power { background: var(--power); }
.key { white-space: nowrap; }
.stage { display: none; }

/* wider screens with the script: one sheet stays in view and fills up as the steps pass */
@media (min-width: 1000px) {
  .js .steps-body { grid-template-columns: minmax(20rem, 30rem) minmax(0, 1fr); gap: clamp(32px, 4vw, 72px); }
  .js .step-list { gap: 0; }
  .js .step { min-height: 78vh; padding: 8vh 0; }
  .js .step-fig .sheet { display: none; }
  .js .step-fig { margin-top: 20px; }
  .js .stage { display: block; position: sticky; top: 92px; height: calc(100vh - 116px); align-self: start; }
  .stage-sheet { height: 100%; display: grid; place-items: center; padding: clamp(16px, 2vw, 32px); }
  .layers { position: relative; width: 100%; max-height: 100%; aspect-ratio: 12.2 / 9.8; }
  .layer { position: absolute; inset: 0; background: var(--sheet); clip-path: inset(0 100% 0 0); transition: clip-path .75s cubic-bezier(.2, .8, .2, 1); }
  .layer.shown { clip-path: inset(0 0 0 0); }
  .layer svg { width: 100%; height: 100%; }
  .stage-step { position: absolute; left: 20px; top: 16px; display: flex; align-items: baseline; gap: 8px; color: var(--ink-3); font-size: 14px; }
  .stage-num { font: 400 32px/1 var(--serif); color: var(--pen); }
}
@media (prefers-reduced-motion: reduce) { .layer, .stage-pins .pin { transition: none; } .step .num { transition: none; } }

/* ---------- handover ---------- */
.handover { max-width: 1440px; margin: 0 auto; padding: clamp(64px, 9vw, 120px) var(--gutter); display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.4fr); gap: clamp(32px, 5vw, 80px); align-items: center; border-top: 3px double var(--cornice); }
.handover h2 { font-size: clamp(2rem, 1.3rem + 2vw, 3.1rem); margin-bottom: 20px; }
.handover p { color: var(--ink-2); max-width: 34rem; }
.handover p + p { margin-top: 16px; }
.handover-fig { margin: 0; }
.handover-fig img { border: 1px solid var(--rule); border-radius: 6px; background: var(--sheet); }
.flooring { display: none; width: 100%; border-collapse: collapse; background: var(--sheet); border: 1px solid var(--rule); border-radius: 6px; font-size: 15px; }
.flooring caption { caption-side: top; text-align: left; padding: 0 0 10px; color: var(--ink-3); font-size: 14px; }
.flooring th { text-align: left; padding: 10px 12px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); border-bottom: 1px solid var(--rule); }
.flooring td { padding: 10px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.flooring tr:last-child td { border-bottom: 0; }
.flooring td:last-child, .flooring th:last-child { text-align: right; white-space: nowrap; }
.chip { display: inline-block; width: 10px; height: 10px; margin-right: 8px; border-radius: 2px; background: var(--c); }

/* ---------- calm ---------- */
.calm { background: var(--chrome); border-top: 3px double var(--cornice); border-bottom: 1px solid var(--rule); padding: clamp(56px, 8vw, 104px) var(--gutter); }
.calm > * { max-width: 1440px; margin-left: auto; margin-right: auto; }
.calm-inner { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.4fr); gap: clamp(28px, 5vw, 80px); align-items: start; }
.calm h2 { font-size: clamp(2rem, 1.3rem + 2vw, 3.1rem); }
.calm-list { margin: 0; border-top: 1px solid var(--rule-2); }
.calm-list > div { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); gap: 8px 32px; padding: 22px 0; border-bottom: 1px solid var(--rule); }
.calm-list dt { font: 400 1.4rem/1.25 var(--serif); }
.calm-list dd { margin: 0; color: var(--ink-2); max-width: 38rem; }

/* ---------- close ---------- */
.close { padding: clamp(56px, 8vw, 104px) var(--gutter); }
.close-sheet { max-width: 1440px; margin: 0 auto; padding: clamp(36px, 6vw, 80px) clamp(24px, 5vw, 72px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.close-plan { opacity: .9; }
.close h2 { font-size: clamp(2.1rem, 1.3rem + 2.4vw, 3.6rem); max-width: 18ch; margin-bottom: 18px; }
.close p { color: var(--ink-2); max-width: 40rem; margin-bottom: 28px; }

/* ---------- footer ---------- */
.foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; padding: 28px var(--gutter) calc(28px + env(safe-area-inset-bottom)); border-top: 3px double var(--cornice); background: var(--chrome); color: var(--ink-3); font-size: 15px; }
.foot-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font: 19px/1 var(--serif); }
.foot-brand img { border-radius: 4px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.foot nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink-2); }
.foot p { margin-left: auto; }

/* ---------- tablets and phones ---------- */
@media (max-width: 1100px) {
  .hero-sheet { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); }
  .step-index { grid-column: 1 / -1; }
  .step-index ol { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); border-left: 0; border-top: 1px solid var(--rule); padding-top: 8px; }
  .step-index a { padding-left: 0; }
}
@media (max-width: 760px) {
  body { font-size: 16.5px; }
  .top-nav a:not(.signin) { display: none; }
  .hero { padding-top: 12px; }
  .hero-sheet { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .plan.lg { display: none; }
  .plan.sm { display: block; }
  .pin .swatch { width: 26px; height: 26px; }
  .pin-text b { font-size: 13px; } .pin-text span { font-size: 12.5px; }
  .handover { grid-template-columns: minmax(0, 1fr); }
  .calm-inner, .calm-list > div { grid-template-columns: minmax(0, 1fr); }
  .step-index { display: none; }
  .pins { display: grid; gap: 8px; margin-top: 12px; }
  .pin { position: static; max-width: none; box-shadow: none; }
  .flooring { display: table; }
  .handover-fig img { display: none; }
  .close-sheet { grid-template-columns: minmax(0, 1fr); }
  .foot p { margin-left: 0; width: 100%; }
}
@media (max-width: 420px) {
  .actions .btn { width: 100%; }
}
