/* LushPash public site. Colours and radii come from the app's design tokens
   (app/lib/design_system/tokens.dart). No external requests. */

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("PlusJakartaSans-Variable.ttf") format("truetype");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;

  --canvas: #faf7f2;
  --surface: #ffffff;
  --surface-raised: #f5f1eb;
  --surface-sunken: #f0ebe4;
  --border-subtle: #e8e2da;
  --border-strong: #cfc7bd;
  --text-primary: #1f1d1b;
  --text-secondary: #605a53;
  --text-tertiary: #6f6961;
  --accent: #e9442b;
  --accent-fill: #d13720;
  --accent-text: #bd321c;
  --accent-tint: #fce9e4;

  /* Own bubbles are the same in light and dark, with dark ink on top. */
  --bubble-sent: #a9b4bc;
  --bubble-delivered: #5fd98a;
  --bubble-read: #53bdeb;
  --bubble-ink: #1f1d1b;
  --bubble-ink-2: #3f3a35;
  --bubble-accent: #bd321c;

  --phone-body: #1f1d1b;
  --phone-edge: #1f1d1b;

  --brand: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system,
    "Segoe UI", Roboto, sans-serif;
  --system: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --gutter: 20px;
  --measure: 34rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #151413;
    --surface: #1e1c1a;
    --surface-raised: #272421;
    --surface-sunken: #121110;
    --border-subtle: #322e2a;
    --border-strong: #4a443e;
    --text-primary: #f3efe9;
    --text-secondary: #b5ada3;
    --text-tertiary: #958d84;
    --accent: #f2583f;
    --accent-fill: #d13720;
    --accent-text: #f46a53;
    --accent-tint: #3a1f1a;

    --phone-body: #0b0a0a;
    --phone-edge: #4a443e;
  }
}

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

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

body {
  margin: 0;
  background: var(--canvas);
  color: var(--text-primary);
  font-family: var(--brand);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
p,
ol,
ul,
dl,
dd,
figure {
  margin: 0;
}

ol,
ul {
  padding: 0;
  list-style: none;
}

a {
  color: var(--accent-text);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

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

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  padding: 0.5rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  color: var(--text-primary);
}

.skip:focus {
  top: 0.75rem;
}

/* ---- masthead ---------------------------------------------------------- */

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
}

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

.brand img {
  width: 48px;
  height: 48px;
  display: block;
}

@media (max-width: 480px) {
  .brand { font-size: 1.3125rem; }
  .brand img { width: 42px; height: 42px; }
}

.masthead nav ul {
  display: flex;
  gap: 1.5rem;
}

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

.masthead nav a:hover,
.masthead nav a[aria-current="page"] {
  color: var(--text-primary);
  text-decoration: underline;
  text-underline-offset: 0.3em;
}

/* ---- opening ----------------------------------------------------------- */

.opening {
  display: grid;
  gap: 3rem;
  padding-top: 2.5rem;
  padding-bottom: 4rem;
}

.opening h1 {
  font-size: clamp(2.625rem, 1.2rem + 6.2vw, 5rem);
  line-height: 1.02;
  font-weight: 700;
  letter-spacing: -0.035em;
  max-width: 11ch;
}

.lede {
  margin-top: 1.5rem;
  max-width: var(--measure);
  font-size: clamp(1.125rem, 1rem + 0.5vw, 1.3125rem);
  line-height: 1.5;
  color: var(--text-primary);
}

.lede + .lede {
  margin-top: 0.875rem;
  color: var(--text-secondary);
}

.state {
  margin-top: 2.25rem;
  padding-top: 1rem;
  max-width: var(--measure);
  border-top: 1px solid var(--border-strong);
  display: flex;
  align-items: baseline;
  gap: 0.625rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-primary);
}

.state::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateY(-1px);
}

.state span {
  color: var(--text-secondary);
  font-weight: 400;
}

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

.part,
.foot {
  position: relative;
}

.part::before,
.foot::before {
  content: "";
  position: absolute;
  top: 0;
  left: var(--gutter);
  right: var(--gutter);
  border-top: 1px solid var(--border-strong);
}

.part {
  padding-top: 1.5rem;
  padding-bottom: 4rem;
  display: grid;
  gap: 1.5rem;
}

