/*
 * FlatBuddy — marketing site.
 *
 * Swiss-minimal: one sans family, hairline rules instead of boxes and shadows,
 * a single accent used sparingly, and a strict measure. The palette is lifted
 * from the app (src/lib/theme.ts) so the site and the thing it is selling read
 * as one product rather than two.
 */

:root {
  --indigo: #5b4bf5;
  --indigo-deep: #4f3df5;
  --indigo-soft: #eeebff;
  /* The warm accent carries the human parts, exactly as in the app. */
  --warm: #f2703f;
  /* The same warm, dark enough to be read.
     #f2703f on white is 2.93:1 — it fails WCAG AA for text at any size, which
     Lighthouse flags and a person in sunlight experiences. It stays the fill
     and border colour, where contrast is not a legibility requirement, and
     text switches to this: the app's own `warmDeep` token, 5.18:1, same hue.

     Restored after a revert took the whole stylesheet back and took this with
     it. Accessibility went 100 -> 96 on the next run, which is the only
     reason it was noticed — worth remembering that a revert can undo a fix
     nobody was thinking about. */
  --warm-deep: #c2410c;
  --ink: #101019;
  --ink-2: #3d3d52;
  --ink-3: #6b6b85;
  --rule: #e4e4ee;
  --bg: #ffffff;
  --bg-2: #fafaff;

  --measure: 34rem;
  --page: 68rem;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--indigo-deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.wrap {
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ── Type ──────────────────────────────────────────────────────────────── */

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 700;
}

h1 {
  font-size: clamp(2.4rem, 6vw, 3.9rem);
  letter-spacing: -0.035em;
}

h2 {
  font-size: clamp(1.6rem, 3.4vw, 2.2rem);
}

h3 {
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

.lede {
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  color: var(--ink-2);
  max-width: var(--measure);
}

.eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.muted {
  color: var(--ink-3);
}

.small {
  font-size: 0.92rem;
}

/* ── Header ────────────────────────────────────────────────────────────── */

header {
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: saturate(1.6) blur(10px);
  z-index: 10;
}

.bar {
  display: flex;
  align-items: center;
  gap: 2rem;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  font-size: 1.08rem;
}

.brand svg {
  width: 28px;
  height: 28px;
  display: block;
}

nav.links {
  margin-left: auto;
  display: flex;
  gap: 1.75rem;
}

nav.links a {
  color: var(--ink-2);
  text-decoration: none;
  font-size: 0.95rem;
}

nav.links a:hover {
  color: var(--ink);
}

@media (max-width: 640px) {
  nav.links {
    display: none;
  }
}

/* ── Sections ──────────────────────────────────────────────────────────── */

section {
  padding: clamp(3.5rem, 9vw, 6.5rem) 0;
  border-bottom: 1px solid var(--rule);
}

.hero {
  padding-top: clamp(3rem, 8vw, 5.5rem);
  border-bottom: 1px solid var(--rule);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(2rem, 6vw, 4rem);
  align-items: center;
}

@media (max-width: 860px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
}

.hero h1 {
  margin-bottom: 1.1rem;
}

.hero .lede {
  margin-bottom: 1.9rem;
}

.accent {
  color: var(--warm-deep);
}

/* ── Store buttons ─────────────────────────────────────────────────────── */

.stores {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.store {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 1.15rem;
  border: 1px solid var(--ink);
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  line-height: 1.15;
}

.store:hover {
  background: #000;
}

.store svg {
  width: 22px;
  height: 22px;
  flex: none;
}

.store span {
  display: block;
}

.store .line {
  font-size: 0.68rem;
  opacity: 0.75;
  letter-spacing: 0.02em;
}

.store .name {
  font-size: 0.98rem;
  font-weight: 600;
}

/* Not yet published on that platform: still says which platform, but is
   plainly not a link. */
.store--soon {
  background: transparent;
  color: var(--ink-3);
  border-color: var(--rule);
  cursor: default;
}

.store--soon:hover {
  background: transparent;
}

.note {
  margin-top: 0.9rem;
  font-size: 0.9rem;
  color: var(--ink-3);
}

/* ── Phone ─────────────────────────────────────────────────────────────── */

.phone {
  width: 100%;
  max-width: 300px;
  margin-inline: auto;
  border: 1px solid var(--rule);
  border-radius: 30px;
  padding: 10px;
  background: var(--bg-2);
}

.phone-screen {
  border: 1px solid var(--rule);
  border-radius: 22px;
  background: #fff;
  padding: 1rem;
  display: grid;
  gap: 0.7rem;
}

.card-mini {
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  display: grid;
  gap: 0.3rem;
}

.card-mini .rent {
  font-weight: 700;
  letter-spacing: -0.02em;
}

.card-mini .allin {
  color: var(--warm-deep);
  font-size: 0.82rem;
  font-weight: 600;
}

.card-mini .where {
  font-size: 0.88rem;
  color: var(--ink-2);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.15rem;
}

.chip {
  font-size: 0.72rem;
  color: var(--ink-3);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 0.12rem 0.5rem;
}

/* The Matches / Nearby switch in the hero mockup. Mirrors the app's own pair
   of pills: the active one carries the count, because the count is the whole
   point — rooms already filtered to what you asked for. */
.feed-tabs {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.7rem;
}
.feed-tab {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink-3);
  background: var(--bg-2);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  white-space: nowrap;
}
.feed-tab.is-on {
  color: #fff;
  background: var(--indigo-deep);
}

.tag {
  display: inline-block;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--indigo-deep);
  background: var(--indigo-soft);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
}

/* ── Grids ─────────────────────────────────────────────────────────────── */

.head {
  max-width: var(--measure);
  margin-bottom: clamp(2rem, 5vw, 3rem);
  display: grid;
  gap: 0.85rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}

.grid-3 > * {
  background: var(--bg);
  padding: 1.6rem;
  display: grid;
  gap: 0.5rem;
  align-content: start;
}

/*
 * A last row that does not fill.
 *
 * The hairlines here are the container's own background showing through a 1px
 * gap, which is a lovely trick right up to the moment a row comes up short:
 * seven cards in three columns left two cells that were never drawn, so the
 * background showed through as a solid grey block a third of the section wide.
 *
 * The orphan takes the space instead of leaving a hole. `3n - 2` is a card
 * alone on its row (1st, 4th, 7th…) and `3n - 1` is the second of two, so both
 * shapes are covered and the block stays a rectangle whatever gets added next
 * — which matters more than this one instance, because the alternative fix is
 * to keep the card count divisible by three forever and that is a rule nobody
 * will remember.
 *
 * The full-width one lays its title and body side by side rather than stacking
 * them across a very long measure: at this width a stacked paragraph would run
 * past 140 characters a line, and the point of the card is to be read.
 */
.grid-3 > :last-child:nth-child(3n - 2) {
  grid-column: 1 / -1;
  grid-template-columns: minmax(11rem, 1fr) 2fr;
  gap: 0.5rem 2.5rem;
  align-items: start;
}

.grid-3 > :last-child:nth-child(3n - 1) {
  grid-column: span 2;
}

@media (max-width: 820px) {
  .grid-3 {
    grid-template-columns: 1fr;
  }

  /* One column means no orphan and nothing to span — and the side-by-side
     title the wide layout uses would be a 11rem column inside a phone. */
  .grid-3 > :last-child:nth-child(3n - 2),
  .grid-3 > :last-child:nth-child(3n - 1) {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
}

.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 6vw, 4rem);
}

