/* Rafton website. One stylesheet, system fonts, light + dark.
   Brand colors from design/brand/rafton-braced-r/manifest.json:
   blue #0040DD, dark background #0E1F3D, dark accent #4C9DFF. */

:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --surface: #f4f6fb;
  --text: #14181f;
  --muted: #4a5263; /* 7.9:1 on --bg */
  --line: #d9deea;
  --accent: #0040dd; /* 7.6:1 on white */
  --accent-text: #ffffff;
  --marker: #a3001b;
  --placeholder-bg: #fff1d6;
  --placeholder-line: #9a4a00;
  --radius: 12px;
  --max: 44rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1f3d;
    --surface: #152a50;
    --text: #eef2fa;
    --muted: #b8c3d9; /* 8.9:1 on --bg */
    --line: #29406b;
    --accent: #4c9dff; /* 5.9:1 on --bg */
    --accent-text: #0e1f3d;
    --marker: #ff9aa8;
    --placeholder-bg: #4a3200;
    --placeholder-line: #ffc266;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

a {
  color: var(--accent);
  text-underline-offset: 0.15em;
}

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

h1,
h2,
h3 {
  line-height: 1.25;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(1.75rem, 1.3rem + 2vw, 2.4rem);
  margin: 0 0 0.75rem;
}

h2 {
  font-size: 1.3rem;
  margin: 2.25rem 0 0.5rem;
}

h3 {
  font-size: 1.075rem;
  margin: 1.5rem 0 0.25rem;
}

p,
ul,
ol,
table {
  margin: 0 0 1rem;
}

ul,
ol {
  padding-left: 1.25rem;
}

li + li {
  margin-top: 0.35rem;
}

/* Skip link: visible only when focused. */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -10rem;
  background: var(--accent);
  color: var(--accent-text);
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  z-index: 10;
}

.skip-link:focus {
  top: 0.75rem;
}

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

/* Header */
.site-header {
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0;
}

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

.lang-switch {
  display: flex;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.95rem;
}

.lang-switch li + li {
  margin-top: 0;
}

.lang-switch a,
.lang-switch span {
  display: inline-block;
  min-width: 2.75rem;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  text-align: center;
  text-decoration: none;
  font-weight: 600;
}

.lang-switch span[aria-current] {
  background: var(--surface);
  color: var(--text);
}

/* Main */
main {
  padding: 2.5rem 0 3rem;
}

.lead {
  font-size: 1.2rem;
  color: var(--muted);
  max-width: 36rem;
}

.meta {
  color: var(--muted);
  font-size: 0.95rem;
}

/* Home benefits */
.benefits {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.75rem;
  margin: 1.5rem 0 2rem;
}

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

.benefits strong {
  display: block;
  font-size: 1.05rem;
}

/* Promises */
.promise {
  border-left: 4px solid var(--accent);
  padding: 0.1rem 0 0.1rem 1rem;
  margin: 1.75rem 0;
}

.promise h2 {
  margin-top: 0;
}

.promise p {
  margin-bottom: 0;
}

/* Quoted contract terms inside the Terms page */
.term-block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
}

.term-block > :first-child {
  margin-top: 0;
}

.term-block > :last-child {
  margin-bottom: 0;
}

/* "Coming soon to the App Store" — a badge, not a link, until the App Store ID is known. */
.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 1.1rem;
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
  line-height: 1.3;
}

.store-badge small {
  display: block;
  font-weight: 400;
  font-size: 0.8rem;
  opacity: 0.85;
}

.callout {
  margin: 2rem 0;
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.callout h2 {
  margin-top: 0;
}

/* Legal pages */
.legal h2 {
  border-top: 1px solid var(--line);
  padding-top: 1.5rem;
}

.legal h2:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.toc {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1rem 1.25rem 0.5rem;
  margin: 1.5rem 0 2rem;
}

.toc h2 {
  font-size: 1rem;
  margin: 0 0 0.5rem;
  border: 0;
  padding: 0;
}

.toc ol {
  padding-left: 1.25rem;
}

.table-scroll {
  overflow-x: auto;
  margin: 0 0 1rem;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.95rem;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid var(--line);
}

th {
  font-weight: 600;
}

/* Draft markers (same intent as web/page: red, bold, small). */
.draft-marker {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--marker);
  margin-bottom: 1.5rem;
}

.draft-note {
  color: var(--muted);
  font-style: italic;
  font-size: 0.9rem;
  margin-top: 2.5rem;
}

/* Owner-supplied values not filled in yet. */
.placeholder {
  background: var(--placeholder-bg);
  outline: 1px dashed var(--placeholder-line);
  padding: 0 0.2rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.5rem 0 2rem;
  font-size: 0.95rem;
  color: var(--muted);
}

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

.site-footer li + li {
  margin-top: 0;
}

.site-footer p {
  margin: 0;
}

@media (min-width: 40rem) {
  .benefits {
    grid-template-columns: 1fr 1fr;
  }
}
