/*
 * The presentation part of the front page (index.html, STASK-1269, specification STASK-1268): what STask is, below
 * and beside the sign-in card. The look of the login page and of Clean (login.css: its colours, the system font,
 * light and dark by the system); only the layout is the one of a landing page. html.alone: the card alone, centred.
 */
:root {
  --teal: #0f6f68;
  --raised: #ffffff;
  --code-bg: #1f2328;
  --code-ink: #e6edf3;
  --code-ink2: #b1bac4;
  --light-only: block;
  --dark-only: none;
}
@media (prefers-color-scheme: dark) {
  :root {
    --teal: #45d0bd;
    --raised: #0d1117;
    --code-bg: #0d1117;
    --light-only: none;
    --dark-only: block;
  }
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body.front { display: block; min-height: 0; padding: 0; place-items: normal; align-content: normal; font-size: 15px; line-height: 1.55; }
/* the presentation part sets its own spacing; the card keeps the one of login.css */
.pres :where(h1, h2, h3, p, ul, ol, dl, dd, figure, table) { margin: 0; padding: 0; }
.pres ul, .pres ol { list-style: none; }
.front img { display: block; max-width: 100%; height: auto; }
.front a { text-underline-offset: 0.18em; }
.front [hidden] { display: none !important; }
.front :focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 4px; }
.front input:focus-visible { outline: 2px solid var(--blue); outline-offset: -1px; border-radius: var(--radius); }
.mono { font-family: ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, Consolas, monospace; font-size: 0.92em; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 16px; top: -64px; z-index: 10; padding: 10px 16px; background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); }
.skip:focus { top: 16px; }

.wrap { max-width: 1160px; margin-inline: auto; padding-inline: clamp(16px, 4vw, 40px); }
.band { padding-block: clamp(56px, 8vw, 104px); }
.band.raised { background: var(--raised); border-block: 1px solid var(--line); }
.front h2 { font-size: clamp(26px, 3.4vw, 38px); line-height: 1.12; font-weight: 700; letter-spacing: -0.02em; max-width: 20ch; text-wrap: balance; }
.front h3 { font-size: 18px; line-height: 1.25; font-weight: 650; }
.lead { font-size: clamp(16px, 1.5vw, 19px); line-height: 1.5; color: var(--ink-2); max-width: 640px; margin-top: 18px; text-wrap: pretty; }

.btn { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 18px; border: 1px solid transparent; border-radius: var(--radius); font-weight: 600; font-size: 15px; line-height: 1.2; text-decoration: none; }
.btn.primary { background: var(--blue); color: var(--on-blue); }
.btn.primary:hover { background: color-mix(in srgb, var(--blue) 86%, var(--ink)); }
.btn.quiet { border-color: var(--field-line); color: var(--ink); }
.btn.quiet:hover { border-color: var(--ink); }

/* ---- the bar at the top: logo, sections, language ---- */
.top { padding-block: 14px; }
.top .wrap { display: flex; align-items: center; gap: 28px; }
.front .brand { margin: 0; font-size: 20px; }
.top nav { margin-left: auto; }
.top nav ul { display: flex; gap: 24px; }
.top nav a { display: inline-flex; align-items: center; min-height: 28px; color: var(--ink-2); text-decoration: none; font-weight: 500; }
.top nav a:hover { color: var(--ink); text-decoration: underline; }
.top .lang { display: inline-flex; }
@media (max-width: 900px) {
  .top nav { display: none; }
  .top .lang { margin-left: auto; }
}

