/* The palette (the five finger colors, paper, ink, rules, light and dark) is
   copied from core/tokens.css by bin/build-tokens.sh. Edit it there. */
/* BEGIN generated from core/tokens.css — do not edit; run bin/build-tokens.sh */
:root {
  color-scheme: light dark;
  --thumb: #b3261e;   /* Blockers - strongest */
  --index: #c9661d;   /* Critical */
  --middle: #a98b1a;  /* Normal */
  --ring: #3b6a8c;    /* Backlog */
  --pinky: #8a8f8c;   /* Notes - weakest */
  --ink: #2b2620;
  --paper: #f6efe1;
  --sheet: #fffdf8;
  --rule: #d9cdb5;
  --stamp: #b3261e;
  --muted: #8a7d68;
  --body: #5b5244;
  /* A question breaks out of the palette entirely rather than adding a
     sixth hue to it: a literal highlighter yellow, the one color on the
     page that isn't dusty paper-and-ink. By night it is a deep mustard, the
     highlighter seen through a dark page. */
  --highlight: #ffe066;
  --paper-line: rgba(43, 38, 32, .06);
  --sheet-shadow: #d9cdb5;
}

@media (prefers-color-scheme: dark) {
  :root {
    --thumb: #f07a6e;
    --index: #ea9250;
    --middle: #d1b04c;
    --ring: #6fa8d6;
    --pinky: #9fa4a0;
    --ink: #f0e8d8;
    --paper: #1c1814;
    --sheet: #26211b;
    --rule: #4a4236;
    --stamp: #f07a6e;
    --muted: #a99c85;
    --body: #cfc5b0;
    --highlight: #4f3f08;
    --paper-line: rgba(240, 232, 216, .05);
    --sheet-shadow: #0e0c09;
  }
}
/* END generated from core/tokens.css */

/* What only this page needs. Each is paper-and-ink by day, and by night the
   same idea on the dark paper: the washes are the finger colors, lifted. */
:root {
    --wash: #efe6d2;
    --wash-blockers: rgba(179, 38, 30, .10);
    --wash-critical: rgba(201, 102, 29, .12);
    --wash-normal: rgba(169, 139, 26, .14);
    --wash-backlog: rgba(59, 106, 140, .11);
    --wash-notes: rgba(138, 143, 140, .15);
    --stamp-wash: rgba(255, 255, 255, .4);
    --code-bg: #fff;
    --code-edge: #b7a98b;
    --avatar-bg: #d8ccb2;
    --avatar-edge: #fff;
    --mono: "Courier New", Courier, monospace;
    --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        --wash: #322c23;
        --wash-blockers: rgba(240, 122, 110, .14);
        --wash-critical: rgba(234, 146, 80, .14);
        --wash-normal: rgba(209, 176, 76, .14);
        --wash-backlog: rgba(111, 168, 214, .14);
        --wash-notes: rgba(159, 164, 160, .14);
        --stamp-wash: rgba(240, 232, 216, .05);
        --code-bg: var(--paper);
        --code-edge: #5c5242;
        --avatar-bg: #4a4236;
        --avatar-edge: var(--sheet);
    }
}

* {
    box-sizing: border-box;
}

/* 106.25% of the reader's own default is the 17px base, and it makes 1rem
   mean that base everywhere. Setting it on body instead leaves rem resolving
   against the root's 16px, so every "1rem" lands a pixel under body text. */
html {
    font-size: 112.5%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--paper);
    background-image: repeating-linear-gradient(transparent 0 27px, var(--paper-line) 27px 28px);
    font-family: var(--serif);
    line-height: 1.65;
}

.page {
    max-width: 640px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

a {
    color: var(--ink);
    text-decoration: none;
    border-bottom: 1px solid var(--stamp);
}

a:hover {
    color: var(--stamp);
}

p {
    margin: 0 0 1rem;
}

code {
    font-family: var(--mono);
    background: var(--wash);
    padding: .1em .35em;
    font-size: .9em;
}

/* Header */

header {
    text-align: center;
    padding: 3.5rem 0 2.5rem;
}

.clock {
    /* logo.2026.A; the circle is 110/112 of the box, so 57px keeps the old 56px dial */
    width: 57px;
    height: 57px;
    margin: 0 auto 1rem;
    background: url("../images/logo.svg") center / contain no-repeat;
}

@media (prefers-color-scheme: dark) {
    .clock {
        background-image: url("../images/logo-dark.svg");
    }
}

h1 {
    margin: 0;
    font-size: clamp(2.4rem, 7vw, 3.6rem);
    font-weight: 400;
    letter-spacing: -.01em;
    line-height: 1.1;
}

h1 sup {
    font-size: .35em;
    vertical-align: super;
    margin-left: -5px;
    line-height: 1;
}

.tag {
    display: block;
    margin: .9rem auto .5rem;
    font-family: var(--mono);
    font-weight: 700;
    font-size: .8rem;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--stamp);
}

