/* Handbook theme.
   Vocabulary taken from the app and from drafting: a dashed line is construction or
   practice, a solid line is finished work; a filled dot is a handle ("you are here");
   the three axis colors are the app's own and are used only for axes. */

@font-face { font-family: "Atkinson Next"; src: url(fonts/AtkinsonHyperlegibleNext.ttf) format("truetype");
  font-weight: 200 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Atkinson Next"; src: url(fonts/AtkinsonHyperlegibleNext-Italic.ttf) format("truetype");
  font-weight: 200 800; font-style: italic; font-display: swap; }

:root {
  --paper: #eef1f0;        /* drafting film */
  --paper-2: #e3e8e7;      /* a sheet laid on the film */
  --ink: #1f2427;          /* graphite */
  --soft: #566067;
  --line: #c3cccd;
  --blue: #136f91;         /* construction blue: links, the horizon */
  --blue-line: #7fb9cc;
  --x: #d6392f; --y: #178f40; --z: #1c6be0;   /* the app's axis colors, deepened for light paper */
  --accent: var(--blue);
  --bg: var(--paper); --panel: var(--paper-2);   /* names the diagrams may use */
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1a1e21; --paper-2: #242a2e; --ink: #e4e9e9; --soft: #9ba7ac; --line: #3a4348;
    --blue: #72c4e0; --blue-line: #3f7f95;
    --x: #ff5a4f; --y: #34c759; --z: #3d8bff;   /* exactly as the app draws them */
  }
}

* { box-sizing: border-box; }
html { scroll-padding-top: 4.5rem; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink);
  font: 400 18px/1.55 "Atkinson Next", "Atkinson Hyperlegible", Verdana, sans-serif; }
a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 3px; }

/* Top bar */
.bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: .75rem;
  padding: .55rem 1.25rem; background: var(--paper); border-bottom: 1.5px solid var(--ink); }
.brand { font-weight: 700; font-size: 1rem; letter-spacing: -.01em; color: var(--ink); text-decoration: none; white-space: nowrap; }
#menu { display: none; font: inherit; font-size: .9rem; font-weight: 600; background: none; color: var(--ink);
  border: 1.5px solid var(--ink); border-radius: 4px; padding: .1rem .6rem; }
.search { position: relative; margin-left: auto; width: min(22rem, 52vw); }
#q { width: 100%; font: inherit; font-size: .9rem; padding: .3rem .65rem; color: var(--ink);
  background: var(--paper); border: 1px solid var(--soft); border-radius: 4px; }
#q::placeholder { color: var(--soft); }
#results { position: absolute; right: 0; left: 0; top: 2.35rem; margin: 0; padding: .25rem; list-style: none;
  max-height: 70vh; overflow: auto; background: var(--paper); border: 1.5px solid var(--ink); border-radius: 4px; }
#results a { display: block; padding: .4rem .6rem; border-radius: 3px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: .95rem; }
#results a:hover, #results a:focus { background: var(--paper-2); }
#results small { display: block; font-weight: 400; font-size: .82rem; line-height: 1.4; color: var(--soft); }

/* Home: the draggable construction */
.hero { border-bottom: 1.5px solid var(--ink); background: var(--paper); }
.hero svg { display: block; width: 100%; height: clamp(15rem, 44vh, 24rem); touch-action: none; user-select: none; -webkit-user-select: none; }
.hero p { max-width: 76rem; margin: 0 auto; padding: .1rem 1.25rem 1.1rem;
  font-size: clamp(1.3rem, 2.6vw, 2rem); font-weight: 600; line-height: 1.2; letter-spacing: -.015em; }
.h-horizon { stroke: var(--blue); stroke-width: 1.5; }
.h-con { fill: none; stroke-width: 1.1; opacity: .8; }
.h-x { stroke: var(--x); }                                   /* the app's dash patterns: X solid, */
.h-y { stroke: var(--y); stroke-dasharray: 9 5; }             /* Y long dash, */
.h-z { stroke: var(--z); stroke-dasharray: 9 4 2 4; }         /* Z dot-dash */
.h-face { fill: var(--paper); stroke: var(--ink); stroke-width: 2.4; stroke-linejoin: round; }
.h-face.shade { fill: var(--paper-2); }
.h-dot { stroke: var(--paper); stroke-width: 2.5; }
.h-dot.x { fill: var(--x); } .h-dot.z { fill: var(--z); }
.h-ring { fill: var(--paper); stroke: var(--ink); stroke-width: 2.4; }
.h-grab { fill: transparent; cursor: grab; outline: none; }
.h-grab:active { cursor: grabbing; }
.h-grab:focus-visible + .h-focus { opacity: 1; }
.h-focus { fill: none; stroke: var(--blue); stroke-width: 2; opacity: 0; pointer-events: none; }

