/*
 * projyard.com and the help centre. No JavaScript: motion is CSS only, and everything here is served
 * from this folder (the CSP allows nothing else). Colours and fonts match the web app; see
 * docs/design-system.md.
 */

@font-face {
  font-family: 'Inter Variable';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/inter-latin-wght-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono Variable';
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url('/fonts/jetbrains-mono-latin-wght-normal.woff2') format('woff2');
}

/* ── Tokens ───────────────────────────────────────────────────────────────── */
:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --bg-subtle: #f7f8fa;
  --bg-hover: #eef0f3;
  --surface: #ffffff;
  --border: #dde1e6;
  --fg: #1c2128;
  --muted: #555e69;
  --accent: #0969da;
  --accent-hover: #0757b5;
  --accent-fg: #ffffff;
  --accent-soft: #eaf3fd;
  --success: #1a7f37;
  --warning: #8a5c00;
  --warning-bg: #fff6d1;
  --shadow-md: 0 4px 14px rgb(20 27 36 / 0.1);
  --shadow-lg: 0 24px 60px rgb(20 27 36 / 0.14);
  --font-ui: 'Inter Variable', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-code: 'JetBrains Mono Variable', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --ease-out: cubic-bezier(0.2, 0.9, 0.3, 1);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --bg-subtle: #11161e;
    --bg-hover: #212830;
    --surface: #161c25;
    --border: #2f3742;
    --fg: #e6edf3;
    --muted: #9da5ae;
    --accent: #58a6ff;
    --accent-hover: #79b8ff;
    --accent-fg: #08111c;
    --accent-soft: #132844;
    --success: #3fb950;
    --warning: #d29922;
    --warning-bg: #3b2e00;
    --shadow-md: 0 4px 14px rgb(0 0 0 / 0.45);
    --shadow-lg: 0 24px 60px rgb(0 0 0 / 0.5);
  }
}

/* ── Base ─────────────────────────────────────────────────────────────────── */
* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.65 var(--font-ui);
  overflow-wrap: break-word;
}
h1,
h2,
h3 {
  line-height: 1.25;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
a {
  color: var(--accent);
  text-underline-offset: 2px;
}
a:hover {
  color: var(--accent-hover);
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
main:focus {
  outline: none;
}
[id] {
  scroll-margin-top: 84px;
}
code {
  padding: 1px 5px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--bg-subtle);
  font: 0.87em var(--font-code);
}
kbd {
  padding: 0 6px;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--bg-subtle);
  font: 13px/1.6 var(--font-code);
}
hr {
  margin: 48px 0 20px;
  border: 0;
  border-top: 1px solid var(--border);
}
.icon {
  flex: none;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-tile {
  display: grid;
  flex: none;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
}
.skip {
  position: absolute;
  top: -56px;
  left: 8px;
  z-index: 20;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-fg);
  font-weight: 600;
  text-decoration: none;
}
.skip:hover {
  color: var(--accent-fg);
}
.skip:focus {
  top: 8px;
}
.wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}
body > .wrap,
body > main {
  flex: 1 0 auto;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-fg);
  font-weight: 600;
  text-decoration: none;
  transition:
    background-color 0.15s,
    border-color 0.15s,
    translate 0.15s var(--ease-out);
}
.btn:hover {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
  color: var(--accent-fg);
  translate: 0 -1px;
}
.btn:active {
  translate: 0 0;
}
.btn.secondary {
  border-color: var(--border);
  background: var(--surface);
  color: var(--fg);
}
.btn.secondary:hover {
  border-color: var(--accent);
  background: var(--bg-hover);
  color: var(--fg);
}

/* ── Header and footer ────────────────────────────────────────────────────── */
header.site {
  z-index: 10;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
header.site .wrap {
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  color: var(--fg);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.brand:hover {
  color: var(--fg);
}
.logo {
  width: 26px;
  height: 26px;
}
header.site nav {
  flex: 1;
}
header.site ul {
  display: flex;
  align-items: center;
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}
header.site nav a:not(.btn) {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.12s;
}
header.site nav a:not(.btn):hover,
header.site nav a[aria-current='page'] {
  color: var(--fg);
}
header.site nav a[aria-current='page'] {
  box-shadow: inset 0 -2px var(--accent);
}
.nav-signin {
  margin-left: auto;
}
header.site .btn {
  min-height: 36px;
  padding: 0 14px;
  font-size: 14px;
}
@media (min-width: 721px) {
  header.site {
    position: sticky;
    top: 0;
  }
}
/* Phones: the logo with the two actions on one line, the page links on the next. */
@media (max-width: 720px) {
  header.site .wrap {
    position: relative;
    display: block;
    padding: 12px 16px 6px;
  }
  .brand {
    position: absolute;
    top: 12px;
    left: 16px;
  }
  header.site ul {
    flex-wrap: wrap;
    column-gap: 18px;
    row-gap: 4px;
  }
  /* The actions come first, pushed right; the empty item after them starts the second line. */
  .nav-signin,
  .nav-cta {
    order: -1;
  }
  header.site ul::after {
    content: '';
    flex-basis: 100%;
    order: -1;
  }
  [id] {
    scroll-margin-top: 16px;
  }
}

footer.site {
  margin-top: 88px;
  padding: 28px 0 36px;
  border-top: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--muted);
  font-size: 14px;
}
footer.site .wrap {
  display: flex;
  flex-wrap: wrap-reverse;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
}
footer.site ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}
footer.site a {
  display: inline-block;
  padding: 4px 0;
  color: var(--muted);
  text-decoration: none;
}
footer.site a:hover {
  color: var(--fg);
  text-decoration: underline;
}
footer.site p {
  margin: 0;
}

