/* Shared by every cnote page: tokens, the cnote bar, sheet grid, margin notes. */
:root {
  --paper: #f6f3ec;
  --ink: #1d1b17;
  --muted: #6f695d;
  --rule: #d9d3c5;
  --mark: rgba(242, 207, 99, .6);
  --mark-hot: rgba(242, 190, 40, .85);
  --side-a: #1d1b17;
  --side-b: #9a917f;
  --idiom-ink: var(--ink);
  --idiom-sub: var(--muted);
  --serif: "Source Serif 4", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #15140f;
    --ink: #e8e3d6;
    --muted: #9b9484;
    --rule: #34312a;
    --mark: rgba(232, 186, 62, .34);
    --mark-hot: rgba(232, 186, 62, .62);
    --side-a: #e8e3d6;
    --side-b: #7d7667;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.1875rem/1.6 var(--serif);
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .18em; }

/* The cnote bar: identical on every page, rendered by common.js. */
.bar {
  position: sticky; top: 0; z-index: 10;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  height: 40px;
  padding: 0 14px;
  background: var(--paper);
  font: 400 .8125rem/1 var(--serif);
  font-variant-caps: all-small-caps;
  letter-spacing: .04em;
  color: var(--muted);
  white-space: nowrap;
}
.bar a, .bar button.link { color: var(--muted); text-decoration: none; }
.bar a:hover, .bar button.link:hover { color: var(--ink); }
.bar .logo { color: var(--ink); font: 400 1.375rem/1 var(--serif); font-variant-caps: normal; letter-spacing: 0; }
.bar .where { flex: 1; min-width: 0; display: flex; gap: 1rem; align-items: baseline; overflow: hidden; }
.bar .where .host { color: var(--ink); overflow: hidden; text-overflow: ellipsis; }
.bar .acct { display: inline-flex; gap: .4rem; align-items: baseline; }
.bar .acct .me { color: var(--ink); }
.bar button.link { font: inherit; letter-spacing: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

.sheet {
  display: grid;
  grid-template-columns: minmax(0, 34rem) 15rem;
  column-gap: 3.5rem;
  align-items: start;
  max-width: calc(34rem + 3.5rem + 15rem);
  margin: 0 auto;
  padding: clamp(3rem, 9vh, 6.5rem) 1rem 2rem;
}
.sheet > * { grid-column: 1; }
.sheet > aside, .sheet > .notes { grid-column: 2; }
/* Two notes on one paragraph run down beside the next paragraph instead of opening a gap. */
.sheet > .notes { grid-row: span 2; }

h1 {
  font: 600 2.75rem/1.05 var(--serif);
  letter-spacing: -.02em;
  margin: 0 0 1.5rem;
}
h1 .path { display: block; font-weight: 400; font-size: .72em; line-height: 1.2; margin-top: .3rem; overflow-wrap: anywhere; }
p { margin: 0 0 1.25rem; }

.mark {
  background: linear-gradient(transparent 52%, var(--mark) 52%, var(--mark) 92%, transparent 92%);
  transition: background .15s;
  cursor: default;
}
.mark.hot { background: linear-gradient(transparent 52%, var(--mark-hot) 52%, var(--mark-hot) 92%, transparent 92%); }
sup { font: 600 .7em/0 var(--sans); padding-left: .1em; color: var(--muted); }

aside {
  font: 400 .875rem/1.5 var(--sans);
  color: var(--muted);
  padding-top: .3rem;
  margin-bottom: 1.25rem;
  transition: color .15s;
}
aside.hot { color: var(--ink); }
aside b { font-weight: 600; color: var(--ink); margin-right: .35em; }
.tally {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-top: .55rem;
  font-size: .75rem;
}
.tally .meter { display: inline-flex; width: 3.25rem; height: 4px; flex: none; }
.tally .meter i { flex: 1; }
.tally .meter i:first-child { background: var(--side-a); }
.tally .meter i:last-child { background: var(--side-b); }

/* cnote.fyi/<url> line */
.go {
  display: flex;
  align-items: baseline;
  border-bottom: 1px solid var(--ink);
  margin: .25rem 0 1.75rem;
  font: 400 1.125rem/1.4 var(--sans);
}
.go label { flex: none; color: var(--muted); }
.go input {
  flex: 1;
  min-width: 0;
  font: inherit;
  color: var(--ink);
  background: transparent;
  border: 0;
  padding: .45rem 0;
  outline: none;
}
.go input::placeholder { color: var(--muted); opacity: .55; }
.go button {
  flex: none;
  font: 600 .875rem/1 var(--sans);
  color: var(--ink);
  background: none;
  border: 0;
  padding: .5rem 0 .5rem .75rem;
  cursor: pointer;
}
.go:focus-within { border-bottom-width: 2px; margin-bottom: calc(1.75rem - 1px); }


[hidden] { display: none !important; }

/* Narrow screens: margin notes drop under their paragraph */
@media (max-width: 860px) {
  body { font-size: 1.125rem; }
  .sheet { display: block; max-width: 36rem; padding-top: 2.5rem; }
  aside {
    border-left: 2px solid var(--mark-hot);
    padding: 0 0 0 .85rem;
    margin: -.4rem 0 1.5rem;
  }
  h1 { font-size: 2.25rem; }
}

@media (max-width: 700px) {
  .bar { gap: .75rem; }
  .bar .hide-narrow { display: none; }
}

/* Landing: one serif, two sizes (body 1.125rem, small .9375rem). The install command is the only mono. */
.home { max-width: 38rem; margin: 0 auto; padding: clamp(3rem, 12vh, 7rem) 1rem 2rem; font: 400 1.125rem/1.55 var(--serif); }
.home p { margin: 0 0 1rem; }
.home small, .home .small { font-size: .9375rem; }
.lede { font-weight: 600; }
.home .mark { font: inherit; color: inherit; border: 0; padding: 0; cursor: pointer; }
.home .mark.hot { background: linear-gradient(transparent 52%, var(--mark-hot) 52%, var(--mark-hot) 92%, transparent 92%); }
.home sup { font: 600 .65em/0 var(--serif); color: var(--muted); padding-left: .1em; }
.go.big { font: inherit; margin: 1.75rem 0 .6rem; align-items: center; }
.go.big label { color: var(--muted); }
.go.big button { font: 600 .9375rem/1 var(--serif); }
.install { font-size: .9375rem; color: var(--muted); margin: 0 0 3rem; }
.home .install code { font: 400 .875rem/1.4 ui-monospace, Menlo, monospace; color: var(--ink); white-space: nowrap; }
/* The contested note: opens beside "balanced opinion" on wide screens, under the line on narrow ones. */
.noted { position: relative; }
.noted aside { font: 400 .9375rem/1.5 var(--serif); color: var(--muted); padding-top: 0; }
.noted aside .tally { font: inherit; }
.home code { font: inherit; color: var(--ink); }
.noted aside b { color: var(--ink); margin-right: .35em; }
.noted aside #claim { color: var(--ink); }
.noted aside .tally { display: flex; margin-top: .4rem; }
.noted aside .status { display: block; margin-top: .2rem; }
.noted .meter i { flex: none; transition: flex-basis .35s ease-out; }
@media (min-width: 1120px) {
  .noted aside { position: absolute; top: 0; left: calc(100% + 3rem); width: 15rem; }
}
@media (max-width: 1119px) {
  .noted aside { border-left: 2px solid var(--mark-hot); padding: 0 0 0 .85rem; margin: -.4rem 0 1.25rem; }
}
@media (prefers-reduced-motion: reduce) { .noted .meter i { transition: none; } }
/* cnote (noun), set like a dictionary entry */
.entry { margin: 0 0 3rem; }
.entry dt { margin-bottom: .3rem; }
.entry dfn { font-style: normal; font-weight: 600; }
.entry .pron, .entry dt i { color: var(--muted); }
.entry dd { margin: 0; }
.entry q { font-style: italic; quotes: none; }
.entry .ety { font-size: .9375rem; color: var(--muted); margin: 0 0 .4rem; }
/* HN-style accounts */
.you { margin-bottom: 1rem; }
.you b { display: block; font-weight: 600; margin-bottom: .4rem; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-bottom: 1rem; }
.auth label { display: block; color: var(--muted); font-size: .9375rem; margin-bottom: .4rem; }
.auth input {
  display: block; width: 100%; margin-top: .1rem;
  font: inherit; font-size: 1.125rem; color: var(--ink); background: transparent;
  border: 0; border-bottom: 1px solid var(--rule); border-radius: 0; padding: .2rem 0; outline: none;
}
.auth input:focus { border-color: var(--ink); }
.auth button {
  margin-top: .35rem; font: 600 .9375rem/1 var(--serif); color: var(--ink); background: none;
  border: 1px solid var(--ink); padding: .5rem .75rem; cursor: pointer;
}
.auth .err { font-size: .9375rem; }
.signedin { color: var(--ink); }
.fine { color: var(--muted); font-size: .9375rem; }
@media (max-width: 600px) { .pair { grid-template-columns: 1fr; gap: 1.25rem; } .home { font-size: 1.0625rem; } }

/* Link-style buttons and dialogs (sign in, add a note), used on every page. */
button.link {
  font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em;
}

/* Dialogs */
dialog {
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
  padding: 1.5rem;
  width: min(30rem, calc(100vw - 2rem));
  font: 400 .9375rem/1.5 var(--sans);
}
dialog::backdrop { background: color-mix(in srgb, var(--ink) 35%, transparent); }
dialog h2 { font: 600 1.375rem/1.2 var(--serif); margin: 0 0 .5rem; }
dialog .hint { color: var(--muted); margin: 0 0 1rem; }
dialog label { display: block; margin-bottom: .9rem; color: var(--muted); font-size: .875rem; }
dialog label.inline { display: flex; gap: .5rem; align-items: baseline; color: var(--ink); font-size: .9375rem; margin-bottom: .35rem; }
dialog input:not([type=radio]), dialog textarea {
  display: block; width: 100%; margin-top: .3rem;
  font: inherit; font-size: 1rem; color: var(--ink);
  background: transparent; border: 0; border-bottom: 1px solid var(--ink);
  padding: .4rem 0; border-radius: 0; outline: none;
}
dialog textarea { border: 1px solid var(--rule); padding: .5rem; resize: vertical; }
dialog input:focus, dialog textarea:focus { border-color: var(--ink); box-shadow: 0 1px 0 var(--ink); }
dialog fieldset { border: 0; padding: 0; margin: 0 0 1rem; }
dialog legend { color: var(--muted); font-size: .875rem; margin-bottom: .4rem; padding: 0; }
dialog blockquote { margin: 0 0 1rem; padding-left: .85rem; border-left: 2px solid var(--mark-hot); font: 400 1rem/1.5 var(--serif); }
dialog .row { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; margin-top: 1.25rem; }
dialog button:not(.link) {
  font: 600 .875rem/1 var(--sans); color: var(--ink); background: none;
  border: 1px solid var(--ink); padding: .6rem .9rem; cursor: pointer;
}
dialog button.primary { background: var(--ink); color: var(--paper); }
.err { color: #b3261e; margin: .25rem 0 0; }
@media (prefers-color-scheme: dark) { .err { color: #f2b8b5; } }

