/*
  Porchlight Home Cleaning, a demo. Fresh markup and styles (DEMO_RUNBOOK step 5): soft and domestic,
  rounded cards on linen, a porch lamp that lights up in the evening look, rooms drawn as cards. None of
  it is shared with another demo; Caliche & Oak, built the same night, is square and drawn like a set of
  plans, and this is the opposite on purpose.

  Colours come only from palettes.js (checked JSON, TECHNICAL 13.12): every section names one of four
  blocks, and the block sets --k-text, --k-muted, --k-accent and --k-accent-text, measured on its own
  background. Typefaces follow the look (data-look). Mobile first; media queries below what they change.
*/

:root {
  --f-head: "Gloock", Georgia, serif;
  --f-body: "Albert Sans", system-ui, sans-serif;
  --head-weight: 400;
  --radius: 20px;
  --radius-s: 12px;
  --shadow: 0 1px 2px rgba(20, 20, 30, .06), 0 8px 24px rgba(20, 20, 30, .08);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --gutter: 16px;
  --max: 1120px;
  --pinbar: 68px;
}
[data-look="B"] { --f-head: "Outfit", system-ui, sans-serif; --f-body: "Outfit", system-ui, sans-serif; --head-weight: 800; --radius: 8px; --radius-s: 6px; }
[data-look="C"] { --f-head: "Lora", Georgia, serif; --f-body: "Mulish", system-ui, sans-serif; --head-weight: 700; --radius: 28px; --radius-s: 16px; }
[data-mode="evening"] { --shadow: 0 0 0 1px rgba(255, 255, 255, .06), 0 10px 30px rgba(0, 0, 0, .35); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--f-body); font-size: 17px; line-height: 1.6;
  padding-bottom: var(--pinbar); overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--f-head); font-weight: var(--head-weight); line-height: 1.12; margin: 0 0 .5em; }
h1 { font-size: clamp(2.2rem, 8vw, 4.2rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.7rem, 5.4vw, 2.7rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.fine { font-size: .9rem; color: var(--k-muted, var(--muted)); max-width: 66ch; }
.strong { font-weight: 700; }

/* ---------- colour blocks ---------- */

[data-block="1"] { --k-bg: var(--b1); --k-text: var(--b1-text); --k-muted: var(--b1-muted); --k-accent: var(--b1-accent); --k-accent-text: var(--b1-accent-text); }
[data-block="2"] { --k-bg: var(--b2); --k-text: var(--b2-text); --k-muted: var(--b2-muted); --k-accent: var(--b2-accent); --k-accent-text: var(--b2-accent-text); }
[data-block="3"] { --k-bg: var(--b3); --k-text: var(--b3-text); --k-muted: var(--b3-muted); --k-accent: var(--b3-accent); --k-accent-text: var(--b3-accent-text); }
[data-block="4"] { --k-bg: var(--b4); --k-text: var(--b4-text); --k-muted: var(--b4-muted); --k-accent: var(--b4-accent); --k-accent-text: var(--b4-accent-text); }
[data-block] { background: var(--k-bg); color: var(--k-text); }
.block { padding: 56px 0; }

/* Cards sit on the block with the page's own surface, so their text is the page's measured pair. */
.card-surface, .room, .detail, .kind-card, .summary, .licence-box, .form, .pt-row {
  --k-text: var(--text); --k-muted: var(--muted); --k-accent: var(--accent); --k-accent-text: var(--accent-text);
  background: var(--surface); color: var(--text);
}

/* ---------- ribbon and looks ---------- */

.ribbon { background: var(--b2); color: var(--b2-text); font-size: .85rem; }
.ribbon-row { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; justify-content: space-between; margin: 0; padding-top: 8px; padding-bottom: 8px; }
.looks-toggle { font: inherit; font-weight: 600; font-size: .8rem; color: inherit; background: transparent; border: 1.5px solid currentColor; border-radius: 999px; padding: 4px 12px; min-height: 32px; cursor: pointer; }
.looks-panel { padding-bottom: 10px; }
.palette-switch { display: flex; flex-wrap: wrap; gap: 6px; }
.palette-switch button { font: inherit; font-size: .85rem; min-width: 44px; min-height: 36px; border-radius: 999px; cursor: pointer; background: transparent; color: var(--b2-text); border: 1.5px solid var(--b2-muted); }
.palette-switch button[aria-pressed="true"] { background: var(--b2-accent); color: var(--b2-accent-text); border-color: var(--b2-accent); }

/* ---------- header and the lamp ---------- */

.topbar-row { display: flex; align-items: center; gap: 12px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; }
.lamp { width: 30px; height: 36px; flex: none; color: var(--k-text); position: relative; }
.lamp svg { width: 30px; height: 36px; overflow: visible; }
.lamp-arm, .lamp-frame { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linejoin: round; }
.lamp-cap { fill: currentColor; }
.lamp-glass { fill: transparent; transition: fill .6s var(--ease); }
.lamp-glow { fill: var(--accent); opacity: 0; transition: opacity .8s var(--ease); }
[data-mode="evening"] .lamp-glass { fill: var(--accent); }
[data-mode="evening"] .lamp-glow { opacity: .22; }
.brand-words { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font-family: var(--f-head); font-weight: var(--head-weight); font-size: 1.4rem; }
.brand-what { font-size: .78rem; color: var(--k-muted); font-weight: 600; letter-spacing: .04em; }
.topnav { display: none; gap: 20px; font-weight: 600; }
.topnav a { text-decoration: none; }
.topnav a:hover { text-decoration: underline; text-underline-offset: 4px; }
.topbar .topcall { display: none; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 10px 22px;
  border-radius: 999px; border: 2px solid var(--k-accent); font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
}
.btn-accent { background: var(--k-accent); color: var(--k-accent-text); box-shadow: var(--shadow); }
.btn-line { background: transparent; color: var(--k-text); border-color: currentColor; }
.btn.small { min-height: 42px; padding: 6px 16px; font-size: .92rem; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0; }

/* ---------- heads ---------- */

.kicker { font-weight: 700; color: var(--k-accent); margin-bottom: 6px; }
.head { max-width: 760px; margin-bottom: 26px; }
.lead { font-size: 1.1rem; color: var(--k-muted); max-width: 60ch; }

/* ---------- hero ---------- */

.hero { padding-top: 22px; }
.hero-grid { display: grid; gap: 26px; }
.hero h1 .line { display: block; }
.hero h1 .soft { color: var(--k-accent); }
.trust { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; margin: 0 0 6px; }
.trust-line { font-weight: 700; }
.trust-note { font-size: .85rem; color: var(--k-muted); }
.booking { display: flex; align-items: center; gap: 10px; font-weight: 600; margin: 6px 0; }
.booking-dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--k-text); flex: none; }
.is-open .booking-dot { background: var(--k-accent); border-color: var(--k-accent); }
.area { color: var(--k-muted); font-size: .95rem; }
.area-label { color: var(--k-text); font-weight: 700; }