.lede {
    margin: .5rem auto 0;
    max-width: 40ch;
    font-size: 1.15rem;
    font-style: italic;
    color: var(--body);
}

.pitch {
    margin: 1.25rem auto 0;
    max-width: 50ch;
    font-size: 1.05rem;
    color: var(--body);
}

.cta {
    margin: 1.25rem auto 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .6rem;
}

.btn {
    display: inline-block;
    padding: .55rem 1rem;
    font-family: var(--mono);
    font-size: .75rem;
    line-height: 1.65;
    letter-spacing: .1em;
    text-transform: uppercase;
    border: 2px solid var(--ink);
    background: var(--sheet);
    color: var(--ink);
    cursor: pointer;
}

.btn:hover {
    background: var(--ink);
    color: var(--paper);
}

/* Sections */

section {
    padding: 1.75rem 0;
}

section + section {
    border-top: 1px solid var(--rule);
}

h2 {
    margin: 0 0 1rem;
    font-family: var(--mono);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: .15em;
    text-transform: uppercase;
    color: var(--muted);
}

h2::before,
h2::after {
    content: " — ";
}

/* The Structure*/

.sheet {
    background: var(--sheet);
    border: 1px solid var(--rule);
    box-shadow: 4px 4px 0 var(--sheet-shadow);
    padding: 1.5rem 1.5rem 1.75rem;
}

.code-wrap {
    position: relative;
}

.code-wrap pre {
    margin: 0;
    overflow-x: auto;
    white-space: pre-wrap;
    padding: 1.1rem 1.25rem;
    font-family: var(--mono);
    font-size: .95rem;
    line-height: 1.55;
    background: var(--code-bg);
    border: 1px dashed var(--code-edge);
    color: var(--ink);
}

.copy-btn,
.replay-btn {
    position: absolute;
    top: .6rem;
    right: .6rem;
    padding: .35rem .7rem;
    font-family: var(--mono);
    font-size: .7rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    border: 2px solid var(--ink);
    background: var(--paper);
    color: var(--ink);
    cursor: pointer;
}

.copy-btn:hover,
.replay-btn:hover {
    background: var(--ink);
    color: var(--paper);
}

.sheet .fine {
    margin: .9rem 0 0;
    font-size: .95rem;
    color: var(--body);
}

/* The Five */

.defs-lede,
.practice-lede,
.syntax-lede {
    font-size: 1rem;
    color: var(--body);
}

dl {
    margin: 0;
}

dl div {
    display: grid;
    grid-template-columns: 8.5rem 1fr;
    gap: 1rem;
    align-items: baseline;
    padding: .6rem 0;
    border-top: 1px dotted var(--rule);
}

dl div:first-child {
    border-top: 0;
}

dt {
    font-family: var(--mono);
    font-weight: 700;
    font-size: .95rem;
    white-space: nowrap;
}

dt::before {
    /*content: "## ";*/
    font-weight: 400;
    color: var(--muted);
}

.defs dl div:nth-child(1) dt {
    color: var(--thumb);
}

.defs dl div:nth-child(2) dt {
    color: var(--index);
}

.defs dl div:nth-child(3) dt {
    color: var(--middle);
}

.defs dl div:nth-child(4) dt {
    color: var(--ring);
}

.defs dl div:nth-child(5) dt {
    color: var(--pinky);
}

dd {
    margin: 0;
    font-size: 1rem;
}

/* Quick Start */

.quick .fine {
    margin: .25rem 0 0 2.4rem;
    font-size: .95rem;
    color: var(--body);
}

/* The Lines */

.grammar {
    width: 100%;
    border-collapse: collapse;
    font-size: .95rem;
}

.grammar th,
.grammar td {
    padding: .5rem .6rem .5rem 0;
    text-align: left;
    vertical-align: top;
    border-top: 1px dotted var(--rule);
}

.grammar th {
    border-top: 0;
    font-family: var(--mono);
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .15em;
    text-transform: uppercase;
    color: var(--muted);
}

.grammar td:first-child {
    font-family: var(--mono);
    font-weight: 700;
    white-space: nowrap;
}

