/* Locly web v2 — "neighbourhood noticeboard".
   Design tokens mirror the Flutter app
   (locly/lib/core/constants/app_colors.dart, app_spacing.dart). */

:root {
  --primary: #2badee;
  --primary-dark: #1a8fcc;
  --bg: #f6f7f8;
  --surface: #ffffff;
  --pastel-blue: #e8f5fe;
  --text: #0d171b;
  --text-secondary: #4f626d;
  --text-hint: #9eb3bf;
  --divider: #e8edf0;

  --cat-language: #3b82f6;
  --cat-wellness: #f97316;
  --cat-art: #8b5cf6;
  --cat-food: #ec4899;
  --cat-outdoors: #22c55e;
  --cat-social: #14b8a6;

  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --radius-full: 999px;
  --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.04);
  --shadow-float: 0 16px 40px rgba(13, 23, 27, 0.08);
  --shadow-paper: 0 1px 2px rgba(13, 23, 27, 0.06), 0 14px 30px rgba(13, 23, 27, 0.1);

  --font-hand: "Caveat", "Segoe Print", cursive;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --container: 1120px;
  --gutter: 20px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--primary-dark);
}

h1,
h2,
h3 {
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
}

h2 {
  font-size: clamp(1.9rem, 4.2vw, 3rem);
  font-weight: 800;
}

h3 {
  font-size: 1.2rem;
  font-weight: 700;
}

p {
  margin: 0 0 16px;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.muted {
  color: var(--text-secondary);
}

/* Dotted "map paper" background used by the board sections */
.board {
  background-color: var(--bg);
  background-image: radial-gradient(color-mix(in srgb, var(--text-hint) 45%, transparent) 1px, transparent 1.4px);
  background-size: 22px 22px;
}

/* Strip of semi-transparent tape on flyers and polaroids */
.tape {
  position: absolute;
  top: -12px;
  left: 50%;
  z-index: 2;
  width: 96px;
  height: 26px;
  transform: translateX(-50%) rotate(-3deg);
  background: color-mix(in srgb, var(--pastel-blue) 75%, transparent);
  border-left: 2px dotted color-mix(in srgb, var(--primary) 25%, transparent);
  border-right: 2px dotted color-mix(in srgb, var(--primary) 25%, transparent);
  box-shadow: 0 1px 2px rgba(13, 23, 27, 0.06);
}

.kicker {
  display: inline-block;
  margin-bottom: 14px;
  font-family: var(--font-hand);
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
  color: var(--primary);
  transform: rotate(-2deg);
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 12px var(--gutter) 0;
  pointer-events: none;
}

.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: calc(var(--container) - 2 * var(--gutter));
  height: 60px;
  margin: 0 auto;
  padding: 0 8px 0 16px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  box-shadow: var(--shadow-float);
  pointer-events: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  width: 32px;
  height: 32px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 26px;
}

.nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}

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

/* The bar's tight right padding suits a pill button; give a text link more room */
.nav a:last-child:not(.btn) {
  margin-right: 16px;
}

@media (max-width: 760px) {
  .nav a:not(.btn) {
    display: none;
  }
}

/* ── Buttons ────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: var(--radius-full);
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary,
.nav .btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 20px rgba(43, 173, 238, 0.3);
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-soft {
  background: var(--pastel-blue);
  color: var(--primary-dark);
}

.btn-sm {
  padding: 10px 18px;
  font-size: 0.9rem;
}

/* ── Hero ───────────────────────────────────────────────── */

.hero {
  margin-top: -72px;
  padding: 140px 0 96px;
  overflow: hidden;
}

.eyebrow {
  display: inline-block;
  padding: 6px 14px;
  margin-bottom: 20px;
  border-radius: var(--radius-full);
  background: var(--pastel-blue);
  color: var(--primary-dark);
  font-size: 0.85rem;
  font-weight: 700;
}

.hero h1 {
  margin-bottom: 28px;
  font-size: clamp(2.9rem, 10vw, 8rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.045em;
}

/* Hand-drawn underline under "Offline." */
.offline {
  position: relative;
  display: inline-block;
  color: var(--primary);
}

.offline::after {
  content: "";
  position: absolute;
  left: 2%;
  right: 4%;
  bottom: -0.08em;
  height: 0.16em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12' preserveAspectRatio='none'%3E%3Cpath d='M2 8c40-6 90-7 196-3' fill='none' stroke='%230d171b' stroke-width='4' stroke-linecap='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}

.hero-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px 48px;
}