@media (max-width: 820px) {
  .two {
    grid-template-columns: 1fr;
  }
}

/* Numbered steps, separated by hairlines rather than cards. */
ol.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: step;
}

ol.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 0.9rem;
  padding: 1.1rem 0;
  border-top: 1px solid var(--rule);
}

ol.steps li:last-child {
  border-bottom: 1px solid var(--rule);
}

ol.steps li::before {
  content: counter(step);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--indigo);
}

ol.steps h3 {
  margin-bottom: 0.15rem;
}

dl.faq {
  margin: 0;
  border-top: 1px solid var(--rule);
}

dl.faq div {
  border-bottom: 1px solid var(--rule);
  padding: 1.25rem 0;
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 2rem;
}

@media (max-width: 760px) {
  dl.faq div {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }
}

dl.faq dt {
  font-weight: 600;
}

dl.faq dd {
  margin: 0;
  color: var(--ink-2);
}

/* ── Closing band + footer ─────────────────────────────────────────────── */

.band {
  background: var(--bg-2);
}

footer {
  padding: 2.5rem 0 3.5rem;
  color: var(--ink-3);
  font-size: 0.92rem;
}

footer .row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: center;
}

footer a {
  color: var(--ink-2);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

footer .spacer {
  margin-left: auto;
}

/* The city links, under the legal row rather than beside it: eight of them
   wrapped into the same line would have buried Privacy and Terms among place
   names. Tighter gaps, because this is a list rather than a set of choices. */
footer .cities-row {
  gap: 1.1rem;
  margin-top: 1rem;
  font-size: 0.86rem;
}

footer .spacer-label {
  color: var(--ink-3);
}

@media (max-width: 640px) {
  footer .spacer {
    margin-left: 0;
  }
}

/* ── Legal pages ───────────────────────────────────────────────────────── */

.doc {
  max-width: 42rem;
  padding: clamp(2.5rem, 7vw, 4.5rem) 1.5rem;
  margin: 0 auto;
}

.doc h1 {
  font-size: clamp(2rem, 5vw, 2.6rem);
  margin-bottom: 0.5rem;
}

.doc h2 {
  font-size: 1.2rem;
  margin: 2.2rem 0 0.6rem;
}

.doc p,
.doc li {
  color: var(--ink-2);
}

.doc ul {
  padding-left: 1.1rem;
}

.doc li {
  margin: 0.35rem 0;
}

.doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.95rem;
}