/* ── Landing page ─────────────────────────────────────────────────────────── */
.section {
  padding-top: 96px;
}
.section > h2 {
  margin: 0 0 24px;
  font-size: clamp(24px, 3.4vw, 30px);
}
.section-lead {
  max-width: 44em;
  margin: -12px 0 28px;
  color: var(--muted);
}
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding-top: 80px;
  text-align: center;
}
.hero > * {
  margin: 0;
}
.badge {
  padding: 3px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}
.hero h1 {
  max-width: 17ch;
  font-size: clamp(32px, 6vw, 56px);
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.lead {
  color: var(--muted);
  font-size: 19px;
}
.hero .lead {
  max-width: 58ch;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.peek {
  padding-top: 64px;
  text-align: center;
}
.peek > h2 {
  margin-bottom: 8px;
  font-size: 22px;
}
.peek > p {
  max-width: 62ch;
  margin: 0 auto 28px;
  color: var(--muted);
  font-size: 15px;
}
figure {
  margin: 0;
}
figcaption {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  text-wrap: balance;
}
/* The example table, framed like a window of the app. */
.window {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  text-align: left;
}
.table-scroll {
  overflow-x: auto;
}
.window table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-size: 14px;
}
.window caption {
  padding: 11px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--muted);
  font: 500 12px/1.6 var(--font-code);
  text-align: left;
}
.window caption::before {
  content: '';
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 46px;
  border-radius: 50%;
  background: var(--border);
  box-shadow:
    15px 0 var(--border),
    30px 0 var(--border);
}
.window th,
.window td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.window tbody tr:last-child > * {
  border-bottom: 0;
}
.window thead th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.window th code {
  padding: 0;
  border: 0;
  background: none;
  font-size: 13px;
  font-weight: 500;
}
.window tbody tr {
  transition: background-color 0.15s;
}
.window tbody tr:hover {
  background: var(--bg-subtle);
}
.window td.is-set::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--success);
  vertical-align: 1px;
}
.window td.is-off {
  color: var(--muted);
}
.window td.gap {
  background: var(--warning-bg);
  color: var(--fg);
  font-weight: 600;
}

.pains,
.cards,
.steps,
.roles {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.pains {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
}
.pains li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-subtle);
}
.pains .icon-tile {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
}
.pains p {
  margin: 0;
}
.after {
  max-width: 44em;
  margin: 20px 0 0;
  color: var(--muted);
}

.cards {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  transition:
    border-color 0.18s,
    box-shadow 0.18s,
    translate 0.18s var(--ease-out);
}
.card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  translate: 0 -3px;
}
.card h2,
.card h3 {
  margin: 4px 0 0;
  font-size: 17px;
}
.card p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.steps {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
  gap: 28px;
  counter-reset: step;
}
.steps li {
  padding-top: 16px;
  border-top: 2px solid var(--accent);
  counter-increment: step;
}
.steps li::before {
  content: '0' counter(step);
  color: var(--accent);
  font: 600 13px var(--font-code);
}
.steps h3 {
  margin: 4px 0 6px;
  font-size: 17px;
}
.steps p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}
.more {
  margin: 24px 0 0;
  font-weight: 500;
}

.roles {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
}
.roles li {
  display: flex;
  gap: 14px;
}
.roles h3 {
  margin: 8px 0 4px;
  font-size: 16px;
}
.roles p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-top: 96px;
  padding: 52px 24px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-subtle);
  text-align: center;
}
.cta > * {
  margin: 0;
}
.cta h2 {
  font-size: clamp(24px, 3.4vw, 30px);
}
.cta p {
  max-width: 56ch;
  color: var(--muted);
}
.cta .fine {
  max-width: 68ch;
  font-size: 13px;
}

