/* The guide: one calm page in the app's type and colours, light and dark. It follows the app's own choice of
   light or dark (guide.js reads it), and the device's otherwise. */
@font-face {
  font-family: Archivo;
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url(../fonts/archivo-latin.woff2) format('woff2');
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: Archivo;
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url(../fonts/archivo-latin-ext.woff2) format('woff2');
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF,
    U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
:root {
  color-scheme: light dark;
  --bg: light-dark(#fff, #0e0e0e);
  --ink: light-dark(#000, #f2f2f2);
  --mute: light-dark(#6e6e6e, #8e8e8e);
  --red: light-dark(#e4002b, #ff3d50);
  --line: light-dark(rgb(0 0 0/0.085), rgb(255 255 255/0.1));
  --line2: light-dark(rgb(0 0 0/0.44), rgb(255 255 255/0.4));
  --hover: light-dark(rgb(0 0 0/0.045), rgb(255 255 255/0.07));
  --edge: light-dark(rgb(0 0 0/0.09), rgb(255 255 255/0.11));
  --plate: light-dark(#f5f5f7, #000);
  --top: 56px;
  --gut: max(20px, env(safe-area-inset-left), env(safe-area-inset-right));
}
:root[data-theme='light'] {
  color-scheme: light;
}
:root[data-theme='dark'] {
  color-scheme: dark;
}
/* Each picture comes in light and dark: the one for the other look is never shown, so never loaded. */
.d {
  display: none !important;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .l {
    display: none !important;
  }
  :root:not([data-theme='light']) .d {
    display: block !important;
  }
}
:root[data-theme='dark'] .l {
  display: none !important;
}
:root[data-theme='dark'] .d {
  display: block !important;
}

* {
  box-sizing: border-box;
}
html {
  scroll-padding-top: calc(var(--top) + 20px);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    17px/1.65 Archivo,
    'Helvetica Neue',
    Arial,
    system-ui,
    sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  text-wrap: pretty;
}
a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--line2);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: text-decoration-color 0.2s;
}
a:hover {
  text-decoration-color: currentColor;
}
:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 4px;
}
b,
strong {
  font-weight: 650;
}
code {
  font: 0.86em/1 ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
  padding: 0.18em 0.4em;
  border-radius: 6px;
  background: var(--hover);
  box-shadow: inset 0 0 0 1px var(--line);
  white-space: nowrap;
}
kbd {
  display: inline-block;
  min-width: 1.7em;
  padding: 0.12em 0.45em;
  border-radius: 6px;
  font: 600 0.8em/1.45 Archivo, system-ui, sans-serif;
  text-align: center;
  white-space: nowrap;
  box-shadow:
    inset 0 0 0 1px var(--line2),
    inset 0 -1.5px 0 var(--line2);
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 20;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
}
.skip:focus {
  top: 10px;
}

/* the bar: the app's name, where you are, the way back to the app, and a rule that fills as you read */
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--top);
  padding: 0 var(--gut);
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(18px);
  backdrop-filter: saturate(1.6) blur(18px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 750;
  font-variation-settings: 'wdth' 108;
  letter-spacing: -0.015em;
  text-decoration: none;
}
.brand img {
  display: block;
  border-radius: 7px;
}
.crumb {
  color: var(--mute);
}
.here {
  color: var(--mute);
  font-weight: 550;
}
.open {
  margin-left: auto;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: inset 0 0 0 1.25px var(--line2);
  transition: background-color 0.2s;
}
.open:hover {
  background: var(--hover);
}
/* On this page, narrower: a button in the bar (its icon alone on a phone), and the list in a sheet like the app's */
.tocb {
  display: none;
}
.tocb svg,
.tocd-x svg,
.hl svg,
.prompt .btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tocb svg circle {
  fill: currentColor;
  stroke: none;
}
@media (max-width: 1119px) {
  .tocb {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-left: auto;
    height: 34px;
    padding: 0 13px 0 11px;
    border: 0;
    border-radius: 999px;
    background: none;
    color: inherit;
    font: 600 14px/1 Archivo, system-ui, sans-serif;
    box-shadow: inset 0 0 0 1.25px var(--line2);
    cursor: pointer;
    transition: background-color 0.2s;
  }
  .tocb:hover {
    background: var(--hover);
  }
  .tocb + .open {
    margin-left: 0;
  }
}
@media (max-width: 599px) {
  .tocb {
    justify-content: center;
    width: 34px;
    padding: 0;
  }
  .tocb span {
    display: none;
  }
}
.tocd {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgb(0 0 0 / 0.32);
}
.tocd[hidden] {
  display: none;
}
.tocd-sheet {
  display: flex;
  flex-direction: column;
  width: min(560px, 100%);
  max-height: min(80vh, 720px);
  padding: 6px 0 calc(10px + env(safe-area-inset-bottom));
  border-radius: 22px 22px 0 0;
  background: var(--bg);
  box-shadow:
    0 0 0 1px var(--line),
    0 -16px 40px -16px rgb(0 0 0 / 0.3);
}
.tocd-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 10px 4px 22px;
}
.tocd-t {
  margin: 0;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: var(--mute);
}
.tocd-x {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--mute);
  cursor: pointer;
}
.tocd-x:hover {
  background: var(--hover);
  color: var(--ink);
}
.tocd nav {
  position: relative;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 10px 22px 12px;
  /* a line cut at either edge fades, like the app's lists that scroll */
  -webkit-mask-image: linear-gradient(transparent, #000 14px, #000 calc(100% - 14px), transparent);
  mask-image: linear-gradient(transparent, #000 14px, #000 calc(100% - 14px), transparent);
}
.tocd ol {
  margin: 0;
  padding: 0;
  list-style: none;
}
.tocd .chs > li {
  padding-bottom: 6px;
}
.tocd a {
  display: block;
  padding: 7px 0 7px 22px;
  border-radius: 10px;
  line-height: 1.35;
  color: var(--mute);
  text-decoration: none;
}
.tocd .ch-a {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 0;
  font-weight: 650;
  color: var(--ink);
}
.tocd .n {
  min-width: 14px;
  font-weight: 800;
  font-variation-settings: 'wdth' 112;
  font-variant-numeric: tabular-nums;
  color: var(--mute);
}
.tocd a[aria-current] {
  color: var(--ink);
  font-weight: 600;
}
.tocd .chs > li:has(a[aria-current]) .n {
  color: var(--red);
}
/* the link at the end of a title, always there in grey, darker while the title is under the pointer; a click copies it */
.hl {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin: -4px 0 -4px 6px;
  border-radius: 8px;
  vertical-align: middle;
  color: var(--mute);
  text-decoration: none;
  transition:
    background-color 0.15s,
    color 0.15s;
}
:is(h2, h3, h4):hover .hl,
.hl:focus-visible {
  color: var(--ink);
}
.hl:hover {
  background: var(--hover);
}
:is(h2, h3, h4) .hl.done {
  color: var(--red);
}
/* the paragraph to paste into an assistant, and its Copy button */
.prompt {
  margin: 18px 0;
}
.prompt pre {
  margin: 0 0 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--hover);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.read {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--line);
}
.read i {
  display: block;
  height: 2px;
  margin-top: -0.5px;
  border-radius: 0 2px 2px 0;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: left;
}
@supports (animation-timeline: scroll()) {
  .read i {
    animation: read linear both;
    animation-timeline: scroll(root block);
  }
  @keyframes read {
    to {
      transform: none;
    }
  }
}

/* the page: one column; on a wide screen, "On this page" on the left, by chapter, beside the text */
.page {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  max-width: calc(46rem + 2 * var(--gut));
  margin: 0 auto;
  padding: 0 var(--gut);
}
@media (min-width: 1120px) {
  .page {
    max-width: calc(14rem + 4.5rem + 46rem + 2 * var(--gut));
    grid-template-columns: 14rem minmax(0, 46rem);
    grid-template-rows: auto 1fr;
    grid-template-areas:
      'toc hero'
      'toc body';
    column-gap: 4.5rem;
  }
  .hero {
    grid-area: hero;
  }
  .body {
    grid-area: body;
  }
  .toc {
    grid-area: toc;
    position: sticky;
    top: calc(var(--top) + 28px);
    align-self: start;
    max-height: calc(100vh - var(--top) - 44px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--line2) transparent;
    margin-top: 92px;
    padding: 0 8px 16px 0;
  }
}

.hero {
  padding: clamp(40px, 9vw, 88px) 0 8px;
}
h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: 1.12;
  text-wrap: balance;
}
h1 {
  font-size: clamp(40px, 8vw, 68px);
  font-weight: 800;
  font-variation-settings: 'wdth' 112;
  letter-spacing: -0.045em;
  line-height: 0.98;
}
.lede {
  max-width: 36em;
  margin: 22px 0 0;
  font-size: clamp(18px, 2.2vw, 20px);
  line-height: 1.55;
  color: var(--mute);
}
.acts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: inherit;
  font: 600 15px/1 Archivo, system-ui, sans-serif;
  text-decoration: none;
  box-shadow: inset 0 0 0 1.25px var(--line2);
  cursor: pointer;
  transition:
    background-color 0.2s,
    transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.btn:hover {
  background: var(--hover);
}
.btn:active {
  transform: scale(0.96);
}
.btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.btn.primary {
  background: var(--ink);
  color: var(--bg);
  box-shadow: none;
}
.btn.primary:hover {
  background: color-mix(in srgb, var(--ink) 84%, var(--bg));
}
.status {
  font-size: 14px;
  color: var(--mute);
}