.grammar code {
    white-space: nowrap;
}
.syntax .fine {
    margin: .9rem 0 0;
    font-size: .95rem;
    color: var(--body);
}

/* How It Works */

.how-lede {
    font-size: 1rem;
    color: var(--body);
}

.rules {
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: r;
}

.rules li {
    counter-increment: r;
    position: relative;
    padding-left: 2.4rem;
    margin-bottom: .9rem;
}

.rules li::before {
    content: counter(r) ".";
    position: absolute;
    left: 0;
    top: .05rem;
    font-family: var(--mono);
    font-weight: 700;
    color: var(--stamp);
}

.rules b {
    font-weight: 400;
    font-style: italic;
}

/* Why Five */

.mnemonic {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 1.5rem;
    align-items: center;
}

.hand {
    width: 100%;
    height: auto;
    display: block;
}

.mnemonic p {
    margin: 0;
    font-size: 1rem;
}

.fingers {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: .3rem;
    list-style: none;
    margin: 1.5rem 0 0;
    padding: 0;
    font-family: var(--mono);
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    text-align: center;
}

.fingers span {
    display: block;
    font-weight: 400;
    color: var(--muted);
}

.finger--blockers {
    color: var(--thumb);
}

.finger--critical {
    color: var(--index);
}

.finger--normal {
    color: var(--middle);
}

.finger--backlog {
    color: var(--ring);
}

.finger--notes {
    color: var(--pinky);
}

/* FAQ */

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.faq-item {
    padding-top: 1rem;
    border-top: 1px dotted var(--rule);
}

.faq-item:first-child {
    padding-top: 0;
    border-top: 0;
}

.faq-q {
    margin: 0 0 .35rem;
    font-weight: 700;
}

.faq-q::before {
    content: "Q. ";
    font-family: var(--mono);
    font-weight: 700;
    color: var(--stamp);
}

.faq-a {
    margin: 0;
    font-size: 1rem;
    color: var(--body);
}

/* In Practice */

.notations {
    list-style: none;
    margin: 1rem 0 0;
    padding: 0;
    font-size: .95rem;
    color: var(--body);
}

.note {
    position: relative;
    padding: .2rem .5rem .2rem 1.7rem;
    margin-bottom: .25rem;
    border-left: 3px solid transparent;
}

.note::before {
    content: "\2192";
    position: absolute;
    left: .5rem;
    color: var(--stamp);
}

/* Each annotation carries its own heading's color, so the five colors taught
   in The Five, the hand and the file icons mean the same thing here. The free
   space above the headings belongs to no heading, so it takes the paper rule. */
.note--preamble {
    border-left-color: var(--rule);
}

.note--blockers {
    border-left-color: var(--thumb);
}

.note--critical {
    border-left-color: var(--index);
}

.note--normal {
    border-left-color: var(--middle);
}

.note--backlog {
    border-left-color: var(--ring);
}

.note--notes {
    border-left-color: var(--pinky);
}

.note b {
    font-weight: 400;
    font-style: italic;
    color: var(--ink);
}

/* Downloads */

.downloads-lede {
    font-size: 1rem;
    color: var(--body);
}

.downloads {
    list-style: none;
    margin: 0;
    padding: 0;
}

.downloads li + li {
    border-top: 1px dotted var(--rule);
}

.dl {
    display: grid;
    grid-template-columns: 44px 1fr;
    column-gap: .9rem;
    align-items: center;
    padding: .7rem 0;
}

/* The icon is a second link to the same file, hidden from assistive tech so
   the row reads as one link; the name is the one that takes focus. */
.dl-icon {
    grid-row: 1 / 3;
    display: block;
    border-bottom: 0;
    color: inherit; /* the row's color, not the link color, so the icon keeps its hue */
}

.file-icon {
    width: 44px;
    height: auto;
    display: block;
}

.file-icon text {
    font-family: monospace;
    font-size: 11px;
    font-weight: 700;
    text-anchor: middle;
    fill: var(--sheet);
}

.dl--md {
    color: var(--thumb);
}

.dl--txt {
    color: var(--index);
}

.dl--docx {
    color: var(--middle);
}

.dl--xlsx {
    color: var(--ring);
}

.dl--pdf {
    color: var(--pinky);
}

.dl--remarkable {
    color: var(--index);
}

.dl--paper {
    color: var(--ring);
}

.dl--alfred {
    color: var(--thumb);
}

.dl--raycast {
    color: var(--index);
}

.dl--espanso {
    color: var(--middle);
}

.dl--vscode {
    color: var(--ring);
}