.part > header h2 {
  font-size: 1.375rem;
  line-height: 1.27;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.part > header p {
  margin-top: 0.5rem;
  max-width: 22rem;
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

/* The numbered list of what the app does. */
.does {
  counter-reset: does;
}

.does li {
  counter-increment: does;
  display: grid;
  grid-template-columns: 2.25rem 1fr;
  column-gap: 0.5rem;
  padding: 1.125rem 0 1.25rem;
  border-top: 1px solid var(--border-subtle);
}

.does li:first-child {
  border-top: 0;
  padding-top: 0;
}

.does li::before {
  content: counter(does, decimal-leading-zero);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.75rem;
  color: var(--accent-text);
  font-variant-numeric: tabular-nums;
}

.does h3 {
  font-size: 1.1875rem;
  line-height: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.012em;
}

.does p {
  grid-column: 2;
  margin-top: 0.25rem;
  max-width: 36rem;
  color: var(--text-secondary);
}

/* What we cannot see / what we keep. */
.ledger {
  display: grid;
  gap: 2.5rem;
}

.ledger h3 {
  font-size: 1.1875rem;
  line-height: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.012em;
  padding-bottom: 0.625rem;
  border-bottom: 1px solid var(--text-primary);
}

.ledger li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.5;
}

.ledger li strong {
  color: var(--text-primary);
  font-weight: 600;
}

.plain {
  font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.75rem);
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -0.03em;
  max-width: 18ch;
}

.plain + p,
.follow {
  margin-top: 1rem;
  max-width: var(--measure);
  color: var(--text-secondary);
}

.follow a {
  font-weight: 500;
}

/* ---- footer ------------------------------------------------------------ */

.foot {
  padding-top: 1.5rem;
  padding-bottom: 3rem;
  display: grid;
  gap: 1rem;
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

.foot ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}

.foot a {
  color: var(--text-primary);
}

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

/* ---- the phone --------------------------------------------------------- */

.device {
  justify-self: center;
  width: min(100%, 21.5rem);
}

.phone {
  background: var(--phone-body);
  border: 1px solid var(--phone-edge);
  border-radius: 46px;
  padding: 10px;
}

.screen {
  background: var(--canvas);
  border-radius: 36px;
  overflow: hidden;
  font-family: var(--system);
  font-size: 16px;
  line-height: 22px;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
}

.sbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px 4px;
  font-size: 13px;
  line-height: 18px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.sbar svg {
  display: block;
  height: 11px;
  width: auto;
  fill: currentColor;
}

.appbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 6px 8px 4px;
  border-bottom: 1px solid var(--border-subtle);
}

.appbar .who {
  flex: 1;
  min-width: 0;
  font-size: 17px;
  font-weight: 600;
}

.avatar {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-tint);
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 600;
}

