/* The Public Protocol family shell: tokens, typefaces, base type, the top bar,
   the menu sheet and the footer. The site switcher is in switcher.css, which
   a sub-site loads after this file. Every sub-site of
   publicprotocol.org uses this file unchanged, so that each reads as a room of
   the same house. Values are the parent's own. See README.md in this folder. */

@font-face{font-family:Alegreya;src:url(fonts/alegreya-400.woff2) format("woff2");font-weight:400;font-display:swap}
@font-face{font-family:Alegreya;src:url(fonts/alegreya-500.woff2) format("woff2");font-weight:500;font-display:swap}
@font-face{font-family:"Alegreya Sans";src:url(fonts/alegreya-sans-400.woff2) format("woff2");font-weight:400;font-display:swap}
@font-face{font-family:"Alegreya Sans";src:url(fonts/alegreya-sans-500.woff2) format("woff2");font-weight:500;font-display:swap}
@font-face{font-family:"Alegreya Sans SC";src:url(fonts/alegreya-sans-sc-500.woff2) format("woff2");font-weight:500;font-display:swap}

/* Colours are the parent's pigments: linen ground, bone black, red ochre,
   yellow ochre, vermilion, mauve, blue, green earth, and verdigris. */
:root{
  color-scheme:light;
  --paper:#EFE9DA;
  --ink:#1F1B16;
  --soft:#5E574B;
  --rule:#1F1B16;
  --rule-soft:#BDB6A6;        /* ink at about 30% on paper, as the parent's table rules */
  --c-red:#B5472B;
  --c-ochre:#C4912A;
  --c-verm:#D9442B;
  --c-mauve:#8E5A9E;
  --c-blue:#2F4FA8;
  --c-green:#5E7F5A;
  --c-verdigris:#3F918B;
  /* The highlight is verdigris, the blue-green that copper gives over vinegar:
     one more pigment beside the others. It is used in three steps of the one
     colour: a pale tint for washes and selected states, the pigment itself for
     button surfaces and marks, and a deep shade for text and outlines. The
     tokens are named by role, so a site need not know the values. */
  --highlight:#3F918B;
  --highlight-strong:#17615E;
  --highlight-soft:#D3E8E3;
  --on-highlight:#1F1B16;
  --on-highlight-strong:#FFFFFF;
  --field-green:#E3E8DA;
  --field-sand:#E6E0D0;
  --focus:#2F4FA8;
  --bar:58px;
  /* The page's measures, taken from the parent: one container for the content
     and the footer, the bar's own gutter, and the measure of running text. */
  --page-max:76rem;
  --page-gutter:clamp(1.25rem,5vw,5rem);
  --bar-gutter:var(--page-gutter); /* retired: the bar's contents now sit on the page's edges */
  --measure:38rem;
  --measure-lead:36rem;
  --serif:Alegreya,"Iowan Old Style","Palatino Linotype",Palatino,Georgia,serif;
  --sans:"Alegreya Sans","Gill Sans","Trebuchet MS",sans-serif;
  --caps:"Alegreya Sans SC","Alegreya Sans","Gill Sans",sans-serif;
}
/* The parent is a light page with dark passages: ink ground, paper text, the
   rule and the soft text of its contents sheet. The dark scheme is those. It
   applies only when the visitor has chosen it: the page is light by default
   and never follows the device's setting. */
:root[data-theme="dark"]{
  color-scheme:dark;
  --paper:#1F1B16;--ink:#EFE9DA;--soft:#C2B9A6;--rule:#57503F;--rule-soft:#453F33;
  --highlight:#5DB3AB;--highlight-strong:#8FCFC7;--highlight-soft:#1D3835;--on-highlight:#1F1B16;--on-highlight-strong:#1F1B16;--field-green:#262B22;--field-sand:#27231C;
  --focus:#9DB4F0;
}