/* On this page: the chapters, each with its sections */
.toc {
  margin: 36px 0 0;
  padding: 20px 0 0;
  border-top: 1px solid var(--line);
  font-size: 15px;
}
.toc-h {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: var(--mute);
}
.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
}
.toc li {
  margin: 0;
  padding: 0;
}
.toc .chs {
  columns: 2;
  column-gap: 28px;
}
.toc .chs > li {
  break-inside: avoid;
  padding-bottom: 14px;
}
.toc a {
  display: block;
  padding: 3px 0 3px 22px;
  line-height: 1.4;
  color: var(--mute);
  text-decoration: none;
  transition: color 0.2s;
}
.toc .ch-a {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 4px 0;
  font-size: 14px;
  font-weight: 650;
  color: var(--ink);
}
/* each chapter's number, set like the app's date; red while you read it, like today's */
.toc .n {
  min-width: 14px;
  font-weight: 800;
  font-variation-settings: 'wdth' 112;
  font-variant-numeric: tabular-nums;
  color: var(--mute);
  transition: color 0.2s;
}
.toc .chs > li:has(a[aria-current]) .n {
  color: var(--red);
}
.toc a:hover,
.toc a[aria-current] {
  color: var(--ink);
}
@media (min-width: 1120px) {
  .toc {
    border-top: 0;
    padding-top: 0;
  }
  .toc .chs {
    columns: auto;
  }
  /* every line keeps 24 px to be pressed (WCAG 2.2): the chapters sit closer, so all of them fit a laptop's screen */
  .toc .chs > li {
    padding-bottom: 2px;
  }
  .toc .ch-a {
    padding: 3px 0;
  }
  .toc ol ol {
    margin: 1px 0 0 4px;
    border-left: 1px solid var(--line);
  }
  .toc ol ol a {
    position: relative;
    padding: 2px 0 2px 17px;
    font-size: 14px;
    line-height: 20px;
  }
  /* where you are: a short red rule over the line */
  .toc ol ol a[aria-current]::before {
    content: '';
    position: absolute;
    left: -1.5px;
    top: 4px;
    bottom: 4px;
    width: 2px;
    border-radius: 2px;
    background: var(--red);
  }
}

