/* Knot Ready — shared styling for the legal pages.
   Palette mirrors the app's default "Dusty Rose & Sage" theme
   (ThemeManager.swift, ThemeVariant.light1). */

:root {
  --paper: #f3eee5;
  --surface: #f8f2ea;
  --primary: #8c9a7e;
  --primary-deep: #6f7d62;
  --accent: #c6b59e;
  --ink: #3b433b;
  --ink-soft: #6b7268;
  --line: rgba(59, 67, 59, 0.14);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 20px;
  --measure: 44rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #22261f;
    --surface: #2b3028;
    --primary: #a9b899;
    --primary-deep: #c2cfb3;
    --accent: #b6a68f;
    --ink: #e6e6de;
    --ink-soft: #adb2a6;
    --line: rgba(230, 230, 222, 0.16);
  }
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  overflow-x: hidden;
}

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- header ---------- */

header.site {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

header.site .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 20px;
  padding-bottom: 20px;
}

.brand {
  font-family: var(--serif);
  font-size: 1.35rem;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}

.brand span {
  color: var(--primary-deep);
}

nav.site a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.95rem;
  margin-left: 20px;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
}

nav.site a:first-child {
  margin-left: 0;
}

nav.site a:hover,
nav.site a:focus-visible {
  color: var(--ink);
  border-bottom-color: var(--primary);
}

nav.site a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--primary);
}

/* ---------- document ---------- */

main {
  padding: 56px 0 72px;
}

h1 {
  font-family: var(--serif);
  font-size: clamp(2.1rem, 6vw, 3rem);
  line-height: 1.15;
  margin: 0 0 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.effective {
  color: var(--primary-deep);
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 28px;
  font-weight: 600;
}

.lede {
  font-size: 1.1rem;
  color: var(--ink-soft);
  margin: 0 0 8px;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--line);
}

section {
  margin-top: 40px;
  scroll-margin-top: 24px;
}

h2 {
  font-family: var(--serif);
  font-size: 1.4rem;
  line-height: 1.3;
  margin: 0 0 14px;
  font-weight: 600;
}

section p {
  margin: 0 0 16px;
  color: var(--ink-soft);
}

section p:last-child {
  margin-bottom: 0;
}

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

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

/* ---------- support FAQ ---------- */

.faq h3 {
  font-family: var(--sans);
  font-size: 1.03rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink);
  margin: 28px 0 8px;
}

.faq h3:first-of-type {
  margin-top: 0;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
}

/* ---------- arbitration notice ---------- */

/* Mirrors the boxed notice at the top of TermsConditionsView.swift. */
.notice {
  margin: 32px 0 0;
  background: var(--surface);
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  padding: 20px 24px;
  color: var(--ink);
}

/* UCC 2-316 requires a warranty disclaimer to be conspicuous, so these
   paragraphs are set apart from the surrounding body copy. */
.conspicuous {
  color: var(--ink) !important;
  font-weight: 600;
  letter-spacing: 0.01em;
  border-left: 3px solid var(--accent);
  padding-left: 16px;
}

/* ---------- home page feature grid ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 20px;
}

.tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
}

.tile h3 {
  font-family: var(--sans);
  font-size: 1.03rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink);
  margin: 0 0 8px;
}

.tile p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.97rem;
}

/* ---------- contact callout ---------- */

.callout {
  margin-top: 48px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 26px;
}

.callout h2 {
  margin-top: 0;
}

.callout p {
  margin-bottom: 0;
}

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

footer.site {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 28px 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

footer.site .wrap {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

footer.site a {
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

footer.site a:hover {
  color: var(--ink);
  border-bottom-color: var(--primary);
}

@media (max-width: 560px) {
  body {
    font-size: 16px;
  }

  main {
    padding: 40px 0 56px;
  }

  nav.site a {
    margin-left: 16px;
  }
}

@media print {
  header.site nav,
  footer.site {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }
}