/* ── Text pages: security, privacy, terms, help ───────────────────────────── */
main.doc {
  max-width: 46em;
  margin: 0 auto;
  padding-top: 48px;
}
main.doc h1 {
  margin: 0 0 6px;
  font-size: clamp(28px, 4.4vw, 38px);
  letter-spacing: -0.025em;
}
main.doc h2 {
  margin: 44px 0 10px;
  font-size: 21px;
}
main.doc h3 {
  margin: 28px 0 6px;
  font-size: 17px;
}
main.doc li {
  margin-bottom: 6px;
}
main.doc li::marker {
  color: var(--muted);
}
.meta {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 14px;
}
main.doc table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14.5px;
}
main.doc caption {
  padding-bottom: 8px;
  font-weight: 600;
  text-align: left;
}
main.doc th,
main.doc td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
main.doc th {
  background: var(--bg-subtle);
}
main.doc thead th {
  font-size: 13px;
}
main.doc thead th:first-child {
  border-top-left-radius: 9px;
}
main.doc thead th:last-child {
  border-top-right-radius: 9px;
}
main.doc tbody tr:last-child > * {
  border-bottom: 0;
}
main.doc tbody tr:last-child > :first-child {
  border-bottom-left-radius: 9px;
}
main.doc > table,
main.doc .table-scroll {
  margin: 16px 0;
}
main.notfound {
  padding-top: 96px;
  text-align: center;
}
main.notfound .actions {
  margin-top: 28px;
}

/* ── Help centre (PY-083) ─────────────────────────────────────────────────── */
.help-layout {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  align-content: start;
  align-items: start;
  gap: 0 48px;
}
.help-layout main.doc {
  width: 100%;
  margin: 0;
  padding-top: 40px;
}
.help-nav,
.toc {
  position: sticky;
  top: 64px;
  max-height: calc(100vh - 64px);
  padding: 40px 0 16px;
  overflow-y: auto;
}
.help-nav ul,
.toc ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.help-nav a,
.toc a {
  display: block;
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
  transition:
    background-color 0.12s,
    color 0.12s;
}
.help-nav a {
  padding: 7px 12px;
  border-radius: 8px;
}
.help-nav a:hover {
  background: var(--bg-hover);
  color: var(--fg);
}
.help-nav a[aria-current='page'] {
  background: var(--accent-soft);
  color: var(--fg);
  font-weight: 600;
}
.toc {
  display: none;
}
.toc p {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.toc a {
  padding: 4px 0 4px 12px;
  border-left: 2px solid var(--border);
  line-height: 1.45;
}
.toc a:hover {
  border-left-color: var(--accent);
  color: var(--fg);
}
@media (min-width: 1100px) {
  .help-layout.has-toc {
    grid-template-columns: 15rem minmax(0, 1fr) 13rem;
    gap: 0 40px;
  }
  .toc {
    display: block;
  }
}
.help-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  margin-top: 28px;
}
.help-grid .card h2 {
  margin: 4px 0 0;
  font-size: 17px;
}
.help-grid h2 a {
  color: var(--fg);
  text-decoration: none;
}
/* The whole card is the link; the focus ring goes round the card. */
.help-grid h2 a::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 12px;
}
.help-grid h2 a:focus-visible {
  outline: none;
}
.help-grid h2 a:focus-visible::after {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.pager {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 40px;
}
.pager a {
  flex: 1 1 200px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--fg);
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.15s;
}
.pager a:hover {
  border-color: var(--accent);
  color: var(--fg);
}
.pager span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}
.pager .next {
  margin-left: auto;
  text-align: right;
}
@media (max-width: 760px) {
  .wrap {
    padding: 0 16px;
  }
  .section {
    padding-top: 64px;
  }
  .hero {
    padding-top: 44px;
  }
  .peek {
    padding-top: 48px;
  }
  .lead {
    font-size: 17px;
  }
  .cta {
    margin-top: 64px;
  }
  footer.site {
    margin-top: 56px;
  }
  .help-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .help-nav {
    position: static;
    max-height: none;
    padding: 14px 0 0;
    overflow: visible;
  }
  .help-nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  .help-nav a {
    padding: 5px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 13px;
  }
  .help-layout main.doc {
    padding-top: 28px;
  }
}

/* On a phone the example table fits the screen, so the missing variable is seen without scrolling. */
@media (max-width: 560px) {
  .window table {
    min-width: 0;
    font-size: 12px;
  }
  .window caption {
    padding: 10px 10px;
    font-size: 11px;
  }
  .window caption::before {
    content: none;
  }
  .window th,
  .window td {
    padding: 10px 6px;
    vertical-align: top;
  }
  .window tr > :first-child {
    padding-left: 10px;
  }
  .window th code {
    font-size: 10.5px;
    overflow-wrap: anywhere;
  }
  .window tbody th {
    width: 34%;
  }
  /* No room for the dot: the word says it. */
  .window td.is-set::before {
    content: none;
  }
  main.doc th,
  main.doc td {
    padding: 8px 9px;
    font-size: 13.5px;
  }
}

/* ── Motion ───────────────────────────────────────────────────────────────── */
@keyframes rise {
  from {
    opacity: 0;
    translate: 0 16px;
  }
}
@media screen and (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
  .rise {
    animation: rise 0.6s var(--ease-out) both;
  }
  .d1 {
    animation-delay: 0.08s;
  }
  .d2 {
    animation-delay: 0.16s;
  }
  .d3 {
    animation-delay: 0.26s;
  }
  main.doc {
    animation: rise 0.4s var(--ease-out) both;
  }
  /* Where the browser can tie animation to scrolling, blocks rise as they come into view. */
  @supports (animation-timeline: view()) {
    .reveal {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 45%;
    }
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
