/* The site's whole stylesheet. No framework, no build step, no dependency.
 *
 * # Why it borrows the app's palette rather than inventing one
 *
 * Somebody who reads this page then opens the product should not feel they changed company. The values
 * below are lifted from `crates/app/ui/app.css` in the engine repository, and the palette rule from
 * there travels with them and is worth restating because it is unusual and load-bearing:
 *
 *   red is audio live, amber is look-at-this, and **fine is not a colour**.
 *
 * So there is no green anywhere on this site either. A "success" state is stated in words. `palette.
 * test.js` enforces that in the product; here it is a convention, and the reason it holds is that
 * nothing on these pages is a status.
 */

:root {
  --hue: 210;
  --ink1: #14150f;
  --ink2: #4a4c44;
  --ink3: #a9aaa2;
  --page: #fbfbfa;
  --card: #fff;
  --hair: #e6e4dd;
  --hair-soft: #efedE7;
  --warn: #9a6b12;
  --live: #a1231b;
  --measure: 34rem;
}

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

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

body {
  margin: 0;
  background: var(--page);
  color: var(--ink1);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  letter-spacing: -0.003em;
}

/* Skip link. Present on every page, because a keyboard user should not have to walk the header on
   each one. Visible only when focused, which is the one place a hidden control must appear. */
.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink1); color: #fff; padding: 10px 16px; z-index: 10;
  border-radius: 0 0 6px 0;
}
.skip:focus { left: 0; }

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

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

header.site {
  border-bottom: 1px solid var(--hair);
  background: rgba(251, 251, 250, 0.94);
  backdrop-filter: blur(6px);
  position: sticky; top: 0; z-index: 5;
}
header.site .wrap { display: flex; align-items: center; gap: 1.5rem; height: 60px; }

.brand {
  font-weight: 700; letter-spacing: -0.02em; font-size: 1.05rem;
  text-decoration: none; color: var(--ink1); flex: none;
}
.brand span { color: var(--ink3); font-weight: 400; }

nav.site { margin-left: auto; display: flex; gap: 1.25rem; flex-wrap: wrap; }
nav.site a { color: var(--ink2); text-decoration: none; font-size: 0.92rem; }
nav.site a:hover, nav.site a:focus-visible { color: var(--ink1); text-decoration: underline; }

/* ------------------------------------------------------------------ content */

main { padding: 3.5rem 0 5rem; }

h1 { font-size: 2.35rem; line-height: 1.14; letter-spacing: -0.028em; margin: 0 0 1rem; font-weight: 700; }
h2 { font-size: 1.3rem; line-height: 1.3; letter-spacing: -0.018em; margin: 2.75rem 0 0.75rem; }
h3 { font-size: 1.02rem; margin: 1.75rem 0 0.4rem; }
p { margin: 0 0 1rem; color: var(--ink2); }
p.lead { font-size: 1.14rem; color: var(--ink1); }
a { color: hsl(var(--hue) 52% 36%); }

ul.plain { list-style: none; padding: 0; margin: 0 0 1rem; }
ul.plain li { padding: 0.45rem 0 0.45rem 1.5rem; position: relative; color: var(--ink2); }
ul.plain li::before {
  content: ''; position: absolute; left: 0.25rem; top: 1.1em;
  width: 6px; height: 1px; background: var(--ink3);
}

code, kbd, .mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
}
code { background: #f4f3ef; padding: 0.1em 0.35em; border-radius: 3px; }

/* --------------------------------------------------------------- the button */

.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--ink1); color: #fff; text-decoration: none;
  border: 1px solid var(--ink1); border-radius: 7px;
  padding: 0.65rem 1.15rem; font-size: 0.97rem; font-weight: 600;
  cursor: pointer;
}
.btn:hover { background: #000; }
.btn.quiet { background: #fff; color: var(--ink1); }
.btn.quiet:hover { background: #f4f3ef; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }

/* Focus is never removed. `crates/app/ui/tests/palette.test.js` asserts this in the product and the
   reasoning carries: a control you cannot see the focus of is a control a keyboard cannot use. */
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 2px solid hsl(var(--hue) 60% 45%);
  outline-offset: 2px;
}

/* ----------------------------------------------------------------- surfaces */

.card {
  background: var(--card); border: 1px solid var(--hair);
  border-radius: 10px; padding: 1.4rem 1.5rem; margin: 0 0 1rem;
}

.note {
  border-left: 3px solid var(--warn);
  background: #fdfaf3; padding: 0.9rem 1.1rem; border-radius: 0 6px 6px 0;
  margin: 1.5rem 0; color: var(--ink2); font-size: 0.95rem;
}
.note strong { color: var(--ink1); }

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

/* -------------------------------------------------------------- the licence */

/* A licence is long and a customer has to select all of it. `readonly` rather than disabled so it
   stays selectable, monospace so a transcription error is visible, and wrapping so nothing is hidden
   off the right-hand edge. Same reasoning the app's Card row follows when it clips instead of
   truncating. */
textarea.licence {
  width: 100%; min-height: 7.5rem; resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem; line-height: 1.5;
  padding: 0.8rem; border: 1px solid var(--hair); border-radius: 7px;
  background: #fcfcfb; color: var(--ink1);
  word-break: break-all;
}

.status { font-size: 0.95rem; color: var(--ink2); margin: 1rem 0; min-height: 1.6em; }
.status[data-state='working']::before { content: '… '; }
/* Amber is look-at-this. There is no green counterpart, deliberately: a licence that worked says so
   in words and carries no hue at all. */
.status[data-state='failed'] { color: var(--live); }
.status[data-state='warn'] { color: var(--warn); }

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

footer.site {
  border-top: 1px solid var(--hair);
  padding: 2rem 0 3rem; color: var(--ink3); font-size: 0.87rem;
}
footer.site .wrap { display: flex; gap: 1.25rem; flex-wrap: wrap; align-items: baseline; }
footer.site a { color: var(--ink3); }
footer.site a:hover { color: var(--ink2); }
footer.site .spacer { margin-left: auto; }

/* -------------------------------------------------------------- small print */

table.plans { width: 100%; border-collapse: collapse; margin: 1rem 0 2rem; font-size: 0.95rem; }
table.plans th, table.plans td {
  text-align: left; padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--hair-soft);
  vertical-align: top;
}
table.plans th { color: var(--ink1); font-weight: 600; }
table.plans td { color: var(--ink2); }

dl.terms dt { font-weight: 600; margin-top: 1.25rem; }
dl.terms dd { margin: 0.3rem 0 0; color: var(--ink2); }

@media (max-width: 40rem) {
  h1 { font-size: 1.85rem; }
  header.site .wrap { height: auto; padding: 0.75rem 1.5rem; flex-wrap: wrap; gap: 0.75rem; }
  nav.site { margin-left: 0; width: 100%; }
}

/* Respected rather than assumed, matching the product's `follow.motionAllowed`. */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
