/* DESIGN CHANGE? Also update the static error pages: deploy/nginx/outage/ (outage.css colours,
 * logo.svg, texts) — nginx serves them when the apps are down (docs/changes/2026-11-11-outage-page.md). */
:root {
  color-scheme: light;
  /* Day greys are neutral, no blue cast (owner 2026-11-30, ADR 0090; were slate-blue #10283f/#52637a/#e2e8f0…). Blue
   * stays where it means something: --sea (links, buttons, categories, selection). Night mode is unchanged. */
  --ink: #1c1c1b;
  --muted: #62615d;
  --sea: #1263b0;
  --pale: #f0efec;
  --line: #deddda;
  /* Surfaces (night mode swaps these; ADR 0031). */
  --bg: #fff;          /* page */
  --bg-soft: #fff;     /* cabinet / homepage background: white by day (ADR 0091, variant 2; was #f5f5f3, #e6ebf1, #eef2f7) */
  --surface: #fff;     /* cards, menus, inputs */
  --surface-2: #f3f3f1;/* hover, subtle fills */
  --field-line: #8f8e8a;
  --shadow: 28 28 27;  /* rgb triplet for shadows */
  --error: #a52a36;
  --error-ink: #7d1d28;   /* error text on --error-bg (contrast ≥ 7:1) */
  --error-bg: #fdf1f2;
  --error-line: #efc3c9;
}

* { box-sizing: border-box; }

body {
  margin: 0 auto;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 system-ui, sans-serif;
}

.i18n-pending body { visibility: hidden; }

.wrap {
  max-width: 1220px;
  padding: 0 28px;
}

.top {
  /* 62px (padding-top 14px) on phones. The top keeps room for the rolling logo's head (it rose above a 72/64 bar,
   * owner 2026-11-24 and 2026-12-01); the bottom ends 12 px under the standing figure's legs (owner 2026-12-01:
   * "cut only at the bottom"). The padding keeps the content where an 84/76 bar centred it. */
  min-height: 68px;
  padding-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: inherit;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -.5px;
  text-decoration: none;
}

/* Logo (ADR 0061): wordmark "BoatMates" + the BoatMate character that rolls in (app.js rollMate).
 * The pink body ring is the wheel: 0.92 of the letter height; the box is the character's full size.
 * The pivot is the body centre (49.39% 56.55% of the box); the box is lifted so that the body, not the
 * whole figure, is centred on the letters. The light outline keeps the navy head visible at night. */
.wordmark { gap: 1px; white-space: nowrap; }
.wordmark-mate {
  display: block;
  width: 1.372em; /* 12% larger than ADR 0061 (owner 2026-11-27: "make him a bit larger") */
  height: 1.8387em;
  flex: none;
  position: relative;
  top: -.1204em;
  margin-left: .02em;
  overflow: visible;
  transform-box: border-box;
  transform-origin: 49.39% 56.55%;
  will-change: transform;
}
.wordmark-mate-head { stroke: #fff; stroke-width: 40; paint-order: stroke; }
/* --roll-delay < 0 continues a roll that started on the previous page (logo click, app.js). */
.wordmark-mate.is-rolling { animation: boatmates-mate-roll 2.7s cubic-bezier(.45, 0, .55, 1) var(--roll-delay, 0s) both; }
@keyframes boatmates-mate-roll {
  0%, 6% { transform: translate(var(--roll-start-x), var(--roll-top-y)) rotate(0deg) scale(.92); }
  73% { transform: translate(var(--roll-end-x), var(--roll-top-y)) rotate(var(--roll-angle)) scale(1); }
  82% { transform: translate(var(--drop-mid-x), var(--drop-mid-y)) rotate(var(--roll-angle-mid)) scale(1.04); }
  90% { transform: translate(var(--drop-near-x), var(--drop-near-y)) rotate(var(--roll-angle-end)) scale(.97); }
  96% { transform: translate(0, var(--drop-bounce-y)) rotate(var(--roll-angle-end)) scale(1.02); }
  100% { transform: translate(0, 0) rotate(var(--roll-angle-end)) scale(1); }
}
@media (prefers-reduced-motion: reduce) { .wordmark-mate.is-rolling { animation: none; } }

.lang {
  display: flex;
  gap: 4px;
}

.lang__btn {
  min-width: 42px;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font: 700 .875rem/1 system-ui, sans-serif;
  cursor: pointer;
}

.lang__btn:hover { background: var(--pale); }

.lang__btn[aria-pressed="true"] {
  background: var(--sea);
  color: #fff;
}

:where(a, button):focus-visible {
  outline: 2px solid var(--sea);
  outline-offset: 3px;
}

.lang-menu { position: relative; }
.lang-menu__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 58px;
  height: 44px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font: 700 .875rem/1 system-ui, sans-serif;
  cursor: pointer;
}
.lang-menu__toggle:hover { background-color: var(--pale); }
.lang-menu__caret {
  width: 0;
  height: 0;
  border-inline: 4px solid transparent;
  border-top: 5px solid currentColor;
}
.lang-menu__toggle[aria-expanded="true"] .lang-menu__caret { transform: rotate(180deg); }
.lang-menu__list {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
  flex-direction: column;
  min-width: 100%;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 9px 26px rgba(23, 52, 58, .12);
}
.lang-menu__list[hidden] { display: none; }