/* ---- the hero: the claim and the sign-in card ---- */
.hero { padding-block: clamp(24px, 4vw, 56px) clamp(48px, 7vw, 96px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 400px); gap: clamp(28px, 5vw, 72px); align-items: center; }
.front h1 { font-size: clamp(34px, 5.4vw, 64px); line-height: 1.02; font-weight: 750; letter-spacing: -0.035em; max-width: 13ch; text-wrap: balance; }
.hero .lead { margin-top: 22px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.front .card { font-size: 14px; line-height: 1.5; scroll-margin-top: 16px; }
.front .card .card-title { font-size: 18px; line-height: 1.5; font-weight: 700; letter-spacing: 0; max-width: none; margin: 0 0 6px; }
.front .card h2:not(.card-title) { font-size: 16px; line-height: 1.5; letter-spacing: 0; margin: 18px 0 6px; }
@media (max-width: 900px) {
  /* a phone: the sign-in first, then the claim */
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-grid .card { order: -1; justify-self: center; }
}

/* the card alone: the steps after signing in and the first setup of an installation */
html.alone .pres { display: none; }
html.alone body.front { min-height: 100vh; display: grid; grid-template-rows: auto 1fr; place-items: stretch; align-content: stretch; }
html.alone .hero { padding-block: 16px 48px; display: grid; align-items: center; }
html.alone .hero-grid { grid-template-columns: minmax(0, 400px); justify-content: center; }
html.alone main { display: grid; }

/* the trace: five records of the demo project and their events in the hash chain */
.trace { margin-top: clamp(40px, 5vw, 60px); background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.trace-head { display: flex; justify-content: space-between; gap: 16px; padding: 14px clamp(16px, 2.4vw, 28px); border-bottom: 1px solid var(--line); color: var(--ink-2); font-size: 14px; }
.trace-head b { color: var(--ink); font-weight: 600; }
.records { display: grid; grid-template-columns: repeat(5, 1fr); padding: 34px clamp(16px, 2.4vw, 28px) 30px; }
.records li { position: relative; padding: 30px 20px 0 0; min-width: 0; --c: var(--blue); }
.records li.work { --c: var(--teal); }
.records li.proof { --c: var(--green); }
.records li::before { content: ''; position: absolute; left: 0; top: 0; width: 13px; height: 13px; border-radius: 50%; background: var(--c); }
.records li::after { content: ''; position: absolute; left: 13px; right: 0; top: 5.5px; height: 2px; background: var(--line); transform-origin: left; }
.records li:last-child::after { display: none; }
.records .rel { position: absolute; z-index: 1; top: 6.5px; left: calc(-50% + 6px); transform: translate(-50%, -50%); padding: 0 8px; background: var(--panel); color: var(--ink-2); font-size: 13px; font-weight: 500; white-space: nowrap; }
.records .kind { display: block; color: var(--c); font-size: 13px; font-weight: 700; }
.records .key { display: block; margin-top: 2px; color: var(--ink-2); }
.records .what { display: block; margin-top: 5px; font-weight: 600; line-height: 1.3; text-wrap: balance; }
.records .state { display: block; margin-top: 9px; color: var(--ink-2); font-size: 14px; }
.records .state b { color: var(--c); font-weight: 600; }

.log { width: 100%; border-collapse: collapse; border-top: 1px solid var(--line); background: var(--bg); font-size: 14px; }
.log th, .log td { padding: 9px 12px; text-align: left; vertical-align: baseline; }
.log th:first-child, .log td:first-child { padding-left: clamp(16px, 2.4vw, 28px); }
.log th:last-child, .log td:last-child { padding-right: clamp(16px, 2.4vw, 28px); }
.log thead th { padding-top: 14px; color: var(--ink-2); font-size: 13px; font-weight: 500; }
.log tbody tr { border-top: 1px solid var(--line); }
.log .prev { color: var(--ink-2); }
.log tfoot td { padding-block: 13px 16px; border-top: 1px solid var(--line); color: var(--green); }
.log tfoot b { font-weight: 600; }
.log tfoot svg { width: 17px; height: 17px; margin-right: 7px; vertical-align: -3px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.log tfoot span { color: var(--ink-2); }

/* the one animation of the page: the trace builds up once after loading */
@keyframes arrive { from { opacity: 0; transform: translateY(8px); } }
@keyframes draw { from { transform: scaleX(0); } }
@keyframes show { from { opacity: 0; } }
.records li { animation: arrive 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both; animation-delay: calc(0.25s + var(--n) * 0.34s); }
.records li::after { animation: draw 0.34s ease-out both; animation-delay: calc(0.5s + var(--n) * 0.34s); }
.records li:nth-child(1) { --n: 0; }
.records li:nth-child(2) { --n: 1; }
.records li:nth-child(3) { --n: 2; }
.records li:nth-child(4) { --n: 3; }
.records li:nth-child(5) { --n: 4; }
.log tbody tr { animation: show 0.4s both; }
.log tbody tr:nth-child(1) { animation-delay: 2.1s; }
.log tbody tr:nth-child(2) { animation-delay: 2.35s; }
.log tbody tr:nth-child(3) { animation-delay: 2.6s; }
.log tfoot tr { animation: show 0.5s 3.05s both; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .records li, .records li::after, .log tr { animation: none; }
}

@media (max-width: 960px) {
  .records { grid-template-columns: 1fr; padding-block: 24px 20px; }
  .records li { padding: 0 0 24px 32px; }
  .records li:last-child { padding-bottom: 0; }
  .records li::before { top: 5px; }
  .records li::after { left: 5.5px; right: auto; top: 18px; bottom: -5px; width: 2px; height: auto; transform-origin: top; }
  .records .rel { position: static; display: block; transform: none; padding: 0; margin-bottom: 2px; background: none; }
  .records .rel::after { content: ' ' attr(data-of); }
  @keyframes draw { from { transform: scaleY(0); } }
  .log .who { display: none; }
}
@media (max-width: 540px) {
  .trace-head span { display: none; }
  .log { font-size: 13px; }
  .log th, .log td { padding-inline: 6px; }
  .log .prev { display: none; }
}

/* ---- three kinds of records ---- */
.split { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(32px, 6vw, 80px); align-items: start; }
.split > *, .pair > * { min-width: 0; }
.streams { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(24px, 3vw, 40px); margin-top: clamp(40px, 5vw, 64px); }
.stream { border-top: 3px solid var(--c); padding-top: 20px; --c: var(--blue); }
.stream.work { --c: var(--teal); }
.stream.proof { --c: var(--green); }
.stream h3 { color: var(--c); }
.stream > p { margin-top: 6px; color: var(--ink-2); min-height: 3.2em; }
.stream ul { margin-top: 18px; }
.stream li { padding-block: 11px; border-top: 1px solid var(--line); }
.stream li b { font-weight: 600; }
.stream li span { display: block; color: var(--ink-2); font-size: 14px; line-height: 1.45; }

/* ---- the clients: chosen with radio buttons, no script ---- */
.clients { border: 0; padding: 0; margin: clamp(36px, 5vw, 56px) 0 0; min-width: 0; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.front .tabs label { display: inline-flex; align-items: center; min-height: 40px; margin: 0; padding: 6px 16px; border: 1px solid var(--field-line); border-radius: 999px; color: var(--ink-2); font-weight: 600; font-size: 14px; cursor: pointer; user-select: none; }
.front .tabs label:hover { border-color: var(--ink); color: var(--ink); }
#c-clean:checked ~ .tabs [for='c-clean'], #c-phone:checked ~ .tabs [for='c-phone'], #c-gem:checked ~ .tabs [for='c-gem'], #c-console:checked ~ .tabs [for='c-console'] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
#c-clean:focus-visible ~ .tabs [for='c-clean'], #c-phone:focus-visible ~ .tabs [for='c-phone'], #c-gem:focus-visible ~ .tabs [for='c-gem'], #c-console:focus-visible ~ .tabs [for='c-console'] { outline: 3px solid var(--blue); outline-offset: 3px; }
.front .clients input.sr-only { width: 1px; padding: 0; border: 0; }
.panel { display: none; margin-top: 32px; }
#c-clean:checked ~ .p-clean, #c-phone:checked ~ .p-phone, #c-gem:checked ~ .p-gem, #c-console:checked ~ .p-console { display: block; }
.screen { aspect-ratio: 16 / 10; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); overflow: hidden; position: relative; }
.screen img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: top left; }
.screen.tall { background: var(--bg); }
.screen.tall img { inset: 4% auto auto 50%; width: auto; height: 92%; transform: translateX(-50%); border: 1px solid var(--line); border-radius: 14px; }
.screen.dark-glass { background: #000000; }
.screen.dark-glass img { object-fit: contain; object-position: center; }
.screen .for-light { display: var(--light-only); }
.screen .for-dark { display: var(--dark-only); }
.panel figcaption { display: grid; grid-template-columns: 5fr 7fr; gap: 8px clamp(32px, 6vw, 80px); align-items: baseline; margin-bottom: 28px; }
.panel figcaption p { color: var(--ink-2); max-width: 610px; }

/* ---- regulated work ---- */
.controls > div { display: grid; grid-template-columns: 200px 1fr; gap: 4px 24px; padding-block: 15px; border-top: 1px solid var(--line); }
.controls > div:last-child { border-bottom: 1px solid var(--line); }
.controls dt { font-weight: 600; }
.controls dd { color: var(--ink-2); }
.signed { margin-top: 36px; max-width: 380px; padding: 17px 20px 19px; border: 1px solid var(--line); border-left: 3px solid var(--green); border-radius: 3px var(--radius) var(--radius) 3px; background: var(--bg); font-size: 14px; }
.signed strong { display: block; color: var(--green); font-weight: 700; }
.signed dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 16px; margin-top: 9px; }
.signed dt { color: var(--ink-2); }

/* ---- your server ---- */
.facts > div { display: grid; grid-template-columns: 150px 1fr; gap: 4px 24px; padding-block: 12px; border-top: 1px solid var(--line); }
.facts dt { color: var(--ink-2); }
.terminal { margin-top: 36px; padding: 20px 22px; border: 1px solid var(--line); border-radius: 10px; background: var(--code-bg); color: var(--code-ink); }
.terminal pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-family: ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, Consolas, monospace; font-size: 14px; line-height: 1.75; }
.terminal .c { color: var(--code-ink2); }
.after-terminal { margin-top: 14px; color: var(--ink-2); font-size: 14px; }

/* ---- integrations and AI ---- */
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 6vw, 80px); }
.front .pair h2 { font-size: clamp(22px, 2.6vw, 29px); }
.pair .lead { font-size: 16px; margin-top: 14px; }
.plain { margin-top: 24px; }
.plain li { position: relative; padding: 10px 0 10px 22px; border-top: 1px solid var(--line); }
.plain li::before { content: ''; position: absolute; left: 0; top: 19px; width: 7px; height: 7px; border-radius: 2px; background: var(--blue); }

