/* Bindery: the brand mark, the home page and the colophon shared by every page.
   Builds on site.css (tapes, fonts) and bujo.css (the cutting mat). */

body.mat.mat--home {
  --mat: #2a2420;
  --mat-line: rgba(240, 226, 204, .09);
  --mat-ink: #e6d9c4;
}

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- the mark: a little bound book and the name, like a spine label ---- */
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--mat-ink, #fff); text-decoration: none;
  font: 800 21px/1 var(--label); letter-spacing: .01em; }
.brand__tld { font-weight: 600; opacity: .55; }
.brand__book { position: relative; width: 22px; height: 28px; border-radius: 2px 4px 4px 2px; background: var(--tape-red);
  box-shadow: inset 4px 0 0 rgba(0,0,0,.28), 0 2px 0 rgba(0,0,0,.25); transform: rotate(-6deg); transition: transform .2s; }
.brand__book::before { content: ''; position: absolute; inset: 6px 4px auto 8px; height: 6px; background: var(--tape-yellow); border-radius: 1px; }
.brand__book::after { content: ''; position: absolute; left: 2px; top: 3px; bottom: 3px; border-left: 1.5px dashed rgba(255,255,255,.55); }
.brand:hover .brand__book { transform: rotate(0); }
/* ---- the masthead: mark, (languages), and the coffee button, on every page ---- */
.mat .masthead { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.mat .masthead .brand { margin-right: auto; }
.mat .masthead .langs { order: 0; flex-basis: auto; margin: 0; position: static; }

/* ---- Buy me a coffee: the same yellow as BMC's own button, so it reads as that at a glance ---- */
.coffee-link { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px 10px 13px; border-radius: 999px; background: #ffdd00; color: #1f1a05;
  font: 800 14px/1 var(--label); letter-spacing: .02em; text-decoration: none; box-shadow: 0 2px 0 #b89f00, 0 6px 14px -6px rgba(0,0,0,.5); transition: transform .15s, box-shadow .15s; white-space: nowrap; }
.coffee-link:hover { transform: translateY(-2px) rotate(-1deg); box-shadow: 0 4px 0 #b89f00, 0 10px 18px -8px rgba(0,0,0,.55); }
.coffee-link svg { flex: none; }
.mat .colophon a.coffee-link { color: #1f1a05; margin-top: 6px; }

/* after a download, the coffee box in the till says thanks */
.mat .coffee--thanks { animation: thanks 1.6s ease-out 1; }
.mat .coffee--thanks p { color: #fff; font-weight: 700; }
@keyframes thanks { 0%, 100% { transform: none; } 15% { transform: scale(1.06) rotate(-1.5deg); } 30% { transform: scale(1.06) rotate(1.5deg); } 45% { transform: none; } }
@media (prefers-reduced-motion: reduce) { .mat .coffee--thanks { animation: none; } }

/* ---- home ---- */
.mat--home .hero { max-width: 1240px; margin: 10px auto 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 520px); gap: 26px 40px; justify-items: start; align-items: start; }
.mat--home .hero > * { grid-column: 1; }
.mat--home .hero > .hero__points { grid-column: 1 / -1; }
.mat--home .hero__art { grid-column: 2; grid-row: 1 / span 3; align-self: center; position: relative; width: 100%; aspect-ratio: 520 / 470; }
.mat--home .hero__art img { position: absolute; width: 86%; height: auto; filter: drop-shadow(0 22px 22px rgba(0,0,0,.45)); }
.mat--home .hero__art img:first-child { right: 0; top: 0; transform: rotate(4deg); }
.mat--home .hero__art img:last-child { left: 0; bottom: 0; transform: rotate(-3deg); }
.mat--home .hero h1 { margin: 0; color: #fbf6ec; font: 400 clamp(2.6rem, 8vw, 6.2rem)/.98 'Crimson Text', Georgia, serif; letter-spacing: -.015em; }
.mat--home .hero__lead { margin: 0; max-width: 54ch; color: var(--mat-ink); font-size: clamp(16px, 2vw, 19px); line-height: 1.6; }
.mat--home .hero__lead a { color: #fff; }
.mat--home .hero__points { list-style: none; padding: 0; margin: 10px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 34px; width: 100%; }
.mat--home .hero__points li { display: grid; gap: 6px; padding-top: 14px; border-top: 2px solid rgba(240,226,204,.22); color: var(--mat-ink); font-size: 14.5px; line-height: 1.5; }
.mat--home .hero__points b { color: #fff; font: 800 15px var(--label); letter-spacing: .03em; }

.mat--home .shelf { max-width: 1240px; margin: 78px auto 0; }
.mat--home .shelf > h2 { margin: 0 0 26px; transform: rotate(-1deg); }
.mat--home .shelf__books { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px; align-items: stretch; }
.mat--home .volume { display: grid; align-content: start; justify-items: start; gap: 12px; padding: 18px 20px 24px; background: var(--paper); color: var(--ink);
  text-decoration: none; box-shadow: 0 1px 1px rgba(0,0,0,.2), 0 18px 28px -12px rgba(0,0,0,.7); transition: transform .2s; }
.mat--home .volume:nth-child(1) { transform: rotate(-.5deg); }
.mat--home .volume:nth-child(2) { transform: rotate(.4deg); }
.mat--home a.volume:hover { transform: rotate(0) translateY(-4px); }
.mat--home .volume img { display: block; width: 100%; height: auto; margin-bottom: 4px; }
.mat--home .volume .dymo { margin-left: -6px; transform: rotate(-1.5deg); }
.mat--home .volume h3 { margin: 0; font: 800 23px/1.15 var(--label); letter-spacing: .02em; }
.mat--home .volume p { margin: 0; font-size: 15px; line-height: 1.55; color: var(--ink-soft); }
.mat--home .volume__cta { margin-top: 4px; font: 800 14px var(--label); letter-spacing: .08em; text-transform: uppercase; color: var(--stamp); border-bottom: 3px solid currentColor; padding-bottom: 2px; }
.mat--home .volume--soon { background: transparent; color: var(--mat-ink); box-shadow: none; border: 2px dashed rgba(240,226,204,.3); }
.mat--home .volume--soon p { color: var(--mat-ink); }
.mat--home .volume--soon h3 { color: #fff; }
/* a stack of unbound signatures waiting for the press */
.mat--home .volume__press { position: relative; width: 100%; aspect-ratio: 520 / 387; margin-bottom: 4px; }
.mat--home .volume__press i { position: absolute; left: 18%; right: 18%; height: 13%; background: #f4efe3; border-radius: 1px;
  box-shadow: 0 2px 0 rgba(0,0,0,.25); }
.mat--home .volume__press i:nth-child(1) { bottom: 10%; transform: rotate(-2deg); }
.mat--home .volume__press i:nth-child(2) { bottom: 23%; transform: rotate(1.5deg); left: 21%; }
.mat--home .volume__press i:nth-child(3) { bottom: 36%; transform: rotate(-1deg); background: #e8dfcb; }
.mat--home .volume__press i:nth-child(4) { bottom: 49%; transform: rotate(2.5deg); left: 16%; }
.mat--home .volume__press i:nth-child(5) { bottom: 62%; transform: rotate(-3deg); left: 24%; right: 22%; background: var(--tape-red); }

/* ---- colophon: the footer on every page ---- */
.mat .colophon { max-width: 1240px; margin: 90px auto 0; padding: 34px 0 10px; border-top: 2px solid var(--mat-line); color: var(--mat-ink); font-size: 14.5px; line-height: 1.55; }
.mat .colophon__inner { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .6fr) minmax(0, 1fr) minmax(0, 1fr); gap: 30px 44px; }
.mat .colophon h2 { margin: 0 0 10px; color: #fff; font: 800 13px var(--label); letter-spacing: .14em; text-transform: uppercase; }
.mat .colophon p { margin: 0 0 8px; }
.mat .colophon__about .brand { margin-bottom: 14px; }
.mat .colophon__quiet { opacity: .7; }
.mat .colophon ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.mat .colophon a { color: #fff; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.mat .colophon__makers a { text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.3); }
.mat .colophon__makers a:hover { border-color: #fff; }
.mat .signup { display: flex; gap: 8px; margin-top: 12px; }
.mat .signup input { flex: 1; min-width: 0; padding: 10px 12px; border: 0; border-radius: 2px; background: var(--paper); color: var(--ink); font: inherit; }
.mat .signup button { padding: 10px 16px; border: 0; border-radius: 2px; background: var(--tape-yellow); color: #2a2410; font: 800 13px var(--label); letter-spacing: .08em; text-transform: uppercase; cursor: pointer; }
.mat .signup button:hover { filter: brightness(1.06); }
.mat .colophon__rights { margin: 34px 0 0; padding-top: 16px; border-top: 1px dashed var(--mat-line); font-size: 13px; opacity: .75; }

@media (max-width: 1100px) { .mat .colophon__inner { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .mat--home .hero, .mat--home .hero__points, .mat--home .shelf__books { grid-template-columns: minmax(0, 1fr); }
  .mat--home .hero__art { grid-column: 1; grid-row: auto; max-width: 460px; }
  .mat .colophon__inner { grid-template-columns: minmax(0, 1fr); }
}

/* landing pages can have long headings: a smaller tape that may wrap */
.mat .top h1.dymo--long { font-size: clamp(1.2rem, 3.3vw, 2.15rem); letter-spacing: .1em; white-space: normal; max-width: 100%; line-height: 1.25; }

/* ---- home: devices, what, how, questions ---- */
.mat--home .sect { max-width: 1240px; margin: 96px auto 0; }
.mat--home .sect > h2 { margin: 0 0 18px; transform: rotate(-1deg); font-size: 1rem; }
.mat--home .sect__lead { margin: 0 0 30px; max-width: 62ch; color: var(--mat-ink); font-size: 16px; line-height: 1.6; }
.mat--home .sect__foot { margin: 18px 0 0; color: var(--mat-ink); font-size: 14.5px; }
.mat--home .sect__foot a { color: #fff; margin-right: 10px; text-underline-offset: 3px; }

.mat--home .devices__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.mat--home .device { background: var(--paper); color: var(--ink); padding: 20px 22px 22px; display: grid; align-content: start; gap: 10px;
  box-shadow: 0 1px 1px rgba(0,0,0,.2), 0 14px 22px -12px rgba(0,0,0,.7); }
.mat--home .device h3 { margin: 0; font: 800 20px/1.2 var(--label); letter-spacing: .02em; }
.mat--home .device > p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--ink-soft); }
.mat--home .device__row { display: grid; gap: 6px; padding-top: 10px; border-top: 1px dashed #c9c3b4; }
.mat--home .device__row b { font: 800 13px var(--label); letter-spacing: .06em; text-transform: uppercase; }
.mat--home .device ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.mat--home .device li a { display: inline-block; padding: 5px 10px; border: 1.5px solid var(--ink); border-radius: 999px; color: var(--ink); text-decoration: none; font-size: 13px; }
.mat--home .device li a:hover { background: var(--ink); color: var(--paper); }

.mat--home .what__cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px; }
.mat--home .what__col { background: var(--paper); color: var(--ink); padding: 24px 26px 26px; display: grid; align-content: start; justify-items: start; gap: 14px;
  box-shadow: 0 1px 1px rgba(0,0,0,.2), 0 14px 22px -12px rgba(0,0,0,.7); }
.mat--home .what__col h3 { margin: 0; font: 800 22px/1.2 var(--label); }
.mat--home .what__col h3 a { color: inherit; text-decoration: none; }
.mat--home .what__col ul { margin: 0; padding-left: 1.2em; display: grid; gap: 8px; font-size: 14.5px; line-height: 1.5; }
.mat--home .what__col li::marker { color: var(--stamp); }

.mat--home .how__steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.mat--home .how__steps li { counter-increment: step; display: grid; align-content: start; gap: 8px; color: var(--mat-ink); font-size: 14.5px; line-height: 1.55; }
.mat--home .how__steps li::before { content: counter(step); display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--tape-yellow); color: #2a2410; font: 800 18px var(--label); }
.mat--home .how__steps b { color: #fff; font: 800 17px var(--label); }

.mat--home .faq__list { display: grid; gap: 10px; max-width: 900px; }
.mat--home .faq details { background: var(--paper); color: var(--ink); padding: 0 22px; box-shadow: 0 1px 1px rgba(0,0,0,.2), 0 10px 16px -10px rgba(0,0,0,.6); }
.mat--home .faq summary { cursor: pointer; padding: 16px 0; font: 800 16px/1.35 var(--label); letter-spacing: .01em; list-style: none; display: flex; justify-content: space-between; gap: 16px; text-decoration: none; }
.mat--home .faq summary::-webkit-details-marker { display: none; }
.mat--home .faq summary::after { content: '+'; color: var(--stamp); font-size: 22px; line-height: 1; }
.mat--home .faq details[open] summary::after { content: '–'; }
.mat--home .faq details p { margin: 0 0 18px; font-size: 15px; line-height: 1.6; color: var(--ink-soft); max-width: 70ch; }

@media (max-width: 1000px) {
  .mat--home .devices__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mat--home .how__steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .mat--home .devices__grid, .mat--home .what__cols, .mat--home .how__steps { grid-template-columns: minmax(0, 1fr); }
  .mat--home .sect { margin-top: 70px; }
}

/* ---- newsletter form extras, and the thank-you sheet after a download (pages/_after.html.erb) ---- */
.signup { flex-wrap: wrap; }
.signup__trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.signup__note { flex-basis: 100%; margin: 6px 0 0; min-height: 1.3em; font-size: 14px; }
.signup--done .signup__note { font-weight: 700; }
.after { position: fixed; inset: 0; margin: auto; height: fit-content; width: min(480px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto; padding: 30px 30px 18px; border: 0; border-radius: 4px;
  background: var(--paper); color: var(--ink); box-shadow: 0 30px 80px rgba(0,0,0,.45); }
.after::backdrop { background: rgba(20, 16, 12, .62); }
.after[open] { animation: after-in .28s ease-out; }
@keyframes after-in { from { opacity: 0; transform: translateY(14px) scale(.98); } }
@media (prefers-reduced-motion: reduce) { .after[open] { animation: none; } }
@media (max-width: 500px) { .after { padding: 26px 20px 14px; } .after__title { font-size: 21px; } }
.after__close { position: absolute; top: 8px; right: 10px; width: 36px; height: 36px; border: 0; background: none; color: inherit; font-size: 26px; line-height: 1; cursor: pointer; opacity: .6; }
.after__close:hover { opacity: 1; }
.after__title { margin: 0 0 6px; font: 800 24px/1.15 var(--label, inherit); letter-spacing: .01em; }
.after__lead { margin: 0 0 20px; }
.after__news, .after__coffee { padding: 16px 0; border-top: 1px dashed rgba(0,0,0,.2); }
.after__news h3 { margin: 0 0 4px; font-size: 16px; }
.after__news p { margin: 0; font-size: 15px; }
.after .signup input { flex: 1 1 200px; border: 1px solid rgba(0,0,0,.25); background: #fff; color: var(--ink); }
.after .signup button { flex: 1 0 auto; }
.after :focus:not(:focus-visible) { outline: none; }
.after .signup button { background: var(--ink); color: var(--paper); }
.after__coffee p { margin: 0 0 12px; font-size: 15px; }
.after__coffee .coffee-link { display: flex; width: fit-content; margin: 0 auto; font-size: 17px; padding: 12px 22px; }
.after__later { display: block; margin: 6px auto 0; border: 0; background: none; color: inherit; opacity: .6; text-decoration: underline; cursor: pointer; font: inherit; font-size: 14px; }

/* the newsletter button: beside the coffee button in the masthead, and on the home page's "more on the press" card */
.news-link { display: inline-flex; align-items: center; gap: 8px; padding: 9px 15px 9px 12px; border-radius: 999px; border: 2px solid currentColor;
  color: var(--paper); font: 800 14px var(--label, inherit); letter-spacing: .02em; text-decoration: none; white-space: nowrap; }
.news-link:hover { background: rgba(255,255,255,.1); }
.mat a.news-link { color: var(--paper); text-decoration: none; }
.mat .masthead .news-link { margin-left: 0; }
.mat a.news-link--card { margin-top: 14px; padding: 11px 18px 11px 14px; border-color: var(--paper); background: var(--paper); color: var(--ink); font-size: 15px; }
.mat a.news-link--card:hover { background: #fff; }
.after--news .signup { margin-top: 4px; }
@media (max-width: 560px) { .news-link--top span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } .news-link--top { padding: 9px 11px; } }

/* while a signup is on its way: the button keeps its size, its label gives way to a spinner */
.signup button { position: relative; }
.signup--busy button { color: transparent !important; cursor: progress; }
.signup--busy button::after { content: ""; position: absolute; inset: 0; margin: auto; width: 16px; height: 16px; border-radius: 50%;
  border: 2.5px solid currentColor; border-color: #2a2410 #2a2410 transparent transparent; animation: signup-spin .7s linear infinite; }
.after .signup--busy button::after { border-color: var(--paper) var(--paper) transparent transparent; }
@keyframes signup-spin { to { transform: rotate(1turn); } }
@media (prefers-reduced-motion: reduce) { .signup--busy button::after { animation-duration: 2s; } }
