/*
 * Public site styles. Deliberately hand-written and self-contained: this site
 * ships no application bundle and no external requests, so the whole visual
 * layer is one small stylesheet using the Mellowpan palette.
 */

:root {
  --background: #f6ebd9;
  --surface: #fdfdfb;
  --surface-muted: #e9e7e2;
  --border: #dcd9d3;
  --text-primary: #3e3a34;
  --text-secondary: #5b5f5a;
  --primary: #6f63a8;
  --primary-strong: #4c3d77;
  --accent: #fe7f2d;
  --on-primary: #fff9ef;
  --radius: 16px;
  --measure: 68ch;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #171815;
    --surface: #2c2b27;
    --surface-muted: #343330;
    --border: #3d3c38;
    --text-primary: #f5efe5;
    --text-secondary: #d4d7d2;
    --primary: #c1b6e4;
    --primary-strong: #e8e3f5;
    --accent: #fe9d5c;
    --on-primary: #2b2350;
  }
}

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

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

body {
  margin: 0;
  padding: 0;
  background: var(--background);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  z-index: 10;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border-radius: var(--radius);
}

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

@media (prefers-color-scheme: dark) {
  a {
    color: var(--primary);
  }
}

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

/* Header and footer */

.site-header,
.site-footer {
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 1.5rem 1.25rem;
}

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

.wordmark {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--text-primary);
}

.locale-switch {
  font-size: 0.95rem;
}

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin-bottom: 0.75rem;
}

.copyright {
  margin: 0;
}

/* Main content */

main {
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1.25rem 3rem;
}

h1 {
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 1rem 0;
}

h2 {
  font-size: 1.35rem;
  line-height: 1.3;
  margin: 2.5rem 0 0.75rem;
  scroll-margin-top: 1rem;
}

h3 {
  font-size: 1.1rem;
  margin: 1.75rem 0 0.5rem;
  scroll-margin-top: 1rem;
}

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

li {
  margin-bottom: 0.4rem;
}

code {
  background: var(--surface-muted);
  border-radius: 6px;
  padding: 0.15em 0.4em;
  font-size: 0.9em;
}

/* Document metadata */

.doc-meta {
  display: grid;
  gap: 0.4rem;
  margin: 0 0 2rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.92rem;
}

.doc-meta > div {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.doc-meta dt {
  font-weight: 600;
  margin: 0;
}

.doc-meta dt::after {
  content: ':';
}

.doc-meta dd {
  margin: 0;
  color: var(--text-secondary);
}

/* Tables scroll inside their own container so the page never scrolls sideways. */

.table-scroll {
  overflow-x: auto;
  margin: 0 0 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

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

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

th {
  background: var(--surface-muted);
  font-weight: 600;
}

tbody tr:last-child td {
  border-bottom: none;
}

/* Landing and invite */

.page-landing main,
.page-invite main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
}

.hero,
.invite {
  padding: 2rem 0;
}

.lede {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 46ch;
}

.cta {
  display: inline-block;
  margin: 0.5rem 0.75rem 0.5rem 0;
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  background: var(--primary-strong);
  color: var(--on-primary);
  font-weight: 600;
  text-decoration: none;
}

@media (prefers-color-scheme: dark) {
  .cta {
    background: var(--primary);
  }
}

.cta-secondary {
  background: transparent;
  color: var(--primary-strong);
  border: 2px solid var(--border);
}

@media (prefers-color-scheme: dark) {
  .cta-secondary {
    color: var(--primary);
  }
}

.cta-pending {
  background: var(--surface-muted);
  color: var(--text-secondary);
  font-weight: 600;
  cursor: default;
}

@media (prefers-color-scheme: dark) {
  .cta-pending {
    background: var(--surface-muted);
    color: var(--text-secondary);
  }
}

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