.hero .lead {
  max-width: 540px;
  margin: 0;
  font-size: 1.2rem;
  color: var(--text-secondary);
}

.hero-note {
  margin: 0;
  font-family: var(--font-hand);
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1;
  color: var(--primary);
  transform: rotate(-4deg);
}

/* ── Flyers ─────────────────────────────────────────────── */

.flyers {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: clamp(20px, 4vw, 56px);
  max-width: var(--container);
  margin: 72px auto 0;
  padding: 0 var(--gutter);
}

.flyer {
  position: relative;
  flex: none;
  width: 290px;
  padding: 22px 18px 0;
  background: linear-gradient(var(--surface), var(--surface)) top / 100% calc(100% - 86px) no-repeat;
  filter: drop-shadow(0 1px 1px rgba(13, 23, 27, 0.08)) drop-shadow(0 12px 18px rgba(13, 23, 27, 0.1));
}

.flyer:nth-child(1) {
  transform: rotate(-3deg);
}

.flyer:nth-child(2) {
  margin-top: 40px;
  transform: rotate(2deg);
}

.flyer:nth-child(3) {
  margin-top: 8px;
  transform: rotate(-1.5deg);
}

.flyer-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c);
}

.flyer-tag::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c);
}

.flyer h3 {
  margin: 8px 0 14px;
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.flyer img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.flyer-meta {
  margin: 12px 0 14px;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

.flyer-meta b {
  color: var(--text);
}

/* Tear-off tabs: one per spot, torn ones are taken */
.tabs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  margin: 0 -18px;
  padding: 0;
  list-style: none;
  border-top: 2px dashed var(--divider);
}

.tabs li {
  display: grid;
  place-items: center;
  height: 86px;
  background: var(--surface);
  border-left: 1px dashed var(--divider);
  transform-origin: top center;
  transition: transform 0.25s ease;
}

.tabs li:first-child {
  border-left: 0;
}

.tabs span {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 0.62rem;
  font-weight: 700;
  white-space: nowrap;
  color: var(--text-secondary);
}

.tabs li:not(.taken):hover {
  transform: rotate(-7deg) translateY(3px);
}

.tabs li.taken {
  height: 12px;
  background: linear-gradient(var(--surface), var(--surface)) top / 100% 8px no-repeat;
  border-left-color: transparent;
}

/* Hand-written notes */
.note {
  position: absolute;
  font-family: var(--font-hand);
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.05;
  color: var(--c, var(--primary));
}

.note-tabs {
  left: -8px;
  bottom: -64px;
  transform: rotate(-4deg);
}

.note-tabs::before {
  content: "↗";
  position: absolute;
  right: -26px;
  top: -20px;
  font-size: 1.6rem;
}

@media (max-width: 980px) {
  .flyers {
    justify-content: flex-start;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 24px var(--gutter) 88px;
    margin-top: 40px;
    scrollbar-width: none;
  }

  .flyers::-webkit-scrollbar {
    display: none;
  }

  .flyer {
    width: 260px;
    scroll-snap-align: center;
  }

  .hero {
    padding-bottom: 40px;
  }
}

@media (max-width: 720px) {
  .hero {
    padding-top: 112px;
  }
}

/* ── Ticker ─────────────────────────────────────────────── */

.ticker {
  position: relative;
  z-index: 1;
  overflow: hidden;
  margin: -28px 0;
  padding: 28px 0;
}

.ticker-band {
  margin: 0 -24px;
  overflow: hidden;
  background: var(--text);
  color: #fff;
  transform: rotate(-1.2deg);
}

.ticker-track {
  display: flex;
  width: max-content;
  animation: ticker 40s linear infinite;
}

.ticker ul {
  display: flex;
  margin: 0;
  padding: 16px 0;
  list-style: none;
}

.ticker li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 28px;
  font-size: 1.1rem;
  font-weight: 700;
  white-space: nowrap;
}

.ticker li::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--c);
}

@keyframes ticker {
  to {
    transform: translateX(-50%);
  }
}

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