/* ---- the way on: the same blue in both themes, white on it ---- */
.closing { background: #0b62d6; color: #ffffff; padding-block: clamp(48px, 7vw, 88px); }
.closing .wrap { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 32px; }
.closing h2 { max-width: 16ch; }
.closing p { margin-top: 16px; max-width: 520px; font-size: 17px; line-height: 1.45; }
.closing .actions { margin-top: 0; }
.closing .btn.primary { background: #ffffff; color: #0b4fae; }
.closing .btn.primary:hover { background: #d8dee4; }
.closing .btn.quiet { border-color: #ffffff; color: #ffffff; }
.closing .btn.quiet:hover { background: #ffffff; color: #0b4fae; }
.closing :focus-visible { outline-color: #ffffff; }

.front footer { padding-block: 34px 48px; color: var(--ink-2); font-size: 13px; }
.front footer .wrap { display: grid; grid-template-columns: auto 1fr; gap: 12px 40px; align-items: baseline; }
.front footer .brand { font-size: 16px; }
.front footer .mark { width: 18px; height: 18px; }
.front footer p { max-width: 720px; }

@media (max-width: 960px) {
  .split, .pair, .panel figcaption { grid-template-columns: 1fr; }
  .streams { grid-template-columns: 1fr; }
  .stream > p { min-height: 0; }
  .front footer .wrap { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .screen.tall { aspect-ratio: 4 / 5; }
  .controls > div, .facts > div { grid-template-columns: 1fr; }
}
