/* Činžovna – one-page site with a waitlist.
   Visual source: a Czech tenement house (činžovní dům) – enamel house-number signs, the doorbell panel
   at the entrance, the house book. One bold element: the interactive doorbell panel in the hero. */

@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo-latin-ext.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;

  /* palette */
  --enamel: #1f4f9e;      /* enamel blue of Czech house-number signs */
  --enamel-deep: #163b78;
  --enamel-wash: #e6ecf6;
  --paper: #f1f2ee;       /* cool stairwell plaster, not cream */
  --sheet: #ffffff;
  --ink: #18212e;         /* blue-black ink */
  --muted: #555d69;
  --rule: #cdd1c9;
  --signal: #b8322b;      /* red of the číslo popisné sign; only for "overdue" */
  --signal-wash: #f8e7e5;
  --ok: #2f6b4a;
  --brass: #b28a3c;

  /* type scale (classic: 14 · 16 · 18 · 21 · 24 · 36 · 48 · 60 · 72) */
  --fs-small: 0.875rem;
  --fs-body: 1.125rem;
  --fs-h3: 1.3125rem;
  --fs-h2: clamp(1.75rem, 1.2rem + 2.2vw, 2.25rem);
  --fs-h1: clamp(2.375rem, 1.3rem + 3.4vw, 4rem);

  --measure: 34em;
  --gutter: clamp(1rem, 0.5rem + 2.5vw, 2.5rem);
  --page: 72rem;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Archivo", system-ui, sans-serif;
  font-size: var(--fs-body);
  font-stretch: 100%;
  line-height: 1.55;
}

img, svg { display: block; max-width: 100%; }

a { color: var(--enamel); text-underline-offset: 0.18em; }
a:hover { color: var(--enamel-deep); }

:focus-visible {
  outline: 3px solid var(--enamel);
  outline-offset: 3px;
  border-radius: 2px;
}

.wrap {
  width: 100%;
  max-width: var(--page);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: -999px;
  top: 0.5rem;
  background: var(--sheet);
  padding: 0.5rem 0.75rem;
  z-index: 10;
}
.skip:focus { left: 0.5rem; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- header ---------- */

.site-header { padding-block: 1.25rem; }
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* the logo is a small enamel sign: blue plate, white inner border, rounded corners */
.plate {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.85rem 0.35rem;
  background: var(--enamel);
  color: #fff;
  border-radius: 0.45rem;
  box-shadow: inset 0 0 0 2px var(--enamel), inset 0 0 0 3.5px #fff;
  font-weight: 700;
  font-stretch: 78%;
  font-size: 1.3125rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  line-height: 1.2;
}
.plate:hover { color: #fff; background: var(--enamel-deep); box-shadow: inset 0 0 0 2px var(--enamel-deep), inset 0 0 0 3.5px #fff; }

.header-link { font-weight: 600; font-size: var(--fs-small); }

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

.hero { padding-block: clamp(1.5rem, 1rem + 3vw, 4rem) clamp(3rem, 2rem + 4vw, 6rem); }
.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  grid-template-areas:
    "intro house"
    "form  house";
  grid-template-rows: auto 1fr;
  column-gap: clamp(2rem, 1rem + 4vw, 5rem);
  align-items: start;
}
.hero-intro { grid-area: intro; }
.house { grid-area: house; }
.hero-form { grid-area: form; }
.hero-form-title { display: none; }

h1, h2, h3 { margin: 0; line-height: 1.08; }

h1 {
  font-size: var(--fs-h1);
  font-weight: 750;
  font-stretch: 80%;
  letter-spacing: -0.01em;
  max-width: 14ch;
  text-wrap: balance;
}
h1 span { display: block; color: var(--muted); font-weight: 600; }

.lead {
  margin: 1.5rem 0 0;
  max-width: var(--measure);
  font-size: 1.1875rem;
  line-height: 1.55;
}

/* ---------- waitlist form ---------- */

.signup {
  margin-top: 2rem;
  max-width: 30rem;
  display: grid;
  gap: 1rem;
}
.field { display: grid; gap: 0.35rem; }
.field label, .field legend { font-weight: 600; font-size: 1rem; }

input[type="email"], select {
  width: 100%;
  font: inherit;
  font-size: 1.0625rem;
  color: var(--ink);
  background: var(--sheet);
  border: 1.5px solid #9aa1a8;
  border-radius: 0.375rem;
  padding: 0.7rem 0.8rem;
}
input[type="email"]:focus, select:focus { border-color: var(--enamel); outline: none; box-shadow: 0 0 0 3px var(--enamel-wash); }
input[aria-invalid="true"] { border-color: var(--signal); }

.flats { border: 0; margin: 0; padding: 0; }
.flats-options { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.35rem; }
.flats-options label {
  position: relative;
  display: inline-flex;
}
.flats-options input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}
.flats-options span {
  display: inline-block;
  min-width: 3.25rem;
  text-align: center;
  padding: 0.45rem 0.8rem;
  border: 1.5px solid #9aa1a8;
  border-radius: 0.375rem;
  background: var(--sheet);
  font-weight: 600;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}
