/* Roomatch website: the app's "sticker" look (cream paper, violet + amber, ink outlines). */

@font-face { font-family: 'Bricolage Grotesque'; font-weight: 800; font-display: swap; src: url('/fonts/BricolageGrotesque_800ExtraBold.ttf') format('truetype'); }
@font-face { font-family: 'DM Sans'; font-weight: 400; font-display: swap; src: url('/fonts/DMSans_400Regular.ttf') format('truetype'); }
@font-face { font-family: 'DM Sans'; font-weight: 500; font-display: swap; src: url('/fonts/DMSans_500Medium.ttf') format('truetype'); }
@font-face { font-family: 'DM Sans'; font-weight: 700; font-display: swap; src: url('/fonts/DMSans_700Bold.ttf') format('truetype'); }

:root {
  --ink: #1A1433;
  --brand: #5B3DF5;
  --brand-fill: #5B3DF5; /* filled violet under white text: 6.1:1 in both themes */
  --brand-soft: #F1EDFF;
  --brand-ink: #3B25B8;
  --accent: #FFB23F;
  --accent-soft: #FFEBC8;
  --accent-ink: #7A4300;
  --bg: #FFF6E9;
  --surface: #FFFFFF;
  --text: #1A1433;
  --muted: #5C5470;
  --hairline: #E6DFD2;
  --success: #0F6B3C;
  --success-bg: #DCF5E6;
  --danger: #C8243F;
  --outline: #1A1433;
  --shadow: #1A1433;
  --radius: 24px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --brand: #7C66FF;
    --brand-soft: #2A2354;
    --brand-ink: #CFC6FF;
    --accent-soft: #3B2C12;
    --accent-ink: #FFD08A;
    --bg: #13101E;
    --surface: #1E1A2E;
    --text: #F3F0FA;
    --muted: #A8A1BF;
    --hairline: #2D2842;
    --success: #5FD39B;
    --success-bg: #12352A;
    --danger: #FF6B81;
    --outline: #4A4270;
    --shadow: #07050F;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.5 'DM Sans', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: 'Bricolage Grotesque', system-ui, sans-serif; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; margin: 0; }
p { margin: 0; }
a { color: inherit; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }

/* sticker surfaces */
.card {
  background: var(--surface);
  border: 2px solid var(--outline);
  border-radius: var(--radius);
  box-shadow: 6px 6px 0 var(--shadow);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 54px; padding: 0 24px;
  border: 2px solid var(--outline); border-radius: 999px;
  background: var(--accent); color: #1A1433;
  font: 700 17px 'DM Sans', system-ui, sans-serif; text-decoration: none; cursor: pointer;
  box-shadow: 4px 4px 0 var(--shadow);
  transition: transform .08s ease, box-shadow .08s ease;
}
.btn:focus-visible, summary:focus-visible, .brand:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
/* pointer devices get a small lift on hover; touch keeps the press state only */
@media (hover: hover) {
  .btn:hover:not(:disabled) { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--shadow); }
  summary:hover { color: var(--brand); }
  .segment span:hover { background: var(--brand-soft); }
  .segment input:checked + span:hover { background: var(--brand-fill); }
}
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--shadow); }
.btn:disabled { background: var(--hairline); color: var(--muted); box-shadow: none; cursor: default; }
.btn-small { min-height: 44px; padding: 0 18px; font-size: 15px; white-space: nowrap; }
.btn-dark { background: #1A1433; color: #FFFFFF; border-color: #1A1433; box-shadow: 4px 4px 0 rgba(26,20,51,.35); }

/* nav */
.nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 0; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--brand); font: 800 28px 'Bricolage Grotesque', system-ui, sans-serif; letter-spacing: -0.03em; }
.door { width: 22px; height: 33px; }

/* hero */
.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: start; padding: 40px 0 72px; }
h1 { font-size: clamp(32px, 9.5vw, 68px); line-height: 1.02; overflow-wrap: break-word; }
.lead { font-size: 20px; color: var(--muted); margin: 20px 0 32px; max-width: 32em; }