.ic {
  flex: none;
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.appbar .ic {
  margin: 0 6px;
}

.appbar .ic.back {
  margin: 0 0 0 4px;
}

.thread {
  padding: 4px 12px 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.e2e {
  align-self: center;
  padding: 10px 14px 6px;
  font-size: 12px;
  line-height: 16px;
  color: var(--text-secondary);
  text-align: center;
}

.e2e svg {
  width: 13px;
  height: 13px;
  margin-right: 4px;
  vertical-align: -2px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.msg {
  max-width: 82%;
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 18px 18px 18px 4px;
  background: var(--surface-raised);
}

.msg.tight {
  margin-top: 2px;
}

.msg.out {
  align-self: flex-end;
  border-radius: 18px 18px 4px 18px;
  background: var(--bubble-read);
  color: var(--bubble-ink);
}

.msg.out.delivered {
  background: var(--bubble-delivered);
  animation: delivered 0.45s cubic-bezier(0.33, 1, 0.68, 1) 1.6s backwards;
}

@keyframes delivered {
  from {
    background: var(--bubble-sent);
  }
}

.msg time {
  float: right;
  margin: 6px 0 0 10px;
  font-size: 12px;
  line-height: 16px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.msg.out time {
  color: var(--bubble-ink-2);
}

.msg::after {
  content: "";
  display: block;
  clear: both;
}

.quote {
  margin-bottom: 4px;
  padding: 3px 8px;
  border-left: 3px solid var(--bubble-accent);
  border-radius: 6px;
  background: rgb(31 29 27 / 0.07);
  font-size: 12px;
  line-height: 16px;
  color: var(--bubble-ink-2);
}

.quote b {
  display: block;
  font-weight: 600;
  color: var(--bubble-accent);
}

.msg.voice {
  padding: 4px 12px 6px 4px;
  width: 232px;
  max-width: 82%;
}

.voice .row {
  display: flex;
  align-items: center;
}

.voice .play {
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: var(--accent-text);
}

.voice .play svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.voice .wave {
  flex: 1;
  min-width: 0;
  height: 28px;
  display: block;
  color: var(--text-tertiary);
}

.voice .wave .played {
  stroke: var(--accent);
}

.voice .meta {
  display: flex;
  justify-content: space-between;
  padding-left: 44px;
  font-size: 12px;
  line-height: 16px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.react {
  margin-top: 2px;
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--surface-raised);
}

.react.out {
  align-self: flex-end;
}

.react svg {
  width: 14px;
  height: 14px;
  margin: 3px 0;
  fill: var(--accent);
}

.composer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 14px 10px;
  color: var(--text-secondary);
}

.composer .field {
  flex: 1;
  padding: 9px 16px;
  border-radius: 20px;
  background: var(--surface-raised);
  color: var(--text-tertiary);
}

.composer .send {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-fill);
  color: #fff;
  display: grid;
  place-items: center;
}

.composer .send .ic {
  width: 22px;
  height: 22px;
}

.device figcaption {
  margin: 1rem 0.5rem 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.key {
  display: inline-block;
  width: 0.625rem;
  height: 0.625rem;
  margin-right: 0.3125rem;
  border-radius: 3px;
  vertical-align: 0;
}

.key.sent {
  background: var(--bubble-sent);
}

.key.delivered {
  background: var(--bubble-delivered);
}

.key.read {
  background: var(--bubble-read);
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---- legal pages ------------------------------------------------------- */

.doc {
  padding-top: 2.5rem;
  padding-bottom: 4rem;
  max-width: 44rem;
  margin-left: 0;
}

.doc h1 {
  font-size: clamp(2rem, 1.4rem + 2.6vw, 3rem);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.doc .note {
  margin-top: 1.5rem;
  padding: 0.875rem 0 0.875rem 1rem;
  border-left: 3px solid var(--accent);
  color: var(--text-secondary);
  font-size: 1rem;
}

.doc .note strong {
  color: var(--text-primary);
}

.doc .body {
  margin-top: 2rem;
  border-top: 1px solid var(--border-strong);
}

.doc .body > p,
.doc .body > ol > li {
  padding: 1.125rem 0;
  border-bottom: 1px solid var(--border-subtle);
}

.doc .body ul {
  margin-top: 0.5rem;
  padding-bottom: 1.125rem;
  border-bottom: 1px solid var(--border-subtle);
}

.doc .body p.has-list {
  border-bottom: 0;
  padding-bottom: 0;
}

.doc .body ul li {
  position: relative;
  padding: 0.3125rem 0 0.3125rem 1.25rem;
  color: var(--text-secondary);
}

.doc .body ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.05em;
  width: 0.5rem;
  height: 1px;
  background: var(--text-tertiary);
}

.doc .body ol {
  counter-reset: clause;
}

.doc .body ol > li {
  counter-increment: clause;
  display: grid;
  grid-template-columns: 2.25rem 1fr;
}

.doc .body ol > li::before {
  content: counter(clause) ".";
  font-weight: 600;
  color: var(--accent-text);
  font-variant-numeric: tabular-nums;
}

.doc .body strong {
  font-weight: 600;
}

.doc .hole {
  color: var(--text-tertiary);
  font-style: italic;
}

.lost {
  padding-top: 4rem;
  padding-bottom: 6rem;
}

.lost h1 {
  font-size: clamp(2.25rem, 1.4rem + 4vw, 3.75rem);
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.03em;
  max-width: 14ch;
}

.lost p {
  margin-top: 1.25rem;
  color: var(--text-secondary);
}

/* ---- wider screens ----------------------------------------------------- */

@media (min-width: 40rem) {
  :root {
    --gutter: 32px;
  }

  .ledger {
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
  }
}

@media (min-width: 60rem) {
  :root {
    --gutter: 48px;
  }

  .masthead {
    padding-top: 1.75rem;
    padding-bottom: 1.75rem;
  }

  .opening {
    grid-template-columns: minmax(0, 1fr) 21.5rem;
    column-gap: 5rem;
    align-items: start;
    padding-top: 4.5rem;
    padding-bottom: 6rem;
  }

  .opening .words {
    padding-top: 2.5rem;
  }

  .device {
    justify-self: end;
  }

  .part {
    grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
    column-gap: 3rem;
    padding-top: 2rem;
    padding-bottom: 6rem;
  }

  .does li {
    grid-template-columns: 3rem 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .msg.out.delivered {
    animation: none;
  }
}

@media print {
  .device,
  .masthead nav {
    display: none;
  }
}