.flats-options input:checked + span { background: var(--enamel); border-color: var(--enamel); color: #fff; }
.flats-options input:focus-visible + span { outline: 3px solid var(--enamel); outline-offset: 2px; }

.check {
  display: grid;
  grid-template-columns: 1.25rem 1fr;
  gap: 0.6rem;
  align-items: start;
  font-size: 1rem;
  line-height: 1.45;
}
.check input { width: 1.15rem; height: 1.15rem; margin: 0.15rem 0 0; accent-color: var(--enamel); }

.honeypot { position: absolute; left: -5000px; width: 1px; height: 1px; overflow: hidden; }

.btn {
  display: inline-block;
  justify-self: start;
  text-decoration: none;
  font: inherit;
  font-weight: 700;
  font-size: 1.0625rem;
  color: #fff;
  background: var(--enamel);
  border: 0;
  border-radius: 0.375rem;
  padding: 0.85rem 1.4rem;
  cursor: pointer;
}
.btn:hover { background: var(--enamel-deep); color: #fff; }
.btn[disabled] { opacity: 0.6; cursor: progress; }

.form-note { margin: 0; color: var(--muted); font-size: var(--fs-small); }

.form-status { margin: 0; font-weight: 600; font-size: 1rem; }
.form-status:empty { display: none; }
.form-status[data-state="ok"] { color: var(--ok); }
.form-status[data-state="error"] { color: var(--signal); }

.signup-done {
  margin-top: 2rem;
  max-width: 30rem;
  padding: 1.25rem 1.4rem;
  background: var(--sheet);
  border-left: 4px solid var(--ok);
}
.signup-done h2 { font-size: var(--fs-h3); font-stretch: 90%; }
.signup-done p { margin: 0.5rem 0 0; }

/* ---------- the doorbell panel (the one bold element) ---------- */

.house { display: grid; gap: 1.25rem; }

.house-hint { margin: 0; font-size: var(--fs-small); color: var(--muted); }

.panel {
  position: relative;
  padding: 1.1rem;
  border-radius: 0.75rem;
  /* brushed stainless plate */
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.22) 0 1px, transparent 1px 3px),
    linear-gradient(160deg, #e3e5e1 0%, #c9ccc7 55%, #d8dad5 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    inset 0 -1px 0 rgba(0, 0, 0, 0.12),
    0 1px 2px rgba(24, 33, 46, 0.18),
    0 10px 24px -12px rgba(24, 33, 46, 0.35);
}
/* the four screws */
.panel::before,
.panel::after {
  content: "";
  position: absolute;
  top: 0.45rem;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #f2f3f1, #8f948f 70%);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15), 0 calc(100% + 0px) 0 0 transparent;
}
.panel::before { left: 0.45rem; }
.panel::after { right: 0.45rem; }

.panel-street {
  margin: 0 0 0.85rem;
  text-align: center;
  font-size: var(--fs-small);
  font-weight: 600;
  font-stretch: 85%;
  color: #3f4650;
}

.bells { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }

.bell {
  width: 100%;
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 1fr);
  align-items: center;
  gap: 0.85rem;
  padding: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  background: none;
  border: 0;
  cursor: pointer;
}