.section {
  padding: 88px 0;
}

.section-white {
  background: var(--surface);
}

.section-head {
  max-width: 720px;
  margin-bottom: 48px;
}

/* ── Manifesto ──────────────────────────────────────────── */

.manifesto {
  max-width: 1000px;
  margin-bottom: 64px;
  font-size: clamp(1.6rem, 3.8vw, 2.9rem);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.025em;
}

.manifesto s {
  color: var(--text-hint);
  text-decoration-thickness: 0.08em;
  text-decoration-color: var(--text);
}

.manifesto ins {
  display: inline-block;
  font-family: var(--font-hand);
  font-size: 1.15em;
  font-weight: 700;
  line-height: 1;
  color: var(--primary);
  text-decoration: none;
  margin-right: 0.15em;
  transform: rotate(-4deg);
}

.manifesto mark,
.quote mark {
  color: inherit;
  background: linear-gradient(transparent 58%, color-mix(in srgb, var(--c) 30%, transparent) 58%, color-mix(in srgb, var(--c) 30%, transparent) 92%, transparent 92%);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* Book quote taped under the manifesto, like a slip of paper */
.quote {
  position: relative;
  max-width: 560px;
  margin: 0 0 72px auto;
  padding: 36px 32px 24px 64px;
  background: var(--surface);
  box-shadow: var(--shadow-paper);
  transform: rotate(1.5deg);
}

.quote blockquote {
  position: relative;
  margin: 0 0 16px;
  font-family: var(--font-hand);
  font-size: clamp(1.5rem, 3vw, 1.9rem);
  font-weight: 700;
  line-height: 1.15;
}

.quote blockquote::before {
  content: "“";
  position: absolute;
  top: -0.05em;
  left: -0.75em;
  font-size: 2.2em;
  line-height: 1;
  color: var(--primary);
}

.quote p {
  margin: 0;
}

.quote figcaption {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.quote cite {
  font-style: normal;
  font-weight: 700;
  color: var(--text);
}

.principles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.principles li {
  padding-top: 20px;
  border-top: 2px solid var(--text);
}

.principles p {
  margin: 0;
  color: var(--text-secondary);
}

/* ── Route (how it works) ───────────────────────────────── */

.route {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Dashed path connecting the stops */
.route::before {
  content: "";
  position: absolute;
  top: 27px;
  left: 28px;
  /* ends at the centre of the last pin: one column width minus half a pin */
  right: calc((100% - 64px) / 3 - 28px);
  border-top: 3px dashed var(--primary);
}

.route li {
  position: relative;
}

.stop {
  position: relative;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 20px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: var(--primary);
  box-shadow: 0 0 0 8px var(--surface);
  color: #fff;
  font-size: 1.25rem;
  font-weight: 800;
}

/* Undo the pin rotation for the number */
.stop span {
  transform: rotate(45deg);
}

.route li:nth-child(2) .stop {
  background: var(--cat-wellness);
}

.route li:nth-child(3) .stop {
  background: var(--cat-food);
}

.when {
  display: block;
  margin-bottom: 4px;
  font-family: var(--font-hand);
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-secondary);
}

.route h3 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 10px;
}

.route p {
  margin: 0;
  color: var(--text-secondary);
}

/* ── Polaroids (app screenshots) ────────────────────────── */

.polaroids {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 48px clamp(16px, 4vw, 56px);
}

.polaroid {
  position: relative;
  width: min(250px, calc(50% - 12px));
  margin: 0;
  padding: 12px 12px 0;
  background: var(--surface);
  box-shadow: var(--shadow-paper);
  text-align: center;
  transition: transform 0.25s ease;
}

.polaroid:nth-child(1) {
  transform: rotate(-2.5deg);
}

.polaroid:nth-child(2) {
  transform: rotate(1.5deg) translateY(24px);
}

.polaroid:nth-child(3) {
  transform: rotate(-1deg);
}

.polaroid:hover {
  transform: rotate(0) scale(1.03);
}

.polaroid img {
  width: 100%;
  height: auto;
  border-radius: 6px;
}

.polaroid figcaption {
  padding: 12px 4px 16px;
  font-family: var(--font-hand);
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.1;
}

.polaroid small {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  margin-top: 8px;
  font-size: 0.7rem;
  color: var(--text-hint);
}

@media (max-width: 560px) {
  .polaroid figcaption {
    font-size: 1.15rem;
  }

  .polaroid:nth-child(2) {
    transform: rotate(1.5deg);
  }
}

/* ── Safety rules ───────────────────────────────────────── */

.rules {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 2px solid var(--text);
}

.rules li {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) minmax(0, 1.2fr);
  align-items: center;
  gap: 8px 32px;
  padding: 28px 0;
  border-bottom: 1px solid var(--divider);
}