/* the text: chapters, each opened by its number as a day is by its date, then their sections */
.body {
  padding-bottom: 40px;
}
.chapter {
  padding-top: 104px;
}
.chapter:first-child {
  padding-top: 56px;
}
.ch {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.ch-n {
  flex: none;
  font-size: clamp(64px, 8vw, 92px);
  font-weight: 800;
  font-variation-settings: 'wdth' 112;
  line-height: 0.8;
  letter-spacing: -0.05em;
  color: var(--line2);
}
.ch h2 {
  font-size: clamp(28px, 4.2vw, 38px);
  font-weight: 800;
  font-variation-settings: 'wdth' 110;
  letter-spacing: -0.035em;
}
.ch p {
  margin: 8px 0 0;
  font-size: 16.5px;
  line-height: 1.5;
  color: var(--mute);
}
.chapter > section {
  padding-top: 56px;
}
h3 {
  font-size: clamp(23px, 3vw, 27px);
  font-weight: 760;
  font-variation-settings: 'wdth' 106;
  letter-spacing: -0.025em;
  margin-bottom: 16px;
}
h4 {
  font-size: 19px;
  font-weight: 680;
  letter-spacing: -0.012em;
  margin: 36px 0 10px;
}
p,
ul,
ol {
  margin: 0 0 16px;
}
ul,
ol {
  padding-left: 1.35em;
}
li {
  margin: 6px 0;
  padding-left: 0.2em;
}
li::marker {
  color: var(--mute);
}
.note {
  margin: 24px 0;
  padding: 16px 20px;
  border-radius: 18px;
  background: var(--hover);
  box-shadow: inset 0 0 0 1px var(--line);
}
.note p {
  margin: 0;
}
.note.warn {
  background: color-mix(in srgb, var(--red) 8%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--red) 30%, transparent);
}

