/* Meridian public site — shared stylesheet.
 *
 * Values are transcribed from the app's semantic colour tokens in
 * mobile/composeApp/src/commonMain/kotlin/app/meridian/ui/designsystem/color/MeridianColors.kt
 * so the site and the product stay one brand. No external fonts, no CDN, no
 * JavaScript, no trackers — everything this page needs is same-origin.
 */

:root {
  /* Light — MeridianLightColors */
  --ground: #f7f5f1;
  --ground-alt: #efebe4;
  --surface: #ffffff;
  --text-primary: #14181a;
  --text-secondary: #4e5652;
  --text-tertiary: #5f6763;
  --accent: #10635a;
  --accent-deep: #0f3b36;
  --accent-container: #e6edea;
  --mint: #8fd6be;
  --on-deep: #ffffff;
  --on-deep-muted: #d6e5e0;
  --border: #e4dfd4;
  --divider: #e7e3da;
  --focus: #10635a;

  --measure: 42rem;
  --radius: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Dark — MeridianDarkColors. Warm and green-influenced, never pure black. */
    --ground: #131a19;
    --ground-alt: #0e1413;
    --surface: #1b2322;
    --text-primary: #f2f0ea;
    --text-secondary: #c2c9c4;
    --text-tertiary: #a9b1ac;
    --accent: #8fd6be;
    --accent-deep: #14514a;
    --accent-container: #1d3a35;
    --mint: #8fd6be;
    --on-deep: #ffffff;
    --on-deep-muted: #c8ddd7;
    --border: #2e3937;
    --divider: #262f2e;
    --focus: #8fd6be;
  }
}

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

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
}

/* --- Skip link ---------------------------------------------------------- */

.skip-link {
  position: absolute;
  inset-inline-start: 0.75rem;
  inset-block-start: -4rem;
  z-index: 10;
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  background: var(--accent-deep);
  color: var(--on-deep);
  text-decoration: none;
  transition: inset-block-start 120ms ease-out;
}

.skip-link:focus {
  inset-block-start: 0.75rem;
}

/* --- Focus -------------------------------------------------------------- */

a:focus-visible,
.skip-link:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

/* --- Layout ------------------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.site-header {
  border-block-end: 1px solid var(--divider);
  background: var(--ground);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  align-items: baseline;
  justify-content: space-between;
  padding-block: 1.25rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  color: var(--text-primary);
  text-decoration: none;
}

.wordmark .mark {
  display: inline-block;
  inline-size: 1.15rem;
  block-size: 1.15rem;
  border-radius: 50%;
  background: var(--accent-deep);
  box-shadow: inset 0 0 0 3px var(--mint);
  flex: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-size: 0.94rem;
}

.site-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  border-block-end: 1px solid transparent;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--accent);
  border-block-end-color: currentColor;
}

main {
  padding-block: 2.5rem 3rem;
}

/* --- Typography --------------------------------------------------------- */

h1,
h2,
h3 {
  line-height: 1.25;
  color: var(--text-primary);
  text-wrap: balance;
}

h1 {
  font-size: clamp(1.85rem, 1.3rem + 2.2vw, 2.6rem);
  margin-block: 0 0.5rem;
  letter-spacing: -0.015em;
}

h2 {
  font-size: clamp(1.2rem, 1.05rem + 0.7vw, 1.45rem);
  margin-block: 2.25rem 0.6rem;
  padding-block-start: 1.25rem;
  border-block-start: 1px solid var(--divider);
}

h3 {
  font-size: 1.02rem;
  margin-block: 1.5rem 0.4rem;
}

p,
ul,
ol,
dl {
  margin-block: 0 1rem;
}

ul,
ol {
  padding-inline-start: 1.4rem;
}

li {
  margin-block-end: 0.4rem;
}

a {
  color: var(--accent);
}

strong {
  font-weight: 650;
}

.lede {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 34rem;
}

.meta {
  font-size: 0.9rem;
  color: var(--text-tertiary);
  margin-block-end: 1.5rem;
}

.placeholder {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--accent-container);
  color: var(--text-primary);
  padding: 0.1em 0.35em;
  border-radius: 4px;
  white-space: nowrap;
}

/* --- Notices and cards --------------------------------------------------- */

.notice {
  border: 1px solid var(--border);
  border-inline-start: 4px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1rem 1.1rem;
  margin-block-end: 2rem;
}

.notice p:last-child {
  margin-block-end: 0;
}

.notice h2 {
  margin: 0 0 0.35rem;
  padding: 0;
  border: 0;
  font-size: 1rem;
}

.hero {
  background: var(--accent-deep);
  color: var(--on-deep);
  border-radius: 16px;
  padding: 2rem 1.5rem;
  margin-block-end: 2.5rem;
}

.hero h1 {
  color: var(--on-deep);
  margin-block-start: 0;
}

.hero p {
  color: var(--on-deep-muted);
  max-width: 32rem;
}

.hero p:last-child {
  margin-block-end: 0;
}

.hero .rule {
  inline-size: 3rem;
  block-size: 3px;
  background: var(--mint);
  border-radius: 2px;
  margin-block-end: 1.25rem;
}

.cards {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}

.cards li {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1.1rem 1.15rem;
}

.cards h3 {
  margin-block-start: 0;
}

.cards p {
  color: var(--text-secondary);
  margin-block-end: 0;
  font-size: 0.96rem;
}

.toc {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1rem 1.15rem;
  margin-block-end: 2rem;
}

.toc h2 {
  margin: 0 0 0.5rem;
  padding: 0;
  border: 0;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.toc ol {
  margin: 0;
  padding-inline-start: 1.2rem;
  font-size: 0.96rem;
}

/* --- Footer -------------------------------------------------------------- */

.site-footer {
  border-block-start: 1px solid var(--divider);
  background: var(--ground-alt);
  padding-block: 1.75rem 2.25rem;
  color: var(--text-tertiary);
  font-size: 0.9rem;
}

.site-footer ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  padding: 0;
  margin: 0 0 0.75rem;
}

.site-footer a {
  color: var(--text-secondary);
}

.site-footer p {
  margin: 0;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* ---------------------------------------------------------------------------
   Forms — /support/ and /delete-account/
   ---------------------------------------------------------------------------
   These are the only two pages that take input. The site runs no JavaScript,
   so validation here is whatever the browser gives us for free: `required`,
   `type="email"` and `maxlength`. Everything that actually matters is checked
   again on the server, which is the only place it can be trusted.
   --------------------------------------------------------------------------- */

.form {
  margin-block-start: 1.5rem;
  max-inline-size: var(--measure);
}

.field {
  display: block;
  margin-block-end: 1.25rem;
}

.field > span {
  display: block;
  font-weight: 600;
  margin-block-end: 0.35rem;
}

.field .hint {
  display: block;
  font-weight: 400;
  color: var(--text-secondary);
  font-size: 0.925rem;
  margin-block-end: 0.5rem;
}

.field input[type="email"],
.field textarea {
  inline-size: 100%;
  box-sizing: border-box;
  font: inherit;
  color: var(--text-primary);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.7rem 0.8rem;
}

.field textarea {
  min-block-size: 9rem;
  resize: vertical;
}

.field input[type="email"]:focus-visible,
.field textarea:focus-visible,
.button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.button {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  color: var(--on-deep);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 0.7rem 1.4rem;
}

.button:hover {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
}

/* The honeypot. Not `display:none`: a bot that reads styles skips hidden
   fields, and a screen reader must skip it too — hence `aria-hidden` and
   `tabindex="-1"` on the input itself, with the field moved out of view
   rather than removed from the box model. */
.trap {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