.signup { padding: 24px; display: grid; gap: 16px; max-width: 520px; }
.signup h2 { font-size: 24px; }
.segment { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px; margin: 0; border: 1.5px solid var(--hairline); border-radius: 999px; }
.segment label { position: relative; }
.segment input { position: absolute; opacity: 0; }
.segment span { display: grid; place-items: center; min-height: 44px; text-align: center; padding: 0 6px; border-radius: 999px; font-weight: 700; font-size: 15px; white-space: nowrap; cursor: pointer; }
.segment input:checked + span { background: var(--brand-fill); color: #FFFFFF; }
.segment input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.field { display: grid; gap: 6px; font-weight: 700; font-size: 14px; }
.field input, .field select {
  font: 400 17px 'DM Sans', system-ui, sans-serif; color: var(--text);
  width: 100%; min-height: 52px; padding: 0 14px; margin: 0;
  background-color: var(--bg); border: 2px solid var(--outline); border-radius: 16px;
  -webkit-appearance: none; appearance: none;
}
/* the select draws its own arrow, so it looks exactly like the e-mail field */
.field select {
  padding-right: 44px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235C5470' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 20px;
}
.field input:focus, .field select:focus { outline: 3px solid var(--brand-soft); border-color: var(--brand); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; }
.fine { font-size: 13px; color: var(--muted); }
.cf-turnstile { min-height: 65px; }
.status { font-weight: 700; min-height: 1.5em; }
.field-error { color: var(--danger); font-weight: 700; font-size: 14px; margin-top: -8px; }
.field input[aria-invalid="true"] { border-color: var(--danger); }
.status.ok { color: var(--success); }
.status.err { color: var(--danger); }

/* hero door: an arched doorway with a person card inside; the leaf swings open once on load */
.doorway {
  position: relative; justify-self: center; align-self: start; margin-top: 16px;
  width: min(380px, 100%); aspect-ratio: 380 / 540;
  /* a true half-circle arch at any width: horizontal radius half the width, vertical the same in px */
  border-radius: 50% 50% 0 0 / 35.2% 35.2% 0 0;
  background: var(--accent);
  border: 2px solid var(--outline);
  box-shadow: 8px 8px 0 var(--shadow);
  perspective: 2200px;
}
.inside {
  position: absolute; inset: 56px 24px 24px;
  display: grid; justify-items: center; align-content: start; gap: 10px; text-align: center;
  background: var(--surface); border: 2px solid var(--outline);
  border-radius: 50% 50% 14px 14px / 36% 36% 14px 14px;
  padding: 36px 20px 20px;
}
.avatar { width: 96px; height: 96px; border-radius: 50%; background: #FF8FA6; border: 2px solid var(--outline); display: grid; place-items: center; font: 800 44px 'Bricolage Grotesque', sans-serif; color: #1A1433; }
.name { font: 800 26px 'Bricolage Grotesque', sans-serif; letter-spacing: -0.02em; }
.score { display: flex; align-items: center; gap: 12px; background: var(--brand-fill); color: #FFFFFF; border-radius: 16px; padding: 10px 16px; width: 100%; justify-content: center; }
.score b { font: 800 34px 'Bricolage Grotesque', sans-serif; }
.score span { font-weight: 700; font-size: 13px; line-height: 1.25; text-align: left; }
.reasons { list-style: none; padding: 0; margin: 4px 0 0; display: grid; gap: 6px; text-align: left; width: 100%; font-weight: 700; font-size: 15px; }
.reasons li::before { content: ''; display: inline-block; width: 18px; height: 18px; background: var(--success); margin-right: 8px; vertical-align: -4px;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath fill-rule='evenodd' d='M9 0a9 9 0 1 1 0 18A9 9 0 0 1 9 0Zm4.2 6.2-1.4-1.4L7.6 9 6 7.4 4.6 8.8l3 3 5.6-5.6Z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath fill-rule='evenodd' d='M9 0a9 9 0 1 1 0 18A9 9 0 0 1 9 0Zm4.2 6.2-1.4-1.4L7.6 9 6 7.4 4.6 8.8l3 3 5.6-5.6Z'/%3E%3C/svg%3E") center / contain no-repeat; }
.leaf {
  position: absolute; inset: -2px;
  border-radius: inherit; background: var(--brand); border: 2px solid var(--outline);
  transform-origin: left center;
}
/* opens when the door comes into view (on phones it sits below the form) */
.doorway.open .leaf { animation: open-door 1.1s cubic-bezier(.6, 0, .25, 1) .3s both; }
.knob { position: absolute; right: 16%; top: 58%; width: 18px; height: 18px; border-radius: 50%; background: var(--bg); }
@keyframes open-door {
  from { transform: none; }
  to { transform: scaleX(-0.22) skewY(-14deg); }
}

/* how it works: a real sequence, so it reads left to right with numbers */
.steps { padding: 24px 0 96px; }
.steps h2 { font-size: clamp(32px, 4vw, 44px); margin-bottom: 40px; }
.steps ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1.15fr .85fr 1fr; gap: 48px; counter-reset: step; }
.step { counter-increment: step; display: grid; grid-template-rows: 150px auto auto; gap: 12px; align-content: start; }
.step h3 { font-size: 24px; }
.step h3::before { content: counter(step) '. '; color: var(--brand); }
.step p { color: var(--muted); max-width: 30em; }
.art { align-self: end; }
.scales { display: grid; gap: 22px; padding-bottom: 8px; }
.scale { position: relative; display: flex; justify-content: space-between; align-items: center; height: 22px; }
.scale::before { content: ''; position: absolute; left: 9px; right: 9px; height: 4px; border-radius: 2px; background: var(--brand-soft); }
.scale .dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--brand-soft); margin: 0 5px; }
.scale .them, .scale .you, .scale .both { width: 20px; height: 20px; margin: 0; }
.scale .them { background: var(--brand); }
.scale .you { background: var(--surface); border: 4px solid var(--accent); }
.scale .both { background: var(--brand); border: 4px solid var(--accent); }
.bell-big { width: 128px; height: 128px; border-radius: 50%; background: var(--accent); border: 2px solid var(--outline); box-shadow: 6px 6px 0 var(--shadow); display: grid; place-items: center; transform: rotate(-8deg); }
.bell-big svg { width: 60px; height: 60px; fill: #1A1433; }
.bubbles { display: grid; gap: 10px; padding-bottom: 8px; }
.bubble { justify-self: start; background: var(--surface); border: 1.5px solid var(--hairline); border-radius: 20px 20px 20px 6px; padding: 10px 16px; font-size: 16px; }
.bubble.mine { justify-self: end; background: var(--brand-fill); border-color: var(--brand-fill); color: #FFFFFF; border-radius: 20px 20px 6px 20px; }

/* owners band */
.owners { background: var(--accent); color: #1A1433; padding: 64px 0; }
.owners-inner { display: flex; align-items: center; justify-content: space-between; gap: 32px; }
.owners h2 { font-size: clamp(32px, 4vw, 48px); margin-bottom: 12px; }
.owners p { max-width: 36em; color: #4A3100; font-size: 18px; }

/* faq */
.faq { padding: 80px 0; }
.faq > * { max-width: 760px; }
.faq h2 { font-size: 36px; margin-bottom: 24px; }
details { border-top: 1.5px solid var(--hairline); padding: 18px 0; }
details:last-of-type { border-bottom: 1.5px solid var(--hairline); }
summary { cursor: pointer; font-weight: 700; font-size: 18px; list-style: none; display: flex; justify-content: space-between; }
summary::-webkit-details-marker { display: none; }
summary::after { content: '+'; color: var(--brand); font-size: 24px; line-height: 1; }
details[open] summary::after { content: '–'; }
details p { margin-top: 10px; color: var(--muted); }

.footer { padding: 32px 0 48px; color: var(--muted); font-size: 14px; border-top: 1.5px solid var(--hairline); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }
.footer a { color: inherit; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 32px; padding-top: 8px; }
  .doorway { width: min(300px, 88%); }
  /* smaller door: everything stays, just tighter */
  .inside { inset: 40px 14px 14px; padding: 22px 12px 14px; gap: 6px; }
  .avatar { width: 60px; height: 60px; font-size: 28px; }
  .name { font-size: 22px; }
  .score { padding: 8px 12px; gap: 10px; }
  .score b { font-size: 28px; }
  .reasons { font-size: 13.5px; gap: 4px; margin-top: 2px; }
  .reasons li::before { width: 16px; height: 16px; margin-right: 6px; vertical-align: -3px; }
  .steps ol { grid-template-columns: 1fr; gap: 40px; }
  .step { grid-template-rows: auto auto auto; }
  .owners-inner { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 360px) {
  .inside { padding-top: 16px; }
  .avatar { width: 46px; height: 46px; font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
  .leaf { animation: none; transform: scaleX(-0.22) skewY(-14deg); }
}

/* ── Listing page (/o/<id>, rendered by src/listing-page.js) ── */
.lp { max-width: 720px; margin: 0 auto; padding-bottom: 72px; }
.lp-photos { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; border-radius: 20px; }
.lp-photos img { flex: 0 0 100%; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; scroll-snap-align: start; border-radius: 20px; border: 2px solid var(--outline); }
.lp-body { display: grid; gap: 12px; padding-top: 24px; }
.lp-body h1 { font-size: clamp(28px, 7vw, 40px); }
.lp-body h2 { font-size: 22px; margin-top: 12px; }
.lp-price b { font: 800 40px 'Bricolage Grotesque', system-ui, sans-serif; letter-spacing: -0.02em; }
.lp-price, .lp-body > .muted { margin: 0; }
.lp-district { margin: 0; font-weight: 700; color: var(--brand); }
.lp-owner { margin: 0; }
.lp-facts, .lp-tags { list-style: none; padding: 0; margin: 4px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.lp-facts li, .lp-tags li { border: 1.5px solid var(--hairline); border-radius: 999px; padding: 6px 12px; font-weight: 700; font-size: 15px; }
.lp-rules { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 0; }
.lp-rules div { border: 1.5px solid var(--hairline); border-radius: 16px; padding: 10px 14px; }
.lp-rules dt { color: var(--muted); font-size: 14px; }
.lp-rules dd { margin: 2px 0 0; font-weight: 700; }
.lp-desc { white-space: pre-line; margin: 8px 0 0; }
.lp-cta { display: grid; gap: 12px; padding: 24px; margin-top: 16px; }
.lp-cta .btn { justify-self: start; }
.lp-open { font-weight: 700; color: var(--brand); }
.lp-gone { max-width: 640px; margin: 48px auto; display: grid; gap: 8px; justify-items: start; }

/* ── Legal pages (prywatnosc.html, regulamin.html) ── */
.doc { max-width: 760px; padding-bottom: 96px; }
.doc h1 { font-size: clamp(32px, 6vw, 48px); margin: 16px 0 8px; }
.doc h2 { font-size: 24px; margin: 40px 0 12px; }
.doc h3 { font-size: 18px; margin: 24px 0 8px; }
.doc p, .doc li { line-height: 1.6; }
.doc ul { padding-left: 22px; display: grid; gap: 6px; }
.doc a { color: var(--brand); }