/* pictures from the app, in a soft frame */
.shot {
  margin: 28px 0 36px;
}
.shot picture {
  display: block;
}
.shot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 18px;
  background: var(--plate);
  box-shadow: 0 0 0 1px var(--edge);
}
.shot figcaption {
  margin-top: 12px;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--mute);
}
/* a computer and a phone, side by side */
.duo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 29%;
  gap: 16px;
  align-items: end;
}
.duo figcaption {
  grid-column: 1 / -1;
}
.phone img {
  border-radius: 26px;
}
/* phones in a row */
.strip .row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.strip .phone {
  margin: 0;
}
.strip .phone figcaption {
  margin-top: 10px;
  text-align: center;
}
/* two pictures of the same size, side by side */
.pair .row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

/* keyboard shortcuts */
table {
  width: 100%;
  margin: 8px 0 28px;
  border-collapse: collapse;
  font-size: 15.5px;
}
caption {
  padding: 0 0 6px;
  text-align: left;
  font-weight: 650;
  font-size: 15px;
}
thead th {
  padding: 8px 12px 8px 0;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: var(--mute);
  border-bottom: 1px solid var(--line2);
}
tbody th,
tbody td {
  padding: 10px 12px 10px 0;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
tbody th {
  width: 44%;
  font-weight: 500;
}
td kbd {
  margin: 1px 0;
}

/* the last section: three plain ways to reach me */
#contact .links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}
.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  padding: 22px var(--gut) max(28px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--mute);
}
.foot .brand {
  color: var(--ink);
}
.foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
}
.foot a {
  text-decoration-color: transparent;
}
.foot a:hover {
  color: var(--ink);
  text-decoration-color: currentColor;
}
.foot p {
  margin: 0 0 0 auto;
}

@media (max-width: 599px) {
  body {
    font-size: 16.5px;
  }
  .here,
  .crumb {
    display: none;
  }
  .chapter {
    padding-top: 80px;
  }
  .chapter > section {
    padding-top: 44px;
  }
  .ch {
    gap: 14px;
  }
  .duo {
    gap: 10px;
  }
  .shot img {
    border-radius: 14px;
  }
  .phone img {
    border-radius: 16px;
  }
  .strip .row {
    gap: 10px;
  }
  .strip .phone figcaption {
    font-size: 13px;
  }
  tbody th {
    width: 50%;
  }
  .foot p {
    margin-left: 0;
  }
}
@media (prefers-contrast: more), (forced-colors: active) {
  .shot img,
  .note,
  .btn {
    box-shadow: inset 0 0 0 1px currentColor;
  }
  .shot img {
    box-shadow: 0 0 0 1px currentColor;
  }
}
@media print {
  .top,
  .skip,
  .acts,
  .toc,
  .hl,
  #contact .links {
    display: none;
  }
  section {
    break-inside: auto;
  }
  .shot {
    break-inside: avoid;
  }
}

/* Opened from One Day on the same page (on a phone): it comes up over the day like a drawer (app.css has the way
   back down). */
@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }
  ::view-transition-old(root) {
    animation: none;
  }
  ::view-transition-new(root) {
    animation: vt-up 0.44s cubic-bezier(0.22, 1, 0.36, 1) both;
  }
}
@keyframes vt-up {
  from {
    transform: translateY(100%);
  }
}