.bell-button {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #e7cf93, var(--brass) 55%, #7d5f22 100%);
  box-shadow:
    0 0 0 3px #b9bdb7,
    0 0 0 4px rgba(0, 0, 0, 0.12),
    0 2px 3px rgba(0, 0, 0, 0.3);
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.nameplate {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.15rem 0.75rem;
  padding: 0.55rem 0.85rem;
  background: #fbfbf9;
  border-radius: 0.3rem;
  box-shadow: inset 0 0 0 1px rgba(24, 33, 46, 0.18), inset 0 1px 2px rgba(0, 0, 0, 0.08);
}
.nameplate b {
  font-weight: 650;
  font-stretch: 78%;
  font-size: 1.125rem;
}
.nameplate small {
  font-size: 0.875rem;
  color: var(--muted);
  font-stretch: 90%;
}
.nameplate small::before {
  content: "";
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  margin-right: 0.4rem;
  border-radius: 50%;
  background: var(--ok);
  vertical-align: 0.05em;
}
.bell[data-tone="warn"] .nameplate small::before { background: var(--brass); }
.bell[data-tone="alert"] .nameplate small { color: var(--signal); }
.bell[data-tone="alert"] .nameplate small::before { background: var(--signal); }

.bell[aria-pressed="true"] .bell-button {
  transform: translateY(1px) scale(0.96);
  box-shadow:
    0 0 0 3px var(--enamel),
    0 0 0 4px rgba(0, 0, 0, 0.12),
    inset 0 2px 4px rgba(0, 0, 0, 0.35);
}
.bell[aria-pressed="true"] .nameplate {
  background: #fff;
  box-shadow: inset 0 0 0 2px var(--enamel);
}
.bell:focus-visible { outline: none; }
.bell:focus-visible .nameplate { outline: 3px solid var(--enamel); outline-offset: 2px; }

/* ---------- the lease file (spis) shown under the panel ---------- */

.spis {
  background: var(--sheet);
  border-radius: 0.375rem;
  border-top: 4px solid var(--enamel);
  padding: 1.1rem 1.25rem 0.5rem;
  box-shadow: 0 1px 2px rgba(24, 33, 46, 0.1);
}
.spis-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.25rem 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--rule);
}
.spis-head h2 { font-size: var(--fs-h3); font-stretch: 85%; font-weight: 700; }
.spis-head p { margin: 0; font-size: var(--fs-small); color: var(--muted); }