.hero {
  padding: 72px 0 52px;
  text-align: center;
}

h1 {
  max-width: 940px;
  margin: 14px auto 18px;
  font-size: clamp(36px, 6vw, 70px);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -.045em;
  text-wrap: balance;
}

.lead {
  max-width: 780px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 19px;
}

.audience-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  max-width: 1060px;
  margin: 0 auto;
  padding-bottom: 72px;
}

.audience-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 18px 48px rgb(var(--shadow) / 9%);
}

.audience-image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1.9;
  object-fit: cover;
  object-position: center bottom;
  background: var(--pale);
  border-bottom: 1px solid var(--line);
}

.audience-body { padding: 28px 30px 30px; }

.audience-body h2 {
  margin: 0 0 10px;
  font-size: 27px;
  font-weight: 750;
  line-height: 1.2;
  letter-spacing: -.025em;
}

.audience-body p {
  margin: 0;
  color: var(--muted);
}

.foot {
  padding: 22px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

@media (max-width: 760px) {
  .wrap { padding: 0 20px; }
  .hero { padding: 54px 0 34px; }
  .lead { font-size: 17px; }
  .audience-grid {
    grid-template-columns: 1fr;
    max-width: 560px;
  }
}

@media (max-width: 540px) {
  .wrap { padding: 0 14px; }
  .top { min-height: 62px; padding-top: 14px; }
  .wordmark { font-size: 18px; }
  .hero { padding: 42px 0 36px; }
  .lead { font-size: 16px; }
  .audience-grid {
    gap: 16px;
    padding-bottom: 48px;
  }
  .audience-card { border-radius: 19px; }
  .audience-body { padding: 22px 20px 23px; }
  .audience-body h2 { font-size: 23px; }
}

/* Shared header (web/src/partials/header.html, header.js): account slot on every user page. */
.site-account { position: relative; display: flex; align-items: center; gap: 6px; flex: none; }
.site-account[hidden] { display: none; }
.site-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 6px 13px;
  border-radius: 10px;
  background: var(--sea);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.site-login:hover { filter: brightness(.9); }
.site-profile { position: relative; }
/* Members: the name of the active role opens the account menu (2026-11-13, ADR 0058). Same type as the
 * language switch; BoatOwner red ("Pin to top" red), BoatMate green; lighter tones at night. */
.site-role {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  height: 44px;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font: 600 15px/1 system-ui, sans-serif;
  letter-spacing: .01em;
  white-space: nowrap;
  cursor: pointer;
}
.site-role-owner { color: var(--brand-text); }
.site-role-mate { color: #0b7a53; }
.site-role:hover, .site-role[aria-expanded="true"] { background-color: var(--pale); }
.site-role-pending { visibility: hidden; cursor: default; } /* holds the role name's place until the profile is known */
.site-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 7px);
  right: 0;
  min-width: 190px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 12px 35px rgb(var(--shadow) / 15%);
}
.site-menu[hidden] { display: none; }
.site-menu :is(a, button) {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.site-menu :is(a, button):is(:hover, :focus-visible) { background: var(--pale); }

.with-discovery { background: var(--bg-soft); }
/* Hero (ADR 0068): a fixed-height box, so a slide change never moves the page. Empty (before Directus answers) it is
 * the plain light panel; hero.js fills it with the carousel, or hides it when no slide is published. */
.home .hero {
  position: relative;
  overflow: hidden;
  height: clamp(400px, 100vw, 440px);
  margin: 14px 0 0; /* the subtitle (.home-lead) brings the space below */
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: radial-gradient(ellipse at top right, var(--hero-glow, #dceeea), transparent 65%), var(--hero-bg, #fffefa);
}
.home .hero[hidden] { display: none; }
.home .hero--slides { background: #0f2236; isolation: isolate; }

/* Footer legal links + privacy / terms pages (one article per language, ADR 0027). */
.foot { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.foot-links a { color: inherit; }
html[data-lang="en"] [data-legal-lang]:not([data-legal-lang="en"]),
html[data-lang="ru"] [data-legal-lang]:not([data-legal-lang="ru"]),
html[data-lang="cnr"] [data-legal-lang]:not([data-legal-lang="cnr"]) { display: none; }
.legal-shell { max-width: 780px; margin: 0 auto; padding: 28px 0 56px; }
.legal h1 { font-size: clamp(28px, 5vw, 40px); margin: 0 0 12px; }
.legal h2 { font-size: 20px; margin: 28px 0 8px; }
.legal p { line-height: 1.65; overflow-wrap: anywhere; }
.legal-draft { padding: 10px 14px; border-radius: 10px; background: #fff8e1; border: 1px solid #e0a800; }
.legal-updated { color: var(--muted, #52637a); font-size: 14px; }

/* CMS logo (header.js): shown only after it has loaded, so the local animated logo stays until
 * then; the box keeps the header height, the image keeps its own proportions. */
.site-header .wordmark { min-height: 40px; }
.cms-wordmark { display: none; width: auto; height: auto; max-width: 150px; max-height: 40px; object-fit: contain; }
.with-cms-logo .cms-wordmark { display: block; }
.with-cms-logo :is(.wordmark-name, .wordmark-mate) { display: none; }
@media (max-width: 420px) { .cms-wordmark { max-width: 112px; max-height: 36px; } }

/* Night mode switch in the header (ADR 0031). Icon is CSS-only; the button carries a
 * translated aria-label/title and aria-pressed (true = night mode). */
.theme-toggle {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font: 700 1.05rem/1 system-ui, sans-serif;
  cursor: pointer;
}
.theme-toggle:hover { background: var(--pale); }
.theme-toggle::before { content: "\263E"; }               /* ☾ — switch to night */
.theme-toggle[aria-pressed="true"]::before { content: "\2600"; } /* ☀ — switch to day */
.top-tools { display: flex; align-items: center; gap: 6px; }
.site-header { flex-wrap: nowrap; background-color: inherit; }
.site-header .wordmark { flex: none; }
.site-header .top-tools { flex: none; margin-inline-start: auto; }

@media (max-width: 420px) {
  .site-header .top-tools { gap: 4px; }
  .lang-menu__toggle { min-width: 52px; padding-inline: 8px; }
  .theme-toggle { min-width: 40px; width: 40px; }
  .site-login { padding-inline: 10px; font-size: 14px; }
}

/* Night palette. app.js sets data-scheme on <html> before first paint from the saved
 * choice (bm.theme / bm_theme) or the OS setting. */
:root[data-scheme="dark"] {
  color-scheme: dark;
  --ink: #e4ecf5;
  --muted: #9fb1c5;
  --sea: #2874cc;
  --pale: #1a2c40;
  --line: #273a4f;
  --bg: #0c1520;
  --bg-soft: #0e1824;
  --surface: #142131;
  --surface-2: #1b2b3e;
  --field-line: #50657e;
  --shadow: 0 0 0;
  --error: #ff8f9a;
  --error-ink: #ffd2d7;
  --error-bg: #34161c;
  --error-line: #6b2a35;
  --hero-glow: #123038;
  --hero-bg: #111d2b;
  --link: #8cc2f5;
}
:root[data-scheme="dark"] .legal-draft { background: #2e2610; border-color: #8a6d12; }
:root[data-scheme="dark"] .legal a, :root[data-scheme="dark"] .foot-links a { color: var(--link); }
:root[data-scheme="dark"] .audience-image { filter: brightness(.9); }

/* Consent is non-modal; reject and accept have equal prominence. */
.analytics-consent {
  position: fixed; z-index: 1000; inset: auto 1rem 3.5rem;
  max-width: 42rem; margin-inline: auto; padding: 1rem;
  border: 1px solid var(--line); border-radius: .75rem;
  background: var(--surface); color: var(--ink); box-shadow: 0 4px 24px #0003;
}
.analytics-consent[hidden] { display: none; }
.analytics-consent p { margin: 0 0 .75rem; }
.analytics-actions { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.analytics-actions button, .analytics-settings {
  font: inherit; padding: .5rem .75rem; border: 1px solid var(--line);
  border-radius: .5rem; color: var(--ink); background: var(--surface); cursor: pointer;
}
.analytics-settings { position: fixed; bottom: .5rem; right: 1rem; z-index: 999; font-size: .8rem; }
.analytics-actions a { color: var(--link); }

/* ---- Shared layout: header and footer of EVERY user page ---------------------------------------
 * The landing page is the source of truth (docs/SHARED_LAYOUT.md, ADR 0055). Header and footer markup come
 * from web/src/partials/ (inserted at build time) and are styled ONLY here, never scoped to one page
 * (.home / .market-page / .legal-page) and never in marketplace.css or cabinet.css — the web image build
 * fails otherwise. Change something here and it changes on the landing, the cabinet and the legal pages. */
/* Header: a full-width bar in the page colour; its 1px bottom line runs edge to edge. Shadows (not a
 * wider box) paint the bar beyond the content width, so nothing scrolls sideways, the dropdowns are not
 * clipped and the header box keeps the same geometry as on every other page. */
/* Brand colour (spec "Lifecycle and cabinets" 4.4, decision R-1, ADR 0060): one hue (351°) in three roles.
 * --brand: graphics, frames, large elements (≥ 3:1). --brand-text: brand text smaller than 24 px (18.66 px
 * bold) and the background of brand plates with text (≥ 4.5:1). --brand-on: the text on such a plate.
 * --brand-pale: the tinted surface behind brand text. White text on #ff3150 / #ff8a9b is never used.
 * The logo ring, the homepage "Post a job" button and the outage page keep #ff3150 in both schemes. */
:root { --brand: #ff3150; --brand-text: #db0021; --brand-on: #fff; --brand-pale: #fdf1f2; }
:root[data-scheme="dark"] { --brand: #ff8a9b; --brand-text: #ff8a9b; --brand-on: #0c1520; --brand-pale: #34161c; }
/* Role name in the header (ADR 0058): lighter tones at night, readable on the dark header. */
:root[data-scheme="dark"] .site-role-mate { color: #5fd3a2; }
/* Header and footer are dark in BOTH schemes (owner 2026-11-17, ADR 0063): the night palette is set on the bars
 * themselves, so everything inside them (language list, account menu, role names, focus rings, logo choice) follows
 * without per-element rules. The page below keeps its own day or night palette. The bar colour is the cabinet
 * navy #0f2236 — one dark for header, footer and the phone tab bar (owner 2026-11-18, ADR 0066).
 * .site-menu--dark: a menu outside the header that must look exactly like the account menu (the cabinet pager's page
 * size, owner 2026-12-04) takes the same palette here, so the two can never drift apart. */
.site-header, .foot, .site-menu--dark {
  color-scheme: dark;
  --ink: #e4ecf5; --muted: #9fb1c5; --sea: #2874cc; --pale: #1a2c40; --line: #22384f;
  --bg: #0f2236; --surface: #142131; --surface-2: #1b2b3e; --link: #8cc2f5; --shadow: 0 0 0;
  --brand: #ff8a9b; --brand-text: #ff8a9b; --brand-on: #0c1520; --brand-pale: #34161c;
}
.site-header .site-role-mate { color: #5fd3a2; }
.foot-links a { color: var(--link); }
.site-header {
  background: var(--bg);
  box-shadow: 0 calc(-100vmax - 1px) 0 100vmax var(--bg), 0 -100vmax 0 100vmax var(--line);
  color: var(--ink); /* not the page's text colour (the cabinet uses its own) */
}
/* Footer: the landing's look on every page — its own bar in the page colour of the landing, edge to edge
 * (the cabinet and legal pages have a different page background). The clip keeps the bar to its own height. */
.foot {
  background: var(--bg);
  /* The top line runs edge to edge like the bar (owner 2026-11-30: it broke off at the container): the line shadow
   * starts at the bar's top edge, the bar-colour shadow 1 px lower covers the rest; the border draws it inside. */
  box-shadow: 0 calc(100vmax + 1px) 0 100vmax var(--bg), 0 100vmax 0 100vmax var(--line);
  clip-path: inset(0 -100vmax);
  color: var(--muted);
}
.site-header .top-tools { gap: 2px; }
.site-header .lang-menu__toggle,
.site-header .site-login {
  min-width: 0;
  min-height: 44px;
  height: 44px;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font: 600 15px/1 system-ui, sans-serif;
  letter-spacing: .01em;
}
.site-header .lang-menu__toggle { gap: 6px; }
.site-header .site-login { filter: none; }
.site-header :is(.lang-menu__toggle, .site-login, .theme-toggle):hover { background-color: var(--pale); filter: none; }
.site-header .theme-toggle {
  display: grid;
  place-items: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 8px;
}
/* Line icons (moon in day mode, sun in night mode); the button keeps its translated label. */
.site-header .theme-toggle::before {
  content: "";
  width: 20px;
  height: 20px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 14.5A8 8 0 0 1 9.5 4a8 8 0 1 0 10.5 10.5z'/%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 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 14.5A8 8 0 0 1 9.5 4a8 8 0 1 0 10.5 10.5z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.site-header .theme-toggle[aria-pressed="true"]::before {
  content: "";
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4'/%3E%3C/svg%3E");
}
@media (min-width: 761px) { .site-header .top-tools { gap: 8px; } }
/* The only page-specific header rule (behaviour, not look): in the cabinet the header stays on top while
 * the workspace scrolls, so its rail and tab bars can stick right under it (--site-header-h, marketplace.js). */
.market-page .site-header { position: sticky; top: 0; z-index: 5; } /* shared-layout: allowed */
@media (max-width: 360px) {
  /* The longest header (ME, "Prijavi se") still fits one row at 320 px. */
  .site-header .top-tools { gap: 0; }
  .site-header .site-login { padding: 0 6px; }
  /* A member's role name (BoatOwner) is wider than the old avatar: the language switch and the role name
   * get a little tighter (same type for both) so the header still fits one row. */
  .site-header :is(.lang-menu__toggle, .site-role) { padding: 0 4px; font-size: 14px; }
  .site-header .theme-toggle { width: 40px; min-width: 40px; }
}

/* ---- Homepage, final design (Claude Design canvas, 2026-11-12) -------------------------------
 * Source of truth: the four artboards (Mobile 390 / Desktop 1440, light and dark) — see
 * docs/changes/2026-11-12-final-homepage-design.md. Homepage content is scoped to body.home; the header it
 * introduced is shared by all pages (section above). */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap;
}


/* Subtitle under the hero: one line on desktop (33px at 1440), wraps on phones (18px). */
.home .home-lead {
  max-width: none;
  margin: clamp(20px, 2.1vw, 30px) auto clamp(24px, 2.8vw, 40px);
  color: var(--ink);
  font-size: clamp(18px, 2.3vw, 33px);
  font-weight: 500;
  line-height: 1.24;
  letter-spacing: -.01em;
  text-align: center;
  text-wrap: balance;
}

/* ---- Homepage MVP (owner 2026-11-17, ADR 0064; Claude Design canvas "Главная MVP" artboards) ----
 * Hero photo pinned to the top (heads stay in the frame), 300 px high on phones; a tiles row in one card; the
 * requests feed with request cards and two promo blocks (3 cards → BoatOwner → 3 cards → BoatMate → Show more).
 * The promo blocks are photo-backed and look the same by day and night; their buttons use the night pink/mint
 * with dark text in both schemes (homepage only, trial). */

.home-tiles:not([hidden]) {
  display: block;
  max-width: 1060px;
  margin: 0 auto clamp(14px, 2.4vw, 34px);
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 9px 26px rgb(var(--shadow) / 6%);
}
:root[data-scheme="dark"] .home-tiles { box-shadow: 0 9px 26px rgb(0 0 0 / 35%); }
.home-tiles__list {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(84px, 1fr);
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}
.home-tiles__list::-webkit-scrollbar { display: none; }
.home-tiles__list > li { min-width: 0; scroll-snap-align: start; }
.home-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  height: 100%;
  padding: 4px 2px 6px;
  border-radius: 14px;
  color: var(--ink);
  text-align: center;
  text-decoration: none;
}
a.home-tile:hover { background: var(--pale); }
.home-tile__box {
  display: grid;
  place-items: center;
  flex: none;
  width: 64px;
  height: 64px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--pale);
  color: var(--link, var(--sea));
}
.home-tile--publish .home-tile__box { border: 2px solid #ff8a9b; background: var(--brand-pale); color: var(--brand-text); }
.home-tile--become_mate .home-tile__box { border: 2px solid #5fd3a2; background: #ebf7f1; color: #0b7a53; }
:root[data-scheme="dark"] .home-tile--become_mate .home-tile__box { background: #0f2e25; color: #5fd3a2; }
.home-tile--how_it_works .home-tile__box { border-color: #22384f; background: #0f2236; } /* header navy (ADR 0066) */
.home-tile__image { width: 100%; height: 100%; object-fit: cover; }
.home-tile__icon { width: 26px; height: 26px; }
.home-tile__mate { width: 38px; height: 51px; overflow: visible; }
.home-tile__label { font-size: 12px; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }

/* Request cards on the homepage: category, bold title with the budget on the right, "area · N ago". The cabinet lists
 * use the same card (one look; canvas "Кабинеты: синяя гамма", 2026-11-23), so the base rule is not scoped to the feed
 * (two classes: it must beat marketplace.css ".market-card", which loads later). */
.market-card.home-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 14px 16px;
  color: var(--ink);
  text-decoration: none;
}
.market-card.home-card:hover { border-color: var(--sea); }
/* Top (owner 2026-11-30, ADR 0089/0090, canvas "BoatMates: главная"): the main category in the top-left corner (blue),
 * the subcategories on the next line in ink, a little smaller — on every card (homepage, phones, cabinets). */
.home-card__category { min-width: 0; color: var(--sea); font-size: 16px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
:root[data-scheme="dark"] .home-card__category { color: var(--link); }
:root[data-scheme="dark"] .home-card__desc { color: #c9d6e4; }
.home-card__row { display: flex; flex: 1; flex-direction: column; align-items: flex-start; gap: 2px; }
.home-card__subs { min-width: 0; color: var(--ink); font-size: 14px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.home-card__budget { flex: none; font-size: 17px; font-weight: 800; line-height: 1.25; }
/* Three levels (ADR 0084, owner's variant "В"): bold title, a muted two-line description, then a small line with the
 * category in colour and the place and age behind line icons. */
.market-card.home-card { gap: 0; }
/* Description darker than the place/time line (owner 2026-11-30, ADR 0091): #3d3c39 by day, #c9d6e4 at night. */
.home-card__desc { margin-top: 6px; color: #3d3c39; font-size: 14px; line-height: 1.4; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.home-card__meta { display: flex; flex-wrap: wrap; align-items: center; column-gap: 12px; row-gap: 2px; margin-top: 12px;
  color: var(--muted); font-size: 12px; }
.home-card__where, .home-card__when { display: inline-flex; align-items: center; gap: 3px; }
.home-card__meta svg { flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
/* Price in the top-right corner, "Waiting for offers" without a sum (owner's canvas, ADR 0083). */
.market-card.home-card { position: relative; overflow: hidden; }
.home-card > :not(.home-card__beam) { position: relative; }
.home-card__price { position: absolute !important; top: 12px; right: 16px; font-size: 17px; font-weight: 800; line-height: 1.25; }
.home-card__price.is-wait { max-width: 96px; color: var(--muted); font-size: 12px; font-weight: 700; text-align: right; }
.home-card.has-price .home-card__row { padding-right: 84px; }
.home-card.has-wait .home-card__row { padding-right: 104px; }
/* Pinned: no badge — the frame and the lighthouse beam (ADR 0084). Day: the soft brand pink #FF8A9B (the "Post a task"
 * tile's frame) with a pink beam; night: the lamp yellow #FFD457 with a yellow beam. The beam (a large circle of light)
 * crosses a card in 1.5 s on a 10 s clock; marketplace.js relayBeams() hands it from card to card along a row. */
.market-card.home-card.market-pinned { padding: 13px 15px; border: 2px solid #ff8a9b; background: var(--surface, #fff); container-type: inline-size; }
:root[data-scheme="dark"] .market-card.home-card.market-pinned { border-color: #ffd457; }
.home-card__beam { position: absolute; top: 50%; left: -760px; width: 760px; height: 760px; margin-top: -380px;
  border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgb(255 138 155 / 28%) 0%, rgb(255 138 155 / 18%) 42%, rgb(255 138 155 / 8%) 60%, rgb(255 138 155 / 0%) 68%);
  animation: bm-lamp-beam 10s linear infinite both; will-change: transform; }
:root[data-scheme="dark"] .home-card__beam {
  background: radial-gradient(circle, rgb(255 236 160 / 34%) 0%, rgb(255 226 120 / 24%) 42%, rgb(255 220 100 / 12%) 60%, rgb(255 220 100 / 0%) 68%); }
/* The beam moves with transform (compositor only): animating `left` re-laid out the page on every frame for every pinned
 * card, which drained phones (performance task 2026-11-26). The card is the size container: 100cqw = its width. */
@keyframes bm-lamp-beam { 0% { transform: translateX(0); } 15%, 100% { transform: translateX(calc(100cqw + 760px)); } }
@media (prefers-reduced-motion: reduce) { .home-card__beam { display: none; } }

.home-promo {
  grid-column: 1 / -1;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin: 4px 0;
  border: 1px solid #ff8a9b;
  border-radius: 20px;
  background: #0f2236; /* under the photo while it loads: header navy (ADR 0066) */
  color: #fff;
}
.home-promo--mate { border-color: #5fd3a2; }
.home-promo__image { position: absolute; z-index: -2; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.home-promo::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(180deg, rgb(12 21 32 / .5) 0%, rgb(12 21 32 / .7) 45%, rgb(12 21 32 / .88) 100%);
}
.home-promo__body { display: flex; flex-direction: column; gap: 10px; padding: 20px 18px 18px; }
.home-promo__kicker { color: #ff8a9b; font-size: 13px; font-weight: 700; }
.home-promo--mate .home-promo__kicker { color: #5fd3a2; }
.home-promo__title { margin: 0; font-size: 22px; font-weight: 800; line-height: 1.2; text-shadow: 0 1px 3px rgb(6 14 24 / .5); }
.home-promo__text { margin: 0; color: #dbe5ef; font-size: 15px; }
.home-promo__button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 12px;
  background: #ff8a9b;
  color: #0c1520;
  font-weight: 800;
  text-decoration: none;
}
.home-promo--mate .home-promo__button { background: #5fd3a2; }
.home-promo__button:hover { filter: brightness(1.06); }
.home-promo__button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* ---- Hero carousel (ADR 0068, hero.js) -------------------------------------------------------------------------
 * Manual: swipe (scroll snapping) and edge arrows, no automatic rotation. Text and button sit in a 3×3 position
 * grid (three row bands; left / centre / right column inside a band). White text with a shadow over a soft bottom
 * shade; the slide background is the header navy while a picture loads or when it fails. */
.hero-track { display: flex; height: 100%; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none; }
.hero-track::-webkit-scrollbar { display: none; }
.hero-track:focus-visible { outline: 3px solid #fff; outline-offset: -6px; }
.hero-slide { position: relative; flex: 0 0 100%; height: 100%; overflow: hidden; scroll-snap-align: start; scroll-snap-stop: always; background: #0f2236; color: #fff; }
.hero-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.hero-focus-center { object-position: center; }
.hero-focus-bottom { object-position: center bottom; }
.hero-focus-left { object-position: left center; }
.hero-focus-right { object-position: right center; }
.hero-shade { position: absolute; inset: auto 0 0; height: 55%; pointer-events: none;
  background: linear-gradient(to bottom, rgb(12 30 52 / 0) 0%, rgb(12 30 52 / .32) 50%, rgb(12 30 52 / .68) 100%); }
.hero-layout { position: absolute; inset: 0; display: grid; grid-template-rows: repeat(3, minmax(0, 1fr)); padding: clamp(16px, 2.6vw, 34px) 68px; pointer-events: none; }
.hero-band { display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr) minmax(0, auto); column-gap: 20px; min-width: 0; }
.hero-band--1 { grid-row: 1; align-items: start; }
.hero-band--2 { grid-row: 2; align-items: center; }
.hero-band--3 { grid-row: 3; align-items: end; }
.hero-cell { display: flex; flex-direction: column; gap: 14px; min-width: 0; pointer-events: auto; }
.hero-c1 { grid-column: 1; align-items: flex-start; }
.hero-c2 { grid-column: 2; align-items: center; }
.hero-c3 { grid-column: 3; align-items: flex-end; }
.hero-text { max-width: 100%; color: #fff; text-shadow: 0 1px 3px rgb(6 14 24 / .55), 0 0 18px rgb(6 14 24 / .35); overflow-wrap: anywhere; }
.hero-align-left { text-align: left; }
.hero-align-center { text-align: center; }
.hero-align-right { text-align: right; }
.hero-slogan { margin: 0; font-size: clamp(36px, 4.6vw, 60px); font-weight: 800; line-height: 1.04; letter-spacing: -.045em; text-wrap: balance; }
.hero-description { margin: 10px 0 0; font-size: clamp(16px, 1.7vw, 22px); font-weight: 500; line-height: 1.35; text-wrap: pretty; }
.hero-slogan + .hero-description { margin-top: 10px; }
.hero-button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 24px; border-radius: 12px;
  background: #ff8a9b; color: #0c1520; font-weight: 800; text-decoration: none; }
.hero-button:hover { filter: brightness(1.06); }
.hero-button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.hero-arrow { position: absolute; z-index: 2; top: 50%; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0;
  border-radius: 50%; color: #fff; background: transparent; cursor: pointer; transform: translateY(-50%); filter: drop-shadow(0 1px 2px rgb(6 14 24 / 70%)); }
.hero-arrow svg { width: 24px; height: 24px; }
.hero-arrow--prev { left: 12px; }
.hero-arrow--next { right: 12px; }
.hero-arrow:focus-visible { outline: 2px solid #fff; outline-offset: -4px; }
@media (max-width: 760px) {
  /* Phones swipe; the arrows are not needed there and the text may use the full width. */
  .hero-arrow { display: none; }
  .hero-layout { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) { .hero-track { scroll-behavior: auto; } }

@media (min-width: 761px) {
  .home-tiles:not([hidden]) { padding: 14px 12px; border-radius: 22px; }
  .home-tile { gap: 10px; padding: 8px 4px; }
  .home-tile__box { width: 84px; height: 84px; border-radius: 22px; }
  .home-tile__icon { width: 30px; height: 30px; }
  .home-tile__mate { width: 46px; height: 62px; }
  .home-tile__label { font-size: 15px; }
  .recent-requests .home-card { min-height: 132px; padding: 18px 20px; }
  .recent-requests .home-card.market-pinned { padding: 17px 19px; }
  .home-card__category { font-size: 17px; }
  .home-card__budget { font-size: 18px; }
  .home-card__meta { font-size: 13px; }
  .home-promo { margin: 8px 0; border-radius: 22px; }
  .home-promo::before { background: linear-gradient(90deg, rgb(12 21 32 / .92) 0%, rgb(12 21 32 / .78) 45%, rgb(12 21 32 / .2) 100%); }
  .home-promo--mate::before { background: linear-gradient(270deg, rgb(12 21 32 / .92) 0%, rgb(12 21 32 / .78) 45%, rgb(12 21 32 / .2) 100%); }
  .home-promo__body { align-items: flex-start; gap: 12px; max-width: 560px; padding: 36px 40px; }
  .home-promo--mate .home-promo__body { margin-left: auto; }
  .home-promo__title { font-size: 34px; line-height: 1.15; }
  .home-promo__text { font-size: 17px; }
  .home-promo__button { margin-top: 6px; padding: 0 28px; }
}

/* Recent requests, closer to the cards. "Show more" opens the full requests board. */
.home .recent-requests { padding-bottom: clamp(48px, 4.4vw, 64px); }
.home .recent-requests h2 {
  margin: 0 0 clamp(12px, 1.25vw, 18px);
  text-align: center;
  font-size: clamp(18px, 1.8vw, 24px);
  font-weight: 750;
  letter-spacing: -.02em;
}
.home .recent-requests .market-stack { margin-top: 0; gap: 16px; }
.home-more-row { display: flex; justify-content: center; margin-top: clamp(20px, 1.9vw, 28px); }
.home-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 220px;
  min-height: 48px;
  padding: 10px 22px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--pale);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}
.home-more:hover { filter: brightness(.97); }

@media (max-width: 760px) {
  .home .recent-requests .market-stack { gap: 12px; }
}
@media (max-width: 540px) {
  .home .hero { height: 300px; } /* owner 2026-11-17: the first screen shows the tiles and the feed start */
  .home .home-lead { max-width: 320px; line-height: 1.45; letter-spacing: 0; }
  .home-more { width: 100%; }
}