.rules svg {
  width: 44px;
  height: 44px;
  fill: none;
  stroke: var(--primary);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rules h3 {
  margin: 0;
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 800;
}

.rules p {
  margin: 0;
  color: var(--text-secondary);
}

@media (max-width: 720px) {
  .rules li {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .rules svg {
    width: 36px;
    height: 36px;
  }

  .rules p {
    grid-column: 2;
  }
}

/* ── Receipt ────────────────────────────────────────────── */

.receipt {
  max-width: 380px;
  margin: 0 auto;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.5;
  transform: rotate(-2deg);
  filter: drop-shadow(0 14px 22px rgba(13, 23, 27, 0.12));
}

/* Zigzag torn edge at the bottom */
.receipt-paper {
  padding: 32px 26px 40px;
  background: var(--surface);
  -webkit-mask: conic-gradient(from -45deg at bottom, #000 90deg, transparent 0) bottom / 16px 100%;
  mask: conic-gradient(from -45deg at bottom, #000 90deg, transparent 0) bottom / 16px 100%;
}

.receipt-head {
  margin-bottom: 18px;
  text-align: center;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  line-height: 1.3;
}

.receipt-head small {
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

.receipt dl {
  margin: 0;
  padding: 12px 0;
  border-top: 1px dashed var(--text-hint);
}

.receipt dl div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.receipt dd {
  margin: 0;
  font-weight: 700;
}

.receipt dl.receipt-total {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  border-top: 3px double var(--text-hint);
}

.receipt-total dd {
  color: var(--primary);
}

.receipt-foot {
  margin: 12px 0 0;
  text-align: center;
  color: var(--text-secondary);
}

/* ── Footer ─────────────────────────────────────────────── */

.site-footer {
  overflow: hidden;
  padding: 24px 0 40px;
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.wordmark {
  margin: 0 0 8px;
  font-size: clamp(5rem, 26vw, 19rem);
  font-weight: 800;
  line-height: 0.85;
  letter-spacing: -0.06em;
  text-align: center;
  color: var(--pastel-blue);
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--text);
}

/* ── Responsive (shared) ────────────────────────────────── */

@media (max-width: 880px) {
  .section {
    padding: 64px 0;
  }

  .principles {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .route {
    grid-template-columns: 1fr;
    gap: 36px;
    padding-left: 84px;
  }

  /* Vertical path: one segment from each pin down to the next */
  .route::before {
    content: none;
  }

  .route li:not(:last-child)::before {
    content: "";
    position: absolute;
    top: 28px;
    left: -57px;
    height: calc(100% + 36px);
    border-left: 3px dashed var(--primary);
  }

  .stop {
    position: absolute;
    left: -84px;
    top: 0;
  }
}

/* ── Prose pages (privacy, delete account, 404) ─────────── */

.prose {
  position: relative;
  max-width: 760px;
  margin: 56px auto 80px;
  background: var(--surface);
  padding: clamp(28px, 5vw, 56px);
  box-shadow: var(--shadow-paper);
}

.prose h1 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 800;
}

.prose h2 {
  font-size: 1.35rem;
  margin-top: 36px;
}

.prose ol,
.prose ul {
  padding-left: 22px;
}

.prose li {
  margin-bottom: 8px;
}

.page {
  margin-top: -72px;
  padding: 72px 0 1px;
}

.notice {
  background: var(--pastel-blue);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-size: 0.95rem;
  color: var(--primary-dark);
  margin-bottom: 24px;
}

.draft {
  background: #fef3c7;
  color: #92400e;
}

/* ── Motion ─────────────────────────────────────────────── */

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

  .ticker-track {
    animation: none;
  }

  .btn,
  .tabs li,
  .polaroid {
    transition: none;
  }
}