.entries { list-style: none; margin: 0; padding: 0; }
.entry {
  display: grid;
  grid-template-columns: 6.1rem minmax(0, 1fr);
  gap: 0.25rem 0.9rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--rule);
}
.entry:last-child { border-bottom: 0; }
.entry time {
  font-size: var(--fs-small);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
}
.entry-who { display: block; font-size: var(--fs-small); font-weight: 650; color: var(--enamel-deep); }
.entry-who[data-who="tenant"] { color: #6a4a12; }
.entry-who[data-who="system"] { color: var(--muted); }
.entry p { margin: 0.1rem 0 0; font-size: 1rem; line-height: 1.45; }
.tag {
  display: inline-block;
  margin-top: 0.4rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: var(--enamel-wash);
  color: var(--enamel-deep);
  font-size: 0.8125rem;
  font-weight: 600;
}
.tag[data-tone="alert"] { background: var(--signal-wash); color: var(--signal); }
.tag[data-tone="ok"] { background: #e3efe7; color: var(--ok); }

.spis-swap { animation: none; }
@media (prefers-reduced-motion: no-preference) {
  .spis-swap { animation: spis-in 220ms ease-out; }
  @keyframes spis-in {
    from { opacity: 0.2; transform: translateY(4px); }
    to { opacity: 1; transform: none; }
  }
}

/* ---------- content sections ---------- */

.section { padding-block: clamp(3rem, 2rem + 4vw, 6rem); }
.section + .section { border-top: 1px solid var(--rule); }
.section-white { background: var(--sheet); }

.section h2 {
  font-size: var(--fs-h2);
  font-weight: 750;
  font-stretch: 82%;
  max-width: 22ch;
}
.section-intro { margin: 1rem 0 0; max-width: var(--measure); color: var(--muted); }

/* spis: two sides */
.sides {
  margin-top: 2.5rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem clamp(2rem, 1rem + 4vw, 5rem);
}
.side h3 {
  font-size: var(--fs-h3);
  font-stretch: 88%;
  font-weight: 700;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid var(--ink);
}
.side h3 small { font-weight: 500; color: var(--muted); font-size: 1rem; }
.side ul { margin: 0; padding: 0; list-style: none; }
.side li { padding: 0.75rem 0; border-bottom: 1px solid var(--rule); max-width: var(--measure); }

.record-rule {
  margin: 3rem 0 0;
  max-width: 44rem;
  padding: 1.25rem 1.5rem;
  background: var(--enamel-wash);
  border-left: 4px solid var(--enamel);
}
.record-rule strong { display: block; font-size: var(--fs-h3); font-stretch: 88%; margin-bottom: 0.35rem; }
.record-rule p { margin: 0; }

/* the landlord's year: a real sequence, so it gets an ordered timeline */
.year {
  list-style: none;
  margin: 2.5rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 clamp(1.5rem, 1rem + 2vw, 3rem);
  counter-reset: step;
}
.year li {
  position: relative;
  padding: 1.25rem 0 1.75rem;
  border-top: 2px solid var(--ink);
}
.year li::before {
  content: "";
  position: absolute;
  top: -0.45rem;
  left: 0;
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--ink);
}
.when {
  display: block;
  font-weight: 700;
  font-stretch: 85%;
  font-size: var(--fs-h3);
  line-height: 1.2;
}
.year p { margin: 0.5rem 0 0; max-width: 28em; }

/* price */
.price {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 2rem clamp(2rem, 1rem + 4vw, 5rem);
  align-items: start;
}
.price p { max-width: var(--measure); }
.included {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 2rem;
}
.included li {
  padding: 0.5rem 0 0.5rem 1.6rem;
  position: relative;
  border-bottom: 1px solid var(--rule);
}
.included li::before {
  content: "";
  position: absolute;
  left: 0.15rem;
  top: 0.95rem;
  width: 0.75rem;
  height: 0.4rem;
  border-left: 2px solid var(--enamel);
  border-bottom: 2px solid var(--enamel);
  transform: rotate(-45deg);
}

/* FAQ */
.faq { margin-top: 2rem; max-width: 46rem; }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 1.1rem 2rem 1.1rem 0;
  position: relative;
  font-weight: 650;
  font-size: 1.1875rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  position: absolute;
  right: 0.35rem;
  top: 1.45rem;
  width: 0.6rem;
  height: 0.6rem;
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  transform: rotate(45deg);
  transition: transform 160ms ease;
}
.faq details[open] summary::after { transform: rotate(-135deg); top: 1.7rem; }
.faq details p { margin: 0 0 1.25rem; max-width: var(--measure); }

.cta-again { margin-top: 2.5rem; }

/* footer */
.site-footer { padding-block: 2.5rem; font-size: var(--fs-small); color: var(--muted); border-top: 1px solid var(--rule); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 0.75rem 2rem; justify-content: space-between; }
.site-footer p { margin: 0; }

/* legal page */
.legal { padding-block: 2rem 5rem; }
.legal h1 { font-size: var(--fs-h2); max-width: none; }
.legal h2 { font-size: var(--fs-h3); margin-top: 2rem; font-stretch: 88%; }
.legal p, .legal li { max-width: var(--measure); }
.draft-note { padding: 0.75rem 1rem; background: var(--signal-wash); color: var(--signal); font-weight: 600; max-width: var(--measure); }

