/* The static pages of ergoda.com: Terms, Privacy, DPA, Legal, the docs and
   the 404, written by scripts/build_site.py. Plain HTML, in the React site's
   design (web/DESIGN.md): three colours on white, Satoshi at two sizes, the
   1240px frame with its corner squares and thread, the menu button. The one
   script is /docs/copy.js, the docs' Copy buttons. The values are the tokens
   in src/index.css; change both. */

@font-face { font-family: "Satoshi"; src: url("/fonts/Satoshi-Variable.woff2") format("woff2"); font-weight: 300 900; font-display: swap; }

:root {
  --ink: #0b0d10;
  --muted: #3f4652;
  --border: #d9e7f4;
  --ice: #cfe6f9;
  --ice-soft: #f1f8fe;
  --deep: #0c3b8c;
  --t: clamp(2.5rem, 5.4vw, 4.6rem);
  color-scheme: light only;
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: clamp(17px, 1.35vw, 20.5px); line-height: 1.5; -webkit-font-smoothing: antialiased; overflow-x: clip; }
body { margin: 0; background: #fff; color: var(--ink); font-family: "Satoshi", ui-sans-serif, system-ui, sans-serif; font-size: 1rem; }
::selection { background: var(--ice); color: var(--ink); }
a { color: var(--deep); font-weight: 600; text-underline-offset: 4px; text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--deep); outline-offset: 2px; }
h1, h2, h3, p, ul, ol { margin: 0; }
/* A long word in a display heading (Troubleshooting, with the text enlarged) wraps rather than leaving the screen. */
h1 { overflow-wrap: anywhere; hyphens: auto; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 60; background: #fff; padding: .5rem 1rem; }

/* ------------------------------------------------------------- the bar */
.bar { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .9); backdrop-filter: blur(24px); border-bottom: 1px solid var(--border); }
.bar-in { max-width: 1240px; margin: 0 auto; height: 4.5rem; padding: 0 1.5rem; display: flex; align-items: center; justify-content: space-between; }
.logo { display: inline-flex; align-items: center; gap: .6rem; color: var(--ink); font-weight: 700; letter-spacing: -0.01em; }
.logo:hover { text-decoration: none; }
.mark { width: 1.25rem; height: 1.25rem; background: url("/brand/ergoda-mark.svg") center / contain no-repeat; }
.bar-end { display: flex; align-items: center; gap: .75rem; }
.cta { display: inline-flex; align-items: center; height: 2.75rem; padding: 0 1.25rem; border-radius: 999px; background: var(--deep); color: #fff; font-weight: 600; transition: background-color .3s, color .3s; }
.cta:hover { background: var(--ice); color: var(--ink); text-decoration: none; }
.cta.wide { display: none; }
@media (min-width: 640px) { .cta.wide { display: inline-flex; } .menu-cta { display: none; } }

/* The menu button: two lines that turn into an x, and a panel inside the frame. */
.menu summary { list-style: none; position: relative; display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--border); cursor: pointer; }
.menu summary::-webkit-details-marker { display: none; }
.menu summary:hover { background: var(--ice); }
.menu summary span { position: absolute; width: 1.25rem; height: 2px; border-radius: 2px; background: var(--ink); transition: transform .35s cubic-bezier(.16, 1, .3, 1); }
.menu summary span:first-child { transform: translateY(-3.5px); }
.menu summary span:last-child { transform: translateY(3.5px); }
.menu[open] summary span:first-child { transform: rotate(45deg); }
.menu[open] summary span:last-child { transform: rotate(-45deg); }
.menu nav { position: absolute; left: 0; right: 0; top: 4.5rem; max-width: 1240px; margin: 0 auto; background: #fff; border: 1px solid var(--border); border-top: 0; }
/* A closed menu's panel still takes layout in Chrome and widened the page. */
.menu:not([open]) nav { display: none; }
.menu ul { list-style: none; padding: 0; }
.menu li + li { border-top: 1px solid var(--border); }
.menu li a { display: grid; gap: .5rem; padding: 1.5rem; color: var(--ink); font-weight: 400; }
.menu li a:hover { background: var(--ice-soft); text-decoration: none; }
.menu li a[aria-current="page"] { box-shadow: inset 4px 0 0 var(--deep); }
.menu li a span:last-child { color: var(--muted); }
.menu-cta { display: grid; place-items: center; padding: 1rem; border-top: 1px solid var(--border); }
@media (min-width: 768px) { .menu li a { grid-template-columns: 1fr 1fr; align-items: center; gap: 2.5rem; padding: 1.75rem 3rem; } }

/* ----------------------------------------------------------- the frame */
.frame { position: relative; max-width: 1240px; margin: 0 auto; border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
.t, h1, .menu .t { font-size: var(--t); line-height: 1; letter-spacing: -0.045em; font-weight: 700; }
/* A border that meets the frame gets a small square at each end. */
.rule { position: relative; border-top: 1px solid var(--border); }
.rule::before, .rule::after { content: ""; position: absolute; top: -5px; width: 9px; height: 9px; border: 1px solid var(--border); background: #fff; z-index: 2; }
.rule::before { left: -5px; }
.rule::after { right: -5px; }

/* The thread down the frame's left edge fills with scroll, where the browser
   can drive it without a script; only then is the scrollbar hidden. */
@supports (animation-timeline: scroll()) {
  .frame::before { content: ""; position: absolute; top: 0; bottom: 0; left: -1px; width: 2px; background: var(--deep); transform-origin: top; animation: thread linear both; animation-timeline: scroll(root); z-index: 3; }
  .frame::after { content: ""; position: absolute; left: -6px; width: 12px; height: 12px; margin-top: -6px; background: var(--deep); rotate: 45deg; box-shadow: 0 0 0 5px rgba(12, 59, 140, .15); animation: thread-head linear both; animation-timeline: scroll(root); z-index: 3; }
  html { scrollbar-width: none; }
  html::-webkit-scrollbar { display: none; }
}
/* The head and the corner squares straddle the 1240px frame, which below 1250px
   is the screen's edge; they show where there is a margin for their other half. */
@media (max-width: 1249px) { .frame::after, .rule::before, .rule::after { display: none; } }
@keyframes thread { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes thread-head { from { top: 0; } to { top: 100%; } }

.head { display: grid; gap: 1.5rem; padding: 2.5rem 1.5rem 4rem; }
.lede { max-width: 40rem; color: var(--muted); }
@media (min-width: 768px) { .head { padding: 3rem 3rem 6rem; } .bar-in { padding: 0 3rem; } }

/* ------------------------------------------------------------ documents */
.doc { display: grid; grid-template-columns: minmax(0, 1fr); }
.rail { display: none; }
@media (min-width: 768px) {
  .doc { grid-template-columns: 15rem minmax(0, 1fr); }
  .rail { display: block; border-right: 1px solid var(--border); }
  /* A page with no contents (/legal/subprocessors/) has no rail: the article takes the row. */
  .doc > article:first-child { grid-column: 1 / -1; }
  .rail ol { position: sticky; top: 6rem; list-style: none; margin: 0; padding: 2rem 1rem; display: grid; gap: .125rem; max-height: calc(100vh - 7rem); overflow-y: auto; }
  .rail a { display: grid; grid-template-columns: 1.8rem minmax(0, 1fr); padding: .375rem .5rem; border-radius: .5rem; color: var(--muted); font-weight: 400; line-height: 1.375; }
  .rail a:hover { background: var(--ice-soft); color: var(--ink); text-decoration: none; }
  .rail .n { color: var(--deep); font-weight: 700; }
}
article { min-width: 0; padding: 3rem 1.5rem 4rem; display: grid; gap: 1.25rem; align-content: start; }
@media (min-width: 768px) { article { padding: 4rem 3rem 6rem; } }
article > * { max-width: 46rem; }
article p, article li { color: var(--muted); }
article strong { color: var(--ink); font-weight: 600; }
article h2, article h3 { font-size: 1rem; font-weight: 700; color: var(--ink); margin-top: 1.5rem; scroll-margin-top: 6rem; }
article h2.annex { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--border); }
article hr { width: 100%; border: 0; border-top: 1px solid var(--border); margin: 1rem 0; }
article ul { list-style: none; padding: 0; display: grid; gap: .75rem; }
article ul li { position: relative; padding-left: 1.75rem; }
article ul li::before { content: ""; position: absolute; left: 0; top: .5rem; width: .6rem; height: .6rem; background: var(--deep); rotate: 45deg; }
article ol { padding-left: 1.5rem; display: grid; gap: .75rem; }
article ol li::marker { color: var(--deep); font-weight: 700; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; color: var(--deep); background: var(--ice-soft); border-radius: .375rem; padding: .1em .35em; box-shadow: inset 0 0 0 1px var(--border); overflow-wrap: anywhere; }
/* A code block wears the terminal's chrome, as the site's code windows do. */
pre { position: relative; margin: 0; padding: 1rem 1.25rem 1.1rem; border-radius: 1rem; background: #1b1c1f; color: #e8e6e1; box-shadow: 0 30px 60px -30px rgba(6, 26, 68, .7); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; }
pre::before { content: ""; display: block; width: .75rem; height: .75rem; margin-bottom: 1rem; border-radius: 50%; background: #ff5f57; box-shadow: 1.25rem 0 #febc2e, 2.5rem 0 #28c840; }
pre code { background: none; box-shadow: none; padding: 0; color: inherit; font-size: .9em; }
/* About fifty columns on a phone, so ordinary lines of code do not break mid-word. */
@media (max-width: 639px) { pre { font-size: .85rem; padding: 1rem; } }
/* Copy, added by /docs/copy.js in the traffic lights' row so it never covers
   the code; the same button as the React code windows' (components/site/doc.tsx). */
pre .copy { position: absolute; top: .5rem; right: .75rem; height: 1.75rem; padding: 0 .625rem; border: 0; border-radius: .375rem; background: rgba(255, 255, 255, .1); color: rgba(255, 255, 255, .8); font: 600 1rem/1 "Satoshi", ui-sans-serif, system-ui, sans-serif; cursor: pointer; transition: background-color .2s, color .2s; }
pre .copy:hover { background: rgba(255, 255, 255, .2); color: #fff; }
pre .copy.done { background: var(--ice); color: var(--ink); }
pre .copy:focus-visible { outline-color: var(--ice); }
.table-wrap { overflow-x: auto; border-radius: 1rem; box-shadow: inset 0 0 0 1px var(--border); }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { background: var(--ice-soft); font-weight: 600; padding: .75rem 1rem; }
td { padding: .75rem 1rem; border-top: 1px solid var(--border); vertical-align: top; color: var(--muted); }
td:first-child { color: var(--ink); font-weight: 600; }
/* In a column narrower than 36rem (a phone, or a tablet beside the contents
   rail) a row is a card: its first cell is the title, and every other cell
   shows its column's name (data-label, scripts/build_site.py) above the value,
   so no column is ever off the edge of the screen. */
article { container-type: inline-size; }
@container (max-width: 36rem) {
  .table-wrap { overflow: visible; border-radius: 0; box-shadow: none; display: grid; gap: .75rem; }
  .table-wrap table, .table-wrap tbody, .table-wrap tr, .table-wrap td { display: block; }
  .table-wrap tbody { display: grid; gap: .75rem; }
  .table-wrap thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .table-wrap tr { border-radius: 1rem; box-shadow: inset 0 0 0 1px var(--border); overflow: hidden; }
  .table-wrap td { border-top: 0; padding: .5rem 1rem; }
  .table-wrap td:first-child { background: var(--ice-soft); padding: .75rem 1rem; border-bottom: 1px solid var(--border); }
  .table-wrap td + td { padding-top: .75rem; }
  .table-wrap td:last-child { padding-bottom: 1rem; }
  .table-wrap td:not(:first-child)::before { content: attr(data-label); display: block; margin-bottom: .125rem; color: var(--ink); font-size: .85em; font-weight: 600; }
}

/* ------------------------------------------------------------- lists of pages */
.rows { list-style: none; margin: 0; padding: 0; }
.rows li + li { border-top: 1px solid var(--border); }
.rows a { display: grid; gap: .5rem; padding: 1.75rem 1.5rem; color: var(--ink); font-weight: 400; }
.rows a:hover { background: var(--ice-soft); text-decoration: none; }
.rows .name { font-weight: 700; color: var(--deep); }
.rows a span:last-child { color: var(--muted); }
@media (min-width: 768px) { .rows a { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 2.5rem; padding: 2rem 3rem; } }

/* ------------------------------------------------------------- the docs */
/* Every docs page lists every docs page. On a wide screen the list heads the
   left column, above the page's own rail; on a phone, where the column is
   hidden, the same list opens from a bar above the text. */
.label { color: var(--ink); font-weight: 700; }
.docs-nav { display: grid; gap: .25rem; }
.docs-nav > .label { padding: .375rem .5rem; }
.docs-nav > .label:hover { color: var(--deep); text-decoration: none; }
.docs-nav ol { list-style: none; margin: 0; padding: 0; display: grid; gap: .125rem; }
.docs-nav ol a { display: block; padding: .375rem .5rem .375rem .75rem; color: var(--muted); font-weight: 400; line-height: 1.375; }
.docs-nav ol a:hover { background: var(--ice-soft); color: var(--ink); text-decoration: none; }
.docs-nav ol a[aria-current="page"] { background: var(--ice-soft); color: var(--ink); font-weight: 600; box-shadow: inset 3px 0 0 var(--deep); }
.side-in { display: none; }
.docs-pick summary { list-style: none; display: flex; align-items: center; gap: .75rem; padding: 1rem 1.5rem; border-bottom: 1px solid var(--border); cursor: pointer; }
.docs-pick summary::-webkit-details-marker { display: none; }
.docs-pick summary::after { content: ""; flex: none; margin-left: auto; width: .55rem; height: .55rem; border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); translate: 0 -.15rem; rotate: 45deg; transition: rotate .35s cubic-bezier(.16, 1, .3, 1), translate .35s cubic-bezier(.16, 1, .3, 1); }
.docs-pick[open] summary::after { translate: 0 .15rem; rotate: 225deg; }
.docs-pick summary:hover { background: var(--ice-soft); }
.docs-pick .here { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.docs-pick .docs-nav { padding: .75rem 1rem 1rem; border-bottom: 1px solid var(--border); }
@media (min-width: 768px) {
  .docs-pick { display: none; }
  .side { border-right: 1px solid var(--border); }
  .side-in { position: sticky; top: 6rem; display: grid; gap: .25rem; align-content: start; max-height: calc(100vh - 7rem); overflow-y: auto; padding: 2rem 1rem; }
  .side-in > .label { margin-top: 1.75rem; padding: .375rem .5rem; }
  .side .rail { display: block; border-right: 0; }
  .side .rail ol { position: static; max-height: none; overflow: visible; padding: 0; }
  .side .rail a { border-radius: 0; }
}

/* The docs index: a card per page, in reading order, cells sharing borders. */
.cards { list-style: none; margin: 0; padding: 0; display: grid; }
.cards li + li { border-top: 1px solid var(--border); }
.cards a { display: grid; gap: .5rem; align-content: start; height: 100%; padding: 2rem 1.5rem; color: var(--ink); font-weight: 400; }
.cards a:hover { background: var(--ice-soft); text-decoration: none; }
.cards .n { color: var(--deep); font-weight: 700; }
.cards .name { font-weight: 700; }
.cards a span:last-child { color: var(--muted); }
@media (min-width: 768px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cards li + li { border-top: 0; }
  .cards li:nth-child(n + 3) { border-top: 1px solid var(--border); }
  .cards li:nth-child(odd) { border-right: 1px solid var(--border); }
  .cards a { padding: 2.5rem 3rem 3rem; }
}

/* ------------------------------------------------------------- footer */
footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem 2rem; padding: 2rem 1.5rem; color: var(--muted); }
footer nav { display: flex; flex-wrap: wrap; gap: 1.5rem; }
footer a { color: var(--muted); font-weight: 400; }
footer a:hover { color: var(--deep); text-decoration: none; }
@media (min-width: 768px) { footer { padding: 2rem 3rem; } }