.doc th,
.doc td {
  text-align: left;
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

.doc th {
  color: var(--ink);
  font-weight: 600;
}

.callout {
  border-left: 2px solid var(--warm);
  padding: 0.35rem 0 0.35rem 1rem;
  margin: 1.5rem 0;
  color: var(--ink-2);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* ── USP showcase ──────────────────────────────────────────────────────── */

/*
 * Four rows, each one thing, alternating sides. A grid of equal tiles said
 * all six features were equally important; these four are what people would
 * switch apps for, so they get room, a sentence that argues rather than
 * labels, and a small piece of the interface as evidence.
 */
.usp {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 6vw, 4.5rem);
  align-items: center;
  padding: clamp(2.5rem, 6vw, 4rem) 0;
  border-top: 1px solid var(--rule);
}

.usp:first-of-type {
  border-top: 0;
  padding-top: 0;
}

/* Even rows put the illustration on the left, so the page does not become a
   column of identical slides. */
.usp:nth-of-type(even) .usp-art {
  order: -1;
}

@media (max-width: 820px) {
  .usp {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }

  .usp:nth-of-type(even) .usp-art {
    order: 0;
  }
}

.usp-copy {
  display: grid;
  gap: 0.8rem;
  align-content: start;
  max-width: var(--measure);
}

.usp-copy h3 {
  font-size: clamp(1.35rem, 2.6vw, 1.75rem);
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.usp-copy p {
  color: var(--ink-2);
}

.usp-list {
  list-style: none;
  margin: 0.25rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.usp-list li {
  padding-left: 1.1rem;
  position: relative;
  color: var(--ink-2);
  font-size: 0.97rem;
}

.usp-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--indigo);
}

/* ── Small pieces of interface, drawn in HTML ──────────────────────────── */

.art {
  border: 1px solid var(--rule);
  border-radius: 16px;
  background: var(--bg-2);
  padding: 1.25rem;
  display: grid;
  gap: 0.7rem;
}

.push {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 0.8rem 0.9rem;
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 0.7rem;
  align-items: start;
  box-shadow: 0 1px 2px rgba(16, 16, 25, 0.04);
}

.push .icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--indigo-soft);
  display: grid;
  place-items: center;
}

.push .icon svg {
  width: 18px;
  height: 18px;
}

.push .t {
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.push .b {
  font-size: 0.84rem;
  color: var(--ink-2);
}

.push .when {
  font-size: 0.72rem;
  color: var(--ink-3);
}

.route {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  font-weight: 600;
}

.route .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--indigo);
  flex: none;
}

.route .line {
  flex: 1;
  height: 1px;
  background: repeating-linear-gradient(
    to right,
    var(--rule) 0 6px,
    transparent 6px 10px
  );
}

.bubbles {
  display: grid;
  gap: 0.5rem;
}

.bubble {
  max-width: 82%;
  padding: 0.55rem 0.8rem;
  border-radius: 14px;
  font-size: 0.88rem;
  line-height: 1.45;
}

.bubble.them {
  background: #fff;
  border: 1px solid var(--rule);
  border-bottom-left-radius: 5px;
  justify-self: start;
  color: var(--ink-2);
}