/* success state: a check that draws itself once (the peak moment of the page) */
.done-mark {
  display: block;
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: 0.75rem;
}
.done-mark circle { fill: #e3efe7; }
.done-mark path {
  fill: none;
  stroke: var(--ok);
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 30;
  stroke-dashoffset: 0;
}
@media (prefers-reduced-motion: no-preference) {
  .done-mark path { animation: draw-check 420ms 120ms ease-out both; }
  @keyframes draw-check { from { stroke-dashoffset: 30; } to { stroke-dashoffset: 0; } }
}

/* sticky call to action in the thumb zone, phones and small tablets only */
.mobile-cta { display: none; }

/* ---------- responsive ---------- */

@media (max-width: 960px) {
  .hero .wrap {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "intro" "house" "form";
    grid-template-rows: auto;
    row-gap: 2.5rem;
  }
  .hero-form-title {
    display: block;
    font-size: var(--fs-h2);
    font-weight: 750;
    font-stretch: 82%;
  }
  .hero-form .signup { margin-top: 1.5rem; }
  h1 { max-width: 14ch; }
  .year { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .price { grid-template-columns: minmax(0, 1fr); }

  .mobile-cta {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
    padding: 0.75rem var(--gutter) calc(0.75rem + env(safe-area-inset-bottom));
    background: rgba(241, 242, 238, 0.94);
    border-top: 1px solid var(--rule);
    box-shadow: 0 -8px 24px -16px rgba(24, 33, 46, 0.35);
    transform: translateY(0);
    transition: transform 200ms ease, visibility 200ms;
  }
  .mobile-cta .btn { display: block; width: 100%; text-align: center; min-height: 3rem; }
  .mobile-cta[data-hidden="true"] { transform: translateY(110%); visibility: hidden; }
  body { padding-bottom: calc(4.5rem + env(safe-area-inset-bottom)); }
}

@media (max-width: 640px) {
  /* 8-point rhythm on phones */
  .hero { padding-block: 1rem 4rem; }
  .section { padding-block: 4rem; }
  .lead { font-size: var(--fs-body); margin-top: 1rem; }
  .header-link { display: none; } /* the sticky button takes over */

  .house { gap: 1rem; }
  .panel { padding: 1rem 0.75rem; }
  .bell { grid-template-columns: 2.75rem minmax(0, 1fr); gap: 0.75rem; min-height: 3.5rem; }
  .bell-button { width: 2.75rem; height: 2.75rem; }
  .nameplate { flex-direction: column; align-items: flex-start; gap: 0; padding: 0.5rem 0.75rem; }

  .spis { padding: 1rem 1rem 0.5rem; }
  .entry { grid-template-columns: minmax(0, 1fr); gap: 0.125rem; padding: 0.75rem 0; }

  /* tap targets of at least 44 px */
  .flats-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; }
  .flats-options label:last-child { grid-column: span 2; }
  .flats-options span { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 2.75rem; }
  .check { grid-template-columns: 1.5rem 1fr; min-height: 2.75rem; }
  .check input { width: 1.375rem; height: 1.375rem; margin-top: 0.05rem; }
  .signup .btn { width: 100%; min-height: 3rem; }
  .faq summary { min-height: 2.75rem; }

  .sides { grid-template-columns: minmax(0, 1fr); margin-top: 2rem; }
  .included { grid-template-columns: minmax(0, 1fr); }

  /* the landlord's year becomes a vertical timeline with a rail on the left */
  .year { grid-template-columns: minmax(0, 1fr); margin-top: 2rem; }
  .year li { border-top: 0; border-left: 2px solid var(--ink); padding: 0 0 2rem 1.5rem; }
  .year li:last-child { padding-bottom: 0; border-left-color: transparent; }
  .year li::before { top: 0.3rem; left: -0.5rem; }
}