.dl--jetbrains {
    color: var(--pinky);
}

.dl--marked {
    color: var(--thumb);
}

.dl--desk {
    color: var(--thumb);
    align-items: start; /* a long description; the icon sits by the name, not mid-paragraph */
}

.downloads-sub {
    margin: 1.75rem 0 .5rem;
    font-family: var(--mono);
    font-size: .9rem;
    font-weight: 600;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--muted);
}

.downloads-sub + .downloads-lede {
    margin-bottom: .5rem;
}

.dl-name {
    color: currentColor;
}

.dl-name {
    grid-column: 2;
    justify-self: start;
    font-family: var(--mono);
    font-weight: 700;
    font-size: .95rem;
    color: var(--ink);
    border-bottom: 0;
}

.dl-name:hover,
.dl-icon:hover + .dl-name {
    color: var(--stamp);
    text-decoration: underline;
}

.dl-apps {
    grid-column: 2;
    margin: 0;
    font-size: .9rem;
    color: var(--body);
}

/* Pass It On */

.pass {
    text-align: center;
}

.pass .tag {
    margin: .25rem auto .75rem;
}

/* A snapshot, not a sheet: a square print, cropped to the mug, tilted like the stamp. */
.pass-photo {
    display: block;
    box-sizing: border-box;
    width: min(320px, 75%);
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
    object-position: 54% 50%;
    margin: 2.5rem auto 0;
    padding: .6rem .6rem 2rem;
    background: var(--sheet);
    border: 1px solid var(--rule);
    box-shadow: 4px 4px 0 var(--sheet-shadow);
    transform: rotate(2deg);
}

.pass-lede {
    max-width: 48ch;
    margin: .5rem auto 1.25rem;
    color: var(--body);
}

.pass .sheet {
    text-align: left;
}

/* Do Credit */

.bio {
    margin: 1.5rem 0 4rem;
    padding-top: 1.5rem;
    border-top: 3px double var(--rule);
    display: flex;
    gap: 1.25rem;
    align-items: center;
}

.avatar {
    width: 144px;
    height: 144px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--avatar-bg);
    border: 3px solid var(--avatar-edge);
    box-shadow: 0 0 0 1px var(--rule);
}

.bio h3 {
    margin: 0 0 .3rem;
    font-family: var(--mono);
    font-size: .9rem;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--muted);
}

.bio p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.5;
}

.copyright {
    margin: -2.75rem 0 1.5rem;
    text-align: center;
    font-size: .75rem;
    color: var(--muted);
}

/* Not My Own */
blockquote {
    margin: 0;
    padding: 0;
    font-style: italic;
    font-size: 1.05rem;
    color: var(--body);
}

blockquote > *:last-child {
    margin-bottom: 0;
}

.signature {
    text-align: right;
}

/* Bio as an in-page section (index.html), ahead of Pass It On */
section.bio {
    margin: 0;
}

/* On index.html the footer follows a section, not footer.bio, so the pull-up
   margin that tucks it under the bio's bottom margin doesn't apply. */
section + footer > .copyright {
    margin-top: 0;
}

@media (max-width: 480px) {
    h2,
    h3 {
        font-size: 0.9rem;
    }

    .cta {
        flex-direction: column;
        align-items: stretch;
    }

    .btn {
        text-align: center;
    }

    dl div {
        grid-template-columns: 1fr;
        gap: .15rem;
    }

    .mnemonic {
        grid-template-columns: 1fr;
    }

    .hand {
        max-width: 150px;
        margin: 0 auto;
    }

    .fingers {
        grid-template-columns: 1fr;
        gap: .4rem;
        text-align: left;
    }

    .fingers span {
        display: inline-block;
        width: 8ch; /* "MIDDLE" plus its letter-spacing; the headings line up after it */
    }

    .bio {
        flex-direction: column;
        text-align: left;
    }

    .code-wrap pre {
        font-size: .82rem;
        border: 0;
    }

    .sheet {
        padding: 0 0 .5rem; /* the last note was touching the bottom edge */
    }

    .grammar thead {
        display: none;
    }

    .grammar tr {
        display: grid;
        grid-template-columns: 6.5rem 1fr;
        column-gap: .6rem;
        padding: .5rem 0;
        border-top: 1px dotted var(--rule);
    }

    .grammar td {
        border-top: 0;
        padding: 0;
    }
    .copy-btn,
    .replay-btn {
        position: static;
        display: block;
        margin: 0 0 .5rem auto;
    }

}

.code-wrap .share,
.share {
    padding-top: 60px;
}
