/* Brass Street (bet 49): /street/ and the building pages /street/b/<n>/, and their share images.
   ops/street-page.js writes the buildings at build time; street.js draws the form's preview with the same
   markup. A building is CSS only: a roof, a wall in its fixed color, the shop sign, windows, a door and a
   brass plaque. --u scales a building (1 on the street, bigger on its own page and the share image). */

.street-sign {
  padding-bottom: 0;
}
.street-sign h1 {
  max-width: none;
}
.street-sign h1,
.street-what {
  overflow-wrap: anywhere;
}
.street-what {
  font-weight: 600;
}
.street-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}
.street-stats b {
  font-size: 1.5rem;
}

/* The street: sky, a row of lots on the sidewalk, the road. Scrolls sideways inside itself only. */
.street-sky,
.street-scene {
  background: linear-gradient(180deg, #fbefd6 0%, #f6e2bb 70%, #efd3a1 100%);
}
.street-sky {
  margin-top: 28px;
}
.street-row {
  display: flex;
  align-items: flex-end;
  gap: 22px;
  margin: 0;
  padding: 24px max(var(--gutter), calc((100vw - 1180px) / 2 + var(--gutter))) 0;
  overflow-x: auto;
  list-style: none;
  border-bottom: 22px solid #cdbb98;
  box-shadow: inset 0 -2px 0 #b29a70;
}
.street-walk {
  height: 26px;
  background:
    repeating-linear-gradient(90deg, #f3e3b4 0 34px, transparent 34px 70px)
      center / 100% 4px no-repeat,
    #3d3732;
}
.lot {
  position: relative;
  flex: none;
  display: grid;
  justify-items: center;
  align-content: end;
}
.lot-example .tag {
  position: absolute;
  top: -12px;
  left: 6px;
  padding: 2px 8px;
  background: var(--ink);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  border-radius: 10px;
}

/* Tack, leaning on the first lamp post, with its line above. Its own lot: it never covers a building. */
.lot-tack {
  width: 220px;
  gap: 36px;
}
.street-sky .bubble {
  position: relative;
  margin: 0;
  padding: 10px 14px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: #fff;
  font-size: 0.95rem;
  line-height: 1.35;
  font-weight: 600;
}
.street-sky .bubble::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 90px;
  border: 9px solid transparent;
  border-top-color: var(--ink);
}
.street-tack {
  display: flex;
  align-items: flex-end;
  justify-self: start;
  margin: 0 0 0 20px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.street-tack .tk {
  width: 96px;
  margin-left: -12px;
}
.lamp {
  position: relative;
  width: 10px;
  height: 180px;
  background: linear-gradient(90deg, #2b2620, #57493a 50%, #2b2620);
  border-radius: 4px 4px 0 0;
}
.lamp::before {
  content: "";
  position: absolute;
  top: -26px;
  left: -13px;
  width: 36px;
  height: 30px;
  border-radius: 6px 6px 14px 14px;
  background: radial-gradient(circle at 50% 70%, #fff4c4, #f0c35a 60%, #8a6420);
  box-shadow: 0 0 24px 6px rgba(255, 214, 120, 0.55);
}

/* One building. */
.bldg {
  --u: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: calc(var(--u) * 176px);
  color: var(--ink);
  text-decoration: none;
}
a.bldg:hover,
a.bldg:focus-visible {
  color: var(--ink);
}
.bldg-roof {
  display: block;
  width: calc(100% + var(--u) * 12px);
  height: calc(var(--u) * 16px);
  background: linear-gradient(180deg, #a77c2c, #6e4f1a);
  border-radius: 2px;
}
.bldg-peak .bldg-roof {
  width: 100%;
  height: calc(var(--u) * 44px);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  background: linear-gradient(180deg, #7a3b22, #4f2414);
}
.bldg-step .bldg-roof {
  width: 100%;
  height: calc(var(--u) * 30px);
  clip-path: polygon(
    0 100%,
    0 55%,
    18% 55%,
    18% 25%,
    36% 25%,
    36% 0,
    64% 0,
    64% 25%,
    82% 25%,
    82% 55%,
    100% 55%,
    100% 100%
  );
  background: color-mix(in srgb, var(--wall) 70%, #000);
}
.bldg-wall {
  display: grid;
  gap: calc(var(--u) * 9px);
  width: 100%;
  padding: calc(var(--u) * 10px);
  background:
    repeating-linear-gradient(
      0deg,
      rgba(0, 0, 0, 0.07) 0 1px,
      transparent 1px calc(var(--u) * 9px)
    ),
    var(--wall);
  border: 3px solid rgba(0, 0, 0, 0.28);
  border-bottom: 0;
  box-shadow: inset 0 0 0 calc(var(--u) * 4px) rgba(255, 255, 255, 0.12);
}
.bldg-sign {
  display: block;
  padding: calc(var(--u) * 6px) calc(var(--u) * 6px);
  background: #2a1a08;
  color: #f0cd72;
  border: 2px solid #c8952c;
  border-radius: 2px;
  font-size: calc(var(--u) * 15px);
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
  overflow-wrap: anywhere;
}
.bldg-wins {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: calc(var(--u) * 9px);
}
.bldg-win {
  height: calc(var(--u) * 30px);
  background: linear-gradient(160deg, #d6eef7, #8fb9cf 70%);
  border: calc(var(--u) * 3px) solid #f6ead0;
}
/* The plaque runs the full width of the wall, above the door, so a long note (60 characters) or a 20-letter
   handle wraps at word breaks instead of into a thin column. The wall grows taller; nothing is ever cut. */
.bldg-front {
  display: grid;
  gap: calc(var(--u) * 8px);
  justify-items: center;
}
.bldg-door {
  width: calc(var(--u) * 42px);
  height: calc(var(--u) * 70px);
  background: linear-gradient(90deg, #3b2410, #5a3a1c);
  border: calc(var(--u) * 3px) solid #f6ead0;
  border-bottom: 0;
  border-radius: calc(var(--u) * 20px) calc(var(--u) * 20px) 0 0;
}
.plaque {
  order: -1;
  justify-self: stretch;
  display: grid;
  gap: 1px;
  padding: calc(var(--u) * 6px) calc(var(--u) * 7px);
  background: linear-gradient(160deg, #f6dc8c, #c8952c 55%, #a7761f);
  border: 2px solid #5a3d10;
  border-radius: 3px;
  box-shadow: 0 2px 4px rgba(40, 20, 0, 0.35);
  color: #2a1a08;
  font-size: calc(var(--u) * 12px);
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.plaque-no {
  font-size: calc(var(--u) * 11px);
  font-weight: 800;
  letter-spacing: 0.02em;
}
.plaque-city,
.plaque-by {
  font-weight: 700;
}
.plaque-note {
  font-style: italic;
}
.plaque-note::before {
  content: "\201C";
}
.plaque-note::after {
  content: "\201D";
}

/* The empty lot at the end of the street. */
.empty {
  display: grid;
  place-content: center;
  gap: 6px;
  width: 176px;
  height: 230px;
  margin-bottom: 0;
  padding: 16px;
  border: 3px dashed #8a6f45;
  border-bottom: 0;
  color: var(--ink);
  text-align: center;
  text-decoration: none;
}
.empty-sign {
  padding: 6px 10px;
  background: #fff;
  border: 2px solid var(--ink);
  font-weight: 800;
}
.empty-sub {
  font-size: 0.9rem;
}

/* One building on its own page. */
.street-one {
  margin: 20px calc(var(--gutter) * -1) 24px;
}
.street-scene {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding: 28px 16px 0;
  border-bottom: 18px solid #cdbb98;
}
.street-one .bldg {
  --u: 1.45;
  max-width: 100%;
}
.street-tack-line {
  max-width: 34em;
}
.street-yours {
  max-width: 34em;
  margin: 28px 0;
  padding: 20px;
  border: 3px solid var(--ink);
}
.street-yours h2 {
  font-size: 1.75rem;
}
.share-said {
  display: inline-block;
  margin-left: 12px;
  font-weight: 700;
}

/* The add form and its preview. */
.add-grid {
  display: grid;
  gap: 28px;
}
.add-grid[hidden] {
  display: none;
}
#street-add label,
.add-colors legend {
  display: block;
  margin: 0 0 6px;
  font-weight: 800;
}
#street-add input[type="text"] {
  display: block;
  width: 100%;
  max-width: 30em;
  min-height: 50px;
  margin: 0 0 16px;
  padding: 0 12px;
  border: 2px solid var(--ink);
  border-radius: 0;
  font: inherit;
}
.add-words {
  margin: -10px 0 16px;
  color: var(--muted);
  font-size: 0.9rem;
}
.add-words.over {
  color: var(--red);
  font-weight: 800;
}
.add-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 18px;
  padding: 0;
  border: 0;
}
.add-colors legend {
  margin-bottom: 10px;
}
.swatch {
  position: relative;
  cursor: pointer;
}
.swatch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.chip {
  display: block;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: var(--chip);
  border: 2px solid rgba(0, 0, 0, 0.35);
}
.swatch input:checked + .chip {
  box-shadow:
    0 0 0 3px #fff,
    0 0 0 6px var(--ink);
}
.swatch input:focus-visible + .chip {
  outline: 3px solid #24406b;
  outline-offset: 6px;
}
.cf-turnstile {
  min-height: 65px;
  margin: 0 0 16px;
}
.add-status {
  margin: 12px 0 0;
  font-weight: 700;
}
.add-preview-h {
  margin: 0 0 8px;
  font-weight: 800;
}
.add-preview .street-scene {
  min-height: 300px;
}
.add-done {
  max-width: 34em;
  padding: 20px;
  border: 3px solid var(--ink);
  background: #fff8e6;
}
.add-rules {
  max-width: 40em;
  margin: 28px 0 16px;
}
.street-fine {
  max-width: 40em;
  color: var(--muted);
  font-size: 0.95rem;
}

/* Phones: a narrower lamp-post lot, so the first building on the street shows whole at 375 px. */
@media (max-width: 559px) {
  .lot-tack {
    width: 140px;
    gap: 28px;
  }
  .street-sky .bubble {
    padding: 8px 10px;
    font-size: 0.85rem;
  }
  .street-sky .bubble::after {
    left: 52px;
  }
  .street-tack {
    margin-left: 8px;
  }
  .street-tack .tk {
    width: 80px;
  }
  .lamp {
    height: 150px;
  }
}

@media (min-width: 860px) {
  .add-grid {
    grid-template-columns: minmax(0, 1fr) 320px;
    align-items: start;
  }
}

@media (prefers-reduced-motion: no-preference) {
  a.bldg {
    transition: transform 0.15s ease;
  }
  a.bldg:hover,
  a.bldg:focus-visible {
    transform: translateY(-4px);
  }
}

/* The top of /street/: what it is for, the demo loop, and the example share picture. Phone first. */
.street-hero .hero-grid {
  display: grid;
  gap: 18px;
}
.street-hero h1 {
  max-width: 15ch;
  font-size: clamp(2.125rem, 1.4rem + 3.4vw, 4rem);
}
.street-hero .street-what {
  max-width: 32em;
  margin: 0;
  font-size: 1.1875rem;
}
.hero-video,
.hero-card {
  margin: 0;
}
.hero-video {
  position: relative;
  width: min(100%, 300px);
}
.hero-video video {
  display: block;
  width: 100%;
  height: auto;
  background: #fbefd6;
  border: 6px solid #2a1a08;
  border-radius: 8px;
}
.demo-pause {
  position: absolute;
  left: 14px;
  bottom: 14px;
  min-height: 36px;
  padding: 0 12px;
  border: 2px solid #fff;
  border-radius: 18px;
  background: #2a1a08;
  color: #fff;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 800;
  cursor: pointer;
}
.hero-cta {
  margin: 4px 0 0;
}
.hero-card img {
  border: 3px solid #2a1a08;
}
.hero-card figcaption {
  max-width: 34em;
  margin-top: 10px;
  font-size: 1rem;
}

/* How it works: the same brass numbers as the demo's captions. */
.street-how {
  background: var(--fog);
}
.how-grid {
  display: grid;
  gap: 40px;
}
.street-how h2,
.street-now h2 {
  font-size: clamp(1.75rem, 1.4rem + 1.6vw, 2.5rem);
}
.how-steps {
  counter-reset: step;
  display: grid;
  gap: 18px;
  margin: 20px 0 28px;
  padding: 0;
  list-style: none;
}
.how-steps li {
  counter-increment: step;
  position: relative;
  max-width: 30em;
  padding-left: 58px;
}
.how-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -4px;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(160deg, #f6dc8c, #c8952c);
  color: #2a1a08;
  font-weight: 900;
  font-size: 1.25rem;
}
.how-steps b {
  display: block;
}
.how-why {
  max-width: 30em;
  margin: 0;
  padding: 16px 18px;
  border-left: 6px solid #c8952c;
  background: var(--paper);
}
.know {
  max-width: 30em;
  margin: 20px 0 0;
  padding-left: 1.2em;
}
.know li + li {
  margin-top: 10px;
}
.street-now {
  padding-top: 56px;
}

@media (min-width: 860px) {
  .street-hero .hero-grid {
    grid-template-columns: minmax(0, 1fr) 360px;
    grid-template-areas:
      "text video"
      "cta video"
      "card video";
    align-items: start;
    column-gap: 56px;
  }
  .hero-text {
    grid-area: text;
  }
  .hero-video {
    grid-area: video;
    width: 100%;
  }
  .hero-cta {
    grid-area: cta;
  }
  .hero-card {
    grid-area: card;
    max-width: 560px;
  }
  .how-grid {
    grid-template-columns: 1fr 1fr;
    gap: 56px;
  }
}