/* Frame */
.frame { display: grid; grid-template-columns: 16.5rem minmax(0, 1fr); max-width: 76rem; margin: 0 auto; }
#nav { position: sticky; top: 3rem; align-self: start; max-height: calc(100vh - 3rem); overflow: auto;
  padding: 1.4rem 1rem 3rem 1.25rem; font-size: .9rem; line-height: 1.35; }
#nav h2 { margin: 1.3rem 0 .35rem; font-size: .9rem; font-weight: 700; }
#nav h2:first-child { margin-top: 0; }
#nav ul { list-style: none; margin: 0; padding: 0; }
#nav a { position: relative; display: block; padding: .22rem 0 .22rem 1.05rem; color: var(--soft); text-decoration: none; }
#nav a:hover { color: var(--ink); text-decoration: underline; }
#nav a.here { color: var(--ink); font-weight: 700; }
#nav a.here::before { content: ""; position: absolute; left: 0; top: .5em; width: .52rem; height: .52rem;
  border-radius: 50%; background: var(--blue); }

main { padding: 2.2rem 2.5rem 4rem; min-width: 0; }
article { max-width: 38rem; }
article > :first-child { margin-top: 0; }

h1 { margin: 0 0 1.4rem; padding-bottom: .9rem; border-bottom: 1.5px solid var(--blue-line);
  font-size: clamp(2rem, 4.2vw, 2.67rem); font-weight: 750; line-height: 1.08; letter-spacing: -.025em; }
h2 { margin: 2.6rem 0 .6rem; font-size: 1.5rem; font-weight: 700; line-height: 1.2; letter-spacing: -.015em; }
h3 { margin: 1.8rem 0 .35rem; font-size: 1.17rem; font-weight: 700; line-height: 1.3; }
h4 { margin: 1.4rem 0 .3rem; font-size: 1rem; font-weight: 700; }
p, ul, ol, dl, table, figure, .admonition { margin: 0 0 1.1rem; }
ul, ol { padding-left: 1.4rem; }
li { margin: .25rem 0; }
li > ul, li > ol { margin-bottom: .2rem; }
ol > li::marker { font-weight: 700; }
strong { font-weight: 700; }

img { display: block; max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 6px; }
figure { margin-left: 0; margin-right: 0; }
figure.diagram svg { display: block; max-width: 100%; height: auto; color: var(--ink); }
figcaption { margin-top: .45rem; font-size: .87rem; line-height: 1.4; color: var(--soft); }

kbd { font: 600 .82em "Atkinson Next", sans-serif; padding: .08em .42em; white-space: nowrap;
  border: 1px solid var(--soft); border-bottom-width: 2.5px; border-radius: 4px; }
code { font: .86em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--paper-2); padding: .1em .3em; border-radius: 3px; }

table { display: block; overflow-x: auto; border-collapse: collapse; font-size: .92rem; line-height: 1.45; }
th, td { text-align: left; vertical-align: top; padding: .5rem .9rem .5rem 0; border-bottom: 1px solid var(--line); }
th { font-weight: 700; border-bottom: 1.5px solid var(--ink); white-space: nowrap; }
dt { font-weight: 700; margin-top: 1rem; }
dd { margin: .15rem 0 0; }

/* Callouts. Platform notes and plain notes: a rule in the margin.
   "Try it" is practice, so it is drawn dashed like a construction line.
   "Careful" is boxed solid. */
.admonition { padding: .1rem 0 .1rem 1rem; border-left: 3px solid var(--line); font-size: .95rem; }
.admonition > :last-child { margin-bottom: 0; }
.admonition-title { margin: 0 0 .2rem; font-weight: 700; }
.admonition.apple, .admonition.mac, .admonition.android { border-left-color: var(--ink); }
.admonition.try { padding: .8rem 1rem; border: 1.5px dashed var(--blue); border-radius: 4px; }
.admonition.try > .admonition-title { color: var(--blue); }
.admonition.warning { padding: .8rem 1rem; border: 1.5px solid var(--ink); border-radius: 4px; background: var(--paper-2); }

.steps { display: flex; justify-content: space-between; gap: 2rem; max-width: 38rem; margin-top: 3.5rem;
  padding-top: 1rem; border-top: 1px solid var(--line); font-size: .95rem; line-height: 1.3; }
.steps a { font-weight: 700; }
.steps span { display: block; font-weight: 400; font-size: .82rem; color: var(--soft); }
.steps .next { margin-left: auto; text-align: right; }

@media (max-width: 860px) {
  body { font-size: 17px; }
  .frame { display: block; }
  #menu { display: block; }
  #nav { display: none; position: static; max-height: none; padding: 1rem 1.25rem 1.5rem; border-bottom: 1.5px solid var(--ink); }
  #nav.open { display: block; }
  main { padding: 1.4rem 1.25rem 3rem; }
  .brand { font-size: .92rem; }
}
@media print {
  .bar, #nav, .steps, .hero { display: none; }
  .frame { display: block; }
  body { background: #fff; color: #000; font-size: 11pt; }
}
