/* myCursr. Two colours from the logo, one shape from its pixel grid. */

@font-face {
  font-family: "Pixelify";
  src: url("/static/fonts/pixelify-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "Schibsted";
  src: url("/static/fonts/schibsted-grotesk.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
}

:root {
  --signal: #c02806;
  --signal-deep: #8f1e04;
  --paper: #f0efed;
  --paper-bright: #faf9f7;
  --clay: #dfdad4;
  --ink: #1f0e09;
  --stone: #6a5c56;
  --moss: #2b6449;
  --ochre: #855608;

  --pixel: "Pixelify", "Schibsted", system-ui, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --text: "Schibsted", system-ui, "Segoe UI", sans-serif;

  --step: 4px;
  --rail: 236px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.55 var(--text);
}

h1, h2, h3 { margin: 0; font-weight: 400; }
h1, h2 { font-family: var(--pixel); letter-spacing: -0.02em; line-height: 1.12; }
h1 { font-size: clamp(1.9rem, 3.2vw, 2.6rem); }
h2 { font-size: 1.4rem; }
h3 { font: 700 1rem/1.3 var(--text); }
p { margin: 0; max-width: 68ch; }
a { color: var(--signal); text-underline-offset: 0.18em; }
code, .code { font-family: var(--mono); font-size: 0.92em; }
ul { margin: 0; padding: 0; list-style: none; }

.muted { color: var(--stone); }
.small { font-size: 0.875rem; }
.pos { color: var(--moss); }
.neg { color: var(--signal); }
[hidden] { display: none !important; }

.stepped {
  clip-path: polygon(
    var(--step) 0, calc(100% - var(--step)) 0, calc(100% - var(--step)) var(--step),
    100% var(--step), 100% calc(100% - var(--step)), calc(100% - var(--step)) calc(100% - var(--step)),
    calc(100% - var(--step)) 100%, var(--step) 100%, var(--step) calc(100% - var(--step)),
    0 calc(100% - var(--step)), 0 var(--step), var(--step) var(--step)
  );
}

/* Buttons */
.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  display: inline-block;
  padding: 0.62rem 1.05rem;
  background: var(--signal);
  color: var(--paper-bright);
  font: 700 0.9375rem/1.2 var(--text);
  text-decoration: none;
  white-space: nowrap;
  clip-path: polygon(
    var(--step) 0, calc(100% - var(--step)) 0, calc(100% - var(--step)) var(--step),
    100% var(--step), 100% calc(100% - var(--step)), calc(100% - var(--step)) calc(100% - var(--step)),
    calc(100% - var(--step)) 100%, var(--step) 100%, var(--step) calc(100% - var(--step)),
    0 calc(100% - var(--step)), 0 var(--step), var(--step) var(--step)
  );
}
.btn:hover { background: var(--signal-deep); }
.btn:disabled { opacity: 0.55; cursor: progress; }
.btn.quiet { background: var(--clay); color: var(--ink); }
.btn.quiet:hover { background: #d2ccc4; }
.btn.danger { background: var(--ink); }
.btn.danger:hover { background: #3a1c13; }
.btn.small { padding: 0.38rem 0.68rem; font-size: 0.8125rem; --step: 3px; }
.btn.inverse { background: var(--paper); color: var(--signal); }
.btn.inverse:hover { background: var(--paper-bright); }
.btn.inverse-quiet { background: var(--signal-deep); color: var(--paper); }
.btn.inverse-quiet:hover { background: #761802; }

/* Clip-path would cut an outside outline, so focus is drawn inside. */
.btn:focus-visible { outline: 2px solid currentColor; outline-offset: -6px; }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Forms */
.field { display: grid; gap: 0.3rem; }
.field > span { font-weight: 600; font-size: 0.9rem; }
.field > small { color: var(--stone); font-size: 0.8125rem; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="url"], input:not([type]), textarea, select {
  width: 100%;
  padding: 0.55rem 0.65rem;
  background: var(--paper-bright);
  border: 2px solid var(--ink);
  border-radius: 0;
  color: var(--ink);
  font: 400 1rem/1.4 var(--text);
}
textarea { min-height: 7rem; resize: vertical; }
textarea.code { font-family: var(--mono); font-size: 0.9rem; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--signal); outline-offset: 0; border-color: var(--signal); }
.check { display: flex; gap: 0.5rem; align-items: flex-start; font-size: 0.95rem; }
.check input { margin-top: 0.3rem; accent-color: var(--signal); }
form.stack, .stack { display: grid; gap: 0.95rem; }
.row { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }
.row.spread { justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.95rem; }
.form-error { color: var(--signal); font-weight: 600; font-size: 0.92rem; }

/* Tables: the console is mostly ledgers, so rows carry the structure. */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th { text-align: left; font-weight: 600; color: var(--stone); font-size: 0.85rem; padding: 0 1rem 0.45rem 0; white-space: nowrap; }
td { padding: 0.62rem 1rem 0.62rem 0; border-top: 1px solid var(--clay); vertical-align: top; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--clay); }

/* Console shell */
.shell { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: 100vh; }
.rail {
  background: var(--signal);
  color: var(--paper);
  padding: 1.5rem 0 1.25rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.rail .logo { width: 138px; display: block; color: var(--paper); }
.rail nav { display: grid; gap: 1px; flex: 1; align-content: start; }
.rail nav a {
  color: var(--paper);
  font-family: var(--pixel);
  font-size: 1rem;
  text-decoration: none;
  padding: 0.42rem 0.8rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.rail nav a:hover { background: var(--signal-deep); }
.rail nav a[aria-current="page"] { background: var(--paper); color: var(--signal); }
.rail nav a:focus-visible { outline: 2px solid var(--paper); outline-offset: -3px; }
.rail nav a[aria-current="page"]:focus-visible { outline-color: var(--signal); }
.count { font-family: var(--text); font-size: 0.8rem; font-weight: 700; }
.rail footer { padding-right: 1.1rem; font-size: 0.875rem; display: grid; gap: 0.4rem; }
.rail footer button { background: none; border: 0; color: var(--paper); text-decoration: underline; cursor: pointer; padding: 0; font: inherit; text-align: left; }
.rail footer .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

main { padding: 2.2rem clamp(1.25rem, 4vw, 3.5rem) 4rem; max-width: 1120px; width: 100%; }
.view { display: grid; gap: 2.2rem; }
.view > header { display: grid; gap: 0.45rem; }
section.block { display: grid; gap: 0.85rem; }
.acting { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.acting select { width: auto; min-width: 14rem; font-family: var(--pixel); }

.empty { padding: 1.4rem 0; display: grid; gap: 0.7rem; justify-items: start; border-top: 1px solid var(--clay); }

.state { font-weight: 600; font-size: 0.875rem; }
.state.good { color: var(--moss); }
.state.wait { color: var(--ochre); }
.state.bad { color: var(--signal); }
.state.off { color: var(--stone); }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 0.25rem 1.25rem; }
.kv dt { color: var(--stone); }
.kv dd { margin: 0; font-variant-numeric: tabular-nums; }

/* Overview: the balance is a sentence, in the logo's voice. */
.balance-line { font-family: var(--pixel); font-size: clamp(1.7rem, 3.6vw, 3rem); line-height: 1.14; letter-spacing: -0.02em; max-width: 24ch; }
/* Pixel numerals blur 5 and 8, and money has to be unmistakable. */
.balance-line b { font: 800 1em/1 var(--text); letter-spacing: -0.02em; color: var(--signal); }

/* Messages */
.inbox { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 2rem; min-height: 420px; }
.threads button {
  width: 100%; text-align: left; background: none; border: 0; border-top: 1px solid var(--clay);
  padding: 0.65rem 0.4rem; cursor: pointer; font: inherit; color: inherit; display: grid; gap: 0.1rem;
}
.threads button:hover { background: var(--clay); }
.threads button[aria-current="true"] { background: var(--ink); color: var(--paper); }
.threads button[aria-current="true"] .muted { color: var(--clay); }
.threads button:focus-visible { outline: 2px solid var(--signal); outline-offset: -2px; }
.threads .preview { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.875rem; }
.bubbles { display: grid; gap: 0.6rem; align-content: start; }
.bubble { max-width: 76%; padding: 0.55rem 0.8rem; background: var(--clay); white-space: pre-wrap; overflow-wrap: anywhere; justify-self: start; }
.bubble.mine { background: var(--signal); color: var(--paper-bright); justify-self: end; }
.bubble time { display: block; font-size: 0.75rem; opacity: 0.75; }

/* Skills and facts */
.list > li { padding: 0.9rem 0; border-top: 1px solid var(--clay); display: grid; gap: 0.3rem; }
.list .head { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; flex-wrap: wrap; }
.handle { font-family: var(--pixel); }
blockquote { margin: 0; padding-left: 0.8rem; border-left: 4px solid var(--signal); color: var(--stone); font-size: 0.92rem; }

pre {
  margin: 0; padding: 1rem; background: var(--ink); color: var(--paper);
  font: 400 0.875rem/1.5 var(--mono); overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere;
}
.reply { white-space: pre-wrap; overflow-wrap: anywhere; }

.packages { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
.packages > div { display: grid; gap: 0.5rem; border-top: 4px solid var(--signal); padding-top: 0.7rem; align-content: start; }
.packages .credits { font: 800 1.6rem/1.1 var(--text); }

dialog {
  border: 0; padding: 1.5rem; width: min(560px, calc(100vw - 2rem));
  background: var(--paper); color: var(--ink);
}
dialog::backdrop { background: rgba(31, 14, 9, 0.6); }
.secret { font-family: var(--mono); font-size: 0.92rem; background: var(--ink); color: var(--paper); padding: 0.75rem; overflow-wrap: anywhere; user-select: all; }

#toast {
  position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 50; max-width: 26rem;
  padding: 0.7rem 1rem; background: var(--ink); color: var(--paper); font-weight: 600;
}
#toast.error { background: var(--signal); color: var(--paper-bright); }

/* Sign-in */
.auth { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(340px, 1fr); min-height: 100vh; }
.auth-brand {
  background: var(--signal); color: var(--paper); padding: clamp(1.5rem, 5vw, 4rem);
  display: flex; flex-direction: column; justify-content: space-between; gap: 3rem;
}
.auth-brand .logo { width: min(340px, 70%); color: var(--paper); display: block; }
.auth-brand p { font-family: var(--pixel); font-size: clamp(1.25rem, 2.2vw, 1.8rem); line-height: 1.2; max-width: 22ch; }
.auth-form { display: grid; align-content: center; padding: clamp(1.5rem, 5vw, 4rem); }
.auth-form .panel { width: 100%; max-width: 380px; display: grid; gap: 1.1rem; justify-self: center; }
.linklike { background: none; border: 0; padding: 0; color: var(--signal); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 0.18em; }
.linklike:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Landing */
.hero { background: var(--signal); color: var(--paper); min-height: 86vh; padding: clamp(1.25rem, 4vw, 3rem); display: flex; flex-direction: column; justify-content: space-between; gap: 3rem; }
.hero .bar { display: flex; justify-content: flex-end; gap: 0.6rem; }
.hero .logo { width: min(860px, 100%); color: var(--paper); display: block; }
.hero h1 { font-size: clamp(1.8rem, 4.6vw, 3.8rem); max-width: 22ch; margin-top: 1.6rem; }
.caret { display: inline-block; width: 0.55em; height: 0.92em; background: var(--paper); margin-left: 0.12em; vertical-align: -0.08em; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero .cta { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 1.6rem; }

.page { max-width: 1060px; margin: 0 auto; padding: 4rem clamp(1.25rem, 4vw, 3rem); display: grid; gap: 4rem; }
.lede { font-size: 1.3rem; line-height: 1.4; max-width: 34ch; }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; }
.intro { gap: 2.5rem; }
.intro .steps { grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); margin: 0; padding: 0; }
.steps li { display: grid; gap: 0.4rem; align-content: start; }
.steps h3 { font: 400 1.25rem/1.2 var(--pixel); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 2.5rem; align-items: start; }
.live { font-size: 1.3rem; line-height: 1.4; max-width: 44ch; }
.site-foot { border-top: 4px solid var(--signal); padding: 1.25rem clamp(1.25rem, 4vw, 3rem); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: 0.9rem; }

.rail footer a { color: var(--paper); }

/* Sections inside one page. The current one sits on a red bar, like a selected pixel row. */
.tabs { display: flex; gap: 0.25rem; flex-wrap: wrap; border-bottom: 4px solid var(--signal); }
.tabs a {
  font-family: var(--pixel); font-size: 1rem; color: var(--ink); text-decoration: none;
  padding: 0.45rem 0.85rem 0.35rem; background: var(--clay);
}
.tabs a:hover { background: #d2ccc4; }
.tabs a[aria-current="page"] { background: var(--signal); color: var(--paper); }
.tabs a:focus-visible { outline: 2px solid var(--ink); outline-offset: -4px; }

/* Something is waiting on the person: a red edge, nothing louder. */
.block.attention { border-left: 4px solid var(--signal); padding-left: 1rem; }

.steps-todo { margin: 0; padding: 0; list-style: none; counter-reset: todo; display: grid; gap: 0.1rem; }
.steps-todo li { counter-increment: todo; display: grid; grid-template-columns: 2.2rem minmax(0, 1fr); column-gap: 0.6rem; padding: 0.7rem 0; border-top: 1px solid var(--clay); }
.steps-todo li::before { content: counter(todo); grid-row: span 2; font: 700 1.1rem/1 var(--text); color: var(--paper); background: var(--signal); width: 2rem; height: 2rem; display: grid; place-items: center; }
.steps-todo li.done::before { content: "\2713"; background: var(--moss); }
.steps-todo li > a, .steps-todo li > span:first-of-type { font-weight: 700; }
.steps-todo li > .setup-prompt { grid-column: 2; margin-top: 0.6rem; }

/* Saved by MyCursr: three big figures, one word under each, one quiet line. */
.savings .figures { display: grid; grid-template-columns: repeat(3, minmax(0, max-content)); column-gap: clamp(1.5rem, 5vw, 3.5rem); row-gap: 1rem; margin: 0.6rem 0 0.4rem; }
.savings .figure { display: grid; gap: 0.15rem; }
.savings .figure b { font: 800 clamp(1.6rem, 3.4vw, 2.4rem)/1 var(--text); letter-spacing: -0.02em; color: var(--moss); font-variant-numeric: tabular-nums; }
.savings .figure span { color: var(--stone); }
@media (max-width: 360px) { .savings .figures { grid-template-columns: repeat(2, minmax(0, max-content)); } }

.page-text { max-height: 26rem; overflow-y: auto; }
.page-read { border-top: 1px solid var(--clay); padding-top: 1rem; }
.balance-line.small-line { font-size: clamp(1.3rem, 2.4vw, 1.9rem); }

@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; height: auto; padding: 1rem; gap: 0.8rem; }
  .rail nav { display: flex; overflow-x: auto; }
  .rail nav a { white-space: nowrap; gap: 0.4rem; }
  .rail footer { display: flex; flex-wrap: wrap; gap: 0.3rem 1.2rem; padding: 0; }
  .rail footer .who { flex: 1 1 100%; }
  .inbox, .split, .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-brand { gap: 1.25rem; }
  .steps, .packages, .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .hero { min-height: 70vh; }
}

@media (prefers-reduced-motion: reduce) {
  .caret { animation: none; }
}

td .handle { white-space: nowrap; }

/* Developer guide */
.doc-head { background: var(--signal); color: var(--paper); padding: 1.25rem clamp(1.25rem, 4vw, 3rem); display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.doc-head .logo { width: min(220px, 50vw); color: var(--paper); display: block; }
.doc { max-width: 820px; gap: 3rem; }
.doc h1 { font: 400 clamp(2rem, 5vw, 3.2rem)/1.1 var(--pixel); }
.doc h3 { margin-top: 0.8rem; }
.doc-list { margin: 0; padding-left: 1.3rem; display: grid; gap: 0.6rem; }
.doc code { font: 0.9em var(--mono); background: var(--clay); padding: 0.05rem 0.3rem; }
.calls { margin: 0; display: grid; grid-template-columns: minmax(0, 20rem) minmax(0, 1fr); }
.calls dt, .calls dd { margin: 0; padding: 0.55rem 0; border-top: 1px solid var(--clay); }
.calls dt { font: 0.85rem/1.5 var(--mono); overflow-wrap: anywhere; padding-right: 1rem; }
@media (max-width: 640px) {
  .calls { grid-template-columns: minmax(0, 1fr); }
  .calls dd { border-top: 0; padding-top: 0; }
}
.facts { margin: 0; padding: 0; list-style: none; display: grid; gap: 0; }
.facts li { padding: 0.75rem 0 0.75rem 1rem; border-left: 4px solid var(--signal); border-top: 1px solid var(--clay); }

/* Encyclopedia */
.wiki { gap: 3rem; }
.wiki-search { display: flex; gap: 0.6rem; align-items: end; flex-wrap: wrap; max-width: 40rem; }
.wiki-search .field { flex: 1 1 18rem; }
.claims { display: grid; gap: 0; }
.claim { border-top: 4px solid var(--signal); padding: 1.1rem 0 1.6rem; display: grid; gap: 0.9rem; }
.claim h2 { font: 400 1.35rem/1.2 var(--pixel); }
.claim .note { color: var(--ochre); font-weight: 600; }
.claim-value { display: grid; gap: 0.35rem; max-width: 68ch; }
.claim-value + .claim-value { border-top: 1px solid var(--clay); padding-top: 0.9rem; }
.claim-value .said { font-size: 1.125rem; line-height: 1.45; }
.claim-value blockquote { margin: 0; padding-left: 0.9rem; border-left: 3px solid var(--clay); color: var(--stone); line-height: 1.55; }
.claim-value a, .wiki .list a { overflow-wrap: anywhere; }

/* Agent sites */
.agent-page { gap: 1rem; max-width: 70ch; }
.page-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; }
.agent-page pre { overflow-x: auto; }

/* A domain the owner proved they control. */
.verified { color: var(--moss); font: 600 0.875rem/1.4 var(--text); white-space: nowrap; }
.review-text { font-style: italic; }
select.period { width: auto; min-width: 12rem; }