.bubble.me {
  background: var(--indigo);
  color: #fff;
  border-bottom-right-radius: 5px;
  justify-self: end;
}

.person {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
}

.person .av {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  /* Still the soft disc underneath: it is what shows while the photo loads,
     and what remains if it never does. */
  background: var(--indigo-soft);
  object-fit: cover;
  flex: none;
}

.person .nm {
  font-weight: 700;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.person .rl {
  font-size: 0.82rem;
  color: var(--ink-3);
}

.tick {
  width: 15px;
  height: 15px;
  flex: none;
}

.art-note {
  font-size: 0.78rem;
  color: var(--ink-3);
}

/*
 * An .art block holding a screenshot rather than a drawing of one.
 *
 * The padding drops to a hairline's worth: the captured screen has its own
 * chrome — a search bar, rounded zoom buttons — and 1.25rem of card padding
 * around that reads as a frame inside a frame. The image keeps a small radius
 * so its corners follow the card's rather than cutting across them.
 */
.art.shot {
  padding: 0.5rem;
  gap: 0.5rem;
  margin: 0;
}

/* Not stretched to the column. It is a phone screen, and blown up to 466px
   wide it stood taller than the paragraph beside it and read as a poster
   rather than as evidence. Held at its own size and centred. */
.art.shot img {
  display: block;
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
  height: auto;
  border-radius: 11px;
  background: var(--bg-2);
}

.art.shot figcaption {
  padding: 0 0.35rem 0.25rem;
}

/* ── City landing pages ─────────────────────────────────────────────────────
   Eight pages that exist to answer "flats in Bengaluru" and its siblings with
   a page actually about that city, rather than a homepage that mentions it in
   a list. They reuse the site's type and spacing and add only what they need.
*/

.crumbs {
  font-size: 0.85rem;
  color: var(--ink-3);
  margin-bottom: 1.25rem;
}

.crumbs a {
  color: var(--ink-3);
}

/* The locality list is a set of names, not a sentence — laid out as chips so
   somebody scanning for their own area finds it without reading a paragraph. */
ul.chips {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 2rem;
}

ul.chips li {
  font-size: 0.85rem;
  color: var(--ink-2);
  background: var(--surface-2, #f3f3f8);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
}

.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.8rem 1.4rem;
  text-decoration: none;
}

/* ── Where to find each city ────────────────────────────────────────────────
   Linked from the footer, because a page nothing links to is a page a crawler
   reaches only through the sitemap and a reader never reaches at all. */

/* ── Guides ─────────────────────────────────────────────────────────────────
   Long-form pages that answer a question somebody typed, rather than pitching.
   Narrower than the marketing sections because prose has a comfortable measure
   and the homepage's full width is not it. */

.prose {
  padding: 3rem 0 4rem;
}

.prose .wrap {
  max-width: 44rem;
}

.prose h1 {
  font-size: clamp(1.9rem, 5vw, 2.6rem);
  line-height: 1.15;
  margin-bottom: 0.5rem;
}

.prose h2 {
  font-size: 1.3rem;
  margin: 2.5rem 0 0.75rem;
}

.prose p,
.prose li {
  line-height: 1.7;
  color: var(--ink-2);
}

.prose ul {
  padding-left: 1.1rem;
  display: grid;
  gap: 0.6rem;
  margin: 0.75rem 0 1rem;
}

.prose strong {
  color: var(--ink-1);
}

.prose hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 3rem 0 2rem;
}

/* ── Screenshot grid ────────────────────────────────────────────────────────
   Six features shown rather than described. The images are real captures from
   the running app, so they have the app's own rounded corners and background
   already — the card here adds only a border and the caption. */

.shots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}

.shots figure {
  margin: 0;
  background: var(--card, #fff);
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* The captured screens vary in height — a filter row is short, a feed card is
   tall. A fixed frame with the image centred inside keeps the grid even
   without stretching any of them out of proportion. */
.shots figure img {
  display: block;
  width: 100%;
  height: auto;
  background: var(--bg-2, #f4f4f8);
}

.shots figcaption {
  padding: 1.1rem 1.25rem 1.35rem;
  border-top: 1px solid var(--line);
}

.shots figcaption h3 {
  font-size: 1.05rem;
  margin: 0 0 0.35rem;
}

.shots figcaption p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--ink-3);
}