*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;scroll-padding-top:calc(var(--bar) + 12px)}
body{margin:0;background:var(--paper);color:var(--ink);font-family:var(--serif);font-size:1.3125rem;line-height:1.52;font-weight:400;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;overflow-wrap:break-word}
h1,h2,h3,h4,p,ol,ul,dl,dd,figure,table{margin:0}
ol,ul{padding:0;list-style:none}
img,svg{display:block}
a{color:inherit;text-decoration-thickness:1px;text-underline-offset:.2em}
button,input{font:inherit;color:inherit}
:focus-visible{outline:2px solid var(--focus);outline-offset:3px}
[hidden]{display:none !important}
.vh{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.skip{position:absolute;left:1rem;top:-5rem;z-index:60;background:var(--ink);color:var(--paper);padding:.5rem .9rem;font-family:var(--sans);font-size:1.0625rem}
.skip:focus{top:.5rem}

h1{font-weight:400;font-size:clamp(2.7rem,5vw,4.6rem);line-height:.98;letter-spacing:-.012em;text-wrap:balance}
h2{font-weight:400;font-size:clamp(2.1rem,3.3vw,2.9rem);line-height:1.05;letter-spacing:-.006em;text-wrap:balance}
h3{font-family:var(--caps);font-weight:500;font-size:1.3125rem;letter-spacing:.04em;line-height:1.2}
.lead{font-size:1.4375rem;line-height:1.42;max-width:var(--measure-lead)}
.lead + .lead{margin-top:.9em}
.page,.wrap{max-width:var(--page-max);margin:0 auto;padding:0 var(--page-gutter)}
/* A label is centred by its capitals, not by its line: the line is set to the
   height of the type and trimmed to the capitals and the baseline, so equal
   padding above and below is equal space around the letters. Where a browser
   cannot trim, a little more padding above does the same for this face. */
.btn{display:inline-block;padding:.95rem 1.5rem;border:1px solid var(--highlight);border-radius:999px;text-decoration:none;font-family:var(--sans);font-weight:500;font-size:1.125rem;line-height:1.2;text-box:trim-both cap alphabetic;background:var(--highlight);color:var(--on-highlight);cursor:pointer;transition:background-color .2s,color .2s}
.btn:hover{background:var(--highlight-strong);border-color:var(--highlight-strong);color:var(--on-highlight-strong)}
@supports not (text-box-trim:trim-both){.btn{padding:.64rem 1.5rem .58rem}}
.btn-quiet{background:transparent;color:var(--ink);border-color:var(--ink)}
.btn-quiet:hover{background:var(--ink);color:var(--paper)}

/* top bar */
.bar{position:sticky;top:0;z-index:30;height:var(--bar);display:flex;align-items:center;gap:1.75rem;padding:0 max(var(--page-gutter),calc((100% - var(--page-max)) / 2 + var(--page-gutter)));background:var(--paper);color:var(--ink);border-bottom:1px solid var(--rule)}
.mark{font-family:var(--caps);font-size:1.125rem;letter-spacing:.06em;font-weight:500;text-decoration:none;white-space:nowrap}
.bar-link,.index summary{font-family:var(--sans);font-size:1.0625rem}
.bar-link{text-decoration:none;white-space:nowrap}
.bar-link:hover,.bar-link[aria-current="page"]{text-decoration:underline}
.bar-nav{display:flex;gap:1.75rem}
.index summary{list-style:none;cursor:pointer;display:flex;align-items:center;gap:.55rem;user-select:none;white-space:nowrap;line-height:1}
.index summary::-webkit-details-marker{display:none}
.index.menu summary::before{content:"";width:9px;height:9px;border-radius:50%;background:var(--highlight)}
.index.menu{display:none}


.sheet{position:fixed;left:0;right:0;top:var(--bar);bottom:0;overflow:auto;background:#1F1B16;color:#EFE9DA;padding:clamp(1.5rem,6vh,4rem) clamp(1.25rem,6vw,6rem) 4rem}
.sheet-title{font-family:var(--serif);font-size:clamp(2.2rem,5vw,3.4rem);line-height:1;margin-bottom:2rem}

/* footer */
.foot{background:#1F1B16;color:#EFE9DA;padding:3rem 0 3.5rem;font-family:var(--sans);font-size:1rem;line-height:1.55;border-top:1px solid #57503F}
.foot .mark{display:block;margin-bottom:1rem}
.foot p{color:#C2B9A6}
.foot p.mark,.foot a{color:#EFE9DA}
.scheme{margin-top:1rem;padding:0;border:0;background:none;color:#EFE9DA;text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:.2em;cursor:pointer}

@media (max-width:899px){
  body{font-size:1.1875rem}
  .bar{gap:1rem}
  .bar-nav{display:none}
  .index.menu{display:block}
}
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation:none !important;transition:none !important;scroll-behavior:auto !important}
}