/* ---------- photos, and illustrations until they exist ---------- */

.photo { margin: 0; position: relative; aspect-ratio: 3 / 2; overflow: hidden; border-radius: var(--radius); background: color-mix(in srgb, var(--k-accent) 10%, var(--k-bg)); box-shadow: var(--shadow); }
.photo img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .6s var(--ease); }
.photo img.is-loaded { opacity: 1; }
.photo-person { aspect-ratio: 4 / 5; }
.photo-hero { aspect-ratio: 1 / 1; }
.photo.is-art { display: grid; place-items: center; padding: 8%; color: var(--k-text); }
.photo.is-art svg { width: 100%; height: 100%; }
.a-line, .a-plant { fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.a-soft-line { fill: none; stroke: color-mix(in srgb, currentColor 30%, transparent); stroke-width: 3; }
.a-plant { stroke: var(--k-accent); }
.a-fill { fill: color-mix(in srgb, var(--k-accent) 28%, transparent); }
.a-soft { fill: color-mix(in srgb, currentColor 8%, transparent); }
.a-warm { fill: #F2B35B; }
.a-warm-line { stroke: #F2B35B; stroke-width: 10; stroke-linecap: round; opacity: .6; }
.a-halo { fill: #F2B35B; opacity: .25; }
.a-dot { fill: currentColor; }
.a-initials { fill: currentColor; font-family: var(--f-head); font-size: 50px; font-weight: var(--head-weight); }

/* ---------- Your home, room by room ---------- */

.controls { display: grid; gap: 18px; margin-bottom: 20px; }
.controls fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.controls legend { font-weight: 700; padding: 0; margin-bottom: 8px; }
.kind-chips { display: grid; gap: 8px; }
.kind-chip { position: relative; display: block; }
.kind-chip input, .extra-chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.kind-box {
  display: grid; gap: 2px; padding: 12px 16px; border-radius: var(--radius-s);
  background: var(--surface); color: var(--text); border: 2px solid transparent; box-shadow: var(--shadow);
}
.kind-name { font-weight: 700; }
.kind-note { font-size: .9rem; color: var(--muted); }
.kind-chip input:checked + .kind-box { border-color: var(--accent); outline: 3px solid color-mix(in srgb, var(--accent) 25%, transparent); }
.kind-chip input:focus-visible + .kind-box, .extra-chip input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
/* On a phone each count is a row, label left and buttons right: three side by side need 139 pixels
   each and pushed the page to 448 wide at 375 (measured 2026-09-30). */
.counts { display: grid; grid-template-columns: 1fr; gap: 8px; }
.stepper { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px; background: var(--surface); color: var(--text); border-radius: var(--radius-s); padding: 8px 12px; box-shadow: var(--shadow); }
.stepper-label { font-size: .85rem; font-weight: 700; color: var(--muted); }
.stepper-row { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.step-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--accent); background: transparent; color: var(--text);
  font: inherit; font-size: 1.3rem; font-weight: 700; line-height: 1; cursor: pointer;
}
.step-btn:disabled { opacity: .35; cursor: default; }
.step-val { font-family: var(--f-head); font-size: 1.6rem; min-width: 1.2em; text-align: center; }
.extra-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.extra-chip { position: relative; }
.extra-chip span {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 14px; border-radius: 999px;
  background: var(--surface); color: var(--text); box-shadow: var(--shadow); font-weight: 600; border: 2px solid transparent;
}
.extra-chip span::before { content: ""; width: 16px; height: 16px; border-radius: 5px; border: 2px solid var(--accent); flex: none; }
.extra-chip input:checked + span { border-color: var(--accent); }
.extra-chip input:checked + span::before { background: var(--accent); box-shadow: inset 0 0 0 3px var(--surface); }
.extra-chip.is-included span { opacity: .6; }
.extra-chip.is-included span::after { content: "included"; font-size: .75rem; font-weight: 700; }

.summary { border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 20px; display: grid; gap: 14px; position: sticky; top: 8px; z-index: 5; }
.sum-main { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sum-main p { margin: 0; display: grid; }
.sum-label { font-size: .8rem; font-weight: 700; color: var(--muted); }
.sum-value { font-family: var(--f-head); font-size: 1.45rem; line-height: 1.2; }
.sum-price .sum-value { color: var(--accent); }
.sum-recurring { display: none; }
.sum-recurring ul { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 4px; }
.sum-recurring li { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; }
.sum-off { font-size: .8rem; color: var(--muted); }

.room-grid { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 12px; }
.room { border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; animation: room-in .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 40ms); }
@keyframes room-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.room-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; border-bottom: 2px dotted color-mix(in srgb, var(--text) 25%, transparent); padding-bottom: 6px; margin-bottom: 8px; }
.room-head h3 { margin: 0; }
.room-count { font-size: .8rem; color: var(--muted); font-weight: 700; white-space: nowrap; }
.room-list { list-style: none; margin: 0; padding: 0; }
.room-list li { position: relative; padding: 4px 0 4px 26px; }
.room-list li::before { content: ""; position: absolute; left: 2px; top: .75em; width: 12px; height: 7px; border-left: 2.5px solid var(--accent); border-bottom: 2.5px solid var(--accent); transform: rotate(-45deg); }
.tag { display: inline-block; margin-left: 8px; font-size: .7rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; border: 1.5px solid var(--accent); color: var(--text); vertical-align: 1px; }
.room-list .is-added .tag { background: var(--accent); color: var(--accent-text); }
.list-foot { display: grid; gap: 18px; margin-bottom: 14px; }
.no-list { list-style: none; margin: 0; padding: 0; }
.no-list li { position: relative; padding: 4px 0 4px 26px; color: var(--k-muted); }
.no-list li::before { content: ""; position: absolute; left: 4px; top: 1em; width: 12px; height: 2.5px; background: currentColor; }
.list-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.saved { margin: 0; font-weight: 600; }

/* ---------- who comes ---------- */

.people { display: grid; gap: 22px; margin-bottom: 26px; }
.person { display: grid; grid-template-columns: 92px 1fr; column-gap: 14px; align-items: start; }
.person .photo { grid-row: span 2; width: 92px; aspect-ratio: 1 / 1; border-radius: 50%; margin: 0; }
.person .photo.is-art { padding: 0; }
.person h3 { margin: 6px 0 4px; }
.person p { color: var(--k-muted); margin: 0; }
.details { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 12px; }
.detail { border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.detail-photo { margin: -16px -18px 12px; border-radius: var(--radius) var(--radius) 0 0; box-shadow: none; }
.detail h3 { color: var(--accent); margin-bottom: 4px; }
.detail p { margin: 0; }

/* ---------- kinds ---------- */

.kind-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.kind-card { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.kind-card .photo { border-radius: 0; box-shadow: none; }
.kind-body { padding: 16px 18px; }
.kind-body p { margin: 0; color: var(--muted); }

/* ---------- prices ---------- */

.price-table { display: grid; gap: 10px; margin-bottom: 16px; }
.pt-row { border-radius: var(--radius-s); padding: 14px 16px; display: grid; gap: 8px; box-shadow: var(--shadow); }
.pt-head { display: none; }
.pt-home { font-weight: 700; font-family: var(--f-head); font-size: 1.15rem; }
.pt-cell { display: grid; grid-template-columns: 6.5rem 1fr; column-gap: 10px; align-items: baseline; }
.pt-kind { font-size: .85rem; font-weight: 700; color: var(--muted); grid-row: span 2; }
.pt-cell strong { color: var(--accent); }
.pt-time { font-size: .85rem; color: var(--muted); }

/* ---------- licence ---------- */

.licence-box { border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); max-width: 820px; }
.licence-box .kicker { color: var(--accent); }
.text-link { font-weight: 700; text-underline-offset: 4px; }

/* ---------- book ---------- */

.book-grid { display: grid; gap: 26px; }
.book .photo { margin-top: 18px; max-width: 460px; }
.form { display: grid; gap: 14px; align-content: start; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.form label { display: grid; gap: 6px; font-weight: 600; }
.form input, .form select, .form textarea {
  font: inherit; font-weight: 400; color: var(--text); background: var(--bg);
  border: 2px solid var(--border); border-radius: var(--radius-s); padding: 10px 12px; min-height: 48px; width: 100%;
}
.form input:focus, .form select:focus, .form textarea:focus { border-color: var(--accent); }
.sample-out { border-radius: var(--radius-s); border: 2px dashed var(--accent); padding: 14px; }
.sample-text { font: inherit; font-size: .9rem; white-space: pre-wrap; margin: 0 0 8px; }

/* ---------- footer, pinned bar ---------- */

.footer-grid { display: grid; gap: 10px; }
.footer-brand { display: flex; align-items: center; gap: 10px; font-family: var(--f-head); font-size: 1.3rem; }
.footer a { text-underline-offset: 3px; }
.pinbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  padding: 8px var(--gutter) calc(8px + env(safe-area-inset-bottom));
  background: var(--b2); --k-text: var(--b2-text); --k-accent: var(--b2-accent); --k-accent-text: var(--b2-accent-text);
  box-shadow: 0 -6px 20px rgba(0, 0, 0, .15);
}

/* ---------- motion ---------- */

.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .7s var(--ease), transform .8s var(--ease); transition-delay: calc(var(--i, 0) * 60ms); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- wider screens ---------- */

@media (min-width: 720px) {
  :root { --gutter: 28px; }
  .block { padding: 84px 0; }
  .kind-chips { grid-template-columns: repeat(3, 1fr); }
  .counts { grid-template-columns: repeat(3, 1fr); }
  .stepper { grid-template-columns: 1fr; padding: 10px; }
  .room-grid { grid-template-columns: repeat(2, 1fr); }
  .sum-recurring { display: block; }
  .summary { grid-template-columns: 1.1fr 1fr; align-items: start; }
  .details { grid-template-columns: repeat(2, 1fr); }
  .kind-cards { grid-template-columns: repeat(2, 1fr); }
  .people { grid-template-columns: repeat(3, 1fr); }
  .person { grid-template-columns: 1fr; }
  .person .photo { grid-row: auto; width: 100%; max-width: 320px; aspect-ratio: 4 / 5; border-radius: var(--radius); margin-bottom: 12px; }
  .pt-head { display: grid; grid-template-columns: 1.2fr repeat(3, 1fr); gap: 12px; padding: 0 16px; font-weight: 700; font-size: .85rem; color: var(--k-muted); }
  .pt-row:not(.pt-head) { grid-template-columns: 1.2fr repeat(3, 1fr); gap: 12px; align-items: center; }
  .pt-cell { grid-template-columns: 1fr; }
  .pt-kind { display: none; }
  .list-foot { grid-template-columns: 1.2fr 1fr; align-items: start; }
}
@media (max-width: 719px) {
  /* On a phone the recurring prices show under the summary, not in it, so the summary stays short. */
  .summary .sum-recurring { display: block; position: static; }
  .summary { position: static; }
}
@media (min-width: 960px) {
  body { --pinbar: 0px; }
  .pinbar { display: none; }
  .topnav { display: flex; }
  .topbar .topcall { display: inline-flex; }
  .hero-grid { grid-template-columns: 1.05fr .95fr; align-items: center; }
  .room-grid { grid-template-columns: repeat(3, 1fr); }
  .book-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1.2fr; align-items: start; }
}

@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .room { animation: none; }
  .lamp-glass, .lamp-glow, .photo img { transition: none; }
}

/* ---------- print: the list only ---------- */

@media print {
  body { padding: 0; background: #fff; color: #000; }
  .ribbon, .topbar, .hero, .team, .kinds, .prices, .licence, .book, .footer, .pinbar, .controls, .list-actions, .builder .lead { display: none !important; }
  .builder { background: #fff; color: #000; padding: 0; }
  .room, .summary { box-shadow: none; border: 1px solid #999; break-inside: avoid; background: #fff; color: #000; }
  .room-grid { grid-template-columns: repeat(2, 1fr); }
}
